query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
look through all files found in crawl for CSS files and parse them for images
private function parseCSS(){ // collect all unique values from the arrays in $links $css_links = array(); foreach ($this->links as $key => $paths) { foreach ($paths as $key => $value) { $css_links[] = $value; } } $css_links = array_unique($css_links); sort($css_links); // loop through all values look for files foreach ($css_links as $value) { if(count(explode('.', $value)) > 1){ $temp = explode('.', $value); $qry = false; // if a file is found, see if it has a querystring foreach ($temp as $key => $css) { if(count(explode('?', $css)) > 1){ $temp[$key] = explode('?', $css); $qry = $key; } } // if it has a query string, remove it if($qry){ $type = $temp[$qry][0]; // otherwise, just grab the extension } else { $type = count($temp); $type = $temp[$type-1]; } // check if the file extension is css if($type === 'css'){ // ensure path to file exists $path = 'http://'.$this->url.$value; if(@file_get_contents($path)){ // add file to $visited $this->visited[] = $value; // set current path for relativePathFiX() $dir = explode('/', $value); array_pop($dir); $this->current_path = implode('/', $dir).'/'; // open the file to start parsing $file = file_get_contents($path); $imgs = array(); // find all occurrences of the url() method used to include images preg_match_all("%.*url\('*(.*)[^\?]*\).*\)*%", $file, $matches); // loop through occurrences foreach ($matches[1] as $key => $img) { // check if a query string is attached to the image (used to prevent caching) if(count(explode('?', $img)) > 1){ // if there is, remove it and fix the path $temp = explode('?', $img); $imgs[] = $this->relativePathFix($temp[0]); } else { // if there isn't a query string, make sure to remove the closing bracket $temp = explode(')', $img); $imgs[] = $this->relativePathFix($temp[0]); } } // if images were found, add them to $links if(count($imgs) > 0){ $this->links[$value] = $imgs; } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findCssFiles();", "private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n $sImgUrl = PH7_URL_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n\n if ($this->isDataUriEligible($sImgPath)) {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . Optimization::dataUri($sImgPath, $this->oFile) . ')',\n $this->sContents\n );\n } else {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . $sImgUrl . ')',\n $this->sContents\n );\n }\n }\n }", "function allLoadCss($path){\n \n $diretorio = dir($path);\n\n while($arquivo = $diretorio -> read()){\n //verifica apenas as extenções do css \n if(strpos($arquivo, '.css')!==FALSE)\n echo (\"<link rel='stylesheet' href='\".BARRA.url_base.BARRA.$path.$arquivo.\"' type='text/css' />\\n\");\n }\n $diretorio -> close();\n\n }", "function ReadCSS($html)\n{\n//! @desc CSS parser\n//! @return string\n\n/*\n* This version ONLY supports: .class {...} / #id { .... }\n* It does NOT support: body{...} / a#hover { ... } / p.right { ... } / other mixed names\n* This function must read the CSS code (internal or external) and order its value inside $this->CSS. \n*/\n\n\t$match = 0; // no match for instance\n\t$regexp = ''; // This helps debugging: showing what is the REAL string being processed\n\t\n\t//CSS inside external files\n\t$regexp = '/<link rel=\"stylesheet\".*?href=\"(.+?)\"\\\\s*?\\/?>/si'; \n\t$match = preg_match_all($regexp,$html,$CSSext);\n $ind = 0;\n\n\twhile($match){\n //Fix path value\n $path = $CSSext[1][$ind];\n $path = str_replace(\"\\\\\",\"/\",$path); //If on Windows\n //Get link info and obtain its absolute path\n $regexp = '|^./|';\n $path = preg_replace($regexp,'',$path);\n if (strpos($path,\"../\") !== false ) //It is a Relative Link\n {\n $backtrackamount = substr_count($path,\"../\");\n $maxbacktrack = substr_count($this->basepath,\"/\") - 1;\n $filepath = str_replace(\"../\",'',$path);\n $path = $this->basepath;\n //If it is an invalid relative link, then make it go to directory root\n if ($backtrackamount > $maxbacktrack) $backtrackamount = $maxbacktrack;\n //Backtrack some directories\n for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,\"/\") );\n $path = $path . \"/\" . $filepath; //Make it an absolute path\n }\n elseif( strpos($path,\":/\") === false) //It is a Local Link\n {\n $path = $this->basepath . $path; \n }\n //Do nothing if it is an Absolute Link\n //END of fix path value\n $CSSextblock = file_get_contents($path);\t\n\n //Get class/id name and its characteristics from $CSSblock[1]\n\t $regexp = '/[.# ]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n\t preg_match_all( $regexp, $CSSextblock, $extstyle);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($extstyle[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $extstyle[2][$i], $extstyleinfo);\n \t\t$extproperties = $extstyleinfo[1];\n \t\t$extvalues = $extstyleinfo[2];\n \t\tfor($j = 0; $j < count($extproperties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$extclassproperties[strtoupper($extproperties[$j])] = trim($extvalues[$j]);\n \t\t}\n \t\t$this->CSS[$extstyle[1][$i]] = $extclassproperties;\n\t \t$extproperties = array();\n \t\t$extvalues = array();\n \t\t$extclassproperties = array();\n \t}\n\t $match--;\n\t $ind++;\n\t} //end of match\n\n\t$match = 0; // reset value, if needed\n\n\t//CSS internal\n\t//Get content between tags and order it, using regexp\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$match = preg_match($regexp,$html,$CSSblock);\n\n\tif ($match) {\n \t//Get class/id name and its characteristics from $CSSblock[1]\n \t$regexp = '/[.#]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n \tpreg_match_all( $regexp, $CSSblock[1], $style);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($style[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $style[2][$i], $styleinfo);\n \t\t$properties = $styleinfo[1];\n \t\t$values = $styleinfo[2];\n \t\tfor($j = 0; $j < count($properties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$classproperties[strtoupper($properties[$j])] = trim($values[$j]);\n \t\t}\n \t\t$this->CSS[$style[1][$i]] = $classproperties;\n \t\t$properties = array();\n \t\t$values = array();\n \t\t$classproperties = array();\n \t}\n\t} // end of match\n\n\t//Remove CSS (tags and content), if any\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$html = preg_replace($regexp,'',$html);\n\n \treturn $html;\n}", "protected function ParseCSSFile()\n {\n $this->_stylelist=$this->BuildStyleList($this->FileName, $this->_inclstandard, $this->_inclid, $this->_incsubstyle);\n }", "public function css()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n $files = $dir->scanRecursive(\"*.css\");\n\n echo \"\\nMinifying Css Files...\\n\";\n foreach($files as $sourceFile)\n {\n // Skip all foo.#.js (e.g foo.52.js) which are files from a previous build\n if (is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)))\n continue;\n\n /**\n * @var $destFile \\Ninja\\File\n */\n $destFile = $sourceFile->getParent()->ensureFile($sourceFile->getName(true) . '.' . self::REVISION . '.' . $sourceFile->getExtension());\n\n $destFile->write(\\Minify_Css::process($sourceFile->read()));\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n\n unset($sourceFile);\n }\n }", "function get_the_css_urls() {\n\n md_get_the_css_urls();\n \n }", "protected function getContentCssFileNames() {}", "protected function loadCss() {}", "public function getCSSFiles() {\n //je krijgt op het einde .. en . terug, deze mag je niet opnemen in je links\n $cssFiles = scandir(\"css\", 1);\n \n return $cssFiles;\n }", "function get_css_files() {\n\t$csslist = array();\n\n\t// List pfSense files, then any BETA files followed by any user-contributed files\n\t$cssfiles = glob(\"/usr/local/www/css/*.css\");\n\n\tif (is_array($cssfiles)) {\n\t\tarsort($cssfiles);\n\t\t$usrcss = $pfscss = $betacss = array();\n\n\t\tforeach ($cssfiles as $css) {\n\t\t\t// Don't display any login/logo page related CSS files\n\t\t\tif (strpos($css, \"login\") == 0 &&\n\t\t\t strpos($css, \"logo\") == 0) {\n\t\t\t\tif (strpos($css, \"BETA\") != 0) {\n\t\t\t\t\tarray_push($betacss, $css);\n\t\t\t\t} else if (strpos($css, \"pfSense\") != 0) {\n\t\t\t\t\tarray_push($pfscss, $css);\n\t\t\t\t} else {\n\t\t\t\t\tarray_push($usrcss, $css);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$css = array_merge($pfscss, $betacss, $usrcss);\n\n\t\tforeach ($css as $file) {\n\t\t\t$file = basename($file);\n\t\t\t$csslist[$file] = pathinfo($file, PATHINFO_FILENAME);\n\t\t}\n\t}\n\treturn $csslist;\n}", "public function crawl(){\n\t\t\t$this->collectUrls();\n\t\t}", "protected function compileCss() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function crawl(){\n\t\t// check if path is allowed by robots.txt\n\t\tif(!$this->robot || $this->robot->crawlAllowed($this->pages[0])){\n\t\t\t// set the file path, extract directory structure, open file\n\t\t\t$path = 'http://'.$this->url.$this->pages[0];\n\t\t\t$this->setCurrentPath();\n\t\t\t$this->doc->loadHTMLFile($path);\n\t\t\t\n\t\t\t// find all <a> tags in the page\n\t\t\t$a_tags = $this->doc->getElementsByTagName('a');\n\t\t\t$link_tags = $this->doc->getElementsByTagName('link');\n\t\t\t$script_tags = $this->doc->getElementsByTagName('script');\n\t\t\t$img_tags = $this->doc->getElementsByTagName('img');\n\t\t\t$form_tags = $this->doc->getElementsByTagName('form');\n\t\t\t// if <a> tags were found, loop through all of them\n\t\t\tif(isset($a_tags) && !is_null($a_tags)){\n\t\t\t\tforeach ($a_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\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\t// if <link> tags were found, loop through all of them\n\t\t\tif(isset($link_tags) && !is_null($link_tags)){\n\t\t\t\tforeach ($link_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\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\t// if <script> tags were found, loop through all of them\n\t\t\tif(isset($script_tags) && !is_null($script_tags)){\n\t\t\t\tforeach ($script_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\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\t// if <img> tags were found, loop through all of them\n\t\t\tif(isset($img_tags) && !is_null($img_tags)){\n\t\t\t\tforeach ($img_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\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\t// if <form> tags were found, loop through all of them\n\t\t\tif(isset($forms_tags) && !is_null($form_tags)){\n\t\t\t\tforeach ($form_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'action'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\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\t\t// merge and sort all arrays\n\t\t$this->arrayShuffle();\n\t}", "protected function doCompressCss() {}", "function ReadCSS($html)\r\n{\r\n//! @desc CSS parser\r\n//! @return string\r\n\r\n/*\r\n* This version ONLY supports: .class {...} / #id { .... }\r\n* It does NOT support: body{...} / a#hover { ... } / p.right { ... } / other mixed names\r\n* This function must read the CSS code (internal or external) and order its value inside $this->CSS. \r\n*/\r\n\r\n\t$match = 0; // no match for instance\r\n\t$regexp = ''; // This helps debugging: showing what is the REAL string being processed\r\n\t\r\n\t//CSS external\r\n\t$regexp = '/<link rel=\"stylesheet\".*?href=\"(.+?)\"\\\\s*?\\/?>/si';\r\n\t$match = preg_match_all($regexp,$html,$CSSext);\r\n $ind = 0;\r\n\r\n\twhile($match) {\r\n\t$file = fopen($CSSext[1][$ind],\"r\");\r\n\t$CSSextblock = fread($file,filesize($CSSext[1][$ind]));\r\n\tfclose($file);\r\n\r\n\t//Get class/id name and its characteristics from $CSSblock[1]\r\n\t$regexp = '/[.# ]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\r\n\tpreg_match_all( $regexp, $CSSextblock, $extstyle);\r\n\r\n\t//Make CSS[Name-of-the-class] = array(key => value)\r\n\t$regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\r\n\r\n\tfor($i=0; $i < count($extstyle[1]) ; $i++)\r\n\t{\r\n\t\tpreg_match_all( $regexp, $extstyle[2][$i], $extstyleinfo);\r\n\t\t$extproperties = $extstyleinfo[1];\r\n\t\t$extvalues = $extstyleinfo[2];\r\n\t\tfor($j = 0; $j < count($extproperties) ; $j++) \r\n\t\t{\r\n\t\t\t//Array-properties and Array-values must have the SAME SIZE!\r\n\t\t\t$extclassproperties[strtoupper($extproperties[$j])] = trim($extvalues[$j]);\r\n\t\t}\r\n\t\t$this->CSS[$extstyle[1][$i]] = $extclassproperties;\r\n\t\t$extproperties = array();\r\n\t\t$extvalues = array();\r\n\t\t$extclassproperties = array();\r\n\t}\r\n\t$match--;\r\n\t$ind++;\r\n\t} //end of match\r\n\r\n\t$match = 0; // reset value, if needed\r\n\r\n\t//CSS internal\r\n\t//Get content between tags and order it, using regexp\r\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\">\r\n\t$match = preg_match($regexp,$html,$CSSblock);\r\n\r\n\tif ($match) {\r\n\t//Get class/id name and its characteristics from $CSSblock[1]\r\n\t$regexp = '/[.#]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\r\n\tpreg_match_all( $regexp, $CSSblock[1], $style);\r\n\r\n\t//Make CSS[Name-of-the-class] = array(key => value)\r\n\t$regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\r\n\r\n\tfor($i=0; $i < count($style[1]) ; $i++)\r\n\t{\r\n\t\tpreg_match_all( $regexp, $style[2][$i], $styleinfo);\r\n\t\t$properties = $styleinfo[1];\r\n\t\t$values = $styleinfo[2];\r\n\t\tfor($j = 0; $j < count($properties) ; $j++) \r\n\t\t{\r\n\t\t\t//Array-properties and Array-values must have the SAME SIZE!\r\n\t\t\t$classproperties[strtoupper($properties[$j])] = trim($values[$j]);\r\n\t\t}\r\n\t\t$this->CSS[$style[1][$i]] = $classproperties;\r\n\t\t$properties = array();\r\n\t\t$values = array();\r\n\t\t$classproperties = array();\r\n\t}\r\n\r\n\t} // end of match\r\n\r\n //print_r($this->CSS);// Important debug-line!\r\n\r\n\t//Remove CSS (tags and content), if any\r\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\">\r\n\t$html = preg_replace($regexp,'',$html);\r\n\r\n \treturn $html;\r\n}", "protected function _getFromCSS()\n {\n // styles to apply\n $styles = array();\n\n // list of the selectors to get in the CSS files\n $getit = array();\n\n // get the list of the selectors of each tags\n $lst = array();\n $lst[] = $this->value['id_lst'];\n for ($i=count($this->table)-1; $i>=0; $i--) {\n $lst[] = $this->table[$i]['id_lst'];\n }\n\n // foreach selectors in the CSS files, verify if it match with the list of selectors\n foreach ($this->cssKeys as $key => $num) {\n if ($this->_getReccursiveStyle($key, $lst)) {\n $getit[$key] = $num;\n }\n }\n\n // if we have selectors\n if (count($getit)) {\n // get them, but in the definition order, because of priority\n asort($getit);\n foreach ($getit as $key => $val) $styles = array_merge($styles, $this->css[$key]);\n }\n\n return $styles;\n }", "protected function pvs_fetch_css($strextraction,&$strouthtml, $iscss, $cssfile=''){\n\t\tif (($this->selectedpics < $this->conf['attachments.']['webpagePreviewNumberOfImages']) || ($this->logofound == FALSE)) {\n\t\t\t$strouthtml.='<div class=\"cssfiles\">';\n\t\t\t$cssfiles = array();\n\t\t\t$k = 0;\n\t\t\t$strouthtmlcss= array();\n\t\t\t$cssfilerelpath='';\n\t\t\tif ($iscss==TRUE) {\n\t\t\t\t$cssfilebits=explode('/', $cssfile);\n\t\t\t\t$cssfilebits[count($cssfilebits)-1] = '';\n\t\t\t\t$cssfilepath=implode('/', $cssfilebits);\n\t\t\t\t$cssfilerelpatharr=explode('/', $cssfilepath);\n\t\t\t\t$cssfilerelpatharr[0]='';\n\t\t\t\t$cssfilerelpath='';\n\t\t\t\t$sizeofcssfilerelpatharr=sizeof($cssfilerelpatharr);\n\t\t\t\tfor($i = 0; $i < $sizeofcssfilerelpatharr; $i++) {\n\n\t\t\t\t\tif (($cssfilerelpatharr[$i] !='') && ($cssfilerelpatharr[$i] !=$this->urlsitestr)) {\n\t\t\t\t\t\t$cssfilerelpath.=$cssfilerelpatharr[$i].'/';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$cssfilepath=$this->urlhomearrstr;\n\t\t\t}\n\n\t\t\t// handling of redirected subdirs\n\t\t\tif ($this->urlsubpath!=''){\n\t\t\t\tif (strpos($cssfilepath, $this->urlsubpath)===FALSE) {\n\t\t\t\t\t$cssfilepath=$cssfilepath . $this->urlsubpath;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// handling of redirected subdirs end\n\n\t\t\t// fetch css\n\t\t\t$css_regex = '/import[^;]*' . 'url\\([\\\"|\\'](.*)[\\\"|\\']/Ui';\n\t\t\tpreg_match_all($css_regex, $strextraction, $cssarr, PREG_PATTERN_ORDER);\n\t\t\t$css_array = $cssarr[1];\n\t\t\t$sizeofcss_array=sizeof($css_array);\n\t\t\tfor($i = 0; $i < $sizeofcss_array; $i++) {\n\t\t\t\tif ($css_array[$i]) {\n\t\t\t\t\tif (substr($css_array[$i], 0, 1)=='/') {\n\t\t\t\t\t\t$css_array[$i]=trim(substr($css_array[$i], 1, 2000));\n\t\t\t\t\t}\n\n\t\t\t\t\t$css_arraybits=explode('.', $css_array[$i]);\n\t\t\t\t\tif ($css_arraybits[count($css_arraybits)-1]=='css') {\n\t\t\t\t\t\tif (strstr($css_array[$i], 'http')) {\n\t\t\t\t\t\t\t$strouthtmlcss[$k]='<p id=\"css'. $k . '\">' . $css_array[$i] . '</p>';\n\t\t\t\t\t\t\t$cssfiles[$k]=$css_array[$i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$css_array[$i]=str_replace($cssfilerelpath, '', $css_array[$i]);\n\t\t\t\t\t\t\t$strouthtmlcss[$k]='<p id=\"css'. $k . '\">' . $cssfilepath . $css_array[$i] . '</p>';\n\t\t\t\t\t\t\t$cssfiles[$k]=$cssfilepath . $css_array[$i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$sizeofcss_array=sizeof($css_array);\n\t\t\t}\n \t\t$css_regex = '/<link[^>]*' . 'href=[\\\"|\\'](.*)[\\\"|\\']/Ui';\n\t\t\tpreg_match_all($css_regex, $strextraction, $cssarr, PREG_PATTERN_ORDER);\n\t\t\t$css_array = $cssarr[1];\n\t\t\t$sizeofcss_array2=sizeof($css_array);\n\t\t\tfor($i = 0; $i < $sizeofcss_array2; $i++) {\n\t\t\t\tif ($css_array[$i]) {\n\t\t\t\t\tif (substr($css_array[$i], 0, 1)=='/') {\n\t\t\t\t\t\t$css_array[$i]=trim(substr($css_array[$i], 1, 2000));\n\t\t\t\t\t}\n\n\t\t\t\t\t$css_arraybits=explode('.', $css_array[$i]);\n\t\t\t\t\tif ($css_arraybits[count($css_arraybits)-1]=='css') {\n\t\t\t\t\t\tif (strstr($css_array[$i], 'http')) {\n\t\t\t\t\t\t\t$strouthtmlcss[$k]='<p id=\"css'. $k . '\">' . $css_array[$i] . '</p>';\n\t\t\t\t\t\t\t$cssfiles[$k]=$css_array[$i];\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$css_array[$i]=str_replace($cssfilerelpath, '', $css_array[$i]);\n\t\t\t\t\t\t\t$strouthtmlcss[$k]='<p id=\"css'. $k . '\">' . $cssfilepath . $css_array[$i] . '</p>';\n\t\t\t\t\t\t\t$cssfiles[$k]=$cssfilepath . $css_array[$i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$sizeofcss_array2=sizeof($css_array);\n\t\t\t}\n\n\t\t\t$sizeofcssfiles=sizeof($cssfiles);\n\t\t\tfor($i = 0; $i < $sizeofcssfiles; $i++) {\n\t\t\t\tif (array_search($cssfiles[$i], $this->css_array) ==FALSE ) {\n\t\t\t\t\tif (($this->selectedpics < $this->conf['attachments.']['webpagePreviewNumberOfImages']) || ($this->logofound == FALSE)) {\n\t\t\t\t\t\t$htmlcss = $this->file_pvs_get_contents_curl($cssfiles[$i], 'css');\n\t\t\t\t\t\tif ($htmlcss != FALSE) {\n\t\t\t\t\t\t\t$images_arraycss=$this->pvs_fetch_images ($htmlcss, TRUE, $cssfiles[$i]);\n\t\t\t\t\t\t\t$this->images_array=array_merge($this->images_array, $images_arraycss);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$i=999999;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$sizeofcssfiles=sizeof($cssfiles);\n\t\t\t}\n\n\t\t\t$strouthtml.= '</div>';\n\t\t\treturn $cssfiles;\n\t\t}\n\n\t}", "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "function css($filename){\n\t\t// If its an array we have to load separately.\n\t\tif(is_array($filename)){\n\t\t\tforeach($filename as $file){\n\t\t\t\t// Calls recursively this function for each file\n\t\t\t\t// on the received array.\n\t\t\t\t$this->css($file);\n\t\t\t}\n\t\t} else {\n\t\t\tif($file = $this->_has_extension($filename)){\n\t\t\t\tarray_pop($file);\n\t\t\t\t$this->css[] = implode('.', $file);\n\t\t\t} else {\n\t\t\t\t$this->css[] = $filename;\n\t\t\t}\n\t\t}\n\t}", "function get_css_files_media_array();", "static public function extract_css( $content ) {\n\t\t$content = preg_replace( '~<!--.*?-->~s', '', $content );\n\n\t\t$tags_files = array();\n\n\t\t$matches = null;\n\t\tif ( preg_match_all( '~<link\\s+([^>]+)/?>(.*</link>)?~Uis', $content,\n\t\t\t\t$matches, PREG_SET_ORDER ) ) {\n\t\t\tforeach ( $matches as $match ) {\n\t\t\t\t$attrs = array();\n\t\t\t\t$attr_matches = null;\n\t\t\t\tif ( preg_match_all( '~(\\w+)=[\"\\']([^\"\\']*)[\"\\']~', $match[1],\n\t\t\t\t\t\t$attr_matches, PREG_SET_ORDER ) ) {\n\t\t\t\t\tforeach ( $attr_matches as $attr_match ) {\n\t\t\t\t\t\t$attrs[$attr_match[1]] = trim( $attr_match[2] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $attrs['href'] ) && isset( $attrs['rel'] ) &&\n\t\t\t\t\tstristr( $attrs['rel'], 'stylesheet' ) !== false &&\n\t\t\t\t\t( !isset( $attrs['media'] ) || stristr( $attrs['media'], 'print' ) === false ) ) {\n\t\t\t\t\t$tags_files[] = array( $match[0], $attrs['href'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif ( preg_match_all( '~@import\\s+(url\\s*)?\\(?[\"\\']?\\s*([^\"\\'\\)\\s]+)\\s*[\"\\']?\\)?[^;]*;?~is',\n\t\t\t\t$content, $matches, PREG_SET_ORDER ) ) {\n\t\t\tforeach ( $matches as $match )\n\t\t\t\t$tags_files[] = array( $match[0], $match[2] );\n\t\t}\n\n\t\treturn $tags_files;\n\t}", "private function maybe_parse_set_from_css() {\n\n\t\t\tif ( true !== $this->settings['auto_parse'] || empty( $this->settings['icon_data']['icon_css'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\t$path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $this->settings['icon_data']['icon_css'] );\n\t\t\tif ( file_exists( $path ) ) {\n\t\t\t\tinclude $path;\n\t\t\t}\n\n\t\t\t$result = ob_get_clean();\n\n\t\t\tpreg_match_all( '/\\.([-_a-zA-Z0-9]+):before[, {]/', $result, $matches );\n\n\t\t\tif ( ! is_array( $matches ) || empty( $matches[1] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( is_array( $this->settings['icon_data']['icons'] ) ) {\n\t\t\t\t$this->settings['icon_data']['icons'] = array_merge(\n\t\t\t\t\t$this->settings['icon_data']['icons'],\n\t\t\t\t\t$matches[1]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->settings['icon_data']['icons'] = $matches[1];\n\t\t\t}\n\n\t\t}", "public function addCSSFiles($css /* array */);", "private function pvs_fetch_images($strextraction, $iscss, $cssfile=''){\n\t\t// fetch images\n\t\t$this->idcounter +=1;\n\t\t$img=array();\n\t\tif ($iscss==TRUE) {\n\t\t\t$img[1]=array();\n\t\t\t$strextractionarr= explode('url(', $strextraction);\n\t\t\t$j=0;\n\t\t\t$countstrextractionarr = count($strextractionarr);\n\t\t\tif ($countstrextractionarr > 0) {\n\t\t\t\tfor($i = 1; $i < $countstrextractionarr; $i++) {\n\t\t\t\t\t$strextractionarr2= explode(')', $strextractionarr[$i]);\n\t\t\t\t\t$strextractionarrcand=$strextractionarr2[0];\n\t\t\t\t\t$strextractionarrcand=str_replace('\"', '', $strextractionarrcand);\n\t\t\t\t\t$strextractionarrcand=str_replace(\"'\", '', $strextractionarrcand);\n\t\t\t\t\tif (!strstr($strextractionarrcand, '.css'))\t{\n\t\t\t\t\t\t$img[1][$j]=$strextractionarrcand;\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$cssfilebits=explode('/', $cssfile);\n\t\t\t$cssfilebits[count($cssfilebits)-1] = '';\n\t\t\t$cssfilepath=implode('/', $cssfilebits);\n\t\t\t$cssfilerelpatharr=explode('/', $cssfilepath);\n\t\t\t$cssfilerelpatharr[0]='';\n\t\t\t$cssfilerelpath='';\n\t\t\t$sizeofcssfilerelpatharr=sizeof($cssfilerelpatharr);\n\t\t\tfor($i = 0; $i < $sizeofcssfilerelpatharr; $i++) {\n\t\t\t\tif (($cssfilerelpatharr[$i] !='') && ($cssfilerelpatharr[$i] !=$this->urlsitestr)) {\n\t\t\t\t\t$cssfilerelpath.=$cssfilerelpatharr[$i].'/';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\t$image_regex = '/<img[^>]*' . 'src=[\\\"|\\'](.*)[\\\"|\\']/Ui';\n\t\t\t$cssfilepath='';\n\t\t\tpreg_match_all($image_regex, $strextraction, $img, PREG_PATTERN_ORDER);\n\t\t}\n\n\t\t// handling of redirected subdirs\n\t\tif ($this->urlsubpath!=''){\n\t\t\tif (strpos($cssfilepath, $this->urlsubpath)===FALSE) {\n\t\t\t\t$cssfilepath=$cssfilepath . $this->urlsubpath;\n\t\t\t}\n\n\t\t}\n\n\t\t// handling of redirected subdirs end\n\t\t$images_array = array();\n\t\t$j = 0;\n\t\t$countimg1=count($img[1]);\n\t\tfor($i = 0; $i < $countimg1; $i++) {\n\t\t\tif (!strstr($img[1][$i], '.css'))\t{\n\t\t\t\t$imgfilenamearr= explode('/', $img[1][$i]);\n\t\t\t\t$imgfilename=$imgfilenamearr[count($imgfilenamearr)-1];\n\t\t\t\t$imgfilenamearr= explode('.', $imgfilename);\n\t\t\t\t$imgfilename=$imgfilenamearr[0];\n\n\t\t\t\t$hit=$this->checkimagepattern($imgfilename);\n\t\t\t\tif ($hit<2) {\n\t\t\t\t\t$images_array[$j] =$img[1][$i];\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t$images_arrayout = array();\n\n\t\t$images_array_unique=array_unique($images_array);\n\t\t$k = 1;\n\t\tif (($this->selectedpics < $this->conf['attachments.']['webpagePreviewNumberOfImages']) || ($this->logofound == FALSE)) {\n\t\t\t$countimages_array=count($images_array);\n\t\t\tfor($i = 0; $i < $countimages_array; $i++) {\n\n\t\t\t\tif (isset($images_array_unique[$i])) {\n\t\t\t\t\tif ($images_array_unique[$i] != '') {\n\t\t\t\t\t\tif (strstr($images_array_unique[$i], 'http')) {\n\t\t\t\t\t\t\t$images_arrayout[$i]=$images_array_unique[$i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($iscss==TRUE) {\n\t\t\t\t\t\t\t\t$images_array_unique[$i]=str_replace($cssfilerelpath, '', $images_array_unique[$i]);\n\t\t\t\t\t\t\t\tif (substr($images_array_unique[$i], 0, 1)=='/') {\n\t\t\t\t\t\t\t\t\t$images_arrayout[$i]=$this->urlhomearrstr . $images_array_unique[$i];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$images_arrayout[$i]=$cssfilepath . $images_array_unique[$i];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// handling of redirected subdirs\n\t\t\t\t\t\t\t\tif ($this->urlsubpath!=''){\n\t\t\t\t\t\t\t\t\tif (strpos(($this->urlhomearrstr . $images_array_unique[$i]), $this->urlsubpath)===FALSE) {\n\t\t\t\t\t\t\t\t\t\t$cssfilepath=$this->urlhomearrstr . $this->urlsubpath . $images_array_unique[$i];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$cssfilepath=$this->urlhomearrstr . $images_array_unique[$i];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$cssfilepath=$this->urlhomearrstr . $images_array_unique[$i];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// handling of redirected subdirs end\n\t\t\t\t\t\t\t\t$images_arrayout[$i]=$cssfilepath;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cssfilebits=explode('.', $images_arrayout[$i]);\n\t\t\t\t\t\t$extpic = $cssfilebits[count($cssfilebits)-1];\n\t\t\t\t\t\t$arrwrk = array();\n\t\t\t\t\t\t$arrwrk=explode('//', $images_arrayout[$i]);\n\t\t\t\t\t\tif (count($arrwrk)>1) {\n\t\t\t\t\t\t\t$arrwrkout='';\n\t\t\t\t\t\t\t$countarrwrk=count($arrwrk);\n\t\t\t\t\t\t\tfor($i2 = 0; $i2 < $countarrwrk; $i2++) {\n\t\t\t\t\t\t\t\tif ($i2==0) {\n\t\t\t\t\t\t\t\t\t$arrwrkout=$arrwrk[$i2] . '//';\n\t\t\t\t\t\t\t\t} elseif ($i2==count($arrwrk)-1) {\n\t\t\t\t\t\t\t\t\t$arrwrkout .=$arrwrk[$i2];\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t$arrwrkout .=$arrwrk[$i2] . '/';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$images_arrayout[$i]=$arrwrkout;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$filename=$this->saveAndResize($images_arrayout[$i], 50, 50, '/' . $this->savepath .'temp/temp .' . $extpic, $extpic);\n\n\t\t\t\t\t\tif ($filename) {\n\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->totalpicscans +=1;\n\t\t\t\t\t\tif (($this->selectedpics > $this->conf['attachments.']['webpagePreviewNumberOfImages']) && (($this->logofound == TRUE) ||\n\t\t\t\t\t\t\t\t(($this->selectedpics > $this->conf['attachments.']['webpagePreviewNumberOfImages']) && ($this->logofound == FALSE) &&\n\t\t\t\t\t\t\t\t\t\t($this->totalpicscans > $this->conf['attachments.']['webpagePreviewScanMaxImageScan'])))) {\n\t\t\t\t\t\t\tif ($this->totalpicscans > $this->conf['attachments.']['webpagePreviewScanMaxImageScansForLogo']) {\n\t\t\t\t\t\t\t\t$i=999999;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->totalpicscans > $this->conf['attachments.']['webpagePreviewScanMaxImageScansForLogo']) {\n\t\t\t\t\t\t\t\t$i=999999;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->totalcounter +=$k-1;\n\t\t}\n\n\t\treturn $images_arrayout;\n\t}", "public function get_css_files()\n\t{\n\t\treturn $this->_css_files;\n\t}", "protected function getSubCssFile(): void\n {\n preg_match_all(self::REGEX_CSS_IMPORT_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $this->sContents = str_replace($aHit[0][$i], '', $this->sContents);\n $this->sContents .= File::EOL . $this->oFile->getUrlContents($aHit[1][$i] . $aHit[2][$i]);\n }\n }", "protected function generateCSS() {}", "function src_inc_list_css(string $assets_url, array $files) : string {\n $source = \"\";\n\n //Process the list of files\n foreach($files as $file){\n $source .= src_inc_css($assets_url.$file).\"\\n\\t\\t\";\n }\n\n return $source;\n}", "protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename('.css'), $file->getPathname());\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_THEMES_NAME, $this->getThemes());\n }\n }", "function _advanced_css($file)\r\n\t{\t\t\r\n\t\tif ( ! $file)\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\t$this->css = file_get_contents($file);\r\n\t\t$this->css = preg_replace('/\\/\\*.+?\\*\\//s', '', $this->css);\r\n\t\t\r\n\t\tif (trim($this->css) == '')\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t\r\n\t\t// Used by the loop to track bracing depth\r\n\r\n\t\t$selector_stack = array();\t\t\r\n\t\t$open = FALSE;\r\n\t\t$depth = 0;\r\n\r\n\t\t/* The regex here is a bit crazy, but we need it to be\r\n\t\t * really quick if we're going to parse css on the fly.\r\n\t\t * The basic version is:\r\n\t\t * \t/\\s*(([^\\}\\{;]*?)\\s*\\{|\\})/\r\n\t\t *\r\n\t\t * I've changed it to use a whitelist of characters instead,\r\n\t\t * which pushes the regex processing time on a 2000 line test file\r\n\t\t * down to 0.07 seconds. Acceptable - result cached by browser.\r\n\t\t */\r\n\t\t$brackets = '/\\s*(([@\\w+~>\\-\\[\\]=\\(\\'\"):,.#\\s]*?)\\s*\\{|\\})\\s*/';\r\n\t\t\r\n\t\tif (preg_match_all($brackets, $this->css, $matches, PREG_OFFSET_CAPTURE))\r\n\t\t{\r\n\t\t\tforeach($matches['1'] as $key => $data)\t// data[0] - string | data[1] - offset\r\n\t\t\t{\r\n\t\t\t\tif ($data['0'] == '}')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($open)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// selector array, start offset, selector /w open-bracket, closing offset\r\n\t\t\t\t\t\t$this->_add_css($selector_stack, $open['0'], $open['1'], $data['1']);\r\n\t\t\t\t\t\t$open = FALSE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tarray_pop($selector_stack);\r\n\t\t\t\t\t$depth--;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$selector_stack[] = $matches['2'][$key]['0'];\r\n\t\t\t\t$open = array($data['1'], $data['0']);\r\n\r\n\t\t\t\t$depth++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->load->library('javascript');\r\n\t\treturn $this->javascript->generate_json($this->parsed_css, TRUE);\r\n\t}", "public function build_css() {\n\t\t\t\n\t\t}", "public function crawl()\n {\n foreach ($this->urlQueue as $k => $url) {\n echo \"\\n[\" . $k . \"] \" . $url;\n ob_flush();\n flush();\n \n $parser = $this->getParser($url);\n if ($parser !== false) {\n $links = $this->getLinksOnPage($url, $parser);\n $this->urlQueue->addFromArray($links);\n }\n }\n \n echo print_r($this->urlQueue, true);\n }", "function loadCSS() {\n\t\t$first = true;\n\t\t$cssPart = '';\n\t\tforeach( $this->conf->css->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$cssPart .= chr( 9 );\n\t\t\t}\n\t\t\t$cssPart .= '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"';\n\t\t\t$cssPart .= $this->conf->path->baseUrl . $this->conf->path->css . $file;\n\t\t\t$cssPart .= '\" />' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalCSS ) >= 1 ) {\n\t\t\tforeach( $this->additionalCSS as $key => $value ) {\n\t\t\t\t$cssPart .= '<style type=\"text/css\">' . chr( 10 );\n\t\t\t\t$cssPart .= $value . chr( 10 );\n\t\t\t\t$cssPart .= '</style>' . chr( 10 );\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn $cssPart;\n\t}", "function media_theplatform_mpx_extract_all_css_links($text) {\n $pattern = '/\\<link rel\\=\\\"stylesheet\\\" type\\=\\\"text\\/css\\\" media\\=\\\"screen\\\" href\\=\\\"(.*?)\\\" \\/\\>/';\n preg_match_all($pattern, $text, $results);\n return $results[1];\n}", "static public function getCssContent($file)\n {\n // Don't try to parse empty (or non-existing) files\n if (empty($file)) return null;\n\n // Skip files that have already been included\n static $files = array();\n if (in_array($file, $files)) {\n return null;\n } else {\n $files[] = $file;\n }\n\n // Initialize the buffer\n $buffer = @file_get_contents($file);\n if (empty($buffer)) return null;\n\n // Initialize the basepath\n $basefile = ScriptMergeHelper::getFileUrl($file, false);\n\n // Follow all @import rules\n if (ScriptMergeHelper::getParams()->get('follow_imports', 1) == 1) {\n if (preg_match_all('/@import\\ url\\((.*)\\);/i', $buffer, $matches)) {\n foreach ($matches[1] as $index => $match) {\n\n // Strip quotes\n $match = str_replace('\\'', '', $match);\n $match = str_replace('\"', '', $match);\n\n $importFile = ScriptMergeHelper::getFilePath($match, $file);\n if (empty($importFile) && strstr($importFile, '/') == false) $importFile = dirname($file).'/'.$match;\n $importBuffer = ScriptMergeHelper::getCssContent($importFile);\n\n if (!empty($importBuffer)) {\n $buffer = str_replace($matches[0][$index], \"\\n\".$importBuffer.\"\\n\", $buffer);\n } else {\n $buffer = \"\\n/* ScriptMerge error: CSS import of $importFile returned empty */\\n\\n\".$buffer;\n }\n }\n }\n }\n\n // Replace all relative paths with absolute paths\n if (preg_match_all('/url\\(([^\\(]+)\\)/i', $buffer, $url_matches)) {\n foreach ($url_matches[1] as $url_index => $url_match) {\n\n // Strip quotes\n $url_match = str_replace('\\'', '', $url_match);\n $url_match = str_replace('\"', '', $url_match);\n\n // Skip CSS-stylesheets which need to be followed differently anyway\n if (strstr($url_match, '.css')) continue;\n\n // Skip URLs and data-URIs\n if (preg_match('/^(http|https):\\/\\//', $url_match)) continue;\n if (preg_match('/^\\/\\//', $url_match)) continue;\n if (preg_match('/^data\\:/', $url_match)) continue;\n\n // Normalize this path\n $url_match_path = ScriptMergeHelper::getFilePath($url_match, $file);\n if (empty($url_match_path) && strstr($url_match, '/') == false) $url_match_path = dirname($file).'/'.$url_match;\n if (!empty($url_match_path)) $url_match = ScriptMergeHelper::getFileUrl($url_match_path);\n \n // Include data-URIs in CSS as well\n if (ScriptMergeHelper::getParams()->get('data_uris', 0) == 1) {\n $imageContent = ScriptMergeHelper::getDataUri($url_match_path);\n if (!empty($imageContent)) {\n $url_match = $imageContent;\n }\n }\n\n $buffer = str_replace($url_matches[0][$url_index], 'url('.$url_match.')', $buffer);\n }\n }\n\n // Detect PNG-images and try to replace them with WebP-images\n if (preg_match_all('/([a-zA-Z0-9\\-\\_\\/]+)\\.(png|jpg|jpeg)/i', $buffer, $matches)) {\n foreach ($matches[0] as $index => $image) {\n $webp = ScriptMergeHelper::getWebpImage($image);\n if ($webp != false && !empty($webp)) {\n $buffer = str_replace($image, $webp, $buffer);\n } \n }\n }\n\n // If compression is enabled\n $compress_css = ScriptMergeHelper::getParams()->get('compress_css', 0);\n if ($compress_css > 0) {\n\n switch ($compress_css) {\n\n case 1: \n $buffer = preg_replace('#[\\r\\n\\t\\s]+//[^\\n\\r]+#', ' ', $buffer);\n $buffer = preg_replace('/[\\r\\n\\t\\s]+/s', ' ', $buffer);\n $buffer = preg_replace('#/\\*.*?\\*/#', '', $buffer);\n $buffer = preg_replace('/[\\s]*([\\{\\},;:])[\\s]*/', '\\1', $buffer);\n $buffer = preg_replace('/^\\s+/', '', $buffer);\n $buffer .= \"\\n\";\n break;\n\n case 2:\n // Compress the CSS-code\n $cssMin = JPATH_SITE.'/components/com_scriptmerge/lib/cssmin.php';\n if(file_exists($cssMin)) include_once $cssMin;\n if(class_exists('CssMin')) {\n $buffer = CssMin::minify($buffer);\n }\n break;\n\n case 0:\n default:\n break;\n }\n\n // If compression is disabled\n } else { \n\n // Append the filename to the CSS-code\n if(ScriptMergeHelper::getParams()->get('use_comments', 1)) {\n $start = \"/* [start] ScriptMerge CSS-stylesheet: $basefile */\\n\\n\";\n $end = \"/* [end] ScriptMerge CSS-stylesheet: $basefile */\\n\\n\";\n $buffer = $start.$buffer.\"\\n\".$end;\n }\n }\n\n return $buffer;\n }", "public function css(){\n if (func_num_args() > 0){\n for ($i = 0; $i < func_num_args(); $i++){\n $arg = func_get_arg($i); // Fatal error: func_get_arg(): Can't be used as a function parameter\n if (preg_match('/^(.+)\\[(.+)\\]$/', $arg, $matches)){\n $filename = $matches[1];\n $media = $matches[2];\n } else {\n $filename = $arg;\n $media = 'screen,projection';\n }\n \n array_push($this->css, $this->stylesheet_tag($filename, $media));\n }\n }\n \n return join($this->css, \"\\n\");\n }", "function css($arquivo);", "public function automaticCss()\n \t{\n \t\t$css = array();\n \t\tif (isset($this->pluginPath)) {\n\t \t\t\n\t \t\t# CSS Plugin Path\n\t\t\t$css_path_plugin = $this->pluginPath . $this->constant['webroot'] . DS . $this->constant['cssBaseUrl'];\n\t\t\tif (is_file($css_path_plugin . $this->controller . '.css')) {\n\t\t \t$css[] = $this->plugin.'.'.$this->controller;\n\t\t \t}\n\n\t\t \tif (is_file($css_path_plugin . $this->controller . DS . $this->action . '.css')) {\n\t\t \t$css[] = $this->plugin.'.'.$this->controller . '/' . $this->action;\n\t\t \t}\n \t\t}\n \t\t\n \t\t$css_path = $this->constant['www_root'] . $this->constant['cssBaseUrl'];\n \t\tif (is_file($css_path . $this->controller . '.css')) {\n\t \t$css[] = $this->controller;\n\t\t}\n\n\t \tif (is_file($css_path . $this->controller . DS . $this->action . '.css')) {\n\t \t$css[] = $this->controller . DS . $this->action;\n\t\t}\n\t\treturn $this->css($css);\n \t}", "public function css() {\r\r\n\r\r\n // $scss = new scssc();\r\r\n // $scss->setImportPaths(\"css/\");\r\r\n // $scss->setFormatter(\"scss_formatter_compressed\");\r\r\n // $dir = $_SERVER['DOCUMENT_ROOT'].\"/css/\";\r\r\n // $server = new scss_server($dir, $this->config->config['cache_path'].'resources', $scss);\r\r\n // $server->serve('', $name);\r\r\n\r\r\n $scss = new scssc();\r\r\n $scss->setFormatter(\"scss_formatter_compressed\");\r\r\n\r\r\n $source = '';\r\r\n $cache_path = $this->config->config['cache_path'].'resources';\r\r\n $file_cache = $cache_path.'/styles.css';\r\r\n\r\r\n $mtime_cache = (file_exists($file_cache)) ? filemtime($file_cache) : 0;\r\r\n $mtime_files = 0;\r\r\n\r\r\n foreach($this->config->config['css_site'] as $file) {\r\r\n if(pathinfo($file, PATHINFO_EXTENSION) === 'scss') {\r\r\n\r\r\n $scss->last_modified = filemtime($file);\r\r\n $scss->compile('@import \"'.$file.'\"');\r\r\n if($mtime_files < $scss->last_modified) {\r\r\n $mtime_files =$scss->last_modified;\r\r\n }\r\r\n\r\r\n } else {\r\r\n if($mtime_files < filemtime($file)) {\r\r\n $mtime_files = filemtime($file);\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n if($mtime_cache > $mtime_files) {\r\r\n header(\"Content-Type: text/css\");\r\r\n $lastModified = gmdate('D, d M Y H:i:s', $mtime_cache) . ' GMT';\r\r\n header('Last-Modified: ' . $lastModified);\r\r\n echo file_get_contents($file_cache);\r\r\n\r\r\n return;\r\r\n }\r\r\n\r\r\n $t = @date('r');\r\r\n\r\r\n foreach($this->config->config['css_site'] as $file) {\r\r\n if(pathinfo($file, PATHINFO_EXTENSION) === 'scss') {\r\r\n $source .= $scss->compile('@import \"'.$file.'\"');\r\r\n } else {\r\r\n $source .= $scss->compile(file_get_contents($file));\r\r\n }\r\r\n }\r\r\n\r\r\n $source = \"/* generated by trivy on \".@date('r').\" */\\n\\n\" . $source;\r\r\n\r\r\n $file = fopen($file_cache, 'w+');\r\r\n fwrite($file, $source);\r\r\n fclose($file);\r\r\n $mtime_cache = filemtime($file_cache);\r\r\n\r\r\n header(\"Content-Type: text/css\");\r\r\n $lastModified = gmdate('D, d M Y H:i:s', $mtime_cache) . ' GMT';\r\r\n header('Last-Modified: ' . $lastModified);\r\r\n echo $source;\r\r\n }", "public function getCss();", "public function getCss();", "static public function findStylesheetFiles($styles) {\n\t\t$theme=OC_Config::getValue( 'theme' );\n\n\t\t// Read the detected formfactor and use the right file name.\n\t\t$fext = self::getFormFactorExtension();\n\n\t\t$files = array();\n\t\tforeach($styles as $style) {\n\t\t\t// is it in 3rdparty?\n\t\t\tif(self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style.'.css')) {\n\n\t\t\t// or in the owncloud root?\n\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"$style$fext.css\" )) {\n\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"$style.css\" )) {\n\n\t\t\t// or in core ?\n\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"core/$style$fext.css\" )) {\n\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"core/$style.css\" )) {\n\n\t\t\t}else{\n\t\t\t\t$append = false;\n\t\t\t\t// or in apps?\n\t\t\t\tforeach( OC::$APPSROOTS as $apps_dir)\n\t\t\t\t{\n\t\t\t\t\tif(self::appendIfExist($files, $apps_dir['path'], $apps_dir['url'], \"$style$fext.css\")) {\n\t\t\t\t\t\t$append = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telseif(self::appendIfExist($files, $apps_dir['path'], $apps_dir['url'], \"$style.css\")) {\n\t\t\t\t\t\t$append = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(! $append) {\n\t\t\t\t\techo('css file not found: style:'.$style.' formfactor:'.$fext\n\t\t\t\t\t\t.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Add the theme css files. you can override the default values here\n\t\tif(!empty($theme)) {\n\t\t\tforeach($styles as $style) {\n\t\t\t\t if(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/apps/$style$fext.css\" )) {\n\t\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/apps/$style.css\" )) {\n\n\t\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/$style$fext.css\" )) {\n\t\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/$style.css\" )) {\n\n\t\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/core/$style$fext.css\" )) {\n\t\t\t\t}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, \"themes/$theme/core/$style.css\" )) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $files;\n\t}", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "public function css_includes()\n {\n }", "private function loadCss($dir)\n {\n $css = [];\n if(file_exists($dir.'objavi.css')){\n $css[] = file_get_contents($dir.'objavi.css');\n }\n if(file_exists($dir.'css/extra.css')){\n $css[] = file_get_contents($dir.'css/extra.css');\n }\n\n return $css;\n }", "public function crawl()\n\t{\n \t// truncate any non-existant pages\n\t\t$this->resetIndex();\n\n\t\t// create a temporary table for incrementing counts\n\t\t$this->createTempTable();\n\n\t\t// add initial URL to crawl list\n\t\t$this->addRequest($this->startUrl);\n\n\t\t// begin crawling the url\n\t\t$this->crawlUrls();\n\n\t\t// update url counts and remove the temp table\n\t\t$this->finalizeUrlCounts();\n\t}", "function happys_getCssAssets() {\n\t \t $filepath = glob(\"wp-content/themes/happys/css/app-v*.css\");\n\t\t $filename = basename($filepath[count($filepath) - 1]).PHP_EOL;\n\t \t echo $filename;\n }", "private function processAssets()\n {\n $js = $this->assetmanager->getAssetHandler('js');\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/script.js');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.js'));\n\n $js->setFileHandler($afh);\n\n $css = $this->assetmanager->getAssetHandler('css');\n\n $theme = $this->config->get('Core', 'style.theme.name');\n\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../fonts/', '../Themes/' . $theme . '/fonts/'));\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../img/', '../Themes/' . $theme . '/img/'));\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/style.css');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.css'));\n\n $css->setFileHandler($afh);\n\n foreach ($this->apps as $app) {\n foreach ($app->javascript as $aio) {\n $js->addObject($aio);\n }\n\n foreach ($app->css as $aio) {\n $css->addObject($aio);\n }\n }\n\n // Process assets\n $this->assetmanager->process();\n }", "protected function renderCssLibraries() {}", "public function getAllCSS()\n {\n return $this->css;\n }", "public static function css();", "function set_css_urls($css_url) {\n\n md_set_css_urls($css_url);\n \n }", "public function compile() {\n try {\n $dest = $this->paths->get('css.out');\n $compile = $this->frequency;\n\n $changed = (bool)$this->isCssUpdated();\n\n JLog::add('CSS cache changed: '.((bool)$changed ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $changed = (bool)(($compile == 2) || ($compile == 1 && $changed));\n\n $doCompile = (!JFile::exists($dest) || $changed);\n\n JLog::add('Force CSS compilation: '.($compile == 2 ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('CSS file exists: '.((bool)JFile::exists($dest) ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('Compiling CSS: '.((bool)$doCompile ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n if ($doCompile) {\n if ($this->compiler == 'less') {\n $generateSourceMap = $this->params->get('generate_css_sourcemap', false);\n\n JLog::add('Generate CSS sourcemap: '.((bool)$generateSourceMap ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $options = array('compress'=>true);\n\n $cssSourceMapUri = str_replace(JPATH_ROOT, JURI::base(), $this->paths->get('css.sourcemap'));\n\n // Build source map with minified code.\n if ($this->params->get('generate_css_sourcemap', false)) {\n $options['sourceMap'] = true;\n $options['sourceMapWriteTo'] = $this->paths->get('css.sourcemap');\n $options['sourceMapURL'] = $cssSourceMapUri;\n $options['sourceMapBasepath'] = JPATH_ROOT;\n $options['sourceMapRootpath'] = JUri::base();\n } else {\n JFile::delete($this->paths->get('css.sourcemap'));\n }\n\n $less = new Less_Parser($options);\n $less->parseFile($this->paths->get('css.in'), JUri::base());\n $css = $less->getCss();\n $files = $less->allParsedFiles();\n } else {\n $formatter = \"Leafo\\ScssPhp\\Formatter\\\\\".$this->formatting;\n $this->cache->store($this->formatting, self::CACHEKEY.'.scss.formatter');\n\n $scss = new Compiler();\n $scss->setFormatter($formatter);\n $css = $scss->compile('@import \"'.$this->paths->get('css.in').'\";');\n\n $files = array_keys($scss->getParsedFiles());\n }\n\n JLog::add('Writing CSS to: '.$dest, JLog::DEBUG, self::LOGGER);\n JFile::write($dest, $css);\n\n // update cache.\n $this->updateCache(self::CACHEKEY.'.files.css', $files);\n $this->cache->store($this->compiler, self::CACHEKEY.'.compiler');\n }\n } catch (Exception $e) {\n JLog::add($e->getMessage(), JLog::ERROR, self::LOGGER);\n return false;\n }\n }", "protected function doConcatenateCss() {}", "public function collectUrls() {\n\t\t\t$this->addUrlsToCrawlArray(self::$seedUrls);\n\t\t\tif (count(self::$crawlXpath) != 0 && self::$dataXpath != \"\") {\n\t\t\t\t$length = count(self::$crawlXpath);\n\t\t\t\tfor($i=0; $i<$length; $i++) {\n\t\t\t\t\t$crawlXpathToUse = self::$crawlXpath[$i];\n\t\t\t\t\t$urlsToCrawlThisRun = self::$urlsToCrawl[$i];\n\t\t\t\t\t$crawledUrlsThisRun = array();\n\t\t\t\t\tforeach ($urlsToCrawlThisRun as $url) {\n\t\t\t\t\t\techo(\"Crawling: \". $url.\"<br>\");\n\t\t\t\t\t\t$xml = $this->getPageHtml($url);\n\t\t\t\t\t\techo\"have page content\".\"<br>\";\n\t\t\t\t\t\t$Xpath = new DOMXpath($xml);\n\t\t\t\t\t\techo\"using xpath: \". $crawlXpathToUse.\"<br>\";\n\t\t\t\t\t\t$urlsFromXpathNodeList = $Xpath->evaluate($crawlXpathToUse);\n\t\t\t\t\t\techo\"xpath evaluated.\";\n\t\t\t\t\t\t$urlsFromXpathArray = array();\n\t\t\t\t\t\t$length = $urlsFromXpathNodeList->length;\n\t\t\t\t\t\tfor($j=0; $j<$length; $j++) {\n\t\t\t\t\t\t\tarray_push($urlsFromXpathArray, $urlsFromXpathNodeList->item($j)->textContent);\n\t\t\t\t\t\t\t$this->addCrawlUrlToDb($urlsFromXpathNodeList->item($j)->textContent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray_push(self::$urlsToCrawl, $urlsFromXpathArray);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else if (count(self::$crawlXpath) == 0 && self::$dataXpath != \"\") {\n\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"Data xPath not provided. Returning.\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function getCss($link)\n {\n $cssLinks = [];\n $content = file_get_contents($link);\n\n if (preg_match_all('/(@import) (url)\\(\\\"([^)]+)\\\"\\)/', $content, $matches)) {\n if (isset($matches[3])) {\n foreach ($matches[3] as $match) {\n $cssLinks[] =$this->getFullLink($link, $match);\n }\n }\n }\n\n if (preg_match_all('/<link.+href=[\\'\"]([^\\'\"]+)[\\'\"].*>/', $content, $matches)) {\n if (isset($matches[1])) {\n foreach ($matches[1] as $match) {\n if (!preg_match('/\\.(xml|ico)$/', $match)) {\n $cssLinks[] = $this->getFullLink($link, $match);\n }\n }\n }\n }\n\n return [$content, $cssLinks];\n }", "protected function crawlUrls()\n\t{\n\t\t// only execute if a cURL request is not running\n\t\tif (!$this->running) {\n\t\t\t$this->execute();\n\t\t}\n\t}", "protected function crawl($url)\n {\n $responseUrl = $this->doRequest($url);\n if (!is_null($responseUrl)) {\n $listCss = $this->crawler->filterXPath('//*[@rel=\"stylesheet\"]')->extract('href');\n $this->getAllLink($url, $listCss, $this->siteCss);\n $listJs = $this->crawler->filter('script')->extract('src');\n $this->getAllLink($url, $listJs, $this->siteJs);\n $listUrl = $this->crawler->filter('a')->extract('href');\n $this->getAllLink($url, $listUrl, $this->siteUrl, 1);\n }\n $this->crawler->clear();\n unset($responseUrl);\n }", "function my_generate_css($info, $scandir, $pos, $i){\n ($pos == 0) ? $neg = \"\" : $neg = \"-\";\n global $nameCSS;\n $chaine = '|.(.*?)/|iU';\n $scandir = preg_replace($chaine,'',$scandir);\n$css = \".sprite-\".substr($scandir[$i], 0,-4).\"{ \\n\n width: \".$info[0].\"px;\\n\n height: \".$info[1].\"px;\\n\n background-position: \".$neg.$pos .\"px 0px;\\n\n}\\n\";\n $handle = fopen($nameCSS, \"a\");\n $write = fwrite($handle, $css);\n fclose($handle);\n}", "function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "function cdn_html_alter_css_urls(&$html) {\n $url_prefix_regex = _cdn_generate_url_prefix_regex();\n $pattern = \"#href=\\\"(($url_prefix_regex)(.*?\\.css)(\\?.*)?)\\\"#\";\n _cdn_html_alter_file_url($html, $pattern, 0, 3, 4, 'href=\"', '\"'); \n}", "public static function combine_css($files,$outputdir = 'static/generated/')\n {\n if(\\HMC\\Config::SITE_ENVIRONMENT() == 'development') {\n Assets::css($files);\n return;\n }\n $ofiles = (is_array($files) ? $files : array($files));\n $hashFileName = md5(join($ofiles));\n $dirty = false;\n\n if(file_exists($outputdir.$hashFileName.'.css')) {\n $hfntime = filemtime($outputdir.$hashFileName.'.css');\n foreach($ofiles as $vfile) {\n $file = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n if(!$dirty){\n $fmtime = filemtime($file);\n if($fmtime > $hfntime) {\n $dirty = true;\n }\n }\n }\n } else {\n $dirty = true;\n }\n if($dirty) {\n $buffer = \"\";\n foreach ($ofiles as $vfile) {\n $cssFile = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n $buffer .= \"\\n\".file_get_contents($cssFile);\n }\n\n // Remove comments\n $buffer = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $buffer);\n\n // Remove space after colons\n $buffer = str_replace(': ', ':', $buffer);\n\n // Remove whitespace\n $buffer = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' '), '', $buffer);\n\n ob_start();\n\n // Write everything out\n echo($buffer);\n\n $fc = ob_get_clean();\n\n file_put_contents(\\HMC\\Config::SITE_PATH().$outputdir.$hashFileName.'.css',$fc);\n\n }\n static::resource(str_replace(':||','://',str_replace('//','/',str_replace('://',':||',\\HMC\\Config::SITE_URL().$outputdir.$hashFileName.'.css'))),'css');\n }", "function style_check($dir) {\n foreach (glob(\"$dir/*\") as $node) {\n if (is_file($node)) style_correct($node);\n elseif (is_dir($node)) style_check(\"$node\");\n }\n}", "public function getCss()\n {\n $result = $this->_css;\n foreach ($this->_packages as $package) {\n $config = $this->getConfig($package);\n if (!empty($config['css'])) {\n foreach ($config['css'] as $item) {\n $result[] = $item;\n }\n }\n }\n return $result;\n }", "public function css()\n {\n $assets = array();\n foreach (Config::get('ImageUpload::assets.css') as $file) {\n $assets[] = new FileAsset(public_path($this->assetPath.'css/'.$file));\n }\n $css = new AssetCollection($assets, array(\n new CssMinFilter(),\n ));\n\n $response = Response::make($css->dump(), 200);\n $response->header('Content-Type', 'text/css');\n return $response;\n }", "public function getCssFiles(): array\n {\n return $this->cssFiles;\n }", "private function _getCSSIncludes () {\n $ret = array();\n foreach ($this->_styles as $stylesheet => $included) {\n if (!$included) {\n $this->_styles[$stylesheet] = true;\n array_push($ret, self::CSS_PATH . $stylesheet);\n }\n }\n\n return $ret;\n }", "private function _replace_inline_css()\n\t{\n\t\t// preg_match_all( '/url\\s*\\(\\s*(?![\"\\']?data:)(?![\\'|\\\"]?[\\#|\\%|])([^)]+)\\s*\\)([^;},\\s]*)/i', $this->content, $matches ) ;\n\n\t\t/**\n\t\t * Excludes `\\` from URL matching\n\t\t * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS\n\t\t * @see #685485\n\t\t * @since 3.0\n\t\t */\n\t\tpreg_match_all( '#url\\((?![\\'\"]?data)[\\'\"]?([^\\)\\'\"\\\\\\]+)[\\'\"]?\\)#i', $this->content, $matches ) ;\n\t\tforeach ( $matches[ 1 ] as $k => $url ) {\n\t\t\t$url = str_replace( array( ' ', '\\t', '\\n', '\\r', '\\0', '\\x0B', '\"', \"'\", '&quot;', '&#039;' ), '', $url ) ;\n\n\t\t\tif ( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "function get_images($file){\r\n $h1count = preg_match_all('/(<img)\\s (src=\"([a-zA-Z0-9\\.;:\\/\\?&=_|\\r|\\n]{1,})\")/isxmU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[3]);\r\n array_push($res,count($patterns[3]));\r\n return $res;\r\n}", "public function parse()\n {\n $contents = file_get_contents($this->uploadPath);\n if ($contents === false)\n {\n throw new Exception(\"SYSTEM: Can't read temp file\");\n }\n\n $comments = array();\n $css = array();\n $fontFamilies = array();\n $colors = array();\n\n // store and remove comments - found this regex on official CSS 2.1 spec page\n preg_match_all('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|',$contents, $comments, PREG_SET_ORDER);\n $contents = preg_replace('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|','',$contents);\n\n // strip newlines\n $contents = preg_replace('/\\n/','',$contents);\n\n // can't take credit for this regex, found on stackexchange\n preg_match_all('/([^{]+)\\s*\\{\\s*([^}]+)\\s*}/',$contents, $css, PREG_SET_ORDER);\n\n // also can't take credit for this regex\n preg_match_all('/font-family\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $fontFamilies, PREG_SET_ORDER);\n\n // a couple more random data points\n preg_match_all('/color\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $colors, PREG_SET_ORDER);\n\n\n $this->parsedData['comments'] = $comments;\n $this->parsedData['css'] = $css;\n $this->parsedData['font_families'] = $fontFamilies;\n $this->parsedData['colors'] = $colors;\n\n }", "protected function loadStylesheets() {}", "public function combine($files)\n\t{\n\t\t// Turn the array around\n\t\t$cssFiles = array();\n\t\tforeach ($files as $url=> $media)\n\t\t\t$cssFiles[$media][] = $url;\n\n\t\t// We will store the new list of registered files here\n\t\t$combinedFiles = array();\n\n\t\t// Produce one file for each media type\n\t\tforeach ($cssFiles as $media=> $files)\n\t\t{\n\t\t\t// Get the contents of all local CSS files and store the external \n\t\t\t// and excluded ones in a separate array\n\t\t\t$untouchedFiles = array();\n\t\t\t$contents = array();\n\n\t\t\tforeach ($files as $url)\n\t\t\t{\n\t\t\t\t$file = $this->resolveAssetPath($url);\n\n\t\t\t\tif ($file !== false && !$this->shouldExclude($url))\n\t\t\t\t\tif (\\Yii::app()->clientScript->remapCssUrls)\n\t\t\t\t\t\t$contents[$file] = $this->remapCssUrls(file_get_contents($file), $url);\n\t\t\t\t\telse\n\t\t\t\t\t\t$contents[$file] = file_get_contents($file);\n\t\t\t\telse\n\t\t\t\t\t$untouchedFiles[$url] = $url;\n\t\t\t}\n\n\t\t\t$combinedProps = $this->getCombinedFileProperties(\n\t\t\t\t\tself::FILE_EXT_CSS, array_keys($contents));\n\t\t\t\n\t\t\t// Extract @import statements and prepend them to the contents\n\t\t\t$importContent = $this->extractImports($contents);\n\t\t\tarray_unshift($contents, $importContent);\n\n\t\t\t// Check if we need to perform combination\n\t\t\tif (!file_exists($combinedProps['path']))\n\t\t\t{\n\t\t\t\tfile_put_contents($combinedProps['path'], implode(PHP_EOL, \n\t\t\t\t\t\t$this->compress(\\YUI\\Compressor::TYPE_CSS, $contents)));\n\t\t\t}\n\n\t\t\tforeach ($untouchedFiles as $untouchedFile)\n\t\t\t\t$combinedFiles[$untouchedFile] = $media;\n\n\t\t\t$combinedFiles[$combinedProps['url']] = $media;\n\t\t}\n\n\t\treturn $combinedFiles;\n\t}", "function XT_load_css($params){\n if($params['media'] == \"\"){\n $params['media']= \"screen\";\n }\n if(empty($params['file'])) {\n return false;\n } else {\n if(empty($GLOBALS['loadedcss'][$params['file']])){\n // js ausgeben und als geladen merken\n $GLOBALS['loadedcss'][$params['file']] = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . STYLES_DIR . 'live/' . $params['file'] . '\" media=\"' . $params['media'] . '\" />';\n return NULL;\n }else{\n return false;\n }\n }\n}", "function readStyles() { $this->ParseCSSFile();\n return $this->_stylelist; }", "function load_css($load_css) {\n if (isset($load_css) && is_array($load_css)) {\n $css_files = '';\n foreach ($load_css as $files) {\n $css_files .= '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . base_url() . 'css/' . $files . '\" />';\n }\n return $css_files;\n }\n}", "function style_check($dir) {\n foreach (glob(\"$dir/*\") as $node) {\n if (is_file($node ?? '')) style_correct($node);\n elseif (is_dir($node ?? '')) style_check(\"$node\");\n }\n}", "private function getAllThemeFiles(){\n\t\t$themeFolder = zweb.\"themes/\";\n\t\t$files = scandir($themeFolder.$this->theme);\n\n\t\tif(gettype($files) != \"array\") $files = array();\n\t\tforeach($files as $file){\n\t\t\tif(!is_dir($themeFolder.$file)){\n\t\t\t\t$info = pathinfo($themeFolder.$file);\n\t\t\t\t$this->$info['filename'] = $this->getThemeFile($info['filename'], @$info['extension']);\n\t\t\t}\n\t\t}\n\t}", "function load_css($arquivo=NULL,$pasta='css',$midia='all'){\n if($arquivo!= null):\n $CI =& get_instance();\n $CI->load->helper('url');\n $retorno ='';\n if(is_array($arquivo)):\n foreach ($arquivo as $css):\n $retorno .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.base_url(\"$pasta/$css.css\").'\"media=\"'.$midia.'\"/>';\n endforeach;\n else:\n $retorno = '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.base_url(\"$pasta/$arquivo.css\").'\"media=\"'.$midia.'\"/>';\n endif;\n endif;\n return $retorno;\n\n}", "public function crawl() {\n $client = Naloader::getHttpClient($this->url);\n $crawler = $client->request('GET', $this->url);\n $this->parseFromCrawler($crawler);\n }", "function queue_css_file($file, $media = 'all', $conditional = false, $dir = 'css', $version = OMEKA_VERSION)\n{\n if (is_array($file)) {\n foreach ($file as $singleFile) {\n queue_css_file($singleFile, $media, $conditional, $dir, $version);\n }\n return;\n }\n queue_css_url(css_src($file, $dir, $version), $media, $conditional);\n}", "function generate_css() {\r\n global $config;\r\n\r\n $res = '';\r\n foreach ($config['css']as $v) {\r\n $res .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"$v\\\"/>\";\r\n }\r\n return $res;\r\n}", "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "private function _print_html_head_css()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t//Check if theme defined\n\t\t$theme = ($this->theme) ? $this->theme : '';\n\t\t\n\t\tforeach($this->css as $style) {\n\t\t\t$skip = FALSE;\n\t\t\t\n\t\t\t$partpath = (strpos($style, '.css') === FALSE) ? \"{$theme}css/{$style}.css\" : \"/{$style}\";\n\t\t\t$fullpath = Ashtree_Common::get_real_path($partpath, TRUE);\n\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\tif (!file_exists($fullpath)) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t\t\n\t\t\t\t$partpath = \"css/{$style}.css\";\n\t\t\t\t$fullpath = ASH_BASEPATH . $partpath;\n\t\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\t\tif (!file_exists($partpath)) {\n\t\t\t\t $skip = TRUE;\n\t\t\t\t} else {\n\t\t\t\t $this->_debug->clear();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($skip) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t} else {\n\t\t\t\t$this->_debug->status('OK');\n\t\t\t\t$fullpath = Ashtree_Common::get_real_path($fullpath);\n\t\t\t\t$output .= \"<link type=\\\"text/css\\\" media=\\\"screen\\\" rel=\\\"stylesheet\\\" href=\\\"{$fullpath}\\\" />\\n\";\n\t\t\t}\n\t\t\t\n\t\t}//foreach\n\t\t\n\t\t$output .= \"<style type=\\\"text/css\\\">\\n\";\n\t\t\n\t\tforeach($this->style as $style) {\n\t\t\t$output .= \"\\t{$style}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"</style>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }", "public function styles() {\n $styles = array();\n if (\\File::isDirectory(public_path('assets/fontello/css'))) {\n foreach (glob(public_path('assets/fontello/css/') . '*', GLOB_BRACE) as $path) {\n $file = explode('/', $path);\n $styles[] = \\HTML::style('public/assets/fontello/css/' . end($file));\n }\n\n return join(\"\\n\", $styles);\n }\n }", "function _asset_css_all(string $pack = '') {\n\t\treturn Asset::setThemePack($pack)->getCssAll();\n\t}", "function fancybox_get_css()\n{\n global $PHORUM;\n\n $css = dirname(__FILE__) . '/code/' .\n 'jquery.fancybox-' . FANCYBOX_VERSION . '.css';\n $code = file_get_contents($css);\n $url = $PHORUM['http_path'] . '/' . FANCYBOX_PATH;\n\n // Update all background-image url references to use an absolute URL.\n $code = preg_replace(\n '/\\burl\\(\\'?([\\w-]+\\.\\w+)\\'?\\)/',\n \"url('$url/\\$1')\",\n $code\n );\n\n // Update all src='fancybox/someimage.png' references.\n $code = preg_replace(\n '/src=\\'?fancybox\\/(\\w+\\.\\w+)\\'/',\n \"src='$url/\\$1'\",\n $code\n );\n\n return $code;\n}", "private function _display_css($group = 'main')\n\t{\n if(empty($this->css))\n {\n return; // there aren't any css assets, so just stop!\n }\n\n if( ! isset($this->css[$group]))\n {\n // the group you asked for doesn't exist. This should never happen, but better to be safe than sorry.\n\t\t\tlog_message('error', \"Assets: The CSS asset group named '{$group}' does not exist.\");\n return;\n }\n\n if($this->dev)\n {\n // we're in a development environment\n foreach($this->css[$group] as $media => $refs)\n {\n foreach($refs as $ref)\n {\n\t\t\t\t\techo $this->_tag('css', $ref['dev'], FALSE, $media);\n\t\t }\n }\n }\n elseif($this->combine && $this->minify_css)\n {\n // we're combining and minifying\n foreach($this->css[$group] as $media => $refs)\n {\n\t\t\t\t// lets try to cache it, shall we?\n\t\t\t\t$lastmodified = 0;\n\t\t\t\t$files = array();\n\t\t\t\t$filenames = '';\n\t\t\n foreach ($refs as $ref)\n {\n\t\t\t\t\t$lastmodified = max($lastmodified, filemtime( realpath( $this->style_path . $ref['dev'] ) ) );\n\t\t\t\t\t$filenames .= $ref['dev'];\n\t\t\t\n if( ! $ref['combine'])\n {\n echo (isset($ref['prod']))\n ? $this->_tag('css', $ref['prod'], $media)\n : $this->_tag('css', $ref['dev'], $media)\n ;\n }\n elseif( ! $ref['minify'])\n {\n $files[] = (isset($ref['prod']))\n ? array('prod'=>$ref['prod'], 'dev'=>$ref['dev'], 'minify'=>$ref['minify'] )\n : array('dev'=>$ref['dev'], 'minify'=>$ref['minify'])\n ;\n }\n else\n {\n $files[] = (isset($ref['prod']))\n ? array('prod'=>$ref['prod'], 'dev'=>$ref['dev'] )\n : array('dev'=>$ref['dev'])\n ;\n }\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$lastmodified = ($lastmodified == 0) ? '0000000000' : $lastmodified;\n\t\t\t\t\n\t\t\t\t$filename = $lastmodified . md5($filenames).'.css';\n\t\t\n if( ! file_exists($this->cache_path.$filename))\n {\n $this->_combine('css', $files, $filename);\n }\n\t\t\t\techo $this->_tag('css', $filename, TRUE, $media);\n\t\t }\n }\n elseif($this->combine && ! $this->minify_css)\n {\n // we're combining bot not minifying\n foreach($this->css[$group] as $media => $refs)\n {\n\t\t\t\t// lets try to cache it, shall we?\n\t\t\t\t$lastmodified = 0;\n\t\t\t\t$files = array();\n\t\t\t\t$filenames = '';\n\t\t\t\n foreach ($refs as $ref)\n {\n\t\t\t\n\t\t\t\t\t$lastmodified = max($lastmodified, filemtime( realpath( $this->style_path . $ref['dev'] ) ) );\n\t\t\t\t\t$filenames .= $ref['dev'];\n\t\t\t\t\n if($ref['combine'] == false)\n {\n echo (isset($ref['prod']))\n ? $this->_tag('css', $ref['prod'], $media)\n : $this->_tag('css', $ref['dev'], $media)\n ;\n }\n else\n {\n $files[] = (isset($ref['prod']))\n ? array('prod'=>$ref['prod'], 'dev'=>$ref['dev'], 'minify'=>FALSE )\n : array('dev'=>$ref['dev'], 'minify'=>FALSE)\n ;\n }\n }\n\t\t\t\t\n\t\t\t\t$lastmodified = ($lastmodified == 0) ? '0000000000' : $lastmodified;\n\t\t\t\t\n\t\t\t\t$filename = $lastmodified . md5($filenames).'.css';\n\t\t\t\n if( ! file_exists($this->cache_path.$filename))\n {\n $this->_combine('css', $files, $filename);\n }\n\t\t\t\techo $this->_tag('css', $filename, TRUE, $media);\n }\n }\n elseif( ! $this->combine && $this->minify_css)\n {\n // we want to minify, but not combine\n foreach($this->css[$group] as $media => $refs)\n {\n foreach($refs as $ref)\n {\n if(isset($ref['prod']))\n {\n\t\t\t\t\t\t$f = $this->style_uri . $ref['prod'];\n }\n elseif( ! $ref['minify'])\n {\n\t\t\t\t\t\t$f = $this->style_uri . $ref['dev'];\n }\n else\n {\n\t\t\t\t\t\t$f = filemtime(realpath($this->style_path . $ref['dev'])) . md5($ref['dev']) . '.css';\n\t\t\t\t\n if( ! file_exists($this->cache_path.$f) )\n {\n\t\t\t\t\t\t\t$c = $this->_minify( 'css', $ref['dev'] );\n\t\t\t\t\t\t\t$this->_cache($f, $c);\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\techo $this->_tag('css', $f, TRUE, $media);\n\t }\t\n }\n }\n else\n {\n // we're in a production environment, but not minifying or combining.\n foreach($this->css[$group] as $media => $refs)\n {\n foreach($refs as $ref)\n {\n\t\t\t\t\t$f = (isset($ref['prod'])) ? $ref['prod'] : $ref['dev'];\n\t\t\t\t\techo $this->_tag('css', $f, FALSE, $media);\n\t\t\t }\n\t\t }\n\t\t}\n }", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "function GetStylesheetes()\n{\n $isMobile = check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile' ? false :true;\n $append = $isMobile ? '.mobile.css':'.css';\n $stylesheets = GetTheDataArray(array('theme','stylesheet'));\n $returnData = '';\n foreach($stylesheets as $key => $style)\n {\n $file = '';\n if($key == 'core') {\n //include core stylesheet and decide if mobile stylesheet should be used\n if(check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile')\n {\n $style = $style['primary'];\n\n } else {\n $style = $style['mobile'];\n\n }\n\n $httpFile = base_url().'theme/'.THEMESELECTED.'/css/'.$style;\n $file = THEMEPATH.THEMESELECTED.'/css/'.$style;\n //including files from project data css folder configured in projectconfig.php\n } elseif($key == 'include'){\n foreach($style as $st)\n {\n $httpFile = base_url().'project/'.PROJECT.'/data/css/'.$st.$append;\n $file = PROJECTROOT.PROJECT.'/data/css/'.$st.$append;\n }\n\n }\n\n if(file_exists($file))\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.$httpFile.'\"/>';\n }\n\n }\n //adding include files depending on what device is being used\n foreach($stylesheets['core']['includes'] as $includes)\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.base_url().'theme/'.THEMESELECTED.'/css/includes/'.$includes.$append.'\"/>';\n }\n //adding animation files\n if(iteraxcontroller::Instance()->it->data['theme']['animations'] === true)\n {\n foreach($stylesheets['animations'] as $includes)\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.base_url().'theme/'.THEMESELECTED.'/css/animation/'.$includes.'\"/>';\n }\n }\n\n\n return $returnData;\n}", "public function read_css() {\r\n\t\t// 1. wir müssen wissen, welche Thema zZ. aktiv ist.\r\n\t\t$cssfile = $this->get_cssfile_name();\r\n\t\t// 2. den Inhalt der CSS-Datei auslesen\r\n\t\t$csscont = $this->read_cssfile($cssfile);\r\n\t\treturn $csscont;\r\n\t}", "protected function getImages()\n {\n $directory = new RecursiveDirectoryIterator($this->origin, FilesystemIterator::SKIP_DOTS);\n $iterator = new RecursiveIteratorIterator($directory);\n\n return new RegexIterator($iterator, '/\\.(jpg|jpeg|gif|png)$/');\n }", "function init() {\r\n $this->load_upcss();\r\n }", "function _findimages(&$data){\n global $conf;\n $files = array();\n\n // http URLs are supposed to be media RSS feeds\n if(preg_match('/^https?:\\/\\//i',$data['ns'])){\n $files = $this->_loadRSS($data['ns']);\n $data['_single'] = false;\n }else{\n $dir = utf8_encodeFN(str_replace(':','/',$data['ns']));\n // all possible images for the given namespace (or a single image)\n if(is_file($conf['mediadir'].'/'.$dir)){\n require_once(DOKU_INC.'inc/JpegMeta.php');\n $files[] = array(\n 'id' => $data['ns'],\n 'isimg' => preg_match('/\\.(jpe?g|gif|png)$/',$dir),\n 'file' => basename($dir),\n 'mtime' => filemtime($conf['mediadir'].'/'.$dir),\n 'meta' => new JpegMeta($conf['mediadir'].'/'.$dir)\n );\n $data['_single'] = true;\n }else{\n $depth = $data['recursive'] ? 0 : 1;\n search($files,\n $conf['mediadir'],\n 'search_media',\n array('depth'=>$depth),\n $dir);\n $data['_single'] = false;\n }\n }\n\n // done, yet?\n $len = count($files);\n if(!$len) return $files;\n if($data['single']) return $files;\n\n // filter images\n for($i=0; $i<$len; $i++){\n if(!$files[$i]['isimg']){\n unset($files[$i]); // this is faster, because RE was done before\n }elseif($data['filter']){\n if(!preg_match($data['filter'],noNS($files[$i]['id']))) unset($files[$i]);\n }\n }\n if($len<1) return $files;\n\n // random?\n if($data['random']){\n shuffle($files);\n }else{\n // sort?\n if($data['sort'] == 'date'){\n usort($files,array($this,'_datesort'));\n }elseif($data['sort'] == 'mod'){\n usort($files,array($this,'_modsort'));\n }elseif($data['sort'] == 'title'){\n usort($files,array($this,'_titlesort'));\n }\n\n // reverse?\n if($data['reverse']) $files = array_reverse($files);\n }\n\n // limits and offsets?\n if($data['offset']) $files = array_slice($files,$data['offset']);\n if($data['limit']) $files = array_slice($files,0,$data['limit']);\n\n return $files;\n }", "function allLoadJs($path){\n \n $diretorio = dir($path);\n\n while($arquivo = $diretorio -> read()){\n //verifica apenas as extenções do css \n if(strpos($arquivo, '.js')!==FALSE)\n echo (\"<script src='\".BARRA.url_base.BARRA.$path.$arquivo.\"' type='text/javascript'></script>\\n\");\n }\n $diretorio -> close();\n\n }", "protected function toCSS( $file ) {\n\t\t$match = array();\n\t\t$cssFile = FileUtility::getFinalName($file);\n\t\tif($cssFile !== null){\n\t\t\tif ( isset( $GLOBALS['TT'] ) ) {\n\t\t\t\t$GLOBALS['TT']->push( 'SCSS|SASS to CSS', '...' . substr( $file, - 30 ) );\n\t\t\t}\n\t\t\t$fullPath = PATH_site . $file;\n\t\t\t$cssFullPath = PATH_site . $cssFile;\n\t\t\tif ( ! is_file( $cssFullPath ) || $this->isFileInDevMod( $fullPath ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t// Fix relative image relative path\n\t\t\t\t\t$newRelativePath = str_repeat( '../', count( GeneralUtility::trimExplode( '/', $this->cssPath ) ) ) . rtrim( dirname( $file ), '/' ) . '/';\n\t\t\t\t\t$cssContent = preg_replace(\n\t\t\t\t\t\t\t'/(url\\([^\\.\\)\\/]*)\\.\\./i', '$1' . $newRelativePath . '..', $this->parser->parse( $fullPath ) );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\t$cssContent = $this->renderException( $e, $file );\n\t\t\t\t}\n\t\t\t\tGeneralUtility::writeFile( $cssFullPath, $cssContent );\n\t\t\t\tif ( is_file( $cssFullPath ) ) {\n\t\t\t\t\t$file = $cssFile;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$file = $cssFile;\n\t\t\t}\n\t\t\tif ( isset( $GLOBALS['TT'] ) ) {\n\t\t\t\t$GLOBALS['TT']->pull();\n\t\t\t}\n\t\t}\n\n\t\treturn $file;\n\t}", "function cssFiles($cssFile = false) {\n\t\n\tif ($cssFile) $this->cssFiles[] = $cssFile;\n\telse return $this->cssFiles;\n }", "public function crawl() {\n\t\t$sDirectories = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\tif ( $sDirectories === '' ) return $sDirectories;\n\n\t\t$aDirectories = explode( ',', $sDirectories );\n\t\tforeach ( $aDirectories as $sDirectory ) {\n\t\t\t$sDir = trim ( $sDirectory );\n\t\t\tif( !is_dir( $sDir ) ) continue;\n\t\t\t$this->readInFiles( $sDir );\n\t\t}\n\t\treturn $this->aFiles;\n\t}" ]
[ "0.7313089", "0.682833", "0.67335427", "0.6691646", "0.6673036", "0.6495293", "0.6486712", "0.6344852", "0.6308274", "0.6184599", "0.6152373", "0.6046938", "0.60176307", "0.5997407", "0.59607375", "0.5951366", "0.5904705", "0.58877546", "0.5876533", "0.58764654", "0.5857931", "0.5838931", "0.57583994", "0.57281893", "0.5723512", "0.5710182", "0.5707117", "0.56960505", "0.5693965", "0.569117", "0.56680596", "0.5664047", "0.56556034", "0.56453186", "0.5630686", "0.5628425", "0.56182516", "0.5601607", "0.5593491", "0.5564097", "0.5553022", "0.5553022", "0.5544818", "0.5525762", "0.5488835", "0.54726946", "0.5467635", "0.54636693", "0.5422253", "0.5396816", "0.5382248", "0.5363454", "0.5358095", "0.5354674", "0.53508496", "0.5342686", "0.5333327", "0.53328186", "0.53303164", "0.53237605", "0.531933", "0.5311945", "0.5311317", "0.5311099", "0.53110987", "0.5305977", "0.52896935", "0.52895373", "0.5280324", "0.52708536", "0.5267426", "0.5261774", "0.52501684", "0.52498966", "0.5249696", "0.5246939", "0.5245631", "0.5245276", "0.5237699", "0.52364814", "0.5232359", "0.5220041", "0.521495", "0.52107185", "0.5203441", "0.51846325", "0.5174336", "0.5170083", "0.5169582", "0.5157731", "0.51516443", "0.51511085", "0.5149036", "0.51351005", "0.5126183", "0.51247317", "0.51140726", "0.5113317", "0.51097447", "0.5097331" ]
0.80734646
0
formats array contents ready for display (default: php)
public function output($type = 'php'){ // crawl the site $this->crawl(); $this->parseCSS(); // switch statement to make it easy to add different output formats switch($type){ case 'php': // for php format, return an array of page count, $visited and $links $return['crawl']['paths_total'] = count($this->visited); sort($this->visited); $return['crawl']['paths'] = $this->visited; $temp = array(); foreach ($this->links as $key => $value) { foreach ($value as $key => $value) { $temp[] = $value; } } $temp = array_unique($temp); sort($temp); $return['crawl']['links_total'] = count($temp); $return['crawl']['links'] = $temp; ksort($this->links); // loop through all arrays in $links to add the per-page total foreach ($this->links as $path => $links) { $return['link_map'][$path.':'.count($links)] = $links; } break; case 'xml': // for xml, make an xml document of $links and save to the server using the domain that was crawled as the filename $xml_doc = new DOMDocument(); $xml_doc->formatOutput = true; $root = $xml_doc->createElement('site_crawl'); // pages visited $visited = $xml_doc->createElement('crawled'); $visited_count = $xml_doc->createAttribute('total'); $visited_count->value = count($this->visited); $visited->appendChild($visited_count); foreach ($this->visited as $key => $value) { $path = $xml_doc->createElement('page', 'http://'.$this->url.$value); $path_id = $xml_doc->createAttribute('path'); $path_id->value = $value; $path->appendChild($path_id); $visited->appendChild($path); } // links per page $links = $xml_doc->createElement('links'); // loop through all the arrays in $links foreach ($this->links as $file_path => $hrefs) { // create element for each array $path = $xml_doc->createElement('page'); $path_id = $xml_doc->createAttribute('path'); // use array's key (path crawled) as element's ID $path_id->value = $file_path; $path->appendChild($path_id); // loop through all links in each array, adding to element foreach ($hrefs as $href) { $link = $xml_doc->createElement('link', 'http://'.$this->url.$href); $link_id = $xml_doc->createAttribute('path'); $link_id->value = $href; $link->appendChild($link_id); $path->appendChild($link); } $links->appendChild($path); } $root->appendChild($visited); $root->appendChild($links); $xml_doc->appendChild($root); $xml_doc->normalizeDocument(); // create filename from domain name $name = explode('.', $this->url); if(count($name) > 2){ $name = $name[1]; } else { $name = $name[0]; } $name .= '_sitecrawl.xml'; $xml_file = fopen($name, 'w'); fwrite($xml_file, $xml_doc->saveXML()); fclose($xml_file); $return = $name; break; case 'sitemap': // new DOMDocument $xml_doc = new DOMDocument(); $xml_doc->formatOutput = true; // root 'urlset' element with URI of the schema $root = $xml_doc->createElement('urlset'); $xmlns = $xml_doc->createAttribute('xmlns'); $xmlns->value = 'http://www.sitemaps.org/schemas/sitemap/0.9'; $root->appendChild($xmlns); // create the individual 'url' elements sort($this->visited); foreach ($this->visited as $key => $value) { $url = $xml_doc->createElement('url'); $loc = $xml_doc->createElement('loc', 'http://'.$this->url.$value); $url->appendChild($loc); $root->appendChild($url); } // finish up $xml_doc->appendChild($root); $xml_doc->normalizeDocument(); // name, save and return $name = 'sitemap.xml'; $xml_file = fopen($name, 'w'); fwrite($xml_file, $xml_doc->saveXML()); fclose($xml_file); $return = $name; break; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmldump ( $array ) {\r\n\t\tforeach($array as $key => $val) {\r\n\t\t\t$return .= $this->ul(\r\n\t\t\t\t\t\t$this->li($this->font($key)) .\r\n\t\t\t\t\t\t\t$this->ul(\r\n\t\t\t\t\t\t\t\t$this->font(is_array($val) ? $this->htmldump($val) : $this->li($val))\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "private function arrayToPrint()\n\t{\n\t\t$this->view->addToReplace($this->langArr);\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->arrRender['CONTENT'] = $this->view\n\t\t\t->setTemplateFile('employeeedit')->renderFile();\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->view->setTemplateFile('index')->templateRender();\n\t}", "function formatData($data) {\n\t$out = '<dl>';\n\tforeach ($data as $key => $value) {\n\t\t$out.= '<dt>'.$key.'</dt><dd>'.(is_array($value)? '': htmlspecialchars($value)).'</dd>';\n\t}\n\treturn $out.'</dl>';\n}", "function pre_print_r($array){\n\n\techo '<pre style=\"font-family: monospace; font-size: 14px; text-align:left!important\">';\n\tprint_r($array);\n\techo '</pre>';\n\n}", "protected function renderArray() {}", "function dump($array) {\n\treturn \"<pre>\" . htmlentities(print_r($array, 1)) . \"</pre>\";\n}", "protected abstract function formatArrayValue(array $value);", "function get_a($object, $html_format = true)\n{\n if (is_array($object)) {\n $content = print_r($object, true);\n } else {\n ob_start();\n var_dump($object);\n $content = ob_get_contents();\n ob_end_clean();\n }\n if ($html_format) {\n $content = \"<pre>\".htmlentities($content).\"</pre>\";\n }\n return $content;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function _pre($array) { echo '<pre>'; print_r ($array); echo '</pre>'; }", "public function format(array $record);", "function tfjecho($array) {\r\n die(json_encode($array));\r\n }", "function pprint($array, $file_name='array'){\n /**\n * Pretty print Arrays - in collapsible and scrollable boxes\n *\n * @param Array to be printed\n * @param String as name of the printed box\n *\n * @return HTML non semantic...\n */\n $id = random_int(0, 999);\n echo '<style type=\"text/css\">input#'.$id.':checked ~ div.ijwe {display: none;}</style>';\n echo '<br><div style=\"background-color:#b1b1b1; border: 1px solid #949494; width:96%; margin: auto;\">';\n echo '<input type=\"checkbox\" id=\"toggle-'.$id.'\" style=\"display:inline; width:15px; background-color:transparent;\"><label style=\" white-space:nowrap; clear: both; width:0px;\" for=\"toggle-'.$id.'\"><h3 style=\"display:inline; line-height: 2px; margin: 1em;\">'.$file_name.':</h3></label>';\n echo '<div class=\"ijwe\" style=\"background-color:#c4c4c4; overflow-y: scroll; padding: 0.3em; max-height:400px;\"><pre><xmp>';\n print_r($array);\n echo '</xmp></pre></div>';\n echo '</div>';\n}", "function dump_array($array)\n{\n\n\t$_str = \"<table bgcolor = '%s'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table><br>\";\n\n\tif(is_array($array)){\n\n\t\t$size = count($array);\n\t\t$string = \"\";\n\n\t\tif($size) {\n\n\t\t\t$string .= \"{ <br>\";\n\n\t\t\tforeach($array as $a => $b) {\n\n\t\t\t\tif(is_array($b)) { $b = dump_array($b); }\n\t\t\t\tif(is_object($b)) { $b = dump_array(object_to_array($b)); }\n\t\t\t\t$string .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>$a = '$b'</b><br>\";\n\n \t\t}\n\n\t\t\t$string .= \" }<br>\";\n\t\t}\n\n\t\t$r = sprintf($_str, '#DACE0B', $string);\n\n\t\treturn $r;\n\n } else { return $array; }\n}", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "function dump_array($the_array)\n{\n echo \"<ul>\";\n\n foreach ($the_array as $key1 => $value1) {\n echo \"<li><span class='key'>$key1</span>\";\n\n # If the value is itself an array, then print that as well.\n if (is_array($value1)) {\n echo \"<ul>\";\n foreach ($value1 as $key2 => $value2) {\n $pvalue = $value2;\n if (is_array($value2)) {\n $pvalue = \"&lt;an array&gt;\";\n }\n echo \"<li><span class='key'>$key2</span><span class='value'> $pvalue</span></li>\\n\";\n } # end inner foreach ($value1 as $key2 => $value2)\n echo \"</ul></li>\\n\";\n } else {\n echo \"<span class='value'> $value1</span></li>\\n\";\n }\n } # end outer foreach ($the_array as $key1 => $value1)\n echo \"</ul>\\n\";\n}", "function diplayArray($array){\n echo '<pre>';\n var_dump($array);\n echo'</pre>';\n}", "function format_array( $name, &$array2format ){\n $cnt = 0;\n $ret = '';\n\n if( count($array2format) === 0 ){\n //no values, create empty array to have a default in settings.conf\n return $name.'[0]=\"\"';\n }\n\n reset($array2format);\n foreach( $array2format as $val ){\n if( $val != '' ){\n $ret .= $name.\"[$cnt]='$val'\\n\";\n ++$cnt;\n }\n }\n\n $ret = trim($ret, \"\\n\");\n return $ret;\n }", "public function render(){\n\t\t$data = array();\n\n\t\tforeach($this->fields as $fieldName => $field){\n\t\t\t$field->invokeContents($field->getValue(), $field);\n\t\t\t$data[$fieldName] = $this->renderTag($field);\n $data['fieldData'][$fieldName] = $this->renderArray($field);\n\t\t}\n $data['namespace'] = $this->settings['namespace'];\n\t\t$data['errors'] = $this->getMessageBag()->get(\"errors\");\n\t\t$data['messages'] = $this->getMessageBag()->get(\"messages\");\n $data['fieldData'] = substr(json_encode($data['fieldData']), 1, -1); // <-- remove outer curly's for IDE\n\n\t\treturn $data;\n\t}", "public function format_array_to_text($array){\n return implode(\"\\n\", $array);\n }", "function htmlspecialchars_array($data){\r\n\tif ( is_array($data) ){\r\n\t\tforeach ( $data as $k => $v ){\r\n\t\t\t$data[$k] = ( is_array($v) ) ? htmlspecialchars_array($v) : htmlspecialchars($v);\r\n\t\t}\r\n\t}\r\n\treturn $data;\r\n}", "function dumpArray($elements) {\n $result = \"<ol>\\n\";\n foreach ($elements as $key => $value) {\n if (is_array($value)) {\n $result .= \"<li>Key <b>$key</b> is an array\n containing:\\n\" . dumpArray($value) . \"</li>\";\n } else {\n $value = nl2br(htmlspecialchars($value));\n $result .= \"<li>Key <b>$key</b> has value [<b>$value</b>]</li>\\n\";\n }\n }\n return $result . \"</ol>\\n\";\n}", "static function DisplayArray($array)\r\n {\r\n $depth = 0;\r\n if (is_array($array))\r\n {\r\n echo \"Array (<br />\";\r\n for($i = 0; $i < count($array); $i ++)\r\n {\r\n if (is_array($array[$i]))\r\n {\r\n DisplayInlineArray($array[$i], $depth + 1, $i);\r\n }\r\n else\r\n {\r\n echo \"[\" . $i . \"] => \" . $array[$i];\r\n echo \"<br />\";\r\n $depth = 0;\r\n }\r\n }\r\n echo \")<br />\";\r\n }\r\n else\r\n {\r\n echo \"Variabele is geen array\";\r\n }\r\n }", "function display($content)\n{\n foreach($content as $key => $value) \n {\n\t print_r($key.\"=>\");\n print_r($value);\n print_r(\"\\n\");\n }\n}", "function preShow( $arr, $returnAsString=false ) {\n $ret = '<pre>' . print_r($arr, true) . '</pre>';\n if ($returnAsString)\n return $ret;\n else\n echo $ret;\n}", "function outputformat_drush_engine_outputformat() {\n $common_topic_example = array(\n \"a\" => array(\"b\" => 2, \"c\" => 3),\n \"d\" => array(\"e\" => 5, \"f\" => 6)\n );\n\n $engines = array();\n $engines['table'] = array(\n 'description' => 'A formatted, word-wrapped table.',\n 'engine-capabilities' => array('format-table'),\n );\n $engines['key-value'] = array(\n 'description' => 'A formatted list of key-value pairs.',\n 'engine-capabilities' => array('format-single', 'format-list', 'format-table'),\n 'hidden' => TRUE,\n );\n $engines['key-value-list'] = array(\n 'engine-class' => 'list',\n 'list-item-type' => 'key-value',\n 'description' => 'A list of formatted lists of key-value pairs.',\n 'list-field-selection-control' => 1,\n 'engine-capabilities' => array('format-table'),\n 'hidden' => TRUE,\n );\n $engines['json'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'Javascript Object Notation.',\n 'topic-example' => $common_topic_example,\n );\n $engines['string'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'A simple string.',\n 'engine-capabilities' => array('format-single'),\n );\n $engines['message'] = array(\n 'machine-parsable' => FALSE, // depends on the label....\n 'hidden' => TRUE,\n );\n $engines['print-r'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'Output via php print_r function.',\n 'verbose-only' => TRUE,\n 'topic-example' => $common_topic_example,\n );\n $engines['var_export'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'An array in executable php format.',\n 'topic-example' => $common_topic_example,\n );\n $engines['yaml'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'Yaml output format.',\n 'topic-example' => $common_topic_example,\n );\n $engines['php'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'A serialized php string.',\n 'verbose-only' => TRUE,\n 'topic-example' => $common_topic_example,\n );\n $engines['config'] = array(\n 'machine-parsable' => TRUE,\n 'engine-class' => 'list',\n 'list-item-type' => 'var_export',\n 'description' => \"A configuration file in executable php format. The variable name is \\\"config\\\", and the variable keys are taken from the output data array's keys.\",\n 'metadata' => array(\n 'variable-name' => 'config',\n ),\n 'list-field-selection-control' => -1,\n 'engine-capabilities' => array('format-list','format-table'),\n 'verbose-only' => TRUE,\n );\n $engines['list'] = array(\n 'machine-parsable' => TRUE,\n 'list-item-type' => 'string',\n 'description' => 'A simple list of values.',\n // When a table is printed as a list, only the array keys of the rows will print.\n 'engine-capabilities' => array('format-list', 'format-table'),\n 'topic-example' => array('a', 'b', 'c'),\n );\n $engines['nested-csv'] = array(\n 'machine-parsable' => TRUE,\n 'engine-class' => 'list',\n 'list-separator' => ',',\n 'list-item-type' => 'csv-or-string',\n 'hidden' => TRUE,\n );\n $engines['csv-or-string'] = array(\n 'machine-parsable' => TRUE,\n 'hidden' => TRUE,\n );\n $engines['csv'] = array(\n 'machine-parsable' => TRUE,\n 'engine-class' => 'list',\n 'list-item-type' => 'nested-csv',\n 'labeled-list' => TRUE,\n 'description' => 'A list of values, one per row, each of which is a comma-separated list of values.',\n 'engine-capabilities' => array('format-table'),\n 'topic-example' => array(array('a', 12, '[email protected]'),array('b', 17, '[email protected]')),\n );\n $engines['variables'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'A list of php variable assignments.',\n 'engine-capabilities' => array('format-table'),\n 'verbose-only' => TRUE,\n 'list-field-selection-control' => -1,\n 'topic-example' => $common_topic_example,\n );\n $engines['labeled-export'] = array(\n 'machine-parsable' => TRUE,\n 'description' => 'A list of php exports, labeled with a name.',\n 'engine-capabilities' => array('format-table'),\n 'verbose-only' => TRUE,\n 'engine-class' => 'list',\n 'list-item-type' => 'var_export',\n 'metadata' => array(\n 'label-template' => '!label: !value',\n ),\n 'list-field-selection-control' => -1,\n 'topic-example' => $common_topic_example,\n );\n return $engines;\n}", "public function displayArray()\r\n\t{\r\n\t\t$this->addThingsToPrint(\"<h2><a href=\\\"\" . $this->contentURL . \"\\\">\" . $this->contentURL . \"</a></h2>\");\r\n\t\t$this->addThingsToPrint(\"<pre>\" . print_r(json_decode($this->getJsonData()), TRUE) . \"</pre>\");\r\n\t\t$fullContent = RestUtils::getHTTPHeader('Testing') . $this->dataToPrint . RestUtils::getHTTPFooter(); \r\n\t\tRestUtils::sendResponse(200, $fullContent);\r\n\t}", "public static function printArray ($array)\r\n\t{\r\n\t\t# If the input is not an array, convert it\r\n\t\t$array = self::ensureArray ($array);\r\n\t\t\r\n\t\t# Loop through each item\r\n\t\t$hash = array ();\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\tif ($value === false) {$value = '0';}\r\n\t\t\t$hash[] = \"$key => $value\";\r\n\t\t}\r\n\t\t\r\n\t\t# Assemble the text as a single string\r\n\t\t$text = implode (\",\\n\", $hash);\r\n\t\t\r\n\t\t# Return the text\r\n\t\treturn $text;\r\n\t}", "private function printArray($array){\n\t\techo \"<pre>\".print_r($array,true).\"</pre>\";\n\t}", "function print_r_html ($arr) {\n\techo \"<pre>\";\n print_r($arr);\n echo \"</pre>\";\n}", "function printJSON($array){\n\t\t\techo '<code>'. json_encode($array) .'</code>';\n\t\t}", "function meta_content($arr=array()){\n $output = NULL;\n if(empty($arr)){\n return $output;\n }\n\n foreach($arr AS $meta => $data){\n $output .= '<meta name=\"'.strtolower($data['name']).'\" content=\"'.htmlspecialchars($data['content'],null,null,false).'\" />';\n }\n return $output;\n}", "public function renderData(array $data)\n\t{\n\t\treturn $this->_format($this->_print($data));\n\t}", "public function display_data() {\n return format_text($this->data, $this->dataformat, array('overflowdiv' => true));\n }", "static function fmt($val){\r\n if (is_array($val)) {\r\n $buf = array();\r\n foreach ($val as $k=>$v) {\r\n $buf[] = self::fmt($k) . '=>' . self::fmt($v);\r\n }\r\n return 'array(' . implode(', ', $buf) . ')';\r\n }\r\n if (is_string($val)) return self::quote($val);\r\n if (is_null($val)) return 'NULL';\r\n if (true===$val) return 'TRUE';\r\n if (false===$val) return 'FALSE';\r\n try {\r\n return strval($val);\r\n }\r\n catch (Exception $e){}\r\n ob_start();\r\n print_r($val);\r\n $val = ob_get_contents();\r\n ob_end_clean();\r\n return $val;\r\n }", "public static function print_rHTML($array)\r\n\t{\r\n\t\tif( ! self::isHTML() ) return;\r\n\t\tCommon::print_r($text);\r\n\t}", "function printarr($a, $descr = '') \r\n{\r\n\tif (!is_array($a)) \r\n\t{\r\n\t\tob_start();\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprintbr('<b>' . $descr . '</b>');\r\n\t\t}\r\n\t\tvar_dump($a);\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t} else {\r\n\t\tob_start();\r\n\t\tprint '<pre>';\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprint('<b>' . $descr . '</b>' . \"\\n\");\r\n\t\t}\r\n\t\tprint_r($a);\r\n\t\tprint '</pre>';\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t}\r\n}", "function DisplayArray($array) {\n foreach ($array as $value) {\n if (is_array($value)) {\n DisplayArray($value);\n } else {\n echo $value . \"<br>\";\n }\n }\n }", "protected function processPhp(array $data)\n {\n\t\t$content = \"<?php \\n /* generated config file */ \\n return \";\n\t\t$content .= $this->printArray($data);\n\t\t$content .= \"\\n?>\";\n\n return $content;\n\t}", "function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for ($i = 0; $i < sizeof($array); $i++) {\n $alist .= \"<li>$array[$i]\";\n }\n $alist .= \"</ul>\";\n return $alist;\n}", "public function toArray()\n {\n return array(\n 'lucida' => Mage::helper('markdown')->__('Lucida Sans'),\n '' => Mage::helper('markdown')->__('Yes'),\n );\n }", "public function render(array $data): string;", "public function format($data);", "public function format($data);", "function angela_print_array($arr, $spaces = 0)\n{\n\t$sp=$spaces+1;\n\t\n\tif (is_array($arr))\n\t\tforeach ( $arr as $arrkey => $arrval )\n\t\t{\n\t\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\t\techo \"[$arrkey] => <br>\\n\";\n\t\t\tangela_print_array($arrval, $sp);\n\t\t}\n\telse\n\t{\n\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\tif (!isset($arr))\n\t\t\techo \"-- empty --<br>\";\n\t\telse\n\t\t\techo \"$arr <br>\";\n\t}\n}", "function print_pre($array){\n\t\techo '<pre>';\n\t\tprint_r($array);\n\t\techo '</pre>';\n\t}", "protected function format(array $message)\n\t{\n\t\t$output = self::DEFAULT_FORMAT_ECHO;\n\t\tforeach($message as $part => $value)\n\t\t{\n\t\t\tif('extra' == $part && count($value))\n\t\t\t{\n\t\t\t\t$value = $this->normalize($value);\n\t\t\t}\n\t\t\telse if('extra' == $part)\n\t\t\t{\n\t\t\t\t// Don't print an empty array\n\t\t\t\t$value = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = $this->normalize($value);\n\t\t\t}\n\t\t\t$output = str_replace(\"%$part%\", $value, $output);\n\t\t}\n\t\treturn $output;\n\t}", "public function pp($arr){\n $retStr = \"<dl>\\n\";\n if (is_array($arr)){\n foreach ($arr as $key=>$val){\n if (is_array($val)){\n\t\t$retStr .= \"<dt>\" . $key . \" => </dt>\\n<dd>\" . $this->pp($val) . \"</dd>\\n\";\n\t\t}\n\t else{\n\t\t$retStr .= \"<dt>\" . $key . \" => </dt>\\n<dd>\" . $val . \"</dd>\\n\";\n\t\t}\n }\n }\n $retStr .= \"</dl>\\n\";\n return $retStr;\n}", "function ourExternalTpl($array, $content)\n {\n $content = str_replace(array(\"{TITLE}\", \"{PROJECT}\", \"{VERSION}\"), array($array['title'], $array['system']['title_project'], $array['system']['version_cms']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }", "function print_response($response) {\n foreach($response as $value) {\n if (is_array($value)) {\n print_response($value);\n }\n else {\n print sm_encode_html_special_chars($value).\"<br />\\n\";\n }\n }\n}", "function myShowArray($data)\n{\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n}", "function JSONoutputString($array){\n\t\t return json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);\n\t\t //return json_encode($array, 0);\n\t}", "public function getFormattedData();", "function print_array($data){\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n }", "function printArray($array){\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n }", "public static function viewArray($array_in) {\n\t\tif (is_array($array_in)) {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">';\n\t\t\tif (count($array_in) == 0) {\n\t\t\t\t$result .= '<tr><td><font face=\"Verdana,Arial\" size=\"1\"><strong>EMPTY!</strong></font></td></tr>';\n\t\t\t} else {\n\t\t\t\tforeach ($array_in as $key => $val) {\n\t\t\t\t\t$result .= '<tr><td valign=\"top\"><font face=\"Verdana,Arial\" size=\"1\">' . htmlspecialchars((string)$key) . '</font></td><td>';\n\t\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t\t$result .= self::viewArray($val);\n\t\t\t\t\t} elseif (is_object($val)) {\n\t\t\t\t\t\t$string = '';\n\t\t\t\t\t\tif (method_exists($val, '__toString')) {\n\t\t\t\t\t\t\t$string .= get_class($val) . ': ' . (string)$val;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string .= print_r($val, TRUE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (gettype($val) == 'object') {\n\t\t\t\t\t\t\t$string = 'Unknown object';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string = (string)$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t}\n\t\t\t\t\t$result .= '</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result .= '</table>';\n\t\t} else {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' .\n\t\t\t\tnl2br(htmlspecialchars((string)$array_in)) .\n\t\t\t\t'<br /></font></td>\n\t\t\t</tr>\n\t\t</table>'; // Output it as a string.\n\t\t}\n\t\treturn $result;\n\t}", "function print_array($array) {\n\n echo \"<pre>\";\n\n print_r($array);\n\n echo \"</pre>\";\n\n }", "abstract function format();", "function printFormatted($return=false){\n\t\t\tif($return){\n\t\t\t\treturn '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}else{\n\t\t\t\techo '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}\n\t\t}", "public function outputFunction($array, $depth=0, $tab=\"&nbsp;&nbsp;\") {\n foreach ($array as $key=>$value) {\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n if (is_numeric($key)) {\n echo $key.' => ';\n }\n else {\n echo '\\''.$key.'\\' => ';\n }\n if (is_array($value)) {\n echo 'array('.\"\\n\";\n $this->outputFunction($value, $depth+1);\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n echo '),'.\"\\n\";\n }\n else {\n // value\n if (is_numeric($value)) {\n echo $value.','.\"\\n\";\n }\n else {\n echo '\\''.$value.'\\','.\"\\n\";\n }\n }\n }\n }", "function printArray($data)\r\n{\r\n\techo \"<pre>\";\r\n\tprint_r($data);\r\n\techo \"</pre>\";\r\n}", "static function printr($array)\n {\n echo '<pre>' . print_r($array, true) . '</pre>';\n }", "function printr($array, $print = true) { //imprime o devuelve la cadena\n if ($print)\n return print_r($array, true);\n else\n echo '<pre>' . print_r($array, true) . '</pre>'; //tabula bien gracias a los <pre>\n }", "function ourInsideTpl($array, $content)\n {\n if (!isset($_COOKIE['char'])) { $array['char']['name'] = 'не выбран';} \n $content = str_replace(array(\"{TITLE}\", \"{USERNAME}\", \"{PROJECT}\", \"{VERSION}\", \"{CHAR}\"), array($array['title'], $array['username'], $array['system']['title_project'], $array['system']['version_cms'], $array['char']['name']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }", "function usingArraysMult()\r\n{ \r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 1) Print arrays elements by using Multidimensional Arrays.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n \r\n $fullForms = array (\r\n array(\"HTML \", \"Hypertext\",\" Markup Language\"),\r\n array(\"CSS \",\"Cascading\",\" Style Sheets\"),\r\n array(\"JS \",\"Java\",\"Script\")\r\n );\r\n \r\n $sizeOfArray = count($fullForms); \r\n \r\n if($sizeOfArray<1)\r\n {\r\n throw new Exception(\"Array is empty!!!\");\r\n } \r\n \r\n echo $fullForms[0][0].\": \".$fullForms[0][1].$fullForms[0][2].\".<br><br>\";\r\n echo $fullForms[1][0].\": \".$fullForms[1][1].$fullForms[1][2].\".<br><br>\";\r\n echo $fullForms[2][0].\": \".$fullForms[2][1].$fullForms[2][2].\".<br><br>\";\r\n}", "function text_pretty($data){\n\t\tif(!Tool::is_scalar($data)){\n\t\t\treturn htmlspecialchars(\\Grithin\\Debug::json_pretty($data));\n\t\t}else{\n\t\t\treturn htmlspecialchars($data);\n\t\t}\n\t}", "function array_pp($arr){\n\t$retStr = '<ul>';\n\tif (is_array($arr)){\n\t\tforeach ($arr as $key=>$val){\n\n\t\t\t$key = str_replace('_', ' ', $key);\n\t\t\t$key = ucwords($key);\n\n\t\t\tif (is_array($val)){\n\t\t\t\t$retStr .= '<li>' . $key . ': ' . array_pp($val) . '</li>';\n\t\t\t}else{\n\t\t\t\t$retStr .= '<li>' . $key . ': ' . $val . '</li>';\n\t\t\t}\n\t\t}\n\t}\n\t$retStr .= '</ul>';\n\treturn $retStr;\n}", "function _yamlizeArray($array,$indent) {\n\tif (is_array($array)) {\n\t\t$string = '';\n\t\tforeach ($array as $key => $value) {\n\t\t$string .= $this->_yamlize($key,$value,$indent);\n\t\t}\n\t\treturn $string;\n\t} else {\n\t\treturn false;\n\t}\n\t}", "abstract protected function generateMarkup(array $data): string;", "function generate($array) {\n $result = \"\";\n ob_start();\n if(sizeof($array)) {\n $i = 0;\n foreach($array as $string) {\n $i++;\n echo \"<span style='background-color: \".$this->colors[\"seq\"].\"; border-right: 1px solid #949494;'>\".$i.\".&nbsp;</span>&nbsp;\";\n echo $string.\"<br/>\\r\\n\";\n }\n }\n $result = ob_get_contents();\n ob_end_clean();\n return $result;\n }", "public function format(array $message);", "private function arrayToString($array)\r\n {\r\n return var_export($array, true);\r\n }", "public function contents() {\n\t\t$vals = array_values(get_object_vars($this));\n\t\treturn( array_reduce($vals, create_function('$a,$b','return is_null($a) ? \"$b\" : \"$a\".\"\\t\".\"$b\";')));\n\t}", "protected function prettyPrint(array $arr)\r\n {\r\n echo '<pre>', print_r($arr, 1), '</pre>';\r\n }", "function l($array) {\n\techo '<div style=\"position: absolute; z-index: 2000; background: #66cc99; '\n\t.'bottom: 30px; right: 30px; height: 40%; '\n\t.'width: 75%; padding:5px; overflow: auto; -moz-opacity: 0.88\">';\n\techo \"<pre>\";\n\tprint_r($array);\n\techo '</div>';\n}", "public static function format($info_array, $data_type)\n {\n }", "function echoContentsWithEOL($data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as $subItem)\r\n {\r\n echoContents($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n echo $data.PHP_EOL;\r\n }\r\n}", "function list_array( $des_array ){\n\tif( is_array( $des_array ) ){\n\t\techo '<ul>';\n\t\tforeach( $des_array as $item ){\n\t\t\techo '<li>' . $item . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}", "private function formatArrayToString(array $map): string\n\t{\n\t\t$resultString = '';\n\t\tforeach ($map as $key => $value) {\n\t\t\ttry {\n\t\t\t\t$resultString .= \" [$key] => \";\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$resultString .= $this->formatArrayToString($value);\n\t\t\t\t} else {\n\t\t\t\t\t$resultString .= strip_tags($value, '<b><i><pre>');\n\t\t\t\t}\n\t\t\t} catch (Throwable $exception) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn $resultString;\n\t}", "function printArray($array){\n print '<pre>';\n print_r($array);\n print '</pre>';\n}", "function _formatData($column, $value, &$R){\n global $conf;\n $vals = explode(\"\\n\",$value);\n $outs = array();\n foreach($vals as $val){\n $val = trim($val);\n if($val=='') continue;\n $type = $column['type'];\n if (is_array($type)) $type = $type['type'];\n switch($type){\n case 'page':\n $val = $this->_addPrePostFixes($column['type'], $val, ':');\n $outs[] = $R->internallink($val,null,null,true);\n break;\n case 'title':\n case 'pageid':\n list($id,$title) = explode('|',$val,2);\n $id = $this->_addPrePostFixes($column['type'], $id, ':');\n $outs[] = $R->internallink($id,$title,null,true);\n break;\n case 'nspage':\n // no prefix/postfix here\n $val = ':'.$column['key'].\":$val\";\n\n $outs[] = $R->internallink($val,null,null,true);\n break;\n case 'mail':\n list($id,$title) = explode(' ',$val,2);\n $id = $this->_addPrePostFixes($column['type'], $id);\n $id = obfuscate(hsc($id));\n if(!$title){\n $title = $id;\n }else{\n $title = hsc($title);\n }\n if($conf['mailguard'] == 'visible') $id = rawurlencode($id);\n $outs[] = '<a href=\"mailto:'.$id.'\" class=\"mail\" title=\"'.$id.'\">'.$title.'</a>';\n break;\n case 'url':\n $val = $this->_addPrePostFixes($column['type'], $val);\n $outs[] = '<a href=\"'.hsc($val).'\" class=\"urlextern\" title=\"'.hsc($val).'\">'.hsc($val).'</a>';\n break;\n case 'tag':\n // per default use keyname as target page, but prefix on aliases\n if(!is_array($column['type'])){\n $target = $column['key'].':';\n }else{\n $target = $this->_addPrePostFixes($column['type'],'');\n }\n\n $outs[] = '<a href=\"'.wl(str_replace('/',':',cleanID($target)),array('dataflt'=>$column['key'].'='.$val )).\n '\" title=\"'.sprintf($this->getLang('tagfilter'),hsc($val)).\n '\" class=\"wikilink1\">'.hsc($val).'</a>';\n break;\n case 'timestamp':\n $outs[] = dformat($val);\n break;\n case 'wiki':\n global $ID;\n $oldid = $ID;\n list($ID,$data) = explode('|',$val,2);\n $data = $this->_addPrePostFixes($column['type'], $data);\n // Trim document_{start,end}, p_{open,close}\n $ins = array_slice(p_get_instructions($data), 2, -2);\n $outs[] = p_render('xhtml', $ins, $byref_ignore);\n $ID = $oldid;\n break;\n default:\n $val = $this->_addPrePostFixes($column['type'], $val);\n if(substr($type,0,3) == 'img'){\n $sz = (int) substr($type,3);\n if(!$sz) $sz = 40;\n $title = $column['key'].': '.basename(str_replace(':','/',$val));\n $outs[] = '<a href=\"'.ml($val).'\" class=\"media\" rel=\"lightbox\"><img src=\"'.ml($val,\"w=$sz\").'\" alt=\"'.hsc($title).'\" title=\"'.hsc($title).'\" width=\"'.$sz.'\" /></a>';\n }else{\n $outs[] = hsc($val);\n }\n }\n }\n return join(', ',$outs);\n }", "private function ArrayToString ($array)\n {\n $str = null;\n if (is_array($array))\n foreach ($array as $valore) {\n if(is_string($valore))\n $str = $str.\"-\".$valore;\n else{$str=$str.\"\\n\".$valore->__toString();}\n }\n else\n $str = $array;\n return $str;\n }", "function opt_2_html($arr) {\n\t$r = array();\n\tforeach($arr AS $key=>$value) {\n\t\t$r[] = sechoe('%s=\"%s\"',$key,$value);\n\t}\n\treturn join(' ', $r);\n}", "function phpArrayToJS($array, $name, $options) {\r\n\t\tprint \"try { $name\" . \"['catTest'] = 'test'; } catch (err) { $name = new Object(); }\\n\";\r\n\r\n\t\tif (!$options['expandYears'] && $options['expandMonths']) {\r\n\t\t\t$lastYear = -1;\r\n\t\t\tforeach ($array as $key => $value) {\r\n\t\t\t$parts = explode('-', $key);\r\n\t\t\t$label = $parts[0];\r\n\t\t\t$year = $parts[1];\r\n\t\t\t$moreparts = explode(':', $key);\r\n\t\t\t$widget = $moreparts[1];\r\n\t\t\tif ($year != $lastYear) {\r\n\t\t\t\tif ($lastYear>0)\r\n\t\t\t\t\tprint \"';\\n\";\r\n\t\t\t\t\tprint $name . \"['$label-$year:$widget'] = '\" . addslashes(str_replace(\"\\n\", '', $value));\r\n\t\t\t\t\t$lastYear=$year;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprint addslashes(str_replace(\"\\n\", '', $value));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprint \"';\\n\";\r\n\t\t} else {\r\n\t\t\tforeach ($array as $key => $value) {\r\n\t\t\t\tprint $name . \"['$key'] = '\" . addslashes(str_replace(\"\\n\", '', $value)) . \"';\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function php2str($value, $formatOutput = true, $indent = 0, $tab = 2)\n {\n static $rep = ['\\\\' => '\\\\\\\\', \"\\n\" => '\\n', \"\\r\" => '\\r', \"\\t\" => '\\t', \"\\v\" => '\\v', \"\\e\" => '\\e', \"\\f\" => '\\f'];\n if (is_array($value))\n {\n if (count($value) == 0) return '[]';\n $tmp = [];\n $isInteger = array_keys($value) === range(0, count($value) - 1);\n if ($formatOutput)\n {\n $indent += $tab;\n if ($isInteger)\n {\n foreach ($value as $v)\n {\n $tmp[] = static::php2str($v, true, $indent, $tab);\n }\n }\n else\n {\n foreach ($value as $k => $v)\n {\n $tmp[] = static::php2str($k) . ' => ' . static::php2str($v, true, $indent, $tab);\n }\n }\n $space = PHP_EOL . str_repeat(' ', $indent);\n return '[' . $space . implode(', ' . $space, $tmp) . PHP_EOL . str_repeat(' ', $indent - $tab) . ']';\n }\n if ($isInteger)\n {\n foreach ($value as $v)\n {\n $tmp[] = static::php2str($v);\n }\n }\n else\n {\n foreach ($value as $k => $v)\n {\n $tmp[] = static::php2str($k) . ' => ' . static::php2str($v);\n }\n }\n return '[' . implode(', ', $tmp) . ']';\n }\n if (is_null($value)) return 'null';\n if (is_bool($value)) return $value ? 'true' : 'false';\n if (is_int($value)) return $value;\n if (is_float($value)) return str_replace(',', '.', $value);\n $flag = false;\n $value = preg_replace_callback('/([^\\x20-\\x7e]|\\\\\\\\)/', function($m) use($rep, &$flag)\n {\n $m = $m[0];\n if ($m == '\\\\') return '\\\\\\\\';\n $flag = true;\n return isset($rep[$m]) ? $rep[$m] : '\\x' . str_pad(dechex(ord($m)), 2, '0', STR_PAD_LEFT);\n }, $value);\n if ($flag) return '\"' . str_replace('\"', '\\\"', $value) . '\"';\n return \"'\" . str_replace(\"'\", \"\\\\'\", $value) . \"'\";\n }", "function echoContents($data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as $subItem)\r\n {\r\n echoContents($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n echo $data;\r\n }\r\n}", "public function __invoke(array $params, \\Smarty_Internal_Template $smarty)\n {\n if (!isset($params['value'])) {\n return \"\";\n }\n $array = $params['value'];\n if (is_string($array)) {\n $array = \\Yana\\Files\\SML::decode($array);\n }\n $configuration = $this->_getDependencyContainer()->getTemplateConfiguration();\n $lDelim = $configuration['leftdelimiter'];\n assert(!empty($lDelim));\n $rDelim = $configuration['rightdelimiter'];\n assert(!empty($rDelim));\n if (is_array($array)) {\n $array = \\Yana\\Util\\Strings::htmlSpecialChars((string) \\Yana\\Files\\SML::encode($array));\n $replacement = '<span style=\"color: #35a;\">$1</span>$2<span style=\"color: #35a;\">$3</span>';\n\n $array = preg_replace('/(&lt;\\w[^&]*&gt;)(.*?)(&lt;\\/[^&]*&gt;)$/m', $replacement, $array);\n $replacement = '<span style=\"color: #607; font-weight: bold;\">$0</span>';\n $array = preg_replace('/&lt;[^&]+&gt;\\s*$/m', $replacement, $array);\n\n $pattern = '/' . preg_quote($lDelim, '/') . '\\$[\\w\\.\\-_]+' . preg_quote($rDelim, '/') . '/m';\n $array = preg_replace($pattern, '<span style=\"color: #080;\">$0</span>', $array);\n\n $array = preg_replace('/\\[\\/?[\\w\\=]+\\]/m', '<span style=\"color: #800;\">$0</span>', $array);\n $array = preg_replace('/&amp;\\w+;/m', '<span style=\"color: #880;\">$0</span>', $array);\n $array = \"<pre>{$array}</pre>\";\n }\n return (string) $array;\n }", "function php2js( $arr, $arrName ) {\n $lineEnd=\"\";\n echo \"<script>\\n\";\n echo \" var $arrName = \".json_encode($arr, JSON_PRETTY_PRINT);\n echo \"</script>\\n\\n\";\n}", "function content_array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'/';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }", "function display($arr)\r\n {\r\n $str = implode($arr);\r\n echo $str.'<br />';\r\n\r\n }", "function print_html($value, $key)\r\n\t{\r\n\t\tif (is_array($value))\r\n\t\t{\r\n\t\t\tarray_walk($value,\"print_html\");\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\techo ($key.\" => \".$value.\"\\n<br>\\n\");\r\n\t\t}\r\n\t\t\r\n\t\treturn;\r\n\t}", "function print_array($array)\r\n{\r\n\techo '<pre>';\r\n\tprint_r($array);\r\n\techo '</pre>';\r\n}", "private function phpinfo2array()\n {\n $entitiesToUtf8 = function ($input) {\n // http://php.net/manual/en/function.html-entity-decode.php#104617\n return preg_replace_callback(\"/(&#[0-9]+;)/\", function ($m) {\n return mb_convert_encoding($m[1], \"UTF-8\", \"HTML-ENTITIES\");\n }, $input);\n };\n $plainText = function ($input) use ($entitiesToUtf8) {\n return trim(html_entity_decode($entitiesToUtf8(strip_tags($input))));\n };\n $titlePlainText = function ($input) use ($plainText) {\n return $plainText($input);\n };\n \n ob_start();\n phpinfo(-1);\n \n $phpinfo = array();\n \n // Strip everything after the <h1>Configuration</h1> tag (other h1's)\n if (!preg_match('#(.*<h1[^>]*>\\s*Configuration.*)<h1#s', ob_get_clean(), $matches)) {\n return array();\n }\n \n $input = $matches[1];\n $matches = array();\n \n if (preg_match_all(\n '#(?:<h2.*?>(?:<a.*?>)?(.*?)(?:<\\/a>)?<\\/h2>)|'.\n '(?:<tr.*?><t[hd].*?>(.*?)\\s*</t[hd]>(?:<t[hd].*?>(.*?)\\s*</t[hd]>(?:<t[hd].*?>(.*?)\\s*</t[hd]>)?)?</tr>)#s',\n $input,\n $matches,\n PREG_SET_ORDER\n )) {\n foreach ($matches as $match) {\n $fn = strpos($match[0], '<th') === false ? $plainText : $titlePlainText;\n if (strlen($match[1])) {\n $phpinfo[$match[1]] = array();\n } elseif (isset($match[3])) {\n $keys1 = array_keys($phpinfo);\n $phpinfo[end($keys1)][$fn($match[2])] = isset($match[4]) ? array($fn($match[3]), $fn($match[4])) : $fn($match[3]);\n } else {\n $keys1 = array_keys($phpinfo);\n $phpinfo[end($keys1)][] = $fn($match[2]);\n }\n }\n }\n \n return $phpinfo;\n }", "public function printSourceArray()\n {\n $this->show($this->SourceCodeArray);\n }", "function dump($data){\n\n $data=print_r($data,true);\n $html=\"<pre>$data</pre>\";\n return $html;\n}", "public function fix_format($array)\n {\n return $this->accountCtrl->fix_format($array);\n }", "protected function formatArrayForConsole(array $array): array\n {\n array_walk($array, function (&$value, $index) {\n $value = sprintf('%s: %s', $index, json_encode($value));\n });\n\n return $array;\n }", "private function formatData($array) {\n\n foreach($array as $field => $value) {\n\n if(is_array($value)) {\n // Recursive loop to save 2nd level changes\n $array[$field] = $this->formatData($value);\n\n } else {\n // Only format phone numbers\n if(is_numeric($value)) {\n $value = substr_replace($value, '(', 0, 0);\n \t\t\t$value = substr_replace($value, ')', 4, 0);\n \t\t\t$value = substr_replace($value, ' ', 5, 0);\n \t\t\t$value = substr_replace($value, '-', 9, 0);\n \t\t\t$array[$field] = $value;\n }\n // ******* add extra if's for any needed data changes in the future ********\n }\n }\n return $array;\n }", "public function provider_render() {\n return array(\n array(\n array(\n \n ),\n ),\n );\n }" ]
[ "0.6870602", "0.6686884", "0.63665843", "0.6327682", "0.6309093", "0.63050085", "0.6256581", "0.62448615", "0.61482674", "0.61482674", "0.61482674", "0.61468863", "0.61433005", "0.6129108", "0.60966706", "0.6089941", "0.6084735", "0.60721046", "0.60689163", "0.5991353", "0.5991219", "0.598251", "0.59813225", "0.59674704", "0.5923708", "0.5903273", "0.5879632", "0.58774954", "0.5877255", "0.58730674", "0.5863745", "0.5858218", "0.5854408", "0.5832749", "0.58290446", "0.58195734", "0.58019155", "0.5801665", "0.57983255", "0.5790793", "0.5786475", "0.57585484", "0.57405037", "0.5739313", "0.5721208", "0.5721208", "0.57099956", "0.5708515", "0.57004464", "0.5698289", "0.5688253", "0.56869394", "0.5681918", "0.5677951", "0.5663055", "0.56620044", "0.5660552", "0.56401396", "0.5636328", "0.56264853", "0.5626468", "0.56253445", "0.56231666", "0.5621176", "0.56115705", "0.5610795", "0.5604362", "0.5591784", "0.55916786", "0.55886054", "0.55880487", "0.55875885", "0.55871904", "0.5584016", "0.5570047", "0.5566332", "0.5564423", "0.5561903", "0.5556027", "0.55533767", "0.55532277", "0.55501556", "0.5542956", "0.5539049", "0.5538", "0.553602", "0.5535765", "0.5533812", "0.5532351", "0.5522542", "0.5510509", "0.55031914", "0.54969305", "0.54958475", "0.5492971", "0.54869324", "0.5484245", "0.54650044", "0.54644537", "0.5461978", "0.5456401" ]
0.0
-1
Create the structure for the displayed month
function mkMonth ($month) { $head = "<div class='fullwidth'>"; $head .= "<div class='month'>"; $head .= date("F", mktime(0,0,0,$month)); $head .= "</div>"; $head .= "<div id='jresult'>"; $head .= "</div>"; $head .= "<div id='week'>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Sunday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Monday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Tuesday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Wednesday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Thursday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Friday"; $head .= "</td>"; $head .= "</table>"; $head .= "<table class='days'>"; $head .= "<td>"; $head .= "Saturday"; $head .= "</td>"; $head .= "</table>"; $head .= "</div>"; echo $head; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monthCreator($from,$to){\n\n$month='';\nforeach (h_many_M($from,$to) as $i) {\n\n$d = DateTime::createFromFormat('!m', $i);\n$m = $d->format('F').' '.$i;\n\n $month.=' \n<th class=\"planning_head_month\" colspan=\"28\">'.$m.'</th>\n ';\n}\necho $month;\n}", "public function get_month_permastruct()\n {\n }", "public function month_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_start',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date',\n\t\t\t\t'default'\t=> 'year-01-01'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_end',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'limit',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'integer',\n\t\t\t\t'default'\t=> 12\n\t\t\t)\n\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set(\n\t\t\t\t'date_range_end',\n\t\t\t\t$this->CDT->add_month($this->P->value('limit'))\n\t\t\t);\n\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = (\n\t\t\t$this->P->value('date_range_end', 'ymd') >\n\t\t\t\t$this->P->value('date_range_start', 'ymd')\n\t\t) ? 1 : -1;\n\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo\n\t\t{\n\t\t\t$vars['conditional']\t= array(\n\t\t\t\t'is_current_month'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t),\n\t\t\t\t'is_not_current_month'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t) ? FALSE : TRUE,\n\t\t\t\t'is_current_year'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? TRUE : FALSE,\n\t\t\t\t'is_not_current_year'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? FALSE : TRUE\n\t\t\t);\n\n\t\t\t$vars['single']\t= array(\n\t\t\t\t'year'\t=> $this->CDT->year,\n\t\t\t\t'month'\t=> $this->CDT->month\n\t\t\t);\n\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'month'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_month($dir);\n\t\t\t$count++;\n\t\t}\n\t\twhile (\n\t\t\t$count < $this->P->value('limit') AND\n\t\t\t$this->CDT->ymd < $this->P->value('date_range_end', 'ymd')\n\t\t);\n\n\t\treturn $output;\n\t}", "public static function create($month, $year){\n\t\t$calendar = array(array());\n\t\t$cal_size = 0;\n\t\t$week = 0;\n\t\t$cell = 1;\n\t\t$month_name = \"\";\n\t\t\n\t\t//Creamos el arreglo Calendario\n\t\t$calendar = self::create_calendar($month,$year,$calendar);\n\t // Longitud del Calendario incluyendo espacios en blanco, con llamada recursiva para que sea completo;\n\t\t// Al ser recursivo nos suma tambien los renglones que son los arrays padres de las celdas, entonces restamos\n\t\t$cal_size =\tcount($calendar,COUNT_RECURSIVE) - count($calendar); \n\t\t//Imprime $month and $year\n\t\tswitch ($month) { // Obtenemos el nombre en castellano del mes\n\t\t\tcase 1 : $month_name = \"ENERO\";\n\t\t\t\tbreak;\n\t\t\tcase 2 : $month_name = \"FEBRERO\";\n\t\t\t\tbreak;\n\t\t\tcase 3 : $month_name = \"MARZO\";\n\t\t\t\tbreak;\n\t\t\tcase 4 : $month_name = \"ABRIL\";\n\t\t\t\tbreak;\n\t\t\tcase 5 : $month_name = \"MAYO\";\n\t\t\t\tbreak;\n\t\t\tcase 6 : $month_name = \"JUNIO\";\n\t\t\t\tbreak;\n\t\t\tcase 7 : $month_name = \"JULIO\";\n\t\t\t\tbreak;\n\t\t\tcase 8 : $month_name = \"AGOSTO\";\n\t\t\t\tbreak;\n\t\t\tcase 9 : $month_name = \"SEPTIEMBRE\";\n\t\t\t\tbreak;\n\t\t\tcase 10 : $month_name = \"OCTUBRE\";\n\t\t\t\tbreak;\n\t\t\tcase 11 : $month_name = \"NOVIEMBRE\";\n\t\t\t\tbreak;\n\t\t\tcase 12 : $month_name = \"DICIEMBRE\";\n\t\t\t\n\t\t}\n\t\t//Creamos las celdas de los dias de la semana\n\t\twhile ($cell <= $cal_size){\n\t\t\tself::$html .= \"<tr>\";\n\t\t\tfor ($day=0;$day<7;$day++){\n\t\t\t\tif ($calendar[$week][$day]!=0){\n\t\t\t\t\tself::$html .= \"<td>\".$calendar[$week][$day].\"</td>\";\n\t\t\t\t} else { self::$html .= \"<td></td>\"; }\n\t\t\t\t$cell++;\n\t\t\t}\n\t\t\t$week++;\n\t\t\tself::$html .= \"</tr>\";\n\t\t}\n\t\tself::$html .= \"<tr><th colspan='7'>\".$month_name.\" \".$year.\"</th></tr>\";\n\n\t\treturn self::$html;\n\t}", "private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}", "private function setMonthNames()\n\t{\n\t\t$range = range(1,12);\n\t\t$return = array();\n\t\tforeach($range AS $key => $monthNum)\n\t\t{\n\t\t $fmt = datefmt_create ($this->locale, null, null, null, IntlDateFormatter::GREGORIAN, 'MMMM');\n\t\t\t$return[$monthNum] = datefmt_format( $fmt , mktime(12,0,0,$monthNum,1,date('Y')));\n\t\t}\n\n\t\treturn $return;\n\t}", "protected function build_month_calendar(&$tpl_var)\n {\n global $page, $lang, $conf;\n\n $query='SELECT '.pwg_db_get_dayofmonth($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $items=array();\n $result = pwg_query($query);\n while ($row = pwg_db_fetch_assoc($result))\n {\n $d = (int)$row['period'];\n $items[$d] = array('nb_images'=>$row['count']);\n }\n\n foreach ( $items as $day=>$data)\n {\n $page['chronology_date'][CDAY]=$day;\n $query = '\n SELECT id, file,representative_ext,path,width,height,rotation, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n ORDER BY '.DB_RANDOM_FUNCTION.'()\n LIMIT 1';\n unset ( $page['chronology_date'][CDAY] );\n\n $row = pwg_db_fetch_assoc(pwg_query($query));\n $derivative = new DerivativeImage(IMG_SQUARE, new SrcImage($row));\n $items[$day]['derivative'] = $derivative;\n $items[$day]['file'] = $row['file'];\n $items[$day]['dow'] = $row['dow'];\n }\n\n if ( !empty($items) )\n {\n list($known_day) = array_keys($items);\n $known_dow = $items[$known_day]['dow'];\n $first_day_dow = ($known_dow-($known_day-1))%7;\n if ($first_day_dow<0)\n {\n $first_day_dow += 7;\n }\n //first_day_dow = week day corresponding to the first day of this month\n $wday_labels = $lang['day'];\n\n if ('monday' == $conf['week_starts_on'])\n {\n if ($first_day_dow==0)\n {\n $first_day_dow = 6;\n }\n else\n {\n $first_day_dow -= 1;\n }\n\n $wday_labels[] = array_shift($wday_labels);\n }\n\n list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;\n\n $tpl_weeks = array();\n $tpl_crt_week = array();\n\n //fill the empty days in the week before first day of this month\n for ($i=0; $i<$first_day_dow; $i++)\n {\n $tpl_crt_week[] = array();\n }\n\n for ( $day = 1;\n $day <= $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR], $page['chronology_date'][CMONTH]\n );\n $day++)\n {\n $dow = ($first_day_dow + $day-1)%7;\n if ($dow==0 and $day!=1)\n {\n $tpl_weeks[] = $tpl_crt_week; // add finished week to week list\n $tpl_crt_week = array(); // start new week\n }\n\n if ( !isset($items[$day]) )\n {// empty day\n $tpl_crt_week[] =\n array(\n 'DAY' => $day\n );\n }\n else\n {\n $url = duplicate_index_url(\n array(\n 'chronology_date' =>\n array(\n $page['chronology_date'][CYEAR],\n $page['chronology_date'][CMONTH],\n $day\n )\n )\n );\n\n $tpl_crt_week[] =\n array(\n 'DAY' => $day,\n 'DOW' => $dow,\n 'NB_ELEMENTS' => $items[$day]['nb_images'],\n 'IMAGE' => $items[$day]['derivative']->get_url(),\n 'U_IMG_LINK' => $url,\n 'IMAGE_ALT' => $items[$day]['file'],\n );\n }\n }\n //fill the empty days in the week after the last day of this month\n while ( $dow<6 )\n {\n $tpl_crt_week[] = array();\n $dow++;\n }\n $tpl_weeks[] = $tpl_crt_week;\n\n $tpl_var['month_view'] =\n array(\n 'CELL_WIDTH' => $cell_width,\n 'CELL_HEIGHT' => $cell_height,\n 'wday_labels' => $wday_labels,\n 'weeks' => $tpl_weeks,\n );\n }\n\n return true;\n }", "function showMonth($showNoMonthDays=false){\n$this->showNoMonthDays=$showNoMonthDays;\n$out=$this->mkMonthHead(); // this should remain first: opens table tag\n$out.=$this->mkMonthTitle(); // tr tag: month title and navigation\n$out.=$this->mkDatePicker(); // tr tag: month date picker (month and year selection)\n$out.=$this->mkWeekDays(); // tr tag: the weekday names\n\tif ($this->showNoMonthDays==false) $out.=$this->mkMonthBody(); // tr tags: the days of the month\n\telse $out.=$this->mkMonthBody(1); // tr tags: the days of the month\n$out.=$this->mkMonthFoot(); // this should remain last: closes table tag\nreturn $out;\n}", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "public function buildMonth()\n\t{\n\t\t$this->orderedDays = $this->getDaysInOrder();\n\t\t\n\t\t$this->monthName = $this->months[ ltrim( $this->month, '0') ];\n\t\t\n\t\t// start of whichever month we are building\n\t\t$start_of_month = getdate( mktime(12, 0, 0, $this->month, 1, $this->year ) );\n\t\t\n\t\t$first_day_of_month = $start_of_month['wday'];\n\t\t\n\t\t$days = $this->startDay - $first_day_of_month;\n\t\t\n\t\tif( $days > 1 )\n\t\t{\n\t\t\t// get an offset\n\t\t\t$days -= 7;\n\t\t\t\n\t\t}\n\n\t\t$num_days = $this->daysInMonth($this->month, $this->year);\n\t\t// 42 iterations\n\t\t$start = 0;\n\t\t$cal_dates = array();\n\t\t$cal_dates_style = array();\n\t\t$cal_events = array();\n\t\twhile( $start < 42 )\n\t\t{\n\t\t\t// off set dates\n\t\t\tif( $days < 0 )\n\t\t\t{\n\t\t\t\t$cal_dates[] = '';\n\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t$cal_dates_data[] = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $days < $num_days )\n\t\t\t\t{\n\t\t\t\t\t// real days\n\t\t\t\t\t$cal_dates[] = $days+1;\n\t\t\t\t\tif( in_array( $days+1, $this->daysWithEvents ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = 'has-events';\n\t\t\t\t\t\t$cal_dates_data[] = $this->data[ $days+1 ];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = '';\n\t\t\t\t\t\t$cal_dates_data[] = '';\n\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{\n\t\t\t\t\t// surplus\n\t\t\t\t\t$cal_dates[] = '';\n\t\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// increment and loop\n\t\t\t$start++;\n\t\t\t$days++;\n\t\t}\n\t\t\n\t\t// done\n\t\t$this->dates = $cal_dates;\n\t\t$this->dateStyles = $cal_dates_style;\n\t\t$this->dateData = $cal_dates_data;\n\t}", "function mkMonthTitle(){\n\tif (!$this->monthNav){\n\t\t$out=\"<tr><td class=\\\"\".$this->cssMonthTitle.\"\\\" colspan=\\\"\".$this->monthSpan.\"\\\">\";\n\t\t$out.=$this->getMonthName().$this->monthYearDivider.$this->actyear;\n\t\t$out.=\"</td></tr>\\n\";\n\t}\n\telse{\n\t\t$out=\"<tr><td class=\\\"\".$this->cssMonthNav.\"\\\" colspan=\\\"2\\\">\";\n\t\tif ($this->actmonth==1) $out.=$this->mkUrl($this->actyear-1,\"12\");\n\t\telse $out.=$this->mkUrl($this->actyear,$this->actmonth-1);\n\t\t$out.=$this->monthNavBack.\"</a></td>\";\n\t\t$out.=\"<td class=\\\"\".$this->cssMonthTitle.\"\\\" colspan=\\\"\".($this->monthSpan-4).\"\\\">\";\n\t\t$out.=$this->getMonthName().$this->monthYearDivider.$this->actyear.\"</td>\";\n\t\t$out.=\"<td class=\\\"\".$this->cssMonthNav.\"\\\" colspan=\\\"2\\\">\";\n\t\tif ($this->actmonth==12) $out.=$this->mkUrl($this->actyear+1,\"1\");\n\t\telse $out.=$this->mkUrl($this->actyear,$this->actmonth+1);\n\t\t$out.=$this->monthNavForw.\"</a></td></tr>\\n\";\n\t}\nreturn $out;\n}", "public function display($month='', $year='') {\n\t\n\t\t// Remove whitespaces\n\t\t$year = trim($year);\n\t\t$month = trim($month);\n\n\t\t// Set day, month and year of calendar\n\t\t$this->day = 1;\n\t\t$this->month = ($month == '') ?\tdate('n') : $month;\n\t\t$this->year = ($year == '') ? date('Y') : $year;\n\n\t\t// Check for valid input\t\n\t\tif (!preg_match('~[0-9]{4}~', $this->year))\n\t\t\tthrow new exception('Invalid value for year');\n\t\tif (!is_numeric($this->month) || $this->month < 0 || $this->month > 13)\n\t\t\tthrow new exception('Invalid value for month');\n\n\t\t// Set the current timestamp\n\t\t$this->timeStamp = mktime(1,1,1,$this->month, $this->day, $this->year);\n\t\t// Set the number of days in teh current month\n\t\t$this->daysInMonth = date('t',$this->timeStamp);\n\n\t\t// Start table\n\t\t$calHTML = sprintf(\"<table id=\\\"%s\\\" cellpadding=\\\"0\\\" cellspacing=\\\"%d\\\"><thead><tr>\", $this->calendarName, $this->innerBorder);\n\t\t// Display previous month navigation\n\t\tif ($this->enableNav) {\n\t\t\t$pM = explode('-', date('n-Y', strtotime('-1 month', $this->timeStamp)));\n\t\t\t$calHTML .= sprintf(\"<td class=\\\"%s-%s\\\"><a href=\\\"?%smonth=%d&amp;year=%d\\\">%s</a></td>\", $this->calendarName, $this->markup['nav'], $this->queryString, $pM[0], $pM[1],$this->prevMonthNavTxt);\n\t\t}\n\t\t\n\t\t// Month name and optional year\n\t\t$calHTML .= sprintf(\"<td colspan=\\\"%d\\\" id=\\\"%s-%s\\\">%s%s</td>\", ($this->enableNav ? 5 : 7), $this->calendarName, $this->markup['header'], $this->getMonthName(), ($this->displayYear ? ' ' .$this->year : ''));\n\n\t\t// Display next month navigation\n\t\tif ($this->enableNav) {\n\t\t\t$nM = explode('-', date('n-Y', strtotime('+1 month', $this->timeStamp)));\n\t\t\t$calHTML .= sprintf(\"<td class=\\\"%s-%s\\\"><a href=\\\"?%smonth=%d&amp;year=%d\\\">%s</a></td>\", $this->calendarName, $this->markup['nav'], $this->queryString, $nM[0], $nM[1],$this->nextMonthNavTxt);\n\t\t}\n\n\t\t$calHTML .= sprintf(\"</tr></thead><tbody><tr id=\\\"%s\\\">\", $this->markup['days_of_week']);\n\n\t\t// Display day headers\n\t\tforeach($this->dayNames as $k => $dayName)\n\t\t\t$calHTML .= sprintf(\"<td>%s</td>\", $dayName);\n\n\t\t$calHTML .= \"</tr><tr>\";\n\t\t\n\t\t/// What the heck is this\n\t\t$sDay = date('N', $this->timeStamp) + $this->startDay - 1;\n\t\t\n\t\t// Print previous months days\n\t\t\tfor ($e=1;$e<=$sDay;$e++)\n\t\t\t\t$calHTML .= sprintf(\"<td class=\\\"%s-%s\\\">%s</td>\", $this->calendarName, $this->markup['prev_month'], (($this->displayNonMonthDays) ? $this->timeTravel(\"-\" . ($sDay -$e) . \" days\", 'd', $this->timeStamp) : ''));\n\t\n\t\t// Print days\n\t\tfor ($i=1;$i<=$this->daysInMonth;$i++) {\n\t\t\t// Set current day and timestamp\n\t\t\t$this->day = $i;\n\t\t\t$this->timeStamp = mktime(1,1,1,$this->month, $this->day, $this->year);\n\t\t\t\n\t\t\t// Set day as either plain text or event link\n\t\t\tif (isset($this->events[$this->year][$this->month][$this->day]))\n\t\t\t\t$this->htmlDay = sprintf(\"<a href=\\\"%s\\\" title=\\\"%s\\\">%s</a>\", $this->events[$this->year][$this->month][$this->day]['event_link'], $this->events[$this->year][$this->month][$this->day]['event_title'], $this->day);\n\t\t\telse\n\t\t\t\t$this->htmlDay = $this->day;\t\t\t\n\t\n\t\t\t// Display calendar cell\n\t\t\t$calHTML .= sprintf(\"<td %s%s>%s</td>\", ($this->timeStamp == mktime(1,1,1,date('n'),date('j'),date('Y')) ? 'id=\"' . $this->calendarName . '-' . $this->markup['current_day'] . '\" ' : ''), ((($sDay + $this->day) % 7 == 0) ? 'class=\"' . $this->calendarName . '-' . $this->markup['last_day_of_week'] . '\"' : ''), $this->htmlDay);\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t// End row if necessary\t\t\t\n\t\t\tif (($sDay + $this->day) % 7 == 0)\n\t\t\t\t$calHTML .= \"</tr><tr>\";\n\t\t}\n\t\t\n\t\t// Print next months days\n\t\tfor ($e2=1;$e2 < (7 - (($sDay + $this->daysInMonth -1) % 7)); $e2++)\n\t\t\t$calHTML .= sprintf(\"<td class=\\\"%s-next-month-day%s\\\">%s</td>\", $this->calendarName, ((($sDay + $this->day + $e2) % 7 == 0) ? ' ' . $this->calendarName . '-' . $this->markup['last_day_of_week'] : ''), (($this->displayNonMonthDays) ? $this->timeTravel(\"+$e2 days\", 'd', $this->timeStamp) : ''));\n\t\t\n\t\t$calHTML .= \"</tr></tbody></table>\";\n\t\n\t\t// Tidy up html\n\t\tif ($this->prettyHTML) {\n\t\t\t$replaceWhat = array('<tr', '<td', '</tr>', '</table>', '<thead>', '</thead>', '<tbody>', '</tbody>');\n\t\t\t$replaceWith = array(\"\\n\\t\\t<tr\", \"\\n\\t\\t\\t<td\", \"\\n\\t\\t</tr>\", \"\\n</table>\", \"\\n\\t<thead>\", \"\\n\\t</thead>\", \"\\n\\t<tbody>\", \"\\n\\t</tbody>\");\n\t\t\t$calHTML = str_replace($replaceWhat, $replaceWith, $calHTML);\n\t\t}\n\t\t\n\t\t// Print calendar\n\t\techo $calHTML;\n\t}", "function mkMonthHead(){\nreturn \"<table class=\\\"\".$this->cssMonthTable.\"\\\">\\n\";\n}", "public function view(){\r\n $this->month();\r\n }", "public function month()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array('categories', 'category_fields', 'custom_fields', 'member_data', 'pagination', 'trackbacks');\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'enable',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'allowed_values' => $disable\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'first_day_of_week',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'start_date_segment',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 3\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\tif ($this->P->value('start_date_segment') AND ee()->uri->segment($this->P->value('start_date_segment')) AND strstr(ee()->uri->segment($this->P->value('start_date_segment')), '-'))\n\t\t\t{\n\t\t\t\tlist($year, $month) = explode('-', ee()->uri->segment($this->P->value('start_date_segment')));\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($year, $month, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start', 'day') != 1)\n\t\t{\n\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->P->value('date_range_start', 'year'), $this->P->value('date_range_start', 'month'), 1);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day($this->CDT->days_in_month($this->P->value('date_range_start', 'month'), $this->P->value('date_range_start', 'year')) - 1));\n\t\t$this->P->set('pad_short_weeks', TRUE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\t'EVENTS_PLACEHOLDER',\n\t\t\t\t\t\t'{/',\n\t\t\t\t\t\t'{',\n\t\t\t\t\t\t'}'\n\t\t\t\t\t\t);\n\t\t$replace = array(\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\tLD.T_SLASH,\n\t\t\t\t\t\t\tLD,\n\t\t\t\t\t\t\tRD\n\t\t\t\t\t\t\t);\n\t\tee()->TMPL->tagdata = str_replace($find, $replace, $this->view('month.html', array(), TRUE, $this->sc->addon_theme_path.'templates/month.html'));\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_month'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_month'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day_of_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day_of_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function get_month_choices()\n {\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "public function getMonths()\r\n\t{\r\n \t$months = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= 12; $i++)\r\n\t\t{\r\n\t\t\t$label = ($i < 10) ? (\"0\" . $i) : $i;\r\n\t\t\t\r\n\t\t\t$months[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $months;\r\n\t}", "public function getMonthAsTable()\n {\n // Get all days to put in calendar\n $days = $this->getDaysAsArray();\n\n // Start table\n $html = \"<table class='table'><thead><tr>\";\n\n // Add weekday names to table head\n foreach (array_keys($this->weekdayIndexes) as $key) {\n $html .= \"<th>{$key}</th>\";\n }\n $html .= \"</tr></thead><tbody>\";\n\n // Add day numbers to table body\n for ($i = 0; $i < count($days); $i++) {\n // New row at start of week\n $html .= $i % 7 === 0 ? \"<tr>\" : \"\";\n\n if (($days[$i] > $i + 7) || ($days[$i] < $i - 7)) {\n // Add class 'outside' if number is part of previous or next month\n $html .= \"<td class='outside'>\";\n } elseif ($i % 7 === 6) {\n // Add class 'red' to Sundays\n $html .= \"<td class='red'>\";\n } else {\n $html .= \"<td>\";\n }\n $html .= \"{$days[$i]}</td>\";\n // Close row at end of week\n $html .= $i % 7 === 6 ? \"</tr>\" : \"\";\n }\n $html .= \"</tbody></table>\";\n return $html;\n }", "public function showMonth ()\n {\n\n $manages = DB::table('adds')->where('user_id', '=', auth()->id())->take(3)\n ->select(DB::raw('sum(pallet) as totalpallet')\n , DB::raw('sum(eilutes) as totaleilutes')\n , DB::raw('sum(vip) as totalvip')\n , DB::raw('sum(valandos) as totalvalandos')\n , DB::raw('YEAR(created_at) year, MONTH(created_at) month'))\n ->groupBy('year', 'month')\n ->orderByRaw('min(created_at) desc')\n ->get();\n\n\n return view('layouts.manage', compact('manages'));\n }", "public static function listMonth()\r\n {\r\n $mes[1] = 'Janeiro';\r\n $mes[2] = 'Fevereiro';\r\n $mes[3] = 'Março';\r\n $mes[4] = 'Abril';\r\n $mes[5] = 'Maio';\r\n $mes[6] = 'Junho';\r\n $mes[7] = 'Julho';\r\n $mes[8] = 'Agosto';\r\n $mes[9] = 'Setembro';\r\n $mes[10] = 'Outubro';\r\n $mes[11] = 'Novembro';\r\n $mes[12] = 'Dezembro';\r\n\r\n return $mes;\r\n }", "public function monthControl(){\n\t\t$month = date('m', time());\n\t\t\t\t\n\t\t//remakes $month to the month's name\n\t\tswitch ($month) {\n\t\t\tcase 1:\t$month = \"Januari\";\t\tbreak;\n\t\t\tcase 2:\t$month = \"Februari\";\tbreak;\n\t\t\tcase 3:\t$month = \"Mars\";\t\tbreak;\n\t\t\tcase 4:\t$month = \"April\";\t\tbreak;\n\t\t\tcase 5:\t$month = \"Maj\";\t\t\tbreak;\n\t\t\tcase 6:\t$month = \"Juni\";\t\tbreak;\n\t\t\tcase 7:\t$month = \"Juli\";\t\tbreak;\n\t\t\tcase 8:\t$month = \"Augusti\";\t\tbreak;\n\t\t\tcase 9:\t$month = \"September\";\tbreak;\n\t\t\tcase 10:$month = \"Oktober\";\t\tbreak;\n\t\t\tcase 11:$month = \"November\";\tbreak;\t\n\t\t\tcase 12:$month = \"December\";\tbreak;\n\t\t}\n\t\t\n\t\treturn $month;\n\t}", "public function listMonths()\n {\n return $this->ozioma->month->list();\n }", "function monthOptionBox ($dictionary, $default)\n{\n $label = array();\n $value = array();\n \tfor ($i=1; $i<=12; $i++)\n\t{\n if ($i<10)\n\t\t{\n\t\t\t$label[] = $dictionary['month0'.$i];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$label[] = $dictionary['month'.$i];\n\t\t}\n $value[] = $i;\n\t}\n\treturn OptionBox($label, $value, $default, $label);\n}", "public function getMonths();", "function mkMonthBody($showNoMonthDays=0){\n\tif ($this->actmonth==1){\n\t\t$pMonth=12;\n\t\t$pYear=$this->actyear-1;\n\t}\n\telse{\n\t\t$pMonth=$this->actmonth-1;\n\t\t$pYear=$this->actyear;\n\t}\n$out=\"<tr>\";\n$cor=0;\n\tif ($this->startOnSun) $cor=1;\n\tif ($this->weekNum) $out.=\"<td class=\\\"\".$this->cssWeekNum.\"\\\">\".$this->mkWeekNum(1+$cor).\"</td>\";\n$monthday=0;\n$nmonthday=1;\n\tfor ($x=0; $x<=6; $x++){\n\t\tif ($x>=$this->firstday){\n\t\t$monthday++;\n\t\t$out.=$this->mkDay($monthday);\n\t\t}\n\t\telse{\n\t\t\tif ($showNoMonthDays==0) $out.=\"<td class=\\\"\".$this->cssNoMonthDay.\"\\\"></td>\";\n\t\t\telse $out.=\"<td class=\\\"\".$this->cssNoMonthDay.\"\\\">\".($this->getMonthDays($pMonth,$pYear)-($this->firstday-1)+$x).\"</td>\";\n\t\t}\n\t}\n$out.=\"</tr>\\n\";\n$goon=$monthday+1;\n$stop=0;\n\tfor ($x=0; $x<=6; $x++){\n\t\tif ($goon>$this->maxdays) break;\n\t\tif ($stop==1) break;\n\t\t$out.=\"<tr>\";\n\t\tif ($this->weekNum) $out.=\"<td class=\\\"\".$this->cssWeekNum.\"\\\">\".$this->mkWeekNum($goon+$cor).\"</td>\";\n\t\t\tfor ($i=$goon; $i<=$goon+6; $i++){\n\t\t\t\tif ($i>$this->maxdays){\n\t\t\t\t\tif ($showNoMonthDays==0) $out.=\"<td class=\\\"\".$this->cssNoMonthDay.\"\\\"></td>\";\n\t\t\t\t\telse $out.=\"<td class=\\\"\".$this->cssNoMonthDay.\"\\\">\".$nmonthday++.\"</td>\";\n\t\t\t\t\t$stop=1;\n\t\t\t\t}\n\t\t\t\telse $out.=$this->mkDay($i);\n\t\t\t}\n\t\t$goon=$goon+7;\n\t\t$out.=\"</tr>\\n\";\n\t}\n$this->selectedday=\"-2\";\nreturn $out;\n}", "public function getCcMonths() {\n $data = Mage::app()->getLocale()->getTranslationList('month');\n foreach ($data as $key => $value) {\n $monthNum = ($key < 10) ? '0' . $key : $key;\n $data[$key] = $monthNum . ' - ' . $value;\n }\n\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $data);\n $this->setData('cc_months', $months);\n }\n\n\n return $months;\n }", "public function Months() {\r\n// $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\r\n $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');\r\n return $months;\r\n }", "private function make_calendar($year, $month){\n\t\t$first_of_month = gmmktime(0,0,0,$month,1,$year);\n\t\t#remember that mktime will automatically correct if invalid dates are entered\n\t\t# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998\n\t\t# this provides a built in \"rounding\" feature to generate_calendar()\n\t\n\t\t$day_names = array(); #generate all the day names according to the current locale\n\t\tfor($n=0,$t=(3+$this->firstDay)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday\n\t\t\t$day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name\n\t\n\t\tlist($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));\n\t\t$weekday = ($weekday + 7 - $this->firstDay) % 7; #adjust for $firstDay\n\t\t$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; #note that some locales don't capitalize month and day names\n\t\n\t\t#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03\n\t\t@list($p, $pl) = each($this->canonicals); @list($n, $nl) = each($this->canonicals); #previous and next links, if applicable\n\t\tif($p) $p = '<span class=\"calendar-prev\">'.($pl ? '<a href=\"'.htmlspecialchars($pl).'\">'.$p.'</a>' : $p).'</span>&nbsp;';\n\t\tif($n) $n = '&nbsp;<span class=\"calendar-next\">'.($nl ? '<a href=\"'.htmlspecialchars($nl).'\">'.$n.'</a>' : $n).'</span>';\n\t\t$calendar = '<table class=\"calendar\">'.\"\\n\".\n\t\t\t'<caption class=\"calendar-month\">'.$p.($this->monthLink ? '<a href=\"'.htmlspecialchars($this->monthLink).'\">'.$title.'</a>' : $title).$n.\"</caption>\\n<tr>\";\n\t\n\t\tif($this->dayNameLength){ #if the day names should be shown ($day_name_length > 0)\n\t\t\t#if day_name_length is >3, the full name of the day will be printed\n\t\t\tforeach($day_names as $d)\n\t\t\t\t$calendar .= '<th abbr=\"'.htmlentities($d).'\">'.htmlentities($this->dayNameLength < 4 ? substr($d,0,$this->dayNameLength) : $d).'</th>';\n\t\t\t$calendar .= \"</tr>\\n<tr>\";\n\t\t}\n\t\n\t\tif($weekday > 0) $calendar .= '<td colspan=\"'.$weekday.'\">&nbsp;</td>'; #initial 'empty' days\n\t\tfor($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){\n\t\t\tif($weekday == 7){\n\t\t\t\t$weekday = 0; #start a new week\n\t\t\t\t$calendar .= \"</tr>\\n<tr>\";\n\t\t\t}\n\t\t\tif(isset($this->days[$day]) and is_array($this->days[$day])){\n\t\t\t\t@list($link, $classes, $content) = $this->days[$day];\n\t\t\t\tif(is_null($content)) $content = $day;\n\t\t\t\t$calendar .= '<td'.($classes ? ' class=\"'.htmlspecialchars($classes).'\">' : '>').\n\t\t\t\t\t($link ? '<a href=\"'.htmlspecialchars($link).'\">'.$content.'</a>' : $content).'</td>';\n\t\t\t}\n\t\t\telse $calendar .= \"<td>$day</td>\";\n\t\t}\n\t\tif($weekday != 7) $calendar .= '<td colspan=\"'.(7-$weekday).'\">&nbsp;</td>'; #remaining \"empty\" days\n\t\n\t\treturn $calendar.\"</tr>\\n</table>\\n\";\n\t}", "function single_month_title($prefix = '', $display = \\true)\n {\n }", "function getMonthLabels() {\n\t\treturn array('count_jan', 'count_feb', 'count_mar', 'count_apr', 'count_may', 'count_jun', 'count_jul', 'count_aug', 'count_sep', 'count_oct', 'count_nov', 'count_dec');\n\t}", "public function print_blanc_calendar(string $month, int $year){\r\n \r\n $month_days = static::no_of_days_in_month($month, $year); \r\n $empty_days = $this->empty_days($month, $year);\r\n for ($i=1; $i<=$empty_days; $i++){\r\n echo \"<div class='cal_date empty_date'> </div>\";\r\n }\r\n \r\n \r\n for ($i=1; $i<=$month_days; $i++){\r\n echo \"<div class='cal_date cal_blanc_date'>\";\r\n echo $i;\r\n echo \"</div>\";\r\n }\r\n }", "private function startMonthSpacers()\n\t{\n\t\tif($this->firstDayOfTheMonth != '0') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".$this->firstDayOfTheMonth.\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['firstday'] = $this->firstDayOfTheMonth;\n\t\t}\n\t}", "function render_months_submenu($date_format, $monthNumber) {\n\n if (qtranxf_getLanguage() == 'es') {\n $locale = 'es_ES';\n } else {\n $locale = 'en_US';\n }\n\n \\Moment\\Moment::setLocale($locale);\n\n $months = get_all_months(array('post'), 'DESC');\n\n foreach($months as $month) {\n $monthMoment = new \\Moment\\Moment($month->month . '/1/' . $month->year);\n $link = get_month_link($monthMoment->format('Y'), $monthMoment->format('n'));\n\n echo '<li>';\n if ($monthNumber == $monthMoment->format('n')) {\n echo '<a class=\"filter-term font-capitalize active\" href=\"' . $link . '\">' . $monthMoment->format($date_format) . '</a>';\n } else {\n echo '<a class=\"filter-term font-capitalize\" href=\"' . $link . '\">' . $monthMoment->format($date_format) . '</a>';\n }\n echo '</li>';\n }\n}", "public static function getMonthNames()\n {\n return array( TextHelper::_('COBALT_JANUARY'),\n TextHelper::_('COBALT_FEBRUARY'),\n TextHelper::_('COBALT_MARCH'),\n TextHelper::_('COBALT_APRIL'),\n TextHelper::_('COBALT_MAY'),\n TextHelper::_('COBALT_JUNE'),\n TextHelper::_('COBALT_JULY'),\n TextHelper::_('COBALT_AUGUST'),\n TextHelper::_('COBALT_SEPTEMBER'),\n TextHelper::_('COBALT_OCTOBER'),\n TextHelper::_('COBALT_NOVEMBER'),\n TextHelper::_('COBALT_DECEMBER') );\n }", "function genMonth_Text($m) { \n switch ($m) { \n case '01': $month_text = \"Enero\"; break; \n case '02': $month_text = \"Febrero\"; break; \n case '03': $month_text = \"Marzo\"; break; \n case '04': $month_text = \"Abril\"; break; \n case '05': $month_text = \"Mayo\"; break; \n case '06': $month_text = \"Junio\"; break; \n case '07': $month_text = \"Julio\"; break; \n case '08': $month_text = \"Agosto\"; break; \n case '09': $month_text = \"Septiembre\"; break; \n case '10': $month_text = \"Octubre\"; break; \n case '11': $month_text = \"Noviembre\"; break; \n case '12': $month_text = \"Diciembre\"; break; \n } \n return ($month_text); \n }", "public function actionPostedInMonth()\n {\n\n $month = date('n', $_GET['time']); // 1 through 12\n $year = date('Y', $_GET['time']); // 2011\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'n') $month++;\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'p') $month--;\n\n $query=Article::find()->where(['status' =>Article::STATUS_ENABLED ])\n ->andWhere(['>','created_at',($firstDay = mktime(0,0,0,$month,1,$year))])\n ->andWhere(['<','created_at',(mktime(0,0,0,$month+1,1,$year))])\n ->orderBy('updated_at DESC');\n\n $pages = new Pagination(['totalCount' => $query->count()]);\n\n $pages->pageSize = \\Yii::$app->params['monthlyArchivesCount'];\n\n $materials = $query->offset($pages->offset)\n ->limit($pages->limit)\n ->all();\n\n return $this->render('month',array(\n 'materials' => $materials,\n 'pages' => $pages,\n 'firstDay' => $firstDay,\n ));\n }", "function get_month($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return January format\n return $this->translate_month($this->cal_lang,date(\"F\",mktime(0,0,0,$date_split[1],$date_split[0],$date_split[2])));}\n elseif ($type=='2'){\n // Return Jan format\n return date(\"M\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='3'){\n // Return 01 format\n return date(\"m\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='4'){\n // Return 1 format\n return date(\"n\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "public function monthlyViews()\n {\n // Group and map views to a collection of totals\n return $this->views\n ->groupBy(function($view) {\n return $view->created_at->format('m/y');\n })\n ->map(function ($views) {\n $view = $views->first();\n\n return collect([\n 'id' => $view->created_at->format('m-y-').\n $view->episode_uuid,\n 'episode_uuid' => $view->episode_uuid,\n 'total' => $views->count(),\n 'label' => $view->created_at->format('m/y'),\n ]);\n });\n }", "function print_month_option_list( $p_month = 0 ) {\n\tfor( $i = 1;$i <= 12;$i++ ) {\n\t\t$t_month_name = date( 'F', mktime( 0, 0, 0, $i, 1, 2000 ) );\n\t\tif( $i == $p_month ) {\n\t\t\techo '<option value=\"' . $i . '\" selected=\"selected\">' . lang_get( 'month_' . strtolower( $t_month_name ) ) . '</option>';\n\t\t} else {\n\t\t\techo '<option value=\"' . $i . '\">' . lang_get( 'month_' . strtolower( $t_month_name ) ) . '</option>';\n\t\t}\n\t}\n}", "public function getMonthList() \n {\t\t\n $this->db->select(\"to_char(cm_date, 'mm') as cm_mm, to_char(cm_date, 'month') as cm_month\");\n $this->db->from(\"ims_hris.calendar_main\");\n $this->db->group_by(\"to_char(cm_date,'mm'), to_char(cm_date, 'month')\");\n $this->db->order_by(\"to_char(cm_date, 'mm')\");\n $q = $this->db->get();\n\t\t \n return $q->result_case('UPPER');\n }", "private function generate_calendar($year, $month){\n\t\t// --- calculations\n\t\t$first_of_month = gmmktime(0,0,0,$month,1,$year);\n\t\t/* remember that mktime will automatically correct if invalid dates are entered\n\t\t for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998\n\t\t this provides a built in \"rounding\" feature to generate_calendar() */\n\t\n\t\t$day_names = array(); // generate all the day names according to the current locale\n\t\tfor($n=0,$t=(3+$this->firstDay)*86400; $n<7; $n++,$t+=86400) // January 4, 1970 was a Sunday\n\t\t\t$day_names[$n] = ucfirst(gmstrftime('%A',$t)); // %A means full textual day name\n\t\n\t\tlist($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));\n\t\t$weekday = ($weekday + 7 - $this->firstDay) % 7; // adjust for $firstDay\n\t\t$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; // note that some locales don't capitalize month and day names\n\t\n\t\t// --- make calendar header\n\t\t@list($p, $pl) = each($this->canonicals); @list($n, $nl) = each($this->canonicals); // previous and next links, if applicable\n\t\tif($p) $p = '<div class=\"prev\">'.($pl ? '<a href=\"'.htmlspecialchars($pl).'\">'.$p.'</a>' : $p).'</div>&nbsp;';\n\t\tif($n) $n = '&nbsp;<div class=\"next\">'.($nl ? '<a href=\"'.htmlspecialchars($nl).'\">'.$n.'</a>' : $n).'</div>';\n\t\t$calendar = '<div class=\"calendar\"><div class=\"month\">'.$p.($this->monthLink ? '<a href=\"'.htmlspecialchars($this->monthLink).'\">'.$title.'</a>' : $title).$n.\"</div>\";\n\n\t\t// --- make days of the week titles\n\t\tif($this->dayNameLength){ //if the day names should be shown ($day_name_length > 0)\n\t\t\tforeach($day_names as $d)\n\t\t\t\t$calendar .= '<div class=\"box '.htmlentities($d).'\">'.htmlentities($this->dayNameLength < 4 ? substr($d,0,$this->dayNameLength) : $d).'</div>';\n\t\t\t$calendar .= '<br><div class=\"dom\">';\n\t\t}\n\n\t\t// --- make days of the month\n\t\tif($weekday > 0) $calendar .= '<div class=\"box offset'.$weekday.'\">&nbsp;</div>'; // initial 'empty' days\n\t\tfor($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){\n\t\t\tif($weekday == 7) $weekday = 0; // start a new week\n\n\t\t\tif(isset($this->days[$day]) and is_array($this->days[$day])){\n\t\t\t\t@list($link, $classes, $content) = $this->days[$day];\n\t\t\t\tif(is_null($content)) $content = $day;\n\t\t\t\t$calendar .= '<div class=\"box'.($classes ? ' '.htmlspecialchars($classes).'\">' : '\">').\n\t\t\t\t\t($link ? '<a href=\"'.htmlspecialchars($link).'\">'.$content.'</a>' : $content).'</div>';\n\t\t\t}\n\t\t\telse $calendar .= '<div class=\"box\">'.$day.'</div>';\n\t\t}\n\t\tif($weekday != 7) $calendar .= '<div class=\"box offset'.(7-$weekday).'\">&nbsp;</div>'; // remaining \"empty\" days\n\n\t\treturn $calendar.'<br class=\"clear\"/></div></div>';\n\t}", "function print_calendar($mon,$year)\n\t{\n\t\tglobal $dates, $first_day, $start_day;\n\t\t\t$cellWidth =\"150\";\n\t\t$first_day = mktime(0,0,0,$mon,1,$year);\n\t\t$start_day = date(\"w\",$first_day);\n\t\t$res = getdate($first_day);\n\t\t$month_name = $res[\"month\"];\n\t\t$no_days_in_month = date(\"t\",$first_day);\n\t\t\n\t\t//If month's first day does not start with first Sunday, fill table cell with a space\n\t\tfor ($i = 1; $i <= $start_day;$i++)\n\t\t\t$dates[1][$i] = \" \";\n\n\t\t$row = 1;\n\t\t$col = $start_day+1;\n\t\t$num = 1;\n\t\twhile($num<=31)\n\t\t\t{\n\t\t\t\tif ($num > $no_days_in_month)\n\t\t\t\t\t break;\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$dates[$row][$col] = $num;\n\t\t\t\t\t\tif (($col + 1) > 7)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$row++;\n\t\t\t\t\t\t\t\t$col = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$col++;\n\t\t\t\t\t\t$num++;\n\t\t\t\t\t}//if-else\n\t\t\t}//while\n\t\t$mon_num = date(\"n\",$first_day);\n\t\t$temp_yr = $next_yr = $prev_yr = $year;\n\n\t\t$prev = $mon_num - 1;\n\t\t$next = $mon_num + 1;\n\n\t\t//If January is currently displayed, month previous is December of previous year\n\t\tif ($mon_num == 1)\n\t\t\t{\n\t\t\t\t$prev_yr = $year - 1;\n\t\t\t\t$prev = 12;\n\t\t\t}\n \n\t\t//If December is currently displayed, month next is January of next year\n\t\tif ($mon_num == 12)\n\t\t\t{\n\t\t\t\t$next_yr = $year + 1;\n\t\t\t\t$next = 1;\n\t\t\t}\n\n\t\techo \"<DIV ALIGN='center'><TABLE BORDER=1 WIDTH=1600px CELLSPACING=0 BORDERCOLOR='silver'>\";\n\n\t\techo \t\"\\n<TR ALIGN='center'><TD BGCOLOR='white'> \".\n\t\t\t \"<A HREF='index.php?month=$prev&year=$prev_yr' STYLE=\\\"text-decoration: none\\\"><B><<</B></A> </TD>\".\n\t\t\t \"<TD COLSPAN=5 BGCOLOR='#99CCFF'><B>\".date(\"F\",$first_day).\" \".$temp_yr.\"</B></TD>\".\n\t\t\t \"<TD BGCOLOR='white'> \".\n\t\t\t \"<A HREF='index.php?month=$next&year=$next_yr' STYLE=\\\"text-decoration: none\\\"><B>>></B></A> </TD></TR>\";\n\n\t\techo \"\\n<TR ALIGN='center'><TD width='$cellWidth'><B>Domenica</B></TD><TD width='$cellWidth'><B>Lunedi</B></TD><TD width='$cellWidth'><B>Martedi</B></TD>\";\n\t\techo \"<TD width='$cellWidth'><B>Mercoledi</B></TD><TD width='$cellWidth'><B>Giovedi</B></TD><TD width='$cellWidth'><B>Venerdi</B></TD><TD width='$cellWidth'><B>Sabato</B></TD></TR>\";\n\t\techo \"<TR><TD COLSPAN=7> </TR><TR height='100px;' ALIGN='center'>\";\n\t\t\t\t\n\t\t$end = ($start_day > 4)? 6:5;\n\t\tfor ($row=1;$row<=$end;$row++)\n\t\t\t{\n\t\t\t\tfor ($col=1;$col<=7;$col++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($dates[$row][$col] == \"\")\n\t\t\t\t\t\t$dates[$row][$col] = \" \";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!strcmp($dates[$row][$col],\" \"))\n\t\t\t\t\t\t\t$count++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$t = $dates[$row][$col];\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//If date is today, highlight it\n\t\t\t\t\t\tif (($t == date(\"j\")) && ($mon == date(\"n\")) && ($year == date(\"Y\"))){\n\t\t\t\t\t\t\techo \"\\n<TD valign='top' BGCOLOR='aqua'><a onclick=\\\"NewWindow(this.href,'pg_center','780','670','no');return false;\\\" href='calendar_add_event.php?azione=add&gg=$t&mm=$mon&yyyy=$year'>\".$t.\"</a>\";\n echo '<div align=\"left\">';\n echo stampa_appuntamenti($t,$mon,$year,$_SESSION['id_utente']);\n echo '</div>';\n echo \"</TD>\";\n }\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//If the date is absent ie after 31, print space\n\t\t\t\t\t\t\techo \"\\n<TD valign='top'>\".(($t == \" \" )? \"&nbsp;\" : \"<a onclick=\\\"NewWindow(this.href,'pg_center','780','670','no');return false;\\\" href='calendar_add_event.php?azione=add&gg=$t&mm=$mon&yyyy=$year'>\".$t.\"</a>\");\n echo '<div align=\"left\">';\n echo stampa_appuntamenti($t,$mon,$year,$_SESSION['id_utente']);\n echo '</div>';\n echo \"</TD>\";\n\t\t\t\t\t }\n }// for -col\n\t\t\t\t\n\t\t\t\tif (($row + 1) != ($end+1))\n\t\t\t\t\techo \"</TR>\\n<TR ALIGN='center' height='100px;'>\";\n\t\t\t\telse\n\t\t\t\t\techo \"</TR>\";\n\t\t\t}// for - row\n\t\techo \"\\n</TABLE><BR><BR><A HREF=\\\"index.php\\\">Visualizza mese corrente</A> </DIV>\";\n\t}", "function __construct($month)\n\t{\n\t\tforeach ($month as $date)\n\t\t{\n\t\t\t\n\t\t\t$this->schema[$date][0] = ShiftFactory::createShift($date , 0);\n\t\t\t$this->schema[$date][1] = ShiftFactory::createShift($date , 1);\n\t\t\t$this->schema[$date][2] = ShiftFactory::createShift($date , 2);\n\t\t\t$this->schema[$date][3] = ShiftFactory::createShift($date , 3);\n\t\t\t\n\t\t}\n\t}", "public static function month_calendar($day, $month, $year) {\r\n global $langDay_of_weekNames, $langMonthNames, $langToday, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n //Handle leap year\r\n $numberofdays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {\r\n $numberofdays[2] = 29;\r\n }\r\n\r\n $eventlist = Calendar_Events::get_calendar_events(\"month\", \"$year-$month-$day\");\r\n\r\n $events = array();\r\n if ($eventlist) {\r\n foreach ($eventlist as $event) {\r\n $eventday = new DateTime($event->startdate);\r\n $eventday = $eventday->format('j');\r\n if (!array_key_exists($eventday,$events)) {\r\n $events[$eventday] = array();\r\n }\r\n array_push($events[$eventday], $event);\r\n }\r\n }\r\n\r\n //Get the first day of the month\r\n $dayone = getdate(mktime(0, 0, 0, $month, 1, $year));\r\n //Start the week on monday\r\n $startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;\r\n\r\n $backward = array('month'=>$month == 1 ? 12 : $month - 1, 'year' => $month == 1 ? $year - 1 : $year);\r\n $foreward = array('month'=>$month == 12 ? 1 : $month + 1, 'year' => $month == 12 ? $year + 1 : $year);\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.':&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= '<table width=100% class=\"title1\">';\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"250\"><a href=\"#\" onclick=\"show_month(1,'.$backward['month'].','.$backward['year'].'); return false;\">&laquo;</a></td>';\r\n $calendar_content .= \"<td class='center'><b>{$langMonthNames['long'][$month-1]} $year</b></td>\";\r\n $calendar_content .= '<td width=\"250\" class=\"right\"><a href=\"#\" onclick=\"show_month(1,'.$foreward['month'].','.$foreward['year'].'); return false;\">&raquo;</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table><br />\";\r\n $calendar_content .= \"<table class='table-default'><tr class='list-header'>\";\r\n for ($ii = 1; $ii < 8; $ii++) {\r\n $calendar_content .= \"<th class='text-center'>\" . $langDay_of_weekNames['long'][$ii % 7] . \"</th>\";\r\n }\r\n $calendar_content .= \"</tr>\";\r\n $curday = -1;\r\n $today = getdate();\r\n\r\n while ($curday <= $numberofdays[$month]) {\r\n $calendar_content .= \"<tr>\";\r\n\r\n for ($ii = 0; $ii < 7; $ii++) {\r\n if (($curday == -1) && ($ii == $startdayofweek)) {\r\n $curday = 1;\r\n }\r\n if (($curday > 0) && ($curday <= $numberofdays[$month])) {\r\n $bgcolor = $ii < 5 ? \"class='alert alert-danger'\" : \"class='odd'\";\r\n $dayheader = \"$curday\";\r\n $class_style = \"class=odd\";\r\n if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {\r\n $dayheader = \"<b>$curday</b> <small>($langToday)</small>\";\r\n $class_style = \"class='today'\";\r\n }\r\n $calendar_content .= \"<td height=50 width=14% valign=top $class_style><b>$dayheader</b>\";\r\n $thisDayItems = \"\";\r\n if (array_key_exists($curday, $events)) {\r\n foreach ($events[$curday] as $ev) {\r\n $thisDayItems .= Calendar_Events::month_calendar_item($ev, Calendar_Events::$calsettings->{$ev->event_group.\"_color\"});\r\n }\r\n $calendar_content .= \"$thisDayItems</td>\";\r\n }\r\n $curday++;\r\n } else {\r\n $calendar_content .= \"<td width=14%>&nbsp;</td>\";\r\n }\r\n }\r\n $calendar_content .= \"</tr>\";\r\n }\r\n $calendar_content .= \"</table>\";\r\n\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n\r\n /*************************************** Bootstrap calendar ******************************************************/\r\n\r\n $calendar_content .= '<div id=\"bootstrapcalendar\"></div>';\r\n\r\n return $calendar_content;\r\n }", "function CalendarData($month=null, $year=null) {\n if (is_null($year)) $year = date('Y');\n if (is_null($month)) $month = date('n');\n\n // RENDER\n exec(\"cal \".$month.\" \". $year, $cal); $this->dbgMsg( ' ### calendar '.$month.\" \". $year.\" :: \", $cal );\n $rxp[] = array_fill(0,7,' ');\n for ($k=2; $k < count($cal); $k++ ) {\n $xpl = explode(' ', trim( preg_replace('{\\s+}i', ' ', $cal[$k]) ) );\n if (count($xpl) && $xpl[0]!=='' ) { // $this->dbgMsg(' xploded row', $xpl, 1,1 );\n if ( $wsp=7-count($xpl) ) {\n if ($k==2) $rx = array_merge( array_fill(0, $wsp, ' ' ), $xpl );\n else $rx = array_merge( $xpl, array_fill(count($xpl)+1, $wsp, ' ' ) );\n }\n else $rx = $xpl;\n $rxp[] = $rx;\n }\n }\n\n for ($j=1; $j < count($rxp); $j++ ) {\n for ($d=0; $d<7; $d++) {\n if ($d===0) $rxp[$j-1][6] = $rxp[$j][0];\n else $rxp[$j][$d-1] = $rxp[$j][$d];\n }\n }\n $rxp[$j-1][$d-1]=' ';\n foreach ($rxp as $j=>$r) { // $this->dbgMsg( \"str_replace(' ','',implode('',\".$rxp[$j].\") )\", str_replace(' ','',implode('',$rxp[$j]) ) );\n if ( !str_replace(' ','',implode('',$rxp[$j]) ) ) unset($rxp[$j]); // NEED FOR TESTS\n } // $this->dbgMsg(' exploded calendar : ', $rxp, 1,1 );\n\n foreach ( $rxp as $i=>$arr ) {\n foreach ( $arr as $k=>$day) {\n $clr = array();\n if ( is_numeric($day) ) { // $this->dbgMsg( 'CalDay is_numeric( '.$day.' ) ', 'YES' );\n $Mm = $month<10?('0'.$month):$month;\n $Dd = $day<10?('0'.$day):$day;\n $key_date = $year.'-'.$Mm.'-'.$Dd; // $href_date = $year.'/'.$Mm.'/'.$Dd;\n $clauses = array();\n $clauses[] = \"'\".$key_date.\"' >= s.`date_start` and '\".$key_date.\"' <= s.`date_stop`\";\n $clauses[] = \"s.`status`<>'closed'\"; // $this->dbgMsg('', $clauses );\n $sql = $this->sql10.\" where \".implode(' and ', $clauses);\n $a = $this->db->sql2array( $sql ); // $this->dbgMsg(\" cal Day :: \".$sql, $a ); // выборка фильм+площадка+сеанс\n\n if ( $key_date == $this->guide->uri_parts[1] ) {\n $clr['tpl'] = '_Curr';\n $clr['Misc'] = ' style=\"color:#333;\"';\n // } elseif ( !empty($a) ) { // так - со ссылками в прошлое\n } elseif ( !empty($a) && date(\"Y-m-d\") <= $key_date ) {\n $clr['tpl'] = '_Href';\n $clr['DayHref']= 'film/'.$key_date.'/';\n if ( $k>4 ) $clr['Misc'] = ' style=\"color:#990000;\"';\n } else {\n $clr['tpl'] = '_Item';\n }\n }\n $clr['DayNum']=$day;\n $rxp[$i][$k] = $this->tpl->ParseOne( $clr, $this->tpf.':CalDay'.$clr['tpl'], '' );\n } // $rxp[$i]['trMisc'] = ' style=\"'.(($i%2==1)?'background:#eee;\"':'\"');\n $rxp[$i]['tdMisc'] = ' style=\"text-align:right;background-color:#ffffff;color:#ccc;\"';\n } // $this->dbgMsg('EXPANDED calendar : ', $rxp, 1,1 );\n return $rxp;\n }", "function group_by_month($objects, $getter = 'getCreatedOn') {\n $months = array(\n 1 => lang('January'),\n 2 => lang('February'),\n 3 => lang('March'),\n 4 => lang('April'),\n 5 => lang('May'),\n 6 => lang('June'),\n 7 => lang('July'),\n 8 => lang('August'),\n 9 => lang('September'),\n 10 => lang('October'),\n 11 => lang('November'),\n 12 => lang('December')\n );\n\n $result = array();\n if(is_foreachable($objects)) {\n foreach($objects as $object) {\n $date = $object->$getter();\n\n $month_name = $months[$date->getMonth()];\n\n if(instance_of($date, 'DateValue')) {\n if(!isset($result[$date->getYear()])) {\n $result[$date->getYear()] = array();\n } // if\n\n if(!isset($result[$date->getYear()][$month_name])) {\n $result[$date->getYear()][$month_name] = array();\n } // if\n\n $result[$date->getYear()][$month_name][] = $object;\n } // if\n } // foreach\n } // if\n return $result;\n }", "public function ajax_get_reports_by_month() {\n $month = $this->input->post('month');\n $month = (!empty($month))? $month: date('Y-m');\n\n $data['month'] = (!empty($month))? date('F', strtotime($month)): date('F');\n $data['month_digit'] = (!empty($month))? date('Y-m', strtotime($month)): date('Y-m');\n\n $data['result'] = $this->Report_Model->get_membership_payments($month . '-%');\n\n echo json_encode($data);\n }", "protected function month(){\n return $this->now->format('m');\n }", "public function is_month()\n {\n }", "public function getMonth()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('M');\n\t\t}", "function month( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_MONTH,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_DATE\n );\n\t}", "public function get_month($month_number)\n {\n }", "public function getMonth() \n {\n $month = array('Januar', 'Februar', 'Mart', 'April', 'Maj', 'Juni', 'Juli', 'Avgust', 'Septembar', 'Octobar', 'Novembar', 'Decembar');\n \n return $month;\n }", "function getMonth()\r\n {\r\n return $this->mes;\r\n }", "public function show() {\n $year = null;\n \n $month = null;\n \n if(null==$year&&isset($_GET['year'])){\n \n $year = $_GET['year'];\n \n }else if(null==$year){\n \n $year = date(\"Y\",time()); \n \n } \n \n if(null==$month&&isset($_GET['month'])){\n \n $month = $_GET['month'];\n \n }else if(null==$month){\n \n $month = date(\"m\",time());\n \n } \n \n $this->thisYear=$year;\n \n $this->thisMonth=$month;\n \n $this->daysInMonth=$this->_daysInMonth($month,$year); \n \n $content='<div id=\"calendar\">'.\n\t\t\t\t\t\"<img src = 'img/manadensbabe/$month.jpg'>\".\n\t\t\t\t\t\n '<div class=\"box\">'.\n $this->_createNavi().\n '</div>'.\n '<div class=\"box-content\">'.\n '<ul class=\"label\">'.$this->_createCalender().'</ul>'; \n $content.='<div class=\"clear\"></div>'; \n $content.='<ul class=\"dates\">'; \n \n $weeksInMonth = $this->_weeksInMonth($month,$year);\n \n for( $i=0; $i<$weeksInMonth; $i++ ){\n \n for($j=1;$j<=7;$j++){\n $content.=$this->_showDay($i*7+$j);\n }\n }\n \n $content.='</ul>';\n \n $content.='<div class=\"clear\"></div>'; \n \n $content.='</div>';\n \n $content.='</div>';\n return $content; \n }", "public function getMonthInfo()\n {\n return $this->currentMonth;\n }", "public function buildCalendar($month, $year);", "protected function getMonthValues()\r\n {\r\n\t $month = array();\r\n\t $month[1] = 'January';\r\n\t $month[2] = 'February';\r\n\t $month[3] = 'March';\r\n\t $month[4] = 'April';\r\n\t $month[5] = 'May';\r\n\t $month[6] = 'June';\r\n\t $month[7] = 'July';\r\n\t $month[8] = 'August';\r\n\t $month[9] = 'September';\r\n\t $month[10] = 'October';\r\n\t $month[11] = 'November';\r\n\t $month[12] = 'December';\t \r\n\t \r\n\t return $month;\r\n }", "function createMonths($id='month_select', $selected= null)\n {\n /*** array of months ***/\n $months = array(\n '01'=>'Jan',\n '02'=>'Feb',\n '03'=>'Mar',\n '04'=>'Apr',\n '05'=>'May',\n '06'=>'Jun',\n '07'=>'Jul',\n '08'=>'Aug',\n '09'=>'Sep',\n '10'=>'Oct',\n '11'=>'Nov',\n '12'=>'Dec');\n\n /*** current month ***/\n\t\n $selected = is_null($selected) ? date('m') : $selected;\n\n $select = '<select name=\"'.$id.'\" id=\"'.$id.'\">'.\"\\n\";\n foreach($months as $key=>$mon)\n {\n $select .= \"<option value=\\\"$key\\\"\";\n $select .= ($key==$selected) ? ' selected=\"selected\"' : '';\n $select .= \">$mon</option>\\n\";\n }\n $select .= '</select>';\n return $select;\n }", "public function showCurrentMonthAction()\r\n {\r\n\t\t$startDate = date('Y-m-01');\r\n\t\t$endDate = date('Y-m-d');\r\n\t\t\r\n\t\t$period = ' - bieżący miesiąc';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }", "public function OrderMonth_Year()\n {\n\t $arrMonth=array();\n\t $year=$this->OrderYear();\n\t foreach($year as $a)\n\t {\n\t\t $arr=array();\n\t\t $select= \"SELECT DISTINCT(month(orderDate)) As orderMonth FROM orders \n\t\t \t\t\twhere year(orderDate)=\".$a->getorderYear(). \" order by orderDate\";\n\t\t $result=$this->executeSelect($select);\n\t\t while($row=mysqli_fetch_array($result))\n\t\t {\n\t\t\t $month=new ordersDto();\n\t\t\t $month->setorderMonth($row['orderMonth']);\n\t\t\t $arr[]=$month;\n\t\t }\n\t\t $this->DisConnectDB();\n\t\t $arrMonth[]=$arr;\n\t }\n/*\t\tfor( $i=0; $i<count($arrMonth); $i++)\n\t\t for($j=0; $j<count($arrMonth[$i]); $j++)\n\t\t\t echo $arrMonth[$i][$j]->getorderMonth();\n\t Thử kiểm tra xem có lấy đc các tháng trong các năm hay k -->>Lấy được\n*/\t\t\n\treturn $arrMonth;\n }", "function mkYearBody($stmonth=false){\n\tif (!$stmonth || $stmonth>12) $stmonth=1;\n$TrMaker = $this->rowCount;\n$curyear = $this->actyear;\n$out=\"<tr>\\n\";\n\tfor ($x=1; $x<=12; $x++) {\n\t\t$this->activeCalendar($curyear,$stmonth,false,$this->GMTDiff);\n\t\t$out.=\"<td valign=\\\"top\\\">\\n\".$this->showMonth().\"</td>\\n\";\n\t\tif ($x == $TrMaker && $x < 12) {\n\t\t\t$out.=\"</tr><tr>\";\n\t\t\t$TrMaker = ($TrMaker+$this->rowCount);\n\t\t}\n\t\tif ($stmonth == 12) {\n\t\t\t$stmonth = 1;\n\t\t\t$curyear++;\n\t\t} \n\t\telse $stmonth++;\n\t}\n$out.=\"</tr>\\n\";\nreturn $out;\n}", "public function getMonth($date){\n // OUTPUT : JSON format of all the month according the the DB\n $month = $this->_makeMonth($date);\n for($i = 0; $i < count($month); $i += 1){\n $_day = $month[$i];\n $day = \\App\\Day::where('date', $_day['full_date'])->first(); // Same as in $this->getWeek($date)\n if ($day != null){\n foreach($day->Agenda as $agenda){\n $month[$i]['items'][] = $this->_makeAgenda($agenda);\n }\n }\n }\n return $month;\n }", "public function getMonths() {\r\n\t\t$month = array();\r\n\r\n\t\t$month[1] = array('id' => 1, 'name' => 'January');\r\n\t\t$month[2] = array('id' => 2, 'name' => 'February');\r\n\t\t$month[3] = array('id' => 3, 'name' => 'March');\r\n\t\t$month[4] = array('id' => 4, 'name' => 'April');\r\n\t\t$month[5] = array('id' => 5, 'name' => 'May');\r\n\t\t$month[6] = array('id' => 6, 'name' => 'June');\r\n\t\t$month[7] = array('id' => 7, 'name' => 'July');\r\n\t\t$month[8] = array('id' => 8, 'name' => 'August');\r\n\t\t$month[9] = array('id' => 9, 'name' => 'September');\r\n\t\t$month[10] = array('id' => 10, 'name' => 'October');\r\n\t\t$month[11] = array('id' => 11, 'name' => 'November');\r\n\t\t$month[12] = array('id' => 12, 'name' => 'December');\r\n\r\n\t\treturn $month; //array\r\n\t}", "function display_month($month, $year) {\n\techo '<br/>';\n\techo \"month = $month, year = $year<br/>\"; \n\t//demo mktime, get unix timestamp for a date\n\t// mktime syntax: mktime($hour, $minute, $second, $month, $day, $year)\n\t$first_day_of_month = mktime(0, 0, 0, $month, 1, $year);\n\n\techo '<br/>';\n\n\techo \" \\n \\r The day's Unix time stamp is: \" . $first_day_of_month . \". &nbsp &nbsp This way of showing time is not user friendly!\";\n\techo '<br/>';\n\t// To display the timestamp in a user readable form \n\n\techo \" The first day of the \" . $month . \"&nbsp month of the year &nbsp\" . $year . \" is: &nbsp\" . date('Y-M-d', $first_day_of_month) . \"!\";\n\techo '<br/>';\n\techo \" The day is: \" . date('Y-M-d H:i:sa', $first_day_of_month) . \"!\";\n\n}", "function display_work_info_month($months)\n{\n ?>\n <thead>\n <tr>\n <th>Luna</th>\n <th>Lucrat</th>\n <th>Absent</th>\n <th>Salariu</th>\n <th>Avans</th>\n <th>Platit</th>\n </tr>\n </thead>\n <tbody>\n <?php\n $y[0] = $y[1] = $y[2] = $y[3] = $y[4] = $y[5] = 0;\n $mon = array(\"01\" => \"IAN\", \"02\" => \"FEB\", \"03\" => \"MAR\", \"04\" => \"APR\", \"05\" => \"MAI\", \"06\" => \"IUN\", \"07\" => \"IUL\", \"08\" => \"AUG\", \"09\" => \"SEP\", \"10\" => \"OCT\", \"11\" => \"SEP\", \"12\" => \"DEC\");\n $nr =null;\n foreach ($months as $nr => $data) {\n ?>\n <tr>\n <th id=\"<?= $_GET['id'].\"&&month=$nr\"; ?>\"><?= $mon[$nr] ?></th>\n <td><?php if (!isset($data['luc'])) {\n $data['luc'] = $data['abs'] = $data['mot'] = $data['sal'] = 0;\n }\n echo $data['luc'] ?> zile\n </td>\n <td><?= $data['abs'] ?> zile &nbsp;\n <span class=\"badge<?php if ($data['mot'] > 0) {\n echo \" danger\";\n } ?>\"><?= $data['mot'] ?></span></td>\n <td><?= $data['sal'] ?> MDL</td>\n <td><?php if (!isset($data['cre'])) {\n $data['cre'] = 0;\n }\n echo $data['cre'] ?> MDL\n </td>\n <td><?php if (!isset($data['pla'])) {\n $data['pla'] = 0;\n }\n echo $data['pla'] ?> MDL\n </td>\n </tr>\n <?php\n $y[0] += $data['luc'];\n $y[1] += $data['abs'];\n $y[2] += $data['mot'];\n $y[3] += $data['sal'];\n $y[4] += $data['cre'];\n $y[5] += $data['pla'];\n } ?>\n </tbody>\n <tfoot class=\"total\">\n <tr>\n <th>Total/6</th>\n <td><?= $y[0] ?> zile</td>\n <td><?= $y[1] ?> zile &nbsp;\n <span class=\"badge<?php if ($y[2] > 0) {\n echo \" danger\";\n } ?>\"><?= $y[2] ?></span></td>\n <td><?= $y[3] ?> MDL</td>\n <td><?= $y[4] ?> MDL</td>\n <td><?= $y[5] ?> MDL</td>\n </tr>\n </tfoot>\n<?php }", "private function getDatesInMonth() {\n $viewer = $this->getViewer();\n\n $timezone = new DateTimeZone($viewer->getTimezoneIdentifier());\n\n $month = $this->month;\n $year = $this->year;\n\n list($next_year, $next_month) = $this->getNextYearAndMonth();\n\n $end_date = new DateTime(\"{$next_year}-{$next_month}-01\", $timezone);\n\n list($start_of_week, $end_of_week) = $this->getWeekStartAndEnd();\n\n $days_in_month = id(clone $end_date)->modify('-1 day')->format('d');\n\n $first_month_day_date = new DateTime(\"{$year}-{$month}-01\", $timezone);\n $last_month_day_date = id(clone $end_date)->modify('-1 day');\n\n $first_weekday_of_month = $first_month_day_date->format('w');\n $last_weekday_of_month = $last_month_day_date->format('w');\n\n $day_date = id(clone $first_month_day_date);\n\n $num_days_display = $days_in_month;\n if ($start_of_week !== $first_weekday_of_month) {\n $interim_start_num = ($first_weekday_of_month + 7 - $start_of_week) % 7;\n $num_days_display += $interim_start_num;\n\n $day_date->modify('-'.$interim_start_num.' days');\n }\n if ($end_of_week !== $last_weekday_of_month) {\n $interim_end_day_num = ($end_of_week - $last_weekday_of_month + 7) % 7;\n $num_days_display += $interim_end_day_num;\n $end_date->modify('+'.$interim_end_day_num.' days');\n }\n\n $days = array();\n\n for ($day = 1; $day <= $num_days_display; $day++) {\n $day_epoch = $day_date->format('U');\n $end_epoch = $end_date->format('U');\n if ($day_epoch >= $end_epoch) {\n break;\n } else {\n $days[] = clone $day_date;\n }\n $day_date->modify('+1 day');\n }\n\n return $days;\n }", "function getMonth(){\r\n return date('F',$this->timestamp);\r\n }", "function months($short = false)\n{\n $months = [\n 0 => 'Month',\n 1 => 'January',\n 2 => 'February',\n 3 => 'March',\n 4 => 'April',\n 5 => 'May',\n 6 => 'June',\n 7 => 'July',\n 8 => 'August',\n 9 => 'September',\n 10 => 'October',\n 11 => 'November',\n 12 => 'December',\n ];\n\n if ($short)\n {\n foreach ($months as $number => $name)\n {\n $months[$number] = substr($name, 0, 3);\n }\n }\n\n return $months;\n}", "public function buildCalendarList(){\n\t\t\n\t\t$first_day = $this->getFirstDay();\t\t\t\t\t\t//Determine what day of the week the month starts on\n\t\t$current_number_of_days = $this->getNumberOfDays();\t\t//Determine the number of days in the month\n\n\t\t$number_of_previous_days = $first_day;\t\t\t\t\t\t\t\t\t\t//Determine the number of days needed to complete the first week\n\t\t$prev_month_number_of_days = $this->getNumberOfDays($this->getMonth()-1); \t//Determine the number of days in the previous month\n\t\t\n\t\t$_SESSION['month'] = $this->getMonth();\n\t\t$_SESSION['year'] = $this->getYear();\n\t\t$_SESSION['view'] = 'list';\n\t\t\n\t\tob_start();?>\n <table border=\"0\" id=\"events_calendar\" class=\"calendar_list\">\n <?php echo $this->buildCalendarHead() ?>\n <tr>\n <td>\n <?php \n /*** CURRENT MONTH CELLS ***/\n $first_day = $this->getYear() . '-' . $this->getMonth() . '-01';\n $last_day = $this->getYear() . '-' . $this->getMonth() . '-' . $current_number_of_days;\n \n $object = $this->events_ob;\n $month_events = new $object();\n $month_events = $month_events->fetchAll(\"WHERE DATE(\" . $this->events_end_date_field . \") >= '\" . $first_day . \"' AND DATE(\" . $this->events_end_date_field . \") <= '\" . $last_day . \"'\", \"ORDER BY `\" . $this->events_end_date_field . \"` DESC\");\n \n if(count($month_events) > 0){\n for($day = 1; $day <= $current_number_of_days; $day++){\t\t//For each day in the current month\n $full_date = $this->getYear() . '-' . $this->getMonth() . '-' . $day;\n \n $events = $this->buildDayList($full_date);\t//get events for each day\n if(strlen(trim($events))){\n ?>\n <div class=\"day\">\n <?php echo $events; ?>\n </div>\n <?php\n }\n }\n }\n else{?>\n \t\t<h5><?php echo 'No events in ' . $this->getMonthName() . ' ' . $this->getYear();?></h5>\n <?php\n }\n ?> \n </td>\n </tr>\n </table>\n <?php\n return ob_get_clean();\n\t}", "function monthNames($format='long')\n {\n $formats = array('one'=>'%b', 'two'=>'%b', 'short'=>'%b', 'long'=>'%B');\n if (!array_key_exists($format,$formats)) {\n $format = 'long';\n }\n $months = array();\n for ($i=1; $i<=12; $i++) {\n $stamp = mktime(0, 0, 0, $i, 1, 2003);\n $month = strftime($formats[$format], $stamp);\n switch($format) {\n case 'one':\n $month = substr($month, 0, 1);\n break;\n case 'two':\n $month = substr($month, 0, 2);\n break;\n }\n $months[$i] = $month;\n }\n return $months;\n }", "function date_month($month) {\n\tswitch ($month) {\n\t\tcase 1:\n\t\t\techo \"Януари\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\techo \"Февруари\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\techo \"Март\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\techo \"Април\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\techo \"Май\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\techo \"Юни\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\techo \"Юли\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\techo \"Август\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\techo \"Септември\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\techo \"Октомври\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\techo \"Ноември\";\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\techo \"Декември\";\n\t\t\tbreak;\n\t}\n}", "function generate_category_content()\n {\n global $conf, $page;\n\n $view_type = $page['chronology_view'];\n if ($view_type==CAL_VIEW_CALENDAR)\n {\n global $template;\n $tpl_var = array();\n if ( count($page['chronology_date'])==0 )\n {//case A: no year given - display all years+months\n if ($this->build_global_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==1 )\n {//case B: year given - display all days in given year\n if ($this->build_year_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n $this->build_nav_bar(CYEAR); // years\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==2 )\n {//case C: year+month given - display a nice month calendar\n if ( $this->build_month_calendar($tpl_var) )\n {\n $template->assign('chronology_calendar', $tpl_var);\n }\n $this->build_next_prev();\n return true;\n }\n }\n\n if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)\n {\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1)\n {\n $this->build_nav_bar(CMONTH); // month\n }\n if ( count($page['chronology_date'])==2 )\n {\n $day_labels = range( 1, $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR] ,$page['chronology_date'][CMONTH] ) );\n array_unshift($day_labels, 0);\n unset( $day_labels[0] );\n $this->build_nav_bar( CDAY, $day_labels ); // days\n }\n $this->build_next_prev();\n }\n return false;\n }", "public static function get_month($i) {\n\t\tswitch($i) {\n\t\t\tcase 1:\n\t\t\t\treturn __('January');\n\t\t\tcase 2:\n\t\t\t\treturn __('February');\n\t\t\tcase 3:\n\t\t\t\treturn __('March');\n\t\t\tcase 4:\n\t\t\t\treturn __('April');\n\t\t\tcase 5:\n\t\t\t\treturn __('May');\n\t\t\tcase 6:\n\t\t\t\treturn __('June');\n\t\t\tcase 7:\n\t\t\t\treturn __('July');\n\t\t\tcase 8:\n\t\t\t\treturn __('August');\n\t\t\tcase 9:\n\t\t\t\treturn __('September');\n\t\t\tcase 10:\n\t\t\t\treturn __('October');\n\t\t\tcase 11:\n\t\t\t\treturn __('November');\n\t\t\tcase 12:\n\t\t\t\treturn __('December');\n\t\t\tdefault:\n\t\t\t\treturn 'Invalid Month index \"'.$i.'\"';\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn View::make('historymonths.create');\n\t}", "function hr_mjesec($month)\n{\n $mj_array[1] = 'Sijecanj';\n $mj_array[2] = 'Veljaca';\n $mj_array[3] = 'Ozujak';\n $mj_array[4] = 'Travanj';\n $mj_array[5] = 'Svibanj';\n $mj_array[6] = 'Lipanj';\n $mj_array[7] = 'Srpanj';\n $mj_array[8] = 'Kolovoz';\n $mj_array[9] = 'Rujan';\n $mj_array[10] = 'Listopad';\n $mj_array[11] = 'Studeni';\n $mj_array[12] = 'Prosinac';\n\n return $mj_array[$month];\n}", "public function __construct() {\r\n $this->setMode(self::$modeMonth);\r\n }", "public function months()\n {\n $input = $this->months;\n\n if (is_null($input) || in_array(0, $input)) { return 'Any month';}\n if (count($input) == 1 ) {return monthsList()[$input[0]];}\n\n sort($input);\n $output = collect($input)->map(function($month) {\n return monthsList()[$month];\n })\n ->implode(', ')\n ;\n\n return $output;\n }", "function mkMonthFoot(){\nreturn \"</table>\\n\";\n}", "function display( )\r\n\t{\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t$view = $this->getView( $this->get( 'suffix' ), 'html' );\r\n\t\t$view->assign( 'date', $date );\r\n\t\t\r\n\t\tparent::display( );\r\n\t}", "public function indexgraphmonthAd()\n {\n\n // ->elementLabel(\"amout\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupBy('name');\n\n // $bills = Bill::where(DB::raw(\"(DATE_FORMAT(updated_at,'%Y'))\"),date('Y'))->get();\n // $chart = Charts::database($bills, 'bar', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->groupByMonth(date('Y'), true);\n\n // $data = Bill::where('updated_at', '2018-12-10')->get();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('updated_at'))\n // ->values($data->pluck('sum'));\n\n $chart = Charts::database(Bill::all(), 'bar', 'highcharts')\n ->elementLabel(\"Total\")\n ->dimensions(1000, 500)\n ->responsive(false)\n ->lastByMonth(12, true);\n\n \n\n // $data = BillDetail::all();\n // $chart = Charts::create('line', 'highcharts')\n // ->elementLabel(\"Total\")\n // ->dimensions(1000, 500)\n // ->responsive(false)\n // ->labels($data->pluck('name'))\n // ->values($data->pluck('amout'));\n\n\n // ->template(\"material\")\n // ->dataset('Element 1', [5,20,100])\n // ->dataset('Element 1', [15,30,80])\n // ->dataset('Element 1', [25,10,40])\n // ->labels(['One', 'Two', 'Three']);\n\n return view('adminPharmacy.a_graphmonth', ['chart' => $chart]);\n }", "protected function build_global_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 0 );\n $query='\n SELECT '.pwg_db_get_date_YYYYMM($this->date_field).' as period,\n COUNT(distinct id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY '.pwg_db_get_year($this->date_field).' DESC, '.pwg_db_get_month($this->date_field).' ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $y = substr($row['period'], 0, 4);\n $m = (int)substr($row['period'], 4, 2);\n if ( ! isset($items[$y]) )\n {\n $items[$y] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$y]['children'][$m] = $row['count'];\n $items[$y]['nb_images'] += $row['count'];\n }\n //echo ('<pre>'. var_export($items, true) . '</pre>');\n if (count($items)==1)\n {// only one year exists so bail out to year view\n list($y) = array_keys($items);\n $page['chronology_date'][CYEAR] = $y;\n return false;\n }\n\n global $lang;\n foreach ( $items as $year=>$year_data)\n {\n $chronology_date = array( $year );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $year_data['children'], false, false, $lang['month'] );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $year_data['nb_images'],\n 'HEAD_LABEL' => $year,\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function definition()\n {\n $now = new DateTime();\n $previousMonth = (new DateTime())->setDate(\n (int)$now->format('Y'),\n (int)$now->format('m') - 1,\n 1,\n );\n\n return [\n 'begin_date' => $previousMonth->format('Y.m.01 00:00:00'),\n 'end_date' => $previousMonth->format('Y.m.t 23:59:59'),\n ];\n }", "function monthOptions(){\n\t\t$months = range('01', '12');\n\t\tforeach ($months as $key => $month) {\n\t\t\t$months[$key] = str_pad($month, 2, '0', STR_PAD_LEFT);\n\t\t}\n\t\treturn array_combine($months, $months);\n\t}", "public function getCcMonths()\r\n {\r\n $months = $this->getData('cc_months');\r\n if (is_null($months)) {\r\n $months[0] = $this->__('Month');\r\n $months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());\r\n $this->setData('cc_months', $months);\r\n }\r\n return $months;\r\n }", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n return $months;\n }", "function getMonth($selMonth=\"\"){\n\t\t$strMonths = \"\";\n\t\t$strMonths = \"<option value=''>00</option>\";\n\t\tfor($ind=1;$ind<=12;$ind++){\n\t\t\tif($ind == $selMonth)\n\t\t\t\t$strSel = \"selected\";\n\t\t\telse\n\t\t\t\t$strSel = \"\";\n\t\t\t\t\n\t\t\t$strMonths.=\"<option value=\".$ind.\" $strSel>\".(strlen($ind)==1?\"0\".$ind:$ind).\"</option>\";\n\t\t}\n\t\t\n\t\treturn $strMonths;\n\t}", "public function getMonthName($i)\n {\n // elseif ($i == 2) $bulan = 'feb' ;\n // elseif ($i == 3) $bulan = 'mar' ;\n // elseif ($i == 4) $bulan = 'apr' ;\n // elseif ($i == 5) $bulan = 'mei' ;\n // elseif ($i == 6) $bulan = 'jun' ;\n // elseif ($i == 7) $bulan = 'jul' ;\n // elseif ($i == 8) $bulan = 'ags' ;\n // elseif ($i == 9) $bulan = 'sep' ;\n // elseif ($i == 10) $bulan = 'okt' ;\n // elseif ($i == 11) $bulan = 'nov' ;\n // elseif ($i == 12) $bulan = 'des' ;\n // return $bulan;\n echo \"2\";\n }", "function selectMonth(){\n $months = array(\"November\",\"December\",\"January\", \"February\");\n \n for($i = 0; $i < sizeof($months); $i++){\n echo \"<option value='\" .$months[$i]. \"'>\" .$months[$i]. \"</option>\";\n }\n }", "public static function monthly() {return new ScheduleViewMode(4);}", "public function testGetMonthNames()\r\n {\r\n $calendar = new \\tabs\\api\\property\\Calendar(array('month_type' => 'short'));\r\n $this->assertEquals('Jan', $calendar->getMonthName('01'));\r\n $this->assertEquals('Feb', $calendar->getMonthName('02'));\r\n $this->assertEquals('Mar', $calendar->getMonthName('03'));\r\n $this->assertEquals('Apr', $calendar->getMonthName('04'));\r\n $this->assertEquals('May', $calendar->getMonthName('05'));\r\n $this->assertEquals('Jun', $calendar->getMonthName('06'));\r\n $this->assertEquals('Jul', $calendar->getMonthName('07'));\r\n $this->assertEquals('Aug', $calendar->getMonthName('08'));\r\n $this->assertEquals('Sep', $calendar->getMonthName('09'));\r\n $this->assertEquals('Oct', $calendar->getMonthName('10'));\r\n $this->assertEquals('Nov', $calendar->getMonthName('11'));\r\n $this->assertEquals('Dec', $calendar->getMonthName('12'));\r\n }", "public function api_getTable($month,$year)\n\t{\n\t\t$employees = Employee::all();\n\n\t\tforeach ($employees as $key => $value) {\n\t\t\t$calendar = Calendar::where('employee_id', '=', $value->id)->where('month',$month)->where('year',$year)->first();\n\t\t\tif($calendar == null)\n\t\t\t{\n\t\t\t\t$calendar = $this->bornCalendarEmpty($value->id, $month, $year);\n\t\t\t}\n\t\t\t$this->generatePresenteWhenInitNewDate($calendar, $month, $year);\n\t\t\t$employees[$key]->calendar = $calendar;\n\t\t}\n\n?>\n <div id=\"datafullname\" style=\"display:none\"></div>\n <div class=\"sidebar-calendar\">\n <table>\n <thead>\n <tr><th><div class=\"nameitem\">Fullname</div></th></tr>\n </thead>\n <tbody>\n <tr class=\"itemblank\">\n <td><div class=\"nameitem\"></div></td>\n </tr>\n <?php foreach($employees as $key => $value) : ?>\n <tr>\n <!-- <td><div class=\"nameitem\">{{ $value->id }}</div></td> -->\n <td><div class=\"nameitem\" idem=\"<?php echo $value->id; ?>\"><?php echo $value->lastname.\" \".$value->firstname; ?></div></td>\n </tr>\n <?php endforeach;?>\n </tbody>\n </table>\n </div>\n <div class=\"content-calendar\">\n <div id=\"datacalendar\" style=\"display:none\"></div>\n <table>\n <thead>\n <tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=1;$i<=31;$i++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dt = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (checkDateValid($i, $month, $year)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dt = Carbon::create($year, $month, $i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<th><div class='day'>\".$i.\"<br/>\".toEnglishDate($dt->dayOfWeek).\"</div></th>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n </tr>\n </thead>\n <tbody>\n <tr class=\"itemblank\">\n <td><div class=\"innerblank\"></div></td>\n </tr>\n <?php\n foreach($employees as $key => $value)\n {\n $calendar = $value->calendar;\n ?>\n <tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=1;$i<=31;$i++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dt = Carbon::create($year, $month, $i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (checkDateValid($i, $month, $year)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($dt->dayOfWeek == 6 || $dt->dayOfWeek == 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"background-color:#ffbff7\"><div class=\"item\" idem=\"{{ $value->id }}\" idday=\"<?php echo $i;?>\" ><?php echo $calendar->{'n'.$i};?></div></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td><div class=\"item\" idem=\"{{ $value->id }}\" idday=\"<?php echo $i;?>\" ><?php echo $calendar->{'n'.$i};?></div></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n </tr>\n <?php\n }\n ?>\n\n </tbody>\n </table>\n </div>\n\n\t\t<?php\n\t}", "function setMonth($m)\r\n {\r\n if($m < 1 || $m > 12) {\r\n $this->mes = 1;\r\n } else {\r\n $this->mes = $m;\r\n }\r\n }", "public function month($value) {\n return $this->setProperty('month', $value);\n }", "function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}", "public function getMonthlyInstalment();", "function displayCurrentMonthCalenderAsTable()\n{\nglobal $year; // this year\nglobal $month; // this month\nglobal $id;\n$day=1; // start from first of month\nglobal $crypted;\nglobal $month_caption; // caption to table\n$lastmonth = $month - 1;\n$nextmonth = $month +1;\n$lastyear = $year - 1;\n$nextyear = $year + 1;\necho \"<table summary=\\\"Monthly calendar\\\" onMouseover= changeto('#CCCCCC') onMouseout= changeback('white') width = 757 cellspacing= 2 cellpadding= 2 id= ignore class=\\\"sk_bok_green\\\">\n<caption ><a href=comm.php?crypted=$_GET[crypted]&calender&lastyear=$lastyear ><font color=green>Last Year</font></a>&nbsp;&nbsp;&nbsp;<a href=comm.php?crypted=$_GET[crypted]&calender&last=$lastmonth&year=$year><font color=green>Last Month</a>&nbsp;&nbsp;&nbsp; <b>[$month_caption ]</b> &nbsp;&nbsp;&nbsp;<a href=comm.php?crypted=$_GET[crypted]&calender&next=$nextmonth&year=$year><font color= green>Next Month</font></a> &nbsp;<a href=comm.php?crypted=$_GET[crypted]&calender&lastyear=$nextyear><font color= green>Next Year<font></a></caption>\n<tr align=center id=ignore>\n<th width =308 id=ignore bgcolor=#FFC56C ><font color =Red>Sun</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Mon</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Tue</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Wed</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Thu</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Fri</font></th> \n<th width =308 id=ignore bgcolor=#FFC56C><font color =blue>Sat</font></th> \n</tr>\\n\"; \n\n$ts = mktime(0,0,0,$month,$day,$year); // unix timestamp of the first day of current month\n$weekday_first_day = date(\"w\",$ts); // which is the weekday of the first day of week 0-Sunday 6-Saturday\n//$my_format = date(\"d-m-Y\");\n$slot=0;\n\nprint \"<tr align=center >\\n\"; // First row starts\nfor($i=0;$i<$weekday_first_day;$i++) // Pad the first few rows(slots)\n{\nprint \" <td id=ignore width =308></td>\"; // Empty slots \n$slot++;\n}\n\tif($day == '')\n\t{\n\t\t$ig = 'ignore';\n\t\techo \">>\";\n\t}\n\nwhile(checkdate($month,$day,$year) && $date<32) // till there are valid days in current month\n{\nif($slot == 7) // if we moved past saturday\n{\n$slot = 0; // reset and move back to sunday\nprint \"</tr>\\n\"; // end of this row\nprint \"<tr align=center width =50>\\n\"; // move on to next row\n\n}\n\t//$system_date = '$day-$month-$year';\n\t//$db_date = date('d-m-Y',$day $month $year);\n\t$system_date = mktime(0, 0, 0, $month, $day, $year);\n\t$db_date = date('d-m-Y',$system_date);\n\t$db_date_search = explode('-',$db_date);\n\t//print_r($db_date_search);\n\t$search_date = mktime(0, 0, 0, $month, $day);\n\t$search_date = sprintf(date('d-m-',$search_date));\n\t$month_no = $db_date_search[1];\n\t $query =\"select * from calender_event where active = '1' and day = '$db_date_search[0]' and `month_no` = '$month_no' and year = '$db_date_search[2]' \";\n\t\n\t$result = mysql_query($query) or die(mysql_error());\n\t$count = mysql_num_rows($result);\n\t/* echo $query;\n\techo $count; */\n\t$tr = 0;\n\t\n\tif($count != '0')\n\t{\t$msg .= \"<table id=ignore width=100%>\";\n\t\twhile($row=mysql_fetch_array($result))\n\t\t{\n\t\t\n\t\tif($row[popup] =='1')\n\t\t{\n\t\t\t$popup_link = \" onmouseout=\\\"hideTooltip()\\\" onmouseover=\\\"showTooltip(event,'$row[pop_msg]'\";\n\t\t\n\t\t}else\n\t\t{\n\t\t\t$popup_link =\"\";\n\t\t}\n\t\t\n\t\t$msg .= \"<tr ><td id=ignore bgcolor=green>$row[heading]</td></tr><tr><td id=ignore bgcolor=white><a href=\\\"comm.php?crypted=$_GET[crypted]&last=$month_no&year=$db_date_search[2]&calender&edit_event=$row[sno]\\\" $popup_link);return false\\\">$row[details]</a></td></tr>\";\n\t\t}\n\t\t$msg .= \"</table>\";\n\t}else\n\t{\n\t\t$msg ='';\n\t\n\t}\n\t//chking all db\n\t$color = \"bgcolor = white\";\n\techo \"<td $color id=$idd width =308 hight=308><DIV align=center id= tips><a href = #><font color=black><a href=comm.php?crypted=$_GET[crypted]&last=$month_no&year=$db_date_search[2]&calender&add_event=$db_date_search[0]-$db_date_search[1]-$db_date_search[2]>$day</a> </font>\n\t\t\n\t\t \";\n\t\n\t\n\t\techo \"</div ></a>$msg</div ></td>\";\n$msg ='';\n\t\n\n$day++;\n$slot++;\n}\n\nif($slot>0) // have we started off a new last row \n{\nwhile($slot<7) // padding at the end to complete the last row table\n{\nprint \" <td id=ignore></td>\"; // empty slots\n$slot++;\n}\nprint \"\\n</tr>\\n\"; // close out last row\n}\nprint '</table>'; //end of table\n}", "protected function getMonthHTML(\n $month,\n $mth_num,\n $opt,\n $year_num,\n $table_cols,\n $first_weekday,\n $today\n ) {\n $cal = '<tr>';\n // insert month name into first column of row\n $cal .= $this->getMonthNameHTML($mth_num);\n $cur_day = 0;\n for ($col = 0; $col < $table_cols; $col++) {\n $weekday_num = ($col + $first_weekday) % 7; // current day of week as a number\n\n // current day is only valid if within the month's days, and at the correct starting day\n if (($cur_day > 0 && $cur_day < $month['len']) || ($col < 7 && $weekday_num == $month['start'])) {\n $cur_day++;\n $cal .= $this->getDayHTML($cur_day, $mth_num, $today, $year_num, $weekday_num, $opt);\n } else {\n $cur_day = 0;\n $cal .= $this->getEmptyCellHTML();\n }\n }\n $cal .= '</tr>';\n\n return $cal;\n }", "function build_calendar($month,$year,$dateArray) {\r\n $daysOfWeek = array('S','M','T','W','T','F','S');\r\n\r\n // What is the first day of the month in question?\r\n $firstDayOfMonth = mktime(0,0,0,$month,1,$year);\r\n\r\n // How many days does this month contain?\r\n $numberDays = date('t',$firstDayOfMonth);\r\n\r\n // Retrieve some information about the first day of the\r\n // month in question.\r\n $dateComponents = getdate($firstDayOfMonth);\r\n\r\n // What is the name of the month in question?\r\n $monthName = $dateComponents['month'];\r\n\r\n // What is the index value (0-6) of the first day of the\r\n // month in question.\r\n $dayOfWeek = $dateComponents['wday'];\r\n\r\n // Create the table tag opener and day headers\r\n\r\n $calendar = \"<table class='table table-bordered'>\";\r\n $calendar .= \"<caption>$monthName $year</caption>\";\r\n $calendar .= \"<tr>\";\r\n\r\n // Create the calendar headers\r\n\r\n foreach($daysOfWeek as $day) {\r\n $calendar .= \"<th class='header'>$day</th>\";\r\n } \r\n\r\n // Create the rest of the calendar\r\n\r\n // Initiate the day counter, starting with the 1st.\r\n\r\n $currentDay = 1;\r\n\r\n $calendar .= \"</tr><tr>\";\r\n\r\n // The variable $dayOfWeek is used to\r\n // ensure that the calendar\r\n // display consists of exactly 7 columns.\r\n\r\n if ($dayOfWeek > 0) { \r\n $calendar .= \"<td colspan='$dayOfWeek'>&nbsp;</td>\"; \r\n }\r\n \r\n $month = str_pad($month, 2, \"0\", STR_PAD_LEFT);\r\n \r\n while ($currentDay <= $numberDays) {\r\n\r\n // Seventh column (Saturday) reached. Start a new row.\r\n\r\n if ($dayOfWeek == 7) {\r\n\r\n $dayOfWeek = 0;\r\n $calendar .= \"</tr><tr>\";\r\n\r\n }\r\n \r\n $currentDayRel = str_pad($currentDay, 2, \"0\", STR_PAD_LEFT);\r\n \r\n $date = \"$year-$month-$currentDayRel\";\r\n\t\tif($date == date('Y-m-d')){\r\n\t\t\t$calendar .= \"<td class='col-md-1 col-xs-1' rel='$date' bgcolor='#ADD8E6'>$currentDay<br/>\";\r\n\t\t}else{\r\n\t\t\t$calendar .= \"<td class='col-md-1 col-xs-1' rel='$date'>$currentDay<br/>\";\r\n\t\t}\r\n \r\n\t\t $sql = mysql_query(\"SELECT * FROM leavesys.leave_details WHERE date = '\".$date.\"'\");\r\n\t\t while($result = mysql_fetch_array($sql)){\r\n\t\t\t $sql2 = mysql_query(\"SELECT * FROM user WHERE id = '\".$result['applicant_id'].\"'\");\r\n\t\t\t $result2 = mysql_fetch_assoc($sql2);\r\n\t\t\t\tif($result['half'] == 1){\r\n\t\t\t\t\t$c_content = \" (am)\";\r\n\t\t\t\t}else if($result['half'] == 2){\r\n\t\t\t\t\t$c_content = \" (pm)\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$c_content = \"\";\r\n\t\t\t\t}\r\n\t\t\t\t$calendar .= $result2['country_code'].\" - \".$result2['name'].$c_content.\"<br/>\";\r\n\t\t }\r\n\t\t $sql1 = mysql_query(\"SELECT * FROM leavesys.holiday WHERE date = '\".$date.\"'\");\r\n\t\t while($result1 = mysql_fetch_array($sql1)){\r\n\t\t\t if($result1['country'] == \"al\"){\r\n\t\t\t\t $calendar .= \"<font color='blue;'>\".$result1['name'].\"</font><br/>\";\r\n\t\t\t }else{\r\n\t\t\t\t$calendar .= \"<font color='blue;'>\".$result1['name'].\" (\".$result1['country'].\")</font><br/>\";\r\n\t\t\t }\r\n\t\t }\r\n\t\t $calendar .= \"</td>\";\r\n\r\n // Increment counters\r\n \r\n $currentDay++;\r\n $dayOfWeek++;\r\n\r\n }\r\n \r\n \r\n\r\n // Complete the row of the last week in month, if necessary\r\n\r\n if ($dayOfWeek != 7) { \r\n \r\n $remainingDays = 7 - $dayOfWeek;\r\n $calendar .= \"<td colspan='$remainingDays'>&nbsp;</td>\"; \r\n\r\n }\r\n \r\n $calendar .= \"</tr>\";\r\n\r\n $calendar .= \"</table>\";\r\n\r\n return $calendar;\r\n\r\n}" ]
[ "0.73935616", "0.7041853", "0.67926854", "0.66831195", "0.66279286", "0.6617421", "0.6536828", "0.6473009", "0.6435724", "0.6414517", "0.64120907", "0.6408968", "0.6383224", "0.63521445", "0.6348271", "0.63159007", "0.631117", "0.6222103", "0.62045795", "0.61959517", "0.61901295", "0.6182413", "0.61705947", "0.61674434", "0.6159054", "0.61405504", "0.6122599", "0.6100624", "0.6084469", "0.6058697", "0.60495293", "0.60370696", "0.60340893", "0.6015372", "0.6011111", "0.6005866", "0.5996447", "0.59890425", "0.5975739", "0.59621704", "0.59581685", "0.5957311", "0.5943211", "0.59423655", "0.5939593", "0.59184587", "0.5914545", "0.5905366", "0.58983815", "0.58931017", "0.5890845", "0.5879924", "0.58796465", "0.5870903", "0.5869308", "0.58597285", "0.58586997", "0.58515126", "0.58426887", "0.58391684", "0.58337253", "0.58302885", "0.58202606", "0.58140725", "0.58061194", "0.5799195", "0.579397", "0.5793512", "0.57873446", "0.5781299", "0.57739305", "0.5771989", "0.57440096", "0.57438725", "0.5724705", "0.5713363", "0.5712332", "0.5711282", "0.57069224", "0.57019126", "0.56982255", "0.56878585", "0.5686442", "0.56844085", "0.56719285", "0.56664443", "0.56626666", "0.56560695", "0.5653387", "0.5647118", "0.5638475", "0.56359935", "0.56067073", "0.56051636", "0.56044126", "0.55996907", "0.55985963", "0.55965245", "0.5594942", "0.5589823" ]
0.72050965
1
Structure for days in month
function mkDays ($numDays, $month, $year) { for ($i = 1; $i <= $numDays; $i++) { $eachDay[$i] = $i; } foreach($eachDay as $day => &$wkday) { $wkday = date("w", mktime(0,0,0,$month,$day,$year)); } foreach($eachDay as $day=>&$wkday) { echo "<table class='box' id=$day month=$month year=$year>"; echo "<td>"; echo $day; echo "</td>"; echo "</table>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDaysInMonth()\r\n {\r\n return Data_Calc::diasInMonth($this->mes, $this->ano);\r\n }", "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "public function daysOfMonthProvider(): array\n {\n return [\n // Time Days Match?\n ['1st January', [1], true],\n ['2nd January', [1], false],\n ['2nd January', [2], true],\n ['2nd January', [1, 2], true],\n ['31st January', [1, 8, 23, 31], true],\n ['29th February 2020', [29], true],\n ];\n }", "private function _daysInMonth ()\n {\n return date('t', strtotime($this->currentYear.'-'.$this->currentMonth));\n }", "function get_month_days ($month) {\n $labels = array();\n $month = month_converter($month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n $day = $date->format('d');\n $i = 0;\n while ($i < 30) {\n if ($day <= $monthdays) {\n if (strlen($day) == 1) {\n $day = '0' . $day;\n }\n if (strlen($month) == 1) {\n $month = '0' . $month;\n }\n $labels[] = $day.'-'.$month;\n $day++;\n $i++;\n } else {\n $day = 1;\n $month++;\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n }\n }\n return $labels;\n}", "private function getDatesInMonth() {\n $viewer = $this->getViewer();\n\n $timezone = new DateTimeZone($viewer->getTimezoneIdentifier());\n\n $month = $this->month;\n $year = $this->year;\n\n list($next_year, $next_month) = $this->getNextYearAndMonth();\n\n $end_date = new DateTime(\"{$next_year}-{$next_month}-01\", $timezone);\n\n list($start_of_week, $end_of_week) = $this->getWeekStartAndEnd();\n\n $days_in_month = id(clone $end_date)->modify('-1 day')->format('d');\n\n $first_month_day_date = new DateTime(\"{$year}-{$month}-01\", $timezone);\n $last_month_day_date = id(clone $end_date)->modify('-1 day');\n\n $first_weekday_of_month = $first_month_day_date->format('w');\n $last_weekday_of_month = $last_month_day_date->format('w');\n\n $day_date = id(clone $first_month_day_date);\n\n $num_days_display = $days_in_month;\n if ($start_of_week !== $first_weekday_of_month) {\n $interim_start_num = ($first_weekday_of_month + 7 - $start_of_week) % 7;\n $num_days_display += $interim_start_num;\n\n $day_date->modify('-'.$interim_start_num.' days');\n }\n if ($end_of_week !== $last_weekday_of_month) {\n $interim_end_day_num = ($end_of_week - $last_weekday_of_month + 7) % 7;\n $num_days_display += $interim_end_day_num;\n $end_date->modify('+'.$interim_end_day_num.' days');\n }\n\n $days = array();\n\n for ($day = 1; $day <= $num_days_display; $day++) {\n $day_epoch = $day_date->format('U');\n $end_epoch = $end_date->format('U');\n if ($day_epoch >= $end_epoch) {\n break;\n } else {\n $days[] = clone $day_date;\n }\n $day_date->modify('+1 day');\n }\n\n return $days;\n }", "public function getNumberOfDays($month = \"\"){ $month = ($month == \"\")? $this->getMonth(): $month; return cal_days_in_month(CAL_GREGORIAN,$month,$this->getYear());}", "function getDays_ym($month, $year){\n // Start of Month\n $start = new DateTime(\"{$year}-{$month}-01\");\n $month = $start->format('F');\n\n // Prepare results array\n $results = array();\n\n // While same month\n while($start->format('F') == $month){\n // Add to array\n $day = $start->format('D');\n $sort_date = $start->format('j');\n $date = $start->format('Y-m-d');\n $results[$date] = ['day' => $day,'sort_date' => $sort_date,'date' => $date];\n\n // Next Day\n $start->add(new DateInterval(\"P1D\"));\n }\n // Return results\n return $results;\n}", "function getNbDayInMonth()\n {\n return $this->nbDaysMonth;\n }", "private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }", "public static function getDaysInMonth($month, $year) {}", "public function getMonths();", "public function get_month_permastruct()\n {\n }", "public function getDaysAsArray()\n {\n $days = [];\n $startCurrent = $this->weekdayIndexes[$this->currentMonth[\"weekday\"]];\n $startPrevious = $this->noOfDaysPrevious - ($startCurrent - 1);\n // Add days of previous month\n for ($i = $startPrevious; $i <= $this->noOfDaysPrevious; $i++) {\n $days[] = $i;\n }\n // Add days of current month\n for ($j = 1; $j <= $this->noOfDays; $j++) {\n $days[] = $j;\n }\n // Add days of next month\n for ($k = 1; count($days) % 7 !== 0; $k++) {\n $days[] = $k;\n }\n return $days;\n }", "public function days() {\n //TODO prediction\n }", "function daysInMonth( $month=0, $year=0 ) {\n\t\t$month = intval( $month );\n\t\t$year = intval( $year );\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\tif ($month == 2) {\n\t\t\tif (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0) {\n\t\t\t\treturn 29;\n\t\t\t} else {\n\t\t\t\treturn 28;\n\t\t\t}\n\t\t} else if ($month == 4 || $month == 6 || $month == 9 || $month == 11) {\n\t\t\treturn 30;\n\t\t} else {\n\t\t\treturn 31;\n\t\t}\n\t}", "private function _getDaysArray($month, $year = 0)\n {\n if ($year == 0)\n {\n $year = $this->year;\n }\n\n $days = array();\n\n // Return everyday of the month if both bit[2] and bit[4] are '*'\n if ($this->bits[2] == '*' AND $this->bits[4] == '*')\n {\n $days = $this->_getDays($month, $year);\n }\n else\n {\n // Create an array for the weekdays\n if (substr($this->bits[4], 0, 1) == '*')\n {\n if (substr($this->bits[4], 1, 1) == '/')\n {\n $step = (int) substr($this->bits[4], 2);\n }\n else\n {\n $step = 1;\n }\n \n for ($i = 0; $i <= 6; $i += $step)\n {\n $arWeekdays[] = $i;\n }\n }\n else\n {\n $arWeekdays = $this->_expandRanges($this->bits[4]);\n $arWeekdays = $this->_sanitize($arWeekdays, 0, 7);\n\n // Map 7 to 0, both represents Sunday. Array is sorted already!\n if (in_array(7, $arWeekdays))\n {\n if (in_array(0, $arWeekdays))\n {\n array_pop($arWeekdays);\n }\n else\n {\n $tmp[] = 0;\n array_pop($arWeekdays);\n $arWeekdays = array_merge($tmp, $arWeekdays);\n }\n }\n }\n\n if ($this->bits[2] == '*')\n {\n $daysmonth = $this->_getDays($month, $year);\n }\n else\n {\n $daysmonth = $this->_expandRanges($this->bits[2]);\n\n // So that we do not end up with 31 of Feb\n $daysInMonth = $this->_daysInMonth($month, $year);\n $daysmonth = $this->_sanitize($daysmonth, 1, $daysInMonth);\n }\n\n // Now match these days with weekdays\n foreach ($daysmonth AS $day)\n {\n $wkday = date('w', mktime(0, 0, 0, $month, $day, $year));\n if (in_array($wkday, $arWeekdays))\n {\n $days[] = $day;\n }\n }\n }\n\n return $days;\n }", "function daysInMonth($m, $y)\n\t{\n\t\tif( $m < 1 || $m > 12 )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// 30: 9, 4, 6, 11\n\t\t\tif( $m == 9 || $m == 4 || $m == 6 || $m == 11 )\n\t\t\t{\n\t\t\t\treturn 30;\n\t\t\t}\n\t\t\telse if( $m != 2 )\n\t\t\t{\n\t\t\t\t// all the rest have 31\n\t\t\t\treturn 31;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// except for february alone\n\t\t\t\tif( $y % 4 != 0 )\n\t\t\t\t{\n\t\t\t\t\t// which has 28\n\t\t\t\t\treturn 28;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif( $y % 100 != 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t// and on leap years 29\n\t\t\t\t\t\treturn 29;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $y % 400 != 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// deja vu: which has 28\n\t\t\t\t\t\t\treturn 28;\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// deja vu: and on leap years 29\n\t\t\t\t\t\t\treturn 29;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function getDaysArray($month, $year)\n\t{\n\t\t$daysinmonth = $this->days_in_month($month, $year);\n\t\t$domStar = false;\n\t\t$dowStar = false;\n\t\t$da = array_pad([], $daysinmonth + 1, null);\n\t\tunset($da[0]);\n\t\t$dwa = array_pad([], $daysinmonth + 1, null);\n\t\tunset($dwa[0]);\n\t\tforeach ($this->_attr[self::DAY_OF_MONTH] as $d) {\n\t\t\tif ($d['dom'] === '*' || $d['dom'] === '?') {\n\t\t\t\t$domStar = (($d['dom'] == '?') || ($d['period'] == 1));\n\t\t\t\tforeach ($da as $key => $value) {\n\t\t\t\t\tif (($key - 1) % $d['period'] == 0) {\n\t\t\t\t\t\t$da[$key] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif (is_numeric($d['dom'])) {\n\t\t\t\t$startDay = $d['dom'];\n\t\t\t\tif ($d['domWeekday']) {\n\t\t\t\t\t$datea = getdate(strtotime(\"$year-$month-$startDay\"));\n\t\t\t\t\tif ($datea['wday'] == 6) {\n\t\t\t\t\t\tif ($startDay == 1) {\n\t\t\t\t\t\t\t$startDay = 3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$startDay--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($datea['wday'] == 0) {\n\t\t\t\t\t\tif ($startDay == $daysinmonth) {\n\t\t\t\t\t\t\t$startDay = $daysinmonth - 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$startDay++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$endDay = $d['end'];\n\t\t\t\tif ($d['endWeekday']) {\n\t\t\t\t\t$datea = getdate(strtotime(\"$year-$month-$endDay\"));\n\t\t\t\t\tif ($datea['wday'] == 6) {\n\t\t\t\t\t\tif ($endDay == 1) {\n\t\t\t\t\t\t\t$endDay = 3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$endDay--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($datea['wday'] == 0) {\n\t\t\t\t\t\tif ($endDay == $daysinmonth) {\n\t\t\t\t\t\t\t$endDay = $daysinmonth - 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$endDay++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor ($i = $startDay; $i <= $endDay && $i <= 31; $i += $d['period']) {\n\t\t\t\t\t$da[$i] = 1;\n\t\t\t\t}\n\t\t\t} elseif ($d['dom'] == 'L') {\n\t\t\t\t$less = empty($d['end']) ? 0 : $d['end'];\n\t\t\t\t$da[$daysinmonth - $less] = 1;\n\t\t\t}\n\t\t}\n\t\t$firstDatea = getdate(strtotime(\"$year-$month-01\"));\n\t\tforeach ($this->_attr[self::DAY_OF_WEEK] as $d) {\n\t\t\tif (is_numeric($d['dow'])) {\n\t\t\t\t//start at the first sunday on or before the 1st day of the month\n\t\t\t\tfor ($i = 1 - $firstDatea['wday']; $i <= $daysinmonth; $i += 7) {\n\t\t\t\t\tfor ($ii = $d['dow']; ($ii <= $d['end']) && ($ii < 7) && (($i + $ii) <= $daysinmonth); $ii += $d['period']) {\n\t\t\t\t\t\t$iii = $i + $ii;\n\t\t\t\t\t\t$w = floor(($iii + 6) / 7);\n\t\t\t\t\t\t$lw = floor(($daysinmonth - $iii) / 7);\n\n\t\t\t\t\t\tif (($iii >= 0) && ((!$d['week'] || $d['week'] == $w) && (!$d['lastDow'] || $lw == 0))) {\n\t\t\t\t\t\t\t$dwa[$iii] = 1;\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\tif ($dowStar) {\n\t\t\treturn $da;\n\t\t} elseif ($domStar) {\n\t\t\treturn $dwa;\n\t\t}\n\t\tforeach ($da as $key => $value) {\n\t\t\t$da[$key] = $value && ($dwa[$key] ?? 0);\n\t\t}\n\t\treturn $da;\n\t}", "function getCurrentMonthNumDays() {\n\t\treturn $this->_currentMonthNumDays;\n\t}", "private function daysDefault(){\n $data = array();\n\n for($i=1; $i<=31; $i++){\n $data['day_'.$i] = 0;\n }\n\n return $data;\n }", "function _makeMonth($date){\n // YYYY-MM and return an array of all the days\n // in the the month. The array that is returned\n // is in the same formate which is returned by\n // 'makeWeek' function\n $start = Carbon::parse($date)->startOfMonth();\n $end = Carbon::parse($date)->endOfMonth();\n $month = [];\n while ($start->lte($end)) {\n $carbon = $start;\n $month[] = $this->_makeDay($carbon);\n $start->addDay();\n }\n return $month;\n }", "public function getDayOfMonth()\n {\n return $this->dayOfMonth;\n }", "function getDaysInMonth($y, $m)\n {\n return (int)Date_Calc::daysInMonth($m, $y);\n }", "function _makeDay($carbon){\n $_date = $carbon->year.'-'.$carbon->month.'-'.$carbon->day;\n $day = $carbon->englishDayOfWeek;\n return [\n 'date' => $carbon->day,\n 'month' => $carbon->month,\n 'year' => $carbon->year,\n 'english_month' => $carbon->englishMonth,\n 'full_date' => $_date,\n 'day' => $day,\n 'items' => [],\n ];\n }", "function days($day, $month, $year) {\n\t\t// Hour, Minute, Second, Month, Day, Year\n\t\t$target = mktime(0, 0, 0, $month, $day, $year);\n\t\t$today = time();\n\t\t$difference = ($target - $today);\n\t\t$days = (int)($difference/86400); // 86400 being the number of seconds in a day\n\t\t\n\t\t// Make sure that we show the correct number of zeros when the number gets smaller\n\t\t// + if the date passes then we don't show a minus value\n\t\tif ($days < 0) {\n\t\t\t$days = '000';\n\t\t} else if ($days < 10) {\n\t\t\t$days = '00'.$days;\n\t\t} else if ($days < 100) {\n\t\t\t$days = '0'.$days;\n\t\t} \n\t\t\n\t\t// Needs to be returned as a String so we can split it into individual characters\n\t\treturn (String)$days;\n\t}", "public function get_days() {\n\t\t\treturn iterator_to_array( $this->days );\n\t\t}", "public function empty_days(string $month, int $year){\r\n $active_month = static::month_str_to_int($month);\r\n $first_date_of_month = new DateTime(\"$year-$month-1\");\r\n $first_day_of_month = $first_date_of_month->format('D');\r\n switch ($first_day_of_month) {\r\n case \"Mon\":\r\n $empty_days = 0;\r\n break;\r\n case \"Tue\":\r\n $empty_days = 1;\r\n break;\r\n case \"Wed\":\r\n $empty_days = 2;\r\n break;\r\n case \"Thu\":\r\n $empty_days = 3;\r\n break;\r\n case \"Fri\":\r\n $empty_days = 4;\r\n break\r\n ;case \"Sat\":\r\n $empty_days = 5;\r\n break;\r\n case \"Sun\":\r\n $empty_days = 6;\r\n break;\r\n default: die(\"wrong m/y format\");\r\n } \r\n return $empty_days; \r\n \r\n }", "function hebrew_month_days($mo, $yr) {\n\n\t\tswitch ($mo) {\n\t\t\tcase 2:\t\t//fixed length 29 day months\n\t\t\tcase 4:\n\t\t\tcase 6:\n\t\t\tcase 10:\n\t\t\tcase 13:\n\t\t\t\treturn (29);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\tif (! hebrew_leap($yr) ) return(29);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t//Heshvan depends on length of year\n\t\t\t\tif ( !( (hebrew_year_days($yr) % 10) == 5) ) return (29);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t//Kislev also varies with the length of year\n\t\t\t\tif ( (hebrew_year_days($yr) % 10) == 3 ) return (29);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//otherwise the month has 30 days\n\t\treturn (30);\n\t}", "function getTotalDays();", "function days_in_month($month, $year)\n{\n\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n}", "protected function compileDays()\n\t{\n\t\t$arrDays = array();\n\n\t\tfor ($i=0; $i<7; $i++)\n\t\t{\n\t\t\t$intCurrentDay = ($i + $this->cal_startDay) % 7;\n\t\t\t$arrDays[$intCurrentDay] = $GLOBALS['TL_LANG']['DAYS'][$intCurrentDay];\n\t\t}\n\n\t\treturn $arrDays;\n\t}", "public function mondays()\n {\n return $this->days(1);\n }", "function ShowDayOfMonth($get_month){\n\t$arr_d1 = explode(\"-\",$get_month);\n\t$xdd = \"01\";\n\t$xmm = \"$arr_d1[1]\";\n\t$xyy = \"$arr_d1[0]\";\n\t$get_date = \"$xyy-$xmm-$xdd\"; // วันเริ่มต้น\n\t//echo $get_date.\"<br>\";\n\t$xFTime1 = getdate(date(mktime(0, 0, 0, intval($xmm+1), intval($xdd-1), intval($xyy))));\n\t$numcount = $xFTime1['mday']; // ฝันที่สุดท้ายของเดือน\n\tif($numcount > 0){\n\t\t$j=1;\n\t\t\tfor($i = 0 ; $i < $numcount ; $i++){\n\t\t\t\t$xbasedate = strtotime(\"$get_date\");\n\t\t\t\t $xdate = strtotime(\"$i day\",$xbasedate);\n\t\t\t\t $xsdate = date(\"Y-m-d\",$xdate);// วันถัดไป\t\t\n\t\t\t\t $arr_d2 = explode(\"-\",$xsdate);\n\t\t\t\t $xFTime = getdate(date(mktime(0, 0, 0, intval($arr_d2[1]), intval($arr_d2[2]), intval($arr_d2[0]))));\t\n\t\t\t\t if($xFTime['wday'] == 0){\n\t\t\t\t\t $j++;\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\tif($xFTime['wday'] != \"0\"){\n\t\t\t\t\t\t$arr_date[$j][$xFTime['wday']] = $xsdate;\t\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}//end if($numcount > 0){\n\treturn $arr_date;\t\n}", "public static function getMonths()\n {\n return [ \n CarbonInterface::JANUARY => 'January', \n CarbonInterface::FEBRUARY => 'February', \n CarbonInterface::MARCH => 'March', \n CarbonInterface::APRIL => 'April', \n CarbonInterface::MAY => 'May', \n CarbonInterface::JUNE => 'June', \n CarbonInterface::JULY => 'July', \n CarbonInterface::AUGUST => 'August', \n CarbonInterface::SEPTEMBER => 'September', \n CarbonInterface::OCTOBER => 'October', \n CarbonInterface::NOVEMBER => 'November', \n CarbonInterface::DECEMBER => 'December', \n ];\n }", "public static function getDays()\n\t {\n\t\t $days=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);\n\t\t return $days;\n\t }", "public function get_day_types(int $y,int $m){\n\t\t$domingos=0;\n\t\t$feriados=0;\n\t\t$laborables=0;\n\t\t$laborados=0;\n\t\t$permisos=0;\n\t\t$inasistencias=0;\n\t\t$total_days=cal_days_in_month(0,$m,$y);\n\t\tif($y==date('Y') && $m==date('m')){\n\t\t\t$days=date('d');\n\t\t}\n\t\telse{\n\t\t\t$days=cal_days_in_month(0,$m,$y);\n\t\t}\n\t\tfor($d=1;$d<=$days;$d++){\n\t\t\tif(Timemanager::is_holiday($y,$m,$d)){\n\t\t\t\t$feriados++;\n\t\t\t}\n\t\t\telseif(!Timemanager::is_laborable($y,$m,$d)){\n\t\t\t\t$domingos++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$laborables++;\n\t\t\t}\n\t\t\tif(Timemanager::is_laborable($y,$m,$d) && !Timemanager::is_holiday($y,$m,$d)){\n\t\t\t\ttry {\n\t\t\t\t\tif(!$this->asistio($y,$m,$d)){\n\t\t\t\t\t\tif(Baja::count([\n\t\t\t\t\t\t\t'conditions'=>[\n\t\t\t\t\t\t\t\t'employee_id = ? and start => ? AND end <= ?',\n\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t$y.'-'.$m.'-'.$d,\n\t\t\t\t\t\t\t\t$y.'-'.$m.'-'.$d\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t])>0){\n\t\t\t\t\t\t\t$permisos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$inasistencias++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$laborados++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tBaja::table()->last_sql;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn['transcurridos'=>$days,'total_days'=>$total_days,'domingos'=>$domingos,'feriados'=>$feriados,'laborados'=>$laborados,'laborables'=>$laborables,'permisos'=>$permisos,'inasistencias'=>$inasistencias];\n\n\t}", "public function getDaysEn()\n {\n $days = array('Monthday', 'Thusday', 'Wendersday', 'Thursday', 'Friday', 'Saturday', 'Sandy');\n \n return $days;\n }", "protected function unav_days_to_dates(string $month, int $year, Room $room_for_check){\r\n $days = $this->row_to_days($month, $year, $room_for_check);\r\n// var_dump($days);\r\n \r\n if (!$days){\r\n return;\r\n }\r\n\r\n $this->year = $year;\r\n $this->active_month = $month;\r\n\r\n $unav_dates_in_month = array();\r\n \r\n foreach($days as $day){\r\n $fixed_month = ucfirst ($this->active_month); \r\n $date_string = $day.\"/\".$fixed_month.\"/\".$this->year;\r\n $new_date = DateTime::createFromFormat('d/M/Y', $date_string);\r\n// var_dump($new_date);\r\n $unav_dates_in_month[] = $new_date;\r\n// var_dump($new_date->format('d/M/Y'));\r\n\r\n //OVIM SU NAPRAVLJENI DATUMI ZA POREDJENJE OD UNESENIH ARGUMENATA\r\n }\r\n// var_dump($unav_dates_in_month);\r\n $this->$month = $unav_dates_in_month;\r\n return $unav_dates_in_month;\r\n}", "function get_daily_weather_for_month( \n $y = 2014, \n $m = 01 )\n {\n $days = date( 't', mktime( 0, 0, 0, $m, 1, $y ) );\n $data = array();\n for ( $i = 1; $i <= $days; $i++ ) {\n $date = date( 'Y-m-d', mktime( 0, 0, 0, $m, $i, $y ) );\n $results = $this->_db->select( \n \"SELECT * \n FROM weather_days\n WHERE date_day = '\".$date.\"'\" );\n if ( is_object( $results[0] ) ) {\n $data[$i] = $results[0];\n }\n }\n return $data;\n }", "public function getIncomeDaysWeek() {\r\n $month_array = array();\r\n $income_days = Income::where('resto_id', Session::get('id'))->pluck('added_on');\r\n $income_days = json_decode( $income_days );\r\n $i = 0;\r\n foreach($income_days as $date) {\r\n $date_name = Carbon::createFromFormat('Y-m-d', $date)->format('d M Y');\r\n $month_array[$i] = $date_name;\r\n $i++;\r\n\r\n }\r\n return $month_array;\r\n }", "public function getDifferenceInMonths();", "protected function getMonthValues()\r\n {\r\n\t $month = array();\r\n\t $month[1] = 'January';\r\n\t $month[2] = 'February';\r\n\t $month[3] = 'March';\r\n\t $month[4] = 'April';\r\n\t $month[5] = 'May';\r\n\t $month[6] = 'June';\r\n\t $month[7] = 'July';\r\n\t $month[8] = 'August';\r\n\t $month[9] = 'September';\r\n\t $month[10] = 'October';\r\n\t $month[11] = 'November';\r\n\t $month[12] = 'December';\t \r\n\t \r\n\t return $month;\r\n }", "public function Months() {\r\n// $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\r\n $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');\r\n return $months;\r\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "public function get_day_permastruct()\n {\n }", "function days_in_month($month, $year)\n\t{\n\t\tif(checkdate($month, 31, $year)) return 31;\n\t\tif(checkdate($month, 30, $year)) return 30;\n\t\tif(checkdate($month, 29, $year)) return 29;\n\t\tif(checkdate($month, 28, $year)) return 28;\n\t\treturn 0; // error\n\t}", "public function getDays()\n\t{\n\t\treturn $this->days;\n\t}", "public function getMonths()\r\n\t{\r\n \t$months = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= 12; $i++)\r\n\t\t{\r\n\t\t\t$label = ($i < 10) ? (\"0\" . $i) : $i;\r\n\t\t\t\r\n\t\t\t$months[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $months;\r\n\t}", "public function calculateTimeMachine()\n {\n $days = array();\n for ($i=1; $i < 31; $i++) {\n $date = date('c', strtotime(\"-$i days\"));\n array_push($days, strtotime($date));\n }\n return $days;\n }", "public function getMonthEn() \n {\n $month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n \n return $month;\n }", "public function getDays() {\r\n\t\treturn $this->days;\r\n\t}", "public function days_in_month($month, $year)\n\t{\n\t\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n\t}", "public function buildMonth()\n\t{\n\t\t$this->orderedDays = $this->getDaysInOrder();\n\t\t\n\t\t$this->monthName = $this->months[ ltrim( $this->month, '0') ];\n\t\t\n\t\t// start of whichever month we are building\n\t\t$start_of_month = getdate( mktime(12, 0, 0, $this->month, 1, $this->year ) );\n\t\t\n\t\t$first_day_of_month = $start_of_month['wday'];\n\t\t\n\t\t$days = $this->startDay - $first_day_of_month;\n\t\t\n\t\tif( $days > 1 )\n\t\t{\n\t\t\t// get an offset\n\t\t\t$days -= 7;\n\t\t\t\n\t\t}\n\n\t\t$num_days = $this->daysInMonth($this->month, $this->year);\n\t\t// 42 iterations\n\t\t$start = 0;\n\t\t$cal_dates = array();\n\t\t$cal_dates_style = array();\n\t\t$cal_events = array();\n\t\twhile( $start < 42 )\n\t\t{\n\t\t\t// off set dates\n\t\t\tif( $days < 0 )\n\t\t\t{\n\t\t\t\t$cal_dates[] = '';\n\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t$cal_dates_data[] = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $days < $num_days )\n\t\t\t\t{\n\t\t\t\t\t// real days\n\t\t\t\t\t$cal_dates[] = $days+1;\n\t\t\t\t\tif( in_array( $days+1, $this->daysWithEvents ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = 'has-events';\n\t\t\t\t\t\t$cal_dates_data[] = $this->data[ $days+1 ];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = '';\n\t\t\t\t\t\t$cal_dates_data[] = '';\n\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{\n\t\t\t\t\t// surplus\n\t\t\t\t\t$cal_dates[] = '';\n\t\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// increment and loop\n\t\t\t$start++;\n\t\t\t$days++;\n\t\t}\n\t\t\n\t\t// done\n\t\t$this->dates = $cal_dates;\n\t\t$this->dateStyles = $cal_dates_style;\n\t\t$this->dateData = $cal_dates_data;\n\t}", "public function countTotalDays($m = NULL){\n\t\t\t$count = 0;\n\t\t\t$first = true;\n\t\t\tforeach(array_reverse(array_keys($this->entries)) as $month){\n\t\t\t\tif($month == $m) $count = 0;\n\t\t\t\tif($first){\n\t\t\t\t\t$first = array_keys(array_reverse($this->entries[$month]));\n\t\t\t\t\t$first = explode(\"-\", $firstmonth[0]);\n\t\t\t\t\t$count += date(\"n\", strtotime($month)) - $first[2] - 1;\n\t\t\t\t\t$first = false;\n\t\t\t\t} else if(date(\"n\", strtotime($month)) == date(\"n\")) $count += date(\"j\") - (time() < strtotime($this->config->emailTime));\n\t\t\t\telse $count += date(\"t\", strtotime($month));\n\t\t\t\tif($month == $m) break;\n\t\t\t}\n\t\t\treturn $count;\n\t\t}", "public function Dates() {\r\n $dates = [];\r\n for ($i = 1; $i <= 31; $i++) {\r\n $dates[$i] = $i;\r\n }\r\n return $dates;\r\n }", "function create_calendar_array($used_dates){\n\n\t//create array of dates for October with false attributes\n\t$october = array();\n\tfor($day=1;$day<=31;$day++){\n\t\t$october[$day]=FALSE;\n\t}\n\t\n\t//compare used dates to whole month\n\tforeach\t($used_dates as $post_id=>$date){\n\t\t$october[intval($date['day'])][]=$post_id;\n\t}\n\t\t\n\t\n\treturn $october;\n}", "function getMonth()\r\n {\r\n return $this->mes;\r\n }", "public static function getMonths() \n\t {\n\t\t $month=array(1,2,3,4,5,6,7,8,9,10,11,12);\n\t\t return $month;\n\t }", "protected function getThisMonthInterval(): array\n\t{\n\t\treturn [\n\t\t\tnew \\DateTime(date('Y-m-01', strtotime(date('Y-m-d')))),\n\t\t\tnew \\DateTime(date('Y-m-t', strtotime(date('Y-m-d'))))\n\t\t];\n\t}", "function getMonthlyHiredDays( $startDate, $endDate ) {\n \n $startDate = DateTime::createFromFormat('Y-m-d H:i:s', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d H:i:s', $endDate);\n \n if ( !$startDate || !$endDate ) {\n \n echo 'Invalid arguments';\n return;\n }\n \n if ( $startDate > $endDate) {\n \n echo 'The start date is greater than the end date';\n return;\n }\n \n $hiredDays = array(); \n if ( $startDate->format('n') == $endDate->format('n') && $startDate->format('Y') == $endDate->format('Y') ) {\n \n // Get ddays between days and push to the array\n array_push( $hiredDays,\n array(\n 'year' => $startDate->format('Y'),\n 'month' => $startDate->format('n'),\n 'days' => $startDate->diff($endDate, true)->days\n )\n );\n \n }else {\n \n // Loop until the last date and get the days of every month \n while( true ) { \n \n if( !isset($startPoint) ) {\n \n $startPoint = $startDate; \n $m = $startDate->format('n');\n }else {\n \n $startPoint = $endPoint->add(new DateInterval('P1D'));\n $startPoint = $startPoint->setTime(0,0,0);\n $m = $startPoint->format('n');\n }\n \n if ( $m == 11 //30 days\n || $m == 4\n || $m == 6\n || $m == 9 ) {\n \n $monthDays = 30;\n }elseif ( $m == 2 ) { // 28 days\n \n $monthDays = $startPoint->format('L') == 1 ? 29 : 28;\n \n }else { // 31 days \n \n $monthDays = 31;\n }\n \n $endPoint = DateTime::createFromFormat('Y-m-d H:i:s', $startPoint->format('Y').'-'.$m.'-'.$monthDays.' 23:59:59');\n \n if ( $endPoint > $endDate ) {\n \n $endPoint = $endDate;\n } \n \n array_push( $hiredDays,\n array(\n 'year' => $startPoint->format('Y'),\n 'month' => $startPoint->format('n'),\n 'days' => $startPoint->diff($endPoint, true)->days + 1\n )\n );\n\n if ( $endPoint == $endDate ) {\n break;\n }\n \n $m = $m == 12 ? 1 : $m + 1;\n }\n } \n return $hiredDays;\n }", "function getMonthArray()\n{\n\t$arrMonths = array();\n\n\tfor ($i=1; $i<13; $i++)\n\t{\n\t\t$arrMonths[$i] = date('M', mktime(0, 0, 1, $i, 1));\n\t}\n\t\n\treturn $arrMonths;\n}", "protected function getMonthsArray()\n\t{\n\t\t$ma = array_pad([], 13, null);\n\t\tunset($ma[0]);\n\t\tforeach ($this->_attr[self::MONTH_OF_YEAR] as $m) {\n\t\t\tif (is_numeric($m['moy'])) {\n\t\t\t\tfor ($i = $m['moy']; $i <= $m['end'] && $i <= 12; $i += $m['period']) {\n\t\t\t\t\t$ma[$i] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ma;\n\t}", "public function getMonthlyInstalment();", "public function getCalendarColumns() {\n $dates = array();\n $date = new DateTime();\n\n $dates[] = $date->format(\"Y-m\");\n\n for ($i = 1; $i < 12; $i++) {\n $date->modify('+1 month');\n $dates[] = $date->format(\"Y-m\");\n }\n return $dates;\n }", "protected static function days()\n {\n static::initI18N();\n return [\n self::SUNDAY => Yii::t('wb_enumerables', 'Sunday'),\n self::MONDAY => Yii::t('wb_enumerables', 'Monday'),\n self::TUESDAY => Yii::t('wb_enumerables', 'Tuesday'),\n self::WEDNESDAY => Yii::t('wb_enumerables', 'Wednesday'),\n self::THURSDAY => Yii::t('wb_enumerables', 'Thursday'),\n self::FRIDAY => Yii::t('wb_enumerables', 'Friday'),\n self::SATURDAY => Yii::t('wb_enumerables', 'Saturday')\n ];\n }", "public function getDays()\n {\n $days = array('Ponedeljak', 'Utorak', 'Sreda', 'Četvrtak', 'Petak', 'Subota', 'Nedelja');\n \n return $days;\n }", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "function monthOptions(){\n\t\t$months = range('01', '12');\n\t\tforeach ($months as $key => $month) {\n\t\t\t$months[$key] = str_pad($month, 2, '0', STR_PAD_LEFT);\n\t\t}\n\t\treturn array_combine($months, $months);\n\t}", "public function getMonths()\n {\n return [\n 1 => 'Januari',\n 2 => 'Februari',\n 3 => 'Maart',\n 4 => 'April',\n 5 => 'Mei',\n 6 => 'Juni',\n 7 => 'Juli',\n 8 => 'Augustus',\n 9 => 'September',\n 10 => 'Oktober',\n 11 => 'November',\n 12 => 'December'\n ];\n }", "public static function getDays()\n {\n return Carbon::getDays();\n }", "public static function getMonthDates()\n {\n $current_year = date('Y-01-01 00:00:00');\n $month_names = self::getMonthNames();\n $months = array();\n for ($i=0; $i<12; $i++) {\n $months[$i] = array( 'name'=>$month_names[$i],'date'=>date('Y-m-d 00:00:00',strtotime(\"$current_year + $i months\")));\n }\n\n return $months;\n }", "public static function days_in_month($month, $year)\n\t{\n\t\t// calculate number of days in a month\n\t\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n\t}", "function build_month_days($month, $number_of_days) {\r\n $days_of_month_html = '<tr class=\"week-day\">';\r\n \r\n $days_in_week = 1;\r\n for ($days = 1; $days <= $number_of_days; $days++) {\r\n\r\n // Split the weeks in rows\r\n if ($days_in_week == 8) {\r\n $days_of_month_html = $days_of_month_html . '</tr>';\r\n $days_of_month_html = $days_of_month_html . '<tr class=\"week-day\">'; \r\n $days_in_week = 1;\r\n }\r\n\r\n // Render days of week in the correct position\r\n if ($days == 1) {\r\n $initial_position = get_first_day($month);\r\n for($i = 1; $i < $initial_position; $i++) {\r\n $days_of_month_html = $days_of_month_html . '<td class=\"day\"></td>';\r\n $days_in_week++;\r\n }\r\n if ($initial_position == 1) {\r\n $days_of_month_html = $days_of_month_html . '<td class=\"day sunday\">'.$days.'</td>';\r\n } else {\r\n $days_of_month_html = $days_of_month_html . '<td class=\"day\">'.$days.'</td>';\r\n }\r\n } else if ($days_in_week == 1) {\r\n $days_of_month_html = $days_of_month_html . '<td class=\"day sunday\">'.$days.'</td>';\r\n } else {\r\n $days_of_month_html = $days_of_month_html . '<td class=\"day\">'.$days.'</td>'; \r\n }\r\n\r\n $days_in_week++;\r\n }\r\n $days_of_month_html = $days_of_month_html . '</tr>';\r\n \r\n return $days_of_month_html;\r\n }", "function daysOnMonth($month, $year) {\n\tif (month <= 0) {\n\t\t$year -= 1;\n\t\t$month += 12;\n\t}\n\tif ( in_array( $month, array(4,6,9,11) ) ) return 30;\n\telseif ($month == 2) {\n\t\tif ( isBissextile($year) ) return 29;\n\t\telse return 28;\n\t} else return 31;\n}", "public static function daysInMonth($month, $year)\n {\n return cal_days_in_month(CAL_GREGORIAN, $month, $year);\n }", "public function get_month_choices()\n {\n }", "public function definition()\n {\n $now = new DateTime();\n $previousMonth = (new DateTime())->setDate(\n (int)$now->format('Y'),\n (int)$now->format('m') - 1,\n 1,\n );\n\n return [\n 'begin_date' => $previousMonth->format('Y.m.01 00:00:00'),\n 'end_date' => $previousMonth->format('Y.m.t 23:59:59'),\n ];\n }", "function getMonthLabels() {\n\t\treturn array('count_jan', 'count_feb', 'count_mar', 'count_apr', 'count_may', 'count_jun', 'count_jul', 'count_aug', 'count_sep', 'count_oct', 'count_nov', 'count_dec');\n\t}", "protected function build_month_calendar(&$tpl_var)\n {\n global $page, $lang, $conf;\n\n $query='SELECT '.pwg_db_get_dayofmonth($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $items=array();\n $result = pwg_query($query);\n while ($row = pwg_db_fetch_assoc($result))\n {\n $d = (int)$row['period'];\n $items[$d] = array('nb_images'=>$row['count']);\n }\n\n foreach ( $items as $day=>$data)\n {\n $page['chronology_date'][CDAY]=$day;\n $query = '\n SELECT id, file,representative_ext,path,width,height,rotation, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n ORDER BY '.DB_RANDOM_FUNCTION.'()\n LIMIT 1';\n unset ( $page['chronology_date'][CDAY] );\n\n $row = pwg_db_fetch_assoc(pwg_query($query));\n $derivative = new DerivativeImage(IMG_SQUARE, new SrcImage($row));\n $items[$day]['derivative'] = $derivative;\n $items[$day]['file'] = $row['file'];\n $items[$day]['dow'] = $row['dow'];\n }\n\n if ( !empty($items) )\n {\n list($known_day) = array_keys($items);\n $known_dow = $items[$known_day]['dow'];\n $first_day_dow = ($known_dow-($known_day-1))%7;\n if ($first_day_dow<0)\n {\n $first_day_dow += 7;\n }\n //first_day_dow = week day corresponding to the first day of this month\n $wday_labels = $lang['day'];\n\n if ('monday' == $conf['week_starts_on'])\n {\n if ($first_day_dow==0)\n {\n $first_day_dow = 6;\n }\n else\n {\n $first_day_dow -= 1;\n }\n\n $wday_labels[] = array_shift($wday_labels);\n }\n\n list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;\n\n $tpl_weeks = array();\n $tpl_crt_week = array();\n\n //fill the empty days in the week before first day of this month\n for ($i=0; $i<$first_day_dow; $i++)\n {\n $tpl_crt_week[] = array();\n }\n\n for ( $day = 1;\n $day <= $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR], $page['chronology_date'][CMONTH]\n );\n $day++)\n {\n $dow = ($first_day_dow + $day-1)%7;\n if ($dow==0 and $day!=1)\n {\n $tpl_weeks[] = $tpl_crt_week; // add finished week to week list\n $tpl_crt_week = array(); // start new week\n }\n\n if ( !isset($items[$day]) )\n {// empty day\n $tpl_crt_week[] =\n array(\n 'DAY' => $day\n );\n }\n else\n {\n $url = duplicate_index_url(\n array(\n 'chronology_date' =>\n array(\n $page['chronology_date'][CYEAR],\n $page['chronology_date'][CMONTH],\n $day\n )\n )\n );\n\n $tpl_crt_week[] =\n array(\n 'DAY' => $day,\n 'DOW' => $dow,\n 'NB_ELEMENTS' => $items[$day]['nb_images'],\n 'IMAGE' => $items[$day]['derivative']->get_url(),\n 'U_IMG_LINK' => $url,\n 'IMAGE_ALT' => $items[$day]['file'],\n );\n }\n }\n //fill the empty days in the week after the last day of this month\n while ( $dow<6 )\n {\n $tpl_crt_week[] = array();\n $dow++;\n }\n $tpl_weeks[] = $tpl_crt_week;\n\n $tpl_var['month_view'] =\n array(\n 'CELL_WIDTH' => $cell_width,\n 'CELL_HEIGHT' => $cell_height,\n 'wday_labels' => $wday_labels,\n 'weeks' => $tpl_weeks,\n );\n }\n\n return true;\n }", "public static function listMonth()\r\n {\r\n $mes[1] = 'Janeiro';\r\n $mes[2] = 'Fevereiro';\r\n $mes[3] = 'Março';\r\n $mes[4] = 'Abril';\r\n $mes[5] = 'Maio';\r\n $mes[6] = 'Junho';\r\n $mes[7] = 'Julho';\r\n $mes[8] = 'Agosto';\r\n $mes[9] = 'Setembro';\r\n $mes[10] = 'Outubro';\r\n $mes[11] = 'Novembro';\r\n $mes[12] = 'Dezembro';\r\n\r\n return $mes;\r\n }", "function toDays( $day=0, $month=0, $year=0) {\n\t\tif (!$day) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$day = $this->day;\n\t\t\t} else {\n\t\t\t\t$day = date( \"d\" );\n\t\t\t}\n\t\t}\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$century = floor( $year / 100 );\n\t\t$year = $year % 100;\n\t\t\n\t\tif($month > 2) {\n\t\t\t$month -= 3;\n\t\t} else {\n\t\t\t$month += 9;\n\t\t\tif ($year) {\n\t\t\t\t$year--;\n\t\t\t} else {\n\t\t\t\t$year = 99;\n\t\t\t\t$century --;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ( floor( (146097 * $century) / 4 ) +\n\t\tfloor( (1461 * $year) / 4 ) +\n\t\tfloor( (153 * $month + 2) / 5 ) +\n\t\t$day + 1721119\n\t\t);\n\t}", "function get_dates() {\n $m = date('m');\n $d = date('d');\n $y = date('Y');\n $retour['j'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y));\n $retour['s1'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +7, $y));\n $retour['s2'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +14, $y));\n $retour['s3'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +21, $y));\n $retour['m1'] = date('d/m/Y', mktime(0, 0, 0, $m +1, $d, $y));\n $retour['m2'] = date('d/m/Y', mktime(0, 0, 0, $m +2, $d, $y));\n $retour['m3'] = date('d/m/Y', mktime(0, 0, 0, $m +3, $d, $y));\n $retour['m6'] = date('d/m/Y', mktime(0, 0, 0, $m +6, $d, $y));\n $retour['m9'] = date('d/m/Y', mktime(0, 0, 0, $m +9, $d, $y));\n $retour['m12'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y +1));\n return $retour;\n}", "protected function getDateInterval(){\n\n $dt = new \\DateTime();\n $dt->modify('-1 month');\n $interval['max'] = $dt->format('Ym');\n $dt->modify('-11 months');\n $interval['min'] = $dt->format('Ym');\n\n return $interval;\n }", "private function _getDays($month, $year)\n {\n $daysInMonth = $this->_daysInMonth($month, $year);\n $days = array();\n\n for ($i = 1; $i <= $daysInMonth; $i++)\n {\n $days[] = $i;\n }\n\n return $days;\n }", "public static function getMonth(){\n\t\t// this represents the number of seconds ni a month\n\t\t// editing this will lead to false values\n\t\treturn 2419200;\n\t}", "function fromDays( $days ) {\n\t\t\n\t\t$days -= 1721119;\n\t\t$century = floor( ( 4 * $days - 1) / 146097 );\n\t\t$days = floor( 4 * $days - 1 - 146097 * $century );\n\t\t$day = floor( $days / 4 );\n\t\t\n\t\t$year = floor( ( 4 * $day + 3) / 1461 );\n\t\t$day = floor( 4 * $day + 3 - 1461 * $year );\n\t\t$day = floor( ($day + 4) / 4 );\n\t\t\n\t\t$month = floor( ( 5 * $day - 3) / 153 );\n\t\t$day = floor( 5 * $day - 3 - 153 * $month );\n\t\t$day = floor( ($day + 5) / 5 );\n\t\t\n\t\tif ($month < 10) {\n\t\t\t$month +=3;\n\t\t} else {\n\t\t\t$month -=9;\n\t\t\tif ($year++ == 99) {\n\t\t\t\t$year = 0;\n\t\t\t\t$century++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->day = $day;\n\t\t$this->month = $month;\n\t\t$this->year = $century*100 + $year;\n\t}", "public static function periodEquivalentDays()\n {\n return [\n static::HOURLY => 1/24,\n static::DAILY => 1,\n static::WEEKLY => 7,\n static::MONTHLY => 30,\n static::YEARLY => 365,\n ];\n }", "protected function get_all_days_in_month($year, $month)\n {\n $md= array(1=>31,28,31,30,31,30,31,31,30,31,30,31);\n\n if ( is_numeric($year) and $month==2)\n {\n $nb_days = $md[2];\n if ( ($year%4==0) and ( ($year%100!=0) or ($year%400!=0) ) )\n {\n $nb_days++;\n }\n }\n elseif ( is_numeric($month) )\n {\n $nb_days = $md[ $month ];\n }\n else\n {\n $nb_days = 31;\n }\n return $nb_days;\n }", "function daysInMonth($year, $month) \n{\n if ($month == 1) return 31;\n if ($month == 2) {\n if ((($year%4) == 0) && ((($year%100) != 0) \n || ((($year%100) == 0) && (($year%400) == 0)))\n ) return 29;\n return 28;\n }\n if ($month == 3) return 31;\n if ($month == 4) return 30;\n if ($month == 5) return 31;\n if ($month == 6) return 30;\n if ($month == 7) return 31;\n if ($month == 8) return 31;\n if ($month == 9) return 30;\n if ($month == 10) return 31;\n if ($month == 11) return 30;\n if ($month == 12) return 31;\n return 0;\n \n}", "function calculateDurationInMonthsAndYears($months) {\n $duration = [];\n $years = floor($months/12);\n $months = $months%12;\n $duration[\"month\"] = $months;\n $duration[\"years\"] = $years;\n return $duration;\n }", "public function getMonth() \n {\n $month = array('Januar', 'Februar', 'Mart', 'April', 'Maj', 'Juni', 'Juli', 'Avgust', 'Septembar', 'Octobar', 'Novembar', 'Decembar');\n \n return $month;\n }", "function semanasMes($year,$month){\n \n # Obtenemos el ultimo dia del mes\n $ultimoDiaMes=date(\"t\",mktime(0,0,0,$month,1,$year)); \n # Obtenemos la semana del primer dia del mes\n $primeraSemana=date(\"W\",mktime(0,0,0,$month,1,$year)); \n # Obtenemos la semana del ultimo dia del mes\n $ultimaSemana=date(\"W\",mktime(0,0,0,$month,$ultimoDiaMes,$year)); \n # Devolvemos en un array los dos valores\n return array($primeraSemana,$ultimaSemana);\n \n}", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "public function enableNonMonthDays() {\n\t\t$this->displayNonMonthDays = true;\n\t}", "function getCurrentDayInMonthNumber ()\n\t{\n\t\treturn date ('j');\n\t}", "public function getTwelveMonth() {\n $result = array();\n $cur = strtotime(date('Y-m-01', time()));\n for ($i = 0; $i <= 11; $i++) {\n $result[$i] = date('M', $cur);\n $cur = strtotime('next month', $cur);\n }\n\n return $result;\n }", "function getMonth(){\r\n return date('F',$this->timestamp);\r\n }", "function getMonthDir() {\n return date(\"Y_m\");\n }", "public function months(): int\n {\n return $this->months;\n }" ]
[ "0.7518319", "0.72533256", "0.7217392", "0.7164777", "0.696042", "0.65474784", "0.6517745", "0.64557636", "0.6450885", "0.6434415", "0.6407145", "0.63869834", "0.6367303", "0.6364206", "0.63265246", "0.6236349", "0.62038857", "0.6175482", "0.6172973", "0.61692995", "0.61658216", "0.6164718", "0.61619884", "0.6136229", "0.61094844", "0.60809517", "0.60734886", "0.6049038", "0.60280627", "0.6025036", "0.6022076", "0.60056144", "0.59876496", "0.5977064", "0.5968699", "0.59564143", "0.59550565", "0.5920285", "0.59131837", "0.591007", "0.59092236", "0.5908716", "0.5903401", "0.5901441", "0.5886733", "0.58791906", "0.5875467", "0.5872999", "0.58684754", "0.5847861", "0.5838334", "0.58334094", "0.5823163", "0.58192754", "0.58183545", "0.5808989", "0.5804753", "0.57997465", "0.5797061", "0.5790449", "0.5784435", "0.57723874", "0.57705307", "0.57503", "0.57483846", "0.57452154", "0.5740569", "0.5737411", "0.5730513", "0.5724269", "0.56936204", "0.5685024", "0.56809855", "0.566532", "0.5648757", "0.5640255", "0.5636716", "0.5630513", "0.5617853", "0.5617268", "0.5616546", "0.5614592", "0.5608566", "0.56058836", "0.5603814", "0.5571444", "0.55652416", "0.5562452", "0.5554731", "0.5544643", "0.55437845", "0.5510826", "0.5504938", "0.54994136", "0.5487151", "0.5479614", "0.5478629", "0.5478503", "0.547", "0.54689527" ]
0.57789725
61
Fill in empty days before the beginning of the month
function emptyDays ($empty, $numDays, $month, $year) { for ($i = 1; $i <= $numDays; $i++) { $eachDay[$i] = $i; } foreach($eachDay as $day => &$wkday) { $wkday = date("w", mktime(0,0,0,$month,$day,$year)); } if ($eachDay[1] == 1) { echo $empty; } elseif ($eachDay[1] == 2) { echo $empty; echo $empty; } elseif ($eachDay[1] == 3) { echo $empty; echo $empty; echo $empty; } elseif ($eachDay[1] == 4) { echo $empty; echo $empty; echo $empty; echo $empty; } elseif ($eachDay[1] == 5) { echo $empty; echo $empty; echo $empty; echo $empty; echo $empty; } elseif ($eachDay[1] == 6) { echo $empty; echo $empty; echo $empty; echo $empty; echo $empty; echo $empty; } else { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n\t\t$this->_monthTimestamp = $this->_dayTimestamp = mktime(0,0,0,$this->_currentMonth,1,$this->_currentYear);\n\t\t$this->_currentMonthNumDays = intval(date('t',$this->_monthTimestamp));\n\t\t$this->_dateArray = array_fill(1, 31, \"\");\n\t\t$this->_preWeekArray = array();\n\t\t$this->_postWeekArray = array();\n\t}", "private function startMonthSpacers()\n\t{\n\t\tif($this->firstDayOfTheMonth != '0') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".$this->firstDayOfTheMonth.\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['firstday'] = $this->firstDayOfTheMonth;\n\t\t}\n\t}", "public function setNearday(){\n\t\n\t$this_month_day=$this->getMonth_day();\n\t\n\tif($this->day!=1 && $this->day!=$this_month_day){\n\t\t\n\t\t$this->predate=$this->makeDate($this->month,$this->day-1);\n\t\t\n\t\t$this->nextdate=$this->makeDate($this->month,$this->day+1);\n\t\t\n\t\t\n\t\t\n\t}elseif($this->day==1){\n\t\t\n\t\t$pre_month=$this->month==1?12:($this->month-1);\n\t\t\n\t\t$pre_month_day=$this->getMonth_day($pre_month);\n\t\t\n\t\t$this->predate=$this->makeDate($pre_month,$pre_month_day);\n\t\t\n\t\t$this->nextdate=$this->makeDate($this->month,2);\n\t\t\n\t}else{\n\t\t\n\t\t$this->predate=$this->makeDate($this->month,$this->day-1);\n\t\t\n\t\t$next_month=$this->month==12?1:($this->month+1);\n\t\t\n\t\t$this->nextdate=$this->makeDate($next_month,1);\n\n\t\t}\n\t\t\n\treturn;\n\n\t}", "public function enableNonMonthDays() {\n\t\t$this->displayNonMonthDays = true;\n\t}", "public function SelectArrayStartingToday()\n {\n\t\t$ListOfDates;\n\t\t\n\t\t\n\t\t$TodayDay = $this->GetThisDay();\n\t\t$ThisMonth = date('m');\n\t\t$ThisYear = $this->GetThisYear();\n\t\t$NextYear = $ThisYear+1;\n\t\t$ListOfDates = [ $ThisYear, $NextYear ];\n\t\t\n\t\t$rangeMonths = array();\n\t\tfor ($i = $ThisMonth; $i <= 12; $i++ )\n\t\t{\n\t\t\tarray_push( $rangeMonths, $i);\n\t\t}\n\t\t$ListOfDates[$ThisYear] = $rangeMonths;\n\t\t\n\t\t$rangeMonths = array();\n\t\tfor ($i = 1; $i <= 12; $i++ )\n\t\t{\n\t\t\tarray_push($rangeMonths, $i );\n\t\t}\n\t\t$ListOfDates[$NextYear] = $rangeMonths;\n\t\t\n\t\t//Get the number of days in this month\n\t\t$NumberofDays = cal_days_in_month(CAL_GREGORIAN, $ThisMonth, $ThisYear);\n\t\t\n\t\t//Subtract NumberofDays by $TodayDay to get days left. 31 - 14 = 17days left 15, 16 , 17 to 31 \n\t\t$Daysleft = $NumberofDays - $TodayDay;\n\t\t$rangeofdaysleft = array(); // will hold the array of days left in the month, including today.\n\t\t\n\t\tfor( $i = $TodayDay; $i <= $NumberofDays; $i++ )\n\t\t{\n\t\t\tarray_push($rangeofdaysleft, $i);\n\t\t}\n\t\n\t\t//$ListOfDates[$ThisYear];\n\t\tfor( $i = $ThisMonth; $i <= 12 ; $i++)\n\t\t{\n\t\t\tif($i == $ThisMonth)\n\t\t\t{\n\t\t\t\t$ListOfDates[$ThisYear][$i] = $rangeofdaysleft;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$range = array();\n\t\t\t\t$MaxDays = cal_days_in_month(CAL_GREGORIAN, $i, $ThisYear);\n\t\t\t\tfor($d = 1; $d <= $MaxDays; $d++)\n\t\t\t\t{\n\t\t\t\t\tarray_push($range, $d);\n\t\t\t\t}\n\t\t\t\t$ListOfDates[$ThisYear][$i] = $range;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//array_push($ListOfDates, $arrCurrentYear);\n\t\t\n\t\n\t\tfor( $i = 1 ; $i <= 12; $i++\t)\n\t\t{\n\t\t\t$range = array();\n\t\t\t$MaxDays = cal_days_in_month(CAL_GREGORIAN, $i, $NextYear);\n\t\t\tfor($d = 1; $d <= $MaxDays; $d++)\n\t\t\t{\n\t\t\t\tarray_push($range, $d);\n\t\t\t}\n\t\t\t$ListOfDates[$NextYear][$i] = $range;\n\t\t\t\n\t\t}\n\t\t//array_push($ListOfDates, $arrNextYear);\n\t\t\n\t\t\n\t\t\n\t\treturn json_encode($ListOfDates);\n\t\n\t}", "public function buildMonth()\n\t{\n\t\t$this->orderedDays = $this->getDaysInOrder();\n\t\t\n\t\t$this->monthName = $this->months[ ltrim( $this->month, '0') ];\n\t\t\n\t\t// start of whichever month we are building\n\t\t$start_of_month = getdate( mktime(12, 0, 0, $this->month, 1, $this->year ) );\n\t\t\n\t\t$first_day_of_month = $start_of_month['wday'];\n\t\t\n\t\t$days = $this->startDay - $first_day_of_month;\n\t\t\n\t\tif( $days > 1 )\n\t\t{\n\t\t\t// get an offset\n\t\t\t$days -= 7;\n\t\t\t\n\t\t}\n\n\t\t$num_days = $this->daysInMonth($this->month, $this->year);\n\t\t// 42 iterations\n\t\t$start = 0;\n\t\t$cal_dates = array();\n\t\t$cal_dates_style = array();\n\t\t$cal_events = array();\n\t\twhile( $start < 42 )\n\t\t{\n\t\t\t// off set dates\n\t\t\tif( $days < 0 )\n\t\t\t{\n\t\t\t\t$cal_dates[] = '';\n\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t$cal_dates_data[] = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $days < $num_days )\n\t\t\t\t{\n\t\t\t\t\t// real days\n\t\t\t\t\t$cal_dates[] = $days+1;\n\t\t\t\t\tif( in_array( $days+1, $this->daysWithEvents ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = 'has-events';\n\t\t\t\t\t\t$cal_dates_data[] = $this->data[ $days+1 ];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = '';\n\t\t\t\t\t\t$cal_dates_data[] = '';\n\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{\n\t\t\t\t\t// surplus\n\t\t\t\t\t$cal_dates[] = '';\n\t\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// increment and loop\n\t\t\t$start++;\n\t\t\t$days++;\n\t\t}\n\t\t\n\t\t// done\n\t\t$this->dates = $cal_dates;\n\t\t$this->dateStyles = $cal_dates_style;\n\t\t$this->dateData = $cal_dates_data;\n\t}", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "private function getDatesInMonth() {\n $viewer = $this->getViewer();\n\n $timezone = new DateTimeZone($viewer->getTimezoneIdentifier());\n\n $month = $this->month;\n $year = $this->year;\n\n list($next_year, $next_month) = $this->getNextYearAndMonth();\n\n $end_date = new DateTime(\"{$next_year}-{$next_month}-01\", $timezone);\n\n list($start_of_week, $end_of_week) = $this->getWeekStartAndEnd();\n\n $days_in_month = id(clone $end_date)->modify('-1 day')->format('d');\n\n $first_month_day_date = new DateTime(\"{$year}-{$month}-01\", $timezone);\n $last_month_day_date = id(clone $end_date)->modify('-1 day');\n\n $first_weekday_of_month = $first_month_day_date->format('w');\n $last_weekday_of_month = $last_month_day_date->format('w');\n\n $day_date = id(clone $first_month_day_date);\n\n $num_days_display = $days_in_month;\n if ($start_of_week !== $first_weekday_of_month) {\n $interim_start_num = ($first_weekday_of_month + 7 - $start_of_week) % 7;\n $num_days_display += $interim_start_num;\n\n $day_date->modify('-'.$interim_start_num.' days');\n }\n if ($end_of_week !== $last_weekday_of_month) {\n $interim_end_day_num = ($end_of_week - $last_weekday_of_month + 7) % 7;\n $num_days_display += $interim_end_day_num;\n $end_date->modify('+'.$interim_end_day_num.' days');\n }\n\n $days = array();\n\n for ($day = 1; $day <= $num_days_display; $day++) {\n $day_epoch = $day_date->format('U');\n $end_epoch = $end_date->format('U');\n if ($day_epoch >= $end_epoch) {\n break;\n } else {\n $days[] = clone $day_date;\n }\n $day_date->modify('+1 day');\n }\n\n return $days;\n }", "public function empty_days(string $month, int $year){\r\n $active_month = static::month_str_to_int($month);\r\n $first_date_of_month = new DateTime(\"$year-$month-1\");\r\n $first_day_of_month = $first_date_of_month->format('D');\r\n switch ($first_day_of_month) {\r\n case \"Mon\":\r\n $empty_days = 0;\r\n break;\r\n case \"Tue\":\r\n $empty_days = 1;\r\n break;\r\n case \"Wed\":\r\n $empty_days = 2;\r\n break;\r\n case \"Thu\":\r\n $empty_days = 3;\r\n break;\r\n case \"Fri\":\r\n $empty_days = 4;\r\n break\r\n ;case \"Sat\":\r\n $empty_days = 5;\r\n break;\r\n case \"Sun\":\r\n $empty_days = 6;\r\n break;\r\n default: die(\"wrong m/y format\");\r\n } \r\n return $empty_days; \r\n \r\n }", "function _data_first_month_day()\n {\n $month = date('m');\n $year = date('Y');\n return date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));\n }", "protected function startDate()\n {\n $d = new DateTime('first day of last month');\n $d->setTime(0, 0, 0);\n return $d;\n }", "public function disableNonMonthDays() {\n\t\t$this->displayNonMonthDays = false;\n\t}", "function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }", "function _data_first_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}", "public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "private function getEmptyStartDate()\n {\n return new \\DotbDateTime('2100-01-01 12:00:00');\n }", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "function createNextMonthArray() { \n\t\t$date = date(\"Ymd\");\n\t\t$result = array($date);\n\n\n\t\tfor ($i=0; $i < 5; $i++) { \n\t\t\t$timestamp = strtotime($date);\n\t\t\t$date =date(\"Ymd\", strtotime('+1 day', $timestamp));\n\t\t\tarray_push($result,$date);\n\t\t}\n\t\treturn $result;\n\t}", "public function takePostBaseOnMonth();", "public function monthPadDates()\n {\n return date('w', strtotime(date('Y-m-01', strtotime($this->strStart))));\n }", "function testResetDateBeforeStartDate() {\n Counter::findOne(1)->reset(Carbon::now()->subDays(6)->toDateString());\n }", "public function month_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_start',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date',\n\t\t\t\t'default'\t=> 'year-01-01'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_end',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'limit',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'integer',\n\t\t\t\t'default'\t=> 12\n\t\t\t)\n\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set(\n\t\t\t\t'date_range_end',\n\t\t\t\t$this->CDT->add_month($this->P->value('limit'))\n\t\t\t);\n\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = (\n\t\t\t$this->P->value('date_range_end', 'ymd') >\n\t\t\t\t$this->P->value('date_range_start', 'ymd')\n\t\t) ? 1 : -1;\n\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo\n\t\t{\n\t\t\t$vars['conditional']\t= array(\n\t\t\t\t'is_current_month'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t),\n\t\t\t\t'is_not_current_month'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t) ? FALSE : TRUE,\n\t\t\t\t'is_current_year'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? TRUE : FALSE,\n\t\t\t\t'is_not_current_year'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? FALSE : TRUE\n\t\t\t);\n\n\t\t\t$vars['single']\t= array(\n\t\t\t\t'year'\t=> $this->CDT->year,\n\t\t\t\t'month'\t=> $this->CDT->month\n\t\t\t);\n\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'month'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_month($dir);\n\t\t\t$count++;\n\t\t}\n\t\twhile (\n\t\t\t$count < $this->P->value('limit') AND\n\t\t\t$this->CDT->ymd < $this->P->value('date_range_end', 'ymd')\n\t\t);\n\n\t\treturn $output;\n\t}", "public function uncleared()\n {\n// dd('Hii this is uncleared function of employeecontroller.');\n for($m=1; $m<=12; $m++) {\n $month = date('F', mktime(0,0,0,$m, 1, date('Y')));\n echo $month. '<br>';\n }\n }", "protected function unav_days_to_dates(string $month, int $year, Room $room_for_check){\r\n $days = $this->row_to_days($month, $year, $room_for_check);\r\n// var_dump($days);\r\n \r\n if (!$days){\r\n return;\r\n }\r\n\r\n $this->year = $year;\r\n $this->active_month = $month;\r\n\r\n $unav_dates_in_month = array();\r\n \r\n foreach($days as $day){\r\n $fixed_month = ucfirst ($this->active_month); \r\n $date_string = $day.\"/\".$fixed_month.\"/\".$this->year;\r\n $new_date = DateTime::createFromFormat('d/M/Y', $date_string);\r\n// var_dump($new_date);\r\n $unav_dates_in_month[] = $new_date;\r\n// var_dump($new_date->format('d/M/Y'));\r\n\r\n //OVIM SU NAPRAVLJENI DATUMI ZA POREDJENJE OD UNESENIH ARGUMENATA\r\n }\r\n// var_dump($unav_dates_in_month);\r\n $this->$month = $unav_dates_in_month;\r\n return $unav_dates_in_month;\r\n}", "function zeroMonth($readings) {\n\t$Dates = explode(\"/\", $readings);\n\t$trim_zero = ltrim($Dates[1], '0');\n\t$zero_month = $trim_zero - 1;\n\n\t$Dates_formatted = [];\n\t$Dates_formatted[] = $Dates[2];\n\t$Dates_formatted[] = $zero_month;\n\t$Dates_formatted[] = $Dates[0];\n\n\treturn $Dates_formatted;\n}", "protected function initDefaultNumberOfDays() {}", "private function daysDefault(){\n $data = array();\n\n for($i=1; $i<=31; $i++){\n $data['day_'.$i] = 0;\n }\n\n return $data;\n }", "function _makeMonth($date){\n // YYYY-MM and return an array of all the days\n // in the the month. The array that is returned\n // is in the same formate which is returned by\n // 'makeWeek' function\n $start = Carbon::parse($date)->startOfMonth();\n $end = Carbon::parse($date)->endOfMonth();\n $month = [];\n while ($start->lte($end)) {\n $carbon = $start;\n $month[] = $this->_makeDay($carbon);\n $start->addDay();\n }\n return $month;\n }", "public function testGetStartEndOfMonth() {\n // We only allow start dates in 31-day months.\n $now = new \\DateTimeImmutable('2019-09-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'monthly',\n 'day_of_month' => '-1',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2019-09-30', $date->format('Y-m-d'));\n\n // Tricky value as there is a Feb 29.\n $now = new \\DateTimeImmutable('2020-02-15');\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2020-02-29', $date->format('Y-m-d'));\n }", "private function calculateDefaultStartDate()\r\n {\r\n $now = time();\r\n while (date('D', $now) != 'Mon') {\r\n $now -= 86400;\r\n }\r\n\r\n return date('Y-m-d', $now);\r\n }", "public static function data_first_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}", "function monthPeriod_start_end($begin, $end)\n{\n $begin = (new DateTime($begin.'-01-01'))->modify('first day of this month');\n $end = (new DateTime($end.'-12-01 +1 month'))->modify('first day of this month');\n $daterange = new DatePeriod($begin, new DateInterval('P1M'), $end);\n\n foreach ($daterange as $date) {\n $dates[] = $date->format(\"m\");\n }\n return $dates;\n}", "function move_to_start_of_day()\n {\n $hour=0;\n $minute=0;\n $second=0;\n $day=$this->get_day();\n $month=$this->get_month();\n $year=$this->get_year();\n $newtimestamp=mktime( $hour, $minute, $second, $day, $month, $year);\n }", "protected function endDate()\n {\n $d = new DateTime('first day of this month');\n $d->setTime(0, 0, 0);\n return $d;\n }", "function getFirstDayInMonth()\n {\n return $this->firstDayInMonth;\n }", "public function calculateFirstDayOfMonth($date)\n {\n return $date->copy()->startOfMonth()->addMonth();\n }", "public function clearMonths()\n {\n $this->collMonths = null; // important to set this to null since that means it is uninitialized\n $this->collMonthsPartial = null;\n\n return $this;\n }", "function non_breaking_date() {\r\n\t\t$english_months_array = array(\r\n\t\t// month => variations\r\n\t\t'January' => array('Jan.', 'Jan'),\r\n\t\t'February' => array('Feb.', 'Feb'),\r\n\t\t'March' => array('Mar.', 'Mar'),\r\n\t\t'April' => array('Apr.', 'Apr'),\r\n\t\t'May' => array(),\r\n\t\t'June' => array('Jun.', 'Jun'),\r\n\t\t'July' => array('Jul.', 'Jul'),\r\n\t\t'August' => array('Aug.', 'Aug'),\r\n\t\t'September' => array('Sept.', 'Sept'),\r\n\t\t'October' => array('Oct.', 'Oct'),\r\n\t\t'November' => array('Nov.', 'Nov'),\r\n\t\t'December' => array('Dec.', 'Dec'),\r\n\t\t);\r\n\t\t$french_months_array = array(\r\n\t\t// month => variations\r\n\t\t'janvier' => array('jan.', 'jan'),\r\n\t\t'février' => array('fév.', 'fév', 'f&#233;vrier', 'f&#233;v.', 'f&#233;v', 'f&#xe9;vrier', 'f&#xe9;v.', 'f&#xe9;v', 'f&eacute;vrier', 'f&eacute;v.', 'f&eacute;v'),\r\n\t\t'mars' => array('mar.', 'mar'),\r\n\t\t'avril' => array('avr.', 'avr'),\r\n\t\t'mai' => array(),\r\n\t\t'juin' => array(),\r\n\t\t'juillet' => array('juil.', 'juil'),\r\n\t\t'août' => array('ao&#251;t', 'ao&#xfb;t', 'ao&ucirc;t'),\r\n\t\t'septembre' => array('sept.', 'sept'),\r\n\t\t'octobre' => array('oct.', 'oct'),\r\n\t\t'novembre' => array('nov.', 'nov'),\r\n\t\t'décembre' => array('déc.', 'déc', 'd&#233;cembre', 'd&#233;c.', 'd&#233;c', 'd&#xe9;cembre', 'd&#xe9;c.', 'd&#xe9;c', 'd&eacute;cembre', 'd&eacute;c.', 'd&eacute;c'),\r\n\t\t);\r\n\t\t$english_seasons_array = array(\r\n\t\t'Spring',\r\n\t\t'Summer',\r\n\t\t'Fall',\r\n\t\t'Winter',\r\n\t\t);\r\n\t\t$french_seasons_array = array(\r\n\t\t'printemps',\r\n\t\t'été', '&#233;t&#233;', '&#xe9;t&#xe9;', '&eacute;t&eacute;',\r\n\t\t'automne',\r\n\t\t'hiver',\r\n\t\t);\r\n\t\t$time_periods_array = array();\r\n\t\tforeach($english_months_array as $month => $variations_array) {\r\n\t\t\t$time_periods_array[] = $month;\r\n\t\t\tforeach($variations_array as $variation) {\r\n\t\t\t\t$time_periods_array[] = $variation;\r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach($french_months_array as $month => $variations_array) {\r\n\t\t\t$time_periods_array[] = $month;\r\n\t\t\tforeach($variations_array as $variation) {\r\n\t\t\t\t$time_periods_array[] = $variation;\r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach($english_seasons_array as $season) {\r\n\t\t\t$time_periods_array[] = $season;\r\n\t\t}\r\n\t\tforeach($french_seasons_array as $season) {\r\n\t\t\t$time_periods_array[] = $season;\r\n\t\t}\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,2},*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '<span class=\"noWrap\">$1 $3 $5</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '<span class=\"noWrap\">$1 $3 $5</span>', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,4},*)/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $c);\r\n\t\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $d);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,2},*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $3 $5</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $3 $5</span>', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,4},*)/is', '<span style=\"white-space: nowrap;\">$1 $3</span>', $this->code, -1, $c);\r\n\t\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)/is', '<span style=\"white-space: nowrap;\">$1 $3</span>', $this->code, -1, $d);\r\n\t\t\t}\r\n\t\t} else { // default to nbsp\r\n\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,2},*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '$1&nbsp;$3&nbsp;$5', $this->code, -1, $a);\r\n\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)(' . $this->spaceRegex . ')+([0-9]{4})/is', '$1&nbsp;$3&nbsp;$5', $this->code, -1, $b);\r\n\t\t\t$this->code = preg_replace('/(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{1,4},*)/is', '$1&nbsp;$3', $this->code, -1, $c);\r\n\t\t\t$this->code = preg_replace('/([0-9]{1,2})(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ',*)/is', '$1&nbsp;$3', $this->code, -1, $d);\r\n\t\t\t\r\n\t\t}\r\n\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t//$this->code = preg_replace('/([^;0-9])([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})([^;0-9])/is', '$1<span class=\"noWrap\">$2&ndash;$4&ndash;$6</span>$7', $this->code, -1, $e);\r\n\t\t\t//$this->code = preg_replace('/([^;0-9])(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})(' . $this->spaceRegex . ')+(' . implode(\"|\", $this->dashes_array) . ')(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})([^;0-9])/is', '$1<span class=\"noWrap\">$2&nbsp;$4&nbsp;&ndash;&nbsp;$8&nbsp;$10</span>$11', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})([^;0-9])/is', '$1<span class=\"noWrap\">$2$3$4$5$6</span>$7', $this->code, -1, $e);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})(' . $this->spaceRegex . ')+(' . implode(\"|\", $this->dashes_array) . ')(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})([^;0-9])/is', '$1<span class=\"noWrap\">$2&nbsp;$4&nbsp;$6&nbsp;$8&nbsp;$10</span>$11', $this->code, -1, $f);\r\n\t\t} else {\r\n\t\t\t//$this->code = preg_replace('/([^;0-9])([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2&ndash;$4&ndash;$6</span>$7', $this->code, -1, $e);\r\n\t\t\t//$this->code = preg_replace('/([^;0-9])(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})(' . $this->spaceRegex . ')+(' . implode(\"|\", $this->dashes_array) . ')(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2&nbsp;$4&nbsp;&ndash;&nbsp;$8&nbsp;$10</span>$11', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})(' . implode(\"|\", $this->dashes_array) . ')([0-9]{2,4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2$3$4$5$6</span>$7', $this->code, -1, $e);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})(' . $this->spaceRegex . ')+(' . implode(\"|\", $this->dashes_array) . ')(' . $this->spaceRegex . ')+(' . implode(\"|\", $time_periods_array) . ')(' . $this->spaceRegex . ')+([0-9]{2,4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2&nbsp;$4&nbsp;$6&nbsp;$8&nbsp;$10</span>$11', $this->code, -1, $f);\r\n\t\t}\r\n\t\t//$this->logMsgIf(\"non_breaking_year_range\", $count);\r\n\t\t$count = $a + $b + $c + $d + $e + $f;\r\n\t\t//var_dump($a, $b, $c, $d, $e, $f);\r\n\t\t$this->logMsgIf(\"non_breaking_date\", $count);\r\n\t}", "function nextMonth($interval=1){ return $this->_getDate(0,$interval); }", "public function set_duedate_from_monthrefdate() {\n $this->duedate = $this->monthrefdate->copy()->addMonths(1)->day(10);\n // TO-DO take out the 10 hardcoded when possible !!!\n //$this->duedate->day(10);\n //$this->duedate->addMonths(1);\n }", "public static function firstDayOfMonth(?DateTimeInterface $date = null): static\n\t{\n\t\t$date = self::checkDate($date);\n\t\treturn static::from($date->format('Y-m-01'));\n\t}", "function ShowDayOfMonth($get_month){\n\t$arr_d1 = explode(\"-\",$get_month);\n\t$xdd = \"01\";\n\t$xmm = \"$arr_d1[1]\";\n\t$xyy = \"$arr_d1[0]\";\n\t$get_date = \"$xyy-$xmm-$xdd\"; // วันเริ่มต้น\n\t//echo $get_date.\"<br>\";\n\t$xFTime1 = getdate(date(mktime(0, 0, 0, intval($xmm+1), intval($xdd-1), intval($xyy))));\n\t$numcount = $xFTime1['mday']; // ฝันที่สุดท้ายของเดือน\n\tif($numcount > 0){\n\t\t$j=1;\n\t\t\tfor($i = 0 ; $i < $numcount ; $i++){\n\t\t\t\t$xbasedate = strtotime(\"$get_date\");\n\t\t\t\t $xdate = strtotime(\"$i day\",$xbasedate);\n\t\t\t\t $xsdate = date(\"Y-m-d\",$xdate);// วันถัดไป\t\t\n\t\t\t\t $arr_d2 = explode(\"-\",$xsdate);\n\t\t\t\t $xFTime = getdate(date(mktime(0, 0, 0, intval($arr_d2[1]), intval($arr_d2[2]), intval($arr_d2[0]))));\t\n\t\t\t\t if($xFTime['wday'] == 0){\n\t\t\t\t\t $j++;\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\tif($xFTime['wday'] != \"0\"){\n\t\t\t\t\t\t$arr_date[$j][$xFTime['wday']] = $xsdate;\t\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}//end if($numcount > 0){\n\treturn $arr_date;\t\n}", "public function isNotFillFirstStartDate () {\n return '0000-00-00' == $this->first_start_date;\n }", "function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)\n {\n if ($s < 0) {\n $m -= floor($s / 60);\n $s = -$s % 60;\n }\n if ($s > 60) {\n $m += floor($s / 60);\n $s %= 60;\n }\n if ($i < 0) {\n $h -= floor($i / 60);\n $i = -$i % 60;\n }\n if ($i > 60) {\n $h += floor($i / 60);\n $i %= 60;\n }\n if ($h < 0) {\n $d -= floor($h / 24);\n $h = -$h % 24;\n }\n if ($h > 24) {\n $d += floor($h / 24);\n $h %= 24;\n }\n for(; $m < 1; $y--, $m+=12);\n for(; $m > 12; $y++, $m-=12);\n\n while ($d < 1) {\n if ($m > 1) {\n $m--;\n } else {\n $m = 12;\n $y--;\n }\n $d += Date_Calc::daysInMonth($m, $y);\n }\n for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days; ) {\n $d -= $max_days;\n if ($m < 12) {\n $m++;\n } else {\n $m = 1;\n $y++;\n }\n }\n }", "function make_date($dates_request){\n\n\t$date_array = array();\n\t$cur_month = date('n');\t\t\n\t$cur_day = date('j');\n\t$cur_year = date('Y');\n\t$leap_true = date('L');\n\t$num_days = 0;\n\t\n\t//Loop that determines next $num_days upcoming dates\n\twhile ($num_days < $dates_request) {\t\n\n\t\t$format_date = $cur_month.\"/\".$cur_day.\"/\".$cur_year;\t\t\t\n\t\t$date_array[] = $format_date;\t\t\n\n\t\t//months with 30 days\n\t\tif ($cur_month == 9 || $cur_month == 4 || $cur_month == 6) {\n\t\t\tif ($cur_day == 30) {\n\t\t\t\t$cur_day = 1;\n\t\t\t\t$cur_month = $cur_month+1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$cur_day = $cur_day+1;\n\t\t\t}\n\t\t}\n\t\t//december\n\t\telse if ($cur_month == 12) {\n\t\t\tif ($cur_day == 31) {\n\t\t\t\t$cur_day = 1;\n\t\t\t\t$cur_month = 1;\n\t\t\t\t$cur_year = $cur_year+1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$cur_day = $cur_day+1;\n\t\t\t}\n\t\t}\n\t\t//february\t\t\n\t\telse if ($cur_month == 2) {\n\t\t\tif ($leap_true == true) {\n\t\t\t\tif ($cur_day == 29) {\n\t\t\t\t\t$cur_day=1;\n\t\t\t\t\t$cur_month=$cur_month+1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$cur_day = $cur_day+1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($cur_day == 28) {\n\t\t\t\t\t$cur_day = 1;\n\t\t\t\t\t$cur_month=$cur_month+1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$cur_day = $cur_day+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//other months\t\t\n\t\telse {\n\t\t\tif ($cur_day == 31) {\n\t\t\t\t$cur_day = 1;\n\t\t\t\t$cur_month=$cur_month+1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$cur_day = $cur_day+1;\n\t\t\t}\n\t\t}\n\t$num_days = $num_days+1;\n\t}\n\treturn $date_array;\n}", "public function skipWeekend()\r\n {\r\n if ($this->getDayOfWeek() == 7)\r\n {\r\n $this->addDay(1);\r\n }\r\n else if ($this->getDayOfWeek() == 6)\r\n {\r\n $this->addDay(2);\r\n }\r\n }", "function allDays($month,$day,$con,$prodID){\n\t\t$m1 = date(\"m\",strtotime($month));\n\t\t$m2 = date(\"m\",strtotime(\"now\"));\n\t\t$year = \"\";\n\t\tif($m2>$m1){\n\t\t\t\n\t\t\t$year = date(\"Y\",strtotime(\"now +1 year\"));\n\t\t}\n\n $last = strtotime(\"last $day of $month $year\");\n $first = strtotime(\"first $day of $month $year\");\n $week = 0;\n for ($i=$first; $i < $last; ) {\n $i=strtotime(\"first $day of $month $year +$week week\");\n $ed = date(\"D M d Y\",$i);\n $checkReserved = $con->prepare(\"SELECT * FROM tbl_reserved WHERE prodID ='$prodID' AND EventDate = '$ed' \");\n $checkReserved->execute();\n $cr = $checkReserved->fetch(); \n if(!$cr){\n if(strtotime(\"now\") >= strtotime(date(\"M d Y\",$i))){\n echo \"<option>\".date(\"M d Y\",strtotime(date(\"M d Y\",$i).\" +1 year\")).\"</option>\";\n }else{\n echo \"<option>\".date(\"M d Y\",$i).\"</option>\";\n }\n \n }\n \n $week++;\n }\n }", "public function setStartMonth($month)\n {\n $this->start_month = $month;\n $date = date('Y', time()) . '-' . $month . '-01';\n $this->start_date = new DateTime($date);\n }", "public function reset()\n {\n $this->values[self::_LAST_CHANGE] = null;\n $this->values[self::_TODAY_TIMES] = null;\n }", "private function makeArrayIterator()\n\t{\n\t\t$this->weekDayNum = $this->firstDayOfTheMonth+1;\t\t\n\t\tfor($this->dayOfMonth; $this->dayOfMonth <= $this->daysInMonth; $this->dayOfMonth++) {\n\t\t\t// Set the default style\n\t\t\t$this->outArray['days'][$this->dayOfMonth]['style'] = 'normalDay';\n\t\t\t\n\t\t\t// Set the style to a weekend day style\n\t\t\tif(($this->weekDayNum == 8)||($this->weekDayNum == 7)) {\n\t\t\t\t$this->outArray['days'][$this->dayOfMonth]['style'] = 'weekendDay';\n\t\t\t}\n\t\t\t\n\t\t\t// Set the style to a current day style\n\t\t\tif($this->curDay == $this->dayOfMonth) {\n\t\t\t\t$this->outArray['days'][$this->dayOfMonth]['style'] = 'currentDay';\n\t\t\t}\n\t\t\t\n\t\t\t// If the current day is Sunday, add a new row\n\t\t\tif($this->weekDayNum == 8) {\n\t\t\t\t$this->weekDayNum = 1;\n\t\t\t} \n\t\t\t\n\t\t\t$this->outArray['days'][$this->dayOfMonth]['dayname'] = $this->daysArray[$this->weekDayNum - 1];\n\t\t\t$this->outArray['days'][$this->dayOfMonth]['weekdaynumber'] = $this->weekDayNum;\n\t\t\t\t\t\t\t\t\t\n\t\t\t// Draw days\n\t\t\tif($this->makeDayEventListArray()) {\n\t\t\t\t$this->outArray['days'][$this->dayOfMonth]['events'] = $this->makeDayEventListArray();\n\t\t\t}\n\t\t\t\n\t\t\t$this->outArray['days'][$this->dayOfMonth]['datestamp'] = $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth;\n\t\t\t\n\t\t\t$this->weekDayNum++;\n\t\t}\n\t}", "function get_dates() {\n $m = date('m');\n $d = date('d');\n $y = date('Y');\n $retour['j'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y));\n $retour['s1'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +7, $y));\n $retour['s2'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +14, $y));\n $retour['s3'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +21, $y));\n $retour['m1'] = date('d/m/Y', mktime(0, 0, 0, $m +1, $d, $y));\n $retour['m2'] = date('d/m/Y', mktime(0, 0, 0, $m +2, $d, $y));\n $retour['m3'] = date('d/m/Y', mktime(0, 0, 0, $m +3, $d, $y));\n $retour['m6'] = date('d/m/Y', mktime(0, 0, 0, $m +6, $d, $y));\n $retour['m9'] = date('d/m/Y', mktime(0, 0, 0, $m +9, $d, $y));\n $retour['m12'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y +1));\n return $retour;\n}", "public function hasStartMonth() {\n return $this->_has(5);\n }", "function start_pointer($input)\n{\n /* set time zone */\n date_default_timezone_set('Asia/Calcutta');\n\n /* append day and month to current year */\n $date_input = $input;\n\n /* create new object of Date time and pass $input as variable */\n $dateTime = (new DateTime(rtrim($date_input)));\n\n /* setting offset of 7 days to traverse back 7 days */\n $offset = -7;\n\n $dateInterval = new DateInterval('P' . abs($offset) . 'D');\n if ($offset < 0) {\n $dateInterval->invert = 1;\n }\n\n /* append $dateInterval which go back 7 days to main datetime object */\n $dateTime->add($dateInterval);\n\n /* assign datetime object to $begin which contain 7 days back value of input data */\n $begin = $dateTime;\n\n /* assign $input data to end means value of end pointer */\n $end = new DateTime(rtrim($date_input));\n $end = $end->modify('+1 day');\n\n /* day range generator offset ITS DIFFERENT THEN BEFORE ONE */\n $interval = new DateInterval('P1D');\n\n\n $daterange = new DatePeriod($begin, $interval, $end);\n\n\n /* print or store in array */\n foreach ($daterange as $i => $date) {\n $rt_array[$i] = $date->format(\"d/m/Y\");\n }\n\n return $rt_array;\n\n}", "function getDays_ym($month, $year){\n // Start of Month\n $start = new DateTime(\"{$year}-{$month}-01\");\n $month = $start->format('F');\n\n // Prepare results array\n $results = array();\n\n // While same month\n while($start->format('F') == $month){\n // Add to array\n $day = $start->format('D');\n $sort_date = $start->format('j');\n $date = $start->format('Y-m-d');\n $results[$date] = ['day' => $day,'sort_date' => $sort_date,'date' => $date];\n\n // Next Day\n $start->add(new DateInterval(\"P1D\"));\n }\n // Return results\n return $results;\n}", "function create_calendar_array($used_dates){\n\n\t//create array of dates for October with false attributes\n\t$october = array();\n\tfor($day=1;$day<=31;$day++){\n\t\t$october[$day]=FALSE;\n\t}\n\t\n\t//compare used dates to whole month\n\tforeach\t($used_dates as $post_id=>$date){\n\t\t$october[intval($date['day'])][]=$post_id;\n\t}\n\t\t\n\t\n\treturn $october;\n}", "function get_first_day($month) {\r\n $data = new DateTime('01-' . $month .'-'.date('Y'));\r\n $first_day = $data->format('D');\r\n switch($first_day) {\r\n case 'Sun':\r\n $initial_day_of_month = 1;\r\n break;\r\n case 'Mon':\r\n $initial_day_of_month = 2;\r\n break;\r\n case 'Tue':\r\n $initial_day_of_month = 3;\r\n break;\r\n case 'Wed':\r\n $initial_day_of_month = 4;\r\n break;\r\n case 'Thu':\r\n $initial_day_of_month = 5;\r\n break;\r\n case 'Fri':\r\n $initial_day_of_month = 6;\r\n break;\r\n case 'Sat':\r\n $initial_day_of_month = 7;\r\n break;\r\n }\r\n\r\n return $initial_day_of_month;\r\n }", "function _buildMay()\n {\n \n $this->_addHoliday(\n 'May',\n $this->_year . '-05-01',\n 'May\\'s Day'\n );\n \n }", "public function generateEmptyCalendar($year, $month){\n $this->load->library('calendar', $this->prefs);\n return $this->calendar->generate($year , $month);\n }", "public function hideEndDateWhenEmpty(DataContainer $dc)\r\n {\r\n $date = $this->Database->prepare(\"SELECT id, start_date FROM tl_ausschreibung WHERE start_date!='' AND end_date=''\")->execute();\r\n while ($row = $date->next())\r\n {\r\n $end_date = $this->Database->prepare(\"UPDATE tl_ausschreibung SET end_date = ? WHERE id = ?\");\r\n $end_date->execute($row->start_date, $row->id);\r\n }\r\n //Wenn end-datum leer ist, wird es ausgeblendet, das ist der Fall beim Erstellen neuer Anlaesse\r\n if ($dc->id != \"\" && $this->Input->get('mode') != 'csv_import')\r\n {\r\n\r\n $date = $this->Database->prepare(\"SELECT start_date FROM tl_ausschreibung WHERE id = ?\")->execute($dc->id);\r\n $date->fetchAssoc();\r\n if ($date->start_date == \"\")\r\n {\r\n $GLOBALS['TL_DCA']['tl_ausschreibung']['palettes']['default'] = 'start_date, art, ort, wettkampfform; zeit, trainer; kommentar; phase, trainingsstunden';\r\n }\r\n }\r\n\r\n }", "function find_start_of_week()\n {\n $this->move_to_start_of_day();\n $this->move_to_start_of_day();\n while ($this->get_day_of_week()>0)\n {\n $this->move_forward_n_days(-1);\n }\n }", "public function print_blanc_calendar(string $month, int $year){\r\n \r\n $month_days = static::no_of_days_in_month($month, $year); \r\n $empty_days = $this->empty_days($month, $year);\r\n for ($i=1; $i<=$empty_days; $i++){\r\n echo \"<div class='cal_date empty_date'> </div>\";\r\n }\r\n \r\n \r\n for ($i=1; $i<=$month_days; $i++){\r\n echo \"<div class='cal_date cal_blanc_date'>\";\r\n echo $i;\r\n echo \"</div>\";\r\n }\r\n }", "function getMonthlyHiredDays( $startDate, $endDate ) {\n \n $startDate = DateTime::createFromFormat('Y-m-d H:i:s', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d H:i:s', $endDate);\n \n if ( !$startDate || !$endDate ) {\n \n echo 'Invalid arguments';\n return;\n }\n \n if ( $startDate > $endDate) {\n \n echo 'The start date is greater than the end date';\n return;\n }\n \n $hiredDays = array(); \n if ( $startDate->format('n') == $endDate->format('n') && $startDate->format('Y') == $endDate->format('Y') ) {\n \n // Get ddays between days and push to the array\n array_push( $hiredDays,\n array(\n 'year' => $startDate->format('Y'),\n 'month' => $startDate->format('n'),\n 'days' => $startDate->diff($endDate, true)->days\n )\n );\n \n }else {\n \n // Loop until the last date and get the days of every month \n while( true ) { \n \n if( !isset($startPoint) ) {\n \n $startPoint = $startDate; \n $m = $startDate->format('n');\n }else {\n \n $startPoint = $endPoint->add(new DateInterval('P1D'));\n $startPoint = $startPoint->setTime(0,0,0);\n $m = $startPoint->format('n');\n }\n \n if ( $m == 11 //30 days\n || $m == 4\n || $m == 6\n || $m == 9 ) {\n \n $monthDays = 30;\n }elseif ( $m == 2 ) { // 28 days\n \n $monthDays = $startPoint->format('L') == 1 ? 29 : 28;\n \n }else { // 31 days \n \n $monthDays = 31;\n }\n \n $endPoint = DateTime::createFromFormat('Y-m-d H:i:s', $startPoint->format('Y').'-'.$m.'-'.$monthDays.' 23:59:59');\n \n if ( $endPoint > $endDate ) {\n \n $endPoint = $endDate;\n } \n \n array_push( $hiredDays,\n array(\n 'year' => $startPoint->format('Y'),\n 'month' => $startPoint->format('n'),\n 'days' => $startPoint->diff($endPoint, true)->days + 1\n )\n );\n\n if ( $endPoint == $endDate ) {\n break;\n }\n \n $m = $m == 12 ? 1 : $m + 1;\n }\n } \n return $hiredDays;\n }", "function testResetDateSameAsStartDate() {\n $startDate = Carbon::now()->subDays(5);\n \n //Test precondition\n $this->tester->seeInDatabase('History', ['counterId'=>1, 'startDate'=>$startDate->toDateString(),\n 'endDate'=>null]);\n\n Counter::findOne(1)->reset($startDate->toDateString());\n\n $this->tester->seeInDatabase('History', ['counterId'=>1, 'startDate'=>$startDate->toDateString(),\n 'endDate'=>null]);\n $this->tester->dontSeeInDatabase('History', ['counterId'=>1, 'startDate'=>$startDate->toDateString(),\n 'endDate'=>$startDate->toDateString()]); \n }", "function remove_date_drop(){\n$screen = get_current_screen();\n if ( 'contact' == $screen->post_type ){\n add_filter('months_dropdown_results', '__return_empty_array');\n }\n}", "function BeginMonth($time,$week,$backwards) {\n\tif ($backwards > 0) { $time = $time - ($backwards * 604800); } \n\t$month = date(\"n\", $time);\n\t$year = date(\"Y\", $time);\n\t$firstday = mktime(12,0,0,$month,1,$year);\n\tif ($week != NULL) { $firstday = BeginWeek($firstday); }\n\treturn($firstday);\n}", "public function reset()\n {\n $this->values[self::_LAST_RESET_TIME] = null;\n $this->values[self::_TODAY_FREE_SWEEP_TIMES] = null;\n }", "function same_day_next_month($time)\n{\n global $_initial_weeknumber;\n\n $days_in_month = date(\"t\", $time);\n $day = date(\"d\", $time);\n $weeknumber = (int)(($day - 1) / 7) + 1;\n $temp1 = ($day + 7 * (5 - $weeknumber) <= $days_in_month);\n\n // keep month number > 12 for the test purpose in line beginning with \"days_jump = 28 +...\"\n $next_month = date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day +35, date(\"Y\", $time))) + (date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day +35, date(\"Y\", $time))) < date(\"n\", $time)) * 12;\n\n // prevent 2 months jumps if $time is in 5th week\n $days_jump = 28 + (($temp1 && !($next_month - date(\"n\", $time) - 1)) * 7);\n\n /* if initial week number is 5 and the new occurence month number ($time + $days_jump)\n * is not changed if we add 7 days, then we can add 7 days to $days_jump to come\n * back to the 5th week (yuh!) */\n $days_jump += 7 * (($_initial_weeknumber == 5) && (date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day + $days_jump, date(\"Y\", $time))) == date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day + $days_jump + 7, date(\"Y\", $time)))));\n\n return $days_jump;\n}", "public static function getFirstDayOfCurrentMonth()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, date('m'), 1, date('Y'));\n\t\t$date = date('Y-m-01', $dateInSeconds);\n\t\treturn $date;\n\t}", "public function setToFirstDayOfMonth(int $month = null) : Time /*PHP8:static*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n if ($month !== null) {\n if ($month < 1 || $month > 12) {\n throw new \\InvalidArgumentException('Arg month[' . $month . '] isn\\'t null or 1 through 12.');\n }\n $mnth = $month;\n }\n else {\n $mnth = (int) $this->format('m');\n }\n return $this->setDate(\n (int) $this->format('Y'),\n $mnth,\n 1\n );\n }", "function fixday($s,$i){\n\treturn $n = mktime(0,0,0,date(\"m\",$s) ,date(\"d\",$s)+$i,date(\"Y\",$s));\n}", "public function getDateStartMonth($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime('first day of this month', strtotime($date)));\n\t\treturn $dateNew;\n\t}", "public function premierdelasemaine(): DateTime{\n // Obtenir le premier jour de la premiere semaine de l'année en cours\n $begin = new DateTime(\"{$this->year}-01-01\");\n \n if ($begin->format('w')!=1) $begin->modify(\"next monday\");\n \n return $begin->modify(\"+\".($this->week-1).\" weeks\");\n }", "public function nextDay() {\n foreach ($this->items as $i => $item) {\n ($this->items[$i] = ItemFactory::getInstance($item))->degrade();\n }\n }", "function calendar($date) {\r\n\t //If no parameter is passed use the current date.\r\n\t if($date == null)\r\n\t $date = getDate();\r\n\r\n\t $day \t\t\t= $date[\"mday\"];\r\n\t $month \t\t= $date[\"mon\"];\r\n\t $month_name \t= $date[\"month\"];\r\n\t $year \t\t\t= $date[\"year\"];\r\n\r\n\t $this_month \t= getDate(mktime(0, 0, 0, $month, 1, $year));\r\n\t $next_month \t= getDate(mktime(0, 0, 0, $month + 1, 1, $year));\r\n\r\n\t //Find out when this month starts and ends.\r\n\t $first_week_day = $this_month[\"wday\"];\r\n\t $days_in_this_month = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24));\r\n\r\n\t $calendar_html = \"<table width='100%'>\";\r\n\t $calendar_html = $calendar_html.\"<tr>\t<td class='perp_report_header' colspan='7' /> Month: \".$month_name.\" / Year: \".$year.\"</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\";\r\n\t $calendar_html = $calendar_html.\"<tr>\t<td class='perp_report_subheader'>Sunday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Monday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Tuesday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Wednesday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Thursday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Friday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Saterday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t\t<tr>\";\r\n\r\n\t// Fill the first week of the month with the appropriate number of blanks.\r\n\t\t\t$gapcounter = 0;\r\n\t\t\tfor($week_day = 0; $week_day < $first_week_day; $week_day++) {\r\n\t\t\t\t\t$gapcounter = $gapcounter + 1;\r\n\t\t\t\t}\r\n\t\t\t$calendar_html = $calendar_html.\"<td class='perp_report_cell' colspan='\".$gapcounter.\"'></td>\";\t\r\n\t\r\n\t// Draw Calendar Elements\r\n\t\t\t// I forget!\t\t\t\t\r\n\t $week_day = $first_week_day;\r\n\t for($day_counter = 1; $day_counter <= $days_in_this_month; $day_counter++) {\r\n\t\t\t\t\t// Determine Day of the week\r\n\t\t\t\t\t$week_day %= 7;\r\n\t\t\t\t\r\n\t\t\t\t\t// If this variable equals 0, we will need to start a new row.\r\n\t\t\t\t\tif($week_day == 0) {\r\n\t\t\t\t\t\t\t$calendar_html = $calendar_html.\"</tr><tr>\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$datetopull = $year.\"/\".$month.\"/\".$day_counter;\r\n\t\t\t\t\t$innercell = \"<TABLE width='100%' style='margin-bottom:0;margin-top:0;'><tr><td class='perp_report_fieldname'>Date:</td><td class='perp_report_fieldcontent'>\".$datetopull.\"</td></tr>\";\r\n\t\t\t\t\t//Now Get inspection List for this day.....\r\n\t\t\t\t\t$objconn = mysqli_connect($GLOBALS['hostdomain'], $GLOBALS['hostusername'], $GLOBALS['passwordofdatabase'], $GLOBALS['nameofdatabase']);\t\t\t\t\t\r\n\t\t\t\t\tif (mysqli_connect_errno()) {\r\n\t\t\t\t\t\t\t// there was an error trying to connect to the mysql database\r\n\t\t\t\t\t\t\t//printf(\"connect failed: %s\\n\", mysqli_connect_error());\r\n\t\t\t\t\t\t\texit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$sql = \"SELECT * FROM tbl_139_337_main WHERE 139337_date = '\".$datetopull.\"' ORDER BY 139337_time\";\r\n\t\t\t\t\t\t\t//echo \"The SQL Statement is :\".$sql.\"<br>\";\r\n\t\t\t\t\t\t\t$objrs = mysqli_query($objconn, $sql);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($objrs) {\r\n\t\t\t\t\t\t\t\t\t$number_of_rows = mysqli_num_rows($objrs);\r\n\t\t\t\t\t\t\t\t\twhile ($objarray = mysqli_fetch_array($objrs, MYSQLI_ASSOC)) {\r\n\t\t\t\t\t\t\t\t\t\t$counter = $counter + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t$counter = $counter + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// So the Archieved or Duplicate Narrowing...\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow\t\t\t\t\t= 0;\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_a\t\t\t\t= 0;\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_b\t\t\t\t= 0;\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$tmpdiscrepancyid\t\t\t= $objarray['Discrepancy_id'];\r\n\t\t\t\t\t\t\t\t\t\t\t$tmpdiscrepancycondition\t= $objarray['discrepancy_checklist_id'];\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_a\t\t\t\t= preflights_tbl_139_337_main_a_yn($tmpdiscrepancyid,0); // 0 will not return a row even if it is archieved.\r\n\t\t\t\t\t\t\t\t\t\t\t//$displayrow_d\t\t\t\t= preflights_tbl_139_327_main_sub_d_d_yn($tmpdiscrepancyid,0); // 0 will not return a row even if it is duplicate.\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif($displayrow_a == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($displayrow_d == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif($displayrow_d == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($displayrow_a == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif ($displayrow == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$innercell = $innercell.\"<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<form style='margin-bottom:0;' action='part139337_report_display.php' method='POST' name='reportform' id='reportform' target='WLHMWindow' onsubmit='window.open('', 'WLHMWindow', 'width=800,height=600,status=no,resizable=no,scrollbars=yes')'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td colspan='2' class='formoptionsubmit'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type='hidden' name='recordid'\tID='recordid' \t\t\tvalue=\".$tmpdiscrepancyid.\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' value='D:\".$tmpdiscrepancyid.\"' name='b1' ID='b1' class='makebuttonlooklikelargetext' style='width:100%;'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$innercell = $innercell.\"</table>\";\t\r\n\t\t\t\t\tif ($counter == 0) {\r\n\t\t\t\t\t\t\t$innercell = $innercell.\"Nothing Reported\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$calendar_html = $calendar_html.\"<td align=\\\"center\\\" valign='top' class='perp_report_activecell'>&nbsp;\".$innercell.\"</td>\";\r\n\t\t\t\t\t$week_day++;\r\n\t\t\t\t\t$counter = 0;\r\n\t\t\t\t}\r\n\r\n\t $calendar_html .= \"</tr>\";\r\n\t $calendar_html .= \"</table>\";\r\n\r\n\t return($calendar_html);\r\n\t }", "public function createFromDateOrFirstDayOfMonth($text): DateTimeHolder\n {\n $holder = new DateTimeHolder;\n $date = date_create_from_format(\"j. n. Y\", $text);\n $holder->typed = $date ? $date : new DateTime('first day of this month');\n $holder->textual = $holder->typed->format(\"j. n. Y\");\n return $holder;\n }", "function dateFix($date) {\n\n $dateArray = explode(\"-\",$date);\n\n $year = $dateArray[0];\n $month = $dateArray[1];\n $day = $dateArray[2];\n\n return date(\"Y-m-d\",mktime(0,0,0,$month,$day,$year));\n\n}", "public function testNeverEnding()\n {\n $this->parse(\n 'FREQ=MONTHLY;BYDAY=2TU;BYSETPOS=2',\n '2015-01-01 00:15:00',\n [\n '2015-01-01 00:15:00',\n ],\n 'monthly', null, 1, null,\n null,\n 'UTC',\n true\n );\n }", "public function testGetStartDateSep31() {\n $now = new \\DateTimeImmutable('2020-02-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'day_of_month' => '31',\n 'month' => '9',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2020-09-30', $date->format('Y-m-d'));\n }", "public function resetPartialMonths($v = true)\n {\n $this->collMonthsPartial = $v;\n }", "function SetInitialDate ($date)\r\n {\r\n if ($date)\r\n {\r\n $this->_dti = $date; \r\n }\r\n }", "function get_first_day($day_number=1, $month=false, $year=false) {\r\n $month = ($month === false) ? strftime(\"%m\"): $month;\r\n $year = ($year === false) ? strftime(\"%Y\"): $year;\r\n \r\n $first_day = 1 + ((7+$day_number - strftime(\"%w\", mktime(0,0,0,$month, 1, $year)))%7);\r\n \r\n return mktime(0,0,0,$month, $first_day, $year);\r\n }", "function beeldgeluid_date_all_day_label() {\n return '';\n}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "public static function setDateFormatMonth()\n {\n self::$settings[0] = 'Y-m';\n }", "public function zeroize()\n {\n for ($i = $this->count() - 1; $i >= 0; --$i) {\n $this->offsetSet($i, 0);\n }\n }", "function getDefaultDatesForTransfer()\n{\n\tglobal $db, $conf;\n\n\t// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)\n\t$periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER;\n\tisset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0;\n\tif ($periodbydefaultontransfer == 2) {\n\t\t$sql = \"SELECT date_start, date_end FROM \".MAIN_DB_PREFIX.\"accounting_fiscalyear \";\n\t\t$sql .= \" WHERE date_start < '\".$db->idate(dol_now()).\"' AND date_end > '\".$db->idate(dol_now()).\"'\";\n\t\t$sql .= $db->plimit(1);\n\t\t$res = $db->query($sql);\n\t\tif ($res->num_rows > 0) {\n\t\t\t$fiscalYear = $db->fetch_object($res);\n\t\t\t$date_start = strtotime($fiscalYear->date_start);\n\t\t\t$date_end = strtotime($fiscalYear->date_end);\n\t\t} else {\n\t\t\t$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);\n\t\t\t$year_start = dol_print_date(dol_now(), '%Y');\n\t\t\tif ($conf->global->SOCIETE_FISCAL_MONTH_START > dol_print_date(dol_now(), '%m')) {\n\t\t\t\t$year_start = $year_start - 1;\n\t\t\t}\n\t\t\t$year_end = $year_start + 1;\n\t\t\t$month_end = $month_start - 1;\n\t\t\tif ($month_end < 1)\n\t\t\t{\n\t\t\t\t$month_end = 12;\n\t\t\t\t$year_end--;\n\t\t\t}\n\t\t\t$date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);\n\t\t\t$date_end = dol_get_last_day($year_end, $month_end);\n\t\t}\n\t} elseif ($periodbydefaultontransfer == 1) {\n\t\t$year_current = strftime(\"%Y\", dol_now());\n\t\t$pastmonth = strftime(\"%m\", dol_now());\n\t\t$pastmonthyear = $year_current;\n\t\tif ($pastmonth == 0) {\n\t\t\t$pastmonth = 12;\n\t\t\t$pastmonthyear--;\n\t\t}\n\t} else {\n\t\t$year_current = strftime(\"%Y\", dol_now());\n\t\t$pastmonth = strftime(\"%m\", dol_now()) - 1;\n\t\t$pastmonthyear = $year_current;\n\t\tif ($pastmonth == 0) {\n\t\t\t$pastmonth = 12;\n\t\t\t$pastmonthyear--;\n\t\t}\n\t}\n\n\treturn array(\n\t\t'date_start' => $date_start,\n\t\t'date_end' => $date_end,\n\t\t'pastmonthyear' => $pastmonthyear,\n\t\t'pastmonth' => $pastmonth\n\t);\n}", "function this_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of this month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of this month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public static function getFirstDayOfMonth( $date = false )\n\t{\n\t\tif ( $date === false )\n\t\t{\n\t\t\treturn date( 'Y-m-01' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn date( 'Y-m-d', strtotime( date( 'Y-m-01', strtotime( $date ) ) ) );\n\t\t}\n\t}", "static function add_eb_nom_start(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_nom_start, [\r\n\t\t\t'label' => 'Nomination period start',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 5 @ 9 a.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "private static function fillWithEmptyValues($arrays, $start_date, $end_date, $frequency = QueryResultPeer::FREQUENCY_DAY)\n {\n $min_date = strtotime($start_date);\n $max_date = strtotime($end_date);\n\n $rtn = array();\n\n if($frequency == QueryResultPeer::FREQUENCY_WEEK)\n {\n $counter = 0;\n foreach($arrays as $array)\n {\n $min_custom = strtotime(Utils::get_date_of_first_day_in_a_week(date('W', $min_date), date('o', $min_date)));\n $max_custom = strtotime(Utils::get_date_of_first_day_in_a_week(date('W', $max_date), date('o', $max_date)));\n $weeks = ceil((($max_date - $min_date) / 24 / 60 / 60 / 7));\n\n $rtn[] = array();\n// for($i = 0; $i < $weeks; $i++)\n// {\n while($min_custom <= $max_custom) {\n if(array_key_exists(date('Y-m-d', $min_custom), $array))\n {\n //$rtn[$counter][date('Y-m-d', $min_custom)] = $array[date('Y-m-d', $min_custom)];\n $rtn[$counter][date('o', $min_custom) . '-' . date('W', $min_custom)] = $array[date('Y-m-d', $min_custom)];\n } else\n {\n //$rtn[$counter][date('Y-m-d', $min_custom)] = -1;\n $rtn[$counter][date('o', $min_custom) . '-' . date('W', $min_custom)] = -1;\n }\n $min_custom = strtotime(date('Y-m-d', $min_custom) .' +1 weeks');\n }\n $counter++;\n }\n } else if($frequency == QueryResultPeer::FREQUENCY_MONTH)\n {\n $min_custom = strtotime(date('Y', $min_date) . date('m', $min_date) . '01');\n $months = (date('Y', $max_date) - date('Y', $min_date)) * 12 + date('m', $max_date) - date('m', $min_date);\n $counter = 0;\n foreach($arrays as $array)\n {\n $rtn[] = array();\n for($i = 0; $i < $months + 1; $i++)\n {\n $date_temp = strtotime(date('Y-m-d', $min_custom) . ' +' .$i. ' months');\n if(array_key_exists(date('Y-m-d', $date_temp), $array))\n {\n $rtn[$counter][date('Y-m-d', $date_temp)] = $array[date('Y-m-d', $date_temp)];\n } else\n {\n $rtn[$counter][date('Y-m-d', $date_temp)] = -1;\n }\n }\n $counter++;\n }\n } else\n {\n $days = ceil((($max_date - $min_date) / 24 / 60 / 60)) + 1;\n\n $counter = 0;\n foreach($arrays as $array)\n {\n $rtn[] = array();\n// for($i = 0; $i < $days; $i++)\n $date_temp = $min_date;\n while($date_temp <= $max_date)\n {\n if(array_key_exists(date('Y-m-d', $date_temp), $array))\n {\n $rtn[$counter][date('Y-m-d', $date_temp)] = $array[date('Y-m-d', $date_temp)];\n } else\n {\n $rtn[$counter][date('Y-m-d', $date_temp)] = -1;\n }\n $date_temp = strtotime('+1 day', $date_temp);\n }\n $counter++;\n }\n }\n\n return $rtn;\n }", "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "function getDatesFromRange($start, $end, $format = 'Y-m-d') { \n $GLOBALS['labelDates'] = array();\n // Declare an empty array \n $dates = array(); \n \n // Variable that store the date interval \n // of period 1 day \n $interval = new DateInterval('P1D'); \n \n $realEnd = new DateTime($end); \n $realEnd->add($interval); \n \n $period = new DatePeriod(new DateTime($start), $interval, $realEnd); \n // Use loop to store date into array \n foreach($period as $date) { \n $dates[] = $date->format($format); \n if($date->format($format) == date('Y-m-d'))\n $GLOBALS['labelDates'][] = \"Today\";\n else\n $GLOBALS['labelDates'][] = $date->format('M-d');\n } \n $dates = array_reverse($dates) ;\n $GLOBALS['labelDates'] = array_reverse( $GLOBALS['labelDates']) ;\n\n \n \n // Return the array elements \n return $dates; \n }", "public static function fillMissingDateArrayKeys(array $array)\n {\n if (empty($array)) {\n return [];\n }\n $formatLength = strlen(array_key_first($array));\n\n switch ($formatLength) {\n case 4:\n $format = 'Y';\n $step = 'year';\n break;\n case 7:\n $format = 'Y-m';\n $step = 'month';\n break;\n case 10:\n $format = 'Y-m-d';\n $step = 'day';\n break;\n default:\n throw new \\InvalidArgumentException(\n 'The keys must be dates in one of the following formats: `Y`, `Y-m`, or `Y-m-d`. `'\n . array_key_first($array)\n . '` was provided.'\n );\n }\n\n $start = strtotime(array_key_first($array));\n $current = $start;\n $end = strtotime(array_key_last($array));\n $newArray = [];\n $defaultValue = (is_array(reset($array))) ? [] : 0;\n while ($current < $end) {\n $newArray[date($format, $current)] = $defaultValue;\n $current = strtotime(\"+1 $step\", $current);\n }\n\n return array_merge($newArray, $array);\n }", "public function reset() {\n\t\t$this->start = $this->end = [];\n\t}", "protected function build_month_calendar(&$tpl_var)\n {\n global $page, $lang, $conf;\n\n $query='SELECT '.pwg_db_get_dayofmonth($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $items=array();\n $result = pwg_query($query);\n while ($row = pwg_db_fetch_assoc($result))\n {\n $d = (int)$row['period'];\n $items[$d] = array('nb_images'=>$row['count']);\n }\n\n foreach ( $items as $day=>$data)\n {\n $page['chronology_date'][CDAY]=$day;\n $query = '\n SELECT id, file,representative_ext,path,width,height,rotation, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n ORDER BY '.DB_RANDOM_FUNCTION.'()\n LIMIT 1';\n unset ( $page['chronology_date'][CDAY] );\n\n $row = pwg_db_fetch_assoc(pwg_query($query));\n $derivative = new DerivativeImage(IMG_SQUARE, new SrcImage($row));\n $items[$day]['derivative'] = $derivative;\n $items[$day]['file'] = $row['file'];\n $items[$day]['dow'] = $row['dow'];\n }\n\n if ( !empty($items) )\n {\n list($known_day) = array_keys($items);\n $known_dow = $items[$known_day]['dow'];\n $first_day_dow = ($known_dow-($known_day-1))%7;\n if ($first_day_dow<0)\n {\n $first_day_dow += 7;\n }\n //first_day_dow = week day corresponding to the first day of this month\n $wday_labels = $lang['day'];\n\n if ('monday' == $conf['week_starts_on'])\n {\n if ($first_day_dow==0)\n {\n $first_day_dow = 6;\n }\n else\n {\n $first_day_dow -= 1;\n }\n\n $wday_labels[] = array_shift($wday_labels);\n }\n\n list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;\n\n $tpl_weeks = array();\n $tpl_crt_week = array();\n\n //fill the empty days in the week before first day of this month\n for ($i=0; $i<$first_day_dow; $i++)\n {\n $tpl_crt_week[] = array();\n }\n\n for ( $day = 1;\n $day <= $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR], $page['chronology_date'][CMONTH]\n );\n $day++)\n {\n $dow = ($first_day_dow + $day-1)%7;\n if ($dow==0 and $day!=1)\n {\n $tpl_weeks[] = $tpl_crt_week; // add finished week to week list\n $tpl_crt_week = array(); // start new week\n }\n\n if ( !isset($items[$day]) )\n {// empty day\n $tpl_crt_week[] =\n array(\n 'DAY' => $day\n );\n }\n else\n {\n $url = duplicate_index_url(\n array(\n 'chronology_date' =>\n array(\n $page['chronology_date'][CYEAR],\n $page['chronology_date'][CMONTH],\n $day\n )\n )\n );\n\n $tpl_crt_week[] =\n array(\n 'DAY' => $day,\n 'DOW' => $dow,\n 'NB_ELEMENTS' => $items[$day]['nb_images'],\n 'IMAGE' => $items[$day]['derivative']->get_url(),\n 'U_IMG_LINK' => $url,\n 'IMAGE_ALT' => $items[$day]['file'],\n );\n }\n }\n //fill the empty days in the week after the last day of this month\n while ( $dow<6 )\n {\n $tpl_crt_week[] = array();\n $dow++;\n }\n $tpl_weeks[] = $tpl_crt_week;\n\n $tpl_var['month_view'] =\n array(\n 'CELL_WIDTH' => $cell_width,\n 'CELL_HEIGHT' => $cell_height,\n 'wday_labels' => $wday_labels,\n 'weeks' => $tpl_weeks,\n );\n }\n\n return true;\n }", "static function add_bod_nom_start(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_nom_start, [\r\n\t\t\t'label' => 'Nomination period start',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 2 @ 9 a.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "public function daysOfMonthProvider(): array\n {\n return [\n // Time Days Match?\n ['1st January', [1], true],\n ['2nd January', [1], false],\n ['2nd January', [2], true],\n ['2nd January', [1, 2], true],\n ['31st January', [1, 8, 23, 31], true],\n ['29th February 2020', [29], true],\n ];\n }", "function reload_all_counts(){\n\t$month = 9;\n\t$year = 2004;\n\n\t$endmonth = date('n');\n\t$endyear = date('Y');\n\n\twhile (($month < $endmonth and $year <= $endyear) or $year < $endyear){\n\t\treload_counts($month,$year);\n\t\t$month++;\n\t\tif ($month > 12){\n\t\t\t$month = 1;\n\t\t\t$year++;\n\t\t}\n\t}\n}", "public function ga_calendar_prev_month()\n {\n $current_date = isset($_POST['current_month']) ? esc_html($_POST['current_month']) : '';\n $service_id = isset($_POST['service_id']) ? (int) $_POST['service_id'] : 0;\n $provider_id = isset($_POST['provider_id']) && 'ga_providers' == get_post_type($_POST['provider_id']) ? (int) $_POST['provider_id'] : 0;\n $form_id = isset($_POST['form_id']) ? (int) $_POST['form_id'] : 0;\n\n if ('ga_services' == get_post_type($service_id) && ga_valid_year_month_format($current_date)) {\n $timezone = ga_time_zone();\n\n $date = new DateTime($current_date, new DateTimeZone($timezone));\n $date->modify('-1 month');\n\n $ga_calendar = new GA_Calendar($form_id, $date->format('n'), $date->format('Y'), $service_id, $provider_id);\n echo $ga_calendar->show();\n } else {\n wp_die(\"Something went wrong.\");\n }\n\n wp_die(); // Don't forget to stop execution afterward.\n }" ]
[ "0.6746664", "0.6631151", "0.6227279", "0.6015293", "0.5929362", "0.5886088", "0.5858518", "0.5784595", "0.5748587", "0.57197934", "0.57119304", "0.5710816", "0.57087296", "0.56523407", "0.56404144", "0.5566514", "0.5531001", "0.548413", "0.5470734", "0.54680187", "0.54668605", "0.54612434", "0.5434882", "0.5428361", "0.54283243", "0.54150194", "0.54082274", "0.5381465", "0.53691566", "0.53625953", "0.5362531", "0.5357684", "0.5342029", "0.53243387", "0.52436036", "0.52416193", "0.5234573", "0.52186763", "0.52002466", "0.5179899", "0.5115254", "0.50864327", "0.50712746", "0.50589544", "0.50585407", "0.50484955", "0.50474197", "0.5041291", "0.50212437", "0.5010383", "0.50093293", "0.5005716", "0.50018847", "0.499042", "0.49855092", "0.4984252", "0.4982401", "0.49723074", "0.49696863", "0.496711", "0.49548155", "0.4949333", "0.49341822", "0.49118295", "0.49094158", "0.49086517", "0.4892476", "0.48902753", "0.4889589", "0.4881031", "0.4880105", "0.4872904", "0.48678565", "0.48611382", "0.4858039", "0.48546305", "0.48519778", "0.48483", "0.48470193", "0.48469326", "0.4841738", "0.48407266", "0.4840389", "0.48364732", "0.48335537", "0.4829182", "0.48270163", "0.48010984", "0.47950408", "0.4794261", "0.47830197", "0.47740898", "0.47689033", "0.47639942", "0.4757223", "0.47464108", "0.47409666", "0.47344065", "0.47285733", "0.4727005" ]
0.5780536
8
/ Algorithm: 1. Get notification settings 2. Get to know who to notify (array of users) 3. Iterate users 3.1 Send Browser notification 3.2 Send Email notification
public function notifyViaEmailOrBrowser(EventTrigger $eventTrigger) { // Getting permissions for particular event $sql = 'Select * from notifications_manage WHERE event_id=:event_id AND (email="1" OR browser="1")'; $notifications = NotificationsManage::findBySql($sql, [':event_id' => $eventTrigger->event_id])->all(); foreach ($notifications as $notification) { switch ($notification['role']) { case 'admin': $eventNotificationTypes = $this->getEventNotificationTypes($eventTrigger->event_id, 'admin'); if (!$eventNotificationTypes['browser'] && !$eventNotificationTypes['email']) { break; } else { // EAGER LOADING // Select all users that have role -> admin and allowed to send them email notifications $admins = $this->returnUsersWithNotificationsOnByGroup('admin'); $this->determinEventType($eventTrigger, $admins, 'admin', $eventNotificationTypes); break; } case 'moderator': $eventNotificationTypes = $this->getEventNotificationTypes($eventTrigger->event_id, 'moderator'); if (!$eventNotificationTypes['browser'] && !$eventNotificationTypes['email']) { break; } else { // EAGER LOADING // Select all users that have role -> moderator and allowed to send them email notifications $moderators = $this->returnUsersWithNotificationsOnByGroup('moderator'); $this->determinEventType($eventTrigger, $moderators, 'moderator', $eventNotificationTypes); break; } case 'registeredUser': $eventNotificationTypes = $this->getEventNotificationTypes($eventTrigger->event_id, 'registeredUser'); if (!$eventNotificationTypes['browser'] && !$eventNotificationTypes['email']) { break; } else { // EAGER LOADING // Select all users that have role -> registeredUser and allowed to send them email notifications $registeredUsers = $this->returnUsersWithNotificationsOnByGroup('registeredUser'); $this->determinEventType($eventTrigger, $registeredUsers, 'registeredUser', $eventNotificationTypes); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _send_email_notifications () {\n// TODO\n/*\n\t\tif (module('forum')->SETTINGS['SEND_NOTIFY_EMAILS']) return false;\n\t\t// Get emails to process\n\t\t$Q5 = db()->query('SELECT * FROM '.db('forum_email_notify').' WHERE topic_id='.intval($topic_info['id']));\n\t\twhile ($A5 = db()->fetch_assoc($Q5)) if (!FORUM_USER_ID || (FORUM_USER_ID != $A5['user_id'])) $notify_user_ids[$A5['user_id']] = $A5['user_id'];\n\t\tif (is_array($notify_user_ids) && count($notify_user_ids)) {\n\t\t\t// Process users that wanted to receive notifications for this topic\n\t\t\t$topic_name\t\t= $this->BB_OBJ->_process_text($topic_info['name']);\n\t\t\t$post_text\t\t= $this->BB_OBJ->_process_text(_substr($_POST['text'], 0, 100)).'...';\n\t\t\t$view_topic_url\t= process_url('./?object=forum&action=view_topic&id='.$topic_info['id']);\n\t\t\t$dont_notify_url= process_url('./?object=forum&action=notify_me&id='.$topic_info['id']);\n\t\t\t// Get users details\n\t\t\t$Q6 = db()->query('SELECT user_email AS `0`, name AS 1 FROM '.db('forum_users').' WHERE id IN('.implode(',', $notify_user_ids).') AND status='a'');\n\t\t\twhile (list($notify_email, $user_login) = db()->fetch_assoc($Q6)) {\n\t\t\t\t$replace = array(\n\t\t\t\t\t'notify_email'\t\t=> $notify_email,\n\t\t\t\t\t'user_name'\t\t\t=> _prepare_html($user_login),\n\t\t\t\t\t'topic_name'\t\t=> $topic_name,\n\t\t\t\t\t'post_text'\t\t\t=> $post_text,\n\t\t\t\t\t'view_topic_url'\t=> $view_topic_url,\n\t\t\t\t\t'dont_notify_url'\t=> $dont_notify_url,\n\t\t\t\t\t'website'\t\t\t=> conf('website_name'),\n\t\t\t\t);\n\t\t\t\t$text = tpl()->parse('forum'.'/emails/post_notify', $replace);\n\t\t\t\tcommon()->send_mail(module('forum')->SETTINGS['ADMIN_EMAIL_FROM'], t('administrator').' '.conf('website_name'), $notify_email, $user_login, t('Post_Notification'), $text, $text);\n\t\t\t}\n\t\t}\n\t\t// Save user notification\n\t\tif (FORUM_USER_ID && $_POST['email_notify']) {\n\t\t\tdb()->query('REPLACE INTO '.db('forum_email_notify').' VALUES ('.intval(FORUM_USER_ID).', '.intval($topic_info['id']).', '.time().')');\n\t\t}\n*/\n\t}", "function send_notification_mail($notification_array){\n\t\n\t$type = $notification_array['type'];\n\t\n\t//To send follow notification email\t\n\tif($type === 'follow'){\n\t\t\n\t\t$following_username = $notification_array['following_username'];\n\t\t$followed_username = $notification_array['followed_username'];\n\t\t$to_email = $followed_email = $notification_array['followed_email'];\n\t\n\t}\n\t//To send comment notification email\t\n\telseif($type === 'comment'){\n\t\t\n\t\t$commentAuthorUsername = $notification_array['commentAuthorUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t//To send like notification email\t\n\telseif($type === 'like'){\n\t\t\n\t\t$likerUsername = $notification_array['likerUsername'];\n\t\t$postAuthorUsername = $notification_array['postAuthorUsername'];\n\t\t$to_email = $postAuthorEmail = $notification_array['postAuthorEmail'];\n\t}\n\t\n\tob_start();\n\tinclude('email_templates/notification.php');\n\t$notification_template = ob_get_contents();\t\t\t\n\tob_end_clean();\n\t\n\t\n\t\n\t$to = '[email protected]'; \n\t/*$to = $to_email; //please uncomment this when in live*/\n\t$strSubject = \"Notification mail\";\n\t$message = $notification_template; \n\t$headers = 'MIME-Version: 1.0'.\"\\r\\n\";\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1'.\"\\r\\n\";\n\t$headers .= \"From: [email protected]\"; \n\t\n\tif(mail($to, $strSubject, $message, $headers)){\n\t\treturn 'Mail send successfully';\n\t}else{\n\t\treturn 'Could not send email';\n\t} \n\t\n}", "function send_notification($user,$i) {\r\n # get PO1 email address\r\n # @$po_num = string, po1, po2, po3\r\n $usrmgr = instantiate_module('usrmgr');\r\n $row = $usrmgr->get_row(array('username'=>$user));\r\n assert($row);\r\n $row['email'];\r\n\r\n $h = array();\r\n $h['from'] = $GLOBALS['mail_from'];\r\n $h['to'] = $row['email'];\r\n $h['subject'] = 'PO3 Has not accept new project after 7 days from partner '.$this->ds->partner_id[$i];\r\n $h['body'] = <<<__END__\r\nHello $user, PO3 has not accepted this project entered by Partner {$this->ds->partner_id[$i]}\r\n\r\nRegistration Number: {$this->ds->project_id[$i]}\r\nProject Name: {$this->ds->name[$i]}\r\n\r\n--\r\n dswbot\r\n\r\n__END__;\r\n\r\n supermailer($h);\r\n\r\n\r\n }", "protected function sendNotification(){\n\t\t$events = Event::getEvents(0);\n\t\t\n\t\t\n\t\tforeach($events as $event)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$eventType = $event['eventType'];\n\t\t\t$message = '';\n\t\t\n\t\t\t//notify followers\n\t\t\tif($eventType == Event::POST_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' added a new post.';\n\t\t\telse if($eventType == Event::POST_LIKED)\n\t\t\t\t$message = $event['raiserName'] . ' liked a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t$message = $event['raiserName'] . ' flagged a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' commented on a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::RESTAURANT_MARKED_FAVOURITE)\n\t\t\t\t$message = $event['raiserName'] . ' marked a restaurant as favourite.';\n\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t$message = $event['raiserName'] . ' is now following ' . $event['relatedUserName'];\n\t\t\n\t\t\tif(!empty($message))\n\t\t\t{\n\t\t\t\t//fetch all followers of the event raiser or related user\n\t\t\t\t$sql = Follower::getQueryForFollower($event['raiserId']);\n\t\t\n\t\t\t\tif($event['relatedUserId'])\n\t\t\t\t\t$sql .= ' OR f.followedUserId =' . $event['relatedUserId'];\n\t\t\n// \t\t\t\t$followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// \t\t\t\tforeach($followers as $follower)\n// \t\t\t\t{\n// \t\t\t\t\tif($follower['id'] != $event['raiserId'] && $follower['id'] != $event['relatedUserId'])\n// \t\t\t\t\t{\n// // \t\t\t\t\t\t$did = Notification::saveNotification($follower['id'], Notification::NOTIFICATION_GROUP_WORLD, $message, $event['id']);\n// // \t\t\t\t\t\terror_log('DID : => '.$did);\n// \t\t\t\t\t\t//send push notification\n// \t\t\t\t\t\t/**----- commented as no followers will be notified, as suggested by the client\n// \t\t\t\t\t\t$session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// \t\t\t\t\t\tif($session)\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t$session->deviceBadge += 1;\n// \t\t\t\t\t\t$session->save();\n// \t\t\t\t\t\tsendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// \t\t\t\t\t\t}\n// \t\t\t\t\t\t*****/\n// \t\t\t\t\t}\n// \t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//notify the related user\n\t\t\tif($event['relatedUserId'] && $event['relatedUserId'] != $event['raiserId'])\n\t\t\t{\n\t\t\t\tif($eventType == Event::POST_LIKED)\n\t\t\t\t\t$message = $event['raiserName'] . ' liked your post.';\n\t\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t\t$message = $event['raiserName'] . ' flagged your post.';\n\t\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t\t$message = $event['raiserName'] . ' commented on your post.';\n\t\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t\t$message = $event['raiserName'] . ' is now following you.';\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_COMMENT){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a comment.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_POST){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a post.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($message))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\t\t\t\t\t$session = Session::model()->findByAttributes(array('userId'=>$event['relatedUserId']));\n// \t\t\t\t\terror_log('SESSION_LOG : '. print_r( $session, true ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!is_null($session) && !empty($session) && $session->deviceToken)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$notifyData = array(\n// \t\t\t\t\t\t\t\t\"id\" => $notfyId,\n// \t\t\t\t\t\t\t\t\"receiverId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"notificationGroup\" => Notification::NOTIFICATION_GROUP_YOU,\n\t\t\t\t\t\t\t\t\"alert\" => $message,\n// \t\t\t\t\t\t\t\t\"eventId\" => $event['id'],\n// \t\t\t\t\t\t\t\t\"isSeen\" => \"0\",\n\t\t\t\t\t\t\t\t\"eventType\" => $eventType,\n// \t\t\t\t\t\t\t\t\"raiserId\" => $event['raiserId'],\n// \t\t\t\t\t\t\t\t\"raiserName\" => $event['raiserName'],\n// \t\t\t\t\t\t\t\t\"relatedUserId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"relatedUserName\" => $event['relatedUserName'],\n\t\t\t\t\t\t\t\t\"elementId\" => $event['elementId'],\n\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n// \t\t\t\t\t\t\t\t\"isNotified\" => $event['isNotified'],\n\t\t\t\t\t\t\t\t'badge' => $session->deviceBadge,\n\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo 'Notify Data : ';\n// \t\t\t\t\t\tprint_r($notifyData);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$session->deviceBadge += 1;\n\t\t\t\t\t\t$session->save();\n\t\t\t\t\t\tsendApnsNotification($session->deviceToken, $message, $session->deviceBadge, $notifyData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}elseif( isset($event['message']) && $event['message'] !=null){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$devices = array();\n\t\t\t\t$sql = 'SELECT id, deviceToken, deviceBadge from session where role=\"manager\"';\n\t\t\t\t\n\t\t\t $rows = Yii::app()->db->createCommand($sql)->queryAll(true);\n\t\t \t$chunk=1;\t\t \n\t\t \n\t\t\t\tforeach ($rows as $row){\n\t\t\t\t\t$devices[] = array(\n\t\t\t\t\t\t\t'deviceToken'=>$row['deviceToken'],\n\t\t\t\t\t\t\t'notifyData' => array('aps'=> array(\n\t\t\t\t\t\t\t\t\t\"alert\" => $event['message'],\n\t\t\t\t\t\t\t\t\t\"eventType\" => $event['eventType'],\n\t\t\t\t\t\t\t\t\t\"elementId\" => $event['id'],\n\t\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n\t\t\t\t\t\t\t\t\t'badge' => $row['deviceBadge'],\n\t\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\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\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($chunk > 4){\n\t\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\t\t$chunk=1;\n\t\t\t\t\t\t$devices = array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$chunk++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($devices)){\n\t\t\t\t\techo 'Sending...'.date(DATE_RFC850).\"\\n\";\n\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\techo 'done '.date(DATE_RFC850).\"\\n\";\n\t\t\t\t}\n// \t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\n// \t\t\t\t$insertSql = 'INSERT into notification (receiverId, notificationGroup, message, eventId) (select id, \"1\", \"'.$event['message'].'\", '.$event['id'].' from user where isDisabled = 0 and role=\"manager\")';\n// \t\t\t\tYii::app()->db->createCommand($insertSql)->query();\n\t\t\t\t\n\t\t\t}\n\t\t\tEvent::model()->updateByPk($event['id'], array('isNotified'=>1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function sendNotificationToUsers($userTokens, $notification){\n $notification->sendNotification($userTokens, \"Answer some questions\", \"Don't forget to check out the new questionnaire today\");\n}", "public static function sendUserNotification()\n {\n $con = $GLOBALS[\"con\"];\n $sqlGetCount = \"SELECT staff_id, notification_counter from user\";\n $result = mysqli_query($con, $sqlGetCount);\n while ($row = mysqli_fetch_assoc($result)) {\n $count = 1;\n $count += (int)$row['notification_counter'];\n $user = $row['staff_id'];\n $sqlAddCount = \"update user set notification_counter = $count where staff_id = $user\";\n mysqli_query($con, $sqlAddCount);\n }\n }", "public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }", "function wp_send_new_user_notifications($user_id, $notify = 'both')\n {\n }", "public function sendNotificationQueue() {\n foreach ($this->_NotificationQueue as $userID => $notifications) {\n if (is_array($notifications)) {\n // Only send out one notification per user.\n $notification = $notifications[0];\n\n /* @var Gdn_Email $Email */\n $email = $notification['Email'];\n\n if (is_object($email) && method_exists($email, 'send')) {\n $this->EventArguments = $notification;\n $this->fireEvent('BeforeSendNotification');\n\n try {\n // Only send if the user is not banned\n $user = Gdn::userModel()->getID($userID);\n if (!val('Banned', $user)) {\n $email->send();\n $emailed = self::SENT_OK;\n } else {\n $emailed = self::SENT_SKIPPED;\n }\n } catch (phpmailerException $pex) {\n if ($pex->getCode() == PHPMailer::STOP_CRITICAL && !$email->PhpMailer->isServerError($pex)) {\n $emailed = self::SENT_FAIL;\n } else {\n $emailed = self::SENT_ERROR;\n }\n } catch (Exception $ex) {\n switch ($ex->getCode()) {\n case Gdn_Email::ERR_SKIPPED:\n $emailed = self::SENT_SKIPPED;\n break;\n default:\n $emailed = self::SENT_FAIL;\n }\n }\n\n try {\n $this->SQL->put('Activity', ['Emailed' => $emailed], ['ActivityID' => $notification['ActivityID']]);\n } catch (Exception $ex) {\n // Ignore an exception in a behind-the-scenes notification.\n }\n }\n }\n }\n\n // Clear out the queue\n unset($this->_NotificationQueue);\n $this->_NotificationQueue = [];\n }", "protected function notifyByEmail() {\n\t\t$userlist = array();\n\n\t\t// find all the users with this server listed\n\t\t$users = $this->db->select(\n\t\t\tSM_DB_PREFIX . 'users',\n\t\t\t'FIND_IN_SET(\\''.$this->server['server_id'].'\\', `server_id`) AND `email` != \\'\\'',\n\t\t\tarray('user_id', 'name', 'email')\n\t\t);\n\n\t\tif (empty($users)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build mail object with some default values\n\t\t$mail = new phpmailer();\n\n\t\t$mail->From\t\t= sm_get_conf('email_from_email');\n\t\t$mail->FromName\t= sm_get_conf('email_from_name');\n\t\t$mail->Subject\t= sm_parse_msg($this->status_new, 'email_subject', $this->server);\n\t\t$mail->Priority\t= 1;\n\n\t\t$body = sm_parse_msg($this->status_new, 'email_body', $this->server);\n\t\t$mail->Body\t\t= $body;\n\t\t$mail->AltBody\t= str_replace('<br/>', \"\\n\", $body);\n\n\t\t// go through empl\n\t foreach ($users as $user) {\n\t \t// we sent a seperate email to every single user.\n\t \t$userlist[] = $user['user_id'];\n\t \t$mail->AddAddress($user['email'], $user['name']);\n\t \t$mail->Send();\n\t \t$mail->ClearAddresses();\n\t }\n\n\t if(sm_get_conf('log_email')) {\n\t \t// save to log\n\t \tsm_add_log($this->server['server_id'], 'email', $body, implode(',', $userlist));\n\t }\n\t}", "function checkForEmailNotification($kind, $picture_id)\n{\n $userManager = new UserManager();\n $pictureManager = new PictureManager();\n\n $users = $userManager->getUsers();\n $pictures = $pictureManager->getPictures(\"\");\n\n $user = $users->fetchAll();\n $picture = $pictures->fetchAll();\n\n if ($user && $picture && $kind != '' && $picture_id > 0)\n {\n for ($i = 0; $picture[$i]; $i++)\n {\n if ($picture_id == $picture[$i]['picture_id'])\n {\n $picture_was_taken_by = $picture[$i]['user_id'];\n }\n }\n for ($i = 0; $user[$i]; $i++)\n {\n if ($picture_was_taken_by == $user[$i]['user_id'])\n {\n if ($user[$i]['notifications'] == 1)\n {\n $name = $user[$i]['user_name'];\n $email = $user[$i]['user_email'];\n sendNotificationEmail($kind, $name, $email, $picture_id); \n }\n }\n }\n }\n}", "function notify_user($to, $from, $subject, $message, array $params = NULL, $methods_override = \"\") {\n\tglobal $NOTIFICATION_HANDLERS;\n\n\t// Sanitise\n\tif (!is_array($to)) {\n\t\t$to = array((int)$to);\n\t}\n\t$from = (int)$from;\n\t//$subject = sanitise_string($subject);\n\n\t// Get notification methods\n\tif (($methods_override) && (!is_array($methods_override))) {\n\t\t$methods_override = array($methods_override);\n\t}\n\n\t$result = array();\n\n\tforeach ($to as $guid) {\n\t\t// Results for a user are...\n\t\t$result[$guid] = array();\n\n\t\tif ($guid) { // Is the guid > 0?\n\t\t\t// Are we overriding delivery?\n\t\t\t$methods = $methods_override;\n\t\t\tif (!$methods) {\n\t\t\t\t$tmp = (array)get_user_notification_settings($guid);\n\t\t\t\t$methods = array();\n\t\t\t\tforeach ($tmp as $k => $v) {\n\t\t\t\t\t// Add method if method is turned on for user!\n\t\t\t\t\tif ($v) {\n\t\t\t\t\t\t$methods[] = $k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($methods) {\n\t\t\t\t// Deliver\n\t\t\t\tforeach ($methods as $method) {\n\n\t\t\t\t\tif (!isset($NOTIFICATION_HANDLERS[$method])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Extract method details from list\n\t\t\t\t\t$details = $NOTIFICATION_HANDLERS[$method];\n\t\t\t\t\t$handler = $details->handler;\n\t\t\t\t\t/* @var callable $handler */\n\n\t\t\t\t\tif ((!$NOTIFICATION_HANDLERS[$method]) || (!$handler) || (!is_callable($handler))) {\n\t\t\t\t\t\terror_log(elgg_echo('NotificationException:NoHandlerFound', array($method)));\n\t\t\t\t\t}\n\n\t\t\t\t\telgg_log(\"Sending message to $guid using $method\");\n\n\t\t\t\t\t// Trigger handler and retrieve result.\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$result[$guid][$method] = call_user_func($handler,\n\t\t\t\t\t\t\t$from ? get_entity($from) : NULL, \t// From entity\n\t\t\t\t\t\t\tget_entity($guid), \t\t\t\t\t// To entity\n\t\t\t\t\t\t\t$subject,\t\t\t\t\t\t\t// The subject\n\t\t\t\t\t\t\t$message, \t\t\t// Message\n\t\t\t\t\t\t\t$params\t\t\t\t\t\t\t\t// Params\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\terror_log($e->getMessage());\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $result;\n}", "public function notifications() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n \n $notifications = $this->notifications->get_notifications($this->user_id);\n \n // Load view/user/notifications.php file\n $this->body = 'user/notifications';\n $this->content = ['notifications' => $notifications];\n $this->user_layout();\n \n }", "public function index()\r\n {\r\n if (!auth()->user()->can('send_notification')) {\r\n abort(403, 'Unauthorized action.');\r\n }\r\n\r\n $business_id = request()->session()->get('user.business_id');\r\n\r\n $customer_notifications = NotificationTemplate::customerNotifications();\r\n\r\n $module_customer_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'customer']);\r\n\r\n if (!empty($module_customer_notifications)) {\r\n foreach ($module_customer_notifications as $module_customer_notification) {\r\n $customer_notifications = array_merge($customer_notifications, $module_customer_notification);\r\n }\r\n }\r\n\r\n foreach ($customer_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $customer_notifications[$key]['subject'] = $notification_template['subject'];\r\n $customer_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $customer_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $customer_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $customer_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $supplier_notifications = NotificationTemplate::supplierNotifications();\r\n\r\n $module_supplier_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'supplier']);\r\n\r\n if (!empty($module_supplier_notifications)) {\r\n foreach ($module_supplier_notifications as $module_supplier_notification) {\r\n $supplier_notifications = array_merge($supplier_notifications, $module_supplier_notification);\r\n }\r\n }\r\n\r\n foreach ($supplier_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $supplier_notifications[$key]['subject'] = $notification_template['subject'];\r\n $supplier_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $supplier_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $supplier_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $supplier_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n\r\n $business_notifications = NotificationTemplate::businessNotifications();\r\n\r\n $module_business_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'business']);\r\n\r\n if (!empty($module_business_notifications)) {\r\n foreach ($module_business_notifications as $module_business_notification) {\r\n $business_notifications = array_merge($business_notifications, $module_business_notification);\r\n }\r\n }\r\n\r\n foreach ($business_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $business_notifications[$key]['subject'] = $notification_template['subject'];\r\n $business_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $business_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $business_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $business_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $tags = NotificationTemplate::notificationTags();\r\n\r\n return view('notification_template.index')\r\n ->with(compact('customer_notifications', 'supplier_notifications', 'business_notifications', 'tags'));\r\n }", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }", "function ihc_send_user_notifications($u_id=FALSE, $notification_type='', $l_id=FALSE, $dynamic_data=array(), $subject='', $message=''){\n\tglobal $wpdb;\n\t$sent = FALSE;\n\tif ($u_id && $notification_type){\n\t\t$admin_case = array(\n\t\t\t\t\t\t\t'admin_user_register',\n\t\t\t\t\t\t\t'admin_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_second_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_third_before_user_expire_level',\n\t\t\t\t\t\t\t'admin_user_expire_level',\n\t\t\t\t\t\t\t'admin_user_payment',\n\t\t\t\t\t\t\t'admin_user_profile_update',\n\t\t\t\t\t\t\t'ihc_cancel_subscription_notification-admin',\n\t\t\t\t\t\t\t'ihc_delete_subscription_notification-admin',\n\t\t\t\t\t\t\t'ihc_order_placed_notification-admin',\n\t\t\t\t\t\t\t'ihc_new_subscription_assign_notification-admin',\n\t\t);\n\n\t\tif (empty($subject) || empty($message)){ /// SEARCH INTO DB FOR NOTIFICATION TEMPLATE\n\t\t\tif ($l_id!==FALSE && $l_id>-1){\n\t\t\t\t$q = $wpdb->prepare(\"SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM \" . $wpdb->prefix . \"ihc_notifications\n\t\t\t\t\t\t\t\t\t\tWHERE 1=1\n\t\t\t\t\t\t\t\t\t\tAND notification_type=%s\n\t\t\t\t\t\t\t\t\t\tAND level_id=%d\n\t\t\t\t\t\t\t\t\t\tORDER BY id DESC LIMIT 1;\", $notification_type, $l_id);\n\t\t\t\t$data = $wpdb->get_row($q);\n\t\t\t\tif ($data){\n\t\t\t\t\t\t$subject = @$data->subject;\n\t\t\t\t\t\t$message = @$data->message;\n\n\t\t\t\t\t\t$domain = 'ihc';\n\t\t\t\t\t\t$languageCode = get_user_meta( $u_id, 'ihc_locale_code', true );\n\t\t\t\t\t\t$wmplName = $notification_type . '_title_' . $l_id;\n\t\t\t\t\t\t$subject = apply_filters( 'wpml_translate_single_string', $subject, $domain, $wmplName, $languageCode );\n\t\t\t\t\t\t$wmplName = $notification_type . '_message_' . $l_id;\n\t\t\t\t\t\t$message = apply_filters( 'wpml_translate_single_string', $message, $domain, $wmplName, $languageCode );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($l_id===FALSE || $l_id==-1 || empty($data)){\n\t\t\t\t$q = $wpdb->prepare(\"SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM \" . $wpdb->prefix . \"ihc_notifications\n\t\t\t\t\t\t\t\t\t\tWHERE 1=1\n\t\t\t\t\t\t\t\t\t\tAND notification_type=%s\n\t\t\t\t\t\t\t\t\t\tAND level_id='-1'\n\t\t\t\t\t\t\t\t\t\tORDER BY id DESC LIMIT 1;\", $notification_type);\n\t\t\t\t$data = $wpdb->get_row($q);\n\t\t\t\tif ($data){\n\t\t\t\t\t\t$subject = @$data->subject;\n\t\t\t\t\t\t$message = @$data->message;\n\n\t\t\t\t\t\t$domain = 'ihc';\n\t\t\t\t\t\t$languageCode = get_user_meta( $u_id, 'ihc_locale_code', true );\n\t\t\t\t\t\t$wmplName = $notification_type . '_title_-1';\n\t\t\t\t\t\t$subject = apply_filters( 'wpml_translate_single_string', $subject, $domain, $wmplName, $languageCode );\n\t\t\t\t\t\t$wmplName = $notification_type . '_message_-1';\n\t\t\t\t\t\t$message = apply_filters( 'wpml_translate_single_string', $message, $domain, $wmplName, $languageCode );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($message)){\n\t\t\t$from_name = get_option('ihc_notification_name');\n\t\t\tif (!$from_name){\n\t\t\t\t$from_name = get_option(\"blogname\");\n\t\t\t}\n\t\t\t//user levels\n\t\t\t$level_list_data = get_user_meta($u_id, 'ihc_user_levels', true);\n\t\t\tif (isset($level_list_data)){\n\t\t\t\t$level_list_data = explode(',', $level_list_data);\n\t\t\t\tforeach ($level_list_data as $id){\n\t\t\t\t\t$temp_level_data = ihc_get_level_by_id($id);\n\t\t\t\t\t$level_list_arr[] = $temp_level_data['label'];\n\t\t\t\t}\n\t\t\t\tif ($level_list_arr){\n\t\t\t\t\t$level_list = implode(',', $level_list_arr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//user data\n\t\t\t$u_data = get_userdata($u_id);\n\t\t\t$user_email = '';\n\t\t\tif ($u_data && !empty($u_data->data) && !empty($u_data->data->user_email)){\n\t\t\t\t$user_email = $u_data->data->user_email;\n\t\t\t}\n\t\t\t//from email\n\t\t\t$from_email = get_option('ihc_notification_email_from');\n\t\t\tif (!$from_email){\n\t\t\t\t$from_email = get_option('admin_email');\n\t\t\t}\n\t\t\t$message = ihc_replace_constants($message, $u_id, $l_id, $l_id, $dynamic_data);\n\t\t\t$subject = ihc_replace_constants($subject, $u_id, $l_id, $l_id, $dynamic_data);\n\t\t\t$message = stripslashes(htmlspecialchars_decode(ihc_format_str_like_wp($message)));\n\t\t\t$message = apply_filters('ihc_send_notification_filter_message', $message, $u_id, $l_id, $notification_type);\n\t\t\t$message = \"<html><head></head><body>\" . $message . \"</body></html>\";\n\t\t\tif ($subject && $message && $user_email){\n\t\t\t\tif (in_array($notification_type, $admin_case)){\n\t\t\t\t\t/// SEND NOTIFICATION TO ADMIN, (we change the destination)\n\t\t\t\t\t$admin_email = get_option('ihc_notification_email_addresses');\n\t\t\t\t\tif (empty($admin_email)){\n\t\t\t\t\t\t$user_email = get_option('admin_email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user_email = $admin_email;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($from_email) && !empty($from_name)){\n\t\t\t\t\t$headers[] = \"From: $from_name <$from_email>\";\n\t\t\t\t}\n\t\t\t\t$headers[] = 'Content-Type: text/html; charset=UTF-8';\n\t\t\t\t$sent = wp_mail($user_email, $subject, $message, $headers);\n\t\t\t}\n\t\t}\n\t\t/// PUSHOVER\n\t\tif (ihc_is_magic_feat_active('pushover')){\n\t\t\t$send_to_admin = in_array($notification_type, $admin_case) ? TRUE : FALSE;\n\t\t\trequire_once IHC_PATH . 'classes/Ihc_Pushover.class.php';\n\t\t\t$pushover_object = new Ihc_Pushover();\n\t\t\t$pushover_object->send_notification($u_id, $l_id, $notification_type, $send_to_admin);\n\t\t}\n\t\t/// PUSHOVER\n\t}\n\treturn $sent;\n}", "public function sendPushNotificationToSpecificUsers($users, $job_id, $data, $msg_text, $is_need_delay);", "public function cron(){\n\n $servers = $this->getServers();\n $emails = Notification::all();\n \n foreach ($servers as $server){\n //Get the server metrics and thresholds\n $this->getServerThresholds( $server ); \n\n $msg = \"\";\n\n if( isset($server->warnings) && count($server->warnings) > 0 ){\n // Got the message\n foreach( $server->warnings as $warning){\n $msg[] = $warning ;\n }\n //Store the notification\n //Save notification on messages table\n $this->storeServerNotifications($msg, $server->id);\n \n //Get the users for notification\n foreach( $emails as $item){\n $user = User::where('email', $item->email )->first();\n $user->notify( new ServerThresholdReached( $msg ) ); \n }\n \n }\n\n //echo $server->name . \" / \" . implode(\",\",$msg) . \"<br/>\"; \n //Notify users of the issue \n }\n }", "public static function sendNotifications(): string\n\t{\n\t\tif (\n\t\t\tLoader::includeModule('imopenlines')\n\t\t\t&& Loader::includeModule('imconnector')\n\t\t\t&& Loader::includeModule('ui')\n\t\t)\n\t\t{\n\t\t\t$lineIds = [];\n\t\t\t$activeConnections = StatusConnectorsTable::getList([\n\t\t\t\t'select' => ['LINE'],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=CONNECTOR' => [\n\t\t\t\t\t\t'facebook',\n\t\t\t\t\t\t'fbinstagramdirect'\n\t\t\t\t\t],\n\t\t\t\t\t'=ACTIVE' => 'Y',\n\t\t\t\t\t'=CONNECTION' => 'Y',\n\t\t\t\t\t'=REGISTER' => 'Y',\n\t\t\t\t],\n\t\t\t]);\n\n\t\t\twhile ($activeConnection = $activeConnections->fetch())\n\t\t\t{\n\t\t\t\t$lineIds[] = $activeConnection['LINE'];\n\t\t\t}\n\n\t\t\tif (!empty($lineIds))\n\t\t\t{\n\t\t\t\tif (\n\t\t\t\t\tLoader::includeModule('bitrix24')\n\t\t\t\t\t&& Loader::includeModule('imbot')\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$userIds = [];\n\n\t\t\t\t\t$lineIds = array_unique($lineIds);\n\n\t\t\t\t\t$queueLine = ConfigTable::getList([\n\t\t\t\t\t\t'select' => ['MODIFY_USER_ID'],\n\t\t\t\t\t\t'filter' => [\n\t\t\t\t\t\t\t'=ID' => $lineIds,\n\t\t\t\t\t\t],\n\t\t\t\t\t]);\n\n\t\t\t\t\twhile ($row = $queueLine->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\t$userIds[] = $row['MODIFY_USER_ID'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (empty($userIds))\n\t\t\t\t\t{\n\t\t\t\t\t\t$userIds = ['ADMIN'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$admins = Support24::getAdministrators();\n\t\t\t\t\t\t$userIds = array_merge($userIds, $admins);\n\t\t\t\t\t\t$userIds = array_unique($userIds);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($userIds as $userId)\n\t\t\t\t\t{\n\t\t\t\t\t\tSupport24::sendMessage([\n\t\t\t\t\t\t\t'DIALOG_ID' => $userId,\n\t\t\t\t\t\t\t'MESSAGE' => Loc::getMessage('IMCONNECTOR_UPDATER_2112000_CHAT', [\n\t\t\t\t\t\t\t\t'#HREF#' => Util::getArticleUrlByCode(self::ID_ARTICLE_HELP_DESK),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t'SYSTEM' => 'N',\n\t\t\t\t\t\t\t'URL_PREVIEW' => 'N'\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{\n\t\t\t\t\t\\CAdminNotify::Add([\n\t\t\t\t\t\t'MODULE_ID' => 'imconnector',\n\t\t\t\t\t\t'ENABLE_CLOSE' => 'Y',\n\t\t\t\t\t\t'NOTIFY_TYPE' => \\CAdminNotify::TYPE_NORMAL,\n\t\t\t\t\t\t'MESSAGE' => Loc::getMessage('IMCONNECTOR_UPDATER_2112000_ADMIN_NOTIFY', [\n\t\t\t\t\t\t\t'#HREF#' => Util::getArticleUrlByCode(self::ID_ARTICLE_HELP_DESK),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}", "public function sendNotificationEmail(){\n $unsentNotifications = $this->unsentNotifications;\n $notificationCount = count($unsentNotifications);\n \n if($notificationCount > 0){\n //Send this employer all his \"unsent\" notifications \n if($this->employer_language_pref == \"en-US\"){\n //Set language based on preference stored in DB\n Yii::$app->view->params['isArabic'] = false;\n\n //Send English Email\n Yii::$app->mailer->compose([\n 'html' => \"employer/notification-html\",\n ], [\n 'employer' => $this,\n 'notifications' => $unsentNotifications,\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo([$this->employer_email])\n ->setSubject(\"[StudentHub] You've got $notificationCount new applicants!\")\n ->send();\n }else{\n //Set language based on preference stored in DB\n Yii::$app->view->params['isArabic'] = true;\n\n //Send Arabic Email\n Yii::$app->mailer->compose([\n 'html' => \"employer/notification-ar-html\",\n ], [\n 'employer' => $this,\n 'notifications' => $unsentNotifications,\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo([$this->employer_email])\n ->setSubject(\"[StudentHub] لقد حصلت على $notificationCount متقدمين جدد\")\n ->send();\n }\n \n \n return true;\n }\n \n return false;\n }", "public function getUserNotifications($user);", "function showUserNotifications($status,$limit){\n global $DB,$user_id;\n $limit;\n $sql = \"Select * from notifications where other_user_id=$user_id and status='$status' order by id desc limit $limit\";\n $res_data_notification = $DB->RunSelectQuery($sql);\n\n foreach ($res_data_notification as $result)\n {\n $notification_data = (array)$result;\n $date = date(\"Y-m-d\", strtotime($notification_data[\"notification_date\"]));\n ?>\n <?php\n// Added here by Nitin Soni for status\n\n /*\nSHow Notification for updated event\n */\n //IF NOTIFICATION TYPE IS update event/ping\n if ($notification_data[\"notification_type\"] == \"ping_updated\"|| $notification_data[\"notification_type\"] == \"event_updated\")\n {\n\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n ?>\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n <?php echo $var ?> <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> has been modified by organiser. Please review the changes.\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /*UPdate event/ping work completed here */\n\n /* Cancel Event/Ping started */\n //IF NOTIFICATION TYPE IS cancel event/ping\n if ($notification_data[\"notification_type\"] == \"Cancel Ping\"|| $notification_data[\"notification_type\"] == \"Cancel Event\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n <?php echo $var ?> <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> has been cancelled.</p>\n\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /* Completed cancel event/ping */\n\n\n\n /*Reorganize event started*/\n /* Cancel Event/Ping started */\n //IF NOTIFICATION TYPE IS cancel event/ping\n if ($notification_data[\"notification_type\"] == \"Event Reorganize\" || $notification_data[\"notification_type\"] == \"Ping Reorganize\")\n {\n\n /*echo \"Hello\";\n exit;*/\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n // 'event_status' => 'L'\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n <?php echo $var ?> <?php echo $event_type ?> <strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a></strong>\n has been reorganized.\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /*Completed here*/\n /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/\n /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/\n /*Completed event update work*/\n\n //IF NOTIFICATION TYPE IS A COMMENT\n if ($notification_data[\"notification_type\"] == \"C\")\n {\n\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $before_result = $DB->RunSelectQuery($sql);\n foreach ($before_result as $result)\n {\n $publicUserResult = (array)$result;\n if ($publicUserResult['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $publicUserResult[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n } ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $notification_data[\"$user_id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong> has commented on your <?php echo $event_type ?><strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a>&nbsp;</strong></p>\n <p id=\"notification-date\"><span class=\"has-noti-icon\"><img alt=\"notifocation-image\" src=\"images/comment_box.gif\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n\n//Completed work for show cancel Event notification\n\n //IF NOTIFICATION TYPE IS A COMMENT\n if ($notification_data[\"notification_type\"] == \"Comment\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n //Query is changed by Nitin Soni\n /* $sql = \"SELECT * from public_users where id=$user_id\";*/\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $before_result = $DB->RunSelectQuery($sql);\n foreach ($before_result as $result)\n {\n $PublicUserData = (array)$result;\n if ($PublicUserData['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $PublicUserData[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n } ?>\n </div>\n <!-- <div class=\"who-sent-notification\">\n <img alt=\"event-image\" src=\"images/profile_img.jpg\" class=\"image-has-radius\">\n </div> -->\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $notification_data[\"id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong> has commented on your <?php echo $event_type ?> <strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a>&nbsp;</strong></p>\n <p id=\"notification-date\"><span class=\"has-noti-icon\"><img alt=\"notifocation-image\" src=\"images/comment_box.gif\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n //IF NOTIFICATION TYPE IS AN ADD BUDDY\n if ($notification_data[\"notification_type\"]=='Add_Buddy')\n {\n// echo'hi mthree';exit;\n $sql = \"Select * from public_users where id=\" . $result->user_id;\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $data)\n {\n $publicUserInfo = (array)$data;\n\n $user_name = $publicUserInfo[\"firstname\"] . \" \" . $publicUserInfo[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\">\n\n <div class=\"who-sent-notification\">\n <?php\n if ($publicUserInfo['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $publicUserInfo[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n } ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $publicUserInfo[\"id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong>&nbsp; wants to add you as a buddy.\n <?php //Check if current user and event_organiser are buddies\n $sql = \"SELECT * from buddies where user_id=$user_id and buddy_id=\" . $publicUserInfo[\"id\"];\n $res_data = $DB->RunSelectQuery($sql);\n if ($res_data[0]->status =='Confirmed buddy')\n {\n\n ?>\n <img src=\"images/green_tick.gif\" style=\"vertical-align:middle\" width=\"15\" />&nbsp;<span class=\"ArialVeryDarkGreyBold15\">Accepted</span>\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n <?php\n }\n else\n {\n ?>\n <div class=\"accept-req-dropdown\" id=\"confirm_add_buddy_status<?php\n echo $publicUserInfo[\"id\"];\n ?>\" style=\"display:inline-block\"><div onClick=\"confirm_add_buddy(<?php\n echo $publicUserInfo[\"id\"];\n ?>)\" class=\"slimbuttonblue\" style=\"width:130px;\">Accept request</div></div>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n <?php\n }?>\n\n <?php\n }\n //IF NOTIFICATION TYPE IS A CONFIRMED BUDDY\n if ($notification_data[\"notification_type\"] == \"Confirmed Buddy\")\n {\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resultuser)\n {\n $resultuserInfo = (array)$resultuser;\n $user_name = $resultuserInfo[\"firstname\"] . \" \" . $resultuserInfo[\"lastname\"];\n }\n ?>\n\n <div class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <img width=\"37\" height=\"37\" src=\"<? echo ROOTURL . '/' . $resultuserInfo[\"profile_pic\"]; ?>\" class=\"image-has-radius\" alt=\"event-image\">\n </div>\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $resultuserInfo[\"id\"]);\n ?>\" style=\"color:#000000\"><?php\n echo $user_name;\n ?></a></strong>&nbsp; has accepted your buddy request.</p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n\n </div>\n <?php\n }\n if ($notification_data[\"notification_type\"] == \"Booking Request\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n } ?>\n <!-- Add new commented here -->\n <div class=\"is-notification\">\n <!-- Added by Nitin Soni for show user image 18Aug/2017 -->\n <div class=\"who-sent-notification\">\n <?php\n if ($resultusercomment['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resultusercomment['profile_pic']; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n <!-- Finsihed by Nitin Soni for user image -->\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><?php echo $user_name; ?> sent you a booking request for <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"> <?php\n echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"]));\n ?></span></p>\n </div>\n </div>\n <!-- Add new task completed -->\n\n <?php\n }\n if ($notification_data[\"notification_type\"] == \"Cancel Booking\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n } ?>\n <!-- Add new commented here -->\n <div class=\"is-notification\">\n <!-- Added by Nitin Soni for show user image 18Aug/2017 -->\n <div class=\"who-sent-notification\">\n <?php\n if ($resultusercomment['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resultusercomment['profile_pic']; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n <!-- Finsihed by Nitin Soni for user image -->\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><?php echo $user_name; ?> Left <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"> <?php\n echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"]));\n ?></span></p>\n </div>\n </div>\n <!-- Add new task completed -->\n\n <?php\n }\n\n ?>\n <?php\n }\n}", "public function sendnotificationemails($type,$to,$subject,$username,$linkhref){\r\n\r\n $bodyhead=\"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n <html xmlns='http://www.w3.org/1999/xhtml'>\r\n <head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n <title>\".$this->getsettings('sitetitle','text').\"</title>\r\n </head><body>\";\r\n if( $this->getsettings('email','logoshow') == '1' ) {\r\n $body = \"<img src='\".$this->getsettings('logo','url').\"' alt='\".$this->getsettings('sitetitle','text').\"' title='\".$this->getsettings('sitetitle','text').\"'/>\";\r\n }\r\n else {\r\n $body = '';\r\n }\r\n\r\n $link = \"<a href='\".$linkhref.\"'>\".$this->getsettings($type,'linktext').\"</a>\";\r\n $emContent = $this->getsettings($type,'text');\r\n $emContent = str_replace(\"[username]\",$username,$emContent);\r\n $emContent = str_replace(\"[break]\",\"<br/>\",$emContent);\r\n $emContent = str_replace(\"[linktext]\",$link,$emContent);\r\n\r\n $body .=\"<p>\".$emContent.\"</p>\";\r\n\r\n $from = $this->getsettings('email','fromname');\r\n $from_add = $this->getsettings('email','fromemail');\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\r\n $headers .= \"From: =?UTF-8?B?\". base64_encode($from) .\"?= <$from_add>\\r\\n\" .\r\n 'Reply-To: '.$from_add . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n mail($to,$subject,$bodyhead.$body.'</body></html>',$headers, '-f'.$from_add);\r\n\r\n if( $type == 'forgotpwdemail' ) {\r\n return '7#email';\r\n }\r\n else {\r\n return '7#register';\r\n }\r\n\r\n die();\r\n\t}", "function gather_ua_jobs_send_email_notifications() {\n $saved_settings = get_option( 'gather_ua_jobs_settings', array() );\n\n // Define the settings\n $keywords_setting = isset( $saved_settings ) && isset( $saved_settings[ 'keywords' ] ) ? $saved_settings[ 'keywords' ] : NULL;\n $email_notif_setting = isset( $saved_settings ) && isset( $saved_settings[ 'email_notification' ] ) ? $saved_settings[ 'email_notification' ] : NULL;\n\n // Check to make sure notifications are enabled\n if ( ! ( isset( $email_notif_setting[ 'enabled' ] ) && strcasecmp( 'yes', $email_notif_setting[ 'enabled' ] ) == 0 ) )\n return false;\n\n // Make sure we actually have emails\n if ( ! ( $emails = isset( $email_notif_setting ) && isset( $email_notif_setting[ 'emails' ] ) ? ( ! is_array( $email_notif_setting[ 'emails' ] ) ? array_map( 'trim', explode( ',', $email_notif_setting[ 'emails' ] ) ) : $email_notif_setting[ 'emails' ] ) : NULL ) )\n return false;\n\n // Get the jobs\n if ( ! ( $faculty_jobs = gather_ua_faculty_jobs( array( 'keywords' => $keywords_setting ) ) ) )\n return false;\n\n // Get our notification options\n $email_notification_option_name = 'gather_ua_jobs_email_notifications';\n $email_notification_options = get_option( $email_notification_option_name, array() );\n\n // Store in new options that will merge upon successful email\n $new_email_notification_options = array();\n\n // Build the email message\n $email_message = NULL;\n\n // Set the font family\n $font_family = \"font-family: Arial, Helvetica, sans-serif;\";\n\n // Go through each job and see if it needs to be added to the message\n $job_count = 0;\n foreach( $faculty_jobs as $job ) {\n\n // See if a notification has been set\n if ( ! empty( $email_notification_options ) && isset( $email_notification_options[ $job->ID ] ) )\n continue;\n\n // Make sure we have a title and a permalink\n if ( ! ( isset( $job->permalink ) && isset( $job->title ) ) )\n continue;\n\n // Store in new options\n $new_email_notification_options[ $job->ID ] = array(\n 'time' => strtotime( 'now' ),\n 'to' => $emails\n );\n\n // Add a divider\n $email_message .= '<hr />';\n\n // Add title and permalink to email message\n $email_message .= '<h4 style=\"margin-bottom:2px; color:#990000; ' . $font_family . ' font-size:17px; line-height:22px;\"><a href=\"' . esc_url( $job->permalink ) . '\" target=\"_blank\" style=\"color:#990000;\">' . esc_html__( $job->title, GATHER_UA_JOBS_TEXT_DOMAIN ) . '</a></h4>' . \"\\n\\n\";\n\n // Add published date to email message\n if ( isset( $job->published ) )\n $email_message .= '<p style=\"margin:0;' . $font_family . 'font-size:14px;line-height:18px;\"><strong>Published:</strong> ' . $job->published->format( 'l, M j, Y' ) . '</p>' . \"\\n\\n\";\n\n // Add authors to email message\n if ( isset( $job->authors ) ) {\n\n // Build the author string\n $author_array = array();\n foreach( $job->authors as $author ) {\n if ( isset( $author->name ) )\n $author_array[] = $author->name;\n }\n\n // If authors, add to email\n if ( ! empty( $author_array ) )\n $email_message .= '<p style=\"margin:0;' . $font_family . 'font-size:14px;line-height:18px;\"><strong>Author(s):</strong> ' . implode( ', ', $author_array ) . '</p>' . \"\\n\\n\";\n\n }\n\n // Add content to email message\n if ( isset( $job->content ) )\n $email_message .= '<p style=\"margin:15px 0 20px 0;' . $font_family . 'font-size:15px;line-height:19px;\">' . wp_trim_words( esc_html__( $job->content, GATHER_UA_JOBS_TEXT_DOMAIN ), $num_words = 55, '...' ) . '</p>' . \"\\n\\n\";\n\n $job_count++;\n\n }\n\n // Make sure we have an email message\n // If we don't it's because there are no new jobs to be notified\n if ( ! $email_message )\n return false;\n\n // Add instructions before the postings\n $tools_page_url = add_query_arg( array( 'page' => 'gather-ua-jobs' ), admin_url( 'tools.php' ) );\n $email_message = '<p><em>' . sprintf( __( 'The following UA faculty jobs postings match the keywords set for the %1$sGather UA Jobs plugin%2$s on the %3$s%4$s%5$s site. Please %6$svisit the plugin\\'s tools page%7$s if you would like to modify the keywords or email notification settings.', GATHER_UA_JOBS_TEXT_DOMAIN ), '<a href=\"' . $tools_page_url . '\" target=\"_blank\" style=\"color:#990000;\">', '</a>', '<a href=\"' . get_bloginfo( 'url' ) . '\" target=\"_blank\" style=\"color:#990000;\">', get_bloginfo( 'name' ), '</a>', '<a href=\"' . $tools_page_url . '\" target=\"_blank\" style=\"color:#990000;\">', '</a>' ) . '</em></p>' . $email_message;\n\n // Set the email as HTML\n add_filter( 'wp_mail_content_type', 'gather_ua_jobs_set_html_content_type' );\n\n // Try to send the email\n $send_the_email = wp_mail( $emails, 'New UA Faculty Job Postings', $email_message );\n\n // Reset content-type to avoid conflicts\n remove_filter( 'wp_mail_content_type', 'gather_ua_jobs_set_html_content_type' );\n\n // The email didn't send so get out of here\n if ( ! $send_the_email )\n return false;\n\n // Make sure both options are arrays\n if ( ! is_array( $email_notification_options ) )\n $email_notification_options = array();\n\n if ( ! is_array( $new_email_notification_options ) )\n $new_email_notification_options = array();\n\n // Merge the old options with the new options\n $email_notification_options = $email_notification_options + $new_email_notification_options;\n\n // Update the notification options\n update_option( $email_notification_option_name, $email_notification_options );\n\n return true;\n\n}", "public function actionNotifyUnExeptedProfiles(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $hidden = UserStat::model()->findAll(\"completeness < :comp\",array(\":comp\"=>PROFILE_COMPLETENESS_MIN));\n\n $c = 0;\n foreach ($hidden as $stat){\n //set mail tracking\n if ($stat->user->status != 0) continue; // skip active users\n if ($stat->user->newsletter == 0) continue; // skip those who unsubscribed\n if ($stat->user->lastvisit_at != '0000-00-00 00:00:00') continue; // skip users who have already canceled their account\n \n //echo $stat->user->name.\" - \".$stat->user->email.\": \".$stat->user->create_at.\" (\".date('c',strtotime('-4 week')).\" \".date('c',strtotime('-3 week')).\")<br />\\n\";\n $create_at = date(\"Y-m-d H\",strtotime($stat->user->create_at));\n //$create_at_hour = date(\"Y-m-d H\",strtotime($stat->user->create_at));\n /*if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue;*/\n if ( !($create_at == date(\"Y-m-d H\",strtotime('-2 hour')) || $create_at == date(\"Y-m-d H\",strtotime('-1 day')) || \n $create_at == date(\"Y-m-d H\",strtotime('-3 days')) || $create_at == date(\"Y-m-d H\",strtotime('-8 days')) || \n $create_at == date(\"Y-m-d H\",strtotime('-14 day')) || $create_at == date(\"Y-m-d H\",strtotime('-21 day')) || \n $create_at == date(\"Y-m-d H\",strtotime('-28 day'))) ) continue;\n //echo $stat->user->email.\" - \".$stat->user->name.\" your Cofinder profile is moments away from approval!\";\n\n //echo \"SEND: \".$stat->user->name.\" - \".$stat->user->email.\": \".$stat->user->create_at.\" (\".$stat->completeness.\")<br />\\n\";\n //echo 'http://www.cofinder.eu/profile/registrationFlow?key='.substr($stat->user->activkey,0, 10).'&email='.$stat->user->email;\n\n //continue;\n //set mail tracking\n $mailTracking = mailTrackingCode($stat->user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'registration-flow-reminder';\n $ml->user_to_id = $stat->user->id;\n $ml->save();\n\n $email = $stat->user->email;\n $message->subject = $stat->user->name.\" your Cofinder account is almost approved\"; // 11.6. title change\n\n $content = \"We couldn't approve your profile just yet since you haven't provided enough information.\"\n . \"Please fill your profile and we will revisit your application.\".\n mailButton(\"Do it now\", absoluteURL().'/profile/registrationFlow?key='.substr($stat->user->activkey,0, 10).'&email='.$stat->user->email,'success',$mailTracking,'fill-up-button');\n\n $message->setBody(array(\"content\"=>$content,\"email\"=>$email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($email);\n Yii::app()->mail->send($message);\n\n Notifications::setNotification($stat->user_id,Notifications::NOTIFY_INVISIBLE);\n $c++;\n }\n if ($c > 0) Slack::message(\"CRON >> UnExcepted profiles: \".$c);\n return 0;\n }", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "function showUserPendingNotifications($status){\n global $DB,$user_id;\n\n $sql = \"Select * from notifications where other_user_id=$user_id and status='$status' order by id desc limit 5\";\n $res_data_notification = $DB->RunSelectQuery($sql);\n\n foreach ($res_data_notification as $result)\n {\n $notification_data = (array)$result;\n $date = date(\"Y-m-d\", strtotime($notification_data[\"notification_date\"]));\n ?>\n\n <?php\n//echo $notification_data[\"notification_type\"] ;\n// Added here by Nitin Soni for status\n\n /*\nSHow Notification for updated event\n */\n //IF NOTIFICATION TYPE IS update event/ping\n if ($notification_data[\"notification_type\"] == \"ping_updated\"|| $notification_data[\"notification_type\"] == \"event_updated\")\n {\n\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n ?>\n <div class=\"is-notification\" id=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n <?php echo $var ?> <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> has been modified by organiser. Please review the changes.\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /*UPdate event/ping work completed here */\n\n /* Cancel Event/Ping started */\n //IF NOTIFICATION TYPE IS cancel event/ping\n if ($notification_data[\"notification_type\"] == \"Cancel Ping\"|| $notification_data[\"notification_type\"] == \"Cancel Event\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\" id=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n <?php echo $var ?> <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> has been cancelled.</p>\n\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /* Completed cancel event/ping */\n\n\n\n /*Reorganize event started*/\n /* Cancel Event/Ping started */\n //IF NOTIFICATION TYPE IS cancel event/ping\n if ($notification_data[\"notification_type\"] == \"Event Reorganize\" || $notification_data[\"notification_type\"] == \"Ping Reorganize\")\n {\n\n /*echo \"Hello\";\n exit;*/\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data_event = $DB->RunSelectQuery($sql);\n // 'event_status' => 'L'\n foreach ($res_data_event as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\" id=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n if ($resulteventcomment['event_photo'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resulteventcomment[\"event_photo\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <?php if ($event_type == 'ping')\n {\n $var = 'The';\n }else{\n $var = 'An';\n } ?>\n\n <?php echo $var ?> <?php echo $event_type ?> <strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a></strong>\n has been reorganized.\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n /*Completed here*/\n /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/\n /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/\n /*Completed event update work*/\n\n //IF NOTIFICATION TYPE IS A COMMENT\n if ($notification_data[\"notification_type\"] == \"C\")\n {\n\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data_publicUser = $DB->RunSelectQuery($sql);\n foreach ($res_data_publicUser as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\" id=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $before_result = $DB->RunSelectQuery($sql);\n foreach ($before_result as $result)\n {\n $publicUserResult = (array)$result;\n if ($publicUserResult['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $publicUserResult[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n } ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $notification_data[\"$user_id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong> has commented on your <?php echo $event_type ?> <strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a>&nbsp;</strong></p>\n <p id=\"notification-date\"><span class=\"has-noti-icon\"><img alt=\"notifocation-image\" src=\"images/comment_box.gif\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n\n//Completed work for show cancel Event notification\n\n //IF NOTIFICATION TYPE IS A COMMENT\n if ($notification_data[\"notification_type\"] == \"Comment\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n }\n ?>\n <div id=\"is-notification\" class=\"is-notification\">\n <div class=\"who-sent-notification\">\n <?php\n //Query is changed by Nitin Soni\n /* $sql = \"SELECT * from public_users where id=$user_id\";*/\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $before_result = $DB->RunSelectQuery($sql);\n foreach ($before_result as $result)\n {\n $PublicUserData = (array)$result;\n if ($PublicUserData['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $PublicUserData[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n } ?>\n </div>\n <!-- <div class=\"who-sent-notification\">\n <img alt=\"event-image\" src=\"images/profile_img.jpg\" class=\"image-has-radius\">\n </div> -->\n <div class=\"notification-itself\">\n <p class=\"notification-content\" id=\"is-notification\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $notification_data[\"id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong> has commented on your <?php echo $event_type ?> <strong><a href=<?php echo $event_link ?> style=\"color:#000000\"><?php echo $event_name ?></a>&nbsp;</strong></p>\n <p id=\"notification-date\"><span class=\"has-noti-icon\"><img alt=\"notifocation-image\" src=\"images/comment_box.gif\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n\n <!-- --><? //\n\n }\n //IF NOTIFICATION TYPE IS AN ADD BUDDY\n if ($notification_data[\"notification_type\"] == \"Add_Buddy\")\n {\n\n $sql = \"Select * from public_users where id=\" . $result->user_id;\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $data)\n {\n $publicUserInfo = (array)$data;\n\n $user_name = $publicUserInfo[\"firstname\"] . \" \" . $publicUserInfo[\"lastname\"];\n }\n ?>\n <div class=\"is-notification\" id=\"is-notification\">\n\n <div class=\"who-sent-notification\">\n <?php\n if ($publicUserInfo['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $publicUserInfo[\"profile_pic\"]; ?>\" width=\"37\" height=\"37\" />\n <?php\n } ?>\n </div>\n\n <div class=\"notification-itself\">\n <p class=\"notification-content\">\n <strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $publicUserInfo[\"id\"]);\n ?>\" style=\"color:#000000\"><?php echo $user_name ?></a></strong>&nbsp; wants to add you as a buddy.\n\n <?php //Check if current user and event_organiser are buddies\n $sql = \"SELECT * from buddies where user_id=$user_id and buddy_id=\" . $publicUserInfo[\"id\"];\n $res_data = $DB->RunSelectQuery($sql);\n if ($res_data[0]->status =='Confirmed buddy')\n {\n\n ?>\n <img src=\"images/green_tick.gif\" style=\"vertical-align:middle\" width=\"15\" />&nbsp;<span class=\"ArialVeryDarkGreyBold15\">Accepted</span>\n </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n </div>\n <?php\n }\n else\n {\n ?>\n <div class=\"accept-req-dropdown\" id=\"confirm_add_buddy_status<?php\n echo $publicUserInfo[\"id\"];\n ?>\" style=\"display:inline-block\"><div onClick=\"confirm_add_buddy(<?php\n\n ?>)\" class=\"slimbuttonblue\" style=\"width:130px;\">Accept request</div></div>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n <?php\n } ?>\n </div>\n </div>\n <?php\n\n }\n //IF NOTIFICATION TYPE IS A CONFIRMED BUDDY\n if ($notification_data[\"notification_type\"] == \"Confirmed Buddy\")\n {\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resultuser)\n {\n $resultuserInfo = (array)$resultuser;\n $user_name = $resultuserInfo[\"firstname\"] . \" \" . $resultuserInfo[\"lastname\"];\n }\n ?>\n\n <div class=\"is-notification\" id=\"is-notification\">\n <div class=\"who-sent-notification\">\n <img width=\"37\" height=\"37\" src=\"<? echo ROOTURL . '/' . $resultuserInfo[\"profile_pic\"]; ?>\" class=\"image-has-radius\" alt=\"event-image\">\n </div>\n <div class=\"notification-itself\">\n <p class=\"notification-content\"><strong><a href=\"<?php\n echo createURL('index.php', \"mod=user&do=profile&userid=\" . $resultuserInfo[\"id\"]);\n ?>\" style=\"color:#000000\"><?php\n echo $user_name;\n ?></a></strong>&nbsp; has accepted your buddy request.</p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-user\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"><?php echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"])) ?></span></p>\n </div>\n\n </div>\n <?php\n }\n if ($notification_data[\"notification_type\"] == \"Booking Request\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n } ?>\n <!-- Add new commented here -->\n <div class=\"is-notification\" id=\"is-notification\">\n <!-- Added by Nitin Soni for show user image 18Aug/2017 -->\n <div class=\"who-sent-notification\">\n <?php\n if ($resultusercomment['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resultusercomment['profile_pic']; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n <!-- Finsihed by Nitin Soni for user image -->\n <div class=\"notification-itself\" >\n <p class=\"notification-content\"><?php echo $user_name; ?> sent you a booking request for <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"> <?php\n echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"]));\n ?></span></p>\n </div>\n </div>\n <!-- Add new task completed -->\n\n <?php\n }\n if ($notification_data[\"notification_type\"] == \"Cancel Booking\")\n {\n $sql = \"Select * from events where event_id=\" . $notification_data[\"event_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n foreach ($res_data as $resulteventcomment)\n {\n $resulteventcomment = (array)$resulteventcomment;\n $event_name = $resulteventcomment[\"event_name\"];\n if ($resulteventcomment[\"entry_type\"] == \"\")\n {\n $event_type = \"event\";\n $event_link = createURL('index.php', \"mod=event&do=eventdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n else if ($resulteventcomment[\"entry_type\"] == \"Ping\")\n {\n $event_type = \"ping\";\n $event_link = createURL('index.php', \"mod=ping&do=pingdetails&eventid=\" . $resulteventcomment[\"event_id\"]);\n }\n }\n\n\n $sql = \"Select * from public_users where id=\" . $notification_data[\"user_id\"];\n $res_data = $DB->RunSelectQuery($sql);\n\n foreach ($res_data as $resultusercomment)\n {\n $resultusercomment = (array)$resultusercomment;\n\n $user_name = $resultusercomment[\"firstname\"] . \" \" . $resultusercomment[\"lastname\"];\n } ?>\n <!-- Add new commented here -->\n <div class=\"is-notification\" id=\"is-notification\">\n <!-- Added by Nitin Soni for show user image 18Aug/2017 -->\n <div class=\"who-sent-notification\">\n <?php\n if ($resultusercomment['profile_pic'] == null)\n {\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<?php echo ROOTURL; ?>/images/no_profile_pic.gif\" />\n <?php\n }\n else\n {\n\n ?>\n <img alt=\"event-image\" class=\"image-has-radius\" src=\"<? echo ROOTURL . '/' . $resultusercomment['profile_pic']; ?>\" width=\"37\" height=\"37\" />\n <?php\n }\n ?>\n </div>\n <!-- Finsihed by Nitin Soni for user image -->\n <div class=\"notification-itself\" >\n <p class=\"notification-content\"><?php echo $user_name; ?> Left <?php echo $event_type; ?> <strong><a style=\"color:#000000\" href=\"<?php echo $event_link;?>\"><?php\n echo $event_name;\n ?></a></strong> </p>\n <p id=\"notification-date\"><span class=\"glyphicon glyphicon-calendar\"></span><span class=\"make-space\"></span><span class=\"has-noti-date-time\"> <?php\n echo date(\"j F, H:i a\", strtotime($notification_data[\"notification_date\"]));\n ?></span></p>\n </div>\n </div>\n <!-- Add new task completed -->\n\n <?php\n }\n\n\n ?>\n <?php\n }\n\n}", "public static function setMSGForHaveNTEmailUsers() {\n\n // not have email end moderation job seekers\n $queryMail = \"\n SELECT\n u.id_user,\n u.email,\n u.crdate,\n u.mdate,\n u.status,\n r.ismoder\n FROM\n user u\n INNER JOIN \n resume r ON r.id_user=u.id_user \n WHERE\n DATE(u.crdate) >= NOW() - INTERVAL 1 DAY \n or \n DATE(u.mdate) >= NOW() - INTERVAL 1 DAY \n GROUP BY u.id_user\n \";\n $queryMail = Yii::app()->db->createCommand($queryMail)->queryAll();\n\n if(count($queryMail)){\n\n foreach ($queryMail as $user){\n $email = $user['email'];\n if ((!preg_match(\"/^(?:[a-z0-9]+(?:[-_.]?[a-z0-9]+)?@[a-z0-9_.-]+(?:\\.?[a-z0-9]+)?\\.[a-z]{2,5})$/i\", $email))\n || ( $email = '' )){\n /**\n * Send messages to users who did not enter the email\n */\n $resultm['users'][] = $user['id_user'];\n $resultm['title'] = 'Администрация';\n $resultm['text'] = 'Уважаемый пользователь, будьте добры заполнить \n поле e-mail в вашем профиле.\n Заранее спасибо!';\n }\n }\n $admMsgM = new AdminMessage();\n\n // send notifications\n if (isset($resultm)) {\n $admMsgM->sendDataByCron($resultm);\n }\n\n foreach ($queryMail as $user){\n $status = $user['status'];\n $ismoder = $user['ismoder'];\n if ( ($status == 2) && ($ismoder != 1)){\n /**\n * Send messages to users who did not enter moderation information\n */\n $resultjs['users'][] = $user['id_user'];\n $resultjs['title'] = 'Администрация';\n $resultjs['text'] = 'Уважаемый пользователь, заполните '.\n 'поля, необходимые для модерации:'.\n '<ul style=\"text-align:left\">'.\n '<li>имя и фамилия</li>'.\n '<li>год рождения</li>'.\n '<li>Фото(допускается и без него, на фото не природа, '.\n 'не больше одной личности, не анимация и т.д)</li>'.\n '<li>номер телефона и эмейл</li>'.\n '<li>целевая вакансия</li>'.\n '<li>раздел \"О себе\"</li>'.\n '<ul>';\n }\n }\n $admMsgJS = new AdminMessage();\n if (isset($resultjs)) {\n $admMsgJS->sendDataByCron($resultjs);\n }\n\n }\n\n $queryEmpl = \"\n SELECT\n u.id_user,\n u.email,\n u.crdate,\n u.mdate,\n u.status,\n e.ismoder\n FROM\n user u\n INNER JOIN \n employer e ON e.id_user=u.id_user \n WHERE\n (\n DATE(u.crdate) >= NOW() - INTERVAL 1 DAY \n or \n DATE(u.mdate) >= NOW() - INTERVAL 1 DAY\n ) and u.status = 3 \n \n GROUP BY u.id_user\n \";\n $queryEmpl = Yii::app()->db->createCommand($queryEmpl)->queryAll();\n\n if(count($queryEmpl)) {\n\n foreach ($queryEmpl as $user){\n $ismoder = $user['ismoder'];\n if ( $ismoder != 1 ){\n /**\n * Send messages to employer who did not enter moderation information\n */\n $resulte['users'][] = $user['id_user'];\n $resulte['title'] = 'Администрация';\n $resulte['text'] = 'Уважаемый пользователь, заполните '.\n 'поля в вашем профиле, необходимые для модерации:'.\n '<ul style=\"text-align:left\">'.\n '<li>название компании</li>'.\n '<li>логотип - желаельно</li>'.\n '<li>номер телефона и эмейл</li>'.\n '<li>имя контактного лица</li>'.\n '<li>контактный номер телефона</li>'.\n '<ul>';\n }\n }\n $admMsgE = new AdminMessage();\n if (isset($resulte)) {\n $admMsgE->sendDataByCron($resulte);\n }\n }\n\n }", "function notify($fave, $notice, $user)\n {\n $other = User::staticGet('id', $notice->user_id);\n if ($other && $other->id != $user->id) {\n \t$otherProfile = $other->getProfile();\n if ($otherProfile->email && $otherProfile->emailnotifyfav) {\n mail_notify_fave($otherProfile, $user->getProfile(), $notice);\n }\n // XXX: notify by IM\n // XXX: notify by SMS\n }\n }", "function _notify_users($channel_id, $entry_id, $entry_title)\n\t{\n\t\t// If we have a member group set for this channel\n\t\tif(isset($this->settings['channels']['id_'.$channel_id]['notification_group']))\n\t\t{\n\t\t\t$notification_group = $this->settings['channels']['id_'.$channel_id]['notification_group'];\n\t\t\t\n\t\t\t// Get all members from this group\n\t\t\t$this->EE->load->model('ep_members');\n\t\t\t$notifications = $this->EE->ep_members->get_all_members_from_group($notification_group);\n\t\t\t\n\t\t\t// If we didn't get any members\n\t\t\tif($notifications == FALSE) return;\n\t\t\t\n\t\t\t// Load the email library and text helper\n\t\t\t$this->EE->load->library('email');\n\t\t\t$this->EE->load->helper('text'); \n\n\t\t\t$this->EE->email->wordwrap = true;\n\t\t\t$this->EE->email->mailtype = 'text';\n\t\t\t\n\t\t\t// Email settings\n\t\t\t$review_url = $this->EE->functions->remove_double_slashes($this->EE->config->item('site_url').\"/\".SYSDIR.\"/\".BASE.AMP.\"C=content_publish\".AMP.\"M=entry_form\".AMP.\"channel_id={$channel_id}\".AMP.\"entry_id={$entry_id}\");\n\t\t\t\n\t\t\t$the_message = \"\";\n\t\t\t$the_message .= \"The entry '{$entry_title}' has been submitted for approval.\\n\\nTo review it please log into your control panel\\n\\n\";\n\t\t\t$the_message .= $review_url.\"\\n\";\n\n\t\t\t$the_subject = $this->EE->config->item('site_name').': An entry has been submitted for approval';\n\t\t\t\n\t\t\t$the_from = $this->EE->config->item('webmaster_email');\n\t\t\t\n\t\t\tforeach ($notifications->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->EE->email->initialize();\n\t\t\t\t$this->EE->email->from($the_from);\n\t\t\t\t$this->EE->email->to($row['email']); \n\t\t\t\t$this->EE->email->subject($the_subject);\n\t\t\t\t$this->EE->email->message(entities_to_ascii($the_message));\n\t\t\t\t$this->EE->email->Send();\n\t\t\t\t\n\t\t\t\t// Logging\n\t\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): Notification email sent to : \".$row['email']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Logging\n\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): No member group found for channel: \".$channel_id);\n\t\t}\n\t}", "public static function _send_deferred_notifications() {\n\t\t$email_notifications = self::get_email_notifications( true );\n\t\tforeach ( self::$deferred_notifications as $email ) {\n\t\t\tif (\n\t\t\t\t! is_string( $email[0] )\n\t\t\t\t|| ! isset( $email_notifications[ $email[0] ] )\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$email_class = $email_notifications[ $email[0] ];\n\t\t\t$email_notification_key = $email[0];\n\t\t\t$email_args = is_array( $email[1] ) ? $email[1] : array();\n\n\t\t\tself::send_email( $email[0], new $email_class( $email_args, self::get_email_settings( $email_notification_key ) ) );\n\t\t}\n\t}", "function accountNotification($email,$messagecontent,$userUniqueNo){\n\n$i=1;\nforeach ($messagecontent as $key => $value) {\n \n if ($i==1) {\n \t//For student notification\n $query=\"INSERT INTO notification(content,notificationDate,studentNo,staffID) VALUES('\".$messagecontent[$key].\"',now(),'\".$userUniqueNo[$key].\"',NULL) \";\n\n if ($query_run=mysqli_query($GLOBALS['link'],$query)) {\n $Message=$messagecontent[$key];\n $notify=emailNotification($email[$key],$messagecontent[$key]);\n\n if ($notify) {\n $Message.=\" <br>Notification has been sent to your email <strong>\".$email[$key].\"</strong>\";\n }else{\n $errorMessage=\"Wrong email address <strong>\".$email[$key].\"</strong>\";\n }\n\n }else{\n $errorMessage=\"Couldn't Notify the responsible stakeholders, please contact the system admin \".mysqli_error($GLOBALS['link']);\n }\n\n }else{//staff notification\n $query=\"INSERT INTO notification(content,notificationDate,studentNo,staffID) VALUES('\".$messagecontent[$key].\"',now(),NULL,'\".$userUniqueNo[$key].\"') \";\n\n if ($query_run=mysqli_query($GLOBALS['link'],$query)) {\n\n if ($i==2) {\n $notify=emailNotification($email[$key],$messagecontent[$key]);\n }\n \n }else{\n if ($i==2) {\n $errorMessage.=\" And Couldn't Notify your Lecturer and HOD too \".mysqli_error($link);\n }\n }\n }//end of staff notification else\n\n$i++;\n}//the end of the foreach loop\n if (isset($Message)) {\n \treturn $Message;\n }else{\n \treturn $errorMessage;\n }\n\n }", "function sendEventStartNotifications()\n {\n $ret = false;\n\n // Settings\n $ini = eZINI::instance( \"bceventnotifications.ini\" );\n $eventClassIdentifier = $ini->variable( \"EventNotificationsSettings\", \"EventClassIdentifier\" );\n $userClassIdentifier = $ini->variable( \"EventNotificationsSettings\", \"UserClassIdentifier\" );\n $userGroupNodeID = $ini->variable( \"EventNotificationsSettings\", \"UserGroupNodeID\" );\n $eventCalendarNodeID = $ini->variable( \"EventNotificationsSettings\", \"EventCalendarNodeID\" );\n $administratorUserID = $ini->variable( \"EventNotificationsSettings\", \"AdministratorUserID\" );\n\n // Change Script Session User to Privilaged Role User, Admin\n $this->loginDifferentUser( $administratorUserID );\n\n // Fetch users in user group\n $groupNode = eZContentObjectTreeNode::fetch( $userGroupNodeID );\n $groupConditions = array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array( $userClassIdentifier ) );\n $groupUsers = $groupNode->subTree( $groupConditions, $userGroupNodeID );\n\n foreach( $groupUsers as $user )\n {\n // Fetch subtree notification rules\n $userID = $user->attribute( 'contentobject_id' );\n $userSubtreeNotificationRules = eZSubtreeNotificationRule::fetchList( $userID, true, false, false );\n $userSubtreeNotificationRulesCount = eZSubtreeNotificationRule::fetchListCount( $userID );\n\n if ( $userSubtreeNotificationRulesCount != 0 )\n {\n foreach ( $userSubtreeNotificationRules as $rule )\n {\n // Check each node in rule for event starting\n $ruleNodeID = $rule->attribute( 'node_id' );\n $node = eZContentObjectTreeNode::fetch( $ruleNodeID );\n\n if ( $this->isEventStarting( $node ) )\n $this->sendEventStartNotificationEmail( $user, $node );\n }\n }\n\n }\n return $ret;\n }", "function userNotificationEmail($email, $user)\n{\n\t$module = new sociallogin();\n\t$sub = $module->l('Thank You For Registration', 'sociallogin_functions');\n\t$vars = array('{firstname}' => $user['fname'], '{lastname}' => $user['lname'], '{email}' => $email, '{passwd}' => $user['pass']);\n\t$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\tMail::Send($id_lang, 'account', $sub, $vars, $email);\n}", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public function notificationsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $notification = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if ($notification['from'] instanceof Users) {\n $this->di->setShared('userData', $notification['from']);\n }\n\n if (!$notification['to'] instanceof Users) {\n echo 'Attribute TO has to be a User' . PHP_EOL;\n return;\n }\n\n if (!class_exists($notification['notification'])) {\n echo 'Attribute notification has to be a Notificatoin' . PHP_EOL;\n return;\n }\n $notificationClass = $notification['notification'];\n\n if (!$notification['entity'] instanceof Model) {\n echo 'Attribute entity has to be a Model' . PHP_EOL;\n return;\n }\n\n $user = $notification['to'];\n\n //instance notification and pass the entity\n $notification = new $notification['notification']($notification['entity']);\n //disable the queue so we process it now\n $notification->disableQueue();\n\n //run notify for the specifiy user\n $user->notify($notification);\n\n $this->log->info(\n \"Notification ({$notificationClass}) sent to {$user->email} - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::NOTIFICATIONS, $callback);\n }", "public function emailnotification($args)\n {\n // Extract expected variables\n $to_uid = $args['to_uid'];\n $from_uid = $args['from_uid'];\n $subject = $args['subject'];\n\n // First check if the Mailer module is avaible\n if(!ModUtil::available('Mailer')) {\n return true;\n }\n\n // Then check if admin allowed email notifications\n $allow_emailnotification = ModUtil::getVar('InterCom', 'messages_allow_emailnotification');\n if ($allow_emailnotification != 1) {\n return true;\n }\n\n // check the user attributes for userprefs\n $user = DBUtil::selectObjectByID('users', $to_uid, 'uid', null, null, null, false);\n if (!is_array($user)){\n // WTF, no user data?\n return true;\n }\n\n if (!isset($user['__ATTRIBUTES__']) || (!isset($user['__ATTRIBUTES__']['ic_note'])\n && !isset($user['__ATTRIBUTES__']['ic_ar'])\n && !isset($user['__ATTRIBUTES__']['ic_art']))) {\n // ic_note: email notifiaction yes/no\n // ic_ar : autoreply yes/no\n // ic_art : autoreply text\n // load values from userprefs tables and store them in attributes\n // get all tables from the database, tbls is a non-assoc array\n $tbls = DBUtil::metaTables();\n // if old intercom_userprefs table exists, try to read the values for user $to_uid\n $olduserprefs = in_array('intercom_userprefs', $tbls);\n if ($olduserprefs == true) {\n $userprefs = DBUtil::selectObjectByID('intercom_userprefs', $to_uid, 'user_id');\n }\n if (is_null($userprefs)) {\n // userprefs table does not exist or userprefs for this user do not exist, create them with defaults\n $user['__ATTRIBUTES__']['ic_note'] = 0;\n $user['__ATTRIBUTES__']['ic_ar'] = 0;\n $user['__ATTRIBUTES__']['ic_art'] = '';\n } else {\n $user['__ATTRIBUTES__']['ic_note'] = $userprefs['email_notification'];\n $user['__ATTRIBUTES__']['ic_ar'] = $userprefs['autoreply'];\n $user['__ATTRIBUTES__']['ic_art'] = $userprefs['autoreply_text'];\n }\n // store attributes\n DBUtil::updateObject($user, 'users', '', 'uid');\n // delete entry in userprefs table\n if ($olduserprefs == true) {\n DBUtil::deleteObjectByID('intercom_userprefs', $to_uid, 'user_id');\n }\n }\n\n if ($user['__ATTRIBUTES__']['ic_note'] != 1) {\n return true;\n }\n\n // Get the needed variables for the mail\n\n $renderer = Zikula_View::getInstance('InterCom', false);\n $renderer->assign('message_from',UserUtil::getVar('uname', $from_uid));\n $renderer->assign('subject', $subject);\n $renderer->assign('viewinbox', ModUtil::url('InterCom', 'user', 'inbox'));\n $renderer->assign('prefs', ModUtil::url('InterCom', 'user', 'settings'));\n $renderer->assign('baseURL', System::getBaseUrl());\n\n $message = $renderer->fetch(\"mail/emailnotification.tpl\");\n\n $fromname = ModUtil::getVar('InterCom', 'messages_fromname');\n if ($fromname == '') {\n $fromname = System::getVar('sitename');\n }\n\n $fromaddress = ModUtil::getVar('InterCom', 'messages_from_email');\n if ($fromaddress == '') {\n $fromaddress = System::getVar('adminmail');\n }\n\n $modinfo = ModUtil::getInfo(ModUtil::getIdFromName('InterCom'));\n $args = array( 'fromname' => $fromname,\n 'fromaddress' => $fromaddress,\n 'toname' => UserUtil::getVar('uname', $to_uid),\n 'toaddress' => UserUtil::getVar('email', $to_uid),\n 'subject' => ModUtil::getVar('InterCom', 'messages_mailsubject'),\n 'body' => $message,\n 'headers' => array('X-Mailer: ' . $modinfo['name'] . ' ' . $modinfo['version']));\n ModUtil::apiFunc('Mailer', 'user', 'sendmessage', $args);\n return true;\n }", "public function do_notify($send, $mailer = NULL);", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "function sendNewMessageNotification($to_user_id,$to_name,$subject,$fromEmail,$replyEmail)\n{\n #check if the user enabled this option\n $query=\"select message_email,email from users where user_id ='$to_user_id' and access_level NOT IN ('ebulkuser','eremote') limit 1\";\n $email_option=getDBRecords($query); \n\n if($email_option[0]['message_email'] == \"Y\")\n { \n $email = $email_option[0]['email'];\n $html=\"<p><font size=\\\"2\\\" face=\\\"Verdana, Arial, Helvetica, sans-serif\\\">Dear \".$to_name.\",<br><br>\n You have been sent a message via the online \".DBS.\" system regarding <b>\".$subject.\"</b>, please login to your secure online account to read the message.\n\t\t\t <br><br>Thank You</font></p>\";\n\n\n\t\t$text=\"Dear \".$to_name.\",\n \n\t\t\t You have been sent a message via the online \".DBS.\" system regarding \".$subject.\", please login to your secure online account to read the message.\n\t\t\t \n\t\t\t Thank You\";\n\n\t\t \n\t\t$from = $fromEmail;\n\t\t$mail = new htmlMimeMail();\n\t\t$mail->setHtml($html, $text);\n\t\t$mail->setReturnPath($replyEmail);\n $mail->setFrom($from);\n $mail->setSubject(\"Important Message\");\n $mail->setHeader('X-Mailer', 'HTML Mime mail class');\n\n if(!empty($email))\n\t {\n $result = $mail->send(array($email), 'smtp');\t\n\t\t}\n } \t\n}", "function notifications(){\n $this->session->set_userdata('notify_offset', '0');\n $offset_session= $this->session->userdata('notify_offset');\n $sk = array();\n $uid = $this->session->userdata('user_id');\n // Login verification and user stats update\n $logged = false;\n $user = null;\n $config['site_url'] = base_url();\n $config['theme_url'] = '';\n $config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] = base_url() . 'ajax/socialAjax';\n $sk['config'] = $config;\n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if (!empty($user['id']) && $user['type'] == \"user\") {\n $sk['user'] = $user;\n $logged = true;\n $query_two = \"UPDATE \" . DB_ACCOUNTS . \" SET last_logged=\" . time() . \" WHERE id=\" . $user['id'];\n $sql_query_two = $this->db->query($query_two);\n }\n $sk['logged'] = $logged;\n $sk['notifications'] = $this->socialkit->SK_getNotifications(array('all'=>true), $offset_session ,50);\n\t\t\t\n $data['sk'] = $sk;\n $this->load->view('user/notifications', $data);\n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()));\n }\n }", "public function actionNotifyToJoin(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->subject = \"We are happy to see you soon on Cofinder\"; // 11.6. title change\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n $c = 0;\n foreach ($invites as $user){\n \n $create_at = strtotime($user->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue; \n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'invitation-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n $activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can \".$activation_url.\"!\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n Slack::message(\"CRON >> Invite to join reminders: \".$c);\n return 0;\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "function pmpro_notifications()\n{\n\tif(current_user_can(\"manage_options\"))\n\t{\n\t\t$pmpro_notification = get_transient(\"pmpro_notification_\" . PMPRO_VERSION);\n\t\tif(empty($pmpro_notification))\n\t\t{\n\t\t\t//set to NULL in case the below times out or fails, this way we only check once a day\n\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, 'NULL', 86400);\n\n\t\t\t//figure out which server to get from\n\t\t\tif(is_ssl())\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"https://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"http://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\n\t\t\t//get notification\n\t\t\t$pmpro_notification = wp_remote_retrieve_body($remote_notification);\n\n\t\t\t//update transient if we got something\n\t\t\tif(!empty($pmpro_notification))\n\t\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, $pmpro_notification, 86400);\n\t\t}\n\n\t\tif($pmpro_notification && $pmpro_notification != \"NULL\")\n\t\t{\n\t\t?>\n\t\t<div id=\"pmpro_notifications\">\n\t\t\t<?php echo $pmpro_notification; ?>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n\n\t//exit so we just show this content\n\texit;\n}", "private function _send_user_email_and_notifications($staff)\n {\n $users[] = $staff->staffid;\n\n add_notification([\n 'description' => 'callbacks_assignee_notification',\n 'touserid' => $staff->staffid,\n 'fromcompany' => true,\n 'link' => 'appointly/callbacks',\n ]);\n\n send_mail_template('appointly_callbacks_notification_assigned_to_staff', 'appointly', $staff);\n pusher_trigger_notification(array_unique($users));\n }", "public function notification() {\n\t\t$this->page_data['page_name'] = \"notification\";\n\t\t$this->page_data['page_title'] = 'notification';\n\t\t$this->page_data['page_view'] = 'user/notification';\n\n\t\t$this->page_data['company_add_request_list'] = $this->corporate_model->get_company_list(\n\t\t\t\"OBJECT\",\n\t\t\tarray(\n\t\t\t\t'company_user' => array('company_id', 'corporate_role', 'designation_id', 'department_id', 'request_status'),\n\t\t\t\t'company' => array('name as company_name'),\n\t\t\t\t'designation' => array('name as designation'),\n\t\t\t\t'department' => array('name as department'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'company_user.user_id' => $this->session->userdata('user_id'),\n\t\t\t\t'company_user.request_status' => 'PENDING',\n\t\t\t)\n\t\t);\n\n\t\t$this->load->view('index', $this->page_data);\n\n\t}", "function get_web_notifications($max = null, $start = 0)\n{\n if (is_guest()) {\n return array(new Tempcode(), 0);\n }\n\n if ($start == 0) {\n $test = get_cache_entry('_get_notifications', serialize(array($max)), CACHE_AGAINST_MEMBER, 10000);\n if ($test !== null) {\n return $test;\n }\n }\n\n $where = array(\n 'd_to_member_id' => get_member(),\n 'd_frequency' => A_WEB_NOTIFICATION,\n );\n\n $rows = $GLOBALS['SITE_DB']->query_select('digestives_tin', array('*'), $where, 'ORDER BY d_date_and_time DESC', $max, $start);\n $out = new Tempcode();\n foreach ($rows as $row) {\n $member_id = $row['d_from_member_id'];\n if ($member_id <= 0) {\n $username = do_lang('SYSTEM');\n $from_url = '';\n $avatar_url = find_theme_image('cns_default_avatars/default');\n } else {\n $username = $GLOBALS['FORUM_DRIVER']->get_username($member_id, true);\n $from_url = $GLOBALS['FORUM_DRIVER']->member_profile_url($member_id, true);\n $avatar_url = $GLOBALS['FORUM_DRIVER']->get_member_avatar_url($member_id);\n }\n\n $_message = get_translated_tempcode('digestives_tin', $row, 'd_message');\n\n $url = mixed();\n switch ($row['d_notification_code']) {\n case 'cns_topic':\n if (is_numeric($row['d_code_category'])) { // Straight forward topic notification\n $url = $GLOBALS['FORUM_DRIVER']->topic_url(intval($row['d_code_category']), '', true);\n }\n break;\n }\n\n $rendered = do_template('NOTIFICATION_WEB', array(\n '_GUID' => '314db5380aecd610c7ad2a013743f614',\n 'ID' => strval($row['id']),\n 'SUBJECT' => $row['d_subject'],\n 'MESSAGE' => $_message,\n 'FROM_USERNAME' => $username,\n 'FROM_MEMBER_ID' => strval($member_id),\n 'URL' => $url,\n 'FROM_URL' => $from_url,\n 'FROM_AVATAR_URL' => $avatar_url,\n 'PRIORITY' => strval($row['d_priority']),\n 'DATE_TIMESTAMP' => strval($row['d_date_and_time']),\n 'DATE_WRITTEN_TIME' => get_timezoned_date($row['d_date_and_time']),\n 'NOTIFICATION_CODE' => $row['d_notification_code'],\n 'CODE_CATEGORY' => $row['d_code_category'],\n 'HAS_READ' => ($row['d_read'] == 1),\n ));\n $out->attach($rendered);\n }\n\n $max_rows = $GLOBALS['SITE_DB']->query_select_value('digestives_tin', 'COUNT(*)', $where + array('d_read' => 0));\n\n $ret = array($out, $max_rows);\n\n if ($start == 0) {\n require_code('caches2');\n put_into_cache('_get_notifications', 60 * 24, serialize(array($max)), null, get_member(), '', null, '', $ret);\n }\n\n return $ret;\n}", "function wpsp_email_notify( $inquiry_info, $is_operator = false, $is_tour_design = flase ) {\n\t\n\tif ( $is_operator ) {\n\t\t$subject = ( $is_tour_design ) ? esc_html__( 'Tour design:', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] : esc_html__( 'Tour inquiry:', 'discovertravel' ) . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'];\n\t} else {\n\t\t$subject = get_bloginfo('name') . ' ' . esc_html__( 'Notification', 'discovertravel' );\n\t}\n\t\n\t$guest_email = strip_tags( $inquiry_info['email'] );\n\t$operator_email = ot_get_option('operator-email');\n\t$noreply_email = ot_get_option('noreply-email');\n\t$emailTo = ( $is_operator ) ? $operator_email : $guest_email;\n\t\n\tif ( $is_operator ) {\n\t\t$headers = \"From: \" . $guest_email . \"\\r\\n\";\n\t\t$headers .= \"Reply-To: \" . $guest_email . \"\\r\\n\";\n\t} else {\n\t\t$headers = \"From: \" . $noreply_email . \"\\r\\n\";\n\t}\n\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\n\tif ( $is_tour_design ) {\n\t\t$custom_destination = '';\n\t\tforeach ( $inquiry_info['destinations'] as $destination ) :\n\t\t\t$custom_destination .=\t$destination . ', ';\n\t\tendforeach;\n\n\t\t$custom_style = '';\n\t\tforeach ( $inquiry_info['tourstyles'] as $style ) :\n\t\t\t$custom_style .=\t$style . ', ';\n\t\tendforeach;\n\t}\n\t\n\t$body = '<html><body style=\"background-color:#4caf50; padding-bottom:30px;\">';\n\t\n\t$body .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#333333\"><tbody>';\n \t$body .= '<tr>';\n $body .= '<td align=\"center\" valign=\"top\">';\n \n $body .= '<table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tbody>';\n $body .= '<tr>';\n $body .= '<td width=\"170\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px;\">';\n $body .= '<img src=\"'. ot_get_option('custom-logo') . '\">';\n $body .= '</td>';\n $body .= '<td width=\"470\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px; text-align:right;\">';\n $body .= '<font style=\"font-size:18px;line-height:18px\" face=\"Arial, sans-serif\" color=\"#ffffff\">' . esc_html__( 'Hotline Support: ', 'discovertravel' ) . '<font color=\"#ffffff\" style=\"text-decoration:none;color:#ffffff\">' . ot_get_option('operator-hotline') . '</font></font>';\n $body .= '<br><font style=\"font-size:14px;line-height:14px\" face=\"Arial, sans-serif\" color=\"#cccccc\"><a href=\"mailto:' . ot_get_option('operator-email') . '\" style=\"text-decoration:none\"><font color=\"#cccccc\">' . ot_get_option('operator-email') . '</font></a></font>';\n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n \n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n\n\t$body .= '<div style=\"max-width:640px; margin: 30px auto 20px; background-color:#fff; padding:30px;\">';\n\t$body .= '<table cellpadding=\"5\" width=\"100%\"><tbody>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\">';\n\tif ( $is_operator ) {\n\t\t$body .= '<p>' . esc_html__( 'Dear Operators', 'discovertravel' ) . ',</p>';\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review the tour customized from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['fullname'] . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review tour inquiry from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . '</strong>' . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t}\n\t\t\t\n\t} else {\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] . ',</p>';\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ',</p>';\t\n\t\t}\n\t\t$body .= '<p>' . esc_html__( 'Thank you very much for your kind interest in booking Tours in Cambodia with', 'discovertravel' ) . ' ' . get_bloginfo('name') . '. ' . esc_html__( 'One of our travel consultants will proceed your request and get back to you with BEST OFFERS quickly.', 'discovertravel' ) . '</p>';\n\t\t$body .= '<p>' . esc_html__( 'Please kindly check all the information of your inquiry again as below:', 'discovertravel' ) . '</p>';\n\t}\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . ( $is_tour_design ) ? esc_html__( 'Tour design summary:', 'discovertravel' ) : esc_html__( 'Tour inquiry summary:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\tif ( !$is_tour_design ) {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour name: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['tourname'] . ' ' . $inquiry_info['tourday'] . ' ' . esc_html__( 'Days', 'discovertravel' ) . '/' . ($inquiry_info['tourday'] - 1) . ' ' . esc_html__( 'Nights', 'discovertravel' ) . '</td>';\n\t\t$body .= '</tr>';\n\t} else {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Destinations: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_destination . '' . $inquiry_info['otherdestination'] . '</td>';\n\t\t$body .= '</tr>';\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour styles: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_style . '</td>';\n\t\t$body .= '</tr>';\n\t}\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Will travel as: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\" style=\"text-transform: capitalize;\">' . $inquiry_info['tourtype'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Total guests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">';\n\tif ( $inquiry_info['tourtype'] == 'solo' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 1';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'couple' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 2';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'family' || $inquiry_info['tourtype'] == 'group' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' ' . $inquiry_info['adult'] . ', ';\n\t\t$body .= esc_html__( 'Children:', 'discovertravel' ) . ' ' . $inquiry_info['children'] . ', '; \n\t\t$body .= esc_html__( 'Babies:', 'discovertravel' ) . ' ' . $inquiry_info['kids'];\n\t} // end tour type as family or group\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Hotel class: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['tourclass'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\tif ( $inquiry_info['flexibledate'] ) {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Flexible date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['manualdate'] . '</td>';\n\t} else {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Arrive date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . date(\"d F Y\", strtotime( $inquiry_info['departuredate'] )) . '</td>';\n\t}// end flexible date is checked\n\t$body .= '</tr>';\n\tif ( !empty( $inquiry_info['otherrequest'] ) ) {\n\t$body .= '<tr>';\n\t$body .= '<td valign=\"top\" style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Special requests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['otherrequest'] . '</td>';\n\t$body .= '</tr>';\n\t} // end other request\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"padding-top: 10px; border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . esc_html__( 'Contact info:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Full Name: ', 'discovertravel' ) . '</strong></td>';\n\tif ( $is_tour_design ) {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['fullname'] . '</strong></td>';\n\t} else {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'] . '</strong></td>';\n\t}\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Email: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['email'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Phone: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['phone'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Nationality: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['country'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '</tbody></table>';\n\n\tif ( !$is_operator )\n\t\t$body .= '<br><p><strong>' . esc_html__( 'Tips: ', 'discovertravel' ) . '</strong>' . esc_html__( 'If you submit incorrect information, please contact our travel consultants to change your information by ', 'discovertravel' ) . '<a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a></p>';\n\t\n\t$body .= '<p style=\"padding-top: 10px;\">' . esc_html__( 'Thanks & Best regards,', 'discovertravel') . '</p>';\t\n\n\tif ( !$is_operator ) {\n\t\t$body .= '<p style=\"border-top:1px solid #ccc; padding-top:30px; font-size:12px; color:#666666;\"><strong style=\"font-size:13px; color:#4caf50;\">' . get_bloginfo('name') . '</strong>';\n\t\t$body .= '<br>' . ot_get_option('operator-address');\n\t\t$body .= '<br><strong>' . esc_html__( 'T. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-phone');\n\t\t$body .= '<br><strong>' . esc_html__( 'E. ', 'discovertravel' ) . '</strong><a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a>';\n\t\t$body .= '<br><strong>' . esc_html__( 'F. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-fax');\n\t\t$body .= '<br><strong>' . esc_html__( 'W: ', 'discovertravel' ) . '</strong>' . get_bloginfo('wpurl', 'display') . '</p>';\n\t}\n\t$body .= '</div>'; //wrapper\n\t$body .= '</body></html>';\n\t\n\tif ( mail( $emailTo, $subject, $body, $headers ) ){\n\t\tif ( !$is_operator ) {\n\t\t\t$out = '<h3>' . esc_html__( 'Thank you for sending us your inquiry!', 'discovertravel' ) . '</h3>';\n\t\t\t$out .= '<p>' . esc_html__( 'We will contact you within 01 working day. If you have any questions, please kindly contact us at: ', 'discovertravel' );\n\t\t\t$out .= '<br>Email: <a href=\"mailto:' . $operator_email . '\">' . $operator_email . '</a>';\n\t\t\t$out .= '<br><span class=\"hotline\">Hotline: ' . ot_get_option('operator-hotline') . '</span></p>';\n\t\t\t$out .= '<p class=\"note\">Note: To ensure that you can receive a reply from us, Please kindly add the \"' . str_replace( 'http://', '', get_home_url() ) . '\" domain to your e-mail \"safe list\".<br>If you do not receive a response in your \"inbox\" within 12 hours, check your \"bulk mail\" or \"junk mail\" folders.</p>';\n\t\t\techo $out;\n\t\t}\n\t} else {\n\t\tif ( !$is_operator )\n\t\t\techo '<h5>' . esc_html__( 'Sorry, your inquiry cannot be send right now.', 'discovertravel' ) . '</h5><p>' . error_message . '</p>';\n\t}\n}", "public function user_notification(){\n $apiData = array();\n $this->loadModel('Post');\n $this->loadModel('Event');\n $this->loadModel('Notification');\n $id = $this->Auth->user('id');\n $notification = $this->Notification->getNotification($id);\n if(!empty($notification)) {\n $data = array();\n $keyValue = Hash::combine($notification ,'{n}.Notification.object_id','{n}.Notification.object_id','{n}.Notification.object_type');\n foreach ($keyValue as $key => $value) {\n switch($key){\n case OBJECT_TYPE_EVENT: \n $data[OBJECT_TYPE_EVENT] = $this->Event->getEventNotification(array_values($value));\n break;\n case OBJECT_TYPE_POST:\n $data[OBJECT_TYPE_POST] = $this->Post->getPostNotification(array_values($value));\n break;\n case OBJECT_TYPE_LEAVE:\n $data[OBJECT_TYPE_LEAVE] = $this->Leave->getLeaveNotification(array_values($value));\n break;\n case OBJECT_TYPE_BIRTHADAY:\n $data[OBJECT_TYPE_BIRTHADAY] = $this->Birthday->getBirthdayNotification(array_values($value));\n break;\n default:\n echo \"No information available for that day.\";\n break;\n }\n } \n }\n if(!empty($data)) {\n $apiData = $this->getFormatedData($notification, $data);\n }\n return $apiData;\n }", "function ciniki_musicfestivals_registrationsEmailSend(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'festival_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Festival'),\n 'teacher_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Teacher'),\n 'subject'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Subject'),\n 'message'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Message'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'musicfestivals', 'private', 'checkAccess');\n $rc = ciniki_musicfestivals_checkAccess($ciniki, $args['tnid'], 'ciniki.musicfestivals.registrationsEmailSend');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $strsql = \"SELECT registrations.id, \"\n . \"registrations.festival_id, \"\n . \"sections.id AS section_id, \"\n . \"registrations.teacher_customer_id, \"\n . \"teachers.display_name AS teacher_name, \"\n . \"registrations.billing_customer_id, \"\n . \"registrations.rtype, \"\n . \"registrations.rtype AS rtype_text, \"\n . \"registrations.status, \"\n . \"registrations.status AS status_text, \"\n . \"registrations.display_name, \"\n . \"registrations.class_id, \"\n . \"classes.code AS class_code, \"\n . \"classes.name AS class_name, \"\n . \"registrations.title1, \"\n . \"registrations.perf_time1, \"\n . \"registrations.title2, \"\n . \"registrations.perf_time2, \"\n . \"registrations.title3, \"\n . \"registrations.perf_time3, \"\n . \"IF(registrations.participation = 1, 'Virtual', 'In Person') AS participation, \"\n . \"FORMAT(registrations.fee, 2) AS fee, \"\n . \"registrations.payment_type \"\n . \"FROM ciniki_musicfestival_registrations AS registrations \"\n . \"LEFT JOIN ciniki_customers AS teachers ON (\"\n . \"registrations.teacher_customer_id = teachers.id \"\n . \"AND teachers.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_classes AS classes ON (\"\n . \"registrations.class_id = classes.id \"\n . \"AND classes.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_categories AS categories ON (\"\n . \"classes.category_id = categories.id \"\n . \"AND categories.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_sections AS sections ON (\"\n . \"categories.section_id = sections.id \"\n . \"AND sections.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE registrations.festival_id = '\" . ciniki_core_dbQuote($ciniki, $args['festival_id']) . \"' \"\n . \"AND registrations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND registrations.teacher_customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['teacher_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.musicfestivals', array(\n array('container'=>'registrations', 'fname'=>'id', \n 'fields'=>array('id', 'festival_id', 'teacher_name', 'display_name', \n 'class_id', 'class_code', 'class_name', \n 'title1', 'perf_time1', 'title2', 'perf_time2', 'title3', 'perf_time3', \n 'fee', 'payment_type', 'participation'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $html = '';\n $text = '';\n if( isset($rc['registrations']) ) {\n $festival['registrations'] = $rc['registrations'];\n $total = 0;\n $html = \"<table cellpadding=5 cellspacing=0>\";\n $html .= \"<tr><th>Class</th><th>Competitor</th><th>Title</th><th>Time</th><th>Virtual</th></tr>\";\n foreach($festival['registrations'] as $iid => $registration) {\n $html .= '<tr><td>' . $registration['class_code'] . '</td><td>' . $registration['display_name'] . '</td>'\n . '<td>' . $registration['title1'] \n . ($registration['title2'] != '' ? \"<br/>{$registration['title2']}\" : '')\n . ($registration['title3'] != '' ? \"<br/>{$registration['title3']}\" : '')\n . '</td>'\n . '<td>' . $registration['perf_time1'] \n . ($registration['perf_time2'] != '' ? \"<br/>{$registration['perf_time2']}\" : '')\n . ($registration['perf_time3'] != '' ? \"<br/>{$registration['perf_time3']}\" : '')\n . '</td>'\n . '<td>' . $registration['participation'] . \"</td></tr>\\n\";\n $text .= $registration['class_code'] \n . ' - ' . $registration['display_name'] \n . ($registration['title1'] != '' ? ' - ' . $registration['title1'] : '')\n . ($registration['perf_time1'] != '' ? ' - ' . $registration['perf_time1'] : '')\n . \"\\n\";\n if( $registration['title2'] != '' ) {\n $text .= preg_replace(\"/./\", '', $registration['class_code'])\n . ' - ' . preg_replace(\"/./\", '', $registration['display_name'])\n . ($registration['title2'] != '' ? ' - ' . $registration['title2'] : '')\n . ($registration['perf_time2'] != '' ? ' - ' . $registration['perf_time2'] : '')\n . \"\\n\";\n }\n if( $registration['title3'] != '' ) {\n $text .= preg_replace(\"/./\", '', $registration['class_code'])\n . ' - ' . preg_replace(\"/./\", '', $registration['display_name'])\n . ($registration['title3'] != '' ? ' - ' . $registration['title3'] : '')\n . ($registration['perf_time3'] != '' ? ' - ' . $registration['perf_time3'] : '')\n . \"\\n\";\n }\n }\n $html .= \"</table>\";\n } else {\n $festival['registrations'] = array();\n }\n\n $html_message = $args['message'] . \"<br/><br/>\" . $html;\n $text_message = $args['message'] . \"\\n\\n\" . $text;\n\n //\n // Lookup the teacher info\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'hooks', 'customerDetails');\n $rc = ciniki_customers_hooks_customerDetails($ciniki, $args['tnid'], \n array('customer_id'=>$args['teacher_id'], 'phones'=>'no', 'emails'=>'yes', 'addresses'=>'no', 'subscriptions'=>'no'));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['customer']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.102', 'msg'=>'No teacher found, we are unable to send the email.'));\n }\n $customer = $rc['customer'];\n\n //\n // if customer is set\n //\n if( !isset($customer['emails'][0]['email']['address']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.103', 'msg'=>\"The teacher doesn't have an email address, we are unable to send the email.\"));\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'hooks', 'addMessage');\n $rc = ciniki_mail_hooks_addMessage($ciniki, $args['tnid'], array(\n 'customer_id'=>$args['teacher_id'],\n 'customer_name'=>(isset($customer['display_name'])?$customer['display_name']:''),\n 'customer_email'=>$customer['emails'][0]['email']['address'],\n 'subject'=>$args['subject'],\n 'html_content'=>$html_message,\n 'text_content'=>$text_message,\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $ciniki['emailqueue'][] = array('mail_id'=>$rc['id'], 'tnid'=>$args['tnid']);\n\n return array('stat'=>'ok');\n}", "public function getUserNotifications($where, array $markers = []);", "function get_notifications($profile_id=0){\n\tglobal $mysqli;\n\n\t\t$query=\"SELECT * FROM event_invitees WHERE profile_id=\".$profile_id;\n\t\t$notifications=array();\n\t\t$result=$mysqli->query($query);\n\t\twhile($row=$result->fetch_assoc())\n\t\t{\n\t\t\t\n\t\t\t$response['notification_type']='event';\n\t\t\t$response['notification_status']=$row['accepted'];\n\t\t\t$response['notification_id']=$row['invitation_id'];\n\t\t\t$response['notification_datetime']=$row['created'];\n\n\t\t\t$sql_notifier=\"SELECT * FROM events WHERE event_id=\".$row['event_id'];\n\t\t\t$res_notifier=$mysqli->query($sql_notifier);\n\t\t\t$row_notifier=$res_notifier->fetch_assoc();\n\t\t\t$response['notification_by']=$row_notifier['event_createdby'];\n\t\t\t$sql_getprofile=\"SELECT * FROM profiles WHERE profile_id=\".$response['notification_by'];\n\t\t\t$res_getprofile=$mysqli->query($sql_getprofile);\n\t\t\t$row_getprofile=$res_getprofile->fetch_assoc();\n\t\t\t$response['notifier_profile_name']=$row_getprofile['profile_name'];\n\t\t\t$response['notifier_thumbnail']=$row_getprofile['profile_thumbnail'];\n\t\t\t$response['notification_title']=$row_notifier['event_title'];\n\t\t\t$response['event_details']=$row_notifier;\n\t\t\tarray_push($notifications, $response);\n\t\t\t//echo $row['event_id'];\n\t\t}\n\t\t$query2=\"SELECT * FROM friends2 WHERE profile2_id=\".$profile_id;\n\t\t$result2=$mysqli->query($query2);\n\t\twhile($row2=$result2->fetch_assoc())\n\t\t{\n\t\t\t$response2['notification_type']='friend';\n\t\t\t$response2['notification_status']=$row2['status'];\n\t\t\t$response2['notification_by']=$row2['profile1_id'];\n\t\t\t$sql_getprofile2=\"SELECT * FROM profiles WHERE profile_id=\".$response2['notification_by'];\n\t\t\t$res_getprofile2=$mysqli->query($sql_getprofile2);\n\t\t\t$row_getprofile2=$res_getprofile2->fetch_assoc();\n\t\t\t$response2['notifier_profile_name']=$row_getprofile2['profile_name'];\n\t\t\t$response2['notifier_thumbnail']=$row_getprofile2['profile_thumbnail'];\n\t\t\t$response2['notification_title']='New Friend Request';\n\t\t\tarray_push($notifications, $response2);\n\t\t\t//echo $row['event_id'];\n\t\t}\n\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($notifications, JSON_UNESCAPED_SLASHES);\n}", "public function cronNotifyRecipients()\n\t{\n\t\t// Check if notifications should be send.\n\t\tif (!$GLOBALS['TL_CONFIG']['avisota_send_notification'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->loadLanguageFile('avisota_subscription');\n\n\t\t$entityManager = EntityHelper::getEntityManager();\n\t\t$subscriptionRepository = $entityManager->getRepository('Avisota\\Contao:RecipientSubscription');\n\t\t$intCountSend = 0;\n\n\t\t$resendDate = $GLOBALS['TL_CONFIG']['avisota_notification_time'] * 24 * 60 * 60;\n\t\t$now = time();\n\n\t\t// Get all recipients.\n\t\t$queryBuilder = EntityHelper::getEntityManager()->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t\t->select('r')\n\t\t\t\t->from('Avisota\\Contao:Recipient', 'r')\n\t\t\t\t->innerJoin('Avisota\\Contao:RecipientSubscription', 's', 'WITH', 's.recipient=r.id')\n\t\t\t\t->where('s.confirmed=0')\n\t\t\t\t->andWhere('s.reminderCount < ?1')\n\t\t\t\t->setParameter(1, $GLOBALS['TL_CONFIG']['avisota_notification_count']);\n\t\t$queryBuilder->orderBy('r.email');\n\t\t\n\t\t// Execute Query.\n\t\t$query = $queryBuilder->getQuery();\n\t\t$integratedRecipients = $query->getResult();\n\t\t\n\t\t// Check each recipient with open subscription.\n\t\tforeach ($integratedRecipients as $integratedRecipient)\n\t\t{\n\t\t\t$subscriptions = $subscriptionRepository->findBy(array('recipient' => $integratedRecipient->id, 'confirmed' => 0), array('updatedAt' => 'asc'));\n\t\t\t$tokens = array();\n\t\t\t$blnNotify = false;\n\n\t\t\tforeach ($subscriptions as $subscription)\n\t\t\t{\n\t\t\t\t// Check if we are over the $resendDate date.\n\t\t\t\tif (($subscription->updatedAt->getTimestamp() + $resendDate) > $now)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Set some data.\n\t\t\t\t$blnNotify = true;\n\t\t\t\t$tokens[] = $subscription->getToken();\n\n\t\t\t\t// Update the subscription.\n\t\t\t\t$subscription->updatedAt = new \\Datetime();\n\t\t\t\t$subscription->reminderSent = new \\Datetime();\n\t\t\t\t$subscription->reminderCount = $subscription->reminderCount + 1;\n\n\t\t\t\t// Save.\n\t\t\t\t$entityManager->persist($subscription);\n\t\t\t}\n\n\t\t\t// Check if we have to send a notify and if we have a subscription module.\n\t\t\tif ($blnNotify && $subscription->getSubscriptionModule())\n\t\t\t{\n\t\t\t\t$subscription = $subscriptions[0];\n\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'email' => $integratedRecipient->email,\n\t\t\t\t\t'token' => implode(',', $tokens),\n\t\t\t\t);\n\n\t\t\t\t$arrPage = $this->Database\n\t\t\t\t\t\t->prepare('SELECT * FROM tl_page WHERE id = (SELECT avisota_form_target FROM tl_module WHERE id = ?)')\n\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t->execute($subscription->getSubscriptionModule())\n\t\t\t\t\t\t->fetchAssoc();\n\n\t\t\t\t$objNextPage = $this->getPageDetails($arrPage['id']);\n\t\t\t\t$strUrl = $this->generateFrontendUrl($objNextPage->row(), null, $objNextPage->rootLanguage);\n\n\t\t\t\t$url = $this->generateFrontendUrl($arrPage);\n\t\t\t\t$url .= (strpos($url, '?') === false ? '?' : '&');\n\t\t\t\t$url .= http_build_query($parameters);\n\n\t\t\t\t$newsletterData = array();\n\t\t\t\t$newsletterData['link'] = (object) array(\n\t\t\t\t\t\t\t'url' => \\Environment::getInstance()->base . $url,\n\t\t\t\t\t\t\t'text' => $GLOBALS['TL_LANG']['avisota_subscription']['confirmSubscription'],\n\t\t\t\t);\n\n\t\t\t\t// Try to send the email.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->sendMessage($integratedRecipient, $GLOBALS['TL_CONFIG']['avisota_notification_mail'], $GLOBALS['TL_CONFIG']['avisota_default_transport'], $newsletterData);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exc)\n\t\t\t\t{\n\t\t\t\t\t$this->log(sprintf('Unable to send reminder to \"%s\" with error message - %s', $integratedRecipient->email, $exc->getMessage()), __CLASS__ . ' | ' . __FUNCTION__, TL_ERROR);\n\t\t\t\t}\n\n\t\t\t\t// Update recipient;\n\t\t\t\t$integratedRecipient->updatedAt = new \\DateTime();\n\n\t\t\t\t// Set counter.\n\t\t\t\t$intCountSend++;\n\t\t\t}\n\n\t\t\t// Send only 5 mails per run.\n\t\t\tif ($intCountSend >= 5)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$entityManager->flush();\n\t}", "function sendMailForWishlistProductPromotion($promoId, $productIdPromotion, $con) {\n if (in_array('all', $productIdPromotion)) {\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email, tu.username FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id\";\n } else {\n $pids = implode(',', $productIdPromotion);\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id WHERE tw.product_id IN ($pids)\";\n }\n $rs = exec_query($qq, $con);\n if (mysqli_num_rows($rs)) {\n $emails = array();\n while ($row = mysqli_fetch_object($rs)) {\n $emails[] = $row->email;\n }\n\n /* fetch promotion details */\n $rsPromo = exec_query(\"SELECT * FROM tbl_promotion WHERE promo_id = '$promoId'\", $con);\n $promotion = mysqli_fetch_object($rsPromo);\n if ($promotion->percent_or_amount == 'percent') {\n $detail = \"FLAT $promotion->promo_value % OFF !!!\";\n } elseif ($promotion->percent_or_amount == 'amount') {\n $detail = \"SAVE $ $promotion->promo_value !!!\";\n }\n\n\n /* fetch emaiul template */\n $rsEmail = exec_query(\"SELECT * FROM tbl_email_template WHERE type = 'promotion'\", $con);\n $rowEmail = mysqli_fetch_object($rsEmail);\n $content = $rowEmail->content;\n\n $contentHTML = html_entity_decode($content);\n $contentHTML = str_replace('{jhm :', '', $contentHTML); // replace all '{jhm : '\n $arraySearch = array(' promotion_title}', ' promotion_detail}'); // isko replace krna h\n $arrayReplace = array($promotion->title, $detail); // isse replace krna h\n $content = str_replace($arraySearch, $arrayReplace, $contentHTML); // yha milega sb\n // now send mail\n sendMail('New Promotion!!! Check it out on ' . siteName, $content, $emails, $con);\n }\n}", "function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)\n{\n\tglobal $bb_cfg, $lang, $db;\n\tglobal $userdata;\n\n\tif (!$bb_cfg['topic_notify_enabled'])\n\t{\n\t\treturn;\n\t}\n\n\t$current_time = time();\n\n\tif ($mode != 'delete')\n\t{\n\t\tif ($mode == 'reply')\n\t\t{\n\t\t\t$sql = \"SELECT ban_userid\n\t\t\t\tFROM bb_banlist\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$user_id_sql = '';\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\tif (isset($row['ban_userid']) && !empty($row['ban_userid']))\n\t\t\t\t{\n\t\t\t\t\t$user_id_sql .= ', ' . $row['ban_userid'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"SELECT u.user_id, u.user_email, u.user_lang\n\t\t\t\tFROM bb_topics_watch tw, bb_users u\n\t\t\t\tWHERE tw.topic_id = $topic_id\n\t\t\t\t\tAND tw.user_id NOT IN (\" . $userdata['user_id'] . \", \" . ANONYMOUS . $user_id_sql . \")\n\t\t\t\t\tAND tw.notify_status = \" . TOPIC_WATCH_UN_NOTIFIED . \"\n\t\t\t\t\tAND u.user_id = tw.user_id\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\t$update_watched_sql = '';\n\t\t\t$bcc_list_ary = array();\n\n\t\t\tif ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t// Sixty second limit\n\t\t\t\t@set_time_limit(60);\n\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif ($row['user_email'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$bcc_list_ary[$row['user_lang']][] = $row['user_email'];\n\t\t\t\t\t}\n\t\t\t\t\t$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];\n\t\t\t\t}\n\t\t\t\twhile ($row = $db->sql_fetchrow($result));\n\n\t\t\t\t//\n\t\t\t\t// Let's do some checking to make sure that mass mail functions\n\t\t\t\t// are working in win32 versions of php.\n\t\t\t\t//\n\t\t\t\tif (preg_match('/[c-z]:\\\\\\.*/i', getenv('PATH')) && !$bb_cfg['smtp_delivery'])\n\t\t\t\t{\n\t\t\t\t\t$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';\n\n\t\t\t\t\t// We are running on windows, force delivery to use our smtp functions\n\t\t\t\t\t// since php's are broken by default\n\t\t\t\t\tif (!@$ini_val('sendmail_path')) {\n\t\t\t\t\t$bb_cfg['smtp_delivery'] = 1;\n\t\t\t\t\t$bb_cfg['smtp_host'] = @$ini_val('SMTP');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sizeof($bcc_list_ary))\n\t\t\t\t{\n\t\t\t\t\trequire SITE_DIR . 'includes/emailer.php';\n\t\t\t\t\t$emailer = new emailer($bb_cfg['smtp_delivery']);\n\n\t\t\t\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($bb_cfg['script_path']));\n\t\t\t\t\t$script_name = ($script_name != '') ? $script_name . '/viewtopic.php' : 'viewtopic.php';\n\t\t\t\t\t$server_name = trim($bb_cfg['server_name']);\n\t\t\t\t\t$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';\n\t\t\t\t\t$server_port = ($bb_cfg['server_port'] <> 80) ? ':' . trim($bb_cfg['server_port']) . '/' : '/';\n\n\t\t\t\t\t$orig_word = array();\n\t\t\t\t\t$replacement_word = array();\n\t\t\t\t\tobtain_word_list($orig_word, $replacement_word);\n\n\t\t\t\t\t$emailer->from($bb_cfg['board_email']);\n\t\t\t\t\t$emailer->replyto($bb_cfg['board_email']);\n\n\t\t\t\t\t$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);\n\n\t\t\t\t\t@reset($bcc_list_ary);\n\t\t\t\t\twhile (list($user_lang, $bcc_list) = each($bcc_list_ary))\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->use_template('topic_notify', $user_lang);\n\n\t\t\t\t\t\tfor ($i = 0; $i < count($bcc_list); $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->bcc($bcc_list[$i]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The Topic_reply_notification lang string below will be used\n\t\t\t\t\t\t// if for some reason the mail template subject cannot be read\n\t\t\t\t\t\t// ... note it will not necessarily be in the posters own language!\n\t\t\t\t\t\t$emailer->set_subject($lang['Topic_reply_notification']);\n\n\t\t\t\t\t\t// This is a nasty kludge to remove the username var ... till (if?)\n\t\t\t\t\t\t// translators update their templates\n\t\t\t\t\t\t$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);\n\n\t\t\t\t\t\t$emailer->assign_vars(array(\n\t\t\t\t\t\t\t'EMAIL_SIG' => (!empty($bb_cfg['board_email_sig'])) ? str_replace('<br />', \"\\n\", \"-- \\n\" . $bb_cfg['board_email_sig']) : '',\n\t\t\t\t\t\t\t'SITENAME' => $bb_cfg['sitename'],\n\t\t\t\t\t\t\t'TOPIC_TITLE' => $topic_title,\n\n\t\t\t\t\t\t\t'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . \"=$post_id#$post_id\",\n\t\t\t\t\t\t\t'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . \"=$topic_id&unwatch=topic\")\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$emailer->send();\n\t\t\t\t\t\t$emailer->reset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\tif ($update_watched_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE bb_topics_watch\n\t\t\t\t\tSET notify_status = \" . TOPIC_WATCH_NOTIFIED . \"\n\t\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\t\tAND user_id IN ($update_watched_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT topic_id\n\t\t\tFROM bb_topics_watch\n\t\t\tWHERE topic_id = $topic_id\n\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\n\t\tif (!$notify_user && !empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"DELETE FROM bb_topics_watch\n\t\t\t\tWHERE topic_id = $topic_id\n\t\t\t\t\tAND user_id = \" . $userdata['user_id'];\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t\telse if ($notify_user && empty($row['topic_id']))\n\t\t{\n\t\t\t$sql = \"INSERT INTO bb_topics_watch (user_id, topic_id, notify_status)\n\t\t\t\tVALUES (\" . $userdata['user_id'] . \", $topic_id, 0)\";\n\t\t\tif (!$db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t}\n\t}\n}", "public function sendNotifyEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->template->notifyEmailToAddress;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n $email->fromEmail = $this->template->notifyEmailToAddress;\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->notifyEmailSubject;\n\t\t$email->htmlBody = $this->template->notifyEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n }", "private function sendEmails($assigned_users){\n\t\t//For each user\n\t\tforeach($assigned_users as $giver){\n\t\t\t//Send the following email\n\t\t\t$email_body = \"Olá {$giver['name']},\n\t\t\t\tPara o Pai Natal Secreto desde ano, vais comprar um presente ao/à {$giver['giving_to']['name']}\n\n\t\t\t\tOs presentes devem todos ser até mais/menos €{$this->item_value},\n\n\t\t\t\tBoa Sorte e Feliz Natal,\n\t\t\t\tPai Natal\n\t\t\t\t\";\n\t\t\t//Log that its sent\n\t\t\t$this->sent_emails[] = $giver['email'];\n\t\t\t//Send em via normal PHP mail method\n\t\t\tmail($giver['email'], $this->mail_title, $email_body, \"From: {$this->mail_from}\\r\\n\");\n\t\t}\n\t}", "function send_notification($msg, $users) {\n\n $android_user = array();\n $ios_user = array();\n\n foreach ($users as $user) {\n\n if ($user['DeviceType'] == 'A') {\n $android_user[] = $user['DeviceId'];\n }\n\n if ($user['DeviceType'] == 'I') {\n $ios_user[] = $user['DeviceId'];\n }\n }\n\n if (!empty($android_user)) {\n\n //Android connection\n $url = 'https://android.googleapis.com/gcm/send';\n $headers = array(\n 'Authorization:key=' . GOOGLE_API_KEY,\n 'Content-Type: application/json'\n );\n //End\n\n $message = array(\"title\" => $msg);\n // Set POST variables\n $fields = array(\n 'registration_ids' => $android_user,\n 'data' => $message,\n );\n\n // Open connection\n $ch = curl_init();\n // Set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n // Disabling SSL Certificate support temporarly\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n // Execute post\n curl_exec($ch);\n // Close connection\n curl_close($ch);\n //echo $result;\n }\n\n// Push Notification for IOS\n if (!empty($ios_user)) {\n\n foreach ($ios_user as $deviceToken) {\n\n ////////////////////////////////////////////////////////////////////////////////\n\n $ctx = stream_context_create();\n\n stream_context_set_option($ctx, 'ssl', 'local_cert', PEM_CERTIFICATE);\n stream_context_set_option($ctx, 'ssl', 'passphrase', PASSPHRASE);\n\n // Open a connection to the APNS server\n $fp = stream_socket_client(\n 'ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);\n\n if (!$fp)\n exit(\"Failed to connect: $err $errstr\" . PHP_EOL);\n\n\n // Create the payload body\n $body['aps'] = array(\n 'alert' => $msg,\n 'sound' => 'default'\n );\n\n // Encode the payload as JSON\n $payload = json_encode($body);\n\n // Build the binary notification\n $msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;\n\n // Send it to the server\n $result = fwrite($fp, $msg, strlen($msg));\n\n// if (!$result)\n// echo 'Message not delivered' . PHP_EOL;\n// else\n// echo 'Message successfully delivered' . PHP_EOL;\n // Close the connection to the server\n fclose($fp);\n }\n }\n }", "public function todayBirthday_notification() {\n $this->layout = 'front_end';\n $todayDate = date('Y-m-d');\n $users = $this->User->userList();\n foreach ($users as $value) {\n $userEmail= $value['User']['email'];\n $userName= $value['User']['first_name'];\n $birthdaydata = $this->User->userBirthday($todayDate);\n foreach ($birthdaydata as $birthdayvalue) {\n $birthday_boy_name= $birthdayvalue['User']['name'];\n $url = Router::url(array(\n 'controller' => 'users',\n 'action' => 'login', ), true);\n $dataArry = array('birthday_boy_name'=>$birthday_boy_name,\n 'user_name'=>$userName,\n 'url'=>$url, );\n if ($userName != $publisher_name) {\n $Email = new Email();\n $send = $Email->sendEmail($userEmail, 'Birthday Notification', 'today_birthday_notification', $dataArry);\n }\n }\n }\n }", "function sendNotificationEmail($notification) {\n\t\t$userId = $notification->getUserId();\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$user = $userDao->getUser($userId);\n\t\tAppLocale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));\n\n\t\tif ($notification->getIsLocalized()) {\n\t\t\t$params = array('param' => $notification->getParam());\n\t\t\t$notificationTitle = __($notification->getTitle(), $params);\n\t\t\t$notificationContents = __($notification->getContents(), $params);\n\t\t} else {\n\t\t\t$notificationTitle = $notification->getTitle();\n\t\t\t$notificationContents = $notification->getContents();\n\t\t}\n\n\t\timport('classes.mail.MailTemplate');\n\t\t$site =& Request::getSite();\n\t\t$mail = new MailTemplate('NOTIFICATION');\n\t\t$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());\n\t\t$mail->assignParams(array(\n\t\t\t'notificationTitle' => $notificationTitle,\n\t\t\t'notificationContents' => $notificationContents,\n\t\t\t'url' => $notification->getLocation(),\n\t\t\t'siteTitle' => $site->getLocalizedTitle()\n\t\t));\n\t\t$mail->addRecipient($user->getEmail(), $user->getFullName());\n\t\t$mail->send();\n\t}", "public function actionNotifyHiddenProfiles(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $hidden = UserStat::model()->findAll(\"completeness < :comp\",array(\":comp\"=>PROFILE_COMPLETENESS_MIN));\n $c = 0;\n foreach ($hidden as $stat){\n //set mail tracking\n if ($stat->user->status == 0) continue; // skip non active users\n if (strtotime($stat->user->lastvisit_at) < strtotime('-2 month')) continue; // skip users who haven't been on our platform for more than 2 months\n \n //echo $stat->user->email.\" - \".$stat->user->name.\" \".$stat->user->surname.\" \".$stat->user->lastvisit_at.\" your profile is not visible!\";\n //continue;\n \n $mailTracking = mailTrackingCode($stat->user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'hidden-profiles';\n $ml->user_to_id = $stat->user->id;\n $ml->save();\n \n $email = $stat->user->email;\n $message->subject = $stat->user->name.\" your Cofinder profile is hidden!\";\n \n $content = 'Your profile on Cofinder is not visible due to lack of information you provided. \n If you wish to be found we suggest you take a few minutes and '.\n mailButton(\"fill it up\", absoluteURL('/profile'),'success',$mailTracking,'fill-up-button');\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($email);\n Yii::app()->mail->send($message);\n\n Notifications::setNotification($stat->user_id,Notifications::NOTIFY_INVISIBLE);\n $c++;\n }\n Slack::message(\"CRON >> Hidden profiles: \".$c);\n return 0;\n }", "function send_notification($notification_array = array()) {\n App::import('Model', 'UserNotification');\n $this->UserNotification = new UserNotification();\n $notification['UserNotification'] = $notification_array;\n $this->UserNotification->save($notification);\n }", "function blast_authd_post()\n\t{\n\t\t$notification_subject\t= $this->input->post('notification_subject');\t\t\n\t\t$notification_message\t= $this->input->post('notification_message');\n\t\n\n\t\t// Get Users who have those methods set\n\t\tif ($users = $this->social_auth->get_users('active', 1, TRUE))\n\t\t{\t\t\n\t\t\tforeach ($users as $user)\n\t\t\t{\n\t\t\t\tif ($this_user_meta = $this->social_auth->get_user_meta_module($user->user_id, 'notifications'))\n\t\t\t\t{\n\t\t\t\t\t$frequency\t= $this->social_auth->find_user_meta_value('notifications_frequency', $this_user_meta);\n\t\t\t\t\t$do_email\t= $this->social_auth->find_user_meta_value('notifications_email', $this_user_meta);\n\t\t\t\t\t$do_sms\t\t= $this->social_auth->find_user_meta_value('notifications_sms', $this_user_meta);\n\t\t\t\t\t$do_mobile\t= $this->social_auth->find_user_meta_value('notifications_mobile', $this_user_meta);\n\n\t\n\t\t\t\t\t// Check Is Last Notification Is Not Too Soon\n\t\t\t\t\tif ($frequency != 'none')\n\t\t\t\t\t{\n\t\t\t\t\t\t$output = '';\n\t\t\t\t\t\n\t\t\t\t\t\t// Do Email\n\t\t\t\t\t\tif ($do_email == 'yes')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//$message = $this->load->view(config_item('email_templates').config_item('email_signup'), $data, true);\n\t\t\t\t\n\t\t\t\t\t\t\t$this->email->from(config_item('site_admin_email'), config_item('site_title'));\n\t\t\t\t\t\t\t$this->email->to($user->email);\n\t\t\t\t\t\t\t$this->email->subject($notification_subject);\n\t\t\t\t\t\t\t$this->email->message($notification_message);\n\t\t\t\t\t\t\t$this->email->send();\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t// Do Mobile PuSH\n\t\t\t\t\t\tif ($do_mobile == 'yes')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= 'Do PuSH';\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Do SMS\n\t\t\t\t\t\tif ($do_sms == 'yes')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Send a new outgoing SMS */\n\t\t\t\t\t\t\t$this->load->config('twilio/twilio');\n\t\t\t\t\t\t\t$this->load->library('twilio/twilio');\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$from \t\t= config_item('twilio_phone_number');\n\t\t\t\t\t\t\t$to\t\t\t= $user->phone_number;\n\t\t\t\t\t\t\t$message \t= $notification_message;\n\t\t\t\t\t\n\t\t\t\t\t\t\t$this->twilio->sms($from, $to, $message);\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\t\t}\n\t\t\n\t\t// Check User Frequency / Last Message Sent\n\t\t\n\t\t\n\t\t\n\t\t// Send Message To Users\t\t\n\t\tif ($output)\n\t\t{\n $message = array('status' => 'success', 'message' => 'Yay, the Notifications was installed');\n }\n else\n {\n $message = array('status' => 'error', 'message' => 'Dang Notifications could not be uninstalled');\n }\t\t\n\t\t\n\t\t$this->response($message, 200);\t\t\n\t}", "function notifyComments($cids, $type)\r\n {\r\n $my = JFactory::getUser();\r\n\r\n $database =& JFactory::getDBO();\r\n\r\n\r\n if (is_array($cids)) {\r\n $cids = implode(',',$cids);\r\n }\r\n\r\n $sentemail = \"\";\r\n $database->setQuery(\"SELECT * FROM #__comment WHERE id IN ($cids)\");\r\n $rows = $database->loadObjectList();\r\n if ($rows) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$my->id.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $myemail = $database->loadResult();\r\n $_notify_users = $this->_notify_users;\r\n\r\n foreach($rows as $row) {\r\n $this->_notify_users = $_notify_users;\r\n $this->setIDs($row->id, $row->contentid);\r\n $this->resetLists();\r\n $this->lists['name'] \t= $row->name;\r\n $this->lists['title'] \t= $row->title;\r\n $this->lists['notify'] \t= $row->notify;\r\n $this->lists['comment']\t= $row->comment;\r\n\r\n $email_writer = $row->email;\r\n /*\r\n * notify writer of approval\r\n */\r\n if ($row->userid > 0) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$row->userid.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $result = $database->loadAssocList();\r\n if ($result) {\r\n $user = $result[0];\r\n $email_writer = $user['email'];\r\n }\r\n }\r\n\r\n if ($email_writer && $email_writer != $myemail) {\r\n switch ($type) {\r\n \t\t\tcase 'publish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($temp=array($email_writer));\r\n $exclude = $myemail ? ($email_writer.','.$myemail): $email_writer;\r\n } else {\r\n $exclude = $myemail ? $myemail:\"\";\r\n }\r\n\t\t\t /*\r\n\t\t\t * notify users, moderators, admin\r\n\t\t\t */\r\n switch ($type) {\r\n case 'publish':\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n//\t \t \techo implode(',', $notification->getMailList($row->contentid));\r\n $templist = $this->getMailList($row->contentid, $exclude);\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($templist);\r\n }\r\n }\r\n return $sentemail;\r\n }", "function xgb_notify_user( $email_of_user, $subject, $message, $no_footer ) {\n\n\t// Add [MillionClues.NET] To The Subject\n\t$subject = '[MillionClues.NET] '.$subject;\n\n\t// Headers\n\t$headers = array();\n\t$headers[] = \"MIME-Version: 1.0\";\n\t$headers[] = \"Content-type: text/plain; charset=iso-8859-1\";\n\t$headers[] = \"Message-id: \" .sprintf( \"<%s.%s@%s>\", base_convert(microtime(), 10, 36), base_convert(bin2hex(openssl_random_pseudo_bytes(8)), 16, 36), $_SERVER['SERVER_NAME'] );\n\t$headers[] = \"From: MillionClues.NET <[email protected]>\";\n\t$headers[] = \"Reply-To: MillionClues.NET <[email protected]>\";\n\t$headers[] = \"X-Mailer: PHP/\" .phpversion();\n\t\n\tif( $no_footer === null ) {\n\t\t// Add Footer For Email\n\t\t$message .= \"\\r\\n\\r\\nSee all pending notifications: http://www.millionclues.net/wp-admin/admin.php?page=notifications \\r\\n\\r\\n- MillionClues.NET\\r\\n\\r\\n---\\r\\n\".xgb_generate_quote();\n\t}\n\t\n\t$emailSent = wp_mail( $email_of_user, $subject, $message, $headers );\n\treturn $emailSent;\n}", "function sendAdminNotifications($type, $memberID, $member_name = null)\n{\n\tglobal $modSettings, $language;\n\n\t$db = database();\n\n\t// If the setting isn't enabled then just exit.\n\tif (empty($modSettings['notify_new_registration']))\n\t{\n\t\treturn;\n\t}\n\n\t// Needed to notify admins, or anyone\n\trequire_once(SUBSDIR . '/Mail.subs.php');\n\n\tif ($member_name === null)\n\t{\n\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\n\t\t// Get the new user's name....\n\t\t$member_info = getBasicMemberData($memberID);\n\t\t$member_name = $member_info['real_name'];\n\t}\n\n\t// All membergroups who can approve members.\n\t$groups = [];\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tid_group\n\t\tFROM {db_prefix}permissions\n\t\tWHERE permission = {string:moderate_forum}\n\t\t\tAND add_deny = {int:add_deny}\n\t\t\tAND id_group != {int:id_group}',\n\t\t[\n\t\t\t'add_deny' => 1,\n\t\t\t'id_group' => 0,\n\t\t\t'moderate_forum' => 'moderate_forum',\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$groups) {\n\t\t\t$groups[] = $row['id_group'];\n\t\t}\n\t);\n\n\t// Add administrators too...\n\t$groups[] = 1;\n\t$groups = array_unique($groups);\n\n\t// Get a list of all members who have ability to approve accounts - these are the people who we inform.\n\t$current_language = User::$info->language;\n\t$db->query('', '\n\t\tSELECT \n\t\t\tid_member, lngfile, email_address\n\t\tFROM {db_prefix}members\n\t\tWHERE (id_group IN ({array_int:group_list}) OR FIND_IN_SET({raw:group_array_implode}, additional_groups) != 0)\n\t\t\tAND notify_types != {int:notify_types}\n\t\tORDER BY lngfile',\n\t\t[\n\t\t\t'group_list' => $groups,\n\t\t\t'notify_types' => 4,\n\t\t\t'group_array_implode' => implode(', additional_groups) != 0 OR FIND_IN_SET(', $groups),\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use ($type, $member_name, $memberID, $language) {\n\t\t\tglobal $scripturl, $modSettings;\n\n\t\t\t$replacements = [\n\t\t\t\t'USERNAME' => $member_name,\n\t\t\t\t'PROFILELINK' => $scripturl . '?action=profile;u=' . $memberID\n\t\t\t];\n\t\t\t$emailtype = 'admin_notify';\n\n\t\t\t// If they need to be approved add more info...\n\t\t\tif ($type === 'approval')\n\t\t\t{\n\t\t\t\t$replacements['APPROVALLINK'] = $scripturl . '?action=admin;area=viewmembers;sa=browse;type=approve';\n\t\t\t\t$emailtype .= '_approval';\n\t\t\t}\n\n\t\t\t$emaildata = loadEmailTemplate($emailtype, $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);\n\n\t\t\t// And do the actual sending...\n\t\t\tsendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);\n\t\t}\n\t);\n\n\tif (isset($current_language) && $current_language !== User::$info->language)\n\t{\n\t\t$lang_loader = new Loader(null, $txt, database());\n\t\t$lang_loader->load('Login', false);\n\t}\n}", "public static function getNotificationsAsHTML()\n {\n $db = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n\n $notifications = Notifications::getNotifications();\n if (!(is_array($notifications) && count($notifications))) {\n $notifications = '';\n } else {\n ob_start();\n if ($db->get_site_setting(\"developer_supress_notify\") != 1) {\n include 'templates/notification_box.tpl.php';\n }\n $notifications = ob_get_contents();\n ob_end_clean();\n }\n return $notifications;\n }", "function email_print_users_to_send($users, $nosenders=false, $options=NULL) {\n\n\tglobal $CFG;\n\n\t$url = '';\n\tif ( $options ) {\n\t\t$url = email_build_url($options);\n\t}\n\n\n\techo '<tr valign=\"middle\">\n <td class=\"legendmail\">\n <b>'.get_string('for', 'block_email_list'). '\n :\n </b>\n </td>\n <td class=\"inputmail\">';\n\n if ( ! empty ( $users ) ) {\n\n \techo '<div id=\"to\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo '<input type=\"hidden\" value=\"'.$userid.'\" name=\"to[]\" />';\n \t}\n\n \techo '</div>';\n\n \techo '<textarea id=\"textareato\" class=\"textareacontacts\" name=\"to\" cols=\"65\" rows=\"3\" disabled=\"true\" multiple=\"multiple\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo fullname( get_record('user', 'id', $userid) ).', ';\n \t}\n\n \techo '</textarea>';\n }\n\n \techo '</td><td class=\"extrabutton\">';\n\n\tlink_to_popup_window( '/blocks/email_list/email/participants.php?'.$url, 'participants', get_string('participants', 'block_email_list').' ...',\n 470, 520, get_string('participants', 'block_email_list') );\n\n echo '</td></tr>';\n echo '<tr valign=\"middle\">\n \t\t\t<td class=\"legendmail\">\n \t\t\t\t<div id=\"tdcc\"></div>\n \t\t\t</td>\n \t\t\t<td><div id=\"fortextareacc\"></div><div id=\"cc\"></div><div id=\"url\">'.$urltoaddcc.'<span id=\"urltxt\">&#160;|&#160;</span>'.$urltoaddbcc.'</div></td><td><div id=\"buttoncc\"></div></td></tr>';\n echo '<tr valign=\"middle\"><td class=\"legendmail\"><div id=\"tdbcc\"></div></td><td><div id=\"fortextareabcc\"></div><div id=\"bcc\"></div></td><td><div id=\"buttonbcc\"></div></td>';\n\n\n}", "function bp_course_send_quiz_notification( $to_user_id, $from_user_id,$quiz,$marks ) {\n\tglobal $bp;\n\n\t/* Let's grab both user's names to use in the email. */\n\t$sender_name = bp_core_get_user_displayname( $from_user_id, false );\n\t$reciever_name = bp_core_get_user_displayname( $to_user_id, false );\n\n\n\t/* Get the userdata for the reciever and sender, this will include usernames and emails that we need. */\n\t$reciever_ud = get_userdata( $to_user_id );\n\t$sender_ud = get_userdata( $from_user_id );\n\n\t/* Now we need to construct the URL's that we are going to use in the email */\n\t$sender_profile_link = site_url( BP_MEMBERS_SLUG . '/' . $sender_ud->user_login . '/' . $bp->profile->slug );\n\t$quiz_results_link = site_url( BP_MEMBERS_SLUG . '/' . $reciever_ud->user_login . '/' . $bp->course->slug . '/course-results' );\n\t$reciever_settings_link = site_url( BP_MEMBERS_SLUG . '/' . $reciever_ud->user_login . '/settings/notifications' );\n\n\t/* Set up and send the message */\n\t$to = $reciever_ud->user_email;\n\t$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s high-fived you!', 'bp-course' ), stripslashes($sender_name) );\n\n\t$message = sprintf( __(\n'Results for %s are out. You\\'ve recieved %s marks.\n\nsee quiz results %s ,evaluated by %s [%s]\n\n\n---------------------\n', 'bp-course' ), $quiz,$marks,$quiz_results_link ,$sender_name, $sender_profile_link);\n\n\nbp_notifications_add_notification(\"user_id=$to_user_id&component_name=quiz&component_action=quiz_results\");\n\necho 'notification';\n}", "function api_email_updates() {\n\t$rv = array(\"status\" => true);\n\t\n\t$query = \"SELECT `created_date` FROM `events` WHERE `type`='email' ORDER BY `created_date` DESC LIMIT 1\";\n\t$result = db_query($query);\n\t\n\tif (db_num_rows($result) > 0) {\n\t\t$row = db_fetch_assoc($result);\n\t\t\n\t\t$query = \"SELECT * FROM `events` WHERE `created_date` > '\".db_escape($row[\"created_date\"]).\"'\";\n\t}\n\telse {\n\t\t$query = \"SELECT * FROM `events`\";\n\t}\n\t\n\t$query .= \" GROUP BY `type`, `key` ORDER BY `created_date` ASC\";\n\t$result = db_query($query);\n\t\n\tif (db_num_rows($result) > 0) {\n\t\t$e = new Event();\n\t\t$e->type = \"email\";\n\t\t$e->user_id = sess_id();\n\t\t$e->save();\n\t\n\t\t$emails = array();\n\t\n\t\twhile ($row = db_fetch_assoc($result)) {\n\t\t\t$meta = json_decode($row[\"meta\"]);\n\t\t\t\n\t\t\tswitch ($row[\"type\"]) {\n\t\t\t\tcase \"extension:insert\":\n\t\t\t\t\t// Alert anyone who asked for notifications on all new extensions\n\t\t\t\t\t// except for the user who uploaded it.\n\t\t\t\t\t$user_query = \"SELECT * FROM `users` WHERE `email_preferences` & \".db_escape(User::$EMAIL_FLAG_EXTENSION_INSERT).\" AND `id` <> '\".db_escape($row[\"user_id\"]).\"'\";\n\t\t\t\t\t$user_result = db_query($user_query);\n\t\t\t\t\t\n\t\t\t\t\twhile ($user_row = db_fetch_assoc($user_result)) {\n\t\t\t\t\t\t$emails[$user_row[\"id\"]][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"extension:update\":\n\t\t\t\t\t// Alert anyone who asked for notifications on extension updates\n\t\t\t\t\t// when they've contributed to a locale.\n\t\t\t\t\t$user_query = \"SELECT \n\t\t\t\t\t\t\t`u`.*\n\t\t\t\t\t\tFROM `users` `u`\n\t\t\t\t\t\t\tLEFT JOIN `message_history` `mh` ON `u`.`id`=`mh`.`user_id`\n\t\t\t\t\t\t\tLEFT JOIN `message_index` `mi` ON `mh`.`message_index_id`=`mi`.`id`\n\t\t\t\t\t\tWHERE `mi`.`extension_id`='\".db_escape($meta->extension_id).\"'\n\t\t\t\t\t\t\tAND `u`.`id` <> '\".db_escape($row[\"user_id\"]).\"'\n\t\t\t\t\t\t\tAND `email_preferences` & \".db_escape(User::$EMAIL_FLAG_EXTENSION_UPDATE).\"\n\t\t\t\t\t\tGROUP BY `u`.`id`\";\n\t\t\t\t\t$user_result = db_query($user_query);\n\t\t\t\t\n\t\t\t\t\twhile ($user_row = db_fetch_assoc($user_result)) {\n\t\t\t\t\t\t$emails[$user_row[\"id\"]][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"locale:complete\":\n\t\t\t\t\t// Alert anyone who asked for notifications when a locale is completed on their extension.\n\t\t\t\t\t$extension = new Extension($meta->extension_id);\n\t\t\t\t\t$user = new User($extension->user_id);\n\t\t\t\t\t\n\t\t\t\t\tif ($user->email_preferences & User::$EMAIL_FLAG_LOCALE_COMPLETE) {\n\t\t\t\t\t\t$emails[$user->id][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"message:update\":\n\t\t\t\t\t// Alert anyone who asked for notifications when their translations are changed.\n\t\t\t\t\t$user = new User($meta->previous_user_id);\n\t\t\t\t\t\n\t\t\t\t\tif ($user->email_preferences & User::$EMAIL_FLAG_MESSAGE_CHANGE) {\n\t\t\t\t\t\t$mindex = new MessageIndex($meta->message_index_id);\n\t\t\t\t\t\t$meta->extension_id = $mindex->extension_id;\n\t\t\t\t\t\t$meta->name = $mindex->name;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emails[$user->id][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$email_objects = array();\n\t\t\n\t\t$default_locale_code = get_locale();\n\t\t\n\t\tforeach ($emails as $user_id => $events) {\n\t\t\t// Emails default to English, even if the API call is made to a localized subdomain.\n\t\t\tset_locale(\"en_US\");\n\t\t\t\n\t\t\t$user = new User($user_id);\n\t\t\t\n\t\t\tif ($user->preferred_locale) {\n\t\t\t\tset_locale($user->preferred_locale);\n\t\t\t}\n\t\t\t\n\t\t\t$email_object = array();\n\t\t\t$email_object[\"to\"] = $user->email;\n\t\t\t$email_object[\"subject\"] = __(\"email_notification_subject\");\n\t\t\t\n\t\t\tob_start();\n\t\t\tinclude INCLUDE_PATH . \"/templates/email/notification.php\";\n\t\t\t$html = ob_get_clean();\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\t$email_object[\"body\"] = $html;\n\t\t\n\t\t\t$email_objects[] = $email_object;\n\t\t}\n\t\t\n\t\tset_locale($default_locale_code);\n\t\t\n\t\tforeach ($email_objects as $email) {\n\t\t\temail($email[\"to\"], $email[\"subject\"], $email[\"body\"]);\n\t\t}\n\t}\n\t\n\treturn $rv;\n}", "public function notificationsAction()\n {\n \t$medium = User_Notification::MEDIUM_HOMEPAGE;\n \t$notifications = $this->_user->getNotifications($medium);\n \t$notifications = $this->_user->addDefaultNotifications($notifications, $medium);\n\n $form = new User_Notification_Form($notifications);\n $form->populateFromDatabaseData($notifications);\n\n $data = $this->_request->getPost();\n if(!$data || !$form->isValid($data)){\n // Display errors or empty form\n $this->view->form = $form;\n $this->view->status = null;\n return;\n }\n\n /**\n * Try to fetch the notification rows in DB for each itemType.\n * Create a blank one if it does not exist, then save it.\n */\n $table = new User_Notification();\n $elements = $form->getElements();\n foreach($elements as $element){\n \t$name = $element->getName();\n \tif(in_array($name, $this->_disregardUpdates)){\n \t\tcontinue;\n \t}\n\n \tif(!isset($data[$name])){\n \t\tcontinue;\n \t}\n\n \t$row = $notifications[$name];\n\t\t\t$row->notify = $element->getValue();\n\t\t\t$row->save();\n }\n\n $this->_user->clearCache();\n // Update successful\n $this->view->form = null;\n $this->view->status = true;\n }", "public function sendUserStatusChangeNotificationEmailDataProvider()\n {\n return [\n [1, 'getActivateCustomerTemplateId', 'customer/customer_change_status/email_activate_customer_template'],\n [0, 'getInactivateCustomerTemplateId', 'customer/customer_change_status/email_lock_customer_template']\n ];\n }", "public function sendAssignmentNotification()\n {\n \t$ctime = date('Y-m-d'); //get current day\n \n \t//get facebook id from the user setting for facebook reminder\n \t$this->PleAssignmentReminder->virtualFields = array('tid' => 'PleUserMapTwitter.twitterId');\n \n \t//get last sent id\n \t$last_sent_id = $this->PleLastReminderSent->find('first',array('conditions' => array('PleLastReminderSent.date' => $ctime, 'PleLastReminderSent.type' => 'twitter')));\n \n \tif( count($last_sent_id) > 0 ) {\n \t\t$options['conditions'][] = array('PleAssignmentReminder.id >' => $last_sent_id['PleLastReminderSent']['last_sent_rid']);\n \t}\n \n \t//get appController class object\n \t$obj = new AppController();\n \t$assignments = $obj->getAssignmentConstraints();\n \n \t//get today assignments\n \n \t$options['conditions'][] = $assignments;\n \t$options['fields'] = array('id', 'user_id', 'assignment_uuid', 'assignment_title', 'due_date', 'course_id');\n \t$options['order'] = array('PleAssignmentReminder.id ASC');\n \n \t//execute query\n \t$assignmnet_details = $this->PleAssignmentReminder->find('all', $options);\n \t\n \n \t//send twitter reminder\n \tforeach( $assignmnet_details as $assignmnet_detail ) {\n\t $user_id = $assignmnet_detail['PleAssignmentReminder']['user_id'];\n \t\t//$to_twitter = $assignmnet_detail['PleAssignmentReminder']['tid'];\n \t\t$body = $assignmnet_detail['PleAssignmentReminder']['assignment_title'];\n\t\t$course_id = $assignmnet_detail['PleAssignmentReminder']['course_id'];\n \t\t\n\t\t//get twitter users array if user is instructor\n \t\t$twitter_users_array = $this->getChildren( $user_id, $course_id );\n\t\t\n \t\t//set display date for assignments\n \t\t$originalDate = $assignmnet_detail['PleAssignmentReminder']['due_date'];\n\t\tif($originalDate != \"\"){\n \t\t$newDate = date(\"F d, Y\", strtotime($originalDate));\n \t\t$due_date = \" due on $newDate\";\n\t\t}else{\n\t\t \t$due_date = \" is due on NA\";\n\t\t }\n \t\t\n \t\t//compose mail date\n \t\t$mail_data = \"Assignment Reminder! $course_id. Your assignment, $body, $due_date.\";\n \t\t$subject = $course_id.\" - \".$body;\n \n\t\t//send the reminder to multiple users\n \t\tforeach ($twitter_users_array as $to_twitter_data ) {\n\t\t$to_twitter = $to_twitter_data['twitter_id'];\n \t\t$to_id = $to_twitter_data['id'];\n \t\t$send_twitter = $this->sendNotification( $to_twitter, $mail_data );\n \n \t\t//check for if facebook reminder sent\n \t\tif ( $send_twitter == 1) {\n \n \t\t\t//remove the previous entry of current date\n \t\t\t$this->PleLastReminderSent->deleteAll(array('PleLastReminderSent.date'=>$ctime, 'PleLastReminderSent.type'=>'twitter'));\n \t\t\t$this->PleLastReminderSent->create();\n \n \t\t\t//update the table for sent facebook reminder\n \t\t\t$data['PleLastReminderSent']['last_sent_rid'] = $assignmnet_detail['PleAssignmentReminder']['id'];\n \t\t\t$data['PleLastReminderSent']['type'] = 'twitter';\n \t\t\t$data['PleLastReminderSent']['date'] = $ctime;\n \t\t\t$this->PleLastReminderSent->save($data);\n \n \t\t\t//create the CSV user data array\n \t\t\t$csv_data = array('id'=>$to_id, 'tid'=>$to_twitter, 'mail_data'=> $mail_data);\n \n \t\t\t//write the csv\n \t\t\t$this->writeTwitterCsv($csv_data);\n \n \t\t\t//unset the csv data array\n \t\t\tunset($csv_data);\n \t\t} else if ( $send_twitter == 2) { //twitter app not following case(can be used for future for notification on dashboard)\n \t\t\t\n \t\t} else {\n \t\t\t//handling for twitter reminder failure\n\t \t\t$tw_data = array();\n\t \t\t$tw_data['AssignmentTwitterFailure']['twitter_id'] = $to_twitter;\n\t \t\t$tw_data['AssignmentTwitterFailure']['mail_data'] = $mail_data;\n\t \t\t$this->AssignmentTwitterFailure->create();\n\t \t\t$this->AssignmentTwitterFailure->save($tw_data);\n \t\t}\n\t\t}\n \t}\n }", "public function updateUserNotification(array $userNotification, $where = null, array $markers = []);", "function sendFirstReminderEmails($rows) {\t\t\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->first_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->first_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\telse\t\t\t\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET first_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\t\t\t\t\r\n\t}", "public function notify_list(){\n\n\t\tif(!empty($_SESSION[\"notify\"][\"messages\"])){\n\n\n\t\t\techo \"<ul id=\\\"notify-messages\\\">\";\n\t\t\tforeach ($_SESSION[\"notify\"][\"messages\"] as $message) {\n\t\t\t\techo \"<li data-type=\\\"\".$message[\"type\"].\"\\\">\" . $message[\"message\"] . \"</li>\";\n\t\t\t}\n\t\t\techo \"</ul>\";\n\t\t}\n\n\t\t//limpar o queue de notifications\n\t\tself::notify_empty();\n\n\t}", "private function notifyORS() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ORSNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $ORSNotification = new ORSNotification($subject, $emailBody);\r\n try {\r\n $ORSNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to ORS : '. $e);\r\n }\r\n }", "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "public function notifyUser($toUserID, $fromUserID, $kind=0, $productID = false, $messageUser = false)\r\n\t{\r\n\t\t$this->load->model('api/notification_push','push');\r\n\t\t$this->load->model('api/profile','profile');\r\n\t\t\r\n\t\t$userRow = $this->profile->get_user_profile($fromUserID, true);\r\n\t\t$userName = $userRow['first_name'];\r\n\t\t\r\n\t\t$notification_data = array();\r\n\r\n\t\tif ($productID != false)\r\n\t\t{\r\n\t\t\t$notification_data ['product_id'] = $productID;\r\n\t\t\t\r\n\t\t\t$this->load->model('api/product','product');\r\n\t\t\t$productRow = $this->product->get($productID);\r\n\t\t}\r\n\t\t//Create Journal\r\n\t\t$messagePushSubtitle = false;\r\n\t\tswitch($kind)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$message = 'aceptado tu solicitud.';\r\n\t\t\t\t$messagePush = $userName.' ha aceptado tu solicitud.';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$message = 'ahora te sigue.';\r\n\t\t\t\t$messagePush = 'Ahora te sigue '.$userName.'.';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\t$message = 'enviado una solicitud.';\r\n\t\t\t\t$messagePush = $userName.' ha enviado una solicitud.';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\t$message = 'te ha compartido.';\r\n\t\t\t\t$messagePush = $userName.' te ha compartido '.$productRow->product_name.'.';\r\n\t\t\t\tif (!empty($messageUser)){\r\n\t\t\t\t\t$messagePushSubtitle = $messageUser;\r\n\t\t\t\t\t$message = $messageUser;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\t$message = $messageUser;\r\n\t\t\t\t$messagePush = null;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\t$message = $messageUser;\r\n\t\t\t\t$messagePush = null;\r\n\t\t\t\t$kind = 3; \r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$message = '';\r\n\t\t\t\t$messagePush = null;\r\n\t\t\t\t$kind = 0; //gm-fix\t\t \r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t$notification_data ['message'] \t\t = $message;\r\n\t\t$notification_data ['user_id']\t\t = $toUserID;\r\n\t\t$notification_data ['target_user_id'] = $fromUserID;\r\n\t\t$notification_data ['kind']\t\t \t = $kind;\r\n\t\t\r\n\t\t\r\n\t\tlog_message('debug','************ Notification Crash ************');\r\n\t\tlog_message('debug',json_encode($notification_data));\r\n\t\t\r\n\t\tif($kind == '0' && $fromUserID == '1')\r\n\t\t{\r\n\t\t\tlog_message('debug','IMPOSIBLE NOTIFICATION FROM MANAGER');\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t$notification_id = $this->insert($notification_data);\r\n\t\t\r\n\t\tif ($messagePush != null)\r\n\t\t\t$update_data['delivery_status'] = $this->push->sendNotification($toUserID, $messagePush, $messagePushSubtitle, 1, $notification_id);\r\n\t\t\r\n\t\treturn $notification_id;\r\n\t}", "function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}", "public function index()\n {\n $user_id = Auth::id();\n $notifs = Notification::where('user_id', $user_id)->orWhere('receiving_id', $user_id)->get();\n foreach ($notifs as $request) {\n if ($request->receiving_id === Auth::id()) {\n $request['received'] = true;\n $profile = Profile::where('user_id', $request->user_id)->first();\n if ($profile === null) {\n $profile = ['ign'=>\"User hasn't completed their profile.\", 'friendCode' => '0'];\n }\n } else {\n $request['received'] = false;\n $profile = Profile::where('user_id', $request->receiving_id)->first();\n }\n $request['profile'] = $profile;\n }\n return $notifs;\n }", "public function trigger_notification()\n\t{\n \t\t\n\t\t $result=$this->Fb_common_func->send_notification($this->facebook,'Skywards meet me here!',array('100001187318347','1220631499','1268065008','1347427052','566769531'),'467450859982651|cf5YXgYRZZDJuvBF1_ZOyDyRJHM','100001187318347');\n\n\t echo $result;\n\t}", "public function it_sends_notification_to_user()\n {\n $this->migrateDatabase();\n $this->createUser();\n $user = UserModel::first();\n $bus = app('Joselfonseca\\LaravelTactician\\CommandBusInterface');\n $bus->addHandler('JJSoft\\SigesCore\\Notifications\\SendAppNotification\\SendAppNotificationCommand',\n 'JJSoft\\SigesCore\\Notifications\\SendAppNotification\\Handler\\SendAppNotificationCommandHandler');\n $bus->dispatch('JJSoft\\SigesCore\\Notifications\\SendAppNotification\\SendAppNotificationCommand', [\n 'user' => $user,\n 'type' => 'success',\n 'message' => 'Some Message'\n ],\n [\n 'JJSoft\\SigesCore\\Notifications\\SendAppNotification\\Middleware\\SetTheUserId'\n ]);\n $this->seeInDatabase('app_notifications', [\n 'user_id' => $user->id,\n 'type' => 'success',\n 'message' => 'Some Message'\n ]);\n }", "public static function informNotifications($sender) {\n $session = Gdn::session();\n if (!$session->isValid()) {\n return;\n }\n\n $activityModel = new ActivityModel();\n // Get five pending notifications.\n $where = [\n 'NotifyUserID' => Gdn::session()->UserID,\n 'Notified' => ActivityModel::SENT_PENDING];\n\n // If we're in the middle of a visit only get very recent notifications.\n $where['DateUpdated >'] = Gdn_Format::toDateTime(strtotime('-5 minutes'));\n\n $activities = $activityModel->getWhere($where, '', '', 5, 0)->resultArray();\n\n $activityIDs = array_column($activities, 'ActivityID');\n $activityModel->setNotified($activityIDs);\n\n $sender->EventArguments['Activities'] = &$activities;\n $sender->fireEvent('InformNotifications');\n\n foreach ($activities as $activity) {\n if ($activity['Photo']) {\n $userPhoto = anchor(\n img($activity['Photo'], ['class' => 'ProfilePhotoMedium']),\n $activity['Url'],\n 'Icon'\n );\n } else {\n $userPhoto = '';\n }\n\n $excerpt = '';\n $story = $activity['Story'] ?? null;\n $format = $activity['Format'] ?? HtmlFormat::FORMAT_KEY;\n $excerpt = htmlspecialchars($story ? Gdn::formatService()->renderExcerpt($story, $format) : $excerpt);\n $activityClass = ' Activity-'.$activity['ActivityType'];\n\n $sender->informMessage(\n $userPhoto\n .wrap($activity['Headline'], 'div', ['class' => 'Title'])\n .wrap($excerpt, 'div', ['class' => 'Excerpt']),\n 'Dismissable AutoDismiss'.$activityClass.($userPhoto == '' ? '' : ' HasIcon')\n );\n }\n }", "function oqp_bp_screen_notification_settings() {\r\n\t//check if at least one form has notifications enabled\r\n\t$forms_slugs = oqp_get_forms_page_ids();\r\n\tforeach ($forms_slugs as $form_slug) {\r\n\t\t$form = oqp_get_form_options($form_slug);\r\n\t\tif (!$form[email_notifications_enabled]) continue;\r\n\t\t$forms_notifications=true;\r\n\t}\r\n\tif (!$forms_notifications) return false;\r\n\t\r\n\t\r\n\t?>\r\n\t<table class=\"notification-settings zebra\" id=\"oqp-notification-settings\">\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<th class=\"icon\"></th>\r\n\t\t\t\t<th class=\"title\"><?php _e( 'One Quick Post', 'oqp' ) ?></th>\r\n\t\t\t\t<th class=\"yes\"><?php _e( 'Yes', 'buddypress' ) ?></th>\r\n\t\t\t\t<th class=\"no\"><?php _e( 'No', 'buddypress' )?></th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\r\n\t\t<tbody>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post is awaiting moderation', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_pending_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_pending_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post is published', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_approved_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_approved_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post has been deleted', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_deleted_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_deleted_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<?php do_action( 'oqp_bp_screen_notification_settings' ) ?>\r\n\t\t</tbody>\r\n\t</table>\r\n<?php\r\n}", "protected function renderNotifications()\n {\n $notifications = Yii::$app->getModule('notification')->getMailNotifications($this->user, $this->interval);\n\n $result['html'] = '';\n $result['text'] = '';\n\n foreach ($notifications as $notification) {\n $result['html'] .= $notification->render(BaseNotification::OUTPUT_MAIL);\n $result['text'] .= $notification->render(BaseNotification::OUTPUT_MAIL_PLAINTEXT);\n }\n\n return $result;\n }", "public function getWhoToNotifyByEmail()\n\t{\n\t\t//return array\n\t\t$group = Group::model()->findByPk($this->groupId);\n\t\t$emails = $group->getMembersByStatus(User::STATUS_ACTIVE);\n\t\treturn $emails->data;\n\t}", "public function notifyUser()\n { \n $message = trim(Input::get('message'));\n $apiType = trim(Input::get('apiType'));\n $mobileNotificationService = App::make('MobileNotificationService');\n $mobileNotificationService->notifyMobileAppUser($message, $apiType, App::environment('production')); \n }", "static function getNotifications($application=\"all\", $userName=\"\"){\n $usr = (!$userName)? (self::getUser()) : ($userName);\n $result = Array();\n return $result;\n }", "function notifyReg($uName,$eMail) { //notify a new user registration\r\n\tglobal $ax, $set, $today;\r\n\t\t\r\n\t//compose email message\r\n\t$subject = \"{$ax['log_new_reg']}: {$uName}\";\r\n\t$msgBody = \"\r\n<p>{$ax['log_new_reg']}:</p><br>\r\n<table>\r\n\t<tr><td>{$ax['log_un']}:</td><td>{$uName}</td></tr>\r\n\t<tr><td>{$ax['log_em']}:</td><td>{$eMail}</td></tr>\r\n\t<tr><td>{$ax['log_date_time']}:</td><td>\".IDtoDD($today).\" {$ax['at_time']} \".ITtoDT(date(\"H:i\")).\"</td></tr>\r\n</table>\r\n\";\r\n\t//send email\r\n\t$result = sendEml($subject,$msgBody,$set['calendarEmail'],1,0,0);\r\n\treturn $result;\r\n}", "function notification($notify) {\n include $_SERVER['DOCUMENT_ROOT'].'/config/database.php';\n try {\n $DB = new PDO($DB_DSN.\";dbname=\".$DB_NAME, $DB_USER, $DB_PASSWORD);\n $stmt = $DB->prepare(\"SELECT `comments_notify`, `likes_notify` FROM user_info WHERE acc_id=?\");\n $stmt->execute([$_SESSION['id']]);\n $user = $stmt->fetch();\n if (!empty($user)) {\n if (intval($user['comments_notify']) !== intval($notify['coms'])\n || intval($user['likes_notify']) !== intval($notify['likes'])) {\n try {\n $stmt = $DB->prepare(\"UPDATE user_info SET `comments_notify`=?, `likes_notify`=? WHERE acc_id=?\");\n $stmt->execute([$notify['coms'], $notify['likes'], $_SESSION['id']]);\n header('Location: ../settings.php?success=Notification settings changed !');\n } catch (PDOException $e) {\n header(\"Location: ../settings.php?error=Database error :(\");\n }\n } else {\n header(\"Location: ../settings.php?error=Notification unchanged !\");\n }\n }\n } catch (PDOException $e) {\n header(\"Location: ../settings.php?error=Database error :(\");\n }\n}", "function sendInfoMail()\t{\n\t\tif ($this->conf['infomail'] && $this->conf['email.']['field'])\t{\n\t\t\t$recipient='';\n\t\t\t$emailfields=t3lib_div::trimexplode(',',$this->conf['email.']['field']);\t\t\t\t\n\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t$recipient.=$recipient?$Arr[$this->conf['email.']['field']].';'.$recipient:$Arr[$this->conf['email.']['field']];\n\t\t\t}\n\t\t\t$fetch = t3lib_div::_GP('fetch');\n\t\t\tif ($fetch)\t{\n\t\t\t\t\t// Getting infomail config.\n\t\t\t\t$key= trim(t3lib_div::_GP('key'));\n\t\t\t\tif (is_array($this->conf['infomail.'][$key.'.']))\t\t{\n\t\t\t\t\t$config = $this->conf['infomail.'][$key.'.'];\n\t\t\t\t} else {\n\t\t\t\t\t$config = $this->conf['infomail.']['default.'];\n\t\t\t\t}\n\t\t\t\t$pidLock='';\n\t\t\t\tif (!$config['dontLockPid'] && $this->thePid)\t{\n\t\t\t\t\t$pidLock='AND pid IN ('.$this->thePid.') ';\n\t\t\t\t}\n\n\t\t\t\t\t// Getting records\n\t\t\t\tif (t3lib_div::testInt($fetch))\t{\n\t\t\t\t\t$DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$this->conf['uidField'],$fetch,$pidLock,'','','1');\n\t\t\t\t} elseif ($fetch) {\t// $this->conf['email.']['field'] must be a valid field in the table!\n\t\t\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t\t\tif ($ef) $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$ef,$fetch,$pidLock,'','','100');\n\t\t\t\t\t\tif (count($DBrows )) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Processing records\n\t\t\t\tif (is_array($DBrows))\t{\n\t\t\t\t\t//$recipient = $DBrows[0][$this->conf['email.']['field']];\n\t\t\t\t\tif ($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t$DBrows[0] = $this->userProcess('evalFunc',$DBrows[0]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->compileMail($config['label'], $DBrows, $this->getFeuserMail($DBrows[0],$this->conf), $this->conf['setfixed.']);\n\t\t\t\t} elseif ($this->cObj->checkEmail($fetch)) {\n\t\t\t\t\t$this->sendMail($fetch, '', '',trim($this->cObj->getSubpart($this->templateCode, '###'.$this->emailMarkPrefix.'NORECORD###')));\n\t\t\t\t}\n\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL_SENT###');\n\t\t\t} else {\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL###');\n\t\t\t}\n\t\t} else $content='Error: infomail option is not available or emailField is not setup in TypoScript';\n\t\treturn $content;\n\t}", "public function sendNotification($notification, $context, $data)\n {\n $users = $notification->getRecipients();\n foreach ($users as $user) {\n $this->sendToUser($notification, $context, $user, $data);\n }\n }", "function notifications()\r\r\n\t{\r\r\n\t\t$table \t\t\t\t\t\t\t= 'notifications';\r\r\n\t\t$condition \t\t\t\t\t\t= '';\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$notificationId \t\t\t= $this->uri->segment(3);\r\r\n\t\t\t$condition['nid'] \t\t\t= $notificationId;\t\t\t\r\r\n\t\t}\r\r\n\t\t$notifications \t\t\t\t\t= $this->base_model->fetch_records_from(\r\r\n\t\t$table, \r\r\n\t\t$condition, \r\r\n\t\t$select \t\t\t\t\t\t= '*', \r\r\n\t\t$order_by \t\t\t\t\t\t= ''\r\r\n\t\t);\r\r\n\t\t$this->data['notifications'] \t= $notifications;\r\r\n\t\tif ($this->uri->segment(3)) {\r\r\n\t\t\t$this->data['notificationTitle'] = $notifications[0]->title;\r\r\n\t\t}\r\r\n\t\t$this->data['content'] \t\t\t= 'general/notifications';\r\r\n\t\t$this->_render_page('temp/template', $this->data);\r\r\n\t}", "final public function get_notifications() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT notification_id, message, user_id, type, a_href, read_status, date_notified\r\n\t\t\tFROM `notifications`\r\n\t\t\tWHERE read_status = '\" . NotificationFactory::UNREAD . \"'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$notifications = array();\r\n\t\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\r\n\t\t\t\t$notification = '<a href=\"' . $row['a_href'] . '\">' . $row['message'] . '</a>';\r\n\t\t\t\tarray_push($notifications, $notification);\r\n\t\t\t}\r\n\t\t\treturn $notifications;\r\n\t\t}\r\n\t}", "private function mailer($id)\n {\n //server\n $server = Servers::where('server_id', $id)->firstOrFail();\n $server_name = $server->server_name;\n //apps\n $server_apps = ServerApp::where('server_id', $id)->get();\n //find the apps\n foreach ($server_apps as $serverapp)\n {\n $app_id = $serverapp->app_id;\n $appfunctionaladmincount = $this->countAppFunctionalAdmin($app_id);\n //check if persons exist\n if ($appfunctionaladmincount >=1){\n //find the persons\n $appfunctionaladmin = App_FunctionalAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($appfunctionaladmin as $functionaladmin)\n {\n $person_mail = $functionaladmin->persons->person_email;\n //run the mails\n if (filter_var($person_mail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_mail)){\n Mail::to($person_mail)->send(new OSnotifyMail($app_name,$server_name,$person_mail));\n }\n }\n }\n } \n $apptechadmincount = $this->countAppTechAdmin($app_id);\n if($apptechadmincount >=1){\n $apptechadmin = App_TechAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($apptechadmin as $techadmin)\n {\n $person_techmail = $techadmin->persons->person_email;\n //run the mails\n if (filter_var($person_techmail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_techmail)){\n Mail::to($person_techmail)->send(new OSnotifyMail($app_name,$server_name,$person_techmail));\n }\n } \n }\n }\n\n }\n }", "function pp_events_send_attend_notification( $to_user_id = 0, $from_user_id = 0, $post_id = 0 ) {\r\n\r\n\tif ( empty( $to_user_id ) || empty( $from_user_id ) || empty( $post_id ) )\r\n\t\treturn;\r\n\r\n\t$bp = buddypress();\r\n\r\n\r\n\t$send_notify = get_post_meta( $post_id, 'event-attend-notify', true );\r\n\r\n\tif ( ! empty( $send_notify ) ) {\r\n\r\n\t\tbp_notifications_add_notification( array(\r\n\t\t\t'user_id' => $to_user_id,\r\n\t\t\t'item_id' => $post_id,\r\n\t\t\t'secondary_item_id' => $from_user_id,\r\n\t\t\t'component_name' => $bp->events->id,\r\n\t\t\t'component_action' => 'event_attender'\r\n\t\t) );\r\n\t}\r\n\r\n\r\n\t// Check to see if the Event owner wants emails\r\n\tif( 'yes' == get_user_meta( (int)$to_user_id, 'notification_events', true ) ) {\r\n\r\n\t\t$sender_name = bp_core_get_user_displayname( $from_user_id, false );\r\n\t\t$receiver_name = bp_core_get_user_displayname( $to_user_id, false );\r\n\t\t$receiver_email = bp_core_get_user_email( $to_user_id );\r\n\r\n\t\t$sender_profile_link = trailingslashit( bp_core_get_user_domain( $from_user_id ) );\r\n\t\t$event_link = get_permalink( $post_id );\r\n\r\n\t\t$attendees = get_post_meta( $post_id, 'event-attendees', true );\r\n\t\tif( in_array( $from_user_id, $attendees ) )\r\n\t\t\t$going = __( 'is attending your Event', 'bp-simple-events' );\r\n\t\telse\r\n\t\t\t$going = __( 'is not attending your Event', 'bp-simple-events' );\r\n\r\n\t\t// Set up and send the message\r\n\t\t$to = $receiver_email;\r\n\t\t$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s %s', 'bp-simple_events' ), stripslashes( $sender_name ), $going );\r\n\r\n\r\n\t\t$message = sprintf( __(\r\n'%s %s\r\n\r\nTo see %s\\'s profile: %s\r\n\r\nEvent: %s\r\n\r\n---------------------\r\n', 'bp-simple_events' ), $sender_name, $going, $sender_name, $sender_profile_link, $event_link );\r\n\r\n\t\t// Only add the link to email notifications settings if the component is active\r\n\t\tif ( bp_is_active( 'settings' ) ) {\r\n\t\t\t$receiver_settings_link = trailingslashit( bp_core_get_user_domain( $to_user_id ) . bp_get_settings_slug() . '/notifications' );\r\n\t\t\t$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'bp-simple_events' ), $receiver_settings_link );\r\n\t\t}\r\n\r\n\t\twp_mail( $to, $subject, $message );\r\n\r\n\t}\r\n}", "function cmj_slack_notification( $_param1, $_param2 = null, $_param3 = null, $_param4 = null ) {\n // The Slack user name for the person the messages should come from.\n // Create a new user in Slack if you like or use an existing one.\n\t$_username = 'myname';\n // Name of the channel you want messages to appear in (without a preceding hashtag - just the channel name).\n\t$_channel = 'orders';\n // The message you want to send.\n\t$_msg = 'New order to ship #' . intval( $_param1 );\n // This script uses the simple token authentication. If you need something more have fun with OAuth https://api.slack.com/docs/oauth\n // Your Slack API token: https://api.slack.com/docs/oauth-test-tokens\n\t$_token = 'whatever-your-token-is';\n\t$_url = 'https://slack.com/api/chat.postMessage'\n\t\t. '?token=' . $_token\n\t\t. '&username=' . $_username\n\t\t. '&channel=' . $_channel\n\t\t. '&text=' . urlencode( $_msg );\n\t$_json = file_get_contents( $_url ); // you can use the Wordpress function wp_remote_get() instead if you prefer\n return $_json;\n}" ]
[ "0.7426494", "0.70351636", "0.70201355", "0.69475675", "0.6827156", "0.67342126", "0.6729391", "0.6700509", "0.66959125", "0.66824865", "0.65648675", "0.65417683", "0.65299207", "0.6506631", "0.64796877", "0.6459044", "0.6376755", "0.6348012", "0.63380975", "0.63247913", "0.6317304", "0.6304039", "0.62966263", "0.6277105", "0.62765735", "0.6242294", "0.621071", "0.6200154", "0.6199769", "0.61831367", "0.61810446", "0.61807007", "0.6178074", "0.6174975", "0.61679727", "0.6165374", "0.6147117", "0.61395234", "0.61340135", "0.6133458", "0.61217093", "0.6119003", "0.6118451", "0.6117953", "0.61168283", "0.61098146", "0.6086285", "0.6066757", "0.6065197", "0.6058196", "0.6045681", "0.6044976", "0.6033649", "0.60192925", "0.6014435", "0.6010543", "0.60010904", "0.6000218", "0.5997838", "0.5995554", "0.59947187", "0.5993245", "0.5988443", "0.59776247", "0.59747285", "0.5970947", "0.59698504", "0.5965366", "0.5959409", "0.5956771", "0.59453833", "0.5942597", "0.5941083", "0.59317756", "0.5929766", "0.59260774", "0.59228545", "0.592044", "0.59055775", "0.5904672", "0.59039605", "0.5903409", "0.59005326", "0.58917296", "0.5891499", "0.5891384", "0.5882754", "0.5878988", "0.5859024", "0.58498675", "0.58439153", "0.5843502", "0.58424115", "0.5829892", "0.582074", "0.58162576", "0.5813293", "0.581064", "0.5802574", "0.5802313" ]
0.6168883
34
Returns list of notification types [browser or email]
protected function getEventNotificationTypes($event_id, $role){ return [ 'browser' => NotificationsManage::find()->where(['event_id' =>$event_id])->andWhere(['role' => $role])->one()->browser == 1, 'email' => NotificationsManage::find()->where(['event_id' =>$event_id])->andWhere(['role' => $role])->one()->email == 1 ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotificationTypes()\n {\n return $this->notifications;\n }", "public function get_notification_types()\n {\n return false;\n }", "public function getNotifyType()\n\t{\n\t\treturn array( 'comments', ipsRegistry::getClass('class_localization')->words['gbl_comments_like'] );\n\t}", "public function getNotifications()\n\t{\n\t\t$arrReturn = array();\n\t\t\n\t\t$arrTypes = array_keys($GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['pct_customcatalog_frontedit']);\n\t\t\n\t\t$objNotifications = \\NotificationCenter\\Model\\Notification::findBy(array('FIND_IN_SET(type,?)'),implode(',',$arrTypes));\n\t\tif($objNotifications === null)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\tforeach($objNotifications as $objModel)\n\t\t{\n\t\t\t$arrReturn[ $objModel->id ] = $objModel->title;\n\t\t}\n\t\t\n\t\treturn $arrReturn;\n\t}", "function getConfiguredNotificationMethods($type = '*')\n{\n\tglobal $modSettings;\n\n\t$unserialized = Util::unserialize($modSettings['notification_methods']);\n\n\tif (isset($unserialized[$type]))\n\t{\n\t\treturn $unserialized[$type];\n\t}\n\n\tif ($type === '*')\n\t{\n\t\treturn $unserialized;\n\t}\n\n\treturn [];\n}", "function get_message_types() {\n\t$policy = new Config;\n\treturn $policy->getMessageTypes();\n}", "public static function get_types(){\n\t\t$types = [];\n\t\t$types[self::TYPE_ENROLLMENT] = get_string('messagetypeenrollment', 'local_custom_certification');\n\t\t$types[self::TYPE_UNENROLLMENT] = get_string('messagetypeunenrollment', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_EXPIRED] = get_string('messagetypecertificationexpired', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_COMPLETED] = get_string('messagetypecertificationcompleted', 'local_custom_certification');\n\t\t$types[self::TYPE_RECERTIFICATION_WINDOW_OPEN] = get_string('messagetyperecertificationwindowopen', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_BEFORE_EXPIRATION] = get_string('messagetyperecertificationbeforeexpiration', 'local_custom_certification');\n\n\t\treturn $types;\n\t}", "private function supportedTypes(): array\n {\n return [\n EmailContent::MAIL_FORMAT_TEXT,\n EmailContent::MAIL_FORMAT_MARKDOWN,\n EmailContent::MAIL_FORMAT_HTML\n ];\n }", "public function get_type()\n\t{\n\t\treturn 'notification.type.pm';\n\t}", "public static function notifications(): array\n {\n return [];\n }", "function _getNotificationSettingsMap() {\n\t\treturn array(\n\t\t\tNOTIFICATION_TYPE_ARTICLE_SUBMITTED => array('settingName' => 'notificationArticleSubmitted',\n\t\t\t\t'emailSettingName' => 'emailNotificationArticleSubmitted',\n\t\t\t\t'settingKey' => 'notification.type.articleSubmitted'),\n\t\t\tNOTIFICATION_TYPE_METADATA_MODIFIED => array('settingName' => 'notificationMetadataModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationMetadataModified',\n\t\t\t\t'settingKey' => 'notification.type.metadataModified'),\n\t\t\tNOTIFICATION_TYPE_SUPP_FILE_MODIFIED => array('settingName' => 'notificationSuppFileModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationSuppFileModified',\n\t\t\t\t'settingKey' => 'notification.type.suppFileModified'),\n\t\t\tNOTIFICATION_TYPE_GALLEY_MODIFIED => array('settingName' => 'notificationGalleyModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationGalleyModified',\n\t\t\t\t'settingKey' => 'notification.type.galleyModified'),\n\t\t\tNOTIFICATION_TYPE_SUBMISSION_COMMENT => array('settingName' => 'notificationSubmissionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationSubmissionComment',\n\t\t\t\t'settingKey' => 'notification.type.submissionComment'),\n\t\t\tNOTIFICATION_TYPE_LAYOUT_COMMENT => array('settingName' => 'notificationLayoutComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationLayoutComment',\n\t\t\t\t'settingKey' => 'notification.type.layoutComment'),\n\t\t\tNOTIFICATION_TYPE_COPYEDIT_COMMENT => array('settingName' => 'notificationCopyeditComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationCopyeditComment',\n\t\t\t\t'settingKey' => 'notification.type.copyeditComment'),\n\t\t\tNOTIFICATION_TYPE_PROOFREAD_COMMENT => array('settingName' => 'notificationProofreadComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationProofreadComment',\n\t\t\t\t'settingKey' => 'notification.type.proofreadComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_COMMENT => array('settingName' => 'notificationReviewerComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_FORM_COMMENT => array('settingName' => 'notificationReviewerFormComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerFormComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerFormComment'),\n\t\t\tNOTIFICATION_TYPE_EDITOR_DECISION_COMMENT => array('settingName' => 'notificationEditorDecisionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationEditorDecisionComment',\n\t\t\t\t'settingKey' => 'notification.type.editorDecisionComment'),\n\t\t\tNOTIFICATION_TYPE_USER_COMMENT => array('settingName' => 'notificationUserComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationUserComment',\n\t\t\t\t'settingKey' => 'notification.type.userComment'),\n\t\t\tNOTIFICATION_TYPE_PUBLISHED_ISSUE => array('settingName' => 'notificationPublishedIssue',\n\t\t\t\t'emailSettingName' => 'emailNotificationPublishedIssue',\n\t\t\t\t'settingKey' => 'notification.type.issuePublished'),\n\t\t\tNOTIFICATION_TYPE_NEW_ANNOUNCEMENT => array('settingName' => 'notificationNewAnnouncement',\n\t\t\t\t'emailSettingName' => 'emailNotificationNewAnnouncement',\n\t\t\t\t'settingKey' => 'notification.type.newAnnouncement'),\n\t\t);\n\t}", "public function via($notifiable)\n {\n $types = [];\n array_push($types, 'database');\n\n if(!is_null($this->user->settingNotifications))\n if($this->user->settingNotifications->email_new_test)\n array_push($types, 'mail');\n\n\n //Send sms notification\n if(!is_null($this->user->settingNotifications))\n if($this->user->settingNotifications->sms_new_test)\n SmsService::sendSmsNotification($this->user->getPhone(), 'SE-IIB, New test was created');\n\n return $types;\n }", "public static function types(): array\n {\n $config = app(ConfigInterface::class);\n\n return $config\n ->get('alert.types');\n }", "public function types()\n {\n return [\n static::TYPE_APP,\n static::TYPE_GALLERY,\n static::TYPE_PHOTO,\n static::TYPE_PLAYER,\n static::TYPE_PRODUCT,\n static::TYPE_SUMMARY,\n static::TYPE_SUMMARY_LARGE_IMAGE,\n ];\n }", "function _getNotificationSettingCategories() {\n\t\treturn array(\n\t\t\t'submissions' => array('categoryKey' => 'notification.type.submissions',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_ARTICLE_SUBMITTED, NOTIFICATION_TYPE_METADATA_MODIFIED, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED)),\n\t\t\t'reviewing' => array('categoryKey' => 'notification.type.reviewing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_REVIEWER_COMMENT, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT)),\n\t\t\t'editing' => array('categoryKey' => 'notification.type.editing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_GALLEY_MODIFIED, NOTIFICATION_TYPE_SUBMISSION_COMMENT, NOTIFICATION_TYPE_LAYOUT_COMMENT, NOTIFICATION_TYPE_COPYEDIT_COMMENT, NOTIFICATION_TYPE_PROOFREAD_COMMENT)),\n\t\t\t'site' => array('categoryKey' => 'notification.type.site',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_USER_COMMENT, NOTIFICATION_TYPE_PUBLISHED_ISSUE, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT)),\n\t\t);\n\t}", "public static function types()\n {\n return [\n self::TYPE_PERSONAL => Yii::t('app', 'Personal'),\n self::TYPE_BUSINESS => Yii::t('app', 'Business'),\n self::TYPE_CUSTOM => Yii::t('app', Yii::$app->holidaySettings->customHolidayName)\n ];\n }", "function notificationMethods()\n {\n static $methods;\n\n if (!isset($methods)) {\n $methods = array('notify' => array(\n '__desc' => _(\"Inline Notification\"),\n 'sound' => array('type' => 'sound',\n 'desc' => _(\"Play a sound?\"),\n 'required' => false)),\n 'mail' => array(\n '__desc' => _(\"Email Notification\"),\n 'email' => array('type' => 'text',\n 'desc' => _(\"Email address (optional)\"),\n 'required' => false)));\n /*\n if ($GLOBALS['registry']->hasMethod('sms/send')) {\n $methods['sms'] = array(\n 'phone' => array('type' => 'text',\n 'desc' => _(\"Cell phone number\"),\n 'required' => true));\n }\n */\n }\n\n return $methods;\n }", "public static function core_email_notifications() {\n\t\treturn array(\n\t\t\t'WP_Job_Manager_Email_Admin_New_Job',\n\t\t\t'WP_Job_Manager_Email_Admin_Updated_Job',\n\t\t\t'WP_Job_Manager_Email_Admin_Expiring_Job',\n\t\t\t'WP_Job_Manager_Email_Employer_Expiring_Job',\n\t\t);\n\t}", "public static function types()\n\t{\n\t\t$states = array(\n\t\t\t'blog' => __('Blog'),\n\t\t\t'page' => __('Page'),\n\t\t\t'user' => __('User')\n\t\t);\n\n\t\t$values = Module::action('gleez_types', $states);\n\n\t\treturn $values;\n\t}", "protected function updateNotificationTypes() {\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_user_notification_event_notification_type\n\t\t\tWHERE\t\teventID = ?\n\t\t\t\t\tAND userID = ?\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\tWCF::getDB()->beginTransaction();\n\t\t$notificationTypes = array();\n\t\tforeach ($this->settings as $eventID => $settings) {\n\t\t\t$statement->execute(array(\n\t\t\t\t$eventID,\n\t\t\t\tWCF::getUser()->userID\n\t\t\t));\n\t\t\t\n\t\t\tif ($settings['type']) {\n\t\t\t\t$notificationTypes[$eventID] = $settings['type'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($notificationTypes)) {\n\t\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_user_notification_event_notification_type\n\t\t\t\t\t\t(userID, eventID, notificationTypeID)\n\t\t\t\tVALUES\t\t(?, ?, ?)\";\n\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t\tforeach ($notificationTypes as $eventID => $type) {\n\t\t\t\t$statement->execute(array(\n\t\t\t\t\tWCF::getUser()->userID,\n\t\t\t\t\t$eventID,\n\t\t\t\t\t$type\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tWCF::getDB()->commitTransaction();\n\t}", "public static function getCustomMimeTypeList()\n {\n # Returns the system MIME type mapping of extensions to MIME types.\n $out = array();\n $file = fopen( Configuration::mimeTypeList, 'r' );\n while ( ( $line = fgets( $file ) ) !== false ) {\n $line = trim( preg_replace( '/#.*/', '', $line ) );\n if ( ! $line )\n continue;\n $parts = preg_split( '/\\s+/', $line );\n if ( count( $parts ) == 1 )\n continue;\n $type = array_shift( $parts );\n foreach( $parts as $part )\n $out[$part] = $type;\n }\n fclose( $file );\n return $out;\n }", "public static function getNotificationsByAdmin($type) {\n return PushNotification::select(\"push_notification.*\", DB::raw(\"DATE_FORMAT(push_notification.created_at, '%m-%d-%Y %H:%i:%s') as created\"), DB::raw(\"push_notification.type % 110 as recipient_id\"))\n ->whereIn('type', $type)\n ->groupBy('title')\n ->groupBy('message')\n ->groupBy('type')\n ->orderBy('created', 'DESC')\n ->paginate(config('constants.record_per_page'))\n ->toArray();\n }", "static public function getDeclaredNotifications(): array\n {\n return static::$declared_notifications;\n }", "public function notificationlist(){\n \n $select = $this->_db->select()\n ->from(array('MNT'=>MAIL_NOTIFY_TYPES), array('MNT.notification_id','MNT.notification_name','MNT.templatecategory_id'))\n\t\t ->where(\"MNT.notification_staus='1' AND MNT.templatecategory_id=1\")\n\t\t ->order(\"MNT.notification_name ASC\");\n $result = $this->getAdapter()->fetchAll($select);\n\t return $result;\n }", "public static function messageTypes(): array\n {\n return _dblog_get_message_types();\n }", "public function getNotificationsForUser($type)\n {\n $type == 'like' ? $typeNotification = NotificationEnum::LIKE_POST : ($type == 'comment' ? $typeNotification = NotificationEnum::COMMENT_POST : $typeNotification = NotificationEnum::FOLLOW_USER);\n $column = $this->model->fillable;\n $column[] = 'id as uuid';\n $notifications = $this->model->select($column)->whereNotifiableId(Auth::user()->id)->whereNotifiableType(NotificationEnum::MODEL_USER)->whereType($typeNotification);\n $updatenotifications = $notifications->update([\n 'view_at' => Carbon::now()\n ]);\n\n return $notifications->orderBy('created_at', 'DESC');\n }", "public function via($notifiable)\n {\n return !empty($this->message_type)\n ? [$this->message_type]\n : [\n $notifiable->account_user()->default_notification_type\n ];\n }", "public function via($notifiable)\n {\n return !empty($this->message_type)\n ? [$this->message_type]\n : [\n $notifiable->account_user()->default_notification_type\n ];\n }", "public function types() {\n return [\n self::TYPE_NONE => 'none',\n self::TYPE_WECHAT => 'wechat',\n self::TYPE_ALIPAY => 'alipay',\n self::TYPE_CASH => 'cash',\n ];\n }", "function monitor_list_activity_types() {\n $query = \"select distinct(`wf_type`) from `\".GALAXIA_TABLE_PREFIX.\"activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_type'];\n }\n return $ret; \n }", "public function get_all_message_type()\n\t{\n\t\t$query = $this->db->get('message_type');\n\t\treturn $query;\n\t}", "public function getSupportedMessagesByTypeMap()\n {\n return [\n 'Prooph\\ProcessingExample\\Type\\SourceUser' => ['collect-data']\n ];\n }", "public static function getAllMimeTypes():array;", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "public static function getNotifications()\n {\n $callbacks = Notifications::_checks();\n\n $notifications = array();\n foreach ($callbacks as $check) {\n $notification = call_user_func($check);\n if (is_array($notification)) {\n $notifications = array_merge($notifications, $notification);\n } elseif (strlen(trim($notification))) {\n $notifications[] = $notification;\n }\n }\n if (count(self::$notifications)) {\n $notifications = array_merge($notifications, self::$notifications);\n }\n if (count($notifications)) {\n return $notifications;\n } else {\n return null;\n }\n }", "public static function getNotificationsAsHTML()\n {\n $db = true;\n include GEO_BASE_DIR . 'get_common_vars.php';\n\n $notifications = Notifications::getNotifications();\n if (!(is_array($notifications) && count($notifications))) {\n $notifications = '';\n } else {\n ob_start();\n if ($db->get_site_setting(\"developer_supress_notify\") != 1) {\n include 'templates/notification_box.tpl.php';\n }\n $notifications = ob_get_contents();\n ob_end_clean();\n }\n return $notifications;\n }", "public static function get_activity_types()\n {\n \n \n $activity_icons = [\"1\"=>\"icon-user\", \n \"2\"=>\"icon-paper-plane\",\n \"3\"=>\"icon-star\",\n \"4\"=>\"icon-present\",\n \"5\"=>\"icon-bubbles\",\n \"6\"=>\"fa fa-fw fa-money\",\n \"7\"=>\"icon-heart\",\n \"8\"=>\"icon-power\",\n \"9\"=>\"icon-reload\",\n \"10\"=>\"icon-trash\"];\n \n return $activity_icons;\n }", "public function get_desired_types();", "public function getNotifType() {\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved notifications types',\n 'data' => NotifType::all()]);\n }", "public function get_event_types()\n {\n return array(0 => 'miscellaneous', 1 => 'appointment', 2 => 'holiday'\n ,3 => 'birthday', 4 => 'personal', 5 => 'education'\n ,6 => 'travel', 7 => 'anniversary', 8 => 'not in office'\n ,9 => 'sick day', 10 => 'meeting', 11 => 'vacation'\n ,12 => 'phone call', 13 => 'business'\n ,14 => 'non-working hours', 50 => 'special occasion'\n );\n }", "public function listNotifications()\r\n { \t \r\n \r\n \t$data = $this->call(array(), \"GET\", \"notifications.json\");\r\n \t$data = $data->{'notifications'};\r\n \t$notificationArray = new ArrayObject();\r\n \tfor($i = 0; $i<count($data);$i++){\r\n \t\t$notificationArray->append(new Notification($data[$i], $this));\r\n \t}\r\n \treturn $notificationArray;\r\n }", "public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }", "public function getType(): string\n {\n return $this->rawData['notificationType'];\n }", "function get_user_types() {\n\t$policy = new Config;\n\treturn $policy->getUserTypes();\n}", "function returnUserNotificationTypeText( $type ) {\n\tglobal $NOTIFICATION_TYPES;\n\n\treturn apply_filters( 'returnUserNotificationTypeText', __( $NOTIFICATION_TYPES[ $type ] ), $type );\n}", "function jgantt_dashboard_get_content_types() {\n $types = array();\n $result = db_query('SELECT d.node_type, d.configuration\n FROM {jgantt_dashboard} d WHERE d.status = :status', array(':status' => 1));\n\n foreach ($result as $record) {\n $types[$record->node_type] = $record;\n }\n return $types;\n}", "public static function getTypes() {\n\t\treturn array(self::TYPE_FILE, self::TYPE_SOURCE, self::TYPE_THUMBNAIL);\n\t}", "protected function types()\n\t{\n\t\treturn array_keys($this->config->get('outmess::styles.' . $this->style)); \n\t}", "final public function get_notifications() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT notification_id, message, user_id, type, a_href, read_status, date_notified\r\n\t\t\tFROM `notifications`\r\n\t\t\tWHERE read_status = '\" . NotificationFactory::UNREAD . \"'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$notifications = array();\r\n\t\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\r\n\t\t\t\t$notification = '<a href=\"' . $row['a_href'] . '\">' . $row['message'] . '</a>';\r\n\t\t\t\tarray_push($notifications, $notification);\r\n\t\t\t}\r\n\t\t\treturn $notifications;\r\n\t\t}\r\n\t}", "protected function getNotificationActions(): array {\n $notifications = [];\n $actions = $this->getActions();\n foreach ($actions as $key => $action) {\n if (!isset($action['enable_notifications']) || $action['enable_notifications'] === FALSE) {\n continue;\n }\n if ($key === 'moderation_state_published') {\n $action['title'] = $this->t('Publish now');\n }\n\n $notifications[$key] = [\n '#type' => 'button',\n '#name' => 'moderation-state-notification-button-' . $action['hyphenated_key'],\n '#id' => 'moderation-state-notification-button-' . $action['hyphenated_key'],\n '#value' => $action['title'],\n '#attributes' => [\n 'class' => [\n 'use-ajax-submit',\n 'button',\n 'moderation-state-notification-button',\n ],\n 'data-moderation-state' => $key,\n ],\n '#ajax' => [\n 'callback' => [NotificationsHelper::class, 'notificationCallback'],\n ],\n '#submit' => [],\n '#limit_validation_errors' => [],\n '#displayNotification' => $this->displayNotificationAction($action['field']),\n ];\n }\n\n return $notifications;\n }", "public static function getAvailableContentTypes()\n {\n return array(\n self::TYPE_TEXT_HTML => self::TYPE_TEXT_HTML,\n self::TYPE_TEXT_CSS => self::TYPE_TEXT_CSS,\n self::TYPE_TEXT_JAVASCRIPT => self::TYPE_TEXT_JAVASCRIPT\n );\n }", "protected function get_applicable_types()\n\t{\n\t\t$types = array();\n\n\t\tforeach ($this->types->get_all() as $id => $class)\n\t\t{\n\t\t\tif ($class->forum_robot && $class->forum_database)\n\t\t\t{\n\t\t\t\t$types[] = $id;\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "public static function get_comment_type_strings() {\n $strings = array(\n 'mention' => _x( 'Mention', 'semantic_linkbacks' ), // Special case. any value that evals to false will be considered standard\n\n 'reply' => _x( 'Reply', 'semantic_linkbacks' ),\n 'repost' => _x( 'Repost', 'semantic_linkbacks' ),\n 'like' => _x( 'Like', 'semantic_linkbacks' ),\n 'favorite' => _x( 'Favorite', 'semantic_linkbacks' ),\n 'rsvp:yes' => _x( 'RSVP', 'semantic_linkbacks' ),\n 'rsvp:no' => _x( 'RSVP', 'semantic_linkbacks' ),\n 'rsvp:invited' => _x( 'RSVP', 'semantic_linkbacks' ),\n 'rsvp:maybe' => _x( 'RSVP', 'semantic_linkbacks' ),\n 'rsvp:tracking' => _x( 'RSVP', 'semantic_linkbacks' )\n );\n return $strings;\n }", "function om_warnings_get_warning_types()\n{\n\t// check if cache file exists, not - generate it\n\tif (!file_exists(FORUM_CACHE_DIR.'cache_om_warnings_types.php'))\n\t\tom_warnings_generate_types_cache();\n\n\trequire FORUM_CACHE_DIR.'cache_om_warnings_types.php';\n\treturn $om_warnings_types;\n}", "public function notifications()\n {\n return $this->hasMany(DatabaseNotification::class, 'type', 'name');\n }", "public function notify_list(){\n\n\t\tif(!empty($_SESSION[\"notify\"][\"messages\"])){\n\n\n\t\t\techo \"<ul id=\\\"notify-messages\\\">\";\n\t\t\tforeach ($_SESSION[\"notify\"][\"messages\"] as $message) {\n\t\t\t\techo \"<li data-type=\\\"\".$message[\"type\"].\"\\\">\" . $message[\"message\"] . \"</li>\";\n\t\t\t}\n\t\t\techo \"</ul>\";\n\t\t}\n\n\t\t//limpar o queue de notifications\n\t\tself::notify_empty();\n\n\t}", "public function getSubscriptionTypes();", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public static function getTypes()\n {\n return [\n // Listings Reports\n '_GET_FLAT_FILE_OPEN_LISTINGS_DATA_',\n '_GET_MERCHANT_LISTINGS_DATA_',\n '_GET_MERCHANT_LISTINGS_DATA_BACK_COMPAT_',\n '_GET_MERCHANT_LISTINGS_DATA_LITE_',\n '_GET_MERCHANT_LISTINGS_DATA_LITER_',\n '_GET_MERCHANT_CANCELLED_LISTINGS_DATA_',\n '_GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_',\n '_GET_MERCHANT_LISTINGS_DEFECT_DATA_',\n\n // Order Reports\n '_GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_',\n '_GET_ORDERS_DATA_',\n '_GET_FLAT_FILE_ORDERS_DATA_',\n '_GET_CONVERGED_FLAT_FILE_ORDER_REPORT_DATA_',\n\n // Order Tracking Reports\n '_GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_',\n '_GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_',\n '_GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE_',\n '_GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_',\n\n // Pending Order Reports\n '_GET_FLAT_FILE_PENDING_ORDERS_DATA_',\n '_GET_PENDING_ORDERS_DATA_',\n '_GET_CONVERGED_FLAT_FILE_PENDING_ORDERS_DATA_',\n\n // Performance Reports\n '_GET_SELLER_FEEDBACK_DATA_',\n '_GET_V1_SELLER_PERFORMANCE_REPORT_',\n\n // Settlement Reports\n '_GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_',\n '_GET_V2_SETTLEMENT_REPORT_DATA_XML_',\n '_GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2_',\n\n // Fulfillment By Amazon (FBA) Reports\n // FBA Sales Reports\n '_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_',\n '_GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_',\n '_GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_',\n '_GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE_',\n '_GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_',\n '_GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_SALES_DATA_',\n '_GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_PROMOTION_DATA_',\n '_GET_FBA_FULFILLMENT_CUSTOMER_TAXES_DATA_',\n\n // FBA Inventory Reports\n '_GET_AFN_INVENTORY_DATA_',\n '_GET_AFN_INVENTORY_DATA_BY_COUNTRY_',\n '_GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA_',\n '_GET_FBA_FULFILLMENT_MONTHLY_INVENTORY_DATA_',\n '_GET_FBA_FULFILLMENT_INVENTORY_RECEIPTS_DATA_',\n '_GET_RESERVED_INVENTORY_DATA_',\n '_GET_FBA_FULFILLMENT_INVENTORY_SUMMARY_DATA_',\n '_GET_FBA_FULFILLMENT_INVENTORY_ADJUSTMENTS_DATA_',\n '_GET_FBA_FULFILLMENT_INVENTORY_HEALTH_DATA_',\n '_GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA_',\n '_GET_FBA_MYI_ALL_INVENTORY_DATA_',\n '_GET_FBA_FULFILLMENT_CROSS_BORDER_INVENTORY_MOVEMENT_DATA_',\n '_GET_FBA_FULFILLMENT_INBOUND_NONCOMPLIANCE_DATA_',\n '_GET_STRANDED_INVENTORY_UI_DATA_',\n '_GET_STRANDED_INVENTORY_LOADER_DATA_',\n '_GET_FBA_INVENTORY_AGED_DATA_',\n '_GET_EXCESS_INVENTORY_DATA_',\n\n // FBA Payments Reports\n '_GET_FBA_ESTIMATED_FBA_FEES_TXT_DATA_',\n '_GET_FBA_REIMBURSEMENTS_DATA_',\n\n // FBA Customer Concessions Reports\n '_GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA_',\n '_GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_REPLACEMENT_DATA_',\n\n // FBA Removals Reports\n '_GET_FBA_RECOMMENDED_REMOVAL_DATA_',\n '_GET_FBA_FULFILLMENT_REMOVAL_ORDER_DETAIL_DATA_',\n '_GET_FBA_FULFILLMENT_REMOVAL_SHIPMENT_DETAIL_DATA_',\n\n // Sales Tax Reports\n '_GET_FLAT_FILE_SALES_TAX_DATA_',\n\n // Browse Tree Reports\n '_GET_XML_BROWSE_TREE_DATA_',\n ];\n }", "public function getBodyTypes(): array\n {\n $format = $this->emailFormat;\n\n if ($format === static::MESSAGE_BOTH) {\n return [static::MESSAGE_HTML, static::MESSAGE_TEXT];\n }\n\n return [$format];\n }", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "public function getNotifications($data=array()){\n\t\t$where_filter = \"1 \";\n\t\t if(!empty($data['templatecategory_id'])){\n\t\t\t $where_filter = \"NT.templatecategory_id ='3'\";\n\t\t }\n\t\t$select = $this->_db->select()\n\t\t\t\t\t->from(array('NT'=>MAIL_NOTIFY_TYPES),array('ID'=>\"NT.notification_id\",'Name'=>'NT.notification_name','category_id'=>'NT.templatecategory_id'))\n\t\t\t\t\t ->where('NT.notification_staus =\"1\" AND '.$where_filter)\n\t\t\t\t\t->order('NT.notification_name ASC');\n\t\t\t\t\t\t//echo $select->__tostring();die;\n\t\treturn $this->getAdapter()->fetchAll($select);\n\t}", "public function via($notifiable): array\n {\n $hasNotifications = $notifiable->unreadNotifications()\n ->where('type', get_class($this))\n ->exists();\n\n return $hasNotifications ? [] : ['database'];\n }", "function getIconClass($notification) {\n\t\tswitch ($notification->getType()) {\n\t\t\tcase NOTIFICATION_TYPE_PUBLISHED_ISSUE:\n\t\t\t\treturn 'notifyIconPublished';\n\t\t\tcase NOTIFICATION_TYPE_NEW_ANNOUNCEMENT:\n\t\t\t\treturn 'notifyIconNewAnnouncement';\n\t\t\tcase NOTIFICATION_TYPE_BOOK_REQUESTED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_CREATED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_UPDATED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_DELETED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_MAILED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SETTINGS_SAVED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_SUBMISSION_ASSIGNED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_ASSIGNED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_DENIED:\n\t\t\tcase NOTIFICATION_TYPE_BOOK_AUTHOR_REMOVED:\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_SUCCESS:\n\t\t\t\treturn 'notifyIconSuccess';\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_NO_GIFT_TO_REDEEM:\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_ALREADY_REDEEMED:\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_GIFT_INVALID:\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_TYPE_INVALID:\n\t\t\tcase NOTIFICATION_TYPE_GIFT_REDEEM_STATUS_ERROR_SUBSCRIPTION_NON_EXPIRING:\n\t\t\t\treturn 'notifyIconError';\n\t\t\tdefault: return parent::getIconClass($notification);\n\t\t}\n\t}", "function get_incoming_message_types($user = null) {\n\n\t$return = array();\n\n\tif (!elgg_instanceof($user)) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t\tif (!$user) {\n\t\t\treturn $return;\n\t\t}\n\t}\n\n\t$message_types = elgg_get_config('inbox_message_types');\n\t$user_types = elgg_get_config('inbox_user_types');\n\n\tforeach ($message_types as $type => $options) {\n\n\t\tif ($type == HYPEINBOX_NOTIFICATION) {\n\t\t\t$methods = (array) get_user_notification_settings($user->guid);\n\t\t\tif (!array_key_exists('site', $methods)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t$policies = $options['policy'];\n\t\tif (!$policies) {\n\t\t\t$return[] = $type;\n\t\t\tcontinue;\n\t\t}\n\n\t\tforeach ($policies as $policy) {\n\n\t\t\t$recipient_type = $policy['recipient'];\n\n\t\t\tif ($recipient_type == 'all') {\n\t\t\t\t$return[] = $type;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$validator = $user_types[$recipient_type]['validator'];\n\t\t\tif ($validator && is_callable($validator) && call_user_func($validator, $user, $recipient_type)) {\n\t\t\t\t$return[] = $type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $return;\n}", "public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_EVENTS_BY_EVENT_TYPE,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE,\n self::TYPE_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE_PER_USER,\n self::TYPE_EVENTS,\n self::TYPE_NOTIFICATIONS,\n self::TYPE_NOTIFICATION_FAILURE_BY_SUBSCRIPTION,\n self::TYPE_UNPROCESSED_RANGE_START,\n self::TYPE_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_DELAY_RANGE_START,\n self::TYPE_TOTAL_PIPELINE_TIME,\n self::TYPE_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_EVENT_PIPELINE_TIME,\n self::TYPE_HOURLY_RANGE_START,\n self::TYPE_HOURLY_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_HOURLY_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_HOURLY_EVENTS,\n self::TYPE_HOURLY_NOTIFICATIONS,\n self::TYPE_HOURLY_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_TOTAL_PIPELINE_TIME,\n self::TYPE_HOURLY_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_HOURLY_EVENT_PIPELINE_TIME,\n ];\n }", "function getUserTypes() {\n return array(self::HOME => self::HOME,\n self::CLINIC => self::CLINIC);\n }", "public function getTypesForDefaultQueue() {\n $types = array(\n ParseGitolite3Logs::NAME,\n MigrateToTuleapSSHKeyManagement::NAME\n );\n\n if ($this->repository_factory->hasGitShellRepositories()) {\n return array_merge(\n $types,\n array(\n SystemEvent_GIT_LEGACY_REPO_ACCESS::NAME,\n SystemEvent_GIT_LEGACY_REPO_DELETE::NAME,\n )\n );\n }\n\n return $types;\n }", "public static function getTypes()\n {\n return [\n ModelRegistry::TRANSACTION => ModelRegistry::getById(ModelRegistry::TRANSACTION)->label,\n ModelRegistry::PRODUCT => ModelRegistry::getById(ModelRegistry::PRODUCT)->label,\n ];\n }", "public function getTissueTypesList() {\n return $this->_get(12);\n }", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "function get_notification_output($priority = 2)\n\t{\n\t\t// Draft to published, and there are draft news articles\n\t\t// then display a nice message.\n\t\t// this is a priority 2 item.\n\t\tif( $priority >= 2 )\n\t\t{\n\t\t\t$output = array();\n\n\t\t\t// dummy priority 3 object\n\t\t\t$obj = new StdClass();\n\t\t\t$obj->priority = 2;\n\t\t\t$obj->html = 'This is a dummy priority 2 notification';\n\t\t\t$output[] = $obj;\n\n\t\t\t// dummy priority 3 object\n\t\t\t$obj = new StdClass();\n\t\t\t$obj->priority = 3;\n\t\t\t$obj->html = 'This is a dummy priority 3 notification';\n\t\t\t$output[] = $obj;\n\t\t}\n\n\t\treturn $output;\n\t}", "function GetAdminNotification()\n\t{\n\t\t$notifications = array(\n\t\t\t'adminnotify_email' => $this->adminnotify_email,\n\t\t\t'adminnotify_send_flag' => $this->adminnotify_send_flag,\n\t\t\t'adminnotify_send_threshold' => $this->adminnotify_send_threshold,\n\t\t\t'adminnotify_send_emailtext' => $this->adminnotify_send_emailtext,\n\t\t\t'adminnotify_import_flag' => $this->adminnotify_import_flag,\n\t\t\t'adminnotify_import_threshold' => $this->adminnotify_import_threshold,\n\t\t\t'adminnotify_import_emailtext' => $this->adminnotify_import_emailtext\n\t\t);\n\n\t\treturn $notifications;\n\t}", "protected function getAvailableTypes() {\n return [\n 'miljoenennota' => 'miljoenennota',\n 'miljoenennota (bijlage)' => 'miljoenennota',\n 'voorjaarsnota' => 'voorjaarsnota',\n 'najaarsnota' => 'najaarsnota',\n 'belastingplan (vvw)' => 'belastingplan_voorstel_van_wet',\n 'belastingplan (mvt)' => 'belastingplan_memorie_van_toelichting',\n 'belastingplan (sb)' => 'belastingplan_staatsblad',\n 'financieel jaarverslag' => 'financieel_jaarverslag',\n 'financieel jaarverslag (bijlage)' => 'financieel_jaarverslag',\n 'sw' => 'voorstel_van_wet',\n 'sw (mvt)' => 'memorie_van_toelichting',\n 'owb' => 'memorie_van_toelichting',\n 'owb (wet)' => 'voorstel_van_wet',\n 'jv' => 'jaarverslag',\n '1supp' => 'memorie_van_toelichting',\n '1supp (wet)' => 'voorstel_van_wet',\n '2supp' => 'memorie_van_toelichting',\n '2supp (wet)' => 'voorstel_van_wet',\n 'isb (mvt)' => 'isb_memorie_van_toelichting',\n 'isb (wet)' => 'isb_voorstel_van_wet',\n ];\n }", "public static function getReportTypes()\n\t{\n\t\treturn self::$_arrReportTypes;\n\t}", "public function list_handled_codes()\n {\n $list = array();\n $list['filedump'] = array(do_lang('CONTENT'), do_lang('filedump:NOTIFICATION_TYPE_filedump'));\n return $list;\n }", "public static function types()\n {\n return self::$types;\n }", "public function getNotificationNids(): array;", "public function get_if_types()\n {\n $this->db->from('oid__iftype');\n $this->db->where('active', 1);\n $this->db->order_by('id', 'ASC');\n $query = $this->db->get();\n return $query->result_array();\n }", "function hybrid_avatar_comment_types( $types ) {\n\n\t/* Add the 'pingback' comment type. */\n\t$types[] = 'pingback';\n\n\t/* Add the 'trackback' comment type. */\n\t$types[] = 'trackback';\n\n\t/* Return the array of comment types. */\n\treturn $types;\n}", "public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notificationable', 'notificationables');\n }", "function workbench_post_get_user_types() {\n $default_users = workbench_post_get_settings_default_user_types();\n $all_users = workbench_post_get_all_user_types();\n $users = array_filter($all_users, function($user) use ($default_users) {\n return $default_users[$user->user_string];\n });\n return $users;\n}", "public function get_item_types()\n\t{\n\t\treturn Plugins::filter( 'get_item_types', $this->item_types );\n\t}", "public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notifiable');\n }", "public static function get_avatar_comment_types($types) {\n $types[] = 'pingback';\n $types[] = 'trackback';\n $types[] = 'webmention';\n\n return $types;\n }", "public function defaultTypes()\n {\n $types = array_keys($this->repository->get($this->repoOptionString($this->settingsKey), array()));\n return array_diff($types, array($this->defaultSettingsKey));\n }", "public function notifications() { return $this->notifications; }", "public function getEventTypes()\n {\n return $this->event_types;\n }", "static function getTypes(): array\n\t{\n return self::$types;\n }", "public function getUserTypes()\n {\n $main_actions = [\n 'type' => \\adminer\\lang('Create type'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n // From db.inc.php\n $userTypes = \\adminer\\support(\"type\") ? \\adminer\\types() : [];\n $details = [];\n foreach($userTypes as $userType)\n {\n $details[] = [\n 'name' => \\adminer\\h($userType),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "static function getAvailableSessionTypes()\n\t{\n\t\t$types = array(\n\t\t\t'no-encryption' => 'Auth_OpenID_PlainTextConsumerSession',\n\t\t\t'DH-SHA1' => 'Auth_OpenID_DiffieHellmanSHA1ConsumerSession',\n\t\t\t'DH-SHA256' => 'Auth_OpenID_DiffieHellmanSHA256ConsumerSession'\n\t\t);\n\n\t\treturn $types;\n\t}", "function GetNotifications () {\n\t\treturn $this->notifications;\n\t}", "public function buildNotificationData( $data, $type )\n\t{\n\t\treturn array();\n\t}", "private function get_type_options() {\n\t\tglobal $wpdb, $updraftcentral_host_plugin;\n\t\t$options = array();\n\n\t\tif (!function_exists('get_post_mime_types')) {\n\t\t\tglobal $updraftplus;\n\t\t\t// For a much later version of WP the \"get_post_mime_types\" is located\n\t\t\t// in a different folder. So, we make sure that we have it loaded before\n\t\t\t// actually using it.\n\t\t\tif (version_compare($updraftplus->get_wordpress_version(), '3.5', '>=')) {\n\t\t\t\trequire_once(ABSPATH.WPINC.'/post.php');\n\t\t\t} else {\n\t\t\t\t// For WP 3.4, the \"get_post_mime_types\" is located in the location provided below.\n\t\t\t\trequire_once(ABSPATH.'wp-admin/includes/post.php');\n\t\t\t}\n\t\t}\n\n\t\t$post_mime_types = get_post_mime_types();\n\t\t$type_options = $wpdb->get_col(\"SELECT `post_mime_type` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' GROUP BY `post_mime_type` ORDER BY `post_mime_type` DESC\");\n\n\t\tforeach ($post_mime_types as $mime_type => $label) {\n\t\t\tif (!wp_match_mime_types($mime_type, $type_options)) continue;\n\t\t\t$options[] = array('label' => $label[0], 'value' => esc_attr($mime_type));\n\t\t}\n\n\t\t$options[] = array('label' => $updraftcentral_host_plugin->retrieve_show_message('unattached'), 'value' => 'detached');\n\t\treturn $options;\n\t}", "public static function getRequesterTypes() {\n return [\n 'COMPANY',\n 'UNIVERSITY'\n ];\n }", "public function sendPushNotifications($type)\n {\n\n $response = [];\n $Model = $this->modelNotifications->create();\n\n // Get news collection\n\n if (!$type) {\n $Collection = $Model->getCollection();\n } else {\n $Collection = $Model->getCollection()->addFieldToFilter('device_type', ['eq' => ($type - 1)]);\n $data = $Collection->getData();\n\n if (!empty($data)) {\n if ($type == self::ANDROID_CODE) {\n $this->__androidChecks($data, $response);\n } elseif ($type == self::IOS_CODE) {\n $this->__validationChecks($data, $response);\n } else {\n $response['statusCode'] = 402;\n $response['type'] = $type;\n $response['msg'] = 'Development is in progress.';\n return $response;\n }\n }\n }\n\n // Load all data of collection\n }", "static public function getAllowedMimeTypes()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('content_type')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->content_type;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function td_nm_get_notifications( $filters = array() ) {\n\t$defaults = array(\n\t\t'posts_per_page' => - 1,\n\t\t'post_type' => 'td_nm_notification',\n\t\t'orderby' => 'date',\n\t\t'order' => 'ASC',\n\t);\n\n\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t}\n\n\t$filters = array_merge( $defaults, $filters );\n\t$posts = get_posts( $filters );\n\t$notifications = array();\n\n\tforeach ( $posts as $post ) {\n\n\t\t$trigger = td_nm_get_trigger( $post->ID );\n\t\t$trigger_instance = TD_NM_Trigger_Factory::get_instance( $trigger );\n\n\t\tif ( $applicable = $trigger_instance->is_notification_applicable() ) {\n\t\t\t$post->trigger = $trigger;\n\t\t\t$post->actions = td_nm_get_actions( $post->ID );\n\t\t\t$notifications[] = $post;\n\t\t}\n\t}\n\n\treturn $notifications;\n}", "public function getInfoTypes()\n {\n return $this->info_types;\n }" ]
[ "0.7681822", "0.7360493", "0.73193216", "0.67300886", "0.6563138", "0.65533835", "0.65118444", "0.64671165", "0.630164", "0.62663674", "0.623087", "0.62062883", "0.6194235", "0.6186474", "0.6162245", "0.6142312", "0.61413944", "0.6092246", "0.60905945", "0.60882276", "0.6074997", "0.6052472", "0.60010356", "0.5996683", "0.5995953", "0.598652", "0.5969934", "0.5969934", "0.5949709", "0.5947174", "0.59457976", "0.5945621", "0.5918473", "0.58997303", "0.58840823", "0.5879336", "0.5867019", "0.5824138", "0.5820415", "0.5818933", "0.5809473", "0.5793391", "0.5788376", "0.5784026", "0.5773467", "0.57681966", "0.57599366", "0.57539505", "0.5738617", "0.5717605", "0.57153565", "0.5707978", "0.5678235", "0.56759554", "0.5674531", "0.56529516", "0.5649768", "0.5639119", "0.56272656", "0.56259406", "0.5624084", "0.5615012", "0.5612321", "0.56112653", "0.56083065", "0.5605894", "0.5605053", "0.5603136", "0.55801207", "0.5576562", "0.5573356", "0.55663234", "0.55646783", "0.55628544", "0.5557024", "0.5550252", "0.5550113", "0.55499387", "0.5538945", "0.5531555", "0.552036", "0.5510144", "0.5507236", "0.5501917", "0.5501111", "0.549693", "0.5481384", "0.54773736", "0.5475696", "0.5471021", "0.5470586", "0.54681927", "0.54672074", "0.5462052", "0.5456433", "0.5451517", "0.54475933", "0.54400736", "0.5433387", "0.54330045" ]
0.5890036
34
User's role (manager or employee) Login() Authenticates user's login information and starts session if verified
public function Login($userid, $password) { // Don't procede if username and password fields are blank if ($userid != '' && $password != '') { // Attempt DB connection $conn = mysqli_connect($_SESSION["SERVER"], $_SESSION["DBUSER"], $_SESSION["DBPASS"], $_SESSION["DATABASE"]); if (!$conn) { // Output error details die('Unable to connect. Error: ' . mysqli_error($conn)); } // Format SQL for query $userid = mysqli_real_escape_string($conn, $userid); $sql = "SELECT * FROM Users WHERE User_Name = '$userid' "; if ($Result = mysqli_query($conn, $sql)) { $count = mysqli_num_rows($Result); $Row = mysqli_fetch_array($Result, MYSQLI_ASSOC); // Check if there is only one row with specified user_id and // match password to hash if ($count == 1 && password_verify($password, $Row['User_Password'])) { // Ses session ID and User information Session::SetUserID($Row['User_ID']); $this->id = $Row['User_ID']; $this->firstname = $Row['User_Firstname']; $this->lastname = $Row['User_Lastname']; $this->username = $Row['User_Name']; $this->role = $Row['User_Role']; mysqli_close($conn); return true; } else { // Authenitcation failure mysqli_close($conn); return false; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login() {\n\t\tif ($this->_identity === null) {\n\t\t\t$this->_identity = new UserIdentity($this->username, $this->password, $this->loginType);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\n\t\t\t$duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days or the default session timeout value\n\t\t\tYii::app()->user->login($this->_identity, $duration);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login()\n\t{\n $identity = $this->getIdentity();\n if ($identity->ok) {\n\t\t\t$duration = $this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->getIdentity(), $duration);\n\t\t\treturn true;\n \n\t\t} else\n\t\t\treturn false;\n\t}", "public function login(){\r\n if(IS_POST){\r\n //判断用户名,密码是否正确\r\n $managerinfo=D('User')->where(array('username'=>$_POST['username'],'pwd'=>md5($_POST['pwd'])))->find();\r\n if($managerinfo!==null){\r\n //持久化用户信息\r\n session('admin_id',$managerinfo['id']);\r\n session('admin_name', $managerinfo['username']);\r\n $this->getpri($managerinfo['roleid']);\r\n //登录成功页面跳到后台\r\n $this->redirect('Index/index');\r\n }else{\r\n $this->error('用户名或密码错误',U('Login/login'),1);\r\n }\r\n return;\r\n }\r\n $this->display();\r\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\n $lastLogin = date(\"Y-m-d H:i:s\");\n\n if(Yii::app()->user->tableName === 'tbl_user'){\n $sql = \"UPDATE tbl_user_dynamic SET ulast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_personnel'){\n $sql = \"UPDATE tbl_user_dynamic SET plast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_reader'){\n $sql = \"UPDATE tbl_user_dynamic SET rlast_login = :lastLogin WHERE user_id = :userid\";\n }\n $command = Yii::app()->db->createCommand($sql);\n $command->bindValue(\":userid\", $this->_identity->id, PDO::PARAM_STR);\n $command->bindValue(\":lastLogin\", $lastLogin, PDO::PARAM_STR);\n $command->execute();\n Tank::wipeStats();\n Yii::app()->user->setState('todayHasRecord',User::todayHasRecord());\n return true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login()\n\t{\t\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\t\tif ($this->commons->validateToken($this->url->post('_token'))){\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t$username = $this->url->post('username');\n\t\t$password = $this->url->post('password');\n\n\t\tif (!$this->validate($username, $password)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\tunset($this->session->data['user_id']);\n\t\tunset($this->session->data['login_token']);\n\t\tunset($this->session->data['role']);\n\n\t\t/*Intiate login Model*/\n\t\t$this->loginModel = new Login();\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\tif ($user = $this->loginModel->checkUser($username)) {\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($user['email'])) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t\n\t\t\t\t$this->url->redirect('login');\n\t\t\t}\n\t\t\telse if ($user['status'] === 1) {\n\t /** \n\t * Check if the password in the database matches the password user submitted.\n\t * We are using the password_verify function to avoid timing attacks.\n\t **/\n\t if (password_verify( $password, $user['password'])) {\n\t \t$this->loginModel->deleteAttempt($user['email']);\n\t \t/** \n\t \t* Start session for user create session varible \n\t\t * Create session login string for authentication\n\t\t **/\n\t \t$this->session->data['user_id'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_id']); \n\t \t$this->session->data['role'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_role']);\n\t \t$this->session->data['login_token'] = hash('sha512', AUTH_KEY . LOGGED_IN_SALT);\n\t \t$this->url->Redirect('dashboard');\n\t } else {\n\t \t/** \n\t \t* Add login attemt to Db\n\t\t * Redirect back to login page and set error for user\n\t\t **/\n\t \t$this->loginModel->addAttempt($user['email']);\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->Redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: Your account has disabled for more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t * If email address not found in DB \n\t\t * Show error to user for creating account\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->redirect('login');\n\t }\n\t}", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function login()\r\n\t{\t\t\r\n\t\tif ($this->_identity === null) {\r\n $this->_identity = new UserIdentity($this->email, $this->password);\r\n $this->_identity->authenticate();\r\n }\r\n\t\t\r\n switch ($this->_identity->errorCode) {\r\n case UserIdentity::ERROR_NONE:\r\n $duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days\r\n Yii::app()->user->login($this->_identity, $duration);\r\n break;\r\n case UserIdentity::ERROR_USERNAME_INVALID:\t\t\t\t\r\n $this->addError('email', 'Email address is incorrect.');\r\n break;\r\n\t\t\tcase UserIdentity::ERROR_PASSWORD_INVALID:\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n default: // UserIdentity::ERROR_PASSWORD_INVALID\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n }\r\n\t\t\r\n if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\r\n $this->onAfterLogin(new CEvent($this, array()));\t\t\t\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\t}", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function action_checklogin(){\n\t\t$validation = Employee::validate(Input::all());\n\t\tif($validation->passes()){\n\t\t\t$credentials = array(\n\t\t\t\t'username' => Input::get('login'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t );\t\t\n\t\t\tif( Auth::attempt($credentials)){\n\t\t\t\t// controle admin keuken gebruiker en redirect naar respectieve page\n\t\t\t\t//return Redirect::to('admin'); +Route aanmaken voor admin!!\n\t\t\t\t$user = Auth::user();\n\t\t\t\tif ($user->type == 'admin') {\n\t\t\t\t\treturn Redirect::to('home_admin');\n\t\t\t\t} else if($user->type == 'keuken') {\n\t\t\t\t\treturn Redirect::to('home_keuken');\n\t\t\t\t} else if($user->type == 'gebruiker') {\n\t\t\t\t\treturn Redirect::to('home_gebruiker');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSession::flash('messagefail', Lang::line('flashmessages.loginfailure')->get(Session::get('language', 'nl')) );\t\t\t\t\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t\t// return to login to show errors and return what the user entered\n\t\t\treturn Redirect::to_route('login')->with_errors($validation)->with_input();\n\t\t\n\t}", "public function actionManagerLogin() {\r\n\r\n if (Yii::app()->user->getstate('user_id')) {\r\n $url = BaseClass::manager_redirect(Yii::app()->user->getstate('user_id'));\r\n $this->redirect($url);\r\n } else {\r\n $model = new LoginForm('Admin');\r\n\r\n // if it is ajax validation request\r\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'LoginForm') {\r\n echo CActiveForm::validate($model);\r\n Yii::app()->end();\r\n }\r\n // collect user input data\r\n if (isset($_POST['LoginForm'])) {\r\n $model->attributes = $_POST['LoginForm'];\r\n //$flag=$model->login();\r\n $access = \"manager\";\r\n if ($model->login($access)) {\r\n echo 1;\r\n Yii::app()->end();\r\n //return true;\r\n } else {\r\n //echo $flag;\r\n echo 0;\r\n Yii::app()->end();\r\n //return false;\r\n }\r\n }\r\n // display the login form\r\n $this->m_str_title = yii::t('admin', 'admin_default_loginpage_title');\r\n //$this->layout = 'login';\r\n $this->render('managerlogin', array('model' => $model));\r\n }\r\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "function login($data = null)\n {\n if(!parent::login($data))\n return $this->_loggedIn;\n\n // fetch the assciated role\n \n $model = $this->getModel();\n \n if(isset($model->hasAndBelongsToMany[$this->parentModel]['with']))\n { \n $with = $model->hasAndBelongsToMany[$this->parentModel]['with'];\n if(!isset($this->{$with}))\n $this->{$with} =& ClassRegistry::init($with); \n\n // fetch the associated model\n $roles = $this->{$with}->find('all', array('conditions' => 'user_id = '.$this->user('id')));\n if(!empty($roles))\n {\n $primaryRole = $this->user($this->fieldKey); \n // retrieve associated role that are not the primary one\n $roles = set::extract('/'.$with.'['.$this->fieldKey.'!='.$primaryRole.']/'.$this->fieldKey, $roles);\n\n // add the suplemental roles id under the Auth session key\n if(!empty($roles))\n {\n $completeAuth = $this->user();\n $completeAuth[$this->userModel][$this->parentModel] = $roles;\n $this->Session->write($this->sessionKey, $completeAuth[$this->userModel]);\n }\n }\n }\n \n return $this->_loggedIn; \n }", "public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }", "protected function loginIfRequested() {}", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function validateLogin(){\n\t\tif($this->validateFormsLogin(Input::all()) === true){\n\t\t\t$userdata = array(\n\t\t\t\t'username' =>Input::get('username'),\n\t\t\t\t'password' =>Input::get('password')\n\t\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)){\n\t\t\t\tif(Auth::user()->role_id == 0){\n\t\t\t\t\treturn Redirect::to('administrador');\n\t\t\t\t}else{\n\t\t\t\t\treturn Redirect::to('/');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tSession::flash('message', 'Error al iniciar session');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}else{\n\t\t\treturn Redirect::to('login')->withErrors($this->validateFormsLogin(Input::all()))->withInput();\t\t\n\t\t}\t\t\t\t\n\t}", "public function login()\n {\n if ($this->validate()) {\n return User::setIdentityByAccessToken($this->user_id);\n }\n return false;\n }", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "abstract protected function doLogin();", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "public function actionLogin()\n {\n // user is logged in, he doesn't need to login\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n // get setting value for 'Login With Email'\n $lwe = Yii::$app->params['lwe'];\n\n // if 'lwe' value is 'true' we instantiate LoginForm in 'lwe' scenario\n $model = $lwe ? new LoginForm(['scenario' => 'lwe']) : new LoginForm();\n\n // monitor login status\n $successfulLogin = true;\n\n // posting data or login has failed\n if (!$model->load(Yii::$app->request->post()) || !$model->login()) {\n $successfulLogin = false;\n }\n\n // if user's account is not activated, he will have to activate it first\n if ($model->status === User::STATUS_INACTIVE && $successfulLogin === false) {\n Yii::$app->session->setFlash('error', Yii::t('app', \n 'You have to activate your account first. Please check your email.'));\n return $this->refresh();\n } \n\n // if user is not denied because he is not active, then his credentials are not good\n if ($successfulLogin === false) {\n return $this->render('login', ['model' => $model]);\n }\n\n // login was successful, let user go wherever he previously wanted\n return $this->goBack();\n }", "public function login()\n\t{\n if($this->_identity===null)\n {\n $this->_identity=new UserIdentity($this->username,$this->password);\n $this->_identity->setUserType($this->usertype); //设置用户种类\n $this->_identity->authenticate();\n }\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration); //调用Yii::app()->user->login()保存数据(session)\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('usernamecookie',$this->username); //用户名cookie\n\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天 \n\t\t\tYii::app()->request->cookies['mycookie']=$cookie;\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('usertypecookie',$this->usertype); //用户类型cookie\n\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天\n\t\t\tYii::app()->request->cookies['usertypecookie']=$cookie;\n\t\t\t\n\t\t\tif(!empty($this->rememberMe))\n\t\t\t{\n\t\t\t\t$cookie = new CHttpCookie('remcookie',$this->rememberMe);\n\t\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天\n\t\t\t\tYii::app()->request->cookies['remcookie']=$cookie;\n\t\t\t}else { //清空cookie\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['remcookie']);\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['mycookie']);\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['usertypecookie']);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "private function auto_login()\n {\n if ($this->_cookies->has('authautologin')) {\n $cookieToken = $this->_cookies->get('authautologin')->getValue();\n\n // Load the token\n $token = Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $cookieToken)));\n\n // If the token exists\n if ($token) {\n // Load the user and his roles\n $user = $token->getUser();\n $roles = $this->get_roles($user);\n\n // If user has login role and tokens match, perform a login\n if (isset($roles['registered']) && $token->user_agent === sha1(\\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent())) {\n // Save the token to create a new unique token\n $token->token = $this->create_token();\n $token->save();\n\n // Set the new token\n $this->_cookies->set('authautologin', $token->token, $token->expires);\n\n // Finish the login\n $this->complete_login($user);\n\n // Regenerate session_id\n session_regenerate_id();\n\n // Store user in session\n $this->_session->set($this->_config['session_key'], $user);\n // Store user's roles in session\n if ($this->_config['session_roles']) {\n $this->_session->set($this->_config['session_roles'], $roles);\n }\n\n // Automatic login was successful\n return $user;\n }\n\n // Token is invalid\n $token->delete();\n } else {\n $this->_cookies->set('authautologin', \"\", time() - 3600);\n $this->_cookies->delete('authautologin');\n }\n }\n\n return false;\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function login(){\n\t\tif($this->request->is('post'))\n\t\t{\n\t\t\t/*if($this->Auth->login())\n\t\t\t{\n\t\t\t\tif($current_user['role'] == 'admin')\n\t\t\t\t{\n\t\t\t\t\treturn $this->redirect(array('controller' => 'teams','action' => 'index'));\n\t\t\t\t}\n\t\t\t} */\n\t\t\tif($this->Auth->login())\n\t\t\t{\n\t\t\t\treturn $this->redirect($this->Auth->redirectUrl());\n\t\t\t}\n\t\t\t$this->Session->setFlash('Usuario incorrecto');\n\t\t}\n\t}", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function doLogin()\n\t{\n\n\t\t$userNameCookie = $this->loginView->getUserNameCookie();\n\t\t$passwordCookie = $this->loginView->getPasswordCookie();\n\n\t\t\n\t\tif(isset($userNameCookie) && isset($passwordCookie))\n\t\t{\n\t\t\t$this->isLoggedIn=$this->authenticate->tryTologin($userNameCookie,$passwordCookie,true);\n\t\t}\n\n\t\t$reqUsername = $this->loginView->getRequestUserName();\n\t\t$reqPass = $this->loginView->getRequestPassword();\n\n\t\tif($this->loginView->userWantsToLogin())\n\t\t{\n\t\t\t$this->isLoggedIn=$this->authenticate->tryTologin($reqUsername,$reqPass);\t\t\t\n\t\t}\n\t\t/* \tSince logout operation requires session variable to be set, after authenticating\n\t\t*\tlogin details, It really should not matter if the message is still 'Bye bye'\n\t\t*/\n\t\telse if(isset($_SESSION['user']) && $this->loginView->userWantsToLogout())\n\t\t{\n\t\t\t\t$this->authenticate->logout();\n\t\t\t\t$this->isLoggedIn = false;\t\t\t\t\n\t\t}\n\t\treturn $this->isLoggedIn;\n\t}", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public function login()\n {\n Yii::$app->settings->clearCache();\n if ($this->validate() && $this->checkSerialNumberLocal()) {\n Yii::$app->settings->checkFinalExpireDate();\n $flag = Yii::$app->user->login($this->getUserByPassword(), 0);\n Yii::$app->object->setShift();\n return $flag;\n }\n \n return false;\n }", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n else {\n return false;\n }\n }", "public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }", "protected function isUserAllowedToLogin() {}", "public function login()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public static function checkLogin($role = ''){\n if(isset($_SESSION['loginId'])) {\n $user = self::loadModel('OpenSms_Model_User', array(0 => $_SESSION['loginId']));\n }elseif(isset($_REQUEST['callback'])){\n if(empty($_REQUEST['loginId'])|| empty($_REQUEST['password'])){\n echo self::jSonp(array('error'=>TRUE, 'message'=> 'Username and password is required'));\n exit();\n }\n $user = self::loadModel('OpenSms_Model_User', array(0 => $_REQUEST['loginId'], 1=> $_REQUEST['password']));\n if(!$user->IsValidated){\n echo self::jSonp(array('error'=>TRUE, 'message'=> 'Invalid Credential'));\n exit();\n }\n }else{\n $token = self::loadModel('OpenSms_Model_Login');\n if($token->Validated()){\n $user = self::loadModel('OpenSms_Model_User', array(0 => $token->LoginId));\n\n }\n }\n\n if(isset($user)){\n $_SESSION['loginId'] = $user->LoginId;\n $_SESSION['role'] = $user->Role;\n }else{\n self::setError('Please login to continue', 'checkLogin_OpenSms');\n OpenSms::redirectToAction('login', 'account', 'account');\n }\n\n if(!empty($role)){\n if($user->Role != $role){\n self::setError('Access denied. You must be an admin to perform that operation', 'checkLogin_OpenSms');\n OpenSms::redirectToAction('login', 'account', 'admin');\n }\n }\n return $user;\n }", "public function authenticate()\n\t{\n\n\t\t$username = strtolower($this->username);\n\t\t/** @var $user User */\n\t\t$user = User::model()->with('roles')->find('LOWER(use_username)=?', array($username));\n\t\tif ($user === null) {\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t} else {\n\t\t\tif (!$user->validatePassword($this->password)) {\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t\t} else {\n\t\t\t\t$this->_id = $user->use_id;\n\t\t\t\t$this->username = $user->use_fname;\n\t\t\t\t$this->_branchId = $user->use_branch;\n\t\t\t\t$this->_scope = $user->use_scope;\n\t\t\t\t$this->_roles = $user->roles;\n\n\t\t\t\t$this->userData = serialize($user);\n\n\t\t\t\tYii::app()->user->setState(\"fullname\", $user->getFullName());\n\n\t\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t\t$this->loadSessionForOldLogin($user);\n\t\t\t}\n\t\t}\n\t\tLoginLog::model()->log($this, $user);\n\t\treturn $this->errorCode == self::ERROR_NONE;\n\t}", "public function doLogin()\n {\n if ($this->validate()) {\n $result = Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n\n if ($result) {\n $event = new LoginEvent();\n $event->user = $this->getUser();\n $this->trigger(self::EVENT_LOGIN, $event);\n }\n\n return $result;\n }\n return false;\n }", "public function authenticate() {\n $user = SysAdminUser::model()->find('LOWER(account)=?', array(strtolower($this->username)));\n if ($user === null){\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n }else if (!$user->validatePassword($this->password)){\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }else {\n $this->_uid = $user->id;\n $this->username = $user->name;\n $this->setUser($user);\n $roleArr = OBJTool::convertModelToArray($user->role);\n if ($roleArr) {\n $role = $roleArr[0]['id'];\n } else {\n $role = NULL;\n }\n $this->setState('__role', $role);\n $this->errorCode = self::ERROR_NONE;\n //Yii::app()->user->setState(\"isadmin\", true);\n }\n return $this->errorCode == self::ERROR_NONE;\n }", "private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }", "public function login() {\n if ($this->validate()) {\n $this->setToken();\n return Yii::$app->user->login($this->getUser()/* , $this->rememberMe ? 3600 * 24 * 30 : 0 */);\n } else {\n return false;\n }\n }", "public function login()\n {\n if ($this->validate()) {\n $duration = $this->module->rememberLoginLifespan;\n\n return Yii::$app->getUser()->login($this->user, $duration);\n }\n\n return false;\n }", "public static function login()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n\n\n $admin = $cont->prepare(\"SELECT `role` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\");\n $admin->execute([$email , $password]);\n $adminData = $admin->fetchObject();\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../admin/login.php\");\n }\n else\n {\n $_SESSION['role'] = $adminData->role; \n \n header(\"location:../admin/index.php\");\n }\n \n }", "public function Login($params)\r\n {\r\n $data = array(\r\n 'email' => $params['email'],\r\n 'password' => $params['password']\r\n );\r\n $qry = $this->db->get_where('users', $data);\r\n if ($qry->num_rows() == 1) {\r\n return $qry->row('role_id');\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function Login($akronymOrEmail, $password) {\n $password=self::CreatePassword($password);\n $user = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('check user password'), array($password, $akronymOrEmail, $akronymOrEmail));\n $user = (isset($user[0])) ? $user[0] : null;\n unset($user['password']);\n if($user) {\n $user['isAuthenticated'] = true;\n $user['groups'] = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('get group memberships'), array($user['id']));\n foreach($user['groups'] as $val) {\n if($val['id'] == 1) {\n $user['hasRoleAdmin'] = true;\n }\n if($val['id'] == 2) {\n $user['hasRoleUser'] = true;\n }\n }\n $this->profile = $user;\n $this->session->SetAuthenticatedUser($this->profile);\n }\n return ($user != null);\n }", "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "public static function loginBySession()\n\t{\n\t\tif (Sessions::get('loggedIn')) :\n\t\t\tAuth::redirectUser(Sessions::get('user/type'));\n\t\tendif;\n\t}", "public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "function user_login($username, $password)\n {\n\n $query = \"SELECT u.*\n \t\t FROM \" . $this->db_table_prefix . \"users u\n \t\t JOIN \" . $this->db_table_prefix . \"roles r ON u.role_id = r.id\n \t\t WHERE email='\" . $username . \"' AND password='\" . md5($password) . \"' \n AND u.status = '1' LIMIT 0,1\";\n \n $result = $this->commonDatabaseAction($query); \n $user_details = array(); \n $user_details = $this->sqlAssoc;\n \n// if (mysql_num_rows($result) > 0 && !empty($user_details))\n if ($this->rowCount > 0 && !empty($user_details))\n { \n $_SESSION ['user_id'] = $user_details[0]['id'];\n $_SESSION ['user_first_name'] = $user_details[0]['firstname'];\n\n if ($user_details[0]['lastname'] !== '')\n {\n $_SESSION ['user_last_name'] = $user_details[0]['lastname'];\n }\n else\n {\n $_SESSION ['user_last_name'] = '';\n }\n\n $_SESSION ['user_role'] = $user_details[0]['role_id'];\n }\n else\n {\n $_SESSION ['user_login_error'] = 1;\n }\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function action_login()\n {\n if(\\Auth::check())\n {\n \\Response::redirect('admin/dashboard');\n }\n\n // Set validation\n $val = \\Validation::forge('login');\n $val->add_field('username', 'Name', 'required');\n $val->add_field('password', 'Password', 'required');\n\n // Run validation\n if($val->run())\n {\n if(\\Auth::instance()->login($val->validated('username'), $val->validated('password')))\n {\n \\Session::set_flash('success', \\Lang::get('nvadmin.public.login_success'));\n \\Response::redirect('admin/dashboard');\n }\n else\n {\n $this->data['page_values']['errors'] = \\Lang::get('nvadmin.public.login_error');\n }\n }\n else\n {\n $this->data['page_values']['errors'] = $val->show_errors();\n }\n\n // Set templates variables\n $this->data['template_values']['subtitle'] = 'Login';\n $this->data['template_values']['description'] = \\Lang::get('nvadmin.public.login');\n $this->data['template_values']['keywords'] = 'login, access denied';\n }", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "function login(){\n\t\t$role = $this->session->userdata('role');\n\t\tif(empty( $role )):\n\t\t\t$this->load->view('site/simple-header');\n\t\t\t$this->load->view('site/login');\n\t\t\t$this->load->view('site/simple-footer');\n\t\telse:\n\t\t\tredirect( base_url() );\n\t\tendif;\n\t}", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n return false;\n }", "function login()\n {\n // run the login() method in the login-model, put the result in $login_successful (true or false)\n $login_model = $this->loadModel('Login');\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = $login_model->login();\n\n // check login status\n if ($login_successful) {\n // if YES, then move user to dashboard/index\n // please note: this is a browser-redirection, not a rendered view\n header('location: ' . URL . 'dashboard/index');\n } else {\n // if NO, then show the login/index (login form) again\n $this->view->render('login/index');\n }\n }", "public function loginRole()\n {\n $c = new Criteria();\n $c->add(sfGuardUserGroupPeer::USER_ID, $this->getGuardUser()->getId(), Criteria::EQUAL);\n $c->addJoin(sfGuardGroupPeer::ID, sfGuardUserGroupPeer::GROUP_ID);\n $role = sfGuardGroupPeer::doSelectOne($c);\n\n if ($role)\n {\n if ($this->isPreceptor())\n {\n $this->setLoginRole('Preceptor');\n }\n else\n {\n $this->setLoginRole($role->getName());\n }\n }\n }", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function authenticate() {\n \n $user = UserMaster::model()->findByAttributes(array('user_name' => $this->username));\n if ($user === null) { // No user found!\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else if ($user->user_pass !== base64_encode($this->password)) { // Invalid password!\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } else {\n /**\n * @desc: Start the Session Here\n */\n $session = new CHttpSession;\n $session->open();\n /**\n * @desc: User Full Name\n */\n $session[\"fullname\"] = ucfirst($user->first_name);\n /**\n * @desc: User ID\n */\n $session[\"uid\"] = $user->u_id;\n /**\n * @desc: User Role Id for ACL Management\n */\n $session[\"rid\"] = $user->ur_id;\n /**\n * @desc : User name\n */\n $session[\"uname\"] = $user->first_name;\n $this->setState('id', $user->ur_id);\n $this->errorCode = self::ERROR_NONE;\n }\n return !$this->errorCode;\n }", "protected function LoginAuthentification()\n {\n \n $tokenHeader = apache_request_headers();\n\n //isset Determina si una variable esta definida y no es NULL\n\n if(isset($tokenHeader['token']))\n { \n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm); \n //var_dump($datosUsers);\n if(isset($datosUsers->nombre) and isset($datosUsers->password))\n { \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n\n if($username == $datosUsers->nombre and $password == $datosUsers->password)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n } \n \n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "public function login() {\n if (!($identity = UserIdentity::findOne(['email' => $this->email]))) {\n $this->addError('email', 'Такой пользователь в системе не найден!');\n } elseif (!$identity->validatePassword($this->password)) {\n $this->addError('password', 'Пароль неверный');\n }\n return !$this->hasErrors() && Yii::$app->user->login($identity, $this->rememberMe ? 3600 * 24 * 30 : 0);\n }", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function login(){\n\n if(isset($_POST)){\n \n /* identificar al usuario */\n /* consulta a la base de datos */\n $usuario = new Usuario();\n \n $usuario->setEmail($_POST[\"email\"]);\n $usuario->setPassword($_POST[\"password\"]);\n \n $identity = $usuario->login();\n \n\n if($identity && is_object($identity)){\n \n $_SESSION[\"identity\"]= $identity;\n\n if($identity->rol == \"admin\"){\n var_dump($identity->rol);\n\n $_SESSION[\"admin\"] = true;\n }\n }else{\n $_SESSION[\"error_login\"] = \"identificacion fallida\";\n }\n\n\n /* crear una sesion */\n \n }\n /* redireccion */\n header(\"Location:\".base_url);\n\n }", "public function actionLogin()\n {\n if (!Yii::app()->user->isGuest)\n {\n $role = Yii::app()->user->role;\n if ($role)\n {\n $this->redirect(Yii::app()->params['modules_default_pages'][$role]);\n }\n }\n\n $model = new LoginForm;\n\n // if it is ajax validation request\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form')\n {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n\n // collect user input data\n if (isset($_POST['LoginForm']))\n {\n $model->attributes = $_POST['LoginForm'];\n\n if ($model->validate() && $model->login())\n $this->redirect('/admin');\n }\n\n $this->render('login', array('model' => $model));\n }", "public function login()\n {\n return Yii::$app->user->login($this);\n }", "public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}", "public function CASLogin()\n {\n // if student, then redirect to the student dashboard, if sponsor redirect to sponsor dashboard\n // else admin, redirect to admin page\n if(Auth::user()->roleID === 1)\n {\n return redirect()->action('Dashboard\\DashboardController@getStudentDashboard');\n }\n elseif(Auth::user()->roleID === 2)\n {\n return redirect()->action('Dashboard\\DashboardController@getSponsorDashboard');\n }\n else\n {\n return redirect('/admin');\n }\n }", "public function login() {\r\n if ($this->request->is('post')) {\r\n \r\n //If the user is authenticated...\r\n if ($this->Auth->login()) {\r\n \r\n if ($this->isAdmin()) $this->redirect(\"/admin/halls\");\r\n else $this->redirect(\"/halls\");\r\n }\r\n else {\r\n $this->Session->setFlash(__('Invalid username or password, try again'));\r\n }\r\n }\r\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->User->find('count') <= 0) {\r\n\t\t\t\t$this->User->create();\r\n\t\t\t\t$data['User']['username'] = \"admin\";\r\n\t\t\t\t$data['User']['password'] = AuthComponent::password(\"admin\");\r\n\t\t\t\t$this->User->save($data);\r\n\t\t\t}\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->write('isLoggedIn', true);\n\t\t\t\t$this->Session->write('mc_rootpath', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('mc_path', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('imagemanager.preview.wwwroot', WWW_ROOT);\n\t\t\t\t$this->Session->write('imagemanager.preview.urlprefix', Router::url( \"/\", true ));\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');\n\t\t\t}\n\t\t}\n\t}", "function login() {\n\n if(empty($this->data['btnSubmit']) == false)\n {\n // Here we validate the user by calling that method from the User model\n if(($user = $this->Usuario->validateLogin($this->data)) != false)\n {\n // Write some Session variables and redirect to our next page!\n $this->setMessage('success', \"Bienvenido a fletescr.com!\");\n\n $roles = $user['Rol'];\n $userRoles = array();\n\n foreach($roles as $rol){\n $userRoles[] = $rol['id'];\n }\n $this->Auth->login($user);\n $this->Session->write('roles', $userRoles);\n\n // Go to our first destination!\n $this->Redirect(array('controller' => 'transport', 'action' => 'index', 'success' => '1'));\n exit();\n }\n else\n {\n $this->setMessage('error', \"El usuario o clave ingresados son incorrectos.\");\n $this->Redirect(array('controller' => 'transport', 'action' => 'index'));\n exit();\n }\n }\n }", "public function doLogin(Request $request)\n {\n $credentials=$request->except('_token');\n\n //step 2 check valid user\n if (Auth::attempt($credentials)) {\n //step2.1 if valid login to the system\n // Authentication passed...\n if(auth()->user()->role ==='student')\n {\n\n return redirect()->route('profile');\n }\n else\n {\n Auth::logout();\n return redirect()->back()->with('message','Invalid Credentials');\n\n }\n\n }else\n {\n //step2.2 return back with error: invalid user\n return redirect()->back()->with('message','Invalid Credentials');\n }\n\n }", "public function authenticate()\n\t{\n \n $record=Usuario::model()->findByAttributes(array('login'=>$this->username));\n if($record===null)\n $this->errorCode=self::ERROR_USERNAME_INVALID;\n\n else\n if (($record->status == 'SUSPENDIDO') || (($record->status == 'EXPULSADO')))\n {\n $this->errorCode=self::ERROR_USERNAME_INVALID;\n }\n else\n if($record->password!==md5($this->password))\n $this->errorCode=self::ERROR_PASSWORD_INVALID;\n else\n {\n $this->_id=$record->id;\n switch ($record->cod_rol) {\n case 1: $role = 'Usuarios'; break;\n case 2: $role = 'Moderadores'; break;\n case 3: $role = 'Coordinadores'; break;\n case 4: $role = 'Supervisores'; break;\n case 5: $role = 'Administradores'; break;\n case 7: $role = 'Root'; break;\n default:\n $role = '';\n }\n $this->setState('rol', $role);\n $this->errorCode=self::ERROR_NONE;\n }\n return !$this->errorCode;\n\t}", "public function login();", "public function login();", "private function auth() {\n // If the user has previously been authenticated\n if(isset($_SESSION['adminUsername']) && isset($_SESSION['adminPassword'])) {\n $this->admin->username = $_SESSION['adminUsername'];\n $this->admin->password = $_SESSION['adminPassword'];\n $auth = $this->admin->get(1);\n\n if($this->admin->password == $auth['password']) {\n $logged = true;\n }\n }\n // If the user has long term login enabled\n elseif(isset($_COOKIE['adminUsername']) && isset($_COOKIE['adminToken'])) {\n $this->admin->username = $_COOKIE['adminUsername'];\n $this->admin->rememberToken = $_COOKIE['adminToken'];\n $auth = $this->admin->get(2);\n\n if($this->admin->rememberToken == $auth['remember_token'] && !empty($auth['remember_token'])) {\n $_SESSION['adminUsername'] = $this->admin->username;\n $this->setPassword($auth['password']);\n $logged = true;\n }\n }\n // If the user is authenticating\n else {\n $auth = $this->admin->get(0);\n\n // Set the sessions\n $_SESSION['adminUsername'] = $this->admin->username;\n $this->setPassword($this->admin->password);\n\n if(password_verify($this->admin->password, $auth['password'])) {\n if($this->admin->rememberToken) {\n $this->admin->renewToken();\n }\n session_regenerate_id();\n $logged = true;\n }\n }\n\n if(isset($logged)) {\n $_SESSION['isAdmin'] = true;\n return $auth;\n }\n\n return false;\n }", "public function actionLogin() {\n $model = new LoginForm;\n // collect user input data\n if (Yii::app()->user->isGuest) {\n if ($this->getPost('LoginForm') != null) {\n $model->setAttributes($this->getPost('LoginForm'));\n // validate user input and redirect to the previous page if valid\n $validate = $model->validate();\n $login = $model->login();\n if ($validate && $login) {\n if (Yii::app()->session['Rol'] == \"Cliente\") {\n if (Yii::app()->session['Usuario']->Activo == 1)\n $this->redirect(Yii::app()->user->returnUrl);\n else\n $this->redirect('Logout');\n }else {\n $this->redirect(Yii::app()->user->returnUrl);\n }\n }\n }\n // display the login form\n $this->render('login', array('model' => $model));\n } else {\n $this->redirect(Yii::app()->homeUrl);\n }\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "public function login($params) {\r\n if($params['login'] && $params['password']) {\r\n return $this->user->login($params['login'], $params['password']);\r\n }\r\n return false;\r\n }", "public function login()\n\t{\n\t\tif (func_num_args() < 2)\n\t\t{\n\t\t\tthrow new Auth_Exception('Minimum two params required to log in');\n\t\t}\n\n\t\t// automatically logout\n\t\t$this->logout();\n\n\t\t$params = func_get_args();\n\t\t$driver_name = array_shift($params);\n\t\t$driver = $this->driver($driver_name);\n\t\tif ($user = call_user_func_array(array($driver, 'login'), $params))\n\t\t{\n\t\t\t$this->_complete_login($user, $driver_name);\n\t\t\t// check for autologin option\n\t\t\t$remember = (bool)arr::get($params, 1, FALSE);\n\t\t\tif ($remember)\n\t\t\t{\n\t\t\t\t$token = $this->orm()->generate_token($user, $driver_name, $this->_config['lifetime']);\n\t\t\t\tCookie::set($this->_autologin_key, $token->token);\n\t\t\t}\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }", "public function login()\n {\n if ($this->validate()) {\n //return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n return true;\n }\n return false;\n }", "function login() {\n\n $this->redirect(\"/staff/users/alllogin\");\n \n $this->layout = 'login_layout';\n\t\t// Display error message on failed authentication\n\t\tif (!empty($this->data) && !$this->Auth->_loggedIn) {\n\t\t\t$this->Session->setFlash($this->Auth->loginError);\t\t\t\n\t\t}\n\t\t// Redirect the logged in user to respective pages\n\t\t$this->setLoginRedirects();\n\t}", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "private function attempt_session_login() {\n if (isset($_SESSION['user_id']) && isset($_SESSION['user_token'])) {\n return $this->attempt_token_login($_SESSION['user_id'], $_SESSION['user_token'], false);\n }\n return false;\n }", "public function verify_login()\n\t{\n\t\t//set form rules to ensure login fields are not empty\n\t\t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('username','Username','required|callback_verify_userinfo');\n\t\t$this->form_validation->set_rules('password','Password','required');\n\t\t\n\t\t//if login form entries pass validation test\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t//save session data in an array\n\t\t\t$sessiondata = array('username' => $this->input->post('username'), 'is_logged_in' => 1);\n\t\t\t//create session with session data\n\t\t\t$this->session->set_userdata($sessiondata);\n\t\t\t\n\t\t\t$role=$this->session->userdata('role');\n\t\t\t\n\t\t\t//run homepage function of main controller\n\t\t\tredirect('main/home');\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//reload login page\n\t\t\t$this->load->view('login_view');\n\t\t}\n\t}", "public function login()\n\t{\n\t\tif ($this->user == FALSE)\n\t\t{\n\t\t\t$customCSS = [\n\t\t\t\t'admin/pages/css/login',\n\t\t\t];\n\t\t\t$customJS = [\n\t\t\t\t'global/plugins/jquery-validation/js/jquery.validate.min',\n\t\t\t\t'admin/pages/scripts/login',\n\t\t\t];\n\n\t\t\t$data = [\n\t\t\t\t'blade_hide_header' => TRUE,\n\t\t\t\t'blade_hide_sidebar' => TRUE,\n\t\t\t\t'blade_hide_footer' => TRUE,\n\t\t\t\t'blade_clean_render' => TRUE,\n\t\t\t\t'blade_custom_css' => $customCSS,\n\t\t\t\t'blade_custom_js' => $customJS,\n\t\t\t\t'pageTitle' => trans('users.login_admin_title'),\n\t\t\t];\n\n\t\t\treturn Theme::view('auth.login', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//If user is logged in - make redirect\n\t\t\treturn Redirect::to('/admin')->send();\n\t\t}\n\t}" ]
[ "0.70636326", "0.7061329", "0.7050518", "0.7023874", "0.69901687", "0.69826776", "0.6905505", "0.68899155", "0.68850625", "0.68605936", "0.6835764", "0.68155366", "0.68106693", "0.6779353", "0.6773212", "0.6770201", "0.67564005", "0.6749095", "0.67448395", "0.6737694", "0.6730978", "0.6723512", "0.67180973", "0.6711368", "0.67106014", "0.6708914", "0.67029274", "0.6693666", "0.6693632", "0.66854197", "0.6654039", "0.6647428", "0.6645596", "0.6635569", "0.66247433", "0.6623547", "0.6618634", "0.66138417", "0.66018885", "0.6600846", "0.6599608", "0.65957874", "0.6592847", "0.65848833", "0.65744865", "0.6569737", "0.65667146", "0.65628934", "0.65616304", "0.65566725", "0.6541341", "0.653823", "0.65280694", "0.65270907", "0.65259206", "0.6523041", "0.6519624", "0.65194607", "0.6513744", "0.65127736", "0.6506577", "0.65023816", "0.6500864", "0.6500584", "0.6491315", "0.649051", "0.6488389", "0.6472027", "0.64717317", "0.6467886", "0.64656216", "0.6453008", "0.644822", "0.6447476", "0.64415014", "0.64378077", "0.64346397", "0.6430924", "0.6426349", "0.6423491", "0.64206153", "0.64093816", "0.64064866", "0.64042723", "0.6401685", "0.6399232", "0.63920015", "0.6391883", "0.6391883", "0.6391852", "0.63908875", "0.6390019", "0.63859224", "0.6381146", "0.63811177", "0.63620704", "0.6361763", "0.63533705", "0.6353118", "0.6352656", "0.6349879" ]
0.0
-1
GetFirstName() Return's user's first name only
public function GetFirstName() { return $this->firstname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getuserFirstName()\n {\n return $this->userFirstName;\n }", "public function getUserFirstName () {\n\t\treturn ($this->userFirstName);\n\t}", "public function getUserFirstName() :string {\n\t\treturn($this->userFirstName);\n\t}", "public function getFirstName();", "public function getFirstNameOrUsername() {\n return $this->first_name ? : $this->username;\n }", "public function getFirstName() {}", "public function getFirstName() {}", "public function getFirstName()\n {\n return $this->first_name ?? $this->nickname ?? $this->name;\n }", "function getFirst_Name() {\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->first_name;\n }", "public function getFirstName() {\n\t\treturn $this->getCustomField( 'first_name' );\n\t}", "public function getFirstName(): string\n {\n return $this->firstName;\n }", "public function getFirstName(): string\n {\n return $this->firstName;\n }", "public function getFirstName(): string\n {\n return $this->firstName;\n }", "public function getFirstName() {\n\t\treturn $this->first_name;\n\t}", "public function getFirstName()\n {\n return $this->first_name;\n }", "public function getFirstName()\n {\n return $this->first_name;\n }", "public function getFirstName()\n {\n return $this->first_name;\n }", "public function getFirstName()\n {\n return $this->first_name;\n }", "public function getFirstName()\n {\n return $this->first_name;\n }", "public function getFirstName() {\n return($this->firstName);\n }", "public function getFirstName() {\n return($this->firstName);\n }", "public function getFirstName()\n\t{\n\t\treturn $this->first_name;\n\t}", "public function getFirstName()\n {\n return parent::getFirstName();\n }", "public function getFirstName()\n {\n return $this->getProfile() ? $this->getProfile()->getFirstName() : null;\n }", "public function getFirstName()\n {\n return $this->firstname;\n }", "public function getFirstName(){\n\t\t\treturn $this->firstname;\n\t\t}", "public function getHonoreeFirstName();", "public function getFirstName()\n {\n return $this->get('FirstName');\n }", "public function getFirstName():string\n {\n return $this->firstName;\n }", "public function getUserProfileFirstName(): string {\n\t\treturn ($this->userProfileFirstName);\n\t}", "public function getFirstName() {\n return $this->firstname;\n }", "public function getFirstName(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_USER_FIRST_NAME);\n }", "public function getFirstname() {\n return $this->getValue('firstname');\n }", "function getFirst_Name(){\n $user = $this->loadUser(Yii::app()->user->id);\n\treturn $user->firstname;\n }", "public function getFirstname()\n {\n return $this->firstName;\n }", "public function getFirstName(){\n \n return $this->first_name;\n \n }", "function getFirstName() {\n\t\treturn $this->getInfo('FirstName');\n\t}", "public function getCustomerFirstname();", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->firstName;\n }", "public function getFirstName() {\n return $this->f_name;\n }", "public function getFirstName()\n {\n if(isset($this->facebookData['first_name'])) {\n return $this->facebookData['first_name'];\n } else {\n return $this->getName();\n }\n }", "public function getUserFirstName($user_id)\n\t{\n\t\t$user = $this->find($user_id);\n\t\treturn $user->first_name;\n\t}", "public function getFirstName() {\n return $this->firstName;\n }", "public function getFirstName() {\n return $this->firstName;\n }", "public function getFirstNameAttribute(): string\n {\n if ($this->user !== null) {\n return $this->user->first_name;\n }\n return '';\n }", "public function requestFirstname();", "public function diviroids_user_firstname($atts)\n {\n return DiviRoids_Security::get_current_user('user_firstname');\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstName()\n {\n return App_Formatting::emptyToNull($this->firstName->getValue());\n }", "public function getFirstName_always_returnCorrectly()\n {\n $this->assertEquals($this->user['user_metadata']['firstname'], $this->entity->getFirstName());\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname()\n {\n return $this->firstname;\n }", "public function getFirstname() {\n return $this->firstname;\n }", "public function getFirst_name()\r\n {\r\n return $this->first_name;\r\n }", "public function getFirstname() {\n\t\treturn $this->firstname;\n\t}", "function getFirstName()\r\n\t{\r\n\t\treturn $this->FirstName;\r\n\t}", "public function getFirstName() :string {\n\t\treturn (string)$this->first_name;\n\t}", "public function getFirstname()\n\t{\n\t\treturn $this->firstname;\n\t}", "public function getFirstname(): string\n {\n return $this->_firstname;\n }", "public function getFirstname()\n\t\t{\n\t\t\treturn $this->firstname;\n\t\t}", "public function getFirstName() { return $this->firstName; }", "public function getFirstName()\n {\n return $this->response['first_name'] ?: null;\n }", "function getPersonFirstName()\n {\n return $this->getValueByFieldName('person_fname');\n }", "public function getFirstName()\r\n\t{\r\n\t\treturn $this['firstName'];\r\n\t}", "public function getFirstName(): ?string\n {\n return $this->FirstName;\n }", "function getFirstName(){\n\t\treturn $this->firstName;\n\t}", "function getFirstName($force_value = false) {\n $result = parent::getFirstName();\n if(empty($result) && $force_value) {\n $email = $this->getEmail();\n return substr_utf($email, 0, strpos_utf($email, '@'));\n } // if\n return $result;\n }", "public function getFirstName(): ?string\n {\n return $this->getParam(self::FIRST_NAME);\n }", "public function getFirstName(): string;", "function getFirstName() {\n return $this->first_name;\n }", "public function get_first_name( $user_id ) {\n\t\t// sanitize the data\n\t\t$user_id = intval( sanitize_text_field( $user_id ));\n\n\t\t$nickname = get_user_meta( $user_id, \"nickname\", true ) ;\n\t\t$first_name = get_user_meta( $user_id, \"first_name\", true ) ;\n\n\t\t// if first name empty then use nickname\n\t\t$first_name = ( $first_name ) ? $first_name : $nickname ;\n\n\t\treturn $first_name;\n\t}", "public function getFirstName()\n {\n if (is_null($this->firstName)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_FIRST_NAME);\n if (is_null($data)) {\n return null;\n }\n $this->firstName = (string) $data;\n }\n\n return $this->firstName;\n }", "public function getFirstName()\n {\n return $this->getBillingFirstName();\n }", "public function getFirstName(): ?string\n {\n return $this->_first_name;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }" ]
[ "0.8616866", "0.85368204", "0.85030794", "0.83826214", "0.8323782", "0.8253516", "0.8253516", "0.82480055", "0.82092226", "0.8185678", "0.8164657", "0.8164657", "0.8164657", "0.81520176", "0.81369776", "0.81369776", "0.81369776", "0.81369776", "0.81369776", "0.81208384", "0.81208384", "0.8116121", "0.81135154", "0.8098044", "0.80936277", "0.8079663", "0.8073571", "0.80711025", "0.8070208", "0.80655193", "0.8061451", "0.80548465", "0.8034559", "0.8029846", "0.80257624", "0.8022752", "0.8020753", "0.80158705", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.8007924", "0.7999846", "0.7988386", "0.7970408", "0.796414", "0.7961321", "0.7961321", "0.79578334", "0.79509", "0.7949449", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7945614", "0.7940681", "0.79359984", "0.79304653", "0.79278994", "0.7920908", "0.79173434", "0.7914395", "0.79122174", "0.7903265", "0.79011357", "0.78966224", "0.78897434", "0.7850279", "0.78444123", "0.7826329", "0.78224105", "0.78169304", "0.78063923", "0.78025514", "0.78011626", "0.77809113", "0.7765996", "0.77647203", "0.7762736", "0.7744237", "0.7700311", "0.7699813", "0.7699813", "0.7699813" ]
0.8143166
14
GetLastName() Returns user's last name only
public function GetLastName() { return $this->lastname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserLastName () {\n\t\treturn ($this->userLastName);\n\t}", "public function getUserLastName() :string {\n\t\treturn($this->userFirstName);\n\t}", "public function getuserLastName()\n {\n return $this->userLastName;\n }", "public function getLastName();", "public function getUserProfileLastName(): string {\n\t\treturn ($this->userProfileLastName);\n\t}", "public function getUserLastName($user_id)\n\t{\n\t\t$user = $this->find($user_id);\n\t\treturn $user->last_name;\n\t}", "public function getLastname() {\n return $this->getValue('lastname');\n }", "public function getLastname() {}", "public function getLastName() {}", "public function getLastName() {}", "public function getHonoreeLastName();", "public function getLastName() {\n\t\treturn $this->getCustomField( 'last_name' );\n\t}", "public function getLastName(){\n \n return $this->last_name;\n \n }", "public function getLastname()\r\n {\r\n return $this->lastname;\r\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName() {\n return($this->lastName);\n }", "public function getLastName() {\n return($this->lastName);\n }", "public function getLastName() { return $this->lastName; }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastName()\n {\n return $this->get('LastName');\n }", "public function getLastname() {\n return $this->lastname;\n }", "public function getLastname()\r\n\t{\r\n\t\treturn $this->lastname;\r\n\t}", "public function getLastname(): string;", "public function getLastname() {\n\t\treturn $this->lastname;\n\t}", "public function getLastname()\n {\n return $this->lastname;\n\n }", "public function getLastName(): string\n {\n return $this->lastName;\n }", "public function getLastName(): string\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname(): string\n {\n return $this->_lastname;\n }", "public function getLastName() {\n\t\treturn $this->last_name;\n\t}", "public function getLastName()\n {\n return $this->last_name ?? $this->surname ?? $this->lastName;\n\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastName(): string;", "public function getLastName()\n {\n return App_Formatting::emptyToNull($this->lastName->getValue());\n }", "public function getLastName()\n\t{\n\t\treturn $this->last_name;\n\t}", "public function getLastName()\n {\n return $this->getProfile() ? $this->getProfile()->getLastName() : null;\n }", "public function getLastName() {\n return $this->lastName;\n }", "public function getLastName() {\n\n return $this->last_name;\n\n }", "public function getLastName() {\n return $this->lastname;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName():string\n {\n return $this->lastName;\n }", "public function getLastNameAttribute(): string\n {\n if ($this->user !== null) {\n return $this->user->last_name;\n }\n return '';\n }", "public function convertLastName()\r\n {\r\n $this->customer->setLastName($this->lastName);\r\n\r\n return $this->customer->getLastName();\r\n }", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "public function getCustomerLastname();", "public function getLastName(){\n\t\t\treturn $this->lastname;\n\t\t}", "public function get_last_name ( $user_id ) {\n\t\t// sanitize the data\n\t\t$user_id = intval( sanitize_text_field( $user_id ));\n\n\t\t$nickname = get_user_meta( $user_id, \"nickname\", true ) ;\n\t\t$last_name = get_user_meta( $user_id, \"last_name\", true ) ;\n\n\t\t// if last name empty thne use nickname\n\t\t$last_name = ( $last_name ) ? $last_name : $nickname ;\n\n\t\treturn $last_name;\n\t}", "public function getLastName()\n {\n return $this->response['last_name'] ?: null;\n }", "function getLastName()\r\n\t{\r\n\t\treturn $this->LastName;\r\n\t}", "function getPersonLastName()\n {\n return $this->getValueByFieldName('person_lname');\n }", "public function getLastName()\n {\n return $this->getBillingLastName();\n }", "public function getLastName(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_USER_LAST_NAME);\n }", "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "function getLastname()\n {\n return $this->lastname;\n }", "public function getLastName()\n {\n $name = $this->getAttribute('name');\n if (isset($name)) {\n return $name['lastName'];\n }\n return null;\n }", "public function getLastName()\n {\n if (is_null($this->lastName)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_LAST_NAME);\n if (is_null($data)) {\n return null;\n }\n $this->lastName = (string) $data;\n }\n\n return $this->lastName;\n }", "public function getLastName_always_returnCorrectly()\n {\n $this->assertEquals($this->user['user_metadata']['lastname'], $this->entity->getLastName());\n }", "public function getLastName() :string {\n\t\treturn (string)$this->last_name;\n\t}", "function getStudentLastName() {\n\t\treturn $this->getData('studentLastName');\n\t}", "public function getLastName()\n {\n return parent::getLastName();\n }", "public function getLastName()\n {\n $name = explode(' ', $this->getName());\n return $name[1];\n }", "public function getSpotifyLastName()\n {\n return $this->spotifyLastName;\n }", "public function getLastName(): ?string {\n return $this->_lastName;\n }", "public function getUser_lname()\n {\n return $this->user_lname;\n }", "public function getTitleLastName() {\r\n $titleLastName = $this->getTitleString() .' '. $this->lastName;\r\n return $titleLastName;\r\n }", "public function getPayerLastName() {\n\t\treturn $this->_getField(self::$PAYER_LAST_NAME);\n\t}", "public function getLastName()\n {\n return $this->getValue('nb_icontact_prospect_last_name');\n }", "public function getLastName(): ?string\n {\n return $this->lastName;\n }", "public function getLastName(): ?string\n {\n return $this->lastName;\n }", "public function getLastName(): ?string\n {\n return $this->lastName;\n }", "public function getLastUserName() {\n\t\treturn $this->lastUserName;\n\t}", "public function getPassengerLastName()\n {\n return isset($this->PassengerLastName) ? $this->PassengerLastName : null;\n }", "public function getSpouseLastName()\n {\n $spouse = $this->getSpouse();\n\n return $spouse ? $spouse->getLastName() : null;\n }" ]
[ "0.8605469", "0.8555658", "0.8540084", "0.82813394", "0.8205732", "0.82057273", "0.81825197", "0.8125636", "0.8088655", "0.8088655", "0.8087347", "0.8070587", "0.8066874", "0.805054", "0.8033346", "0.8033346", "0.8033346", "0.8033346", "0.8033346", "0.80258036", "0.80258036", "0.8024041", "0.80169296", "0.80169296", "0.80169296", "0.80169296", "0.80169296", "0.80169296", "0.80169296", "0.80169296", "0.80148464", "0.80131793", "0.79980314", "0.7988501", "0.7970469", "0.79629374", "0.79502213", "0.79502213", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.79499686", "0.7944117", "0.7943586", "0.7940982", "0.7937917", "0.79372984", "0.7934169", "0.7924847", "0.7913184", "0.79117763", "0.7910348", "0.79042715", "0.7900591", "0.7873601", "0.78480136", "0.7840587", "0.7829348", "0.78230613", "0.78092897", "0.7805228", "0.7803322", "0.7782275", "0.7739776", "0.7694447", "0.7672536", "0.7670251", "0.76657754", "0.76567984", "0.76558226", "0.7639455", "0.761518", "0.7540675", "0.75392044", "0.7534873", "0.74861354", "0.7483392", "0.7456175", "0.743477", "0.7417934", "0.7415549", "0.74149543", "0.7404225", "0.7404225", "0.7404225", "0.7388578", "0.73570484", "0.73412496" ]
0.8068257
12
GetUsername() Returns user's username only
public function GetUsername() { return $this->username; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername() {}", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername() {\n if (isset($_REQUEST['username']))\n return $_REQUEST['username'];\n else\n return false;\n }", "public function getUserUsername () {\n\t\treturn ($this->userUsername);\n\t}", "public function getUsername()\n {\n return $this->get(self::_USERNAME);\n }", "public function getUsername() {\n return $this->getValue('username');\n }", "public function getUsername(): string\n {\n return $this->username;\n }", "public function getUsername(): string\n {\n return $this->username;\n }", "public function getUsername(): string\n {\n return $this->username;\n }", "public function getUsername() {\n // TODO: Implement getUsername() method.\n return $this->getLogin();\n }", "public function GetUsername() {\n return $this->username;\n }", "private function getUsername()\n {\n return $this->_username;\n }", "public function getUsername(): string {\n return $this->username;\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n return $this->username;\n }", "public function getUsername() {\n }", "public function getUsername() {\n return $this->user->username;\n }", "public function getUsername() {\r\n\t\treturn $this->username;\r\n\t}", "public function getUsername()\n {\n return empty($this->username) ? 'anonymous' : $this->username;\n }", "public function getUsername()\n\t{\n\t\treturn $this->username;\n\t}", "public function getUsername()\n\t{\n\t\treturn $this->username;\n\t}", "public function getUsername()\n\t{\n\t\treturn $this->username;\n\t}", "public function getUsername()\n\t{\n\t\treturn $this->username;\n\t}", "public function getUsername()\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername(): string\n {\n return (string) $this->username;\n }", "public function getUsername()\n {\n return $this->getLogin();\n }", "public function getUsername()\n\t{\n\t return $this->username;\n\t}", "public function get_username() {\n return $this->username;\n }", "public function getUsername()\r\n {\r\n return $this->username;\r\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function getUsername()\n {\n return $this->username;\n }", "public function get_strUsername()\n {\n return $this->strUsername;\n }", "public function getUsername()\r\n {\r\n return $this->username;\r\n }", "public function getUsername()\n {\n return $this->wrapped->getUsername();\n }", "public function getUsername()\n {\n }", "public function getUsername()\n {\n }", "public function getUsername ()\r\n {\r\n return $this->_username;\r\n }" ]
[ "0.8656025", "0.8656025", "0.8656025", "0.8656025", "0.8656025", "0.84136355", "0.8246191", "0.8246191", "0.8246191", "0.8169937", "0.8168453", "0.81662846", "0.80738807", "0.8070408", "0.8070408", "0.8070408", "0.804463", "0.8024169", "0.80169356", "0.80066293", "0.7990061", "0.798777", "0.7987449", "0.7977107", "0.79762137", "0.7971827", "0.7971827", "0.7971827", "0.7971827", "0.7966462", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.79640293", "0.7954603", "0.79524475", "0.7947383", "0.7930599", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.79253477", "0.7915192", "0.79061", "0.79042435", "0.79008764", "0.79008764", "0.78928787" ]
0.8000178
20
GetFullName() Returns user's name in format "Firstname Lastname (username)"
public function GetFullName() { return $this->firstname . " " . $this->lastname . " (" . $this->username . ")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullNameWithLogin()\n\t{\n\t\treturn \"{$this->firstname} {$this->lastname} ({$this->login})\";\n\t}", "public function getFullName(): string\n {\n return sprintf('%s %s', $this->getGivenName(), $this->getLastname());\n }", "public function getFullName(): string\n {\n return sprintf('%s %s', $this->firstName, $this->lastName);\n }", "public function getFullName()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullName()\r\n\t{\r\n\t\treturn sprintf('%s %s', $this['firstName'], $this['lastName']);\r\n\t}", "public function GetFullName()\n\t\t{\n\t\t\treturn $this->GetAttribute('first_name').' '.$this->GetAttribute('last_name');\n\t\t}", "public function getFullName(){\n\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n\n return $first_name.' '.$last_name;\n }", "public function getFullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullname() {\n $fullname = sprintf(\n '%s %s',\n $this->getFirstname(),\n $this->getLastname()\n );\n\n return trim($fullname);\n }", "public function getFullName(){\n\n return \"{$this->firstname}{$this->lastname}\";\n }", "function getFullName()\r\n\t{\r\n\t\treturn $this->getFirstName() . \" \" . $this->getLastName();\r\n\t}", "public function getFullName()\n {\n $fullName = $this->first_name . ' ' . $this->last_name;\n\n return $fullName;\n }", "public function getFullName()\n {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getFullName():string\n {\n return $this->firstName . \" \" . $this->lastName;\n }", "public function getFullName()\n {\n return \"{$this->lastname} {$this->firstname} {$this->patronymic}\";\n }", "public function getUserFullName() {\n\t\treturn ($this->userFullName);\n\t}", "public function fullName()\n\t{\n\t\treturn trim(\"{$this->first_name} {$this->last_name}\");\n\t}", "public function getFullName() {\n return $this->getFirstName() . ' ' . $this->getLastName();\n }", "function user_fullname($user) {\n\t$nick = (!empty($user->nickname)) ? \" '\".$user->nickname.\"' \" : \"\";\n\techo $user->user_firstname . $nick . $user->user_lastname;\n}", "public function getFullName()\n {\n return $this->getFirstName().' '.$this->getLastName();\n }", "public function getFullName()\n {\n return $this->getFirstName().' '.$this->getLastName();\n }", "public function getFullNameAttribute(): string\n {\n if ($this->user !== null) {\n return $this->user->first_name . ' ' . $this->user->last_name;\n }\n return '';\n }", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->lastname;\n\t\t}", "public function fullName()\n\t{\n\t\treturn \"{$this->first_name} {$this->last_name}\";\n\t}", "public function getFullName() {\n return $this->firstname . ' ' . $this->lastname;\n }", "public function getFullname() {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getUserFullName($user_id)\n\t{\n\t\treturn $this->getUserFirstName($user_id) . ' ' . $this->getUserLastName($user_id);\n\t}", "public function fullName()\n {\n if (isset($this->last_name)) {\n return $this->first_name . ' ' . $this->last_name;\n } else {\n return $this->first_name;\n }\n }", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->Fname.\" \".$this->lastname;\n\t\t}", "function getFullName()\n\t\t{\n\t\t\treturn $this->firstname.\" \".$this->Fname.\" \".$this->lastname;\n\t\t}", "public function getFullname()\n {\n return $this->firstname . ' ' . $this->lastname;\n }", "public function getFullName() {\n $author = $this->getAuthor()->one();\n if ($author == null) {\n return null;\n }\n $this->firstName = $author->firstname;\n $this->lastName = $author->lastname;\n return $this->lastName . ' ' . $this->firstName;\n }", "public function getFullName()\n {\n return $this->firstName.' '.$this->lastName;\n }", "protected function _getFullName()\n {\n return 'ID:'. $this->_properties['id'] . ' ' .\n\t\t$this->_properties['firstName'] . ' ' .\n $this->_properties['lastName'];\n }", "public function getFullname(): string;", "public function getFullName()\n {\n return $this->firstName . ' ' . $this->lastName;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function fullName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullName();", "public function getFullName() {}", "public function getFullname()\n {\n $fullname = trim($this->getName().' '.$this->getLastName());\n return (!$fullname) ? $this->getEmail() : $fullname;\n }", "public function getFullNameAttribute()\n {\n $implode = [];\n\n if ($this->salutation) {\n $implode[] = ucwords($this->salutation);\n }\n if ($this->first_name) {\n $implode[] = $this->first_name;\n }\n\n if ($this->last_name) {\n $implode[] = $this->last_name;\n }\n return implode(' ', $implode);\n }", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "public function fullName()\n {\n return $this->forename.' '.$this->surname;\n }", "public function fullName(): ?string {\n if (null === $this->user) {\n return null;\n }\n $user = $this->user;\n\n return $user->first_name.' '.$user->last_name;\n }", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "public function showfullname()\n {\n return $this->getFirstname() . ' ' . $this->getLastname();\n }", "private function make_full_name() {\n return $this->firstname . \" \" . $this->infix . \" \" . $this->lastname;\n }", "public function fullName() {\n return $this->getFirstName() . \" \" . $this->getLastName();\n }", "public function getFullNameAttribute(): string\n\t{\n\t\treturn implode_not_empty(' ', [$this->name, $this->last_name]);\n\t}", "public function getFullNameShort() {\r\n $fullNameShort = $this->firstName .' '. $this->lastName;\r\n return $fullNameShort;\r\n }", "public function getFullNameAttribute() : string\n {\n if ($this->middle_initial) return $this->first_name . ' ' . $this->middle_initial . '. ' . $this->last_name;\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getName()\n {\n $result = null;\n if (isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'] . ' ' . $this->userInfo['last_name'];\n } elseif (isset($this->userInfo['first_name']) && !isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'];\n } elseif (!isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['last_name'];\n }\n return $result;\n }", "public function getFullName()\n\t{\n\t\treturn \"{$this->nombre} {$this->ape_p} {$this->ape_m}\";\n\t}", "public function getFullname()\n\t{\n\t\treturn $this->fullname();\n\t}", "public function getName()\n {\n $firstName = $this->getFieldValue(self::FIELD_FIRST_NAME);\n $lastName = $this->getFieldValue(self::FIELD_LAST_NAME);\n // User does not exist.\n if (!$firstName && !$lastName) {\n $name = 'Unknown&nbsp;User';\n } else {\n $name = \"{$firstName} {$lastName}\";\n }\n\n return $name;\n }", "public function getFullName()\n\t{\n\t\t// but accessible using \"offsetGet()\" and \"offsetSet()\"\n\t\t// these two methods are the \"getter\" and \"setter\" for ArrayObject\n\t\treturn $this->offsetGet('firstName') \n\t\t\t . ' ' \n\t\t\t . $this->offsetGet('lastName');\n\t}", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "public function getFullNameAttribute(): ?string\n {\n $result = '';\n if (!empty($this->first_name)) {\n $result = $this->first_name;\n }\n if (!empty($this->last_name)) {\n if (strlen($result) > 0) {\n $result .= ' ';\n }\n $result .= $this->last_name;\n }\n\n return strlen($result) > 0 ? $result : null;\n }", "public function getFullname()\n {\n return $this->fullname;\n }", "private function getUserFullName(?string $cleanMode = null): \\Generator\n {\n $info = yield $this->MadelineProto->getInfo($this->MadelineProto->update->getUpdate());\n $fullName = (string) ($info['User']['first_name'] ?? 'No Name');\n isset($info['User']['last_name']) && $fullName .= ' ' . $info['User']['last_name'];\n if ($cleanMode !== null) {\n $fullName = Tools::clean($fullName, $cleanMode);\n }\n\n return $fullName;\n }", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "function formatFullName($fname, $lname)\n{\n\t$fnameLastChar \t= substr($fname, -1, 1);\t// get last character of first name\n\t$lnameFirstChar = substr($lname, 1, 1);\t\t// get first character of last name\n\tif($fnameLastChar == ' ') \t{ $fnameLength = strlen($fname); $fname = substr($fname, 0, $fnameLength - 1); }\n\tif($lnameFirstChar == ' ') \t{ $lnameLength = strlen($lname); $lname = substr($lname, 1, $fnameLength - 1); }\n\t$fullName = $fname.' '.$lname;\n\treturn ($fullName);\n}", "public function getAutoCompleteUserName() {\n// $retVal = $this->username;\n// if (!empty($this->last_name)) {\n// $retVal .= ' - ' . $this->last_name;\n// }\n// if (!empty($this->first_name)) {\n// $retVal .= ' ' . $this->first_name;\n// }\n $arr = array(\n $this->getFullName(),\n $this->getRoleName(),\n $this->getAgentName(),\n );\n $retVal = implode(' - ', $arr);\n\n return $retVal;\n }", "public function getFullName(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_USER_FULL_NAME);\n }", "public function getFullName($fullData = null) {\n\t\t$result = $this->getEmptyText();\n\t\tif (empty($fullData)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$fieldsFullName = [\n\t\t\t[\n\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_SURNAME,\n\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME,\n\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME\n\t\t\t],\n\t\t\t[\n\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME,\n\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME\n\t\t\t]\n\t\t];\n\t\t$dataFullName = [];\n\t\tforeach ($fieldsFullName[0] as $field) {\n\t\t\t$dataItem = h(Hash::get($fullData, $field));\n\t\t\tif (!empty($dataItem)) {\n\t\t\t\t$dataFullName[] = mb_ucfirst($dataItem);\n\t\t\t}\n\t\t}\n\t\tif (count($dataFullName) == 3) {\n\t\t\t$result = implode(' ', $dataFullName);\n\n\t\t\treturn $result;\n\t\t}\n\n\t\tforeach ($fieldsFullName[1] as $field) {\n\t\t\t$dataItem = h(Hash::get($fullData, $field));\n\t\t\tif (empty($dataItem)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result = mb_ucfirst($dataItem);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getFullNameAttribute()\n {\n return ucfirst($this->first_name).' '.ucfirst($this->last_name);\n }", "public function getFullNameAttribute()\n {\n return \"{$this->last_name} {$this->first_name} {$this->middle_name}\";\n }", "public function getFullName()\n {\n return $this->fullName;\n }", "public function getUserDisplayName();", "public function getFullNameAttribute()\n {\n return \"{$this->last_name} {$this->first_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullNameAttribute()\n {\n return \"{$this->first_name} {$this->last_name}\";\n }", "public function getFullName(){\n\t\treturn $this->nombre.' '.$this->apellido;\n\t}", "public function getName()\n {\n $name = $this->getFirstName() . ' ';\n if ($this->getNickName() !== null && $this->getNickName() !== '') {\n $name .= $this->getNickName() . ' ';\n }\n $name .= $this->getLastName();\n return $name;\n }", "public function getFullname()\r\n\t{\r\n\t\treturn $this->FullName;\t\t\r\n\t}", "public function getFullname()\n {\n return $this->fullname;\n }", "public function getShortName()\n {\n return trim($this->first_name . ' ' . ($this->last_name ? $this->last_name{0} . '.' : ''));\n }", "public function getFullNameAttribute()\n {\n return $this->getAttributeFromArray('first_name') . ' ' . $this->getAttributeFromArray('last_name');\n }", "public function getFullNameAttribute()\n {\n return $this->attributes['first_name'] . ' ' . $this->attributes['last_name'];\n }", "public function fullName()\n {\n return $this->getAttribute('first_name').' '.$this->getAttribute('last_name');\n }", "public function fullName(bool $nameFirst = true): string {\n return trim($nameFirst ? $this->first_name . ' ' . $this->last_name : $this->last_name . ' ' . $this->first_name);\n }", "function getRHUL_FullName() {\n return getRHUL_FirstName() . \" \" . getRHUL_LastName();\n}", "public function getFullname() {\n return $this->fullname;\n }", "public function getFullName($userName)\n {\n $fullNameArray = $this->model->getFullName($userName);\n $fullName = $fullNameArray[0]['firstName'] . \" \" . $fullNameArray[0]['lastName'];\n return $fullName;\n }", "public function getFullName()\n {\n if ($this->_fullName === null && $this->employee !== null) {\n $this->_fullName = $this->employee->fullName;\n }\n return $this->_fullName;\n }", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "public function getFullName($userid){\n\t\t$sql = \"select concat(lname,', ',fname,' ',mname) fullname\n\t\t\t\tfrom user_table where userid=\".$userid;\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->result()[0]->fullname;\n\t}", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getSpouseFullName()\n {\n return $this->getSpouseFirstName().' '.$this->getSpouseLastName();\n }", "function GetUserFullName()\r\n{\r\n if(isset($_SESSION['firstname']) || isset($_SESSION['lastname'])){\r\n $userfullname = Escape($_SESSION['firstname']).\" \".Escape($_SESSION ['lastname']);\r\n return $userfullname;\r\n }\r\n return \"LoggedIn User\";\r\n}", "function fullname($firstname,$lastname) {\n // i18n: allows to control fullname layout in address book listing\n // first %s is for first name, second %s is for last name.\n // Translate it to '%2$s %1$s', if surname must be displayed first in your language.\n // Please note that variables can be set to empty string and extra formating \n // (for example '%2$s, %1$s' as in 'Smith, John') might break. Use it only for \n // setting name and surname order. scripts will remove all prepended and appended\n // whitespace.\n return trim(sprintf(dgettext('squirrelmail',\"%s %s\"),$firstname,$lastname));\n }", "protected function getFullNameAttribute()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getName () {\n\n if( $this->first_name && $this->last_name ) {\n $fullName = $this->first_name.' '.$this->last_name;\n return $fullName;\n }\n\n if($this->first_name) {\n return $this->first_name;\n }\n // otherwise\n return null;\n }" ]
[ "0.88807863", "0.8406179", "0.818946", "0.81530416", "0.81102824", "0.80676764", "0.79877394", "0.7919875", "0.79179424", "0.7893183", "0.7893183", "0.7892198", "0.7879585", "0.7817252", "0.77925134", "0.7786947", "0.7780658", "0.7770078", "0.7744989", "0.7738218", "0.7735202", "0.7729852", "0.7726146", "0.7726146", "0.76907015", "0.7681832", "0.7676293", "0.7672164", "0.76346713", "0.7594047", "0.75940186", "0.7574464", "0.7574464", "0.7550886", "0.75461507", "0.75037795", "0.7477587", "0.7473938", "0.74666214", "0.7456848", "0.7456848", "0.7456848", "0.7448533", "0.74457157", "0.741911", "0.7392522", "0.7372602", "0.7368864", "0.73619395", "0.7353344", "0.7347084", "0.73345315", "0.7324276", "0.7319176", "0.73168874", "0.7314446", "0.7304954", "0.7301062", "0.7293756", "0.72576106", "0.7249635", "0.72216886", "0.7208943", "0.7206818", "0.72025055", "0.7189155", "0.7184317", "0.7181191", "0.7176183", "0.71685797", "0.7164364", "0.71617377", "0.71483684", "0.71457475", "0.71379125", "0.7114077", "0.7113464", "0.7113464", "0.7113464", "0.7104875", "0.70957464", "0.7095548", "0.7086835", "0.70758104", "0.70706135", "0.70685494", "0.7066399", "0.70629156", "0.7056665", "0.70383596", "0.7037896", "0.7033351", "0.7031509", "0.70220286", "0.7016663", "0.701164", "0.7007229", "0.7004476", "0.69869745", "0.69863296" ]
0.83666515
2
GetUserID() Return's user's ID number
public function GetUserID() { return $this->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_user_id();", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getUserID(){\n return($this->userID);\n }", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserID() {\n\t\t\treturn $this->iUser; \t\n\t\t}", "public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "public function getUserid()\n {\n return $this->userid;\n }", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "public function getUserID () {\n return $this->id;\n }", "function getUserID() {\n\t\treturn $this->_UserID;\n\t}", "function getUserID() {\n\t\treturn $this->_UserID;\n\t}", "function getUserID() {\n\t\treturn $this->_UserID;\n\t}", "function getUserID() {\n\t\treturn $this->_UserID;\n\t}", "function getUserID() {\n\t\treturn $this->_UserID;\n\t}", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return (int)$this->user_id;\n }", "public static function getUserId() {\n $returnValue = 0;\n if (isset($_SESSION[\"userid\"])) {\n $returnValue = $_SESSION[\"userid\"];\n }\n return $returnValue;\n }", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public static function GetUserID()\n\t{\n\t\treturn self::GetFB()->getUser();\n\t}", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "abstract protected function getUserId() ;", "public function getUserId()\n {\n return $this->userid;\n }", "public function getUserId()\n {\n return $this->userid;\n }", "public function getUserId() : int\n {\n return $this->userId;\n }", "public function getUserId () {\n\t\treturn ($this->userId);\n\t}", "protected function getUserId() {}", "protected function getUserId() {}", "public function getUserId()\r\n\t{\r\n\t\treturn $this->_userid;\r\n\t}", "public function getUserId(): int\n {\n return $this->userId;\n }", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function get_user_id()\n {\n return self::getUser();\n }", "public function getUserId() {\n\t\treturn $this->user_id;\n\t}", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "public function getUserid()\n {\n if ($this->_userid === false) {\n $this->_userid = Userlogin::find()->where(['id' => Yii::$app->user->identity->id])->one();\n }\n return $this->_userid;\n }", "public function getUserId() \n {\n if (!$this->hasUserId()) \n {\n $this->userId = 0;\n }\n\n return $this->userId;\n }", "public function getUser_id()\n {\n return $this->user_id;\n }", "public function getUser_id()\n {\n return $this->user_id;\n }", "function get_userid() {\n return $this->userid;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return parent::getValue('user_id');\n }", "public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }", "public function getID() {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->getValue('nb_user_id');\n }", "public function get_user_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'user_id', $context ) ;\n\t}", "public function get_user_id() {\n\t\treturn $this->user_id;\n\t}", "public function getUserId() {\n\t\treturn ($this->userId);\n\t}", "public function getUserIdUser(): int\n {\n return $this->User_id_user;\n }", "public function getIdUser() \n\t{\n\t\treturn $this->idUser;\n\t}", "public function getUserId() {\n return $this->user_id;\n }", "public function getUserId() {\n return $this->user_id;\n }", "private function get_user_id() {\n\t\t//\treturn intval($_POST['s']);\n\t\tif (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) {\n\t\t\t//$_POST['s'] = $_GET['user_id'];\n\t\t\treturn intval($_GET['user_id']);\n\t\t}\n\t}", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "public function getUserId() {\n\t\treturn($this->userId);\n\t}", "public static function getUserId() {\n if(self::$_identity) {\n return self::$_identity->userid;\n }\n return null;\n }", "public function getIduser()\n {\n return $this->iduser;\n }", "public function getUserId()\n {\n return $this->id;\n }", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "function get_current_user_id()\n {\n }" ]
[ "0.83754134", "0.83009905", "0.8201869", "0.81995666", "0.8148632", "0.8148632", "0.80815613", "0.80815613", "0.80815613", "0.80635446", "0.80485123", "0.80380726", "0.802951", "0.7978551", "0.79627794", "0.79020417", "0.79020417", "0.79020417", "0.79020417", "0.79020417", "0.78751814", "0.7870864", "0.7870864", "0.7870864", "0.78704", "0.78489065", "0.7832904", "0.781501", "0.7798111", "0.77829444", "0.77739173", "0.775741", "0.775741", "0.775741", "0.775741", "0.775741", "0.775741", "0.775741", "0.775741", "0.775741", "0.77537495", "0.7740609", "0.7740609", "0.77099097", "0.77072704", "0.7702034", "0.7702034", "0.77000713", "0.76957417", "0.76863486", "0.76859236", "0.76841974", "0.7673839", "0.76618", "0.76568335", "0.76392525", "0.7639017", "0.7629636", "0.7629636", "0.76225185", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.76055515", "0.7602921", "0.7599705", "0.75979966", "0.7596007", "0.75784963", "0.7565709", "0.75541335", "0.7552328", "0.75304145", "0.7530189", "0.7530189", "0.7530006", "0.7527659", "0.7527646", "0.75233984", "0.7521502", "0.7513391", "0.7510687", "0.7498882" ]
0.7910976
15
GetUserRole() Returns 1 for Manager or 0 for Employee
public function GetUserRole() { return $this->role; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getRole(){\n\t$user = new Pas_User_Details();\n $person = $user->getPerson();\n if($person){\n \treturn $person->role;\n } else {\n \treturn false;\n }\n }", "public function getRole() {}", "public function getRole();", "public function getRole();", "function getRole() {\n\t\treturn 1;\n\t}", "public function getUserRole()\r\n {\r\n $admin_user_session = Mage::getSingleton('admin/session');\r\n $adminUserId = $admin_user_session->getUser()->getUserId();\r\n return Mage::getModel('admin/user')->load($adminUserId)->getRole()->role_name;\r\n }", "public function _getUserRole()\n {\n $this->selftest();\n return $this->objectUserRole;\n }", "protected function _getUserRoleId()\n {\n $cuser = $this->_getUser();\n $role_id = (empty($cuser)) ? ROLE_GUEST : $cuser['role_id'];\n\n return $role_id;\n }", "private function _getRole()\n {\n //return role\n if(false/*logged_in*/){\n\n }else{\n $this->load->Model('user_roles/Mdl_roles');\n return $this->Mdl_roles->getRolesName();\n }\n }", "public static function getUserRole()\n {\n return self::getInstance()->_getUserRole();\n }", "public function getUserRole()\n {\n return $this->userRole;\n }", "public function getUserRole()\n {\n return $this->userRole;\n }", "public static function getRole(){\n $role = Auth::user()->role_id ;\n switch($role){\n case 1 :\n return \"admin\";\n break;\n case 2 :\n return \"khateeb\";\n break ;\n case 3 :\n return \"ad\";\n break;\n default:\n return \"false\";\n }\n }", "function getRole()\n\t{\n\t\tif (($role = $this->getState('__role')) !== null)\n\t\t\treturn $this->role;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function getAuthenticatedRole();", "public function get_role()\n {\n }", "public function getRole()\n {\n $userIdentity = $this->getIdentity();\n if ($userIdentity === false) {\n return false;\n }\n return $userIdentity->role;\n }", "public function getRole() : string;", "public function getRole() {\n $user = new Pas_User_Details();\n $person = $user->getPerson();\n if ($person) {\n $this->_role = $person->role;\n } \n return $this->_role;\n }", "public function getRole()\n {\n return $this->_getVar('user_role');\n }", "public function getRole(): int\n {\n return $this->role;\n }", "function cs_get_user_role() {\n\tglobal $current_user;\n\t$user_roles = $current_user->roles;\n\t$user_role = array_shift($user_roles);\n\treturn $user_role;\n}", "public function getRoleCode(){\n\t\t/* return user code */\n\t\treturn $this->_intRoleCode;\n\t}", "protected function userRole() : string\n {\n return 'user';\n }", "public function role(){\n $role = \"guest\";\n if(Auth::check())\n {\n $role=\"user\";\n $loggedEmail = Auth::user()->email;\n if(Administrator::where('email', $loggedEmail)->exists())\n $role=\"administrator\";\n }\n return $role;\n }", "function get_user_role_id(){\n return $this->user_role_id;\n }", "public function getRole()\n {\n $res = $this->getEntity()->getRole();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getRole();\n\t\t}\n return $res;\n }", "public function getRole() {\n return($this->role);\n }", "function getUserRoleName()\n{\n return array_flip(getConfig('role'))[Auth::user()->role_id];\n}", "function is($role_name){\n $this->CI->load->model('role');\n $role = $this->CI->role->getRoleOnUserByName($this->username(), $role_name);\n if(!empty($role)) return $role;\n else return false;\n }", "protected function getIsRoleAttribute()\n {\n $dataRole = $this->attributes['role'];\n if ($dataRole === 0) {\n return \"Student\";\n } \n if ($dataRole === 1) {\n return \"Teacher\";\n }\n if ($dataRole === 3) {\n return \"Admin\";\n }\n return false;\n }", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }", "function user_role_need ($role) {\r\n\t$info = user_info();\r\n\treturn ($info[3] == $role ? true : false);\r\n}", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "function getRole()\n {\n return $this->role;\n }", "static public function getRole() {\n\t\tif(!Yii::$app->user->isGuest) {\n\t\t\tif($role = AuthAssignment::findOne(['user_id' => Yii::$app->user->identity->id]))\n\t\t\t\tif($key = array_search($role->item_name, Yii::$app->params['league_roles']))\n\t\t\t\t\treturn $key;\n\t\t\treturn self::DEFAULT_ROLE;\n\t\t}\n\t\treturn null;\n\t}", "public static function getUserRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT *\n FROM user_role\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function getRole(){\n return $this->role; \n }", "protected function getRole()\n {\n $this->role = 'ROLE_USER';\n if ($this->isGranted('ROLE_ADMIN')) {\n $this->role = 'ROLE_ADMIN';\n }\n return $this->role;\n }", "public static function userRole()\n\t{\n\t\ttry {\n\t\t\tif(Auth::user()->roles) {\n\t\t\t\treturn ucfirst(Auth::user()->roles->role->name);\n\t\t\t} else {\n\t\t\t\treturn 'User';\n\t\t\t}\n\t\t\treturn 'User';\n\t\t} catch (\\Throwable $th) {\n\t\t\tLog::error('error on userRole in CommanHelper '. $th->getMessage());\n\t\t}\n\t}", "function wv_get_loggedin_user_role() {\n global $current_user;\n\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n\n return $user_role;\n }", "public function getRole() \n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "function ppom_get_current_user_role() {\n \n\tif( is_user_logged_in() ) {\n\t\t$user = wp_get_current_user();\n\t\t$role = ( array ) $user->roles;\n\t\treturn $role[0];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function get_role($role)\n {\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "function get_role() {\n if(is_valid_user()) {\n return $_SESSION['role'];\n } else {\n return null;\n }\n}", "public function _getRoleID()\n {\n $this->selftest();\n return $this->objectUser->RoleID;\n }", "function role() {\n isset($this->_role) || $this->_load_from_session();\n return $this->_role;\n }", "public function getUser_status_role()\n {\n return $this->user_status_role;\n }", "public function getRole() {\n return $this->role;\n }", "public function getUsers_role_role()\n {\n return $this->users_role_role;\n }", "public function getRole() {\n\n return session('role');\n\n }", "public function isEmployee()\n {\n return (\\Auth::user()->role == 'employee');\n }", "public function getRole()\n {\n return $this->access_level;\n }", "public function isRole(){\n $r=Cache::get('role');\n if ((int)$r ==2)\n {\n return true;\n }\n else\n return false;\n }", "function get_user_role() {\n global $current_user;\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n return $user_role; // return translate_user_role( $user_role );\n}", "public function getRole()\n {\n return $this->sessionStorage->user['role'];\n }", "function getUserRole($val)\n{\n $arr = array(\n '1'=>'超级管理员',\n '2'=>'管理员',\n '3'=>'会员'\n );\n return $arr[$val];\n}", "function hasRole($role, $userId = null);", "public function onlineUserRole(){\n return User::getRole();\n }", "public function getDefaultUserRole()\n {\n return $this->defaultUserRole;\n }", "private function getAccessRole(): int {\n // We're doing this because we can get the\n // UserID->ApplicantID while checking the role.\n $tokenRole = Token::getRoleFromToken();\n\n if ($tokenRole === Token::ROLE_FACULTY) {\n return $this::ACCESS_FACULTY;\n }\n elseif ($tokenRole === Token::ROLE_STUDENT) {\n $tokenUsername = Token::getUsernameFromToken();\n $queryUserNameToID = $this->dbc->prepare('\n SELECT *\n FROM Users\n WHERE username = :username;\n ');\n\n $queryUserNameToID->bindParam(':username', $tokenUsername);\n $queryUserNameToID->setFetchMode(PDO::FETCH_ASSOC);\n\n try {\n $queryUserNameToID->execute();\n } catch (Exception $e) {\n $this->userApplicantID = null;\n return $this::ACCESS_USER;\n }\n\n // Let's assume there's one username to ID...\n // extract the userID\n $row = $queryUserNameToID->fetch();\n $this->tokenUserID = $row['userID'];\n\n // Now we can find the associated applicant, if exists.\n $queryAID = $this->dbc->prepare('\n SELECT applicantID, userID\n FROM Applicants\n WHERE userID = :userID;\n ');\n\n $queryAID->setFetchMode(PDO::FETCH_ASSOC);\n $queryAID->bindParam(':userID', $this->tokenUserID);\n\n try {\n $queryAID->execute();\n } catch (Exception $e) {\n $this->userApplicantID = null;\n return $this::ACCESS_USER;\n }\n\n $aidResult = $queryAID->fetch();\n $this->userApplicantID = $aidResult['applicantID'] ?? null;\n\n return $this::ACCESS_USER;\n } else {\n return $this::ACCESS_NONE;\n }\n }", "function getRole($userID) {\n $result = $this->db->dbQuery('Select roleID from User where userID=' . $userID);\n if ($result->num_rows > 0) {\n $finalResult = $result->fetch_assoc();\n return $finalResult['roleID'];\n } else return -1;\n }", "function get_user_role($role_id) {\n\t\treturn $this->db->get_where('system_security.users', array('role_id' => $role_id, 'active' => 1));\n\t\n\t}", "public function getRole()\n\t{\n\t\t$column = self::COL_ROLE;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}", "private function getCurrentRole()\n {\n return AuthAssignment::find()->where(['user_id' => $this->user->id])->andWhere(['item_name' => $this->role])->one();\n }", "public function getRole(): ?int\n {\n return $this->role ?? null;\n }", "function get_current_user_role() {\n\n\tglobal $wp_roles;\n\n\t$current_user = wp_get_current_user();\n\n\t$roles = $current_user->roles;\n\n\t$role = array_shift($roles);\n\n\treturn isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : false;\n\n}", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "public function getRoleID(string $role):string;", "public static function getRole($id_or_email=false){\n self::init();\n\n if(self::isLoggedIn() && $id_or_email === false){\n return $_SESSION['logged_user_role'];\n } else {\n $role = self::$db->get(CONFIG['AUTH_USERS_TABLE'], self::$role_field, [\n 'OR' => [\n self::$email_field => $id_or_email,\n self::$id_field => $id_or_email,\n ]\n ]);\n\n return !is_null($role) ? $role : false;\n }\n }", "public function getRole(): ?string\n { \n return $this->role;\n }", "function get_role_id(){\n return $this->role_id;\n }", "public function hasRole() {\n return $this->_has(2);\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "private static function getUserRole(): array\n\t{\n\t return self::getUser()->roles;\n\t}", "function getRole($uid,$rid){\n\t$sql = \"SELECT \tr.id,r.name\n\t\t\t\t from \t\tadministrador a,roles r\n\t\t\t\t\twhere \ta.Rol = r.id\n\t\t\t\t\tand\t\t\ta.Rol = $rid\n\t\t\t\t\tand \t\ta.IdAdministrador = $uid\";\n\t\n\t$result = mysql_query($sql) or die('Error :'.mysql_error());\n\t\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t $rid = $row->id;\n\t $rname = $row->name;\n\t}\n\t\t\n\tif(trim($rname) == \"Superadmin\"){\n\t\t$role = 1;\n\t}\n\telse{\n\t\t$role = 0;\n\t}\n\treturn $role;\t\t\t\t\n}", "public function getRoleUsuario()\n {\n\t\n\t return $this->roles;\n\t\n }", "public function getUsers_role_id()\n {\n return $this->users_role_id;\n }", "function GetUserRole ($userRoleId = null) {\n $answer = $this->answer;\n\n if ($userRoleId) {\n $roleResult = $this->db\n ->where('role_id', $userRoleId)\n ->get('user_role');\n\n if ($roleResult->num_rows() > 0) {\n $answer['success'] = true;\n $answer['result'] = $roleResult->row();\n }\n else {\n $answer['msg'] = 'can not get role';\n return $answer;\n }\n }\n else {\n $roleResult = $this->db\n ->get('user_role');\n\n if ($roleResult->num_rows() > 0) {\n $answer['success'] = true;\n $answer['result'] = $roleResult->result();\n }\n else {\n $answer['msg'] = 'can not get role list';\n return $answer;\n }\n }\n return $answer;\n }", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getRoleId()\n {\n return $this->__get(\"role_id\");\n }", "public function getRole() : string\n {\n return $this->role;\n }", "public function check_role($username) \n {\n $this->db->select('role');\n $this->db->from('user');\n $this->db->where('adminNumber', $username);\n $query = $this->db->get(); \n $row = $query->row();\n return $row->role;\n }", "function get_current_user_role() {\n\t$current_user = wp_get_current_user();\n\t$roles = $current_user->roles;\n\t$role = array_shift($roles);\n\treturn $role;\n}", "public function getRoleId() {\n if (Yii::app()->getSession()->get('roleId'))\n return Yii::app()->getSession()->get('roleId');\n return null;\n }", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "public function getRoleAttribute(){\n \n $rolesIDs = $this->roles()->pluck('role_id')->toArray();\n $selected = 0;\n if(!empty($rolesIDs)){\n $selected = $rolesIDs[0];\n }\n return $selected;\n }", "public function rolesForUser();" ]
[ "0.7872344", "0.7593834", "0.7592852", "0.7592852", "0.7550908", "0.7520922", "0.7488806", "0.745582", "0.74337673", "0.74128824", "0.73357975", "0.73357975", "0.73347485", "0.7302454", "0.7289681", "0.7289425", "0.72725517", "0.7239393", "0.7239005", "0.71804416", "0.70732474", "0.70624816", "0.7011104", "0.6987307", "0.6984039", "0.6959933", "0.6955622", "0.69361746", "0.6928329", "0.69244266", "0.6916683", "0.69119483", "0.6902171", "0.69013417", "0.6896627", "0.6893452", "0.6880723", "0.68733704", "0.6868465", "0.68585646", "0.68585044", "0.6855921", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.68512297", "0.6849525", "0.6834861", "0.6832475", "0.68271023", "0.6801721", "0.6793401", "0.6775828", "0.6768542", "0.67438096", "0.6743526", "0.673409", "0.6721859", "0.67184734", "0.671193", "0.6706454", "0.6694252", "0.6631189", "0.66275465", "0.66218156", "0.6616862", "0.66140175", "0.6606486", "0.65894043", "0.65827656", "0.657925", "0.6577554", "0.656902", "0.65617883", "0.65612245", "0.6542378", "0.65363926", "0.6502702", "0.649632", "0.649632", "0.6482725", "0.6476985", "0.64753205", "0.6466222", "0.6461518", "0.64548165", "0.64544344", "0.6454356", "0.64479446", "0.6435017", "0.6427962", "0.6415745", "0.641373", "0.6411785" ]
0.718014
20
Logout() Closes session and returns to login screen
public static function Logout() { Session::CloseSession(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function logOut()\n {\n self::startSession();\n session_destroy();\n }", "public function logout()\n { \n Session_activity::delete();\n \n Session_activity::delete_session();\n \n $conf = $GLOBALS['CONF'];\n $ossim_link = $conf->get_conf('ossim_link');\n $login_location = preg_replace(\"/(\\/)+/\",\"/\", $ossim_link.'/session/login.php');\n \n unset($_SESSION);\n header(\"Location: $login_location\");\n \n exit();\n }", "public function logout()\n {\n $this->session->end();\n }", "public function logout() {\r\n Session::end();\r\n Misc::redirect('login');\r\n }", "public function logout()\n {\n session_unset();\n\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"Successfully logged out. Return to <a href=\\\"login.php\\\">login</a>\";\n $site->printFooter();\n\n }", "public function logout()\n {\n Session::destroy();\n $this->ok();\n }", "public function userLogout() {\n // Starting a session to unset and destroy it\n session_start();\n session_unset();\n session_destroy();\n\n // Sending the user back to the login page\n header(\"Location: login\");\n }", "public function logout() {\r\n\t\tSession::delete($this->_sessionName);\r\n\t}", "public function logout()\n {\n $this->deleteSession();\n }", "public function LogOut()\n {\n session_destroy();\n }", "public function logout() {\n\t\tif ($this->isLoggedIn ()) { //only the logged in user may call logout.\n\t\t\t//Remove session data\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t\tunset ($_SESSION['uid']);\n\t\t\tsession_destroy();\n\t\t}\n\t\techo '<reply action=\"ok\" />';\n\t}", "public function logOut () : void {\n $this->destroySession();\n }", "public function logout() {\n\t\t//Bridge Logout\n\t\tif ($this->config->get('cmsbridge_active') == 1 && !$this->lite_mode){\n\t\t\t$this->bridge->logout();\n\t\t}\n\n\t\t//Loginmethod logout\n\t\t$arrAuthObjects = $this->get_login_objects();\n\t\tforeach($arrAuthObjects as $strMethods => $objMethod){\n\t\t\tif (method_exists($objMethod, 'logout')){\n\t\t\t\t$objMethod->logout();\n\t\t\t}\n\t\t}\n\n\t\t//Destroy this session\n\t\t$this->destroy();\n\t}", "public function Logout() \n {\n session_unset();\n session_destroy();\n }", "public function logout() {\r\n\t\tSession::set('login', FALSE, self::$namespace);\r\n\t}", "private static function logout() {\n\t\t$key = Request::getCookie('session');\n\t\t$session = Session::getByKey($key);\n\t\tif ($session)\n\t\t\t$session->delete();\n\t\tOutput::deleteCookie('session');\n\t\tEnvironment::getCurrent()->notifySessionChanged(null);\n\t\tself::$loggedOut->call();\n\t}", "public function logout() {\n @session_start();\n session_destroy();\n }", "public function logout()\n {\n session_unset();\n // deletes session file\n session_destroy();\n }", "public function logoutxxx()\n {\n $this->getSession()->destroy();\n }", "public function logout()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth])) {\t\n\t\t\tSessionManager::instance()->trashLoginCreadentials();\n\t\t}\n\t}", "public function Logout() {\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\theader('location: ?a=login');\n\t}", "public function logout()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect('main');\n\t}", "public function logout()\n\t{\n\t\t$this->session->sess_destroy();\n\n\t\tredirect('login');\n\t}", "public static function logout() {\n session_start();\n session_destroy();\n header(\"Location: /\");\n exit;\n }", "public function logout() {\r\n session_unset();\r\n session_destroy();\r\n header('location: ' . DB::MAIN_URL);\r\n }", "function logout() {\n\t\t$this->session->sess_destroy();\n\t\tredirect('c_login/login_form','refresh');\n\t}", "public function logout()\n {\n\t // unsets all cookies and session data\n process_logout(); \n }", "static function logout()\n {\n session_destroy();\n }", "public function logout(){\n\t\t// Destroy the All Session Variables\n\t\tSession::destroyAll();\n\n\t\t// Redirect to login page with message\n\t\tUrl::redirect('login/?logout=1');\n\t}", "function logout()\n\t{\n\n\t\t// log the user out\n\t\t$this->session->sess_destroy();\n\n\t\t// redirect them to the login page\n\t\tredirect('auth', 'refresh');\n\t}", "public function logout()\r\n {\r\n session_unset();\r\n session_destroy(); \r\n }", "public function action_logout()\n\t{\n\t\tAuth::instance()->logout(TRUE);\n\n\t\t// Redirect back to the login object\n\t\tRequest::current()->redirect(url::site('auth/login',Request::current()->protocol(),false));\n\n\t}", "function logout(){\n session_start();\n session_destroy();\n header(\"Location: \" .LOGIN);\n }", "function action_logout() {\n session_unset();\n session_destroy();\n header('Location: /home/login');\n }", "public function logOut(){\r\n\t\t// Starting sessions\r\n\t\tsession_start();\r\n\t\t\r\n\t\t// Emptying sessions\r\n\t\t$_SESSION['userID'] = '';\r\n\t\t$_SESSION['logged_in'] = false;\r\n\t\t\r\n\t\t// Destroying sessions\r\n\t\tsession_destroy();\r\n\t\theader(\"Location: ?controller=home\");\r\n\t\texit();\r\n\t}", "public function logout()\n {\n session_destroy();\n $this->redirect(BASE_URL . 'index.php?page=home');\n }", "public function logout(){\n session_unset();\n session_destroy();\n }", "public function logOut() {\r\n //Logs when a user exit\r\n $ctrLog = new ControllerLog();\r\n $ctrLog->logOff();\r\n\r\n header('location:../index');\r\n session_destroy();\r\n }", "public function logout()\n {\n unset( $_SESSION['login'] );\n ( new Events() )->trigger( 3, true );\n }", "public function logout()\n\t{\n\t\tSession::destroySession();\n\t\t$this->load->redirectIn();\n\t}", "public function doLogout()\n {\n $this->deleteRememberMeCookie();\n\n $_SESSION = array();\n session_destroy();\n\n $this->user_is_logged_in = false;\n $this->messages[] = MESSAGE_LOGGED_OUT;\n }", "public function logout() {\n session_destroy();\n $this->redirect('?v=index&a=show');\n }", "public function logout() {\n if ($this->User->checkIfClientIsLoggedIn($_SESSION)) {\n $this->User->logoutClient($_SESSION);\n }\n else {\n redirect();\n }\n }", "public function logout()\n {\n $this->session->sess_destroy();\n redirect(\"login\");\n }", "public function logout(){\n\t\t$this->session->sess_destroy();\n\t\tredirect('superpanel/main/login');\n\t}", "public function logout() { \n \n session_destroy(); \n }", "public function logOut(){\n $_SESSION=[];\n session_destroy();\n }", "function logout(){\n\t\tsession_destroy();\n\t\theader(\"Location: http://serenity.ist.rit.edu/~zab5957/341/project1/login.php\");\n\t\texit();\n\t}", "function logout(){\n\t\tsession_destroy();\n\t\theader(\"Location: http://serenity.ist.rit.edu/~zab5957/341/project1/login.php\");\n\t\texit();\n\t}", "function logout(){\n\t\tsession_destroy();\n\t\theader(\"Location: http://serenity.ist.rit.edu/~zab5957/341/project1/login.php\");\n\t\texit();\n\t}", "public function LogOut() {\n\t\t$this->session->UnsetAuthenticatedUser();\n\t\t$this->session->AddMessage('success', \"You have been successfully logged out.\");\n\t}", "public function logout() {\r\n\t\t// remove session entry\r\n\t\t$this->session->unset_userdata($this->sess_login_key);\r\n\t\t$this->rolls = false;\r\n\t}", "function logout()\n {\n $this->session->sess_destroy();\n \n redirect('/login');\n }", "public function logout() {\n $session_key = $this->getSessionKey();\n if ($this->Session->valid() && $this->Session->check($session_key)) {\n $ses = $this->Session->read($session_key);\n if (!empty($ses) && is_array($ses)) {\n $this->Session->delete($session_key);\n $this->Session->delete($this->config['prefixo_sessao'] . '.frompage');\n }\n }\n if ($this->config['auto_redirecionamento'] && !empty($this->config['pagina_logout'])) {\n $this->redirecionar($this->config['pagina_logout']);\n }\n }", "public function logout()\n {\n session_destroy();\n\n // Redirect them to the login screen\n header('location: /id/login');\n }", "public function logout ()\n {\n\n session_destroy();\n header(\"Location:\" . SITE_URL. \"/index.php\");\n }", "public function logout() {\n $this->session->sess_destroy ();\n redirect('login');\n }", "private static function logout() {\r\n\t\t$base = $_SESSION['base'];\r\n\t\t$dbName = $_SESSION['dbName'];\r\n\t\t$configFile = $_SESSION['configFile'];\r\n\t\tsession_destroy();\r\n\t\tsession_regenerate_id(true);\r\n\r\n\t\t// start new session\r\n\t\tsession_start();\r\n\t\t$_SESSION['base'] = $base;\r\n\t\t$_SESSION['dbName'] = $dbName;\r\n\t\t$_SESSION['configFile'] = $configFile;\r\n\t\t$_SESSION['styles'] = array();\r\n\t\t$_SESSION['scripts'] = array();\r\n\t\t$_SESSION['libraries'] = array();\r\n\t\tself::redirect('home', 'success', 'You have been successfully logged out');\r\n\t}", "public function logout() {\r\n\t\tsession_destroy();\r\n\t\tredirect('/User/Login');\r\n\t}", "public function logout(){\n\t\tsession_destroy();\n\t\theader(\"location: index.php\");\n\t\texit;\n\t}", "public function userLogout() {\n session_destroy();\n header('Location: index.php');\n }", "public function logoff(){\n\t\tsession_destroy();\n\t\theader('location: ../view/login.php');\n\t\texit;\n\t}", "public function logOut() {\n\t$this->isauthenticated = false;\n\tunset($_SESSION['clpauthid'], $_SESSION['clpareaname'], $_SESSION['clpauthcontainer']);\n\tsession_regenerate_id();\n}", "public function logout()\n {\n $this->Auth->logout();\n $this->login();\n }", "function logout(){\r\n\t\tsession_destroy();\r\n\t\theader(\"Location:index.php?page=loginForm\");\r\n\t\texit;\r\n\t}", "public function logout() {\n\t\t$this->facebook->destroy_session();\n\t\t// Remove user data from session\n\t\t$this->session->sess_destroy();\n\t\t// Redirect to login page\n redirect('/user_authentication');\n }", "public function logout() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\t$this->session->stop();\n\t\t\t$this->session->start();\n\t\t\t$this->session->set('logout', 'A bientôt !');\n\t\t\theader('Location: index.php?action=forumHome');\n\t\t}\n\t}", "public function logout(){\n\t\t\t// remove all session variables\n\t\t\tsession_unset();\n\t\t\t// destroy the session\n\t\t\tsession_destroy(); \n\t\t}", "public function Logout()\r\n {\r\n\r\n\t\t//destroys the session\r\n\t\t$this->id = NULL;\r\n\t\t$this->email = NULL;\r\n\t\t$this->name = NULL;\r\n\r\n session_unset();\r\n session_destroy();\r\n\r\n\t\t//head to index page\r\n header(\"Location: /index.php\");\r\n\r\n }", "public function logout(){\n session_destroy();\n header('Location: index.php');\n }", "protected function logout() {\n $current_session = $this->Session->id();\n $this->loadModel('CakeSession');\n $this->CakeSession->delete($current_session);\n\n // Process provider logout\n $this->Social = $this->Components->load('SocialIntegration.Social');\n if ($this->Session->read('provider')) {\n $this->Social->socialLogout($this->Session->read('provider'));\n SocialIntegration_Auth::storage()->set(\"hauth_session.{$this->Session->read('provider')}.is_logged_in\", 0);\n $this->Session->delete('provider');\n }\n\n // clean the sessions\n $this->Session->delete('uid');\n $this->Session->delete('admin_login');\n $this->Session->delete('Message.confirm_remind');\n\n // delete cookies\n $this->Cookie->delete('email');\n $this->Cookie->delete('password');\n $cakeEvent = new CakeEvent('Controller.User.afterLogout', $this);\n $this->getEventManager()->dispatch($cakeEvent);\n }", "public function logout(){\n\t\tsession_destroy();\t\t\t\t//destroying session\n\t\tredirect(base_url().\"login\");\t\t//redirecting to login page\n\t}", "public function Action_Logout()\n {\n Zero_App::$Users->IsOnline = 'no';\n Zero_App::$Users->Save();\n Zero_Session::Unset_Instance();\n session_unset();\n session_destroy();\n Zero_Response::Redirect(ZERO_HTTP);\n }", "public function logout()\n {\n $_SESSION = array();\n session_destroy();\n\n header('Location: /home');\n exit();\n }", "public static function destroy(){\r\n\t\t\t\tsession_destroy();\r\n\t\t\t\tsession_unset();\r\n\t\t\t\theader(\"location: login.php\");\r\n\t\t\t}", "public function action_logout(){\n\t\tAuth::instance()->logout();\n \n\t\t#redirect to the user account and then the signin page if logout worked as expected\n\t\tHTTP::redirect('/');\t\n\n\t}", "public function logout() {\n\t\t$this->getCI()->session->sess_destroy();\n\t}", "private function exeLogout() {\n if (isset($this->_userInfo->login_token)) {\n // call login api\n $usrToken = $this->_userInfo->login_token;\n $logoutLnk = API_LOGOUT . '/token/' . $usrToken;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $logoutLnk);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(API_HEADER_CONTENT, API_HEADER_TYPE, API_HEADER_ACCEPT));\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, API_TIMEOUT); //timeout in seconds\n\n $results = curl_exec($ch);\n $results = json_decode($results);\n if ($results->meta->code == 200) {\n // destroy session at my page\n $this->session->unset_userdata('userInfo');\n $this->session->unset_userdata('linkBackLogin');\n $this->session->unset_userdata('passwordUser');\n }\n redirect(site_url('/'));\n } else {\n redirect(site_url('/'));\n }\n }", "function logout() {\n $this -> session -> sess_destroy();\n redirect('home', 'location');\n }", "function logout() {\n User::destroyLoginSession();\n header( \"Location: \" . APP_URL );\n}", "public function logout() {\n session_destroy();\n $this->redirect('/');\n }", "public function actionLogout()\n\t{\n\t\tYii::app()->user->logout();\n\t\tYii::app()->session->clear();\n\t\tYii::app()->session->destroy();\n\t\t$this->redirect(Yii::app()->homeUrl);\n\t}", "function logout()\n {\n session_start();\n session_destroy();\n header(\"Location: \" . BASE_URL);\n }", "public function logout (){\n\t\t$this->load->library('facebook');\n // Logs off session from website\n $this->facebook->destroySession();\n\t\t$this->session->sess_destroy();\n\t\t}", "public function logout() {\n $logout = $this->ion_auth->logout();\n\n // redirect them back to the login page\n redirect('login');\n }", "public function logout(){\n\t\t$this->session->sess_destroy();\n\t\tredirect('/');\n\t}", "public function logout ()\n {\n unset ( $_SESSION['user_id'] );\n unset ( $_SESSION['email'] );\n unset ( $_SESSION['order_count'] );\n unset ( $_SESSION['like_count'] );\n //session_destroy () ;\n header( 'Location:' . \\f\\ifm::app()->siteUrl . 'login' );\n }", "public function logout() {\n unset($_SESSION['uID']);\n\n // close the session\n session_write_close();\n\n // send to the homepage\n header('Location: '.BASE_URL);\n\n }", "public function logout() {\n\t\tSentry::logout();\n\t\tredirect(website_url('auth'));\n\t}", "public function logoutAction()\n {\n session_unset();\n header(\"Location: /SafeRideStore\");\n }", "public function logout() {\n $this->run('logout', array());\n }", "public function logout()\n\t{\n\t\t$this->session->unset_userdata('logged_in');\n\t\theader(\"location:\". site_url('?status=loggedout'));\n\t}", "public function logoutAction(){\n\t\t$this->session->destroy();\n\t\t$this->response->redirect(\"$this->controller/signIn\");\n\t}", "public function logout() {\n\t\t\t// Destroy the cookie\n\t\t\tsetcookie(session_name(),'', time() - 42000);\n\t\t\t// Unset session values\n\t\t\t$_SESSION = [];\n\t\t\t// Destroy session\n\t\t\tsession_destroy();\n\t\t\t// Redirect\n\t\t\theader('Location: ./');\n\t\t}", "public function logout(){\n session_destroy();\n unset($_SESSION);\n }", "public function logout(){\n $this->_user->logout();\n }", "public function logout()\n {\n DbModel::logUserActivity('logged out of the system');\n\n //set property $user of this class to null\n $this->user = null;\n\n //we call a method remove inside session that unsets the user key inside $_SESSION\n $this->session->remove('user');\n\n //we then redirect the user back to home page using the redirect method inside Response class\n $this->response->redirect('/');\n\n\n }", "public function logout() {\n\t\t$this->setLoginStatus(0);\n\t}", "function Signout() {\n session_destroy();\n}", "public function end_login(){\n\n\t\t//STARTS SESSION IF NON\n\t\tsession_id() == ''? session_start(): NULL;\n\n\t\t$this->LOGGED_IN = false;\n\t\tunset($this->USER_ID);\n\n\t\t$_SESSION = Array();\n\n\t\tsetcookie(\"PHPSESSID\", NULL, time()-3600, '/');\n\t\tsetcookie(\"user\", NULL, time()-3600, '/');\n\n\t\techo Janitor::build_json_alert('Logged Out Successfully', 'Success', 107, 1);\n\t\texit;\n\t\t}" ]
[ "0.8442549", "0.8360225", "0.83082336", "0.8288833", "0.82682294", "0.8265262", "0.82278305", "0.82249373", "0.821423", "0.8210084", "0.82098794", "0.8203934", "0.82014424", "0.8174821", "0.81561655", "0.8118859", "0.81179655", "0.80941784", "0.8085273", "0.8083066", "0.8075119", "0.80700505", "0.806584", "0.8064809", "0.8049729", "0.8048938", "0.80460423", "0.80450946", "0.8037738", "0.8031728", "0.80269986", "0.8026505", "0.80182576", "0.8015947", "0.80112135", "0.8007649", "0.80052334", "0.8002231", "0.7996121", "0.7987937", "0.7986112", "0.7985", "0.79743177", "0.79725784", "0.7949361", "0.79452837", "0.79292595", "0.79278266", "0.79278266", "0.79278266", "0.79205936", "0.791302", "0.79104507", "0.7909261", "0.79045534", "0.7900064", "0.789855", "0.7897388", "0.78745645", "0.78743213", "0.78728783", "0.78711534", "0.78704536", "0.7867602", "0.7867184", "0.786114", "0.7851717", "0.7850469", "0.78454655", "0.7837689", "0.7831713", "0.78309137", "0.7826682", "0.78184587", "0.7817153", "0.78166586", "0.7816269", "0.78109235", "0.78069556", "0.7806421", "0.7798583", "0.77900577", "0.77862996", "0.7784276", "0.7781551", "0.7778502", "0.7777745", "0.7776242", "0.7770467", "0.7769305", "0.7766743", "0.7766563", "0.7751497", "0.7747379", "0.7747051", "0.7746798", "0.7746722", "0.774516", "0.77419394", "0.7736081" ]
0.8388605
1
Display a listing of the resource.
public function index() { // return view($this->folder.'/index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // return view($this->folder.'/create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // // print_r($request->all()); $text = $request->text; // validation if (empty($text)) { $title = "Failed"; $message = 'Data is Empty'; $type = 'danger'; } else{ $crud = new Crud; $crud->text = $text; $save = $crud->save(); if ($save) { $title = "Success"; $message = 'Saved Data Successfully'; $type = 'success'; } else{ $title = "Failed"; $message = 'Failed to Save Data'; $type = 'danger'; } } $json = [ 'title'=>$title, 'message'=>$message, 'type'=>$type, 'state'=>'show' ] ; return $json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // $data = Crud::find($id); return view($this->folder.'/edit',compact('data'));; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $text = $request->text; // validasi if (empty($text)) { $title = "Failed"; $message = 'Data is Empty'; $type = 'danger'; } else{ $crud = Crud::find($id); $crud->text = $text; $save = $crud->save(); if ($save) { $title = "Success"; $message = 'Data Updated Successfully'; $type = 'success'; } else{ $title = "Failed"; $message = 'Failed to Update Data'; $type = 'danger'; } } $json = [ 'title'=>$title, 'message'=>$message, 'type'=>$type, 'state'=>'show' ] ; return $json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // $crud = Crud::find($id); if (count($crud) > 0 ) { $delete = $crud->delete(); if ($delete) { $title = "Success"; $message = 'Deleted Data Successfully'; $type = 'success'; } else{ $title = "Failed"; $message = 'Failed to Delete Data'; $type = 'danger'; } } else{ $title = "Failed"; $message = 'Failed to Delete Data'; $type = 'danger'; } $json = [ 'title'=>$title, 'message'=>$message, 'type'=>$type, 'state'=>'show' ] ; return $json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Submit a survey for the first time
public function insert_submission($survey_id, $data, $current_page = 0, $complete = FALSE) { $hash = md5( microtime() . $survey_id . $this->session->userdata('session_id') ); $data = array( 'hash' => $hash, 'member_id' => $this->session->userdata('member_id'), 'survey_id' => $survey_id, 'data' => json_encode($data), 'created' => time(), 'completed' => $complete ? time() : NULL, 'current_page' => $current_page ); $this->db->insert('vwm_surveys_submissions', $data); return $this->db->affected_rows() > 0 ? $hash : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function submit_survey_post()\n\t\t{\n\t\t\t$testId = $this->post('testId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($testId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'ts_uuid' => $uuid,\n\t\t\t\t\t'ts_test_id' => $testId,\n\t\t\t\t\t'ts_week' => $weekSend,\n\t\t\t\t\t'ts_submitted_on' => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->insertSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function takeSurvey(){\n $this->load->database();\n\n $test['title'] = 'Survey';\n\n $test['survey'] = $this -> Survey_model -> get_survey();\n\n $data['title'] = 'Add a response to Survey';\n\n \t$this->form_validation ->set_rules('Student_Answer', 'Student_Answer', 'required');\n $this->form_validation ->set_rules('Q_ID', 'Q_ID', 'required');\n $this->form_validation ->set_rules('Surv_ID', 'Surv_ID', 'required');\n $this->form_validation ->set_rules('S_ID', 'S_ID', 'required');\n \n \n \n if($this->form_validation->run()=== FALSE){\n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n\n }else{\n\n $this -> Survey_model -> takeSurvey(); \n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n }\n }", "function testSimpleSurvey()\n\t{\n\t\t$this->loadAndCacheFixture();\n\t\t$this->switchUser(FORGE_ADMIN_USERNAME);\n\t\t$this->gotoProject('ProjectA');\n\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\n\t\t// Create some questions\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"This is my first question (radio) ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my second question (text area) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Area\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my third question (yes/no) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Radio Buttons Yes/No\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a comment line of text\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Comment Only\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a my fifth question (text field) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\n\t\t// Create survey\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='4']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='2']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='5']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='3']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"This is a my fifth question (text field) ?\");\n\t\t$this->assertTextPresent(\"This is a comment line of text\");\n\t\t$this->assertTextPresent(\"This is my third question (yes/no) ?\");\n\t\t$this->assertTextPresent(\"This is my second question (text area) ?\");\n\t\t$this->clickAndWait(\"//input[@name='_1' and @value='3']\");\n\t\t$this->type(\"_2\", \"hello\");\n\t\t$this->clickAndWait(\"_3\");\n\t\t$this->clickAndWait(\"_5\");\n\t\t$this->type(\"_5\", \"text\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"Warning - you are about to vote a second time on this survey.\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=Result\");\n\t\t$this->assertTextPresent(\"YES (1)\");\n\t\t$this->assertTextPresent(\"3 (1)\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5\");\n\t\t// Check that the number of votes is 1\n\t\t$this->assertEquals(\"1\", $this->getText(\"//main[@id='maindiv']/table/tbody/tr/td[5]\"));\n\n\t\t// Now testing by adding new questions to the survey.\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Another added question ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Q8 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q9 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='8']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='9']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5, 6, 7, 8, 9\");\n\n\t\t// Check that survey is public.\n\t\t$this->logout();\n\t\t$this->gotoProject('ProjectA');\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->assertTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\n//\t\t// Set survey to private\n//\t\t$this->login(FORGE_ADMIN_USERNAME);\n//\n//\t\t$this->open(\"/survey/?group_id=6\");\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->clickAndWait(\"link=Administration\");\n//\t\t$this->clickAndWait(\"link=Add Survey\");\n//\t\t$this->clickAndWait(\"link=Edit\");\n//\t\t$this->clickAndWait(\"//input[@name='is_public' and @value='0']\");\n//\t\t$this->clickAndWait(\"submit\");\n//\t\t// Log out and check no survey is visible\n//\t\t$this->clickAndWait(\"link=Log Out\");\n//\t\t$this->select($this->byName(\"none\"))->selectOptionByLabel(\"projecta\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->assertTextPresent(\"No Survey is found\");\n//\n//\t\t// Check direct access to a survey.\n//\t\t$this->open(\"/survey/survey.php?group_id=6&survey_id=1\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->assertFalse($this->isTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\"));\n\t}", "public function pi_ajax_submit_survey() {\n\t //if user is logged in validate nonce and then save their choice\n\t\tif ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'pi_msg_ajax') ) {\n\t\t\tstatus_header( '401' );\n\t\t\tdie();\n\t\t}else{\n\t\t\t$survey_type = $_POST['surveyType'];\n\t\t\t$posted = array();\n\t\t\tparse_str( $_POST[ 'formData' ] , $posted);\n\t\t\t\n\t\t\tif( $survey_type === 'alumni-survey'){\n\t\t\t\t\n\t\t\t\t$message = $this->pi_process_alumni_survey($posted);\n\n\t\t\t}elseif( $survey_type === 'staff-survey'){\n\n\t\t\t\t$message = $this->pi_process_staff_survey($posted);\n\n\t\t\t}elseif( $survey_type === 'family-survey'){\n\n\t\t\t\t$message = $this->pi_process_family_survey($posted);\n\n\t\t\t}\n\t\t\t// $to = array('[email protected]', '[email protected]' , '[email protected]');\n\t\t\t$to = '[email protected]';\n\t\t\t$subject = 'Patient Survey from' . get_bloginfo('name');\n\t\t\t$headers[] = 'From:' . get_bloginfo('name') . ' <[email protected]>';\n\t\t\twp_mail( $to, $subject, $message, $headers);\n\n\t\t\t$response = 'Thank you for submitting the survey. <a href=\"'.home_url().'\">To continue using this website click here</a>.';\n\t\t wp_send_json_success( $response );\t\t\n\t\t}\n\t}", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function store_survey_post()\n\t\t{\n\t\t\t$clickValue = $this->post('clickValue');\n\t\t\t$optionId = $this->post('optionId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($clickValue) &&\n\t\t\t\t!empty($optionId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'tans_opt_id' => $optionId,\n\t\t\t\t\t'tans_uuid' => $uuid,\n\t\t\t\t\t'tans_week' => $weekSend,\n\t\t\t\t\t'trans_survey_value' => $clickValue\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->storeStudentSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function startSurvey($respondent = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'user'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'respondentGUID' => $respondent)); // send to the main survey routine\n }", "public function submit(Request $request, $id)\n {\n if($id != $request->input('survey_id')) {\n if($request->has('return_url')\n && strlen($request->input('return_url'))>5) {\n return response()\n ->header('Location', $request->input('return_url'));\n }\n }\n\n $survey = \\App\\Survey::find($id);\n $answerArray = array();\n $validationArray = array();\n $messageArray = array();\n\n //loop through questions and check for answers\n foreach($survey->questions as $question) {\n if($question->required)\n {\n $validationArray['q-' . $question->id] = 'required';\n $messageArray['q-' . $question->id . '.required'] = $question->label . ' is required';\n }\n if($request->has('q-' . $question->id)) {\n if(is_array($request->input('q-' . $question->id)) && count($request->input('q-' . $question->id))) {\n $answerArray[$question->id] = array(\n 'value' => implode('|', $request->input('q-' . $question->id)),\n 'question_id' => $question->id\n );\n } elseif ( strlen(trim($request->input('q-' . $question->id))) > 0) {\n\n $answerArray[$question->id] = array(\n 'value'=> $request->input('q-' . $question->id),\n 'question_id'=>$question->id\n );\n\n } // I guess there is an empty string\n }\n }\n\n\n\n $this->validate($request, $validationArray, $messageArray);\n\n //if no errors, submit form!\n if(count($answerArray) > 0) {\n $sr = new \\App\\SurveyResponse(['survey_id'=>$id, 'ip'=>$_SERVER['REMOTE_ADDR']]);\n $sr->save();\n foreach($answerArray as $qid => $ans) {\n // print_r($ans);\n $sr->answers()->create($ans);\n }\n }\n\n\n if($survey->return_url\n && strlen($survey->return_url)>5\n && !$survey->kiosk_mode ) {\n return redirect()->away($survey->return_url);\n } else {\n return redirect('thanks/' . $survey->id);\n }\n }", "public function run()\n {\n $survey = \\App\\Models\\Survey::create([\n 'availability' => true,\n 'camunda_identifier' => 'survey_001',\n 'title' => 'Diabetes Quality of Life',\n 'description' => 'Diabetes Quality of Life survey captures your satisfaction, impact and worry related to living with the diagnosis of diabetes (Type 1 or 2).',\n 'explanation' => 'Please rate your answers from 1 (least impact on you) to 5 (highest impact on you). Please choose only one response for each question.',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_01',\n 'text' => 'How satisfied are you with the amount of time it takes to manage your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_02',\n 'text' => 'How satisfied are you with the amount of time you spend getting checkups?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_03',\n 'text' => 'How satisfied are you with the time it takes to determine your sugar level?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_04',\n 'text' => 'How satisfied are you with your current treatment?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_05',\n 'text' => 'How satisfied are you with your knowledge about your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_06',\n 'text' => 'How satisfied are you with life in general?',\n ]);\n\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_01',\n 'text' => 'How often do you feel pain associated with the treatment for your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_02',\n 'text' => 'How often do you feel physically ill?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_03',\n 'text' => 'How often does your diabetes interfere with your family life?',\n ]);\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_04',\n 'text' => 'How often do you find your diabetes limiting your social relationships and friendships?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_05',\n 'text' => 'How often do you find your diabetes limiting your sexual life?',\n ]);\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_06',\n 'text' => 'How often do you find your diabetes limiting your life plans such as employment, education or training?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_07',\n 'text' => 'How often do you find your diabetes limiting your leisure activities or travels?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_01',\n 'text' => 'How often do you worry about whether you will pass out?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_02',\n 'text' => 'How often do you worry that your body looks different because you have diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_03',\n 'text' => 'How often do your worry that you will get complications from your diabetes?',\n ]);\n\n\n $questions = \\App\\Models\\Question::where('survey_id', $survey->id)->get();\n\n foreach ($questions as $question) {\n $index = 0;\n\n while ($index <= 4) {\n $index++;\n \\App\\Models\\Answer::create([\n 'question_id' => $question->id,\n 'text' => $index,\n 'value' => $index,\n ]);\n }\n }\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function reset_survey_post()\n\t\t{\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($uuid) && !empty($weekSend))\n\t\t\t{\n\t\t\t\t$this->db->where('ts_uuid' , $uuid)\n\t\t\t\t\t\t->where('ts_week' , $weekSend)\n\t\t\t\t\t\t->where('ts_test_id' , 1)\n\t\t\t\t\t\t->delete('plused_test_submited');\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function testCreateSurvey()\n {\n $data = [\n 'year' => 2020,\n 'type' => Survey::TRAINER,\n 'title' => 'My Awesome Survey',\n 'prologue' => 'Take the survey',\n 'epilogue' => 'Did you take it?'\n ];\n\n $response = $this->json('POST', 'survey', [\n 'survey' => $data\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', $data);\n }", "function survey_add($d){\n $url = $this->url.\"survey_add\";\n $data['case_id'] =$d['case_id'] ;\n $data['satisfactoriness'] =$d['satisfactoriness'] ;\n $data['satisfied_reason'] =$d['satisfied_reason'] ;\n $data['submitter'] =$d['submitter'] ;\n $this->setTransactionToLog(\"method:\".__METHOD__);\n $result = $this->_exec($url,$data);\n }", "function submit() {\n\t\tThesisHandler::setupTemplate();\n\n\t\t$journal = &Request::getJournal();\n\t\t$journalId = $journal->getJournalId();\n\n\t\t$thesisPlugin = &PluginRegistry::getPlugin('generic', 'ThesisPlugin');\n\n\t\tif ($thesisPlugin != null) {\n\t\t\t$thesesEnabled = $thesisPlugin->getEnabled();\n\t\t}\n\n\t\tif ($thesesEnabled) {\n\t\t\t$thesisPlugin->import('StudentThesisForm');\n\n\t\t\t$templateMgr = &TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'thesis'), 'plugins.generic.thesis.theses'));\n\t\t\t$thesisDao = &DAORegistry::getDAO('ThesisDAO');\n\n\t\t\t$thesisForm = &new StudentThesisForm();\n\t\t\t$thesisForm->initData();\n\t\t\t$thesisForm->display();\n\n\t\t} else {\n\t\t\t\tRequest::redirect(null, 'index');\n\t\t}\n\t}", "private function json_submitSurvey()\n {\n\n // Gets the input data entered in the Front-End\n $input = json_decode(file_get_contents(\"php://input\"));\n $title = $_POST['title'];\n $description = $_POST['description'];\n $question = $_POST['question'];\n $file = $_FILES['file']['name'];\n\n // Gets the last SurveyID\n $query = \"SELECT surveyID FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\n $params = [];\n $resLastSurveyID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentSurveyID = $resLastSurveyID['data']['0']['surveyID'] + 1;\n\n // Gets the last QuestionID\n $query = \"SELECT questionID FROM Questions ORDER BY questionID DESC LIMIT 1;\";\n $params = [];\n $resLastQuestionID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentQuestionID = $resLastQuestionID['data']['0']['questionID'] + 1;\n\n // Create the Uploads Directory\n $uploadsDirectory = dirname(__FILE__, 2) . \"/uploads\";\n $surveyDirectory = $uploadsDirectory . \"/\" . $currentSurveyID;\n $questionDirectory = $surveyDirectory . \"/\" . $currentQuestionID;\n// $questionDirectory = $questionDirectory . \"/\";\n\n // File Permissions\n if (!file_exists($questionDirectory)) {\n mkdir($questionDirectory, 0777, true);\n }\n\n // File Checks\n $path = pathinfo($file);\n $filename = $path['filename'];\n $ext = $path['extension'];\n $temp_name = $_FILES['file']['tmp_name'];\n $path_filename_ext = $questionDirectory . \"/\" . $filename . \".\" . $ext;\n if (file_exists($path_filename_ext)) {\n // echo \"Sorry, File Already Exists.\";\n } else {\n move_uploaded_file($temp_name, $path_filename_ext);\n // echo \"Congratulations! File Uploaded Successfully.\";\n }\n $media_url = \"uploads/\" . $currentSurveyID . \"/\" . $currentQuestionID . \"/\" . $_FILES['file']['name'];\n\n // Insert survey data into the Survey table\n $createSurveyQuery = \"INSERT INTO Surveys (surveyTitle, surveyDescription) VALUES (:surveyTitle, :surveyDescription);\";\n\n $createSurveyParams =\n [\n \":surveyTitle\" => $title,\n \":surveyDescription\" => $description,\n ];\n\n $resCreateSurvey = json_decode($this->recordset->getJSONRecordSet($createSurveyQuery, $createSurveyParams), true);\n\n print_r($resCreateSurvey);\n\n // Insert question data into the Questions table\n $createQuestionQuery = \"INSERT INTO Questions (question, mediaPath, surveyID) VALUES (:question, :media_url, :surveyID);\";\n\n $createQuestionParams =\n [\n \":question\" => $question,\n \":media_url\" => $media_url,\n \":surveyID\" => $currentSurveyID,\n ];\n\n $resCreateQuestion = json_decode($this->recordset->getJSONRecordSet($createQuestionQuery, $createQuestionParams), true);\n\n $res['status'] = 200;\n $res['filename'] = $file;\n $res['dirnametest'] = dirname(__FILE__, 2);\n $res['lastSurveyID'] = $resLastSurveyID;\n $res['lastQuestionID'] = $resLastQuestionID;\n $res['questionDirectory'] = $questionDirectory;\n\n return json_encode($res);\n }", "function testSurvey($id = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'test'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'surveyId' => $id)); // send to the main survey routine\n }", "public function actionCreate() {\n $model = new Surveys();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() == TRUE) {\n // print_r($model);\n $model->save();\n Yii::$app->session->setFlash('success', \"Poll Created Succsesfully\");\n\n return $this->redirect('create');\n } else {\n $sessions = Yii::$app->session->set(\"Error\", \"Error when creating Survey\");\n }\n //print_r($model);\n //return $this->redirect(['view', 'id' => $model->survey_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function surveyQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyQuestion\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) { // only proceed if this is an ajax request\n if (!$this->request->is('post')) {\n if ($id != null) { // existing question being edited so retrieve it from the session\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempData = $this->Session->read('SurveyQuestion.new');\n $this->set('question_index', $id);\n $question = $tempData[$id];\n $question['Choice']['value'] = $this->Survey->Question->Choice->CombineChoices($question['Choice']);\n $this->request->data['Question'] = $question; // send the existing question to the view\n }\n }\n $this->render('/Elements/question_form');\n } else { // returning with data from the form here\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempArr = $this->Session->read('SurveyQuestion.new');\n }\n $this->request->data['Question']['Choice'] = $this->Survey->Question->Choice->SplitChoices($this->request->data['Question']['Choice']['value']);\n $this->Survey->Question->set($this->request->data);\n $checkfieldsArr = $this->Survey->Question->schema();\n unset($checkfieldsArr['id']);\n unset($checkfieldsArr['survey_id']);\n unset($checkfieldsArr['order']);\n $checkfields = array_keys($checkfieldsArr);\n if ($this->Survey->Question->validates(array('fieldList' => $checkfields))) {\n if (is_null($id)) {\n $tempArr[] = $this->request->data['Question'];\n } else {\n $tempArr[$id] = $this->request->data['Question'];\n }\n $this->Session->write('SurveyQuestion.new',$tempArr);\n } else {\n $errors = $this->Survey->Question->invalidFields();\n $this->Session->setFlash('Invalid question: '.$errors['question'][0], true, null, 'error');\n }\n $this->set('questions', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_questions');\n }\n }\n }", "public function testVenueSubmitSurvey()\n {\n $this->buildVenueSurvey();\n\n $venueG = $this->venueGroup;\n $venueQ = $this->venueQuestion;\n\n $response = $this->json('POST', 'survey/submit', [\n 'slot_id' => $this->slot->id,\n 'type' => Survey::TRAINING,\n 'survey' => [\n [\n 'survey_group_id' => $venueG->id,\n 'answers' => [\n [\n 'survey_question_id' => $venueQ->id,\n 'response' => 'a response'\n ]\n ]\n ],\n ]\n ]);\n\n $response->assertStatus(200);\n\n $this->assertDatabaseHas('survey_answer', [\n 'person_id' => $this->user->id,\n 'slot_id' => $this->slot->id,\n 'survey_question_id' => $venueQ->id,\n 'response' => 'a response'\n ]);\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "public function create(Request $request)\n {\n\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'kiosk_mode' => 'boolean',\n 'begin_at' => 'nullable|date',\n 'end_at' => 'nullable|date'\n ]);\n\n $survey_details = $request->intersect([\n 'name', 'description', 'return_url', 'css', 'thank_you_message',\n 'slug', 'kiosk_mode', 'begin_at', 'end_at'\n ]);\n\n if(isset($survey_details['slug'])) {\n $survey_details['slug'] = str_replace(' ','_', $survey_details['slug']);\n }\n\n if(isset($survey_details['begin_at'])) {\n $survey_details['begin_at'] = date('Y-m-d H:i:s', strtotime($survey_details['begin_at']));\n }\n\n if(isset($survey_details['end_at'])) {\n $survey_details['end_at'] = date('Y-m-d H:i:s', strtotime($survey_details['end_at']));\n }\n\n //ok, we're valid, now to save form data as a new survey:\n $survey = Survey::create(\n $survey_details\n );\n return redirect('/addquestion/' . $survey->id . '#new-question-form');\n }", "public static function insertSurvey()\n\t{\n\t\tif(isset($_POST['SurveyID']) && (is_numeric($_POST['SurveyID'])))\n\t\t{//insert response!\n\t\t\t$iConn = IDB::conn();\n\t\t\t// turn off auto-commit\n\t\t\tmysqli_autocommit($iConn, FALSE);\n\t\t\t//insert response\n\t\t\t$sql = sprintf(\"INSERT into \" . PREFIX . \"responses(SurveyID,DateAdded) VALUES ('%d',NOW())\",$_POST['SurveyID']);\n\t\t\t$result = @mysqli_query($iConn,$sql); //moved or die() below!\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Entering Response: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\t\t\n\t\t\t//retrieve responseid\n\t\t\t$ResponseID = mysqli_insert_id($iConn); //get ID of last record inserted\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Retrieving ResponseID: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\n\t\t\t//loop through and insert answers\n\t\t\tforeach($_POST as $varName=> $value)\n\t\t\t{//add objects to collection\n\t\t\t\t $qTest = substr($varName,0,2); //check for \"obj_\" added to numeric type\n\t\t\t\t if($qTest==\"q_\")\n\t\t\t\t {//add choice!\n\t\t\t\t \t$QuestionID = substr($varName,2); //identify question\n\t\t\t\t \t\n\t\t\t\t \tif(is_array($_POST[$varName]))\n\t\t\t\t \t{//checkboxes are arrays, and we need to loop through each checked item to insert\n\t\t\t\t\t \twhile (list ($key,$value) = @each($_POST[$varName])){\n\t\t\t\t\t\t \t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t\t \t\t$result = @mysqli_query($iConn,$sql);\n\t\t\t\t\t \t\tif(!$result)\n\t\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (array/checkbox): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t \t\t}else{//not an array, so likely radio or select\n\t\t\t\t \t\t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t \t $result = @mysqli_query($iConn,$sql);\n\t\t\t\t \t if(!$result)\n\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (single/radio): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t} \n\t\t\t \t\t}\n\t\t\t\t }\n\t\t\t}\n\t\t\t//we got this far, lets COMMIT!\n\t\t\tmysqli_commit($iConn);\n\t\t\t\n\t\t\t// our transaction is over, turn autocommit back on\n\t\t\tmysqli_autocommit($iConn, TRUE);\n\t\t\t\n\t\t\t//count total responses, update TotalResponses\n\t\t\tself::responseCount((int)$_POST['SurveyID']); //convert to int on way in!\n\t\t\treturn TRUE; #\n\t\t}else{\n\t\t\treturn FALSE;\t\n\t\t}\n\n\t}", "function printSurveyCreationForm() {\n\tglobal $tool_content, $langTitle, $langPollStart, \n\t\t$langPollEnd, $langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langCreate, $langSurveyContinue, $start_cal_Survey, $end_cal_Survey;\n\t\n\t$CurrentDate = date(\"Y-m-d H:i:s\");\n\t$CurrentDate = htmlspecialchars($CurrentDate);\n\t$tool_content .= <<<cData\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t<input type=\"hidden\" value=\"0\" name=\"MoreQuestions\">\n\t<table><thead></thead>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\"></td></tr>\n\t\t<tr><td>$langPollStart</td><td colspan=\"2\">\n\t\t\t$start_cal_Survey\n\t\t</td></tr>\n\t\t<tr><td>$langPollEnd</td><td colspan=\"2\">$end_cal_Survey</td></tr>\n\t\t<!--<tr>\n\t\t <td>$langType</td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"1\" />\n\t $langSurveyMC</label></td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"2\" />\n\t $langSurveyFillText</label></td>\n\t\t</tr>-->\n\t\t<input name=\"UseCase\" type=\"hidden\" value=\"1\" />\n\t\t<tr><td colspan=\"3\" align=\"right\">\n <input name=\"$langSurveyContinue\" type=\"submit\" value=\"$langSurveyContinue -&gt;\"></td></tr>\n\t</table>\n\t</form>\ncData;\n}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "function userSurvey() {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n if (!$this->Session->check('Survey.progress')) {\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // logic for the survey process starts here\n switch ($progress) {\n case INTRO:\n $this->layout = 'intro'; // use the intro layout\n $this->render('/Elements/intro');\n break;\n case RIGHTS:\n $this->layout = 'rights'; // use the more rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent);\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function askFaq()\n {\n $faq = new \\Model\\Entity\\Faq();\n\n if (!empty($_POST)){\n $faq->setSubject($_POST['subject']);\n $faq->setQuestion($_POST['question']);\n\n if ($faq->isValid()){\n $faqManager = new FaqManager();\n $faqManager->create($faq);\n View::show(\"faq/questionsend.php\", \"Question send\");\n }\n }\n else{\n View::show(\"faq/askFaq.php\", \"Ask your question\");\n }\n }", "function submitoswestrysurvey()\n {\n $userdetails = $this->userInfo();\n \n $therapistid = $this->fetch_all_rows($this->execute_query(\"select therapist_id from therapist_patient where patient_id = '{$userdetails['user_id']}' and status = 1\"));\n \n $oswestrydata = $this->jsondecode($_REQUEST['oswestrydata'], true);\n \n $score = 0;\n $count = 0;\n foreach($oswestrydata as $key => $value)\n {\n if($key == 'painscale')\n continue;\n $score += ($value - 1);\n $count++;\n }\n \n /*\n * algorithm for calculating the score\n */\n $score = round(($score / (5 * $count)) * 100);\n $painscale = ($oswestrydata['painscale']) * 10;\n \n //determine which oswestry survey is taken\n \n /*\n * The Oswestry Outcome Measure (i.e. survey) will be assigned at the \n * following intervals automatically. Day 1, Day 18, Day 37, Day 53.\n */\n\t\t $surveynumber=1;\n if($_REQUEST['surveytakenon'] >= 1 && $_REQUEST['surveytakenon'] < 18)\n {\n $action = 'oswestry survey 1';\n\t\t\t$surveynumber=1;\n }\n else if($_REQUEST['surveytakenon'] >= 18 && $_REQUEST['surveytakenon'] < 37)\n {\n $action = 'oswestry survey 2';\n\t\t\t$surveynumber=2;\n \n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n else if($_REQUEST['surveytakenon'] >= 37 && $_REQUEST['surveytakenon'] < 53)\n {\n $action = 'oswestry survey 3';\n\t\t\t$surveynumber=3;\n \n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n \n //mark survey 2 as void only if it is not complete\n $this->markOswestrySurveyVoid(2, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n else if($_REQUEST['surveytakenon'] >= 53)\n {\n $action = 'oswestry survey 4';\n $surveynumber=4;\n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n\n //mark survey 2 as void only if it is not complete\n $this->markOswestrySurveyVoid(2, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n \n //mark survey 3 as void only if it is not complete\n $this->markOswestrySurveyVoid(3, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n \n //check if the score has already been inserted in the database.\n $sqlforomcheck = \"SELECT * FROM patient_om WHERE patient_id = {$userdetails['user_id']} AND filledagainstsurvey = '{$action}' AND om_form = '1'\";\n \n //oswestry has already been taken, so returned string will be \n $string = \"\";\n \n if($this->num_rows($this->execute_query($sqlforomcheck)) == 0)\n\t\t\n {\n //oswestry has not been taken\n\n //insert in patient_om table\n $formtype = 1; //for oswestry form type\n $patientomdata = array(\n 'om_form' => $formtype,\n 'score' => $score,\n 'score2' => $painscale,\n 'patient_id' => $userdetails['user_id'],\n 'therapist_id' => $therapistid[0]['therapist_id'],\n 'filledagainstsurvey' => $action,\n 'status' => 2,\n 'created_on' => date('Y-m-d H:i:s'),\n 'submited_on' => date('Y-m-d H:i:s')\n );\n\n $this->insert('patient_om', $patientomdata);\n $newlyinsertedomid = $this->insert_id();\n\t\t\t\n\n //update the patient_history table\n $patienthistoryarr = array(\n 'patient_id' => $userdetails['user_id'],\n 'action' => $action,\n 'action_status' => 'complete', \n 'action_type' => 'outcome measure',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $patienthistoryarr);\n \n $string = \"{$score},{$painscale}\";\n\t\t\t\n\t\t\t//sending notification message\n\t\t\t\n\t\t\t\n\t\t$this->sendOswestryNotificion($surveynumber,$score, $userdetails, $therapistid[0]['therapist_id']);\t\n\t\t$this->sendPainlevelNotificion($surveynumber,$oswestrydata['painscale'], $userdetails, $therapistid[0]['therapist_id']);\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n }\n \n echo $string;\n }", "function reeditSurvey() {\n $this->layout = 'survey'; // use the more basic survey layout\n $this->Session->write('Survey.progress', GDTA_ENTRY); // change the progress back to GDTA entry\n $this->redirect(array('action' => 'enterGdta'));\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public static function reset_survey($first_page_id = NULL, $initial_answers = []) {\n $now = time();\n $urid_str = (isset($initial_answers['h_device']) ? $initial_answers['h_device'] . '-' : '') . $now . '-' . rand();\n\n $initial_answers['h_start_time'] = $now;\n $initial_answers['h_unique_response_id'] = md5($urid_str);\n \n $_SESSION[TOOLKIT_TAG]['answers'] = [];\n $_SESSION[TOOLKIT_TAG]['initialAnswers'] = $initial_answers;\n $_SESSION[TOOLKIT_TAG]['pages'] = []; //[$first_page_id];\n $_SESSION[TOOLKIT_TAG]['response'] = [];\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function process_quiz()\n {\n if (isset($_POST[$this->token . '_nonce']) && wp_verify_nonce($_POST[$this->token . '_nonce'], $this->token . '_submit_quiz')) {\n global $wpdb;\n $blog_id = get_current_blog_id();\n $quiz_id = sanitize_text_field($_POST['quiz_id']);\n $frontdesk_campaign = sanitize_text_field($_POST['frontdesk_campaign']);\n $first_name = sanitize_text_field($_POST['first_name']);\n $email = sanitize_text_field($_POST['email']);\n $score = $this->score_quiz($_POST['score']);\n\n if (!isset($_POST['first_name']) || $_POST['first_name'] == '') {\n echo json_encode(['user_id' => '', 'score' => $score['score'], 'feedback' => $score['feedback']]);\n die();\n }\n\n $wpdb->query($wpdb->prepare(\n 'INSERT INTO ' . $this->table_name . '\n\t\t\t\t ( blog_id, first_name, email, score, responses, created_at, updated_at )\n\t\t\t\t VALUES ( %d, %s, %s, %s, %s, NOW(), NOW() )',\n [\n $blog_id,\n $first_name,\n $email,\n $score['score'],\n ''\n ]\n ));\n\n $user_id = $wpdb->insert_id;\n\n // Create the prospect on FrontDesk\n $frontdesk_id = $this->frontdesk->setApiKey(get_post_meta($quiz_id, 'api_key', true))\n ->createProspect([\n 'campaign_id' => $frontdesk_campaign,\n 'first_name' => $first_name,\n 'email' => $email\n ]);\n\n if ($frontdesk_id != null) {\n $wpdb->query($wpdb->prepare(\n 'UPDATE ' . $this->table_name . '\n\t\t\t\t\t SET frontdesk_id = %s\n\t\t\t\t\t WHERE id = \\'' . $user_id . '\\'',\n [\n $frontdesk_id\n ]\n ));\n }\n\n // Create a note for the FrontDesk prospect\n if ($frontdesk_id !== null) {\n $responses = $this->formatResponses($quiz_id, $_POST['questions']);\n $content = '<p><strong>Quiz Score:</strong> ' . $score['score'] . '/100</p>';\n foreach ($responses as $response) {\n $content .= '<p><strong>' . $response['question'] . '</strong><br> ' . $response['answer'] . '</p>';\n }\n $this->frontdesk->setApiKey(get_post_meta($quiz_id, 'api_key', true))->createNote($frontdesk_id, 'Chiro Quiz Responses', stripslashes($content));\n }\n\n // Email the blog owner the details for the new prospect\n $this->emailResultsToAdmin($user_id, $score['score'], $_POST['questions'], $quiz_id);\n\n echo json_encode(['user_id' => $user_id, 'score' => $score['score'], 'feedback' => $score['feedback']]);\n die();\n }\n }", "public function createOfficialsSurvey()\n {\n return $this->mailer->createOfficialsSurvey($this->data);\n }", "public function store(Request $request)\n {\n $srvy = new Survey;\n \n\n $srvy->survey_title = $request->title;\n $srvy->description = $request->descrip;\n $srvy->commity_id = $request->commity_id;\n $srvy->course_code = $request->course_id;\n $srvy->creator_id = Sentinel::getUser()->id;\n $srvy->is_template = $request->is_temp;\n \n $srvy->expired = $request->deadline;\n $srvy->save();\n\n\n $id=$srvy->survey_id;\n Session::set('survey_id',$id);\n return redirect()->action('SurveyController@show',[$id]);\n }", "private function _askQuestion()\n {\n // Grab the question\n $question = str_replace(\"!question \", \"\", $this->_data->message);\n\n // Create the yql\n $yql = 'select * from answers.search where query=\"'. $question .'\" and type=\"resolved\"';\n \n $array = $this->grabData($yql);\n \n $stuff = $array['query']['results']['Question'];\n if (is_array($stuff)) {\n $answer = $stuff[array_rand($stuff)]['ChosenAnswer'];\n $link = $stuff[array_rand($stuff)]['Link'];\n }\n $this->_message($this->_data->nick.': You asked: '. $question);\n if (!$answer) {\n $this->_message($this->_data->nick.': Sorry, I cannot answer that one! Try asking a simpler question.'); \n }\n else {\n $this->_message($this->_data->nick.': Yahoo! answers says: '. $answer .' ('. $link .')');\n }\n }", "public function testUpdateSurvey()\n {\n $survey = Survey::factory()->create();\n\n $response = $this->json('PATCH', \"survey/{$survey->id}\", [\n 'survey' => ['epilogue' => 'epilogue your behind']\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', ['id' => $survey->id, 'epilogue' => 'epilogue your behind']);\n }", "function enterGdta() {\n $this->layout = 'survey'; // use the survey layout\n if (!$this->request->is('post')) {\n // if there is no data then setup an initial view\n $this->request->data['Survey']['mainGoal'] = $this->Session->check('Survey.mainGoal') ? $this->Session->read('Survey.mainGoal') : ''; // set the main goal if it exists in the session, otherwise make it blank\n $this->set(\"hierarchy\", ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array()); // setup a blank array or use the session variable if it exists\n } else { // GDTA entry complete so move forward\n $goal = $this->request->data['Survey']['mainGoal'];\n $this->Session->write('Survey.mainGoal', $goal);\n $this->Session->write('Survey.progress', SUMMARY);\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function addSubmittedExercise() {\n\n\t\t//$answers_from_current_user = xaseAnswer::where(array('user_id' => $this->dic->user()->getId(), 'question_id' => $this->xase_question->getId()))->get();\n\n\n\t\t$all_items_assisted_exercise = xaseQuestion::where(array( 'assisted_exercise_id' => $this->assisted_exercise->getId() ))->get();\n\n\t\t$answers_from_current_user = xaseQuestionTableGUI::getAllUserAnswersFromAssistedExercise($all_items_assisted_exercise, $this->dic, $this->dic->user());\n\n\t\t/*\n\t\t * @var xaseAnswer $answers_from_current_user\n\t\t */\n\t\tforeach ($answers_from_current_user as $answer_from_current_user) {\n\t\t\tif (is_array($answers_from_current_user)) {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answer_from_current_user['id'] ))->first();\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t} else {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answers_from_current_user['id'] ));\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tilUtil::sendSuccess($this->obj_facade->getLanguageValue('success_message_exercise_submitted'), true);\n\t\t$this->obj_facade->getCtrl()->redirectByClass(xaseQuestionGUI::class, xaseQuestionGUI::CMD_INDEX);\n\t}", "public function __construct($name = null)\n {\n parent::__construct('survey');\n\n $this->add([\n 'name' => 'idsurvey',\n 'type' => 'hidden',\n ]);\n\n $this->add([\n 'name' => 'iduser',\n 'type' => 'hidden',\n ]);\n\n $this->add([\n 'name' => 'idquestion',\n 'type' => 'hidden',\n ]);\n\n $this->add([\n 'name' => 'idanswer',\n 'type' => 'hidden',\n ]);\n\n $this->add([\n 'name' => 'title',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Title',\n ],\n ]);\n\n $this->add([\n 'name' => 'description',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Description',\n ],\n ]);\n $this->add([\n 'name' => 'status',\n 'type' => 'hidden',\n ]);\n\n $this->add([\n 'name' => 'date',\n 'type' => 'hidden'\n ]);\n\n $this->add([\n 'name' => 'submit',\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n\n $this->add([\n 'name' => 'submitq',\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n\n $this->add([\n 'name' => 'submita',\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n\n\n $this->add([\n 'name' => 'submitc',\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n\n $this->add([\n 'name' => 'submituq', //update question\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n\n $this->add([\n 'name' => 'submitua',\n 'type' => 'submit',\n 'attributes' => [\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ],\n ]);\n $this->add([\n 'name' => 'text',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Question',\n ],\n ]);\n\n $this->add([\n 'name' => 'type',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Type',\n 'value_options' => array(\n '0' => 'Open',\n '1' => 'Multiple choice',\n '2' => 'Single Choice',\n ),\n ],\n ]);\n\n $this->add([\n 'name' => 'texta',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Answer',\n ],\n ]);\n }", "function add() {\n $this->autoRender = false;\n $this->layout = 'ajax';\n if($this->request->is('ajax')) {\n if ($this->request->is('post')) {\n $this->Survey->set($this->request->data);\n if ($this->Survey->save($this->request->data)) {\n $this->Session->setFlash('Survey saved', true, null, 'confirm');\n $this->Survey->recursive = 0;\n $this->set('surveys', $this->paginate());\n $this->render('/Surveys/index');\n } else {\n $err = array_values($this->Survey->invalidFields());\n $this->Session->setFlash('Invalid survey: '.implode($err[0],\", \"), true, null, 'error');\n $this->Survey->recursive = 0;\n $this->set('surveys', $this->paginate());\n $this->render('/Surveys/index');\n }\n } else {\n $this->render();\n }\n }\n }", "function fillSurveyForUser($user_id = ANONYMOUS_USER_ID)\n\t{\n\t\tglobal $ilDB;\n\t\t// create an anonymous key\n\t\t$anonymous_id = $this->createNewAccessCode();\n\t\t$this->saveUserAccessCode($user_id, $anonymous_id);\n\t\t// create the survey_finished dataset and set the survey finished already\n\t\t$active_id = $ilDB->nextId('svy_finished');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_finished (finished_id, survey_fi, user_fi, anonymous_id, state, tstamp) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','integer','integer','text','text','integer'),\n\t\t\tarray($active_id, $this->getSurveyId(), $user_id, $anonymous_id, 1, time())\n\t\t);\n\t\t// fill the questions randomly\n\t\t$pages =& $this->getSurveyPages();\n\t\tforeach ($pages as $key => $question_array)\n\t\t{\n\t\t\tforeach ($question_array as $question)\n\t\t\t{\n\t\t\t\t// instanciate question\n\t\t\t\trequire_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t\t$question =& SurveyQuestion::_instanciateQuestion($question[\"question_id\"]);\n\t\t\t\t$question->saveRandomData($active_id);\n\t\t\t}\n\t\t}\t\t\n\t}", "public function survey_post()\n\t\t{\n\t\t\t$data = array();\n\t\t\t$userId = $this->post('userId');\n\t\t\tif($userId != '')\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\n\t\t\t\t$userData = $this->Student_survey_model->getUserdata($userId);\n\t\t\t\t$testDetails = $this->Student_survey_model->getTestDetails('Survey');\n\t\t\t\t$filledWeek = $this->Student_survey_model->getSTDFilledWeeks($userData['uuid'] , $testDetails['test_id']);\n\n\t\t\t\t//User Information\n\t\t\t\t$data['userInfo']['campusName'] = $userData['nome_centri'];\n\t\t\t\t$data['userInfo']['studentName'] = $userData['nome'].' '.$userData['cognome'];\n\t\t\t\t$data['userInfo']['groupLeader'] = $userData['gl_rif'];\n\t\t\t\t$data['userInfo']['travellingWith'] = $userData['businessname'];\n\n\t\t\t\t//Survey details\n\t\t\t\t$data['surveyInfo']['surveyId'] = $testDetails['test_id'];\n\t\t\t\t$data['surveyInfo']['surveyTitle'] = $testDetails['test_title'];\n\n\t\t\t\t$weekNo = $this->diffInWeeks($userData['data_arrivo_campus'] , date('Y-m-d', strtotime($userData['data_partenza_campus'].' -1 day')));\n\t\t\t\t$weekStart = array();\n\t\t\t\t$weekDay = 7;\n\t\t\t\t$currDate = date(\"Y-m-d\");\n\n\t\t\t\t//Split the weeks from the date range and save in an array\n\t\t\t\tfor($i = 1 ; $i <= $weekNo ; $i++)\n\t\t\t\t{\n\t\t\t\t\tif($i == 1)\n\t\t\t\t\t\t$weekStart[$i] = date('Y-m-d' , strtotime($userData['data_arrivo_campus']));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(date('Y-m-d' , strtotime($weekStart[$i - 1] . ' +7 days')) > $userData['data_partenza_campus'])\n\t\t\t\t\t\t\t$weekStart[$i] = $userData['data_partenza_campus'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$weekStart[$i] = date('Y-m-d', strtotime($weekStart[$i - 1] . ' +7 days'));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//fetch the dates from the week date string and store in array(Already filled up survey)\n\t\t\t\t$filledDates = array();\n\t\t\t\tif(!empty($filledWeek))\n\t\t\t\t{\n\t\t\t\t\tforeach($filledWeek as $dates)\n\t\t\t\t\t{\n\t\t\t\t\t\t$dateArr = explode('_' , $dates['ts_week']);\n\t\t\t\t\t\t$filledDates[] = $dateArr[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Separate the completed and pending survey\n\t\t\t\t$data['completed'] = $data['pending'] = array();\n\t\t\t\tforeach($weekStart as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$tempWeekSend = $key.'_'.$value;\n\t\t\t\t\t//For completed\n\t\t\t\t\tif(in_array($value , $filledDates))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['completed'][$key]['frontTitle'] = 'Week '.$key;\n\t\t\t\t\t\t$data['completed'][$key]['title'] = $testDetails['test_title'].' (Week '.$key.')';\n\t\t\t\t\t\t$data['completed'][$key]['weekSend'] = $tempWeekSend;\n\t\t\t\t\t\t$data['completed'][$key]['fromDate'] = $value;\n\t\t\t\t\t\t$data['completed'][$key]['toDate'] = date('Y-m-d' , strtotime($value . ' +6 days'));\n\t\t\t\t\t\t$data['completed'][$key]['questions'] = $this->getQuestion($userData['uuid'] , $tempWeekSend);\n\t\t\t\t\t}\n\t\t\t\t\t//For pending\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['pending'][$key]['frontTitle'] = 'Week '.$key;\n\t\t\t\t\t\t$data['pending'][$key]['title'] = $testDetails['test_title'].' (Week '.$key.')';\n\t\t\t\t\t\t$data['pending'][$key]['weekSend'] = $tempWeekSend;\n\t\t\t\t\t\t$data['pending'][$key]['fromDate'] = $value;\n\t\t\t\t\t\t$data['pending'][$key]['toDate'] = date('Y-m-d' , strtotime($value . ' +6 days'));\n\t\t\t\t\t\t$data['pending'][$key]['questions'] = $this->getQuestion($userData['uuid'] , $tempWeekSend);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['pending'] = array_values($data['pending']);\n\t\t\t\t$data['completed'] = array_values($data['completed']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('invalid_student_login');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function ipal_make_student_form(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\tglobal $USER;\r\n\tglobal $course;\r\n\t$disabled='';\r\n\t\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t\r\n\tif($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t\t$question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t\t$qid=$question->question_id;\r\n\t\t$myFormArray= ipal_get_questions_student($qid);\r\n//\t\t$disabled=ipal_check_if_answered($USER->id,$myFormArray[0]['id'],$ipal_quiz->quiz_id,$course->id,$ipal->id);\r\n\t\techo \"<br><br><br>\";\r\n\t\techo \"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\"; \r\n\t\techo $myFormArray[0]['question'];\r\n\t\techo \"<br>\";\r\n\t\tif(ipal_get_qtype($qid) == 'essay'){\r\n\t\t\techo \"<INPUT TYPE=\\\"text\\\" NAME=\\\"a_text\\\" >\\n<br />\";\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=\\\"answer_id\\\" value=\\\"-1\\\">\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($myFormArray[0]['answers'] as $k=>$v){\r\n\t\t\techo \"<input type=\\\"radio\\\" name=\\\"answer_id\\\" value=\\\"$k\\\" \".$disabled.\"/> \".strip_tags($v).\"<br />\\n\";\r\n//\t\t\techo \"<br>\";\r\n\t\t\t}\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=a_text VALUE=\\\" \\\">\";\r\n\t\t}\r\n\techo \"<INPUT TYPE=hidden NAME=question_id VALUE=\\\"\".$myFormArray[0]['id'].\"\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=active_question_id VALUE=\\\"$question->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=course_id VALUE=\\\"$course->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=user_id VALUE=\\\"$USER->id\\\">\";\r\n\techo \"<INPUT TYPE=submit NAME=submit VALUE=\\\"Submit\\\" \".$disabled.\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=ipal_id VALUE=\\\"$ipal->id\\\">\";\r\n echo \"<INPUT TYPE=hidden NAME=instructor VALUE=\\\"\".findInstructor($course->id).\"\\\">\";\r\n\techo \"</form>\";\r\n\t}else{\r\n\techo \"<br><br>No Current Question.\";}\r\n}", "public function addquestion(Request $request, Survey $survey)\n {\n $this->validate($request, [\n 'label'=>'required|max:255',\n 'options'=>'required_if:type,select,checkbox-list,section',\n 'required'=>'boolean'\n ]);\n $data = array();\n $data = $request->intersect([\n 'label', 'question_type', 'options', 'required', 'css_class'\n ]);\n /*\n $data['label'] = $request->input('label');\n $data['question_type'] = $request->input('type');\n if($request->has('options')) {\n $data['options'] = $request->input('options');\n }\n if($request->has('required') && $request->input('type') != 'section') {\n $data['required'] = '1';\n }\n */\n // return($data);\n $survey->questions()->create($data);\n return redirect('/addquestion/' . $survey->id . '#new-question-form');\n }", "public function Create()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$this->created = $this->GetServerTime();\n\t\t$user = GetUser();\n\t\t$userid = $user->userid;\n\n\t\t$tablefields = implode(',', $this->_columns);\n\n\t\t//$_columns = array('name','userid','description','created','surveys_header','surveys_header_text','email','email_feedback','after_submit','show_message','show_uri','error_message','submit_button_text');\n\n\t\t$query = \"INSERT INTO {$prefix}surveys ({$tablefields})\n\t\t\t\t VALUES ('\" . $this->Db->Quote($this->name) . \"',\"\n\t\t\t\t\t\t\t . $userid . \",'\"\n\t\t\t\t \t\t\t . $this->Db->Quote($this->description) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->created) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->surveys_header) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->surveys_header_text) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->surveys_header_logo) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->email) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->email_feedback) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->after_submit) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->show_message) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->show_uri) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->error_message) . \"','\"\n\t\t\t\t\t\t\t . $this->Db->Quote($this->submit_button_text) . \"')\";\n\n\n\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$query .= ' RETURNING id;';\n\t\t}\n\n\t\t$results = $this->Db->Query($query);\n\n\t\tif ($results === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$surveyid = $this->Db->FetchOne($results);\n\t\t} else {\n\t\t\t$surveyid = $this->Db->LastId();\n\t\t}\n\n\t\treturn $surveyid;\n\t}", "public function create()\n {\n return view ('survey.create');\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function add_reseller_program_survey_question()\n {\n $this->loadModel('ResellerProgramSurveyQuestions');\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException(__('BAD_REQUEST'));\n }\n $resellerProgramSurveyQuestion=$this->request->data;\n $resellerProgramSurveyQuestion = $this->ResellerProgramSurveyQuestions->newEntity($resellerProgramSurveyQuestion);\n if ($this->ResellerProgramSurveyQuestions->save($resellerProgramSurveyQuestion)) {\n $this->set('resellerProgramSurveyQuestion', $resellerProgramSurveyQuestion);\n $this->set('response', ['status' => \"OK\"]);\n } else {\n throw new InternalErrorException(__('Internal Error'));\n }\n $data =array();\n $data['status']=true;\n $data['data']['id']=$resellerProgramSurveyQuestion->id;\n $this->set('response',$data);\n $this->set('_serialize', ['response']);\n }", "public function store(Request $request)\n {\n $this->validateSurvey($request);\n\n $survey = new Survey();\n $survey->user_id = $request->user()->id;\n $survey->name = $request->input('name');\n $survey->uuid = Uuid::generate(4);\n $survey->description = $request->input('description');\n $survey->shareable_link = Helper::generateRandomString(8);\n $survey->save();\n $request->session()->flash('success', 'Survey ' . $survey->uuid . ' successfully created!');\n\n //return redirect()->route('survey.edit', $survey->uuid);\n return Redirect::route('surveys');\n }", "function ras_submit_db () {\n\n\t\textract(doSlash(psa(array('poll_id', 'name', 'prompt', 'n0', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9' ,'step', 'event', 'selection'))));\n\t\t$where = \"id='\".$poll_id.\"'\";\n\t\t\n\t\tif($step == 'poll_response') {\n\t\t\t$stat = 'r'.substr($selection, -1);\n\t\t\t\t$current = safe_field( $stat ,'txp_poll' , $where);\n\t\t\t\t\t$newstat = $current + 1;\n\t\t\t\t\t$what = $stat.'='.$newstat;\n\t\t\t\tsafe_update('txp_poll', $what ,$where);\n\t\t}\n}", "function ipal_send_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t\r\n\t$ipal_course=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t$record = new stdClass();\r\n\t$record->id = '';\r\n\t$record->course = $ipal_course->course;\r\n\t$record->ipal_id = $ipal->id;\r\n\t$record->quiz_id = $ipal->id;\r\n\t$record->question_id = $_POST['question'];\r\n\t$record->timemodified = time();\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n\t$lastinsertid = $DB->insert_record('ipal_active_questions', $record);\r\n\r\n}", "public function create()\n {\n $survey = new Survey();\n return view('backend.surveys.create')->with('survey', $survey);\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}", "public function actionCreate($question_id, $survey_id)\n //$survey_id ist notwendig, um auf die Survey zurückzukommen, für die man die Answer erstellt hat.\n {\n $model = new Answer();\n\n //Die Question holen, die im survey/view erstellungsformular erstellt wurde.\n $question = Question::find()->where(['id'=>$question_id]);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $model->link('questions', $question->one());\n return $this->redirect(['survey/view/', 'id' => $survey_id]);\n\n } else {\n return $this->render('create', ['id'=>$question_id,\n 'model' => $model,\n ]);\n }\n\n }", "public function reset_survey_options_post()\n\t\t{\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($uuid) && !empty($weekSend))\n\t\t\t{\n\t\t\t\t$this->db->where('tans_uuid' , $uuid)\n\t\t\t\t\t\t->where('tans_week' , $weekSend)\n\t\t\t\t\t\t->delete('plused_test_answers');\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function pastIntro() {\n // move progress forward and redirect to the runSurvey action\n $this->autoRender = false; // turn off autoRender\n $this->Session->write('Survey.progress', RIGHTS);\n $this->redirect(array('action' => 'runSurvey'));\n\n }", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "public function store_survey(Request $request )\n {\n $user = Auth::user();\n //get the current answered question_id and choice_id\n $answers = $request->input(\"data\");\n $survey_id = $request->input(\"survey_id\");\n// $elapsedSeconds = $request->input(\"secondsElapsed\");\n\n //fire the NewSurvey event to save response\n event(new NewSurvey($user, $answers, $survey_id));\n\n\n // level and points pair\n $playerStatus= array('playerStatus'=>$user->getPlayerStatus());\n\n\n return response()->json($playerStatus);\n\n }", "public function updateSurvey(){\n\t\t// echo $this->session->userdata('id_users');exit();\n\t\tdate_default_timezone_set('Asia/Jakarta');\n\t\t$action = $this->input->post('action');\n\t\t$where \t= array(\n\t\t\t'id'\t=> $this->input->post('id')\n\t\t);\n\t\t$data = array(\n\t\t\t'title'\t\t\t=> $this->input->post('title'),\n\t\t\t// 'date' \t\t\t=> $this->dmys2ymd(date(\"y/m/d\")),\n\t\t\t'date' \t\t\t=> date('Y-m-d'),\n\t\t\t'beginDate' => $this->checkDate($this->input->post('surveyBegin')),\n\t\t\t'endDate' \t=> $this->checkDate($this->input->post('surveyEnd')),\n\t\t\t'category'\t\t\t\t=> $this->input->post('category'),\n\t\t\t'url'\t\t\t\t=> $this->input->post('url'),\n\t\t\t'target'\t\t=> $this->input->post('target'),\n\t\t\t'id_user'\t=> $this->session->userdata('id_users')\n\t\t);\n\n\t\tif ($action == \"create\") {\n\t\t\t$checkSurvey = $this->MstSurveyModel->checkSurvey($this->input->post('title'));\n\t\t\tif($checkSurvey->title > 0) $response = \"duplicate\";\n\t\t\telse{\n\t\t\t\t#cek mak survey\n\t\t\t\t$usr_lvl = $this->MstSurveyModel->cek_level($this->session->userdata('id_user_level'));\n\t\t\t\tif($usr_lvl->max_survey > 0){\n\t\t\t\t\t#cek survey bulan ini\n\t\t\t\t\t$svy = $this->MstSurveyModel->cek_survey_bln($this->session->userdata('id_users'),date('Y-m'));\n\t\t\t\t\t#jika jumlah survey belum lewat batas maksimal\n\t\t\t\t\tif($svy->jml_d < $usr_lvl->max_survey){\n\t\t\t\t\t\tif ($this->MstSurveyModel->insert($this->tableSurveys, $data)) {\n\t\t\t\t\t\t\t$response = \"success\";\n\t\t\t\t\t\t}else $response = \"failed\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$response = \"failed\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif ($this->MstSurveyModel->insert($this->tableSurveys, $data)) {\n\t\t\t\t\t\t$response = \"success\";\n\t\t\t\t\t}else $response = \"failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tif ($this->MstSurveyModel->update($this->tableSurveys, $data, $where)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function guestquestionAnswerFormSubmit(Request $request)\n {\n\n \n\n $data = array();\n\n $data = $request->input();\n // dd($data);\n unset($data['_token']);\n unset($data['relevantInfo']);\n $questionAnswer = new QuestionAnswer;\n \n \n $result = DB::table('question_answer')->insert($data);\n if($result)\n {\n \n return redirect()->back()->with('success','Diet information submit succesfully');;\n }\n }", "public function submit() {\r\n global $db;\r\n\r\n $this->status = SUBMITTED;\r\n $this->saveMe();\r\n\r\n $sql = \"SELECT d.division_id FROM users as u\r\n LEFT JOIN departments AS d ON d.department_id = u.department_id\r\n WHERE u.user_id = \" . $this->userId;\r\n $divisionId = $db->getRow($sql);\r\n\r\n // save the approvals to the database\r\n foreach($this->approvals as $approval) {\r\n $approval->save($divisionId['division_id']);\r\n }\r\n\r\n $sql = sprintf(\"UPDATE `forms_tracking` SET\r\n `submit_date` = NOW()\r\n WHERE `form_tracking_id` = %s\",\r\n $this->trackingFormId\r\n );\r\n $db->Execute($sql);\r\n\r\n $this->sendSubmissionConfirmationEmail();\r\n\r\n // send notifications\r\n $this->notifyORS();\r\n\r\n // notify Dean if deadline is within DEAN_NOTIFICATION_THRESHOLD_DAYS\r\n if(isset($this->deadline)) {\r\n $dateThreshold = strtotime(DEAN_NOTIFICATION_THRESHOLD_DAYS);\r\n $deadline = strtotime($this->deadline);\r\n if($deadline < $dateThreshold) {\r\n $this->notifyDean();\r\n }\r\n }\r\n\r\n if($this->compliance->requiresBehavioural()) {\r\n $this->notifyHREB();\r\n }\r\n }", "public static function addSubmit($sessionIdentifier) {\n /**\n * Setup basic session variables (Type hinting below to avoid IDE error messages)\n * @var $templates League\\Plates\\Engine\n * @var $data array\n * @var $config array\n * @var $user User\n * @var $mysqli mysqli\n * @var $session Session\n */\n extract(self::setup($sessionIdentifier));\n\n // Attempt to create a new question for this question type\n try {\n $question = QuestionFactory::create($_POST[\"questionType\"], $_POST);\n }\n\n // If error creating question, log the error and display an error page\n catch(Exception $e) {\n Error::exception($e, __LINE__, __FILE__);\n die();\n }\n\n // If MCQ or MRQ question\n if(in_array(get_class($question), [\"QuestionMcq\", \"QuestionMrq\"])) {\n\n // Loop for every posted value\n foreach($_POST as $key => $value) {\n\n // Use regex to check if this is a \"mcq-choice-1\" field\n preg_match(\"/(mcq-choice-)(\\w*[0-9]\\w*)/\", $key, $matches);\n\n // If there are matches then this is a \"mcq-choice-1\" field\n if($matches) {\n\n // Get the index\n $index = $matches[2];\n\n // Boolean for if this is correct\n $correct = text2bool(array_key_exists(\"mcq-choice-correct-$index\", $_POST) ? $_POST[\"mcq-choice-correct-$index\"] : \"false\");\n\n // Add choice\n $question->addChoice($value, $correct);\n }\n }\n }\n\n // Insert question into the database\n $questionID = DatabaseQuestion::insert($question, $mysqli);\n\n // Load the session ID\n $sessionID = DatabaseSessionIdentifier::loadSessionID($sessionIdentifier, $mysqli);\n\n // If invalid session identifier, display 404\n if($sessionID === null) {\n PageError::error404();\n die();\n }\n\n // Insert question session combo into DatabaseSession\n DatabaseSessionQuestion::insert($sessionID, $questionID, $mysqli);\n\n header(\"Location: \" . $config[\"baseUrl\"] . \"session/$sessionIdentifier/edit/\");\n die();\n }", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "public function submit()\n {\n $this->waitFor(20000, function () {\n return $this->present();\n });\n $this->xpath($this->selectors['submit'])->click();\n $this->waitFor(20000, function () {\n return $this->xpath($this->selectors['formSubmitted']) !== null;\n });\n }", "public function testTrainerGroupSubmitSurvey()\n {\n $this->buildVenueSurvey();\n\n $trainer = $this->trainer;\n $trainerG = $this->trainerGroup;\n $trainerQ = $this->trainerQuestion;\n\n $response = $this->json('POST', 'survey/submit', [\n 'slot_id' => $this->slot->id,\n 'type' => Survey::TRAINING,\n 'survey' => [\n [\n 'survey_group_id' => $trainerG->id,\n 'trainer_id' => $trainer->id,\n 'answers' => [\n [\n 'survey_question_id' => $trainerQ->id,\n 'response' => 'a response'\n ]\n ]\n ],\n ]\n ]);\n\n $response->assertStatus(200);\n\n $this->assertDatabaseHas('survey_answer', [\n 'person_id' => $this->user->id,\n 'slot_id' => $this->slot->id,\n 'survey_question_id' => $trainerQ->id,\n 'trainer_id' => $trainer->id,\n 'response' => 'a response'\n ]);\n }", "public function add_reseller_program_survey()\n {\n $this->loadModel('ResellerProgramSurveys');\n if (!$this->request->is('post')) {\n throw new MethodNotAllowedException(__('BAD_REQUEST'));\n }\n \n $resellerProgramId = $this->Auth->user('id');\n $this->request->data['reseller_program_id'] = $resellerProgramId;\n $resellerProgramSurveys=$this->request->data;\n\n $resellerProgramSurveys = $this->ResellerProgramSurveys->newEntity($resellerProgramSurveys);\n //pr($resellerProgramSurveys); die;\n if ($this->ResellerProgramSurveys->save($resellerProgramSurveys)) {\n $this->set('resellerProgramSurveys', $resellerProgramSurveys);\n $this->set('response', ['status' => \"OK\"]);\n } else {\n //pr($resellerProgramSurveys->errors()); die;\n throw new InternalErrorException(__('Internal Error'));\n }\n $data =array();\n $data['status']=true;\n $data['data']['id']=$resellerProgramSurveys->id;\n $this->set('response',$data);\n $this->set('_serialize', ['response']);\n }", "function edit($id = null) {\n if (is_null($id) && !empty($this->request->data)) { // check for an id as long as no form data has been submitted\n $this->Session->setFlash('Invalid survey', true, null, 'error'); // display an error when no valid survey id is given\n $this->redirect(array('action' => 'index')); // return to the index view\n }\n if (!empty($this->request->data)) { // check to see if form data has been submitted\n // first assemble the complete survey data including information from the edit session values\n if ($this->Session->check('SurveyQuestion.new')) { // check for a session for the survey questions\n $tempQuestions = $this->Session->read('SurveyQuestion.new'); // retrieve the questions that have been stored in the session\n //go through each question and set its order value to the same as the current index in the array\n foreach ($tempQuestions as $index => &$quest) {\n $quest['order'] = $index;\n }\n $this->request->data['Question'] = $tempQuestions; // update the form data with the current questions\n }\n if ($this->Session->check('SurveyRespondent.new')) { // check the session for the respondents\n $this->request->data['Respondent'] = $this->Session->read('SurveyRespondent.new'); // update the form data with the current respondents\n }\n $delrespondent = null; // variable to hold respondents to delete (database records only)\n if ($this->Session->check('SurveyRespondent.delete')) { // check the session for respondents to delete\n $delrespondent = $this->Session->read('SurveyRespondent.delete'); // retrieve the respondents to delete\n }\n $delquestion = null; // variable to hold questions to delete (database records only)\n if ($this->Session->check('SurveyQuestion.delete')) { // check the session for questions to delete\n $delquestion = $this->Session->read('SurveyQuestion.delete'); // retrieve the questions to delete\n }\n // now save the survey and return the results\n $errReturn = $this->Survey->complexSave($this->request->data, $delquestion, $delrespondent); // save the combined data, including deletion of survey and respondents that have been dropped\n if (is_null($errReturn)) { // if no errors are returned\n $this->__clearEditSession(); // empty the session variables used for the edit session now that it is complete\n $this->Session->setFlash('The survey has been saved', true, null, 'confirm'); // send a confirmation message that the survey was saved\n $this->redirect(array('action' => 'index')); // redirect to the index view\n } else {\n $this->Session->setFlash($errReturn['message'], true, null, $errReturn['type']); // send error messages received from the model during the save to the view for display\n }\n } else { // if there is no form data, and therefore the edit session is just starting\n $this->Survey->contain(array('Question' => 'Choice', 'Respondent' => 'Response'));\n $this->request->data = $this->Survey->findById($id); // find the survey being edited\n if(!$this->request->data) {\n $this->Session->setFlash('Invalid ID for survey.', true, null, 'error'); // send an error message\n $this->redirect(array('action' => 'index')); // redirect to the index view\n }\n $this->__clearEditSession(); // make sure the session edit variables are empty\n $this->Session->write('Survey.id', $id); // put the survey id in to the session\n $this->Session->write('SurveyQuestion.new', $this->request->data['Question']); // put the original survey questions in to the session\n $this->Session->write('SurveyRespondent.new', $this->request->data['Respondent']); // put the original survey respondents in to the session\n }\n }", "public function setQuestionSystem()\n {\n if($this->input->server('REQUEST_METHOD') == 'GET')\n {\n $question_data = array(\n 'is_recorded' => 1,\n 'flag' => 0\n );\n $question_id = $this->Question_model->insertQuestion($question_data);\n\n //If new question inserted successfully\n if($question_id)\n {\n echo json_encode(array('result' => array('error' => false, 'question_id'=> $question_id)));\n return;\n }\n echo json_encode(array('result' => array('error' => true)));\n return;\n\n }\n }", "function post_stud_query($sub_id, $question)\n {\n $stud_id = $_COOKIE['stud_id'];\n $stud_name = $_COOKIE['user'];\n \n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\n // get subject name\n $query_sub = \"SELECT subject_name FROM subjects where sub_id=\".$sub_id;\n $result = $mysqli->query($query_sub);\n $row = $result->fetch_row();\n $sub_name = $row[0];\n\n // Insert query now\n $query = 'INSERT INTO queries(stud_id,sub_id,student_name,subject_name,question) \n values(?,?,?,?,?)';\n\n date_default_timezone_set('Asia/Kolkata');\n $now = date(\"Y-m-d h:i:s\");\n\n if($stmt = $mysqli->prepare($query))\n {\n $stmt->bind_param('iisss',$stud_id,$sub_id,$stud_name,$sub_name,$question);\n $stmt->execute();\n\n echo \"<script>alert('Question posted Successfully')</script>\";\n header('location:/pages/student_modules/queries/answers.php');\n\n }\n else\n {\n $error = $mysqli->errno . ' ' . $mysqli->error;\n echo $error;\n } \n }", "function startSurvey($user_id, $anonymous_id, $appraisee_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif ($this->getAnonymize() && (strlen($anonymous_id) == 0)) return;\n\n\t\tif (strcmp($user_id, \"\") == 0)\n\t\t{\n\t\t\tif ($user_id == ANONYMOUS_USER_ID)\n\t\t\t{\n\t\t\t\t$user_id = 0;\n\t\t\t}\n\t\t}\n\t\t$next_id = $ilDB->nextId('svy_finished');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_finished (finished_id, survey_fi, user_fi, anonymous_id, state, tstamp, appr_id) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','integer','integer','text','text','integer','integer'),\n\t\t\tarray($next_id, $this->getSurveyId(), $user_id, $anonymous_id, 0, time(), $appraisee_id)\n\t\t);\n\t\treturn $next_id;\n\t}", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "function questionnaire_add_instance($questionnaire) {\n // (defined by the form in mod.html) this function\n // will create a new instance and return the id number\n // of the new instance.\n global $COURSE, $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if it's set.\n\n if (empty($questionnaire->sid)) {\n // Create a new survey.\n $cm = new Object();\n $qobject = new questionnaire(0, $questionnaire, $COURSE, $cm);\n\n if ($questionnaire->create == 'new-0') {\n $sdata = new Object();\n $sdata->name = $questionnaire->name;\n $sdata->realm = 'private';\n $sdata->title = $questionnaire->name;\n $sdata->subtitle = '';\n $sdata->info = '';\n $sdata->theme = ''; // Theme is deprecated.\n $sdata->thanks_page = '';\n $sdata->thank_head = '';\n $sdata->thank_body = '';\n $sdata->email = '';\n $sdata->owner = $COURSE->id;\n if (!($sid = $qobject->survey_update($sdata))) {\n print_error('couldnotcreatenewsurvey', 'questionnaire');\n }\n } else {\n $copyid = explode('-', $questionnaire->create);\n $copyrealm = $copyid[0];\n $copyid = $copyid[1];\n if (empty($qobject->survey)) {\n $qobject->add_survey($copyid);\n $qobject->add_questions($copyid);\n }\n // New questionnaires created as \"use public\" should not create a new survey instance.\n if ($copyrealm == 'public') {\n $sid = $copyid;\n } else {\n $sid = $qobject->sid = $qobject->survey_copy($COURSE->id);\n // All new questionnaires should be created as \"private\".\n // Even if they are *copies* of public or template questionnaires.\n $DB->set_field('questionnaire_survey', 'realm', 'private', array('id' => $sid));\n }\n }\n $questionnaire->sid = $sid;\n }\n\n $questionnaire->timemodified = time();\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n if (!$questionnaire->id = $DB->insert_record(\"questionnaire\", $questionnaire)) {\n return false;\n }\n\n questionnaire_set_events($questionnaire);\n\n return $questionnaire->id;\n}", "public function testDuplicateSurvey()\n {\n $year = 2018;\n $currentYear = current_year();\n $origSurvey = Survey::factory()->create(['year' => $year, 'title' => \"$year Survey Title\"]);\n $origGroup = SurveyGroup::factory()->create(['survey_id' => $origSurvey->id]);\n $origQuestion = SurveyQuestion::factory()->create(['survey_id' => $origSurvey->id, 'survey_group_id' => $origGroup->id]);\n\n $response = $this->json('POST', \"survey/{$origSurvey->id}/duplicate\");\n $response->assertStatus(200);\n $newId = $response->json('survey_id');\n\n $this->assertDatabaseHas('survey', ['id' => $newId, 'title' => \"$currentYear Survey Title\"]);\n $this->assertDatabaseHas('survey_group', ['survey_id' => $newId, 'title' => $origGroup->title]);\n $this->assertDatabaseHas('survey_question', ['survey_id' => $newId, 'description' => $origQuestion->description]);\n }", "public function getPostCreateQuestion()\n {\n $title = \"Ask Question\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $user = $this->di->get(\"authHelper\")->getLoggedInUser();\n\n if (!$user) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $form = new QuestionForm($this->di);\n $form->check();\n $view->add(\"comment/question-form\", [\"form\" => $form->getHTML([\"use_buttonbar\" => false])]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function submit_new_entry_start()\n\t{\n\t\t// -------------------------------------\n\t\t// This is really obnoxious, but EE makes us do this for Quick Save/Preview to work\n\t\t// -------------------------------------\n\n\t\tif ($this->data->channel_is_calendars_channel(ee()->input->post('weblog_id')) === TRUE OR\n\t\t\t$this->data->channel_is_events_channel(ee()->input->post('weblog_id')) === TRUE)\n\t\t{\n\t\t\t$this->cache['quicksave']\t= TRUE;\n\t\t}\n\t}", "public function run()\n {\n foreach ($this->questions as $question) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestion $existing */\n $existing = DB::table('site_survey_questions')\n ->where('name', $question['name'])\n ->first();\n\n if (!$existing) {\n $questionId = DB::table('site_survey_questions')\n ->insertGetId([\n 'name' => $question['name'],\n ]);\n\n if (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $questionId,\n 'name' => $option,\n ]);\n }\n }\n } elseif (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestionOption $existingOption */\n $existingOption = DB::table('site_survey_question_options')\n ->where('name', $option)\n ->where('site_survey_question_id', $existing->id)\n ->first();\n\n if (!$existingOption) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $existing->id,\n 'name' => $option,\n ]);\n }\n }\n }\n }\n }", "function surveyObject()\n\t{\n\t\t$form = $this->initTagsForm(\"survey\", \"saveSurveySettings\",\n\t\t\t\"advanced_editing_survey_settings\");\n\t\t\n\t\t$this->tpl->setContent($form->getHTML());\t\t\n\t}", "public function testIndexSurvey()\n {\n $year = 2018;\n Survey::factory()->create(['year' => $year]);\n\n $response = $this->json('GET', 'survey', ['year' => $year]);\n $response->assertStatus(200);\n $this->assertCount(1, $response->json()['survey']);\n }", "function insertQuestion($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($question_id))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// get maximum sequence index in test\n\t\t\t$result = $ilDB->queryF(\"SELECT survey_question_id FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$sequence = $result->numRows();\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($question_id);\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer', 'integer', 'integer', 'integer', 'integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $duplicate_id, $sequence, time())\n\t\t\t);\n\t\t\t$this->loadQuestionsFromDb();\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function startQuiz(){\n if($this->session->get('userId') == null){\n echo \"sorry unauthorized!...\";\n return;\n }\n $this->answeredQuestions =[];\n $this->minId = 1;\n // jel ok da pretpostavim da je sve od 1 do maxa tu - msm da da\n $q = new Question();\n $this->maxId = $q->getMaxId();\n\n return view('quiz.php');\n }", "function saveSurveyOneToSession(){\n $_SESSION['fullName'] = $_POST['fullName'];\n $_SESSION['age'] = $_POST['age'];\n $_SESSION['student'] = $_POST['student'];\n}", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "function printTFQuestionForm() {\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) {\n\tif ($MoreQuestions == $langCreate) {\n\t\tcreateTFSurvey();\n\t} else {\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"2\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\ncData;\n\t\t$counter = 0;\n\t\tforeach (array_keys($_POST) as $key) {\n\t\t\t++$counter;\n\t\t $$key = $_POST[$key];\n\t\t if (($counter > 4 )&($counter < count($_POST)-1)) {\n\t\t\t\t$tool_content .= \"<tr><td>$langQuestion</td><td><input type='text' name='question{$counter}' value='${$key}'></td></tr>\"; \n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t<tr><td>$langQuestion</td><td><input type='text' name='question'></td></tr>\n\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\ncData;\n\t}\n}", "public function store(Request $request, $uuid, $survey_id,$section_id)\n {\n //dd($request->all());\n $this_survey = Survey::where('hash_id',$survey_id)->firstOrFail();\n\n //dd($request->all());\n foreach ($request->all() as $key=> $input){\n if($key!='_token' && $key!='referrerScript'){\n $answer_string ='';\n if($input!='' || $input!=null){\n if(is_array($input)){\n foreach ($input as $innerKey=>$value){\n if(strpos($value, 'q')===false){\n $answer_string.= $value.'_|@|_';\n }\n else{\n\n }\n\n }\n }\n else{\n $answer_string = $input;\n }\n\n\n $client_answer =null;\n $under_test = ClientAnswer::where('question_id',$key)->first();\n\n if($under_test==null){\n\n $client_answer = new ClientAnswer();\n\n $client_answer['uuid'] = $uuid;\n\n $client_answer['survey_id'] = $this_survey->id;\n $client_answer['question_id'] = $key;\n $client_answer['questionAnswer'] = $answer_string;\n $client_answer['created_at'] = Carbon::now();\n\n\n $client_answer->save();\n }\n\n else{\n $update = [['questionAnswer' => $answer_string],['created_at' => Carbon::now()]];\n DB::table('clients_answers')\n ->where([\n ['uuid', '=', $uuid],\n ['survey_id', '=', $this_survey->id],\n ['question_id', '=', $key],\n ])\n ->update(['questionAnswer' => $answer_string]);\n\n }\n\n\n }\n\n\n\n }\n }\n\n $next_section = $this_survey->sections->where('id','>', $section_id)->min('id');\n //Session::flash('referrer',$section_id);\n\n if($next_section!=null){\n return redirect(route('clients.surveys.section.show',['uuid'=>$uuid, 'survey_id'=>$survey_id, 'section_id'=>$next_section]));\n\n }\n else{\n return redirect(route('start',['uuid'=>$uuid, 'survey_id'=>$survey_id]));\n }\n\n\n\n }", "public function store(Request $request)\n {\n // If the title attribute is set, a text answer has been submitted\n if(isset($request->title)){\n // Validate the users input\n $this->validate($request, [\n 'title' => 'required|max:50',\n ]);\n // Add the users text input to the answers table & associate with the question\n answer::create(['title' => $request->title, 'rating' => $request->rating, 'question_id' => $request->question_id]);\n // Get the answer that was just submitted back from the database\n $answer = answer::where('title', $request->title)->where('question_id', $request->question_id)->first();\n // Add the response to the response table\n response::create(['respondent_id' => $request->respondent_id, 'answer_id' => $answer->id]);\n // Get the next question ID\n $next_question = Helpers\\getNextQuestion($answer->id);\n\n // If the title attribute is not set, a multiple choice question has been submitted\n } else {\n // Validate the users input\n $this->validate($request, [\n 'answer_id' => 'required',\n ]);\n // Add the response to the response table\n response::create($request->all());\n // Get the next question ID\n $next_question = Helpers\\getNextQuestion($request->answer_id);\n }\n // Check if the $next_question number is set\n if (isset($next_question)) {\n // Send the user back to the page to complete the next question\n return redirect(\"question/create/$next_question->id\");\n // $next_question not set (user has completed the questionnaire)\n } else {\n // Send the user to the thank you page\n return redirect(\"thank-you/$request->respondent_id\");\n }\n }", "function surveyRespondent($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyRespondent\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) {\n // only proceed if this is an ajax request\n if (!$this->request->is('post')) { // check to see if there is any form data\n if ($id != null) { // if there is no form data, check if an id was passed (if there is an id, then the user is editing and not creating)\n if ($this->Session->check('SurveyRespondent.new')) { // look for the session record of the respondents\n $tempData = $this->Session->read('SurveyRespondent.new'); // retrieve the session record of respondents\n $this->set('respondent_index', $id); // include the session array index for the respondent in the view\n $this->request->data['Respondent'] = $tempData[$id]; // send the values of the respondent being edited to the view\n }\n }\n $this->render('/Elements/respondent_form'); // render the ajax form element\n } else { // handle form data\n $tempArr = null; // temporary array to hold session values\n if ($this->Session->check('SurveyRespondent.new')) { // check for existing session values\n $tempArr = $this->Session->read('SurveyRespondent.new'); // read the respondent data from the session\n }\n if (!isset($this->request->data['Respondent']['survey_id'])) { // check to see if the respondent's foreign key is set\n $this->request->data['Respondent']['survey_id'] = $this->Session->read('Survey.id'); // put the survey id in the foreign key of the respondent\n }\n /*if (!isset($this->request->data['Respondent']['started'])) {\t// check to see if the respondent has a started datetime set\n $this->request->data['Respondent']['started'] = null; // put the empty \"started\" key in place\n }\n if (!isset($this->request->data['Respondent']['finished'])) { // check to see if the respondent has a finished datetime set\n $this->request->data['Respondent']['finished'] = null; // put the empty \"finished\" key in place\n }*/\n $this->Survey->Respondent->set($this->request->data); // set the model data to the current form data\n $checkfieldsArr = $this->Survey->Respondent->schema(); // read the model schema to use for setting custom validation procedures\n unset($checkfieldsArr['id']); // remove the id field for validation\n unset($checkfieldsArr['survey_id']); // remove the survey_id from the validation criteria\n unset($checkfieldsArr['guid']); // remove the guid from the validation criteria\n $checkfields = array_keys($checkfieldsArr); // pull the keys only from the modified schema to create an array of validation fields\n if ($this->Survey->Respondent->validates(array('fieldList' => $checkfields))) { // perform modified validation\n if (is_null($id)) {\n $this->request->data['Respondent']['url'] = 'Not available until after changes saved';\n $tempArr[] = $this->request->data['Respondent']; // new respondent\n } else {\n $tempArr[$id] = $this->request->data['Respondent']; // editing an existing respondent\n }\n $this->Session->write('SurveyRespondent.new',$tempArr);\n } else {\n $this->Session->setFlash('Invalid respondent: '.implode($this->Survey->Respondent->invalidFields(),\", \"), true, null, 'error');\n }\n $this->set('respondents', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_respondents');\n }\n }\n }", "public function create_survey($session_key, $sid, $sSurveyTitle, $sSurveyLanguage, $sformat = 'G')\n\t{\n\t\tYii::app()->loadHelper(\"surveytranslator\");\n\t\tif ($this->_checkSessionKey($session_key))\n {\n\t\t\tif (Yii::app()->session['USER_RIGHT_CREATE_SURVEY'])\n\t\t\t{\t\n\t\t\t\tif( $sSurveyTitle=='' || $sSurveyLanguage=='' || !array_key_exists($sSurveyLanguage,getLanguageDataRestricted()) || !in_array($sformat, array('A','G','S')))\n\t\t\t\t{\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Faulty parameters', 21);\n\t\t\t\t\texit;\n\t\t\t\t} \n\n $aInsertData = array(\n 'template' => 'default',\n 'owner_id' => Yii::app()->session['loginID'],\n 'active' => 'N',\n 'language'=>$sSurveyLanguage,\n 'format' => $sformat\n );\n\n if(Yii::app()->getConfig('filterxsshtml') && Yii::app()->session['USER_RIGHT_SUPERADMIN'] != 1)\n $xssfilter = true;\n else\n $xssfilter = false;\n\n\n if (!is_null($sid))\n {\n\t\t\t\t\t$aInsertData['wishSID'] = $sid;\n }\n\n\t\t\t$iNewSurveyid = Survey::model()->insertNewSurvey($aInsertData, $xssfilter);\n\t\t\tif (!$iNewSurveyid)\n\t\t\t{\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Creation failed', 28);\n\t\t\t\texit;\t\t\t\t\n\t\t\t}\n \n\t\t\t$sTitle = html_entity_decode($sSurveyTitle, ENT_QUOTES, \"UTF-8\");\n\n\t\t\t// Load default email templates for the chosen language\n\t\t\t$oLanguage = new Limesurvey_lang($sSurveyLanguage);\n\t\t\t$aDefaultTexts = templateDefaultTexts($oLanguage, 'unescaped');\n\t\t\tunset($oLanguage);\n\t\t\t\n\t\t\t$bIsHTMLEmail = false;\n\t\t\t\n $aInsertData = array('surveyls_survey_id' => $iNewSurveyid,\n 'surveyls_title' => $sTitle,\n 'surveyls_language' => $sSurveyLanguage, \n 'surveyls_email_invite_subj' => $aDefaultTexts['invitation_subject'],\n 'surveyls_email_invite' => conditionalNewlineToBreak($aDefaultTexts['invitation'], $bIsHTMLEmail, 'unescaped'),\n 'surveyls_email_remind_subj' => $aDefaultTexts['reminder_subject'],\n 'surveyls_email_remind' => conditionalNewlineToBreak($aDefaultTexts['reminder'], $bIsHTMLEmail, 'unescaped'),\n 'surveyls_email_confirm_subj' => $aDefaultTexts['confirmation_subject'],\n 'surveyls_email_confirm' => conditionalNewlineToBreak($aDefaultTexts['confirmation'], $bIsHTMLEmail, 'unescaped'),\n 'surveyls_email_register_subj' => $aDefaultTexts['registration_subject'],\n 'surveyls_email_register' => conditionalNewlineToBreak($aDefaultTexts['registration'], $bIsHTMLEmail, 'unescaped'),\n 'email_admin_notification_subj' => $aDefaultTexts['admin_notification_subject'],\n 'email_admin_notification' => conditionalNewlineToBreak($aDefaultTexts['admin_notification'], $bIsHTMLEmail, 'unescaped'),\n 'email_admin_responses_subj' => $aDefaultTexts['admin_detailed_notification_subject'],\n 'email_admin_responses' => $aDefaultTexts['admin_detailed_notification']\n );\n \n $langsettings = new Surveys_languagesettings;\n $langsettings->insertNewSurvey($aInsertData, $xssfilter);\n Survey_permissions::model()->giveAllSurveyPermissions(Yii::app()->session['loginID'], $iNewSurveyid);\n\n\t\t\treturn \t$iNewSurveyid;\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t}\t\t\t\n\t}", "public function save_survey_filled_data(Request $request)\n\t{\n\t\t$sdata = $request->all();\n\t\t$surveyid = $sdata['survey_id'];\n\t\t$activation_code = $sdata['activation_code'];\n\t\t$org_id = org::select('id')->where('activation_code' ,$activation_code)->first()->id;\n\t\tSession::put('org_id', $org_id);\n\t\t\n\t\t$table = $org_id.'_survey_data_'.$surveyid;\n\t\tif(!Schema::hasTable($table))\n \t{\n \t\tSurveyHelper::create_survey_table($surveyid , $org_id);\n\t\t}\n\t\telse{\n\t\t\tSurveyHelper::alter_survey_table($surveyid , $org_id);\n\t\t}\n\t\t$survey_data = json_decode($sdata['survey_data'],true);\n\t\t$count_sdata = count($survey_data);\n\t\tfor ($i=0; $i < $count_sdata; $i++) { \n\t\t\t$unique_id = $survey_data[$i]['unique_id'];\n\t\t\t$check_unique_id = DB::table($table)->where('unique_id',$unique_id)->count();\n\t\t\tif($check_unique_id ==0)\n\t\t\t{\t\n\t\t\t\tunset($survey_data[$i]['survey_sync_status'], $survey_data[$i]['id'], $survey_data[$i]['incomplete_name'], $survey_data[$i]['completed_groups'], $survey_data[$i]['last_group_id'] , $survey_data[$i]['last_field_id'] );\n\t\t\t\tif($survey_data[$i]['survey_status']==\"completed\")\n\t\t\t\t{\n\t\t\t\t\t$status =1;\t\n\t\t\t\t}else{\n\t\t\t\t\t$status =0;\n\t\t\t\t}\n\n\t\t\t\t$survey_data[$i]['survey_status'] = $status;\n\t\t\t\t$insert = $survey_data[$i];\n\t\t\t\tDB::table($table)->insert($insert);\t\n\t\t\t\treturn ['status'=>\"successfully\" , 'message'=>'survey insert sucessfully'];\n\n\t\t\t}else{\n\t\t\t\treturn ['status'=>\"exist\" , 'message'=>'Already exist'];\n\t\t\t}\n\t\t}\n\n\n\t\t// $org_id = org::select('id')->where('activation_code' ,$request->activation_code)->first()->id;\n\t\t// Session::put('org_id', $org_id);\n\t\t// $data = json_decode($request->export,true);\n\t\t\n\t\t// $surveyid = $data[0][\"surveyid\"];\n\t\t// $table = $org_id.'_survey_data_'.$surveyid;\n\t\t// if(!Schema::hasTable($table))\n // \t{\n // \t\tSurveyHelper::create_survey_table($surveyid , $org_id);\n\t\t// }\n\t\t// else{\n\t\t// \tSurveyHelper::alter_survey_table($surveyid , $org_id);\n\t\t// }\n\t\t// foreach ($data as $key => $value) {\n\t\t// \t$survey_check =0;\n\t\t// \tif($value['status']==\"completed\")\n\t\t// \t{\n\t\t// \t\t$status =1;\t\n\t\t// \t}else{\n\t\t// \t\t$status =0;\n\t\t// \t}\n\t\t// \t$insert[\"survey_status\"] = $status;\n\t\t// \t$insert[\"survey_started_on\"] = \t$value['starton'];\n\t\t// \t$insert[\"survey_completed_on\"] = \t$value['endon']; \n\t\t// \t$insert[\"ip_address\"] = $request->ip();\n\t\t// \t$insert[\"survey_submitted_from\"] = \"APP\";\n\t\t// \tif(isset($value['user_id']))\n\t\t// \t{\n\t\t// \t\t$insert[\"survey_submitted_by\"] = $value['user_id'];\n\t\t// \t}\n\n\t\t// \tif(isset($value['unique_id']))\n\t\t// \t{\n\t\t// \t\t$insert[\"unique_id\"] = \t@$value['unique_id'];\n\t\t// \t$survey_check = DB::table($table)->where('unique_id',$insert[\"unique_id\"])->count();\n\t\t// \t//dd($surve_check);\n\t\t// \t}\n\t\t// \t//dump($value);\n\t\t// \tforeach ($value['answers'] as $ansKey => $ansValue) {\t\n\t\t// \t\tif(isset($ansValue[\"answer\"]))\n\t\t// \t\t{\n\t\t// \t\t\tif(is_array($ansValue[\"answer\"]))\n\t\t// \t\t\t{\n\t\t// \t\t\t$insert[$ansValue[\"questkey\"]] = json_encode($ansValue[\"answer\"]);\n\t\t// \t\t\t}\n\t\t// \t\t\telse\n\t\t// \t\t\t{\n\t\t// \t\t\t\t$insert[$ansValue[\"questkey\"]] = $ansValue[\"answer\"];\n\t\t// \t\t\t}\n\t\t// \t\t}\t\t\t\t \n\t\t// \t}\n\t\t// \t$insert[\"device_detail\"] =\t\t$request->device_details;\n\n\t\t// \tif($survey_check==0)\n\t\t// \t{\t\t\n\t\t// \t\tDB::table($table)->insert($insert);\t\n\t\t// \t}\t\n\t\t// }\t\t\n\t}" ]
[ "0.69874746", "0.67204213", "0.6670898", "0.66456157", "0.6603026", "0.6557397", "0.6527744", "0.64886016", "0.64543456", "0.6264102", "0.6160785", "0.61414486", "0.61368847", "0.60913616", "0.6037287", "0.6034831", "0.600105", "0.59627587", "0.5957348", "0.5951941", "0.59515214", "0.59515214", "0.59440154", "0.59439135", "0.59295535", "0.5927033", "0.59268814", "0.5895142", "0.589143", "0.5838728", "0.58087313", "0.5801305", "0.5801305", "0.57983726", "0.57983726", "0.5777734", "0.57773995", "0.5736823", "0.5736772", "0.5736772", "0.57299656", "0.5724758", "0.5701211", "0.56975245", "0.56894416", "0.5669227", "0.5645132", "0.5645068", "0.5636567", "0.5633401", "0.56314766", "0.562475", "0.5612011", "0.5606616", "0.55954266", "0.5591435", "0.5591435", "0.5588817", "0.55811137", "0.55792844", "0.55757874", "0.55724937", "0.5563355", "0.5558428", "0.55558395", "0.55529183", "0.55485", "0.5531436", "0.5524778", "0.5521073", "0.55173707", "0.55173707", "0.55145067", "0.5505695", "0.55041367", "0.54951024", "0.54754394", "0.54734266", "0.5463515", "0.5456394", "0.54493797", "0.5444201", "0.5442064", "0.5434716", "0.5421234", "0.5415021", "0.54104674", "0.5406039", "0.53986275", "0.5392377", "0.5391175", "0.5367923", "0.5353666", "0.53509295", "0.5350894", "0.53483796", "0.5338041", "0.5336333", "0.5323427", "0.5318014", "0.53158504" ]
0.0
-1
Delete an individual survey submission
public function delete_survey_submission($id) { if ( isset($id) ) { $this->db->delete('vwm_surveys_submissions', array('id' => $id)); } elseif ( isset($survey_id) ) { $this->db->delete('vwm_surveys_submissions', array('survey_id' => $id)); } return $this->db->affected_rows() > 0 ? TRUE : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "public function destroy(Submission $submission)\n {\n //\n }", "public function destroy(Survey $survey)\n {\n //\n }", "function deleteSubmission(&$args, &$request) {\n\t\t//FIXME: Implement\n\n\t\treturn false;\n\t}", "public function deletequestionAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // delete the question\r\n $question->deleteQuestion($questionId);\r\n\r\n // Return to the page informations\r\n $this->_helper->redirector('gestionquestion', 'admin', null);\r\n\r\n }\r\n\r\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "public function destroy(IdeaSubmission $ideaSubmission)\n {\n //\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function destroy(Survey $survey)\n {\n $survey->delete();\n return Redirect::route('surveys');\n }", "public function deleted(AssignmentSubmitted $as) {\n Messages::where('id', $as->message_id)->delete();\n }", "public function Delete($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t// First Delete all Widgets Associated with the form,\n\t\t$widgets = $this->getWidgets($surveyid);\n\t\tforeach ($widgets as $key=>$widget) {\n\t\t\t\t// for each widget delete all the fields related ..\n\t\t\t\t$query = \"DELETE FROM {$prefix}surveys_fields WHERE surveys_widget_id = {$widget['id']}\";\n\t\t\t\t$this->Db->Query($query);\n\t\t}\n\n\t\t// Delete the actual widget,\n\t\t$query = \"DELETE FROM {$prefix}surveys_widgets WHERE surveys_id = {$surveyid}\";\n\t\t$this->Db->Query($query);\n\n\t\t// Lastly delete the actual suvey\n\t\t$query = \"DELETE FROM {$prefix}surveys WHERE id = $surveyid\";\n\t\t$this->Db->Query($query);\n\n\t\t// Delete all the responses and response value as well..\n\t\t$query = \"DELETE sr, srv\n\t\t\t\t FROM {$prefix}surveys_response as sr, {$prefix}surveys_response_value as srv\n\t\t\t\t WHERE sr.id = srv.surveys_response_id and\n\t\t\t\t sr.surveys_id = {$surveyid}\";\n\n\n\t\t// Delete all the files uploaded from the survey folders..\n\t\t$survey_images_dir = TEMP_DIRECTORY . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $surveyid;\n\n\t\tif (is_dir($survey_images_dir)) {\n\t\t// Delete using our library file\n\t\t\t\t$dir = new IEM_FileSystem_Directory($survey_images_dir);\n\t\t\t\t$dir->delete();\n\t\t}\n\n\t\t$this->Db->Query($query);\n\t}", "public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('user_survey_answer');\n }", "public function deleteAction()\n {\n /* Check if user is signed in and redirect to sign in if is not */\n $this->requireSignin();\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Redirect link after deleting. By default index page */\n $returnUrl = (isset($_POST['return'])) ? '/'.$_POST['return'] : '/';\n\n /* Getting Question by id */\n $answer = Answer::getById(intval($_POST['id']));\n\n /* If Answer exists and is active */\n if ($answer) {\n\n /* Checking if signed in user is answer's author */\n if ($answer->user_id == $user->id) {\n\n /* Check if question deleted */\n if (Answer::delete($answer->id)) {\n\n Flash::addMessage(\"Answer deleted!\", Flash::INFO);\n \n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n /* Redirect back */\n $this->redirect($returnUrl);\n }", "public function deleteanswer(Request $request)\n\t{\n\t\t$ans = \\App\\Answer::destroy($request->input('id'));\n\t}", "public function delete_survey_submissions($survey_id)\n\t{\n\t\t$this->db->delete('vwm_surveys_submissions', array('survey_id' => $survey_id));\n\n\t\treturn $this->db->affected_rows() > 0 ? TRUE : FALSE;\n\t}", "function delete($id = null) {\n if (is_null($id)) { // check for a value in the id variable\n $this->Session->setFlash('Invalid id for survey', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('survey_id' => $id)));\n if ($i > 0) {\n $this->Session->setFlash('A survey that has responses cannot be deleted. Please delete all survey responses first.', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n if ($this->Survey->delete($id)) { // delete the survey and return true if successful\n $this->Session->setFlash('Survey deleted', true, null, \"confirm\"); // send a confirmation message\n $this->redirect(array('action'=>'index')); // go back to the index view\n }\n // continue when the delete function returns false\n $this->Session->setFlash('Survey was not deleted', true, null, \"error\"); // send an error message\n $this->redirect(array('action' => 'index')); // go back to the index view\n }", "public function delete() {\n\t\t$this->assignment->delete();\n\t}", "function deleteBySubmissionId($submissionId) {\n\t\t$returner = false;\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT review_id FROM review_assignments WHERE submission_id = ?',\n\t\t\tarray((int) $submissionId)\n\t\t);\n\n\t\twhile (!$result->EOF) {\n\t\t\t$row = $result->GetRowAssoc(false);\n\t\t\t$reviewId = $row['review_id'];\n\n\t\t\t$this->update('DELETE FROM review_form_responses WHERE review_id = ?', $reviewId);\n\t\t\t$this->update('DELETE FROM review_assignments WHERE review_id = ?', $reviewId);\n\n\t\t\t$result->MoveNext();\n\t\t\t$returner = true;\n\t\t}\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}", "public function destroy( $id ) {\n\n $submission = Submission::find( $id );\n\n if ( empty( $submission) ) {\n\n return redirect( route( 'submissions.index' ) )->withErrors( [ 'notfound' => 'Submission not found' ] );\n\n }\n\n $submission->destroy( $id );\n\n Session::flash( 'flash_message', 'Submission deleted successfully.' );\n\n return redirect( route( 'submissions.index' ) );\n\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('e_id', $id);\n $questions->delete();\n\n\n $exam=DB::table('exams')->where('e_id', $id);\n $exam->delete();\n return redirect('/dashboard')->with('success','Sucessfully Deleted Exam and their questions.');\n }", "public function deleteAnswers($question_id)\n\t{\n\t}", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "public function deletequaliteAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $qualiteId = $params['qualiteId'];\r\n\r\n\r\n $qualite = new Application_Model_DbTable_FicheQualite();\r\n // delete the qualite\r\n $qualite->deleteQualite($qualiteId);\r\n\r\n // Return to the page informations\r\n $this->_helper->redirector('gestionqualite', 'admin', null);\r\n\r\n }\r\n\r\n }", "function delete_question($questionid) {\n delete_records(\"question_turprove\", \"question\", $questionid);\n return true;\n }", "function questionnaire_delete_instance($id) {\n global $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n if (! $questionnaire = $DB->get_record('questionnaire', array('id' => $id))) {\n return false;\n }\n\n $result = true;\n\n if (! $DB->delete_records('questionnaire', array('id' => $questionnaire->id))) {\n $result = false;\n }\n\n if ($survey = $DB->get_record('questionnaire_survey', array('id' => $questionnaire->sid))) {\n // If this survey is owned by this course, delete all of the survey records and responses.\n if ($survey->owner == $questionnaire->course) {\n $result = $result && questionnaire_delete_survey($questionnaire->sid, $questionnaire->id);\n }\n }\n\n if ($events = $DB->get_records('event', array(\"modulename\" => 'questionnaire', \"instance\" => $questionnaire->id))) {\n foreach ($events as $event) {\n delete_event($event->id);\n }\n }\n\n return $result;\n}", "public function delete(){\n\t\t$this->feedbacks_model->delete();\n\t}", "public function test_deleting_question() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('DELETE', '/api/v1/' . $videoquanda->id . '/questions/1');\n\n $this->assertEquals(204, $client->getResponse()->getStatusCode());\n $this->assertFalse($DB->record_exists('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }", "function delete_numberreturnsubmission($numberReturnSubmissionId)\n {\n $response = $this->db->delete('numberreturnsubmission',array('numberReturnSubmissionId'=>$numberReturnSubmissionId));\n if($response)\n {\n return \"numberreturnsubmission deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting numberreturnsubmission\";\n }\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function deleteAction() {\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitereview_post');\n\n //GET LISTING SUBJECT\n $sitereview = $post->getParent('sitereview_listing');\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$sitereview->isOwner($viewer) && !$post->isOwner($viewer)) {\n return $this->_helper->requireAuth->forward();\n }\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, null, \"view_listtype_$sitereview->listingtype_id\")->isValid())\n return;\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Post_Delete();\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $table = Engine_Api::_()->getDbTable('posts', 'sitereview');\n $db = $table->getAdapter();\n $db->beginTransaction();\n $topic_id = $post->topic_id;\n try {\n $post->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //GET TOPIC\n $topic = Engine_Api::_()->getItem('sitereview_topic', $topic_id);\n\n $href = ( null == $topic ? $sitereview->getHref() : $topic->getHref() );\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRedirect' => $href,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Post deleted.')),\n ));\n }", "public function destroy($id)\n {\n $survey = Survey::findOrFail($id);\n $survey->delete();\n $msg = 'Deleted successfully';\n Session::set('massage',$msg);\n return redirect()->action('SurveyController@index');\n }", "public function testDeleteSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n $surveyGroupId = $surveyGroup->id;\n\n $response = $this->json('DELETE', \"survey-group/{$surveyGroupId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey_group', [ 'id' => $surveyGroupId ]);\n }", "public function delete_survey($session_key, $sid)\n {\n if ($this->_checkSessionKey($session_key))\n {\n if (hasSurveyPermission($sid, 'survey', 'delete'))\n {\n Survey::model()->deleteAllByAttributes(array('sid' => $sid));\n rmdirr(Yii::app()->getConfig(\"uploaddir\") . '/surveys/' . $sid);\n return array('status' => 'OK');\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\n }", "public function delete(Datastore $db)\n {\n $stmt = $db->prepare('DELETE FROM tbl_survey WHERE col_uuid = :surveyUuid');\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }", "public function deleteQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n if(isset($_GET['question_id']) && is_numeric($_GET['question_id'])){\n\n $question_id = $_GET['question_id'];\n\n $this->object->deleteQuestion($question_id);\n $ilTabs->activateTab(\"editQuiz\");\n\n ilUtil::sendSuccess($this->txt(\"successful_delete\"), true);\n // Forwarding\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n }", "function delete_by_id_question($id)\n {\n if ($this->db->delete('fis_dtraining_feedback_selections', array('tfselect_tfque_fk' => $id))) {\n $this->session->set_userdata('typeNotif', 'successDelete');\n return TRUE;\n } else {\n $this->session->set_userdata('typeNotif', 'errorDelete');\n return FALSE;\n }\n }", "function deleteAnswer( $id_track ) {\n\t\t\n\t\t\n\t\treturn sql_query(\"\n\t\tDELETE FROM \".$GLOBALS['prefix_lms']\t.\"_testtrack_answer \n\t\tWHERE idTrack = '\".(int)$id_track.\"' AND \n\t\t\tidQuest = '\".$this->id.\"'\");\n\t}", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "public function destroy(PastQuestionSingleRequest $request)\n {\n $past_question = PastQuestion::find($request->input('id'));\n\n if ($past_question) { \n\n if ($past_question->uploaded_by !== auth()->user()->id || $this->USER_LEVEL_3 !== auth()->user()->rank) {\n return $this->authenticationFailure('This past question was not uploaded by you');\n }\n\n if ($past_question->delete()) {\n return $this->actionSuccess('Past question was deleted');\n } else {\n return $this->requestConflict('Currently unable to delete past question');\n }\n\n } else {\n return $this->notFound('Past question was not found');\n }\n }", "public function destroy($id)\n {\n $delete=TrialTest::find($id);\n $delete->delete();\n return redirect()->back()->with('success','question deleted');\n }", "public function destroy($id)\n {\n $inquiry = Inquiry::find($id);\n $inquiry->delete();\n return redirect('submissions');\n }", "public function delete_instance() {\n global $DB;\n // Will throw exception on failure.\n $DB->delete_records('assignsubmission_circleci',\n array('assignment'=>$this->assignment->get_instance()->id));\n\n return true;\n }", "function removequestion($sq_id, $survey_id, $question_id)\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t// move question to bottom of survey list so deletion can be done\r\n\t\t// without affecting the number order\r\n\t\t$this->SurveyQuestion->moveQuestion($survey_id, $question_id, \"BOTTOM\");\r\n\r\n\t\t// remove the question from the survey association as well as all other\r\n\t\t// references to the question in the responses and questions tables\r\n\t\t$this->SurveyQuestion->del($sq_id);\r\n\t\t//$this->Question->editCleanUp($question_id);\r\n\r\n\t\t$this->set('message', 'The question was removed successfully.');\r\n\t\t$this->set('survey_id', $survey_id);\r\n\r\n\t\t$this->questionssummary($survey_id, $question_id);\r\n\t\t//$this->render('index');\r\n\t}", "public function destroy($q_id,$a_id)\n {\n $answer = Answer::find($a_id);\n $answer->delete();\n return redirect()->route('questions.show',$q_id);\n }", "public function destroy(Exam $exam)\n {\n foreach ($exam->questions()->orderBy('order')->get() as $Q) {\n\n $exam->questions()->detach([$Q->id_Question]);\n }\n $exam->delete();\n return redirect('/teacher/exams');\n }", "function student_form_delete() {\n $id = arg(1);\n $num_deleted = db_delete('student')\n ->condition('st_id', $id)\n ->execute();\n if ($num_deleted) {\n drupal_set_message(t('entry has been deleted.'));\n drupal_goto(\"formlist\");\n }\n else {\n drupal_set_message(t('error in query'));\n }\n}", "public function destroy($id)\n {\n $questionnaire = Questionnaire::find($id);\n $questionnaire->delete();\n return redirect()->route('questionnaire.index')->with('success', 'Data Deleted');\n }", "public function removeAction()\n {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_frpformanswers_domain_model_formentry');\n\n $queryBuilder->delete('tx_frpformanswers_domain_model_formentry')\n ->where($queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($this->pid, \\PDO::PARAM_INT)))\n ->andWhere($queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(1, \\PDO::PARAM_INT)))\n ->execute();\n\n $this->addFlashMessage(\n LocalizationUtility::translate('LLL:EXT:frp_form_answers/Resources/Private/Language/de.locallang_be.xlf:flashmessage.removeEntries.body', null, [$this->pid]),\n LocalizationUtility::translate('LLL:EXT:frp_form_answers/Resources/Private/Language/de.locallang_be.xlf:flashmessage.removeEntries.title'),\n \\TYPO3\\CMS\\Core\\Messaging\\FlashMessage::OK,\n true);\n\n $this->redirect('list');\n }", "public function delete_poll_submissions() {\n\t\tforminator_validate_ajax( 'forminatorPollEntries' );\n\t\tif ( ! empty( $_POST['id'] ) ) {\n\t\t\t$form_id = intval( $_POST['id'] );\n\t\t\tForminator_Form_Entry_Model::delete_by_form( $form_id );\n\n\t\t\t$file = forminator_plugin_dir() . \"admin/views/poll/entries/content-none.php\";\n\n\t\t\tob_start();\n\t\t\t/** @noinspection PhpIncludeInspection */\n\t\t\tinclude $file;\n\t\t\t$html = ob_get_clean();\n\n\t\t\t$data['html'] = $html;\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'success',\n\t\t\t\t'text' => __( 'All the submissions deleted successfully.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_success( $data );\n\t\t} else {\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'text' => __( 'Submission delete failed.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_error( $data );\n\t\t}\n\t}", "public function actionAnswerDelete($id)\n\t{\n\t\t$model = $this->findAnswer($id);\n\t\t$this->checkAccess($model->question0->user);\n\t\t$model->question0->count--;\n\t\t$model->question0->save(true,['count']);\n\t\t$model->delete();\n\t}", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "public function testDeleteSurveyQuestionChoice0()\n {\n }", "function pubf_DeleteSingleAnswer(){\n //delete all relations from table actividadrespuesta\n $DeleteSingleAnswer=$this->prepare(\"DELETE FROM actividadrespuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteSingleAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteSingleAnswer);\n $DeleteRelatedAnswer=$this->prepare(\"DELETE FROM respuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteRelatedAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteRelatedAnswer);\n }", "protected function deleteQuestion($a_id)\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\tif(!is_array($a_id))\n\t\t{\n\t\t\t$a_id = array($a_id);\n\t\t}\n\t\t\n\t\t$ilCtrl->setParameter($this->editor_gui, \"pgov\", $this->current_page);\n\t\t$this->editor_gui->removeQuestionsForm(array(), $a_id, array());\n\t\treturn true;\n\t}", "public function delete(SurveyService $surveyService, QuestionService $questionService)\n {\n $type = \\request('type', 'survey');\n $id = \\request('id', 0);\n if (0 == $id) {\n return $this->error('params error');\n }\n if ('survey' == $type) {\n $ret = $surveyService->delete($id);\n } else {\n $ret = $questionService->delete($id);\n }\n\n if (empty($ret)) {\n return $this->error('failed to delete it');\n }\n return $this->success('delete success');\n }", "public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //SET LAYOUT \n $this->_helper->layout->setLayout('default-simple');\n\n //GET CLAIM ID\n $claim_id = $this->_getParam('claim_id', 'null');\n\n //GET CLAIM ITEM\n $claim = Engine_Api::_()->getItem('sitepage_claim', $claim_id);\n if ($claim->user_id != Engine_Api::_()->user()->getViewer()->getIdentity()) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET FORM\n $this->view->form = $form = new Sitepage_Form_Deleteclaim();\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET CLAIM TABLE\n Engine_Api::_()->getDbtable('claims', 'sitepage')->delete(array('claim_id=?' => $claim_id));\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => true,\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('You have successfully deleted your claim request.'))\n ));\n }\n }", "public function destroy(ClientSurvey $clientSurvey)\n {\n //\n }", "public function destroy($id)\n {\n $question= forumquestion::where('id',$id);\n $question->delete();\n return redirect('/Forum')\n ->with('message','Question Supprimé!');\n }", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reports WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('id', '=',$id)->delete();\n }", "public function destroy(Submission $submission, Request $request)\n {\n $user = auth()->user();\n if($user->hasRole('admin') || $user->id == $submission['user_id']){\n try{\n $submission->delete();\n }catch(\\Error $err){\n return response()->json(['error' => $err], 500);\n }\n return self::parseRedirectURL($request['redirect']);\n }else{\n return response()->json(['error' => 'Unathorized.'], 401);\n }\n }", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reportKinds WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "function deleteQuestion($idQuestion = null)\n {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) { // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) { //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n if (isset($tempArr[$idQuestion]['id']) && ($tempArr[$idQuestion]['id'] != '')) { // questions that have been written to the database will have an id set\n $delArr = array();\n if ($this->Session->check('SurveyQuestion.delete')) { // get a copy of any questions already marked for deletion\n $delArr = $this->Session->read('SurveyQuestion.delete');\n }\n $delArr[] = $tempArr[$idQuestion]['id']; // add our question to the array for deletion from the database\n $this->Session->write('SurveyQuestion.delete',$delArr); // write to the session\n }\n unset($tempArr[$idQuestion]); // remove the question from the temporary question array\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }", "public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }", "public function destroy( Request $request, $id = null)\n {\n $pDelete = $request->get( '_permanent' ) == \"true\";\n $bundleDelete = $request->get( '_bundle' ) == \"true\";\n $Ids = $request->get( '_bundle_ids' );\n\n $Ids = explode( ',', urldecode( $Ids ) );\n\n if( !$bundleDelete ) {\n $Ids = [$id];\n }\n\n $question = $pDelete ? Question::whereIn( 'id', $Ids)->onlyTrashed( ) : Question::whereIn('id',$Ids)->withoutTrashed( );\n\n// dd( $question->get() );\n\n if ( $question->exists() ) {\n $deleted = 0;\n $this->set( 'data', $question->get() );\n\n if( $pDelete ) {\n if( QuestAssign::where( [ 'question_id' => $id ] )->exists() ) {\n return $this->setAndGetResponse( 'message', 'Quiz assigned with question!', 403 );\n }\n\n if( $deleted = $question->forceDelete() ) {\n $this->set('action', 'permanently-deleted');\n }\n }else {\n if( $deleted = $question->delete()) {\n $this->set('action', 'deleted');\n }\n }\n\n if( $deleted > 0){\n $this->set( 'delete_count', $deleted );\n return $this->setAndGetResponse('message', \"Question \" . ( $pDelete ? \" permanently \":\"\" ) . \"deleted\" );\n }\n }\n\n return $this->setAndGetResponse( 'message' , 'Question not found!', 404 );\n }", "public function delete($id = null) {\n\t\tif (!$this->request->is('post')) {\n\t\t\tthrow new MethodNotAllowedException();\n\t\t}\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\tif ($this->SurveyInstanceObject->delete()) {\n\t\t\t$this->Session->setFlash(__('Survey instance object deleted'));\n\t\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t\t}\n\t\t$this->Session->setFlash(__('Survey instance object was not deleted'));\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "function delete($id) {\r\n\t\treturn SurveyAnswerQuery::create()->filterByPrimaryKey($id)->delete() > 0;\r\n\t}", "public function destroy(Request $request,$id)\n {\n //Find Record\n $record=Assignatory::find($id);\n\n //go back\n activity('Delete Signatory')\n ->log(Auth::user()->name.' deleted signatory: '.$record->name);\n\n //Delete the record\n $record->delete();\n return redirect()->back()->with('success','Signatory Deleted.');\n }", "public function deleteAction()\r\n {\r\n $id = $this->getRequest()->getParam('id');\r\n $model = Mage::getModel('thetailor_workgroup/workflow');\r\n \r\n if ($id) {\r\n // Load record\r\n $model->load($id);\r\n \r\n // Check if record is loaded\r\n if (!$model->getId()) {\r\n Mage::getSingleton('adminhtml/session')->addError($this->__('This workflow no longer exists.'));\r\n $this->_redirect('*/*/');\r\n \r\n return;\r\n } else {\r\n try { \r\n $model->setId($id)->delete();\r\n \r\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The workflow was successfully deleted.'));\r\n $this->_redirect('*/*/');\r\n } catch (Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n $this->_redirect('*/*/edit', array('id' => $id));\r\n }\r\n }\r\n }\r\n }", "public function destroy($id)\n {\n $element = Question::whereId($id)->with('surveys', 'answers', 'results')->first();\n if ($element) {\n if ($element->surveys->isNotEmpty()) {\n $element->surveys()->detach();\n }\n if ($element->results->isNotEmpty()) {\n foreach ($element->results as $r) {\n $r->question()->dissociate();\n $r->save();\n }\n }\n if ($element->answers->isNotEmpty()) {\n $element->answers()->detach();\n }\n $element->delete();\n return redirect()->route('backend.question.index')->with('success', 'question deleted');\n }\n return redirect()->route('backend.question.index')->with('error', 'question is not deleted');\n }", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }", "function delete_question($objet) {\n\t\t$sql = \"DELETE FROM \n\t\t\t\t\tquestions\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objet['id'];\n\t\t// return $sql;\n\t\t$result = $this -> query($sql);\n\t\t\n\t\treturn $result;\n\t}", "public function destroy(Question $question)\n {\n\n\n }", "public function destroy()\n {\n $id = DB::table('codifications')->selectRaw('codifications.id')->first()->id;\n $task = Codification::findOrFail($id);\n \n $task->delete();\n \n return redirect()->route('Codificationcreate');\n }", "function deleteSurveyCode($survey_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (strlen($survey_code) > 0)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s AND survey_key = %s\",\n\t\t\t\tarray('integer', 'text'),\n\t\t\t\tarray($this->getSurveyId(), $survey_code)\n\t\t\t);\n\t\t}\n\t}", "public function deleteQuestion()\r\n {\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE questionid= :questionid\";\r\n\r\n return $query_string;\r\n}", "public function destroy($pregunta_id)\n {\n Pregunta::all()->find($pregunta_id)->delete();\n return redirect()->route('preguntas.index')\n ->with('success','Pregunta eliminada correctamente');\n }", "function delete_answer($answerId, $questionId){\n $this->db->where('ans_id', $answerId);\n $this->db->where('ans_question', $questionId);\n $this->db->delete('answers');\n }", "public function destroy($id)\n {\n $remove = Question::where('question_id', $id);\n $remove -> delete();\n\n $removeOption = Question_option::where('question_id', $id);\n $removeOption -> delete();\n\n Session::flash('success', 'this post was sucessfully deleted');\n return redirect()->route('questionPosts.index');\n }", "public function delete_question($session_key, $sid, $gid, $qid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$sid = sanitize_int($sid);\n\t\t\t$gid = sanitize_int($gid);\n\t\t\t$qid = sanitize_int($qid);\t\t\t\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n \t\t \n\t\t\t$groupidExists = Groups::model()->findByAttributes(array('gid' => $gid));\n\t\t\tif (!isset($groupidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid groupid', 22);\n\n\t\t\t$questionidExists = Questions::model()->findByAttributes(array('qid' => $qid));\n\t\t\tif (!isset($questionidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid questionid', 22);\n\t\t\n\t\t\tif($surveyidExists['active']=='Y')\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey is active and not editable', 35);\t\n\t\t\t\t\t\t\t\n if (hasSurveyPermission($sid, 'surveycontent', 'delete'))\n {\n\t\t\t\t$ccresult = Conditions::model()->findAllByAttributes(array('cqid' => $qid));\n\t\t\t\tif(count($ccresult)>0)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Cannot delete Question. There are conditions for other questions that rely on this question ', 37);\n\t\t\t\t\n\t\t\t\t$row = Questions::model()->findByAttributes(array('qid' => $qid))->attributes;\n\t\t\t\tif ($row['gid']!=$gid)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Missmatch in groupid and questionid', 21);\t\n\n\t\t\t\tLimeExpressionManager::RevertUpgradeConditionsToRelevance(NULL,$qid);\n\n Conditions::model()->deleteAllByAttributes(array('qid' => $qid));\n Question_attributes::model()->deleteAllByAttributes(array('qid' => $qid));\n Answers::model()->deleteAllByAttributes(array('qid' => $qid));\n\n $criteria = new CDbCriteria;\n $criteria->addCondition('qid = :qid or parent_qid = :qid');\n $criteria->params[':qid'] = $qid;\n Questions::model()->deleteAll($criteria);\n\n Defaultvalues::model()->deleteAllByAttributes(array('qid' => $qid));\n Quota_members::model()->deleteAllByAttributes(array('qid' => $qid));\n Questions::updateSortOrder($gid, $sid);\n \n return \"Deleted \".$qid;\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\t\t\n\t}", "public function forceDeleted(AssignmentSubmitted $assignmentSubmitted)\n {\n //\n }", "public function actionDelete($survey_id, $vote_id)\n {\n $this->findModel($vote_id)->delete();\n\n return $this->redirect(['survey/view', 'id'=>$survey_id]);\n }", "public function deleting(assignment $assignment)\n {\n //code...\n }", "public function reset_survey_post()\n\t\t{\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($uuid) && !empty($weekSend))\n\t\t\t{\n\t\t\t\t$this->db->where('ts_uuid' , $uuid)\n\t\t\t\t\t\t->where('ts_week' , $weekSend)\n\t\t\t\t\t\t->where('ts_test_id' , 1)\n\t\t\t\t\t\t->delete('plused_test_submited');\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function deleteAction()\r\n\t{\r\n\t\t// check if we know what should be deleted\r\n\t\tif ($id = $this->getRequest()->getParam('faq_id')) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\t// init model and delete\r\n\t\t\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\t\t$model->load($id);\r\n\t\t\t\t$model->delete();\r\n\t\t\t\t\r\n\t\t\t\t// display success message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('cms')->__('FAQ Entry was successfully deleted'));\r\n\t\t\t\t\r\n\t\t\t\t// go to grid\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t\r\n\t\t\t\t// display error message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\t\r\n\t\t\t\t// go back to edit form\r\n\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t'faq_id' => $id ));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// display error message\r\n\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('cms')->__('Unable to find a FAQ entry to delete'));\r\n\t\t\r\n\t\t// go to grid\r\n\t\t$this->_redirect('*/*/');\r\n\t}", "public function removeQuestions($lecture_id, $chapter_id, $survey_id) {\n $request_parameter = (array) Request::all();\n $questions_to_remove_array = explode(\"_\", $request_parameter['questions_to_remove']);\n\n //print_r($questions_to_remove_array);\n\n if ($this->hasPermission($lecture_id)) {\n DB::transaction(function() use ($questions_to_remove_array, $survey_id) {\n for ($x = 0; $x < sizeof($questions_to_remove_array); $x++) {\n QuestionModel::where(['survey_id' => $survey_id, 'id' => $questions_to_remove_array[$x]])->delete();\n }\n });\n } else {\n // TODO: Permission denied page\n print \"Permission denied\";\n }\n\n return redirect()->route('survey', ['lecture_id' => $lecture_id, 'chapter_id' => $chapter_id, 'survey_id' => $survey_id]);\n }", "function tquiz_delete_instance($id) {\n global $DB;\n\n if (! $tquiz = $DB->get_record('tquiz', array('id' => $id))) {\n return false;\n }\n\n # Delete any dependent records here #\n\n $DB->delete_records('tquiz', array('id' => $tquiz->id));\n\n return true;\n}", "function delete()\n\t{\n\t\t$kReport = $this->input->post(\"kReport\");\n\t\t$kStudent = $this->input->post(\"kStudent\");\n\t\t$this->report->delete($kReport);\n\t\tredirect(\"report/get_list/student/$kStudent\");\n\t}", "function delete_correct_answer($id)\n {\n return $this->db->delete('correct_answers',array('id'=>$id));\n }", "public function delFaq(){\n// $faqManager = new FaqManager();\n// $idFaq = $_GET['id'];\n// $faqManager->deleteFaq($idFaq);\n\n View::show('admin/deleteFaq.php', 'Question deleted', []);\n\n }", "public function delete_post() {\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]|callback_validateAnyUserJoinedContest[delete]');\n $this->form_validation->validation($this); /* Run validation */\n\n /* Delete Contests Data */\n $this->SnakeDrafts_model->deleteContest($this->SessionUserID, $this->ContestID);\n $this->Return['Message'] = \"Contest deleted successfully.\";\n }" ]
[ "0.704928", "0.6927132", "0.6782566", "0.67519563", "0.6743712", "0.67242193", "0.6659275", "0.6654835", "0.65483344", "0.6547482", "0.6538272", "0.6526627", "0.6492822", "0.64676714", "0.64564884", "0.6453267", "0.6381312", "0.63810337", "0.6379219", "0.6363803", "0.63554263", "0.6351556", "0.6342595", "0.6329575", "0.6329575", "0.63254064", "0.6312604", "0.6304798", "0.6304132", "0.6294992", "0.62907815", "0.62600875", "0.62564534", "0.62416863", "0.62290865", "0.62290865", "0.622112", "0.62029964", "0.6200617", "0.6194057", "0.618772", "0.6178884", "0.6159656", "0.6153373", "0.614958", "0.6148366", "0.61474967", "0.61335325", "0.613273", "0.61088634", "0.6097756", "0.60972196", "0.6089947", "0.60854936", "0.6084033", "0.6073112", "0.6069676", "0.606238", "0.6059259", "0.6059259", "0.6058276", "0.60537916", "0.605303", "0.6037126", "0.60219", "0.6020762", "0.6017251", "0.60155344", "0.6015494", "0.60099167", "0.60056204", "0.5989134", "0.5976101", "0.59671015", "0.59551114", "0.59510744", "0.5945293", "0.5942059", "0.5938065", "0.59353334", "0.59345716", "0.59313715", "0.5923854", "0.5923464", "0.5921525", "0.59209347", "0.5912359", "0.5909519", "0.5905997", "0.59008855", "0.5897997", "0.58973473", "0.5894872", "0.5894393", "0.5893417", "0.5891256", "0.58882105", "0.5885872", "0.5885448", "0.5879354" ]
0.7071134
0
Delete all survey submissions for a particular survey
public function delete_survey_submissions($survey_id) { $this->db->delete('vwm_surveys_submissions', array('survey_id' => $survey_id)); return $this->db->affected_rows() > 0 ? TRUE : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Delete($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t// First Delete all Widgets Associated with the form,\n\t\t$widgets = $this->getWidgets($surveyid);\n\t\tforeach ($widgets as $key=>$widget) {\n\t\t\t\t// for each widget delete all the fields related ..\n\t\t\t\t$query = \"DELETE FROM {$prefix}surveys_fields WHERE surveys_widget_id = {$widget['id']}\";\n\t\t\t\t$this->Db->Query($query);\n\t\t}\n\n\t\t// Delete the actual widget,\n\t\t$query = \"DELETE FROM {$prefix}surveys_widgets WHERE surveys_id = {$surveyid}\";\n\t\t$this->Db->Query($query);\n\n\t\t// Lastly delete the actual suvey\n\t\t$query = \"DELETE FROM {$prefix}surveys WHERE id = $surveyid\";\n\t\t$this->Db->Query($query);\n\n\t\t// Delete all the responses and response value as well..\n\t\t$query = \"DELETE sr, srv\n\t\t\t\t FROM {$prefix}surveys_response as sr, {$prefix}surveys_response_value as srv\n\t\t\t\t WHERE sr.id = srv.surveys_response_id and\n\t\t\t\t sr.surveys_id = {$surveyid}\";\n\n\n\t\t// Delete all the files uploaded from the survey folders..\n\t\t$survey_images_dir = TEMP_DIRECTORY . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $surveyid;\n\n\t\tif (is_dir($survey_images_dir)) {\n\t\t// Delete using our library file\n\t\t\t\t$dir = new IEM_FileSystem_Directory($survey_images_dir);\n\t\t\t\t$dir->delete();\n\t\t}\n\n\t\t$this->Db->Query($query);\n\t}", "public function destroy(Survey $survey)\n {\n //\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function delete_poll_submissions() {\n\t\tforminator_validate_ajax( 'forminatorPollEntries' );\n\t\tif ( ! empty( $_POST['id'] ) ) {\n\t\t\t$form_id = intval( $_POST['id'] );\n\t\t\tForminator_Form_Entry_Model::delete_by_form( $form_id );\n\n\t\t\t$file = forminator_plugin_dir() . \"admin/views/poll/entries/content-none.php\";\n\n\t\t\tob_start();\n\t\t\t/** @noinspection PhpIncludeInspection */\n\t\t\tinclude $file;\n\t\t\t$html = ob_get_clean();\n\n\t\t\t$data['html'] = $html;\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'success',\n\t\t\t\t'text' => __( 'All the submissions deleted successfully.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_success( $data );\n\t\t} else {\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'text' => __( 'Submission delete failed.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_error( $data );\n\t\t}\n\t}", "public function delete_survey_submission($id)\n\t{\n\t\tif ( isset($id) )\n\t\t{\n\t\t\t$this->db->delete('vwm_surveys_submissions', array('id' => $id));\n\t\t}\n\t\telseif ( isset($survey_id) )\n\t\t{\n\t\t\t$this->db->delete('vwm_surveys_submissions', array('survey_id' => $id));\n\t\t}\n\n\t\treturn $this->db->affected_rows() > 0 ? TRUE : FALSE;\n\t}", "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "public function destroy(Survey $survey)\n {\n $survey->delete();\n return Redirect::route('surveys');\n }", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "public function batchDestroy(PastQuestionMultipleRequest $request)\n {\n // Gets all the past questions in the array by id\n $past_questions = PastQuestion::whereIn('id', $request->input('past_questions'))->get();\n if ($past_questions) {\n\n // Deletes all found past questions\n $filtered = $past_questions->filter(function ($value, $key) {\n if ($value->uploaded_by === auth()->user()->id || $this->USER_LEVEL_3 === auth()->user()->rank) {\n if ($value->delete()) {\n return $value;\n }\n }\n });\n\n // Check's if any past questions were deleted\n if (($deleted = count($filtered)) > 0) {\n return $this->actionSuccess(\"$deleted Past question(s) deleted\");\n } else {\n return $this->requestConflict('Currently unable to delete past question(s)');\n }\n\n } else {\n return $this->notFound('Past question(s) not found');\n }\n }", "public function massDestroy(Request $request)\r\n {\r\n if (!Gate::allows('questions_option_delete')) {\r\n return abort(401);\r\n }\r\n if ($request->input('ids')) {\r\n $entries = QuestionsOption::whereIn('id', $request->input('ids'))->get();\r\n\r\n foreach ($entries as $entry) {\r\n $entry->delete();\r\n }\r\n }\r\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('answer_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Answer::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function removeQuestions($lecture_id, $chapter_id, $survey_id) {\n $request_parameter = (array) Request::all();\n $questions_to_remove_array = explode(\"_\", $request_parameter['questions_to_remove']);\n\n //print_r($questions_to_remove_array);\n\n if ($this->hasPermission($lecture_id)) {\n DB::transaction(function() use ($questions_to_remove_array, $survey_id) {\n for ($x = 0; $x < sizeof($questions_to_remove_array); $x++) {\n QuestionModel::where(['survey_id' => $survey_id, 'id' => $questions_to_remove_array[$x]])->delete();\n }\n });\n } else {\n // TODO: Permission denied page\n print \"Permission denied\";\n }\n\n return redirect()->route('survey', ['lecture_id' => $lecture_id, 'chapter_id' => $chapter_id, 'survey_id' => $survey_id]);\n }", "public function delete_survey($session_key, $sid)\n {\n if ($this->_checkSessionKey($session_key))\n {\n if (hasSurveyPermission($sid, 'survey', 'delete'))\n {\n Survey::model()->deleteAllByAttributes(array('sid' => $sid));\n rmdirr(Yii::app()->getConfig(\"uploaddir\") . '/surveys/' . $sid);\n return array('status' => 'OK');\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "public function destroy(ClientSurvey $clientSurvey)\n {\n //\n }", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "public function reset_survey_post()\n\t\t{\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($uuid) && !empty($weekSend))\n\t\t\t{\n\t\t\t\t$this->db->where('ts_uuid' , $uuid)\n\t\t\t\t\t\t->where('ts_week' , $weekSend)\n\t\t\t\t\t\t->where('ts_test_id' , 1)\n\t\t\t\t\t\t->delete('plused_test_submited');\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function delete_all(Request $r)\n\t{\n\t\t$input = $r->all();\n\t\tforeach($input['datachecked'] as $tag)\n\t\t{\n\t\t\t$tag_status = \\App\\Tag::where('id',$tag)->first();\n\t\t\t$tag_status->delete();\n }\n session()->flash('success', 'Tag(s) deleted successfully.');\n\t\techo 'success';\n\t}", "public function deleteAnswers($question_id)\n\t{\n\t}", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Subjects::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('user_survey_answer');\n }", "public function destroyall(Request $request)\n {\n if(count(collect($request->checkbox)) > 1){\n $post = Post::whereIn('id',$request->get('checkbox'));\n $post->delete();\n }else{\n $post = post::find($request->get('checkbox'))->first();\n $post->delete();\n }\n return back();\n }", "public function removeAllAction()\n {\n $isPosted = $this->request->getPost('doRemoveAll');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->deleteAll($this->request->getPost('pageKey'));\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function batchPermanentDestroy(PastQuestionMultipleRequest $request)\n {\n // Check access level\n if ($this->USER_LEVEL_3 !== auth()->user()->rank) {\n return $this->authenticationFailure('Please contact management');\n }\n\n // Gets all the past questions in the array by id\n $past_questions = PastQuestion::with('image','document')\n ->whereIn('id', $request->input('past_questions'))->get();\n if ($past_questions) {\n\n // Deletes all found past questions\n $filtered = $past_questions->filter(function ($value, $key) {\n if ($value->forceDelete()) {\n return $value;\n }\n });\n\n // Check's if any past questions were deleted\n if (($deleted = count($filtered)) > 0) {\n\n // Remove previously stored images from server or cloud\n if (config('ovsettings.image_permanent_delete')) {\n $removed_images = $filtered->filter(function ($value, $key){\n if (BatchMediaProcessors::batchUnStoreImages($value->image)){\n return true;\n }\n });\n $removed_images = count($removed_images);\n } else { $removed_images = 0; }\n\n // Remove previously stored document from server or cloud\n if (config('ovsettings.document_permanent_delete')) {\n $removed_documents = $filtered->filter(function ($value, $key){\n if (BatchMediaProcessors::batchUnStoreFiles($value->document)) {\n return true;\n }\n });\n $removed_documents = count($removed_documents);\n } else { $removed_documents = 0; }\n\n return $this->actionSuccess(\"$deleted Past question(s) deleted with $removed_images image file(s) and $removed_documents document File(s) removed\");\n } else {\n return $this->requestConflict('Currently unable to delete past question(s)');\n }\n\n } else {\n return $this->notFound('Past question(s) not found');\n }\n }", "public function reset_survey_options_post()\n\t\t{\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($uuid) && !empty($weekSend))\n\t\t\t{\n\t\t\t\t$this->db->where('tans_uuid' , $uuid)\n\t\t\t\t\t\t->where('tans_week' , $weekSend)\n\t\t\t\t\t\t->delete('plused_test_answers');\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function delete(Datastore $db)\n {\n $stmt = $db->prepare('DELETE FROM tbl_survey WHERE col_uuid = :surveyUuid');\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('exam_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Exam::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "function questionnaire_delete_instance($id) {\n global $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n if (! $questionnaire = $DB->get_record('questionnaire', array('id' => $id))) {\n return false;\n }\n\n $result = true;\n\n if (! $DB->delete_records('questionnaire', array('id' => $questionnaire->id))) {\n $result = false;\n }\n\n if ($survey = $DB->get_record('questionnaire_survey', array('id' => $questionnaire->sid))) {\n // If this survey is owned by this course, delete all of the survey records and responses.\n if ($survey->owner == $questionnaire->course) {\n $result = $result && questionnaire_delete_survey($questionnaire->sid, $questionnaire->id);\n }\n }\n\n if ($events = $DB->get_records('event', array(\"modulename\" => 'questionnaire', \"instance\" => $questionnaire->id))) {\n foreach ($events as $event) {\n delete_event($event->id);\n }\n }\n\n return $result;\n}", "function delete($id = null) {\n if (is_null($id)) { // check for a value in the id variable\n $this->Session->setFlash('Invalid id for survey', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('survey_id' => $id)));\n if ($i > 0) {\n $this->Session->setFlash('A survey that has responses cannot be deleted. Please delete all survey responses first.', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n if ($this->Survey->delete($id)) { // delete the survey and return true if successful\n $this->Session->setFlash('Survey deleted', true, null, \"confirm\"); // send a confirmation message\n $this->redirect(array('action'=>'index')); // go back to the index view\n }\n // continue when the delete function returns false\n $this->Session->setFlash('Survey was not deleted', true, null, \"error\"); // send an error message\n $this->redirect(array('action' => 'index')); // go back to the index view\n }", "function resetSurveyData(\\Plugin\\Project $eventProject, \\Plugin\\Record $surveyRecord, $eventID, $deleteFields) {\n $surveyRecord->updateDetails($deleteFields);\n $surveyIDs = array();\n $sql = \"SELECT survey_id\n FROM redcap_surveys\n WHERE project_id=\".$eventProject->getProjectId();\n $result = db_query($sql);\n while ($row = db_fetch_assoc($result)) {\n $surveyIDs[] = $row['survey_id'];\n }\n\n $participantIDs = array();\n $sql = \"SELECT d.participant_id\n FROM redcap_surveys_participants d\n JOIN redcap_surveys_response d2\n ON d.participant_id = d2.participant_id AND d2.record=\".$surveyRecord->getId().\"\n WHERE d.event_id=\".$eventID.\"\n AND d.survey_id IN (\".implode(\",\",$surveyIDs).\")\";\n $result = db_query($sql);\n while ($row = db_fetch_assoc($result)) {\n $participantIDs[] = $row['participant_id'];\n }\n\n foreach ($participantIDs as $participantID) {\n $sql = \"UPDATE redcap_surveys_response\n SET start_time=NULL, first_submit_time=NULL, completion_time=NULL, return_code=NULL, results_code=NULL\n WHERE record=\".$surveyRecord->getId().\" AND participant_id=\".$participantID;\n db_query($sql);\n }\n}", "public function deleteQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n if(isset($_GET['question_id']) && is_numeric($_GET['question_id'])){\n\n $question_id = $_GET['question_id'];\n\n $this->object->deleteQuestion($question_id);\n $ilTabs->activateTab(\"editQuiz\");\n\n ilUtil::sendSuccess($this->txt(\"successful_delete\"), true);\n // Forwarding\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n }", "function pubf_DeleteSingleAnswer(){\n //delete all relations from table actividadrespuesta\n $DeleteSingleAnswer=$this->prepare(\"DELETE FROM actividadrespuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteSingleAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteSingleAnswer);\n $DeleteRelatedAnswer=$this->prepare(\"DELETE FROM respuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteRelatedAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteRelatedAnswer);\n }", "public function massDestroy(Request $request)\n {\n if (!Gate::allows('lesson_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Assignment::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function massDestroy(Request $request) {\n if (!Gate::allows('speakers_congress_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = SpeakersCongress::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDeleteAction()\n {\n $faqIds = $this->getRequest()->getParam('faqs');\n if (!is_array($faqIds)) {\n Mage::getSingleton('adminhtml/session')->addError($this->__('Please select FAQ\\'s.'));\n } else {\n try {\n foreach ($faqIds as $faqId) {\n $faq = Mage::getModel('ecomitizetest/faqs')->load($faqId);\n $faq->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n $this->__('Total of %d record(s) have been deleted.', count($faqIds))\n );\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n }\n\n $this->_redirect('*/*/' . $this->getRequest()->getParam('ret', 'index'));\n }", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "function deleteAllUserData()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$active_array = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($active_array, $row[\"finished_id\"]);\n\t\t}\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\tforeach ($active_array as $active_fi)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_answer WHERE active_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($active_fi)\n\t\t\t);\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_times WHERE finished_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($active_fi)\n\t\t\t);\n\t\t}\n\t}", "public function destroy($id) {\n\n $questionnaire = Questionnaire::find($id);\n $questionsQuestionnaire = $questionnaire->questions;\n $categoriesQuestionnaire = $questionnaire->categories;\n\n foreach ($questionsQuestionnaire as $question) {\n \n DB::table('question_questionnaire')\n ->where('questionnaire_id', '=', $id)\n ->where('question_id', '=', $question->id)\n ->delete();\n }\n\n foreach ($categoriesQuestionnaire as $category) {\n \n DB::table('category_questionnaire')\n ->where('questionnaire_id', '=', $id)\n ->where('category_id', '=', $category->id)\n ->delete();\n }\n \n $questionnaire->delete();\n //Questionnaire::destroy($id);\n\n return redirect(route('admin.questionnaire.index'))\n ->withSuccess('Le questionnaire a bien été supprimé.');\n }", "public function deleted(AssignmentSubmitted $as) {\n Messages::where('id', $as->message_id)->delete();\n }", "private function createDeleteForm(Survey $survey) {\n return $this->createFormBuilder(array(), array('csrf_token_id' => 'authenticate'))\n ->setAction($this->generateUrl('survey_delete', array('id' => $survey->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy($id)\n {\n $element = Question::whereId($id)->with('surveys', 'answers', 'results')->first();\n if ($element) {\n if ($element->surveys->isNotEmpty()) {\n $element->surveys()->detach();\n }\n if ($element->results->isNotEmpty()) {\n foreach ($element->results as $r) {\n $r->question()->dissociate();\n $r->save();\n }\n }\n if ($element->answers->isNotEmpty()) {\n $element->answers()->detach();\n }\n $element->delete();\n return redirect()->route('backend.question.index')->with('success', 'question deleted');\n }\n return redirect()->route('backend.question.index')->with('error', 'question is not deleted');\n }", "public function deleteAll(Request $request)\n {\n if($request->ajax()){\n\n $data = $request->json()->all();\n \n if(is_array($data)){\n \n foreach($data as $key){\n $record = Appointment::find($key);\n if(!is_null($record)){\n $record->delete();\n }\n }\n $msg = 'Delete ' . count($data) . ' success!';\n \n return $this->respondWithMessage($msg);\n }\n else{\n return $this->respondWithError(ApiCode::ERROR_REQUEST, 402);\n }\n }\n }", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('id', '=',$id)->delete();\n }", "FUNCTION ServiceSurvey_remove_Survey( &$dbh,\n\t\t\t\t\t\t$aspid,\n\t\t\t\t\t\t$surveyid )\n\t{\n\t\tif ( ( $aspid == \"\" ) || ( $surveyid == \"\" ) )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$aspid = database_mysql_quote( $aspid ) ;\n\t\t$surveyid = database_mysql_quote( $surveyid ) ;\n\n\t\t$query = \"DELETE FROM chatsurveylogs WHERE aspID = $aspid AND surveyID = $surveyid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t$query = \"DELETE FROM chatsurveys WHERE aspID = $aspid AND surveyID = $surveyid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t$query = \"UPDATE chatrequestlogs SET surveyID = 0 WHERE surveyID = $surveyid AND aspID = $aspid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\treturn true ;\n\t\t}\n\n\t\treturn false ;\n\t}", "public function delete(){\n\t\t$this->feedbacks_model->delete();\n\t}", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('time_project_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = TimeProject::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->resolutionNum)\n continue;\n $resolution->resolutionNum--;\n $resolution->saveInfo();\n }\n // Delete subclauses\n foreach($this->preambulatory as $clause){\n $clause->delete();\n }\n foreach($this->operative as $clause){\n $clause->delete();\n }\n // Delete resolution\n mysql_query(\"DELETE FROM resolution_list WHERE id='$this->resolutionId'\") or die(mysql_error());\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reportKinds WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "function kilman_cleanup() {\n global $DB;\n\n // Find surveys that don't have kilmans associated with them.\n $sql = 'SELECT qs.* FROM {kilman_survey} qs '.\n 'LEFT JOIN {kilman} q ON q.sid = qs.id '.\n 'WHERE q.sid IS NULL';\n\n if ($surveys = $DB->get_records_sql($sql)) {\n foreach ($surveys as $survey) {\n kilman_delete_survey($survey->id, 0);\n }\n }\n // Find deleted questions and remove them from database (with their associated choices, etc.).\n return true;\n}", "public function removeBulk(Request $request)\n {\n $reviews_id_array = $request['id'];\n foreach ($reviews_id_array as $review_id)\n {\n $review = Review::find($review_id);\n $review->delete();\n }\n return response()->json('Data deleted successfully.');\n }", "function deleteAllRevisionsBySubmissionId($submissionId, $fileStage = null) {\n\t\treturn $this->_deleteInternally($submissionId, $fileStage);\n\t}", "public function massDestroy(Request $request)\n {\n if (!Gate::allows('quotation_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Quotation::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function testDeleteSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n $surveyGroupId = $surveyGroup->id;\n\n $response = $this->json('DELETE', \"survey-group/{$surveyGroupId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey_group', [ 'id' => $surveyGroupId ]);\n }", "public function destroy( Request $request, $id = null)\n {\n $pDelete = $request->get( '_permanent' ) == \"true\";\n $bundleDelete = $request->get( '_bundle' ) == \"true\";\n $Ids = $request->get( '_bundle_ids' );\n\n $Ids = explode( ',', urldecode( $Ids ) );\n\n if( !$bundleDelete ) {\n $Ids = [$id];\n }\n\n $question = $pDelete ? Question::whereIn( 'id', $Ids)->onlyTrashed( ) : Question::whereIn('id',$Ids)->withoutTrashed( );\n\n// dd( $question->get() );\n\n if ( $question->exists() ) {\n $deleted = 0;\n $this->set( 'data', $question->get() );\n\n if( $pDelete ) {\n if( QuestAssign::where( [ 'question_id' => $id ] )->exists() ) {\n return $this->setAndGetResponse( 'message', 'Quiz assigned with question!', 403 );\n }\n\n if( $deleted = $question->forceDelete() ) {\n $this->set('action', 'permanently-deleted');\n }\n }else {\n if( $deleted = $question->delete()) {\n $this->set('action', 'deleted');\n }\n }\n\n if( $deleted > 0){\n $this->set( 'delete_count', $deleted );\n return $this->setAndGetResponse('message', \"Question \" . ( $pDelete ? \" permanently \":\"\" ) . \"deleted\" );\n }\n }\n\n return $this->setAndGetResponse( 'message' , 'Question not found!', 404 );\n }", "function delete($id) {\r\n\t\treturn SurveyAnswerQuery::create()->filterByPrimaryKey($id)->delete() > 0;\r\n\t}", "public function delete_question($session_key, $sid, $gid, $qid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$sid = sanitize_int($sid);\n\t\t\t$gid = sanitize_int($gid);\n\t\t\t$qid = sanitize_int($qid);\t\t\t\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n \t\t \n\t\t\t$groupidExists = Groups::model()->findByAttributes(array('gid' => $gid));\n\t\t\tif (!isset($groupidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid groupid', 22);\n\n\t\t\t$questionidExists = Questions::model()->findByAttributes(array('qid' => $qid));\n\t\t\tif (!isset($questionidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid questionid', 22);\n\t\t\n\t\t\tif($surveyidExists['active']=='Y')\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey is active and not editable', 35);\t\n\t\t\t\t\t\t\t\n if (hasSurveyPermission($sid, 'surveycontent', 'delete'))\n {\n\t\t\t\t$ccresult = Conditions::model()->findAllByAttributes(array('cqid' => $qid));\n\t\t\t\tif(count($ccresult)>0)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Cannot delete Question. There are conditions for other questions that rely on this question ', 37);\n\t\t\t\t\n\t\t\t\t$row = Questions::model()->findByAttributes(array('qid' => $qid))->attributes;\n\t\t\t\tif ($row['gid']!=$gid)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Missmatch in groupid and questionid', 21);\t\n\n\t\t\t\tLimeExpressionManager::RevertUpgradeConditionsToRelevance(NULL,$qid);\n\n Conditions::model()->deleteAllByAttributes(array('qid' => $qid));\n Question_attributes::model()->deleteAllByAttributes(array('qid' => $qid));\n Answers::model()->deleteAllByAttributes(array('qid' => $qid));\n\n $criteria = new CDbCriteria;\n $criteria->addCondition('qid = :qid or parent_qid = :qid');\n $criteria->params[':qid'] = $qid;\n Questions::model()->deleteAll($criteria);\n\n Defaultvalues::model()->deleteAllByAttributes(array('qid' => $qid));\n Quota_members::model()->deleteAllByAttributes(array('qid' => $qid));\n Questions::updateSortOrder($gid, $sid);\n \n return \"Deleted \".$qid;\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\t\t\n\t}", "public function deleteAllReviews() {\n $deleteGenreQuery = $connection->prepare(\"DELETE FROM Reviews WHERE genreName=(?)\");\n $deleteGenreQuery->bind_param(\"s\",$genreName);\n $genreName=$this->get_genreName();\n $insertGenreQuery->execute();\n\n }", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('e_id', $id);\n $questions->delete();\n\n\n $exam=DB::table('exams')->where('e_id', $id);\n $exam->delete();\n return redirect('/dashboard')->with('success','Sucessfully Deleted Exam and their questions.');\n }", "public function deleteanswer(Request $request)\n\t{\n\t\t$ans = \\App\\Answer::destroy($request->input('id'));\n\t}", "public function deleteGroupQuestionsConnectionWithAnswer(){\n //Yii::app()->db->createCommand('DELETE FROM `tbl_link_group_questions_answers` WHERE `group_questions_id`=:group')->bindParam(\":group\",$this->id)->execute();\n Yii::app()->db->createCommand()->delete('tbl_templates_link_group_questions_answers', 'group_questions_id=:id', array(':id'=>$this->id));\n }", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Language::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function destroy(Submission $submission)\n {\n //\n }", "public function delete(){\r\n $rsid_array = $this -> uri -> segment_array();\r\n\r\n foreach ($rsid_array as $key => $value) {\r\n \r\n //If the key is greater than 2 i.e is one of the the ids\r\n if ($key > 2) {\r\n\r\n //Run delete\r\n $this -> db -> delete('refSubs', array('id' => $value));\r\n\r\n } \r\n }\r\n\r\n }", "function deleteBySubmissionId($submissionId) {\n\t\t$returner = false;\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT review_id FROM review_assignments WHERE submission_id = ?',\n\t\t\tarray((int) $submissionId)\n\t\t);\n\n\t\twhile (!$result->EOF) {\n\t\t\t$row = $result->GetRowAssoc(false);\n\t\t\t$reviewId = $row['review_id'];\n\n\t\t\t$this->update('DELETE FROM review_form_responses WHERE review_id = ?', $reviewId);\n\t\t\t$this->update('DELETE FROM review_assignments WHERE review_id = ?', $reviewId);\n\n\t\t\t$result->MoveNext();\n\t\t\t$returner = true;\n\t\t}\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "function delete_all()\n {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->procedure = 'POST_DELETE';\n\n\n /*if ($_SERVER['REQUEST_METHOD'] == 'POST') {*/\n for ($i = 0; $i < count($this->p_delete); $i++) {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->delete($this->p_delete[$i]);\n //Modules::run('admin/Post_Categories/delete', $this->p_delete[$i]);\n }\n\n /* } else {\n redirect('admin/Posts/display_cat');\n }\n redirect('admin/Posts/display_cat');*/\n }", "public function delete() {\n global $DB;\n foreach ($this->targets as $target) {\n $DB->delete_records('progressreview_tutor', array('id' => $target->id));\n }\n }", "public function destroy(Answers $answers)\n {\n //\n }", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "public function massDestroy(Request $request)\n {\n if (!Gate::allows('testimonials_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = DB::table('testimonials')->whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function destroy(Exam $exam)\n {\n foreach ($exam->questions()->orderBy('order')->get() as $Q) {\n\n $exam->questions()->detach([$Q->id_Question]);\n }\n $exam->delete();\n return redirect('/teacher/exams');\n }", "public function destroy($id)\n {\n $survey = Survey::findOrFail($id);\n $survey->delete();\n $msg = 'Deleted successfully';\n Session::set('massage',$msg);\n return redirect()->action('SurveyController@index');\n }", "function removequestion($sq_id, $survey_id, $question_id)\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t// move question to bottom of survey list so deletion can be done\r\n\t\t// without affecting the number order\r\n\t\t$this->SurveyQuestion->moveQuestion($survey_id, $question_id, \"BOTTOM\");\r\n\r\n\t\t// remove the question from the survey association as well as all other\r\n\t\t// references to the question in the responses and questions tables\r\n\t\t$this->SurveyQuestion->del($sq_id);\r\n\t\t//$this->Question->editCleanUp($question_id);\r\n\r\n\t\t$this->set('message', 'The question was removed successfully.');\r\n\t\t$this->set('survey_id', $survey_id);\r\n\r\n\t\t$this->questionssummary($survey_id, $question_id);\r\n\t\t//$this->render('index');\r\n\t}", "public function deleteAll(): void;", "public function deleteUnfinalizedSubmissions($form_id, $delete_all = false)\n {\n $db = Core::$db;\n\n if (!Forms::checkFormExists($form_id)) {\n return self::processError(650);\n }\n\n $time_clause = (!$delete_all) ? \"AND DATE_ADD(submission_date, INTERVAL 2 HOUR) < curdate()\" : \"\";\n $db->query(\"\n SELECT *\n FROM {PREFIX}form_{$form_id}\n WHERE is_finalized = 'no'\n $time_clause\n \");\n $db->execute();\n $submissions = $db->fetchAll();\n\n $num_rows = $db->numRows();\n if ($num_rows == 0) {\n return 0;\n }\n\n // find out which of this form are file fields\n $form_fields = Fields::getFormFields($form_id);\n $file_type_id = FieldTypes::getFieldTypeIdByIdentifier(\"file\");\n\n $file_field_info = array(); // a hash of col_name => file upload dir\n foreach ($form_fields as $field_info) {\n if ($field_info[\"field_type_id\"] == $file_type_id) {\n $field_id = $field_info[\"field_id\"];\n $col_name = $field_info[\"col_name\"];\n $field_settings = Fields::getFieldSettings($field_id);\n $file_field_info[$col_name] = $field_settings[\"folder_path\"];\n }\n }\n\n // now delete the info\n foreach ($submissions as $submission_info) {\n $submission_id = $submission_info[\"submission_id\"];\n\n // delete any files associated with the submission\n foreach ($file_field_info as $col_name => $file_upload_dir) {\n if (!empty($submission_info[$col_name])) {\n @unlink(\"{$file_upload_dir}/{$submission_info[$col_name]}\");\n }\n }\n\n $db->query(\"DELETE FROM {PREFIX}form_{$form_id} WHERE submission_id = :submission_id\");\n $db->bind(\"submission_id\", $submission_id);\n $db->execute();\n }\n\n return $num_rows;\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('hargajual_view')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = hargajual::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "function ipal_clear_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\t\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n}", "public function destroy($id)\n {\n try{\n $survey = Survey::find($id);\n $survey->delete();\n return json_encode(array('status' => 1, 'message' => \"Survey Deleted\"));\n }catch(Exception $e){\n return json_encode(array('status' => 0, 'message' => $e->getMessage()));\n }\n }", "public function deleteAll()\n {\n $this->record->entries()->delete();\n $this->record->status = 'pending';\n $this->record->is_opened = 'false';\n $this->is_finished = false;\n $this->is_current = false;\n\n return $this->buildResponse();\n }", "public function destroy()\n {\n $posts = Post::where('published', 0)->get();\n\n foreach ($posts as $post) {\n $post->subscriptions->each(function ($subscription) {\n $subscription->delete();\n });\n }\n\n return redirect(route('admin.subscription.index'));\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "public function actionDelete($survey_id, $vote_id)\n {\n $this->findModel($vote_id)->delete();\n\n return $this->redirect(['survey/view', 'id'=>$survey_id]);\n }", "abstract public function deleteAll();", "public function testDeleteSurveyQuestion0()\n {\n }", "public function testDeleteSurveyQuestion0()\n {\n }", "public function destroy($id)\n {\n QuestField::where('questID', $id)->delete();\n Quest::destroy($id);\n $dialog = Dialog::where('questID', $id)->first();\n\n if ($dialog) {\n\n DialogDescription::where('dialogID', $dialog->ID)->delete();\n $dialog->delete();\n }\n\n\n $questdescriptions = QuestDescription::where('questID', $id)->get();\n\n foreach ($questdescriptions as $one) {\n\n $description = Description::where('key', $one->textKey)->first();\n if ($description) {\n\n DescriptionLocalization::where('descriptionID', $description->ID)->delete();\n $description->delete();\n }\n\n }\n QuestDescription::where('questID', $id)->delete();\n\n return redirect('quests' . getQueryParams(request()))->with('flash_message', 'Quest deleted!');\n }", "public function resetSurveysAndPollsAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id'));\n\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE user_id = ?\", $this->user_id);\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function deleteSurveyCode($survey_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (strlen($survey_code) > 0)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s AND survey_key = %s\",\n\t\t\t\tarray('integer', 'text'),\n\t\t\t\tarray($this->getSurveyId(), $survey_code)\n\t\t\t);\n\t\t}\n\t}", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('posts.index');\n }\n }", "public function delete_all()\n {\n }", "public function destroy($id)\n {\n $inquiry = Inquiry::find($id);\n $inquiry->delete();\n return redirect('submissions');\n }", "public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "function deleteSubmission(&$args, &$request) {\n\t\t//FIXME: Implement\n\n\t\treturn false;\n\t}" ]
[ "0.67710656", "0.65085137", "0.65076256", "0.6371583", "0.6282924", "0.62668693", "0.61472", "0.61339176", "0.6004049", "0.5990968", "0.59772944", "0.59734684", "0.5972448", "0.5812081", "0.5793504", "0.57799935", "0.57547843", "0.5746567", "0.57342863", "0.573265", "0.57054245", "0.56958246", "0.5679387", "0.56751007", "0.5667873", "0.5639087", "0.56370187", "0.56327224", "0.56264246", "0.56222826", "0.5613404", "0.5602283", "0.5588594", "0.5584511", "0.5584511", "0.5584511", "0.5581228", "0.55794156", "0.55595434", "0.5554631", "0.5541546", "0.55276614", "0.5526696", "0.55200785", "0.55200267", "0.55157316", "0.5494627", "0.5485547", "0.54818225", "0.5476454", "0.5473213", "0.5473213", "0.54563016", "0.5454198", "0.5451594", "0.5443745", "0.5441217", "0.54307216", "0.54295653", "0.54259485", "0.5424269", "0.5414023", "0.54109836", "0.5409422", "0.54080045", "0.54063445", "0.5404755", "0.53920054", "0.5386078", "0.5384575", "0.5380577", "0.5374424", "0.53737396", "0.53716564", "0.5352679", "0.5351235", "0.5350837", "0.53482556", "0.534647", "0.5338711", "0.5329358", "0.5327176", "0.5324297", "0.53224415", "0.5320518", "0.5309946", "0.5302909", "0.5301034", "0.53008884", "0.53008884", "0.5298537", "0.5297137", "0.52932173", "0.5290976", "0.52889407", "0.52840525", "0.52831113", "0.52808833", "0.5277553", "0.5275808" ]
0.6699532
1
Update a previously created survey
public function update_submission($hash, $data, $current_page = 0, $complete = FALSE) { // Get previously created survey submission $query = $this->db->where('hash', $hash)->limit(1)->get('vwm_surveys_submissions'); // Make sure that this submission exists if ($query->num_rows() > 0) { $row = $query->row(); // Combine old and new submission data $previous_data = json_decode($row->data, TRUE); $new_data = $previous_data; foreach($data as $question_id => $question_data) { $new_data[ $question_id ] = $question_data; } $new_data = json_encode($new_data); $data = array( 'data' => $new_data, 'updated' => time(), 'completed' => $complete ? time() : NULL, 'current_page' => $current_page, ); $this->db ->where('hash', $hash) ->update('vwm_surveys_submissions', $data); return $this->db->affected_rows() > 0 ? TRUE : FALSE; } // If this submission does not exist else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateSurvey()\n {\n $survey = Survey::factory()->create();\n\n $response = $this->json('PATCH', \"survey/{$survey->id}\", [\n 'survey' => ['epilogue' => 'epilogue your behind']\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', ['id' => $survey->id, 'epilogue' => 'epilogue your behind']);\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function update(Request $request, Survey $survey)\n {\n //\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function Update()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$user = GetUser();\n\t\t$userid = $user->userid;\n\t\t$where = 'id = ' . $this->id;\n\n\t\t$surveys_data = $this->data;\n\n\t\tif (isset($surveys_data['_columns'])) {\n\t\t\tunset($surveys_data['_columns']);\n\t\t}\n\n\t\tif (isset($surveys_data['id'])) {\n\t\t\tunset($surveys_data['id']);\n\t\t}\n\n\t\t$surveys_data['updated'] = $this->GetServerTime();\n\n\t\t$this->Db->UpdateQuery('surveys', $surveys_data, $where);\n\t}", "public function update(Request $request, ClientSurvey $clientSurvey)\n {\n //\n }", "public function actionUpdate($id)\n {\n $survey = $this->findModel($id);\n\n $fractal = new Fractal\\Manager();\n $fractal->setSerializer(new ArraySerializer());\n\n $questionItems = new Fractal\\Resource\\Collection($survey->questions, function (Question $q) {\n return [\n 'title' => $q->title,\n 'required' => $q->required,\n 'position' => $q->position,\n 'uuid' => $q->uuid,\n 'type' => $q->type,\n 'meta' => json_decode($q->meta),\n 'survey_id' => $q->survey_id\n ];\n });\n\n $surveyItem = new Fractal\\Resource\\Item($survey, function (Survey $survey) use ($fractal, $questionItems) {\n return [\n 'title' => $survey->title,\n 'desc' => $survey->desc,\n 'emails' => implode(', ', ArrayHelper::getColumn($survey->participants, 'email')),\n 'startDate' => (new \\DateTime($survey->startDate))->format(\"Y-m-d\"),\n 'sendDate' => (new \\DateTime($survey->sendDate))->format(\"Y-m-d\"),\n 'expireDate' => (new \\DateTime($survey->expireDate))->format(\"Y-m-d\"),\n 'questions' => $fractal->createData($questionItems)->toArray()\n ];\n });\n\n\n Yii::$app->gon->send('survey', $fractal->createData($surveyItem)->toArray());\n Yii::$app->gon->send('saveSurveyUrl', Url::to(['/survey/save-update', 'id' => $id]));\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n return $this->render('update', [\n 'model' => $survey,\n ]);\n\n }", "public function updateQ(){\n\t\t$action = $this->input->post('q');\n\t\t$where \t= array(\n\t\t\t'id'\t\t => $this->input->post('idQ'),\n\t\t\t// 'survey' => $this->input->post('id'),\n\t\t\t// 'page'\t => $this->input->post('idPage')\n\t\t);\n\t\t\n\t\tif ($action == \"create\") {\n\t\t\t$data = array(\n\t\t\t\t'survey' => $this->input->post('id'),\n\t\t\t\t'page'\t => $this->input->post('idPage'),\n\t\t\t\t'title'\t\t\t=> $this->input->post('titleQ'),\n\t\t\t\t'desc'\t\t\t=> $this->input->post('textQ'),\n\t\t\t\t'type'\t\t\t=> $this->input->post('typeAns'),\n\t\t\t\t'req'\t\t\t => $this->input->post('reqQ'),\n\t\t\t\t'cat_risk'\t\t\t => $this->input->post('cat_risk'),\n\t\t\t);\n\t\t\tif ($this->MstSurveyModel->insert($this->tables[2], $data)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}else{\n\t\t\t$data = array(\n\t\t\t\t'title'\t\t\t=> $this->input->post('titleQ'),\n\t\t\t\t'desc'\t\t\t=> $this->input->post('textQ'),\n\t\t\t\t'type'\t\t\t=> $this->input->post('typeAns'),\n\t\t\t\t'req'\t\t\t\t=> $this->input->post('reqQ'),\n\t\t\t\t'cat_risk'\t\t\t => $this->input->post('cat_risk'),\n\t\t\t);\n\t\t\t// print_r($data);exit();\n\t\t\tif ($this->MstSurveyModel->update($this->tables[2], $data, $where)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "public function survey_update(Request $request )\n\t {\n\n\t \t\t// $ssdata =\tjson_decode($request->settings,true);\n\t \t\t// dump($ssdata);\n\t \t\t// die;\n\t try{\n\t \tDB::beginTransaction();\n\t Surrvey::findORfail($request->id);\n\t \t$status = \"0\";\n\t if($request->enableDisable==\"true\")\n\t {\n\t \t$status = \"1\";\n\t }\n\t $array = array(\n\t \t\t'name'\t\t\t=>\t$request->name,\n\t \t\t'description'\t=>\t$request->description,\n\t \t\t'status'\t\t=>\t$status\n\t \t);\n\t Surrvey::where('id',$request->id)->update(['name'=>$request->name, 'description'=>$request->description,'status'=>$status]);\n\t $ssetting = SSETTING::where('survey_id',$request->id);\n\t \tif($ssetting->count() > 0){\n\t \t\t$ssetting->forceDelete();\n\t \t}\n\t \t$sid = $request->id;\n\t\t \t$ssdata =\tjson_decode($request->settings,true);\n\t\t \t$this->setting_save($ssdata, $sid);\n\n\t\t DB::commit();\t\t\n \treturn ['status'=>'success', 'response'=>'successfully updated surrvey'];\n\t }catch(\\Exception $e)\n\t {\n\t \tDB::rollback();\n\t \tthrow $e;\n\t \treturn ['status'=>'success', 'response'=>'Something goes wrong Try Again'];\n\t }\n\t }", "public function update()\n {\n $data = Input::all();\n foreach (array_combine($data['question_id'], $data['question_name']) as $question_id => $question_name) {\n $question = Question::find($question_id);\n $question->question_name = $question_name;\n $question->save();\n }\n\n Flash::success('The question has been successfully updated!');\n return Redirect::action('AnswerController@edit', $question->exam_id);\n }", "public function updateSurvey(){\n\t\t// echo $this->session->userdata('id_users');exit();\n\t\tdate_default_timezone_set('Asia/Jakarta');\n\t\t$action = $this->input->post('action');\n\t\t$where \t= array(\n\t\t\t'id'\t=> $this->input->post('id')\n\t\t);\n\t\t$data = array(\n\t\t\t'title'\t\t\t=> $this->input->post('title'),\n\t\t\t// 'date' \t\t\t=> $this->dmys2ymd(date(\"y/m/d\")),\n\t\t\t'date' \t\t\t=> date('Y-m-d'),\n\t\t\t'beginDate' => $this->checkDate($this->input->post('surveyBegin')),\n\t\t\t'endDate' \t=> $this->checkDate($this->input->post('surveyEnd')),\n\t\t\t'category'\t\t\t\t=> $this->input->post('category'),\n\t\t\t'url'\t\t\t\t=> $this->input->post('url'),\n\t\t\t'target'\t\t=> $this->input->post('target'),\n\t\t\t'id_user'\t=> $this->session->userdata('id_users')\n\t\t);\n\n\t\tif ($action == \"create\") {\n\t\t\t$checkSurvey = $this->MstSurveyModel->checkSurvey($this->input->post('title'));\n\t\t\tif($checkSurvey->title > 0) $response = \"duplicate\";\n\t\t\telse{\n\t\t\t\t#cek mak survey\n\t\t\t\t$usr_lvl = $this->MstSurveyModel->cek_level($this->session->userdata('id_user_level'));\n\t\t\t\tif($usr_lvl->max_survey > 0){\n\t\t\t\t\t#cek survey bulan ini\n\t\t\t\t\t$svy = $this->MstSurveyModel->cek_survey_bln($this->session->userdata('id_users'),date('Y-m'));\n\t\t\t\t\t#jika jumlah survey belum lewat batas maksimal\n\t\t\t\t\tif($svy->jml_d < $usr_lvl->max_survey){\n\t\t\t\t\t\tif ($this->MstSurveyModel->insert($this->tableSurveys, $data)) {\n\t\t\t\t\t\t\t$response = \"success\";\n\t\t\t\t\t\t}else $response = \"failed\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$response = \"failed\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif ($this->MstSurveyModel->insert($this->tableSurveys, $data)) {\n\t\t\t\t\t\t$response = \"success\";\n\t\t\t\t\t}else $response = \"failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tif ($this->MstSurveyModel->update($this->tableSurveys, $data, $where)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "function edit($id = null) {\n if (is_null($id) && !empty($this->request->data)) { // check for an id as long as no form data has been submitted\n $this->Session->setFlash('Invalid survey', true, null, 'error'); // display an error when no valid survey id is given\n $this->redirect(array('action' => 'index')); // return to the index view\n }\n if (!empty($this->request->data)) { // check to see if form data has been submitted\n // first assemble the complete survey data including information from the edit session values\n if ($this->Session->check('SurveyQuestion.new')) { // check for a session for the survey questions\n $tempQuestions = $this->Session->read('SurveyQuestion.new'); // retrieve the questions that have been stored in the session\n //go through each question and set its order value to the same as the current index in the array\n foreach ($tempQuestions as $index => &$quest) {\n $quest['order'] = $index;\n }\n $this->request->data['Question'] = $tempQuestions; // update the form data with the current questions\n }\n if ($this->Session->check('SurveyRespondent.new')) { // check the session for the respondents\n $this->request->data['Respondent'] = $this->Session->read('SurveyRespondent.new'); // update the form data with the current respondents\n }\n $delrespondent = null; // variable to hold respondents to delete (database records only)\n if ($this->Session->check('SurveyRespondent.delete')) { // check the session for respondents to delete\n $delrespondent = $this->Session->read('SurveyRespondent.delete'); // retrieve the respondents to delete\n }\n $delquestion = null; // variable to hold questions to delete (database records only)\n if ($this->Session->check('SurveyQuestion.delete')) { // check the session for questions to delete\n $delquestion = $this->Session->read('SurveyQuestion.delete'); // retrieve the questions to delete\n }\n // now save the survey and return the results\n $errReturn = $this->Survey->complexSave($this->request->data, $delquestion, $delrespondent); // save the combined data, including deletion of survey and respondents that have been dropped\n if (is_null($errReturn)) { // if no errors are returned\n $this->__clearEditSession(); // empty the session variables used for the edit session now that it is complete\n $this->Session->setFlash('The survey has been saved', true, null, 'confirm'); // send a confirmation message that the survey was saved\n $this->redirect(array('action' => 'index')); // redirect to the index view\n } else {\n $this->Session->setFlash($errReturn['message'], true, null, $errReturn['type']); // send error messages received from the model during the save to the view for display\n }\n } else { // if there is no form data, and therefore the edit session is just starting\n $this->Survey->contain(array('Question' => 'Choice', 'Respondent' => 'Response'));\n $this->request->data = $this->Survey->findById($id); // find the survey being edited\n if(!$this->request->data) {\n $this->Session->setFlash('Invalid ID for survey.', true, null, 'error'); // send an error message\n $this->redirect(array('action' => 'index')); // redirect to the index view\n }\n $this->__clearEditSession(); // make sure the session edit variables are empty\n $this->Session->write('Survey.id', $id); // put the survey id in to the session\n $this->Session->write('SurveyQuestion.new', $this->request->data['Question']); // put the original survey questions in to the session\n $this->Session->write('SurveyRespondent.new', $this->request->data['Respondent']); // put the original survey respondents in to the session\n }\n }", "public function updated(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "function questionnaire_update_instance($questionnaire) {\n global $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if its set.\n if (!empty($questionnaire->sid) && !empty($questionnaire->realm)) {\n $DB->set_field('questionnaire_survey', 'realm', $questionnaire->realm, array('id' => $questionnaire->sid));\n }\n\n $questionnaire->timemodified = time();\n $questionnaire->id = $questionnaire->instance;\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n // Get existing grade item.\n questionnaire_grade_item_update($questionnaire);\n\n questionnaire_set_events($questionnaire);\n\n return $DB->update_record(\"questionnaire\", $questionnaire);\n}", "public function edit(Survey $survey)\n {\n //\n }", "function reeditSurvey() {\n $this->layout = 'survey'; // use the more basic survey layout\n $this->Session->write('Survey.progress', GDTA_ENTRY); // change the progress back to GDTA entry\n $this->redirect(array('action' => 'enterGdta'));\n }", "public function update(Request $request, $id)\n {\n $question = Question::findOrFail($id);\n $question->question = $request->get('question');\n $question->save();\n $question->answers()->delete();\n foreach($request->get('choice') as $key => $choice){\n $answer = new Answer();\n $answer->type=\"string\";\n $answer->textual= $choice;\n $answer->correct= in_array($key+1,$request->get('answer')) <=> 0;\n $answer->question()->associate($question);\n $answer->save();\n }\n return redirect()->to(route(\"paper.edit\",$question->paper->id));\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "public function update(Request $request, $id)\n {\n $data = $this->validateForm($request);\n\n $question = Question::find($id);\n $question->question = $data['question'];\n $question->quiz_id = $data['quiz_id'];\n $question->update();\n\n $this->deleteAnswer($question->id);\n\n foreach($data['options'] as $key=>$option){\n $is_correct = false;\n if($key == $data['correct_answer']){\n $is_correct = true;\n }\n $answer = Answer::create([\n 'question_id' => $question->id,\n 'answer' => $option,\n 'is_correct' => $is_correct\n ]);\n }\n return redirect()->route('question.show', $id)->with('message', 'Question updated successfully');\n }", "public function update(ExamQuestionRequest $request, $id, $question_id)\n {\n //\n try{\n $question = Question::find($question_id);\n $question->question = $request->question;\n $question->type = $request->q_type;\n $question->sol = $request->co;\n $question->save();\n\n\n $x = $request->q_type == 0 ? 4 : 2 ;\n $answers = Answer::where('question_id',$question_id)->take($x)->get();\n foreach($answers as $i => $answer){\n $answer->answer = $request->a[$i];\n $answer->true = $i == $request->co ? 1 : 0 ;\n $answer->save();\n }\n\n } catch(Exception $e) {\n return redirect()->back()->with([\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.question_failed_updated'),\n ]]);\n }\n return redirect('admin/exam/'.$id.'/questions')->with([\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.updated successfully'),\n ]]);\n }", "public function update(Request $request, $id)\n {\n // the form sends the request\n // the id indicates which question to update\n \n // store\n //echo $request;\n if($request->type == 'single' || $request->type == 'multi-value')\n {\n $question = Question::find($id);\n $question->prompt = $request->input('prompt'); // works! \n \n // what happens if we leave it unselected? \n // nice, doesn't change it if nothing selected\n // I think it has the previous selected\n $question->difficulty = $request->input('difficulty'); // works!\n $question->total_score = $request->input('total_score'); // works!\n \n $question->save();\n \n // detach all answers from the question\n // attach the newly created ones from the form; overwrites. \n \n $question->answers()->detach(); // detach all answers from question\n \n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n \n // question now has the new answers attached to it. \n \n \n // need this line or else it redirects to the non-GET URL\n // it has a PUT request instead, so nothing displays\n // because there is no view associated with a PUT\n // YES IT WORKS\n // THAT IS WHAt I AM TALKING ABOUT\n }\n elseif($request->type == 'true-false')\n {\n $question = Question::find($id);\n $question->prompt = $request->input('prompt'); // works! \n $question->difficulty = $request->input('difficulty'); // works!\n $question->total_score = $request->input('total_score'); // works!\n $question->type = 'true-false';\n $question->save();\n \n // detach all answers from the question\n // attach the newly created ones from the form; overwrites. \n \n $question->answers()->detach(); // detach all answers from question\n \n $a1 = new Answer;\n $a2 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n \n $a1->save();\n $a2->save();\n \n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n }\n elseif($request->type == 'free-response')\n {\n $question = Question::find($id);\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->subject_id = 1;\n $question->type = 'free-response';\n $question->total_score = $request->total_score;\n $question->save();\n \n $question->answers()->detach();\n \n $a1 = new Answer;\n $a1->text = $request->choice1;\n $a1->save();\n $question->answers()->attach($a1->id, array('is_correct' => 0));\n }\n else\n {\n echo \"Nothing worked!\";\n }\n \n return view('question.show', ['question' => $question]);\n \n }", "public function update($data)\n {\n $this->db->where('user_id',$data['id']);\n return $this->db->update('user_survey_answer',$data);\n }", "public function update(Request $request, $id){\n $question = Question::find($id);\n $question->question_name = $request->input('q_name');\n $question->question_type = $request->input('q_type');\n $question->choices = $request->input('choices');\n $question->answer = $request->input('q_ans');\n $question->points = $request->input('q_point');\n $question->save();\n }", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function testUpdateSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n\n $response = $this->json('PATCH', \"survey-group/{$surveyGroup->id}\", [\n 'survey_group' => [ 'title' => 'Fork Your Survey' ]\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey_group', [ 'id' => $surveyGroup->id, 'title' => 'Fork Your Survey' ]);\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function update(Request $request, Survey $survey)\n {\n if (Survey::isRunning($survey->uuid) === Survey::ERR_IS_RUNNING_SURVEY_OK) {\n $request->session()->flash('warning', 'Survey \"' . $survey->uuid . '\" cannot be updated because it is being run.');\n\n return redirect()->route('survey.edit', $survey->uuid);\n }\n\n $this->validateSurvey($request);\n\n $survey = Survey::getByOwner($survey->uuid, $request->user()->id);\n\n if (!$survey) {\n $request->session()->flash('warning', 'Survey \"' . $survey->uuid . '\" not found.');\n\n return redirect()->route('surveys');\n }\n\n $survey->name = $request->input('name');\n $survey->description = $request->input('description');\n $survey->save();\n $request->session()->flash('success', 'Survey ' . $survey->uuid . ' successfully updated!');\n\n return redirect()->route('surveys.show', $survey->id);\n }", "public function update(Request $request)\n { \n $question = Question::where('question_id', $request -> question_id) -> first();\n $question -> worksheet_id = $request -> worksheet_name;\n $question -> animal_id = $request -> animal_name;\n\n if($request -> description == null) {\n $question -> description_id = $request -> existDesc;\n } else {\n $description = new Question_description;\n $description -> description = $request -> description;\n $description -> save();\n $descriptionId = Question_description::where('description', $request -> description) \n -> first();\n $question -> description_id = $descriptionId -> description_id;\n }\n\n $question -> question = $request -> question;\n $question -> answer = $request -> answer;\n $question -> save();\n\n $option = Question_option::where('question_id', $request -> question_id) -> delete();\n for ($i = 1; $i <= 4; $i++) { \n $qOption = \"qOption_\".$i;\n if($request -> $qOption == null)\n break;\n $newOption = new Question_option;\n $newOption -> question_id = $request -> question_id;\n $newOption -> option_id = $i;\n $newOption -> qOption = $request -> $qOption;\n $newOption -> save(); \n }\n \n Session::flash('success', 'this post was sucessfully saved');\n return redirect()->route('questionPosts.show', $request -> question_id); \n }", "public function update(Request $request, $id)\n {\n $user = User::find(Auth::id());\n $array = [];\n array_push($array, \"texto\");\n $ques = new answers_clinic_history;\n $ques->createdby = $user->id;\n $ques->question = 26;\n $ques->answer = json_encode($array);\n $ques->save();\n return redirect('medicalconsultations');\n }", "public function update(Request $request, $id)\n {\n $question= TrialTest::find($id);\n $question->question = $request->input('question');\n $question->answer = $request->input('answer');\n $question->unit =$request->input('unit');\n $question->save();\n return redirect()->back()->with('success','question updated');\n }", "public function update(Quiz $quiz): void\n {\n }", "function saveQuestionsToDb() \n\t{\n\t\tglobal $ilDB;\n\t\t// save old questions state\n\t\t$old_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$old_questions[$row[\"question_fi\"]] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete existing question relations\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t// create new question relations\n\t\tforeach ($this->questions as $key => $value) \n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value][\"heading\"])) ? $old_questions[$value][\"heading\"] : NULL, $key, time())\n\t\t\t);\n\t\t}\n\t}", "public function SurveyReadStatusUpdate() {\n $user = $this->auth();\n if (empty($user)) {\n Utils::response(['status' => false, 'message' => 'Forbidden access.'], 403);\n }\n $input = $this->getInput();\n if (($this->input->method() != 'post') || empty($input)) {\n Utils::response(['status' => false, 'message' => 'Bad request.'], 400);\n }\n $validate = [\n ['field' => 'push_survey_id', 'label' => 'Pushed Survey ID', 'rules' => 'required'],\n ];\n $errors = $this->ConsumerModel->validate($input, $validate);\n if (is_array($errors)) {\n Utils::response(['status' => false, 'message' => 'Validation errors.', 'errors' => $errors]);\n }\t\n\t\t$push_survey_id = $this->getInput('push_survey_id');\n\t\t$push_survey_idi = $push_survey_id['push_survey_id'];\n\t\t\n $this->db->set('media_play_date', date(\"Y-m-d H:i:s\")); \n $this->db->where('id', $push_survey_idi);\n if ($this->db->update('push_surveys')) {\n Utils::response(['status' => true, 'message' => 'Record updated.', 'data' => $input]);\n } else {\n Utils::response(['status' => false, 'message' => 'System failed to update.'], 200);\n }\n }", "public function update(Request $request, Exam $exam, TFQuestion $TFQuestion, SAQuestion $SAQuestion, MCQuestion $MCQuestion, MRQuestion $MRQuestion, Question $question)\n {\n\ndd($request->all());\n $exam_current = $request->id_Exam;\n $e = Exam::find($exam_current);\n $e->title = $request->title;\n $e->Description = $request->Description;\n\n foreach ($exam->questions()->orderBy('order')->get() as $Q) {\n $question = Question::find($Q->id_Question);\n if ($question->questiontable_type == \"TFQuestion\") {\n $TFQuestion = TFQuestion::find($Q->questiontable_id);\n $question->expression = request('expression' . $Q->id_Question);\n $TFQuestion->correct_answer = request('correct_answer' . $Q->id_Question);\n $TFQuestion->save();\n $time = request('estimated_time' . $Q->id_Question);\n $time = str_replace('H', '', $time);\n $time = str_replace('M', '', $time);\n $time = $time . ':00';\n $format = DateTime::createFromFormat('H:i:s', $time);\n $question->estimated_time = $format;\n $question->questiontable_id = $TFQuestion->id_t_f_questions;\n $question->questiontable_type = \"TFQuestion\";\n $question->save();\n $e->questions()->updateExistingPivot($question->id_Question, ['score' => request('score' . $Q->id_Question), 'order' => request('order' . $Q->id_Question)]);\n }\n if ($question->questiontable_type == \"MCQuestion\") {\n dd($request->all());\n $MCQuestion = MCQuestion::find($Q->questiontable_id);\n $question->expression = request('expression' . $Q->id_Question);\n $MCQuestion->correct_answer = request('correct_answer' . $Q->id_Question);\n $MCQuestion->save();\n $time = request('estimated_time' . $Q->id_Question);\n $time = str_replace('H', '', $time);\n $time = str_replace('M', '', $time);\n $time = $time . ':00';\n $format = DateTime::createFromFormat('H:i:s', $time);\n $question->estimated_time = $format;\n $question->questiontable_id = $MCQuestion->id_m_c_questions;\n $question->questiontable_type = \"MCQuestion\";\n $question->save();\n $MCQuestion->choices()->delete();\n $choices = [];\n foreach (request('choice' . $Q->id_Question) as $ch) {\n $choix = new MCChoice();\n $choix->choice = $ch;\n $choices[] = $choix;\n }\n $MCQuestion->choices()->saveMany($choices);\n $e->questions()->updateExistingPivot($question->id_Question, ['score' => request('score' . $Q->id_Question), 'order' => request('order' . $Q->id_Question)]);\n }\n if ($question->questiontable_type == \"SAQuestion\") {\n $SAQuestion = SAQuestion::find($Q->questiontable_id);\n $question->expression = request('expression' . $Q->id_Question);\n\n $SAQuestion->save();\n $time = request('estimated_time' . $Q->id_Question);\n $time = str_replace('H', '', $time);\n $time = str_replace('M', '', $time);\n $time = $time . ':00';\n $format = DateTime::createFromFormat('H:i:s', $time);\n $question->estimated_time = $format;\n $question->questiontable_id = $SAQuestion->id_s_a_questions;\n $question->questiontable_type = \"SAQuestion\";\n $question->save();\n $SAQuestion->choices()->delete();\n $choices = [];\n foreach (request('choice' . $Q->id_Question) as $ch) {\n $choix = new SAChoice();\n $choix->choice = $ch;\n $choices[] = $choix;\n }\n $SAQuestion->choices()->saveMany($choices);\n $e->questions()->updateExistingPivot($question->id_Question, ['score' => request('score' . $Q->id_Question), 'order' => request('order' . $Q->id_Question)]);\n }\n if ($question->questiontable_type == \"MRQuestion\") {\n $MRQuestion = MRQuestion::find($Q->questiontable_id);\n $question->expression = request('expression' . $Q->id_Question);\n $MRQuestion->save();\n $time = request('estimated_time' . $Q->id_Question);\n $time = str_replace('H', '', $time);\n $time = str_replace('M', '', $time);\n $time = $time . ':00';\n $format = DateTime::createFromFormat('H:i:s', $time);\n $question->estimated_time = $format;\n $question->questiontable_id = $MRQuestion->id_m_r_questions;\n $question->questiontable_type = \"MRQuestion\";\n $question->save();\n $MRQuestion->choices()->delete();\n $choices = [];\n $coc = 0;\n $coidc = 0;\n while ($coidc < count(request('is_correct' . $Q->id_Question))) {\n $choix = new MRChoice();\n $ch = request('choice' . $Q->id_Question)[$coc];\n $isc = request('is_correct' . $Q->id_Question)[$coidc];\n $choix->choice = $ch;\n $choix->is_correct = $isc;\n $choices[] = $choix;\n if ($isc == 1) {\n $coidc++;\n }\n $coc++;\n $coidc++;\n }\n $MRQuestion->choices()->saveMany($choices);\n $e->questions()->updateExistingPivot($question->id_Question, ['score' => request('score' . $Q->id_Question), 'order' => request('order' . $Q->id_Question)]);\n }\n }\n $e->save();\n $qcount = count($e->questions);\n $tfq = 0;\n $mcq = 0;\n $mrq = 0;\n $saq = 0;\n $r = null;\n $c = 0;\n $m = 0;\n $r = 0;\n $d = null;\n foreach ($e->questions as $q) {\n if ($q->questiontable_type == \"TFQuestion\") {\n $tfq++;\n }\n if ($q->questiontable_type == \"MCQuestion\") {\n $mcq++;\n }\n if ($q->questiontable_type == \"MRQuestion\") {\n $mrq++;\n }\n }\n foreach ($e->students as $st) {\n if ($st->id_student != $r) {\n $c++;\n $r = $st->id_student;\n }\n if ($st->pivot->mark >= 10) {\n $m++;\n }\n if ($q->questiontable_type == \"SAQuestion\") {\n $saq++;\n }\n }\n foreach ($e->groupes as $gr) {\n\n $r += count($gr->students);\n $d = $gr->pivot->date_scheduling;\n }\n return view('teacher.exams.show')->with('exams', $e)->with('tfq', $tfq)->with('mrq', $mrq)->with('mcq', $mcq)->with('qcount', $qcount)\n ->with('tst', $c)->with('pst', $m)->with('saq', $saq)\n ->with('stn', $r - 1)->with('dsch', $d);\n }", "public function update(Request $request, $id)\n {\n\n $helper = new Helpers();\n try{\n $this->validate($request,[\n 'title_en' => 'required|max:500',\n 'title_ar' => 'required|max:500',\n ],[\n 'title_en.required' => 'Please enter title in english',\n 'title_ar.required' => 'Please enter title in arabic',\n ]);\n\n $survey = Survey::find($id);\n $survey->title_en = $request->title_en;\n $survey->title_ar = $request->title_ar;\n if(!empty($request->image1) && $request->image1 != null) {\n copy(base_path('/media/'.$request->image1),base_path('images/surveys/'.$request->image1));\n $survey->image = $request->image1;\n }\n $survey->save();\n return redirect('admin/survey')->with(\"message\",\"Survey Updated\")->with('alert-class', 'alert-success');\n }catch(Exception $e){\n return redirect('admin/survey')->with(\"message\",$e->getMessage())->with('alert-class', 'alert-danger');\n }\n }", "public function update(Request $request, question $question)\n {\n //\n }", "public function edit(ClientSurvey $clientSurvey)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n $exam_id = $request->input('exam_id');\n $q_id = $request->input('question_id');\n $q_answer = $request->input('question_answer');\n DB::table('exam_questions')->where(['exam_id' => $exam_id, 'question_id' => $q_id])\n ->update(['answer' => $q_answer]);\n\n if ($request->input('finsh_status') == 'true') {\n $exam_question = Exam_question::where('exam_id', $exam_id)->get();\n $total_right = 0;\n foreach ($exam_question as $q) {\n $assessment = Question::find($q->question_id);\n if ($q->answer == $assessment->rightanswer) {\n echo 'True';\n $total_right++;\n } else {\n echo 'false';\n }\n }\n $mytime = Carbon::now();\n $end_date = $mytime->toDateTimeString();\n $exam = Exam::find($exam_id);\n $exam->total_right = $total_right;\n $exam->end_date = $end_date;\n $exam->save();\n // print_r($exam_question);\n };\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'answer1' => 'required',\n 'answer2' => 'required',\n 'answer3' => 'required',\n 'answer4' => 'required',\n 'number' => 'required',\n ]);\n $questionnaire = Questionnaire::find($id);\n $questionnaire->answer1 = $request->get('answer1');\n $questionnaire->answer2 = $request->get('answer2');\n $questionnaire->answer3 = $request->get('answer3');\n $questionnaire->answer4 = $request->get('answer4');\n $questionnaire->number = $request->get('number');\n $questionnaire->save();\n return redirect()->route('questionnaire.index')->with('success', 'Data Updated');\n }", "public function update(Request $request, Question $question)\n {\n\n }", "private function actionUpdateQuestion($iSurveyID)\n {\n LimeExpressionManager::RevertUpgradeConditionsToRelevance($iSurveyID);\n\n $cqr = Question::model()->findByAttributes(array('qid'=>$this->iQuestionID));\n $oldtype = $cqr['type'];\n $oldgid = $cqr['gid'];\n\n $survey = Survey::model()->findByPk($iSurveyID);\n // If the survey is activate the question type may not be changed\n if ($survey->active !== 'N') {\n $sQuestionType = $oldtype;\n } else {\n $sQuestionType = Yii::app()->request->getPost('type');\n }\n\n\n // Remove invalid question attributes on saving\n $criteria = new CDbCriteria;\n $criteria->compare('qid', $this->iQuestionID);\n $validAttributes = \\LimeSurvey\\Helpers\\questionHelper::getQuestionAttributesSettings($sQuestionType);\n // If the question has a custom template, we first check if it provides custom attributes\n $oAttributeValues = QuestionAttribute::model()->find(\"qid=:qid and attribute='question_template'\", array('qid'=>$cqr->qid));\n if (is_object($oAttributeValues) && $oAttributeValues->value) {\n $aAttributeValues['question_template'] = $oAttributeValues->value;\n } else {\n $aAttributeValues['question_template'] = 'core';\n }\n $validAttributes = Question::getQuestionTemplateAttributes($validAttributes, $aAttributeValues, $cqr);\n foreach ($validAttributes as $validAttribute) {\n $criteria->compare('attribute', '<>'.$validAttribute['name']);\n }\n QuestionAttribute::model()->deleteAll($criteria);\n\n $aLanguages = array_merge(array(Survey::model()->findByPk($iSurveyID)->language), Survey::model()->findByPk($iSurveyID)->additionalLanguages);\n foreach ($validAttributes as $validAttribute) {\n /* Readonly attribute : disable save */\n if( $validAttribute['readonly'] || ( $validAttribute['readonly_when_active'] && Survey::model()->findByPk($iSurveyID)->getIsActive() ) ) {\n continue;\n }\n if ($validAttribute['i18n']) {\n /* Delete invalid language : not needed but cleaner */\n $langCriteria = new CDbCriteria;\n $langCriteria->compare('qid', $this->iQuestionID);\n $langCriteria->compare('attribute', $validAttribute['name']);\n $langCriteria->addNotInCondition('language', $aLanguages);\n QuestionAttribute::model()->deleteAll($langCriteria);\n /* delete IS NULL too*/\n QuestionAttribute::model()->deleteAll('attribute=:attribute AND qid=:qid AND language IS NULL', array(':attribute'=>$validAttribute['name'], ':qid'=>$this->iQuestionID));\n foreach ($aLanguages as $sLanguage) {\n // TODO sanitise XSS\n $value = Yii::app()->request->getPost($validAttribute['name'].'_'.$sLanguage);\n $iInsertCount = QuestionAttribute::model()->countByAttributes(array('attribute'=>$validAttribute['name'], 'qid'=>$this->iQuestionID, 'language'=>$sLanguage));\n if ($iInsertCount > 0) {\n if ($value != '') {\n QuestionAttribute::model()->updateAll(array('value'=>$value), 'attribute=:attribute AND qid=:qid AND language=:language', array(':attribute'=>$validAttribute['name'], ':qid'=>$this->iQuestionID, ':language'=>$sLanguage));\n } else {\n QuestionAttribute::model()->deleteAll('attribute=:attribute AND qid=:qid AND language=:language', array(':attribute'=>$validAttribute['name'], ':qid'=>$this->iQuestionID, ':language'=>$sLanguage));\n }\n } elseif ($value != '') {\n $attribute = new QuestionAttribute;\n $attribute->qid = $this->iQuestionID;\n $attribute->value = $value;\n $attribute->attribute = $validAttribute['name'];\n $attribute->language = $sLanguage;\n $attribute->save();\n }\n }\n } else {\n $default = isset($validAttribute['default']) ? $validAttribute['default'] : '';\n $value = Yii::app()->request->getPost($validAttribute['name'], $default);\n if ($validAttribute['name'] == \"slider_layout\") {\n tracevar(\"delete $value\");\n }\n /* we must have only one element, and this element must be null, then reset always (see #11980)*/\n /* We can update, but : this happen only for admin and not a lot, then : delete + add */\n QuestionAttribute::model()->deleteAll('attribute=:attribute AND qid=:qid', array(':attribute'=>$validAttribute['name'], ':qid'=>$this->iQuestionID));\n if ($value != $default) {\n if ($validAttribute['name'] == \"slider_layout\") {\n tracevar(\"save $value\");\n }\n $attribute = new QuestionAttribute;\n $attribute->qid = $this->iQuestionID;\n $attribute->value = $value;\n $attribute->attribute = $validAttribute['name'];\n $attribute->save();\n }\n }\n }\n\n $aQuestionTypeList = getQuestionTypeList('', 'array');\n // These are the questions types that have no answers and therefore we delete the answer in that case\n $iAnswerScales = $aQuestionTypeList[$sQuestionType]['answerscales'];\n $iSubquestionScales = $aQuestionTypeList[$sQuestionType]['subquestions'];\n\n // These are the questions types that have the other option therefore we set everything else to 'No Other'\n if (($sQuestionType != \"L\") && ($sQuestionType != \"!\") && ($sQuestionType != \"P\") && ($sQuestionType != \"M\")) {\n $_POST['other'] = 'N';\n }\n\n // These are the questions types that have no validation - so zap it accordingly\n\n if ($sQuestionType == \"!\" || $sQuestionType == \"L\" || $sQuestionType == \"M\" || $sQuestionType == \"P\" ||\n $sQuestionType == \"F\" || $sQuestionType == \"H\" ||\n $sQuestionType == \"X\" || $sQuestionType == \"\") {\n $_POST['preg'] = '';\n }\n\n\n // For Bootstrap Version usin YiiWheels switch :\n $_POST['mandatory'] = (Yii::app()->request->getPost('mandatory') == '1') ? 'Y' : 'N';\n $_POST['other'] = (Yii::app()->request->getPost('other') == '1') ? 'Y' : 'N';\n\n // These are the questions types that have no mandatory property - so zap it accordingly\n if ($sQuestionType == \"X\" || $sQuestionType == \"|\") {\n $_POST['mandatory'] = 'N';\n }\n\n\n if ($oldtype != $sQuestionType) {\n // TMSW Condition->Relevance: Do similar check via EM, but do allow such a change since will be easier to modify relevance\n //Make sure there are no conditions based on this question, since we are changing the type\n $ccresult = Condition::model()->findAllByAttributes(array('cqid'=>$this->iQuestionID));\n $cccount = count($ccresult);\n foreach ($ccresult as $ccr) {\n $qidarray[] = $ccr['qid'];\n }\n }\n if (isset($cccount) && $cccount) {\n Yii::app()->setFlashMessage(gT(\"Question could not be updated. There are conditions for other questions that rely on the answers to this question and changing the type will cause problems. You must delete these conditions before you can change the type of this question.\"), 'error');\n } else {\n if (isset($this->iQuestionGroupID) && $this->iQuestionGroupID != \"\") {\n\n // $array_result=checkMoveQuestionConstraintsForConditions(sanitize_int($surveyid),sanitize_int($qid), sanitize_int($gid));\n // // If there is no blocking conditions that could prevent this move\n //\n // if (is_null($array_result['notAbove']) && is_null($array_result['notBelow']))\n // {\n $aSurveyLanguages = Survey::model()->findByPk($iSurveyID)->additionalLanguages;\n $sBaseLanguage = Survey::model()->findByPk($iSurveyID)->language;\n array_push($aSurveyLanguages, $sBaseLanguage);\n foreach ($aSurveyLanguages as $qlang) {\n if (isset($qlang) && $qlang != \"\") {\n // &eacute; to é and &amp; to & : really needed ? Why not for answers ? (130307)\n $sQuestionText = Yii::app()->request->getPost('question_'.$qlang, '');\n $sQuestionHelp = Yii::app()->request->getPost('help_'.$qlang, '');\n // Fix bug with FCKEditor saving strange BR types : in rules ?\n $sQuestionText = $this->oFixCKeditor->fixCKeditor($sQuestionText);\n $sQuestionHelp = $this->oFixCKeditor->fixCKeditor($sQuestionHelp);\n $udata = array(\n 'type' => $sQuestionType,\n 'title' => Yii::app()->request->getPost('title'),\n 'question' => $sQuestionText,\n 'preg' => Yii::app()->request->getPost('preg'),\n 'help' => $sQuestionHelp,\n 'gid' => $this->iQuestionGroupID,\n 'other' => Yii::app()->request->getPost('other'),\n 'mandatory' => Yii::app()->request->getPost('mandatory'),\n 'relevance' => Yii::app()->request->getPost('relevance'),\n );\n\n // Update question module\n if (Yii::app()->request->getPost('module_name') != '') {\n // The question module is not empty. So it's an external question module.\n $udata['modulename'] = Yii::app()->request->getPost('module_name');\n } else {\n // If it was a module before, we must\n $udata['modulename'] = '';\n }\n\n if ($oldgid != $this->iQuestionGroupID) {\n if (getGroupOrder($iSurveyID, $oldgid) > getGroupOrder($iSurveyID, $this->iQuestionGroupID)) {\n // TMSW Condition->Relevance: What is needed here?\n\n // Moving question to a 'upper' group\n // insert question at the end of the destination group\n // this prevent breaking conditions if the target qid is in the dest group\n $insertorder = getMaxQuestionOrder($this->iQuestionGroupID, $iSurveyID) + 1;\n $udata = array_merge($udata, array('question_order' => $insertorder));\n } else {\n // Moving question to a 'lower' group\n // insert question at the beginning of the destination group\n shiftOrderQuestions($iSurveyID, $this->iQuestionGroupID, 1); // makes 1 spare room for new question at top of dest group\n $udata = array_merge($udata, array('question_order' => 0));\n }\n }\n //$condn = array('sid' => $surveyid, 'qid' => $qid, 'language' => $qlang);\n $oQuestion = Question::model()->findByPk(array(\"qid\"=>$this->iQuestionID, 'language'=>$qlang));\n\n foreach ($udata as $k => $v) {\n $oQuestion->$k = $v;\n }\n\n $uqresult = $oQuestion->save(); //($uqquery); // or safeDie (\"Error Update Question: \".$uqquery.\"<br />\"); // Checked)\n if (!$uqresult) {\n $bOnError = true;\n $aErrors = $oQuestion->getErrors();\n if (count($aErrors)) {\n foreach ($aErrors as $sAttribute=>$aStringErrors) {\n foreach ($aStringErrors as $sStringErrors) {\n Yii::app()->setFlashMessage(sprintf(gT(\"Question could not be updated with error on %s: %s\"), $sAttribute, $sStringErrors), 'error');\n }\n }\n } else {\n Yii::app()->setFlashMessage(gT(\"Question could not be updated.\"), 'error');\n }\n }\n }\n }\n\n\n // Update the group ID on subquestions, too\n if ($oldgid != $this->iQuestionGroupID) {\n Question::model()->updateAll(array('gid'=>$this->iQuestionGroupID), 'qid=:qid and parent_qid>0', array(':qid'=>$this->iQuestionID));\n // if the group has changed then fix the sortorder of old and new group\n Question::model()->updateQuestionOrder($oldgid, $iSurveyID);\n Question::model()->updateQuestionOrder($this->iQuestionGroupID, $iSurveyID);\n // If some questions have conditions set on this question's answers\n // then change the cfieldname accordingly\n fixMovedQuestionConditions($this->iQuestionID, $oldgid, $this->iQuestionGroupID);\n }\n // Update subquestions\n if ($oldtype != $sQuestionType) {\n Question::model()->updateAll(array('type'=>$sQuestionType), 'parent_qid=:qid', array(':qid'=>$this->iQuestionID));\n }\n\n // Update subquestions if question module\n if (Yii::app()->request->getPost('module_name') != '') {\n // The question module is not empty. So it's an external question module.\n Question::model()->updateAll(array('modulename'=>Yii::app()->request->getPost('module_name')), 'parent_qid=:qid', array(':qid'=>$this->iQuestionID));\n } else {\n // If it was a module before, we must\n Question::model()->updateAll(array('modulename'=>''), 'parent_qid=:qid', array(':qid'=>$this->iQuestionID));\n }\n\n Answer::model()->deleteAllByAttributes(array('qid' => $this->iQuestionID), 'scale_id >= :scale_id', array(':scale_id' => $iAnswerScales));\n\n // Remove old subquestion scales\n Question::model()->deleteAllByAttributes(array('parent_qid' => $this->iQuestionID), 'scale_id >= :scale_id', array(':scale_id' => $iSubquestionScales));\n if (!isset($bOnError) || !$bOnError) {\n // This really a quick hack and need a better system\n Yii::app()->setFlashMessage(gT(\"Question was successfully saved.\"));\n }\n } else {\n Yii::app()->setFlashMessage(gT(\"Question could not be updated\"), 'error');\n }\n }\n //This is SUPER important! Recalculating the Expression Manager state!\n LimeExpressionManager::SetDirtyFlag();\n LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);\n $this->_resetEM();\n\n $closeAfterSave = Yii::app()->request->getPost('close-after-save') === 'true';\n\n if ($closeAfterSave) {\n // Redirect to summary\n $this->getController()->redirect(array('admin/questions/sa/view/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));\n } else {\n // Redirect to edit\n $this->getController()->redirect(array('admin/questions/sa/editquestion/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));\n // This works too: $this->getController()->redirect(Yii::app()->request->urlReferrer);\n }\n }", "public function update(Request $request)\n {\n $question = $request->question;\n $q_id = $request->q_id;\n\n DB::table('questions')->where('id',$q_id)->update(\n [\n 'question' => $question,\n\n \"updated_at\" => \\Carbon\\Carbon::now(),\n ]\n\n );\n\n return redirect('admin/questions/edit/'.$q_id)->with('message','Question Updated');\n }", "public function update(Request $request)\n {\n $this->validate($request,[\n 'study' => 'required',\n 'title' => 'required',\n 'description' => 'required',\n 'type' => 'required'\n ]);\n\n auth()->user()->questions()->find($request->id)->update([\n 'school_id' => auth()->user()->school[0]->id,\n 'user_id' => auth()->user()->id,\n 'study_id' => $request->study,\n 'title' => $request->title,\n 'description' => $request->description,\n 'type' => $request->type,\n ]);\n\n return redirect()->route('teachers.questions.index')->with(['success' => 'Soal berhasil diupdate']);\n }", "public function update(Request $request){\n $validators=Validator::make($request->all(),[\n 'question'=>'required',\n 'answer'=>'required'\n ]);\n if($validators->fails()){\n return Response::json(['errors'=>$validators->getMessageBag()->toArray()]);\n }else{\n $q=CommonQuestion::where('id',$request->id)->where('user_id',Auth::user()->id)->first();\n if($q){\n $q->question=$request->question;\n $q->user_id=Auth::user()->id;\n $q->answer=$request->answer;\n $q->save();\n return Response::json(['success'=>'CommonQuestion updated successfully !']);\n }else{\n return Response::json(['error'=>'CommonQuestion not found !']);\n }\n }\n }", "public function changeQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n // update database\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz->changeQuestionAndAnswers($this->object);\n\n $_GET['question_id'] = $_POST['question_id'];\n $this->initQuestionAndAnswersEditForm();\n\n // load changed data and display them\n }", "public function update(Request $request, $id)\n {\n\n $object = ParseObject::create(\"Questions\");\n $object->getObjectId();\n $object->set('question', $request->get('question'));\n $arrayResponses = array();\n $responses = $request->get('responses');\n\n for($i = 0; $i < count($responses); $i++){\n $arrayResponses['q'.$i] = $responses[$i];\n }\n $object->setArray('responses', $arrayResponses);\n $object->save();\n }", "public function store(Request $request, $uuid, $survey_id,$section_id)\n {\n //dd($request->all());\n $this_survey = Survey::where('hash_id',$survey_id)->firstOrFail();\n\n //dd($request->all());\n foreach ($request->all() as $key=> $input){\n if($key!='_token' && $key!='referrerScript'){\n $answer_string ='';\n if($input!='' || $input!=null){\n if(is_array($input)){\n foreach ($input as $innerKey=>$value){\n if(strpos($value, 'q')===false){\n $answer_string.= $value.'_|@|_';\n }\n else{\n\n }\n\n }\n }\n else{\n $answer_string = $input;\n }\n\n\n $client_answer =null;\n $under_test = ClientAnswer::where('question_id',$key)->first();\n\n if($under_test==null){\n\n $client_answer = new ClientAnswer();\n\n $client_answer['uuid'] = $uuid;\n\n $client_answer['survey_id'] = $this_survey->id;\n $client_answer['question_id'] = $key;\n $client_answer['questionAnswer'] = $answer_string;\n $client_answer['created_at'] = Carbon::now();\n\n\n $client_answer->save();\n }\n\n else{\n $update = [['questionAnswer' => $answer_string],['created_at' => Carbon::now()]];\n DB::table('clients_answers')\n ->where([\n ['uuid', '=', $uuid],\n ['survey_id', '=', $this_survey->id],\n ['question_id', '=', $key],\n ])\n ->update(['questionAnswer' => $answer_string]);\n\n }\n\n\n }\n\n\n\n }\n }\n\n $next_section = $this_survey->sections->where('id','>', $section_id)->min('id');\n //Session::flash('referrer',$section_id);\n\n if($next_section!=null){\n return redirect(route('clients.surveys.section.show',['uuid'=>$uuid, 'survey_id'=>$survey_id, 'section_id'=>$next_section]));\n\n }\n else{\n return redirect(route('start',['uuid'=>$uuid, 'survey_id'=>$survey_id]));\n }\n\n\n\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->survey_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id) {\n \n dump($request->all()); die; \n\n $page = 'questionnaire';\n $date = Date::now();\n\n $questionnaire = questionnaire::findOrFail($id);\n\n $questionnaire->updated_at = $date;\n\n $questionnaire->title = $request->input('title');\n \n $categories = $request->categories? $request->categories : [];\n $questionnaire->categories()->sync($categories);\n\n $questions = $request->questions? $request->questions : [];\n $questionnaire->questions()->sync($questions);\n\n $questionnaire->save();\n\n return redirect()\n ->route('admin.questionnaire.index')\n ->withSuccess('Le questionnaire a bien été modifiée.');\n }", "public function update(Request $request, Questions $questions)\n {\n //\n }", "public function update(Request $request, $id)\n {\n Question::where('id','=',$id)->update([\n 'title' => $request['title'],\n 'total_answers' => $request['total-answers'],\n 'correct_answers' => $request['correct-answers']\n ]);\n\n return redirect('questions');\n }", "public function update(Request $request, Answers $answers)\n {\n //\n }", "function resetSurveyData(\\Plugin\\Project $eventProject, \\Plugin\\Record $surveyRecord, $eventID, $deleteFields) {\n $surveyRecord->updateDetails($deleteFields);\n $surveyIDs = array();\n $sql = \"SELECT survey_id\n FROM redcap_surveys\n WHERE project_id=\".$eventProject->getProjectId();\n $result = db_query($sql);\n while ($row = db_fetch_assoc($result)) {\n $surveyIDs[] = $row['survey_id'];\n }\n\n $participantIDs = array();\n $sql = \"SELECT d.participant_id\n FROM redcap_surveys_participants d\n JOIN redcap_surveys_response d2\n ON d.participant_id = d2.participant_id AND d2.record=\".$surveyRecord->getId().\"\n WHERE d.event_id=\".$eventID.\"\n AND d.survey_id IN (\".implode(\",\",$surveyIDs).\")\";\n $result = db_query($sql);\n while ($row = db_fetch_assoc($result)) {\n $participantIDs[] = $row['participant_id'];\n }\n\n foreach ($participantIDs as $participantID) {\n $sql = \"UPDATE redcap_surveys_response\n SET start_time=NULL, first_submit_time=NULL, completion_time=NULL, return_code=NULL, results_code=NULL\n WHERE record=\".$surveyRecord->getId().\" AND participant_id=\".$participantID;\n db_query($sql);\n }\n}", "public function update(Request $request, StudentAnswerController $studentAnswer)\n {\n //\n }", "public static function insertSurvey()\n\t{\n\t\tif(isset($_POST['SurveyID']) && (is_numeric($_POST['SurveyID'])))\n\t\t{//insert response!\n\t\t\t$iConn = IDB::conn();\n\t\t\t// turn off auto-commit\n\t\t\tmysqli_autocommit($iConn, FALSE);\n\t\t\t//insert response\n\t\t\t$sql = sprintf(\"INSERT into \" . PREFIX . \"responses(SurveyID,DateAdded) VALUES ('%d',NOW())\",$_POST['SurveyID']);\n\t\t\t$result = @mysqli_query($iConn,$sql); //moved or die() below!\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Entering Response: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\t\t\n\t\t\t//retrieve responseid\n\t\t\t$ResponseID = mysqli_insert_id($iConn); //get ID of last record inserted\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Retrieving ResponseID: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\n\t\t\t//loop through and insert answers\n\t\t\tforeach($_POST as $varName=> $value)\n\t\t\t{//add objects to collection\n\t\t\t\t $qTest = substr($varName,0,2); //check for \"obj_\" added to numeric type\n\t\t\t\t if($qTest==\"q_\")\n\t\t\t\t {//add choice!\n\t\t\t\t \t$QuestionID = substr($varName,2); //identify question\n\t\t\t\t \t\n\t\t\t\t \tif(is_array($_POST[$varName]))\n\t\t\t\t \t{//checkboxes are arrays, and we need to loop through each checked item to insert\n\t\t\t\t\t \twhile (list ($key,$value) = @each($_POST[$varName])){\n\t\t\t\t\t\t \t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t\t \t\t$result = @mysqli_query($iConn,$sql);\n\t\t\t\t\t \t\tif(!$result)\n\t\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (array/checkbox): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t \t\t}else{//not an array, so likely radio or select\n\t\t\t\t \t\t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t \t $result = @mysqli_query($iConn,$sql);\n\t\t\t\t \t if(!$result)\n\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (single/radio): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t} \n\t\t\t \t\t}\n\t\t\t\t }\n\t\t\t}\n\t\t\t//we got this far, lets COMMIT!\n\t\t\tmysqli_commit($iConn);\n\t\t\t\n\t\t\t// our transaction is over, turn autocommit back on\n\t\t\tmysqli_autocommit($iConn, TRUE);\n\t\t\t\n\t\t\t//count total responses, update TotalResponses\n\t\t\tself::responseCount((int)$_POST['SurveyID']); //convert to int on way in!\n\t\t\treturn TRUE; #\n\t\t}else{\n\t\t\treturn FALSE;\t\n\t\t}\n\n\t}", "public function update(Request $request, $id)\n {\n\n $data = $request->validate([\n 'question' => 'required',\n 'allottedTime' => 'required',\n ]);\n \n Question::whereId($id)->update($data);\n return redirect(route('questions.index'))->with('completed', 'Question updated');\n }", "public function submit(Request $request, $id)\n {\n if($id != $request->input('survey_id')) {\n if($request->has('return_url')\n && strlen($request->input('return_url'))>5) {\n return response()\n ->header('Location', $request->input('return_url'));\n }\n }\n\n $survey = \\App\\Survey::find($id);\n $answerArray = array();\n $validationArray = array();\n $messageArray = array();\n\n //loop through questions and check for answers\n foreach($survey->questions as $question) {\n if($question->required)\n {\n $validationArray['q-' . $question->id] = 'required';\n $messageArray['q-' . $question->id . '.required'] = $question->label . ' is required';\n }\n if($request->has('q-' . $question->id)) {\n if(is_array($request->input('q-' . $question->id)) && count($request->input('q-' . $question->id))) {\n $answerArray[$question->id] = array(\n 'value' => implode('|', $request->input('q-' . $question->id)),\n 'question_id' => $question->id\n );\n } elseif ( strlen(trim($request->input('q-' . $question->id))) > 0) {\n\n $answerArray[$question->id] = array(\n 'value'=> $request->input('q-' . $question->id),\n 'question_id'=>$question->id\n );\n\n } // I guess there is an empty string\n }\n }\n\n\n\n $this->validate($request, $validationArray, $messageArray);\n\n //if no errors, submit form!\n if(count($answerArray) > 0) {\n $sr = new \\App\\SurveyResponse(['survey_id'=>$id, 'ip'=>$_SERVER['REMOTE_ADDR']]);\n $sr->save();\n foreach($answerArray as $qid => $ans) {\n // print_r($ans);\n $sr->answers()->create($ans);\n }\n }\n\n\n if($survey->return_url\n && strlen($survey->return_url)>5\n && !$survey->kiosk_mode ) {\n return redirect()->away($survey->return_url);\n } else {\n return redirect('thanks/' . $survey->id);\n }\n }", "public function update(Request $request, Quiz $quiz)\n {\n //\n }", "public function update(Request $request, Quiz $quiz)\n {\n //\n }", "public function updateQuestion()\r\n{\r\n $query_string = \"UPDATE questions \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizid = :quizid, \";\r\n $query_string .= \"question = :question, \";\r\n $query_string .= \"choice1 = :choice1, \";\r\n $query_string .= \"choice2 = :choice2, \";\r\n $query_string .= \"choice3 = :choice3, \";\r\n $query_string .= \"choice4 = :choice4, \";\r\n $query_string .= \"ans = :ans \";\r\n $query_string .= \"WHERE questionid = :questionid \";\r\n\r\n return $query_string;\r\n}", "public function update(Request $request, $id)\n {\n //Admin answer response, limited to one answer only\n //Needs database normalization of more than one answer can be added\n\n\n }", "public function update(Request $request, Question_Test $question_Test)\n {\n //\n }", "function randomstrayquotes_update_instance(stdclass $randomstrayquotes, $mform =null) {\n global $DB, $CFG;\n\n $randomstrayquotes->timemodified = time();\n $randomstrayquotes->id = $randomstrayquotes->instance;\n $randomstrayquotes->students_add_quotes = $randomstrayquotes->admin_setting_students_add_quotes;\n $randomstrayquotes->students_add_authors = $randomstrayquotes->admin_setting_students_add_authors;\n $randomstrayquotes->students_add_categories = $randomstrayquotes->admin_setting_students_add_categories;\n\n // You may have to add extra stuff in here.\n $result = $DB->update_record('randomstrayquotes', $randomstrayquotes);\n\n randomstrayquotes_grade_item_update($randomstrayquotes);\n\n return $result;\n}", "function surveyQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyQuestion\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) { // only proceed if this is an ajax request\n if (!$this->request->is('post')) {\n if ($id != null) { // existing question being edited so retrieve it from the session\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempData = $this->Session->read('SurveyQuestion.new');\n $this->set('question_index', $id);\n $question = $tempData[$id];\n $question['Choice']['value'] = $this->Survey->Question->Choice->CombineChoices($question['Choice']);\n $this->request->data['Question'] = $question; // send the existing question to the view\n }\n }\n $this->render('/Elements/question_form');\n } else { // returning with data from the form here\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempArr = $this->Session->read('SurveyQuestion.new');\n }\n $this->request->data['Question']['Choice'] = $this->Survey->Question->Choice->SplitChoices($this->request->data['Question']['Choice']['value']);\n $this->Survey->Question->set($this->request->data);\n $checkfieldsArr = $this->Survey->Question->schema();\n unset($checkfieldsArr['id']);\n unset($checkfieldsArr['survey_id']);\n unset($checkfieldsArr['order']);\n $checkfields = array_keys($checkfieldsArr);\n if ($this->Survey->Question->validates(array('fieldList' => $checkfields))) {\n if (is_null($id)) {\n $tempArr[] = $this->request->data['Question'];\n } else {\n $tempArr[$id] = $this->request->data['Question'];\n }\n $this->Session->write('SurveyQuestion.new',$tempArr);\n } else {\n $errors = $this->Survey->Question->invalidFields();\n $this->Session->setFlash('Invalid question: '.$errors['question'][0], true, null, 'error');\n }\n $this->set('questions', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_questions');\n }\n }\n }", "public function update(Request $request, UserQuestion $userQuestion)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $jipphy02tt01 = jipphy02tt01::find($id);\n\n\n\n // Save the data to the database\n\n\n $jipphy02tt01->solution = $request->input('solution');\n\n $jipphy02tt01->question_data = $request->input('question_data');\n $jipphy02tt01->option1 = $request->input('option1');\n $jipphy02tt01->option2 = $request->input('option2');\n $jipphy02tt01->option3 = $request->input('option3');\n $jipphy02tt01->option4 = $request->input('option4');\n $jipphy02tt01->correct_ans = $request->input('correct_ans');\n $jipphy02tt01->difficulty = $request->input('difficulty');\n $jipphy02tt01->ideal_time = $request->input('ideal_time');\n $jipphy02tt01->question_type = $request->input('question_type');\n\n\n\n\n\n $jipphy02tt01->save();\n\n\n\n\n // set flash data with success message\n Session::flash('success', 'This question was successfully updated.');\n\n // redirect with flash data to posts.show\n return redirect()->route('jipphy02tt01.show', $jipphy02tt01->id);\n }", "public function updateAns(){\n\t\t$action = $this->input->post('q');\n\t\t$answerCount = $this->input->post('answerCount');\n\t\t// $where \t= array(\n\t\t// \t'id'\t\t => $this->input->post('idAns'),\n\t\t// );\n\t\t$where \t= array(\n\t\t\t'survey' \t\t=> $this->input->post('id'),\n\t\t\t'page'\t \t\t=> $this->input->post('idPage'),\n\t\t\t'question'\t=> $this->input->post('idQ'),\n\t\t);\n\n\t\tif ($this->MstSurveyModel->delete($this->tables[3], $where)) {\n\t\t\tfor ($i=0; $i <= $answerCount ; $i++) { \n\t\t\t\tif($this->input->post('titleAns'.$i) == '') continue;\n\t\t\t\t$data = array(\n\t\t\t\t\t'survey' => $this->input->post('id'),\n\t\t\t\t\t'page'\t => $this->input->post('idPage'),\n\t\t\t\t\t'question'\t=> $this->input->post('idQ'),\n\t\t\t\t\t'title'\t\t=> $this->input->post('titleAns'.$i),\n\t\t\t\t\t'skor'\t\t=> $this->input->post('skorAns'.$i),\n\t\t\t\t\t'rightAns'\t=> $this->input->post('rightAns'.$i),\n\t\t\t\t\t'type'\t\t=> $this->input->post('typeAns'),\n\t\t\t\t);\n\t\t\t\t// print_r($data);exit();\n\t\t\t\tif ($this->MstSurveyModel->insert($this->tables[3], $data)) {\n\t\t\t\t\t$response = \"success\";\n\t\t\t\t}else $response = \"failed\";\n\t\t\t}\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "public function takeSurvey(){\n $this->load->database();\n\n $test['title'] = 'Survey';\n\n $test['survey'] = $this -> Survey_model -> get_survey();\n\n $data['title'] = 'Add a response to Survey';\n\n \t$this->form_validation ->set_rules('Student_Answer', 'Student_Answer', 'required');\n $this->form_validation ->set_rules('Q_ID', 'Q_ID', 'required');\n $this->form_validation ->set_rules('Surv_ID', 'Surv_ID', 'required');\n $this->form_validation ->set_rules('S_ID', 'S_ID', 'required');\n \n \n \n if($this->form_validation->run()=== FALSE){\n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n\n }else{\n\n $this -> Survey_model -> takeSurvey(); \n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n }\n }", "function update( $data = array() )\r\n\t{\r\n\t\tif (isset($data['orderno'])) $this->orderno = $data['orderno'];\r\n\t\tif (isset($data['question']) and $data['question']!=$this->question)\r\n\t\t{\r\n\t\t\t$this->question = $data['question'];\r\n\t\t\tunset($this->questionid);\r\n\t\t}\r\n\t\tif (isset($data['type']) and $data['type']!=$this->type) \r\n\t\t{\r\n\t\t\t$this->type = $data['type'];\r\n\t\t\tunset($this->questionid);\r\n\t\t}\r\n\t\tif (isset($data['maxscore'])) $this->maxscore = $data['maxscore'];\r\n\t\tif (isset($data['answers'])) \r\n\t\t{\r\n\t\t\tforeach ($data['answers'] as $key => $answer)\r\n\t\t\t{\r\n\t\t\t\t$this->answers[$key]->answer = $answer;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($data['scorepercentages'])) \r\n\t\t{\r\n\t\t\tforeach ($data['scorepercentages'] as $key => $scorepercentage)\r\n\t\t\t{\r\n\t\t\t\t$this->answers[$key]->scorepercentage = $scorepercentage;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif ($this->type == \"shortanswer\")\r\n\t\t{\r\n\t\t\t$this->typeshort = \"SA\";\r\n\t\t}\r\n\t\tif ($this->type == \"multichoice\")\r\n\t\t{\r\n\t\t\t$this->typeshort = \"MC\";\r\n\t\t}\r\n\t\r\n\t}", "public function testDuplicateSurvey()\n {\n $year = 2018;\n $currentYear = current_year();\n $origSurvey = Survey::factory()->create(['year' => $year, 'title' => \"$year Survey Title\"]);\n $origGroup = SurveyGroup::factory()->create(['survey_id' => $origSurvey->id]);\n $origQuestion = SurveyQuestion::factory()->create(['survey_id' => $origSurvey->id, 'survey_group_id' => $origGroup->id]);\n\n $response = $this->json('POST', \"survey/{$origSurvey->id}/duplicate\");\n $response->assertStatus(200);\n $newId = $response->json('survey_id');\n\n $this->assertDatabaseHas('survey', ['id' => $newId, 'title' => \"$currentYear Survey Title\"]);\n $this->assertDatabaseHas('survey_group', ['survey_id' => $newId, 'title' => $origGroup->title]);\n $this->assertDatabaseHas('survey_question', ['survey_id' => $newId, 'description' => $origQuestion->description]);\n }", "public function update($id,Request $request)\n\t{\n\t\t$this->validate($request,[\n\t\t\n\t\t\t'name' => 'required|max:255',\n\t\t\n\t\t\t\n\t\t\t]);\n\t\t\n\t\t$enquiry = Enquirys::find($id);\n\t\t\t\n\t\t\t\t\t\t\t\t$enquiry->userid = $request->user()->id;\n\n\t\t$enquiry->name = $request->input(\"name\");\n\t\t$enquiry->age = $request->input(\"age\");\t\n\t\t$enquiry->mumname = $request->input(\"mumname\");\n\t\t$enquiry->fatname = $request->input(\"fatname\");\n\t\t$enquiry->parentocc = $request->input(\"parentocc\");\n\t\t$enquiry->address = $request->input(\"address\");\n\t\t$enquiry->phone = $request->input(\"phone\");\n\t\t$enquiry->email = $request->input(\"email\");\n\t\t$enquiry->highestedu = $request->input(\"highestedu\");\n\t\t$enquiry->nameofschool = $request->input(\"nameofschool\");\n\t\t$enquiry->ourschool = $request->input(\"ourschool\");\n\t\t$enquiry->totalmarks = $request->input(\"totalmarks\");\n\t\t$enquiry->english = $request->input(\"english\");\n\t\t$enquiry->mathematics = $request->input(\"mathematics\");\n\t\t$enquiry->physics = $request->input(\"physics\");\n\t\t$enquiry->chemistry = $request->input(\"chemistry\");\n\t\t$enquiry->biology = $request->input(\"biology\");\n\t\t$enquiry->myanmar = $request->input(\"myanmar\");\n\t\t$enquiry->others = $request->input(\"others\");\n\t\t$enquiry->igcseenglish = $request->input(\"igcseenglish\");\n\t\t$enquiry->igcsepuremaths = $request->input(\"igcsepuremaths\");\n\t\t$enquiry->igcsemaths = $request->input(\"igcsemaths\");\n\t\t$enquiry->igcsephysics = $request->input(\"igcsephysics\");\n\t\t$enquiry->igcsechemistry = $request->input(\"igcsechemistry\");\n\t\t$enquiry->igcsebiology = $request->input(\"igcsebiology\");\n\t\t$enquiry->igcseothers = $request->input(\"igcseothers\");\n \t\t$enquiry->programinterested = $request->input(\"programinterested\");\n \t\t$enquiry->campus = $request->input(\"campus\");\n \t\t$enquiry->remarks = $request->input(\"remarks\");\n\n\n\t\t$enquiry->active = 0;\n\t\tif (Input::get('active') === \"\"){$enquiry->active = 1;}\n\n\t\t\n\t\t\n\t\t\n\t\t$enquiry->save();\n\t\treturn redirect()->route(\"enquirys.index\");\n\t}", "public function update(Request $request, Quest $quest)\n {\n\n //$quest->update($request->all());\n }", "function updateLorAnswer(\\Foundation\\Form\\Input $input, \\Jazzee\\Entity\\Answer $answer);", "public function updateUserQuestion()\n\t{\n\t\tif (Input::has('add_good_answer'))\n\t\t{\n\t\t\t// increase number of good answers\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_add_good_answer', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t]);\n\t\t}\n\n\t\tif (Input::has('add_bad_answer'))\n\t\t{\n\t\t\t// increase number of bad answers\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_add_bad_answer', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t]);\n\t\t}\n\n\t\tif (Input::has('update'))\n\t\t{\n\t\t\t// update question and/or answer\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_update_user_question', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t\t'question' => Input::get('question'),\n\t\t\t\t'answer' => Input::get('answer')\n\t\t\t]);\n\n\t\t\t/*\n\t\t\t * Store in session for next request only\n\t\t\t * This will force learning page to display concrete user question instead of random one,\n\t\t\t * and the answer div to be displayed so user can see updated fields\n\t\t\t */\n\t\t\tSession::flash('user_question_id', Input::get('user_question_id'));\n\t\t\tSession::flash('display_answer', true);\n\t\t}\n\n\t\t/*\n\t\t * Success API response\n\t\t */\n\t\tif (isset($apiResponse) && $apiResponse->getSuccess())\n\t\t{\n\t\t\t// redirect to learning page display user question\n\t\t\treturn Redirect::route('learning_page_display_user_question');\n\t\t}\n\n\t\t// unexpected API resppnse\n\t\tthrow new Exception('Unexpected API response');\n\t}", "public function update(Request $request, Answer $answer)\n {\n //\n }", "public function update(Request $request, Answer $answer)\n {\n //\n }", "public function update(Request $request, Answer $answer)\n {\n //\n }", "public function update(Request $request, Answer $answer)\n {\n //\n }", "public function update(Request $request, Answer $answer)\n {\n //\n }", "function releaseSurvey($id=null)\r\n {//deprecated, this function is not used\r\n $eventArray = array();\r\n\r\n $this->Survey->setId($id);\r\n $this->params['data'] = $this->Survey->read();\r\n $this->params['data']['Survey']['released'] = 1;\r\n\r\n //add survey to eventsx();\r\n //set up Event params\r\n $eventArray['Event']['title'] = $this->params['data']['Survey']['name'];\r\n $eventArray['Event']['course_id'] = $this->params['data']['Survey']['course_id'];\r\n $eventArray['Event']['event_template_type_id'] = 3;\r\n $eventArray['Event']['template_id'] = $this->params['data']['Survey']['id'];\r\n $eventArray['Event']['self_eval'] = 0;\r\n $eventArray['Event']['com_req'] = 0;\r\n $eventArray['Event']['due_date'] = $this->params['data']['Survey']['due_date'];\r\n $eventArray['Event']['release_date_begin'] = $this->params['data']['Survey']['release_date_begin'];\r\n $eventArray['Event']['release_date_end'] = $this->params['data']['Survey']['release_date_end'];\r\n $eventArray['Event']['creator_id'] = $this->params['data']['Survey']['creator_id'];\r\n $eventArray['Event']['created'] = $this->params['data']['Survey']['created'];\r\n\r\n //Save Data\r\n if ($this->Event->save($eventArray)) {\r\n //Save Groups for the Event\r\n //$this->GroupEvent->insertGroups($this->Event->id, $this->params['data']['Event']);\r\n\r\n //$this->redirect('/events/index/The event is added successfully.');\r\n }\r\n\r\n $this->Survey->save($this->params['data']);\r\n\r\n\r\n\t\t$this->set('data', $this->Survey->findAll(null, null, 'id'));\r\n\t\t$this->set('message', 'The survey was released.');\r\n\t\t$this->index();\r\n\t\t$this->render('index');\r\n\t}", "public function update(Request $request, Question $question)\n {\n if (!$question) {\n throw new ModelNotFoundException();\n }\n $poll =Poll::findOrFail($question->poll_id);\n\n if($poll->app_id != $request->app_id){\n throw new UnauthorizedHttpException('','not allowed');\n }\n $requestData = $request->all();\n $question->update($requestData);\n\n /*replace options*/\n if (!empty($requestData['options'])) {\n $question->options()->delete();\n $question->options()->createMany($requestData['options']);\n }\n\n return response('Question Updated', 200);\n }", "public function update($question_id)\n {\n $question = Question::where('id',$question_id)->first();\n $question->public = true;\n\n dd($question);\n return Response::view('errors.200',['url' =>'/hedgehogs/dashboard/topics/','message'=>'Question publique.'], 200);\n }", "public function update(Request $request, Question $question)\n {\n// $this->authorize('update-question',$question);\n $this->authorize('update',$question);\n\n $question->update($request->only(['title','body']));\n return redirect()->route('questions.index')->with('success','Sualda deyisiklik edildi');\n }", "public function update(Request $request, $student_id)\n {\n\n DB::table('assignment')->where('student_id', '=', $student_id)->update(['company_confirm' => \"Approved\"]);\n /* Declare variables */\n DB::table('evaluation')->insert([\n 'student_id' => $student_id\n ]);\n $id = Auth::user()->user_id;\n $instructor = DB::table('instructor_company')->where('company_id', $id)->first();\n DB::table('student_instructor_company')\n ->insert([\n 'instructor_id' => $instructor->instructor_id,\n 'student_id' => $student_id\n ]);\n DB::table('topic')->where('topic_id', '=', $request->topic_id)->decrement('quantity', 1);\n\n\n }", "public function save_survey_data(Request $request)\n\t{\t\n\t\t$survey_id \t= $request['survey_id'];\n\t\t$grp \t\t= GROUP::where('survey_id',$survey_id);\n\t\t$sq \t\t= SQ::where('survey_id', $survey_id);\t\t\n\t\t$data \t\t= json_decode($request['survey_data'],true);\n\t\ttry{\n\t\t\t\tDB::beginTransaction();\n\t\t\t\tif($grp->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$grp->forceDelete();\n\t\t\t\t\t$msg = \"Update Successfully Survey Group Question\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t$msg = \"Successfully Create Survey Group & Questions\";\n\t\t\t\t}\n\t\t\t\tif($sq->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$sq->forceDelete();\n\t\t\t\t}\n\t\t\t\tforeach($data as $key => $value) {\n\t\t\t\t\t//group \n\t\t\t\t\t$grp = new GROUP();\n\t\t\t\t\t$grp->survey_id \t=\t$survey_id;//$request['survey_id'];\n\t\t\t\t\t$grp->title \t\t=\t$value[\"group_name\"]; \n\t\t\t\t\t$grp->description \t=\t$value[\"group_description\"]; \n\t\t\t\t\t$grp->save();\n\t\t\t\t\tforeach ($value['group_questions'] as $key => $val) {\n\t\t\t\t\t// group Question\t\t\t\t \n\t\t\t\t\t\t$sq = \t new SQ();\n\t\t\t\t\t\t$sq->question = $val[\"question\"];\n\t\t\t\t\t\tunset($val[\"question\"]);\n\t\t\t\t\t\t$sq->answer = \tjson_encode($val);\n\t\t\t\t\t\t$sq->survey_id = $survey_id;\n\t\t\t\t\t\t$sq->group_id = $grp->id;\n\t\t\t\t\t\t$sq->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDB::commit();\n\t\t\t\treturn ['status'=>\"success\", \"message\"=>$msg];\n\t\t\t}catch(\\Exception $e){\n\t\t\t\tDB::rollback();\n\t\t\t\tthrow $e;\n\t\t\t}\t\t\t\t\n\t}", "public function question_and_option_update()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->model('operator/Questions');\t\t\n\t\t$CI->Questions->question_and_option_update();\n\t\t$this->session->set_userdata(array('message'=>display('successfully_update')));\n\t\tredirect(base_url('operator/Oquestion'));\n\t}", "public function update(UpdateSampleRequests $request)\n { \n $sample = $this->sample\n ->whereid($request->get('id'))->first();\n \n $sample\n ->fill($request->input())\n ->save();\n return redirect(route('samples'));\n }", "public function update(Request $request, $id)\n {\n if($this->isAdmin()==false){\n return response([\n 'message' =>'Invalid user'\n ],403 );\n }\n $existingLesson = Lesson::find($id);\n if ($existingLesson) { \n $existingLesson->update([\n 'l_type'=>$request->input('l_type'),\n 'name'=>$request->input('name'),\n 'question_count'=>$request->input('question_count'),\n 'question_count_to_test'=>$request->input('question_count_to_test'),\n 'language'=>$request->input('language')\n ]);\n\n CrossLesson::where('lesson_id',$existingLesson->id)->delete();\n $cross_lessons = $request->input('cross_lessons');\n if(isset($cross_lessons)){\n foreach ($cross_lessons as $lesson_) {\n CrossLesson::create([\n 'lesson_id'=>$existingLesson->id,\n 'cross_lesson_id'=>$lesson_['id']\n ]); \n }\n }\n\n $questionOperation = $request->input('q_operation');\n if($questionOperation==='new'){\n \n $questions = Question::where('lesson_id', $existingLesson->lesson_id)->get();\n foreach ($questions as $question) {\n Option::where('question_id', $question->id)->delete();\n }\n Question::where('lesson_id', $existingLesson->lesson_id)->delete();\n Question::where('lesson_id', -1)\n ->update([\n 'lesson_id' => $existingLesson->id,\n 'tmp' => 0,\n ]);\n }\n else if($questionOperation==='merge'){\n Question::where('lesson_id', -1)\n ->update([\n 'lesson_id' => $existingLesson->id,\n 'tmp' => 0,\n ]);\n }\n else if($questionOperation==='no_touch'){\n \n }\n\n $existingLesson->update([\n 'question_count'=>Question::where('lesson_id', $existingLesson->id)->count()\n ]);\n\n return response([\n 'message' =>'successfully updated'\n ]); \n \n }else{\n return response([\n 'message' =>'Invalid credentials'\n ],Response::HTTP_NOT_FOUND );\n }\n }", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "public function update(Request $request, $questionId, $id)\n {\n /*\n * Only Update If User is Admin\n * or\n * Solution is Not Approved and the User is the Creator\n */\n $solution = Solution::find($id);\n if($request->user()->isAdmin() || (!$solution->isApproved() && $solution->creator_id == $request->user()->id)){\n return $this->storeOrUpdate($request, $solution);\n }else{\n App::abort(403, 'Unauthorized action.');\n }\n }", "public function set_survey_properties($session_key,$sid, $sproperty_name, $sproperty_value, $slang='')\n {\n if ($this->_checkSessionKey($session_key))\n { \n\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\tif (!isset($surveyidExists))\n\t\t{\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n\t\t\texit;\n\t\t}\t\t \n\t\tif (hasSurveyPermission($sid, 'survey', 'update'))\n {\n\t\t\t\t$valid_value = $this->_internal_validate($sproperty_name, $sproperty_value);\n\t\t\t\t\n\t\t\t\tif (!$valid_value)\n\t\t\t\t{\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Update values are not valid', 24);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ocurrent_Survey = Survey::model()->findByPk($sid);\t\t\t\t\n $abasic_attrs = $ocurrent_Survey->getAttributes();\n\n if ($slang == '')\n\t\t\t\t\t$slang = $abasic_attrs['language'];\n\t\t\t\t\t\n\t\t\t\t$ocurrent_Survey_languagesettings = Surveys_languagesettings::model()->findByAttributes(array('surveyls_survey_id' => $sid, 'surveyls_language' => $slang));\t\t\n\t\t\t\t$alang_attrs = $ocurrent_Survey_languagesettings->getAttributes();\n\n\t\t\t\t$active = $abasic_attrs['active'];\t\n\t\t\t\t$adissallowed = array('language', 'additional_languages', 'attributedescriptions', 'surveyls_survey_id', 'surveyls_language');\t\t\t\t\t\n\t\t\t\tif ($active == 'Y')\n\t\t\t\t\tarray_push($adissallowed, 'active', 'anonymized', 'savetimings', 'datestamp', 'ipaddr','refurl');\n\t\t\t\t\t\n\t\t\t\tif (!in_array($sproperty_name, $adissallowed))\n\t\t\t\t{\n\t\t\t\t\tif (array_key_exists($sproperty_name, $abasic_attrs))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ocurrent_Survey->setAttribute($sproperty_name,$valid_value);\n\t\t\t\t\t\treturn $ocurrent_Survey->save();\n\t\t\t\t\t}\n\t\t\t\t\telseif (array_key_exists($sproperty_name, $alang_attrs))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ocurrent_Survey_languagesettings->setAttribute($sproperty_name,$valid_value);\n\t\t\t\t\t\treturn $ocurrent_Survey_languagesettings->save();\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No such property', 25);\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Property not editable', 26);\t\n }\n else\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \n\t\t\t\n }\n }" ]
[ "0.783796", "0.7607503", "0.7607503", "0.73462087", "0.73462087", "0.7274194", "0.7178802", "0.7178802", "0.69725287", "0.69445485", "0.67672473", "0.66948223", "0.65750146", "0.65455353", "0.6525728", "0.6514486", "0.6467296", "0.6417657", "0.64144254", "0.63971466", "0.6392465", "0.63633776", "0.63004047", "0.61930674", "0.6185614", "0.6132276", "0.61254305", "0.61202306", "0.6077878", "0.6073968", "0.6057249", "0.6056217", "0.60167176", "0.59854186", "0.5984939", "0.5984761", "0.595755", "0.5944312", "0.5939401", "0.5928263", "0.5920106", "0.5902841", "0.58852", "0.5880943", "0.5877009", "0.5858608", "0.5853572", "0.584373", "0.58309007", "0.581774", "0.5817152", "0.5817066", "0.58129895", "0.5797405", "0.5797405", "0.5797405", "0.5793004", "0.5765477", "0.5765294", "0.5755449", "0.5752031", "0.5751853", "0.5749088", "0.5738044", "0.5731948", "0.5725911", "0.5719289", "0.5719289", "0.571689", "0.57107985", "0.56888425", "0.5680417", "0.56791294", "0.5648934", "0.5638689", "0.5636312", "0.5632287", "0.5631365", "0.56186", "0.561502", "0.55894846", "0.55867153", "0.5585145", "0.5584965", "0.5584965", "0.5584965", "0.5584965", "0.5584965", "0.55818266", "0.55780977", "0.5574047", "0.55739707", "0.55687654", "0.55585223", "0.55580723", "0.55555093", "0.5553366", "0.5546706", "0.55445", "0.55431354", "0.5541568" ]
0.0
-1
Get all submissions for a given survey If completed_since is set than we will check for all surveys completed since that time. This will be used to see if the user wants to compile new results based on the new completed survey submissions.
public function get_completed_survey_submissions($id, $completed_since = NULL) { $data = array(); $this->db ->order_by('completed', 'ASC') ->where('completed IS NOT NULL', NULL, TRUE) ->where('survey_id', $id); // If completed_since is set, only grab completed submissions AFTER that date if ($completed_since != NULL) { $this->db->where('completed >=', $completed_since); } $query = $this->db->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[ $row->id ] = array( 'member_id' => (int)$row->member_id, 'survey_id' => (int)$row->survey_id, 'data' => json_decode($row->data, TRUE), 'created' => (int)$row->created, 'updated' => (int)$row->updated, 'completed' => (int)$row->completed, 'current_page' => (int)$row->current_page, 'complete' => (bool)$row->completed ); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "public function get_survey_submissions($filters, $order_by = 'updated', $order_by_order = 'DESC')\n\t{\n\t\t$data = array();\n\n\t\t$order_by = in_array($order_by, array('id', 'member_id', 'survey_id', 'created', 'updated', 'completed', 'complete')) ? $order_by : 'updated';\n\t\t$order_by_order = in_array($order_by_order, array('ASC', 'DESC', 'RANDOM')) ? $order_by_order : 'DESC';\n\n\t\t$this->db->order_by($order_by, $order_by_order);\n\n\t\t// Filter survey ID\n\t\tif ( isset($filters['survey_id']) AND $filters['survey_id'])\n\t\t{\n\t\t\t$this->db->where('survey_id', $filters['survey_id']);\n\t\t}\n\n\t\t// Filter member ID\n\t\tif ( isset($filters['member_id']) AND $filters['member_id'])\n\t\t{\n\t\t\t$this->db->where('member_id', $filters['member_id']);\n\t\t}\n\n\t\t// Filter group ID\n\t\tif ( isset($filters['group_id']) AND $filters['group_id'])\n\t\t{\n\t\t\t$this->db->join('members', 'members.member_id = vwm_surveys_submissions.member_id');\n\t\t\t$this->db->where('group_id', $filters['group_id']);\n\t\t}\n\n\t\t// If a valid created from date was provided\n\t\tif ( isset($filters['created_from']) AND strtotime($filters['created_from']) )\n\t\t{\n\t\t\t// If a valid created to date was provided as well\n\t\t\tif ( isset($filters['created_to']) AND strtotime($filters['created_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to created_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys created from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys created on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`created` BETWEEN ' . strtotime($filters['created_from']) . ' AND ' . (strtotime($filters['created_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a created from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'created >=', strtotime($filters['created_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// If a valid updated from date was provided\n\t\tif ( isset($filters['updated_from']) AND strtotime($filters['updated_from']) )\n\t\t{\n\t\t\t// If a valid updated to date was provided as well\n\t\t\tif ( isset($filters['updated_to']) AND strtotime($filters['updated_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to updated_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys updated from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys updated on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`updated` BETWEEN ' . strtotime($filters['updated_from']) . ' AND ' . (strtotime($filters['updated_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a updated from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'updated >=', strtotime($filters['updated_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// Filter completed\n\t\tif ( isset($filters['complete']) AND $filters['complete'] !== NULL)\n\t\t{\n\t\t\t// Show completed subissions\n\t\t\tif ($filters['complete'])\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NOT NULL', NULL, TRUE);\n\t\t\t}\n\t\t\t// Show incomplete submissions\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NULL', NULL, TRUE);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ (int)$row->id ] = array(\n\t\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t\t'hash' => $row->hash,\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "function all_final_submissions($min_status = 0) {\n\t\treturn $this->all_final_submissions_from( $this->all_submissions($min_status) );\n\t}", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "function all_final_submissions_quick($min_status = 0) {\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$join_on = \"best\";\n\t\t} else {\n\t\t\t$join_on = \"last\";\n\t\t}\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM user_entity as ue JOIN submission as s ON ue.\".$join_on.\"_submissionid = s.submissionid\".\n\t\t\t\" WHERE ue.`entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\t$subs = Submission::fetch_all($query);\n\t\t$result = array();\n\t\tforeach($subs as $s) {\n\t\t\t$result[$s->userid] = $s;\n\t\t}\n\t\treturn $result;\n\t}", "protected function createSurveyEntries(): array\n {\n $result = [];\n $query = $this->SurveyResults->find();\n $count = 0;\n\n $this->out((string)__d('Qobo/Survey', 'Found [{0}] survey_result records', $query->count()));\n\n if (empty($query->count())) {\n return $result;\n }\n\n foreach ($query as $item) {\n $survey = $this->Surveys->find()\n ->where(['id' => $item->get('survey_id')]);\n\n if (!$survey->count()) {\n $this->warn((string)__d('Qobo/Survey', 'Survey [{0}] is not found. Moving on', $item->get('survey_id')));\n\n continue;\n }\n\n $entry = $this->SurveyEntries->find()\n ->where([\n 'id' => $item->get('submit_id'),\n ])\n ->first();\n\n if (empty($entry)) {\n if (empty($item->get('submit_id'))) {\n continue;\n }\n\n $entry = $this->SurveyEntries->newEntity();\n $entry->set('id', $item->get('submit_id'));\n $entry->set('submit_date', $item->get('submit_date'));\n $entry->set('survey_id', $item->get('survey_id'));\n $entry->set('status', 'in_review');\n $entry->set('score', 0);\n\n $saved = $this->SurveyEntries->save($entry);\n\n if ($saved) {\n $result[] = $saved->get('id');\n $count++;\n } else {\n $this->out((string)__d('Qobo/Survey', 'Survey Result with Submit ID [{0}] cannot be saved. Next', $item->get('submit_id')));\n }\n } else {\n // saving existing survey_entries,\n // to double check if anything is missing as well.\n $result[] = $entry->get('id');\n }\n }\n\n $this->out((string)__d('Qobo/Survey', 'Saved [{0}] survey_entries', $count));\n\n //keeping only unique entry ids, to avoid excessive iterations.\n $result = array_values(array_unique($result));\n\n return $result;\n }", "public function getSubmissionsForSelect($conferenceId = null, $empty = null)\n\t{\n\t\t$return = array();\n\n\t\tif ($empty) {\n\t\t\t$return[0] = $empty;\n\t\t}\n\n\t\t$identity = Zend_Auth::getInstance()->getIdentity();\n\n\t\t$query = 'select st.submission_id, s.title from submission_status st\n\t\tleft join submissions s ON s.submission_id = st.submission_id\n\t\twhere st.status = :status AND s.conference_id = :conference_id';\n\n\t\tif (!$identity->isAdmin()) {\n\t\t\t// if user is not admin, only show their own submissions\n\t\t\t$mySubmissions = implode(\",\", array_keys($identity->getMySubmissions()));\n\t\t\tif (!empty($mySubmissions)) {\n\t\t\t\t$query .= ' and st.submission_id IN ('.$mySubmissions.')';\n\t\t\t} else {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\n\t\t$submissions = $this->getAdapter()->query(\n\t\t\t$query,\n\t\t\tarray(\n\t\t\t\t'status' => $this->_getAcceptedValue(),\n\t\t\t\t'conference_id' => $this->getConferenceId()\n\t\t\t)\n\t\t);\n\t\tforeach ($submissions as $submission) {\n\t\t\t$return[$submission['submission_id']] = $submission['title'];\n\t\t}\n\t\treturn $return;\n\t}", "function getCumulatedResults(&$question, $finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!$finished_ids)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$nr_of_users = $result->numRows();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t}\n\t\t\n\t\t$result_array =& $question->getCumulatedResults($this->getSurveyId(), $nr_of_users, $finished_ids);\n\t\treturn $result_array;\n\t}", "function &getUserSpecificResults($finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$evaluation = array();\n\t\t$questions =& $this->getSurveyQuestions();\n\t\tforeach ($questions as $question_id => $question_data)\n\t\t{\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($question_id);\n\t\t\t$data =& $question->getUserAnswers($this->getSurveyId(), $finished_ids);\n\t\t\t$evaluation[$question_id] = $data;\n\t\t}\n\t\treturn $evaluation;\n\t}", "public function getSubmissions()\n {\n return $this->getFiles()->filter(function (File $file) {\n return $file->getOwner()->getType() === 'student';\n });\n }", "public function __invoke(): Collection|array\n {\n return Survey::all();\n }", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "public function get_survey_submission($hash = NULL, $submission_id = NULL)\n\t{\n\t\t$data = array();\n\n\t\t// If we have a submission hash\n\t\tif ($hash)\n\t\t{\n\t\t\t$this->db->where('hash', $hash);\n\t\t}\n\t\t// If we do not have a submission hash we must have a submission ID\n\t\telse\n\t\t{\n\t\t\t$this->db->where('id', $submission_id);\n\t\t}\n\n\t\t$query = $this->db->limit(1)->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\n\t\t\t$data = array(\n\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t'hash' => $row->hash,\n\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t);\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "function get_available_by_time_surveys() {\r\n // set connection var\r\n global $db;\r\n\r\n // get current time\r\n $time = date(\"Y-m-d H:i:s\");\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND status = '1' AND available_from < '$time' AND available_due > '$time';\";\r\n $surveys_data = array();\r\n $surveys = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "function GetSubmissions () {\n $array = array ();\n $result = @mysql_query (\"SELECT `submission_id` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"' ORDER BY `submission_timestamp` ASC;\", $this->ka_db);\n while ($row = @mysql_fetch_array ($result))\n $array [] = new Submission ($row[\"submission_id\"], $this->roster_coder);\n return $array;\n }", "function learndash_get_submitted_essay_data( $quiz_id, $question_id, $essay ) {\n\t$users_quiz_data = get_user_meta( $essay->post_author, '_sfwd-quizzes', true );\n\tif ( ( !empty( $users_quiz_data ) ) && ( is_array( $users_quiz_data ) ) ) {\n\t\tif ( ( $essay ) && ( is_a( $essay, 'WP_Post' ) ) ) {\n\t\t\t$essay_quiz_time = get_post_meta( $essay->ID, 'quiz_time', true );\n\t\t} else {\n\t\t\t$essay_quiz_time = null;\n\t\t}\n\n\t\tforeach ( $users_quiz_data as $quiz_data ) {\n\t\t\t// We check for a match on the quiz time from the essay postmeta first. \n\t\t\t// If the essay_quiz_time is not empty and does NOT match then continue;\n\t\t\tif ( ( absint( $essay_quiz_time ) ) && ( isset( $quiz_data['time'] ) ) && ( absint( $essay_quiz_time ) !== absint( $quiz_data['time'] ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (empty($quiz_data['pro_quizid']) || $quiz_id != $quiz_data['pro_quizid'] || ! isset( $quiz_data['has_graded'] ) || false == $quiz_data['has_graded'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((isset($quiz_data['graded'])) && (!empty($quiz_data['graded']))) {\n\t\t\t\tforeach ( $quiz_data['graded'] as $key => $graded_question ) {\n\t\t\t\t\tif ( ( $key == $question_id ) && ( $essay->ID == $graded_question['post_id'] ) ) {\n\t\t\t\t\t\treturn $quiz_data['graded'][ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public static function get_all_awaiting_winners() {\n global $wpdb;\n $winners_table = $wpdb->prefix.\"wauc_winners\";\n return $wpdb->get_results(\"SELECT * FROM $winners_table WHERE is_selected = 1 AND is_winner = 0\");\n }", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "function submissions() {\n \n global $CFG, $USER;\n\n // need to get course id in order to retrieve students\n $assignment = get_record('assignment', 'id', $this->mainobject->id);\n $courseid = $assignment->course;\n\n //permission to grade?\n $coursemodule = get_record('course_modules', 'module', $this->mainobject->modulesettings['assignment']->id, 'instance', $assignment->id) ;\n $modulecontext = get_context_instance(CONTEXT_MODULE, $coursemodule->id);\n\n if (!has_capability($this->capability, $modulecontext, $USER->id)) {\n return;\n }\n \n $this->mainobject->get_course_students($courseid);\n\n $student_sql = $this->get_role_users_sql($this->mainobject->courses[$courseid]->context);\n\n $sql = \"SELECT s.id as subid, s.userid, s.timemodified, s.data2, c.id as cmid\n FROM {$CFG->prefix}assignment_submissions s\n INNER JOIN {$CFG->prefix}course_modules c\n ON s.assignment = c.instance\n INNER JOIN {$CFG->prefix}assignment a\n ON s.assignment = a.id\n WHERE s.assignment = {$this->mainobject->id}\n AND s.timemarked < s.timemodified\n AND (s.userid IN ({$student_sql}))\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n \n AND c.module = {$this->mainobject->modulesettings['assignment']->id}\n ORDER BY timemodified ASC\";\n\n $submissions = get_records_sql($sql);\n\n if ($submissions) {\n\n $data = array();\n\n // If we are not making the submissions for a specific group, run the group filtering\n // function to see if the config settings say display by groups and display them if they\n // are (returning false). If there are no groups, the function will return true and we\n // carry on, but if the config settings say 'don't display' then it will return false\n // and we skip this assignment\n if(!$this->mainobject->group) {\n\n //TODO - data array as input for function\n\n //$data['submissions'] = $submissions;\n //$data['type'] = $this->type;\n //$data['id'] = $this->mainobject->id;\n //$data['course'] = $assignment->course;\n\n //$group_filter = $this->mainobject->try_to_make_group_nodes($data);\n $group_filter = $this->mainobject->try_to_make_group_nodes($submissions, $this->type, $this->mainobject->id, $assignment->course);\n\n if (!$group_filter) {\n return;\n }\n }\n\n // begin json object\n $this->mainobject->output = '[{\"type\":\"submissions\"}';\n\n foreach ($submissions as $submission) {\n // add submission to JSON array of objects\n if (!isset($submission->userid)) {\n continue;\n }\n\n // ignore non-submitted uploaded files\n if (($assignment->assignmenttype == 'upload') && ($submission->data2 != 'submitted')) {\n continue;\n }\n\n // if we are displaying for just one group, skip this submission if it doesn't match\n if ($this->mainobject->group && !$this->mainobject->check_group_membership($this->mainobject->group, $submission->userid)) {\n continue;\n }\n \n $name = $this->mainobject->get_fullname($submission->userid);\n \n // sort out the time info\n $now = time();\n $seconds = ($now - $submission->timemodified);\n $summary = $this->mainobject->make_time_summary($seconds);\n \n $this->mainobject->make_submission_node($name, $submission->userid, $submission->cmid, $summary, 'assignment_final', $seconds, $submission->timemodified);\n \n }\n $this->mainobject->output .= \"]\"; // end JSON array\n \n }\n }", "public function findSubmissionsForMod($modUserId)\n {\n $query = '\n SELECT submitted_at, first_name, last_name, topic, mark, s.id\n FROM submissions s\n LEFT JOIN users u ON s.user_id = u.id\n LEFT JOIN projects p ON s.project_id = p.id\n WHERE mod_user_id = :mod_user_id\n ORDER BY submitted_at DESC\n ';\n $statement = $this->db->prepare($query);\n $statement->bindValue('mod_user_id', $modUserId, \\PDO::PARAM_INT);\n $statement->execute();\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $result;\n }", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "public static function withSubmitted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->withSubmitted();\n }", "public function submissions()\n {\n $segregatedSubmissions = Submissions::getStudentSubmissions();\n //dd($segregatedSubmissions);\n $upcoming_submissions = $segregatedSubmissions[0];\n $ongoing_submissions = $segregatedSubmissions[1];\n $finished_submissions = $segregatedSubmissions[2];\n\n //dd($upcoming_submissions);\n //dd($ongoing_submissions);\n //dd($finished_submissions);\n $unReadNotifCount = StudentCalls::getUnReadNotifCount();\n return view('student/submissions', compact('upcoming_submissions', 'ongoing_submissions', 'finished_submissions','unReadNotifCount'));\n }", "public function getScoreSubmissions($team) {\n\t\t\n\t\t\n\t\tif($this->scoreSubmissions == null && $this->db != null && ($this->getTeamOneId() == $team->getId() || $this->getTeamTwoId() == $team->getId()) ) {\n\t\t\t$this->scoreSubmissions = [];\n\t\t\n\t\t\t$sql = \"SELECT scoreSubmissions.* FROM \" . Includes_DBTableNames::scoreSubmissionsTable . \" scoreSubmissions \"\n\t\t\t\t\t. \"INNER JOIN \" . Includes_DBTableNames::datesTable . \" dates \"\n\t\t\t\t\t\t. \"ON scoreSubmissions.score_submission_date_id = dates.date_id AND dates.date_id = \" . $this->getDateId() . \" \"\n\t\t\t\t\t. \"WHERE scoreSubmissions.score_submission_team_id = \" . $team->getId() . \" AND scoreSubmissions.score_submission_ignored = 0 \"\n\t\t\t\t\t. \"ORDER BY dates.date_week_number ASC, scoreSubmissions.score_submission_is_phantom ASC, scoreSubmissions.score_submission_id ASC\";\n\t\t\t\n\t\t\t//echo $sql;\n\t\t\t\n\t\t\t$stmt = $this->db->query($sql);\n\n\t\t\twhile(($row = $stmt->fetch()) != false) {\n\t\t\t\t$this->scoreSubmissions[] = Models_ScoreSubmission::withRow($this->db, $this->logger, $row);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//print_r($this->scoreSubmissions);\n\t\t\n\t\treturn $this->scoreSubmissions;\n\t}", "function &getExistingQuestions() \n\t{\n\t\tglobal $ilDB;\n\t\t$existing_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.original_id FROM svy_question, svy_svy_qst WHERE \" .\n\t\t\t\"svy_svy_qst.survey_fi = %s AND svy_svy_qst.question_fi = svy_question.question_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\tif($data[\"original_id\"])\n\t\t\t{\n\t\t\t\tarray_push($existing_questions, $data[\"original_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $existing_questions;\n\t}", "private function get_user_submissions($submission_hahses)\n\t{\n\t\tself::$user_submissions = array();\n\n\t\t$member_id = $this->session->userdata('member_id');\n\n\t\t// Make sure we have a member ID or some submission hashes to check\n\t\tif ( $member_id OR $submission_hahses )\n\t\t{\n\t\t\t// If we have a member ID\n\t\t\tif ($member_id)\n\t\t\t{\n\t\t\t\t$this->db\n\t\t\t\t\t->where('member_id', $member_id)\n\t\t\t\t\t->or_where_in('hash', $submission_hahses ? $submission_hahses : ''); // CI does not like an empty array\n\t\t\t}\n\t\t\t// If we only have submission hashes\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where_in('hash', $submission_hahses);\n\t\t\t}\n\n\t\t\t$query = $this->db\n\t\t\t\t->order_by('completed, updated, created', 'DESC')\n\t\t\t\t->get('vwm_surveys_submissions');\n\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t// Loop through each submission\n\t\t\t\tforeach ($query->result() as $row)\n\t\t\t\t{\n\t\t\t\t\t// First key is either \"completed\" or \"progress\", second is survey ID, and value is the submission hash\n\t\t\t\t\tself::$user_submissions[ $row->completed ? 'complete' : 'progress' ][ $row->survey_id ] = $row->hash;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function index(Request $request)\n {\n /**\n * Past questions are being returned with both approved and unapproved past questions\n * Unapproved past questions should be separated during render\n */\n if ($request->input('status')){\n \n // Get all past questions that are active/approved or inactive/unapproved\n $past_questions = PastQuestion::where('approved', (boolean)$request->input('status'))\n ->with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('properties')){\n \n // Get all past questions with all their relations\n $past_questions = PastQuestion::with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('deleted')){\n\n // Get all deleted past questions with all their relations\n $past_questions = PastQuestion::onlyTrashed()->with([\n 'image',\n 'document',\n 'comment',\n ])->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } else {\n\n // Get all past questions with out their relations\n $past_questions = PastQuestion::orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n }\n\n if ($past_questions) {\n \n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }", "function _getFilteredSubmissions($journalId) {\r\n \r\n\t\t$sectionId = Request::getUserVar('decisionCommittee');\r\n\t\t$decisionType = Request::getUserVar('decisionType');\r\n\t\t$decisionStatus = Request::getUserVar('decisionStatus');\r\n\t\t$decisionAfter = Request::getUserVar('decisionAfter');\r\n\t\t$decisionBefore = Request::getUserVar('decisionBefore');\r\n \r\n\t\t$studentResearch = Request::getUserVar('studentInitiatedResearch');\r\n\t\t$startAfter = Request::getUserVar('startAfter');\r\n\t\t$startBefore = Request::getUserVar('startBefore');\r\n\t\t$endAfter = Request::getUserVar('endAfter');\r\n\t\t$endBefore = Request::getUserVar('endBefore');\r\n\t\t$kiiField = Request::getUserVar('KII');\r\n\t\t$multiCountry = Request::getUserVar('multicountry');\r\n\t\t$countries = Request::getUserVar('countries');\r\n\t\t$geoAreas = Request::getUserVar('geoAreas');\r\n\t\t$researchDomains = Request::getUserVar('researchDomains');\r\n $researchFields = Request::getUserVar('researchFields');\r\n\t\t$withHumanSubjects = Request::getUserVar('withHumanSubjects');\r\n\t\t$proposalTypes = Request::getUserVar('proposalTypes');\r\n\t\t$dataCollection = Request::getUserVar('dataCollection');\r\n\r\n $budgetOption = Request::getUserVar('budgetOption');\r\n\t\t$budget = Request::getUserVar('budget');\r\n\t\t$sources = Request::getUserVar('sources');\r\n \r\n\t\t$identityRevealed = Request::getUserVar('identityRevealed');\r\n\t\t$unableToConsent = Request::getUserVar('unableToConsent');\r\n\t\t$under18 = Request::getUserVar('under18');\r\n\t\t$dependentRelationship = Request::getUserVar('dependentRelationship');\r\n\t\t$ethnicMinority = Request::getUserVar('ethnicMinority');\r\n\t\t$impairment = Request::getUserVar('impairment');\r\n\t\t$pregnant = Request::getUserVar('pregnant');\r\n\t\t$newTreatment = Request::getUserVar('newTreatment');\r\n\t\t$bioSamples = Request::getUserVar('bioSamples');\r\n\t\t$exportHumanTissue = Request::getUserVar('exportHumanTissue');\r\n\t\t$exportReason = Request::getUserVar('exportReason');\r\n $radiation = Request::getUserVar('radiation');\r\n\t\t$distress = Request::getUserVar('distress');\r\n\t\t$inducements = Request::getUserVar('inducements');\r\n\t\t$sensitiveInfo = Request::getUserVar('sensitiveInfo');\r\n\t\t$reproTechnology = Request::getUserVar('reproTechnology');\r\n\t\t$genetic = Request::getUserVar('genetic');\r\n\t\t$stemCell = Request::getUserVar('stemCell');\r\n\t\t$biosafety = Request::getUserVar('biosafety');\r\n \r\n\r\n $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\r\n\r\n $submissions =& $editorSubmissionDao->getEditorSubmissionsReport(\r\n $journalId, $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety);\r\n \r\n $criterias = $this->_getCriterias(\r\n $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety \r\n );\r\n \r\n\t\treturn array( 0 => $submissions->toArray(), 1 => $criterias); \r\n }", "public function user_submissions_progress($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some surveys in progress return an array of their hashes\n\t\treturn isset(self::$user_submissions['progress']) ? self::$user_submissions['progress'] : array();\n\t}", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "function what_questions_can_be_answered( $survey_info, $survey_id, $number_of_questions, $old_answers )\n{\n\tglobal $db;\n\t// the first if clause checks to see if there are any response caps in the survey\n\tif( str_replace('|', '', $survey_info['question_response_caps']) )\n\t{\n\t\t// if we get here there are response caps in the survey, so we explode $question_sums and $response_caps so we can\n\t\t// figure out which questions have hit the cap\n\t\t$question_sums = explode(\"|\", $survey_info['question_sums']);\n\t\t$question_selected_text = explode(\"|\", $survey_info['question_selected_text']);\n\t\t$question_response_caps = explode(\"|\", $survey_info['question_response_caps']);\n\t\t$group_ids = $survey_info['group_ids'];\n\n\t\t// get answers for this survey from all users\n\t\t// now do the query for the actual responses...\n\t\t$sql = \"SELECT DISTINCT u.user_id, sa.answers\n\t\t\t\tFROM \" . USERS_TABLE . \" u\n\t\t\t\tINNER JOIN \" . USER_GROUP_TABLE . \" ug ON ug.user_id = u.user_id\n\t\t\t\tINNER JOIN \" . SURVEY_ANSWERS_TABLE . \" sa ON sa.user_id = ug.user_id\n\t\t\t\tWHERE ( (ug.group_id IN ($group_ids) AND ug.user_pending = 0) OR \" . SURVEY_ALL_REGISTERED_USERS . \" IN ($group_ids) )\n\t\t\t\tAND sa.survey_id = $survey_id\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, \"Could not obtain answer data for the survey in this topic\", '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t// fetch all the answer info\n\t\t$answer_info = $db->sql_fetchrowset($result);\n\t\t$db->sql_freeresult($result);\n\n\t\t// count the number of responders\n\t\t$number_of_responders = count($answer_info);\n\n\t\t// cycle through the questions 1 by 1 in order to see if we've hit the cap for each question that has a cap\n\t\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t\t{\n\t\t\tif( $question_response_caps[$i] > 0 )\n\t\t\t{\n\t\t\t\t// if we get here, this question has a cap so loop through the responding users, get their answers and check against the relevant response cap\n\t\t\t\tfor ( $j = 0; $j < $number_of_responders; $j++ )\n\t\t\t\t{\n\t\t\t\t\t// explode all the answers of this user into an answer array\n\t\t\t\t\t$answers = explode(\"|\", $answer_info[$j]['answers']);\n\n\t\t\t\t\t// here, increment the total if the question is answered and supposed to be totalled at the bottom\n\t\t\t\t\tswitch( $question_sums[$i] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"\":\n\t\t\t\t\t\tcase SURVEY_NO_TOTAL:\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_AVERAGE_OF_NUMBERS_IN_REPSONSES:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_NUMBERS_IN_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i] = $total[$i] + $answers[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_MATCHING_TEXT:\n\t\t\t\t\t\t\t// note that I used strtolower to make this case insensitive\n\t\t\t\t\t\t\tif( strtolower($answers[$i]) == strtolower($question_selected_text[$i]) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// now set a flag to indicate for each question whether it can still be answered (i.e. whether we've hit the response cap)\n\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t{\n\t\t$questions_can_be_answered[$i] = ( $question_response_caps[$i] == 0 || $total[$i] < $question_response_caps[$i] || $old_answers[$i] ) ? TRUE : FALSE;\n\t}\n\treturn $questions_can_be_answered;\n}", "public function getSubmits()\n {\n return $this->submits;\n }", "private function users_for_stats() {\n\n\t\t\tif ( ! is_null( $this->users_for_stats ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( is_null( $this->request ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\tif ( empty( $quiz_id ) ) {\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( learndash_is_admin_user() ) {\n\t\t\t\t$this->users_for_stats = array();\n\t\t\t} elseif ( learndash_is_group_leader_user() ) {\n\t\t\t\tif ( learndash_get_group_leader_manage_courses() ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * If the Group Leader can manage_courses they have will access\n\t\t\t\t\t * to all quizzes. So they are treated like the admin user.\n\t\t\t\t\t */\n\t\t\t\t\t$this->users_for_stats = array();\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * Else we need to figure out of the quiz requested is part of a\n\t\t\t\t\t * Course within Group managed by the Group Leader.\n\t\t\t\t\t */\n\t\t\t\t\t$quiz_users = array();\n\t\t\t\t\t$leader_courses = learndash_get_groups_administrators_courses( get_current_user_id() );\n\t\t\t\t\tif ( ! empty( $leader_courses ) ) {\n\t\t\t\t\t\t$quiz_courses = array();\n\t\t\t\t\t\tif ( 'yes' === LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Courses_Builder', 'shared_steps' ) ) {\n\t\t\t\t\t\t\t$quiz_courses = learndash_get_courses_for_step( $quiz_id, true );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$quiz_course = learndash_get_setting( $quiz_id, 'course' );\n\t\t\t\t\t\t\tif ( ! empty( $quiz_course ) ) {\n\t\t\t\t\t\t\t\t$quiz_courses = array( $quiz_course );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $quiz_courses ) ) {\n\t\t\t\t\t\t\t$common_courses = array_intersect( $quiz_courses, $leader_courses );\n\t\t\t\t\t\t\tif ( ! empty( $common_courses ) ) {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * The following will get a list of all users within the Groups\n\t\t\t\t\t\t\t\t * managed by the Group Leader. This list of users will be passed\n\t\t\t\t\t\t\t\t * to the query logic to limit the selected rows.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * This is not 100% accurate because we don't limit the rows based\n\t\t\t\t\t\t\t\t * on the associated courses. Consider if Shared Course steps is\n\t\t\t\t\t\t\t\t * enabled and the quiz is part of two courses and those courses\n\t\t\t\t\t\t\t\t * are associated with multiple groups. And the user is in both\n\t\t\t\t\t\t\t\t * groups. So potentially we will pull in statistics records for\n\t\t\t\t\t\t\t\t * the other course quizzes.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$quiz_users = learndash_get_groups_administrators_users( get_current_user_id() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $quiz_users ) ) {\n\t\t\t\t\t\t$this->users_for_stats = $quiz_users;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If here then non-admin and non-group leader user.\n\t\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\t\tif ( ! empty( $quiz_id ) ) {\n\t\t\t\t\tif ( get_post_meta( $quiz_id, '_viewProfileStatistics', true ) ) {\n\t\t\t\t\t\t$this->users_for_stats = (array) get_current_user_id();\n\t\t\t\t\t\treturn $this->users_for_stats;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t}\n\n\t\t\treturn $this->users_for_stats;\n\t\t}", "public function takeAll(){\n if(isset($_POST['submit'])){\n $post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n // var_dump($post);\n // Messages::setMsg('Answer is submitted', 'success');\n // Check if the answer is correct\n // echo 'session data:';\n\n // Put the submitted chosen answers into an array\n $choices = array();\n // Check the number of questions\n $num_q = count($_SESSION['quiz_data']);\n // Add the choices into an array\n for($i = 0; $i < $num_q; $i++){\n $choices[] = intval($post[\"choice{$i}\"]);\n }\n echo 'CHOICES';\n var_dump($choices);\n echo 'NUMBER OF QUESTIONS IS: ';\n echo $num_q;\n\n // Loop through the answers and count the correct answers\n $score = 0;\n $question = 0;\n foreach($choices as $choice){\n // $indexed_array = array_values($_SESSION['quiz_data']);\n $is_answer = array_values($_SESSION['quiz_data']) [$question][$choice]['is_answer'];\n if($is_answer == 1){\n $score++;\n $question++;\n }\n }\n Messages::setMsg(\"You scored {$score} out of {$num_q}\", 'success');\n return;\n } else {\n // !!! Need to modified, question.user_id does not exist amy more\n $this->query('SELECT questions.content, options.content, options.is_answer FROM questions JOIN users ON questions.user_id = users.id JOIN options ON options.question_id = questions.id WHERE users.id = :user_id');\n // Bind the user_id to the current user id\n $userId = $_SESSION['user_data']['id'];\n $this->bind(':user_id', $userId);\n $rows = $this->resultSetGroup();\n // echo '<pre>';\n // print_r($rows);\n // echo '</pre>';\n // var_dump($rows);\n // print_r($rows);\n // Store $row in session to check the answer once it is submitted\n if($rows){\n $_SESSION['quiz_data'] = $rows;\n } else {\n Messages::setMsg('No quizzes yet', 'error');\n }\n return $rows;\n }\n }", "function getCumulatedResultsDetails($survey_id, $counter, $finished_ids)\n\t{\n\t\tif (count($this->cumulated) == 0)\n\t\t{\n\t\t\tif(!$finished_ids)\n\t\t\t{\n\t\t\t\tinclude_once \"./Modules/Survey/classes/class.ilObjSurvey.php\";\t\t\t\n\t\t\t\t$nr_of_users = ilObjSurvey::_getNrOfParticipants($survey_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t\t}\n\t\t\t$this->cumulated =& $this->object->getCumulatedResults($survey_id, $nr_of_users, $finished_ids);\n\t\t}\n\t\t\n\t\t$output = \"\";\n\t\tinclude_once \"./Services/UICore/classes/class.ilTemplate.php\";\n\t\t$template = new ilTemplate(\"tpl.il_svy_svy_cumulated_results_detail.html\", TRUE, TRUE, \"Modules/Survey\");\n\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question\"));\n\t\t$questiontext = $this->object->getQuestiontext();\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->object->prepareTextareaOutput($questiontext, TRUE));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question_type\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->lng->txt($this->getQuestionType()));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_answered\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_ANSWERED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_skipped\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_SKIPPED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t/*\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode_nr_of_selections\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE_NR_OF_SELECTIONS\"]);\n\t\t$template->parseCurrentBlock();\n\t\t*/\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"categories\"));\n\t\t$categories = \"\";\n\t\tif (is_array($this->cumulated[\"variables\"]))\n\t\t{\n\t\t\tforeach ($this->cumulated[\"variables\"] as $key => $value)\n\t\t\t{\n\t\t\t\t$categories .= \"<li>\" . $value[\"title\"] . \": n=\" . $value[\"selected\"] . \n\t\t\t\t\t\" (\" . sprintf(\"%.2f\", 100*$value[\"percentage\"]) . \"%)</li>\";\n\t\t\t}\n\t\t}\n\t\t$categories = \"<ol>$categories</ol>\";\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $categories);\n\t\t$template->parseCurrentBlock();\n\t\t\n\t\t// add text answers to detailed results\n\t\tif (is_array($this->cumulated[\"textanswers\"]))\n\t\t{\n\t\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"freetext_answers\"));\t\n\t\t\t$html = \"\";\t\t\n\t\t\tforeach ($this->cumulated[\"textanswers\"] as $key => $answers)\n\t\t\t{\n\t\t\t\t$html .= $this->cumulated[\"variables\"][$key][\"title\"] .\"\\n\";\n\t\t\t\t$html .= \"<ul>\\n\";\n\t\t\t\tforeach ($answers as $answer)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<li>\" . preg_replace(\"/\\n/\", \"<br>\\n\", $answer) . \"</li>\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= \"</ul>\\n\";\n\t\t\t}\n\t\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $html);\n\t\t\t$template->parseCurrentBlock();\n\t\t}\t\t\t\n\t\t\n\t\t// chart \n\t\t$template->setCurrentBlock(\"detail_row\");\t\t\t\t\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"chart\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->renderChart(\"svy_ch_\".$this->object->getId(), $this->cumulated[\"variables\"]));\n\t\t$template->parseCurrentBlock();\n\t\t\t\t\n\t\t$template->setVariable(\"QUESTION_TITLE\", \"$counter. \".$this->object->getTitle());\n\t\treturn $template->get();\n\t}", "function survey_data() {\n $surveys = array();\n foreach ( $this->sites as $name => $blog ) {\n $this->println(sprintf(\"Surveying Blog #%s: %s.\", $blog->id, $blog->name));\n $survey = $this->survey_site($blog->id);\n $surveys[$blog->name] = $survey;\n }\n\n // Compile meta survey.\n $posts = array();\n $site_counts = array();\n $meta_survey = array(\n 'posts' => 0,\n 'media-images' => 0,\n 'media-images-sans-alt' => 0,\n 'embedded-images' => 0,\n 'embedded-images-sans-alt' => 0,\n 'embedded-images-sans-media' => 0,\n 'embedded-images-external' => 0\n );\n foreach ( $surveys as $name => $survey ) {\n $posts += $survey['posts'];\n $counts = $survey['counts'];\n $meta_survey['posts'] += $counts['posts'];\n $meta_survey['media-images'] += $counts['media-images'];\n $meta_survey['media-images-sans-alt'] += $counts['media-images-sans-alt'];\n $meta_survey['embedded-images'] += $counts['embedded-images'];\n $meta_survey['embedded-images-sans-alt'] += $counts['embedded-images-sans-alt'];\n $meta_survey['embedded-images-sans-media'] += $counts['embedded-images-sans-media'];\n $site_counts[$name] = $counts;\n }\n\n // Count non-uploaded images\n foreach ( $posts as $post ) {\n $meta_survey['embedded-images-external'] += count($post->external_embedded_images());\n }\n\n $report_f = <<<EOB\nSITES:\n%s\n\nMETA:\n%s\nEOB;\n return sprintf($report_f, print_r($site_counts, 1), print_r($meta_survey, 1));\n }", "public function user_submissions_complete($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some completed surveys return an array of their hashes\n\t\treturn isset(self::$user_submissions['complete']) ? self::$user_submissions['complete'] : array();\n\t}", "function get_user_study_n_collection_requests($survey_id,$user_id,$request_status=NULL)\n\t{\n\t\t$requests=array();\n\t\t\n\t\t//collections that study belong to with DA access enabled\n\t\t$collections=$this->get_study_collections($survey_id);\n\t\t\n\t\tif($collections)\n\t\t{\n\t\t\t//find requests by collection\n\t\t\tforeach($collections as $collection)\n\t\t\t{\n\t\t\t\t$result=$this->get_user_collection_requests($user_id,$collection['repositoryid'],$request_status);\n\t\t\t\t\n\t\t\t\tif($result)\n\t\t\t\t{\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$requests[]=$row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//find requests by study\n\t\t$result=$this->get_user_study_requests($survey_id,$user_id);\n\t\t\n\t\tif ($result)\n\t\t{\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$requests[]=$row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $requests;\n\t}", "private function get_all_circleci_submissions($submissionid) {\n global $DB;\n return $DB->get_records('assignsubmission_circleci', array('submission'=>$submissionid));\n }", "function latestAnswers($patientId) {\n // Get Sessions\n $sessions = $this->SurveySession->find('all', array(\n 'conditions' => array(\n 'SurveySession.patient_id' => $patientId,\n 'SurveySession.finished' => true,\n ),\n 'order' => array(\n 'SurveySession.reportable_datetime DESC',\n )));\n\n // Get All Questionnaires in the DB\n $questionnaireModel = ClassRegistry::init('Questionnaire');\n $questionnaires = $questionnaireModel->find('all', array(\n 'fields' => array('id'),\n 'recursive' => -1));\n\n // This data structure will hold all the latest answers by questionnaire\n $questionnaireHash = array();\n foreach ($questionnaires as $questionnaire) {\n $questionnaireHash[$questionnaire[\"Questionnaire\"][\"id\"]] = null;\n }\n\n // Loop through each session\n foreach ($sessions as $session) {\n // Get survey data (answers) from the session\n\n //$surveyData = $this->SurveySession->questionnaireResponseData($session[\"SurveySession\"][\"id\"]);\n $surveyData = $this->SurveySession->surveyData($session[\"SurveySession\"][\"id\"]); // this is currently reliable, but will need a refactor to qRD plus transforming text below. Affects the Substitutional stuff for Module D in PTSM Paintracker.\n //$questionnaireResourcesFHIR = FHIR::questionnaireAsFHIR( $surveyData, $session, true);\n //echo (\"size: \" . sizeof($questionnaireResourcesFHIR[0]));\n\n // Sort the answers by questionnaire\n $surveyDataByQuestionnaire = array();\n foreach ($surveyData as $answerObj) {\n $questionnaireId = $answerObj[\"Questionnaire\"][\"id\"];\n $questionId = $answerObj[\"Answer\"][\"question_id\"];\n $bareAnswer = array(\n \"Answer\" => $answerObj[\"Answer\"],\n \"Option\" => $answerObj[\"Option\"],\n );\n // Save data in surveyDataByQuestionnaire, create new array if necessary\n if (!array_key_exists($questionnaireId, $surveyDataByQuestionnaire)) {\n $surveyDataByQuestionnaire[$questionnaireId] = array();\n }\n $surveyDataByQuestionnaire[$questionnaireId][$questionId] = $bareAnswer;\n //array_push($surveyDataByQuestionnaire[$questionnaireId], $bareAnswer);\n }\n // Move latest answers into questionnaireHash \n foreach ($questionnaireHash as $qnid => $qn) {\n if (sizeof($qn) == null && array_key_exists($qnid, $surveyDataByQuestionnaire)) {\n $questionnaireHash[$qnid] = $surveyDataByQuestionnaire[$qnid];\n }\n }\n }\n\n return $questionnaireHash;\n }", "public function getSubmissions($filters = array())\n {\n // filter date\n if (isset($filters['date'])) {\n\n switch ($filters['date']) {\n case 'LAST_DAY':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 days\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_WEEK':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 week\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_14DAYS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-2 week\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_MONTH':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_6_MONTHS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-6 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_YEAR':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-12 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_18_MONTHS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-18 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n }\n }\n\n $getSubmissionsService = $this->limsApiFactory->newGetSubmissionsService();\n $result = $getSubmissionsService->execute($filters);\n\n // paginate\n $this->limsPaginator = new LimsPagination($result, self::PER_PAGE, isset($filters['page']) ? $filters['page'] : 1);\n $this->limsPaginator->paginate();\n\n return $this->limsPaginator->currentItems;\n }", "public function get_submitted_quiz_of_student_for_teacher($quiz_id) {\n\t\t\t$sql = \"SELECT *\n\t\t\t\t\tFROM quiz_list\n\t\t\t\t\tINNER JOIN quiz_submissions \n\t\t\t\t\tON quiz_list.id = quiz_submissions.quiz_id\n\t\t\t\t\tWHERE quiz_list.id = :quiz_id \n\t\t\t\t\tAND quiz_list.status = 'enabled'\n\t\t\t\t\tAND quiz_submissions.teacher_remark NOT LIKE 'hide'\";\n\t\t\t$check_query = PDO::prepare($sql);\n\t\t\t$check_query->execute(['quiz_id'=>$quiz_id]);\n\t\t\t// echo print_r($check_query->errorInfo());\n\t\t\treturn $record_array = $check_query->fetch(PDO::FETCH_ASSOC);\n\n\t\t}", "public function index()\n\t{\n\t\t//User based filtering\n\t\t$user = $this->apiKey->guestUser;\n\t\t$survey_ids_taken = TrackSurvey::where('users_id', $user->id)->groupBy('surveys_id')->lists('surveys_id');\n\n\t\t//Question count\n\t\t// return $survey_ids_taken;\n\t\t\n\t\ttry {\n\t\t\t//inserting custom key-val\n\t\t\t$surveys = Survey::all();\n\t\t\tforeach($surveys as $survey){\n\t\t\t\t$survey->is_taken = in_array($survey->id, $survey_ids_taken) ? '1':'0';\n\t\t\t\t$survey->mcq_count = Question::where('surveys_id', $survey->id)->where('type', 'mcq')->count();\n\t\t\t\t$survey->wr_count = Question::where('surveys_id', $survey->id)->where('type', 'written')->count();\n\t\t\t\t$survey->taken_by = TrackSurvey::where('surveys_id', $survey->id)->groupBy('users_id')->lists('users_id');\t\t\t\n\t\t\t}\n\n\t\t\t// return $surveys;\n\t\t\treturn Fractal::collection($surveys, new SurveyTransformer);\n\t\t\n\t\t} catch (Exception $e) {\n \n \treturn $this->response->errorGone();\n\t\t\t\n\t\t}\n\t}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public static function getChallenges($session) \n {\n \n KorisnikModel::updateWrapper($session->get('user')->summonerName);\n \n $uQModel = new UserQuestModel();\n $qModel = new QuestModel();\n $uQ = $uQModel->where('summonerName', $session->get('user')->summonerName)->findAll();\n $poroUser = count($uQModel->where('summonerName', $session->get('user')->summonerName)->where('completed', 1)->findAll());\n $poroTotal = count($qModel->findAll());\n\n $data = [\n 'poroUser' => $poroUser,\n 'poroTotal' => $poroTotal,\n 'quests' => []\n ];\n \n foreach ($uQ as $userQuest) {\n $quest = $qModel->find($userQuest->questId);\n $dataQuest = [\n 'id' => $userQuest->questId,\n 'title' => $quest->title,\n 'description' => $quest->description,\n 'image' => $quest->image,\n 'completed' => $userQuest->completed,\n 'attributes' => QuestAttributeModel::getAttributes($quest->questId)\n ];\n \n \n $questRequired = null;\n $preReqSatisfied = true;\n foreach($dataQuest['attributes'] as $atr){\n if($atr->attributeKey == 'Prerequisite Id'){\n $questRequired = intval($atr->attributeValue);\n $preReQuest = $uQModel->where('questId', $questRequired)->where('summonerName',$session->get('user')->summonerName)->find();\n if($preReQuest[0]->completed == 0){\n $preReqSatisfied = false;\n break;\n } \n } \n }\n \n if($preReqSatisfied == false){ \n continue;\n }\n // $dataQuest['attributes'];\n array_push($data['quests'], $dataQuest);\n }\n return $data;\n }", "public function getResponses()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t$query = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tdatetime\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[] = $row;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "function &_getGlobalSurveyData($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\t$result = array();\n\t\tif (($survey->getTitle()) and ($survey->author) and (count($survey->questions)))\n\t\t{\n\t\t\t$result[\"complete\"] = true;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\t$result[\"complete\"] = false;\n\t\t}\n\t\t$result[\"evaluation_access\"] = $survey->getEvaluationAccess();\n\t\treturn $result;\n\t}", "public function scopeSubmitted($query)\n {\n return $query->whereNotIn('status', ['incomplete', 'canceled']);\n }", "public function index($survey_id)\n\t{\n\t\t$questions = Survey::find($survey_id)->questions;\n\n\t\treturn Fractal::collection($questions, new QuestionTransformer);\n\t}", "public function submissions($client_form_id)\n { \n $submissions = Pedim_consent_for_rapid_covid19_testings::all()->where('client_forms_id', $client_form_id);\n //dd($submissions);\n $client_id = Client_forms::all()->where('id', $client_form_id)->first()->clients_id; \n return view('forms.pedim.pedim-consent-for-rapid-covid-19-testing.submissions')->with(array('submissions'=>$submissions,'client_id'=>$client_id)); \n //\n }", "public function getSendMailings() {\n\t\t$sql = 'SELECT pageId, UNIX_TIMESTAMP(dateadded) as `dateadded` FROM mailqueue WHERE issend=2';\n\t\t$ids = $this -> _conn -> getFields($sql);\n\t\t$rows = $this -> _conn -> getRows($sql);\n\t\t$page = new Page();\n\t\t$result = $page -> getPagesByIds($ids, true);\n\t\tif($result) {\n\t\t\tforeach($result as $page) {\n\t\t\t\tforeach($rows as $row) {\n\t\t\t\t\tif($row -> pageId == $page -> pageId) {\n\t\t\t\t\t\t$page -> publicationdate = $row -> dateadded;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function getMailsReadyForSending()\n {\n $qb = $this->doctrine->getEntityManager()->createQueryBuilder();\n $result = $qb->select('a')\n ->from('MailerBundle:MailQueue', 'a')\n ->where('a.status = :pending_status')\n ->andWhere('a.sendAt <= CURRENT_TIMESTAMP()')\n ->setParameter('pending_status', MailStatuses::PENDING)\n ->getQuery()\n ->getResult();\n \n return $result;\n }", "function get_surveys_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND created_by = '$user_id';\";\r\n\r\n $surveys_data = array();\r\n $surveys = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function multiSearchIndex(Request $request)\n {\n $status = is_null($request->input('status'))?true:$request->input('status');\n $department = is_null($request->input('department'))?$request->input('department'):Helper::escapeLikeForQuery($request->input('department'));\n $course_name = is_null($request->input('course_name'))?$request->input('course_name'):Helper::escapeLikeForQuery($request->input('course_name'));\n $course_code = is_null($request->input('course_code'))?$request->input('course_code'):Helper::escapeLikeForQuery($request->input('course_code'));\n $semester = is_null($request->input('semester'))?$request->input('semester'):Helper::escapeLikeForQuery($request->input('semester'));\n $school = is_null($request->input('school'))?$request->input('school'):Helper::escapeLikeForQuery($request->input('school'));\n $year = is_null($request->input('year'))?$request->input('year'):Helper::escapeLikeForQuery($request->input('year'));\n\n $past_questions = PastQuestion::where('approved', $status)\n ->where('department', 'like', '%'.$department.'%')\n ->where('course_name', 'like', '%'.$course_name.'%')\n ->where('course_code', 'like', '%'.$course_code.'%')\n ->where('semester', 'like', '%'.$semester.'%')\n ->where('school', 'like', '%'.$school.'%')\n ->where('year', 'like', '%'.$year.'%')\n ->orderBy('created_at', 'desc')\n ->take(100)\n ->paginate(10);\n\n if ($past_questions) {\n \n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }", "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function lecturesWithoutKritter($survey, $daysInFuture=1) {\n\t\tif ($daysInFuture>0) {\n\t\t\t$dateLimit = time() + $daysInFuture*24*60*60;\n\t\t\t$dateLimitWhere = ' AND eval_date_fixed < '.$dateLimit.' ';\n\t\t}\n\t\telse $dateLimitWhere = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM tx_fsmivkrit_lecture\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE deleted=0 AND hidden=0\n\t\t\t\t\t\t\t\t\t\t\t\t AND survey='.$survey.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_1=0 OR kritter_feuser_1 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_2=0 OR kritter_feuser_2 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_3=0 OR kritter_feuser_3 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_4=0 OR kritter_feuser_4 IS NULL) '.\n\t\t\t\t\t\t\t\t\t\t\t\t $dateLimitWhere.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND eval_date_fixed > '.time().'\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY eval_date_fixed');\n\n\t\t$lectures = array ();\n\t\twhile ($res && $row = mysql_fetch_assoc($res))\n\t\t\t$lectures[] = $row['uid'];\n\n\t\treturn $lectures;\n\t}", "public function getFormSubmissions($formId, array $submissionDetails)\n {\n $response = $this->client->request(\"GET\", \"form/$formId/submissions\", $submissionDetails);\n return $response[\"content\"];\n }", "public function &getSurveyQuestions($with_answers = false)\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_qtype.type_tag, svy_qtype.plugin, svy_question.question_id, \".\n\t\t\t\"svy_svy_qst.heading FROM svy_qtype, svy_question, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \" .\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$add = true;\n\t\t\tif ($row[\"plugin\"])\n\t\t\t{\n\t\t\t\tif (!$this->isPluginActive($row[\"type_tag\"]))\n\t\t\t\t{\n\t\t\t\t\t$add = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($add)\n\t\t\t{\n\t\t\t\t$question =& $this->_instanciateQuestion($row[\"question_id\"]);\n\t\t\t\t$questionrow = $question->_getQuestionDataArray($row[\"question_id\"]);\n\t\t\t\tforeach ($row as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questionrow[$key] = $value;\n\t\t\t\t}\n\t\t\t\t$all_questions[$row[\"question_id\"]] = $questionrow;\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"usableForPrecondition\"] = $question->usableForPrecondition();\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"availableRelations\"] = $question->getAvailableRelations();\n\t\t\t\tif (array_key_exists($row[\"question_id\"], $obligatory_states))\n\t\t\t\t{\n\t\t\t\t\t$all_questions[$row[\"question_id\"]][\"obligatory\"] = $obligatory_states[$row[\"question_id\"]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst WHERE \" .\n\t\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \" .\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif ($with_answers)\n\t\t\t{\n\t\t\t\t$answers = array();\n\t\t\t\t$result = $ilDB->queryF(\"SELECT svy_variable.*, svy_category.title FROM svy_variable, svy_category \" .\n\t\t\t\t\t\"WHERE svy_variable.question_fi = %s AND svy_variable.category_fi = svy_category.category_id \".\n\t\t\t\t\t\"ORDER BY sequence ASC\",\n\t\t\t\t\tarray('integer'),\n\t\t\t\t\tarray($question_id)\n\t\t\t\t);\n\t\t\t\tif ($result->numRows() > 0) \n\t\t\t\t{\n\t\t\t\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($answers, $data[\"title\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id][\"answers\"] = $answers;\n\t\t\t}\n\t\t}\n\t\treturn $all_questions;\n\t}", "public function submit(Request $request, $id)\n {\n if($id != $request->input('survey_id')) {\n if($request->has('return_url')\n && strlen($request->input('return_url'))>5) {\n return response()\n ->header('Location', $request->input('return_url'));\n }\n }\n\n $survey = \\App\\Survey::find($id);\n $answerArray = array();\n $validationArray = array();\n $messageArray = array();\n\n //loop through questions and check for answers\n foreach($survey->questions as $question) {\n if($question->required)\n {\n $validationArray['q-' . $question->id] = 'required';\n $messageArray['q-' . $question->id . '.required'] = $question->label . ' is required';\n }\n if($request->has('q-' . $question->id)) {\n if(is_array($request->input('q-' . $question->id)) && count($request->input('q-' . $question->id))) {\n $answerArray[$question->id] = array(\n 'value' => implode('|', $request->input('q-' . $question->id)),\n 'question_id' => $question->id\n );\n } elseif ( strlen(trim($request->input('q-' . $question->id))) > 0) {\n\n $answerArray[$question->id] = array(\n 'value'=> $request->input('q-' . $question->id),\n 'question_id'=>$question->id\n );\n\n } // I guess there is an empty string\n }\n }\n\n\n\n $this->validate($request, $validationArray, $messageArray);\n\n //if no errors, submit form!\n if(count($answerArray) > 0) {\n $sr = new \\App\\SurveyResponse(['survey_id'=>$id, 'ip'=>$_SERVER['REMOTE_ADDR']]);\n $sr->save();\n foreach($answerArray as $qid => $ans) {\n // print_r($ans);\n $sr->answers()->create($ans);\n }\n }\n\n\n if($survey->return_url\n && strlen($survey->return_url)>5\n && !$survey->kiosk_mode ) {\n return redirect()->away($survey->return_url);\n } else {\n return redirect('thanks/' . $survey->id);\n }\n }", "function learndash_update_submitted_essay_data( $quiz_id, $question_id, $essay, $submitted_essay ) {\n\t$users_quiz_data = get_user_meta( $essay->post_author, '_sfwd-quizzes', true );\n\n\tif ( ( $essay ) && ( is_a( $essay, 'WP_Post' ) ) ) {\n\t\t$essay_quiz_time = get_post_meta( $essay->ID, 'quiz_time', true );\n\t} else {\n\t\t$essay_quiz_time = null;\n\t}\n\n\t$quizdata_changed = array();\n\n\tforeach ( $users_quiz_data as $quiz_key => $quiz_data ) {\n\t\t// We check for a match on the quiz time from the essay postmeta first. \n\t\t// If the essay_quiz_time is not empty and does NOT match then continue;\n\t\tif ( ( absint( $essay_quiz_time ) ) && ( isset( $quiz_data['time'] ) ) && ( absint( $essay_quiz_time ) !== absint( $quiz_data['time'] ) ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif ( $quiz_id != $quiz_data['pro_quizid'] || ! isset( $quiz_data['has_graded'] ) || false == $quiz_data['has_graded'] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tforeach ( $quiz_data['graded'] as $question_key => $graded_question ) {\n\t\t\tif ( ( $question_key == $question_id ) && ( $essay->ID == $graded_question['post_id'] ) ) {\n\t\t\t\t$users_quiz_data[ $quiz_key ]['graded'][ $question_key ] = $submitted_essay;\n\t\t\t\tif ( ( isset( $submitted_essay['status'] ) ) && ( 'graded' === $submitted_essay['status'] ) ) {\n\t\t\t\t\t$quizdata_changed[] = $users_quiz_data[ $quiz_key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate_user_meta( $essay->post_author, '_sfwd-quizzes', $users_quiz_data );\n\n\t/**\n\t * Perform action after essay response data is updated\n\t */\n\tdo_action( 'learndash_essay_response_data_updated', $quiz_id, $question_id, $essay, $submitted_essay );\n}", "function dev_get_submission_pages() {\n\n\t$submission = dev_get_option( 'ticket_submit' );\n\n\tif ( ! is_array( $submission ) ) {\n\t\t$submission = array_filter( (array) $submission );\n\t}\n\n\treturn $submission;\n\n}", "function get_request_approved_surveys($request_id)\n\t{\n\t\t$this->db->select('resources.survey_id');\n\t\t$this->db->join('resources', 'lic_file_downloads.fileid= resources.resource_id');\n\t\t$this->db->where('lic_file_downloads.requestid',$request_id);\n\t\t$result=$this->db->get('lic_file_downloads')->result_array();\n\t\t\n\t\tif (!$result)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$output=array();\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$output[]=$row['survey_id'];\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public static function getSubmissions(array $users, $limit = 5) {\n return self::getItems($users, $limit, 'submitted');\n }", "public function is_progress($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n foreach ($this->questions as $question) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestion $existing */\n $existing = DB::table('site_survey_questions')\n ->where('name', $question['name'])\n ->first();\n\n if (!$existing) {\n $questionId = DB::table('site_survey_questions')\n ->insertGetId([\n 'name' => $question['name'],\n ]);\n\n if (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $questionId,\n 'name' => $option,\n ]);\n }\n }\n } elseif (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestionOption $existingOption */\n $existingOption = DB::table('site_survey_question_options')\n ->where('name', $option)\n ->where('site_survey_question_id', $existing->id)\n ->first();\n\n if (!$existingOption) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $existing->id,\n 'name' => $option,\n ]);\n }\n }\n }\n }\n }", "public function personalIndex(Request $request)\n {\n /**\n * Past questions are being returned with both approved and unapproved past questions\n * Unapproved past questions should be separated during render\n */\n if ($request->input('status')){\n \n // Get all past questions that are active/approved or inactive/unapproved\n $past_questions = PastQuestion::where('approved', (boolean)$request->input('status'))\n ->where('uploaded_by', auth()->user()->id)\n ->with(['image','document','comment',])\n ->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('properties')){\n \n // Get all past questions with all their relations\n $past_questions = PastQuestion::where('uploaded_by', auth()->user()->id)\n ->with(['image','document','comment',])\n ->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } elseif ($request->input('deleted')){\n\n // Get all deleted past questions with all their relations\n $past_questions = PastQuestion::where('uploaded_by', auth()->user()->id)\n ->onlyTrashed()\n ->with(['image','document','comment',])\n ->orderBy('created_at', 'desc')\n ->take(500)\n ->paginate(10);\n\n } else {\n\n // Get all past questions with out their relations\n $past_questions = PastQuestion::where('uploaded_by', auth()->user()->id)\n ->orderBy('created_at', 'desc')\n ->paginate(10);\n }\n\n if ($past_questions) {\n \n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }", "public function createOfficialsSurvey()\n {\n return $this->mailer->createOfficialsSurvey($this->data);\n }", "public static function submitted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->submitted();\n }", "function get_simple_form_submissions() {\n global $wpdb;\n $table_name = $wpdb->prefix . 'content_submissions';\n\n $sql = \"SELECT * FROM $table_name\";\n $results = $wpdb->get_results( $sql );\n\n return $results;\n}", "public function generateReport($reportRunningStatusId, $surveyId, $personId, $reportRunningDto)\n {\n $reportRunningStatus = $this->reportsRunningStatusRepository->find($reportRunningStatusId);\n $reportStudentIds = $reportRunningStatus->getFilteredStudentIds();\n $organizationId = $reportRunningStatus->getOrganization()->getId();\n $personObject = $reportRunningStatus->getPerson();\n $reportObject = $reportRunningStatus->getReports();\n $personName = [];\n $reportFilter = [];\n\n // ISQ - Org Questions End\n $organizationLanguage = $this->organizationLangRepository->findOneBy([\n 'organization' => $organizationId\n ]);\n $organization = $organizationLanguage->getOrganization();\n $searchAttributes = $reportRunningDto->getSearchAttributes();\n\n // Filtered Questions from optional filters\n $surveyQuestions = $this->getSelectedSurveyQuestionsForReport($searchAttributes);\n $questionsWithDataBlockId = $this->surveyQuestionRepository->getDataBlockQuestionsBasedPermission($organizationId, $personId, $surveyId, $surveyQuestions, true);\n $descriptiveQuestions = $scaledQuestions = $numericQuestions = [];\n\n if (count($questionsWithDataBlockId) > 0) {\n if (!empty($reportStudentIds)) {\n $ebiQuestionPermissions = $this->getStudentsAssociatedWithDataBlocks($reportStudentIds, $personId, $organizationId, $questionsWithDataBlockId);\n if (count($ebiQuestionPermissions) > 0) {\n $scaledQuestions = $this->getScaledCategoryQuestions($surveyId, $reportRunningStatusId, $ebiQuestionPermissions, $personId);\n $descriptiveQuestions = $this->getDescriptiveQuestions($surveyId, $reportRunningStatusId, $ebiQuestionPermissions, $personId);\n $numericQuestions = $this->getNumericQuestions($surveyId, $reportRunningStatusId, $ebiQuestionPermissions, $personId);\n }\n }\n }\n $scaledOrganizationQuestions = $descriptiveOrgQuestions = $numericOrgQuestions = [];\n $organizationMultipleResponse = [];\n\n if (!empty($reportStudentIds)) {\n $orgQuestionPermissions = $this->fetchStudentsPermittedOrgQuestions($reportStudentIds, $personId, $organizationId);\n if (count($orgQuestionPermissions) > 0) {\n $organizationMultipleResponse = $this->getMultiResponseQuestions($surveyId, $reportRunningStatusId, $orgQuestionPermissions, $personId);\n $scaledOrganizationQuestions = $this->getScaledCategoryQuestions($surveyId, $reportRunningStatusId, $orgQuestionPermissions, $personId, 'orgQuestions');\n $descriptiveOrgQuestions = $this->getDescriptiveQuestions($surveyId, $reportRunningStatusId, $orgQuestionPermissions, $personId, 'orgQuestions');\n $numericOrgQuestions = $this->getNumericQuestions($surveyId, $reportRunningStatusId, $orgQuestionPermissions, $personId, 'orgQuestions');\n }\n\n if (empty($organizationLanguage)) {\n $error = ['error' => 'Organization Language not found'];\n $responseJSON = $this->serializer->serialize($error, 'json');\n $reportRunningStatus->setStatus('F');\n $reportRunningStatus->setResponseJson($responseJSON);\n $this->reportsRunningStatusRepository->flush();\n $this->createReportNotification($reportRunningStatus);\n return false;\n } else {\n\n $surveyQuestions = $descriptiveQuestions + $scaledQuestions + $numericQuestions + $organizationMultipleResponse + $scaledOrganizationQuestions + $descriptiveOrgQuestions + $numericOrgQuestions;\n\n if (empty($surveyQuestions)) {\n $reportData['status_message'] = [\n 'code' => ReportsConstants::REPORT_NO_DATA_CODE,\n 'description' => ReportsConstants::REPORT_NO_DATA_MESSAGE\n ];\n } else {\n ksort($surveyQuestions);\n $surveyQuestions = array_values($surveyQuestions);\n\n $reportInfoDto = new ReportInfoDto();\n $reportInfoDto->setReportId($reportObject->getId());\n $reportInfoDto->setReportInstanceId($reportRunningStatusId);\n $reportInfoDto->setReportName($reportObject->getName());\n $reportInfoDto->setReportDescription($reportObject->getDescription());\n $reportInfoDto->setReportDate($reportRunningStatus->getCreatedAt());\n $students = explode(',', $reportStudentIds);\n $totalStudents = count($students);\n $reportInfoDto->setTotalStudents($totalStudents);\n $reportInfoDto->setShortCode($reportObject->getShortCode());\n $reportInfoDto->setReportDisable($reportObject->getIsActive());\n $personName['first_name'] = $personObject->getFirstname();\n $personName['last_name'] = $personObject->getLastname();\n $reportInfoDto->setReportBy($personName);\n $reportFilter['numeric'] = true;\n $reportFilter['categorical'] = true;\n $reportFilter['scaled'] = true;\n $reportFilter['long_answer'] = true;\n $reportFilter['short_answer'] = true;\n $reportInfoDto->setReportFilter($reportFilter);\n\n $organizationInformationArray = array(\n 'campus_id' => $organizationId,\n 'campus_name' => $organizationLanguage->getOrganizationName(),\n 'campus_logo' => $organization->getLogoFileName(),\n 'campus_color' => $organization->getPrimaryColor()\n );\n $reportData['report_info'] = $reportInfoDto;\n $reportData['campus_info'] = $organizationInformationArray;\n $reportData['sections'] = $surveyQuestions;\n }\n }\n } else {\n $reportData['status_message'] = [\n 'code' => ReportsConstants::REPORT_OPTIONAL_FILTERS_TOO_RESTRICTIVE_CODE,\n 'description' => ReportsConstants::REPORT_OPTIONAL_FILTERS_TOO_RESTRICTIVE_MESSAGE\n ];\n }\n $reportData['request_json'] = $reportRunningDto;\n $reportData['report_instance_id'] = $reportRunningStatusId;\n $responseJSON = $this->serializer->serialize($reportData, 'json');\n $reportRunningStatus->setStatus('C');\n $reportRunningStatus->setResponseJson($responseJSON);\n $this->reportsRunningStatusRepository->flush();\n $this->createReportNotification($reportRunningStatus);\n }", "public function filledSurveys(){\n return $this->hasMany(FilledSurvey::class);\n }", "public function getAnsweredQuestions($userId, $surveyId) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.id' => $surveyId, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "public function do_findPossibleScores($postData)\n {\n $this->checkIsAdmin();\n $form = new \\Foundation\\Form;\n $field = $form->newField();\n $field->setLegend('Find Matching Scores for ' . $this->_applicant->getFullName());\n \n $existingScores = array();\n foreach($this->getAnswers() as $answer){\n $date = strtotime($this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getJazzeeElement()->displayValue($answer));\n $uniqueId = \n $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getJazzeeElement()->displayValue($answer) .\n $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getJazzeeElement()->displayValue($answer) .\n date('m', $date) . date('Y', $date); \n $existingScores[$uniqueId] = $answer;\n \n }\n \n $element = $field->newElement('CheckboxList', 'greMatches');\n $element->setLabel('Possible GRE');\n \n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findByName(substr($this->_applicant->getFirstName(), 0, 2) . '%', substr($this->_applicant->getLastName(), 0, 3) . '%') as $score) {\n $uniqueId = $score->getRegistrationNumber() . 'GRE/GRE Subject' . $score->getTestDate()->format('m') . $score->getTestDate()->format('Y');\n if(!array_key_exists($uniqueId, $existingScores)){\n $element->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleInitial() . ' ' . $score->getTestDate()->format('m/d/Y'));\n } else {\n if(!$existingScores[$uniqueId]->getGREScore()) {\n $element->addMessage('The system found at least one match for a GRE score the applicant had previously entered. You may need to refresh this page to view that match.');\n $this->matchScore($existingScores[$uniqueId]);\n }\n }\n }\n\n $element = $field->newElement('CheckboxList', 'toeflMatches');\n $element->setLabel('Possible TOEFL');\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findByName(substr($this->_applicant->getFirstName(), 0, 2) . '%', substr($this->_applicant->getLastName(), 0, 3) . '%') as $score) {\n $uniqueId = $score->getRegistrationNumber() . 'TOEFL' . $score->getTestDate()->format('m') . $score->getTestDate()->format('Y');\n if(!array_key_exists($uniqueId, $existingScores)){\n $element->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleName() . ' ' . $score->getTestDate()->format('m/d/Y'));\n } else {\n if(!$existingScores[$uniqueId]->getTOEFLScore()) {\n $element->addMessage('The system found at least one match for a TOEFL score the applicant had previously entered. You may need to refresh this page to view that match.');\n $this->matchScore($existingScores[$uniqueId]);\n }\n }\n }\n $form->newButton('submit', 'Match Scores');\n if (!empty($postData)) {\n //create a blank for so it can get values from parent::newAnswer\n $this->_form = new \\Foundation\\Form();\n if ($input = $form->processInput($postData)) {\n if ($input->get('greMatches')) {\n foreach ($input->get('greMatches') as $scoreId) {\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->find($scoreId);\n $arr = array(\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getId() => $score->getRegistrationNumber(),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getId() => $score->getTestDate()->format('c'),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getId() => $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getItemByValue('GRE/GRE Subject')->getId()\n );\n $newInput = new \\Foundation\\Form\\Input($arr);\n $this->newAnswer($newInput);\n }\n }\n if ($input->get('toeflMatches')) {\n foreach ($input->get('toeflMatches') as $scoreId) {\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->find($scoreId);\n $arr = array(\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getId() => $score->getRegistrationNumber(),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getId() => $score->getTestDate()->format('c'),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getId() => $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getItemByValue('TOEFL')->getId()\n );\n $newInput = new \\Foundation\\Form\\Input($arr);\n $this->newAnswer($newInput);\n }\n }\n $this->_controller->setLayoutVar('status', 'success');\n } else {\n $this->_controller->setLayoutVar('status', 'error');\n }\n }\n\n return $form;\n }", "public function getWhenSubmitted()\n {\n $when_submitted = new DateTime($this->when_submitted, new DateTimeZone('UTC'));\n \n // Adjust the UTC time based on the user's current time zone offset.\n $when_submitted->sub(new DateInterval('PT' . BaseUser::getTimeZoneOffset() . 'M'));\n $resulting_format = 'Y-M-d h:i a';\n \n // if more than more than a week ago, give date without time.\n // This mitigates a time zone change problem where times before a\n // change will display with the new offset.\n $diff_from_now = (new DateTime(\"now\"))->diff($when_submitted);\n if (intval($diff_from_now->format('%a')) > 7) {\n $resulting_format = 'Y-M-d';\n }\n \n return $when_submitted->format($resulting_format);\n }", "public function submissions();", "public function pi_process_staff_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'currently-employed':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Are you currently employed with this treatment center? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'how-long':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'How long have you been employed there? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'full-time-or-contractor':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Do you work at the treatment center full time or an independent contractor or a consultant? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'licensed-medical-professionals':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'How many licensed medical professionals work at the facility full-time? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'medical-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the center’s medical staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'health-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the mental health staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'addiction-treatment-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the center\\'s addiction treatment staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'marketing-pr-fairness':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Fairness and honesty in terms of advertising, marketing and public relations ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'community':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Ability to manage fairly and inspire a sense of community ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "function fetchAllForms () {\n global $wpdb;\n $table_name = $wpdb->prefix . \"dx_forms_meta_data\";\n $dbResults = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\n echo \"<h1>All forms</h1>\";\n\n // loop through all forms\n foreach ($dbResults as $row) {\n ?>\n <div>Last updated on: <?= date(\"F j, Y. g:i A\",strtotime($row->timestamp)) ?></div>\n <div><?= $row->form_name ?></div>\n <h3>Form submissions</h3>\n <?php\n // get field mappings (ID to name) from DB row\n $field_mappings = json_decode($row->field_mappings, true);\n \n $this->fetchFormSubmissions($row->form_id, $field_mappings);\n }\n\n echo \"<hr>\";\n }", "public function index()\n {\n /*member variables*/\n $options = \"\";\n $optionValue = \"\";\n /* confirm if user had logged in in before and started a survey*/\n $user = Auth::user();\n $answer = Answer::where('user_id','=',$user->id)->get()->last();\n\n if( $answer != \"\" ){\n $question_id = $answer->question_id;\n $answer_string = $answer->string;\n\n /*get next question using function getNextQuestion in answer controller*/\n $displayQuestion = app('App\\Http\\Controllers\\AnswerController')->getNextQuestion($question_id,$answer_string);\n\n return $displayQuestion;\n /* use post question to work */\n }else{\n /*if user has never done a the survey before get first question*/\n /*fetch every paths*/\n $paths = Path::get(['id', 'name', 'sequence']);\n If( sizeof($paths)>0 ) {\n // fetch path where sequence == 1\n $sequence = \"1\";\n $path_id = \"\";\n $paths = Path::where('sequence',$sequence)->get(['id', 'name', 'sequence']);\n foreach( $paths as $path ){\n $path_id = $path->id;\n }\n $questions = Question::where('path_id' , '=' ,$path_id/*[['sequence', '=', $sequence], ['path_id', '=', 1]]*/)\n ->get(['id', 'string', 'sequence', 'path_id', 'user_id', 'progress', 'is_dichotomous', 'is_optional', 'has_options']);\n foreach ($questions as $questions) {\n /* use question id to pluck options for this specific question id*/\n $question_id = $questions->id;\n $sequence = $questions->sequence;\n /* if has options get the options div displays */\n if( $questions->has_options == true ){\n $input_type = \"option\";\n /*get the div displays*/\n $optionValue = app('App\\Http\\Controllers\\InputController')->index($input_type,$question_id);\n /*get the options*/\n $options = Option::where('question_id', $question_id)->pluck('options_string');\n\n }elseif ( $questions->has_multiple == true ){\n\n echo(\"get has multiple values\");\n\n }else if ( $questions->has_options == false && $questions->has_multiple == false ){\n\n echo(\"both values of has multiple and has options is false\");\n\n }else{\n\n echo(\"no reasonable input type \");\n\n }\n /* creating a new collection instance to fit our required output*/\n $question = new Collection;\n\n $question->push([\n 'id' => $questions->id,\n 'string' => $questions->string,\n 'sequence' => $sequence,\n 'options' => $options,\n 'optionValue' => $optionValue,\n\n ]);\n $question = $question[0];\n $question = json_encode($question);\n\n return $question;\n\n }\n\n }\n else{\n echo \"CANNOT COMPLETE REQUEST\";\n }\n }\n\n\n }", "public function getFormValues()\n {\n $validator = App::make(SubmitForm::class);\n return $validator->getSubmissions();\n }", "public function listPendingSubmissions(Request $request) {\n\t\t$pager = $this->pager($request, $this->getDoctrine()->getRepository(JokeSubmission::class)->findPending());\n\t\treturn $this->render('Joke/listSubmissions.html.twig', ['pager' => $pager]);\n\t}", "public function getMultiResponseQuestions($surveyId, $reportRunningStatusId, $ebiQuestionPermissions, $personId)\n {\n $reportRunningStatus = $this->reportsRunningStatusRepository->find($reportRunningStatusId);\n $reportStudentIds = $reportRunningStatus->getFilteredStudentIds();\n $reportStudentIds = explode(',', $reportStudentIds);\n $questionsResponse = [];\n $questionOptions = [];\n\n if (!empty($reportStudentIds)) {\n $organizationId = $reportRunningStatus->getOrganization()->getId();\n $surveyQuestions = $this->orgQuestionResponseRepository->getMultiResponseISQCalculatedResponses($surveyId, $reportStudentIds, $organizationId, array_keys($ebiQuestionPermissions));\n if (!empty($surveyQuestions)) {\n foreach ($surveyQuestions as $surveyQuestion) {\n $ebiQuestionId = $surveyQuestion['org_question_id'];\n $questionNumber = $surveyQuestion['org_question_id'];\n $surveyQuestionId = $questionNumber;\n $surveySnapshotSectionDto = new SurveySnapshotSectionDto();\n $questionTypeCode = $surveyQuestion['question_type'];\n $questionType = 'Multiple Response';\n $surveySnapshotSectionDto->setQuestionTypeCode('ISQ-' . $questionTypeCode);\n $surveySnapshotSectionDto->setQuestionType($questionType);\n $surveySnapshotSectionDto->setQuestionText($surveyQuestion['question_text']);\n $surveySnapshotSectionDto->setSurveyQuestionId($surveyQuestionId);\n $standardDeviation = number_format($surveyQuestion['standard_deviation'], 2);\n $surveySnapshotSectionDto->setStdDeviation($standardDeviation);\n $surveySnapshotSectionDto->setQuestionQnbr($questionNumber);\n $reportStudentIds = $ebiQuestionPermissions[$ebiQuestionId];\n $totalStudents = count($reportStudentIds);\n $surveySnapshotSectionDto->setTotalStudents($totalStudents);\n $surveyResponses = $this->orgQuestionResponseRepository->getMultiResponseISQResponses($surveyId, $organizationId, $reportStudentIds, $ebiQuestionId);\n $branchDetails = $this->surveyBranchRepository->getQuestionBranchDetails($surveyId, $surveyQuestionId);\n $branching = array();\n if (!empty($branchDetails)) {\n foreach ($branchDetails as $branchDetail) {\n $branches = array();\n $branches['option_text'] = $branchDetail['option_text'];\n $branches['source_qtype'] = $branchDetail['type'];\n $branches['source_qnbr'] = $branchDetail['qnbr'];\n $branches['source_question_text'] = $branchDetail['question_text'];\n $branching[] = $branches;\n }\n }\n $response = [];\n if (!empty($surveyResponses)) {\n $totalResponded = $this->orgQuestionResponseRepository->getMultiResponseISQResponseCount($surveyId, $organizationId, $reportStudentIds, $ebiQuestionId);\n $totalResponded = ($totalResponded[0]['student_count']) ? $totalResponded[0]['student_count'] : 0;\n $surveySnapshotSectionDto->setTotalStudentsResponded($totalResponded);\n $totalStudentPercentage = number_format(($totalResponded * 100) / $totalStudents, 1);\n $surveySnapshotSectionDto->setRespondedPercentage($totalStudentPercentage);\n\n foreach ($surveyResponses as $surveyResponse) {\n $surveySnapshotSectionResponseDto = new SurveySnapshotSectionResponseDto();\n $surveySnapshotSectionResponseDto->setResponseText($surveyResponse['option_text']);\n $optionResponded = $surveyResponse['student_count'];\n $optionRespondedPercent = number_format(($optionResponded * 100) / $totalResponded, 1);\n $surveySnapshotSectionResponseDto->setResponsePercentage($optionRespondedPercent);\n $studentResponse = $surveyResponse['option_value'];\n $surveySnapshotSectionResponseDto->setOptionValue($studentResponse);\n $surveySnapshotSectionResponseDto->setNoResponded($optionResponded);\n $surveySnapshotSectionResponseDto->setOptionId($surveyResponse['option_id']);\n $response[] = $surveySnapshotSectionResponseDto;\n }\n }\n $result = $response;\n $surveySnapshotSectionDto->setBranchDetails($branching);\n $surveySnapshotSectionDto->setResponseOptions($result);\n $questionsResponse['ISQ-' . $questionNumber] = $surveySnapshotSectionDto;\n $questionOptions[$questionType][$questionNumber] = $surveySnapshotSectionDto;\n }\n }\n }\n // store category and scaled questions in table\n $this->saveReportRunDetails('Multiple Response', $questionOptions, $reportRunningStatus, $personId);\n $this->reportsRunningStatusRepository->flush();\n\n return $questionsResponse;\n }", "function ubc_di_get_assessment_results() {\n\t\tglobal $wpdb;\n\t\t$response = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t} else {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t\t$temp_ubc_di_sites = array();\n\t\t\t$user_id = get_current_user_id();\n\t\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_site->ID, 'ubc_di_assessment_result_group', true );\n\t\t\t\t$ubc_di_group_people = get_post_meta( $ubc_di_asr_group_id, 'ubc_di_group_people', true );\n\t\t\t\tif ( '' != $ubc_di_group_people ) {\n\t\t\t\t\tforeach ( $ubc_di_group_people as $ubc_di_group_person ) {\n\t\t\t\t\t\tif ( $user_id == $ubc_di_group_person ) {\n\t\t\t\t\t\t\t$temp_ubc_di_sites[] = $ubc_di_site;\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$ubc_di_sites = $temp_ubc_di_sites;\n\t\t}\n\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t$temp_array = $this->ubc_di_get_site_metadata( $ubc_di_site->ID );\n\t\t\tif ( null != $temp_array ) {\n\t\t\t\tarray_push( $response, $temp_array );\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "public function collectQuestions()\r\n {\r\n if ($this->questionLoadingFailed()) {\r\n die(\"Question is Not Loaded Error!\");\r\n }\r\n\r\n foreach ($this->questionInfo->items as $question) {\r\n\r\n $questionInfo = $this->getSingleQuestionInfo($question);\r\n\r\n $this->fileContent[] = $this->formatOfQuestion($questionInfo);\r\n }\r\n\r\n return $this;\r\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "public static function webservice_surveycheck($initialdate = 0, $enddate = 0) {\n global $DB;\n \n //Parameter validation\n $params = self::validate_parameters(self::webservice_surveycheck_parameters(),\n array('initialdate' => $initialdate, 'enddate' => $enddate));\n $query = 'SELECT q.id as questionnaireid, c.id as courseid, q.opendate, q.closedate FROM {course} AS c\n INNER JOIN {course_modules} AS cm ON (c.id = cm.course)\n INNER JOIN {modules} AS m ON (cm.module = m.id AND m.name = ?)\n INNER JOIN {questionnaire} AS q ON (c.id = q.course AND q.closedate < ?)\n INNER JOIN {questionnaire_response} AS qr ON (q.id = qr.questionnaireid)\n WHERE q.intro like \"<ul>%\" AND c.category != 39 group by q.id';\n $parameters = array(\n \"questionnaire\",\n time(),\n );\n \n $questionnaires = $DB->get_records_sql($query, $parameters);\n $return = array();\n $prefix = '';\n echo '[';\n foreach($questionnaires as $quetionnaire){\n $textresponses = $DB->get_records_sql('SELECT qrt.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position, q.intro as info, qq.name as sectioncategory, qq.content as question, qrt.response as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_response_text} AS qrt ON (qrt.question_id = qq.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $rankresponses = $DB->get_records_sql('SELECT qrr.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position,q.intro as info, qq.name as sectioncategory, qqc.content as question, qrr.rankvalue+1 as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_quest_choice} AS qqc ON (qqc.question_id = qq.id)\n INNER JOIN {questionnaire_response_rank} AS qrr ON (qrr.choice_id = qqc.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $dateresponses = $DB->get_records_sql('SELECT qrd.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position,q.intro as info, qq.name as sectioncategory, qq.content as question, qrd.response as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_response_date} AS qrd ON (qrd.question_id = qq.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $boolresponses = $DB->get_records_sql('SELECT qrd.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position,q.intro as info, qq.name as sectioncategory, qq.content as question, qrd.choice_id as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_response_bool} AS qrd ON (qrd.question_id = qq.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $singleresponses = $DB->get_records_sql('SELECT qrs.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position,q.intro as info, qq.name as sectioncategory, qq.content as question, qqc.content as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_quest_choice} AS qqc ON (qqc.question_id = qq.id)\n INNER JOIN {questionnaire_resp_single} AS qrs ON (qrs.choice_id = qqc.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $multiresponses = $DB->get_records_sql('SELECT qrm.id as id, cc.name as category, c.fullname as coursename, q.name as questionnaire, qqt.response_table, qq.length, qq.position,q.intro as info, qq.name as sectioncategory, qq.content as question, qqc.content as response FROM {questionnaire} AS q\n INNER JOIN {course} AS c ON (c.id = q.course AND c.id = ? AND q.id = ?)\n INNER JOIN {course_categories} AS cc ON (cc.id = c.category)\n INNER JOIN {questionnaire_question} AS qq ON (qq.surveyid = q.id)\n INNER JOIN {questionnaire_quest_choice} AS qqc ON (qqc.question_id = qq.id)\n INNER JOIN {questionnaire_resp_multiple} AS qrm ON (qrm.choice_id = qqc.id)\n INNER JOIN {questionnaire_question_type} AS qqt ON (qqt.typeid = qq.type_id)\n WHERE q.intro like \"<ul>%\" AND cc.id != 39', array($quetionnaire->courseid,$quetionnaire->questionnaireid));\n $result = array_merge($textresponses,$rankresponses,$dateresponses,$boolresponses,$singleresponses,$multiresponses);\n foreach($result as $position => $response){\n $result[$position]->question = strip_tags($response->question);\n if($response->response_table === 'response_rank'){\n $explode = explode(\")\", $response->question);\n unset($explode[0]);\n $response->question = ltrim(implode(\")\", $explode));\n }\n $explode = explode(\"</li>\",$response->info);\n foreach($explode as $key => $item){\n $explode[$key] = strip_tags($item);\n }\n foreach($explode as $key => $exploded){\n $info = explode(\":\",$exploded);\n $explode[$key] = $info[1];\n \n }\n $obj = new stdClass();\n $obj->fecha = $explode[5];\n $obj->fechaapertura = date(\"d-m-Y\",$quetionnaire->opendate);\n $obj->fechacierre = date(\"d-m-Y\",$quetionnaire->closedate);\n $obj->category = $response->category;\n $obj->coursename = $response->coursename;\n $obj->questionnaire = $response->questionnaire;\n $obj->sectioncategory = $response->sectioncategory;\n $obj->question = $response->question;\n if($response->response_table === 'response_rank'){\n $obj->responseint = $response->response;\n $obj->responsetext = '';\n }else{\n $obj->responseint = '';\n $obj->responsetext = $response->response;\n \n }\n $obj->programa = $explode[0];\n $obj->cliente = $explode[1];\n $obj->actividad = $explode[2];\n if(strlen($explode[4]) > 5){\n if($response->position == 6 || $response->position == 7 || $response->question === \"El Profesor/Facilitador 2\"){\n $obj->profesor = $explode[4];\n }else{\n $obj->profesor = $explode[3];\n }\n }else{\n $obj->profesor = $explode[3];\n }\n $obj->grupo = $explode[6];\n $obj->coordinadora = $explode[7];\n $obj->position = $response->position;\n if($response->position != $oldposition){\n $count = 1;\n }\n $obj->ordenpregunta = $count;\n if($response->length == 4){\n $obj->tiporid = 1;\n $obj->tiporp = '1 a 4 con N/A';\n if($response->response == 0){\n $obj->idvalortipo = 5;\n }else{\n $obj->idvalortipo = $response->response;\n }\n }elseif($response->length == 7){\n $obj->tiporid = 2;\n $obj->tiporp = '1 a 7 con N/A';\n if($response->response == 0){\n $obj->idvalortipo = 13;\n }else{\n $obj->idvalortipo = $response->response + 5;\n }\n }else{\n $obj->tiporid = 3;\n $obj->tiporp = 'Texto Comentario';\n $obj->idvalortipo = 0;\n }\n \n unset($obj->info);\n echo $prefix, json_encode( $obj);\n $prefix = ',';\n $oldposition = $response->position;\n }\n }\n echo ']';\n }", "function get_survey_requests_by_user($user_id=NULL,$survey_id=NULL)\n\t{\n\t\t\t$this->db->select('lic_requests.id,expiry,status');\n\t\t\t$this->db->where('userid',$user_id);\n\t\t\t$this->db->where('lic_requests.surveyid',$survey_id);\n\t\t\t$this->db->where('lic_requests.status !=','DENIED');\n\t\t\t$this->db->join('lic_file_downloads', 'lic_requests.id = lic_file_downloads.requestid','left');\n\t\t\t$query=$this->db->get(\"lic_requests\");\n\t\t\t//echo mktime(0,0,0,9,9,2010);\n\t\t\tif (!$query)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->result_array();\n\t}", "function submitMulti($cID, $tID){\n\t$questions = Contest :: get_contest_questions($cID);\n\t$sub_array = array();\n\n\t// Get an array of unsubmitted questions \n\t$newQuests = filter_questions($questions, Submission :: get_submissions_by_team_and_contest($tID, $cID));\n\n\tforeach($newQuests as $quest){\t\t\t\t\n\t\t$folderID = File_Functions :: get_folder_for_question_team($tID, $quest);\n\t\t$fileID = File_Functions :: first_file($folderID);\n\t\t$info = File_Functions :: retrieve_file($fileID);\n\t\t\n\t\t$submission_stat = Submission::add_submission($quest, $tID, $info['content']);\n\t\t\n\t\tif(!is_numeric($submission_stat))\n\t\t\treturn json_encode(array('stat' => $submission_stat));\n\t\t\n\t\t$sub_array[] = $submission_stat;\n\t}\n\t\n\techo json_encode(array('stat' => '', 'subs' => $sub_array));\n}", "function get_user_study_requests($survey_id, $user_id,$request_status=NULL)\n\t{\n\t\t$this->db->select('id,request_type,status');\n\t\t$this->db->where('userid',$user_id);\n\t\t$this->db->where('surveyid',$survey_id);\n\t\tif($request_status)\n\t\t{\n\t\t\t$this->db->where_in('status',$request_status);\n\t\t}\n\t\treturn $this->db->get('lic_requests')->result_array();\n\t}", "public function myQuests(Request $request)\n {\n return Auth::user()->quests;\n }", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getSubmissionsToViewAndDelete( $objQuerySubmissionStruct )\n\t{\n assert( isset( $this->dbConnection ) );\n\n $isSuccess = false;\n\n $bindTypes = \"\";\n $params = array();\n\n $stmtQuery = \"SELECT idChallengePhoto, firstname, lastname, email, phone, challengeType, year, month, challengeNo, photoFilename1, photoFilename2, photoThumbnail1, photoThumbnail2\";\n $stmtQuery .= \" FROM icaict406a_challenge_photos, icaict406a_challenges, icaict406a_users\";\n $stmtQuery .= \" WHERE icaict406a_users.idUser = icaict406a_challenge_photos.userID\";\n $stmtQuery .= \" AND icaict406a_challenges.idChallenge = icaict406a_challenge_photos.challengeID\";\n\n $stmtQuery .= $this->setQueryParam( $objQuerySubmissionStruct->challengeType, \" AND challengeType= ?\", FALSE, \"i\", $bindTypes, $params );\n $stmtQuery .= $this->setQueryParam( $objQuerySubmissionStruct->month, \" AND month= ?\", FALSE, \"i\", $bindTypes, $params );\n $stmtQuery .= $this->setQueryParam( $objQuerySubmissionStruct->year, \" AND year= ?\", FALSE, \"i\", $bindTypes, $params );\n $stmtQuery .= $this->setQueryParam( $objQuerySubmissionStruct->firstname, \" AND firstname like ?\", TRUE, \"s\", $bindTypes, $params );\n $stmtQuery .= $this->setQueryParam( $objQuerySubmissionStruct->lastname, \" AND lastname like ?\", TRUE, \"s\", $bindTypes, $params );\n\n $stmtQuery .= \" ORDER BY year DESC, month DESC, challengeNo DESC\";\n\n if( $stmt = $this->dbConnection->prepare( $stmtQuery ) )\n {\n if( $bindTypes != \"\" )\n {\n $bindNames[] = $bindTypes;\n foreach ($params as $key => $value ) \n {\n $bindName = \"bind\" . $key;\n $$bindName = $value;\n $bindNames[] = &$$bindName;\n }\n call_user_func_array( array($stmt, \"bind_param\"), $bindNames );\n }\n \n\t\t if( $bSuccess = $stmt->execute())\n {\n $stmt->bind_result( $db_idChallengePhoto, $db_firstname, $db_lastname, $db_email, $db_phone, $db_challengeType, $db_year, $db_month, $db_challengeNo, $db_photoFilename1, $db_photoFilename2, $db_photoThumbnail1, $db_photoThumbnail2 );\n\t\t \n while( $stmt->fetch() ) \n\t\t {\n $objSubmission = new c_submissionStruct();\n $objSubmission->idChallengePhoto = $db_idChallengePhoto;\n $objSubmission->firstname = $db_firstname;\n $objSubmission->lastname = $db_lastname;\n $objSubmission->email = $db_email;\n $objSubmission->phone = $db_phone;\n $objSubmission->challengeType = $db_challengeType;\n $objSubmission->month = $db_month;\n $objSubmission->year = $db_year;\n $objSubmission->challengeNo = $db_challengeNo;\n $objSubmission->photoFilename1 = ( $db_photoFilename1 != '' )? PHOTO_DIR . $db_photoFilename1 : ''; \n $objSubmission->photoFilename2 = ( $db_photoFilename2 != '' )? PHOTO_DIR . $db_photoFilename2 : ''; \n $objSubmission->photoThumbnail1 = ( $db_photoThumbnail1 != '' )? THUMBNAIL_PHOTO_DIR . $db_photoThumbnail1 : ''; \n $objSubmission->photoThumbnail2 = ( $db_photoThumbnail2 != '' )? THUMBNAIL_PHOTO_DIR . $db_photoThumbnail2 : ''; \n\n $this->submissions[] = $objSubmission;\n\t\t } \n }\n\t $stmt->close(); \t// Free resultset \n }\n \treturn $bSuccess;\n\n\t}", "static function getBookingDiffsReport( $selectedDate, $jobId ) {\n global $wpdb;\n\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT y.guest_name, \n IF( y.room_type IN ('DBL','TRIPLE','QUAD','TWIN'), y.room_type, IF(y.room_type_id IS NULL, y.room_type, CONVERT(CONCAT(y.capacity, y.room_type) USING utf8))) `hw_room_type`,\n y.checkin_date `hw_checkin_date`, y.checkout_date `hw_checkout_date`, y.hw_persons, y.payment_outstanding `hw_payment_outstanding`, y.booked_date, y.booking_source,\n y.booking_reference, \n\t IF( z.room_type IN ('DBL','TRIPLE','QUAD','TWIN'), z.room_type, CONVERT(CONCAT(z.capacity, z.room_type) USING utf8)) `lh_room_type`, z.lh_status,\n z.checkin_date `lh_checkin_date`, z.checkout_date `lh_checkout_date`, z.lh_persons, z.payment_outstanding `lh_payment_outstanding`, z.data_href, z.notes,\n IF( IFNULL(y.hw_person_count,0) = IFNULL(z.lh_persons,0), 'Y', 'N' ) `matched_persons`,\n\t IF( IFNULL(y.room_type_id,-1) = IFNULL(z.room_type_id,0), 'Y', 'N' ) `matched_room_type`, -- if room type id not matched, this will always be N\n IF( IFNULL(y.checkin_date,0) = IFNULL(z.checkin_date,0), 'Y', 'N') `matched_checkin_date`,\n IF( IFNULL(y.checkout_date,0) = IFNULL(z.checkout_date,0), 'Y', 'N') `matched_checkout_date`,\n IF( IFNULL(z.lh_status, 'null') IN ('checked-in', 'checked-out') OR IFNULL(y.payment_outstanding,'null') = IFNULL(z.payment_outstanding,'null') OR z.payment_outstanding = 0, 'Y', 'N') `matched_payment_outstanding`\n FROM (\n -- all unique HW records for the given job_id\n SELECT b.booking_reference, b.booking_source, b.guest_name, b.booked_date, b.persons `hw_persons`, b.payment_outstanding, d.persons `hw_person_count`, d.room_type_id, IF(d.room_type_id IS NULL, d.room_type, r.room_type) `room_type`, r.capacity,\n (SELECT COUNT(DISTINCT e.room_type_id) FROM wp_hw_booking_dates e WHERE e.hw_booking_id = b.id ) `num_room_types`, -- keep track of bookings that contain more than one room type\n\t\t MIN(d.booked_date) `checkin_date`, DATE_ADD(MAX(d.booked_date), INTERVAL 1 DAY) `checkout_date`\n FROM wp_hw_booking b\n JOIN wp_hw_booking_dates d ON b.id = d.hw_booking_id\n LEFT OUTER JOIN (SELECT DISTINCT room_type_id, room_type, capacity FROM wp_lh_rooms) r ON r.room_type_id = d.room_type_id\n GROUP BY b.booking_reference, b.booking_source, b.guest_name, b.booked_date, b.persons, b.payment_outstanding, d.persons, d.room_type_id, d.room_type, r.room_type, r.capacity\n HAVING MIN(d.booked_date) = %s -- checkin date\n ) y\n LEFT OUTER JOIN (\n -- all unique LH records for the given job_id\n SELECT c.booking_reference, c.guest_name, c.booked_date, c.lh_status, c.room_type_id, c.checkin_date, c.checkout_date, c.data_href, c.payment_outstanding, c.notes, r.room_type, r.capacity,\n IF(c.lh_status = 'cancelled', c.num_guests, SUM(IFNULL((SELECT MAX(r.capacity) FROM wp_lh_rooms r WHERE r.room_type IN ('DBL', 'TWIN', 'TRIPLE', 'QUAD') AND r.room_type_id = c.room_type_id), 1 ))) `lh_persons`\n FROM wp_lh_calendar c \n JOIN (SELECT DISTINCT room_type_id, room_type, capacity FROM wp_lh_rooms) r ON r.room_type_id = c.room_type_id\n WHERE c.job_id = %d\n AND ( c.booking_source = 'Hostelbookers' OR c.booking_source LIKE 'Hostelworld%%' )\n GROUP BY c.booking_reference, c.guest_name, c.booked_date, c.lh_status, c.room_type_id, c.checkin_date, c.checkout_date, c.data_href, c.payment_outstanding, c.notes, r.room_type, r.capacity\n ) z ON CONCAT(IF(y.booking_source = 'Hostelbookers', 'HBK-', 'HWL-551-'), y.booking_reference) = z.booking_reference \n -- if there is only 1 room type, then match by booking ref only\n AND IFNULL(y.room_type_id, 0) = IF(y.num_room_types > 1, z.room_type_id, IFNULL(y.room_type_id, 0))\", \n $selectedDate->format('Y-m-d'), $jobId ));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n return $resultset;\n }" ]
[ "0.5996727", "0.5936609", "0.54508674", "0.5380265", "0.5299355", "0.52664226", "0.51739275", "0.51614606", "0.5112784", "0.50744545", "0.50663435", "0.5055705", "0.50379115", "0.50034606", "0.49738628", "0.4944428", "0.49141344", "0.48513246", "0.48392534", "0.48335564", "0.47980154", "0.4797188", "0.47884125", "0.4781893", "0.4756993", "0.475167", "0.47358626", "0.47295982", "0.47207606", "0.4717574", "0.46949536", "0.46823284", "0.46693414", "0.46692225", "0.4664508", "0.46620432", "0.46540785", "0.46476892", "0.4634726", "0.46106228", "0.4601685", "0.46014756", "0.45943844", "0.4592567", "0.45651752", "0.45613724", "0.45573515", "0.45525858", "0.45363656", "0.45342433", "0.4531851", "0.44783157", "0.44718564", "0.4460652", "0.44514978", "0.44485825", "0.44268736", "0.44260296", "0.4422668", "0.44134238", "0.441229", "0.44086158", "0.44009447", "0.44000563", "0.43947747", "0.43864506", "0.43811262", "0.4374489", "0.4373383", "0.43710342", "0.4363073", "0.43563", "0.43512422", "0.4346377", "0.43418077", "0.43368194", "0.43276432", "0.43220928", "0.4320169", "0.4305458", "0.43027374", "0.43019304", "0.42996868", "0.4298698", "0.42896777", "0.42870685", "0.4286528", "0.42854524", "0.42788544", "0.42749423", "0.42708725", "0.42708218", "0.42704368", "0.42692488", "0.4266096", "0.4263513", "0.42612264", "0.42549658", "0.4252722", "0.42518744" ]
0.6841735
0
Get all survey submissions (but allow for a search filter)
public function get_survey_submissions($filters, $order_by = 'updated', $order_by_order = 'DESC') { $data = array(); $order_by = in_array($order_by, array('id', 'member_id', 'survey_id', 'created', 'updated', 'completed', 'complete')) ? $order_by : 'updated'; $order_by_order = in_array($order_by_order, array('ASC', 'DESC', 'RANDOM')) ? $order_by_order : 'DESC'; $this->db->order_by($order_by, $order_by_order); // Filter survey ID if ( isset($filters['survey_id']) AND $filters['survey_id']) { $this->db->where('survey_id', $filters['survey_id']); } // Filter member ID if ( isset($filters['member_id']) AND $filters['member_id']) { $this->db->where('member_id', $filters['member_id']); } // Filter group ID if ( isset($filters['group_id']) AND $filters['group_id']) { $this->db->join('members', 'members.member_id = vwm_surveys_submissions.member_id'); $this->db->where('group_id', $filters['group_id']); } // If a valid created from date was provided if ( isset($filters['created_from']) AND strtotime($filters['created_from']) ) { // If a valid created to date was provided as well if ( isset($filters['created_to']) AND strtotime($filters['created_to']) ) { /** * Add one day (86400 seconds) to created_to date * * If user is searching for all surveys created from 1/1/2000 to * 1/1/2000 it should show all surveys created on 1/1/2000. */ $this->db->where( '`created` BETWEEN ' . strtotime($filters['created_from']) . ' AND ' . (strtotime($filters['created_to']) + 86400), NULL, FALSE ); } // Just a created from date was provided else { $this->db->where( 'created >=', strtotime($filters['created_from']) ); } } // If a valid updated from date was provided if ( isset($filters['updated_from']) AND strtotime($filters['updated_from']) ) { // If a valid updated to date was provided as well if ( isset($filters['updated_to']) AND strtotime($filters['updated_to']) ) { /** * Add one day (86400 seconds) to updated_to date * * If user is searching for all surveys updated from 1/1/2000 to * 1/1/2000 it should show all surveys updated on 1/1/2000. */ $this->db->where( '`updated` BETWEEN ' . strtotime($filters['updated_from']) . ' AND ' . (strtotime($filters['updated_to']) + 86400), NULL, FALSE ); } // Just a updated from date was provided else { $this->db->where( 'updated >=', strtotime($filters['updated_from']) ); } } // Filter completed if ( isset($filters['complete']) AND $filters['complete'] !== NULL) { // Show completed subissions if ($filters['complete']) { $this->db->where('completed IS NOT NULL', NULL, TRUE); } // Show incomplete submissions else { $this->db->where('completed IS NULL', NULL, TRUE); } } $query = $this->db->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[ (int)$row->id ] = array( 'id' => (int)$row->id, 'hash' => $row->hash, 'member_id' => (int)$row->member_id, 'survey_id' => (int)$row->survey_id, 'created' => (int)$row->created, 'updated' => (int)$row->updated, 'completed' => (int)$row->completed, 'complete' => (bool)$row->completed ); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "public function __invoke(): Collection|array\n {\n return Survey::all();\n }", "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "function _getFilteredSubmissions($journalId) {\r\n \r\n\t\t$sectionId = Request::getUserVar('decisionCommittee');\r\n\t\t$decisionType = Request::getUserVar('decisionType');\r\n\t\t$decisionStatus = Request::getUserVar('decisionStatus');\r\n\t\t$decisionAfter = Request::getUserVar('decisionAfter');\r\n\t\t$decisionBefore = Request::getUserVar('decisionBefore');\r\n \r\n\t\t$studentResearch = Request::getUserVar('studentInitiatedResearch');\r\n\t\t$startAfter = Request::getUserVar('startAfter');\r\n\t\t$startBefore = Request::getUserVar('startBefore');\r\n\t\t$endAfter = Request::getUserVar('endAfter');\r\n\t\t$endBefore = Request::getUserVar('endBefore');\r\n\t\t$kiiField = Request::getUserVar('KII');\r\n\t\t$multiCountry = Request::getUserVar('multicountry');\r\n\t\t$countries = Request::getUserVar('countries');\r\n\t\t$geoAreas = Request::getUserVar('geoAreas');\r\n\t\t$researchDomains = Request::getUserVar('researchDomains');\r\n $researchFields = Request::getUserVar('researchFields');\r\n\t\t$withHumanSubjects = Request::getUserVar('withHumanSubjects');\r\n\t\t$proposalTypes = Request::getUserVar('proposalTypes');\r\n\t\t$dataCollection = Request::getUserVar('dataCollection');\r\n\r\n $budgetOption = Request::getUserVar('budgetOption');\r\n\t\t$budget = Request::getUserVar('budget');\r\n\t\t$sources = Request::getUserVar('sources');\r\n \r\n\t\t$identityRevealed = Request::getUserVar('identityRevealed');\r\n\t\t$unableToConsent = Request::getUserVar('unableToConsent');\r\n\t\t$under18 = Request::getUserVar('under18');\r\n\t\t$dependentRelationship = Request::getUserVar('dependentRelationship');\r\n\t\t$ethnicMinority = Request::getUserVar('ethnicMinority');\r\n\t\t$impairment = Request::getUserVar('impairment');\r\n\t\t$pregnant = Request::getUserVar('pregnant');\r\n\t\t$newTreatment = Request::getUserVar('newTreatment');\r\n\t\t$bioSamples = Request::getUserVar('bioSamples');\r\n\t\t$exportHumanTissue = Request::getUserVar('exportHumanTissue');\r\n\t\t$exportReason = Request::getUserVar('exportReason');\r\n $radiation = Request::getUserVar('radiation');\r\n\t\t$distress = Request::getUserVar('distress');\r\n\t\t$inducements = Request::getUserVar('inducements');\r\n\t\t$sensitiveInfo = Request::getUserVar('sensitiveInfo');\r\n\t\t$reproTechnology = Request::getUserVar('reproTechnology');\r\n\t\t$genetic = Request::getUserVar('genetic');\r\n\t\t$stemCell = Request::getUserVar('stemCell');\r\n\t\t$biosafety = Request::getUserVar('biosafety');\r\n \r\n\r\n $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\r\n\r\n $submissions =& $editorSubmissionDao->getEditorSubmissionsReport(\r\n $journalId, $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety);\r\n \r\n $criterias = $this->_getCriterias(\r\n $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety \r\n );\r\n \r\n\t\treturn array( 0 => $submissions->toArray(), 1 => $criterias); \r\n }", "function get_simple_form_submissions() {\n global $wpdb;\n $table_name = $wpdb->prefix . 'content_submissions';\n\n $sql = \"SELECT * FROM $table_name\";\n $results = $wpdb->get_results( $sql );\n\n return $results;\n}", "public function getSubmissions()\n {\n return $this->getFiles()->filter(function (File $file) {\n return $file->getOwner()->getType() === 'student';\n });\n }", "protected function createSurveyEntries(): array\n {\n $result = [];\n $query = $this->SurveyResults->find();\n $count = 0;\n\n $this->out((string)__d('Qobo/Survey', 'Found [{0}] survey_result records', $query->count()));\n\n if (empty($query->count())) {\n return $result;\n }\n\n foreach ($query as $item) {\n $survey = $this->Surveys->find()\n ->where(['id' => $item->get('survey_id')]);\n\n if (!$survey->count()) {\n $this->warn((string)__d('Qobo/Survey', 'Survey [{0}] is not found. Moving on', $item->get('survey_id')));\n\n continue;\n }\n\n $entry = $this->SurveyEntries->find()\n ->where([\n 'id' => $item->get('submit_id'),\n ])\n ->first();\n\n if (empty($entry)) {\n if (empty($item->get('submit_id'))) {\n continue;\n }\n\n $entry = $this->SurveyEntries->newEntity();\n $entry->set('id', $item->get('submit_id'));\n $entry->set('submit_date', $item->get('submit_date'));\n $entry->set('survey_id', $item->get('survey_id'));\n $entry->set('status', 'in_review');\n $entry->set('score', 0);\n\n $saved = $this->SurveyEntries->save($entry);\n\n if ($saved) {\n $result[] = $saved->get('id');\n $count++;\n } else {\n $this->out((string)__d('Qobo/Survey', 'Survey Result with Submit ID [{0}] cannot be saved. Next', $item->get('submit_id')));\n }\n } else {\n // saving existing survey_entries,\n // to double check if anything is missing as well.\n $result[] = $entry->get('id');\n }\n }\n\n $this->out((string)__d('Qobo/Survey', 'Saved [{0}] survey_entries', $count));\n\n //keeping only unique entry ids, to avoid excessive iterations.\n $result = array_values(array_unique($result));\n\n return $result;\n }", "public function getSubmissionsForSelect($conferenceId = null, $empty = null)\n\t{\n\t\t$return = array();\n\n\t\tif ($empty) {\n\t\t\t$return[0] = $empty;\n\t\t}\n\n\t\t$identity = Zend_Auth::getInstance()->getIdentity();\n\n\t\t$query = 'select st.submission_id, s.title from submission_status st\n\t\tleft join submissions s ON s.submission_id = st.submission_id\n\t\twhere st.status = :status AND s.conference_id = :conference_id';\n\n\t\tif (!$identity->isAdmin()) {\n\t\t\t// if user is not admin, only show their own submissions\n\t\t\t$mySubmissions = implode(\",\", array_keys($identity->getMySubmissions()));\n\t\t\tif (!empty($mySubmissions)) {\n\t\t\t\t$query .= ' and st.submission_id IN ('.$mySubmissions.')';\n\t\t\t} else {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\n\t\t$submissions = $this->getAdapter()->query(\n\t\t\t$query,\n\t\t\tarray(\n\t\t\t\t'status' => $this->_getAcceptedValue(),\n\t\t\t\t'conference_id' => $this->getConferenceId()\n\t\t\t)\n\t\t);\n\t\tforeach ($submissions as $submission) {\n\t\t\t$return[$submission['submission_id']] = $submission['title'];\n\t\t}\n\t\treturn $return;\n\t}", "private function get_all_circleci_submissions($submissionid) {\n global $DB;\n return $DB->get_records('assignsubmission_circleci', array('submission'=>$submissionid));\n }", "public static function withSubmitted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->withSubmitted();\n }", "public function getSubmissions($filters = array())\n {\n // filter date\n if (isset($filters['date'])) {\n\n switch ($filters['date']) {\n case 'LAST_DAY':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 days\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_WEEK':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 week\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_14DAYS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-2 week\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_MONTH':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-1 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_6_MONTHS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-6 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_YEAR':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-12 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n case 'LAST_18_MONTHS':\n $filters['submittedDateBegin'] = date('Y-m-d',strtotime(\"-18 month\"));\n $filters['submittedDateEnd'] = date('Y-m-d');\n break;\n }\n }\n\n $getSubmissionsService = $this->limsApiFactory->newGetSubmissionsService();\n $result = $getSubmissionsService->execute($filters);\n\n // paginate\n $this->limsPaginator = new LimsPagination($result, self::PER_PAGE, isset($filters['page']) ? $filters['page'] : 1);\n $this->limsPaginator->paginate();\n\n return $this->limsPaginator->currentItems;\n }", "function GetSubmissions () {\n $array = array ();\n $result = @mysql_query (\"SELECT `submission_id` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"' ORDER BY `submission_timestamp` ASC;\", $this->ka_db);\n while ($row = @mysql_fetch_array ($result))\n $array [] = new Submission ($row[\"submission_id\"], $this->roster_coder);\n return $array;\n }", "public function submissions();", "function dev_get_submission_pages() {\n\n\t$submission = dev_get_option( 'ticket_submit' );\n\n\tif ( ! is_array( $submission ) ) {\n\t\t$submission = array_filter( (array) $submission );\n\t}\n\n\treturn $submission;\n\n}", "function getSubmissionFilter() {\n\t\treturn null;\n\t}", "public function index(): AnonymousResourceCollection\n {\n return SurveyResource::collection(Survey::all());\n }", "function submissions() {\n \n global $CFG, $USER;\n\n // need to get course id in order to retrieve students\n $assignment = get_record('assignment', 'id', $this->mainobject->id);\n $courseid = $assignment->course;\n\n //permission to grade?\n $coursemodule = get_record('course_modules', 'module', $this->mainobject->modulesettings['assignment']->id, 'instance', $assignment->id) ;\n $modulecontext = get_context_instance(CONTEXT_MODULE, $coursemodule->id);\n\n if (!has_capability($this->capability, $modulecontext, $USER->id)) {\n return;\n }\n \n $this->mainobject->get_course_students($courseid);\n\n $student_sql = $this->get_role_users_sql($this->mainobject->courses[$courseid]->context);\n\n $sql = \"SELECT s.id as subid, s.userid, s.timemodified, s.data2, c.id as cmid\n FROM {$CFG->prefix}assignment_submissions s\n INNER JOIN {$CFG->prefix}course_modules c\n ON s.assignment = c.instance\n INNER JOIN {$CFG->prefix}assignment a\n ON s.assignment = a.id\n WHERE s.assignment = {$this->mainobject->id}\n AND s.timemarked < s.timemodified\n AND (s.userid IN ({$student_sql}))\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n \n AND c.module = {$this->mainobject->modulesettings['assignment']->id}\n ORDER BY timemodified ASC\";\n\n $submissions = get_records_sql($sql);\n\n if ($submissions) {\n\n $data = array();\n\n // If we are not making the submissions for a specific group, run the group filtering\n // function to see if the config settings say display by groups and display them if they\n // are (returning false). If there are no groups, the function will return true and we\n // carry on, but if the config settings say 'don't display' then it will return false\n // and we skip this assignment\n if(!$this->mainobject->group) {\n\n //TODO - data array as input for function\n\n //$data['submissions'] = $submissions;\n //$data['type'] = $this->type;\n //$data['id'] = $this->mainobject->id;\n //$data['course'] = $assignment->course;\n\n //$group_filter = $this->mainobject->try_to_make_group_nodes($data);\n $group_filter = $this->mainobject->try_to_make_group_nodes($submissions, $this->type, $this->mainobject->id, $assignment->course);\n\n if (!$group_filter) {\n return;\n }\n }\n\n // begin json object\n $this->mainobject->output = '[{\"type\":\"submissions\"}';\n\n foreach ($submissions as $submission) {\n // add submission to JSON array of objects\n if (!isset($submission->userid)) {\n continue;\n }\n\n // ignore non-submitted uploaded files\n if (($assignment->assignmenttype == 'upload') && ($submission->data2 != 'submitted')) {\n continue;\n }\n\n // if we are displaying for just one group, skip this submission if it doesn't match\n if ($this->mainobject->group && !$this->mainobject->check_group_membership($this->mainobject->group, $submission->userid)) {\n continue;\n }\n \n $name = $this->mainobject->get_fullname($submission->userid);\n \n // sort out the time info\n $now = time();\n $seconds = ($now - $submission->timemodified);\n $summary = $this->mainobject->make_time_summary($seconds);\n \n $this->mainobject->make_submission_node($name, $submission->userid, $submission->cmid, $summary, 'assignment_final', $seconds, $submission->timemodified);\n \n }\n $this->mainobject->output .= \"]\"; // end JSON array\n \n }\n }", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "public function xsubmissions() {\n\t\t\n\t\t/* Load Model */\n\t\t$submissions = $this->getModel ( 'submission' );\n\t\t\n\t\t$submissions->setTableName ( $this->_getFormId () );\n\t\t\n\t\t/* Get all rows */\n\t\t$submissions->getAll ();\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'submissions' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t}", "public function actionIndex() {\n $searchModel = new SurveySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $surveyz = new Surveys();\n $surv = $surveyz->find()->orderBy(['survey_id' => SORT_ASC])->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider, 'surv' => $surv,\n ]);\n }", "public function getBookmarkedSubmissions()\n {\n return Auth::user()->bookmarkedSubmissions()->simplePaginate(10);\n }", "public function index(Request $request)\n {\n $quests = Quest::where('status', 0)->where('user_id', '!=', Auth::id());\n if ($request->has('q')) {\n $quests = $quests->where('name', 'LIKE', '%' . $request->input('q') . '%')->get();\n } else {\n $quests = $quests->get();\n }\n\n return $quests;\n\n }", "public function index($survey_id)\n\t{\n\t\t$questions = Survey::find($survey_id)->questions;\n\n\t\treturn Fractal::collection($questions, new QuestionTransformer);\n\t}", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "public function index()\n\t{\n\t\t//User based filtering\n\t\t$user = $this->apiKey->guestUser;\n\t\t$survey_ids_taken = TrackSurvey::where('users_id', $user->id)->groupBy('surveys_id')->lists('surveys_id');\n\n\t\t//Question count\n\t\t// return $survey_ids_taken;\n\t\t\n\t\ttry {\n\t\t\t//inserting custom key-val\n\t\t\t$surveys = Survey::all();\n\t\t\tforeach($surveys as $survey){\n\t\t\t\t$survey->is_taken = in_array($survey->id, $survey_ids_taken) ? '1':'0';\n\t\t\t\t$survey->mcq_count = Question::where('surveys_id', $survey->id)->where('type', 'mcq')->count();\n\t\t\t\t$survey->wr_count = Question::where('surveys_id', $survey->id)->where('type', 'written')->count();\n\t\t\t\t$survey->taken_by = TrackSurvey::where('surveys_id', $survey->id)->groupBy('users_id')->lists('users_id');\t\t\t\n\t\t\t}\n\n\t\t\t// return $surveys;\n\t\t\treturn Fractal::collection($surveys, new SurveyTransformer);\n\t\t\n\t\t} catch (Exception $e) {\n \n \treturn $this->response->errorGone();\n\t\t\t\n\t\t}\n\t}", "public function results()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->match((isset($this->request->get['limit']) ? $this->request->get['limit'] : null));\n }", "public function submissions()\n {\n return $this->hasMany('App\\Modules\\Models\\Submission');\n }", "public function getSurveys() {\n\n \n $this->db->select('sur_id, sur_title');\n $this->db->from('msv_surveys');\n \n $query = $this->db->get();\n \n $res = $query->result();\n \n return $res;\n }", "public function getSubmits()\n {\n return $this->submits;\n }", "public static function submitted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->submitted();\n }", "public function submissions()\n {\n return $this->hasMany('App\\Submission');\n }", "public function submissions()\n {\n return $this->hasMany('App\\Submission');\n }", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "public function index()\n {\n $surveys = Survey::where('id', '>', 0)->paginate(10);\n\n return view('backend.surveys.index', compact('surveys'));\n }", "public static function searchAll() {\n $list = [];\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM postInfo WHERE visibility = 1 ORDER BY postID DESC');\n foreach ($req->fetchAll() as $post) {\n $list[] = new Post($post['postID'], $post['memberID'], $post['categoryID'], $post['title'], $post['author'], $post['about'], $post['category'], $post['datePosted'], $post['dateUpdated'], $post['excerpt'], $post['content']);\n }\n return $list;\n }", "public function getSearchResults() {\n\t\t\n\t\t$pages = array();\n\t\n\t\tif ($query = Core\\Request::query('query')) {\n\t\t\n\t\t\t$collection = $this->Automad->getCollection();\n\t\t\n\t\t\tif (array_key_exists($query, $collection)) {\n\t\t\t\n\t\t\t\t// If $query matches an actual URL of an existing page, just get that page to be the only match in the $pages array.\n\t\t\t\t// Since $pages has only one element, the request gets directly redirected to the edit page (see below).\n\t\t\t\t$pages = array($this->Automad->getPage($query));\n\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$Selection = new Core\\Selection($collection);\n\t\t\t\t$Selection->filterByKeywords($query);\n\t\t\t\t$Selection->sortPages(AM_KEY_MTIME . ' desc');\n\t\t\t\t$pages = $Selection->getSelection(false);\n\t\t\t\n\t\t\t}\n\t\n\t\t\t// Redirect to edit mode for a single result or in case $query represents an actually existing URL.\n\t\t\tif (count($pages) == 1) {\n\t\t\t\t$Page = reset($pages);\n\t\t\t\theader('Location: ' . AM_BASE_INDEX . AM_PAGE_DASHBOARD . '?context=edit_page&url=' . urlencode($Page->origUrl));\n\t\t\t\tdie;\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $pages;\n\t\t\n\t}", "public function submissions()\n {\n $segregatedSubmissions = Submissions::getStudentSubmissions();\n //dd($segregatedSubmissions);\n $upcoming_submissions = $segregatedSubmissions[0];\n $ongoing_submissions = $segregatedSubmissions[1];\n $finished_submissions = $segregatedSubmissions[2];\n\n //dd($upcoming_submissions);\n //dd($ongoing_submissions);\n //dd($finished_submissions);\n $unReadNotifCount = StudentCalls::getUnReadNotifCount();\n return view('student/submissions', compact('upcoming_submissions', 'ongoing_submissions', 'finished_submissions','unReadNotifCount'));\n }", "public function actionIndex()\n {\n //session_unset();\n $dataProvider = new ActiveDataProvider([\n 'query' => Survey::find(),\n 'pagination'=>['pageSize'=>10],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n //session_unset();\n $dataProvider = new ActiveDataProvider([\n 'query' => Survey::find(),\n 'pagination'=>['pageSize'=>10],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function getSubmissions(array $users, $limit = 5) {\n return self::getItems($users, $limit, 'submitted');\n }", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function multiSearchIndex(Request $request)\n {\n $status = is_null($request->input('status'))?true:$request->input('status');\n $department = is_null($request->input('department'))?$request->input('department'):Helper::escapeLikeForQuery($request->input('department'));\n $course_name = is_null($request->input('course_name'))?$request->input('course_name'):Helper::escapeLikeForQuery($request->input('course_name'));\n $course_code = is_null($request->input('course_code'))?$request->input('course_code'):Helper::escapeLikeForQuery($request->input('course_code'));\n $semester = is_null($request->input('semester'))?$request->input('semester'):Helper::escapeLikeForQuery($request->input('semester'));\n $school = is_null($request->input('school'))?$request->input('school'):Helper::escapeLikeForQuery($request->input('school'));\n $year = is_null($request->input('year'))?$request->input('year'):Helper::escapeLikeForQuery($request->input('year'));\n\n $past_questions = PastQuestion::where('approved', $status)\n ->where('department', 'like', '%'.$department.'%')\n ->where('course_name', 'like', '%'.$course_name.'%')\n ->where('course_code', 'like', '%'.$course_code.'%')\n ->where('semester', 'like', '%'.$semester.'%')\n ->where('school', 'like', '%'.$school.'%')\n ->where('year', 'like', '%'.$year.'%')\n ->orderBy('created_at', 'desc')\n ->take(100)\n ->paginate(10);\n\n if ($past_questions) {\n \n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }", "public function index(){\n return new QuestionCollection(Question::all());\n }", "function all_final_submissions_quick($min_status = 0) {\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$join_on = \"best\";\n\t\t} else {\n\t\t\t$join_on = \"last\";\n\t\t}\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM user_entity as ue JOIN submission as s ON ue.\".$join_on.\"_submissionid = s.submissionid\".\n\t\t\t\" WHERE ue.`entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\t$subs = Submission::fetch_all($query);\n\t\t$result = array();\n\t\tforeach($subs as $s) {\n\t\t\t$result[$s->userid] = $s;\n\t\t}\n\t\treturn $result;\n\t}", "public function index()\n {\n return new QuestionCollection(Question::paginate(10));\n }", "public function getFormValues()\n {\n $validator = App::make(SubmitForm::class);\n return $validator->getSubmissions();\n }", "function all_final_submissions($min_status = 0) {\n\t\treturn $this->all_final_submissions_from( $this->all_submissions($min_status) );\n\t}", "public function actionAll()\n {\n $searchModel = new ResearchAllSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('all', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAllEnquiries()\r\n\t\t{\r\n\t\t\tContact::SetQuery($name, $email, $subject, $message);\r\n\t\t}", "public function get_survey_submission($hash = NULL, $submission_id = NULL)\n\t{\n\t\t$data = array();\n\n\t\t// If we have a submission hash\n\t\tif ($hash)\n\t\t{\n\t\t\t$this->db->where('hash', $hash);\n\t\t}\n\t\t// If we do not have a submission hash we must have a submission ID\n\t\telse\n\t\t{\n\t\t\t$this->db->where('id', $submission_id);\n\t\t}\n\n\t\t$query = $this->db->limit(1)->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\n\t\t\t$data = array(\n\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t'hash' => $row->hash,\n\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t);\n\t\t}\n\n\t\treturn $data;\n\t}", "public function all()\n {\n $endpoint = 'https://api.hubapi.com/forms/v2/forms';\n\n return $this->client->request('get', $endpoint);\n }", "public function queryset(){\n return $this->_get_queryset();\n }", "function smartchoice_get_all_responses($choice) {\n global $DB;\n return $DB->get_records('smartchoice_answers', array('choiceid' => $choice->id));\n}", "public function search(Request $request)\n {\n $faqs = FrequentlyAskedQuestion::where('title', 'like', '%'.$request->input('query').'%')->take(20)->latest()->get();\n $html = View::make('admin.faqs.table', ['faqs' => $faqs]);\n $response = $html->render();\n\n return response()->json([\n 'status' => 'success',\n 'html' => $response\n ]); \n }", "public function index(Request $request)\n {\n\n $quiz = Question::query();\n\n\n $page_options = new PageOption();\n $where =[];\n\n $page_options->default_sort_column = 'title';\n $page_options->search_column = 'title';\n $page_options->where = $where;\n\n $this->set_page_option( $quiz, $page_options );\n\n $where[ 'hidden' ] = 0;\n\n if( ( $this->isAdmin($user_id) ) ) {\n if( $request->get('_hidden_only' ) == 1 )\n $where['hidden'] = 1;\n else unset($where['hidden']);\n }\n\n if( !$quiz->where( $where )->exists() )\n return response([\"message\" => \"No Question Found\"]);\n\n if ( $request->has('exclution' ) ) {\n $exclutionList = explode( ',', $request->get('exclution' ) );\n $quiz->whereNotIn( 'id', $exclutionList );\n }\n\n $data = QuestionResource::collection( $quiz->where( $where )->paginate( $page_options->page_size ) );\n $data->additional( [ 'sql' => $quiz->toSql() ]);\n\n return $data;\n }", "public function getResults()\n {\n return $this->action->getRequest()->getResults();\n }", "public function all()\n\t{\n\t\t$queries = [];\n\n\t\tforeach( $this->request->all() as $key => $value )\n\t\t{\n\t\t\t$queries[$key] = new Inquiry($key, $value);\n\t\t}\n\n\t\treturn $queries;\n\t}", "static function search_posts() {\n\t\tglobal $wpdb;\n\n\t\tif( !isset( $_POST['term'] ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$posts = apply_filters( 'wp_form_pre_search_posts', null );\n\n\t\tif( !isset( $posts ) ) {\n\t\t\t$query_args = array(\n\t\t\t\t's' => $_POST['term'],\n\t\t\t\t'post_status' => 'any'\n\t\t\t);\n\n\t\t\tif( isset( $_POST['post_type'] ) ) {\n\t\t\t\t$query_args['post_type'] = (array) $_POST['post_type'];\n\t\t\t}\n\n\t\t\t$query_args = apply_filters( 'wp_form_search_posts', $query_args );\n\n\t\t\t$query = new WP_Query( $query_args );\n\t\t\t$posts = $query->posts;\n\t\t}\n\n\t\t$posts = apply_filters( 'wp_form_search_results', $posts );\n\n\t\twp_send_json_success( $posts );\n\t}", "public function get_research_questions()\n\t{\n\t\treturn $this->research_questions;\n\t}", "function get_all_by_survey($sid)\r\n {\r\n $this->db->select(\"*\");\r\n $this->db->where(\"sid\",$sid);\r\n return $this->db->get(\"data_files\")->result_array();\r\n }", "public function listSubmissions(Request $request) {\n\t\t$pager = $this->pager($request, $this->getUser()->getJokeSubmissions());\n\t\treturn $this->render('Joke/listSubmissions.html.twig', ['pager' => $pager]);\n\t}", "function get_popular_surveys($limit=10)\n\t{\n\t\tif (!is_numeric($limit)){\n\t\t\t$limit=10;\n\t\t}\n\t\t\n\t\t$fields='s.id as id,\n\t\t\t\ts.idno as idno, \n\t\t\t\ts.title as title,\n\t\t\t\ts.authoring_entity,\n\t\t\t\ts.nation,\n\t\t\t\ts.total_views as visits';\n\t\t\t\t\t\t\t\t\n\t\t$this->db->select($fields);\n\t\t$this->db->limit($limit);\n\t\t$this->db->where('s.published',1);\t\t\n\t\t$query=$this->db->get('surveys s');\n\t\t\t\t\n\t\tif ($query){\n\t\t\treturn $query->result_array();\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function retrieve_subreddit_posts()\n {\n $post_array = $this->request_subreddit($this->subreddit);\n $post_collection = $this->get_post_collection($post_array);\n\n return $this->to_array($post_collection);\n }", "public function getAll()\n {\n return $this->_answers;\n }", "public function index()\n {\n return QuestionResource::collection(Question::latest()->get()); //This line gets all the latest questions\n }", "static function getAllSurveys($id = null, $cfg) {\n // In the event the survey project is longitudinal, we need to use the event ID\n $survey_event_id = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? NULL : StaticUtils::getEventIdFromName($cfg['SURVEY_PID'], $cfg['SURVEY_EVENT_ARM_NAME']);\n $survey_event_prefix = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? \"\" : \"[\" . $cfg['SURVEY_EVENT_ARM_NAME'] . \"]\";\n\n if ($id == null) {\n $filter = null; //get all ids\n } else {\n $filter = $survey_event_prefix . \"[{$cfg['SURVEY_FK_FIELD']}]='$id'\";\n }\n\n $get_data = array(\n $cfg['SURVEY_PK_FIELD'],\n $cfg['SURVEY_FK_FIELD'],\n $cfg['SURVEY_TIMESTAMP_FIELD'],\n $cfg['SURVEY_DATE_FIELD'],\n $cfg['SURVEY_DAY_NUMBER_FIELD'],\n $cfg['SURVEY_FORM_NAME'] . '_complete'\n ) ;\n\n $q = REDCap::getData(\n $cfg['SURVEY_PID'],\n 'json',\n NULL,\n $get_data,\n $survey_event_id,\n NULL,FALSE,FALSE,FALSE,\n $filter\n );\n\n $results = json_decode($q,true);\n return $results;\n }", "function get_all_numberreturnsubmission()\n {\n return $this->db->get('numberreturnsubmission')->result_array();\n }", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function postSearch(Request $request){\n\n $results = array();\n\n //Validate search input\n $this->validate($request, ['input' => 'required|max:255']);\n\n //Define search terms, and add search filters to search terms\n $search_terms = $request->input('input');\n $search_terms_array = array_map('strtolower', explode(\" \", $search_terms));\n\n if( !(empty($request['prep_time'])) )\n $max_prep_time = $request->input('prep_time');\n else\n $max_prep_time = PHP_INT_MAX;\n\n if( !(empty($request['cook_time'])) )\n $max_cook_time = $request->input('cook_time');\n else\n $max_cook_time = PHP_INT_MAX;\n\n //Narrow down search to include only certain courses\n if( isset($request['course']) ){\n\n if( $request['course'] == 'entree' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%entree%')->get();\n\n if( $request['course'] == 'main' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%main%')->get();\n\n if( $request['course'] == 'dessert' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%dessert%')->get();\n }\n else{\n\n $course_results = \\App\\Recipe::all();\n }\n\n\n //Narrow down the search to include time constraints\n $timeconstraint_results = array();\n foreach( $course_results as $result ){\n\n if( ($result->prep_time <= $max_prep_time) && ($result->cook_time <= $max_cook_time) ){\n\n array_push($timeconstraint_results, $result);\n }\n }\n\n //Narrow down the search to only include search term matches\n $searchterm_results = array();\n foreach( $timeconstraint_results as $result ){\n\n //Get terms that potentially match search terms\n $title_terms = array_map('strtolower', array_map('trim', explode(\" \", $result->title)));\n $tag_terms = array_map('strtolower', array_map('trim', explode(\"#\", $result->tags)));\n $recipe_terms = array_merge($title_terms, $tag_terms);\n\n if( sizeof(array_intersect($search_terms_array, $recipe_terms)) > 0 ){\n\n array_push($results, $result);\n }\n }\n\n return view('Recipes.search')->with('results', $results);\n\n }", "public function actionIndex($id = null)\n {\n $userId = $id ?: Yii::$app->getUser()->getId();\n $searchModel = new SearchSurvey();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $userId);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $dqlsurvey = \"SELECT sy.id,sy.title,sy.descriptions,sy.active,sy.createdOn,ev.title as event_title FROM DroidInfotechDroidBundle:Survey sy JOIN DroidInfotechDroidBundle:Events ev WITH sy.eventId=ev.id\";\n\n $surveys = $em->createQuery($dqlsurvey)->getResult();\n // print_r($surveys); \n //$surveys = $em->getRepository('DroidInfotechDroidBundle:Survey')->findAll();\n return $this->render('survey/index.html.twig', array(\n 'surveys' => $surveys,\n ));\n }", "private function getSelectedSurveyQuestionsForReport($searchAttributes)\n {\n\n if (!isset($searchAttributes['survey'])\n || empty($searchAttributes['survey'])\n ) {\n\n return [];\n }\n\n $surveyQuestions = [];\n $searchAttributes = $searchAttributes['survey'];\n\n foreach ($searchAttributes as $searchAttribute) {\n\n if (!isset($searchAttribute['survey_id'])\n || empty($searchAttribute['survey_id'])\n ) {\n\n continue;\n }\n\n if (!isset($searchAttribute['survey_questions'])\n || empty($searchAttribute['survey_questions'])\n ) {\n\n continue;\n }\n\n foreach ($searchAttribute['survey_questions'] as $surveyQues) {\n\n if (!isset($surveyQues['id'])\n || empty($surveyQues['id'])\n ) {\n\n continue;\n }\n $surveyQuestions[] = $surveyQues['id'];\n }\n }\n\n return $surveyQuestions;\n }", "function submissions($args) {\n\t\t$this->validate();\n\t\t$this->setupTemplate(EDITOR_SERIES_HOME);\n\n\t\t$press =& Request::getPress();\n\t\t$pressId = $press->getId();\n\t\t$user =& Request::getUser();\n\n\t\t$sort = Request::getUserVar('sort');\n\t\t$sort = isset($sort) ? $sort : 'id';\n\t\t$sortDirection = Request::getUserVar('sortDirection');\n\t\t$sortDirection = (isset($sortDirection) && ($sortDirection == 'ASC' || $sortDirection == 'DESC')) ? $sortDirection : 'ASC';\n\n\t\t$editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\n\n\t\t$page = isset($args[0]) ? $args[0] : '';\n\n\t\t$rangeInfo = Handler::getRangeInfo('submissions');\n\n\t\tswitch($page) {\n\t\t\tcase 'submissionsUnassigned':\n\t\t\t\t$functionName = 'getUnassigned';\n\t\t\t\t$helpTopicId = 'editorial.editorsRole.submissions.unassigned';\n\t\t\t\tbreak;\n\t\t\tcase 'submissionsInEditing':\n\t\t\t\t$functionName = 'getInEditing';\n\t\t\t\t$helpTopicId = 'editorial.editorsRole.submissions.inEditing';\n\t\t\t\tbreak;\n\t\t\tcase 'submissionsArchives':\n\t\t\t\t$functionName = 'getArchives';\n\t\t\t\t$helpTopicId = 'editorial.editorsRole.submissions.archives';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$page = 'submissionsInReview';\n\t\t\t\t$functionName = 'getInReview';\n\t\t\t\t$helpTopicId = 'editorial.editorsRole.submissions.inReview';\n\t\t}\n\n\t\t// TODO: nulls represent search options which have not yet been implemented\n\t\t$submissions =& $editorSubmissionDao->$functionName(\n\t\t\t$pressId,\n\t\t\tFILTER_EDITOR_ALL,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t$rangeInfo,\n\t\t\t$sort,\n\t\t\t$sortDirection\n\t\t);\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign('pageToDisplay', $page);\n\t\t$templateMgr->assign('editor', $user->getFullName());\n\n\t\t$templateMgr->assign_by_ref('submissions', $submissions);\n\n\t\t$templateMgr->assign('helpTopicId', $helpTopicId);\n\t\t$templateMgr->display('editor/submissions.tpl');\n\t}", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "public function index(Request $request)\n {\n $per_page = (isset($request->recordvalue) ? $request->recordvalue : Config::get('variable.page_per_record'));\n $surveys = Survey::paginate($per_page);\n return view ('survey.index',compact(\"surveys\"));\n }", "public function __invoke(Form $form): FormSubmissionsResource\n {\n $this->authorize('list-submissions', $form);\n\n $submissions = $form->submissions;\n\n abort_if($submissions->isEmpty(), Response::HTTP_NO_CONTENT);\n\n return new FormSubmissionsResource($submissions);\n }", "public function index()\n {\n return Question::latest()->paginate(90);\n }", "function getQuestionsTable($arrFilter)\n\t{\n\t\tglobal $ilUser;\n\t\tglobal $ilDB;\n\t\t$where = \"\";\n\t\tif (is_array($arrFilter))\n\t\t{\n\t\t\tif (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_question.title', 'text', \"%%\" . $arrFilter['title'] . \"%%\");\n\t\t\t}\n\t\t\tif (array_key_exists('description', $arrFilter) && strlen($arrFilter['description']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_question.description', 'text', \"%%\" . $arrFilter['description'] . \"%%\");\n\t\t\t}\n\t\t\tif (array_key_exists('author', $arrFilter) && strlen($arrFilter['author']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_question.author', 'text', \"%%\" . $arrFilter['author'] . \"%%\");\n\t\t\t}\n\t\t\tif (array_key_exists('type', $arrFilter) && strlen($arrFilter['type']))\n\t\t\t{\n\t\t\t\t$where .= \" AND svy_qtype.type_tag = \" . $ilDB->quote($arrFilter['type'], 'text');\n\t\t\t}\n\t\t\tif (array_key_exists('spl', $arrFilter) && strlen($arrFilter['spl']))\n\t\t\t{\n\t\t\t\t$where .= \" AND svy_question.obj_fi = \" . $ilDB->quote($arrFilter['spl'], 'integer');\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$spls =& $this->getAvailableQuestionpools($use_obj_id = TRUE, $could_be_offline = FALSE, $showPath = FALSE);\n\t\t$forbidden = \"\";\n\t\t$forbidden = \" AND \" . $ilDB->in('svy_question.obj_fi', array_keys($spls), false, 'integer');\n\t\t$forbidden .= \" AND svy_question.complete = \" . $ilDB->quote(\"1\", 'text');\n\t\t$existing = \"\";\n\t\t$existing_questions =& $this->getExistingQuestions();\n\t\tif (count($existing_questions))\n\t\t{\n\t\t\t$existing = \" AND \" . $ilDB->in('svy_question.question_id', $existing_questions, true, 'integer');\n\t\t}\n\t\t\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\t$trans = ilObjSurveyQuestionPool::_getQuestionTypeTranslations();\n\t\t\n\t\t$query_result = $ilDB->query(\"SELECT svy_question.*, svy_qtype.type_tag, svy_qtype.plugin, object_reference.ref_id\".\n\t\t\t\" FROM svy_question, svy_qtype, object_reference\".\n\t\t\t\" WHERE svy_question.original_id IS NULL\".$forbidden.$existing.\n\t\t\t\" AND svy_question.obj_fi = object_reference.obj_id AND svy_question.tstamp > 0\".\n\t\t\t\" AND svy_question.questiontype_fi = svy_qtype.questiontype_id \" . $where);\n\n\t\t$rows = array();\n\t\tif ($query_result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($query_result))\n\t\t\t{\n\t\t\t\tif (array_key_exists('spl_txt', $arrFilter) && strlen($arrFilter['spl_txt']))\n\t\t\t\t{\n\t\t\t\t\tif(!stristr($spls[$row[\"obj_fi\"]], $arrFilter['spl_txt']))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$row['ttype'] = $trans[$row['type_tag']];\n\t\t\t\tif ($row[\"plugin\"])\n\t\t\t\t{\n\t\t\t\t\tif ($this->isPluginActive($row[\"type_tag\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($rows, $row);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tarray_push($rows, $row);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "public function singleSearchIndex(Request $request)\n {\n $status = is_null($request->input('status'))?true:$request->input('status');\n $search = is_null($request->input('search'))?$request->input('search'):Helper::escapeLikeForQuery($request->input('search'));\n\n $past_questions = PastQuestion::where('approved', (boolean)$status)\n ->where(function ($query) use ($search) {\n $query->where('department', 'like', '%'.$search.'%')\n ->orWhere('course_name', 'like', '%'.$search.'%')\n ->orWhere('course_code', 'like', '%'.$search.'%')\n ->orWhere('semester', 'like', '%'.$search.'%')\n ->orWhere('school', 'like', '%'.$search.'%')\n ->orWhere('year', 'like', '%'.$search.'%');\n })->orderBy('created_at', 'desc')\n ->take(100)\n ->paginate(10);\n\n if ($past_questions) {\n\n if (count($past_questions) > 0) {\n return $this->success($past_questions);\n } else {\n return $this->notFound('Past questions were not found');\n }\n\n } else {\n return $this->requestConflict('Currently unable to search for past questions');\n }\n }", "public function actionsurveysearch()\n {\n $module = \"HelpDesk\";\n $year = $_POST['year'];\n Yii::app()->session['Search_year'] = $year;\n $month = $_POST['month'];\n Yii::app()->session['Search_month'] = $month;\n $reportdamage = $_POST['reportdamage'];\n Yii::app()->session['Search_reportdamage'] = $reportdamage;\n $trailer = $_POST['trailer'];\n Yii::app()->session['Search_trailer'] = $trailer;\n $trailerid = $_POST['trailerid'];\n Yii::app()->session['Search_trailerid'] = $trailerid;\n if ($trailer == \"--All Trailers--\")\n $trailer = \"0\";\n $model = new Troubleticket;\n $this->LoginCheck();\n$minLimit = $_POST['minLimit'];\n$maxLimit = $_POST['maxLimit'];\n$ticketstatus = $_POST['ticketstatus'];\n $records = $model->findAll($module, 'all', $year, $month, $trailer, $reportdamage, $minLimit, $maxLimit, $ticketstatus);\n$dataArray = array();\nforeach ($records['result'] as $data) {\n $date = date('y-m-d', strtotime(Yii::app()->localtime->toLocalDateTime($data['createdtime'])));\n $time = date('H:i', strtotime(Yii::app()->localtime->toLocalDateTime($data['createdtime'])));\n $viewdteails = '<span id=' . $data['id'] . '></span><a href=\"index.php?r=troubleticket/surveydetails/' . $data['id'] . '\" onclick=waitprocess(\"' . $data['id'] . '\")>' . $data['accountname'] . '</a>';\n\n $arrData = array('ticket_no'=>$data['ticket_no'],\n 'date'=>$date,\n 'time'=>$time,\n 'trailerid'=>$data['trailerid'],\n 'viewdteails' => $data['accountname'],\n 'contactname' => $data['contactname'],\n 'damagereportlocation' => htmlentities($data['damagereportlocation'], ENT_QUOTES, \"UTF-8\"),\n 'damagestatus' => $data['damagestatus'],\n 'reportdamage' => $data['reportdamage'],\n 'damagetype' => htmlentities($data['damagetype'], ENT_QUOTES, \"UTF-8\"),\n 'damageposition' => htmlentities($data['damageposition'], ENT_QUOTES, \"UTF-8\"),\n 'drivercauseddamage' => $data['drivercauseddamage'],\n 'id' => $data['id']\n );\n array_push($dataArray,$arrData);\n }\n echo json_encode($dataArray);\nexit;\n }", "public function get_collection_params_statistics_questions() {\n\t\t\t$query_params = parent::get_collection_params();\n\n\t\t\tif ( isset( $query_params['search'] ) ) {\n\t\t\t\tunset( $query_params['search'] );\n\t\t\t}\n\n\t\t\treturn $query_params;\n\t\t}", "public static function getAll() {\n \treturn Question::whereNull('deleted_at')->get();\n }", "public function index(Request $request)\n {\n $request->merge([\n 'order' => [\n [\n 'column' => 'order',\n 'dir' => 'asc'\n ]\n ]\n ]);\n\n $records = $this->faqService->getAll($request->query());\n\n return (new FaqQuestionCollection($records))\n ->additional(['success' => true]);\n }", "protected function _query_all() {\n\t\t\t\t\n\t\t/* set the default query args */\n\t\t$default_queryargs = array();\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\tcase('post'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'post_type' \t\t=> 'post',\t\t\t\n\t\t\t\t\t'posts_per_page'\t=> -1,\n\t\t\t\t\t'post_status'\t\t=> 'publish',\n\t\t\t\t\t'orderby'\t\t\t=> 'ID',\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t\t'suppress_filters'\t=> false\t\t\t\t\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('attachment'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'post_type' \t\t=> 'attachment',\t\n\t\t\t\t\t'post_status'\t\t=> 'any',\n\t\t\t\t\t'posts_per_page'\t=> -1,\n\t\t\t\t\t'orderby'\t\t\t=> 'ID',\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t\t'suppress_filters'\t=> false\t\t\t\t\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('comment'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'order'\t\t\t\t=> 'ASC',\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t\t$default_queryargs = array(\n\t\t\t\t\t'role' => '',\n\t\t\t\t\t'meta_key' => '',\n\t\t\t\t\t'meta_value' => '',\n\t\t\t\t\t'meta_compare' => '',\n\t\t\t\t\t'meta_query' => array(),\n\t\t\t\t\t'include' => array(),\n\t\t\t\t\t'exclude' => array(),\n\t\t\t\t\t'orderby' => 'login',\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t'offset' => '',\n\t\t\t\t\t'search' => '',\n\t\t\t\t\t'number' => '',\n\t\t\t\t\t'count_total' => false,\n\t\t\t\t\t'fields' => 'all',\n\t\t\t\t\t'who' => ''\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$this->set_error( 500, 'One Id modelclass is not supported without id, this error cant even run :)');\n\t\t\t\treturn array();\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/* merge in query args from the request */\n\t\t$queryargs = array_merge($default_queryargs, $this->request_query_vars);\n\t\t\n\t\t/* filter args, add more query args from the extended class if desired */\n\t\t$queryargs = $this->filter_query_args($queryargs);\n\n\t\t// call database\t\n\t\t$found_items = array();\t\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t $wpQuery = new \\WP_Query($queryargs);\n\t\t\t $this->wp_query = $wpQuery;\n\t\t\t if( $wpQuery->have_posts()) {\n \t\t\t\t$found_items = $wpQuery->posts; \t\t\t \n\t\t\t }\t \n\t\t\tbreak;\n\t\t\tcase('comment'):\n\t\t\t\t$found_items = get_comments( $queryargs );\n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t\t$found_items = get_users($queryargs);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif ( empty($found_items) ) {\n\t\t\t//$this->set_error( 500, 'query is empty' );\n\t\t\t//return false;\n\t\t}\n\t\t\n\t\t/* get custom_package data and populate the result */\n\t\t$items = array();\n\t\t\n\t\tfor ( $i = 0; $i < count($found_items); $i++ ) {\n\t\t\t\n\t\t\t$found_items[$i] = $this->filter_found_item($found_items[$i]);\n\t\t\t\n\t\t\tswitch( $this->properties->modelclass ) {\n\t\t\t\tcase('post'):\n\t\t\t\tcase('attachment'):\n\t\t\t\t\t$items[$i]['post'] = $found_items[$i]; \t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase('comment'):\n\t\t\t\t\t$items[$i]['comment'] = $found_items[$i];\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase('user'):\n\t\t\t\t\t$items[$i]['user'] = $found_items[$i];\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t/* get custom data packkages */\n\t\t\t$custom_data = $this->_action_custom_package_data( $found_items[$i] );\t\t\t\n\n\t\t\t/* merge core data_packages with custom_data packages */\n\t\t\t$items[$i] = array_merge($items[$i], $custom_data );\t\t\t\n\t\t}\n\t\t/*\n\t *\tlooks something like this now:\n\t\t *\t$items = array (\n\t\t *\t\t\t\tarray(\n\t\t * \t\t\t\t'post' => array(\n\t\t *\t\t\t\t\t\t\t\t'post_title' => 'My title',\n\t\t *\t\t\t\t\t\t\t\t'post_parent'=> 567,\n\t\t *\t\t\t\t\t\t\t\t),\n\t\t * \t\t\t\t'postmeta'\t\t\t=> array(...),\n\t\t * \t\t\tarray(...),\n\t\t *\t\t\t);\n\t\t */\n\t\t \n\t\t \n\t\t/* when caching is enabled, set the cache */\n\t\tif($this->cache_time) {\n $this->set_cache($items);\n\t\t}\n\t\t\n\t\t/* return */\n\t\t$this->query = $items;\n\t\treturn $items;\n\t}", "public function listPendingSubmissions(Request $request) {\n\t\t$pager = $this->pager($request, $this->getDoctrine()->getRepository(JokeSubmission::class)->findPending());\n\t\treturn $this->render('Joke/listSubmissions.html.twig', ['pager' => $pager]);\n\t}", "function mysite_netcomp_search_submit($form, &$form_state){\n $searchValues = array();\n foreach ($form_state['values'] as $value){\n if ($value){\n $searchValues[] = $value;\n }\n }\n $results = _mysite_netcomp_apiRequest(\"Search\", \"GET\", \"\", $ids = $searchValues);\n\n// die(kpr($results));\n $form_state['storage']['results'] = array(\n '#value' => $results\n );\n $form_state['rebuild'] = TRUE;\n\n}", "private function json_allSurveys()\n {\n $query = \"SELECT * FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\n $params = [];\n\n $nextpage = null;\n\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n\n $res['status'] = 200;\n $res['message'] = \"ok\";\n $res['next_page'] = $nextpage;\n return json_encode($res);\n }", "public function getSubmittedSettings() {\n\t\t\treturn $this->submittedSettings;\n\t\t}", "public function do_searchScores($postData)\n {\n $this->checkIsAdmin();\n $searchForm = new \\Foundation\\Form;\n $field = $searchForm->newField();\n $field->setLegend('Search Scores');\n \n $element = $field->newElement('TextInput', 'firstName');\n $element->setLabel('First Name');\n $element->setValue($this->_applicant->getFirstName());\n $element = $field->newElement('TextInput', 'lastName');\n $element->setLabel('Last Name');\n $element->setValue($this->_applicant->getLastName());\n $searchForm->newHiddenElement('level', 'search');\n $searchForm->newButton('submit', 'Search Scores');\n \n $matchForm = new \\Foundation\\Form;\n $field = $matchForm->newField();\n $field->setLegend('Select scores to match');\n \n $greElement = $field->newElement('CheckboxList', 'greMatches');\n $greElement->setLabel('Possible GRE');\n \n $toeflElement = $field->newElement('CheckboxList', 'toeflMatches');\n $toeflElement->setLabel('Possible TOEFL');\n \n $matchForm->newHiddenElement('level', 'match');\n $matchForm->newButton('submit', 'Match Scores');\n \n $form = $searchForm;\n if (!empty($postData)) {\n if($postData['level'] == 'search'){\n if($input = $searchForm->processInput($postData)){\n $matchForm->newHiddenElement('firstName', $input->get('firstName'));\n $matchForm->newHiddenElement('lastName', $input->get('lastName'));\n \n $existingScores = array();\n foreach($this->getAnswers() as $answer){\n $date = strtotime($this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getJazzeeElement()->displayValue($answer));\n $uniqueId = \n $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getJazzeeElement()->displayValue($answer) .\n $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getJazzeeElement()->displayValue($answer) .\n date('m', $date) . date('Y', $date); \n $existingScores[$uniqueId] = $answer;\n }\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findByName($input->get('firstName') . '%', $input->get('lastName') . '%') as $score) {\n $uniqueId = $score->getRegistrationNumber() . 'GRE/GRE Subject' . $score->getTestDate()->format('m') . $score->getTestDate()->format('Y');\n if(!array_key_exists($uniqueId, $existingScores)){\n $greElement->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleInitial() . ' ' . $score->getTestDate()->format('m/d/Y'));\n } else {\n if(!$existingScores[$uniqueId]->getGREScore()) {\n $greElement->addMessage('The system found at least one match for a GRE score the applicant had previously entered. You may need to refresh this page to view that match.');\n $this->matchScore($existingScores[$uniqueId]);\n }\n }\n }\n\n\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findByName($input->get('firstName') . '%', $input->get('lastName') . '%') as $score) {\n $uniqueId = $score->getRegistrationNumber() . 'TOEFL' . $score->getTestDate()->format('m') . $score->getTestDate()->format('Y');\n if(!array_key_exists($uniqueId, $existingScores)){\n $toeflElement->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleName() . ' ' . $score->getTestDate()->format('m/d/Y'));\n } else {\n if(!$existingScores[$uniqueId]->getTOEFLScore()) {\n $toeflElement->addMessage('The system found at least one match for a TOEFL score the applicant had previously entered. You may need to refresh this page to view that match.');\n $this->matchScore($existingScores[$uniqueId]);\n }\n }\n }\n $form = $matchForm;\n }\n } else if($postData['level'] == 'match'){\n $form = $matchForm;\n \n //Re add all the matches to the elements so they will validate\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findByName($postData['firstName'] . '%', $postData['lastName'] . '%') as $score) {\n $greElement->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleInitial() . ' ' . $score->getTestDate()->format('m/d/Y'));\n }\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findByName($postData['firstName'] . '%', $postData['lastName'] . '%') as $score) {\n $toeflElement->newItem($score->getId(), $score->getLastName() . ', ' . $score->getFirstName() . ' ' . $score->getMiddleName() . ' ' . $score->getTestDate()->format('m/d/Y'));\n }\n\n if($input = $matchForm->processInput($postData)){\n //create a blank for so it can get values from parent::newAnswer\n $this->_form = new \\Foundation\\Form();\n if ($input->get('greMatches')) {\n foreach ($input->get('greMatches') as $scoreId) {\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->find($scoreId);\n $arr = array(\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getId() => $score->getRegistrationNumber(),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getId() => $score->getTestDate()->format('c'),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getId() => $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getItemByValue('GRE/GRE Subject')->getId()\n );\n $newInput = new \\Foundation\\Form\\Input($arr);\n $this->newAnswer($newInput);\n }\n }\n if ($input->get('toeflMatches')) {\n foreach ($input->get('toeflMatches') as $scoreId) {\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->find($scoreId);\n $arr = array(\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getId() => $score->getRegistrationNumber(),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getId() => $score->getTestDate()->format('c'),\n 'el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getId() => $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getItemByValue('TOEFL')->getId()\n );\n $newInput = new \\Foundation\\Form\\Input($arr);\n $this->newAnswer($newInput);\n }\n }\n $this->_controller->setLayoutVar('status', 'success');\n }\n }\n }\n\n return $form;\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "function survey_data() {\n $surveys = array();\n foreach ( $this->sites as $name => $blog ) {\n $this->println(sprintf(\"Surveying Blog #%s: %s.\", $blog->id, $blog->name));\n $survey = $this->survey_site($blog->id);\n $surveys[$blog->name] = $survey;\n }\n\n // Compile meta survey.\n $posts = array();\n $site_counts = array();\n $meta_survey = array(\n 'posts' => 0,\n 'media-images' => 0,\n 'media-images-sans-alt' => 0,\n 'embedded-images' => 0,\n 'embedded-images-sans-alt' => 0,\n 'embedded-images-sans-media' => 0,\n 'embedded-images-external' => 0\n );\n foreach ( $surveys as $name => $survey ) {\n $posts += $survey['posts'];\n $counts = $survey['counts'];\n $meta_survey['posts'] += $counts['posts'];\n $meta_survey['media-images'] += $counts['media-images'];\n $meta_survey['media-images-sans-alt'] += $counts['media-images-sans-alt'];\n $meta_survey['embedded-images'] += $counts['embedded-images'];\n $meta_survey['embedded-images-sans-alt'] += $counts['embedded-images-sans-alt'];\n $meta_survey['embedded-images-sans-media'] += $counts['embedded-images-sans-media'];\n $site_counts[$name] = $counts;\n }\n\n // Count non-uploaded images\n foreach ( $posts as $post ) {\n $meta_survey['embedded-images-external'] += count($post->external_embedded_images());\n }\n\n $report_f = <<<EOB\nSITES:\n%s\n\nMETA:\n%s\nEOB;\n return sprintf($report_f, print_r($site_counts, 1), print_r($meta_survey, 1));\n }", "function inbound_cf7_get_form_submissions_by( $nature = 'lead_id' , $params ){\n global $wpdb;\n\n $table_name = $wpdb->prefix . \"inbound_events\";\n $query = 'SELECT * FROM '.$table_name.' WHERE ';\n\n switch ($nature) {\n case 'lead_id':\n $query .= '`lead_id` = \"'.$params['lead_id'].'\" ';\n break;\n case 'page_id':\n $query .= '`page_id` = \"'.$params['page_id'].'\" ';\n break;\n case 'cta_id':\n $query .= '`cta_id` = \"'.$params['cta_id'].'\" ';\n break;\n }\n\n /* add date constraints if applicable */\n if (isset($params['start_date'])) {\n $query .= 'AND datetime >= \"'.$params['start_date'].'\" AND datetime <= \"'.$params['end_date'].'\" ';\n }\n\n if (isset($params['variation_id'])) {\n $query .= 'AND variation_id = \"'.$params['variation_id'].'\" ';\n }\n\n $query .= 'AND `event_name` = \"cf7_form_submission\" ORDER BY `datetime` DESC';\n\n $results = $wpdb->get_results( $query , ARRAY_A );\n\n return $results;\n}", "function ubc_di_get_assessment_results() {\n\t\tglobal $wpdb;\n\t\t$response = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t} else {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t\t$temp_ubc_di_sites = array();\n\t\t\t$user_id = get_current_user_id();\n\t\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_site->ID, 'ubc_di_assessment_result_group', true );\n\t\t\t\t$ubc_di_group_people = get_post_meta( $ubc_di_asr_group_id, 'ubc_di_group_people', true );\n\t\t\t\tif ( '' != $ubc_di_group_people ) {\n\t\t\t\t\tforeach ( $ubc_di_group_people as $ubc_di_group_person ) {\n\t\t\t\t\t\tif ( $user_id == $ubc_di_group_person ) {\n\t\t\t\t\t\t\t$temp_ubc_di_sites[] = $ubc_di_site;\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$ubc_di_sites = $temp_ubc_di_sites;\n\t\t}\n\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t$temp_array = $this->ubc_di_get_site_metadata( $ubc_di_site->ID );\n\t\t\tif ( null != $temp_array ) {\n\t\t\t\tarray_push( $response, $temp_array );\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "public function listSurvey() {\n $surveys = \\App\\Survey::where('deleted', '=', 0)->get();\n return view('User/listSurvey', ['surveys' => $surveys]);\n }", "public function Read(){\n if (isset($_SESSION['question'])) {\n unset($_SESSION['question']);\n\n }\n \n $model = Survey::getInstance();\n $questions = $model->get_questions();\n $answers = $model->get_answers();\n // var_dump($query);\n $this->smarty->assign('questions',$questions);\n $this->smarty->assign('answers',$answers);\n\n $this->smarty->show('survey');\n }" ]
[ "0.64325094", "0.64244294", "0.61194974", "0.60658884", "0.60614973", "0.59773904", "0.5884745", "0.58226883", "0.581804", "0.5790863", "0.5789288", "0.5775172", "0.57700557", "0.5765209", "0.5763232", "0.5725316", "0.57097596", "0.56432366", "0.5620622", "0.56064343", "0.55968606", "0.55528903", "0.55387634", "0.55200285", "0.5517244", "0.5458244", "0.5442555", "0.544234", "0.5416997", "0.53964084", "0.5396186", "0.53595865", "0.53595865", "0.53432333", "0.5340374", "0.5314741", "0.5307694", "0.53030515", "0.53027356", "0.530248", "0.530248", "0.5261804", "0.5258036", "0.5243898", "0.5242762", "0.5241197", "0.52383775", "0.5218681", "0.52057326", "0.5191174", "0.51789457", "0.5172541", "0.51667833", "0.5165924", "0.5150893", "0.5148673", "0.5147815", "0.51372045", "0.51321274", "0.51273394", "0.5126219", "0.5121166", "0.511889", "0.5117098", "0.51136297", "0.51129115", "0.51095873", "0.5105121", "0.5095181", "0.5084099", "0.50626", "0.50616086", "0.5059365", "0.5051354", "0.5051068", "0.5044641", "0.5042378", "0.5040208", "0.50360185", "0.503229", "0.5027856", "0.5025763", "0.5023778", "0.50068784", "0.500663", "0.5005542", "0.5004037", "0.5003257", "0.49949527", "0.4994781", "0.49945006", "0.49937496", "0.4993596", "0.4990115", "0.49872404", "0.49847832", "0.49829713", "0.49829343", "0.4982012", "0.49798286" ]
0.64346766
0
Get details from a prevously submitted survey
public function get_survey_submission($hash = NULL, $submission_id = NULL) { $data = array(); // If we have a submission hash if ($hash) { $this->db->where('hash', $hash); } // If we do not have a submission hash we must have a submission ID else { $this->db->where('id', $submission_id); } $query = $this->db->limit(1)->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { $row = $query->row(); $data = array( 'id' => (int)$row->id, 'hash' => $row->hash, 'member_id' => (int)$row->member_id, 'survey_id' => (int)$row->survey_id, 'data' => json_decode($row->data, TRUE), 'created' => (int)$row->created, 'updated' => (int)$row->updated, 'completed' => (int)$row->completed, 'current_page' => (int)$row->current_page, 'complete' => (bool)$row->completed ); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionsurveydetails()\n {\n $model = new Troubleticket;\n $this->LoginCheck();\n $module = \"HelpDesk\";\n $urlquerystring = $_SERVER['QUERY_STRING'];\n $paraArr = explode(\"/\", $urlquerystring);\n $ticketId = $paraArr['2'];\n $storedata = $model->findById($module, $ticketId);\n\n $picklist_damagestatus = $model->getpickList('damagestatus');\n $this->render('surveydetails', array('model' => $model,\n 'result' => $storedata,\n 'damagestatus' => $picklist_damagestatus)\n );\n }", "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function getSurveyDetails($id) {\n $result = array();\n\t\t$survey_details = $this->findById($id);\n\t\tif (!empty($survey_details))\n\t\t{\n\t\t\t$result['name'] = $survey_details['Survey']['name'];\n\t\t\t$result['description'] = $survey_details['Survey']['description'];\n $result['surveyKey'] = $survey_details['Survey']['survey_key'];\n $result['type'] = $survey_details['Survey']['type'] == true ? 1 : 0;\n $result['status'] = $survey_details['Survey']['status'];\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n }", "public function Read(){\n if (isset($_SESSION['question'])) {\n unset($_SESSION['question']);\n\n }\n \n $model = Survey::getInstance();\n $questions = $model->get_questions();\n $answers = $model->get_answers();\n // var_dump($query);\n $this->smarty->assign('questions',$questions);\n $this->smarty->assign('answers',$answers);\n\n $this->smarty->show('survey');\n }", "public function show(Survey $survey)\n {\n \n }", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "function &_getGlobalSurveyData($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\t$result = array();\n\t\tif (($survey->getTitle()) and ($survey->author) and (count($survey->questions)))\n\t\t{\n\t\t\t$result[\"complete\"] = true;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\t$result[\"complete\"] = false;\n\t\t}\n\t\t$result[\"evaluation_access\"] = $survey->getEvaluationAccess();\n\t\treturn $result;\n\t}", "function survey_data() {\n $surveys = array();\n foreach ( $this->sites as $name => $blog ) {\n $this->println(sprintf(\"Surveying Blog #%s: %s.\", $blog->id, $blog->name));\n $survey = $this->survey_site($blog->id);\n $surveys[$blog->name] = $survey;\n }\n\n // Compile meta survey.\n $posts = array();\n $site_counts = array();\n $meta_survey = array(\n 'posts' => 0,\n 'media-images' => 0,\n 'media-images-sans-alt' => 0,\n 'embedded-images' => 0,\n 'embedded-images-sans-alt' => 0,\n 'embedded-images-sans-media' => 0,\n 'embedded-images-external' => 0\n );\n foreach ( $surveys as $name => $survey ) {\n $posts += $survey['posts'];\n $counts = $survey['counts'];\n $meta_survey['posts'] += $counts['posts'];\n $meta_survey['media-images'] += $counts['media-images'];\n $meta_survey['media-images-sans-alt'] += $counts['media-images-sans-alt'];\n $meta_survey['embedded-images'] += $counts['embedded-images'];\n $meta_survey['embedded-images-sans-alt'] += $counts['embedded-images-sans-alt'];\n $meta_survey['embedded-images-sans-media'] += $counts['embedded-images-sans-media'];\n $site_counts[$name] = $counts;\n }\n\n // Count non-uploaded images\n foreach ( $posts as $post ) {\n $meta_survey['embedded-images-external'] += count($post->external_embedded_images());\n }\n\n $report_f = <<<EOB\nSITES:\n%s\n\nMETA:\n%s\nEOB;\n return sprintf($report_f, print_r($site_counts, 1), print_r($meta_survey, 1));\n }", "public function pi_process_staff_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'currently-employed':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Are you currently employed with this treatment center? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'how-long':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'How long have you been employed there? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'full-time-or-contractor':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Do you work at the treatment center full time or an independent contractor or a consultant? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'licensed-medical-professionals':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'How many licensed medical professionals work at the facility full-time? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'medical-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the center’s medical staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'health-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the mental health staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'addiction-treatment-staff-credentials':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Credentials and experience of the center\\'s addiction treatment staff ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'marketing-pr-fairness':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Fairness and honesty in terms of advertising, marketing and public relations ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'community':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Ability to manage fairly and inspire a sense of community ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function pi_process_alumni_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-month':\n\t\t\t\t\t\t\t$content .= 'Date began treatment: '. sanitize_text_field($value) . '/' ;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-day':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '/';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-year':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'facility-name':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Facility Name: ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'led-decision':\n\t\t\t\t\t\t\t$header = 'What led to the decision? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'how-choice':\n\t\t\t\t\t\t\t$header = 'How did you choose this treatment facility? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'condition':\n\t\t\t\t\t\t\t$header = 'What condition were you treated for? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'long-ago':\n\t\t\t\t\t\t\t$header = 'How long has it been since you left treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'before-complete':\n\t\t\t\t\t\t\t$header = 'Did you leave the treatment center before completing your treatment program? If yes, explain. ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'counselor-additional':\n\t\t\t\t\t\t\t$header = 'Integration of holistic and alternatice treatments...';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'approriate':\n\t\t\t\t\t\t\t$header = 'If you were diagnosed with corresponding psychiatric or psychological conditions such as anxiety, depression, PTSD or OCD, were they addressed appropriately during treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'after-care':\n\t\t\t\t\t\t\t$header = 'Did the treatment center provide you with resources or aftercare support? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'relapse':\n\t\t\t\t\t\t\t$header = 'Did you relapse after treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'reenter':\n\t\t\t\t\t\t\t$header = 'Did you re-enter this facility after you relapsed? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'education':\n\t\t\t\t\t\t\t$header = 'Did the treatment program provide you with the appropriate education and recovery tools to help you in your journey toward sobriety? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'needs':\n\t\t\t\t\t\t\t$header = 'Did the program take your specific needs into consideration during individual and group therapy sessions? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'expectations':\n\t\t\t\t\t\t\t$header = 'Did the addiction center and your specific treatment program meet your needs and expectations? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'recommend':\n\t\t\t\t\t\t\t$header = 'Would you recommend this treatment facility to a friend or family member who needs help for their substance dependency? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'return':\n\t\t\t\t\t\t\t$header = 'Would you return to this facility if you needed additional treatment or suffered a relapse? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "public function get_details($qid) {\n\t\t$query = $this -> db -> get_where('Question', array('questionID' => $qid));\n\t\treturn $query -> first_row();\n\t}", "public function createOfficialsSurvey()\n {\n return $this->mailer->createOfficialsSurvey($this->data);\n }", "protected function response_survey_display($data) {\n $resptags = new \\stdClass();\n if (isset($data->{'q'.$this->id})) {\n $resptags->content = $data->{'q'.$this->id};\n }\n return $resptags;\n }", "public function getDetails($id = 0)\n\t{\n\t\t//dd($c);\n\t\t$assessments = DB::table('assessment_question')\n\t\t\t\t//->join('assessment', 'assessment.id', '=', 'assessment_question.assessment_id')\n\t\t\t\t->join('questions', 'questions.id', '=', 'assessment_question.question_id')\n\t\t\t\t->join('question_type', 'questions.question_type_id','=', 'question_type.id')\n\t\t\t\t->leftjoin('question_answers','question_answers.question_id','=','assessment_question.question_id')\n\t\t\t\t->leftjoin('passage','passage.id','=','assessment_question.passage_id')\n\t\t\t\t->where('assessment_question.assessment_id','=',$id)\n\n\t\t\t\t->select('questions.id as qstn_id','questions.title as qstn_title','question_answers.id as answer_id','question_answers.is_correct','question_answers.ans_text','questions.qst_text','passage.id as psg_id','passage.title as psg_title','passage.passage_text as psg_txt','passage.passage_lines as psg_lines','question_type.qst_type_text as qst_type')\n\t\t\t\t//->orderby('psg_id','qstn_id')\n\t\t\t\t->get();\n\t\t//dd($assessments);\n\t\t$questions = [];\n\t\tforeach ($assessments as $key => $question) {\n\t\t\t$questions[$question->psg_id]['psg_title'] = $question->psg_title;\n\t\t\t$questions[$question->psg_id]['psg_txt'] = $question->psg_txt;\n\t\t\t$questions[$question->psg_id]['questions'][$question->qstn_id]['qstn_id'] = $question->qstn_id;\n\t\t\t$questions[$question->psg_id]['questions'][$question->qstn_id]['title'] = $question->qstn_title;\n\t\t\t$questions[$question->psg_id]['questions'][$question->qstn_id]['qst_text'] = $question->qst_text;\n\t\t\t$questions[$question->psg_id]['questions'][$question->qstn_id]['answers'][] = ['Id' => $question->answer_id, 'ans_text' => $question->ans_text, 'is_correct' => $question->is_correct];\n\t\t\t$questions[$question->psg_id]['questions'][$question->qstn_id]['qst_type'] = $question->qst_type;\n\t\t}\n\n\t\t//dd($questions);\n\t\treturn $questions;\n\n\t}", "public function get_survey()\n {\n // check the primary key value\n $primary_key_name = static::get_primary_key_name();\n if( is_null( $this->$primary_key_name ) )\n {\n log::warning( 'Tried to delete record with no id.' );\n return;\n }\n \n return new limesurvey\\surveys( $this->sid );\n }", "private function json_retrieveQuestions()\n {\n // Gets the input data from the Front-End\n $input = json_decode(file_get_contents(\"php://input\"));\n// $surveyID = $_POST['surveyID'];\n $surveyID= $input->surveyID;\n\n // Gets Survey Details\n $surveyQuery = \"SELECT surveyTitle, surveyDescription FROM Surveys WHERE surveyID = :surveyID;\";\n $surveyParams = [\n \":surveyID\" => $surveyID,\n ];\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $resSurveyDetails = json_decode($this->recordset->getJSONRecordSet($surveyQuery, $surveyParams), true);\n $surveyTitle = $resSurveyDetails['data']['0']['surveyTitle'];\n $surveyDescription = $resSurveyDetails['data']['0']['surveyDescription'];\n\n // Gets Questions Details\n $questionsQuery = \"SELECT questionID, question, mediaPath FROM Questions WHERE surveyID = :surveyID;\";\n $questionsParams = [\n \":surveyID\" => $surveyID,\n ];\n\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $resQuestions = json_decode($this->recordset->getJSONRecordSet($questionsQuery, $questionsParams), true);\n $questionID = $resQuestions['data']['0']['questionID'];\n $question = $resQuestions['data']['0']['question'];\n $mediaPath = $resQuestions['data']['0']['mediaPath'];\n\n $nextpage = null;\n\n $res['status'] = 200;\n $res['message'] = \"ok\";\n $res['next_page'] = $nextpage;\n $res['surveyTitle'] = $surveyTitle;\n $res['surveyDescription'] = $surveyDescription;\n $res['questionID'] = $questionID;\n $res['question'] = $question;\n $res['mediaPath'] = $mediaPath;\n\n return json_encode($res);\n }", "public function extractData()\n {\n $this->client->run($this->getCreateSurvey());\n $this->client->run($this->getRemoveDuplicatedQuestions());\n $this->updateQuestionFieldIdSchema();\n $this->client->run($this->getCreateListOfQuestions());\n $this->client->run($this->getCreateSurveyLinkedList());\n $this->client->run($this->getCreateCountries());\n $this->client->run($this->getCreateStates());\n $this->client->run($this->getCreateWorksInCountry());\n $this->client->run($this->getCreateLivesInCountry());\n $this->client->run($this->getCreateWorksInState());\n $this->client->run($this->getCreateLivesInState());\n $this->client->run($this->getCreateWorksAs());\n $this->client->run($this->getCreateStates());\n $this->client->run($this->getCreateWorksAs());\n $this->client->run($this->getCreateCurrentDiagnosis());\n $this->client->run($this->getCreateSelfDiagnosis());\n $this->client->run($this->getCreateProfessionalDiagnosis());\n $this->client->run($this->getSetQuestionAndAnswerResponseCounts());\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "function get_rad_survey_results($conn, $survey_id) {\n\t$query_results = \"SELECT * FROM rad_survey_result WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_results);\n}", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "public function pi_process_family_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'currently-employed':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Are you currently employed with this treatment center? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'relationship':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'What is your relationship to the individual who has received treatment for their addiction? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-month':\n\t\t\t\t\t\t\t$content .= 'When did they enter the facility: '. sanitize_text_field($value) . '/' ;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-day':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '/';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-year':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'active-role':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Did you take on an active role in helping this person make the decision to enter treatment? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'resources':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'If you were involved in helping them make their choice, what resources did you use? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'contact':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Did you keep in contact with the patient during his/her stay in the facility? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'family':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' Did the treatment center allow for family events and/or family therapy sessions? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'benefitted':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' Do you feel this person has benefitted from their time at the treatment facility? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'improvement':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' If your answer to the previous question was yes, in what area of their life do you see the most improvement? (You can choose multiple answers) ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "function collectDetails() {\n if (! $_SESSION[\"eligible\"]) {\n return $this->showStart();\n }\n if (isset($_REQUEST['details_submitted'])) {\n \n /* these attributes are a subset of the db \n * entity 'participant' field names */\n $participant_attributes = array(\n\t\t\t \"first_name\",\n\t\t\t \"last_name\"\n\t\t\t );\n $participant_details = array();\n $participant_contact_details = array();\n\n /* these attributes match the database entity \n * 'participant_contact' field names */\n $contact_attributes = array(\n\t\t\t \"participant_id\",\n\t\t\t \"email\",\n\t\t\t \"alternate_email\",\n\t\t\t \"street_address1\",\n\t\t\t \"street_address2\",\n\t\t\t \"city\",\n\t\t\t \"state\",\n\t\t\t \"postcode\"\n\t\t\t );\n foreach($_REQUEST as $name=>$value) {\n\tif (in_array($name, $participant_attributes)){\n\t $participant_details[$name] = $value;\n\t}\n\telse if (in_array($name, $contact_attributes)){\n\t $participant_contact_details[$name] = $value;\n\t}\n }\n if ($this->isEmailDuplicate($participant_contact_details[\"email\"])) {\n\treturn $this->failToRegister();\n }\n // add the enrolment date to the participant details\n $mysqldatetime = date( 'Y-m-d H:i:s', time());\n $participant_details['enrolled'] = $mysqldatetime;\n // add new participant\n $participant_id = $this->addThing('participant', $participant_details);\n $participant_contact_details['participant_id'] = $participant_id;\n /* add new participant_contact \n * (no id to harvest for dependent entity)\n */\n $this->addThing('participant_contact', $participant_contact_details);\n $_REQUEST[\"participant_id\"] = $participant_id;\n $_REQUEST[\"mode\"] = 'consent';\n return $this->collectConsent();\n }\n $output = $this->outputBoilerplate('details.html');\n return $output;\n }", "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "function testSimpleSurvey()\n\t{\n\t\t$this->loadAndCacheFixture();\n\t\t$this->switchUser(FORGE_ADMIN_USERNAME);\n\t\t$this->gotoProject('ProjectA');\n\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\n\t\t// Create some questions\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"This is my first question (radio) ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my second question (text area) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Area\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my third question (yes/no) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Radio Buttons Yes/No\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a comment line of text\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Comment Only\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a my fifth question (text field) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\n\t\t// Create survey\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='4']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='2']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='5']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='3']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"This is a my fifth question (text field) ?\");\n\t\t$this->assertTextPresent(\"This is a comment line of text\");\n\t\t$this->assertTextPresent(\"This is my third question (yes/no) ?\");\n\t\t$this->assertTextPresent(\"This is my second question (text area) ?\");\n\t\t$this->clickAndWait(\"//input[@name='_1' and @value='3']\");\n\t\t$this->type(\"_2\", \"hello\");\n\t\t$this->clickAndWait(\"_3\");\n\t\t$this->clickAndWait(\"_5\");\n\t\t$this->type(\"_5\", \"text\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"Warning - you are about to vote a second time on this survey.\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=Result\");\n\t\t$this->assertTextPresent(\"YES (1)\");\n\t\t$this->assertTextPresent(\"3 (1)\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5\");\n\t\t// Check that the number of votes is 1\n\t\t$this->assertEquals(\"1\", $this->getText(\"//main[@id='maindiv']/table/tbody/tr/td[5]\"));\n\n\t\t// Now testing by adding new questions to the survey.\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Another added question ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Q8 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q9 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='8']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='9']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5, 6, 7, 8, 9\");\n\n\t\t// Check that survey is public.\n\t\t$this->logout();\n\t\t$this->gotoProject('ProjectA');\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->assertTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\n//\t\t// Set survey to private\n//\t\t$this->login(FORGE_ADMIN_USERNAME);\n//\n//\t\t$this->open(\"/survey/?group_id=6\");\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->clickAndWait(\"link=Administration\");\n//\t\t$this->clickAndWait(\"link=Add Survey\");\n//\t\t$this->clickAndWait(\"link=Edit\");\n//\t\t$this->clickAndWait(\"//input[@name='is_public' and @value='0']\");\n//\t\t$this->clickAndWait(\"submit\");\n//\t\t// Log out and check no survey is visible\n//\t\t$this->clickAndWait(\"link=Log Out\");\n//\t\t$this->select($this->byName(\"none\"))->selectOptionByLabel(\"projecta\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->assertTextPresent(\"No Survey is found\");\n//\n//\t\t// Check direct access to a survey.\n//\t\t$this->open(\"/survey/survey.php?group_id=6&survey_id=1\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->assertFalse($this->isTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\"));\n\t}", "function get_SurveyQuestions($surveyID){\r\n $sql = $this->db->prepare(\"SELECT * FROM SURVEYQUESTION WHERE SurveyID = :surveyid;\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function get_research_questions()\n\t{\n\t\treturn $this->research_questions;\n\t}", "public function get_survey_summary($session_key,$sid, $stat_name)\n {\n $permitted_stats = array();\n if ($this->_checkSessionKey($session_key))\n { \n\t\t \t \n\t\t$permitted_token_stats = array('token_count', \n\t\t\t\t\t\t\t\t'token_invalid', \n\t\t\t\t\t\t\t\t'token_sent', \n\t\t\t\t\t\t\t\t'token_opted_out',\n\t\t\t\t\t\t\t\t'token_completed'\n\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t$permitted_survey_stats = array('completed_responses', \n\t\t\t\t\t\t\t\t'incomplete_responses', \n\t\t\t\t\t\t\t\t'full_responses' \n\t\t\t\t\t\t\t\t); \n\t\t$permitted_stats = array_merge($permitted_survey_stats, $permitted_token_stats);\t\t\t\t\t\t\n\t\t$surveyidExists = Survey::model()->findByPk($sid);\t\t \n\t\tif (!isset($surveyidExists))\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\t\n\t\t\t\n\t\tif(in_array($stat_name, $permitted_token_stats))\t\n\t\t{\n\t\t\tif (tableExists('{{tokens_' . $sid . '}}'))\n\t\t\t\t$summary = Tokens_dynamic::model($sid)->summary();\n\t\t\telse\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t}\n\t\t\n\t\tif(in_array($stat_name, $permitted_survey_stats) && !tableExists('{{survey_' . $sid . '}}'))\t\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t\t\t\t\t\t\t\n\t\tif (!in_array($stat_name, $permitted_stats)) \n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No such property', 23);\n\t\n\t\tif (hasSurveyPermission($sid, 'survey', 'read'))\n\t\t{\t\n\t\t\tswitch($stat_name) \n\t\t\t{\n\t\t\t\tcase 'token_count':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcount'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_invalid':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkinvalid'];\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'token_sent':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tksent'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_opted_out':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkoptout'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_completed';\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcompleted'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'completed_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count('submitdate IS NOT NULL');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'incomplete_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->countByAttributes(array('submitdate' => null));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'full_responses';\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count();\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Data is not available', 23);\n\t\t\t}\n\t\t}\n\t\telse\n\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \t\t\n }\n }", "public function getSurveys() {\n\n \n $this->db->select('sur_id, sur_title');\n $this->db->from('msv_surveys');\n \n $query = $this->db->get();\n \n $res = $query->result();\n \n return $res;\n }", "public function getSurvey($surveyAbbreviation) {\n return $this->_request(\n \"surveys/survey={$surveyAbbreviation}\"\n );\n }", "public function survey()\n {\n \treturn $this->hasOne('Asabanovic\\Surveys\\Model\\Survey');\n }", "public function getQuestionData()\n {\n return $this->_coreRegistry->registry('current_question');\n }", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function security_question_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$pid = html_escape($this->input->post('id'));\n\t\t\t$id = preg_replace('#[^0-9]#i', '', $pid); // filter everything but numbers\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('security_questions')->where('id',$id)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\n\t\t\t\t\t$data['id'] = $detail->id;\n\t\t\t\t\t\n\t\t\t\t\t$data['headerTitle'] = $detail->question;\t\t\t\n\n\t\t\t\t\t$data['question'] = $detail->question;\n\t\t\t\t\t\n\t\t\t\t\t$data['model'] = 'security_questions';\n\t\t\t\t\t$data['success'] = true;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode($data);\n\t\t\t\n\t\t}", "public function show(RecipeSurveyService $recipeSurveyService): array\n {\n $recipeSurvey = $recipeSurveyService->buildSurveyQuestions();\n session(['recipe_survey' => $recipeSurvey]);\n\n return ['data' => $recipeSurvey];\n }", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function show(Survey $survey)\n {\n return new SingleSurveyResource(\n $survey->load([\n 'questions',\n 'questions.options',\n 'questions.type'\n ])\n );\n }", "public function getQuestion()\n {\n // TODO: Implement getQuestion() method.\n }", "public function show(ClientSurvey $clientSurvey)\n {\n //\n }", "function printMCQuestionForm() {\n\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions, $langAnswer, \n\t\t$langSurveyMoreAnswers, $langSurveyInfo,\n\t\t$langQuestion1, $langQuestion2, $langQuestion3, $langQuestion4, $langQuestion5, $langQuestion6,\n\t\t$langQuestion7, $langQuestion8,$langQuestion9, $langQuestion10;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) { // Create survey ******************************************************\n\tif ($MoreQuestions == $langCreate) { // Create survey\n\t\tcreateMCSurvey();\n\t} elseif(count($_POST)<7) { // Just entered MC survey creation dialiog ****************************\n\t\t$tool_content .= <<<cData\n\t\t<table><thead></thead>\n\t<tr><td colspan=2>$langSurveyInfo</td></tr></table>\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'question1')\">\n\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t<table id=\"QuestionTable\">\n\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t<tr><td colspan=3>\n\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n <OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n <OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n <OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n <OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n <OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n <OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n <OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n <OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n <OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\n\t\t\t<tr><td>$langQuestion</td><td><input type=\"text\" name=\"question1\" size=\"70\" id=\"NewQuestion\"></td></tr> \n\t\t\t<tr><td>$langAnswer 1</td><td><input type=\"text\" name=\"answer1.1\" size=\"70\" id=\"NewAnswer1\"></td></tr>\n\t\t\t<tr><td>$langAnswer 2</td><td><input type=\"text\" name=\"answer1.2\" size=\"70\" id=\"NewAnswer2\"></td></tr>\n\t\t\t<tr id=\"NextLine\">\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" /></td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" /></td>\n\t\t <td>\n\t\t\t\t\t<input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"1\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} elseif ($MoreQuestions == $langSurveyMoreAnswers) { // Print more answers \n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\n\t\tprintAllQA();\n\t\t$tool_content .= <<<cData\n\t\t\t\t\t<tr><td>$langAnswer</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"answer\" value=\"\"></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} else { // Print more questions ******************************************************\n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t++$NumOfQuestions;\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'questionx')\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\">\n\t\t\t\t<input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\t\t\n\t\tprintAllQA();\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<tr><td colspan=3><hr></td></tr>\n\t\t\t<tr><td colspan=3>\n\t\t\t\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n\t\t\t\t<OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n\t\t\t\t<OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n\t\t\t\t<OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n\t\t\t\t<OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n\t\t\t\t<OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n\t\t\t\t<OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n\t\t\t\t<OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n\t\t\t\t<OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n\t\t\t\t<OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\ncData;\n\t\t\n\t\t$tool_content .= \"<tr> <td>\" . \n\t\t\t\t$langQuestion . \"\t</td><td><input type='text' name='questionx' size='70' id='NewQuestion'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 1</td><td><input type='text' name='answerx.1' size='70' id='NewAnswer1'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 2</td><td><input type='text' name='answerx.2' size='70' id='NewAnswer2'></td></tr>\";\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t\t<tr id=\"NextLine\"><td colspan=3><hr></td></tr>\n\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t}\n}", "function get_text_question_answers($questionid, $surveyid)\n{\n $CI =& get_instance();\n $CI->db->select('answer,resultid');\n $CI->db->from('tblformresults');\n $CI->db->where('questionid', $questionid);\n $CI->db->where('rel_id', $surveyid);\n $CI->db->where('rel_type', 'survey');\n\n return $CI->db->get()->result_array();\n}", "public function id($id){\n $this->load->model(\"survey_model\");\n\n #get survey title, description, & check if it's active\n $data['survey'] = $this->survey_model->read_survey($id);\n $data['survey_id'] = $id;\n\n #check for if survey is active if inactive redirect user\n if ($data['survey']['active'] == '0'){\n $this->session->set_flashdata('error', 'The survey is no longer active');\n redirect(base_url());\n }\n\n #get survey question types, question instructions, question & position\n $data['question'] = $this->survey_model->read_all_questions($id);\n\n #check for errors\n $data['error'] = $this->session->flashdata('errors');\n\n #filter down questions into types and responses\n for ( $i=0; $i < count($data['question']); $i++ ) { \n $data['type'][$i] = intval($data['question'][$i]['question_type_id']);\n $data['answer'][$i] = $this->survey_model->read_answers($data['question'][$i]['id'], $data['type'][$i]);\n }\n\n #required files and title for page\n $header['user'] = $this->session->userdata('user');\n $header['title'] = 'Show Survey';\n $header['js'] = array('jquery', 'bootstrap.min', 'input', 'show');\n $header['css'] = array('reset', 'bootstrap.min', 'index');\n\n #load views\n $this->load->view('header', $header);\n $this->load->view('show', $data);\n $this->load->view('footer'); \n }", "public function getSurvey()\n {\n return $this->hasOne(SurveyTemplates::ClassName(), ['id' => 'survey_template_id']);\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "public function show($id)\n\t{\n define( 'LS_BASEURL', 'http://192.168.10.1/limesurvey/index.php'); // adjust this one to your actual LimeSurvey URL\n define( 'LS_USER', 'admin' );\n define( 'LS_PASSWORD', 'qwerty' );\n\n //$client = new Client(LS_BASEURL);\n // the survey to process\n $survey_id=177998;\n\n // instanciate a new client\n $myJSONRPCClient = new \\org\\jsonrpcphp\\JsonRPCClient( LS_BASEURL.'/admin/remotecontrol' );\n\n // receive session key\n $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );\n\n $questionInfo = $myJSONRPCClient->list_groups($sessionKey,$id);\n\n return $questionInfo;\n\t}", "function ipal_get_answers_student($question_id){\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\r\n\t$answerarray=array(); \r\n\t$line=\"\";\r\n\t$answers=$DB->get_records('question_answers',array('question'=>$question_id));\r\n\t\t\tforeach($answers as $answers){\r\n\t\t\t\t$answerarray[$answers->id]=$answers->answer; \r\n\t\t\t}\r\n\t\t\t\r\n\treturn($answerarray);\r\n}", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function get_prescription ($appointment_hash = NULL)\n {\n $page_data = NULL;\n $prescriptions_arr = array();\n\n if (get_data('term') == NULL)\n {\n return;\n }\n /*Fetching Patient details from third party database via curl request*/\n $prescriptions = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n 'action' => 'getformulary',\n 'lookfor' => get_data('term'),\n )));\n\n $prescriptions = !empty($prescriptions) ? json_decode($prescriptions) : array();\n\n /*Converting to autocomplete understandable format*/\n if (!empty($prescriptions))\n {\n foreach ($prescriptions as $val)\n {\n $prescriptions_arr[] = array('id' => current($val)->vpid, 'value' => current($val)->nm, 'unit_price' => current($val)->UnitPrice);\n }\n }\n exit(json_encode($prescriptions_arr));\n }", "public static function getQuestionInfoById($question_id) {\n\t\tif($question_id > 0){\n\t\t\treturn self::find($question_id);\n\t\t}\n }", "function surveyPageFields(\\Plugin\\Project $project, $fieldList, $form_name, $question_section)\n{\n $page = 1;\n // Field counter\n $i = 1;\n // Create empty array\n $pageFields = array();\n $firstField = $project->getFirstFieldName();\n $metaData = $project->getMetadata();\n\n // Loop through all form fields and designate fields to page based on location of section headers\n foreach ($fieldList as $field_name)\n {\n $fieldMeta = $metaData->getField($field_name);\n // Do not include record identifier field nor form status field (since they are not shown on survey)\n if ($field_name == $firstField || $field_name == $form_name.\"_complete\") continue;\n // If field has a section header, then increment the page number (ONLY for surveys that have paging enabled)\n if ($question_section && $fieldMeta->getElementPrecedingHeader() != \"\" && $i != 1) $page++;\n // Add field to array\n $pageFields[$page][$i] = $field_name;\n // Increment field count\n $i++;\n }\n // Return array\n return array($pageFields, count($pageFields));\n}", "function printSurveyCreationForm() {\n\tglobal $tool_content, $langTitle, $langPollStart, \n\t\t$langPollEnd, $langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langCreate, $langSurveyContinue, $start_cal_Survey, $end_cal_Survey;\n\t\n\t$CurrentDate = date(\"Y-m-d H:i:s\");\n\t$CurrentDate = htmlspecialchars($CurrentDate);\n\t$tool_content .= <<<cData\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t<input type=\"hidden\" value=\"0\" name=\"MoreQuestions\">\n\t<table><thead></thead>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\"></td></tr>\n\t\t<tr><td>$langPollStart</td><td colspan=\"2\">\n\t\t\t$start_cal_Survey\n\t\t</td></tr>\n\t\t<tr><td>$langPollEnd</td><td colspan=\"2\">$end_cal_Survey</td></tr>\n\t\t<!--<tr>\n\t\t <td>$langType</td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"1\" />\n\t $langSurveyMC</label></td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"2\" />\n\t $langSurveyFillText</label></td>\n\t\t</tr>-->\n\t\t<input name=\"UseCase\" type=\"hidden\" value=\"1\" />\n\t\t<tr><td colspan=\"3\" align=\"right\">\n <input name=\"$langSurveyContinue\" type=\"submit\" value=\"$langSurveyContinue -&gt;\"></td></tr>\n\t</table>\n\t</form>\ncData;\n}", "private function getSelectedSurveyQuestionsForReport($searchAttributes)\n {\n\n if (!isset($searchAttributes['survey'])\n || empty($searchAttributes['survey'])\n ) {\n\n return [];\n }\n\n $surveyQuestions = [];\n $searchAttributes = $searchAttributes['survey'];\n\n foreach ($searchAttributes as $searchAttribute) {\n\n if (!isset($searchAttribute['survey_id'])\n || empty($searchAttribute['survey_id'])\n ) {\n\n continue;\n }\n\n if (!isset($searchAttribute['survey_questions'])\n || empty($searchAttribute['survey_questions'])\n ) {\n\n continue;\n }\n\n foreach ($searchAttribute['survey_questions'] as $surveyQues) {\n\n if (!isset($surveyQues['id'])\n || empty($surveyQues['id'])\n ) {\n\n continue;\n }\n $surveyQuestions[] = $surveyQues['id'];\n }\n }\n\n return $surveyQuestions;\n }", "function get_request_approved_surveys($request_id)\n\t{\n\t\t$this->db->select('resources.survey_id');\n\t\t$this->db->join('resources', 'lic_file_downloads.fileid= resources.resource_id');\n\t\t$this->db->where('lic_file_downloads.requestid',$request_id);\n\t\t$result=$this->db->get('lic_file_downloads')->result_array();\n\t\t\n\t\tif (!$result)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$output=array();\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$output[]=$row['survey_id'];\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "function learndash_get_submitted_essay_data( $quiz_id, $question_id, $essay ) {\n\t$users_quiz_data = get_user_meta( $essay->post_author, '_sfwd-quizzes', true );\n\tif ( ( !empty( $users_quiz_data ) ) && ( is_array( $users_quiz_data ) ) ) {\n\t\tif ( ( $essay ) && ( is_a( $essay, 'WP_Post' ) ) ) {\n\t\t\t$essay_quiz_time = get_post_meta( $essay->ID, 'quiz_time', true );\n\t\t} else {\n\t\t\t$essay_quiz_time = null;\n\t\t}\n\n\t\tforeach ( $users_quiz_data as $quiz_data ) {\n\t\t\t// We check for a match on the quiz time from the essay postmeta first. \n\t\t\t// If the essay_quiz_time is not empty and does NOT match then continue;\n\t\t\tif ( ( absint( $essay_quiz_time ) ) && ( isset( $quiz_data['time'] ) ) && ( absint( $essay_quiz_time ) !== absint( $quiz_data['time'] ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (empty($quiz_data['pro_quizid']) || $quiz_id != $quiz_data['pro_quizid'] || ! isset( $quiz_data['has_graded'] ) || false == $quiz_data['has_graded'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((isset($quiz_data['graded'])) && (!empty($quiz_data['graded']))) {\n\t\t\t\tforeach ( $quiz_data['graded'] as $key => $graded_question ) {\n\t\t\t\t\tif ( ( $key == $question_id ) && ( $essay->ID == $graded_question['post_id'] ) ) {\n\t\t\t\t\t\treturn $quiz_data['graded'][ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function get_feedback_data(){\n\t\t$task_id = $this->input->post('field_id');\n\t\t$query = $this->InteractModal->feedback_status($task_id );\n\t\tif(!empty($query)){\n\t\t\tforeach($query as $queries){\n\t\t\t\t$price_opinion = $queries['price_opinion'];\n\t\t\t\t$interest_opinion = $queries['interest_opinion'];\n\t\t\t\t$property_quality = $queries['property_quality'];\n\t\t\t\t$showing_id = $queries['showing_id'];\n\t\t\t\t$details = $queries['details'];\n\t\t\t\t$feedback_detail = @unserialize( $details );\n\t\t\t\t$agent_name=$feedback_detail['user_name'];\n\t\t\t}\n\t\t\t$data['agent_name']= $agent_name;\n\t\t\t$data['price_opinion']= $price_opinion;\n\t\t\t$data['interest_opinion']= $interest_opinion;\n\t\t\t$data['property_quality']= $property_quality;\n\t\t $this->load->view('common/feedback_content',$data); \n\t\t}\n\t}", "function ipal_display_student_interface(){\r\n\tglobal $DB;\r\n\tipal_java_questionUpdate();\r\n\t$priorresponse = '';\r\n\tif(isset($_POST['answer_id'])){\r\n\t if($_POST['answer_id'] == '-1'){\r\n\t \t$priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($_POST['a_text']);\r\n\t }\r\n\t else\r\n\t {\r\n\t $answer_id = $_POST['answer_id'];\r\n\t\t $answer = $DB->get_record('question_answers', array('id'=>$answer_id));\r\n\t\t //$answer = $DB\r\n\t\t $priorresponse = \"\\n<br />Last answer you submitted: \".strip_tags($answer->answer);\r\n\t }\r\n\t ipal_save_student_response($_POST['question_id'],$_POST['answer_id'],$_POST['active_question_id'],$_POST['a_text']);\r\n\t}\r\n echo $priorresponse;\r\n ipal_make_student_form();\t\r\n}", "public function getSurveyReturn()\n {\n return $this->_getVar('surveyReturn', array());\n }", "public function survey()\n {\n return $this->belongsTo('App\\Survey', 'survey_id');\n }", "public function index($survey_id)\n\t{\n\t\t$questions = Survey::find($survey_id)->questions;\n\n\t\treturn Fractal::collection($questions, new QuestionTransformer);\n\t}", "public function get_questions_extraction()\n\t{\n\t\treturn $this->questions_extraction;\n\t}", "protected function question_where(){\n return $array = array('exam_id'=>trim($this->input->post('exam_id')), \n 'category_id'=>trim($this->input->post('category_id')),\n 'body_id'=>trim($this->input->post('body_id')),\n 'subject_id'=>trim($this->input->post('subject_id')),\n 'period_id'=>trim($this->input->post('period_id')),\n 'question_number'=>trim($this->input->post('question_number')),\n );\n }", "public function pi_ajax_submit_survey() {\n\t //if user is logged in validate nonce and then save their choice\n\t\tif ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'pi_msg_ajax') ) {\n\t\t\tstatus_header( '401' );\n\t\t\tdie();\n\t\t}else{\n\t\t\t$survey_type = $_POST['surveyType'];\n\t\t\t$posted = array();\n\t\t\tparse_str( $_POST[ 'formData' ] , $posted);\n\t\t\t\n\t\t\tif( $survey_type === 'alumni-survey'){\n\t\t\t\t\n\t\t\t\t$message = $this->pi_process_alumni_survey($posted);\n\n\t\t\t}elseif( $survey_type === 'staff-survey'){\n\n\t\t\t\t$message = $this->pi_process_staff_survey($posted);\n\n\t\t\t}elseif( $survey_type === 'family-survey'){\n\n\t\t\t\t$message = $this->pi_process_family_survey($posted);\n\n\t\t\t}\n\t\t\t// $to = array('[email protected]', '[email protected]' , '[email protected]');\n\t\t\t$to = '[email protected]';\n\t\t\t$subject = 'Patient Survey from' . get_bloginfo('name');\n\t\t\t$headers[] = 'From:' . get_bloginfo('name') . ' <[email protected]>';\n\t\t\twp_mail( $to, $subject, $message, $headers);\n\n\t\t\t$response = 'Thank you for submitting the survey. <a href=\"'.home_url().'\">To continue using this website click here</a>.';\n\t\t wp_send_json_success( $response );\t\t\n\t\t}\n\t}", "function get_QuestionResult($SurveyID,$QuestionNo){\r\n $sql = $this->db->prepare(\"SELECT * FROM SURVEYRESULTS WHERE SurveyID = :surveyid AND questionNo = :qNo;\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $SurveyID,\r\n \"qNo\" => $QuestionNo,\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function answers($id)\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n $m = new SurveyMatcher();\n $p = $m->getParticipantById($id);\n\n if(sizeof($p) == 0) return 404;\n\n $ig = array('interested_0', 'interested_1', 'send_results');\n foreach($p as $k => $v) {\n if(in_array($k, $ig) && $v == 0)\n continue;\n $this->request->post[$k] = $v;\n }\n\n return $this->form(array('*' => 'This survey is read-only.'));\n }", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "private function getQuestion($uuid = NULL , $weekSend = NULL)\n\t\t{\n\t\t\t$returnArr = array();\n\t\t\t$questionArr = $this->Student_survey_model->getQuestions('Survey' , $uuid , $weekSend);\n\t\t\treturn $questionArr;\n\t\t}", "public function view_survey_data($id)\n\t{\n\t\ttry{\n\t\t\t// Surrvey::findORfail($id);\n\t\t\t$sdata = Surrvey::with(['group'=>function($query){\n\t\t\t\t$query->orderBy('group_order');\n\t\t\t}])->find($id);\t\n\t\t\t$survey['id'] \t\t\t= \t$sdata->id;\n\t\t\t$survey['survey_name'] \t= \t$sdata->name;\n\t \t\t$survey['created_by']\t= \t$sdata->created_by;\n\t \t\t//$survey['user_name']\t= \t$sdata->creat_by->name;\n\t \t\t$survey['description'] \t=\t$sdata->description;\n\t \t\t$survey['status'] \t\t= \t$sdata->status;\n\t \t\tif(count($sdata->group)>0){\n\t\t\t\tforeach ($sdata->group as $key => $grp) {\n\t\t\t\t\t$survey['group'][$key]['group_id'] \t\t\t= $grp->id;\n\t\t\t\t\t$survey['group'][$key]['survey_id'] \t\t= $grp->survey_id;\n\t\t\t\t\t$survey['group'][$key]['group_name'] \t\t= $grp->title;\n\t\t \t\t$survey['group'][$key]['group_description'] = $grp->description;\t\t\t\n\t\t \t\t$survey['group'][$key]['group_order'] \t\t= $grp->group_order;\t\t\t\n\t\t\t\t\tforeach ($grp->question as $qkey => $ques) {\n\t\t\t\t\t\t$answer = json_decode($ques->answer,true);\n\t\t\t\t\t\tforeach ($answer as $anskey => $ansVal) {\n\t\t\t\t\t\t\t$survey['group'][$key]['group_questions'][$qkey][$anskey] =$ansVal;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$survey['group'][$key]['group_questions'][$qkey]['survey_id'] \t= $ques->survey_id;\n\t\t \t\t$survey['group'][$key]['group_questions'][$qkey]['question'] \t= $ques->question;\n\t\t \t\t$survey['group'][$key]['group_questions'][$qkey]['group_id'] \t= $ques->group_id;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t$survey['group'] \t=[];\n\t\t\t\t$survey['question']\t=[];\n\t\t\t}\n\n\t\t\treturn ['status'=>'success','response'=>$survey];\t\n\t\t}catch(\\Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t\treturn ['status'=>'error','message'=>\"Something goes wrong\"];\t\n\t\t}\t\n\t}", "function get_rad_survey_labs($conn, $survey_id) {\n\t$query_labs = \"SELECT building, room FROM rad_survey_labs WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_labs);\n}", "public function showResults(){\n $this->extractQuestions();\n }", "public static function assessment_feedback() {\n\t\t$request = Controller::curr()->getRequest();\n\n\t\tif($request->latestParam('Action') == 'finished' && $submissionID = $request->latestParam('ID')) {\n\t\t\t\n\t\t\t$submission = RhinoSubmittedAssessment::get()->filter('uid', $submissionID)->First();\n\t\t\tif($submission) {\n\t\t\t\t$assessment = $submission->Parent();\n\t\t\t\tif($assessment) {\n\t\t\t\t\t$mark = $submission->getAssessmentMark();\n\t\t\t\t\t$feedback = $assessment->dbObject('FeedbackOn'.$mark);\n\t\t\t\t\tif ($feedback) {\n\t\t\t\t\t\treturn $feedback;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function get_Surveys(){\r\n $sql = $this->db->prepare(\"CALL SPgetSurvey2(:userid,:chamberID,:businessID);\");\r\n $result = $sql->execute(array(\r\n \"userid\" => $_SESSION['userid'],\r\n \"chamberID\" => $_SESSION['chamber'],\r\n \"businessID\" => $_SESSION['businessid'],\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false; // was array(); HL 10/10/17\r\n }\r\n }", "function printTFQuestionForm() {\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) {\n\tif ($MoreQuestions == $langCreate) {\n\t\tcreateTFSurvey();\n\t} else {\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"2\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\ncData;\n\t\t$counter = 0;\n\t\tforeach (array_keys($_POST) as $key) {\n\t\t\t++$counter;\n\t\t $$key = $_POST[$key];\n\t\t if (($counter > 4 )&($counter < count($_POST)-1)) {\n\t\t\t\t$tool_content .= \"<tr><td>$langQuestion</td><td><input type='text' name='question{$counter}' value='${$key}'></td></tr>\"; \n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t<tr><td>$langQuestion</td><td><input type='text' name='question'></td></tr>\n\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\ncData;\n\t}\n}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function index()\n {\n /*member variables*/\n $options = \"\";\n $optionValue = \"\";\n /* confirm if user had logged in in before and started a survey*/\n $user = Auth::user();\n $answer = Answer::where('user_id','=',$user->id)->get()->last();\n\n if( $answer != \"\" ){\n $question_id = $answer->question_id;\n $answer_string = $answer->string;\n\n /*get next question using function getNextQuestion in answer controller*/\n $displayQuestion = app('App\\Http\\Controllers\\AnswerController')->getNextQuestion($question_id,$answer_string);\n\n return $displayQuestion;\n /* use post question to work */\n }else{\n /*if user has never done a the survey before get first question*/\n /*fetch every paths*/\n $paths = Path::get(['id', 'name', 'sequence']);\n If( sizeof($paths)>0 ) {\n // fetch path where sequence == 1\n $sequence = \"1\";\n $path_id = \"\";\n $paths = Path::where('sequence',$sequence)->get(['id', 'name', 'sequence']);\n foreach( $paths as $path ){\n $path_id = $path->id;\n }\n $questions = Question::where('path_id' , '=' ,$path_id/*[['sequence', '=', $sequence], ['path_id', '=', 1]]*/)\n ->get(['id', 'string', 'sequence', 'path_id', 'user_id', 'progress', 'is_dichotomous', 'is_optional', 'has_options']);\n foreach ($questions as $questions) {\n /* use question id to pluck options for this specific question id*/\n $question_id = $questions->id;\n $sequence = $questions->sequence;\n /* if has options get the options div displays */\n if( $questions->has_options == true ){\n $input_type = \"option\";\n /*get the div displays*/\n $optionValue = app('App\\Http\\Controllers\\InputController')->index($input_type,$question_id);\n /*get the options*/\n $options = Option::where('question_id', $question_id)->pluck('options_string');\n\n }elseif ( $questions->has_multiple == true ){\n\n echo(\"get has multiple values\");\n\n }else if ( $questions->has_options == false && $questions->has_multiple == false ){\n\n echo(\"both values of has multiple and has options is false\");\n\n }else{\n\n echo(\"no reasonable input type \");\n\n }\n /* creating a new collection instance to fit our required output*/\n $question = new Collection;\n\n $question->push([\n 'id' => $questions->id,\n 'string' => $questions->string,\n 'sequence' => $sequence,\n 'options' => $options,\n 'optionValue' => $optionValue,\n\n ]);\n $question = $question[0];\n $question = json_encode($question);\n\n return $question;\n\n }\n\n }\n else{\n echo \"CANNOT COMPLETE REQUEST\";\n }\n }\n\n\n }", "public function getAnswers();", "public function getSurveyContent($surveyId , $tpl)\n\t{\n\t\t// give the form an action to handle the submission\n\t\t// $tpl->Assign('action', 'admin/index.php?Page=Addons&Addon=surveys&Action=Submit&ajax=1&formId=' . $surveyId);\n\n\t\t$success_message = IEM::sessionGet('survey.addon.' . $surveyId . '.successMessage');\n\t\tif ($success_message) {\n\t\t\t\tIEM::sessionRemove('survey.addon.' . $surveyId . '.successMessage');\n\t\t\t\t$tpl->Assign('successMessage', $success_message);\n\t\t\t\treturn $tpl->ParseTemplate('survey_success');\n\t\t}\n\n\t\t$tpl->Assign('action', 'surveys_submit.php?ajax=1&formId=' . $surveyId);\n\n\t\t// check for valid ID\n\t\tif (!isset($surveyId)) {\n\t\t\treturn;\n\t\t}\n\n\n\t\trequire_once('widgets.php');\n\t\t$widgets_api = new Addons_survey_widgets_api();\n\t\t$loadRes = $this->Load($surveyId);\n\t\tif ($loadRes === false) {\n\t\t\techo 'invalid form id';\n\t\t\treturn;\n\t\t}\n\n\t\t$surveyData = $this->GetData();\n\n\n\t\t$widgets = $this->getWidgets($this->id);\n\n\t\t// and if there are widgets\n\t\t// iterate through each one\n\t\t$widgetErrors = array();\n\n\t\tif ($widgets) {\n\t\t\t$widgetErrors = IEM::sessionGet('survey.addon.' . $surveyId . '.widgetErrors');\n\n\t\t\tforeach ($widgets as $k => &$widget) {\n\t\t\t\tif ($widget['is_visible'] == 1 || $widget['type'] == 'section.break') {\n\t\t\t\t// $widget->className = Interspire_String::camelCase($widget->type, true);\n\t\t\t\t// Getting error from form..\n\n\t\t\t\t\t$widgets_api->SetId($widget['id']);\n\t\t\t\t\t$widget['fields'] = $widgets_api->getFields(false);\n\t\t\t\t\t// if there are errors for this widget, set them\n\n\t\t\t\t\tif ($widgetErrors && count($widgetErrors[$widget['id']]) > 0) {\n\t\t\t\t\t\t\t$widget['errors'] = $widgetErrors[$widget['id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t// randomize the fields if told to do so\n\t\t\t\t\tif ($widget['is_random'] == 1) {\n\t\t\t\t\t\tshuffle($widget['fields']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// tack on an other field if one exists\n\t\t\t\t\t if ($otherField = $widgets_api->getOtherField()) {\n\t\t\t\t\t\t$otherField['value'] = '__other__';\n\t\t\t\t\t\t$widget['fields'][] = $otherField;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if it is a file widget, then grab the file types\n\t\t\t\t\tif ($widget['type'] == 'file') {\n\t\t\t\t\t\t$widget['fileTypes'] = preg_split('/\\s*,\\s*/', $widget['allowed_file_types']);\n\t\t\t\t\t\t$widget['lastFileType'] = array_pop($widget['fileTypes']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// assign the widget information to the view\n\t\t\t\t\t$tpl->Assign('widget', $widget);\n\n\t\t\t\t\t// render the widget template\n\t\t\t\t\t$widget['template'] = $tpl->parseTemplate('widget.front.' . $widget['type'], true);\n\t\t\t\t} else {\n\t\t\t\t\tunset($widgets[$k]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// clear the widget errors session variable\n\t\t\tIEM::sessionRemove('survey.addon.' . $surveyId . '.widgetErrors');\n\t\t}\n\n\t\t// assign the form, widget and widget-field data to the template\n\t\t$tpl->Assign('errorMessage', IEM::sessionGet('survey.addon.' . $surveyId . '.errorMessage'));\n\t\t$tpl->Assign('successMessage', IEM::sessionGet('survey.addon.' . $surveyId . '.successMessage'));\n\n\t\t$tpl->Assign('survey', $surveyData);\n\t\t$tpl->Assign('widgets', $widgets);\n\n\t\t// unset the message that was set, so it doesn't get displayed again\n\t\tIEM::sessionRemove('survey.addon.' . $surveyId . '.errorMessage');\n\t\tIEM::sessionRemove('survey.addon.' . $surveyId . '.successMessage');\n\n\n\t\t//return $this->template->parseTemplate('form', true);\n\t\treturn $tpl->ParseTemplate('survey');\n\t}", "function edit($id = null) {\n if (is_null($id) && !empty($this->request->data)) { // check for an id as long as no form data has been submitted\n $this->Session->setFlash('Invalid survey', true, null, 'error'); // display an error when no valid survey id is given\n $this->redirect(array('action' => 'index')); // return to the index view\n }\n if (!empty($this->request->data)) { // check to see if form data has been submitted\n // first assemble the complete survey data including information from the edit session values\n if ($this->Session->check('SurveyQuestion.new')) { // check for a session for the survey questions\n $tempQuestions = $this->Session->read('SurveyQuestion.new'); // retrieve the questions that have been stored in the session\n //go through each question and set its order value to the same as the current index in the array\n foreach ($tempQuestions as $index => &$quest) {\n $quest['order'] = $index;\n }\n $this->request->data['Question'] = $tempQuestions; // update the form data with the current questions\n }\n if ($this->Session->check('SurveyRespondent.new')) { // check the session for the respondents\n $this->request->data['Respondent'] = $this->Session->read('SurveyRespondent.new'); // update the form data with the current respondents\n }\n $delrespondent = null; // variable to hold respondents to delete (database records only)\n if ($this->Session->check('SurveyRespondent.delete')) { // check the session for respondents to delete\n $delrespondent = $this->Session->read('SurveyRespondent.delete'); // retrieve the respondents to delete\n }\n $delquestion = null; // variable to hold questions to delete (database records only)\n if ($this->Session->check('SurveyQuestion.delete')) { // check the session for questions to delete\n $delquestion = $this->Session->read('SurveyQuestion.delete'); // retrieve the questions to delete\n }\n // now save the survey and return the results\n $errReturn = $this->Survey->complexSave($this->request->data, $delquestion, $delrespondent); // save the combined data, including deletion of survey and respondents that have been dropped\n if (is_null($errReturn)) { // if no errors are returned\n $this->__clearEditSession(); // empty the session variables used for the edit session now that it is complete\n $this->Session->setFlash('The survey has been saved', true, null, 'confirm'); // send a confirmation message that the survey was saved\n $this->redirect(array('action' => 'index')); // redirect to the index view\n } else {\n $this->Session->setFlash($errReturn['message'], true, null, $errReturn['type']); // send error messages received from the model during the save to the view for display\n }\n } else { // if there is no form data, and therefore the edit session is just starting\n $this->Survey->contain(array('Question' => 'Choice', 'Respondent' => 'Response'));\n $this->request->data = $this->Survey->findById($id); // find the survey being edited\n if(!$this->request->data) {\n $this->Session->setFlash('Invalid ID for survey.', true, null, 'error'); // send an error message\n $this->redirect(array('action' => 'index')); // redirect to the index view\n }\n $this->__clearEditSession(); // make sure the session edit variables are empty\n $this->Session->write('Survey.id', $id); // put the survey id in to the session\n $this->Session->write('SurveyQuestion.new', $this->request->data['Question']); // put the original survey questions in to the session\n $this->Session->write('SurveyRespondent.new', $this->request->data['Respondent']); // put the original survey respondents in to the session\n }\n }", "public function survey()\n {\n return $this->belongsTo(Survey::class, 'survey_id');\n }", "private function getQuestionData($approved = true)\n {\n // section -64--88-0-2-189b15d9:1604cc00e9e:-8000:0000000000000ED6 begin\n\t $this->Database = new Database();\n\n\t if($approved == true){\n\t\t $sql = $this->Database->prepare(\"SELECT * FROM ask_question_forum WHERE id = ? AND approved = 1\");\n\t }\n\n\t $sql->setFetchMode( PDO::FETCH_ASSOC );\n\t $sql->execute( array(\n\t \t$this->questionId\n\t ) );\n\t $questionData = $sql->fetchAll();\n\n\t /** Set Class Variables */\n\t $this->questionUsersId = $questionData[0]['user_id'];\n\t $this->category = $questionData[0]['category'];\n\t $this->subcategory = $questionData[0]['subcategory'];\n\t $this->question = $questionData[0]['question'];\n\t $this->description = $questionData[0]['description'];\n\t $this->dateCreated = $questionData[0]['date_created'];\n\t $this->postType = $questionData[0]['post_type'];\n\t $this->postId = $questionData[0]['id'];\n // section -64--88-0-2-189b15d9:1604cc00e9e:-8000:0000000000000ED6 end\n }", "function surveyQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyQuestion\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) { // only proceed if this is an ajax request\n if (!$this->request->is('post')) {\n if ($id != null) { // existing question being edited so retrieve it from the session\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempData = $this->Session->read('SurveyQuestion.new');\n $this->set('question_index', $id);\n $question = $tempData[$id];\n $question['Choice']['value'] = $this->Survey->Question->Choice->CombineChoices($question['Choice']);\n $this->request->data['Question'] = $question; // send the existing question to the view\n }\n }\n $this->render('/Elements/question_form');\n } else { // returning with data from the form here\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempArr = $this->Session->read('SurveyQuestion.new');\n }\n $this->request->data['Question']['Choice'] = $this->Survey->Question->Choice->SplitChoices($this->request->data['Question']['Choice']['value']);\n $this->Survey->Question->set($this->request->data);\n $checkfieldsArr = $this->Survey->Question->schema();\n unset($checkfieldsArr['id']);\n unset($checkfieldsArr['survey_id']);\n unset($checkfieldsArr['order']);\n $checkfields = array_keys($checkfieldsArr);\n if ($this->Survey->Question->validates(array('fieldList' => $checkfields))) {\n if (is_null($id)) {\n $tempArr[] = $this->request->data['Question'];\n } else {\n $tempArr[$id] = $this->request->data['Question'];\n }\n $this->Session->write('SurveyQuestion.new',$tempArr);\n } else {\n $errors = $this->Survey->Question->invalidFields();\n $this->Session->setFlash('Invalid question: '.$errors['question'][0], true, null, 'error');\n }\n $this->set('questions', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_questions');\n }\n }\n }", "public function submit_survey_post()\n\t\t{\n\t\t\t$testId = $this->post('testId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($testId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'ts_uuid' => $uuid,\n\t\t\t\t\t'ts_test_id' => $testId,\n\t\t\t\t\t'ts_week' => $weekSend,\n\t\t\t\t\t'ts_submitted_on' => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->insertSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function getSubmissionData($submission_id, $form_id) {\n \n }", "public function getQuestion() {\n return $this->question;\n }", "public function get_question() {\n\t\t\treturn $this->question;\n\t\t}", "function get_SurveyAnswers($surveyID){\r\n $sql = $this->db->prepare(\"CALL SPgetSurveyAnswers(:surveyid);\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function takeSurvey(){\n $this->load->database();\n\n $test['title'] = 'Survey';\n\n $test['survey'] = $this -> Survey_model -> get_survey();\n\n $data['title'] = 'Add a response to Survey';\n\n \t$this->form_validation ->set_rules('Student_Answer', 'Student_Answer', 'required');\n $this->form_validation ->set_rules('Q_ID', 'Q_ID', 'required');\n $this->form_validation ->set_rules('Surv_ID', 'Surv_ID', 'required');\n $this->form_validation ->set_rules('S_ID', 'S_ID', 'required');\n \n \n \n if($this->form_validation->run()=== FALSE){\n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n\n }else{\n\n $this -> Survey_model -> takeSurvey(); \n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n }\n }", "function getQuestions()\n\t{\n\t\treturn $this->aQuestion;\n\t}", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "function getPrintView($question_title = 1, $show_questiontext = 1, $survey_id = null, array $a_working_data = null)\n\t{\n\t\t$options = $this->getParsedAnswers($a_working_data);\n\t\t\n\t\t$template = new ilTemplate(\"tpl.il_svy_qpl_mc_printview.html\", TRUE, TRUE, \"Modules/SurveyQuestionPool\");\n\t\tswitch ($this->object->getOrientation())\n\t\t{\n\t\t\tcase 0:\n\t\t\t\t// vertical orientation\n\t\t\t\tforeach($options as $option)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tif ($option[\"other\"])\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->setCurrentBlock(\"other_row\");\n\t\t\t\t\t\t$template->setVariable(\"IMAGE_CHECKBOX\", ilUtil::getHtmlPath(ilUtil::getImagePath(\"checkbox_\".$option[\"checked\"].\".png\")));\n\t\t\t\t\t\t$template->setVariable(\"ALT_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t\t$template->setVariable(\"TITLE_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t\t$template->setVariable(\"OTHER_LABEL\", ilUtil::prepareFormOutput($option[\"title\"]));\n\t\t\t\t\t\t$template->setVariable(\"OTHER_ANSWER\", $option[\"textanswer\"] \n\t\t\t\t\t\t\t? ilUtil::prepareFormOutput($option[\"textanswer\"])\n\t\t\t\t\t\t\t: \"&nbsp;\");\n\t\t\t\t\t\t$template->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->setCurrentBlock(\"mc_row\");\n\t\t\t\t\t\t$template->setVariable(\"IMAGE_CHECKBOX\", ilUtil::getHtmlPath(ilUtil::getImagePath(\"checkbox_\".$option[\"checked\"].\".png\")));\n\t\t\t\t\t\t$template->setVariable(\"ALT_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t\t$template->setVariable(\"TITLE_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t\t$template->setVariable(\"TEXT_MC\", ilUtil::prepareFormOutput($option[\"title\"]));\n\t\t\t\t\t\t$template->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t// horizontal orientation\n\t\t\t\tforeach($options as $option)\n\t\t\t\t{\n\t\t\t\t\t$template->setCurrentBlock(\"checkbox_col\");\n\t\t\t\t\t$template->setVariable(\"IMAGE_CHECKBOX\", ilUtil::getHtmlPath(ilUtil::getImagePath(\"checkbox_\".$option[\"checked\"].\".png\")));\n\t\t\t\t\t$template->setVariable(\"ALT_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t$template->setVariable(\"TITLE_CHECKBOX\", $this->lng->txt($option[\"checked\"]));\n\t\t\t\t\t$template->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t\tforeach($options as $option)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tif ($option[\"other\"])\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->setCurrentBlock(\"other_text_col\");\n\t\t\t\t\t\t$template->setVariable(\"OTHER_LABEL\", ilUtil::prepareFormOutput($option[\"title\"]));\n\t\t\t\t\t\t$template->setVariable(\"OTHER_ANSWER\", $option[\"textanswer\"] \n\t\t\t\t\t\t\t? ilUtil::prepareFormOutput($option[\"textanswer\"])\n\t\t\t\t\t\t\t: \"&nbsp;\");\n\t\t\t\t\t\t$template->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->setCurrentBlock(\"text_col\");\n\t\t\t\t\t\t$template->setVariable(\"TEXT_MC\", ilUtil::prepareFormOutput($option[\"title\"]));\n\t\t\t\t\t\t$template->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif ($this->object->use_min_answers)\n\t\t{\n\t\t\t$template->setCurrentBlock('min_max_msg');\n\t\t\tif ($this->object->nr_min_answers > 0 && $this->object->nr_max_answers > 0)\n\t\t\t{\n\t\t\t\t$template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_nr_answers'), $this->object->nr_min_answers, $this->object->nr_max_answers));\n\t\t\t}\n\t\t\telse if ($this->object->nr_min_answers > 0)\n\t\t\t{\n\t\t\t\t$template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_nr_answers'), $this->object->nr_min_answers));\n\t\t\t}\n\t\t\telse if ($this->object->nr_max_answers > 0)\n\t\t\t{\n\t\t\t\t$template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_max_nr_answers'), $this->object->nr_max_answers));\n\t\t\t}\n\t\t\t$template->parseCurrentBlock();\n\t\t}\n\t\tif ($show_questiontext)\n\t\t{\n\t\t\t$this->outQuestionText($template);\n\t\t}\n\t\tif ($question_title)\n\t\t{\n\t\t\t$template->setVariable(\"QUESTION_TITLE\", $this->object->getTitle());\n\t\t}\n\t\t$template->parseCurrentBlock();\n\t\treturn $template->get();\n\t}", "public static function webservice_surveycheck_returns() {\n return new external_value(PARAM_TEXT, 'json encoded array that returns, courses and its surveys with the last time the survey was changed');\n }", "public function get_answers_page_4()\n\t{\n\t\tif ($this->input->post(\"presence31\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"presence31\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '31';\n\t\t\t$answer->save();\n\t\t}\n\t\tif ($this->input->post(\"presence32\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"presence32\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '32';\n\t\t\t$answer->save();\n\t\t}\n\t\tif ($this->input->post(\"any33\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"any33\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '33';\n\t\t\t$answer->save();\n\t\t}\n\t\t$this->session->set(\"message\", \"Your answers have been submitted.\");\n\t\turl::redirect('questionnaire_selection');\n\t}", "public function actionsurvey()\n {\n $model = new Troubleticket;\n $this->LoginCheck();\n if (isset($_POST['submit'])) {\n $model->Save($_POST['Troubleticket']);\n }\n $pickList_sealed = $model->getpickList('sealed');\n $pickList_category = $model->getpickList('ticketcategories');\n $pickList_damagetype = $model->getpickList('damagetype');\n $pickList_damagepostion = $model->getpickList('damageposition');\n $picklist_drivercauseddamage = $model->getpickList('drivercauseddamage');\n $picklist_reportdamage = $model->getpickList('reportdamage');\n $picklist_ticketstatus = $model->getpickList('ticketstatus');\n $Asset_List = $model->findAssets('Assets');\n $postdata = @$_POST['Troubleticket'];\n $this->render('survey', array('model' => $model,\n 'Sealed' => $pickList_sealed,\n 'category' => $pickList_category,\n 'damagetype' => $pickList_damagetype,\n 'damagepos' => $pickList_damagepostion,\n 'drivercauseddamageList' => $picklist_drivercauseddamage,\n 'reportdamage' => $picklist_reportdamage,\n 'Assets' => $Asset_List,\n 'ticketstatus' => $picklist_ticketstatus,\n 'postdata' => $postdata)\n );\n }", "function general_enquiry_process($gen_post_data)\n\t{\n\t\t$villaName = $gen_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $gen_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($gen_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($gen_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $gen_post_data['selCountry'];\n\t\t$params['Email'] = $gen_post_data['txtEmail'];\n\t\t$params['TelNo'] = $gen_post_data['txtPhoneAreaCode'].$gen_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = '1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = '1';\n\t\t$params['SpecialRequest'] = stripslashes('Subject:'.strip_tags($gen_post_data['messageSubject']).', Message: '.$gen_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($gen_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $gen_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\t\n\t}", "function &getSurveyPages()\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.*, svy_qtype.type_tag, svy_svy_qst.heading FROM \" . \n\t\t\t\"svy_question, svy_qtype, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \".\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$all_questions[$row[\"question_id\"]] = $row;\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst \".\n\t\t\t\t\"WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \".\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$all_pages = array();\n\t\t$pageindex = -1;\n\t\t$currentblock = \"\";\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\tif (array_key_exists($question_id, $obligatory_states))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"obligatory\"] = $obligatory_states[$question_id];\n\t\t\t}\n\t\t\t$constraints = array();\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\tif (!$currentblock or ($currentblock != $questionblocks[$question_id]['questionblock_id']))\n\t\t\t\t{\n\t\t\t\t\t$pageindex++;\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = $questionblocks[$question_id]['show_questiontext'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = $questionblocks[$question_id]['show_blocktitle'];\n\t\t\t\t$currentblock = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pageindex++;\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = 1;\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = 1;\n\t\t\t\t$currentblock = \"\";\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif (!isset($all_pages[$pageindex]))\n\t\t\t{\n\t\t\t\t$all_pages[$pageindex] = array();\n\t\t\t}\n\t\t\tarray_push($all_pages[$pageindex], $all_questions[$question_id]);\n\t\t}\n\t\t// calculate position percentage for every page\n\t\t$max = count($all_pages);\n\t\t$counter = 1;\n\t\tforeach ($all_pages as $index => $block)\n\t\t{\n\t\t\tforeach ($block as $blockindex => $question)\n\t\t\t{\n\t\t\t\t$all_pages[$index][$blockindex][\"position\"] = $counter / $max;\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\treturn $all_pages;\n\t}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "function getSurveyForm()\n{\n\t$output = '<div id=\"div-survey-form-1\"><script type=\"text/javascript\" src=\"https://wq360.infusionsoft.com/app/form/iframe/4fe0ff1546212fbd13a93be716c6dc04\"></script></div>';\nreturn $output;\n}", "public function getQuestionText() {\n\t\treturn $this->questionText;\n\t}", "public function survey_post()\n\t\t{\n\t\t\t$data = array();\n\t\t\t$userId = $this->post('userId');\n\t\t\tif($userId != '')\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\n\t\t\t\t$userData = $this->Student_survey_model->getUserdata($userId);\n\t\t\t\t$testDetails = $this->Student_survey_model->getTestDetails('Survey');\n\t\t\t\t$filledWeek = $this->Student_survey_model->getSTDFilledWeeks($userData['uuid'] , $testDetails['test_id']);\n\n\t\t\t\t//User Information\n\t\t\t\t$data['userInfo']['campusName'] = $userData['nome_centri'];\n\t\t\t\t$data['userInfo']['studentName'] = $userData['nome'].' '.$userData['cognome'];\n\t\t\t\t$data['userInfo']['groupLeader'] = $userData['gl_rif'];\n\t\t\t\t$data['userInfo']['travellingWith'] = $userData['businessname'];\n\n\t\t\t\t//Survey details\n\t\t\t\t$data['surveyInfo']['surveyId'] = $testDetails['test_id'];\n\t\t\t\t$data['surveyInfo']['surveyTitle'] = $testDetails['test_title'];\n\n\t\t\t\t$weekNo = $this->diffInWeeks($userData['data_arrivo_campus'] , date('Y-m-d', strtotime($userData['data_partenza_campus'].' -1 day')));\n\t\t\t\t$weekStart = array();\n\t\t\t\t$weekDay = 7;\n\t\t\t\t$currDate = date(\"Y-m-d\");\n\n\t\t\t\t//Split the weeks from the date range and save in an array\n\t\t\t\tfor($i = 1 ; $i <= $weekNo ; $i++)\n\t\t\t\t{\n\t\t\t\t\tif($i == 1)\n\t\t\t\t\t\t$weekStart[$i] = date('Y-m-d' , strtotime($userData['data_arrivo_campus']));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(date('Y-m-d' , strtotime($weekStart[$i - 1] . ' +7 days')) > $userData['data_partenza_campus'])\n\t\t\t\t\t\t\t$weekStart[$i] = $userData['data_partenza_campus'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$weekStart[$i] = date('Y-m-d', strtotime($weekStart[$i - 1] . ' +7 days'));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//fetch the dates from the week date string and store in array(Already filled up survey)\n\t\t\t\t$filledDates = array();\n\t\t\t\tif(!empty($filledWeek))\n\t\t\t\t{\n\t\t\t\t\tforeach($filledWeek as $dates)\n\t\t\t\t\t{\n\t\t\t\t\t\t$dateArr = explode('_' , $dates['ts_week']);\n\t\t\t\t\t\t$filledDates[] = $dateArr[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Separate the completed and pending survey\n\t\t\t\t$data['completed'] = $data['pending'] = array();\n\t\t\t\tforeach($weekStart as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$tempWeekSend = $key.'_'.$value;\n\t\t\t\t\t//For completed\n\t\t\t\t\tif(in_array($value , $filledDates))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['completed'][$key]['frontTitle'] = 'Week '.$key;\n\t\t\t\t\t\t$data['completed'][$key]['title'] = $testDetails['test_title'].' (Week '.$key.')';\n\t\t\t\t\t\t$data['completed'][$key]['weekSend'] = $tempWeekSend;\n\t\t\t\t\t\t$data['completed'][$key]['fromDate'] = $value;\n\t\t\t\t\t\t$data['completed'][$key]['toDate'] = date('Y-m-d' , strtotime($value . ' +6 days'));\n\t\t\t\t\t\t$data['completed'][$key]['questions'] = $this->getQuestion($userData['uuid'] , $tempWeekSend);\n\t\t\t\t\t}\n\t\t\t\t\t//For pending\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['pending'][$key]['frontTitle'] = 'Week '.$key;\n\t\t\t\t\t\t$data['pending'][$key]['title'] = $testDetails['test_title'].' (Week '.$key.')';\n\t\t\t\t\t\t$data['pending'][$key]['weekSend'] = $tempWeekSend;\n\t\t\t\t\t\t$data['pending'][$key]['fromDate'] = $value;\n\t\t\t\t\t\t$data['pending'][$key]['toDate'] = date('Y-m-d' , strtotime($value . ' +6 days'));\n\t\t\t\t\t\t$data['pending'][$key]['questions'] = $this->getQuestion($userData['uuid'] , $tempWeekSend);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['pending'] = array_values($data['pending']);\n\t\t\t\t$data['completed'] = array_values($data['completed']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('invalid_student_login');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}" ]
[ "0.6340673", "0.6281586", "0.6280045", "0.62490594", "0.61598873", "0.60957825", "0.601392", "0.5995809", "0.5994953", "0.59703803", "0.5885166", "0.58823514", "0.5877491", "0.58746284", "0.58021843", "0.5799707", "0.57962775", "0.57939667", "0.5778306", "0.5776508", "0.572702", "0.57242584", "0.56946224", "0.5690949", "0.56825316", "0.5665409", "0.5652087", "0.56100225", "0.55939674", "0.55909616", "0.5581216", "0.5575654", "0.5575291", "0.5574303", "0.5573864", "0.5562432", "0.55366534", "0.5534328", "0.553365", "0.5510724", "0.5484639", "0.5469223", "0.5456138", "0.54268014", "0.54226846", "0.5409423", "0.5399841", "0.5382774", "0.5355265", "0.53531134", "0.5350838", "0.53491366", "0.5346756", "0.5343549", "0.53299606", "0.53122807", "0.53055626", "0.5302364", "0.5291513", "0.5288339", "0.52871007", "0.5285793", "0.528508", "0.5273765", "0.5270864", "0.5269047", "0.52677697", "0.5261798", "0.5260254", "0.5259925", "0.5256459", "0.52536106", "0.52480626", "0.5247716", "0.5245296", "0.52424926", "0.52400076", "0.52375776", "0.5237092", "0.52341646", "0.5232328", "0.5218274", "0.5210102", "0.5199941", "0.5199909", "0.5194585", "0.5191929", "0.51901555", "0.5187257", "0.5173361", "0.5160825", "0.515986", "0.5156411", "0.51534104", "0.51457435", "0.51435405", "0.5142052", "0.51388574", "0.5138603", "0.5135663" ]
0.5204321
83
See if a survey has been completed by the current user
public function is_complete($survey_id) { $query = $this->db ->where('survey_id', $survey_id) ->where('completed IS NOT NULL', NULL, TRUE) ->where('member_id', $this->session->userdata('member_id')) ->order_by('updated', 'DESC') ->limit(1) ->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "public function isCompletedByCurrentUser()\n {\n return SwagUser::getCurrent()->isSwagpathCompleted($this);\n }", "function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "function _isComplete($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\tif (($survey->getTitle()) and (count($survey->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function hasCompletedSurvey($iSurveyId, $sToken) {\n\t\t// Check if this token has already completed this survey\n\t\t$sQuery \t\t= \"SELECT completed FROM lime_tokens_$iSurveyId WHERE token = '$sToken'\";\n\t\t$oResult\t\t= $this->oDbConnection->query($sQuery);\n\t\twhile($aRow = mysqli_fetch_array($oResult)) {\n\t\t\t$isCompleted = $aRow['completed'];\n\t\t}\n\t\treturn (isset($isCompleted) && ($isCompleted != 'N'));\n\t}", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "function isComplete()\n\t{\n\t\tif (($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "public static function _hasUserCompleted($a_obj_id, $a_user_id)\n\t{\n\t\treturn (self::_lookupStatus($a_obj_id, $a_user_id) == self::LP_STATUS_COMPLETED_NUM);\n\t}", "public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }", "public function hasCompleted() : bool\n {\n return $this->completed_at !== null;\n }", "public function isProfileCompleted() {\n\t\tif ($this->RelatedProductsAndServices()->count() == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($this->Title) ||\n\t\t\tempty($this->Description) ||\n\t\t\tempty($this->PhoneNumber)\n\t\t) {\n\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isCompleted()\n\t{\n\t\tif($this->test_status_id == Test::COMPLETED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "public function isCompletedByUser($swagUser)\n {\n return $swagUser->isSwagpathCompleted($this);\n }", "function challengeCompleted($challenge_id)\n\t{\n\t $current = $this->DB->database_select('users', array('challenges_completed'), array('uid' => session_get('uid')), 1);\n\t $current = $current['challenges_completed'];\n\t if(!empty($current)) //Has any challenges been completed?\n\t {\n\t\t $challenges = explode(',', $current);\n\t\t for($i = 0; $i < count($challenges); $i++)\n\t\t {\n\t\t\t if($challenges[$i] == $challenge_id)\n\t\t\t {\n\t\t\t\t return true; //Challenge was already completed\n\t\t\t }\n\t\t }\n\t }\n\t return false;\n\t}", "function isComplete() {\n return (bool) $this->fulfillment['complete'];\n }", "public function isCompleted(): bool\n {\n return $this->status == 'completed';\n }", "public function isCompleted() : bool\n {\n return in_array($this->getOrderStatus(), [self::AUTHORISED, self::COMPLETED]);\n }", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "function getChallengesCompleted()\n\t{\n\t $current = $this->DB->database_select('users', array('challenges_completed'), array('uid' => session_get('uid')), 1);\n\t $current = $current['challenges_completed'];\n\t if(!empty($current))\n\t {\n\t\t return $current;\n\t }\n\t return false; //No challenges completed\n\t}", "function isCompleted(){\r\n\t\treturn $this->status==IFocusModel::COMPLETE;\r\n\t}", "public function isCompleted()\n {\n return $this->completed;\n }", "public function isComplete() {\n if ( !empty($this->aliasId) && !empty($this->email) && !empty($this->username)) {\n return true;\n } else {\n return false;\n }\n }", "public function is_complete() {\n return (bool) $this->timecompleted;\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public function psxFormIsCompleted()\n {\n // TODO: Remove all code related to PSX form. Since it's not used any more we return true to be sure to not make any breaking changes\n return true;\n//\n// if (getenv('PLATEFORM') === 'PSREADY') { // if on ready, the user is already onboarded\n// return true;\n// }\n//\n// return !empty($this->getPsxForm());\n }", "public function isCompleted()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_COMPLETED;\n\t}", "function tquiz_user_complete($course, $user, $mod, $tquiz) {\n}", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function isComplete() {\n return !variable_get('og_7200_ogur_roles', FALSE);\n }", "function isComplete()\n {\n return $this->complete;\n }", "function etherpadlite_user_complete($course, $user, $mod, $etherpadlite) {\n return true;\n}", "protected function isCompleteCaptured()\n {\n $payment = $this->getPayment();\n return $payment->getAmountPaid() == $payment->getAmountAuthorized();\n }", "public function canCheckAnswers()\n {\n $sections = $this->getSectionCompletion(self::SECTIONS);\n\n return $sections['allCompleted'] && $this->canBeUpdated();\n }", "public function getUserStatusInQuests($user);", "public function isComplete()\n\t{\n\t\treturn $this->status == 'Complete';\n\t}", "protected function is_question_finished(): bool {\n return $this->quba->get_question_state($this->slot)->is_finished();\n }", "public function can_be_completed(): bool {\n\t\t// TODO: Implement this.\n\t\treturn false;\n\t}", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "public function hasComplete(){\n return $this->_has(2);\n }", "function i4_is_unit_complete($course_id, $user_id, $unit_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $completed_status = \"complete\";\n\n //Here we grab the unit info for units that are completed for the users course.\n $SQL = $wpdb->prepare(\"SELECT * FROM $wpcwdb->units_meta LEFT JOIN $wpcwdb->user_progress\n ON $wpcwdb->units_meta.unit_id=$wpcwdb->user_progress.unit_id\n WHERE parent_course_id = %d AND unit_completed_status = %s AND user_id = %d\", $course_id, $completed_status, $user_id);\n\n //Store the Completed units Array\n $completed_units = $wpdb->get_results($SQL);\n\n $completed_unit_ids = array();\n\n //set the counter\n $i = 0;\n\n //Store the Unit ID's into the completed unit id's array\n foreach ($completed_units as $completed_unit) {\n $completed_unit_ids[$i] = $completed_unit->unit_id;\n $i++;\n }\n //If the unit is in the completed units array, display the completed checkmark.\n if (in_array($unit_id, $completed_unit_ids)) {\n return true;\n }\n else {\n return false;\n }\n }", "public function isCompleted()\n {\n return static::STATUS_SUCCESS == $this->getStatus();\n }", "public function isCompleted();", "public function isDone()\n\t{\n\t $today = Carbon::now()->setTimezone('America/Los_Angeles')->startOfDay();\n\t return $today->gte($this->event_date->endOfDay());\n\t}", "public function isComplete()\n {\n return $this->status == 'success';\n }", "public function hasCompleted()\n\t{\n\t\treturn $this->isStatusSuccessful() || $this->isStatusFailed();\n\t}", "function isComplete()\r\n {\r\n return $this->_complete;\r\n }", "function isSubmittedBy();", "public function is_progress($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function isCompleted() {\n return $this->state->getCode() == TaskState::Completed;\n }", "function isRead() {\n\t\t$submissionDao = Application::getSubmissionDAO();\n\t\t$userGroupDao = DAORegistry::getDAO('UserGroupDAO');\n\t\t$userStageAssignmentDao = DAORegistry::getDAO('UserStageAssignmentDAO');\n\t\t$viewsDao = DAORegistry::getDAO('ViewsDAO');\n\n\t\t$submission = $submissionDao->getById($this->getSubmissionId());\n\n\t\t// Get the user groups for this stage\n\t\t$userGroups = $userGroupDao->getUserGroupsByStage(\n\t\t\t$submission->getContextId(),\n\t\t\t$this->getStageId()\n\t\t);\n\t\twhile ($userGroup = $userGroups->next()) {\n\t\t\t$roleId = $userGroup->getRoleId();\n\t\t\tif ($roleId != ROLE_ID_MANAGER && $roleId != ROLE_ID_SUB_EDITOR) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the users assigned to this stage and user group\n\t\t\t$stageUsers = $userStageAssignmentDao->getUsersBySubmissionAndStageId(\n\t\t\t\t$this->getSubmissionId(),\n\t\t\t\t$this->getStageId(),\n\t\t\t\t$userGroup->getId()\n\t\t\t);\n\n\t\t\t// Check if any of these users have viewed it\n\t\t\twhile ($user = $stageUsers->next()) {\n\t\t\t\tif ($viewsDao->getLastViewDate(\n\t\t\t\t\tASSOC_TYPE_REVIEW_RESPONSE,\n\t\t\t\t\t$this->getId(),\n\t\t\t\t\t$user->getId()\n\t\t\t\t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasFinalChoice($userid)\n {\n return is_object(R::findOne('finalchoice', 'user_id = ?', [$userid]));\n }", "public function completedStatus()\n {\n \t$validation = 'validateStatus' . studly_case(str_replace('.', '-', $this->status->slug));\n\n \tif (method_exists($this, $validation)) {\n \t\t$complete = $this->{$validation}();\n \t}else {\n \t\t$complete = true;\n \t}\n\n \treturn $complete && $this->completedAllSteps() && $this->generalValidation();\n }", "public function onBoardingIsCompleted()\n {\n return !empty($this->getIdToken());\n // Commented out because psx form is no longer used\n // && $this->psxFormIsCompleted();\n }", "public function getHasSubmitted() {\n\t\t@$cookie = $_COOKIE['promotion_' . $this->getId()];\n\t\treturn (bool) $cookie;\n\t}", "function complete() \n {\n if (!($this->activity->isInteractive()))\n {\n $this->error[] = tra('interactive activities should not call the complete() method');\n return false;\n }\n \n return $this->instance->complete($this->activity_id);\n }", "public function hasNotCompleted() : bool\n {\n return $this->completed_at === null;\n }", "public function questComplete($questid, $userid)\n {\n $query = $this->dbh->prepare('UPDATE `playerquests` SET `completed` = 1\n WHERE `questid` = ?\n AND `userid` = ?');\n $query->execute(array($questid, $userid));\n }", "public function hasAnswers();", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function isDone (int $question_id)\n { \n return (bool) $this->getScoreByQuestion($question_id)\n ->done;\n }", "public static function OrderProcessHasBeenMarkedAsCompleted()\n {\n return array_key_exists(self::SESSION_KEY_NAME_ORDER_SUCCESS, $_SESSION) && true == $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS];\n }", "public function approved()\n\t{\n\t\treturn $this->response[0] === self::APPROVED;\n\t}", "public function has_achieved_goal() {\r\n\t\treturn $this->get_donated_amount() >= $this->get_goal();\r\n\t}", "public function isComplete()\n {\n return\n $this->Status == 'CardCreated' ||\n $this->Status == 'Captured' ||\n $this->Status == 'Refunded' ||\n $this->Status == 'Void';\n }", "public function isRedeemed()\n\t{\n\t\tif (!$this->exists())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->get('redeemed_by'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "abstract public function isComplete();", "function isAnswered( $current )\n\t{\n\t\ttry\n\t\t{\n\t\t\t$db = DB::getConnection();\n\t\t\t$st = $db->prepare( 'SELECT id_user FROM page_' . $current . ' WHERE id_user LIKE :id' );\n\t\t\t$st->execute( array( 'id' => $_SESSION['id'] ) );\n\t\t}\n\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t$row = $st->fetch();\n\t\tif( $row === false )\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public function isCurrentUserPreparedForPrerequisites()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n if ($this->isCurrentUserPrepared()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCurrentUserPrepared()) {\n return false;\n }\n }\n\n return true;\n }", "public function hasConsented()\n {\n return $this->hasConsented;\n }", "public function getReadyForCompletion() {\n\t\t$ready = $this->getExerciseReadyForCompletion();\n\n\t\t//Is there a question\n\t\tif(count($this->questions) == 0) {\n\t\t\t$ready = 0;\n\t\t} else {\n\t\t\tforeach($this->questions as $question) {\n\t\t\t\t//Is the question filled out\n\t\t\t\t$questionText = $question->getText();\n\t\t\t\tif(empty($questionText)) {\n\t\t\t\t\t$ready= 0;\n\t\t\t\t} else {\n\t\t\t\t\t$possibleAnswers = $question->getPossibleAnswers();\n\t\t\t\t\t//Does it have atleast 2 possible answers\n\t\t\t\t\tif(count($possibleAnswers) < 2) {\n\t\t\t\t\t\t$ready = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($possibleAnswers as $possibleAnswer) {\n\t\t\t\t\t\t\t//Does each answer have a text\n\t\t\t\t\t\t\t$answerText = $possibleAnswer->getText();\n\t\t\t\t\t\t\tif(empty($answerText)) {\n\t\t\t\t\t\t\t\t$ready= 0;\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\t\treturn $ready;\n\t}", "function canTakeWrittenExam()\n {\n if(!$this->readingExamResult()->exists()){\n return FALSE;\n }\n\n // user already took the exam, determine if passed\n if(!$this->latestReadingExamResult()->didPassed()){\n return FALSE;\n }\n\n if(!$this->writtenExamResult()->exists()){\n return TRUE;\n }\n\n $exam = $this->latestWrittenExamResult();\n $now = Carbon::now();\n $examDate = Carbon::createFromFormat('Y-m-d H:i:s', $exam->datetime_started);\n\n $allowance = $examDate->copy()->addMinutes($exam->essay->limit);\n if(!$exam->datetime_ended && $allowance->gt($now)){\n return TRUE;\n }\n\n $cooldown = $examDate->copy()->addMonths(6);\n if($cooldown->lt($now)){\n return TRUE;\n } \n\n return FALSE;\n\n \n }", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "public function hasFinishScore(){\n return $this->_has(3);\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "function completeLessonbyUser($userEmail, $lessonId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE UserLesson SET lessonCompleted='1' WHERE emailUser='\" . $userEmail . \"' AND idLesson='\" . $lessonId . \"' \";\n\n\t\t$result = $conn->query($query);\n\n\t}", "function usp_ews_completion_used($course){\n\n\tglobal $DB;\n\t$fields = 'enablecompletion';\n\t$record = $DB->get_record('course', array('id'=>$course), $fields);\n\t\n\tif($record->enablecompletion == 1)\n\t\treturn true;\n\telse\n\t\treturn false;\n\t\n}", "public function hasCompletedAffiliatedOrders()\n {\n return (count($this->getCompletedAffiliatedOrders()) > 0) ? true : false;\n }", "public function isOpen()\n {\n return $this->completed_at === null;\n }", "protected function isQuestionActive(){\n return $this->socialQuestion &&\n $this->socialQuestion->SocialPermissions->isActive();\n }", "public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }", "public function onTrial()\n {\n // If trial end column is not empty, means the subscription is on trial period\n return $this->active && !is_null($this->trialEndsAt);\n }", "function saveCompletionStatus() \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$complete = 0;\n\t\tif ($this->isComplete()) \n\t\t{\n\t\t\t$complete = 1;\n\t\t}\n if ($this->getSurveyId() > 0) \n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"UPDATE svy_svy SET complete = %s, tstamp = %s WHERE survey_id = %s\",\n\t\t\t\tarray('text','integer','integer'),\n\t\t\t\tarray($this->isComplete(), time(), $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}", "public function markCompletedFor($a_user_id) {\n\t\tglobal $ilAppEventHandler;\n\n\t\t$ilAppEventHandler->raise(\"Services/Tracking\", \"updateStatus\", array(\n\t\t\t\"obj_id\" => $this->getId(),\n\t\t\t\"usr_id\" => $a_user_id,\n\t\t\t\"status\" => ilLPStatus::LP_STATUS_COMPLETED_NUM,\n\t\t\t\"percentage\" => 100\n\t\t\t));\n\t}", "public function isPaid()\n {\n return $this->status === self::STATUS_APPROVED;\n }", "public function isComplete()\n {\n $result = TRUE;\n foreach(['Id','Address','FullName'] as $what):\n $getter = 'get'.$what;\n $value = $this->{$getter}();\n $result = $result && !empty($value);\n endforeach;\n return $result;\n }", "function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {\n return true;\n}", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "function areAllUsersDone(){\n\t\t$connection = new Connection();\n\t\t$pdo = $connection->getConnection();\n\t\tunset($connection);\n\t\t\n\t\t$status =\n\t\t$pdo->prepare('SELECT FirstName FROM hhm_users \n\t\t\t\tWHERE UserStatus = \"not done\" AND HouseholdID = :id');\n\t\t$status->execute(array(':id'=>$this->householdId));\n\t\t$info = $status->fetchAll(PDO::FETCH_COLUMN);\n\t\tif (empty($info)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function userHasResources() {\n $utenti = new MUtenti;\n foreach ($utenti->find(array(), $utenti->getPosition()) as $itemUtenti) {\n if ($itemUtenti[$_POST['nomeRisorsaOfferta']] < $_POST['quantitaOfferta']) {\n return false;\n }\n }\n return true;\n }", "public function isComplete(Context $context)\n\t{\n\t\treturn true;\n\t}", "function questionnaire_get_completion_state($course, $cm, $userid, $type) {\n global $CFG, $DB;\n\n // Get questionnaire details.\n $questionnaire = $DB->get_record('questionnaire', array('id' => $cm->instance), '*', MUST_EXIST);\n\n // If completion option is enabled, evaluate it and return true/false.\n if ($questionnaire->completionsubmit) {\n $params = array('userid' => $userid, 'qid' => $questionnaire->id);\n return $DB->record_exists('questionnaire_attempts', $params);\n } else {\n // Completion option is not enabled so just return $type.\n return $type;\n }\n}" ]
[ "0.75086784", "0.7241403", "0.71344525", "0.70983624", "0.70219064", "0.686156", "0.67033005", "0.6701492", "0.65841794", "0.65590996", "0.6543528", "0.6487884", "0.6482565", "0.6481459", "0.64751357", "0.6446314", "0.64217484", "0.64139885", "0.6395755", "0.6344057", "0.63191026", "0.63171566", "0.6309688", "0.62582475", "0.6257918", "0.62425345", "0.62216246", "0.621809", "0.6208306", "0.62068576", "0.6191277", "0.61839366", "0.61831105", "0.6177846", "0.6150764", "0.6144806", "0.6113869", "0.6098774", "0.6085061", "0.60801786", "0.6061837", "0.60597986", "0.6059247", "0.60439533", "0.6017258", "0.60161436", "0.6006593", "0.60060453", "0.5993186", "0.5987234", "0.5968825", "0.59381765", "0.5919283", "0.5918468", "0.5898789", "0.58844507", "0.5879971", "0.5868674", "0.5867608", "0.5843479", "0.583954", "0.58384824", "0.58290774", "0.5826317", "0.5818631", "0.58134925", "0.579771", "0.57975453", "0.57870233", "0.5780646", "0.5759736", "0.57444644", "0.5734789", "0.57324076", "0.5731586", "0.57135266", "0.57122564", "0.56974256", "0.56924206", "0.5691191", "0.567847", "0.5673619", "0.56673366", "0.5665774", "0.5645687", "0.5638811", "0.56361884", "0.56196487", "0.5618496", "0.5605426", "0.5601315", "0.56011087", "0.5589111", "0.5581021", "0.5579742", "0.5573482", "0.55714154", "0.5569402", "0.5559589", "0.5559445" ]
0.7188206
2
Get all surveys completed or in progress by the current user If a member ID is set, use that. If submission hashes are found, use those. Save results to user_submissions property.
private function get_user_submissions($submission_hahses) { self::$user_submissions = array(); $member_id = $this->session->userdata('member_id'); // Make sure we have a member ID or some submission hashes to check if ( $member_id OR $submission_hahses ) { // If we have a member ID if ($member_id) { $this->db ->where('member_id', $member_id) ->or_where_in('hash', $submission_hahses ? $submission_hahses : ''); // CI does not like an empty array } // If we only have submission hashes else { $this->db->where_in('hash', $submission_hahses); } $query = $this->db ->order_by('completed, updated, created', 'DESC') ->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { // Loop through each submission foreach ($query->result() as $row) { // First key is either "completed" or "progress", second is survey ID, and value is the submission hash self::$user_submissions[ $row->completed ? 'complete' : 'progress' ][ $row->survey_id ] = $row->hash; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function user_submissions_progress($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some surveys in progress return an array of their hashes\n\t\treturn isset(self::$user_submissions['progress']) ? self::$user_submissions['progress'] : array();\n\t}", "public function get_completed_survey_submissions($id, $completed_since = NULL)\n\t{\n\t\t$data = array();\n\n\t\t$this->db\n\t\t\t->order_by('completed', 'ASC')\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('survey_id', $id);\n\n\t\t// If completed_since is set, only grab completed submissions AFTER that date\n\t\tif ($completed_since != NULL)\n\t\t{\n\t\t\t$this->db->where('completed >=', $completed_since);\n\t\t}\n\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ $row->id ] = array(\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function submissions() {\n \n global $CFG, $USER;\n\n // need to get course id in order to retrieve students\n $assignment = get_record('assignment', 'id', $this->mainobject->id);\n $courseid = $assignment->course;\n\n //permission to grade?\n $coursemodule = get_record('course_modules', 'module', $this->mainobject->modulesettings['assignment']->id, 'instance', $assignment->id) ;\n $modulecontext = get_context_instance(CONTEXT_MODULE, $coursemodule->id);\n\n if (!has_capability($this->capability, $modulecontext, $USER->id)) {\n return;\n }\n \n $this->mainobject->get_course_students($courseid);\n\n $student_sql = $this->get_role_users_sql($this->mainobject->courses[$courseid]->context);\n\n $sql = \"SELECT s.id as subid, s.userid, s.timemodified, s.data2, c.id as cmid\n FROM {$CFG->prefix}assignment_submissions s\n INNER JOIN {$CFG->prefix}course_modules c\n ON s.assignment = c.instance\n INNER JOIN {$CFG->prefix}assignment a\n ON s.assignment = a.id\n WHERE s.assignment = {$this->mainobject->id}\n AND s.timemarked < s.timemodified\n AND (s.userid IN ({$student_sql}))\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n \n AND c.module = {$this->mainobject->modulesettings['assignment']->id}\n ORDER BY timemodified ASC\";\n\n $submissions = get_records_sql($sql);\n\n if ($submissions) {\n\n $data = array();\n\n // If we are not making the submissions for a specific group, run the group filtering\n // function to see if the config settings say display by groups and display them if they\n // are (returning false). If there are no groups, the function will return true and we\n // carry on, but if the config settings say 'don't display' then it will return false\n // and we skip this assignment\n if(!$this->mainobject->group) {\n\n //TODO - data array as input for function\n\n //$data['submissions'] = $submissions;\n //$data['type'] = $this->type;\n //$data['id'] = $this->mainobject->id;\n //$data['course'] = $assignment->course;\n\n //$group_filter = $this->mainobject->try_to_make_group_nodes($data);\n $group_filter = $this->mainobject->try_to_make_group_nodes($submissions, $this->type, $this->mainobject->id, $assignment->course);\n\n if (!$group_filter) {\n return;\n }\n }\n\n // begin json object\n $this->mainobject->output = '[{\"type\":\"submissions\"}';\n\n foreach ($submissions as $submission) {\n // add submission to JSON array of objects\n if (!isset($submission->userid)) {\n continue;\n }\n\n // ignore non-submitted uploaded files\n if (($assignment->assignmenttype == 'upload') && ($submission->data2 != 'submitted')) {\n continue;\n }\n\n // if we are displaying for just one group, skip this submission if it doesn't match\n if ($this->mainobject->group && !$this->mainobject->check_group_membership($this->mainobject->group, $submission->userid)) {\n continue;\n }\n \n $name = $this->mainobject->get_fullname($submission->userid);\n \n // sort out the time info\n $now = time();\n $seconds = ($now - $submission->timemodified);\n $summary = $this->mainobject->make_time_summary($seconds);\n \n $this->mainobject->make_submission_node($name, $submission->userid, $submission->cmid, $summary, 'assignment_final', $seconds, $submission->timemodified);\n \n }\n $this->mainobject->output .= \"]\"; // end JSON array\n \n }\n }", "public function getStudentSubmission(User $user)\n {\n foreach ($this->getSubmissions() as $submission) {\n if ($submission->getOwner() === $user) {\n return $submission;\n }\n }\n }", "function &getUserSpecificResults($finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$evaluation = array();\n\t\t$questions =& $this->getSurveyQuestions();\n\t\tforeach ($questions as $question_id => $question_data)\n\t\t{\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($question_id);\n\t\t\t$data =& $question->getUserAnswers($this->getSurveyId(), $finished_ids);\n\t\t\t$evaluation[$question_id] = $data;\n\t\t}\n\t\treturn $evaluation;\n\t}", "public function getSubmissions()\n {\n return $this->getFiles()->filter(function (File $file) {\n return $file->getOwner()->getType() === 'student';\n });\n }", "public function get_survey_submissions($filters, $order_by = 'updated', $order_by_order = 'DESC')\n\t{\n\t\t$data = array();\n\n\t\t$order_by = in_array($order_by, array('id', 'member_id', 'survey_id', 'created', 'updated', 'completed', 'complete')) ? $order_by : 'updated';\n\t\t$order_by_order = in_array($order_by_order, array('ASC', 'DESC', 'RANDOM')) ? $order_by_order : 'DESC';\n\n\t\t$this->db->order_by($order_by, $order_by_order);\n\n\t\t// Filter survey ID\n\t\tif ( isset($filters['survey_id']) AND $filters['survey_id'])\n\t\t{\n\t\t\t$this->db->where('survey_id', $filters['survey_id']);\n\t\t}\n\n\t\t// Filter member ID\n\t\tif ( isset($filters['member_id']) AND $filters['member_id'])\n\t\t{\n\t\t\t$this->db->where('member_id', $filters['member_id']);\n\t\t}\n\n\t\t// Filter group ID\n\t\tif ( isset($filters['group_id']) AND $filters['group_id'])\n\t\t{\n\t\t\t$this->db->join('members', 'members.member_id = vwm_surveys_submissions.member_id');\n\t\t\t$this->db->where('group_id', $filters['group_id']);\n\t\t}\n\n\t\t// If a valid created from date was provided\n\t\tif ( isset($filters['created_from']) AND strtotime($filters['created_from']) )\n\t\t{\n\t\t\t// If a valid created to date was provided as well\n\t\t\tif ( isset($filters['created_to']) AND strtotime($filters['created_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to created_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys created from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys created on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`created` BETWEEN ' . strtotime($filters['created_from']) . ' AND ' . (strtotime($filters['created_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a created from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'created >=', strtotime($filters['created_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// If a valid updated from date was provided\n\t\tif ( isset($filters['updated_from']) AND strtotime($filters['updated_from']) )\n\t\t{\n\t\t\t// If a valid updated to date was provided as well\n\t\t\tif ( isset($filters['updated_to']) AND strtotime($filters['updated_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to updated_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys updated from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys updated on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`updated` BETWEEN ' . strtotime($filters['updated_from']) . ' AND ' . (strtotime($filters['updated_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a updated from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'updated >=', strtotime($filters['updated_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// Filter completed\n\t\tif ( isset($filters['complete']) AND $filters['complete'] !== NULL)\n\t\t{\n\t\t\t// Show completed subissions\n\t\t\tif ($filters['complete'])\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NOT NULL', NULL, TRUE);\n\t\t\t}\n\t\t\t// Show incomplete submissions\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NULL', NULL, TRUE);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ (int)$row->id ] = array(\n\t\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t\t'hash' => $row->hash,\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function findSubmissionsForMod($modUserId)\n {\n $query = '\n SELECT submitted_at, first_name, last_name, topic, mark, s.id\n FROM submissions s\n LEFT JOIN users u ON s.user_id = u.id\n LEFT JOIN projects p ON s.project_id = p.id\n WHERE mod_user_id = :mod_user_id\n ORDER BY submitted_at DESC\n ';\n $statement = $this->db->prepare($query);\n $statement->bindValue('mod_user_id', $modUserId, \\PDO::PARAM_INT);\n $statement->execute();\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $result;\n }", "public function user_submissions_complete($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some completed surveys return an array of their hashes\n\t\treturn isset(self::$user_submissions['complete']) ? self::$user_submissions['complete'] : array();\n\t}", "private function users_for_stats() {\n\n\t\t\tif ( ! is_null( $this->users_for_stats ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( is_null( $this->request ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\tif ( empty( $quiz_id ) ) {\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( learndash_is_admin_user() ) {\n\t\t\t\t$this->users_for_stats = array();\n\t\t\t} elseif ( learndash_is_group_leader_user() ) {\n\t\t\t\tif ( learndash_get_group_leader_manage_courses() ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * If the Group Leader can manage_courses they have will access\n\t\t\t\t\t * to all quizzes. So they are treated like the admin user.\n\t\t\t\t\t */\n\t\t\t\t\t$this->users_for_stats = array();\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * Else we need to figure out of the quiz requested is part of a\n\t\t\t\t\t * Course within Group managed by the Group Leader.\n\t\t\t\t\t */\n\t\t\t\t\t$quiz_users = array();\n\t\t\t\t\t$leader_courses = learndash_get_groups_administrators_courses( get_current_user_id() );\n\t\t\t\t\tif ( ! empty( $leader_courses ) ) {\n\t\t\t\t\t\t$quiz_courses = array();\n\t\t\t\t\t\tif ( 'yes' === LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Courses_Builder', 'shared_steps' ) ) {\n\t\t\t\t\t\t\t$quiz_courses = learndash_get_courses_for_step( $quiz_id, true );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$quiz_course = learndash_get_setting( $quiz_id, 'course' );\n\t\t\t\t\t\t\tif ( ! empty( $quiz_course ) ) {\n\t\t\t\t\t\t\t\t$quiz_courses = array( $quiz_course );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $quiz_courses ) ) {\n\t\t\t\t\t\t\t$common_courses = array_intersect( $quiz_courses, $leader_courses );\n\t\t\t\t\t\t\tif ( ! empty( $common_courses ) ) {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * The following will get a list of all users within the Groups\n\t\t\t\t\t\t\t\t * managed by the Group Leader. This list of users will be passed\n\t\t\t\t\t\t\t\t * to the query logic to limit the selected rows.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * This is not 100% accurate because we don't limit the rows based\n\t\t\t\t\t\t\t\t * on the associated courses. Consider if Shared Course steps is\n\t\t\t\t\t\t\t\t * enabled and the quiz is part of two courses and those courses\n\t\t\t\t\t\t\t\t * are associated with multiple groups. And the user is in both\n\t\t\t\t\t\t\t\t * groups. So potentially we will pull in statistics records for\n\t\t\t\t\t\t\t\t * the other course quizzes.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$quiz_users = learndash_get_groups_administrators_users( get_current_user_id() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $quiz_users ) ) {\n\t\t\t\t\t\t$this->users_for_stats = $quiz_users;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If here then non-admin and non-group leader user.\n\t\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\t\tif ( ! empty( $quiz_id ) ) {\n\t\t\t\t\tif ( get_post_meta( $quiz_id, '_viewProfileStatistics', true ) ) {\n\t\t\t\t\t\t$this->users_for_stats = (array) get_current_user_id();\n\t\t\t\t\t\treturn $this->users_for_stats;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t}\n\n\t\t\treturn $this->users_for_stats;\n\t\t}", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "public function submission()\n {\n return Submission::where('assignment_id', $this->attributes['id'])->where('user_id', Auth::user()->id)->first();\n }", "public function getSubmittedbyuser()\n\t{\n\t\treturn $this->submittedbyuser;\n\t}", "public function userStanding(User $user, Collection $submissions = null)\n {\n return $this->gradeStanding($this->userPercentage($user, $submissions));\n }", "public function get_survey_submission($hash = NULL, $submission_id = NULL)\n\t{\n\t\t$data = array();\n\n\t\t// If we have a submission hash\n\t\tif ($hash)\n\t\t{\n\t\t\t$this->db->where('hash', $hash);\n\t\t}\n\t\t// If we do not have a submission hash we must have a submission ID\n\t\telse\n\t\t{\n\t\t\t$this->db->where('id', $submission_id);\n\t\t}\n\n\t\t$query = $this->db->limit(1)->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\n\t\t\t$data = array(\n\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t'hash' => $row->hash,\n\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t);\n\t\t}\n\n\t\treturn $data;\n\t}", "private function getCurrentSubmission(\n Gradeable $gradeable,\n string $who_id,\n string $details_page\n ): GradedGradeable {\n $submitter_id = $this->core->getQueries()->getSubmitterIdFromAnonId($who_id, $gradeable->getId());\n if ($submitter_id === null) {\n $submitter_id = $who_id;\n }\n $current_submission = $this->tryGetGradedGradeable($gradeable, $submitter_id, false);\n\n // Submission does not exist\n if ($current_submission === false) {\n $this->core->redirect($details_page);\n }\n\n return $current_submission;\n }", "public function getSubmissionsForSelect($conferenceId = null, $empty = null)\n\t{\n\t\t$return = array();\n\n\t\tif ($empty) {\n\t\t\t$return[0] = $empty;\n\t\t}\n\n\t\t$identity = Zend_Auth::getInstance()->getIdentity();\n\n\t\t$query = 'select st.submission_id, s.title from submission_status st\n\t\tleft join submissions s ON s.submission_id = st.submission_id\n\t\twhere st.status = :status AND s.conference_id = :conference_id';\n\n\t\tif (!$identity->isAdmin()) {\n\t\t\t// if user is not admin, only show their own submissions\n\t\t\t$mySubmissions = implode(\",\", array_keys($identity->getMySubmissions()));\n\t\t\tif (!empty($mySubmissions)) {\n\t\t\t\t$query .= ' and st.submission_id IN ('.$mySubmissions.')';\n\t\t\t} else {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\n\t\t$submissions = $this->getAdapter()->query(\n\t\t\t$query,\n\t\t\tarray(\n\t\t\t\t'status' => $this->_getAcceptedValue(),\n\t\t\t\t'conference_id' => $this->getConferenceId()\n\t\t\t)\n\t\t);\n\t\tforeach ($submissions as $submission) {\n\t\t\t$return[$submission['submission_id']] = $submission['title'];\n\t\t}\n\t\treturn $return;\n\t}", "private function get_user_quiz_details() {\n\t\t\tif ( isset( $this->user_quiz_data[ $this->current()->getUserId() ] ) ) {\n\n\t\t\t\treturn $this->user_quiz_data[ $this->current()->getUserId() ];\n\t\t\t}\n\n\t\t\t$user_quizzes = (array) get_user_meta( $this->current()->getUserId(), '_sfwd-quizzes', true );\n\t\t\t$user_quizzes_stats = array();\n\t\t\t/**\n\t\t\t * We want to rebuild/reindex the quizzes listing to be by\n\t\t\t * the statatistics ref ID.\n\t\t\t */\n\t\t\tif ( ! empty( $user_quizzes ) ) {\n\t\t\t\tforeach ( $user_quizzes as $user_quiz ) {\n\t\t\t\t\tif ( ( ! isset( $user_quiz['statistic_ref_id'] ) ) || ( empty( $user_quiz['statistic_ref_id'] ) ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$statistic_ref_id = absint( $user_quiz['statistic_ref_id'] );\n\t\t\t\t\t$user_quizzes_stats[ $statistic_ref_id ] = $user_quiz;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->user_quiz_data[ $this->current()->getUserId() ] = $user_quizzes_stats;\n\n\t\t\treturn $this->user_quiz_data[ $this->current()->getUserId() ];\n\t\t}", "private function get_submitters_data()\n {\n $publication = DataManager::retrieve_by_id(\n ContentObjectPublication::class_name(), \n $this->get_publication_id());\n \n // Users\n $this->users = DataManager::get_publication_target_users_by_publication_id(\n $this->get_publication_id());\n // Course groups\n $this->course_groups = DataManager::retrieve_publication_target_course_groups(\n $this->get_publication_id(), \n $publication->get_course_id())->as_array();\n // Platform groups\n $this->platform_groups = DataManager::retrieve_publication_target_platform_groups(\n $this->get_publication_id(), \n $publication->get_course_id())->as_array();\n }", "function submitSurveyReport($user_id,$userData)\n\t\t{\n\t\t\t//getting the active survey set no\n\t\t\t$active_set = $this->manageContent->getValue_where(\"survey_info\",\"*\",\"status\",1);\n\t\t\t$survey_set_no = $active_set[0]['set_no'];\n\t\t\t//getting the questions which are answered\n\t\t\tforeach($userData as $key=>$value)\n\t\t\t{\n\t\t\t\tif(substr($key,0,1) == 'q')\n\t\t\t\t{\n\t\t\t\t\t$question_no = substr($key,1);\n\t\t\t\t\t//getting values of user id of that answer\n\t\t\t\t\t$ans_user = $this->manageContent->getValueMultipleCondtn(\"survey_info\",\"*\",array(\"set_no\",\"question_no\",\"answer_no\"),array($survey_set_no,$question_no,$value));\n\t\t\t\t\t$user_field = $ans_user[0]['user_id'];\n\t\t\t\t\tif(empty($user_field))\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_user_field = $user_id;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_user_field = $ans_user[0]['user_id'].','.$user_id;\n\t\t\t\t\t}\n\t\t\t\t\t//updating the value\n\t\t\t\t\t$update = $this->manageContent->updateValueWhere(\"survey_info\",\"user_id\",$new_user_field,\"id\",$ans_user[0]['id']);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $update;\n\t\t}", "function submission($task_id, $user_status){\n\t$answer = DB::table('tasks')->where('id',$task_id)->select('answer_type')->first();\n\t$answer_type = $answer->answer_type;\n\t$response = $response_orig;\n\t\n\t// if(sizeof($response_orig)<3 && $answer_type== \"int\"){\n\t// \t$response = \"Not enough data\";\n\t// }\n\n\tif($answer_type == \"mcq\"){\n\t\t$response = DB::table('answers')->select('answers.data as data', DB::raw(\"count('answers.data') as total\"))->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->whereNotIn('answers.data', ['null', 'timeout'])->where('users.status', $user_status)->where('answers.task_id',$task_id)->groupBy('data')->get();\n\t\t// if(sizeof($response_orig) < 3){\n\t\t// \t$response=\"Not enough data\";\n\t\t// }\n\t\t// else {\n\t\t\t$hist = [];\n\t\t\tforeach( $response as $item )\n\t\t\t\t$hist[$item->data] = $item->total;\n\t\t\tarsort($hist);\n\t\t\t$response = array_slice($hist,0,3,true);\t\n\t\t// }\n\t\t\n\t}\n\n\telse if($answer_type == \"int\"){\n \t\t$data = array_map('intval', DB::table('answers')->select('answers.data as data')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->whereNotIn('answers.data', ['null', 'timeout'])->where('users.status', $user_status)->where('answers.task_id', $task_id)->lists('data'));\n\t\t$med = array_median($data);\n\t\t$response = array('data' => $med);\n\t}\n\t\t\n\t\t// if ($total % 2 != 0)\n\t\t// \t$total += 1;\n\t\t// $median = (int)(ceil($total / 2));\n\t\t// $upper_index = (int)(ceil($total / 4) - 1);\n\t\t// $lower_index = (int)(ceil($total * 3 / 4) - 1);\n\n\t\t// $median = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($median)->limit(1)->first();\n\t\t// $median_up = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($upper_index)->limit(1)->first();\n\t\t// $median_down = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($lower_index)->limit(1)->first();\n\n\t\t// $iqr = ($median_down->data - $median_up->data);\n\t\t// $median = $median->data;\n\n\t\t//$response = array('count'=>$total, 'median'=>$median, 'first_quartile'=>$median_up, 'third_quartile' =>$median_down );\n\treturn $response;\n}", "function get_survey_requests_by_user($user_id=NULL,$survey_id=NULL)\n\t{\n\t\t\t$this->db->select('lic_requests.id,expiry,status');\n\t\t\t$this->db->where('userid',$user_id);\n\t\t\t$this->db->where('lic_requests.surveyid',$survey_id);\n\t\t\t$this->db->where('lic_requests.status !=','DENIED');\n\t\t\t$this->db->join('lic_file_downloads', 'lic_requests.id = lic_file_downloads.requestid','left');\n\t\t\t$query=$this->db->get(\"lic_requests\");\n\t\t\t//echo mktime(0,0,0,9,9,2010);\n\t\t\tif (!$query)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->result_array();\n\t}", "private function get_codehandin_submission($assignmentid, $userid) {\r\n global $DB;\r\n return $DB->get_record('codehandin_submission', array('assignmentid' => $assignmentid, 'userid' => $userid));\r\n }", "public function getSubmissionById($id)\n\t{\n\t\treturn $this->find((int) $id)->current();\n\t}", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "public function evaluationTotal(User $user, Collection $submissions = null)\n {\n $evaluationTotal = 0;\n if(!$submissions){\n $submissions = $this->submissions;\n }\n foreach ( $submissions as $submission )\n {\n $userGrade = $submission->grades()->where('user_id', $user->id);\n if ($userGrade->exists())\n {\n if (!$submission->bonus)\n {\n $evaluationTotal += $submission->total;\n }\n\n }\n }\n\n return $evaluationTotal;\n }", "public function userFinalPercentage(User $user, Collection $submissions = null, $limit=false)\n {\n return round(($this->userMark($user, $submissions, $limit)) * $this->grade, 1);\n }", "function getCumulatedResults(&$question, $finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!$finished_ids)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$nr_of_users = $result->numRows();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t}\n\t\t\n\t\t$result_array =& $question->getCumulatedResults($this->getSurveyId(), $nr_of_users, $finished_ids);\n\t\treturn $result_array;\n\t}", "function getCumulatedResultsDetails($survey_id, $counter, $finished_ids)\n\t{\n\t\tif (count($this->cumulated) == 0)\n\t\t{\n\t\t\tif(!$finished_ids)\n\t\t\t{\n\t\t\t\tinclude_once \"./Modules/Survey/classes/class.ilObjSurvey.php\";\t\t\t\n\t\t\t\t$nr_of_users = ilObjSurvey::_getNrOfParticipants($survey_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t\t}\n\t\t\t$this->cumulated =& $this->object->getCumulatedResults($survey_id, $nr_of_users, $finished_ids);\n\t\t}\n\t\t\n\t\t$output = \"\";\n\t\tinclude_once \"./Services/UICore/classes/class.ilTemplate.php\";\n\t\t$template = new ilTemplate(\"tpl.il_svy_svy_cumulated_results_detail.html\", TRUE, TRUE, \"Modules/Survey\");\n\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question\"));\n\t\t$questiontext = $this->object->getQuestiontext();\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->object->prepareTextareaOutput($questiontext, TRUE));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question_type\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->lng->txt($this->getQuestionType()));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_answered\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_ANSWERED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_skipped\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_SKIPPED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t/*\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode_nr_of_selections\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE_NR_OF_SELECTIONS\"]);\n\t\t$template->parseCurrentBlock();\n\t\t*/\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"categories\"));\n\t\t$categories = \"\";\n\t\tif (is_array($this->cumulated[\"variables\"]))\n\t\t{\n\t\t\tforeach ($this->cumulated[\"variables\"] as $key => $value)\n\t\t\t{\n\t\t\t\t$categories .= \"<li>\" . $value[\"title\"] . \": n=\" . $value[\"selected\"] . \n\t\t\t\t\t\" (\" . sprintf(\"%.2f\", 100*$value[\"percentage\"]) . \"%)</li>\";\n\t\t\t}\n\t\t}\n\t\t$categories = \"<ol>$categories</ol>\";\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $categories);\n\t\t$template->parseCurrentBlock();\n\t\t\n\t\t// add text answers to detailed results\n\t\tif (is_array($this->cumulated[\"textanswers\"]))\n\t\t{\n\t\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"freetext_answers\"));\t\n\t\t\t$html = \"\";\t\t\n\t\t\tforeach ($this->cumulated[\"textanswers\"] as $key => $answers)\n\t\t\t{\n\t\t\t\t$html .= $this->cumulated[\"variables\"][$key][\"title\"] .\"\\n\";\n\t\t\t\t$html .= \"<ul>\\n\";\n\t\t\t\tforeach ($answers as $answer)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<li>\" . preg_replace(\"/\\n/\", \"<br>\\n\", $answer) . \"</li>\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= \"</ul>\\n\";\n\t\t\t}\n\t\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $html);\n\t\t\t$template->parseCurrentBlock();\n\t\t}\t\t\t\n\t\t\n\t\t// chart \n\t\t$template->setCurrentBlock(\"detail_row\");\t\t\t\t\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"chart\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->renderChart(\"svy_ch_\".$this->object->getId(), $this->cumulated[\"variables\"]));\n\t\t$template->parseCurrentBlock();\n\t\t\t\t\n\t\t$template->setVariable(\"QUESTION_TITLE\", \"$counter. \".$this->object->getTitle());\n\t\treturn $template->get();\n\t}", "public function getSubmissionData()\r\n {\r\n return $this->data;\r\n }", "function all_final_submissions_quick($min_status = 0) {\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$join_on = \"best\";\n\t\t} else {\n\t\t\t$join_on = \"last\";\n\t\t}\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM user_entity as ue JOIN submission as s ON ue.\".$join_on.\"_submissionid = s.submissionid\".\n\t\t\t\" WHERE ue.`entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\t$subs = Submission::fetch_all($query);\n\t\t$result = array();\n\t\tforeach($subs as $s) {\n\t\t\t$result[$s->userid] = $s;\n\t\t}\n\t\treturn $result;\n\t}", "public static function getSubmissions(array $users, $limit = 5) {\n return self::getItems($users, $limit, 'submitted');\n }", "public function userTotalMark(User $user, Collection $submissions = null)\n {\n\n $userTotalMark = 0;\n if(!$submissions){\n $submissions = $this->submissions;\n }\n foreach ( $submissions as $submission )\n {\n $userGrade = $submission->grades()->where('user_id', $user->id);\n if ($userGrade->exists())\n {\n $userTotalMark += $userGrade->get()->first()->mark;\n\n }\n }\n\n return $userTotalMark;\n }", "public function vote($submission_id, $user_id)\n {\n $this->submission->find($submission_id)->attach($user_id);\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getSubmissionData()\n {\n return $this->data;\n }", "public function getUserProgressInQuest($user, $questCode);", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "private function get_all_circleci_submissions($submissionid) {\n global $DB;\n return $DB->get_records('assignsubmission_circleci', array('submission'=>$submissionid));\n }", "function ubc_di_get_assessment_results() {\n\t\tglobal $wpdb;\n\t\t$response = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t} else {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t\t$temp_ubc_di_sites = array();\n\t\t\t$user_id = get_current_user_id();\n\t\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_site->ID, 'ubc_di_assessment_result_group', true );\n\t\t\t\t$ubc_di_group_people = get_post_meta( $ubc_di_asr_group_id, 'ubc_di_group_people', true );\n\t\t\t\tif ( '' != $ubc_di_group_people ) {\n\t\t\t\t\tforeach ( $ubc_di_group_people as $ubc_di_group_person ) {\n\t\t\t\t\t\tif ( $user_id == $ubc_di_group_person ) {\n\t\t\t\t\t\t\t$temp_ubc_di_sites[] = $ubc_di_site;\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$ubc_di_sites = $temp_ubc_di_sites;\n\t\t}\n\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t$temp_array = $this->ubc_di_get_site_metadata( $ubc_di_site->ID );\n\t\t\tif ( null != $temp_array ) {\n\t\t\t\tarray_push( $response, $temp_array );\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "function _getFilteredSubmissions($journalId) {\r\n \r\n\t\t$sectionId = Request::getUserVar('decisionCommittee');\r\n\t\t$decisionType = Request::getUserVar('decisionType');\r\n\t\t$decisionStatus = Request::getUserVar('decisionStatus');\r\n\t\t$decisionAfter = Request::getUserVar('decisionAfter');\r\n\t\t$decisionBefore = Request::getUserVar('decisionBefore');\r\n \r\n\t\t$studentResearch = Request::getUserVar('studentInitiatedResearch');\r\n\t\t$startAfter = Request::getUserVar('startAfter');\r\n\t\t$startBefore = Request::getUserVar('startBefore');\r\n\t\t$endAfter = Request::getUserVar('endAfter');\r\n\t\t$endBefore = Request::getUserVar('endBefore');\r\n\t\t$kiiField = Request::getUserVar('KII');\r\n\t\t$multiCountry = Request::getUserVar('multicountry');\r\n\t\t$countries = Request::getUserVar('countries');\r\n\t\t$geoAreas = Request::getUserVar('geoAreas');\r\n\t\t$researchDomains = Request::getUserVar('researchDomains');\r\n $researchFields = Request::getUserVar('researchFields');\r\n\t\t$withHumanSubjects = Request::getUserVar('withHumanSubjects');\r\n\t\t$proposalTypes = Request::getUserVar('proposalTypes');\r\n\t\t$dataCollection = Request::getUserVar('dataCollection');\r\n\r\n $budgetOption = Request::getUserVar('budgetOption');\r\n\t\t$budget = Request::getUserVar('budget');\r\n\t\t$sources = Request::getUserVar('sources');\r\n \r\n\t\t$identityRevealed = Request::getUserVar('identityRevealed');\r\n\t\t$unableToConsent = Request::getUserVar('unableToConsent');\r\n\t\t$under18 = Request::getUserVar('under18');\r\n\t\t$dependentRelationship = Request::getUserVar('dependentRelationship');\r\n\t\t$ethnicMinority = Request::getUserVar('ethnicMinority');\r\n\t\t$impairment = Request::getUserVar('impairment');\r\n\t\t$pregnant = Request::getUserVar('pregnant');\r\n\t\t$newTreatment = Request::getUserVar('newTreatment');\r\n\t\t$bioSamples = Request::getUserVar('bioSamples');\r\n\t\t$exportHumanTissue = Request::getUserVar('exportHumanTissue');\r\n\t\t$exportReason = Request::getUserVar('exportReason');\r\n $radiation = Request::getUserVar('radiation');\r\n\t\t$distress = Request::getUserVar('distress');\r\n\t\t$inducements = Request::getUserVar('inducements');\r\n\t\t$sensitiveInfo = Request::getUserVar('sensitiveInfo');\r\n\t\t$reproTechnology = Request::getUserVar('reproTechnology');\r\n\t\t$genetic = Request::getUserVar('genetic');\r\n\t\t$stemCell = Request::getUserVar('stemCell');\r\n\t\t$biosafety = Request::getUserVar('biosafety');\r\n \r\n\r\n $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\r\n\r\n $submissions =& $editorSubmissionDao->getEditorSubmissionsReport(\r\n $journalId, $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety);\r\n \r\n $criterias = $this->_getCriterias(\r\n $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety \r\n );\r\n \r\n\t\treturn array( 0 => $submissions->toArray(), 1 => $criterias); \r\n }", "private function get()\n {\n\n $this->getMarks()->getAssessments();\n return ['users' => $this->me->get()];\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "function getPendingChallengesUsers($mysqli, $currentUser)\n{\n\tif($stmt = $mysqli->prepare(\"SELECT * FROM PENDING_CHALLENGE WHERE User_ID_2 = ?; \"))\n\t{\n\t\t$stmt->bind_param('i', $currentUser);\n $stmt->execute();\n $stmt->store_result();\n\t\t$data = array();\n\n\t\t$stmt->bind_result($id, $userid1, $userid2);\n\n\t\twhile ($stmt->fetch())\n {\n\t\t\tarray_push($data,array(\"userID1\"=>$userid1));\n }\n }\n else\n {\n return false;\n }\n\treturn $data;\n}", "function all_final_submissions($min_status = 0) {\n\t\treturn $this->all_final_submissions_from( $this->all_submissions($min_status) );\n\t}", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "function dataform_get_participants($dataid) {\n global $DB;\n\n $params = array('dataid' => $dataid);\n\n $sql = \"SELECT DISTINCT u.id \n FROM {user} u,\n {dataform_entries} e\n WHERE e.dataid = :dataid AND\n u.id = e.userid\";\n $entries = $DB->get_records_sql($sql, $params);\n\n $sql = \"SELECT DISTINCT u.id \n FROM {user} u,\n {dataform_entries} e,\n {comments} c\n WHERE e.dataid = ? AND\n u.id = e.userid AND\n e.id = c.itemid AND\n c.commentarea = 'entry'\";\n $comments = $DB->get_records_sql($sql, $params);\n\n $sql = \"SELECT DISTINCT u.id \n FROM {user} u,\n {dataform_entries} e,\n {ratings} r\n WHERE e.dataid = ? AND\n u.id = e.userid AND\n e.id = r.itemid AND\n r.component = 'mod_dataform' AND\n (r.ratingarea = 'entry' OR\n r.ratingarea = 'activity')\";\n $ratings = $DB->get_records_sql($sql, $params);\n\n $participants = array();\n\n if ($entries) {\n foreach ($entries as $entry) {\n $participants[$entry->id] = $entry;\n }\n }\n if ($comments) {\n foreach ($comments as $comment) {\n $participants[$comment->id] = $comment;\n }\n }\n if ($ratings) {\n foreach ($ratings as $rating) {\n $participants[$rating->id] = $rating;\n }\n }\n return $participants;\n}", "public function submissions($project_id, $public = true, $force = false)\n {\n\n $submissions = $this->model($project_id)->stage->submissions();\n\n if ($force) return $submissions->get();\n\n if ($public) return $submissions->public()->get();\n\n return $submissions->private()->get();\n\n }", "private function has_submission_field($user_id)\n {\n $this->db->where('umeta_key', 'submissions');\n $this->db->where('user_id', $user_id);\n\n $result = $this->db->get('user_meta');\n\n return ($result->num_rows() == 1) ? $result->row('umeta_value') : FALSE;\n }", "public function browse_submitters()\n {\n $html = array();\n \n $html[] = $this->render_header();\n \n $html[] = '<div class=\"announcements level_1\" style=\"background-image: url(' .\n Theme::getInstance()->getCommonImagePath('ContentObject/Introduction') . ');\">';\n $html[] = $this->generate_assignment_details_html();\n $html[] = $this->get_reporting_html();\n $html[] = '</div><br />';\n \n // retrieve group submissions allowed\n $publication = DataManager::retrieve_by_id(\n ContentObjectPublication::class_name(), \n $this->get_publication_id());\n \n $assignment = $publication->get_content_object();\n $allow_group_submissions = $assignment->get_allow_group_submissions();\n \n if ($allow_group_submissions == 0)\n {\n $this->submitter_type = AssignmentSubmission::SUBMITTER_TYPE_USER;\n \n $users_table = new SubmissionUsersBrowserTable($this);\n $users_html = $users_table->as_html();\n $html[] = $users_html;\n }\n else\n {\n // Create tabs per submitter type\n $type = Request::get(self::PARAM_TYPE);\n if ($type == null)\n {\n $type = self::TYPE_COURSE_GROUP;\n }\n switch ($type)\n {\n case self::TYPE_COURSE_GROUP :\n $this->submitter_type = AssignmentSubmission::SUBMITTER_TYPE_COURSE_GROUP;\n $course_groups_table = new SubmissionCourseGroupsBrowserTable($this);\n $content_table = $course_groups_table->as_html();\n $selected_course_group = true;\n break;\n case self::TYPE_GROUP :\n $this->submitter_type = AssignmentSubmission::SUBMITTER_TYPE_PLATFORM_GROUP;\n $groups_table = new SubmissionGroupsBrowserTable($this);\n $content_table = $groups_table->as_html();\n $parameters[] = $parameters[self::PARAM_TYPE] = self::TYPE_GROUP;\n $selected_group = true;\n break;\n }\n $parameters_course_group = $this->get_parameters();\n $parameters_course_group[self::PARAM_TYPE] = self::TYPE_COURSE_GROUP;\n $link_course_group = $this->get_url($parameters_course_group);\n $parameters_group = $this->get_parameters();\n $parameters_group[self::PARAM_TYPE] = self::TYPE_GROUP;\n $link_group = $this->get_url($parameters_group);\n \n $tabs = new DynamicVisualTabsRenderer('submissions', $content_table);\n $tab_course_group = new DynamicVisualTab(\n 'tab_course_group', \n Translation::get('CourseGroups'), \n null, \n $link_course_group, \n $selected_course_group);\n $tabs->add_tab($tab_course_group);\n $tab_group = new DynamicVisualTab(\n 'tab_group', \n Translation::get('Groups'), \n null, \n $link_group, \n $selected_group);\n $tabs->add_tab($tab_group);\n $html[] = $tabs->render();\n }\n \n $html[] = $this->render_footer();\n \n return implode(PHP_EOL, $html);\n }", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "public function setSubmittedbyuser($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->submittedbyuser !== $v) {\n\t\t\t$this->submittedbyuser = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::SUBMITTEDBYUSER;\n\t\t}\n\n\t\tif ($this->aUser !== null && $this->aUser->getUserid() !== $v) {\n\t\t\t$this->aUser = null;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function is_progress($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getSubmittedBy()\r\n {\r\n return $this->_submittedBy;\r\n }", "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "public function getResultsOfUser($user_id);", "public function get_files(stdClass $submission, stdClass $user) {\n $result = array();\n $fs = get_file_storage();\n\n $files = $fs->get_area_files($this->assignment->get_context()->id,\n 'assignsubmission_circleci',\n ASSIGNSUBMISSION_CIRCLECI_FILEAREA,\n $submission->id,\n 'timemodified',\n false);\n\n foreach ($files as $file) {\n // Do we return the full folder path or just the file name?\n if (isset($submission->exportfullpath) && $submission->exportfullpath == false) {\n $result[$file->get_filename()] = $file;\n } else {\n $result[$file->get_filepath().$file->get_filename()] = $file;\n }\n }\n return $result;\n }", "public function getSubmission() {\n\t\t$submission = $this->getRequest()->param('ID');\n\t\t\n\t\tif ($submission) {\n\t\t\treturn SubmittedForm::get()->filter('uid', $submission)->First();\n\t\t}\n\n\t\treturn null;\n\t}", "public function evalGradeExists(User $user, Collection $submissions = null)\n {\n if(!$submissions){\n $submissions = $this->submissions;\n }\n $list = $submissions->pluck('id');\n $userGrade = $user->grades()->whereIn('submission_id', $list)->get();\n return !$userGrade->isEmpty();\n\n }", "public function submissions()\n {\n $segregatedSubmissions = Submissions::getStudentSubmissions();\n //dd($segregatedSubmissions);\n $upcoming_submissions = $segregatedSubmissions[0];\n $ongoing_submissions = $segregatedSubmissions[1];\n $finished_submissions = $segregatedSubmissions[2];\n\n //dd($upcoming_submissions);\n //dd($ongoing_submissions);\n //dd($finished_submissions);\n $unReadNotifCount = StudentCalls::getUnReadNotifCount();\n return view('student/submissions', compact('upcoming_submissions', 'ongoing_submissions', 'finished_submissions','unReadNotifCount'));\n }", "function get_user_study_requests($survey_id, $user_id,$request_status=NULL)\n\t{\n\t\t$this->db->select('id,request_type,status');\n\t\t$this->db->where('userid',$user_id);\n\t\t$this->db->where('surveyid',$survey_id);\n\t\tif($request_status)\n\t\t{\n\t\t\t$this->db->where_in('status',$request_status);\n\t\t}\n\t\treturn $this->db->get('lic_requests')->result_array();\n\t}", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "public function get_group_assign_submission_date($userid, $contextid) {\n global $remotedb;\n // Group submissions.\n $sql = \"SELECT su.timemodified\n FROM {files} f\n JOIN {assign_submission} su ON f.itemid = su.id\n LEFT JOIN {groups_members} gm ON su.groupid = gm.groupid AND gm.userid = ?\n WHERE contextid=? AND filesize > 0 AND su.groupid <> 0\";\n $params = array($userid, $contextid);\n $files = $remotedb->get_recordset_sql($sql, $params, $limitfrom = 0, $limitnum = 0);\n $out = array();\n foreach ($files as $file) {\n $out[] = $file->timemodified;\n }\n $br = html_writer::empty_tag('br');\n return implode($br, $out);\n }", "public function complete(Request $request, $userId)\n {\n $completedBadgeIds = BadgeUser::where(['user_id' => $userId, 'completed' => true])->pluck('badge_id')->all();\n $badges = Badge::whereNotIn('id', $completedBadgeIds)->get(['id', 'name']);\n\n foreach ($badges as $badge) {\n switch ($badge->name) {\n case 'Igra brez napake':\n $count = Answer::where(['user_id' => $userId, 'success' => true])\n ->select(DB::raw('COUNT(*) AS total'))\n ->groupBy('game_id')\n ->having('total', '=', 24)\n ->get()\n ->count();\n if ($count > 0) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Igra s 50% točnostjo':\n $userGameIds = GameUser::where(['user_id' => $userId, 'finished' => true])\n ->pluck('game_id')\n ->all();\n $count = Answer::whereIn('game_id', $userGameIds)\n ->where(['user_id' => $userId, 'success' => true])\n ->select('game_id', DB::raw('COUNT(*) AS total'))\n ->groupBy('game_id')\n ->having('total', '>=', 12)\n ->get()\n ->count();\n if ($count > 0) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Igra končana v 25 minutah':\n $userGameIds = GameUser::where(['user_id' => $userId, 'finished' => true])\n ->pluck('game_id')\n ->all();\n $count = Answer::whereIn('game_id', $userGameIds)\n ->where(['user_id' => $userId])\n ->select(DB::raw('SUM(time) AS total'))\n ->groupBy('game_id')\n ->having('total', '<=', 1000 * 60 * 25)\n ->get()\n ->count();\n if ($count > 0) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Dokončana igra 3 dni zapored':\n if ($this->hasFinishedGame($userId, 2)) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Dokončana igra 7 dni zapored':\n if ($this->hasFinishedGame($userId, 6)) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Dokončana igra z vsemi različnimi inštrumenti':\n $count = GameUser::where(['user_id' => $userId, 'finished' => true])\n ->select(DB::raw('COUNT(*)'))\n ->groupBy('instrument')\n ->get()\n ->count();\n if ($count === 5) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n }\n break;\n case 'Zmaga v večigralski igri':\n $userGameIds = GameUser::where(['user_id' => $userId])\n ->pluck('game_id')\n ->all();\n $gameIds = Game::whereIn('id', $userGameIds)\n ->whereMode('multi')\n ->pluck('id')\n ->all();\n foreach ($gameIds as $gameId) {\n $userIds = GameUser::where(['game_id' => $gameId])\n ->orderBy('points', 'desc')\n ->pluck('user_id')\n ->all();\n if ($userIds[0] == $userId) {\n BadgeUser::where(['badge_id' => $badge->id, 'user_id' => $userId])\n ->update(['completed' => true]);\n break;\n }\n }\n break;\n }\n }\n\n return response()->json([], 204);\n }", "protected final function findAccessibleSubmissionById ($id)\n\t{\n\t\t/**\n\t\t * @var $submission \\Submission\n\t\t */\n\t\t$submission = Repositories::findEntity(Repositories::Submission, $id);\n\t\t$userId = User::instance()->getId();\n\t\t$authorId = $submission->getUser()->getId();\n\t\t$ownerId = $submission->getAssignment()->getGroup()->getOwner()->getId();\n\n\t\tif ($authorId !== $userId && $ownerId !== $userId)\n\t\t{\n\t\t\tif (User::instance()->hasPrivileges(User::groupsManageAll, User::lecturesManageAll, User::otherAdministration))\n\t\t\t{\n\t\t\t\treturn $submission;\n\t\t\t}\n\t\t\treturn $this->death(StringID::InsufficientPrivileges);\n\t\t}\n\t\treturn $submission;\n\t}", "public function executeMySurveysBubbles() {\n $numbers_for_bubbles = Doctrine_Core::getTable(\"LtMySurvey\")->getNumbersForBubbles($this->getUser()->getGuardUser()->getId());\n \n // Get amount of \"Updated\" surveys\n $this->updated_amount = (int) $numbers_for_bubbles[0]['updated_amount'];\n \n // Get amount of \"Past dues\" surveys\n $this->past_dues_amount = (int) $numbers_for_bubbles[0]['past_due_amount'];\n \n // Check if both bubbles exist\n $this->both_bubble = false;\n if ($this->updated_amount > 0 && $this->past_dues_amount > 0) {\n $this->both_bubble = true;\n }\n }", "private function getInitialData($userid) {\r\n\t\t// get trials for this researcher\r\n\t\t$returnArray = array();\r\n\t\t$researcher = $trials = $trialList = array();\r\n\t\t$result = getData(\"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\");\r\n\t\t// \"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\"\r\n\t\t$sql = \"SELECT t.*, r.*\r\n\t\t\tFROM trial t\r\n\t\t\tINNER JOIN researcher_trial_bridge rt ON rt.trialid = t.trialid\r\n\t\t\tINNER JOIN researcher r ON r.researcherid = rt.researcherid\r\n\t\t\tWHERE t.active = 1 AND r.active = 1 AND r.researcherid = {$userid}\";\r\n\t\t$result = $db->query($sql);\r\n\t\tif($result && count($result)) {\r\n\t\t\tforeach($result as $row) {\r\n\t\t\t\t$trialid = $row['trialid'];\r\n\t\t\t\tif(!in_array($trialid, $trialList)) $trialList[] = $row['trialid'];\r\n\t\t\t\tif(!array_key_exists($trialid, $trials)) {\r\n\t\t\t\t\t$trials[$trialid] = array(\r\n\t\t\t\t\t\t\"trial_name\" => $row['trial_name'],\r\n\t\t\t\t\t\t\"purpose\" => $row['purpose'],\r\n\t\t\t\t\t\t\"creation_date\" => $row['creation_date']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tif(!count(array_keys($researcher))) {\r\n\t\t\t\t\t$researcher = array(\r\n\t\t\t\t\t\t\"prefix\" => $row['prefix'],\r\n\t\t\t\t\t\t\"first_name\" => $row['first_name'],\r\n\t\t\t\t\t\t\"last_name\" => $row['last_name'],\r\n\t\t\t\t\t\t\"suffix\" => $row['suffix'],\r\n\t\t\t\t\t\t\"affiliation\" => $row['affiliation']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($trialList) == 1) {\r\n\t\t\t// given the selected trial, acquire the next batch of data\r\n\r\n\t\t} else if(count($trialList) > 1) {\r\n\t\t\t// this is all the data that's needed for now; after researcher selects a trial, the next batch will be acquired\r\n\t\t\t$returnArray = array(\"researcher\" => $researcher, \"trials\" => $trials, \"trialList\" => $trialList);\r\n\t\t}\r\n\t}", "function get_voted_surveys_by_user($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for user\r\n $sql = \"SELECT survey_id\r\n FROM votes\r\n WHERE is_active='1' AND user_id='$user_id'\";\r\n\r\n $votes_data = array();\r\n $votes_survey = array();\r\n $votes_survey_unique = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes_survey[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n $votes_survey_unique = array_unique($votes_survey);\r\n\r\n return $votes_survey_unique;\r\n}", "public function getUserStatusInQuests($user);", "function i4_get_completed_units($course_id, $user_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $completed_status = \"complete\";\n\n //Here we grab the unit info for units that are completed for the users course.\n $SQL = $wpdb->prepare(\"SELECT * FROM $wpcwdb->units_meta LEFT JOIN $wpcwdb->user_progress\n ON $wpcwdb->units_meta.unit_id=$wpcwdb->user_progress.unit_id\n WHERE parent_course_id = %d AND unit_completed_status = %s AND user_id = %d\", $course_id, $completed_status, $user_id);\n\n //Store the Completed units Array\n $completed_units = $wpdb->get_results($SQL);\n\n $completed_unit_ids = array();\n\n //set the counter\n $i = 0;\n\n //Store the Unit ID's into the completed unit id's array\n foreach ($completed_units as $completed_unit) {\n $completed_unit_ids[$i] = $completed_unit->unit_id;\n $i++;\n }\n\n return $completed_unit_ids;\n }", "public function completed_users()\n {\n return $this->belongsToMany(\n User::class,\n CompletedSentence::class,\n 'sentence_id',\n 'user_id',\n 'id',\n 'id'\n );\n }", "public function getSubmittedSettings() {\n\t\t\treturn $this->submittedSettings;\n\t\t}", "function findCompletedOrdersByUser(User $user);", "public function form_submission_list_user($userid,$formid){\n $this->db->select('fs.id,fs.form_id,fd.form_id,fd.form_name,fs.submission,fs.token,fs.created_at,fd.response_to,concat(u.firstname,\" \" ,u.lastname) as submitted_by')\n ->from('form_submission fs')\n ->join('form_details fd','fd.form_id = fs.form_id')\n ->join('users u','u.id = fs.user_id')\n ->where('fs.user_id',$userid)\n ->where('fs.form_id',$formid)\n ->order_by('fs.created_at','DESC');\n $forms = $this->db->get();\n return $forms->result_array();\n }", "public function handle()\n {\n //give score of 100 to everyone who submitted to 319 and 320\n /* $submission = new Submission();\n $responses = '';\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98762)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $result = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'];\n $responses .= $result . ', ';\n\n }\n dd($responses);*/\n DB::beginTransaction();\n $score = new Score();\n $score->where('assignment_id', 319)->update(['score' => 100]);\n $score = new Score();\n $score->where('assignment_id', 320)->update(['score' => 160]);\n\n $submission = new Submission();\n //On Adapt ID: 392-98875 can I make all true submissions to \"zero score\"\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98875)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $true_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'A';\n $submission->score = $true_submission ? 0 : 2;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $true_submission ? -2 : 2;\n $current->score = $current->score + $adjustment;\n $current->save();\n\n }\n /*The students that submitted A for 392-98765 should get it correct and\n the rest should not.*/\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98765)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $correct_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'A';\n $submission->score = $correct_submission ? 4 : 0;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $correct_submission ? 4 : -4;\n $current->score = $current->score + $adjustment;\n $current->save();\n }\n//Another one: 392-98764\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98764)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $correct_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'C';\n $submission->score = $correct_submission ? 4 : 0;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $correct_submission ? 4 : -4;\n $current->score = $current->score + $adjustment;\n $current->save();\n }\n\n DB::commit();\n\n /*I want every Chem 2C student to get 100% on assignments 319 and 320.\n I presume a simple override of the final score is needed instead of playing around with each assessment score.\n\n and all \"false submission\" into full credit of 2 points?\n /*The students that submitted A for 392-98765 should get it correct and\n the rest should not.*/\n }", "public function userMark(User $user, Collection $submissions = null, $limit=false)\n {\n $userMark =$this->userTotalMark($user, $submissions) / $this->evaluationTotal($user, $submissions);\n if($limit&&$userMark>1){\n return 1;\n }\n return $userMark;\n }", "public function getResponsesForUser($user_id)\n {\n return Proposal::where('responder_id', $user_id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function userPercentage(User $user, Collection $submissions = null, $limit=false)\n {\n return round($this->userMark($user, $submissions, $limit), 4) * 100;\n }", "public function calculate_average_submissions($user_id)\n {\n $user = get_user_by_id($user_id);\n \n if ($user)\n {\n $user_meta = $this->wolfauth->get_user_meta($user_id);\n\n $days = ceil(abs($user->row('register_date') - now())/86400);\n\t\t\t\n\t\t\tif (isset($user_meta->submissions))\n\t\t\t\t$submissions = $user_meta->submissions;\n\t\t\telse\n\t\t\t\t$submissions = 0;\n\n $average = round(($submissions/$days), 2);\n\n return $average;\n } \n }", "public function getSubmissionData($submission_id, $form_id) {\n \n }", "function parseCompletedTasks (&$user) {\n global $_Vars_TasksData;\n\n $result = [\n 'completedTasks' => 0,\n 'completedTasksLinks' => [],\n 'postTaskDataUpdates' => []\n ];\n\n if (empty($user['tasks_done_parsed']['locked'])) {\n return $result;\n }\n\n $completedTasks = 0;\n $completedTasksLinks = [];\n $postTaskDataUpdates = [];\n\n foreach ($user['tasks_done_parsed']['locked'] as $taskCategoryID => $categoryTasks) {\n $hasSkippedCategory = false;\n\n if (strstr($taskCategoryID, 's')) {\n $taskCategoryID = str_replace('s', '', $taskCategoryID);\n $hasSkippedCategory = true;\n }\n\n foreach ($categoryTasks as $taskID) {\n unset($user['tasks_done_parsed']['jobs'][$taskCategoryID][$taskID]);\n\n if (\n !$hasSkippedCategory ||\n (\n $hasSkippedCategory &&\n $_Vars_TasksData[$taskCategoryID]['skip']['tasksrew'] === true\n )\n ) {\n $completedTasksLinks[$taskCategoryID] = 'cat='.$taskCategoryID.'&amp;showtask='.$taskID;\n foreach($_Vars_TasksData[$taskCategoryID]['tasks'][$taskID]['reward'] as $RewardData) {\n Tasks_ParseRewards($RewardData, $postTaskDataUpdates);\n }\n }\n $completedTasks += 1;\n }\n\n if (Tasks_IsCatDone($taskCategoryID, $user)) {\n unset($user['tasks_done_parsed']['jobs'][$taskCategoryID]);\n\n if (\n $hasSkippedCategory ||\n (\n $hasSkippedCategory &&\n $_Vars_TasksData[$taskCategoryID]['skip']['catrew'] === true\n )\n ) {\n $completedTasksLinks[$taskCategoryID] = 'mode=log&amp;cat='.$taskCategoryID;\n foreach ($_Vars_TasksData[$taskCategoryID]['reward'] as $RewardData) {\n Tasks_ParseRewards($RewardData, $postTaskDataUpdates);\n }\n }\n } else {\n if (empty($user['tasks_done_parsed']['jobs'])) {\n unset($user['tasks_done_parsed']['jobs']);\n }\n }\n }\n\n if (empty($user['tasks_done_parsed']['jobs'])) {\n unset($user['tasks_done_parsed']['jobs']);\n }\n\n unset($user['tasks_done_parsed']['locked']);\n // TODO: investigate if this should be moved to \"postTaskDataUpdates\"\n $user['tasks_done'] = json_encode($user['tasks_done_parsed']);\n\n $result['completedTasks'] = $completedTasks;\n $result['completedTasksLinks'] = $completedTasksLinks;\n $result['postTaskDataUpdates'] = $postTaskDataUpdates;\n\n return $result;\n}", "function save_course_progress_get($user_id = \"\") {\n\t\t$lesson_id = $_GET['lesson_id'];\n\t\t$progress = $_GET['progress'];\n\t\t$user_details = $this->user_model->get_all_user($user_id)->row_array();\n\t\t$watch_history = $user_details['watch_history'];\n\t\t$watch_history_array = array();\n\t\tif ($watch_history == '') {\n\t\t\tarray_push($watch_history_array, array('lesson_id' => $lesson_id, 'progress' => $progress));\n\t\t}else{\n\t\t\t$founder = false;\n\t\t\t$watch_history_array = json_decode($watch_history, true);\n\t\t\tfor ($i = 0; $i < count($watch_history_array); $i++) {\n\t\t\t\t$watch_history_for_each_lesson = $watch_history_array[$i];\n\t\t\t\tif ($watch_history_for_each_lesson['lesson_id'] == $lesson_id) {\n\t\t\t\t\t$watch_history_for_each_lesson['progress'] = $progress;\n\t\t\t\t\t$watch_history_array[$i]['progress'] = $progress;\n\t\t\t\t\t$founder = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$founder) {\n\t\t\t\tarray_push($watch_history_array, array('lesson_id' => $lesson_id, 'progress' => $progress));\n\t\t\t}\n\t\t}\n\t\t$data['watch_history'] = json_encode($watch_history_array);\n\t\t$this->db->where('id', $user_id);\n\t\t$this->db->update('users', $data);\n\t\t$lesson_details = $this->crud_model->get_lessons('lesson', $lesson_id)->row_array();\n\t\treturn $this->course_completion_data($lesson_details['course_id'], $user_id);\n\t}", "public function getSurveysWithUser(User $user,$isParticipant){\n if($isParticipant){\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ParticipantDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n }\n else{\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ResearcherDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n \n }\n $cursor = $query->getQuery()->execute();\n $projectIds = array();\n foreach($cursor as $participant){\n array_push($projectIds,new \\MongoId($participant->project->id));\n }\n \n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\SurveyDocument')\n ->field('project.$id')->in($projectIds);\n $cursor = $query->getQuery()->execute();\n $surveys = array();\n foreach($cursor as $survey){\n array_push($surveys,$survey);\n }\n return $surveys;\n }", "function display_submissions( $message='') {\n \n global $CFG, $DB, $USER, $DB, $OUTPUT, $PAGE;\n require_once($CFG->libdir.'/gradelib.php');\n\n /* first we check to see if the form has just been submitted\n * to request user_preference updates\n */\n\n $filters = array(self::FILTER_ALL => get_string('all'),\n self::FILTER_REQUIRE_GRADING => get_string('requiregrading', 'assignment'));\n\n $updatepref = optional_param('updatepref', 0, PARAM_BOOL);\n if ($updatepref) {\n $perpage = optional_param('perpage', 10, PARAM_INT);\n $perpage = ($perpage <= 0) ? 10 : $perpage ;\n $filter = optional_param('filter', 0, PARAM_INT);\n set_user_preference('assignment_perpage', $perpage);\n set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));\n set_user_preference('assignment_filter', $filter);\n }\n\n /* next we get perpage and quickgrade (allow quick grade) params\n * from database\n */\n $perpage = get_user_preferences('assignment_perpage', 10);\n $quickgrade = get_user_preferences('assignment_quickgrade', 0) && $this->quickgrade_mode_allowed();\n $filter = get_user_preferences('assignment_filter', 0);\n $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);\n\n if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {\n $uses_outcomes = true;\n } else {\n $uses_outcomes = false;\n }\n\n $page = optional_param('page', 0, PARAM_INT);\n $strsaveallfeedback = get_string('saveallfeedback', 'assignment');\n\n /// Some shortcuts to make the code read better\n\n $course = $this->course;\n $assignment = $this->assignment;\n $cm = $this->cm;\n $hassubmission = false;\n\n // reset filter to all for offline assignment only.\n if ($assignment->assignmenttype == 'offline') {\n if ($filter == self::FILTER_SUBMITTED) {\n $filter = self::FILTER_ALL;\n }\n } else {\n $filters[self::FILTER_SUBMITTED] = get_string('submitted', 'assignment');\n }\n\n $tabindex = 1; //tabindex for quick grading tabbing; Not working for dropdowns yet\n add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->cm->id, $this->assignment->id, $this->cm->id);\n $PAGE->requires->js('/mod/sword/js/jquery.js', true);\n $PAGE->requires->js('/mod/sword/js/sword22.js', true);\n $PAGE->requires->css('/mod/sword/css/estilo.css', true);\n \n // array(array('aparam'=>'paramvalue')));\n \n $PAGE->set_title(format_string($this->assignment->name,true));\n $PAGE->set_heading($this->course->fullname);\n echo $OUTPUT->header();\n\n echo '<div class=\"usersubmissions\">';\n\n //hook to allow plagiarism plugins to update status/print links.\n echo plagiarism_update_status($this->course, $this->cm);\n\n \n $course_context = context_course::instance($course->id);\n if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {\n echo '<div class=\"allcoursegrades\"><a href=\"' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '\">'\n . get_string('seeallcoursegrades', 'grades') . '</a></div>';\n }\n\n\n \n $context = context_module::instance($cm->id);\n\n /// Check to see if groups aredisplay_submissions being used in this assignment\n\n /// find out current groups mode\n $groupmode = groups_get_activity_groupmode($cm);\n $currentgroup = groups_get_activity_group($cm, true);\n groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);\n\n /// Print quickgrade form around the table\n if ($quickgrade) {\n $formattrs = array();\n $formattrs['action'] = new moodle_url('/mod/assignment/submissions.php');\n $formattrs['id'] = 'fastg';\n $formattrs['method'] = 'post';\n\n echo html_writer::start_tag('form', $formattrs);\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=> $this->cm->id));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'mode', 'value'=> 'fastgrade'));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'page', 'value'=> $page));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=> sesskey()));\n }\n\n /// Get all ppl that are allowed to submit assignments\n list($esql, $params) = get_enrolled_sql($context, 'mod/assignment:submit', $currentgroup);\n\n if ($filter == self::FILTER_ALL) {\n $sql = \"SELECT u.id FROM {user} u \".\n \"LEFT JOIN ($esql) eu ON eu.id=u.id \".\n \"WHERE u.deleted = 0 AND eu.id=u.id \";\n } else {\n $wherefilter = ' AND s.assignment = '. $this->assignment->id;\n $assignmentsubmission = \"LEFT JOIN {assignment_submissions} s ON (u.id = s.userid) \";\n if($filter == self::FILTER_SUBMITTED) {\n $wherefilter .= ' AND s.timemodified > 0 ';\n } else if($filter == self::FILTER_REQUIRE_GRADING && $assignment->assignmenttype != 'offline') {\n $wherefilter .= ' AND s.timemarked < s.timemodified ';\n } else { // require grading for offline assignment\n $assignmentsubmission = \"\";\n $wherefilter = \"\";\n }\n\n $sql = \"SELECT u.id FROM {user} u \".\n \"LEFT JOIN ($esql) eu ON eu.id=u.id \".\n $assignmentsubmission.\n \"WHERE u.deleted = 0 AND eu.id=u.id \".\n $wherefilter;\n }\n\n $users = $DB->get_records_sql($sql, $params);\n if (!empty($users)) {\n if($assignment->assignmenttype == 'offline' && $filter == self::FILTER_REQUIRE_GRADING) {\n //remove users who has submitted their assignment\n foreach ($this->get_submissions() as $submission) {\n if (array_key_exists($submission->userid, $users)) {\n unset($users[$submission->userid]);\n }\n }\n }\n $users = array_keys($users);\n }\n\n // if groupmembersonly used, remove users who are not in any group\n if ($users and !empty($CFG->enablegroupmembersonly) and $cm->groupmembersonly) {\n if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {\n $users = array_intersect($users, array_keys($groupingusers));\n }\n }\n\n $extrafields = get_extra_user_fields($context);\n //select row\n $tablecolumns = array_merge(array('state'),array('select'),array('picture', 'fullname'), $extrafields,\n array('grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade'));\n if ($uses_outcomes) {\n $tablecolumns[] = 'outcome'; // no sorting based on outcomes column\n }\n\n $extrafieldnames = array();\n foreach ($extrafields as $field) {\n $extrafieldnames[] = get_user_field_name($field);\n }\n $tableheaders = array_merge(\n array(get_string('status')),\n array(get_string('select')),\n array('', get_string('fullnameuser')),\n $extrafieldnames,\n array(\n get_string('grade'),\n get_string('comment', 'assignment'),\n get_string('lastmodified').' ('.get_string('submission', 'assignment').')',\n get_string('lastmodified').' ('.get_string('grade').')',\n get_string('status'),\n get_string('finalgrade', 'grades'),\n ));\n if ($uses_outcomes) {\n $tableheaders[] = get_string('outcome', 'grades');\n }\n\n require_once($CFG->libdir.'/tablelib.php');\n echo '<form>';\n $table = new flexible_table('mod-assignment-submissions');\n\n $table->define_columns($tablecolumns);\n $table->define_headers($tableheaders);\n $table->define_baseurl($CFG->wwwroot.'/mod/sword/submissions22.php?id='.$this->cm_sword->id.'&assignment='.$this->cm->id.'&amp;currentgroup='.$currentgroup);\n\n $table->sortable(true, 'lastname');//sorted by lastname by default\n $table->collapsible(true);\n $table->initialbars(true);\n\n $table->column_suppress('picture');\n $table->column_suppress('fullname');\n \n \n $table->column_class('state', 'state');\n $table->column_class('select', 'select');\n $table->column_class('picture', 'picture');\n $table->column_class('fullname', 'fullname');\n foreach ($extrafields as $field) {\n $table->column_class($field, $field);\n }\n $table->column_class('grade', 'grade');\n $table->column_class('submissioncomment', 'comment');\n $table->column_class('timemodified', 'timemodified');\n $table->column_class('timemarked', 'timemarked');\n $table->column_class('status', 'status');\n $table->column_class('finalgrade', 'finalgrade');\n if ($uses_outcomes) {\n $table->column_class('outcome', 'outcome');\n }\n\n $table->set_attribute('cellspacing', '0');\n $table->set_attribute('id', 'attempts');\n $table->set_attribute('class', 'submissions');\n $table->set_attribute('width', '100%');\n\n $table->no_sorting('finalgrade');\n $table->no_sorting('outcome');\n\n // Start working -- this is necessary as soon as the niceties are over\n $table->setup();\n\n /// Construct the SQL\n list($where, $params) = $table->get_sql_where();\n if ($where) {\n $where .= ' AND ';\n }\n\n if ($filter == self::FILTER_SUBMITTED) {\n $where .= 's.timemodified > 0 AND ';\n } else if($filter == self::FILTER_REQUIRE_GRADING) {\n $where = '';\n if ($assignment->assignmenttype != 'offline') {\n $where .= 's.timemarked < s.timemodified AND ';\n }\n }\n\n if ($sort = $table->get_sql_sort()) {\n $sort = ' ORDER BY '.$sort;\n }\n\n $ufields = user_picture::fields('u', $extrafields);\n if (!empty($users)) {\n $select = \"SELECT $ufields,\n s.id AS submissionid, s.grade, s.submissioncomment,\n s.timemodified, s.timemarked,\n ss.status as pub_status,\n CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1\n ELSE 0 END AS status \";\n\n $sql = 'FROM {user} u '.\n 'LEFT JOIN {assignment_submissions} s ON u.id = s.userid\n AND s.assignment = '.$this->assignment->id.' '. \n 'LEFT JOIN {sword_submissions} ss ON ss.submission = s.id AND ss.type = \\'assignment\\' AND ss.sword = :sword_id' .\n 'WHERE '.$where.'u.id IN ('.implode(',',$users).') ';\n\n $params[\"sword_id\"] = $this->cm_sword->instance; \n $ausers = $DB->get_records_sql($select.$sql.$sort, $params, $table->get_page_start(), $table->get_page_size());\n\n $table->pagesize($perpage, count($users));\n\n ///offset used to calculate index of student in that particular query, needed for the pop up to know who's next\n $offset = $page * $perpage;\n $strupdate = get_string('update');\n $strgrade = get_string('grade');\n $strview = get_string('view');\n $grademenu = make_grades_menu($this->assignment->grade);\n\n if ($ausers !== false) {\n $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id, array_keys($ausers));\n $endposition = $offset + $perpage;\n $currentposition = 0;\n foreach ($ausers as $auser) {\n if ($currentposition == $offset && $offset < $endposition) {\n $rowclass = null;\n $final_grade = $grading_info->items[0]->grades[$auser->id];\n $grademax = $grading_info->items[0]->grademax;\n $final_grade->formatted_grade = round($final_grade->grade,2) .' / ' . round($grademax,2);\n $locked_overridden = 'locked';\n if ($final_grade->overridden) {\n $locked_overridden = 'overridden';\n }\n\n // TODO add here code if advanced grading grade must be reviewed => $auser->status=0\n \n $picture = $OUTPUT->user_picture($auser);\n\n if (empty($auser->submissionid)) {\n $auser->grade = -1; //no submission yet\n }\n $selectAssig=NULL; \n if (!empty($auser->submissionid)) {\n $hassubmission = true;\n \n $selectAssig= $auser->submissionid;\n ///Prints student answer and student modified date\n ///attach file or print link to student answer, depending on the type of the assignment.\n ///Refer to print_student_answer in inherited classes.\n if ($auser->timemodified > 0) {\n $studentmodifiedcontent = $this->print_student_answer($auser->id)\n . userdate($auser->timemodified);\n if ($assignment->timedue && $auser->timemodified > $assignment->timedue && $this->supports_lateness()) {\n $studentmodifiedcontent .= $this->display_lateness($auser->timemodified);\n $rowclass = 'late';\n }\n } else {\n $studentmodifiedcontent = '&nbsp;';\n }\n $studentmodified = html_writer::tag('div', $studentmodifiedcontent, array('id' => 'ts' . $auser->id));\n ///Print grade, dropdown or text\n if ($auser->timemarked > 0) {\n $teachermodified = '<div id=\"tt'.$auser->id.'\">'.userdate($auser->timemarked).'</div>';\n\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\" class=\"'. $locked_overridden .'\">'.$final_grade->formatted_grade.'</div>';\n } else if ($quickgrade) {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'. $menu .'</div>';\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">'.$this->display_grade($auser->grade).'</div>';\n }\n\n } else {\n $teachermodified = '<div id=\"tt'.$auser->id.'\">&nbsp;</div>';\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\" class=\"'. $locked_overridden .'\">'.$final_grade->formatted_grade.'</div>';\n } else if ($quickgrade) {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'.$menu.'</div>';\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">'.$this->display_grade($auser->grade).'</div>';\n }\n }\n ///Print Comment\n if ($final_grade->locked or $final_grade->overridden) {\n $comment = '<div id=\"com'.$auser->id.'\">'.shorten_text(strip_tags($final_grade->str_feedback),15).'</div>';\n\n } else if ($quickgrade) {\n $comment = '<div id=\"com'.$auser->id.'\">'\n . '<textarea tabindex=\"'.$tabindex++.'\" name=\"submissioncomment['.$auser->id.']\" id=\"submissioncomment'\n . $auser->id.'\" rows=\"2\" cols=\"20\">'.($auser->submissioncomment).'</textarea></div>';\n } else {\n $comment = '<div id=\"com'.$auser->id.'\">'.shorten_text(strip_tags($auser->submissioncomment),15).'</div>';\n }\n } else {\n $studentmodified = '<div id=\"ts'.$auser->id.'\">&nbsp;</div>';\n $teachermodified = '<div id=\"tt'.$auser->id.'\">&nbsp;</div>';\n $status = '<div id=\"st'.$auser->id.'\">&nbsp;</div>';\n\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\">'.$final_grade->formatted_grade . '</div>';\n $hassubmission = true;\n } else if ($quickgrade) { // allow editing\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'.$menu.'</div>';\n $hassubmission = true;\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">-</div>';\n }\n\n if ($final_grade->locked or $final_grade->overridden) {\n $comment = '<div id=\"com'.$auser->id.'\">'.$final_grade->str_feedback.'</div>';\n } else if ($quickgrade) {\n $comment = '<div id=\"com'.$auser->id.'\">'\n . '<textarea tabindex=\"'.$tabindex++.'\" name=\"submissioncomment['.$auser->id.']\" id=\"submissioncomment'\n . $auser->id.'\" rows=\"2\" cols=\"20\">'.($auser->submissioncomment).'</textarea></div>';\n } else {\n $comment = '<div id=\"com'.$auser->id.'\">&nbsp;</div>';\n }\n }\n\n if (empty($auser->status)) { /// Confirm we have exclusively 0 or 1\n $auser->status = 0;\n } else {\n $auser->status = 1;\n }\n\n $buttontext = ($auser->status == 1) ? $strupdate : $strgrade;\n if ($final_grade->locked or $final_grade->overridden) {\n $buttontext = $strview;\n }\n\n ///No more buttons, we use popups ;-).\n $popup_url = '/mod/assignment/submissions.php?id='.$this->cm->id\n . '&amp;userid='.$auser->id.'&amp;mode=single'.'&amp;filter='.$filter.'&amp;offset='.$offset++;\n\n $button = $OUTPUT->action_link($popup_url, $buttontext);\n\n $status = '<div id=\"up'.$auser->id.'\" class=\"s'.$auser->status.'\">'.$button.'</div>';\n\n $finalgrade = '<span id=\"finalgrade_'.$auser->id.'\">'.$final_grade->str_grade.'</span>';\n\n $outcomes = '';\n\n if ($uses_outcomes) {\n\n foreach($grading_info->outcomes as $n=>$outcome) {\n $outcomes .= '<div class=\"outcome\"><label for=\"'. 'outcome_'.$n.'_'.$auser->id .'\">'.$outcome->name.'</label>';\n $options = make_grades_menu(-$outcome->scaleid);\n\n if ($outcome->grades[$auser->id]->locked or !$quickgrade) {\n $options[0] = get_string('nooutcome', 'grades');\n $outcomes .= ': <span id=\"outcome_'.$n.'_'.$auser->id.'\">'.$options[$outcome->grades[$auser->id]->grade].'</span>';\n } else {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $attributes['id'] = 'outcome_'.$n.'_'.$auser->id;\n $outcomes .= ' '.html_writer::select($options, 'outcome_'.$n.'['.$auser->id.']', $outcome->grades[$auser->id]->grade, array(0=>get_string('nooutcome', 'grades')), $attributes);\n }\n $outcomes .= '</div>';\n }\n }\n\n $userlink = '<a href=\"' . $CFG->wwwroot . '/user/view.php?id=' . $auser->id . '&amp;course=' . $course->id . '\">' . fullname($auser, has_capability('moodle/site:viewfullnames', $this->context)) . '</a>';\n $extradata = array();\n foreach ($extrafields as $field) {\n $extradata[] = $auser->{$field};\n }\n \n $check='';\n if ($selectAssig == NULL ) {\n $check=html_writer::checkbox('submission_selected',$selectAssig,false,'',array('disabled'=>'disabled'));\n\n } else {\n $check=html_writer::checkbox('submission_selected',$selectAssig,false,NULL,array('class'=>\"usercheckbox\"));\n }\n \n \n \n \n if ($auser->pub_status!=NULL) { \n \n $estado=get_string($auser->pub_status, 'sword');\n }\n else {\n $estado=get_string('nosend', 'sword');\n }\n \n $row = array_merge(array($estado),array($check),array($picture, $userlink), $extradata,\n array($grade, $comment, $studentmodified, $teachermodified,\n $status, $finalgrade));\n if ($uses_outcomes) {\n $row[] = $outcomes;\n }\n $table->add_data($row, $rowclass);\n }\n $currentposition++;\n }\n \n\t\techo html_writer::empty_tag('input',\n\t\t\t\t\t array('type' => 'hidden',\n\t\t\t\t\t\t 'name' => 'id',\n\t\t\t\t\t\t 'value' => $this->cm->id)\n\t\t\t );\n \n \n \n echo '<input type=\"button\" onclick=\"enviar('.$this->cm->id.' ,'. $this->cm->instance.' ,'. $this->cm_sword->id.')\" value=\"'.get_string('sendtorepo', 'sword').'\" />';\n \n \n \n \n \n echo '</form>';\n \n \n $table->print_html(); /// Print the whole table\n } else {\n if ($filter == self::FILTER_SUBMITTED) {\n echo html_writer::tag('div', get_string('nosubmisson', 'assignment'), array('class'=>'nosubmisson'));\n } else if ($filter == self::FILTER_REQUIRE_GRADING) {\n echo html_writer::tag('div', get_string('norequiregrading', 'assignment'), array('class'=>'norequiregrading'));\n }\n }\n }\n\n /// Print quickgrade form around the table\n if ($quickgrade && $table->started_output && !empty($users)){\n $mailinfopref = false;\n if (get_user_preferences('assignment_mailinfo', 1)) {\n $mailinfopref = true;\n }\n $emailnotification = html_writer::checkbox('mailinfo', 1, $mailinfopref, get_string('enablenotification','assignment'));\n\n $emailnotification .= $OUTPUT->help_icon('enablenotification', 'assignment');\n echo html_writer::tag('div', $emailnotification, array('class'=>'emailnotification'));\n\n $savefeedback = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'fastg', 'value'=>get_string('saveallfeedback', 'assignment')));\n echo html_writer::tag('div', $savefeedback, array('class'=>'fastgbutton'));\n\n echo html_writer::end_tag('form');\n } else if ($quickgrade) {\n echo html_writer::end_tag('form');\n }\n\n echo '</div>';\n echo '<div class=\"modal\"><!-- Place at bottom of page --></div>';\n\n echo $OUTPUT->footer();\n }", "function &getRevisionsByReviewRound($submissionId, $stageId, $round, $fileStage = null,\n\t\t\t$uploaderUserId = null, $uploaderUserGroupId = null) {\n\t\tif (!($stageId && $round)) {\n\t\t\t$nullVar = null;\n\t\t\treturn $nullVar;\n\t\t}\n\t\treturn $this->_getInternally($submissionId, $fileStage, null, null, null, null, $stageId, $uploaderUserId, $uploaderUserGroupId, $round);\n\t}", "public function submissions();", "function &getReviewerIdsBySubmissionId($submissionId, $round = null, $stageId = null) {\n\t\t$query = 'SELECT r.reviewer_id\n\t\t\t\tFROM\treview_assignments r\n\t\t\t\tWHERE r.submission_id = ?';\n\n\t\t$queryParams[] = (int) $submissionId;\n\n\t\tif ($round != null) {\n\t\t\t$query .= ' AND r.round = ?';\n\t\t\t$queryParams[] = (int) $round;\n\t\t}\n\n\t\tif ($stageId != null) {\n\t\t\t$query .= ' AND r.stage_id = ?';\n\t\t\t$queryParams[] = (int) $stageId;\n\t\t}\n\n\t\t$result =& $this->retrieve($query, $queryParams);\n\n\t\t$reviewAssignments = array();\n\t\twhile (!$result->EOF) {\n\t\t\t$row = $result->GetRowAssoc(false);\n\t\t\t$reviewAssignments[] = $row['reviewer_id'];\n\t\t\t$result->MoveNext();\n\t\t}\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $reviewAssignments;\n\t}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public function getJobDetails($user_id){\n \n $results = $this->findBy(array('userId'=>$user_id), array('endDate' => 'DESC'));\n $response =array();\n $currentWorking = array();\n foreach($results as $result)\n {\n if($result->getCurrentlyWorking()){\n $currentWorking['id'] = $result->getId();\n $currentWorking['user_id'] = $result->getUserId();\n $currentWorking['company'] = $result->getCompanyName();\n $currentWorking['title'] = $result->getTitle();\n $currentWorking['location'] = $result->getLocation();\n $currentWorking['start_date'] = $result->getStartDate();\n $currentWorking['end_date'] = new \\DateTime(\"now\");\n $currentWorking['currently_working'] = (int) $result->getCurrentlyWorking();\n $currentWorking['headline'] = $result->getHeadline();\n $currentWorking['description'] = $result->getDescription();\n $currentWorking['updated_at'] = $result->getUpdatedAt();\n $currentWorking['visibility_type'] = (int) $result->getVisibility();\n }else{\n $jobDetail = array();\n $jobDetail['id'] = $result->getId();\n $jobDetail['user_id'] = $result->getUserId();\n $jobDetail['company'] = $result->getCompanyName();\n $jobDetail['title'] = $result->getTitle();\n $jobDetail['location'] = $result->getLocation();\n $jobDetail['start_date'] = $result->getStartDate();\n $jobDetail['end_date'] = $result->getEndDate();\n $jobDetail['currently_working'] = (int) $result->getCurrentlyWorking();\n $jobDetail['headline'] = $result->getHeadline();\n $jobDetail['description'] = $result->getDescription();\n $jobDetail['updated_at'] = $result->getUpdatedAt();\n $jobDetail['visibility_type'] = (int) $result->getVisibility();\n\n $response[] = $jobDetail;\n }\n }\n \n if(!empty($currentWorking)){\n array_unshift($response, $currentWorking);\n }\n \n return $response;\n\n }", "function get_surveys_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND created_by = '$user_id';\";\r\n\r\n $surveys_data = array();\r\n $surveys = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "private function get_submission_details($idtype = \"moodle\", $turnitintooltwoassignment = \"\") {\n global $DB, $CFG;\n\n if ($idtype == \"moodle\") {\n $condition = array(\"id\" => $this->id);\n } else {\n $condition = array(\"submission_objectid\" => $this->submission_objectid);\n }\n\n if ($submission = $DB->get_record('turnitintooltwo_submissions',\n $condition, '*', IGNORE_MULTIPLE)) {\n if (empty($turnitintooltwoassignment)) {\n $turnitintooltwoassignment = new turnitintooltwo_assignment($submission->turnitintooltwoid);\n $this->turnitintooltwoid = $turnitintooltwoassignment->turnitintooltwo->id;\n }\n\n if (count($turnitintooltwoassignment->get_parts()) > 1) {\n if ($submission->userid != 0) {\n $usersubmissions = $turnitintooltwoassignment->get_user_submissions($submission->userid,\n $submission->turnitintooltwoid);\n $useroverallgrade = $turnitintooltwoassignment->get_overall_grade($usersubmissions);\n\n if ($turnitintooltwoassignment->turnitintooltwo->grade == 0 OR $useroverallgrade === '--') {\n $this->overallgrade = '--';\n } else if ($turnitintooltwoassignment->turnitintooltwo->grade < 0) { // Scale.\n $scale = $DB->get_record('scale', array('id' => $turnitintooltwoassignment->turnitintooltwo->grade * -1));\n $scalearray = explode(\",\", $scale->scale);\n // Array is zero indexed, Scale positions are from 1 upward.\n $index = $useroverallgrade - 1;\n $this->overallgrade = $scalearray[$index];\n } else {\n $usergrade = round($useroverallgrade / $turnitintooltwoassignment->turnitintooltwo->grade * 100, 1);\n $this->overallgrade = $usergrade.'%';\n }\n } else {\n $this->overallgrade = '--';\n }\n }\n\n foreach ($submission as $field => $value) {\n $this->$field = $value;\n }\n\n if ($submission->userid > 0) {\n if ($CFG->branch >= 311) {\n $allnamefields = implode(', ', \\core_user\\fields::get_name_fields());\n } else {\n $allnamefields = implode(', ', get_all_user_name_fields());\n }\n\n $user = $DB->get_record('user', array('id' => $submission->userid), 'id, ' . $allnamefields);\n $this->firstname = $user->firstname;\n $this->lastname = $user->lastname;\n $this->fullname = fullname($user);\n $this->nmoodle = 0;\n } else {\n $this->firstname = $submission->submission_nmfirstname;\n $this->lastname = $submission->submission_nmlastname;\n\n $tmpuser = new stdClass();\n $tmpuser->firstname = $submission->submission_nmfirstname;\n $tmpuser->lastname = $submission->submission_nmlastname;\n $this->fullname = fullname($tmpuser);\n\n $this->nmoodle = 1;\n }\n\n } else if ($idtype == \"moodle\") {\n turnitintooltwo_print_error('submissiongeterror', 'turnitintooltwo', null, null, __FILE__, __LINE__);\n }\n }", "public function is_progress_by_hashes($survey_id, $submission_hashes)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where_in('hash', $submission_hashes)\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function submissions()\n {\n return $this->hasMany('App\\Modules\\Models\\Submission');\n }", "abstract public function getAssignments($userId);", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "function get_user_study_n_collection_requests($survey_id,$user_id,$request_status=NULL)\n\t{\n\t\t$requests=array();\n\t\t\n\t\t//collections that study belong to with DA access enabled\n\t\t$collections=$this->get_study_collections($survey_id);\n\t\t\n\t\tif($collections)\n\t\t{\n\t\t\t//find requests by collection\n\t\t\tforeach($collections as $collection)\n\t\t\t{\n\t\t\t\t$result=$this->get_user_collection_requests($user_id,$collection['repositoryid'],$request_status);\n\t\t\t\t\n\t\t\t\tif($result)\n\t\t\t\t{\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$requests[]=$row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//find requests by study\n\t\t$result=$this->get_user_study_requests($survey_id,$user_id);\n\t\t\n\t\tif ($result)\n\t\t{\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$requests[]=$row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $requests;\n\t}", "function incompleteSubmissionExists($monographId, $userId, $pressId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tsubmission_progress\n\t\t\tFROM\tmonographs\n\t\t\tWHERE\tmonograph_id = ? AND\n\t\t\t\tuser_id = ? AND\n\t\t\t\tpress_id = ? AND\n\t\t\t\tdate_submitted IS NULL',\n\t\t\tarray($monographId, $userId, $pressId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}" ]
[ "0.58979917", "0.5864403", "0.56491774", "0.5584163", "0.5540704", "0.5500674", "0.54719305", "0.5454758", "0.5414054", "0.53811324", "0.5347915", "0.5323728", "0.52780086", "0.52272236", "0.5170256", "0.51539874", "0.5069158", "0.50341356", "0.49852288", "0.49704343", "0.49376476", "0.4922154", "0.49219683", "0.48684505", "0.48546648", "0.48175475", "0.481444", "0.4798427", "0.4779008", "0.47745308", "0.47691786", "0.47347674", "0.47164792", "0.47043195", "0.46976447", "0.46976447", "0.46976447", "0.46976447", "0.46923622", "0.4683469", "0.46594462", "0.46560076", "0.46522027", "0.46410233", "0.46297467", "0.46285662", "0.46266785", "0.46213564", "0.46160743", "0.46118847", "0.4605988", "0.45948058", "0.45840243", "0.45788524", "0.45702133", "0.45667312", "0.45645097", "0.45644218", "0.45611754", "0.45495313", "0.45409536", "0.45289886", "0.45244226", "0.4520141", "0.45171866", "0.45130014", "0.45119742", "0.4502526", "0.44983402", "0.44974697", "0.4496363", "0.449059", "0.44749206", "0.4468501", "0.44640085", "0.44627914", "0.44611773", "0.44584563", "0.4457573", "0.44497913", "0.44392997", "0.4433479", "0.44333413", "0.4432259", "0.44253907", "0.44242", "0.44182608", "0.4416821", "0.4411625", "0.43978378", "0.43916747", "0.43892395", "0.4389195", "0.43720275", "0.43707404", "0.4369249", "0.436596", "0.43555492", "0.4352723", "0.43508145" ]
0.6154837
0
Get all surveys completed by the current user
public function user_submissions_complete($submission_hahses) { // If user submissions have not yet been gathered if (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); } // If we have some completed surveys return an array of their hashes return isset(self::$user_submissions['complete']) ? self::$user_submissions['complete'] : array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "function get_surveys_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND created_by = '$user_id';\";\r\n\r\n $surveys_data = array();\r\n $surveys = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function getSurveys() {\n\n \n $this->db->select('sur_id, sur_title');\n $this->db->from('msv_surveys');\n \n $query = $this->db->get();\n \n $res = $query->result();\n \n return $res;\n }", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "public function completed_users()\n {\n return $this->belongsToMany(\n User::class,\n CompletedSentence::class,\n 'sentence_id',\n 'user_id',\n 'id',\n 'id'\n );\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "public function getSurveysWithUser(User $user,$isParticipant){\n if($isParticipant){\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ParticipantDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n }\n else{\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ResearcherDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n \n }\n $cursor = $query->getQuery()->execute();\n $projectIds = array();\n foreach($cursor as $participant){\n array_push($projectIds,new \\MongoId($participant->project->id));\n }\n \n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\SurveyDocument')\n ->field('project.$id')->in($projectIds);\n $cursor = $query->getQuery()->execute();\n $surveys = array();\n foreach($cursor as $survey){\n array_push($surveys,$survey);\n }\n return $surveys;\n }", "public function listSurvey() {\n $surveys = \\App\\Survey::where('deleted', '=', 0)->get();\n return view('User/listSurvey', ['surveys' => $surveys]);\n }", "public function completedTasks()\n\t{\n\t\treturn $this->belongsToMany('TGLD\\Tasks\\Task', 'user_completed_task', 'user_id', 'task_id')\n\t\t\t->with('project')\n\t\t\t->orderBy('priority', 'ASC')\n\t\t\t->latest();\n\t}", "public function userCompleteTickets()\n {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'user_id')->whereNotNull('completed_at');\n }", "public function get_completed_survey_submissions($id, $completed_since = NULL)\n\t{\n\t\t$data = array();\n\n\t\t$this->db\n\t\t\t->order_by('completed', 'ASC')\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('survey_id', $id);\n\n\t\t// If completed_since is set, only grab completed submissions AFTER that date\n\t\tif ($completed_since != NULL)\n\t\t{\n\t\t\t$this->db->where('completed >=', $completed_since);\n\t\t}\n\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ $row->id ] = array(\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function get_available_by_time_surveys() {\r\n // set connection var\r\n global $db;\r\n\r\n // get current time\r\n $time = date(\"Y-m-d H:i:s\");\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND status = '1' AND available_from < '$time' AND available_due > '$time';\";\r\n $surveys_data = array();\r\n $surveys = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "function getUserCompletedCourses($userEmail){\n\n\t\tglobal $conn;\n\t\t$query = \"SELECT Course.id AS courseId, Course.name AS courseName, Category.name AS courseCategory \n\t\t\t\tFROM Course INNER JOIN Category ON Course.CategoryId=Category.id\n\t\t\t\tWHERE Course.id IN (SELECT CourseLesson.idCourse \n\t\t\t\t\t\t\t\t\tFROM CourseLesson INNER JOIN UserLesson ON CourseLesson.idLesson=UserLesson.idLesson\n\t\t\t\t\t\t\t\t\tWHERE UserLesson.emailUser='\" . $userEmail . \"' GROUP BY CourseLesson.idCourse HAVING MIN(UserLesson.lessonCompleted) = 1)\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\n\t}", "function &_getGlobalSurveyData($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\t$result = array();\n\t\tif (($survey->getTitle()) and ($survey->author) and (count($survey->questions)))\n\t\t{\n\t\t\t$result[\"complete\"] = true;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\t$result[\"complete\"] = false;\n\t\t}\n\t\t$result[\"evaluation_access\"] = $survey->getEvaluationAccess();\n\t\treturn $result;\n\t}", "public function getResponses()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t$query = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tdatetime\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[] = $row;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "public function getAnsweredQuestions($userId, $surveyId) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.id' => $surveyId, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "function findCompletedOrdersByUser(User $user);", "public function myQuests(Request $request)\n {\n return Auth::user()->quests;\n }", "public function addCompletedCourses(){\n\t\t$courses = Courses::getOneProgramCoursesList();\n\t\treturn view('courses.completedCourses', compact('courses'));\n\t}", "public function index()\n\t{\n\t\t//User based filtering\n\t\t$user = $this->apiKey->guestUser;\n\t\t$survey_ids_taken = TrackSurvey::where('users_id', $user->id)->groupBy('surveys_id')->lists('surveys_id');\n\n\t\t//Question count\n\t\t// return $survey_ids_taken;\n\t\t\n\t\ttry {\n\t\t\t//inserting custom key-val\n\t\t\t$surveys = Survey::all();\n\t\t\tforeach($surveys as $survey){\n\t\t\t\t$survey->is_taken = in_array($survey->id, $survey_ids_taken) ? '1':'0';\n\t\t\t\t$survey->mcq_count = Question::where('surveys_id', $survey->id)->where('type', 'mcq')->count();\n\t\t\t\t$survey->wr_count = Question::where('surveys_id', $survey->id)->where('type', 'written')->count();\n\t\t\t\t$survey->taken_by = TrackSurvey::where('surveys_id', $survey->id)->groupBy('users_id')->lists('users_id');\t\t\t\n\t\t\t}\n\n\t\t\t// return $surveys;\n\t\t\treturn Fractal::collection($surveys, new SurveyTransformer);\n\t\t\n\t\t} catch (Exception $e) {\n \n \treturn $this->response->errorGone();\n\t\t\t\n\t\t}\n\t}", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "function &getUserSpecificResults($finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$evaluation = array();\n\t\t$questions =& $this->getSurveyQuestions();\n\t\tforeach ($questions as $question_id => $question_data)\n\t\t{\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($question_id);\n\t\t\t$data =& $question->getUserAnswers($this->getSurveyId(), $finished_ids);\n\t\t\t$evaluation[$question_id] = $data;\n\t\t}\n\t\treturn $evaluation;\n\t}", "function get_voted_surveys_by_user($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for user\r\n $sql = \"SELECT survey_id\r\n FROM votes\r\n WHERE is_active='1' AND user_id='$user_id'\";\r\n\r\n $votes_data = array();\r\n $votes_survey = array();\r\n $votes_survey_unique = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes_survey[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n $votes_survey_unique = array_unique($votes_survey);\r\n\r\n return $votes_survey_unique;\r\n}", "public function filledSurveys(){\n return $this->hasMany(FilledSurvey::class);\n }", "public function getCompletedGoals($userid)\n {\n $sql = \"SELECT count(patient_goal_id) as completedgoals FROM patient_goal WHERE status = 2 AND created_by = {$userid}\";\n\n $completedgoals = $this->fetch_all_rows($this->execute_query($sql));\n\n return $completedgoals[0]['completedgoals'];\n }", "public function completed()\n {\n $allRows = Job::completed()->notInvoiced()->latest()->get();\n $rows = Job::completed()->notInvoiced()->latest()->paginate(10);\n\n return view('admin.jobs.index', [\n 'rows' => $rows,\n 'title' => 'Completed, Not Invoiced',\n 'values' => $this->totalValue($allRows)\n ]\n );\n }", "function get_survey_requests_by_user($user_id=NULL,$survey_id=NULL)\n\t{\n\t\t\t$this->db->select('lic_requests.id,expiry,status');\n\t\t\t$this->db->where('userid',$user_id);\n\t\t\t$this->db->where('lic_requests.surveyid',$survey_id);\n\t\t\t$this->db->where('lic_requests.status !=','DENIED');\n\t\t\t$this->db->join('lic_file_downloads', 'lic_requests.id = lic_file_downloads.requestid','left');\n\t\t\t$query=$this->db->get(\"lic_requests\");\n\t\t\t//echo mktime(0,0,0,9,9,2010);\n\t\t\tif (!$query)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->result_array();\n\t}", "function i4_get_completed_units($course_id, $user_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $completed_status = \"complete\";\n\n //Here we grab the unit info for units that are completed for the users course.\n $SQL = $wpdb->prepare(\"SELECT * FROM $wpcwdb->units_meta LEFT JOIN $wpcwdb->user_progress\n ON $wpcwdb->units_meta.unit_id=$wpcwdb->user_progress.unit_id\n WHERE parent_course_id = %d AND unit_completed_status = %s AND user_id = %d\", $course_id, $completed_status, $user_id);\n\n //Store the Completed units Array\n $completed_units = $wpdb->get_results($SQL);\n\n $completed_unit_ids = array();\n\n //set the counter\n $i = 0;\n\n //Store the Unit ID's into the completed unit id's array\n foreach ($completed_units as $completed_unit) {\n $completed_unit_ids[$i] = $completed_unit->unit_id;\n $i++;\n }\n\n return $completed_unit_ids;\n }", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function get_all_completed_checklist_data() {\n\n $completed_inspect_data = array();\n\n $query = db_select('checklist_inspections', 'c')\n ->fields('c', array('order_num','category','unit_id','nid', 'admin_notes', 'admin_approver',\n 'approved','inspected_by','repair_archive','date_submitted','follow_up_alert','comments'))\n ->condition('approved', 'approved')\n ->condition('completed', 'completed');\n $results = $query->execute();\n\n foreach ($results as $val) {\n $completed_inspect_data[] = (array) $val;\n }\n return $completed_inspect_data;\n }", "private function json_allSurveys()\n {\n $query = \"SELECT * FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\n $params = [];\n\n $nextpage = null;\n\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n\n $res['status'] = 200;\n $res['message'] = \"ok\";\n $res['next_page'] = $nextpage;\n return json_encode($res);\n }", "public function get_survey_list($session_key, $suser='')\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t $current_user = Yii::app()->session['user'];\n\t\t if( Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1 and $suser !='')\n\t\t\t\t$current_user = $suser;\n\n\t\t $aUserData = User::model()->findByAttributes(array('users_name' => $current_user));\t\t \n\t\t if (!isset($aUserData))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid user', 38);\t\t \n\t \t \t\t \n\t\t $user_surveys = Survey::model()->findAllByAttributes(array(\"owner_id\"=>$aUserData->attributes['uid'])); \t\t \n\t\t if(count($user_surveys)==0)\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No Surveys found', 30);\n\t\t\t\n\t\t\tforeach ($user_surveys as $asurvey)\n\t\t\t\t{\n\t\t\t\t$asurvey_ls = Surveys_languagesettings::model()->findByAttributes(array('surveyls_survey_id' => $asurvey->primaryKey, 'surveyls_language' => $asurvey->language));\n\t\t\t\tif (!isset($asurvey_ls))\n\t\t\t\t\t$asurvey_title = '';\n\t\t\t\telse\n\t\t\t\t\t$asurvey_title = $asurvey_ls->attributes['surveyls_title'];\n\t\t\t\t$aData[]= array('sid'=>$asurvey->primaryKey,'surveyls_title'=>$asurvey_title,'startdate'=>$asurvey->attributes['startdate'],'expires'=>$asurvey->attributes['expires'],'active'=>$asurvey->attributes['active']);\n\t\t\t\t}\n\t\t\treturn $aData;\n }\t\t\t\t\n\t}", "function get_Surveys(){\r\n $sql = $this->db->prepare(\"CALL SPgetSurvey2(:userid,:chamberID,:businessID);\");\r\n $result = $sql->execute(array(\r\n \"userid\" => $_SESSION['userid'],\r\n \"chamberID\" => $_SESSION['chamber'],\r\n \"businessID\" => $_SESSION['businessid'],\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false; // was array(); HL 10/10/17\r\n }\r\n }", "public function completedList()\n {\n $result = Registration::where(['status' => 'completed'])->paginate(5);\n return view('Completed/index', compact(['result']));\n }", "public function userTickets($complete = false)\n {\n if ($complete) {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'user_id')->whereNotNull('completed_at');\n } else {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'user_id')->whereNull('completed_at');\n }\n }", "public function __invoke(): Collection|array\n {\n return Survey::all();\n }", "public function getResponsesForUser($user_id)\n {\n return Proposal::where('responder_id', $user_id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "public function surveys(){\n return $this->belongsToMany('App\\surveys');\n }", "public function index()\n { \n $id = Sentinel::getUser()->id;\n \n\n if(Sentinel::getUser()->inRole('admin')){\n $srvy = DB::table('surveys')->get();\n }else{\n $srvy = DB::table('surveys')->where('creator_id', '=', $id)->get();\n }\n return view('pages.survey',compact('srvy'));\n }", "public function getUserFinishedCompanyTasks(User $user): Collection {\n return CompanyTask::where('company_tasks.status', CompanyTask::STATUS_FINISHED)\n ->join('company_task_user_applies', 'company_tasks.id', '=', 'company_task_user_applies.company_task_id')\n ->where('company_task_user_applies.user_id', $user->id)\n ->where('company_task_user_applies.status', CompanyTaskUserApply::STATUS_ASSIGNED)\n ->orderBy('company_task_user_applies.id' ,'asc')\n ->limit(3)\n ->get();\n }", "public static function navigation($survey_id, $user_id)\n {\n $survey = Survey::findOrFail($survey_id);\n $user = User::findOrFail($user_id);\n $surveyQuestions = self::questions($survey->blueprint_id);\n $questions = array();\n foreach ($surveyQuestions as $surveyQuestion) {\n $questions[] = array(\n 'order' => $surveyQuestion->order,\n 'key' => $surveyQuestion->key,\n 'answered' => Answer::isAnswered($survey_id, $user_id, $surveyQuestion->id),\n 'link' => Survey::createKey(array( $survey->key , $user->key , $surveyQuestion->key ))\n );\n }\n return $questions;\n }", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "function getChallengesCompleted()\n\t{\n\t $current = $this->DB->database_select('users', array('challenges_completed'), array('uid' => session_get('uid')), 1);\n\t $current = $current['challenges_completed'];\n\t if(!empty($current))\n\t {\n\t\t return $current;\n\t }\n\t return false; //No challenges completed\n\t}", "public function responses()\n {\n return $this->hasMany(SurveyResponse::class, 'visual_question_answer_id');\n }", "public function get_completed_interstitials() {\n\t\treturn $this->data['completed'];\n\t}", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "public function index()\n {\n $surveys = Survey::getAllByOwner(Auth::user()->id);\n return view('backend.surveys.index', compact('surveys'));\n }", "public function index()\n {\n $pulse_surveys = PulseSurvey::currentReport()\n ->with(\n 'pulse_survey_results',\n 'pulse_survey_results.observer',\n 'action_plan',\n 'action_plan.behaviors',\n 'action_plan.behaviors.behavior'\n )\n ->orderByDesc('cycle')\n ->get();\n $application_state = ApplicationState::currentUser()->where('application_key', 'pulse_survey')->get()->first();\n $action_plans = ActionPlan::currentReport()->get();\n $observers = Observer::currentReport()->currentUser()->enabled()->get();\n $observer_types = ObserverTypes::optionsWithLabels();\n\n $data = json_encode(compact('pulse_surveys', 'application_state', 'action_plans', 'observers', 'observer_types'));\n\n return view('pulse-surveys.index', compact('data'));\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "function get_request_approved_surveys($request_id)\n\t{\n\t\t$this->db->select('resources.survey_id');\n\t\t$this->db->join('resources', 'lic_file_downloads.fileid= resources.resource_id');\n\t\t$this->db->where('lic_file_downloads.requestid',$request_id);\n\t\t$result=$this->db->get('lic_file_downloads')->result_array();\n\t\t\n\t\tif (!$result)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$output=array();\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$output[]=$row['survey_id'];\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "function get_user_study_n_collection_requests($survey_id,$user_id,$request_status=NULL)\n\t{\n\t\t$requests=array();\n\t\t\n\t\t//collections that study belong to with DA access enabled\n\t\t$collections=$this->get_study_collections($survey_id);\n\t\t\n\t\tif($collections)\n\t\t{\n\t\t\t//find requests by collection\n\t\t\tforeach($collections as $collection)\n\t\t\t{\n\t\t\t\t$result=$this->get_user_collection_requests($user_id,$collection['repositoryid'],$request_status);\n\t\t\t\t\n\t\t\t\tif($result)\n\t\t\t\t{\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$requests[]=$row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//find requests by study\n\t\t$result=$this->get_user_study_requests($survey_id,$user_id);\n\t\t\n\t\tif ($result)\n\t\t{\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$requests[]=$row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $requests;\n\t}", "public static function getChallenges($session) \n {\n \n KorisnikModel::updateWrapper($session->get('user')->summonerName);\n \n $uQModel = new UserQuestModel();\n $qModel = new QuestModel();\n $uQ = $uQModel->where('summonerName', $session->get('user')->summonerName)->findAll();\n $poroUser = count($uQModel->where('summonerName', $session->get('user')->summonerName)->where('completed', 1)->findAll());\n $poroTotal = count($qModel->findAll());\n\n $data = [\n 'poroUser' => $poroUser,\n 'poroTotal' => $poroTotal,\n 'quests' => []\n ];\n \n foreach ($uQ as $userQuest) {\n $quest = $qModel->find($userQuest->questId);\n $dataQuest = [\n 'id' => $userQuest->questId,\n 'title' => $quest->title,\n 'description' => $quest->description,\n 'image' => $quest->image,\n 'completed' => $userQuest->completed,\n 'attributes' => QuestAttributeModel::getAttributes($quest->questId)\n ];\n \n \n $questRequired = null;\n $preReqSatisfied = true;\n foreach($dataQuest['attributes'] as $atr){\n if($atr->attributeKey == 'Prerequisite Id'){\n $questRequired = intval($atr->attributeValue);\n $preReQuest = $uQModel->where('questId', $questRequired)->where('summonerName',$session->get('user')->summonerName)->find();\n if($preReQuest[0]->completed == 0){\n $preReqSatisfied = false;\n break;\n } \n } \n }\n \n if($preReqSatisfied == false){ \n continue;\n }\n // $dataQuest['attributes'];\n array_push($data['quests'], $dataQuest);\n }\n return $data;\n }", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function getAll()\n {\n return $this->_answers;\n }", "public function index()\n {\n $semesters = MorssSemester::nowSurvey()->get();\n\n $user = User::where('id', Auth::user()->id)->with('moraleSurveys')->first();\n\n return view('moralesurvey.survey.index', compact('semesters', 'user'));\n // return $user->moraleSurveys;\n }", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function get_user_study_requests($survey_id, $user_id,$request_status=NULL)\n\t{\n\t\t$this->db->select('id,request_type,status');\n\t\t$this->db->where('userid',$user_id);\n\t\t$this->db->where('surveyid',$survey_id);\n\t\tif($request_status)\n\t\t{\n\t\t\t$this->db->where_in('status',$request_status);\n\t\t}\n\t\treturn $this->db->get('lic_requests')->result_array();\n\t}", "public function avaliable_tasks()\n {\n return DB::table('tasks')\n ->leftJoin('subjects', 'tasks.subject_id', '=', 'subjects.id')\n ->leftJoin('usersubjects', 'subjects.id', '=', 'usersubjects.subject_id')\n ->leftJoin('users', 'usersubjects.user_id', '=', 'users.id')\n ->where('users.id','=',$this->id)\n ->where('tasks.isactive','=',true)\n ->select('subjects.name', 'users.id', 'tasks.*')\n ->get();\n }", "public static function complete() {\n return static::where('done', 1)->get();\n }", "function get_SurveyQuestions($surveyID){\r\n $sql = $this->db->prepare(\"SELECT * FROM SURVEYQUESTION WHERE SurveyID = :surveyid;\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function getCumulatedResultsDetails($survey_id, $counter, $finished_ids)\n\t{\n\t\tif (count($this->cumulated) == 0)\n\t\t{\n\t\t\tif(!$finished_ids)\n\t\t\t{\n\t\t\t\tinclude_once \"./Modules/Survey/classes/class.ilObjSurvey.php\";\t\t\t\n\t\t\t\t$nr_of_users = ilObjSurvey::_getNrOfParticipants($survey_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t\t}\n\t\t\t$this->cumulated =& $this->object->getCumulatedResults($survey_id, $nr_of_users, $finished_ids);\n\t\t}\n\t\t\n\t\t$output = \"\";\n\t\tinclude_once \"./Services/UICore/classes/class.ilTemplate.php\";\n\t\t$template = new ilTemplate(\"tpl.il_svy_svy_cumulated_results_detail.html\", TRUE, TRUE, \"Modules/Survey\");\n\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question\"));\n\t\t$questiontext = $this->object->getQuestiontext();\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->object->prepareTextareaOutput($questiontext, TRUE));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question_type\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->lng->txt($this->getQuestionType()));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_answered\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_ANSWERED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_skipped\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_SKIPPED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t/*\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode_nr_of_selections\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE_NR_OF_SELECTIONS\"]);\n\t\t$template->parseCurrentBlock();\n\t\t*/\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"categories\"));\n\t\t$categories = \"\";\n\t\tif (is_array($this->cumulated[\"variables\"]))\n\t\t{\n\t\t\tforeach ($this->cumulated[\"variables\"] as $key => $value)\n\t\t\t{\n\t\t\t\t$categories .= \"<li>\" . $value[\"title\"] . \": n=\" . $value[\"selected\"] . \n\t\t\t\t\t\" (\" . sprintf(\"%.2f\", 100*$value[\"percentage\"]) . \"%)</li>\";\n\t\t\t}\n\t\t}\n\t\t$categories = \"<ol>$categories</ol>\";\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $categories);\n\t\t$template->parseCurrentBlock();\n\t\t\n\t\t// add text answers to detailed results\n\t\tif (is_array($this->cumulated[\"textanswers\"]))\n\t\t{\n\t\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"freetext_answers\"));\t\n\t\t\t$html = \"\";\t\t\n\t\t\tforeach ($this->cumulated[\"textanswers\"] as $key => $answers)\n\t\t\t{\n\t\t\t\t$html .= $this->cumulated[\"variables\"][$key][\"title\"] .\"\\n\";\n\t\t\t\t$html .= \"<ul>\\n\";\n\t\t\t\tforeach ($answers as $answer)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<li>\" . preg_replace(\"/\\n/\", \"<br>\\n\", $answer) . \"</li>\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= \"</ul>\\n\";\n\t\t\t}\n\t\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $html);\n\t\t\t$template->parseCurrentBlock();\n\t\t}\t\t\t\n\t\t\n\t\t// chart \n\t\t$template->setCurrentBlock(\"detail_row\");\t\t\t\t\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"chart\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->renderChart(\"svy_ch_\".$this->object->getId(), $this->cumulated[\"variables\"]));\n\t\t$template->parseCurrentBlock();\n\t\t\t\t\n\t\t$template->setVariable(\"QUESTION_TITLE\", \"$counter. \".$this->object->getTitle());\n\t\treturn $template->get();\n\t}", "public function createOfficialsSurvey()\n {\n return $this->mailer->createOfficialsSurvey($this->data);\n }", "function get_survey_ids_by_user($email) {\n\t$mysql = new mysqli ( 'localhost', 'root', 'stu.fudan2013', 'EasyPolling' ) or die ( 'Cannot connect to Database' );\n\t$query = \"SELECT * from Poll where Creator='\" . $email . \"'\";\n\t$result = mysqli_query ( $mysql, $query );\n\t\n\t$returned = array ();\n\twhile ( $row = mysqli_fetch_array ( $result ) ) {\n\t\t$id = $row ['ID'];\n\t\t$survey = get_survey_by_id ( $id );\n\t\tarray_push ( $returned, array (\n\t\t\t\t'id' => $id,\n\t\t\t\t'survey' => $survey \n\t\t) );\n\t}\n\tmysqli_close ( $mysql );\n\t\n\treturn $returned;\n}", "public function getAllCompletedMentorshipSessions() {\n return $this->mentorshipSessionStorage->getAllCompletedMentorshipSessions();\n }", "public function getAllCompletedMentorshipSessions() {\n return $this->mentorshipSessionStorage->getAllCompletedMentorshipSessions();\n }", "public function getQuestionsAnswered($user_id)\n\t{\n\t\t$list = Yii::app()->db->createCommand(\n\t\t\t'select a.user_answer,DATE_FORMAT(a.date_created,\\'%m/%d/%Y\\') as date_created,\n\t\t\tq.content,qc.content as choice,c.display_name as category\n\t\t\tfrom answer a join question q on q.question_id=a.question_id \n\t\t\tleft join question_choice qc on a.question_choice_id = qc.question_choice_id \n\t\t\tleft join category_question cg on cg.question_id = a.question_id \n\t\t\tleft join category c on cg.category_id=c.category_id and a.user_id= :user_id\n\t\t\tand a.is_active = 1')->\n\t\t\tbindValues(array(\n\t\t\t\t':user_id'=>Yii::app()->user->id,\n\t\t\t))->queryAll();\n\t\t\treturn $list;\n\t}", "function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }", "function deleteAllUserData()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$active_array = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($active_array, $row[\"finished_id\"]);\n\t\t}\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\tforeach ($active_array as $active_fi)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_answer WHERE active_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($active_fi)\n\t\t\t);\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_times WHERE finished_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($active_fi)\n\t\t\t);\n\t\t}\n\t}", "public function getCourseHistory()\n {\n $user = $this->getAuthenticatedUser();\n $payments = $user->payments()->get();\n\n $all_purchases = [];\n\n foreach ( $payments as $payment ) {\n\n $purchases = $payment->purchases;\n\n foreach ( $purchases as $purchase ) {\n $all_purchases[] = collect($purchase->course, $purchase->course->school);\n }\n\n }\n\n return $this->respond([\n 'data' => $all_purchases,\n ]);\n }", "public function agentCompleteTickets()\n {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'agent_id')->whereNotNull('completed_at');\n }", "public function getManualJournals(){\n return [];\n }", "public static function get_all_awaiting_winners() {\n global $wpdb;\n $winners_table = $wpdb->prefix.\"wauc_winners\";\n return $wpdb->get_results(\"SELECT * FROM $winners_table WHERE is_selected = 1 AND is_winner = 0\");\n }", "public function getCompletedGoals() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/app/completed_goal_list.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "public function getSalespersonAllQuestions() {\n return $this->_salespersonDatasource->getSalespersonAllQuestions();\n }", "static function getAllSurveys($id = null, $cfg) {\n // In the event the survey project is longitudinal, we need to use the event ID\n $survey_event_id = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? NULL : StaticUtils::getEventIdFromName($cfg['SURVEY_PID'], $cfg['SURVEY_EVENT_ARM_NAME']);\n $survey_event_prefix = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? \"\" : \"[\" . $cfg['SURVEY_EVENT_ARM_NAME'] . \"]\";\n\n if ($id == null) {\n $filter = null; //get all ids\n } else {\n $filter = $survey_event_prefix . \"[{$cfg['SURVEY_FK_FIELD']}]='$id'\";\n }\n\n $get_data = array(\n $cfg['SURVEY_PK_FIELD'],\n $cfg['SURVEY_FK_FIELD'],\n $cfg['SURVEY_TIMESTAMP_FIELD'],\n $cfg['SURVEY_DATE_FIELD'],\n $cfg['SURVEY_DAY_NUMBER_FIELD'],\n $cfg['SURVEY_FORM_NAME'] . '_complete'\n ) ;\n\n $q = REDCap::getData(\n $cfg['SURVEY_PID'],\n 'json',\n NULL,\n $get_data,\n $survey_event_id,\n NULL,FALSE,FALSE,FALSE,\n $filter\n );\n\n $results = json_decode($q,true);\n return $results;\n }", "public function getCompletedList()\n {\n if(!$this->check_access(['idea.complete_list'])){\n return View::make('error/403')->with('warning', 'You do not have access to do this action.');\n }\n\n $ideas = Idea::with('category','advertisement');\n\n if (Input::get('name')) {\n $ideas = $ideas->where('ideas.name','LIKE', '%'.e(Input::get('name')).'%');\n }\n if (Input::get('first_name')) {\n $ideas = $ideas\n ->join('users', 'users.id', '=', 'ideas.user_id')\n ->where('users.first_name','LIKE', '%'.e(Input::get('first_name')).'%');\n }\n if (Input::get('advertisement_id')) {\n $ad_id = explode(\"-\",e(Input::get('advertisement_id')));\n if(sizeof($ad_id)>1){\n $ideas = $ideas->where('ideas.workflow_category_id','=',$ad_id[0])\n ->where('ideas.advertisement_id','=',$ad_id[1]);\n }else{\n $ideas = $ideas->where('ideas.workflow_category_id','=',$ad_id[0]);\n }\n }\n\n if (Input::get('sub_from')) {\n $ideas = $ideas->where('ideas.created_at', '<=', date('Y-m-d',strtotime(e(Input::get('sub_from')))));\n }\n if (Input::get('sub_to')) {\n $ideas = $ideas->where('ideas.created_at', '>=', date('Y-m-d',strtotime(e(Input::get('sub_to')))));\n }\n\n $ideas = $ideas\n ->where('ideas.is_opened','1')\n ->where('ideas.is_closed','1')\n ->where('ideas.is_exited','0')\n ->orderBy('priority', 'DESC')\n ->orderBy('ideas.created_at', 'DESC')\n ->paginate(10);\n\n $workflow_categories = DB::select( DB::raw(\"SELECT id, w.`name` FROM `workflow_categories` AS w WHERE w.`is_periodical` = 0\n UNION\n SELECT CONCAT(a.`workflow_category_id`,'-',a.id) as 'id', CONCAT(w.`name`,' (', a.name,')') FROM `workflow_categories` AS w\n INNER JOIN `advertisements` AS a ON a.`workflow_category_id` = w.`id`\n WHERE w.`is_periodical` = 1\"\n ));\n $wfs = array();\n foreach($workflow_categories as $wc){\n $wfs[$wc->id] = $wc->name;\n }\n $workflow_categories = $wfs;//Workflow_category::lists('name', 'id');\n\n return View::make('ideas.completedideas', compact('ideas','workflow_categories'))->with('input', Input::all());\n\n }", "public function actionIndex() {\n $searchModel = new SurveySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $surveyz = new Surveys();\n $surv = $surveyz->find()->orderBy(['survey_id' => SORT_ASC])->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider, 'surv' => $surv,\n ]);\n }", "function get_SurveyAnswers($surveyID){\r\n $sql = $this->db->prepare(\"CALL SPgetSurveyAnswers(:surveyid);\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function indexAction()\n {\n $user = $this->getUser();\n $uqm = $this->get('user_quiz.manager');\n $qm = $this->get('quiz.manager');\n\n $active_quiz = $uqm->active($user);\n\n /**\n * Get quiz ids for active quizes\n */\n $active_quiz_ids = array_keys($active_quiz->toArray('QuizId'));\n $available_quiz = $qm->available();\n $completed_users_quiz = $uqm->completed($user);\n\n return array(\n 'users_quiz' => $active_quiz,\n 'active_quiz_ids' => $active_quiz_ids,\n 'available_quiz' => $available_quiz,\n 'completed_users_quiz' => $completed_users_quiz,\n );\n }", "public function findAllBySurveyId($id)\n {\n $queryBuilder = $this->queryAll();\n $queryBuilder->where('o.survey_id = :id')\n ->setParameter(':id', $id, \\PDO::PARAM_INT);\n $result = $queryBuilder->execute()->fetchAll();\n\n return !$result ? [] : $result;\n }", "public function index()\n {\n $surveys = Survey::where('id', '>', 0)->paginate(10);\n\n return view('backend.surveys.index', compact('surveys'));\n }", "public function completeResultsAction()\n {\n $manager = ResultsManager::getInstance($this->getDoctrine()->getManager(), $this->getActiveTournament());\n $results = $manager->getCompleteResults();\n\n return $this->createResponse(array('results' => $results));\n }", "public function findAllTeacher()\n {\n \treturn $this->createQueryBuilder('u')\n \t->where('u.role = 1')\n \t->getQuery()\n \t->getResult();\n \t;\n }", "public function getSurveysAsJson() {\n return $this->serializer->serialize($this->getSurveys(), 'json');\n }", "public function responses()\n\t{\n\t\treturn $this->oneToMany('Components\\Answers\\Models\\Response', 'question_id');\n\t}", "public function goals()\n {\n return $this->hasMany(Goal::class)->select('id','course_id','goal');\n }", "public function getResponds()\n {\n return $this->hasMany(Respond::className(), ['user_id' => 'id']);\n }", "public function index($survey_id)\n\t{\n\t\t$questions = Survey::find($survey_id)->questions;\n\n\t\treturn Fractal::collection($questions, new QuestionTransformer);\n\t}", "function kilman_get_user_responses($kilmanid, $userid, $complete=true) {\n global $DB;\n $andcomplete = '';\n if ($complete) {\n $andcomplete = \" AND complete = 'y' \";\n }\n return $DB->get_records_sql (\"SELECT *\n FROM {kilman_response}\n WHERE kilmanid = ?\n AND userid = ?\n \".$andcomplete.\"\n ORDER BY submitted ASC \", array($kilmanid, $userid));\n}", "public function getAnalytics($surveyId) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.id' => $surveyId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.user_id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public function agentTickets($complete = false)\n {\n if ($complete) {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'agent_id')->whereNotNull('completed_at');\n } else {\n return $this->hasMany('PanicHD\\PanicHD\\Models\\Ticket', 'agent_id')->whereNull('completed_at');\n }\n }" ]
[ "0.70288384", "0.633615", "0.61032325", "0.60768795", "0.6067278", "0.60088587", "0.59663516", "0.59495735", "0.59407634", "0.5937145", "0.58834386", "0.5830206", "0.581785", "0.5804144", "0.5754926", "0.5741124", "0.5706073", "0.5653799", "0.56431717", "0.5624406", "0.5589708", "0.5583024", "0.55640686", "0.5545813", "0.55365896", "0.55229634", "0.5506131", "0.55034584", "0.5491011", "0.5481136", "0.5474181", "0.54626924", "0.5453002", "0.5440971", "0.54320335", "0.54258865", "0.5403527", "0.54031813", "0.5380774", "0.5376871", "0.53488356", "0.5335397", "0.53350466", "0.5332558", "0.53278893", "0.53118294", "0.5309624", "0.5308803", "0.52602935", "0.52552146", "0.5251644", "0.5249465", "0.5174069", "0.5147588", "0.5144158", "0.514224", "0.514181", "0.51361156", "0.51279634", "0.5119747", "0.51153994", "0.51150405", "0.5113537", "0.5100094", "0.5094813", "0.5091997", "0.50813925", "0.50781757", "0.5075457", "0.50677145", "0.50645083", "0.50639933", "0.5046324", "0.5046324", "0.50419605", "0.503576", "0.50235415", "0.5019638", "0.50149727", "0.50032556", "0.500111", "0.4997346", "0.49768323", "0.49765506", "0.49742347", "0.49531877", "0.49412486", "0.49347433", "0.49332455", "0.4932398", "0.49307302", "0.49235457", "0.49229723", "0.49228537", "0.4920437", "0.49135596", "0.4909125", "0.49005032", "0.48965135", "0.4894185" ]
0.5180068
52
Get all surveys in progress by the current user
public function user_submissions_progress($submission_hahses) { // If user submissions have not yet been gathered if (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); } // If we have some surveys in progress return an array of their hashes return isset(self::$user_submissions['progress']) ? self::$user_submissions['progress'] : array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "public function getSurveysWithUser(User $user,$isParticipant){\n if($isParticipant){\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ParticipantDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n }\n else{\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ResearcherDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n \n }\n $cursor = $query->getQuery()->execute();\n $projectIds = array();\n foreach($cursor as $participant){\n array_push($projectIds,new \\MongoId($participant->project->id));\n }\n \n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\SurveyDocument')\n ->field('project.$id')->in($projectIds);\n $cursor = $query->getQuery()->execute();\n $surveys = array();\n foreach($cursor as $survey){\n array_push($surveys,$survey);\n }\n return $surveys;\n }", "function get_available_by_time_surveys() {\r\n // set connection var\r\n global $db;\r\n\r\n // get current time\r\n $time = date(\"Y-m-d H:i:s\");\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND status = '1' AND available_from < '$time' AND available_due > '$time';\";\r\n $surveys_data = array();\r\n $surveys = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function index()\n\t{\n\t\t//User based filtering\n\t\t$user = $this->apiKey->guestUser;\n\t\t$survey_ids_taken = TrackSurvey::where('users_id', $user->id)->groupBy('surveys_id')->lists('surveys_id');\n\n\t\t//Question count\n\t\t// return $survey_ids_taken;\n\t\t\n\t\ttry {\n\t\t\t//inserting custom key-val\n\t\t\t$surveys = Survey::all();\n\t\t\tforeach($surveys as $survey){\n\t\t\t\t$survey->is_taken = in_array($survey->id, $survey_ids_taken) ? '1':'0';\n\t\t\t\t$survey->mcq_count = Question::where('surveys_id', $survey->id)->where('type', 'mcq')->count();\n\t\t\t\t$survey->wr_count = Question::where('surveys_id', $survey->id)->where('type', 'written')->count();\n\t\t\t\t$survey->taken_by = TrackSurvey::where('surveys_id', $survey->id)->groupBy('users_id')->lists('users_id');\t\t\t\n\t\t\t}\n\n\t\t\t// return $surveys;\n\t\t\treturn Fractal::collection($surveys, new SurveyTransformer);\n\t\t\n\t\t} catch (Exception $e) {\n \n \treturn $this->response->errorGone();\n\t\t\t\n\t\t}\n\t}", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "function get_surveys_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND created_by = '$user_id';\";\r\n\r\n $surveys_data = array();\r\n $surveys = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "function get_user_study_n_collection_requests($survey_id,$user_id,$request_status=NULL)\n\t{\n\t\t$requests=array();\n\t\t\n\t\t//collections that study belong to with DA access enabled\n\t\t$collections=$this->get_study_collections($survey_id);\n\t\t\n\t\tif($collections)\n\t\t{\n\t\t\t//find requests by collection\n\t\t\tforeach($collections as $collection)\n\t\t\t{\n\t\t\t\t$result=$this->get_user_collection_requests($user_id,$collection['repositoryid'],$request_status);\n\t\t\t\t\n\t\t\t\tif($result)\n\t\t\t\t{\n\t\t\t\t\tforeach($result as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$requests[]=$row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//find requests by study\n\t\t$result=$this->get_user_study_requests($survey_id,$user_id);\n\t\t\n\t\tif ($result)\n\t\t{\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$requests[]=$row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $requests;\n\t}", "public function get_survey_list($session_key, $suser='')\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t $current_user = Yii::app()->session['user'];\n\t\t if( Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1 and $suser !='')\n\t\t\t\t$current_user = $suser;\n\n\t\t $aUserData = User::model()->findByAttributes(array('users_name' => $current_user));\t\t \n\t\t if (!isset($aUserData))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid user', 38);\t\t \n\t \t \t\t \n\t\t $user_surveys = Survey::model()->findAllByAttributes(array(\"owner_id\"=>$aUserData->attributes['uid'])); \t\t \n\t\t if(count($user_surveys)==0)\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No Surveys found', 30);\n\t\t\t\n\t\t\tforeach ($user_surveys as $asurvey)\n\t\t\t\t{\n\t\t\t\t$asurvey_ls = Surveys_languagesettings::model()->findByAttributes(array('surveyls_survey_id' => $asurvey->primaryKey, 'surveyls_language' => $asurvey->language));\n\t\t\t\tif (!isset($asurvey_ls))\n\t\t\t\t\t$asurvey_title = '';\n\t\t\t\telse\n\t\t\t\t\t$asurvey_title = $asurvey_ls->attributes['surveyls_title'];\n\t\t\t\t$aData[]= array('sid'=>$asurvey->primaryKey,'surveyls_title'=>$asurvey_title,'startdate'=>$asurvey->attributes['startdate'],'expires'=>$asurvey->attributes['expires'],'active'=>$asurvey->attributes['active']);\n\t\t\t\t}\n\t\t\treturn $aData;\n }\t\t\t\t\n\t}", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "public function getSurveys() {\n\n \n $this->db->select('sur_id, sur_title');\n $this->db->from('msv_surveys');\n \n $query = $this->db->get();\n \n $res = $query->result();\n \n return $res;\n }", "function get_survey_requests_by_user($user_id=NULL,$survey_id=NULL)\n\t{\n\t\t\t$this->db->select('lic_requests.id,expiry,status');\n\t\t\t$this->db->where('userid',$user_id);\n\t\t\t$this->db->where('lic_requests.surveyid',$survey_id);\n\t\t\t$this->db->where('lic_requests.status !=','DENIED');\n\t\t\t$this->db->join('lic_file_downloads', 'lic_requests.id = lic_file_downloads.requestid','left');\n\t\t\t$query=$this->db->get(\"lic_requests\");\n\t\t\t//echo mktime(0,0,0,9,9,2010);\n\t\t\tif (!$query)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->result_array();\n\t}", "function get_voted_surveys_by_user($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for user\r\n $sql = \"SELECT survey_id\r\n FROM votes\r\n WHERE is_active='1' AND user_id='$user_id'\";\r\n\r\n $votes_data = array();\r\n $votes_survey = array();\r\n $votes_survey_unique = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes_survey[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n $votes_survey_unique = array_unique($votes_survey);\r\n\r\n return $votes_survey_unique;\r\n}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public function listSurvey() {\n $surveys = \\App\\Survey::where('deleted', '=', 0)->get();\n return view('User/listSurvey', ['surveys' => $surveys]);\n }", "function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "function get_user_study_requests($survey_id, $user_id,$request_status=NULL)\n\t{\n\t\t$this->db->select('id,request_type,status');\n\t\t$this->db->where('userid',$user_id);\n\t\t$this->db->where('surveyid',$survey_id);\n\t\tif($request_status)\n\t\t{\n\t\t\t$this->db->where_in('status',$request_status);\n\t\t}\n\t\treturn $this->db->get('lic_requests')->result_array();\n\t}", "public function myQuests(Request $request)\n {\n return Auth::user()->quests;\n }", "public static function navigation($survey_id, $user_id)\n {\n $survey = Survey::findOrFail($survey_id);\n $user = User::findOrFail($user_id);\n $surveyQuestions = self::questions($survey->blueprint_id);\n $questions = array();\n foreach ($surveyQuestions as $surveyQuestion) {\n $questions[] = array(\n 'order' => $surveyQuestion->order,\n 'key' => $surveyQuestion->key,\n 'answered' => Answer::isAnswered($survey_id, $user_id, $surveyQuestion->id),\n 'link' => Survey::createKey(array( $survey->key , $user->key , $surveyQuestion->key ))\n );\n }\n return $questions;\n }", "function &_getGlobalSurveyData($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\t$result = array();\n\t\tif (($survey->getTitle()) and ($survey->author) and (count($survey->questions)))\n\t\t{\n\t\t\t$result[\"complete\"] = true;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\t$result[\"complete\"] = false;\n\t\t}\n\t\t$result[\"evaluation_access\"] = $survey->getEvaluationAccess();\n\t\treturn $result;\n\t}", "function ubc_di_get_assessment_results() {\n\t\tglobal $wpdb;\n\t\t$response = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t} else {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t\t$temp_ubc_di_sites = array();\n\t\t\t$user_id = get_current_user_id();\n\t\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_site->ID, 'ubc_di_assessment_result_group', true );\n\t\t\t\t$ubc_di_group_people = get_post_meta( $ubc_di_asr_group_id, 'ubc_di_group_people', true );\n\t\t\t\tif ( '' != $ubc_di_group_people ) {\n\t\t\t\t\tforeach ( $ubc_di_group_people as $ubc_di_group_person ) {\n\t\t\t\t\t\tif ( $user_id == $ubc_di_group_person ) {\n\t\t\t\t\t\t\t$temp_ubc_di_sites[] = $ubc_di_site;\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$ubc_di_sites = $temp_ubc_di_sites;\n\t\t}\n\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t$temp_array = $this->ubc_di_get_site_metadata( $ubc_di_site->ID );\n\t\t\tif ( null != $temp_array ) {\n\t\t\t\tarray_push( $response, $temp_array );\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function __invoke(): Collection|array\n {\n return Survey::all();\n }", "public function getResponses()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t$query = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tdatetime\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[] = $row;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "public function index()\n { \n $id = Sentinel::getUser()->id;\n \n\n if(Sentinel::getUser()->inRole('admin')){\n $srvy = DB::table('surveys')->get();\n }else{\n $srvy = DB::table('surveys')->where('creator_id', '=', $id)->get();\n }\n return view('pages.survey',compact('srvy'));\n }", "public function index()\n {\n $pulse_surveys = PulseSurvey::currentReport()\n ->with(\n 'pulse_survey_results',\n 'pulse_survey_results.observer',\n 'action_plan',\n 'action_plan.behaviors',\n 'action_plan.behaviors.behavior'\n )\n ->orderByDesc('cycle')\n ->get();\n $application_state = ApplicationState::currentUser()->where('application_key', 'pulse_survey')->get()->first();\n $action_plans = ActionPlan::currentReport()->get();\n $observers = Observer::currentReport()->currentUser()->enabled()->get();\n $observer_types = ObserverTypes::optionsWithLabels();\n\n $data = json_encode(compact('pulse_surveys', 'application_state', 'action_plans', 'observers', 'observer_types'));\n\n return view('pulse-surveys.index', compact('data'));\n }", "function &getUserSpecificResults($finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$evaluation = array();\n\t\t$questions =& $this->getSurveyQuestions();\n\t\tforeach ($questions as $question_id => $question_data)\n\t\t{\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($question_id);\n\t\t\t$data =& $question->getUserAnswers($this->getSurveyId(), $finished_ids);\n\t\t\t$evaluation[$question_id] = $data;\n\t\t}\n\t\treturn $evaluation;\n\t}", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "function get_survey_ids_by_user($email) {\n\t$mysql = new mysqli ( 'localhost', 'root', 'stu.fudan2013', 'EasyPolling' ) or die ( 'Cannot connect to Database' );\n\t$query = \"SELECT * from Poll where Creator='\" . $email . \"'\";\n\t$result = mysqli_query ( $mysql, $query );\n\t\n\t$returned = array ();\n\twhile ( $row = mysqli_fetch_array ( $result ) ) {\n\t\t$id = $row ['ID'];\n\t\t$survey = get_survey_by_id ( $id );\n\t\tarray_push ( $returned, array (\n\t\t\t\t'id' => $id,\n\t\t\t\t'survey' => $survey \n\t\t) );\n\t}\n\tmysqli_close ( $mysql );\n\t\n\treturn $returned;\n}", "public function getSubmissions()\n {\n return $this->getFiles()->filter(function (File $file) {\n return $file->getOwner()->getType() === 'student';\n });\n }", "public function getUserProgressInQuest($user, $questCode);", "function userSurvey() {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n if (!$this->Session->check('Survey.progress')) {\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // logic for the survey process starts here\n switch ($progress) {\n case INTRO:\n $this->layout = 'intro'; // use the intro layout\n $this->render('/Elements/intro');\n break;\n case RIGHTS:\n $this->layout = 'rights'; // use the more rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent);\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "function get_Surveys(){\r\n $sql = $this->db->prepare(\"CALL SPgetSurvey2(:userid,:chamberID,:businessID);\");\r\n $result = $sql->execute(array(\r\n \"userid\" => $_SESSION['userid'],\r\n \"chamberID\" => $_SESSION['chamber'],\r\n \"businessID\" => $_SESSION['businessid'],\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false; // was array(); HL 10/10/17\r\n }\r\n }", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "function get_request_approved_surveys($request_id)\n\t{\n\t\t$this->db->select('resources.survey_id');\n\t\t$this->db->join('resources', 'lic_file_downloads.fileid= resources.resource_id');\n\t\t$this->db->where('lic_file_downloads.requestid',$request_id);\n\t\t$result=$this->db->get('lic_file_downloads')->result_array();\n\t\t\n\t\tif (!$result)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$output=array();\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$output[]=$row['survey_id'];\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function getAnsweredQuestions($userId, $surveyId) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.id' => $surveyId, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "function getViewablePausedReports($conn){\n\t$sql = \"SELECT temporaryreport.PlanId, DatePaused FROM temporaryreport JOIN plan ON temporaryreport.PlanId = plan.PlanId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "public function get_completed_survey_submissions($id, $completed_since = NULL)\n\t{\n\t\t$data = array();\n\n\t\t$this->db\n\t\t\t->order_by('completed', 'ASC')\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('survey_id', $id);\n\n\t\t// If completed_since is set, only grab completed submissions AFTER that date\n\t\tif ($completed_since != NULL)\n\t\t{\n\t\t\t$this->db->where('completed >=', $completed_since);\n\t\t}\n\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ $row->id ] = array(\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function index($survey_id)\n\t{\n\t\t$questions = Survey::find($survey_id)->questions;\n\n\t\treturn Fractal::collection($questions, new QuestionTransformer);\n\t}", "public static function get_all_awaiting_winners() {\n global $wpdb;\n $winners_table = $wpdb->prefix.\"wauc_winners\";\n return $wpdb->get_results(\"SELECT * FROM $winners_table WHERE is_selected = 1 AND is_winner = 0\");\n }", "public function completedTasks()\n\t{\n\t\treturn $this->belongsToMany('TGLD\\Tasks\\Task', 'user_completed_task', 'user_id', 'task_id')\n\t\t\t->with('project')\n\t\t\t->orderBy('priority', 'ASC')\n\t\t\t->latest();\n\t}", "function get_all_by_survey($sid)\r\n {\r\n $this->db->select(\"*\");\r\n $this->db->where(\"sid\",$sid);\r\n return $this->db->get(\"data_files\")->result_array();\r\n }", "public function actionIndex() {\n $searchModel = new SurveySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $surveyz = new Surveys();\n $surv = $surveyz->find()->orderBy(['survey_id' => SORT_ASC])->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider, 'surv' => $surv,\n ]);\n }", "function getCumulatedResultsDetails($survey_id, $counter, $finished_ids)\n\t{\n\t\tif (count($this->cumulated) == 0)\n\t\t{\n\t\t\tif(!$finished_ids)\n\t\t\t{\n\t\t\t\tinclude_once \"./Modules/Survey/classes/class.ilObjSurvey.php\";\t\t\t\n\t\t\t\t$nr_of_users = ilObjSurvey::_getNrOfParticipants($survey_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t\t}\n\t\t\t$this->cumulated =& $this->object->getCumulatedResults($survey_id, $nr_of_users, $finished_ids);\n\t\t}\n\t\t\n\t\t$output = \"\";\n\t\tinclude_once \"./Services/UICore/classes/class.ilTemplate.php\";\n\t\t$template = new ilTemplate(\"tpl.il_svy_svy_cumulated_results_detail.html\", TRUE, TRUE, \"Modules/Survey\");\n\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question\"));\n\t\t$questiontext = $this->object->getQuestiontext();\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->object->prepareTextareaOutput($questiontext, TRUE));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"question_type\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->lng->txt($this->getQuestionType()));\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_answered\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_ANSWERED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"users_skipped\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"USERS_SKIPPED\"]);\n\t\t$template->parseCurrentBlock();\n\t\t/*\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE\"]);\n\t\t$template->parseCurrentBlock();\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"mode_nr_of_selections\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->cumulated[\"MODE_NR_OF_SELECTIONS\"]);\n\t\t$template->parseCurrentBlock();\n\t\t*/\n\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"categories\"));\n\t\t$categories = \"\";\n\t\tif (is_array($this->cumulated[\"variables\"]))\n\t\t{\n\t\t\tforeach ($this->cumulated[\"variables\"] as $key => $value)\n\t\t\t{\n\t\t\t\t$categories .= \"<li>\" . $value[\"title\"] . \": n=\" . $value[\"selected\"] . \n\t\t\t\t\t\" (\" . sprintf(\"%.2f\", 100*$value[\"percentage\"]) . \"%)</li>\";\n\t\t\t}\n\t\t}\n\t\t$categories = \"<ol>$categories</ol>\";\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $categories);\n\t\t$template->parseCurrentBlock();\n\t\t\n\t\t// add text answers to detailed results\n\t\tif (is_array($this->cumulated[\"textanswers\"]))\n\t\t{\n\t\t\t$template->setCurrentBlock(\"detail_row\");\n\t\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"freetext_answers\"));\t\n\t\t\t$html = \"\";\t\t\n\t\t\tforeach ($this->cumulated[\"textanswers\"] as $key => $answers)\n\t\t\t{\n\t\t\t\t$html .= $this->cumulated[\"variables\"][$key][\"title\"] .\"\\n\";\n\t\t\t\t$html .= \"<ul>\\n\";\n\t\t\t\tforeach ($answers as $answer)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"<li>\" . preg_replace(\"/\\n/\", \"<br>\\n\", $answer) . \"</li>\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= \"</ul>\\n\";\n\t\t\t}\n\t\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $html);\n\t\t\t$template->parseCurrentBlock();\n\t\t}\t\t\t\n\t\t\n\t\t// chart \n\t\t$template->setCurrentBlock(\"detail_row\");\t\t\t\t\n\t\t$template->setVariable(\"TEXT_OPTION\", $this->lng->txt(\"chart\"));\n\t\t$template->setVariable(\"TEXT_OPTION_VALUE\", $this->renderChart(\"svy_ch_\".$this->object->getId(), $this->cumulated[\"variables\"]));\n\t\t$template->parseCurrentBlock();\n\t\t\t\t\n\t\t$template->setVariable(\"QUESTION_TITLE\", \"$counter. \".$this->object->getTitle());\n\t\treturn $template->get();\n\t}", "public function indexAction()\n {\n $user = $this->getUser();\n $uqm = $this->get('user_quiz.manager');\n $qm = $this->get('quiz.manager');\n\n $active_quiz = $uqm->active($user);\n\n /**\n * Get quiz ids for active quizes\n */\n $active_quiz_ids = array_keys($active_quiz->toArray('QuizId'));\n $available_quiz = $qm->available();\n $completed_users_quiz = $uqm->completed($user);\n\n return array(\n 'users_quiz' => $active_quiz,\n 'active_quiz_ids' => $active_quiz_ids,\n 'available_quiz' => $available_quiz,\n 'completed_users_quiz' => $completed_users_quiz,\n );\n }", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "function getUserQuizzes() \n\t{\n\t\t$user =& JFactory::getUser();\n\t\t\n\t\t$config =& JFactory::getConfig();\n\t\t$jnow\t\t=& JFactory::getDate();\n\t\t$jnow->setOffset( $config->getValue('config.offset' ));\n\t\t$now\t\t= $jnow->toMySQL(true);\n\n\t\t$query = 'SELECT qui.*' .\n\t\t' FROM #__jquarks_quizzes AS qui' .\n\t\t' LEFT JOIN #__jquarks_users_quizzes as users_quizzes ON qui.id = users_quizzes.quiz_id' .\n\t\t' WHERE qui.published = 1' .\n\t\t' AND qui.access_id = 1' .\n\t\t' AND users_quizzes.user_id = ' . $user->id . \n\t\t' AND users_quizzes.archived <> 1' .\n\t\t' AND qui.publish_up < \\'' . $now . '\\'' .\n\t\t' AND ( qui.publish_down > \\'' . $now . '\\' OR qui.publish_down = \\'0000-00-00 00:00:00\\' )' ;\n\t\t\n\t\t$this->_userQuizzes = $this->_getList($query);\n\t\tif($this->_db->getErrorNum()) {\n\t\t\treturn false ;\n\t\t}\n\t\t\n\t\treturn $this->_userQuizzes ;\n\t}", "public static function getChallenges($session) \n {\n \n KorisnikModel::updateWrapper($session->get('user')->summonerName);\n \n $uQModel = new UserQuestModel();\n $qModel = new QuestModel();\n $uQ = $uQModel->where('summonerName', $session->get('user')->summonerName)->findAll();\n $poroUser = count($uQModel->where('summonerName', $session->get('user')->summonerName)->where('completed', 1)->findAll());\n $poroTotal = count($qModel->findAll());\n\n $data = [\n 'poroUser' => $poroUser,\n 'poroTotal' => $poroTotal,\n 'quests' => []\n ];\n \n foreach ($uQ as $userQuest) {\n $quest = $qModel->find($userQuest->questId);\n $dataQuest = [\n 'id' => $userQuest->questId,\n 'title' => $quest->title,\n 'description' => $quest->description,\n 'image' => $quest->image,\n 'completed' => $userQuest->completed,\n 'attributes' => QuestAttributeModel::getAttributes($quest->questId)\n ];\n \n \n $questRequired = null;\n $preReqSatisfied = true;\n foreach($dataQuest['attributes'] as $atr){\n if($atr->attributeKey == 'Prerequisite Id'){\n $questRequired = intval($atr->attributeValue);\n $preReQuest = $uQModel->where('questId', $questRequired)->where('summonerName',$session->get('user')->summonerName)->find();\n if($preReQuest[0]->completed == 0){\n $preReqSatisfied = false;\n break;\n } \n } \n }\n \n if($preReqSatisfied == false){ \n continue;\n }\n // $dataQuest['attributes'];\n array_push($data['quests'], $dataQuest);\n }\n return $data;\n }", "public function surveys(){\n return $this->belongsToMany('App\\surveys');\n }", "public function index()\n {\n $surveys = Survey::where('id', '>', 0)->paginate(10);\n\n return view('backend.surveys.index', compact('surveys'));\n }", "public function getAnalytics($surveyId) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.id' => $surveyId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.user_id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\n }", "public function getAllUserStories(): array\n {\n $stmt = $this->db->getPDO()->prepare('SELECT * FROM userstory WHERE idprojet=:projectId');\n $values = array(':projectId' => $this->projectId);\n $stmt->execute($values);\n return $stmt->fetchAll();\n }", "public function completed_users()\n {\n return $this->belongsToMany(\n User::class,\n CompletedSentence::class,\n 'sentence_id',\n 'user_id',\n 'id',\n 'id'\n );\n }", "public function index()\n {\n $surveys = Survey::getAllByOwner(Auth::user()->id);\n return view('backend.surveys.index', compact('surveys'));\n }", "public static function getInProgressProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'in-progress');\n\n\t}", "public function getResponsesForUser($user_id)\n {\n return Proposal::where('responder_id', $user_id)\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function get_all_completed_checklist_data() {\n\n $completed_inspect_data = array();\n\n $query = db_select('checklist_inspections', 'c')\n ->fields('c', array('order_num','category','unit_id','nid', 'admin_notes', 'admin_approver',\n 'approved','inspected_by','repair_archive','date_submitted','follow_up_alert','comments'))\n ->condition('approved', 'approved')\n ->condition('completed', 'completed');\n $results = $query->execute();\n\n foreach ($results as $val) {\n $completed_inspect_data[] = (array) $val;\n }\n return $completed_inspect_data;\n }", "function getSavedReportsForSelf() {\r\n\t\treturn $this->getSavedReportsForUser( $_SESSION['userid'] );\r\n\t}", "private function getInitialData($userid) {\r\n\t\t// get trials for this researcher\r\n\t\t$returnArray = array();\r\n\t\t$researcher = $trials = $trialList = array();\r\n\t\t$result = getData(\"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\");\r\n\t\t// \"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\"\r\n\t\t$sql = \"SELECT t.*, r.*\r\n\t\t\tFROM trial t\r\n\t\t\tINNER JOIN researcher_trial_bridge rt ON rt.trialid = t.trialid\r\n\t\t\tINNER JOIN researcher r ON r.researcherid = rt.researcherid\r\n\t\t\tWHERE t.active = 1 AND r.active = 1 AND r.researcherid = {$userid}\";\r\n\t\t$result = $db->query($sql);\r\n\t\tif($result && count($result)) {\r\n\t\t\tforeach($result as $row) {\r\n\t\t\t\t$trialid = $row['trialid'];\r\n\t\t\t\tif(!in_array($trialid, $trialList)) $trialList[] = $row['trialid'];\r\n\t\t\t\tif(!array_key_exists($trialid, $trials)) {\r\n\t\t\t\t\t$trials[$trialid] = array(\r\n\t\t\t\t\t\t\"trial_name\" => $row['trial_name'],\r\n\t\t\t\t\t\t\"purpose\" => $row['purpose'],\r\n\t\t\t\t\t\t\"creation_date\" => $row['creation_date']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tif(!count(array_keys($researcher))) {\r\n\t\t\t\t\t$researcher = array(\r\n\t\t\t\t\t\t\"prefix\" => $row['prefix'],\r\n\t\t\t\t\t\t\"first_name\" => $row['first_name'],\r\n\t\t\t\t\t\t\"last_name\" => $row['last_name'],\r\n\t\t\t\t\t\t\"suffix\" => $row['suffix'],\r\n\t\t\t\t\t\t\"affiliation\" => $row['affiliation']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($trialList) == 1) {\r\n\t\t\t// given the selected trial, acquire the next batch of data\r\n\r\n\t\t} else if(count($trialList) > 1) {\r\n\t\t\t// this is all the data that's needed for now; after researcher selects a trial, the next batch will be acquired\r\n\t\t\t$returnArray = array(\"researcher\" => $researcher, \"trials\" => $trials, \"trialList\" => $trialList);\r\n\t\t}\r\n\t}", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "private function users_for_stats() {\n\n\t\t\tif ( ! is_null( $this->users_for_stats ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( is_null( $this->request ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\tif ( empty( $quiz_id ) ) {\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( learndash_is_admin_user() ) {\n\t\t\t\t$this->users_for_stats = array();\n\t\t\t} elseif ( learndash_is_group_leader_user() ) {\n\t\t\t\tif ( learndash_get_group_leader_manage_courses() ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * If the Group Leader can manage_courses they have will access\n\t\t\t\t\t * to all quizzes. So they are treated like the admin user.\n\t\t\t\t\t */\n\t\t\t\t\t$this->users_for_stats = array();\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * Else we need to figure out of the quiz requested is part of a\n\t\t\t\t\t * Course within Group managed by the Group Leader.\n\t\t\t\t\t */\n\t\t\t\t\t$quiz_users = array();\n\t\t\t\t\t$leader_courses = learndash_get_groups_administrators_courses( get_current_user_id() );\n\t\t\t\t\tif ( ! empty( $leader_courses ) ) {\n\t\t\t\t\t\t$quiz_courses = array();\n\t\t\t\t\t\tif ( 'yes' === LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Courses_Builder', 'shared_steps' ) ) {\n\t\t\t\t\t\t\t$quiz_courses = learndash_get_courses_for_step( $quiz_id, true );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$quiz_course = learndash_get_setting( $quiz_id, 'course' );\n\t\t\t\t\t\t\tif ( ! empty( $quiz_course ) ) {\n\t\t\t\t\t\t\t\t$quiz_courses = array( $quiz_course );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $quiz_courses ) ) {\n\t\t\t\t\t\t\t$common_courses = array_intersect( $quiz_courses, $leader_courses );\n\t\t\t\t\t\t\tif ( ! empty( $common_courses ) ) {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * The following will get a list of all users within the Groups\n\t\t\t\t\t\t\t\t * managed by the Group Leader. This list of users will be passed\n\t\t\t\t\t\t\t\t * to the query logic to limit the selected rows.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * This is not 100% accurate because we don't limit the rows based\n\t\t\t\t\t\t\t\t * on the associated courses. Consider if Shared Course steps is\n\t\t\t\t\t\t\t\t * enabled and the quiz is part of two courses and those courses\n\t\t\t\t\t\t\t\t * are associated with multiple groups. And the user is in both\n\t\t\t\t\t\t\t\t * groups. So potentially we will pull in statistics records for\n\t\t\t\t\t\t\t\t * the other course quizzes.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$quiz_users = learndash_get_groups_administrators_users( get_current_user_id() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $quiz_users ) ) {\n\t\t\t\t\t\t$this->users_for_stats = $quiz_users;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If here then non-admin and non-group leader user.\n\t\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\t\tif ( ! empty( $quiz_id ) ) {\n\t\t\t\t\tif ( get_post_meta( $quiz_id, '_viewProfileStatistics', true ) ) {\n\t\t\t\t\t\t$this->users_for_stats = (array) get_current_user_id();\n\t\t\t\t\t\treturn $this->users_for_stats;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t}\n\n\t\t\treturn $this->users_for_stats;\n\t\t}", "abstract public function getQueuedSignups();", "public function avaliable_tasks()\n {\n return DB::table('tasks')\n ->leftJoin('subjects', 'tasks.subject_id', '=', 'subjects.id')\n ->leftJoin('usersubjects', 'subjects.id', '=', 'usersubjects.subject_id')\n ->leftJoin('users', 'usersubjects.user_id', '=', 'users.id')\n ->where('users.id','=',$this->id)\n ->where('tasks.isactive','=',true)\n ->select('subjects.name', 'users.id', 'tasks.*')\n ->get();\n }", "function get_my_request_history($user_id){\r\n\treturn $this->db->select('rf.*, ft.form_type')\r\n\t\t\t->from('requests_forms as rf')\r\n\t\t\t->join('form_types as ft', 'ft.form_types_id = rf.forms_id')\r\n\t\t\t->where('rf.resident_id', $user_id)\r\n\t\t\t->where_in('rf.request_status', array('approved', 'disapproved'))\r\n\t\t\t->get()\r\n\t\t\t->result();\r\n\t}", "public function participants()\n{\n $participants = DB::table('association_user_actions')->where('action_id', $this->id)->get();\n\n return $participants;\n}", "public function index()\n {\n $semesters = MorssSemester::nowSurvey()->get();\n\n $user = User::where('id', Auth::user()->id)->with('moraleSurveys')->first();\n\n return view('moralesurvey.survey.index', compact('semesters', 'user'));\n // return $user->moraleSurveys;\n }", "public function index(): AnonymousResourceCollection\n {\n return SurveyResource::collection(Survey::all());\n }", "protected function createSurveyEntries(): array\n {\n $result = [];\n $query = $this->SurveyResults->find();\n $count = 0;\n\n $this->out((string)__d('Qobo/Survey', 'Found [{0}] survey_result records', $query->count()));\n\n if (empty($query->count())) {\n return $result;\n }\n\n foreach ($query as $item) {\n $survey = $this->Surveys->find()\n ->where(['id' => $item->get('survey_id')]);\n\n if (!$survey->count()) {\n $this->warn((string)__d('Qobo/Survey', 'Survey [{0}] is not found. Moving on', $item->get('survey_id')));\n\n continue;\n }\n\n $entry = $this->SurveyEntries->find()\n ->where([\n 'id' => $item->get('submit_id'),\n ])\n ->first();\n\n if (empty($entry)) {\n if (empty($item->get('submit_id'))) {\n continue;\n }\n\n $entry = $this->SurveyEntries->newEntity();\n $entry->set('id', $item->get('submit_id'));\n $entry->set('submit_date', $item->get('submit_date'));\n $entry->set('survey_id', $item->get('survey_id'));\n $entry->set('status', 'in_review');\n $entry->set('score', 0);\n\n $saved = $this->SurveyEntries->save($entry);\n\n if ($saved) {\n $result[] = $saved->get('id');\n $count++;\n } else {\n $this->out((string)__d('Qobo/Survey', 'Survey Result with Submit ID [{0}] cannot be saved. Next', $item->get('submit_id')));\n }\n } else {\n // saving existing survey_entries,\n // to double check if anything is missing as well.\n $result[] = $entry->get('id');\n }\n }\n\n $this->out((string)__d('Qobo/Survey', 'Saved [{0}] survey_entries', $count));\n\n //keeping only unique entry ids, to avoid excessive iterations.\n $result = array_values(array_unique($result));\n\n return $result;\n }", "private function __getSurveysBySession(Instruction $instruction){\n $instruction_surveys = $this->em->getRepository('AppBundle\\Entity\\InstructionSurvey')->findBy(array('instruction' => $instruction), array('created' => 'DESC') );\n \n return $instruction_surveys;\n }", "public function index()\n {\n // ->paginate(3);\n $tasks = QueryBuilder::for(Task::class)\n ->allowedIncludes(['project', 'user'])\n ->allowedFilters(['completed', 'due_date', Filter::exact('user_id'),Filter::exact('project_id')])\n ->get();\n\n\n return TaskResource::collection($tasks);\n }", "public function getUserStatusInQuests($user);", "private function get()\n {\n\n $this->getMarks()->getAssessments();\n return ['users' => $this->me->get()];\n }", "function getRelatedTasks() {\n\t\tif (!$this->relatedtasks) {\n\t\t\t$this->relatedtasks = db_query_params ('SELECT pt.group_project_id,pt.project_task_id,pt.summary,pt.start_date,pt.end_date,pgl.group_id,pt.status_id,pt.percent_complete,ps.status_name\n\t\t\tFROM project_task pt, project_group_list pgl, project_status ps\n\t\t\tWHERE pt.group_project_id = pgl.group_project_id\n AND ps.status_id = pt.status_id\n AND EXISTS (SELECT project_task_id FROM project_task_artifact\n\t\t\t\tWHERE project_task_id=pt.project_task_id\n\t\t\t\tAND artifact_id = $1)',\n\t\t\t\t\t\t\t array ($this->getID())) ;\n\t\t}\n\t\treturn $this->relatedtasks;\n\t}", "function get_status_progression( $id_parcours) {\n\n\tglobal $wpdb;\n\n\t$completed = 0;\n\n\t$episodes = get_field('episodes' , $id_parcours);\n\n\t$episodes_number = count($episodes);\n\t// init the array to be returned\n\t$progress_ar = [];\n\n\t$id_user = get_current_user_id();\n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\t$achieved = $rowcount;\n\t\n\tif($achieved == $episodes_number) {\n\t\t$completed = 1;\n\t}\n\n\n\t$percent = round(($achieved * 100) / $episodes_number);\n\n\t$progress_ar['completed'] = $completed;\n\t$progress_ar['percent'] = $percent;\n\t$progress_ar['achieved'] = $achieved;\n\t$progress_ar['episodes_number'] = $episodes_number;\n\n\treturn $progress_ar;\n}", "function get_rad_survey_results($conn, $survey_id) {\n\t$query_results = \"SELECT * FROM rad_survey_result WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_results);\n}", "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "public function getPendingSteps();", "public function getAllTasks()\n\t{\n\t\treturn $this->task->orderBy('is_completed', 'ASC')->get();\t\n\t}", "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function &getExistingQuestions() \n\t{\n\t\tglobal $ilDB;\n\t\t$existing_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.original_id FROM svy_question, svy_svy_qst WHERE \" .\n\t\t\t\"svy_svy_qst.survey_fi = %s AND svy_svy_qst.question_fi = svy_question.question_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\tif($data[\"original_id\"])\n\t\t\t{\n\t\t\t\tarray_push($existing_questions, $data[\"original_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $existing_questions;\n\t}", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "function &getSurveyPages()\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.*, svy_qtype.type_tag, svy_svy_qst.heading FROM \" . \n\t\t\t\"svy_question, svy_qtype, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \".\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$all_questions[$row[\"question_id\"]] = $row;\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst \".\n\t\t\t\t\"WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \".\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$all_pages = array();\n\t\t$pageindex = -1;\n\t\t$currentblock = \"\";\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\tif (array_key_exists($question_id, $obligatory_states))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"obligatory\"] = $obligatory_states[$question_id];\n\t\t\t}\n\t\t\t$constraints = array();\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\tif (!$currentblock or ($currentblock != $questionblocks[$question_id]['questionblock_id']))\n\t\t\t\t{\n\t\t\t\t\t$pageindex++;\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = $questionblocks[$question_id]['show_questiontext'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = $questionblocks[$question_id]['show_blocktitle'];\n\t\t\t\t$currentblock = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pageindex++;\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = 1;\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = 1;\n\t\t\t\t$currentblock = \"\";\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif (!isset($all_pages[$pageindex]))\n\t\t\t{\n\t\t\t\t$all_pages[$pageindex] = array();\n\t\t\t}\n\t\t\tarray_push($all_pages[$pageindex], $all_questions[$question_id]);\n\t\t}\n\t\t// calculate position percentage for every page\n\t\t$max = count($all_pages);\n\t\t$counter = 1;\n\t\tforeach ($all_pages as $index => $block)\n\t\t{\n\t\t\tforeach ($block as $blockindex => $question)\n\t\t\t{\n\t\t\t\t$all_pages[$index][$blockindex][\"position\"] = $counter / $max;\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\treturn $all_pages;\n\t}", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function filledSurveys(){\n return $this->hasMany(FilledSurvey::class);\n }", "public function getCompletedGoals($userid)\n {\n $sql = \"SELECT count(patient_goal_id) as completedgoals FROM patient_goal WHERE status = 2 AND created_by = {$userid}\";\n\n $completedgoals = $this->fetch_all_rows($this->execute_query($sql));\n\n return $completedgoals[0]['completedgoals'];\n }", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "public function get_inprogress_opportunities() {\n\t\tif($this->session->userdata('uid')){\n\t\t\ttry {\n\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t$new = $this->opp_sales->fetch_inprogress_opportunities($user_id);\n\t\t\t\techo json_encode($new);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function getTasks();", "public function getTasks();", "public function findAllBySurveyId($id)\n {\n $queryBuilder = $this->queryAll();\n $queryBuilder->where('o.survey_id = :id')\n ->setParameter(':id', $id, \\PDO::PARAM_INT);\n $result = $queryBuilder->execute()->fetchAll();\n\n return !$result ? [] : $result;\n }", "public function index()\n {\n $params = request()->validate([\n 'survey_id' => 'required|integer:exists:survey,id'\n ]);\n\n $this->authorize('index', SurveyGroup::class);\n return $this->success(SurveyGroup::findAllForSurvey($params['survey_id']), null, 'survey_group');\n }", "function i4_get_completed_units($course_id, $user_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $completed_status = \"complete\";\n\n //Here we grab the unit info for units that are completed for the users course.\n $SQL = $wpdb->prepare(\"SELECT * FROM $wpcwdb->units_meta LEFT JOIN $wpcwdb->user_progress\n ON $wpcwdb->units_meta.unit_id=$wpcwdb->user_progress.unit_id\n WHERE parent_course_id = %d AND unit_completed_status = %s AND user_id = %d\", $course_id, $completed_status, $user_id);\n\n //Store the Completed units Array\n $completed_units = $wpdb->get_results($SQL);\n\n $completed_unit_ids = array();\n\n //set the counter\n $i = 0;\n\n //Store the Unit ID's into the completed unit id's array\n foreach ($completed_units as $completed_unit) {\n $completed_unit_ids[$i] = $completed_unit->unit_id;\n $i++;\n }\n\n return $completed_unit_ids;\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "public function index()\n {\n $disciplines = Discipline::with ('curriculum','languagePreference')->get();\n $allbadges=Auth::user()->badges->last();\n\n $pendings=Pendingtask::with('user')->where('user_id', '=', Auth::user()->id)->get();\n $exercisesets=new Collection();\n $nb = count($disciplines);\n\n\n return view('homepage',compact('disciplines','allbadges','pendings' ));\n }", "public static function getRecentAudios()\n {\n $current_user = Users::getCurrentUser();\n $columns = implode(',', self::$columns);\n $query = db()->prepare(\n \"SELECT\n {$columns}\n FROM audios\n WHERE reply_to IS NULL\n AND status = '1'\n AND user_id = :user_id\n ORDER BY date_added DESC\n LIMIT 3\"\n );\n $query->bindValue('user_id', $current_user->id, PDO::PARAM_INT);\n $query->execute();\n $result = array();\n foreach ($query->fetchAll() as $array) {\n $result[] = self::complete($array);\n }\n return $result;\n }", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "public function index()\n\t{\n\t\treturn Response::json(Interview::with(['responses', 'questionnaire'])->get(), 200);\n\t}", "public function all_pending_course_request(){\n\t\t\t$load = new Load();\n\t\t\t$request_model = $load->model('course_request_model');\n\t\t\t$all_course_request = $request_model->getByWhere('course_request','request_status','pending');\n \n\t\t\treturn $all_course_request;\n\t\t}" ]
[ "0.6652602", "0.6117724", "0.5956528", "0.5916422", "0.5807825", "0.5804387", "0.57642627", "0.5750422", "0.5711903", "0.57080066", "0.56722724", "0.56544435", "0.563402", "0.55712306", "0.5531804", "0.5487317", "0.5483295", "0.5439113", "0.54257715", "0.54192895", "0.536268", "0.53040814", "0.5299713", "0.5283864", "0.5283704", "0.52682555", "0.52551275", "0.5241278", "0.5239564", "0.5230815", "0.52233803", "0.521768", "0.52071613", "0.52028173", "0.5199444", "0.5196247", "0.5184807", "0.51828384", "0.51782405", "0.5152925", "0.51267725", "0.5102543", "0.5100838", "0.509738", "0.5095288", "0.50901645", "0.5086102", "0.50851303", "0.5051476", "0.50498134", "0.50362957", "0.50299895", "0.5028885", "0.5025562", "0.502528", "0.502337", "0.50107324", "0.5010615", "0.5007133", "0.5003644", "0.4999086", "0.49971202", "0.49824798", "0.49799854", "0.49680436", "0.4965405", "0.49635437", "0.49606737", "0.4955841", "0.49530968", "0.4943002", "0.494291", "0.4933258", "0.4924078", "0.4917822", "0.4910508", "0.4906492", "0.4876881", "0.48753873", "0.48753121", "0.486848", "0.4866195", "0.4865458", "0.48556587", "0.485479", "0.48534274", "0.4852525", "0.48473325", "0.48461685", "0.48443544", "0.48443544", "0.4842981", "0.48396936", "0.48363602", "0.48327443", "0.4827902", "0.48272142", "0.48229215", "0.48225963", "0.481656" ]
0.5328361
21
Check an array of submission hashes to see if it marks a completed survey
public function is_complete_by_hashes($survey_id, $submission_hashes) { $query = $this->db ->where('survey_id', $survey_id) ->where('completed IS NOT NULL', NULL, TRUE) ->where_in('hash', $submission_hashes) ->limit(1) ->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_progress_by_hashes($survey_id, $submission_hashes)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where_in('hash', $submission_hashes)\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function user_submissions_complete($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some completed surveys return an array of their hashes\n\t\treturn isset(self::$user_submissions['complete']) ? self::$user_submissions['complete'] : array();\n\t}", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function HasSubmitted ($id) {\n if (@mysql_result(@mysql_query (\"SELECT `submission_id` AS `sub_id` FROM `hunt_submissions` WHERE `submission_person` = $id AND `submission_hunt` = \".$this->hunt_id.\" LIMIT 1\", $this->ka_db), 0, 'sub_id') != '') {\n return true;\n } else {\n return false;\n }\n }", "public function is_progress($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function _isComplete($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\tif (($survey->getTitle()) and (count($survey->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "function areSet($submit, $arr) {\n if(empty($submit)) return false;\n $json = json_encode($submit);\n foreach ($arr as $variable) {\n if (strpos($json, $variable)==-1) return false;\n }\n return true;\n}", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function hasAnswers();", "public static function check_question(array $question);", "function proposal_is_submitted($proposal_id) {\n foreach ($_SESSION['submitted_proposals'] as $sp) {\n if ($sp->id == $proposal_id) {return TRUE;}\n }\n}", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function _erpal_projects_helper_timetracking_finalise_action_validate($timetrackings) {\n $errors = false;\n\n foreach ($timetrackings as $timetracking) {\n //error if timetracking has no subject\n $timetracking_link = l($timetracking->defaultLabel(), 'timetracking/'.$timetracking->timetracking_id.'/edit', array('query' => array('destination' => $_GET['q'])));\n if (!$timetracking->subject_id) {\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise a timetracking, ensure that a subject task is set for !timetracking_link', array('!timetracking_link' => $timetracking_link));\n } elseif (!$timetracking->time_end) {\n //if we dont have a duration the timetracking is still running and cannot be finalised!\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise the timetracking !timetracking_link, ensure that it is not still tracking the time!', array('!timetracking_link' => $timetracking_link));\n }\n }\n\n return $errors;\n}", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $this->post_data['secondNumber'];\n // Assign the number of correct answers to $number_correct in the class method.\n $number_correct = $this->post_data['numberCorrect'];\n // Assign the question number for this level to $question_number in the class method.\n $question_number = $this->post_data['questionNumber'];\n // Assign the level number for this level to $level_number in the class method.\n $level_number = $this->post_data['levelNumber'];\n // Reset Question number to 1 if more than five questions have been completed or increase it by one\n if($question_number == 5) {\n $question_number = 1;\n $level_number++;\n } else {\n $question_number++;\n }\n\n // Check the correct answer to the question.\n $sum = $first_number * $second_number;\n // If the answer in the post data is equivalent to the correct answer, increment $number_correct by one \n // then return true and $number_correct. If it isn't correct return false and $number_correct.\n if ($sum == $this->post_data['sumAnswer']) {\n $number_correct++;\n return array(true, $number_correct, $question_number, $level_number);\n } else {\n return array(false, $number_correct, $question_number, $level_number);\n }\n }", "public function canBeSubmitted()\n {\n if (!$this->isNotYetSubmitted()) {\n return false;\n }\n\n $confirmationSections = $this->getSectionCompletion(self::CONFIRMATION_SECTIONS);\n\n if (!$confirmationSections['allCompleted']) {\n return false;\n }\n\n $applicationSections = $this->getSectionCompletion(self::SECTIONS);\n\n if (!$applicationSections['allCompleted']) {\n return false;\n }\n\n return $this->licence->canMakeEcmtApplication($this);\n }", "public function isSubmitted();", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "function hasCompletedSurvey($iSurveyId, $sToken) {\n\t\t// Check if this token has already completed this survey\n\t\t$sQuery \t\t= \"SELECT completed FROM lime_tokens_$iSurveyId WHERE token = '$sToken'\";\n\t\t$oResult\t\t= $this->oDbConnection->query($sQuery);\n\t\twhile($aRow = mysqli_fetch_array($oResult)) {\n\t\t\t$isCompleted = $aRow['completed'];\n\t\t}\n\t\treturn (isset($isCompleted) && ($isCompleted != 'N'));\n\t}", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "public function markSubmitted(): void\n {\n $user = Auth::user()->callsign;\n $uploadDate = date('n/j/y G:i:s');\n $batchInfo = $this->batchInfo ?? '';\n\n foreach ($this->bmids as $bmid) {\n $bmid->status = Bmid::SUBMITTED;\n\n /*\n * Make a note of what provisions were set\n */\n\n $showers = [];\n if ($bmid->showers) {\n $showers[] = 'set';\n }\n\n if ($bmid->earned_showers) {\n $showers[] = 'earned';\n }\n if ($bmid->allocated_showers) {\n $showers[] = 'allocated';\n }\n if (empty($showers)) {\n $showers[] = 'none';\n }\n\n $meals = [];\n if (!empty($bmid->meals)) {\n $meals[] = $bmid->meals . ' set';\n }\n if (!empty($bmid->earned_meals)) {\n $meals[] = $bmid->earned_meals . ' earned';\n }\n if (!empty($bmid->allocated_meals)) {\n $meals[] = $bmid->allocated_meals . ' allocated';\n }\n\n if (empty($meals)) {\n $meals[] = 'none';\n }\n\n /*\n * Figure out which provisions are to be marked as submitted.\n *\n * Note: Meals and showers are not allowed to be banked in the case were the\n * person earned them yet their position (Council, OOD, Supervisor, etc.) comes\n * with a provisions package.\n */\n\n $items = [];\n if ($bmid->effectiveShowers()) {\n $items[] = Provision::WET_SPOT;\n }\n\n if (!empty($bmid->meals) || !empty($bmid->allocated_meals)) {\n // Person is working.. consume all the meals.\n $items = [...$items, ...Provision::MEAL_TYPES];\n } else if (!empty($bmid->earned_meals)) {\n // Currently only two meal provision types, All Eat, and Event Week\n $items[] = ($bmid->earned_meals == Bmid::MEALS_ALL) ? Provision::ALL_EAT_PASS : Provision::EVENT_EAT_PASS;\n }\n\n\n if (!empty($items)) {\n $items = array_unique($items);\n Provision::markSubmittedForBMID($bmid->person_id, $items);\n }\n\n $meals = '[meals ' . implode(', ', $meals) . ']';\n $showers = '[showers ' . implode(', ', $showers) . ']';\n $bmid->notes = \"$uploadDate $user: Exported $meals $showers\\n$bmid->notes\";\n $bmid->auditReason = 'exported to print';\n $bmid->batch = $batchInfo;\n $bmid->saveWithoutValidation();\n }\n }", "public function canCheckAnswers()\n {\n $sections = $this->getSectionCompletion(self::SECTIONS);\n\n return $sections['allCompleted'] && $this->canBeUpdated();\n }", "public function hasComplete(){\n return $this->_has(2);\n }", "public function isSubmited(): bool\n {\n return (bool) $this->values();\n }", "public function getHasSubmitted() {\n\t\t@$cookie = $_COOKIE['promotion_' . $this->getId()];\n\t\treturn (bool) $cookie;\n\t}", "function challengeCompleted($challenge_id)\n\t{\n\t $current = $this->DB->database_select('users', array('challenges_completed'), array('uid' => session_get('uid')), 1);\n\t $current = $current['challenges_completed'];\n\t if(!empty($current)) //Has any challenges been completed?\n\t {\n\t\t $challenges = explode(',', $current);\n\t\t for($i = 0; $i < count($challenges); $i++)\n\t\t {\n\t\t\t if($challenges[$i] == $challenge_id)\n\t\t\t {\n\t\t\t\t return true; //Challenge was already completed\n\t\t\t }\n\t\t }\n\t }\n\t return false;\n\t}", "function incompleteSubmissionExists($monographId, $userId, $pressId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tsubmission_progress\n\t\t\tFROM\tmonographs\n\t\t\tWHERE\tmonograph_id = ? AND\n\t\t\t\tuser_id = ? AND\n\t\t\t\tpress_id = ? AND\n\t\t\t\tdate_submitted IS NULL',\n\t\t\tarray($monographId, $userId, $pressId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "function check_quiz_pass($taking_id) {\r\n\r\n $quizDataBaseName = 'wp_watupro_taken_exams';\r\n $postmetaDatabaseName = 'wp_postmeta';\r\n $exam = get_recent_exam_ID($taking_id);\r\n $examID = $exam->exam_id;\r\n $user_ID = $exam->user_id;\r\n $userEmail = get_user_meta($user_ID, 'billing_email', true);\r\n $watuObj = get_certificate_data($user_ID);\r\n if (!empty($watuObj)) {\r\n $postedID = get_specific_postmeta_data($postmetaDatabaseName, $userEmail);\r\n if (valExistence_check($postedID, $watuObj) == false) {\r\n $examName = get_recent_exam_name($user_ID);\r\n update_all_data_to_wp_store_locator($user_ID, $examName, $userEmail);\r\n }\r\n }\r\n}", "public function hasPartsToIssue(): bool\n {\n return count($this->issuedItems) > 0;\n }", "function isComplete()\n\t{\n\t\tif (($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function getHasAcceptedAnswer(array $answers)\n\t{\n\t\t$res = array();\n\t\tforeach ($answers as $answer) {\n\t\t\t$res[] = $answer->accepted;\n\t\t}\n\t\treturn in_array(true, $res);\n\t}", "function isSubmittedBy();", "function questionIdsExist($arr, $form) {\r\n\r\n\t$formId = getFormId($form);\r\n\tif($formId) {\r\n\t\tforeach ($arr as $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\tquestionIdsExist($value, $form);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(getQuestionId($value, $form) == null) return false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\telse return false;\r\n}", "public function isPartiallyCorrect()\n {\n if (empty($this->submission) || empty($this->submission->answers())) {\n return false;\n }\n\n $questionId = $this->element->owner->owner->id;\n\n $answers = $this->submission->answers();\n if (empty($answers[$questionId][$this->element->id])) {\n return false;\n }\n\n if (!isset($this->element->options)) {\n return false;\n }\n\n $atLeastOneCorrect = false;\n $atLeastOneIncorrect = false;\n foreach ($this->element->options as $option) {\n if (isset($answers[$questionId][$this->element->id]['textAnswer'])) {\n continue;\n }\n\n //The option is marked as correct but the submission does not exist, mark as incorrect\n if (\n $option->correct &&\n array_search($option->id, $answers[$questionId][$this->element->id]['answer']) === false\n ) {\n $atLeastOneIncorrect = true;\n } elseif (\n !$option->correct &&\n array_search($option->id, $answers[$questionId][$this->element->id]['answer']) !== false\n ) {\n $atLeastOneIncorrect = true;\n } elseif (\n $option->correct &&\n array_search($option->id, $answers[$questionId][$this->element->id]['answer']) !== false\n ) {\n $atLeastOneCorrect = true;\n }\n }\n\n if ($atLeastOneCorrect && $atLeastOneIncorrect) {\n return true;\n }\n\n return false;\n }", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "public function acceptsMultipleAnswers() {\n\t\treturn ($this->getMultipleAnswer() == 1);\n\t}", "public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );\n\t}", "function hasAnswers() {\n\t\t$answers = $this->getAnswers();\n\t\tif(sizeof($answers) > 0) {\n\t\t\t$hasAnswers = true;\n\t\t} else {\n\t\t\t$hasAnswers = false;\n\t\t}\n\t\t\n\t\treturn $hasAnswers;\n\t}", "private function check_finish_inputs()\n {\n $output = [];\n if (!isset($_POST[\"token\"]) || !isset($_POST[\"exam_id\"]) || !isset($_POST[\"corrects\"]) || !isset($_POST[\"wrongs\"]) || !isset($_POST[\"emptys\"]))\n return false;\n\n if (empty($_POST[\"token\"]) || empty($_POST[\"exam_id\"]) || empty($_POST[\"corrects\"]) || empty($_POST[\"wrongs\"]) || empty($_POST[\"emptys\"]))\n return false;\n\n $output = [\n (string) \"token\" => $_POST[\"token\"],\n (int) \"exam_id\" => $_POST[\"exma_id\"],\n (array) \"corrects\" => json_decode($_POST[\"corrects\"]),\n (array) \"wrongs\" => json_decode($_POST[\"wrongs\"]),\n (array) \"emptys\" => json_decode($_POST[\"emptys\"]),\n ];\n\n return $output;\n }", "public function finishExam(Request $request, $slug)\n {\n \n $quiz = Quiz::getRecordWithSlug($slug);\n\n if($this->examSession('check'))\n {\n flash('Ooops..!','exam_already_submitted', 'info');\n return redirect($this->getRedirectUrl()); \n }\n \n $this->examSession('exam_completed');\n\n if($isValid = $this->isValidRecord($quiz))\n return redirect($isValid);\n\n $input_data = Input::all();\n $answers = array();\n $time_spent = $request->time_spent;\n \n //Remove _token key from answers data prepare the list of answers at one place\n foreach ($input_data as $key => $value) {\n if($key=='_token' || $key=='time_spent')\n continue;\n $answers[$key] = $value;\n }\n\n\n //Get the list of questions and prepare the list at one place\n //This is to find the unanswered questions\n //List the unanswered questions list at one place\n $questions = DB::table('questionbank_quizzes')->select('questionbank_id', 'subject_id')\n ->where('quize_id','=',$quiz->id)\n ->get();\n \n \n $subject = [];\n $time_spent_not_answered = [];\n $not_answered_questions = [];\n\n foreach($questions as $q)\n {\n \n $subject_id = $q->subject_id;\n if(! array_key_exists($q->subject_id, $subject)) {\n $subject[$subject_id]['subject_id'] = $subject_id;\n $subject[$subject_id]['correct_answers'] = 0;\n $subject[$subject_id]['wrong_answers'] = 0;\n $subject[$subject_id]['not_answered'] = 0;\n $subject[$subject_id]['time_spent'] = 0;\n $subject[$subject_id]['time_to_spend'] = 0;\n $subject[$subject_id]['time_spent_correct_answers'] = 0;\n $subject[$subject_id]['time_spent_wrong_answers'] = 0;\n }\n if(! array_key_exists($q->questionbank_id, $answers)){\n $subject[$subject_id]['not_answered'] += 1;\n $not_answered_questions[] = $q->questionbank_id;\n $time_spent_not_answered[$q->questionbank_id]['time_to_spend'] = 0;\n $time_spent_not_answered[$q->questionbank_id]['time_spent'] = $time_spent[$q->questionbank_id];\n $subject[$subject_id]['time_spent'] += $time_spent[$q->questionbank_id];\n }\n }\n \n $result = $this->processAnswers($answers, $subject, $time_spent, $quiz->negative_mark);\n $result['not_answered_questions'] = json_encode($not_answered_questions);\n $result['time_spent_not_answered_questions'] = json_encode($time_spent_not_answered);\n \n $result = (object) $result;\n $answers = json_encode($answers);\n \n $record = new QuizResult();\n $record->quiz_id = $quiz->id;\n $record->user_id = Auth::user()->id;\n $record->marks_obtained = $result->marks_obtained;\n $record->total_marks = $quiz->total_marks;\n $record->percentage = $this->getPercentage($result->marks_obtained, $quiz->total_marks);\n \n $exam_status = 'pending';\n if($record->percentage >= $quiz->pass_percentage)\n $exam_status = 'pass';\n else\n $exam_status = 'fail';\n\n $record->exam_status = $exam_status;\n $record->answers = $answers;\n $record->subject_analysis = $result->subject_analysis;\n $record->correct_answer_questions = $result->correct_answer_questions;\n $record->wrong_answer_questions = $result->wrong_answer_questions;\n $record->not_answered_questions = $result->not_answered_questions;\n $record->time_spent_correct_answer_questions = $result->time_spent_correct_answer_questions;\n $record->time_spent_wrong_answer_questions = $result->time_spent_wrong_answer_questions;\n $record->time_spent_not_answered_questions = $result->time_spent_not_answered_questions;\n\n $record->slug = getHashCode();\n $user_record = Auth::user();\n \n $content = 'You have attempted exam. The score percentage is '.formatPercentage($record->percentage);\n \n $record->save();\n\n try{\n sendEmail('exam-result', array('user_name' => $user->username,'content'=> $content, 'to_email' => Auth::user()->email));\n }\n catch(Exception $ex)\n {\n\n }\n\n $topperStatus = false;\n $data['isUserTopper'] = $topperStatus;\n $data['rank_details'] = FALSE;\n $data['quiz'] = $quiz;\n $data['active_class'] = 'exams';\n $data['title'] = $quiz->title;\n $data['record'] = $record;\n\n $data['user'] = $user_record;\n \n //Chart Data START\n $color_correct = getColor('background', rand(1,999));\n $color_wrong = getColor('background', rand(1,999));\n $color_not_attempted = getColor('background', rand(1,999));\n\n $labels_marks = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $dataset_marks = [count(json_decode($record->correct_answer_questions)),\n count(json_decode($record->wrong_answer_questions)), \n count(json_decode($record->not_answered_questions))];\n\n $dataset_label_marks = \"Marks\";\n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n $chart_data['type'] = 'doughnut';\n $chart_data['data'] = (object) array(\n 'labels' => $labels_marks,\n 'dataset' => $dataset_marks,\n 'dataset_label' => $dataset_label_marks,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['marks_data'][] = (object)$chart_data; \n\n \n $time_spent = 0;\n foreach(json_decode($record->time_spent_correct_answer_questions) as $rec)\n {\n $time_spent += $rec->time_spent;\n }\n foreach(json_decode($record->time_spent_wrong_answer_questions) as $rec)\n {\n $time_spent += $rec->time_spent;\n }\n foreach(json_decode($record->time_spent_not_answered_questions) as $rec)\n {\n $time_spent += $rec->time_spent;\n }\n\n //Time Chart Data\n $color_correct = getColor('background', rand(1,999));\n $color_wrong = getColor('background', rand(1,999));\n $color_not_attempted = getColor('background', rand(1,999));\n $total_time = $quiz->dueration*60;\n $total_time_spent = ($time_spent);\n \n $labels_time = [getPhrase('total_time').' (sec)', getPhrase('consumed_time').' (sec)'];\n $dataset_time = [ $total_time, $time_spent];\n\n $dataset_label_time = \"Time in sec\";\n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n $chart_data['type'] = 'pie';\n $chart_data['data'] = (object) array(\n 'labels' => $labels_time,\n 'dataset' => $dataset_time,\n 'dataset_label' => $dataset_label_time,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$chart_data; \n \n //Chart Data END\n\n $quizrecordObject = new QuizResult();\n $history = array();\n $history = $quizrecordObject->getHistory();\n\n $toppers = array();\n\n $data['toppers'] = $toppers;\n $data['block_navigation'] = TRUE;\n \n return view('student.exams.results', $data);\n }", "function submitMulti($cID, $tID){\n\t$questions = Contest :: get_contest_questions($cID);\n\t$sub_array = array();\n\n\t// Get an array of unsubmitted questions \n\t$newQuests = filter_questions($questions, Submission :: get_submissions_by_team_and_contest($tID, $cID));\n\n\tforeach($newQuests as $quest){\t\t\t\t\n\t\t$folderID = File_Functions :: get_folder_for_question_team($tID, $quest);\n\t\t$fileID = File_Functions :: first_file($folderID);\n\t\t$info = File_Functions :: retrieve_file($fileID);\n\t\t\n\t\t$submission_stat = Submission::add_submission($quest, $tID, $info['content']);\n\t\t\n\t\tif(!is_numeric($submission_stat))\n\t\t\treturn json_encode(array('stat' => $submission_stat));\n\t\t\n\t\t$sub_array[] = $submission_stat;\n\t}\n\t\n\techo json_encode(array('stat' => '', 'subs' => $sub_array));\n}", "function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}", "public function submitExam(Request $request) {\n $existEpe = Epe::find($request->epe_id);\n\n\n $epe = Epe::with(array('Subject'))->find($request->epe_id);\n\n\n// $examMark = $markDistribution->objective;\n //$passMark = $markDistribution->epe_passing_mark;\n //$passed = 2; //Assumed that; student has failed initially\n\n\n $markList = EpeToQuestion::where('epe_id', $epe->id)->pluck('mark', 'question_id')->toArray();\n $questionArr = array();\n if ($epe->questionnaire_format == '1') {\n $qid = $request->question_id;\n if (!empty($qid)) {\n $questionArr = Question::where('id', $qid)->select('id', 'type_id', 'mcq_answer', 'ftb_answer', 'tf_answer', 'match_answer')->get();\n }\n } else {\n $qidArr = $request->question_id;\n if (!empty($qidArr)) {\n $questionArr = Question::whereIn('id', $qidArr)->select('id', 'type_id', 'mcq_answer', 'ftb_answer', 'tf_answer', 'match_answer')->get();\n }\n }\n $examData = array();\n $corretArr = array();\n if (!$questionArr->isEmpty()) {\n foreach ($questionArr as $question) {\n $examData[$question->id]['epe_mark_id'] = $request->epe_mark_id;\n $examData[$question->id]['question_id'] = $question->id;\n\n if ($question->type_id == '1') {\n $corretArr[$question->id] = $question->mcq_answer;\n } else if ($question->type_id == '3') {\n $corretArr[$question->id] = trim($question->ftb_answer);\n } else if ($question->type_id == '5') {\n $corretArr[$question->id] = $question->tf_answer;\n } else if ($question->type_id == '6') {\n $corretArr[$question->id] = $question->id;\n } else if ($question->type_id == '4') {\n $corretArr[$question->id] = NULL;\n }\n\n $examData[$question->id]['correct_answer'] = $corretArr[$question->id];\n\n //Follwing data will be overrided later\n $examData[$question->id]['submitted_answer'] = '';\n $examData[$question->id]['correct'] = NULL;\n $examData[$question->id]['final_mark'] = null;\n }\n }\n $answerArr = $request->question;\n\n $totalMark = 0;\n if (!empty($answerArr)) {\n foreach ($answerArr as $qid => $val) {\n $examData[$qid]['submitted_answer'] = $val;\n if (!empty($val)) {\n $examData[$qid]['correct'] = 0;\n }\n\n // if (strtolower(trim($val)) == strtolower($corretArr[$qid])) {\n if (strcasecmp(trim($val), $corretArr[$qid]) == 0) { //Added by bakibilah\n $examData[$qid]['correct'] = 1;\n //$examData[$qid]['ds_mark'] = !empty($markList[$qid])?$markList[$qid]:null;\n $examData[$qid]['final_mark'] = !empty($markList[$qid]) ? $markList[$qid] : null;\n $totalMark++;\n }\n }\n }\n //Insert data into details table\n EpeMarkDetails::insert($examData);\n\n // one to one start\n if ($epe->questionnaire_format == '1') {\n $epeQusSumArr = EpeQusSubmitDetails::where('epe_id', $existEpe->id)\n ->where('employee_id', Auth::user()->id)\n ->where('question_id', $qid)->first();\n if (!empty($epeQusSumArr)) {\n EpeQusSubmitDetails::where('epe_id', $existEpe->id)\n ->where('employee_id', Auth::user()->id)\n ->where('question_id', $qid)->delete();\n $seriarArr = EpeQusSubmitDetails::where('epe_id', $epe->id)->where('employee_id', Auth::user()->id)\n ->orderBy('serial_id','asc')->first();\n if (empty($seriarArr)) {\n $target = EpeMark::find($request->epe_mark_id);\n $target->objective_submission_time = date('Y-m-d H:i:s');\n $target->objective_earned_mark = null;\n $target->objective_no_of_question = $epe->obj_no_question;\n $target->objective_no_correct_answer = null;\n $target->submitted = 1; //Objective submitted\n $target->save();\n EpeQusSubmitDetails::where('epe_id', $existEpe->id)\n ->where('employee_id', Auth::user()->id)->delete();\n Session::forget('epeExam');\n return Response::json(['success' => true, 'url' => URL::to('/subjectiveComplete?id=' . $existEpe->id)], 200);\n } else {\n $epeToQusArr = EpeToQuestion::where('epe_id', $existEpe->id)\n ->where('question_id', $seriarArr->question_id)->first();\n $currentTime1 = date(\"H:i:s\");\n $time = \"$epeToQusArr->time\";\n $parsed = date_parse($time);\n $seconds = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n $result = date(\"H:i:s\", strtotime('+' . $seconds . 'seconds', strtotime($currentTime1)));\n EpeQusSubmitDetails::where('epe_id', $existEpe->id)->where('employee_id', Auth::user()->id)\n ->where('serial_id', $seriarArr->serial_id)\n ->update(array('time' => $result));\n return Response::json(['success' => true, 'url' => URL::to('/epeExam?id=' . $request->epe_id)], 200);\n }\n }\n } else {\n $target = EpeMark::find($request->epe_mark_id);\n $target->objective_submission_time = date('Y-m-d H:i:s');\n $target->objective_earned_mark = null;\n $target->objective_no_of_question = $epe->obj_no_question;\n $target->objective_no_correct_answer = null;\n $target->submitted = 1; //Objective submitted\n $target->save();\n Session::forget('epeExam');\n return Response::json(['success' => true, 'url' => URL::to('/subjectiveComplete?id=' . $existEpe->id)], 200);\n }\n\n\n // one to one end\n }", "public static function OrderProcessHasBeenMarkedAsCompleted()\n {\n return array_key_exists(self::SESSION_KEY_NAME_ORDER_SUCCESS, $_SESSION) && true == $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS];\n }", "public function update_submission($hash, $data, $current_page = 0, $complete = FALSE)\n\t{\n\t\t// Get previously created survey submission\n\t\t$query = $this->db->where('hash', $hash)->limit(1)->get('vwm_surveys_submissions');\n\n\t\t// Make sure that this submission exists\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\n\t\t\t// Combine old and new submission data\n\t\t\t$previous_data = json_decode($row->data, TRUE);\n\t\t\t$new_data = $previous_data;\n\n\t\t\tforeach($data as $question_id => $question_data)\n\t\t\t{\n\t\t\t\t$new_data[ $question_id ] = $question_data;\n\t\t\t}\n\n\t\t\t$new_data = json_encode($new_data);\n\n\t\t\t$data = array(\n\t\t\t\t'data' => $new_data,\n\t\t\t\t'updated' => time(),\n\t\t\t\t'completed' => $complete ? time() : NULL,\n\t\t\t\t'current_page' => $current_page,\n\t\t\t);\n\n\t\t\t$this->db\n\t\t\t\t->where('hash', $hash)\n\t\t\t\t->update('vwm_surveys_submissions', $data);\n\n\t\t\treturn $this->db->affected_rows() > 0 ? TRUE : FALSE;\n\t\t}\n\t\t// If this submission does not exist\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function submitEvaluation($arrayQuestion){\n\n\t\tglobal $conn;\n\n\t\t$numberRightAnswer = 0;\n\n\t\tfor($i = 0; $i < count($arrayQuestion); $i++){\n\n\t\t\t$questionId = $arrayQuestion[$i]['questionId'];\n\t\t\t$answer = $arrayQuestion[$i]['answer'];\t\n\t\t\t\n\t\t\tif(isQuestionAnswerCorrect($questionId, $answer) == 1){\n\n\t\t\t\t$numberRightAnswer++;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $numberRightAnswer/(count($arrayQuestion));\n\n\t}", "public function isSubmitted($classID) {\n $row = $this->db->where('key', $this->__buildClazzKey($classID))->limit(1)->get('score_meta')->row();\n return $row != NULL && $row->value == 'true';\n }", "public function hasCheckedAnswers()\n {\n return $this->fieldIsAgreed('checkedAnswers');\n }", "public function is_empty(stdClass $submission) { //called on save\r\n return $this->count_codehandin_submission($submission->id, ASSIGNSUBMISSION_CODEHANDIN_FILEAREA) == 0;\r\n }", "public function evalGradeExists(User $user, Collection $submissions = null)\n {\n if(!$submissions){\n $submissions = $this->submissions;\n }\n $list = $submissions->pluck('id');\n $userGrade = $user->grades()->whereIn('submission_id', $list)->get();\n return !$userGrade->isEmpty();\n\n }", "function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a school\n\t\t\t$result = $this->_job->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('save'=>'saved', 'archive'=>'archived');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The job has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The job could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_job';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t}", "public function getReadyForCompletion() {\n\t\t$ready = $this->getExerciseReadyForCompletion();\n\n\t\t//Is there a question\n\t\tif(count($this->questions) == 0) {\n\t\t\t$ready = 0;\n\t\t} else {\n\t\t\tforeach($this->questions as $question) {\n\t\t\t\t//Is the question filled out\n\t\t\t\t$questionText = $question->getText();\n\t\t\t\tif(empty($questionText)) {\n\t\t\t\t\t$ready= 0;\n\t\t\t\t} else {\n\t\t\t\t\t$possibleAnswers = $question->getPossibleAnswers();\n\t\t\t\t\t//Does it have atleast 2 possible answers\n\t\t\t\t\tif(count($possibleAnswers) < 2) {\n\t\t\t\t\t\t$ready = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($possibleAnswers as $possibleAnswer) {\n\t\t\t\t\t\t\t//Does each answer have a text\n\t\t\t\t\t\t\t$answerText = $possibleAnswer->getText();\n\t\t\t\t\t\t\tif(empty($answerText)) {\n\t\t\t\t\t\t\t\t$ready= 0;\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\t\treturn $ready;\n\t}", "private function is_multiple_choice($questions) {\n $is_multiple_choice = true;\n \n foreach ($questions->options->anwsers as $answer) {\n if ($answer->fraction == 1) {\n $is_multiple_choice = false;\n break;\n }\n }\n\n return $is_multiple_choice;\n }", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "public function checkDataSubmission() {\n\t\t$this->main('', array());\n }", "public function hasFinishScore(){\n return $this->_has(3);\n }", "public function checkSubmitStep($h)\n {\n // get functions\n $funcs = new SubmitFunctions();\n\n switch ($h->pageName)\n {\n // SUBMIT STEP 1\n case 'submit':\n case 'submit1':\n // set properties\n $h->pageName = 'submit1';\n $h->pageType = 'submit';\n $h->pageTitle = $h->lang[\"submit_step1\"];\n $this->doSubmit1($h, $funcs);\n break;\n \n // SUBMIT STEP 2 \n case 'submit2':\n // set properties\n $h->pageType = 'submit';\n $h->pageTitle = $h->lang[\"submit_step2\"];\n $this->doSubmit2($h, $funcs);\n break;\n \n // SUBMIT STEP 3\n case 'submit3':\n $h->pageType = 'submit';\n $h->pageTitle = $h->lang[\"submit_step3\"];\n $this->doSubmit3($h, $funcs);\n break;\n \n // SUBMIT CONFIRM\n case 'submit_confirm':\n $this->doSubmitConfirm($h, $funcs);\n break;\n \n // EDIT POST (after submission)\n case 'edit_post':\n $h->pageType = 'submit';\n $h->pageTitle = $h->lang[\"submit_edit_title\"];\n $this->doSubmitEdit($h, $funcs);\n break;\n }\n }", "public function isSubmitted()\n\t{\n\t\tif ($this->http_method == 'get') {\n\t\t\t// GET form is always submitted\n\t\t\treturn TRUE;\n\t\t} else if (isset($this->raw_input['__'])) {\n\t\t\t$__ = $this->raw_input['__'];\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ((array) $__ as $token => $x) {\n\t\t\t$t = static::validateFormToken($token, $this->id);\n\t\t\tif ($t !== FALSE) {\n\t\t\t\t// Submitted\n\t\t\t\tif ($this->form_ttl > 0 && time() - $t > $this->form_ttl) {\n\t\t\t\t\t$this->form_errors[self::E_FORM_EXPIRED] = array(\n\t\t\t\t\t\t'message' => _('The form has expired, please check entered data and submit it again.')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "private function get_user_submissions($submission_hahses)\n\t{\n\t\tself::$user_submissions = array();\n\n\t\t$member_id = $this->session->userdata('member_id');\n\n\t\t// Make sure we have a member ID or some submission hashes to check\n\t\tif ( $member_id OR $submission_hahses )\n\t\t{\n\t\t\t// If we have a member ID\n\t\t\tif ($member_id)\n\t\t\t{\n\t\t\t\t$this->db\n\t\t\t\t\t->where('member_id', $member_id)\n\t\t\t\t\t->or_where_in('hash', $submission_hahses ? $submission_hahses : ''); // CI does not like an empty array\n\t\t\t}\n\t\t\t// If we only have submission hashes\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where_in('hash', $submission_hahses);\n\t\t\t}\n\n\t\t\t$query = $this->db\n\t\t\t\t->order_by('completed, updated, created', 'DESC')\n\t\t\t\t->get('vwm_surveys_submissions');\n\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t// Loop through each submission\n\t\t\t\tforeach ($query->result() as $row)\n\t\t\t\t{\n\t\t\t\t\t// First key is either \"completed\" or \"progress\", second is survey ID, and value is the submission hash\n\t\t\t\t\tself::$user_submissions[ $row->completed ? 'complete' : 'progress' ][ $row->survey_id ] = $row->hash;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function user_submissions_progress($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some surveys in progress return an array of their hashes\n\t\treturn isset(self::$user_submissions['progress']) ? self::$user_submissions['progress'] : array();\n\t}", "public static function fields_has_survey( $fields ) {\n\n\t\tif ( ! empty( $fields ) && is_array( $fields ) ) {\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\tif ( self::field_has_survey( $field ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasCheckInTaskList(){\n return $this->_has(2);\n }", "public function check_and_filter_answers($form) {\n $tags = $this->part_tags();\n $res = (object)array('answers' => array());\n foreach ($form->answermark as $i => $a) {\n if ((strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0)\n && (strlen(trim($form->subqtext[$i]['text'])) != 0\n || strlen(trim($form->feedback[$i]['text'])) != 0\n || strlen(trim($form->vars1[$i])) != 0\n )\n ) {\n $res->errors[\"answer[$i]\"] = get_string('error_answer_missing', 'qtype_formulas');\n $skip = true;\n }\n if (strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0) {\n continue; // If no mark or no answer, then skip this answer.\n }\n if (floatval($form->answermark[$i]) <= 0) {\n $res->errors[\"answermark[$i]\"] = get_string('error_mark', 'qtype_formulas');\n }\n $skip = false;\n if (strlen(trim($form->correctness[$i])) == 0) {\n $res->errors[\"correctness[$i]\"] = get_string('error_criterion', 'qtype_formulas');\n $skip = true;\n }\n if ($skip) {\n continue; // If no answer or correctness conditions, it cannot check other parts, so skip.\n }\n $res->answers[$i] = new stdClass();\n $res->answers[$i]->questionid = $form->id;\n foreach ($tags as $tag) {\n $res->answers[$i]->{$tag} = trim($form->{$tag}[$i]);\n }\n\n $subqtext = array();\n $subqtext['text'] = $form->subqtext[$i]['text'];\n $subqtext['format'] = $form->subqtext[$i]['format'];\n if (isset($form->subqtext[$i]['itemid'])) {\n $subqtext['itemid'] = $form->subqtext[$i]['itemid'];\n }\n $res->answers[$i]->subqtext = $subqtext;\n\n $fb = array();\n $fb['text'] = $form->feedback[$i]['text'];\n $fb['format'] = $form->feedback[$i]['format'];\n if (isset($form->feedback[$i]['itemid'])) {\n $fb['itemid'] = $form->feedback[$i]['itemid'];\n }\n $res->answers[$i]->feedback = $fb;\n\n $fb = array();\n $fb['text'] = $form->partcorrectfb[$i]['text'];\n $fb['format'] = $form->partcorrectfb[$i]['format'];\n if (isset($form->partcorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partcorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partcorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partpartiallycorrectfb[$i]['text'];\n $fb['format'] = $form->partpartiallycorrectfb[$i]['format'];\n if (isset($form->partpartiallycorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partpartiallycorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partpartiallycorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partincorrectfb[$i]['text'];\n $fb['format'] = $form->partincorrectfb[$i]['format'];\n if (isset($form->partincorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partincorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partincorrectfb = $fb;\n }\n if (count($res->answers) == 0) {\n $res->errors[\"answermark[0]\"] = get_string('error_no_answer', 'qtype_formulas');\n }\n\n return $res;\n }", "public function has_submitted($memberid) {\n return !empty($this->redscores[$memberid]);\n }", "private function has_submission_field($user_id)\n {\n $this->db->where('umeta_key', 'submissions');\n $this->db->where('user_id', $user_id);\n\n $result = $this->db->get('user_meta');\n\n return ($result->num_rows() == 1) ? $result->row('umeta_value') : FALSE;\n }", "public function isAllStepsCompleted()\n {\n $completedSteps = count($this->getCompletedSettingsSteps());\n $status = ($completedSteps == 5) ? true : false;\n\n return $status;\n }", "public function check(array $qas, array $answers)\n {\n $percentages = [];\n $correct = [];\n\n foreach ($qas as $id => $qa) {\n if (!$answers[$id]) {\n $percentages[$id] = 0;\n continue;\n }\n $percentages[$id] = 0;\n $correct[$id] = 0;\n /** @var Answer $answer */\n foreach ($qa->answers as $answer) {\n if ($answer->correct && isset($answers[$id][$answer->id])) {\n $percentages[$id]++;\n $correct[$id]++;\n } elseif ($answer->correct) {\n $correct[$id]++;\n }\n }\n $percentages[$id] = $percentages[$id] / $correct[$id] * 100;\n }\n\n $percentages['final'] = array_sum($percentages) / count($percentages);\n\n return $percentages;\n }", "protected function submitted ($post)\n\t{\n\t\treturn isset ($post['BoothNum']);\n\t}", "public static function verifyPostValue($array)\n {\n foreach ($array as $item) {\n if (!(isset($_POST[$item]) && $_POST[$item] != '')) {\n return false;\n }\n }\n return true;\n }", "public function get_completed_survey_submissions($id, $completed_since = NULL)\n\t{\n\t\t$data = array();\n\n\t\t$this->db\n\t\t\t->order_by('completed', 'ASC')\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('survey_id', $id);\n\n\t\t// If completed_since is set, only grab completed submissions AFTER that date\n\t\tif ($completed_since != NULL)\n\t\t{\n\t\t\t$this->db->where('completed >=', $completed_since);\n\t\t}\n\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ $row->id ] = array(\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'data' => json_decode($row->data, TRUE),\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'current_page' => (int)$row->current_page,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function can_submit_brief_research_proposal(ResearchRequest $researchRequest)\n {\n return in_array(auth()->user()->id, $researchRequest->researchRequestReceivers->pluck('to')->toArray());\n }", "public function isSubmitted() {\n return $this->submitted;\n }", "public function IsSubmitted() {\n\n if ($this->HttpValues === null) {\n // HTTP submision's data are not imported? import them now from Request service.\n $this->SetHttpValues();\n }\n return isset($this->HttpValues['_FormName'])\n && $this->HttpValues['_FormName'] === $this->Name;\n }", "function learndash_get_submitted_essay_data( $quiz_id, $question_id, $essay ) {\n\t$users_quiz_data = get_user_meta( $essay->post_author, '_sfwd-quizzes', true );\n\tif ( ( !empty( $users_quiz_data ) ) && ( is_array( $users_quiz_data ) ) ) {\n\t\tif ( ( $essay ) && ( is_a( $essay, 'WP_Post' ) ) ) {\n\t\t\t$essay_quiz_time = get_post_meta( $essay->ID, 'quiz_time', true );\n\t\t} else {\n\t\t\t$essay_quiz_time = null;\n\t\t}\n\n\t\tforeach ( $users_quiz_data as $quiz_data ) {\n\t\t\t// We check for a match on the quiz time from the essay postmeta first. \n\t\t\t// If the essay_quiz_time is not empty and does NOT match then continue;\n\t\t\tif ( ( absint( $essay_quiz_time ) ) && ( isset( $quiz_data['time'] ) ) && ( absint( $essay_quiz_time ) !== absint( $quiz_data['time'] ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (empty($quiz_data['pro_quizid']) || $quiz_id != $quiz_data['pro_quizid'] || ! isset( $quiz_data['has_graded'] ) || false == $quiz_data['has_graded'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((isset($quiz_data['graded'])) && (!empty($quiz_data['graded']))) {\n\t\t\t\tforeach ( $quiz_data['graded'] as $key => $graded_question ) {\n\t\t\t\t\tif ( ( $key == $question_id ) && ( $essay->ID == $graded_question['post_id'] ) ) {\n\t\t\t\t\t\treturn $quiz_data['graded'][ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function is_more_interesting_submission($subm_a, $subm_b) {\n\t\tif ($subm_b === false || $subm_b === null) return true;\n\t\t// keep the last/best one\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$status_a = Status::base_status_group($subm_a->status);\n\t\t\t$status_b = Status::base_status_group($subm_b->status);\n\t\t\tif ($status_a > $status_b) return true;\n\t\t\tif ($status_a < $status_b) return false;\n\t\t}\n\t\treturn $subm_a->time >= $subm_b->time;\n\t}", "public function can_create_a_checked_answere_with_valid_submission_media()\n {\n $this->create_user('admin');\n $challenge = $this->create(\"Challenge\", [\n \"game_type\" => \"text_answere\",\n \"game_id\" => $this->create(\"GameTextAnswere\")->id,\n \"playfield_type\" => \"city\",\n \"playfield_id\" => $this->create(\"City\")->id,\n ]);\n\n $body = [\n \"challenge_id\" => $challenge->id,\n \"user_id\" => $this->create(\"User\")->id,\n \"answere\" => \"ajsdj huasf oiioe iewa saijsa.\",\n \"score\" => 1200\n ];\n\n $files = [ \n \"submission\" => [\n UploadedFile::fake()->image(\"liverpool.jpg\") \n ]\n ];\n\n $res = $this->json(\"POST\", \"/$this->api_base/checked\", array_merge($body, $files));\n\n // Then\n $res->assertStatus(201)\n ->assertJsonStructure([\n \"data\" => [\n \"id\",\n \"answere\",\n \"score\",\n \"created_at\",\n \"user\" => [\n \"id\",\n \"email\",\n \"phone\",\n \"email_verified_at\",\n \"first_name\",\n \"family_name\",\n \"age\",\n \"gender\",\n \"score\",\n \"created_at\"\n ],\n \"challenge\" => [\n \"id\",\n \"sort_order\",\n \"created_at\",\n \"playfield\" => [\n \"id\",\n \"type\",\n \"short_code\",\n \"name\",\n \"created_at\"\n ],\n \"game\" => [\n \"id\",\n \"type\",\n \"title\",\n \"content_text\",\n \"correct_answere\",\n \"points_min\",\n \"points_max\",\n \"created_at\"\n ]\n ],\n \"media_submission\" => [\n \"*\" => [\n \"def\",\n \"md\",\n \"sm\",\n \"thumb\"\n ]\n ] \n ]\n ]);\n\n // assert if the game has been added to the database\n $this->assertDatabaseHas(\"answere_checkeds\", $body);\n\n // assert if the files are uploaded to storage\n // Check if db file media data urls actually exist as files in storage\n if($stored_header_files_array = $this->spread_media_urls($res->getData()->data->media_submission)){\n \\Storage::disk(\"test\")->assertExists($stored_header_files_array);\n }\n }", "public function isSubmitted() {\n return $this->submitted;\n }", "function ifSamePrereqs($mysqli, $id, $prereq_id){\n\t\t$sql = $mysqli->query(\"\n\t\t\tSELECT COALESCE(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT GROUP_CONCAT(p.Pre_Requisite) \n\t\t\t\t\t\t\tFROM pre_requisites p \n\t\t\t\t\t\t\tWHERE p.Course_ID = $id \n\t\t\t\t\t\t\tORDER BY p.Pre_Requisite\n\t\t\t\t\t\t),'0'\n\t\t\t\t\t)='$prereq_id' AS 'ifSamePrereqs'\n\t\t\");\n\t\tif ($result = $sql) {\n\t\t\twhile ($obj = $result -> fetch_object()){\n\t\t\t\treturn $obj->ifSamePrereqs;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function isAllSwagPostItemsCompleted($swagUser)\n {\n foreach ($this->getSwagPostItems() as $swagPostItem) {\n if (!$swagPostItem->isCompleted($swagUser)) {\n return false;\n }\n\n }\n\n return true;\n }", "function edd_pup_is_processing( $emailid = null ) {\r\n\tif ( empty( $emailid ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t$email_list = edd_pup_emails_processing();\r\n\r\n\tif ( is_array( $email_list['processing'] ) && in_array( $emailid, $email_list['processing'] ) ) {\r\n\r\n\t\t$totals = edd_pup_check_queue( $emailid );\r\n\r\n\t\tif ( $totals['queue'] > 0 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n}", "public function hasRecruitments() {\n return $this->_has(4);\n }", "public function checksubaward($shortnumber,$shortarray){\n\t\tif (in_array($shortnumber, $shortarray)){\n\t\t\treturn \"checked\";\n\t\t}\n\t}", "function submissionsOpen($resolutionRow) {\n if ($resolutionRow['status'] == 'pending') {\n return true;\n } else if (($resolutionRow['status'] == 'in_session') && ($resolutionRow['speakers'] < 2)) {\n return true;\n } else {\n return false;\n }\n}", "public function process_answers($data) {\n # Set page id\n if (isset($data[TOOLKIT_TAG . '_page_id'])) {\n $pageID = $data[TOOLKIT_TAG . '_page_id'];\n \n # Loop through page questions\n $pageQuestions = $this->obj_page_generator->get_page_questions($pageID);\n\n foreach ($pageQuestions as $questionID => $question) {\n switch ($question['type']) {\n case SC_Survey_Constructor::TYPE_MATRIX:\n case SC_Survey_Constructor::TYPE_CHECKTRIX:\n foreach ($question['subquestions'] as $subquestionID => $subquestion) {\n $this->store_answer($data, $questionID, $subquestionID);\n }\n break;\n\n case SC_Survey_Constructor::TYPE_RADIO:\n $this->store_answer($data, $questionID);\n if (isset($question['other']) && $data[$questionID] === $question['other']['value']) {\n $this->store_answer($data, $questionID . '-specific-input');\n }\n break;\n\n default:\n $this->store_answer($data, $questionID);\n break;\n }\n }\n\n return array_keys($pageQuestions);\n \n } else { //No page id was posted\n return FALSE;\n }\n }", "public function allows_submission() {\n if (!$submission = $this->submission_settings) {\n return false;\n }\n\n $allowed = false;\n\n // Save buttons.\n foreach ($this->submission_buttons as $name) {\n if ($name == 'cancel') {\n continue;\n }\n if (array_key_exists($name, $submission)) {\n $allowed = true;\n break;\n }\n }\n\n return $allowed;\n }", "function what_questions_can_be_answered( $survey_info, $survey_id, $number_of_questions, $old_answers )\n{\n\tglobal $db;\n\t// the first if clause checks to see if there are any response caps in the survey\n\tif( str_replace('|', '', $survey_info['question_response_caps']) )\n\t{\n\t\t// if we get here there are response caps in the survey, so we explode $question_sums and $response_caps so we can\n\t\t// figure out which questions have hit the cap\n\t\t$question_sums = explode(\"|\", $survey_info['question_sums']);\n\t\t$question_selected_text = explode(\"|\", $survey_info['question_selected_text']);\n\t\t$question_response_caps = explode(\"|\", $survey_info['question_response_caps']);\n\t\t$group_ids = $survey_info['group_ids'];\n\n\t\t// get answers for this survey from all users\n\t\t// now do the query for the actual responses...\n\t\t$sql = \"SELECT DISTINCT u.user_id, sa.answers\n\t\t\t\tFROM \" . USERS_TABLE . \" u\n\t\t\t\tINNER JOIN \" . USER_GROUP_TABLE . \" ug ON ug.user_id = u.user_id\n\t\t\t\tINNER JOIN \" . SURVEY_ANSWERS_TABLE . \" sa ON sa.user_id = ug.user_id\n\t\t\t\tWHERE ( (ug.group_id IN ($group_ids) AND ug.user_pending = 0) OR \" . SURVEY_ALL_REGISTERED_USERS . \" IN ($group_ids) )\n\t\t\t\tAND sa.survey_id = $survey_id\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, \"Could not obtain answer data for the survey in this topic\", '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t// fetch all the answer info\n\t\t$answer_info = $db->sql_fetchrowset($result);\n\t\t$db->sql_freeresult($result);\n\n\t\t// count the number of responders\n\t\t$number_of_responders = count($answer_info);\n\n\t\t// cycle through the questions 1 by 1 in order to see if we've hit the cap for each question that has a cap\n\t\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t\t{\n\t\t\tif( $question_response_caps[$i] > 0 )\n\t\t\t{\n\t\t\t\t// if we get here, this question has a cap so loop through the responding users, get their answers and check against the relevant response cap\n\t\t\t\tfor ( $j = 0; $j < $number_of_responders; $j++ )\n\t\t\t\t{\n\t\t\t\t\t// explode all the answers of this user into an answer array\n\t\t\t\t\t$answers = explode(\"|\", $answer_info[$j]['answers']);\n\n\t\t\t\t\t// here, increment the total if the question is answered and supposed to be totalled at the bottom\n\t\t\t\t\tswitch( $question_sums[$i] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"\":\n\t\t\t\t\t\tcase SURVEY_NO_TOTAL:\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_AVERAGE_OF_NUMBERS_IN_REPSONSES:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_NUMBERS_IN_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i] = $total[$i] + $answers[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_MATCHING_TEXT:\n\t\t\t\t\t\t\t// note that I used strtolower to make this case insensitive\n\t\t\t\t\t\t\tif( strtolower($answers[$i]) == strtolower($question_selected_text[$i]) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// now set a flag to indicate for each question whether it can still be answered (i.e. whether we've hit the response cap)\n\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t{\n\t\t$questions_can_be_answered[$i] = ( $question_response_caps[$i] == 0 || $total[$i] < $question_response_caps[$i] || $old_answers[$i] ) ? TRUE : FALSE;\n\t}\n\treturn $questions_can_be_answered;\n}", "private function checkFinaliseInput(array $data) {\n\t\tif (!array_key_exists('i_agree', $data)) {\n\t\t\t$this->errors[] = \"You must agree to finalise the contract before continuing\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function submitted_events_create_pending_submissions_page() {\n\t$pending_submissions = submitted_events_get_pending_submissions ();\n\t$num_pending = sizeof ( $pending_submissions );\n\tif ($num_pending == 0) {\n\t\techo '<h2>No pending submissions</h2>';\n\t} elseif ($num_pending == 1) {\n\t\techo '<h2>There is one pending submission</h2>';\n\t} else {\n\t\techo '<h2>There are ' . $num_pending . ' pending submissions</h2>';\n\t}\n}", "public function delete_survey_submissions($survey_id)\n\t{\n\t\t$this->db->delete('vwm_surveys_submissions', array('survey_id' => $survey_id));\n\n\t\treturn $this->db->affected_rows() > 0 ? TRUE : FALSE;\n\t}", "function submission($task_id, $user_status){\n\t$answer = DB::table('tasks')->where('id',$task_id)->select('answer_type')->first();\n\t$answer_type = $answer->answer_type;\n\t$response = $response_orig;\n\t\n\t// if(sizeof($response_orig)<3 && $answer_type== \"int\"){\n\t// \t$response = \"Not enough data\";\n\t// }\n\n\tif($answer_type == \"mcq\"){\n\t\t$response = DB::table('answers')->select('answers.data as data', DB::raw(\"count('answers.data') as total\"))->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->whereNotIn('answers.data', ['null', 'timeout'])->where('users.status', $user_status)->where('answers.task_id',$task_id)->groupBy('data')->get();\n\t\t// if(sizeof($response_orig) < 3){\n\t\t// \t$response=\"Not enough data\";\n\t\t// }\n\t\t// else {\n\t\t\t$hist = [];\n\t\t\tforeach( $response as $item )\n\t\t\t\t$hist[$item->data] = $item->total;\n\t\t\tarsort($hist);\n\t\t\t$response = array_slice($hist,0,3,true);\t\n\t\t// }\n\t\t\n\t}\n\n\telse if($answer_type == \"int\"){\n \t\t$data = array_map('intval', DB::table('answers')->select('answers.data as data')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->whereNotIn('answers.data', ['null', 'timeout'])->where('users.status', $user_status)->where('answers.task_id', $task_id)->lists('data'));\n\t\t$med = array_median($data);\n\t\t$response = array('data' => $med);\n\t}\n\t\t\n\t\t// if ($total % 2 != 0)\n\t\t// \t$total += 1;\n\t\t// $median = (int)(ceil($total / 2));\n\t\t// $upper_index = (int)(ceil($total / 4) - 1);\n\t\t// $lower_index = (int)(ceil($total * 3 / 4) - 1);\n\n\t\t// $median = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($median)->limit(1)->first();\n\t\t// $median_up = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($upper_index)->limit(1)->first();\n\t\t// $median_down = DB::table('answers')->join('users', 'users.id', '=', 'answers.user_id')->where('users.is_mturk', true)->where('users.status', $user_status)->whereNotIn('answers.data', ['null', 'timeout'])->where('answers.task_id', $task_id)->orderBy(DB::raw(\"cast(answers.data as unsigned)\"), 'asc')->skip($lower_index)->limit(1)->first();\n\n\t\t// $iqr = ($median_down->data - $median_up->data);\n\t\t// $median = $median->data;\n\n\t\t//$response = array('count'=>$total, 'median'=>$median, 'first_quartile'=>$median_up, 'third_quartile' =>$median_down );\n\treturn $response;\n}", "public function is_complete_response(array $response)\n {\n //otherwise, try processing it\n try\n {\n //process the user's response\n $this->process_response($response);\n return true;\n }\n catch(SimulationException $e)\n {\n return false; \n }\n }", "function submitted_events_process_pending_submissions($pending_submissions) {\n\tforeach ( $pending_submissions as $submission ) {\n\t\tsubmitted_events_create_event ( $submission );\n\t}\n\t// tell the user how many events were created\n\t\n\tif (sizeof ( $pending_submissions ) == 0) {\n\t\techo '<h2>No pending submissions - no events created.</h2>';\n\t} else {\n\t\t$events_created_text;\n\t\tif (sizeof ( $pending_submissions ) == 1) {\n\t\t\t$events_created_text = 'one new event';\n\t\t} else {\n\t\t\t$events_created_text = sizeof ( $pending_submissions ) . ' new events';\n\t\t}\n\t\t\n\t\techo '<h2>Created ' . $events_created_text . ' - please edit and publish when ready.</h2>\n\t\t<p>Hopefully this has saved you some work!</p>';\n\t}\n}", "public function isSubmit() {\n return Tools::isSubmit($this->key());\n }", "function get_all_unmarked() {\n\n global $CFG;\n\n $sql = \"SELECT s.id as subid, s.userid, s.data2, a.course, a.assignmenttype, a.name, a.description, a.id, c.id as cmid\n FROM {$CFG->prefix}assignment a\n INNER JOIN {$CFG->prefix}course_modules c\n ON a.id = c.instance\n INNER JOIN {$CFG->prefix}assignment_submissions s\n ON s.assignment = a.id\n WHERE c.module = {$this->mainobject->modulesettings['assignment']->id}\n AND c.visible = 1\n AND a.course IN ({$this->mainobject->course_ids})\n AND s.timemarked < s.timemodified\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n ORDER BY a.id\";\n\n $unmarked = get_records_sql($sql);\n\n // Due to oracle being rubbish, there is no way to put this bit into sql as the data2 field is\n // a CLOB and so cannot be used with any kind of comparison operator.\n // It used to be:\n // AND NOT (a.assignmenttype = 'upload' AND s.data2 != 'submitted'))\n \n\n foreach ($unmarked as $key => $submission) {\n\n if (($submission->data2 != 'submitted') && ($submission->assignmenttype == 'upload')) {\n unset($unmarked[$key]);\n }\n }\n \n\n $this->all_submissions = $unmarked;\n\n return true;\n }", "public function psxFormIsCompleted()\n {\n // TODO: Remove all code related to PSX form. Since it's not used any more we return true to be sure to not make any breaking changes\n return true;\n//\n// if (getenv('PLATEFORM') === 'PSREADY') { // if on ready, the user is already onboarded\n// return true;\n// }\n//\n// return !empty($this->getPsxForm());\n }", "public function get_all_completed_checklist_data() {\n\n $completed_inspect_data = array();\n\n $query = db_select('checklist_inspections', 'c')\n ->fields('c', array('order_num','category','unit_id','nid', 'admin_notes', 'admin_approver',\n 'approved','inspected_by','repair_archive','date_submitted','follow_up_alert','comments'))\n ->condition('approved', 'approved')\n ->condition('completed', 'completed');\n $results = $query->execute();\n\n foreach ($results as $val) {\n $completed_inspect_data[] = (array) $val;\n }\n return $completed_inspect_data;\n }" ]
[ "0.6178807", "0.59711295", "0.5959456", "0.5868236", "0.5860308", "0.5852881", "0.57966447", "0.574047", "0.56483114", "0.55511385", "0.55195135", "0.5517042", "0.5457055", "0.54339623", "0.5426887", "0.54228735", "0.54208577", "0.5354125", "0.5342349", "0.533848", "0.53353405", "0.53350353", "0.5314593", "0.530779", "0.52938277", "0.52745646", "0.5260125", "0.5253789", "0.5240312", "0.52338785", "0.521093", "0.5197594", "0.51961565", "0.51879245", "0.51850915", "0.5166403", "0.51597047", "0.51593137", "0.5134958", "0.5131362", "0.51293474", "0.5126068", "0.51244456", "0.5118643", "0.5106608", "0.5087348", "0.5050888", "0.5038025", "0.5029045", "0.50096273", "0.5002659", "0.49937442", "0.4987918", "0.49865234", "0.4975006", "0.49649984", "0.495232", "0.49423882", "0.49407932", "0.4935229", "0.4926463", "0.4920863", "0.49196094", "0.49156195", "0.48937443", "0.48863313", "0.4883735", "0.4880833", "0.48739752", "0.4870477", "0.48666677", "0.48644128", "0.4863294", "0.48603964", "0.4851892", "0.48501417", "0.4849164", "0.48177442", "0.48093912", "0.480458", "0.47877133", "0.47863984", "0.47778037", "0.47565696", "0.4753341", "0.47531444", "0.4750888", "0.4743637", "0.4742066", "0.47372678", "0.47360644", "0.47225863", "0.47172537", "0.47128108", "0.4712683", "0.47119656", "0.47099325", "0.4706458", "0.4706346", "0.47047758" ]
0.6854474
0
See if the current user has progress in the provided survey
public function is_progress($survey_id) { $query = $this->db ->where('survey_id', $survey_id) ->where('completed IS NULL', NULL, TRUE) ->where('member_id', $this->session->userdata('member_id')) ->order_by('updated', 'DESC') ->limit(1) ->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { $row = $query->row(); return $row->hash; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }", "public function isCompletedByCurrentUser()\n {\n return SwagUser::getCurrent()->isSwagpathCompleted($this);\n }", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "public function getUserProgressInQuest($user, $questCode);", "public function getUserStatusInQuests($user);", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "function hasCompletedSurvey($iSurveyId, $sToken) {\n\t\t// Check if this token has already completed this survey\n\t\t$sQuery \t\t= \"SELECT completed FROM lime_tokens_$iSurveyId WHERE token = '$sToken'\";\n\t\t$oResult\t\t= $this->oDbConnection->query($sQuery);\n\t\twhile($aRow = mysqli_fetch_array($oResult)) {\n\t\t\t$isCompleted = $aRow['completed'];\n\t\t}\n\t\treturn (isset($isCompleted) && ($isCompleted != 'N'));\n\t}", "public function isCurrentUserPreparedForPrerequisites()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n if ($this->isCurrentUserPrepared()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCurrentUserPrepared()) {\n return false;\n }\n }\n\n return true;\n }", "function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "private function checkAchievementProgressUser($achievementProgressUser, $achievementRewaredAt) {\n // Checking the progress of the achievement\n if ($achievementProgressUser >= $achievementRewaredAt) {\n return true;\n } else {\n return false;\n } \n }", "protected function in_progress() {\n\t\treturn 'in_progress' === get_option( 'ratesync_sync_status' );\n\t}", "function isRead() {\n\t\t$submissionDao = Application::getSubmissionDAO();\n\t\t$userGroupDao = DAORegistry::getDAO('UserGroupDAO');\n\t\t$userStageAssignmentDao = DAORegistry::getDAO('UserStageAssignmentDAO');\n\t\t$viewsDao = DAORegistry::getDAO('ViewsDAO');\n\n\t\t$submission = $submissionDao->getById($this->getSubmissionId());\n\n\t\t// Get the user groups for this stage\n\t\t$userGroups = $userGroupDao->getUserGroupsByStage(\n\t\t\t$submission->getContextId(),\n\t\t\t$this->getStageId()\n\t\t);\n\t\twhile ($userGroup = $userGroups->next()) {\n\t\t\t$roleId = $userGroup->getRoleId();\n\t\t\tif ($roleId != ROLE_ID_MANAGER && $roleId != ROLE_ID_SUB_EDITOR) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the users assigned to this stage and user group\n\t\t\t$stageUsers = $userStageAssignmentDao->getUsersBySubmissionAndStageId(\n\t\t\t\t$this->getSubmissionId(),\n\t\t\t\t$this->getStageId(),\n\t\t\t\t$userGroup->getId()\n\t\t\t);\n\n\t\t\t// Check if any of these users have viewed it\n\t\t\twhile ($user = $stageUsers->next()) {\n\t\t\t\tif ($viewsDao->getLastViewDate(\n\t\t\t\t\tASSOC_TYPE_REVIEW_RESPONSE,\n\t\t\t\t\t$this->getId(),\n\t\t\t\t\t$user->getId()\n\t\t\t\t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function canProceed($user)\n {\n $canProceed = false;\n\n $plan = $user->plan;\n\n if ($plan != null && $plan->isActive()) {\n if ($plan->product_type == Product::TYPE_DAILY) {\n //If user's plan is daily, check if it's not exipred\n if ($plan->expire >= time()) {\n $canProceed = true;\n }\n } else if ($plan->product_type == Product::TYPE_LIMITED) {\n //If user's plan is limited check if user has enought limit to download file\n $bytesSended = DownloadJournal::getBytesSendedToUser($user, $plan->start);\n\n if ($plan->getLimitInBytes() >= $bytesSended) {\n $canProceed = true;\n }\n }\n\n if (!$canProceed && $plan != null && $plan->isActive()) {\n //User's plan is expired. Update it\n $plan->setScenario(UserPlan::SCENARIO_UPDATE);\n $plan->status = UserPlan::STATUS_EXPIRED;\n $plan->save();\n }\n }\n\n return $canProceed;\n }", "protected function _isDuringTest($questionnaire) {\n\t\treturn $questionnaire['Questionnaire']['status'] == NetCommonsBlockComponent::STATUS_PUBLISHED ? false : true;\n\t}", "public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }", "protected function isQuestionActive(){\n return $this->socialQuestion &&\n $this->socialQuestion->SocialPermissions->isActive();\n }", "function _isComplete($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\tif (($survey->getTitle()) and (count($survey->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function isAnswered( $current )\n\t{\n\t\ttry\n\t\t{\n\t\t\t$db = DB::getConnection();\n\t\t\t$st = $db->prepare( 'SELECT id_user FROM page_' . $current . ' WHERE id_user LIKE :id' );\n\t\t\t$st->execute( array( 'id' => $_SESSION['id'] ) );\n\t\t}\n\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t$row = $st->fetch();\n\t\tif( $row === false )\n\t\t\treturn false;\n\t\treturn true;\n\t}", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "function isSubmittedBy();", "public function getHasSubmitted() {\n\t\t@$cookie = $_COOKIE['promotion_' . $this->getId()];\n\t\treturn (bool) $cookie;\n\t}", "public function isprojectstudent()\n {\n return $this->hasuser() && $this->user()->isprojectstudent();\n }", "function userSurvey() {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n if (!$this->Session->check('Survey.progress')) {\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // logic for the survey process starts here\n switch ($progress) {\n case INTRO:\n $this->layout = 'intro'; // use the intro layout\n $this->render('/Elements/intro');\n break;\n case RIGHTS:\n $this->layout = 'rights'; // use the more rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent);\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function has_achieved_goal() {\r\n\t\treturn $this->get_donated_amount() >= $this->get_goal();\r\n\t}", "public function isReported(User $user)\n {\n $userId = $user->getId();\n $redis = Yii::$app->redis;\n \n $key = 'postcomplains:'.$this->id;\n \n return($redis->sismember($key, $userId)); \n }", "public function isProfileCompleted() {\n\t\tif ($this->RelatedProductsAndServices()->count() == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($this->Title) ||\n\t\t\tempty($this->Description) ||\n\t\t\tempty($this->PhoneNumber)\n\t\t) {\n\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function can_access_stats_questions( $request ) {\n\t\t\tif ( ! current_user_can( 'wpProQuiz_show_statistics' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check we have a valid Quiz ID.\n\t\t\t$quiz_id = $request->get_param( 'quiz' );\n\t\t\tif ( empty( $quiz_id ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check the Quiz has Statistics enabled.\n\t\t\t$quiz_pro_statistics_on = learndash_get_setting( $quiz_id, 'statisticsOn', true );\n\t\t\tif ( ! $quiz_pro_statistics_on ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$stat_ref_id = $request->get_param( 'statistic' );\n\t\t\t$stat_users = (array) $this->users_for_stats();\n\n\t\t\tif ( $stat_ref_id && $this->valid() ) {\n\t\t\t\t$stat_user = (int) $this->current()->getUserId();\n\t\t\t\t$stat_users = array_map( 'absint', $stat_users );\n\t\t\t\treturn empty( $stat_users ) || in_array( $stat_user, $stat_users, true );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "function tquiz_user_complete($course, $user, $mod, $tquiz) {\n}", "private function userHasResources() {\n $utenti = new MUtenti;\n foreach ($utenti->find(array(), $utenti->getPosition()) as $itemUtenti) {\n if ($itemUtenti[$_POST['nomeRisorsaOfferta']] < $_POST['quantitaOfferta']) {\n return false;\n }\n }\n return true;\n }", "function isComplete()\n\t{\n\t\tif (($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasConsented()\n {\n return $this->hasConsented;\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function isCompletedByUser($swagUser)\n {\n return $swagUser->isSwagpathCompleted($this);\n }", "public function isParticipating($id_user, $id_event) {\n \t//$participants = Participant::where('id_user', '=', $id_user, 'AND', 'id_event', '=', $id_event)->get();\n $participants = Participant::whereRaw('id_user =' . $id_user . ' and id_event=' . $id_event)->get();\n\n \treturn count($participants) >= 1;\n }", "public function present() {\n\t\tif($this->survey === null) {\n\t\t\treturn <<<HTML\n<p class=\"shoutout full\">Survey $this->tag does not exist.</p>\nHTML;\n\t\t}\n\n\t\tif($this->unavailable) {\n\t\t\treturn <<<HTML\n<p class=\"shoutout full\">Survey not available.</p>\nHTML;\n\t\t}\n\n\t\tif($this->user->atLeast(Member::INSTRUCTOR)) {\n\t\t\treturn $this->presentResults();\n\t\t}\n\n\t\tif($this->done) {\n\t\t\t$redirect = $this->site->root . $this->survey->redirect;\n\t\t\treturn <<<HTML\n<div class=\"full\">\n<p class=\"shoutout\">You have already completed this survey.</p>\n<p class=\"center\"><a href=\"$redirect\">Exit</a></p>\n</div>\n\nHTML;\n\t\t}\n\n\t\t$html = $this->survey->present($this->site);\n\n\t\treturn $html;\n\t}", "function isApproved() {\n return $this->getStatus() == UserpointsTransaction::STATUS_APPROVED;\n }", "public function onTrial() : bool\n {\n return (bool) $this->is_freetrial;\n }", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "abstract function is_trial_utilized();", "public function psxFormIsCompleted()\n {\n // TODO: Remove all code related to PSX form. Since it's not used any more we return true to be sure to not make any breaking changes\n return true;\n//\n// if (getenv('PLATEFORM') === 'PSREADY') { // if on ready, the user is already onboarded\n// return true;\n// }\n//\n// return !empty($this->getPsxForm());\n }", "public function isSubmitted();", "public static function alreadyVotedThis($unit,$student){\n try{\n $voted = self::getMyDoneVoted($student);\n //print_r($voted);\n if(!$voted){\n return FALSE;\n }\n $evaluation = Evaluation::getActive()['id'];\n foreach ($voted as $voten){\n if($voten['unit']==$unit && $voten['evaluation']==$evaluation && $voten['student']==$student){\n return TRUE;\n }\n }\n return FALSE;\n } catch (Exception $ex) {\n return FALSE;\n }\n }", "public function isActive() {\n if ($this->getMaxCount() > 0) {\n $current_count = $this->getCompletedCount() + $this->getInProgressCount();\n if ($current_count >= $this->getMaxCount()) {\n return false;\n }\n }\n return parent::isActive(); // TODO: Change the autogenerated stub\n }", "private function checkIsApproved()\n {\n if (!$this->model->isApproved()) {\n return true;\n }\n\n throw QuizzException::errorQuestionApproved();\n }", "function canTakeWrittenExam()\n {\n if(!$this->readingExamResult()->exists()){\n return FALSE;\n }\n\n // user already took the exam, determine if passed\n if(!$this->latestReadingExamResult()->didPassed()){\n return FALSE;\n }\n\n if(!$this->writtenExamResult()->exists()){\n return TRUE;\n }\n\n $exam = $this->latestWrittenExamResult();\n $now = Carbon::now();\n $examDate = Carbon::createFromFormat('Y-m-d H:i:s', $exam->datetime_started);\n\n $allowance = $examDate->copy()->addMinutes($exam->essay->limit);\n if(!$exam->datetime_ended && $allowance->gt($now)){\n return TRUE;\n }\n\n $cooldown = $examDate->copy()->addMonths(6);\n if($cooldown->lt($now)){\n return TRUE;\n } \n\n return FALSE;\n\n \n }", "public function isAwaitingConfirmation() {\n if(isset($this->data['charge']))\n return $this->data['charge']['status'] === 'successful' ? false : true;\n else\n return true;\n }", "function teacher_approved()\r\n{\r\n\r\n include \"connect.inc.php\";\r\n\r\n\r\n $ssn = $_SESSION['SSN'];\r\n\r\n /*Checking if the user is in Approve phase or not*/\r\n $query = \"SELECT * FROM `teachers_approve` WHERE `SSN`='$ssn'\";\r\n\r\n $query_run = mysqli_query($con, $query);\r\n\r\n /*If the teacher is not in approval table*/\r\n if (mysqli_num_rows($query_run) == 0) {\r\n\r\n return true;\r\n\r\n\r\n } /*If the teacher was not approved*/\r\n else {\r\n\r\n return false;\r\n\r\n }\r\n\r\n\r\n}", "public function inSetup()\n\t{\n\t\t$setupComplete = $this->config()->get('confirm_step') ? 3 : 2;\n\n\t\treturn ($this->get('setup_stage') < $setupComplete);\n\t}", "function incompleteSubmissionExists($monographId, $userId, $pressId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tsubmission_progress\n\t\t\tFROM\tmonographs\n\t\t\tWHERE\tmonograph_id = ? AND\n\t\t\t\tuser_id = ? AND\n\t\t\t\tpress_id = ? AND\n\t\t\t\tdate_submitted IS NULL',\n\t\t\tarray($monographId, $userId, $pressId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function canCheckAnswers()\n {\n $sections = $this->getSectionCompletion(self::SECTIONS);\n\n return $sections['allCompleted'] && $this->canBeUpdated();\n }", "public function checkIfUserSubmittedProject($userId)\n {\n $query = 'SELECT EXISTS(SELECT * FROM submissions WHERE user_id = :user_id)';\n $statement = $this->db->prepare($query);\n $statement->bindValue('user_id', $userId, \\PDO::PARAM_INT);\n $statement->execute();\n $result = (bool) $statement->fetchColumn();\n\n return $result;\n }", "public function onTrial()\n {\n // If trial end column is not empty, means the subscription is on trial period\n return $this->active && !is_null($this->trialEndsAt);\n }", "public function approved()\n\t{\n\t\treturn $this->response[0] === self::APPROVED;\n\t}", "function check_participation($exam_id)\r\n{\r\n include \"connect.inc.php\";\r\n\r\n $student_id = student_get_field('Student_id');\r\n $query = \"SELECT * FROM `written_answers` WHERE `Student_id`='$student_id'AND `exam_id`='$exam_id'\";\r\n\r\n if ($query_run = mysqli_query($con, $query)) {\r\n\r\n if (mysqli_num_rows($query_run) > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n } else {\r\n echo \"The query couldn't execute\";\r\n }\r\n}", "public function userIsProfessor($user_id){\n $user_temp = Users::find($user_id);\n return !empty($user_id) && $user_temp && $user_temp['type'] == 1;\n }", "public function userIsProfessor($user_id){\n $user_temp = Users::find($user_id);\n return !empty($user_id) && $user_temp && $user_temp['type'] == 1;\n }", "static function hasAnAnswerPage ()\n {\n return true;\n }", "function is_approved() {\n\t\treturn $this->get_data( 'comment_approved' );\n\t}", "public function isApproved(): bool;", "private function check_exam_and_user(int $_user_id, int $_exam_id)\n {\n return true;\n }", "public function is_current_requested() {\n\t\treturn $this->is_interstitial_requested( $this->get_current_interstitial() );\n\t}", "function is_pro_trial($blog_id) {\r\n\tglobal $psts;\r\n\treturn $psts->is_trial( $blog_id );\t\r\n}", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function userAdvance($userid, $postid)\n{\n\tglobal $wpdb;\n\t$valu = $wpdb->get_var( \"SELECT level FROM \".$wpdb->prefix.\"feedback WHERE user_id = '\".$userid.\"' && post_id = '\".$postid.\"'\" );\n\tif ($valu == 3) {\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function displayFeedbackQuestionnaire(): bool {\n // and a feedback questionnaire exists\n // and the feedback questionnare has not been answered\n return $this->userResponse != null &&\n $this->feedbackQuestionnaire != null\n && $this->userFeedbackQuestionnaireResponse == null;\n }", "function ipal_check_if_answered($user_id, $question_id, $quiz_id, $class_id, $ipal_id){\r\n\tglobal $DB;\r\n\t if($DB->record_exists('ipal_answered', array('user_id'=>$user_id, 'question_id'=>$question_id, 'quiz_id'=>$quiz_id, 'class_id'=>$class_id, 'ipal_id'=>$ipal_id ))){\r\n\t\t return(\"disabled=\\\"disabled\\\"\");\r\n\t\t }else{\r\n\t\t return(\"\");\r\n\t }\r\n\r\n}", "public function updateDailyProgress(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n $this->user->daily_objective = $this->user->dailyQuestions()->count();\n $this->user->save();\n $this->user->updateDailyProgress();\n $expectedDailyProgress = 1;\n\n /** @var Question_user $artificiallyAnsweredQuestion */\n $artificiallyAnsweredQuestion = $this->user->dailyQuestions()->first();\n $artificiallyAnsweredQuestion = Question_user::query()->where('question_id', $artificiallyAnsweredQuestion->id)->first();\n $artificiallyAnsweredQuestion->next_question_at = Carbon::now()->addDay();\n $artificiallyAnsweredQuestion->save();\n\n\n $this->user->updateDailyProgress();\n $this->assertEquals($this->user->daily_progress, $expectedDailyProgress);\n }", "public function hasAnswers();", "public function onGenericTrial()\n {\n return $this->trial_ends_at && $this->trial_ends_at->isFuture();\n }", "public function isRoundCompleted();", "public function hasMadeChoice($userid)\n {\n return is_object(R::findOne('choice', 'user_id = ?', [$userid]));\n }", "static function wait_survey($id_student){\n if(!($id_user = PDOQueries::get_TE_ID_of_student($id_student)) > 0)\n throw new \\PersonalizeException(2001);\n $marker = '{wait_survey}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Answer::$survey_complete_id_page.'&'.Answer::$survey_marker.'='.crypt::encrypt($id_student);\n return PDOQueries::add_notification($id_user,$marker,$link);\n }", "public function isSupsended($username) {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->isSuspended($username);\n }", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "public function hasTrial()\n {\n return (is_numeric($this->trial_period_days) and $this->trial_period_days > 0);\n }", "public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }", "function currentFormHasData() {\n global $double_data_entry, $user_rights, $quesion_by_section, $pageFields;\n\n $record = $_GET['id'];\n if ($double_data_entry && $user_rights['double_data'] != 0) {\n $record = $record . '--' . $user_rights['double_data'];\n }\n\n if (PAGE != 'DataEntry/index.php' && $question_by_section && Records::fieldsHaveData($record, $pageFields[$_GET['__page__']], $_GET['event_id'])) {\n // The survey has data.\n return true;\n }\n\n if (Records::formHasData($record, $_GET['page'], $_GET['event_id'], $_GET['instance'])) {\n // The data entry has data.\n return true;\n }\n\n return false;\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "public function hasParticipant() {\n return $this->_has(1);\n }", "function usp_ews_completion_used($course){\n\n\tglobal $DB;\n\t$fields = 'enablecompletion';\n\t$record = $DB->get_record('course', array('id'=>$course), $fields);\n\t\n\tif($record->enablecompletion == 1)\n\t\treturn true;\n\telse\n\t\treturn false;\n\t\n}", "public function estaUpvoteado()\n {\n return $this->getVotos()->where(['usuario_id' => Yii::$app->user->id, 'positivo' => true])->one() !== null;\n }", "protected function AssessLvlAnswers()\n {\n $lvlDecreased = $this->TryToDecreaseLevel();\n \n if ($lvlDecreased == FALSE)\n {\n $lvlIncreased = $this->TryToIncreaseLevel();\n \n if ($lvlIncreased == FALSE)\n {\n $isDone = $this->IsDone();\n \n if ($isDone == TRUE)\n {\n $this->RecordLvlQAs();\n }\n }\n }\n }", "public function getCompletedAttribute(){\n if ($this->accepter->profile->progress >= 100){\n return 1;\n }\n else{\n return 0;\n } \n }", "public function isReviewed() {\n\t\t$this->getReviewed();\n\t}", "protected function isCompleteCaptured()\n {\n $payment = $this->getPayment();\n return $payment->getAmountPaid() == $payment->getAmountAuthorized();\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public static function _hasUserCompleted($a_obj_id, $a_user_id)\n\t{\n\t\treturn (self::_lookupStatus($a_obj_id, $a_user_id) == self::LP_STATUS_COMPLETED_NUM);\n\t}", "public function is_correct_user_answer() {\n\t\t\treturn strtolower($this->correct_answer) == strtolower($this->user_answer); \n\t\t}", "function collectConsent() {\n if (! $_SESSION[\"eligible\"]) {\n return $this->showStart();\n }\n if (isset($_REQUEST[\"participant_id\"])) {\n $participant_id = $_REQUEST[\"participant_id\"];\n }\n else {\n return $this->collectDetails();\n }\n \n if (isset($_REQUEST[\"consent_submitted\"])) {\n if($_REQUEST[\"consent\"] == \"yes\") {\n\t$_REQUEST[\"mode\"] = \"final\";\n\t$details = array('eligible' => 'yes', 'consent' => 'yes');\n\t$this->updateThing('participant', (int)$participant_id, $details);\n\treturn $this->showFinal();\n }\n else {\n\t// delete participant, go to thanks anyway\n\t$delete_conditions = array('participant_id' => (int)$participant_id);\n\t$this->deleteThings('participant', $delete_conditions);\n\treturn $this->showIneligible();\n }\n }\n $action = $this->action . '?mode=consent';\n $extra = array('action' => $action,\n\t\t 'participant_id' => $participant_id);\n $output = $this->outputBoilerplate('consent.html', $extra);\n return $output; \n }" ]
[ "0.6668665", "0.6657424", "0.6462117", "0.6414857", "0.63745147", "0.6373646", "0.62753797", "0.6224302", "0.6185834", "0.6037406", "0.5979025", "0.59544533", "0.5932114", "0.5910558", "0.5878628", "0.5799039", "0.5790695", "0.5786931", "0.57848215", "0.5761883", "0.57605815", "0.57506466", "0.57479864", "0.5706481", "0.5675713", "0.5643657", "0.56359196", "0.5633163", "0.56286305", "0.56156653", "0.55839866", "0.55678797", "0.5565482", "0.5564128", "0.5548248", "0.55347466", "0.5513879", "0.55129796", "0.54933655", "0.5489413", "0.5467515", "0.5434931", "0.5434655", "0.54321426", "0.5425576", "0.5424306", "0.54212344", "0.54211366", "0.5419421", "0.54102886", "0.54086596", "0.54017025", "0.5395814", "0.53912777", "0.5386331", "0.53788984", "0.5374753", "0.53682435", "0.53681487", "0.5366245", "0.5351369", "0.535108", "0.53496134", "0.5345862", "0.5332698", "0.53313625", "0.53313625", "0.53221524", "0.53062993", "0.530301", "0.5294865", "0.5284841", "0.5281838", "0.52760124", "0.52716416", "0.52574795", "0.5248791", "0.5245376", "0.5234945", "0.5231078", "0.5225251", "0.5222522", "0.5218092", "0.5215451", "0.52149534", "0.52144", "0.5212826", "0.5209508", "0.52071977", "0.5205195", "0.5201594", "0.5200234", "0.5199884", "0.5198889", "0.5198798", "0.5197046", "0.5194647", "0.51939106", "0.5184062", "0.5183427" ]
0.6585163
2
Check an array of submission hashes to see if the current user has any progress in this survey
public function is_progress_by_hashes($survey_id, $submission_hashes) { $query = $this->db ->where('survey_id', $survey_id) ->where('completed IS NULL', NULL, TRUE) ->where_in('hash', $submission_hashes) ->order_by('updated', 'DESC') ->limit(1) ->get('vwm_surveys_submissions'); if ($query->num_rows() > 0) { $row = $query->row(); return $row->hash; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_progress($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\treturn $row->hash;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function user_submissions_progress($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some surveys in progress return an array of their hashes\n\t\treturn isset(self::$user_submissions['progress']) ? self::$user_submissions['progress'] : array();\n\t}", "public function is_complete_by_hashes($survey_id, $submission_hashes)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where_in('hash', $submission_hashes)\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function incompleteSubmissionExists($monographId, $userId, $pressId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tsubmission_progress\n\t\t\tFROM\tmonographs\n\t\t\tWHERE\tmonograph_id = ? AND\n\t\t\t\tuser_id = ? AND\n\t\t\t\tpress_id = ? AND\n\t\t\t\tdate_submitted IS NULL',\n\t\t\tarray($monographId, $userId, $pressId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function user_submissions_complete($submission_hahses)\n\t{\n\t\t// If user submissions have not yet been gathered\n\t\tif (self::$user_submissions == NULL) { $this->get_user_submissions($submission_hahses); }\n\n\t\t// If we have some completed surveys return an array of their hashes\n\t\treturn isset(self::$user_submissions['complete']) ? self::$user_submissions['complete'] : array();\n\t}", "function is_any_parcours_completed() {\n\t\n\t$id_user = get_current_user_id();\n\tglobal $wpdb;\n\t$results = $wpdb->get_results(\"SELECT * FROM parcours_user WHERE id_user = $id_user AND completed = 1\", ARRAY_A);\n\tif(!empty($results)) return true;\t\n\treturn false;\n}", "function isSubmittedBy();", "function isRead() {\n\t\t$submissionDao = Application::getSubmissionDAO();\n\t\t$userGroupDao = DAORegistry::getDAO('UserGroupDAO');\n\t\t$userStageAssignmentDao = DAORegistry::getDAO('UserStageAssignmentDAO');\n\t\t$viewsDao = DAORegistry::getDAO('ViewsDAO');\n\n\t\t$submission = $submissionDao->getById($this->getSubmissionId());\n\n\t\t// Get the user groups for this stage\n\t\t$userGroups = $userGroupDao->getUserGroupsByStage(\n\t\t\t$submission->getContextId(),\n\t\t\t$this->getStageId()\n\t\t);\n\t\twhile ($userGroup = $userGroups->next()) {\n\t\t\t$roleId = $userGroup->getRoleId();\n\t\t\tif ($roleId != ROLE_ID_MANAGER && $roleId != ROLE_ID_SUB_EDITOR) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the users assigned to this stage and user group\n\t\t\t$stageUsers = $userStageAssignmentDao->getUsersBySubmissionAndStageId(\n\t\t\t\t$this->getSubmissionId(),\n\t\t\t\t$this->getStageId(),\n\t\t\t\t$userGroup->getId()\n\t\t\t);\n\n\t\t\t// Check if any of these users have viewed it\n\t\t\twhile ($user = $stageUsers->next()) {\n\t\t\t\tif ($viewsDao->getLastViewDate(\n\t\t\t\t\tASSOC_TYPE_REVIEW_RESPONSE,\n\t\t\t\t\t$this->getId(),\n\t\t\t\t\t$user->getId()\n\t\t\t\t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function HasSubmitted ($id) {\n if (@mysql_result(@mysql_query (\"SELECT `submission_id` AS `sub_id` FROM `hunt_submissions` WHERE `submission_person` = $id AND `submission_hunt` = \".$this->hunt_id.\" LIMIT 1\", $this->ka_db), 0, 'sub_id') != '') {\n return true;\n } else {\n return false;\n }\n }", "private function get_user_submissions($submission_hahses)\n\t{\n\t\tself::$user_submissions = array();\n\n\t\t$member_id = $this->session->userdata('member_id');\n\n\t\t// Make sure we have a member ID or some submission hashes to check\n\t\tif ( $member_id OR $submission_hahses )\n\t\t{\n\t\t\t// If we have a member ID\n\t\t\tif ($member_id)\n\t\t\t{\n\t\t\t\t$this->db\n\t\t\t\t\t->where('member_id', $member_id)\n\t\t\t\t\t->or_where_in('hash', $submission_hahses ? $submission_hahses : ''); // CI does not like an empty array\n\t\t\t}\n\t\t\t// If we only have submission hashes\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where_in('hash', $submission_hahses);\n\t\t\t}\n\n\t\t\t$query = $this->db\n\t\t\t\t->order_by('completed, updated, created', 'DESC')\n\t\t\t\t->get('vwm_surveys_submissions');\n\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t// Loop through each submission\n\t\t\t\tforeach ($query->result() as $row)\n\t\t\t\t{\n\t\t\t\t\t// First key is either \"completed\" or \"progress\", second is survey ID, and value is the submission hash\n\t\t\t\t\tself::$user_submissions[ $row->completed ? 'complete' : 'progress' ][ $row->survey_id ] = $row->hash;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function isSubmitted();", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function evalGradeExists(User $user, Collection $submissions = null)\n {\n if(!$submissions){\n $submissions = $this->submissions;\n }\n $list = $submissions->pluck('id');\n $userGrade = $user->grades()->whereIn('submission_id', $list)->get();\n return !$userGrade->isEmpty();\n\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "function proposal_is_submitted($proposal_id) {\n foreach ($_SESSION['submitted_proposals'] as $sp) {\n if ($sp->id == $proposal_id) {return TRUE;}\n }\n}", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "private function has_submission_field($user_id)\n {\n $this->db->where('umeta_key', 'submissions');\n $this->db->where('user_id', $user_id);\n\n $result = $this->db->get('user_meta');\n\n return ($result->num_rows() == 1) ? $result->row('umeta_value') : FALSE;\n }", "public function getHasSubmitted() {\n\t\t@$cookie = $_COOKIE['promotion_' . $this->getId()];\n\t\treturn (bool) $cookie;\n\t}", "function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function submissions() {\n \n global $CFG, $USER;\n\n // need to get course id in order to retrieve students\n $assignment = get_record('assignment', 'id', $this->mainobject->id);\n $courseid = $assignment->course;\n\n //permission to grade?\n $coursemodule = get_record('course_modules', 'module', $this->mainobject->modulesettings['assignment']->id, 'instance', $assignment->id) ;\n $modulecontext = get_context_instance(CONTEXT_MODULE, $coursemodule->id);\n\n if (!has_capability($this->capability, $modulecontext, $USER->id)) {\n return;\n }\n \n $this->mainobject->get_course_students($courseid);\n\n $student_sql = $this->get_role_users_sql($this->mainobject->courses[$courseid]->context);\n\n $sql = \"SELECT s.id as subid, s.userid, s.timemodified, s.data2, c.id as cmid\n FROM {$CFG->prefix}assignment_submissions s\n INNER JOIN {$CFG->prefix}course_modules c\n ON s.assignment = c.instance\n INNER JOIN {$CFG->prefix}assignment a\n ON s.assignment = a.id\n WHERE s.assignment = {$this->mainobject->id}\n AND s.timemarked < s.timemodified\n AND (s.userid IN ({$student_sql}))\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n \n AND c.module = {$this->mainobject->modulesettings['assignment']->id}\n ORDER BY timemodified ASC\";\n\n $submissions = get_records_sql($sql);\n\n if ($submissions) {\n\n $data = array();\n\n // If we are not making the submissions for a specific group, run the group filtering\n // function to see if the config settings say display by groups and display them if they\n // are (returning false). If there are no groups, the function will return true and we\n // carry on, but if the config settings say 'don't display' then it will return false\n // and we skip this assignment\n if(!$this->mainobject->group) {\n\n //TODO - data array as input for function\n\n //$data['submissions'] = $submissions;\n //$data['type'] = $this->type;\n //$data['id'] = $this->mainobject->id;\n //$data['course'] = $assignment->course;\n\n //$group_filter = $this->mainobject->try_to_make_group_nodes($data);\n $group_filter = $this->mainobject->try_to_make_group_nodes($submissions, $this->type, $this->mainobject->id, $assignment->course);\n\n if (!$group_filter) {\n return;\n }\n }\n\n // begin json object\n $this->mainobject->output = '[{\"type\":\"submissions\"}';\n\n foreach ($submissions as $submission) {\n // add submission to JSON array of objects\n if (!isset($submission->userid)) {\n continue;\n }\n\n // ignore non-submitted uploaded files\n if (($assignment->assignmenttype == 'upload') && ($submission->data2 != 'submitted')) {\n continue;\n }\n\n // if we are displaying for just one group, skip this submission if it doesn't match\n if ($this->mainobject->group && !$this->mainobject->check_group_membership($this->mainobject->group, $submission->userid)) {\n continue;\n }\n \n $name = $this->mainobject->get_fullname($submission->userid);\n \n // sort out the time info\n $now = time();\n $seconds = ($now - $submission->timemodified);\n $summary = $this->mainobject->make_time_summary($seconds);\n \n $this->mainobject->make_submission_node($name, $submission->userid, $submission->cmid, $summary, 'assignment_final', $seconds, $submission->timemodified);\n \n }\n $this->mainobject->output .= \"]\"; // end JSON array\n \n }\n }", "public function isCurrentUserPreparedForPrerequisites()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n if ($this->isCurrentUserPrepared()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCurrentUserPrepared()) {\n return false;\n }\n }\n\n return true;\n }", "public function checkCurrentSlot() {\n $result = array();\n foreach($this->workflowSlotUser as $user) {\n $processUser = WorkflowProcessUserTable::instance()->getProcessUserByWorkflowSlotUserId($user->getId())->toArray();\n $this->decission[] = $this->checkProcessState($processUser);\n }\n }", "public function hasPartsToIssue(): bool\n {\n return count($this->issuedItems) > 0;\n }", "public function markSubmitted(): void\n {\n $user = Auth::user()->callsign;\n $uploadDate = date('n/j/y G:i:s');\n $batchInfo = $this->batchInfo ?? '';\n\n foreach ($this->bmids as $bmid) {\n $bmid->status = Bmid::SUBMITTED;\n\n /*\n * Make a note of what provisions were set\n */\n\n $showers = [];\n if ($bmid->showers) {\n $showers[] = 'set';\n }\n\n if ($bmid->earned_showers) {\n $showers[] = 'earned';\n }\n if ($bmid->allocated_showers) {\n $showers[] = 'allocated';\n }\n if (empty($showers)) {\n $showers[] = 'none';\n }\n\n $meals = [];\n if (!empty($bmid->meals)) {\n $meals[] = $bmid->meals . ' set';\n }\n if (!empty($bmid->earned_meals)) {\n $meals[] = $bmid->earned_meals . ' earned';\n }\n if (!empty($bmid->allocated_meals)) {\n $meals[] = $bmid->allocated_meals . ' allocated';\n }\n\n if (empty($meals)) {\n $meals[] = 'none';\n }\n\n /*\n * Figure out which provisions are to be marked as submitted.\n *\n * Note: Meals and showers are not allowed to be banked in the case were the\n * person earned them yet their position (Council, OOD, Supervisor, etc.) comes\n * with a provisions package.\n */\n\n $items = [];\n if ($bmid->effectiveShowers()) {\n $items[] = Provision::WET_SPOT;\n }\n\n if (!empty($bmid->meals) || !empty($bmid->allocated_meals)) {\n // Person is working.. consume all the meals.\n $items = [...$items, ...Provision::MEAL_TYPES];\n } else if (!empty($bmid->earned_meals)) {\n // Currently only two meal provision types, All Eat, and Event Week\n $items[] = ($bmid->earned_meals == Bmid::MEALS_ALL) ? Provision::ALL_EAT_PASS : Provision::EVENT_EAT_PASS;\n }\n\n\n if (!empty($items)) {\n $items = array_unique($items);\n Provision::markSubmittedForBMID($bmid->person_id, $items);\n }\n\n $meals = '[meals ' . implode(', ', $meals) . ']';\n $showers = '[showers ' . implode(', ', $showers) . ']';\n $bmid->notes = \"$uploadDate $user: Exported $meals $showers\\n$bmid->notes\";\n $bmid->auditReason = 'exported to print';\n $bmid->batch = $batchInfo;\n $bmid->saveWithoutValidation();\n }\n }", "public function IsSubmitted() {\n\n if ($this->HttpValues === null) {\n // HTTP submision's data are not imported? import them now from Request service.\n $this->SetHttpValues();\n }\n return isset($this->HttpValues['_FormName'])\n && $this->HttpValues['_FormName'] === $this->Name;\n }", "public function isSubmitted() {\n return $this->submitted;\n }", "public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );\n\t}", "public function isSubmited(): bool\n {\n return (bool) $this->values();\n }", "function check_quiz_pass($taking_id) {\r\n\r\n $quizDataBaseName = 'wp_watupro_taken_exams';\r\n $postmetaDatabaseName = 'wp_postmeta';\r\n $exam = get_recent_exam_ID($taking_id);\r\n $examID = $exam->exam_id;\r\n $user_ID = $exam->user_id;\r\n $userEmail = get_user_meta($user_ID, 'billing_email', true);\r\n $watuObj = get_certificate_data($user_ID);\r\n if (!empty($watuObj)) {\r\n $postedID = get_specific_postmeta_data($postmetaDatabaseName, $userEmail);\r\n if (valExistence_check($postedID, $watuObj) == false) {\r\n $examName = get_recent_exam_name($user_ID);\r\n update_all_data_to_wp_store_locator($user_ID, $examName, $userEmail);\r\n }\r\n }\r\n}", "function all_final_submissions_quick($min_status = 0) {\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$join_on = \"best\";\n\t\t} else {\n\t\t\t$join_on = \"last\";\n\t\t}\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM user_entity as ue JOIN submission as s ON ue.\".$join_on.\"_submissionid = s.submissionid\".\n\t\t\t\" WHERE ue.`entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\t$subs = Submission::fetch_all($query);\n\t\t$result = array();\n\t\tforeach($subs as $s) {\n\t\t\t$result[$s->userid] = $s;\n\t\t}\n\t\treturn $result;\n\t}", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "function can_submit_brief_project_proposal(ProjectRequest $projectRequest)\n {\n return in_array(auth()->user()->id, $projectRequest->projectRequestReceivers->pluck('receiver')->toArray());\n }", "public function checkIfUserSubmittedProject($userId)\n {\n $query = 'SELECT EXISTS(SELECT * FROM submissions WHERE user_id = :user_id)';\n $statement = $this->db->prepare($query);\n $statement->bindValue('user_id', $userId, \\PDO::PARAM_INT);\n $statement->execute();\n $result = (bool) $statement->fetchColumn();\n\n return $result;\n }", "function count_pending_submissions() {\n\t\tif (!$this->submitable()) return 0;\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT COUNT(*) FROM `submission`\".\n\t\t\t\" WHERE `entity_path`=? AND `status` = \".Status::PENDING\n\t\t);\n\t\t$query->execute(array($this->path()));\n\t\treturn $query->fetchColumn();\n\t}", "public function allows_submission() {\n if (!$submission = $this->submission_settings) {\n return false;\n }\n\n $allowed = false;\n\n // Save buttons.\n foreach ($this->submission_buttons as $name) {\n if ($name == 'cancel') {\n continue;\n }\n if (array_key_exists($name, $submission)) {\n $allowed = true;\n break;\n }\n }\n\n return $allowed;\n }", "function get_all_unmarked() {\n\n global $CFG;\n\n $sql = \"SELECT s.id as subid, s.userid, s.data2, a.course, a.assignmenttype, a.name, a.description, a.id, c.id as cmid\n FROM {$CFG->prefix}assignment a\n INNER JOIN {$CFG->prefix}course_modules c\n ON a.id = c.instance\n INNER JOIN {$CFG->prefix}assignment_submissions s\n ON s.assignment = a.id\n WHERE c.module = {$this->mainobject->modulesettings['assignment']->id}\n AND c.visible = 1\n AND a.course IN ({$this->mainobject->course_ids})\n AND s.timemarked < s.timemodified\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n ORDER BY a.id\";\n\n $unmarked = get_records_sql($sql);\n\n // Due to oracle being rubbish, there is no way to put this bit into sql as the data2 field is\n // a CLOB and so cannot be used with any kind of comparison operator.\n // It used to be:\n // AND NOT (a.assignmenttype = 'upload' AND s.data2 != 'submitted'))\n \n\n foreach ($unmarked as $key => $submission) {\n\n if (($submission->data2 != 'submitted') && ($submission->assignmenttype == 'upload')) {\n unset($unmarked[$key]);\n }\n }\n \n\n $this->all_submissions = $unmarked;\n\n return true;\n }", "public function canBeSubmitted()\n {\n if (!$this->isNotYetSubmitted()) {\n return false;\n }\n\n $confirmationSections = $this->getSectionCompletion(self::CONFIRMATION_SECTIONS);\n\n if (!$confirmationSections['allCompleted']) {\n return false;\n }\n\n $applicationSections = $this->getSectionCompletion(self::SECTIONS);\n\n if (!$applicationSections['allCompleted']) {\n return false;\n }\n\n return $this->licence->canMakeEcmtApplication($this);\n }", "public function isSubmitted() {\n return $this->submitted;\n }", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $this->post_data['secondNumber'];\n // Assign the number of correct answers to $number_correct in the class method.\n $number_correct = $this->post_data['numberCorrect'];\n // Assign the question number for this level to $question_number in the class method.\n $question_number = $this->post_data['questionNumber'];\n // Assign the level number for this level to $level_number in the class method.\n $level_number = $this->post_data['levelNumber'];\n // Reset Question number to 1 if more than five questions have been completed or increase it by one\n if($question_number == 5) {\n $question_number = 1;\n $level_number++;\n } else {\n $question_number++;\n }\n\n // Check the correct answer to the question.\n $sum = $first_number * $second_number;\n // If the answer in the post data is equivalent to the correct answer, increment $number_correct by one \n // then return true and $number_correct. If it isn't correct return false and $number_correct.\n if ($sum == $this->post_data['sumAnswer']) {\n $number_correct++;\n return array(true, $number_correct, $question_number, $level_number);\n } else {\n return array(false, $number_correct, $question_number, $level_number);\n }\n }", "public function isSubmitted()\n {\n return $this->isSubmitted;\n }", "public function isSubmitted()\n {\n return $this->isSubmitted;\n }", "private function users_for_stats() {\n\n\t\t\tif ( ! is_null( $this->users_for_stats ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( is_null( $this->request ) ) {\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\tif ( empty( $quiz_id ) ) {\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\treturn $this->users_for_stats;\n\t\t\t}\n\n\t\t\tif ( learndash_is_admin_user() ) {\n\t\t\t\t$this->users_for_stats = array();\n\t\t\t} elseif ( learndash_is_group_leader_user() ) {\n\t\t\t\tif ( learndash_get_group_leader_manage_courses() ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * If the Group Leader can manage_courses they have will access\n\t\t\t\t\t * to all quizzes. So they are treated like the admin user.\n\t\t\t\t\t */\n\t\t\t\t\t$this->users_for_stats = array();\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * Else we need to figure out of the quiz requested is part of a\n\t\t\t\t\t * Course within Group managed by the Group Leader.\n\t\t\t\t\t */\n\t\t\t\t\t$quiz_users = array();\n\t\t\t\t\t$leader_courses = learndash_get_groups_administrators_courses( get_current_user_id() );\n\t\t\t\t\tif ( ! empty( $leader_courses ) ) {\n\t\t\t\t\t\t$quiz_courses = array();\n\t\t\t\t\t\tif ( 'yes' === LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Courses_Builder', 'shared_steps' ) ) {\n\t\t\t\t\t\t\t$quiz_courses = learndash_get_courses_for_step( $quiz_id, true );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$quiz_course = learndash_get_setting( $quiz_id, 'course' );\n\t\t\t\t\t\t\tif ( ! empty( $quiz_course ) ) {\n\t\t\t\t\t\t\t\t$quiz_courses = array( $quiz_course );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $quiz_courses ) ) {\n\t\t\t\t\t\t\t$common_courses = array_intersect( $quiz_courses, $leader_courses );\n\t\t\t\t\t\t\tif ( ! empty( $common_courses ) ) {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * The following will get a list of all users within the Groups\n\t\t\t\t\t\t\t\t * managed by the Group Leader. This list of users will be passed\n\t\t\t\t\t\t\t\t * to the query logic to limit the selected rows.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * This is not 100% accurate because we don't limit the rows based\n\t\t\t\t\t\t\t\t * on the associated courses. Consider if Shared Course steps is\n\t\t\t\t\t\t\t\t * enabled and the quiz is part of two courses and those courses\n\t\t\t\t\t\t\t\t * are associated with multiple groups. And the user is in both\n\t\t\t\t\t\t\t\t * groups. So potentially we will pull in statistics records for\n\t\t\t\t\t\t\t\t * the other course quizzes.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$quiz_users = learndash_get_groups_administrators_users( get_current_user_id() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $quiz_users ) ) {\n\t\t\t\t\t\t$this->users_for_stats = $quiz_users;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If here then non-admin and non-group leader user.\n\t\t\t\t$quiz_id = $this->request->get_param( 'quiz' );\n\t\t\t\tif ( ! empty( $quiz_id ) ) {\n\t\t\t\t\tif ( get_post_meta( $quiz_id, '_viewProfileStatistics', true ) ) {\n\t\t\t\t\t\t$this->users_for_stats = (array) get_current_user_id();\n\t\t\t\t\t\treturn $this->users_for_stats;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->users_for_stats = array( 0 );\n\t\t\t}\n\n\t\t\treturn $this->users_for_stats;\n\t\t}", "function all_submissions($min_status = 0) {\n\t\tif (!$this->submitable()) return array();\n\t\tstatic $query;\n\t\tDB::prepare_query($query,\n\t\t\t\"SELECT * FROM `submission`\".\n\t\t\t\" WHERE `entity_path` = ? AND `status` >= ?\".\n\t\t\t\" ORDER BY `time` ASC\"\n\t\t);\n\t\t$query->execute(array($this->path(), $min_status));\n\t\treturn Submission::fetch_all($query);\n\t}", "private function checkAchievementProgressUser($achievementProgressUser, $achievementRewaredAt) {\n // Checking the progress of the achievement\n if ($achievementProgressUser >= $achievementRewaredAt) {\n return true;\n } else {\n return false;\n } \n }", "function isSubmitted ($model)\n {\n if ($_SERVER['REQUEST_URI'] != $this->handler) {\n return FALSE;\n }\n\n switch ($this->method) {\n case Wtk_Form_Model_Submission::METHOD_URLENCODED:\n $array = $_POST;\n break;\n case Wtk_Form_Model_Submission::METHOD_POST:\n case Wtk_Form_Model_Submission::METHOD_FORM_DATA:\n case Wtk_Form_Model_Submission::METHOD_MULTIPART:\n if (isset($_POST[$model->id]) || isset($_FILES[$model->id])) {\n\t$files = array ();\n\t$array = $_POST;\n\tforeach ($_FILES as $prefix => $value) {\n\t if (is_array($value['name'])) {\n\t $files[$prefix] = array_merge_recursive($files, $this->fixFilesArray($value));\n\t }\n\t else {\n\t $files[$prefix] = $value;\n\t }\n\t}\n\t$array = $this->mergeFilesInfos($array, $files);\n }\n else {\n\t$array = array();\n }\n break;\n case Wtk_Form_Model_Submission::METHOD_GET:\n $array = $_GET;\n break;\n default:\n return FALSE;\n break;\n }\n\n if (!isset($array[$model->id]))\n return FALSE;\n\n\n $data = $array[$model->id];\n $submission = $array['$$submission$$'];\n if ($submission != $this->id)\n return FALSE;\n\n return $data;\n }", "function submitted_events_create_pending_submissions_page() {\n\t$pending_submissions = submitted_events_get_pending_submissions ();\n\t$num_pending = sizeof ( $pending_submissions );\n\tif ($num_pending == 0) {\n\t\techo '<h2>No pending submissions</h2>';\n\t} elseif ($num_pending == 1) {\n\t\techo '<h2>There is one pending submission</h2>';\n\t} else {\n\t\techo '<h2>There are ' . $num_pending . ' pending submissions</h2>';\n\t}\n}", "function can_submit_brief_research_proposal(ResearchRequest $researchRequest)\n {\n return in_array(auth()->user()->id, $researchRequest->researchRequestReceivers->pluck('to')->toArray());\n }", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function submissionsOpen($resolutionRow) {\n if ($resolutionRow['status'] == 'pending') {\n return true;\n } else if (($resolutionRow['status'] == 'in_session') && ($resolutionRow['speakers'] < 2)) {\n return true;\n } else {\n return false;\n }\n}", "public function isUsed()\n\t{\n\t\treturn $this->data && $this->data['forms_attempts'] > 0;\n\t}", "function getTotalSubmissions() {\n if(\n is_object(\n $oStmt = DB::$PDO->prepare(\n 'SELECT\n COUNT(1)\n FROM\n challenges c\n INNER JOIN\n attempts a\n ON\n (a.challenge_id=c.id)\n WHERE\n (\n c.active\n OR\n :RightViewAllChallenges\n )'\n )\n )\n &&\n $oStmt->execute(\n Array(\n //':RightViewAllChallenges' => access('show_unactive_challenges')? 1 : 0\n ':RightViewAllChallenges' => 1\n )\n )\n &&\n is_array($aTotalSubs = $oStmt->fetch(PDO::FETCH_NUM))\n ){\n return $aTotalSubs[0];\n } return 0;\n}", "public function getSubmissions()\n {\n return $this->getFiles()->filter(function (File $file) {\n return $file->getOwner()->getType() === 'student';\n });\n }", "public function hasAssignmentRequest($status)\n {\n return $this->where('assignment_count', '>', 0);\n }", "public static function is_in_progress(): bool {\n return Simply_Static\\Options::instance()->get('archive_start_time')\n && !Simply_Static\\Options::instance()->get('archive_end_time');\n }", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "public function isSubmitted()\n\t{\n\t\tif ($this->http_method == 'get') {\n\t\t\t// GET form is always submitted\n\t\t\treturn TRUE;\n\t\t} else if (isset($this->raw_input['__'])) {\n\t\t\t$__ = $this->raw_input['__'];\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ((array) $__ as $token => $x) {\n\t\t\t$t = static::validateFormToken($token, $this->id);\n\t\t\tif ($t !== FALSE) {\n\t\t\t\t// Submitted\n\t\t\t\tif ($this->form_ttl > 0 && time() - $t > $this->form_ttl) {\n\t\t\t\t\t$this->form_errors[self::E_FORM_EXPIRED] = array(\n\t\t\t\t\t\t'message' => _('The form has expired, please check entered data and submit it again.')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function isCompletedByCurrentUser()\n {\n return SwagUser::getCurrent()->isSwagpathCompleted($this);\n }", "public function isAllSwagPostItemsCompleted($swagUser)\n {\n foreach ($this->getSwagPostItems() as $swagPostItem) {\n if (!$swagPostItem->isCompleted($swagUser)) {\n return false;\n }\n\n }\n\n return true;\n }", "public function progress_check(){\n \ttry {\n\t $json = file_get_contents(\"php://input\");\n\t $data = json_decode($json);\n\t $stage_id=$data->stage_id;\n\t $next_stage_id=$data->next_stage_id;\n\t $opportunity_id = $data->opp_id;\n\t $finalArray = array();\n\t $qualifier_data = $this->opp_common->check_qualifiers($next_stage_id);\n\t $finalArray['qualifier'] = $qualifier_data;\n\t $files_data = $this->opp_sales->check_files_for_stage($stage_id,$opportunity_id);\n\t $finalArray['fileCheck'] = $files_data;\n\t echo json_encode($finalArray);\n \t} catch (LConnectApplicationException $e) {\n \t\techo $this->exceptionThrower($e);\n \t}\n }", "function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getUserProgressInQuest($user, $questCode);", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "function _erpal_projects_helper_timetracking_finalise_action_validate($timetrackings) {\n $errors = false;\n\n foreach ($timetrackings as $timetracking) {\n //error if timetracking has no subject\n $timetracking_link = l($timetracking->defaultLabel(), 'timetracking/'.$timetracking->timetracking_id.'/edit', array('query' => array('destination' => $_GET['q'])));\n if (!$timetracking->subject_id) {\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise a timetracking, ensure that a subject task is set for !timetracking_link', array('!timetracking_link' => $timetracking_link));\n } elseif (!$timetracking->time_end) {\n //if we dont have a duration the timetracking is still running and cannot be finalised!\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise the timetracking !timetracking_link, ensure that it is not still tracking the time!', array('!timetracking_link' => $timetracking_link));\n }\n }\n\n return $errors;\n}", "function currentFormHasData() {\n global $double_data_entry, $user_rights, $quesion_by_section, $pageFields;\n\n $record = $_GET['id'];\n if ($double_data_entry && $user_rights['double_data'] != 0) {\n $record = $record . '--' . $user_rights['double_data'];\n }\n\n if (PAGE != 'DataEntry/index.php' && $question_by_section && Records::fieldsHaveData($record, $pageFields[$_GET['__page__']], $_GET['event_id'])) {\n // The survey has data.\n return true;\n }\n\n if (Records::formHasData($record, $_GET['page'], $_GET['event_id'], $_GET['instance'])) {\n // The data entry has data.\n return true;\n }\n\n return false;\n }", "function processQuiz() {\n $response = array();\n $accountId = $_GET['accountId'];\n $quizId = $_GET['quizId'];\n // for now just return the questions from the quiz if quiz is not a part of the history.\n $sql = \"SELECT count(*) as count FROM results where quizId=:quizId and accountId=:accountId\";\n try {\n $db = getConnection();\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"quizId\", $quizId);\n $stmt->bindParam(\"accountId\", $accountId);\n $stmt->execute();\n $count = $stmt->fetchObject();\n $db = null;\n } catch (PDOException $e) {\n $response[\"status\"] = ERROR;\n $response[\"data\"] = EXCEPTION_MSG;\n phpLog($e->getMessage());\n }\n if ($count->count == 0) {\n // this quiz hasn't been taken.\n // logic for package redemption at this point its null.\n $sql = \"SELECT questionIds FROM quizzes where id=:id\";\n try {\n $db = getConnection();\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"id\", $quizId);\n $stmt->execute();\n $questionIds = $stmt->fetchObject();\n $db = null;\n if ($questionIds->questionIds != null) {\n $questions = getQuestions($questionIds->questionIds);\n $response[\"status\"] = \"success\";\n $response[\"data\"] = $questions;\n } else {\n $response[\"status\"] = \"fail\";\n $response[\"data\"] = \"Something went wrong! Please drop in an email to [email protected]\";\n }\n } catch (PDOException $e) {\n $response[\"status\"] = ERROR;\n $response[\"data\"] = EXCEPTION_MSG;\n phpLog($e->getMessage());\n }\n } else {\n // you have already taken this quiz, fetch the questions and show it in results\n $response[\"status\"] = FAIL;\n $response[\"data\"] = \"You have already taken this quiz\";\n //echo '{\"error\":{\"text\":' . $msg . '}}';\n }\n sendResponse($response);\n}", "public function hasCheckInTaskList(){\n return $this->_has(2);\n }", "protected function in_progress() {\n\t\treturn 'in_progress' === get_option( 'ratesync_sync_status' );\n\t}", "public function submissions();", "function display_submissions( $message='') {\n \n global $CFG, $DB, $USER, $DB, $OUTPUT, $PAGE;\n require_once($CFG->libdir.'/gradelib.php');\n\n /* first we check to see if the form has just been submitted\n * to request user_preference updates\n */\n\n $filters = array(self::FILTER_ALL => get_string('all'),\n self::FILTER_REQUIRE_GRADING => get_string('requiregrading', 'assignment'));\n\n $updatepref = optional_param('updatepref', 0, PARAM_BOOL);\n if ($updatepref) {\n $perpage = optional_param('perpage', 10, PARAM_INT);\n $perpage = ($perpage <= 0) ? 10 : $perpage ;\n $filter = optional_param('filter', 0, PARAM_INT);\n set_user_preference('assignment_perpage', $perpage);\n set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));\n set_user_preference('assignment_filter', $filter);\n }\n\n /* next we get perpage and quickgrade (allow quick grade) params\n * from database\n */\n $perpage = get_user_preferences('assignment_perpage', 10);\n $quickgrade = get_user_preferences('assignment_quickgrade', 0) && $this->quickgrade_mode_allowed();\n $filter = get_user_preferences('assignment_filter', 0);\n $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);\n\n if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {\n $uses_outcomes = true;\n } else {\n $uses_outcomes = false;\n }\n\n $page = optional_param('page', 0, PARAM_INT);\n $strsaveallfeedback = get_string('saveallfeedback', 'assignment');\n\n /// Some shortcuts to make the code read better\n\n $course = $this->course;\n $assignment = $this->assignment;\n $cm = $this->cm;\n $hassubmission = false;\n\n // reset filter to all for offline assignment only.\n if ($assignment->assignmenttype == 'offline') {\n if ($filter == self::FILTER_SUBMITTED) {\n $filter = self::FILTER_ALL;\n }\n } else {\n $filters[self::FILTER_SUBMITTED] = get_string('submitted', 'assignment');\n }\n\n $tabindex = 1; //tabindex for quick grading tabbing; Not working for dropdowns yet\n add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->cm->id, $this->assignment->id, $this->cm->id);\n $PAGE->requires->js('/mod/sword/js/jquery.js', true);\n $PAGE->requires->js('/mod/sword/js/sword22.js', true);\n $PAGE->requires->css('/mod/sword/css/estilo.css', true);\n \n // array(array('aparam'=>'paramvalue')));\n \n $PAGE->set_title(format_string($this->assignment->name,true));\n $PAGE->set_heading($this->course->fullname);\n echo $OUTPUT->header();\n\n echo '<div class=\"usersubmissions\">';\n\n //hook to allow plagiarism plugins to update status/print links.\n echo plagiarism_update_status($this->course, $this->cm);\n\n \n $course_context = context_course::instance($course->id);\n if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {\n echo '<div class=\"allcoursegrades\"><a href=\"' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '\">'\n . get_string('seeallcoursegrades', 'grades') . '</a></div>';\n }\n\n\n \n $context = context_module::instance($cm->id);\n\n /// Check to see if groups aredisplay_submissions being used in this assignment\n\n /// find out current groups mode\n $groupmode = groups_get_activity_groupmode($cm);\n $currentgroup = groups_get_activity_group($cm, true);\n groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);\n\n /// Print quickgrade form around the table\n if ($quickgrade) {\n $formattrs = array();\n $formattrs['action'] = new moodle_url('/mod/assignment/submissions.php');\n $formattrs['id'] = 'fastg';\n $formattrs['method'] = 'post';\n\n echo html_writer::start_tag('form', $formattrs);\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=> $this->cm->id));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'mode', 'value'=> 'fastgrade'));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'page', 'value'=> $page));\n echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=> sesskey()));\n }\n\n /// Get all ppl that are allowed to submit assignments\n list($esql, $params) = get_enrolled_sql($context, 'mod/assignment:submit', $currentgroup);\n\n if ($filter == self::FILTER_ALL) {\n $sql = \"SELECT u.id FROM {user} u \".\n \"LEFT JOIN ($esql) eu ON eu.id=u.id \".\n \"WHERE u.deleted = 0 AND eu.id=u.id \";\n } else {\n $wherefilter = ' AND s.assignment = '. $this->assignment->id;\n $assignmentsubmission = \"LEFT JOIN {assignment_submissions} s ON (u.id = s.userid) \";\n if($filter == self::FILTER_SUBMITTED) {\n $wherefilter .= ' AND s.timemodified > 0 ';\n } else if($filter == self::FILTER_REQUIRE_GRADING && $assignment->assignmenttype != 'offline') {\n $wherefilter .= ' AND s.timemarked < s.timemodified ';\n } else { // require grading for offline assignment\n $assignmentsubmission = \"\";\n $wherefilter = \"\";\n }\n\n $sql = \"SELECT u.id FROM {user} u \".\n \"LEFT JOIN ($esql) eu ON eu.id=u.id \".\n $assignmentsubmission.\n \"WHERE u.deleted = 0 AND eu.id=u.id \".\n $wherefilter;\n }\n\n $users = $DB->get_records_sql($sql, $params);\n if (!empty($users)) {\n if($assignment->assignmenttype == 'offline' && $filter == self::FILTER_REQUIRE_GRADING) {\n //remove users who has submitted their assignment\n foreach ($this->get_submissions() as $submission) {\n if (array_key_exists($submission->userid, $users)) {\n unset($users[$submission->userid]);\n }\n }\n }\n $users = array_keys($users);\n }\n\n // if groupmembersonly used, remove users who are not in any group\n if ($users and !empty($CFG->enablegroupmembersonly) and $cm->groupmembersonly) {\n if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {\n $users = array_intersect($users, array_keys($groupingusers));\n }\n }\n\n $extrafields = get_extra_user_fields($context);\n //select row\n $tablecolumns = array_merge(array('state'),array('select'),array('picture', 'fullname'), $extrafields,\n array('grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade'));\n if ($uses_outcomes) {\n $tablecolumns[] = 'outcome'; // no sorting based on outcomes column\n }\n\n $extrafieldnames = array();\n foreach ($extrafields as $field) {\n $extrafieldnames[] = get_user_field_name($field);\n }\n $tableheaders = array_merge(\n array(get_string('status')),\n array(get_string('select')),\n array('', get_string('fullnameuser')),\n $extrafieldnames,\n array(\n get_string('grade'),\n get_string('comment', 'assignment'),\n get_string('lastmodified').' ('.get_string('submission', 'assignment').')',\n get_string('lastmodified').' ('.get_string('grade').')',\n get_string('status'),\n get_string('finalgrade', 'grades'),\n ));\n if ($uses_outcomes) {\n $tableheaders[] = get_string('outcome', 'grades');\n }\n\n require_once($CFG->libdir.'/tablelib.php');\n echo '<form>';\n $table = new flexible_table('mod-assignment-submissions');\n\n $table->define_columns($tablecolumns);\n $table->define_headers($tableheaders);\n $table->define_baseurl($CFG->wwwroot.'/mod/sword/submissions22.php?id='.$this->cm_sword->id.'&assignment='.$this->cm->id.'&amp;currentgroup='.$currentgroup);\n\n $table->sortable(true, 'lastname');//sorted by lastname by default\n $table->collapsible(true);\n $table->initialbars(true);\n\n $table->column_suppress('picture');\n $table->column_suppress('fullname');\n \n \n $table->column_class('state', 'state');\n $table->column_class('select', 'select');\n $table->column_class('picture', 'picture');\n $table->column_class('fullname', 'fullname');\n foreach ($extrafields as $field) {\n $table->column_class($field, $field);\n }\n $table->column_class('grade', 'grade');\n $table->column_class('submissioncomment', 'comment');\n $table->column_class('timemodified', 'timemodified');\n $table->column_class('timemarked', 'timemarked');\n $table->column_class('status', 'status');\n $table->column_class('finalgrade', 'finalgrade');\n if ($uses_outcomes) {\n $table->column_class('outcome', 'outcome');\n }\n\n $table->set_attribute('cellspacing', '0');\n $table->set_attribute('id', 'attempts');\n $table->set_attribute('class', 'submissions');\n $table->set_attribute('width', '100%');\n\n $table->no_sorting('finalgrade');\n $table->no_sorting('outcome');\n\n // Start working -- this is necessary as soon as the niceties are over\n $table->setup();\n\n /// Construct the SQL\n list($where, $params) = $table->get_sql_where();\n if ($where) {\n $where .= ' AND ';\n }\n\n if ($filter == self::FILTER_SUBMITTED) {\n $where .= 's.timemodified > 0 AND ';\n } else if($filter == self::FILTER_REQUIRE_GRADING) {\n $where = '';\n if ($assignment->assignmenttype != 'offline') {\n $where .= 's.timemarked < s.timemodified AND ';\n }\n }\n\n if ($sort = $table->get_sql_sort()) {\n $sort = ' ORDER BY '.$sort;\n }\n\n $ufields = user_picture::fields('u', $extrafields);\n if (!empty($users)) {\n $select = \"SELECT $ufields,\n s.id AS submissionid, s.grade, s.submissioncomment,\n s.timemodified, s.timemarked,\n ss.status as pub_status,\n CASE WHEN s.timemarked > 0 AND s.timemarked >= s.timemodified THEN 1\n ELSE 0 END AS status \";\n\n $sql = 'FROM {user} u '.\n 'LEFT JOIN {assignment_submissions} s ON u.id = s.userid\n AND s.assignment = '.$this->assignment->id.' '. \n 'LEFT JOIN {sword_submissions} ss ON ss.submission = s.id AND ss.type = \\'assignment\\' AND ss.sword = :sword_id' .\n 'WHERE '.$where.'u.id IN ('.implode(',',$users).') ';\n\n $params[\"sword_id\"] = $this->cm_sword->instance; \n $ausers = $DB->get_records_sql($select.$sql.$sort, $params, $table->get_page_start(), $table->get_page_size());\n\n $table->pagesize($perpage, count($users));\n\n ///offset used to calculate index of student in that particular query, needed for the pop up to know who's next\n $offset = $page * $perpage;\n $strupdate = get_string('update');\n $strgrade = get_string('grade');\n $strview = get_string('view');\n $grademenu = make_grades_menu($this->assignment->grade);\n\n if ($ausers !== false) {\n $grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id, array_keys($ausers));\n $endposition = $offset + $perpage;\n $currentposition = 0;\n foreach ($ausers as $auser) {\n if ($currentposition == $offset && $offset < $endposition) {\n $rowclass = null;\n $final_grade = $grading_info->items[0]->grades[$auser->id];\n $grademax = $grading_info->items[0]->grademax;\n $final_grade->formatted_grade = round($final_grade->grade,2) .' / ' . round($grademax,2);\n $locked_overridden = 'locked';\n if ($final_grade->overridden) {\n $locked_overridden = 'overridden';\n }\n\n // TODO add here code if advanced grading grade must be reviewed => $auser->status=0\n \n $picture = $OUTPUT->user_picture($auser);\n\n if (empty($auser->submissionid)) {\n $auser->grade = -1; //no submission yet\n }\n $selectAssig=NULL; \n if (!empty($auser->submissionid)) {\n $hassubmission = true;\n \n $selectAssig= $auser->submissionid;\n ///Prints student answer and student modified date\n ///attach file or print link to student answer, depending on the type of the assignment.\n ///Refer to print_student_answer in inherited classes.\n if ($auser->timemodified > 0) {\n $studentmodifiedcontent = $this->print_student_answer($auser->id)\n . userdate($auser->timemodified);\n if ($assignment->timedue && $auser->timemodified > $assignment->timedue && $this->supports_lateness()) {\n $studentmodifiedcontent .= $this->display_lateness($auser->timemodified);\n $rowclass = 'late';\n }\n } else {\n $studentmodifiedcontent = '&nbsp;';\n }\n $studentmodified = html_writer::tag('div', $studentmodifiedcontent, array('id' => 'ts' . $auser->id));\n ///Print grade, dropdown or text\n if ($auser->timemarked > 0) {\n $teachermodified = '<div id=\"tt'.$auser->id.'\">'.userdate($auser->timemarked).'</div>';\n\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\" class=\"'. $locked_overridden .'\">'.$final_grade->formatted_grade.'</div>';\n } else if ($quickgrade) {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'. $menu .'</div>';\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">'.$this->display_grade($auser->grade).'</div>';\n }\n\n } else {\n $teachermodified = '<div id=\"tt'.$auser->id.'\">&nbsp;</div>';\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\" class=\"'. $locked_overridden .'\">'.$final_grade->formatted_grade.'</div>';\n } else if ($quickgrade) {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'.$menu.'</div>';\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">'.$this->display_grade($auser->grade).'</div>';\n }\n }\n ///Print Comment\n if ($final_grade->locked or $final_grade->overridden) {\n $comment = '<div id=\"com'.$auser->id.'\">'.shorten_text(strip_tags($final_grade->str_feedback),15).'</div>';\n\n } else if ($quickgrade) {\n $comment = '<div id=\"com'.$auser->id.'\">'\n . '<textarea tabindex=\"'.$tabindex++.'\" name=\"submissioncomment['.$auser->id.']\" id=\"submissioncomment'\n . $auser->id.'\" rows=\"2\" cols=\"20\">'.($auser->submissioncomment).'</textarea></div>';\n } else {\n $comment = '<div id=\"com'.$auser->id.'\">'.shorten_text(strip_tags($auser->submissioncomment),15).'</div>';\n }\n } else {\n $studentmodified = '<div id=\"ts'.$auser->id.'\">&nbsp;</div>';\n $teachermodified = '<div id=\"tt'.$auser->id.'\">&nbsp;</div>';\n $status = '<div id=\"st'.$auser->id.'\">&nbsp;</div>';\n\n if ($final_grade->locked or $final_grade->overridden) {\n $grade = '<div id=\"g'.$auser->id.'\">'.$final_grade->formatted_grade . '</div>';\n $hassubmission = true;\n } else if ($quickgrade) { // allow editing\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $menu = html_writer::label(get_string('assignment:grade', 'assignment'), 'menumenu'. $auser->id, false, array('class' => 'accesshide'));\n $menu .= html_writer::select(make_grades_menu($this->assignment->grade), 'menu['.$auser->id.']', $auser->grade, array(-1=>get_string('nograde')), $attributes);\n $grade = '<div id=\"g'.$auser->id.'\">'.$menu.'</div>';\n $hassubmission = true;\n } else {\n $grade = '<div id=\"g'.$auser->id.'\">-</div>';\n }\n\n if ($final_grade->locked or $final_grade->overridden) {\n $comment = '<div id=\"com'.$auser->id.'\">'.$final_grade->str_feedback.'</div>';\n } else if ($quickgrade) {\n $comment = '<div id=\"com'.$auser->id.'\">'\n . '<textarea tabindex=\"'.$tabindex++.'\" name=\"submissioncomment['.$auser->id.']\" id=\"submissioncomment'\n . $auser->id.'\" rows=\"2\" cols=\"20\">'.($auser->submissioncomment).'</textarea></div>';\n } else {\n $comment = '<div id=\"com'.$auser->id.'\">&nbsp;</div>';\n }\n }\n\n if (empty($auser->status)) { /// Confirm we have exclusively 0 or 1\n $auser->status = 0;\n } else {\n $auser->status = 1;\n }\n\n $buttontext = ($auser->status == 1) ? $strupdate : $strgrade;\n if ($final_grade->locked or $final_grade->overridden) {\n $buttontext = $strview;\n }\n\n ///No more buttons, we use popups ;-).\n $popup_url = '/mod/assignment/submissions.php?id='.$this->cm->id\n . '&amp;userid='.$auser->id.'&amp;mode=single'.'&amp;filter='.$filter.'&amp;offset='.$offset++;\n\n $button = $OUTPUT->action_link($popup_url, $buttontext);\n\n $status = '<div id=\"up'.$auser->id.'\" class=\"s'.$auser->status.'\">'.$button.'</div>';\n\n $finalgrade = '<span id=\"finalgrade_'.$auser->id.'\">'.$final_grade->str_grade.'</span>';\n\n $outcomes = '';\n\n if ($uses_outcomes) {\n\n foreach($grading_info->outcomes as $n=>$outcome) {\n $outcomes .= '<div class=\"outcome\"><label for=\"'. 'outcome_'.$n.'_'.$auser->id .'\">'.$outcome->name.'</label>';\n $options = make_grades_menu(-$outcome->scaleid);\n\n if ($outcome->grades[$auser->id]->locked or !$quickgrade) {\n $options[0] = get_string('nooutcome', 'grades');\n $outcomes .= ': <span id=\"outcome_'.$n.'_'.$auser->id.'\">'.$options[$outcome->grades[$auser->id]->grade].'</span>';\n } else {\n $attributes = array();\n $attributes['tabindex'] = $tabindex++;\n $attributes['id'] = 'outcome_'.$n.'_'.$auser->id;\n $outcomes .= ' '.html_writer::select($options, 'outcome_'.$n.'['.$auser->id.']', $outcome->grades[$auser->id]->grade, array(0=>get_string('nooutcome', 'grades')), $attributes);\n }\n $outcomes .= '</div>';\n }\n }\n\n $userlink = '<a href=\"' . $CFG->wwwroot . '/user/view.php?id=' . $auser->id . '&amp;course=' . $course->id . '\">' . fullname($auser, has_capability('moodle/site:viewfullnames', $this->context)) . '</a>';\n $extradata = array();\n foreach ($extrafields as $field) {\n $extradata[] = $auser->{$field};\n }\n \n $check='';\n if ($selectAssig == NULL ) {\n $check=html_writer::checkbox('submission_selected',$selectAssig,false,'',array('disabled'=>'disabled'));\n\n } else {\n $check=html_writer::checkbox('submission_selected',$selectAssig,false,NULL,array('class'=>\"usercheckbox\"));\n }\n \n \n \n \n if ($auser->pub_status!=NULL) { \n \n $estado=get_string($auser->pub_status, 'sword');\n }\n else {\n $estado=get_string('nosend', 'sword');\n }\n \n $row = array_merge(array($estado),array($check),array($picture, $userlink), $extradata,\n array($grade, $comment, $studentmodified, $teachermodified,\n $status, $finalgrade));\n if ($uses_outcomes) {\n $row[] = $outcomes;\n }\n $table->add_data($row, $rowclass);\n }\n $currentposition++;\n }\n \n\t\techo html_writer::empty_tag('input',\n\t\t\t\t\t array('type' => 'hidden',\n\t\t\t\t\t\t 'name' => 'id',\n\t\t\t\t\t\t 'value' => $this->cm->id)\n\t\t\t );\n \n \n \n echo '<input type=\"button\" onclick=\"enviar('.$this->cm->id.' ,'. $this->cm->instance.' ,'. $this->cm_sword->id.')\" value=\"'.get_string('sendtorepo', 'sword').'\" />';\n \n \n \n \n \n echo '</form>';\n \n \n $table->print_html(); /// Print the whole table\n } else {\n if ($filter == self::FILTER_SUBMITTED) {\n echo html_writer::tag('div', get_string('nosubmisson', 'assignment'), array('class'=>'nosubmisson'));\n } else if ($filter == self::FILTER_REQUIRE_GRADING) {\n echo html_writer::tag('div', get_string('norequiregrading', 'assignment'), array('class'=>'norequiregrading'));\n }\n }\n }\n\n /// Print quickgrade form around the table\n if ($quickgrade && $table->started_output && !empty($users)){\n $mailinfopref = false;\n if (get_user_preferences('assignment_mailinfo', 1)) {\n $mailinfopref = true;\n }\n $emailnotification = html_writer::checkbox('mailinfo', 1, $mailinfopref, get_string('enablenotification','assignment'));\n\n $emailnotification .= $OUTPUT->help_icon('enablenotification', 'assignment');\n echo html_writer::tag('div', $emailnotification, array('class'=>'emailnotification'));\n\n $savefeedback = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'fastg', 'value'=>get_string('saveallfeedback', 'assignment')));\n echo html_writer::tag('div', $savefeedback, array('class'=>'fastgbutton'));\n\n echo html_writer::end_tag('form');\n } else if ($quickgrade) {\n echo html_writer::end_tag('form');\n }\n\n echo '</div>';\n echo '<div class=\"modal\"><!-- Place at bottom of page --></div>';\n\n echo $OUTPUT->footer();\n }", "public function canCheckAnswers()\n {\n $sections = $this->getSectionCompletion(self::SECTIONS);\n\n return $sections['allCompleted'] && $this->canBeUpdated();\n }", "public function update_submission($hash, $data, $current_page = 0, $complete = FALSE)\n\t{\n\t\t// Get previously created survey submission\n\t\t$query = $this->db->where('hash', $hash)->limit(1)->get('vwm_surveys_submissions');\n\n\t\t// Make sure that this submission exists\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\n\t\t\t// Combine old and new submission data\n\t\t\t$previous_data = json_decode($row->data, TRUE);\n\t\t\t$new_data = $previous_data;\n\n\t\t\tforeach($data as $question_id => $question_data)\n\t\t\t{\n\t\t\t\t$new_data[ $question_id ] = $question_data;\n\t\t\t}\n\n\t\t\t$new_data = json_encode($new_data);\n\n\t\t\t$data = array(\n\t\t\t\t'data' => $new_data,\n\t\t\t\t'updated' => time(),\n\t\t\t\t'completed' => $complete ? time() : NULL,\n\t\t\t\t'current_page' => $current_page,\n\t\t\t);\n\n\t\t\t$this->db\n\t\t\t\t->where('hash', $hash)\n\t\t\t\t->update('vwm_surveys_submissions', $data);\n\n\t\t\treturn $this->db->affected_rows() > 0 ? TRUE : FALSE;\n\t\t}\n\t\t// If this submission does not exist\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function isThereWorkToBeDone()\r\n {\r\n if($this->dbCon->count($this->dbTableName, [\"isDelivered\" => 0]) < 1)\r\n {\r\n generic::successEncDisplay(\"There is no email for posting\");\r\n\r\n // add the return to follow the PHP principles and manual, however, it will terminate from the above!\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function is_empty(stdClass $submission) { //called on save\r\n return $this->count_codehandin_submission($submission->id, ASSIGNSUBMISSION_CODEHANDIN_FILEAREA) == 0;\r\n }", "function submitted_events_process_pending_submissions($pending_submissions) {\n\tforeach ( $pending_submissions as $submission ) {\n\t\tsubmitted_events_create_event ( $submission );\n\t}\n\t// tell the user how many events were created\n\t\n\tif (sizeof ( $pending_submissions ) == 0) {\n\t\techo '<h2>No pending submissions - no events created.</h2>';\n\t} else {\n\t\t$events_created_text;\n\t\tif (sizeof ( $pending_submissions ) == 1) {\n\t\t\t$events_created_text = 'one new event';\n\t\t} else {\n\t\t\t$events_created_text = sizeof ( $pending_submissions ) . ' new events';\n\t\t}\n\t\t\n\t\techo '<h2>Created ' . $events_created_text . ' - please edit and publish when ready.</h2>\n\t\t<p>Hopefully this has saved you some work!</p>';\n\t}\n}", "public function has_submitted($memberid) {\n return !empty($this->redscores[$memberid]);\n }", "public function checkDataSubmission() {\n\t\t$this->main('', array());\n }", "function check_all_is_post_upcoming(){\n $this->loop_through_all(array($this, 'is_post_upcoming'));\n }", "public function evalEmpty()\n {\n $users = User::students()->get();\n $evalEmpty = true;\n foreach ( $users as $user )\n {\n if ($this->evalGradeExists($user)){\n $evalEmpty = false;\n break;\n }\n }\n return $evalEmpty;\n }", "public function hasComplete(){\n return $this->_has(2);\n }", "public function isSigLeader()\n {\n return $this->sigs()->where('main', 1)->count() > 0;\n }", "public function getSubmittedbyuser()\n\t{\n\t\treturn $this->submittedbyuser;\n\t}", "public function isReported(User $user)\n {\n $userId = $user->getId();\n $redis = Yii::$app->redis;\n \n $key = 'postcomplains:'.$this->id;\n \n return($redis->sismember($key, $userId)); \n }", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "function learndash_get_submitted_essay_data( $quiz_id, $question_id, $essay ) {\n\t$users_quiz_data = get_user_meta( $essay->post_author, '_sfwd-quizzes', true );\n\tif ( ( !empty( $users_quiz_data ) ) && ( is_array( $users_quiz_data ) ) ) {\n\t\tif ( ( $essay ) && ( is_a( $essay, 'WP_Post' ) ) ) {\n\t\t\t$essay_quiz_time = get_post_meta( $essay->ID, 'quiz_time', true );\n\t\t} else {\n\t\t\t$essay_quiz_time = null;\n\t\t}\n\n\t\tforeach ( $users_quiz_data as $quiz_data ) {\n\t\t\t// We check for a match on the quiz time from the essay postmeta first. \n\t\t\t// If the essay_quiz_time is not empty and does NOT match then continue;\n\t\t\tif ( ( absint( $essay_quiz_time ) ) && ( isset( $quiz_data['time'] ) ) && ( absint( $essay_quiz_time ) !== absint( $quiz_data['time'] ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (empty($quiz_data['pro_quizid']) || $quiz_id != $quiz_data['pro_quizid'] || ! isset( $quiz_data['has_graded'] ) || false == $quiz_data['has_graded'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((isset($quiz_data['graded'])) && (!empty($quiz_data['graded']))) {\n\t\t\t\tforeach ( $quiz_data['graded'] as $key => $graded_question ) {\n\t\t\t\t\tif ( ( $key == $question_id ) && ( $essay->ID == $graded_question['post_id'] ) ) {\n\t\t\t\t\t\treturn $quiz_data['graded'][ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public function send_approvals() {\n if (isset($_POST['approval'])) {\n $PDO = Record::getConnection();\n\t\t\t $common = new APCommon();\n \t\t\t foreach($_POST['approval'] as $id){\n\t\t\t\t\n\t\t\t\t//Find the record in the temp table and send the confirmation email\n\t\t\t\t$sql = \"SELECT * FROM \". TABLE_PREFIX . \"approved_users_temp WHERE id=:id\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute(array(\"id\" => $id));\n\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t$email = $row[2];\n\t\t\t\t$name = $row[1];\n\t\t\t\t$common->confirmation_email($email, $name);\n\t\t\t\t\n\t\t\t\t//Update the temp table to mark row as processed\n $sql = \"UPDATE \" . TABLE_PREFIX . \"approved_users_temp SET processed=1 WHERE id=:id\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute(array(\"id\" => $id));\n\t\t\t }\n \n \t\t\tFlash::set('success', __('Approvals processed'));\n \t\t} else {\n Flash::set('error', __('Unable to process approvals'));\n }\n\n redirect(get_url('plugin/approved_users/approvals'));\n }", "public function getUserStatusInQuests($user);", "function edd_pup_is_processing( $emailid = null ) {\r\n\tif ( empty( $emailid ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t$email_list = edd_pup_emails_processing();\r\n\r\n\tif ( is_array( $email_list['processing'] ) && in_array( $emailid, $email_list['processing'] ) ) {\r\n\r\n\t\t$totals = edd_pup_check_queue( $emailid );\r\n\r\n\t\tif ( $totals['queue'] > 0 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n}", "private function allowed_to_view_matches(){\n if(!rcp_user_can_access($this->user_id, $this->security_form_id) || !rcp_user_can_access($this->user_id, $this->defendant_id)){\n $this->error_message = esc_html__('You do not have access to this report.', 'pprsus');\n return false;\n }\n //are the variables even set\n if($this->security_form_id == '' || $this->defendant_id == '' || $this->token == ''){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n //is this a security form post type\n if(get_post_type($this->security_form_id) != 'security'){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n //does the security form or defendant belong to the current user\n $security_form_author = get_post_field('post_author', $this->security_form_id);\n if($security_form_author != $this->user_id){\n $this->error_message = esc_html__('This security report belongs to another user.', 'pprsus');\n return false;\n }\n\n $defendant_author = get_post_field('post_author', $this->defendant_id);\n if($defendant_author != $this->user_id){\n $this->error_message = esc_html__('This defendant belongs to another user.', 'pprsus');\n return false;\n }\n\n //is the token valid\n $token_from_post = get_post_meta((int)$this->security_form_id, 'secret_token', true);\n if($token_from_post != $this->token){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n return true;\n }", "public function isSubmitted($classID) {\n $row = $this->db->where('key', $this->__buildClazzKey($classID))->limit(1)->get('score_meta')->row();\n return $row != NULL && $row->value == 'true';\n }", "public function handle()\n {\n //give score of 100 to everyone who submitted to 319 and 320\n /* $submission = new Submission();\n $responses = '';\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98762)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $result = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'];\n $responses .= $result . ', ';\n\n }\n dd($responses);*/\n DB::beginTransaction();\n $score = new Score();\n $score->where('assignment_id', 319)->update(['score' => 100]);\n $score = new Score();\n $score->where('assignment_id', 320)->update(['score' => 160]);\n\n $submission = new Submission();\n //On Adapt ID: 392-98875 can I make all true submissions to \"zero score\"\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98875)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $true_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'A';\n $submission->score = $true_submission ? 0 : 2;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $true_submission ? -2 : 2;\n $current->score = $current->score + $adjustment;\n $current->save();\n\n }\n /*The students that submitted A for 392-98765 should get it correct and\n the rest should not.*/\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98765)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $correct_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'A';\n $submission->score = $correct_submission ? 4 : 0;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $correct_submission ? 4 : -4;\n $current->score = $current->score + $adjustment;\n $current->save();\n }\n//Another one: 392-98764\n $submissions = $submission->where('assignment_id', 392)->where('question_id', 98764)->get();\n foreach ($submissions as $submission) {\n $submission_arr = json_decode($submission->submission, true);\n $correct_submission = $submission_arr['score']['answers']['AnSwEr0001']['original_student_ans'] === 'C';\n $submission->score = $correct_submission ? 4 : 0;\n $submission->save();\n $score = new Score();\n $current = $score->where('assignment_id', 392)->where('user_id', $submission->user_id)->first();\n $adjustment = $correct_submission ? 4 : -4;\n $current->score = $current->score + $adjustment;\n $current->save();\n }\n\n DB::commit();\n\n /*I want every Chem 2C student to get 100% on assignments 319 and 320.\n I presume a simple override of the final score is needed instead of playing around with each assessment score.\n\n and all \"false submission\" into full credit of 2 points?\n /*The students that submitted A for 392-98765 should get it correct and\n the rest should not.*/\n }", "public function has_results()\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n\t\t$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats\r\n\t\t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n\t\t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t$result = api_sql_query($sql, __FILE__, __LINE__);\r\n\t\t$number=mysql_fetch_row($result);\r\n\t\treturn ($number[0] != 0);\r\n }", "public function getActiveSubmissionsEvent($form_id) {\n $query = $this->db->select()\n ->from(DB_PREFIX.\"form_\".$form_id)\n ->where(\"stav != \", \"zruseny\")\n ->get();\n \n if ($query->num_rows() > 0) {\n \n return $query->result();\n }\n return FALSE; \n }", "public function isAllStepsCompleted()\n {\n $completedSteps = count($this->getCompletedSettingsSteps());\n $status = ($completedSteps == 5) ? true : false;\n\n return $status;\n }", "public function checkQueuedEditsAction()\n {\n $reqIds = $this->_getParam(\"req_ids\");\n $this->_helper->json($this->checkQueuedEdits($reqIds));\n }" ]
[ "0.6453063", "0.63572836", "0.62184566", "0.614686", "0.5964588", "0.5960737", "0.58579767", "0.57735705", "0.5769345", "0.5744846", "0.57434314", "0.57242435", "0.56118435", "0.5611202", "0.5591954", "0.5563764", "0.55606085", "0.54936224", "0.54547346", "0.5449678", "0.5419217", "0.5407261", "0.53684336", "0.5356259", "0.5347819", "0.532864", "0.5328052", "0.5318049", "0.53054416", "0.529099", "0.52681404", "0.5264059", "0.5255341", "0.5251851", "0.52402806", "0.5232169", "0.5226991", "0.5224125", "0.5211001", "0.5203548", "0.5201219", "0.51812893", "0.5178481", "0.5156057", "0.51488584", "0.5135223", "0.5135223", "0.51264954", "0.5112782", "0.510765", "0.5094557", "0.5086678", "0.50862974", "0.50783575", "0.50678056", "0.50487274", "0.50438803", "0.5036015", "0.5032035", "0.50238246", "0.5022593", "0.5018278", "0.50124043", "0.5005565", "0.5005235", "0.49967632", "0.49856576", "0.49849576", "0.4977908", "0.49644738", "0.4963826", "0.49548024", "0.49543783", "0.49476573", "0.49447078", "0.49359453", "0.4935565", "0.49334514", "0.4929954", "0.49245885", "0.49199814", "0.4917261", "0.4916584", "0.48931995", "0.48867953", "0.48855606", "0.48825875", "0.48758343", "0.48725778", "0.4866951", "0.48668686", "0.48606676", "0.48603642", "0.4856621", "0.4848787", "0.48408195", "0.48396897", "0.4837989", "0.48316637", "0.4823926" ]
0.66446465
0
Bootstrap any application services.
public function boot() { //视图间共享数据 view()->share('sitename','Laravel学院-- 我是共享数据'); //视图Composer view()->composer('hello',function($view) { $view->with('user', array('name' => 'test', 'avatar' => public_path('images/touxiang.jpg'))); }); //多个视图 view()->composer(['hello','home'],function($view) { $view->with('user', array('name' => 'test', 'avatar' => public_path('images/touxiang.jpg'))); }); //所有视图 view()->composer('*',function($view) { $view->with('user', array('name' => 'test', 'avatar' => public_path('images/touxiang.jpg'))); }); //和composer功能相同 因为实例化后立即消失 也许可以减少内存消耗吧 view()->creator('profile', 'App\Http\ViewCreators\ProfileCreator'); /* * 这个东西怎么理解呢 * share() 不可变共享数据 比如 网站名 网站地址之类的 * composer() 可变共享数据 比如用户名和头像 还有就是快速变化的信息 比如网站在线人数 * 这个每个页面加载都得请求 所以直接放到这里共享出来 */ // DB::listen(function($sql,$bindings,$time){ // echo 'SQL语句执行: '.$sql.',参数: '.json_encode($bindings).',耗时: '.$time.'ms'; // }); Post::saving(function($post){ echo 'saving event is fired<br>'; //看来同样道理 必须是可见的参数 //必须在fillable里 if($post->user_id == 1) return false; }); Post::creating(function($post){ echo 'creating event is fired<br>'; //看来同样道理 必须是可见的参数 //必须在fillable里 if($post->name == 'test content') return false; }); Post::created(function($post){ echo 'created event is fired<br>'; }); Post::saved(function($post){ echo 'saved event is fired<br>'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67912513", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.0
-1
Register any application services.
public function register() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
insertar un nuevo campo en la estructura
public function insertar($pidnomeav, $pnombre, $ptipo, $plongitud, $pnombre_mostrar, $pregex, $visible, $tipocampo, $descripcion) { $this->Instancia(); //-- verificar que no se repita el campo en la tabla $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); $result = $query->from('NomCampoestruc ') ->where("idnomeav='$pidnomeav' AND nombre='$pnombre'") ->execute()->count(); if ($result > 0) return false; //-- buscar el id del proximo campo $idCampoNuevo = $this->buscaridproximo(); //-- insertar los valores $this->instance->idcampo = $idCampoNuevo; $this->instance->idnomeav = $pidnomeav; $this->instance->nombre = $pnombre; $this->instance->tipo = $ptipo; $this->instance->longitud = $plongitud; $this->instance->nombre_mostrar = $pnombre_mostrar; $this->instance->regex = $pregex; $this->instance->visible = $visible; $this->instance->tipocampo = $tipocampo; $this->instance->descripcion = $descripcion; try { $this->instance->save(); return $idCampoNuevo; } catch (Doctrine_Exception $ee) { if (DEBUG_ERP) echo(__FILE__ . ' ' . __LINE__ . ' ' . $ee->getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertar($objeto){\r\n\t}", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "public function inserir()\n {\n }", "private function insertNew() {\n $sth=NULL;\n $array=array();\n $query=\"INSERT INTO table_spectacles (libelle) VALUES (?)\";\n $sth=$this->dbh->prepare($query);\n $array=array($this->libelle);\n $sth->execute($array);\n $this->message=\"\\\"\".$this->getLibelle().\"\\\" enregistré !\";\n $this->blank();\n $this->test=1;\n }", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "public function insert($aluno) {\n\t}", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function insert($contenido);", "public function insert($tarConvenio);", "public function insert($fisicasuelo);", "public function insert( $objet);", "public function insert($usuario_has_hojaruta);", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "public function insert(registroEquipo $reEquipo);", "public function insert($producto);", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "public function insertar(){\n $mysqli = new mysqli(Config::BBDD_HOST, Config::BBDD_USUARIO, Config::BBDD_CLAVE, Config::BBDD_NOMBRE);\n //Arma la query\n $sql = \"INSERT INTO tipo_domicilios ( \n tipo,\n nombre\n ) VALUES (\n '\" . $this->tipo .\"', \n '\" . $this->nombre .\"'\n );\";\n //Ejecuta la query\n if (!$mysqli->query($sql)) {\n printf(\"Error en query: %s\\n\", $mysqli->error . \" \" . $sql);\n }\n //Obtiene el id generado por la inserción\n $this->idtipo = $mysqli->insert_id;\n //Cierra la conexión\n $mysqli->close();\n }", "public function insert($maeMedico);", "public function insert($mambot);", "public function insert($tienda);", "function AgenteInsert($Nombre, $Contacto, $Notas, $NombreArchivo, $Uuid, $IdInmobiliaria) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]agentes set\r\n\t\tNombre = '$Nombre',\r\n\t\tContacto = '$Contacto',\r\n\t\tNotas = '$Notas',\r\n\t\tNombreArchivo = '$NombreArchivo',\r\n\t\tUuid = '$Uuid',\r\n\t\tIdInmobiliaria = $IdInmobiliaria\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function insertarEnBd(){\n\t/* Conexion con base de datos. */\n\t$conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n\t/* Se define la consulta SQL */\n\t$consulta = \"INSERT INTO alumno (matricula,nombre,carrera,email,telefono) VALUES (\";\n\t$consulta .= \"'.$this->matricula.','$this->nombre','$this->carrera','$this->email','$this->telefono');\";\n\t\n\t/* Se efectúa la consulta. */\n\t$conexion->exec($consulta);\n\n}", "public function insertar($nombreMiembro,$apellido1Miembro,$apellido2Miembro,$correo,$contrasenna,$rol){ \n $miembro = new Miembro();\n \n $miembro->nombreMiembro = $nombreMiembro;\n $miembro->apellido1Miembro = $apellido1Miembro;\n $miembro->apellido2Miembro = $apellido2Miembro;\n $miembro->correo = $correo;\n $miembro->contrasenna = $contrasenna;\n $miembro->rol = $rol;\n \n $miembro->save();\n }", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "protected function fijarSentenciaInsert(){}", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function guardarRegistro2(){\r\n $this->database->execute(\"INSERT INTO empleados (nombreApellido, dni, email, pass) VALUES ('rodri', '12345678', '[email protected]', '123456'\");\r\n }", "function ajouterUe($id, $nomUe,$libelleUe) {\n $query = 'insert into ue values(\"\",\"'.$nomUe.'\",\"'.$id.'\",\"'.$libelleUe.'\")';\n mysql_query($query) or die (\"Impossible d'inserer une UE\");\n\t\n}", "public function insert($permiso);", "function insertar($bd);", "protected function saveInsert()\n {\n }", "public function insertar($tabla, $campo){\r\n $resul = $this->conexion->query(\"INSERT INTO $tabla VALUES ($campo)\") or die($this->conexion->error);\r\n if($resul)\r\n echo \"Se agrego con exito\";\r\n return true;\r\n return false;\r\n }", "function Save(){\n $rowsAffected = 0;\n if(isset($this->legajo)){\n $rowsAffected = $this->UpdateSQL([\"legajo = \".$this->legajo]);\n }else{\n $rowsAffected = $this->InsertSQL();\n if($rowsAffected > 0){\n $this->legajo = $this->Max(\"legajo\");\n }\n }\n if($rowsAffected == 0){\n throw new \\Exception(\"Error al guardar Usuario\");\n }else{\n $this->Refresh();\n }\n }", "public function insert($calendario);", "function insertarEnBd(){\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n /* Se define la consulta SQL */\n $consulta = \"INSERT INTO maestro (noEmpleado,carrera,nombre,telefono) VALUES (\";\n $consulta .= \"'$this->noEmpleado','$this->carrera','$this->nombre','$this->telefono');\";\n \n /* Se efectúa la consulta. */\n $conexion->exec($consulta);\n\n}", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "function insertar(){\n global $conexion, $data;\n $usuario = $data[\"usuario\"];\n $email = $data[\"email\"];\n $clave = $data[\"clave\"];\n $tipo = $data[\"tipo\"];\n $eliminado = $data[\"eliminado\"];\n $estado = $data[\"estado\"];\n $resultado = mysqli_query($conexion,\"INSERT INTO usuario(usu_usuario, usu_email, usu_clave, usu_estado, usu_eliminado, usu_id_tipo_usuario)VALUES ('$usuario', '$email', '$clave', '$estado', '$eliminado', '$tipo' ) \");\n echo validarError($conexion, true, $resultado);\n }", "public function insert($cotizacion);", "function inserir($cidade, $bairro, $rua, $numeroTerreno, $quantidadeCasa, $valor, $idUsuario) #Funcionou\n {\n $conexao = new conexao();\n $sql = \"insert into terreno( Cidade, Bairro, Rua, NumeroTerreno, QuantidadeCasa, Valor, idUsuario) \n values('$cidade', '$bairro', '$rua', '$numeroTerreno', '$quantidadeCasa', '$valor', $idUsuario )\";\n mysqli_query($conexao->conectar(), $sql);\n echo \"<p> Inserido </p>\";\n }", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "public function insert($perifericos);", "public function insert(...$field_values);", "function insertNewField($inserttable, $name, $optional, $type, $tablename, $minimum, $maximum, $ordering){\r\n\r\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n try{\r\n $sql = $this->db->prepare(\"INSERT INTO $inserttable (displayname, inputtype, mandatory, tablename, minimum, maximum, ordering)\r\n VALUES(:name, :type, :optional, :tablename, :minimum, :maximum, :ordering)\");\r\n\r\n $sql->bindParam(':name', $name, PDO::PARAM_STR);\r\n $sql->bindParam(':type', $type, PDO::PARAM_STR);\r\n $sql->bindParam(':optional', $optional, PDO::PARAM_INT);\r\n $sql->bindParam(':tablename', $tablename, PDO::PARAM_STR);\r\n $sql->bindParam(':minimum', $minimum, PDO::PARAM_INT);\r\n $sql->bindParam(':maximum', $maximum, PDO::PARAM_INT);\r\n $sql->bindParam(':ordering', $ordering, PDO::PARAM_INT);\r\n if($sql->execute()){\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n\r\n\r\n } catch(PDOExecption $e) {\r\n echo $e->getMessage();\r\n }\r\n\r\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function addField();", "public function insertar($data){\n\t\t\t$this->db->insert('tareas',array(\n\t\t\t\t'titulo'=>$data['titulo'],\n\t\t\t\t'descripcion'=>$data['descripcion'],\n\t\t\t\t'id_estado'=>1,\n\t\t\t\t'fecha_alta'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_modificacion'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_baja'=>null\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function insert() {\n \n $query = $this->dbConnection->prepare(\"INSERT INTO `menu` (`id`, `name`, `nameen`, `address`, `isMenu`, `order`) VALUES (NULL, :name, :nameen, :address, :isMenu, :order)\");\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':nameen', $this->nameen, PDO::PARAM_STR);\n $query->bindValue(':address', $this->address, PDO::PARAM_STR);\n $query->bindValue(':isMenu', $this->isMenu, PDO::PARAM_STR);\n $query->bindValue(':order', $this->order, PDO::PARAM_STR);\n $query->execute();\n $this->id = $this->dbConnection->lastInsertId();\n }", "public function insert()\n {\n \n }", "public function insert() {\n \n }", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "public function insertarDataInicialEnSchema(){\n $sql = \"INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('Valen13', '$2y$10\\$qf6VYsFmsKP5jnbuMonYMeYkNXXDU1Rhz2FHS7ayYpO/82ATX/x5S', '[email protected]', 'Valentin', 'Mariño', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad65b6e90.jpg');\n INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('monty15', '$2y$10\\$rYwEXX3AjtZYYbWb9HjsT.V5sBiDmi3bb7ldCPbvqOhGdA8VRWJY6', '[email protected]', 'Monty', 'Hola', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad959ec8b.jpg');\";\n\n $this->db->prepare($sql)->execute();\n }", "function insert()\n\t{\n\t\t$nama = $_POST ['nama'];\n\t\t$tipe = $_POST ['tipe'];\n\t\t$harga = $_POST ['harga'];\n\t\t$bintang = $_POST ['bintang'];\n\t\t$fasilitas = $_POST ['fasilitas'];\n\t\t$strategis = $_POST ['strategis'];\n\n\t\t//save ke db (nama_lengkap dan alamat sesuai nama tabel di DB)\n\t\t$data = array('nama_hotel'=> $nama, 'tipe_kamar'=> $tipe, 'harga'=> $harga, 'bintang'=> $bintang, 'fasilitas'=> $fasilitas, 'strategis'=> $strategis);\n\t\t$tambah = $this->model_alternatif->tambahData('alternatif', $data);\n\t\tif($tambah >0)\n\t\t{\n\t\t\tredirect ('Alternatif/index');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\techo 'Gagal Disimpan';\n\t\t}\n\n\t}", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function insertArticulo($etiqueta){\r\n\t$nombreimg = $_FILES[\"imagen\"]['name'];\r\n\t\r\n\t$articulo = new Articulo;\r\n\t$material = getMaterial($etiqueta->material);\r\n\t$acabado = getAcabado($etiqueta->acabado);\r\n\t\r\n\t$articulo->articuloId = getUltimoArticulo()+1;\r\n\t$articulo->nombre = $etiqueta->nombre;\r\n\t$articulo->categoria = 1;\r\n\t$articulo->grupo = $etiqueta->grupo;\r\n\t$articulo->descripcion = ' sobre '.$material['material'].', de '.$etiqueta->ancho.'mm. x '.$etiqueta->alto.'mm. impresa en '.getTextTinta($etiqueta->colores).' con '.$etiqueta->cambios.' cambios, acabado: '.$acabado['tipo_acabado'].'. '.$etiqueta->nombre.' '.$etiqueta->descripcion.'.';;\r\n\t$articulo->formatoprecio = 1;\r\n\t$articulo->cantidad = $etiqueta->cantidad;\r\n\t$articulo->imagen = 'impresas/'.$nombreimg;\r\n\t$articulo->oferta = 0;\r\n\t$articulo->coste = $etiqueta->coste;\r\n\t$articulo->visible = 1;\r\n\t$articulo->stock = 0;\r\n\t\r\n\t$query = sprintf('INSERT INTO articulos\r\n\t(articuloId, nombre, categoria, grupo, descripcion, formatoPrecio, cantidad, imagen, oferta, coste, visible, stock)\r\n\tVALUES (%d, \"%s\", %d, \"%s\", \"%s\", %d, %d, \"%s\", %d, %f, %d, %d)',\r\n\t$articulo->articuloId,\r\n\t$articulo->nombre,\r\n\t$articulo->categoria,\r\n\t$articulo->grupo,\r\n\t$articulo->descripcion,\r\n\t$articulo->formatoprecio,\r\n\t$articulo->cantidad,\r\n\t$articulo->imagen,\r\n\t$articulo->oferta,\r\n\t$articulo->coste,\r\n\t$articulo->visible,\r\n\t$articulo->stock);\r\n\t\t\r\ninsert_db($query);\r\nreturn $articulo->articuloId;}", "function insertEtiquetaImpresa($etiqueta){\r\n\t\t\r\n\t$query = sprintf('INSERT INTO etiq_impresas(etiq_impresas_id, nombre, grupo, material, descripcion, ancho, alto, cantidad, colores, cambios, cliches, acabado, coste) VALUES (%d, \"%s\", \"%s\", %d, \"%s\", %f, %f, %d, %d, %d, %d, %d, %f)',\r\n\tgetUltimoArticulo()+1,\r\n\t$etiqueta->nombre,\r\n\t$etiqueta->grupo,\r\n\t$etiqueta->material,\r\n\t$etiqueta->descripcion,\r\n\t$etiqueta->ancho,\r\n\t$etiqueta->alto,\r\n\t$etiqueta->cantidad,\r\n\t$etiqueta->colores,\r\n\t$etiqueta->cambios,\r\n\t$etiqueta->cliches,\r\n\t$etiqueta->acabado,\r\n\t$etiqueta->coste);\r\n\tinsert_db($query);\r\n\t}", "function EmpresaInsert($Nombre) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]empresas set\r\n\t\tNombre = '$Nombre'\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function form_insert($data){\n\t\t$this->db->insert('annonce', $data);\n\t}", "public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }", "function ajoue_proprietaire($nom,$CA,$debut_contrat,$fin_contrat)\r\n{ $BDD=ouverture_BDD_Intranet_Admin();\r\n\r\n if(exist($BDD,\"proprietaire\",\"nom\",$nom)){echo \"nom deja pris\";return;}\r\n\r\n $SQL=\"INSERT INTO `proprietaire` (`ID`, `nom`, `CA`, `debut_contrat`, `fin_contrat`) VALUES (NULL, '\".$nom.\"', '\".$CA.\"', '\".$debut_contrat.\"', '\".$fin_contrat.\"')\";\r\n\r\n $result = $BDD->query ($SQL);\r\n\r\n if (!$result)\r\n {echo \"<br>SQL : \".$SQL.\"<br>\";\r\n die('<br>Requête invalide ajoue_equipe : ' . mysql_error());}\r\n}", "public function _insertar($objeto) {\n\t\t$this->db->setTable_name( $this->table_name );\t\t\n\t\t$this->db->setIs_query(false);\n\t\t\n\t\t$query = $this->_create_query_insertar( $objeto );\n\t\t// echo \"<br> $query <br>\\n\";\n\t\t\n\t\tif ( $this->db->getDriver() == amaguk_database_connection::DB_DRIVER_POSTGRESL ){\n\t\t\t$this->db->setField_key_name( $this->fields[0] );\n\t\t\t\n\t\t\t$this->db->insert_query( $query );\n\t\t}else{\n\t\t\t$this->db->query( $query );\n\t\t}\t\t\n\t\t\n\t\t$this->where=\"\";\n\t\t//print $query;\n\t\t$this->clearCondition();\n\t\t\n\t}", "public function insertFormLabel()\r\n {\r\n\r\n $formfield = new FormFields();\r\n $formfield->setName('name');\r\n $formfield->setLabel('name');\r\n $formfield1 = new FormFields();\r\n $formfield1->setName('surname');\r\n $formfield1->setLabel('surname');\r\n $formfield2 = new FormFields();\r\n $formfield2->setName('email');\r\n $formfield2->setLabel('email');\r\n $formfield3 = new FormFields();\r\n $formfield3->setName('telephone');\r\n $formfield3->setLabel('telephone');\r\n\r\n $this->entityManage->persist($formfield);\r\n $this->entityManage->persist($formfield1);\r\n $this->entityManage->persist($formfield2);\r\n $this->entityManage->persist($formfield3);\r\n $this->entityManage->flush();\r\n\r\n }", "public function insert($data);", "public function insertFormSubmit()\r\n {\r\n $post = array(\r\n 'name' => ($_POST['name']),\r\n 'surname' => ($_POST['surname']),\r\n 'surname' => ($_POST['email']),\r\n 'telephone' => ($_POST['telephone'])\r\n );\r\n if (!empty($post)) {\r\n $formsubmit = new FormSubmit();\r\n $formsubmit->setDate();\r\n $this->entityManager->persist($formsubmit);\r\n $submitdata = new FormSubmitData();\r\n $submitdata->setName(($_POST['name']));\r\n $submitdata->setValue(base64_encode(serialize($post)));\r\n $this->entityManager->persist($submitdata);\r\n $this->entityManager->flush();\r\n echo 'ok';\r\n }\r\n }", "function insertar(){\n $conexion = mysqli_connect(\"localhost\",\"root\",\"\",'dynasoft');\n $query= \"INSERT INTO Material (Id_Material,NOMBRE_MATERIAL,UNIDAD_MEDIDA,CANTIDAD_MATERIAL,DESCRIPCION,Fecha_Vencido)\n VALUES ('$this->id_material','$this->nombre','$this->unidad','$this->cantidad','$this->descripcion','$this->fecha_vencido')\";\n $resultado = mysqli_query($conexion,$query);\n\n mysqli_close($conexion);\n }", "public function insertar($comentario){\n\t\t\t$db=DB::conectar();\n\t\t\t$insert=$db->prepare('INSERT INTO comentarios values( :idproducto,:ip,:fecha,:comentario,:estrellas,:activo,:email)');\n\t\t\t$insert->bindValue('idproducto',$comentario->getIdproducto());\n\t\t\t$insert->bindValue('ip',$comentario->getIp());\n\t\t\t$insert->bindValue('fecha',$comentario->getFecha());\n\t\t\t$insert->bindValue('comentario',$comentario->getComentario());\n\t\t\t$insert->bindValue('estrellas',$comentario->getEstrellas());\n\t\t\t$insert->bindValue('activo',$comentario->getActivo());\n\t\t\t$insert->bindValue('email',$comentario->getEmail());\n\t\t\t$insert->execute();\n\t\t\t\n\t\t}", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "function insere_db($campos,$valores,$tabela) {\n\t$inicio=\"INSERT INTO $tabela(\";\n\t$meio=\") VALUES (\";\n\t$fim=\")\";\n\t$valor = sizeof($campos);\n\t$strc=\"\";\n\tfor($i=0;$i <= ($valor-1);$i++){\n\t\t$strc.=\"$campos[$i]\";\n\t\tif($i != ($valor-1)){\n\t\t $strc.=\",\";\n\t\t}\n\t }\n\t$strv=\"\";\n\tfor($k=0;$k <= ($valor-1);$k++){\n\t\t$strv.=\"\\\"$valores[$k]\\\"\";\n\t\tif($k != ($valor-1)){\n\t\t $strv.=\",\";\n\t\t}\n\t }\n\t$insere=\"$inicio$strc$meio$strv$fim\";\n\t//echo $insere;\n\t$foi = consulta_db($insere);\n\treturn $foi;\n}", "public function insert() {\n\t\t$db = self::getDB();\n\t\t$sql = \"INSERT INTO posts\n\t\t\t\t\t(nome, conteudo, fk_idUsuario, fk_idTopico)\n\t\t\t\tVALUES\n\t\t\t\t\t(:nome, :conteudo, :fk_idUsuario, :fk_idTopico)\";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':nome' => $this->getNome(),\n\t\t\t':conteudo' => $this->getConteudo(),\n\t\t\t':fk_idUsuario' => $this->getFkIdUsuario(),\n\t\t\t':fk_idTopico' => $this->getFkIdTopico()\n\t\t]);\n\t\t$this->idPost = $db->lastInsertId();\n\t}", "public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }", "function criar_enquete(){\n\n// dados de formulario\n$conteudo = remove_html($_REQUEST['conteudo']);\n\n// tabela\n$tabela = TABELA_ENQUETE;\n\n// data\n$data = data_atual();\n\n// query\n$query = \"insert into $tabela values(null, '$conteudo', '$data');\";\n\n// valida conteudo\nif($conteudo != null){\n\ncomando_executa($query);\n\t\n};\n\n}", "public function insere_contato_voluntario() {\r\n\t\r\n\t\t/* \r\n\t\tVerifica se algo foi postado e se está vindo do form que tem o campo\r\n\t\tinsere_contato_voluntario.\r\n\t\t*/\r\n\r\n//\t\tif ( 'POST' != $_SERVER['REQUEST_METHOD'] || empty( $_POST['insere_contato_voluntario'] ) ) {\r\n\t\tif ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (chk_array($this->parametros,2) != 0) return;\r\n\r\n\t\tunset ($_POST['insere_contato_voluntario']);\r\n\t\tunset ($_POST['nome']);\r\n\t\tunset ($_POST['apelido']);\r\n\t\tunset ($_POST['id_fone']);\r\n\t\tunset ($_POST['tipo']); // Fixo ou celular verificar !!!\r\n\r\n\t\tif (isset($_POST['whatsapp'])) {\r\n\t\t\t$_POST['whatsapp'] = \"S\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$_POST['whatsapp'] = 'N';\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\tPara evitar conflitos apenas inserimos valores se o parâmetro edit\r\n\t\tnão estiver configurado.\r\n\t\t*/\r\n/*\t\tif ( chk_array( $this->parametros, 0 ) == 'edit' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Só pra garantir que não estamos atualizando nada\r\n\t\tif ( is_numeric( chk_array( $this->parametros, 1 ) ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n*/\t\t\t\r\n//\t\tforeach ( $_POST as $key => $value ) {echo $key . \" - \" . $value . \" cada POST Insere Contato</br>\";}\r\n\r\n\t\t// Insere os dados na base de dados\r\n\t\t$query = $this->db->insert( 'telefones', $_POST );\r\n\t\t\r\n\t\t// Verifica a consulta\r\n\t\tif ( $query ) {\t\t\r\n\t\t\t// Retorna uma mensagem\r\n\t\t\t$this->form_msg = 'Contato Inserido Com Sucesso!';\r\n\t\t\treturn;\t\t\t\r\n\t\t} \r\n\t\t\r\n\t\t// :(\r\n\t\t$this->form_msg = 'Erro ao enviar dados!';\r\n\r\n\t}", "public function add($data){\n $this->db->insert('tbl_petugas', $data);\n\n }", "function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }", "function insert(){\n\t\t\t$result = $this->consult();\n\t\t\tif(count($result) > 0){\n\t\t\t\t$this->form_data[\"id_paciente\"] = $result[0]->id_paciente;\n\t\t\t\t$this->id_paciente = $result[0]->id_paciente;\n\t\t\t\treturn $this->update();\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->db->insert('paciente', $this->form_data);\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\treturn array(\"message\"=>\"ok\");\n\t\t\t} catch (Exception $e){\n\t\t\t\treturn array(\"message\"=>\"error\");\n\t\t\t}\n\t\t}", "function dbInsert($edit)\r\n\t{\r\n\r\n\t}", "public function add() {\n if ($this->id == 0) {\n $reponse = $this->bdd->prepare('INSERT INTO chapitres SET title = :title, body = :body');\n $reponse->execute([\n 'body'=>$this->body, \n 'title'=>$this->title\n ]);\n }\n }", "public function insert(){\n\n }", "public function inserir() {\n $query = '\n insert into tb_atividade(\n id_evento, nome, qntd_part, inscricao, valor, tipo, carga_hr, data_inicio, data_fim\n ) values ( \n :id_evento, \n :nome, \n :qntd_part, \n :inscricao, \n :valor, \n :tipo, \n :carga_hr, \n :data_inicio, \n :data_fim\n )';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id_evento', $this->atividade->__get('id_evento'));\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function insert($cbtRekapNilai);", "public function productosInsert($nombre, $preciounitario, $preciopaquete, $unidadesporpaquete, $unidadesenstock, $categoria, $proveedor,$foto)\n {\n $sql = \"INSERT INTO productos (nombreproducto,preciounitario,preciopaquete,unidadesporpaquete,unidadesenstock,idcategoria,idproveedor,foto) VALUES ('$nombre',$preciounitario,$preciopaquete,$unidadesporpaquete,$unidadesenstock,'$categoria','$proveedor','$foto')\";\n \nmysqli_query($this->open(), $sql) or die('Error. ' . mysqli_error($sql));\n $this->productosSelect();\n }", "public function insert()\n {\n # code...\n }", "function ADD() {\n // si el atributo clave de la entidad no esta vacio\n\t\tif ( ( $this->login <> '' && $this->IdTrabajo <> '' ) ) {\n \n\t\t\t// construimos el sql para buscar esa clave en la tabla\n\t\t\t$sql = \"SELECT * FROM ENTREGA WHERE ( login = '$this->login' && IdTrabajo = '$this->IdTrabajo')\";\n // si da error la ejecución de la query\n\t\t\tif ( !$result = $this->mysqli->query( $sql ) ) { \n\t\t\t\treturn 'No se ha podido conectar con la base de datos'; // error en la consulta (no se ha podido conectar con la bd). Devolvemos un mensaje que el controlador manejara\n // si la ejecución de la query no da error\n\t\t\t} else { \n if ($result->num_rows == 0){ // miramos si el resultado de la consulta es vacio\n //Variable que almacena la sentencia sql\n\t\t\t\t\t$sql = \"INSERT INTO ENTREGA (\n\t\t\t\t\t\t\t login,\n IdTrabajo,\n Alias,\n Horas,\n Ruta) \n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$this->login',\n\t\t\t\t\t\t\t\t'$this->IdTrabajo',\n\t\t\t\t\t\t\t\t'$this->Alias',\n '$this->Horas',\n '$this->Ruta'\n\t\t\t\t\t\t\t\t)\";//se contruye la sentencia sql para insertar la entrega\n \n \n \n }\n //si el número de tuplas no es 0\n else{\n return 'Ya existe la entrega introducida en la base de datos'; // ya existe\n }\n }\n // si da error en la ejecución del insert devolvemos mensaje\n\t\t\t\t\tif ( !$this->mysqli->query( $sql )) { \n\t\t\t\t\t\treturn \"Error en la inserción\";\n\t\t\t\t\t}\n \n //si no da error en la insercion devolvemos mensaje de exito\n else { \n\t\t\t\t\t\treturn 'Inserción realizada con éxito'; //operacion de insertado correcta\n\t\t\t\t\t}\n // si ya existe ese valor de clave en la tabla devolvemos el mensaje correspondiente\n\t\t\t\t} else \n\t\t\t\t\treturn 'Inserta un valor'; // ya existe\n \n\t}", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "public function insert(Modelo $modelo){\n $sql = INSERT . TABELA_MODELO . \" \n (idMarca, nomeModelo)\n VALUES (\n '\".$modelo->getIdMarca().\"',\n '\".$modelo->getNomeModelo().\"')\";\n\n //Abrindo conexão com o BD\n $PDO_conex = $this->conex->connectDataBase();\n\n //Executa no BD o script Insert e retorna verdadeiro/falso\n if($PDO_conex->query($sql)){\n $erro = false;\n }else{\n $erro = true;\n }\n //Fecha a conexão com o BD\n $this->conex->closeDataBase();\n return $erro;\n}", "function inserisci($team,$id,$nr_maglia,$nome,$eta,$nascita,$skill,$ruolo,$forma,$fresc,$cond,$esp,$po,$df,$cn,$pa,$rg,$cr,$tc,$tr,$pd,$talento,$qta,$carattere,$stipendio,$valore)\n\t\t{\n\t\t\t$qry = \"INSERT INTO giocatori (id,id_team,nr,nome,eta,nascita,skill,pos,forma,fresc,cond,esp,\n\t\t\t\t\t\tpo,df,cn,pa,rg,cr,tc,tr,\n\t\t\t\t\t\tpiede,talento,qta,\n\t\t\t\t\t\tstipendio,valore,carattere,contratto) \t\t\t\n\t\t\t\t\tVALUES \n\t\t\t\t\t('$id',\\\"$team\\\",\\\"$nr_maglia\\\",\\\"$nome\\\",\\\"$eta\\\",\\\"$nascita\\\",\\\"$skill\\\",\n\t\t\t\t\t\\\"$ruolo\\\",\\\"$forma\\\",\\\"$fresc\\\",\\\"$cond\\\",\\\"$esp\\\",\t\n\t\t\t\t\t\\\"$po\\\",\\\"$df\\\",\\\"$cn\\\",\\\"$pa\\\",\\\"$rg\\\",\\\"$cr\\\",\\\"$tc\\\",\\\"$tr\\\",\n\t\t\t\t\t\\\"$pd\\\",\\\"$talento\\\",\\\"$qta\\\",\n\t\t\t\t\t\\\"$stipendio\\\",\\\"$valore\\\",\\\"$carattere\\\",9)\";\n\t\t\t\t\t\n\t\t\t$result = mysql_query($qry);\n\t\t\tif (!$result)\n\t\t\t{\n\t\t\t\techo 'Errore nella fase di creazione giocatori: ' . mysql_error();\n\t\t\t\techo '<br>la query è:<br>'.$qry;\n\t\t\t\texit();\n\t\t\t}\n\t\t\t//echo $team.\" - (\".$nr_maglia.\") \".$nome.\" \".$skill.\" \".$eta.\" \".$nascita.\" \".$ruolo.\" \".$forma.\" \".$fresc.\" \".$cond.\" \".$esp.\" \".$po.\" \".$df.\" \".$cn.\" \".$pa.\" \".$rg.\" \".$cr.\" \".$tc.\" \".$tr.\" \".$pd.\" \".$talento.\" \".$carattere.\" \".$stipendio.\" \".$valore.\"<br>\";\n\t\t}", "function ZonaInsert($Nombre, $IdZonaPadre) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]zonas set\r\n\t\tNombre = '$Nombre',\r\n\t\tIdZonaPadre = $IdZonaPadre\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function crear_reserva($reserva) {\n $this->db->insert('edicion', $reserva);\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "function addCampanha($varNome,$varDescricao){\r\n\t$sql = mysql_query(\"Insert into campanha (`nomeCampanha`,`descCampanha`, `dtCampanha`) values ('$varNome','$varDescricao',NOW(),'$_SESSION[idUsuario]')\") or die (mysql_error());\r\n\treturn $sql;\r\n}", "function insertarPuertos($puerto,$bandera,$refdestinos) {\r\n$sql = \"insert into tbpuertos(idpuerto,puerto,bandera,refdestinos)\r\nvalues ('','\".($puerto).\"','\".($bandera).\"',\".$refdestinos.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "public function inserir($nome, $email, $endereco, $bairro, $cep, $cpf, $fone) {\n\n //$nome = $_POST[\"txt_nome\"]; // assim já pega os dados mas\n // por questão de segurança recomenda-se usar strip_tags para quebrar as tags e ficar mais seguro\n // usa-se o issset para verificar se o dado existe, senão retorna null\n $nome = isset($_POST[\"txt_nome\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_nome\")) : NULL; // usado para a edição e inserção do cliente\n $email = isset($_POST[\"txt_email\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_email\")) : NULL; // usado para a edição e inserção do cliente\n $endereco = isset($_POST[\"txt_endereco\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_endereco\")) : NULL; // usado para a edição e inserção do cliente\n $bairro = isset($_POST[\"txt_bairro\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_bairro\")) : NULL; // usado para a edição e inserção do cliente\n $cep = isset($_POST[\"txt_cep\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cep\")) : NULL; // usado para a edição e inserção do cliente\n $cpf = isset($_POST[\"txt_cpf\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cpf\")) : NULL; // usado para a edição e inserção do cliente\n $fone = isset($_POST[\"txt_fone\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_fone\")) : NULL; // usado para a edição e inserção do cliente\n\n $sql = \"INSERT INTO cliente SET nome = :nome, email = :email, endereco = :endereco, bairro = :bairro, cep = :cep, cpf = :cpf, fone = :fone\";\n $qry = $this->db->prepare($sql); // prepare para os dados externos\n $qry->bindValue(\":nome\", $nome); // comando para inserir\n $qry->bindValue(\":email\", $email); // comando para inserir\n $qry->bindValue(\":endereco\", $endereco); // comando para inserir\n $qry->bindValue(\":bairro\", $bairro); // comando para inserir\n $qry->bindValue(\":cep\", $cep); // comando para inserir\n $qry->bindValue(\":cpf\", $cpf); // comando para inserir\n $qry->bindValue(\":fone\", $fone); // comando para inserir\n $qry->execute(); // comando para executar\n\n return $this->db->lastInsertId(); // retorna o id do ultimo registro inserido\n }", "public function inserir($oficina){\r\n\t\t$sql = 'INSERT INTO oficina (id, nome, data, carga_horaria, horario, id_evento, tipo, vagas) VALUES (:id, :nome, :data, :carga_horaria, :horario, :id_evento, :tipo, :vagas)';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->bindValue(':id',$oficina->getId()); \n\r\t\t$consulta->bindValue(':nome',$oficina->getNome()); \n\r\t\t$consulta->bindValue(':data',$oficina->getData()); \n\r\t\t$consulta->bindValue(':carga_horaria',$oficina->getCarga_horaria()); \n\r\t\t$consulta->bindValue(':horario',$oficina->getHorario()); \n\r\t\t$consulta->bindValue(':id_evento',$oficina->getId_evento()); \n\r\t\t$consulta->bindValue(':tipo',$oficina->getTipo()); \n\r\t\t$consulta->bindValue(':vagas',$oficina->getVagas()); \r\n\t\t$consulta->execute();\r\n\t}", "public function persist() {\n $bd = BD::getConexion();\n $sqlInsertUsuario = \"insert into usuarios (nomUsuario, clave) values (:nomUsuario, :clave)\";\n $sthSqlInsertUsuario = $bd->prepare($sqlInsertUsuario);\n $result = $sthSqlInsertUsuario->execute([\":nomUsuario\" => $this->nomUsuario, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }" ]
[ "0.6919016", "0.6855505", "0.6799637", "0.67825305", "0.6734514", "0.6702299", "0.66236323", "0.6611422", "0.65880764", "0.65611744", "0.65516", "0.65460014", "0.6527724", "0.6513393", "0.6512761", "0.651132", "0.64727205", "0.6453065", "0.64228815", "0.6421157", "0.6392726", "0.63880634", "0.6378495", "0.6365291", "0.636099", "0.63512623", "0.6347292", "0.6346571", "0.63322264", "0.63288224", "0.63254493", "0.63103503", "0.6299473", "0.62966573", "0.62890804", "0.6288754", "0.62855434", "0.6283949", "0.62761885", "0.62715715", "0.6267207", "0.6247116", "0.6239887", "0.6230726", "0.62156117", "0.6213404", "0.6212256", "0.62119013", "0.62039477", "0.619755", "0.6159339", "0.6153137", "0.61411375", "0.61384594", "0.61349183", "0.6124309", "0.61235386", "0.61222416", "0.611912", "0.61159337", "0.6099468", "0.6097535", "0.6092686", "0.6089443", "0.60866857", "0.60848594", "0.60809755", "0.6075046", "0.6074681", "0.60620046", "0.6060485", "0.60601866", "0.6056002", "0.60495", "0.60480803", "0.60401183", "0.6040076", "0.6032943", "0.6030216", "0.60292345", "0.6026329", "0.60262513", "0.60163325", "0.60148835", "0.6009312", "0.60082936", "0.6008004", "0.6006849", "0.6006849", "0.6006245", "0.6005576", "0.6004228", "0.60040706", "0.6003142", "0.6003142", "0.59994876", "0.5989638", "0.5976469", "0.5973437", "0.5972643", "0.59592474" ]
0.0
-1
Eliminar un campo de la base de datos
public function eliminarCampo($pCampo) { try { $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); // eliminar el campo $result = $query->delete('idcampo') ->from('NomCampoestruc') ->where("idcampo = '$pCampo'") ->execute(); return $result != 0; } catch (Doctrine_Exception $ee) { if (DEBUG_ERP) echo(__FILE__ . ' ' . __LINE__ . ' ' . $ee->getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function eliminar($objeto){\r\n\t}", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}", "function delete_field($field)\n {\n }", "public function deleteField($fieldName) {}", "public function remove_form_field()\n\t{\n\t\t//Get logged in session admin id\n\t\t$user_id \t\t\t\t\t\t= ($this->session->userdata('user_id_hotcargo')) ? $this->session->userdata('user_id_hotcargo') : 1;\n\t\t$setting_data \t\t\t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t$data['data']['setting_data'] \t= $setting_data;\n\t\t$data['data']['settings'] \t\t= $this->sitesetting_model->get_settings();\n\t\t$data['data']['dealer_id'] \t\t= $user_id;\n\t\t\n\t\t//getting all admin data \n\t\t$data['myaccount_data'] \t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t\n\t\t\n\t\t//Get requested id to remove\n\t\t$field_id \t\t\t\t\t= $this->input->get('form_id');\n\t\t\n\t\t//deleting query\n\t\t$this->mongo_db->where(array('field_name' => $field_id));\n\t\tif($this->mongo_db->delete('form_fields'))\n\t\t\techo 1;\n\t\telse\n\t\t\techo 0;\n\t}", "public function clean() {\n unset($data['id_nome']);\n }", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "function eliminar_alumno($codigo){\r\n\t\t\t\t$cn = $this->conexion();\r\n\r\n if($cn!=\"no_conexion\"){\r\n \t$sql=\"delete from $this->nombre_tabla_alumnos where codigo='$codigo'\";\r\n\t\t\t$rs = mysql_query($sql,$cn);\r\n\t\t\tmysql_close($cn);\t\t\t \r\n\t\t\treturn \"mysql_si\";\r\n\t\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\treturn \"mysql_no\";\r\n\t\t}\r\n\t}", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "public function eliminar(){\n $sql = \"UPDATE especialidad SET Estado = ? WHERE Id_Especialidad = ?;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //bindeando los parametros de la consulta prepar\n $query->bindParam(1, $this->estado);\n $query->bindParam(2, $this->id_especialidad);\n //ejecutando\n $result = $query->execute();\n //retornando true si se ejecuto, false si no\n return $result;\n }", "function Eliminar(){\n\t \n\t $this->Model->Eliminar($_GET['id']);\n\t\t\n\t }", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public static function eliminar($idAlumno){\r\n\t\t\t$conexion =new Conexion();\r\n\t\t\t\tif($idAlumno){\r\n\t\t\t\t\t$consulta = $conexion->prepare('DELETE FROM ' . self::TABLA .' WHERE idAlumno = :idAlumno' );\r\n\t\t\t\t\t$consulta->bindParam(':idAlumno', $idAlumno);\r\n\t\t\t\t\t$consulta->execute(); \r\n\t\t\t\t}\r\n\t\t\t$conexion = null; \r\n\t\t}", "function eliminarTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n mysql_query(\"DELETE FROM ca_tipo_matricula WHERE id = ? ;\");\n $sql = \"DELETE FROM ca_tipo_matricula WHERE id = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function Elimina($id){\r\n\t\r\n\t\t$db=dbconnect();\r\n\t\r\n\t\t/*Definición del query que permitira eliminar un registro*/\r\n\t\t$sqldel=\"DELETE FROM productos WHERE id_producto=:id\";\r\n\t\r\n\t\t/*Preparación SQL*/\r\n\t\t$querydel=$db->prepare($sqldel);\r\n\t\t\t\r\n\t\t$querydel->bindParam(':id',$id);\r\n\t\t\r\n\t\t$valaux=$querydel->execute();\r\n\t\r\n\t\treturn $valaux;\r\n\t}", "public function removeField( $field ) {\r\n if ( isset($this->fields[$field]) ) {\r\n unset($this->fields[$field]);\r\n }\r\n\r\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_nom=$this->iid_nom AND id_nivel='$this->iid_nivel'\")) === false) {\n $sClauError = 'PersonaNota.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "function eliminar(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $eliminado = $data[\"eliminado\"];\n $resultado = mysqli_query($conexion,\"UPDATE usuario SET usu_eliminado='$eliminado' WHERE usu_id='$id'\");\n echo validarError($conexion, true, $resultado);\n }", "function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}", "public function dropField( $table, $field );", "public function borrar() {\n $id = $this->input->post(\"id\");\n $this->AdministradorModel->delete($this->tabla, $id);\n }", "public function eliminar() {\n $fecha = $this->fecha;\n return ($fecha) ? Funciones::gEjecutarSQL(\"DELETE FROM ASISTENTES WHERE FECHA='$fecha'\") : FALSE;\n }", "function borrar(){\n $id=$_POST[\"id\"];\n $consulta=\"DELETE FROM usuarios WHERE id = \".$id.\"\";\n echo $consulta. \"<br>\";\n \n\n $resultado = $conector->query($consulta);\n mostrarListado();\n }", "function Delete_Partido($partido)\n{\n $valor = eliminar(\"DELETE FROM `tb_partidos` WHERE id_partido=$partido\");\n return $valor;\n}", "function eliminar()\n{\n\t$sql=\"delete FROM slc_unid_medida WHERE id_unid_medida ='$this->cod'\";\n\t\t$result=mysql_query($sql,$this->conexion);\n\t\tif ($result) \n\t\t\t return true;\n\t\telse\n\t\t\t return false;\n\t\n}", "public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }", "public function eliminar($valor=null, $columna=null){\n\n\t\t//error_reporting (0);\n\t\t$active = 0;\n\n\t\t//eleimna de la tabla los elementos, si es null nos pone id\n\t\t//$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = ':p'\";\n\t\t$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = '\".$this->id.\"'\";\n\t\t//echo $query.\"<br/>\";\n\n\t\tself::getConexion();\n\t\t//Prepara la conexión\n\t\t$res = self::$cnx->prepare($query);\n\t\t//Agregamos los parametros\n\t\t//Si el valor es diferente de nulo, loa agrega como parametro, en caso contraro de que no existiera el valor\n\t\t//simplemente le ponemos el valor del id del modelo o del registro que se haya puesto \n\t\t\n\t\t//echo \"id: \".$this->id;\n\t\t\n\t\tif(!is_null($valor)){\n $res->bindParam(\":p\",$active, $valor);\n \n }else{\n $res->bindParam(\":p\",$active,(is_null($this->id)?null:$this->id));\n \t//error_reporting (0);\n }//if\n\n\t\t//ejecutar al final \n\t\tif($res->execute()){\n\t\t\t//si ejecuta el query al final desconecta y retorna true\n\t\t\tself::getDesconectar();\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//si no ejecuta el query nos retorna false\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function delete( $value = NULL, $field = 'id' );", "public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_activ='$this->iid_activ' AND id_asignatura='$this->iid_asignatura' AND id_nom=$this->iid_nom\")) === false) {\n $sClauError = 'Matricula.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "function eliminarImagenArreglo($campo, $tabla, $llavePrimaria, $campoLlave)\n {\n $data=$this->analisisRiesgo->getNombreImagenTabla($campo, $tabla, $llavePrimaria, $campoLlave);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagenTabla($borrar, $tabla, $llavePrimaria, $campoLlave);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$campo/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function remove(){\n if(!empty($_POST['id'])){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $val->del();\n }\n header('location: '.FOLDER_PATH.'/Valida');\n }", "public function bajaUnidadMedida() // Ok\n {\n $id = $this->input->post('idUnidadMedida');\n echo $this->Lovs->eliminar($id); \n }", "public function EliminarPerfil()\n {\n $this->db->where('idPerfil', $_POST['idPerfil']);\n $row = $this->db->get('perfil');\n $query=$row->row();\n\n /** Registro de Historial **/\n $Mensaje=\" Se Eliminó Perfil: \".$query->DescripcionPerfil.\"\";\n $this->db->select(\"FU_REGISTRO_HISTORIAL(5,\".$this->glob['idUsuario'].\",'\".$Mensaje.\"','\".$this->glob['FechaAhora'].\"') AS Respuesta\");\n $func[\"Historial\"] = $this->db->get();\n\n\n\n $this->db->where('idPerfil', $_POST['idPerfil']);\n $delete_data[\"Delete\"] = $this->db->delete('perfil');\n $delete_data[\"errDB\"] = $this->db->error();\n\n return $delete_data;\n\n }", "public static function removeColumn($col){\n\t\t//\t\t\tarray_slice($db_fields, $col + 1, count($db_fields) -1, true);\n\t\t\t\t\n\t}", "function eliminarFila($id_campo, $cant_campos){\n\t$respuesta = new xajaxResponse();\n\t$respuesta->addRemove(\"rowDetalle_$id_campo\"); //borro el detalle que indica el parametro id_campo\n\t-- $cant_campos; //Resto uno al numero de campos y si es cero borro todo\n\tif($cant_campos == 0){\n\t\t$respuesta->addRemove(\"rowDetalle_0\");\n\t\t$respuesta->addAssign(\"num_campos\", \"value\", \"0\"); //dejo en cero la cantidad de campos para seguir agregando si asi lo desea el usuario\n\t\t$respuesta->addAssign(\"cant_campos\", \"value\", \"0\");\n\t}\n $respuesta->addAssign(\"cant_campos\", \"value\", $cant_campos); \n\treturn $respuesta;\n}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "protected\n function eliminar($id)\n {\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function removeField(string $name): void\n {\n $card = $this->getCardFor($name);\n\n if (null === $card) {\n return;\n }\n\n $group = $this->getGroup($card);\n foreach ($group->fields as $i => $field) {\n if (isset($field->id) && $field->id === $name) {\n unset($group->fields[$i]);\n }\n }\n }", "function eliminarRegistro($table,$camp,$dato){\n\t$q = \"DELETE FROM \".$table.\" WHERE \".$camp.\" = \".$dato;\n\t\n\tmysql_query($q);\n\n}", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }", "public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_localidad($id)\");\n }\n }", "public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_rubro($id)\");\n }\n }", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "function eliminarImagenCarpeta($campo, $tabla, $idAsignacion, $carpeta)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$carpeta/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "function EliminarMascotas($nombres, $primer_apellido, $segundo_apellido, $fehca_nacimiento, $lugar_nacimiento, $iddepartamento, $idmunicipio, $telefono_casa, $celular, $direccion, $foto){\n $conexion = Conectar();\n $sql = \"DELETE FROM padrinos WHERE id=:id\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':idpadrinos', $idpadrinos);\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $res=$statement->fetchAll();\n return $res;\n}", "public function removeField($field_name){\n\t\tif(isset($this->Fields[$field_name])){\n\t\t\tunset($this->Fields[$field_name]);\n\t\t}\n\t}", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "public function EliminarId()\n\t{\n\t\theader (\"content-type: application/json; charset=utf-8\");\n\t\tif($this->_Method == \"POST\")\n\t\t{\n\t\t\t// Validaciones\n\t\t\tif(validarTokenAntiCSRF(\"_JS\"))\n\t\t\t{\n\t\t\t\t//Creamos una instancia de nuestro \"modelo\"\n\t\t\t\t$item = $this->ObtenModelPostId();\n\t\t\t\tif($item != null && $item->Eliminar())\n\t\t\t\t{\n\t\t\t\t\techo json_encode( array(\"Estado\"=>1) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo json_encode( array(\"Estado\"=>0, \"Error\"=>\"No eliminador\" ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo json_encode( array(\"Estado\"=>0, \"Error\"=>\"No permitido, por fallo de Token anti CSRF.\" ) );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo json_encode( array(\"Estado\"=>0, \"Error\"=>\"No permitido, solo por POST.\") );\n\t\t}\n\t}", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "function eliminarImagenSusQ($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/fotoSustanciasQuimicas/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public function delete(){\n\t\t$sql = new Sql();\n\t\t$sql->query(\"DELETE FROM TB_USUARIOS WHERE idusuario=:ID\", array(\n\t\t\t':ID'=>$this->getIdusuario()\n\t\t));\n\n\t\t$this->setIdusuario(null);\n\t\t$this->setDeslogin(null);\n\t\t$this->setDessenha(null);\n\t\t$this->setDtcadastro(new DateTime());\n\t}", "public function remove_field(form_item $field) {\n foreach($this->_fields as $key=>$f) {\n if ($f == $field) {\n unset($this->_fields[$key]);\n return;\n }\n }\n }", "function excluirPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"DELETE FROM pessoa WHERE id = '{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}", "public function eliminarUsuario(){\r\n $sql =\"DELETE FROM usuarios WHERE IdUsuario = '{$this->idUsuario}';\";\r\n $res = $this->conexion->setQuery($sql);\r\n return $res;\r\n}", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function testDeleteField()\n {\n $fakePista = factory(Pista::class,1)->create([\n 'id' => 4545,\n 'id_club' => factory(Establecimiento::Class,1)->create([\n 'id' => 9999\n ]),\n ]);\n Pista::deleteField(4545);\n $this->assertDatabaseMissing('pista',[\n 'id' => 4545\n ]);\n\n }", "public function field_delete_field($field_name) {\n field_delete_field($field_name);\n field_purge_batch();\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function eliminarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function __unset($field) {\n\t\t$this->offsetUnset($field);\n\t}", "protected function eliminar($id)\n {\n }", "public static function eliminar(){\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $cita = Cita::find($_POST['id']);\n $cita->eliminar();\n header('Location:' . $_SERVER['HTTP_REFERER']);\n }\n }", "public function __unset(string $field): void\n\t{\n\t\t$this->unsetValue($field);\n\t}", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function eliminar($con){\r\n\t\t$sql = \"DELETE FROM lineaspedidos WHERE idPedido='$this->idPedido' AND idProducto='$this->idProducto'\";\r\n\t\t// Ejecuta la consulta y devuelve el resultado\r\n\t\treturn ($con->query($sql));\r\n\t}", "function eliminarImagenServidor($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_item='$this->iid_item'\")) === FALSE) {\n $sClauError = 'UbiGasto.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return FALSE;\n }\n return TRUE;\n }", "protected function eliminar_cliente_modelo ($codigo){\n\t\t$query=mainModel::conectar()->prepare(\"DELETE FROM cliente WHERE CuentaCodigo =:Codigo\");\n\t\t$query->bindParam(\":Codigo\",$codigo);\n\t\t$query->execute();\n\t\treturn $query;\n\t}", "public function Eliminar_Exp_Laboral($data){\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n $tiporegistro = \"Experiencia Laboral\";\n $accion = \"Elimina una Nueva \".$tiporegistro.\" de el Sistema (Hoja vida) TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario'];\n //$idusuario = $_POST['id_user'];;\n try {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n $sql = \"DELETE FROM th_experiencia_laboral WHERE exp_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->id\n )\n ); \n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "function Delete(){\n if(isset($this->legajo)){\n $this->DeleteBy([\"legajo = \".$this->legajo]);\n return true;\n }\n return false;\n }", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE id_situacion='$this->iid_situacion'\")) === false) {\n $sClauError = 'Nota.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "function Delete($de_cod_denuncia){\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\n\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"DELETE FROM denuncia WHERE de_cod_denuncia =?\" ;\n\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute(array($de_cod_denuncia));\n\n\t\tfloopets_BD::Disconnect();\n\t}", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "function elimina_record($id){\n\n $mysqli = connetti();\n\n $sql = \"DELETE FROM spesa WHERE id =\" . $id;\n\n //var_dump($sql); die();\n\n $mysqli->query($sql);\n chiudi_connessione($mysqli);\n}", "public function delete($value, $searchField = null);", "public function removeNlAbo()\n\t{\n\t\t$t=array('email'=>$_POST['email']);\n\t\t$req= self::$bdd->prepare('DELETE FROM `AbonnementNlGW` WHERE email= (:email);');\n\t\t$req->execute($t);\n\t}", "public function eliminarArchivo($nomBaseArchiu){\n $dbh = BaseDatos::getInstance(); \n $borraArchiu = $dbh->prepare('DELETE FROM archiu\n WHERE NOM_BASE_ARCHIU = :nomArchiu');\n $borraArchiu->bindParam(':nomArchiu', $nomBaseArchiu, PDO::PARAM_STR);\n $borraArchiu->execute();\n }", "function eliminar($bd);", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "function EliminaDetallePedido($NumPedido,$CodArti){\n\t\tif($this->con->conectar()==true){\n\t\treturn mysql_query(\"DELETE * FROM `DET_PedidosSolicitados` WHERE `NumPedido` = '\" .$NumPedido. \"' and `NumPedido` = '\" .$CodArti. \"'\");\n\t\t}\n\t}", "public function DBEliminar()\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (($oDblSt = $oDbl->exec(\"DELETE FROM $nom_tabla WHERE dl='$this->iid_dl' \")) === false) {\n $sClauError = 'Delegacion.eliminar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n return true;\n }", "public function remover()\n\t{\n\t\t$sql = \"DELETE FROM $this->tabela WHERE $this->chave_primaria = :id\";\n\n\t\t$this->resultado = $this->conn->prepare($sql);\n\t\t$this->resultado->bindValue(':id', $this->id);\n\n\t\treturn $this->resultado->execute();\n\t}", "function delete_profile_field()\n {\n if ( ! Session::access('can_admin_members'))\n {\n return Cp::unauthorizedAccess();\n }\n\n if ( ! $m_field_id = Request::input('m_field_id'))\n {\n return false;\n }\n\n $query = DB::table('member_fields')\n ->where('m_field_id', $m_field_id)\n ->select('m_field_name', 'm_field_label', 'm_field_id')\n ->first();\n\n if (!$query) {\n return false;\n }\n\n // Drop Column\n Schema::table('member_data', function($table) use ($query)\n {\n $table->dropColumn('m_field_'.$query->m_field_name);\n });\n\n DB::table('member_fields')->where('m_field_id', $query->m_field_id)->delete();\n\n Cp::log(__('members.profile_field_deleted').'&nbsp;'.$query->m_field_label);\n\n return $this->custom_profile_fields();\n }", "function supprimer1($connexion,$nomTable,$nomClePrimaire,$valeurClePrimaire) { \n $req =$connexion -> query(\"DELETE FROM $nomTable WHERE $nomClePrimaire = '$valeurClePrimaire'\");\n }" ]
[ "0.6975732", "0.66022176", "0.65110576", "0.64433587", "0.6423955", "0.64115226", "0.64111334", "0.6383432", "0.6366389", "0.6353331", "0.6308395", "0.6302912", "0.62975776", "0.62965965", "0.62806696", "0.6273385", "0.6271693", "0.6261888", "0.6244422", "0.62344307", "0.62327266", "0.6230111", "0.61918706", "0.6188781", "0.61672336", "0.6165131", "0.6156283", "0.6151621", "0.61440206", "0.6132135", "0.61252797", "0.6122874", "0.61223346", "0.6120885", "0.6110523", "0.6109688", "0.6101944", "0.60992146", "0.6098461", "0.6082552", "0.60679954", "0.60676485", "0.60535127", "0.60402215", "0.603647", "0.60102654", "0.60082", "0.6003419", "0.5999924", "0.5998515", "0.5992774", "0.59896255", "0.5987981", "0.5987981", "0.59852934", "0.59797764", "0.59724754", "0.5968745", "0.59670806", "0.5961796", "0.5961796", "0.5961796", "0.5958749", "0.5957702", "0.59511054", "0.5943649", "0.59424585", "0.5940094", "0.5937794", "0.5937278", "0.5937123", "0.59337276", "0.59334755", "0.5928517", "0.59278613", "0.59260005", "0.59186393", "0.59170264", "0.591325", "0.5911826", "0.59050924", "0.5900875", "0.5895164", "0.58825564", "0.588232", "0.5876627", "0.5872464", "0.5868491", "0.58667487", "0.5864415", "0.5864149", "0.5859249", "0.58508545", "0.5845041", "0.5843026", "0.5843026", "0.58397377", "0.5837643", "0.5828746", "0.5828409", "0.5826409" ]
0.0
-1
Devuelve a que tabla pertenece un campo detereminado
public function buscarTablaPertenece($idCampo) { $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); $result = $query->select('t.idnomeav,t.nombre,t.fechaini,t.fechafin,t.root,t.concepto,t.externa, c.idcampo,c.idnomeav,c.nombre,c.tipo,c.longitud,c.nombre_mostrar,c.regex,c.descripcion,c.tipocampo,c.visible') ->from('NomNomencladoreavestruc t') ->innerJoin('t.NomCampoestruc c') ->where("c.idcampo='$idCampo'") ->execute() ->toArray(); $arreglo = isset($result[0]) ? $result[0] : array(); return $arreglo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTabla(){\n return $this->table;\n }", "function campo($tabla,$campo,$criterio,$pos,$and=''){\n\t$array=CON::getRow(\"SELECT $pos FROM $tabla WHERE $campo='$criterio' $and\");\n\treturn $array[$pos];\n}", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "function getTabla() {\r\n return $this->tabla;\r\n }", "function existe($tabla,$campo,$where){\n\treturn (count(CON::getRow(\"SELECT $campo FROM $tabla $where\"))>0)?true:false;\n}", "function tampil_data($tabel)\n {\n $row = $this->db->prepare(\"SELECT * FROM sms\");\n $row->execute();\n return $hasil = $row->fetchAll();\n }", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public function getInputTable($type);", "private function rowDataTable($seccion, $tabla, $id) {\n $data = '';\n switch ($tabla) {\n case 'admin_usuario':\n $sql = $this->db->select(\"SELECT wa.nombre, wa.email, wr.descripcion as rol, wa.estado\n FROM admin_usuario wa\n LEFT JOIN admin_rol wr on wr.id = wa.id_rol WHERE wa.id = $id;\");\n break;\n case 'ciudad':\n $sql = $this->db->select(\"SELECT c.id, c.descripcion as ciudad, c.estado, d.descripcion as departamento FROM ciudad c\n LEFT JOIN departamento d on c.id_departamento = d.id WHERE c.id = $id;\");\n break;\n default :\n $sql = $this->db->select(\"SELECT * FROM $tabla WHERE id = $id;\");\n break;\n }\n switch ($seccion) {\n case 'departamento':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"departamento\" data-rowid=\"departamento_\" data-tabla=\"departamento\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"departamento\" data-rowid=\"departamento_\" data-tabla=\"departamento\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modal_editar_departamento\" data-id=\"\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['descripcion']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'ciudad':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"ciudad\" data-rowid=\"ciudad_\" data-tabla=\"ciudad\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"ciudad\" data-rowid=\"ciudad_\" data-tabla=\"ciudad\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarCiudad\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['departamento']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['ciudad']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'slider':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"slider\" data-rowid=\"slider_\" data-tabla=\"web_inicio_slider\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"slider\" data-rowid=\"slider_\" data-tabla=\"web_inicio_slider\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTSlider\"><i class=\"fa fa-edit\"></i> Editar </a>';\n if (!empty($sql[0]['imagen'])) {\n $img = '<img src=\"' . URL . 'public/images/slider/' . $sql[0]['imagen'] . '\" style=\"width: 160px;\">';\n } else {\n $img = '';\n }\n if ($sql[0]['principal'] == 1) {\n $principal = '<span class=\"badge badge-warning\">Principal</span>';\n } else {\n $principal = '<span class=\"badge\">Normal</span>';\n }\n $data = '<td>' . $sql[0]['orden'] . '</td>'\n . '<td>' . $img . '</td>'\n . '<td>' . utf8_encode($sql[0]['texto_1']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['texto_2']) . '</td>'\n . '<td>' . $principal . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'caracteristicas';\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"caracteristicas\" data-rowid=\"caracteristicas_\" data-tabla=\"web_inicio_caracteristicas\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"caracteristicas\" data-rowid=\"caracteristicas_\" data-tabla=\"web_inicio_caracteristicas\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $icono = '<i class=\"' . utf8_encode($sql[0]['icon']) . '\"></i>';\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarCaracteristicas\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['titulo']) . '</td>'\n . '<td>' . $icono . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'frases':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"frases\" data-rowid=\"frases_\" data-tabla=\"web_frases\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"frases\" data-rowid=\"frases_\" data-tabla=\"web_frases\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarFrases\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['frase']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['autor']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'servicios':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"servicios\" data-rowid=\"servicios_\" data-tabla=\"web_inicio_servicios\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"servicios\" data-rowid=\"servicios_\" data-tabla=\"web_inicio_servicios\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarServicios\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['servicio']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'verContacto':\n if ($sql[0]['leido'] == 1) {\n $estado = '<span class=\"label label-primary\">Leído</span>';\n } else {\n $estado = '<span class=\"label label-danger\">No Leído</span>';\n }\n $btnEditar = '<a class=\"btnVerContacto pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalVerContacto\"><i class=\"fa fa-edit\"></i> Ver Datos </a>';\n $data = '<td>' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['email']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['asunto']) . '</td>'\n . '<td>' . date('d-m-Y H:i:s', strtotime($sql[0]['fecha'])) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'blog':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"blog\" data-rowid=\"blog_\" data-tabla=\"web_blog\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"blog\" data-rowid=\"blog_\" data-tabla=\"web_blog\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarBlogPost\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $imagen = '<img class=\"img-responsive imgBlogTable\" src=\"' . URL . 'public/images/blog/' . $sql[0]['imagen_thumb'] . '\">';\n $data = '<td>' . $sql[0]['id'] . '</td>'\n . '<td>' . utf8_encode($sql[0]['titulo']) . '</td>'\n . '<td>' . $imagen . '</td>'\n . '<td>' . date('d-m-Y', strtotime($sql[0]['fecha_blog'])) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'usuarios':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"usuarios\" data-rowid=\"usuarios_\" data-tabla=\"admin_usuario\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"usuarios\" data-rowid=\"usuarios_\" data-tabla=\"admin_usuario\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTUsuario\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['email']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['rol']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'paciente':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"paciente\" data-rowid=\"paciente_\" data-tabla=\"paciente\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"paciente\" data-rowid=\"paciente_\" data-tabla=\"paciente\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDatosPaciente\"><i class=\"fa fa-edit\"></i> Ver Datos / Editar </a>';\n $data = '<td>' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['apellido']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['email']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['documento']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['telefono']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['celular']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'redes':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"redes\" data-rowid=\"redes_\" data-tabla=\"web_redes\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"redes\" data-rowid=\"redes_\" data-tabla=\"web_redes\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarRedes\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['descripcion']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['enlace']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'metatags':\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarMetaTag\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['pagina']) . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n }\n return $data;\n }", "function nombreTabla($result,$indice){\n\t if (isset($result) and isset ($indice)){\n\t\treturn mysql_field_table($result, $indice);\n\t }\n\t}", "function campo($tabla,$campo,$criterio,$pos,$and=''){\n\t$array=$GLOBALS['cn']->queryRow('SELECT '.$pos.' FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\" '.$and);\n\treturn $array[$pos];\n}", "function generateColonneByTypeEnTab($table, $columnName, $recherche=false, $attribut=null, $disabled=false) {\n $columnName = strtolower($columnName);\n $retour = '';\n $disabled = $disabled ? 'disabled' : '';\n $recherche = $recherche ? 'rechercheTableStatique' : '';\n $type = $table->getTypeOfColumn($columnName);\n switch ($type) {\n case 'string':\n $retour .= '<td class=\"'.$recherche.'\" columnName='.$columnName.'>'.$attribut.'</td>';\n break;\n case 'float' :\n case 'integer' :\n if (preg_match('#^id[a-zA-Z]+#', $columnName)) {\n $columnNameId = $columnName;\n $columnName = substr($columnName, 2);\n if ($attribut != 0) {\n $cleEtrangere = Doctrine_Core::getTable($columnName)->findOneBy(\"id\", $attribut);\n $retour .= '<td columnName='.$columnNameId.' idCleEtrangere='.$cleEtrangere->id.'>'.$cleEtrangere->libelle.'</td>';\n } else {\n $retour .= '<td columnName='.$columnNameId.'></td>';\n }\n } else {\n $retour .= '<td columnName='.$columnName.'>'.$attribut.'</td>';\n }\n break;\n case 'boolean' :\n $retour .= '<td>';\n if($attribut != null && $attribut == 1) {\n $retour .= '<span class=\"checkbox checkbox_active\" value=\"1\" columnName='.$columnName.' '.$disabled.'></span></div>';\n } else {\n $retour .= '<span class=\"checkbox\" value=\"0\" columnName='.$columnName.' '.$disabled.'></span></td>';\n };\n break;\n }\n return $retour;\n}", "function getColumnasFomTable($tabla)\n{\n $query = \"SELECT cols.ordinal_position as posicion,cols.column_name as nombre,cols.data_type\"\n .\" FROM information_schema.columns cols\"\n .\" WHERE\"\n .\" cols.table_name=?\"\n .\" and cols.column_name not in ('created_at', 'updated_at')\"\n .\" order by posicion\";\n\n $lista = \\DB::select($query, [$tabla]);\n $columnas = array();\n foreach($lista as $item){\n $columnas[$item->nombre] = str_oracion($item->nombre);\n }\n\n return $columnas;\n}", "function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>&nbsp;</td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td>&nbsp;</td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}", "public function checkForField( $field, $table );", "function fetchTabelaUsersPorAprovar($conn) {\n $sql = \"SELECT U.*, T.descricao FROM utilizador U, tipoUtilizador T WHERE tipoUtilizador = '4' AND T.idTipoUtilizador = U.tipoUtilizador\";\n $retval = mysqli_query($conn, $sql);\n if(mysqli_num_rows($retval) != 0) {\n while($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\n mostrarDadosTabela($row);\n }\n } else {\n echo \"\n <tr>\n <td colspan='6' class='has-text-centered'>\n Não foram encontrados registos nesta tabela.\n </td>\n </tr>\n \";\n }\n mysqli_close($conn);\n}", "function tabledata_Fiche($table, $serveur, $field, $key , $idLigne, $modeFiche =\"voir\")\r\n{\r\n\r\n $nombre_Enregistrements = 0;\r\n\r\n // $mode : possible ajout, modif, voir , effacer\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $boolSQL = false;\r\n $txtReadonly = \"\";\r\n $nombre_Enregistrements = 1; // pour forcer passage car pas de requete\r\n break;\r\n case \"effacer\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n case \"modif\" :\r\n $boolSQL = true;\r\n $txtReadonly = \"\";\r\n break;\r\n case \"voir\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n default :\r\n $boolSQL = false;\r\n $txtReadonly = \" READONLY \";\r\n }\r\n\r\n if ($boolSQL)\r\n {\r\n $sqlResult = tabledata_Cde_select($table , $field,\"\",\"\", $key, $idLigne);\r\n $nombre_Enregistrements = sql_count($sqlResult); //2.0\r\n }\r\n\r\n if ($nombre_Enregistrements>0)\r\n {\r\n $total = '';\r\n $hiddens = '';\r\n\r\n if ($boolSQL)\r\n {\r\n $tabUnEnregistrement = sql_fetch($sqlResult);\r\n }\r\n else\r\n {\r\n foreach ($field as $k => $v)\r\n {\r\n $tabUnEnregistrement[$k] = \"\";\r\n }\r\n }\r\n\r\n foreach ($field as $k => $v)\r\n {\r\n if (array_search($k, $key) == \"PRIMARY KEY\")\r\n {\r\n if ($boolSQL)\r\n {\r\n $strDebut = \"Enregistrement ayant comme cl&#233; primaire :<br/><i><b>\"\r\n .$k.\"='\".$tabUnEnregistrement[$k].\"'</b></i><br/>\";\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *([A-Za-z]+) *(\\(([^)]+)\\))?(.*DEFAULT *'(.*)')?/\", $v, $m);\r\n $type = $m[1];\r\n $s = ($m[5] ? \" value='$m[5]' \" : '');\r\n $t = $m[3];\r\n if ($m[2])\r\n {\r\n if (is_numeric($t))\r\n {\r\n if ($t <= 32)\r\n {\r\n $s .= \" sizemax='$t' size='\" . ($t * 2) . \"'\";\r\n }\r\n else\r\n {\r\n $type = 'BLOB';\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *'?(.*[^'])'? *$/\", $t, $m2); $t = $m2[1];\r\n }\r\n }\r\n\r\n switch (strtoupper($type))\r\n {\r\n case TINYINT:\r\n if ($t==1)\r\n {\r\n $checked = \"\";\r\n if ($tabUnEnregistrement[$k] == 1)\r\n {\r\n $checked = \" checked\";\r\n }\r\n $s = \"<td>\"\r\n .\"<input type='checkbox' name='\".$k.\"'\"\r\n .\" value='1'\".$checked.$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n }\r\n case INT:\r\n case INTEGER:\r\n case BIGINT:\r\n case TINYINT:\r\n case CHAR:\r\n case VARCHAR:\r\n case TEXT:\r\n case TINYTEXT:\r\n case TINYBLOB:\r\n case YEAR:\r\n case DATETIME:\r\n case DATE:\r\n case TIME:\r\n $s = \"<td>\"\r\n .\"<input type='text'\".$s.\" name='\".$k.\"'\"\r\n .\" value='\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES)\r\n .\"'\".$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n case ENUM:\r\n case SET: //ajout JFM\r\n $s = \"<td><select name='\".$k.\"'\".$txtReadonly.\">\\n\";\r\n foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n {\r\n if ($tabUnEnregistrement[$k]==$v)\r\n {\r\n $s .= \"<option selected>\".$v.\"</option>\\n\";\r\n }\r\n else\r\n {\r\n $s .= \"<option>\".$v.\"</option>\\n\";\r\n }\r\n } //foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n $s .= \"</select></td>\\n\";\r\n break;\r\n case TIMESTAMP:\r\n $s = '';\r\n if ($mode==\"ajout\")\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='NOW()'/>\\n\";\r\n }\r\n else\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='\".$v.\"'/>\\n\";\r\n }\r\n break;\r\n case LONGBLOB:\r\n $s = \"<td><textarea name='$k' cols='45' rows='20'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\"; //modif. JFM\r\n break;\r\n default:\r\n $t = floor($t / 45)+1;\r\n $s = \"<td><textarea name='$k' cols='45' rows='$t'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\";\r\n break;\r\n } //switch (strtoupper($type))\r\n if ($s)\r\n $total .= \"<tr><td>$k</td>\\n$s</tr>\\n\";\r\n }\r\n }\r\n $hiddens .= \"<input type='hidden' name='serveur' value='\".$serveur.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='table' value='\".$table.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='mode' value='\".$mode.\"'/>\\n\";\r\n\r\n\r\n // $idLigne = htmlentities(stripcslashes($idLigne), ENT_QUOTES );\r\n $idLigne = htmlentities($idLigne, ENT_QUOTES );\r\n\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $txtbouton =\"Ajouter\";\r\n break;\r\n case \"effacer\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='ordresuplig'/>\\n\";\r\n $txtbouton =\"Effacer d&#233;finitivement\";\r\n break;\r\n case \"modif\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='maj'/>\\n\";\r\n $txtbouton =\"Modifier\";\r\n break;\r\n case \"voir\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"--\";\r\n break;\r\n default:\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"AUCUN\";\r\n }\r\n\r\n return \"\\n\\n\\n\".tabledata_url_generer_post_ecrire(\r\n 'tabledata'\r\n , \"<table>\\n\".$strDebut.$total\r\n .\"</table>\".$hiddens,$txtbouton);\r\n } // if ($nombre_Enregistrements>0)\r\n\r\n}", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "private function rowDataTable($seccion, $tabla, $id) {\n $data = '';\n switch ($tabla) {\n case 'usuario':\n $sql = $this->db->select(\"SELECT wa.nombre, wa.email, wr.descripcion as rol, wa.estado\n FROM usuario wa\n LEFT JOIN usuario_rol wr on wr.id = wa.id_usuario_rol WHERE wa.id = $id;\");\n break;\n case 'meta_tags':\n $sql = $this->db->select(\"SELECT\n m.es_texto,\n en_texto\n FROM\n meta_tags mt\n LEFT JOIN menu m ON m.id = mt.id_menu WHERE mt.id = $id;\");\n break;\n default :\n $sql = $this->db->select(\"SELECT * FROM $tabla WHERE id = $id;\");\n break;\n }\n\n switch ($seccion) {\n case 'redes':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"redes\" data-rowid=\"redes_\" data-tabla=\"redes\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"redes\" data-rowid=\"redes_\" data-tabla=\"redes\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarRedes\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"redes_\" data-id=\"' . $id . '\" data-tabla=\"redes\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['descripcion']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['url']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'usuarios':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"usuarios\" data-rowid=\"usuarios_\" data-tabla=\"usuario\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"usuarios\" data-rowid=\"usuarios_\" data-tabla=\"usuario\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTUsuario\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"usuarios_\" data-id=\"' . $id . '\" data-tabla=\"usuario\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['email']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['rol']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'blog':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"blog\" data-rowid=\"blog_\" data-tabla=\"blog\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"blog\" data-rowid=\"blog_\" data-tabla=\"blog\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarBlogPost\" data-pagina=\"blog\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"redes_\" data-id=\"' . $id . '\" data-tabla=\"redes\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n if (empty($sql[0]['youtube_id'])) {\n $imagen = '<img class=\"img-responsive imgBlogTable\" src=\"' . URL . 'public/images/blog/thumb/' . $sql[0]['imagen_thumb'] . '\">';\n } else {\n $imagen = '<iframe class=\"scale-with-grid\" src=\"http://www.youtube.com/embed/' . $sql[0]['youtube_id'] . '?wmode=opaque\" allowfullscreen></iframe>';\n }\n $data = '<td>' . $sql[0]['id'] . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_titulo']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_titulo']) . '</td>'\n . '<td>' . $imagen . '</td>'\n . '<td>' . date('d-m-Y', strtotime($sql[0]['fecha_blog'])) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'slider':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"slider\" data-rowid=\"slider_\" data-tabla=\"slider\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"slider\" data-rowid=\"slider_\" data-tabla=\"slider\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTSlider\" data-pagina=\"slider\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"slider_\" data-id=\"' . $id . '\" data-tabla=\"slider\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n if (!empty($sql[0]['imagen'])) {\n $img = '<img src=\"' . URL . 'public/images/slider/' . $sql[0]['imagen'] . '\" style=\"width: 160px;\">';\n } else {\n $img = '-';\n }\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . $img . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_titulo']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_titulo']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_titulo_principal']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_titulo_principal']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'certificaciones':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"certificaciones\" data-rowid=\"certificaciones_\" data-tabla=\"certificaciones\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"certificaciones\" data-rowid=\"certificaciones_\" data-tabla=\"certificaciones\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTCertificaciones\" data-pagina=\"certificaciones\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"certificaciones_\" data-id=\"' . $id . '\" data-tabla=\"certificaciones\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n if (!empty($sql[0]['imagen_certificacion'])) {\n $img = '<img src=\"' . URL . 'public/images/certificaciones/' . $sql[0]['imagen_certificacion'] . '\" style=\"width: 160px;\">';\n } else {\n $img = '-';\n }\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . $img . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_nombre']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'fraseNosotros':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"fraseNosotros\" data-rowid=\"fraseNosotros_\" data-tabla=\"aboutus_seccion2\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"fraseNosotros\" data-rowid=\"fraseNosotros_\" data-tabla=\"aboutus_seccion2\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTFraseNosotros\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"fraseNosotros_\" data-id=\"' . $id . '\" data-tabla=\"aboutus_seccion2\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_frase']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_frase']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'fraseRetail':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"fraseRetail\" data-rowid=\"fraseRetail_\" data-tabla=\"privatelabel_seccion2\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"fraseRetail\" data-rowid=\"fraseRetail_\" data-tabla=\"privatelabel_seccion2\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTFraseRetail\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"fraseRetail_\" data-id=\"' . $id . '\" data-tabla=\"privatelabel_seccion2\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_frase']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_frase']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'nosotrosSeccion3':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"nosotrosSeccion3\" data-rowid=\"nosotrosSeccion3_\" data-tabla=\"aboutus_seccion3\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"nosotrosSeccion3\" data-rowid=\"nosotrosSeccion3_\" data-tabla=\"aboutus_seccion3\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTNosotrosSeccion3\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"nosotrosSeccion3_\" data-id=\"' . $id . '\" data-tabla=\"aboutus_seccion3\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_titulo']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_titulo']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'itemProductos':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"itemProductos\" data-rowid=\"itemProductos_\" data-tabla=\"productos_items\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"itemProductos\" data-rowid=\"itemProductos_\" data-tabla=\"productos_items\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTItemProducto\" data-pagina=\"itemProductos\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"itemProductos_\" data-id=\"' . $id . '\" data-tabla=\"productos_items\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n if (!empty($sql[0]['imagen'])) {\n $img = '<img src=\"' . URL . 'public/images/productos/items/' . $sql[0]['imagen'] . '\" style=\"width: 160px;\">';\n } else {\n $img = '-';\n }\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . $img . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_nombre']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'productos':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"productos\" data-rowid=\"productos_\" data-tabla=\"productos\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"productos\" data-rowid=\"productos_\" data-tabla=\"productos\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnListado = '<a class=\"mostrarListadoProductos pointer btn-xs\" data-id=\"' . $id . '\"><i class=\"fa fa-list\"></i> Listado </a>';\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTProducto\" data-pagina=\"productos\"><i class=\"fa fa-edit\"></i> Editar </a>';\n //$btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"productos_\" data-id=\"' . $id . '\" data-tabla=\"productos\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n if (!empty($sql[0]['imagen'])) {\n $img = '<img src=\"' . URL . 'public/images/productos/' . $sql[0]['imagen'] . '\" style=\"width: 160px;\">';\n } else {\n $img = '-';\n }\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . $img . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_producto']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_producto']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnListado . ' ' . $btnEditar . '</td>';\n break;\n case 'servicios':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"servicios\" data-rowid=\"servicios_\" data-tabla=\"servicios\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"servicios\" data-rowid=\"servicios_\" data-tabla=\"servicios\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarDTServicios\" data-pagina=\"servicios\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $btnBorrar = '<a class=\"deletDTContenido pointer btn-xs txt-red\" data-rowid=\"servicios_\" data-id=\"' . $id . '\" data-tabla=\"servicios\"><i class=\"fa fa-trash-o\"></i> Eliminar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_servicio']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_servicio']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . ' ' . $btnBorrar . '</td>';\n break;\n case 'verContacto':\n if ($sql[0]['leido'] == 1) {\n $estado = '<span class=\"label label-primary\">Leído</span>';\n } else {\n $estado = '<span class=\"label label-danger\">No Leído</span>';\n }\n $btnEditar = '<a class=\"btnVerContacto pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalVerContacto\"><i class=\"fa fa-edit\"></i> Ver Datos </a>';\n $data = '<td class=\"sorting_1\">' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['nombre']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['email']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['asunto']) . '</td>'\n . '<td>' . date('d-m-Y H:i:s', strtotime($sql[0]['fecha'])) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'meta_tags':\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarMetaTag\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . $id . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_texto']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_texto']) . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n case 'menu':\n if ($sql[0]['estado'] == 1) {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"menu\" data-rowid=\"menu_\" data-tabla=\"menu\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"1\"><span class=\"label label-primary\">Activo</span></a>';\n } else {\n $estado = '<a class=\"pointer btnCambiarEstado\" data-seccion=\"menu\" data-rowid=\"menu_\" data-tabla=\"menu\" data-campo=\"estado\" data-id=\"' . $id . '\" data-estado=\"0\"><span class=\"label label-danger\">Inactivo</span></a>';\n }\n $btnEditar = '<a class=\"editDTContenido pointer btn-xs\" data-id=\"' . $id . '\" data-url=\"modalEditarMenu\"><i class=\"fa fa-edit\"></i> Editar </a>';\n $data = '<td>' . utf8_encode($sql[0]['orden']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['es_texto']) . '</td>'\n . '<td>' . utf8_encode($sql[0]['en_texto']) . '</td>'\n . '<td>' . $estado . '</td>'\n . '<td>' . $btnEditar . '</td>';\n break;\n }\n return $data;\n }", "public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }", "function getTableFields(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t $sql = \"SELECT field_name, field_label\n\t\t FROM export_tabs_fields\n\t\t WHERE source_id = '\".$this->penelopeTabID.\"' ORDER BY field_num ; \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$tableFields = array();\n\t\t\t\t$tableFields[] = self::primaryKeyFieldLabel; //always start with the primary key\n\t\t\t\t\n\t\t\t\t$tableFieldsTemp = array();\n\t\t\t\t$tableFieldsTemp[self::primaryKeyField] = self::primaryKeyFieldLabel; //always start with the primary key\n\t\t \n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $tableFields[] = $row[\"field_label\"];\n\t\t\t\t\t $tableFieldsTemp[$row[\"field_name\"]] = $row[\"field_label\"];\n\t\t\t\t}\n\t\t\t\t$this->tableFieldsTemp = $tableFieldsTemp;\n\t\t\t\t$this->tableFields = $tableFields;\n\t\t }\n\t\t else{\n\t\t\t\treturn false;\n\t\t }\n\t\t \n\t }", "function DatosRow($tabla,$columna,$valor){\n\t\t\t\t\t$this->db->where($columna,$valor);\n\t\t\t\t\t$query = $this->db->get($tabla);\n\n\t\t\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t\t\treturn $query->result();\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}", "function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }", "public static function check_fields_of_table_list($fields) {\n $table_name = self::table_name();\n foreach ($fields as $index => $field) {\n if (strpos($field, '.') !== false) { // found TABLE\n list($request_table, $request_field) = array_map('trim', explode('.', $field));\n\n if ($request_table != $this->_table and ($this->_join and !array_key_exists($request_table, $this->_join)))\n throw new TableNotFoundException(\"Sorgulama işleminde böyle bir tablo mevcut değil\", $request_table);\n\n self::check_fieldname($request_field, $request_table);\n\n } else {\n $fields[$index] = $table_name . '.' . $field;\n }\n }\n return $fields;\n }", "public function getTableFields()\n {\n return array(\n array(\"Field\" => \"uid_empresa\", \"Type\" => \"int(10)\", \"Null\" => \"NO\", \"Key\" => \"PRI\", \"Default\" => \"\", \"Extra\" => \"auto_increment\"),\n array(\"Field\" => \"endeve_id\", \"Type\" => \"varchar(60)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"pago_no_obligatorio\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"nombre\", \"Type\" => \"varchar(100)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"nombre_comercial\", \"Type\" => \"varchar(200)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"representante_legal\", \"Type\" => \"varchar(512)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cif\", \"Type\" => \"varchar(20)\", \"Null\" => \"NO\", \"Key\" => \"UNI\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"pais\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_pais\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"direccion\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"localidad\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"provincia\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cp\", \"Type\" => \"int(8)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"accion\", \"Type\" => \"timestamp\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"CURRENT_TIMESTAMP\", \"Extra\" => \"\"),\n array(\"Field\" => \"updated\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_provincia\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_municipio\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"convenio\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"created\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"aviso_caducidad_subcontratas\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"color\", \"Type\" => \"varchar(10)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"email\", \"Type\" => \"varchar(255)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_enterprise\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"logo\", \"Type\" => \"tinytext\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"skin\", \"Type\" => \"varchar(300)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"dokify\", \"Extra\" => \"\"),\n array(\"Field\" => \"lang\", \"Type\" => \"varchar(2)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"es\", \"Extra\" => \"\"),\n array(\"Field\" => \"activo_corporacion\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"pago_aplicacion\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"receive_summary\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"date_last_summary\", \"Type\" => \"int(16)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"license\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_validation_partner\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"partner_validation_price\", \"Type\" => \"float\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"partner_validation_price_urgent\", \"Type\" => \"float\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"validation_languages\", \"Type\" => \"varchar(250)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cost\", \"Type\" => \"float\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"pay_for_contracts\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"invoice_periodicity\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_attached\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_validated\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_rejected\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_expired\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_transfer_pending\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"kind\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"min_app_version\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"2\", \"Extra\" => \"\"),\n array(\"Field\" => \"prevention_service\", \"Type\" => \"varchar(20)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_idle\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"corporation\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_referrer\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"requirement_count\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"invoice_count\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_referrer\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_manager\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_self_controlled\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"has_custom_login\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"header_img\", \"Type\" => \"tinytext\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"), array(\"Field\" => \"uid_manager\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_referrer\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"requirements_origin_company_cloneables\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n );\n }", "function tablaRuta($Nombre){\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::tablaRegistro($Nombre, $query);\r\n\t\r\n }", "public function show_tablefields()\n {\n $table_name = JFactory::getApplication()->input->get('table_name');\n\n if( ! $table_name)\n {\n return;\n }\n\n $db = JFactory::getDBO();\n\n $table_name = $db->getPrefix().$table_name;\n $fields = $db->getTableColumns($table_name);\n\n if( ! count($fields) || ! count($fields[$table_name]))\n {\n JFactory::getApplication()->enqueueMessage(jgettext('No table fields found'), 'error');\n }\n\n ?>\n<table>\n <tr>\n <th colspan=\"2\"><?php echo jgettext('Include')?></th>\n <th><?php echo jgettext('Editable'); ?></th>\n <th><?php echo jgettext('Type'); ?></th>\n </tr>\n <?php\n foreach($fields[$table_name] as $key => $value)\n {\n switch($value)\n {\n case 'int':\n case 'tinyint':\n $def = '0';\n break;\n\n default:\n $def = 'NULL';\n break;\n }\n\n $javascript1 = \"$('tblfield_edit_\".$key.\"').disabled=(this.checked)?false:true;\";\n $javascript2 = \"$('tblfield_type_\".$key.\"').disabled=(this.checked && $('tblfield_edit_\"\n .$key.\"').checked)?false:true;\";\n\n $javascript = $javascript1.$javascript2;\n ?>\n <tr>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript; ?>\"\n name=\"table_fields[]\" checked=\"checked\"\n id=\"tblfield_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\">\n </td>\n <td><label for=\"tblfield_<?php echo $key; ?>\">\n <?php echo $key.'<br />('.$value.')'; ?>\n </label></td>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript2; ?>\"\n name=\"table_fields_edits[]\" checked=\"checked\"\n id=\"tblfield_edit_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\"></td>\n <td><select name=\"table_fields_types[<?php echo $key; ?>]\"\n id=\"tblfield_type_<?php echo $key; ?>\">\n <option>text</option>\n <option>text area</option>\n <option>radio bool</option>\n <option>html</option>\n </select></td>\n </tr>\n <?php\n }\n ?>\n</table>\n <?php\n }", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "function getTablaInformeAjuntament($desde,$hasta){\n \n // $this->ponerHorasTaller();\n // $this->ponerNumRegistro();\n \n \n $letra=getLetraCasal();\n $numeroRegistroCasalIngresos=getNumeroRegistroCasalIngresos();\n $numeroRegistroCasalDevoluciones=getNumeroRegistroCasalDevoluciones();\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id ASC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $primero=0;\n }\n else {\n $primero=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id DESC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $ultimo=0;\n }\n else {\n $ultimo=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT r.id as id, r.fecha as fecha , r.id_socio as id_socio , r.importe as importe , r.recibo as recibo, s.nombre as nombre,s.apellidos as apellidos \n FROM casal_recibos r\n LEFT JOIN casal_socios_nuevo s ON s.num_socio=r.id_socio\n WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY r.id\";\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio as num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe>0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n //log_message('INFO',$sql);\n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n \n $cabeceraTabla='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Ingrés</th>\n <th class=\"col-sm-1 text-center\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA INGRES</th>\n \n </tr>';\n \n \n \n $tabla=$cabeceraTabla;\n \n $importeTotal=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n }\n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;\n $tabla.='</td>';\n \n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n if($v->periodos==4) $horas=floatval($v->horas_taller_T1);\n if($v->periodos==2) $horas=floatval($v->horas_taller_T2);\n if($v->periodos==1) $horas=floatval($v->horas_taller_T3); \n //log_message('INFO', '===================='.$v->nombre.' '.$horas);\n \n if($horas>0)\n $preu_hora=number_format($v->importe/$horas*100,2); \n else \n $preu_hora=0;\n\n $tabla.='<td class=\"text-center\">';\n $tabla.= $preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\" >';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n $importeTotal+=number_format($importe,2);\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n $pieTabla='</tr></thead><thead><tr>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\">T O T A L S</th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTabla.=number_format($importeTotal,2);\n $pieTabla.='</th>';\n $pieTabla.='</tr></thead></tody></table>';\n \n $tabla.=$pieTabla;\n \n \n $cabeceraTablaDevoluciones='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Devolució</th>\n <th class=\"col-sm-1 text-rigcenterht\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA DEVOLUCIÓ</th>\n \n </tr>';\n \n $tituloCasal=strtoupper(getTituloCasal());\n $salida='<h4>INFORME DETALLAT INGRESSOS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>'\n \n .$tabla.'<br>';\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe<0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n \n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n $tabla=$cabeceraTablaDevoluciones;\n $importeTotalDevoluciones=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n } \n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;;\n $tabla.='</td>';\n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n \n \n /*\n $id_taller=$v->id_taller;\n $periodos=$v->periodos;\n $id_socio=$v->id_socio;\n $importe=-$v->importe;\n $id=$v->id;\n $sql=\"SELECT * FROM casal_lineas_recibos WHERE id<'$id' AND id_taller='$id_taller' AND id_socio='$id_socio' AND periodos='$periodos' AND importe='$importe' ORDER BY id DESC LIMIT 1\";\n //log_message('INFO',$sql);\n if($this->db->query($sql)->num_rows()==1) {\n $recibo=$letra.' '.$this->db->query($sql)->row()->id_recibo;\n }\n else $recibo='';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n */\n \n \n if($v->periodos==4) $horas=$v->horas_taller_T1;\n if($v->periodos==2) $horas=$v->horas_taller_T2;\n if($v->periodos==1) $horas=$v->horas_taller_T3; \n \n //log_message('INFO', '++=================='.$v->nombre.' '.$horas);\n \n $preu_hora=number_format($v->importe/$horas*100,2); \n $tabla.='<td class=\"text-center\">';\n $tabla.= -$preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" >';\n $tabla.= -$importe;\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= -$importe;\n $tabla.='</td>';\n $importeTotalDevoluciones+=$importe;\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n \n \n $pieTablaDevoluciones='</tr></thead><thead><tr>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\">T O T A L S</th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTablaDevoluciones.=-number_format($importeTotalDevoluciones,2);\n $pieTablaDevoluciones.='</th>';\n $pieTablaDevoluciones.='</tr></thead></tody></table>';\n \n \n \n \n \n $salida.='<h4>INFORME DETALLAT DEVOLUCIONS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>';\n \n \n \n \n \n \n $salida.=$tabla;\n $salida.=$pieTablaDevoluciones;\n $salida.='<br><h4>RESUM TOTAL</h4>';\n \n $importeResumen=number_format($importeTotal,2)+number_format($importeTotalDevoluciones,2);\n $resumenTotal='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid #DDDDDD;border-top:2px solid #DDDDDD;border-left:1px solid #DDDDDD;\">T O T A L S</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid black;border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">'.number_format($importeResumen,2).'</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n\n\n\n </thead></tbody></table>';\n \n $salida.=$resumenTotal;\n \n \n \n \n return $salida;\n \n }", "public function getFields($table);", "final public function checkRelationTable():Table\n {\n return static::typecheck($this->relationTable(),Table::class,$this->col());\n }", "public function table($mensaje = NULL)\n\t{\n\t\tif($this->_session_data['id_perfil'] == 2){\n\t\t\t$db['registros'] = $this->m_entes->getEntes($this->_session_data['id_usuario']);\n\t\t}else{\n\t\t if($this->_config['entes_delete'] == 1){\n $db['registros'] = $this->m_entes->getRegistros('all'); \n }else{\n $db['registros'] = $this->m_entes->getRegistros(); \n }\n\t\t}\n\t\t\t\n\t\tif($mensaje != NULL) {\n\t\t\t$db['mensaje'] = $mensaje;\n\t\t}\n\t\t\t\n\t\t$this->armar_vista('table', $db);\n\t}", "function createTableString($tablas){\n\t\tglobal $formatedTables;\n\n\t\tforeach ($tablas as $key => $value) {\n\t\t\tif(!@in_array($value, $formatedTables)){\n\t\t\t\t$formatedTables[] = $value;\n\t\t\t}\n\t\t}\n\t}", "function createTableString($tablas){\n\t\tglobal $formatedTables;\n\n\t\tforeach ($tablas as $key => $value) {\n\t\t\tif(!@in_array($value, $formatedTables)){\n\t\t\t\t$formatedTables[] = $value;\n\t\t\t}\n\t\t}\n\t}", "function getTableData($table, $column, $status) {\n\tglobal $connection;\n\n\t$query = \"SELECT * FROM {$table} WHERE {$column} = '{$status}' \";\n\t$result = mysqli_query($connection, $query);\n\n\tconfirm($result);\n\n\treturn mysqli_num_rows($result);\n}", "abstract protected function getIndexTableFields();", "function get_editable_field($role_id,$table)\n {\n // LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n // WHERE b.TABLE_NAME ='\".$table.\"' \";\n $sql = \" SELECT DISTINCT UPPER(b.COLUMN_NAME) AS fieldname, a.editable FROM INFORMATION_SCHEMA.COLUMNS b\n LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n WHERE b.TABLE_NAME IN (\".$table.\") \";\n\n Debugbar::info($sql);\n $data = DB::SELECT($sql);\n\n if(!empty($data))\n {\n foreach($data as $k => $v)\n {\n //echo \"1<pre>\"; print_r($v);\n $result[$v->fieldname]= $v->editable;\n }\n }\n\n return $result;\n }", "public function listaTable($campos,$table,$condicao){\n\t\t$msg=\"\";\n\t\t$query=\"\";\n\t\t//echo $this->getConn().\"aki\";\n\t\ttry{\n\t\t\tif($condicao==\"\"){\n\t\t\t\t$case = \"\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$case=\" where \".$condicao;\n\t\t\t}\n\t\t $sql = \"SELECT \".$campos.\" from \".$table.\" \". $case; //echo $sql.\"<br>\";\n\t\t $query = $this->exeSQL($sql,$this->getConn());\n\t\t}catch(Exception $ex){\n\t\t echo $this->getStatus().$ex->getMessage().\" \".$ex->getLine(); //exibe a mensagem de erro\n\t\t}\n\t\treturn $query;\n\t}", "function generateColonneByType($table, $columnName, $recherche=false, $attribut=null, $disabled=false) {\n $columnName = strtolower($columnName);\n $retour = '';\n $disabled = $disabled ? 'disabled' : '';\n $recherche = $recherche ? 'rechercheTableStatique' : '';\n $type = $table->getTypeOfColumn($columnName);\n switch ($type) {\n case 'string':\n $cantBeNull = $table->getColumnDefinition($columnName);\n $cantBeNull['notnull'] == 1 ? $class = 'requis' : $class = '';\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' : </span>\n <span><input class=\"contour_field input_char '.$recherche.' '.$class.'\" type=\"text\" columnName='.$columnName.' value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>';\n break;\n case 'float' :\n case 'integer' :\n if (preg_match('#^id[a-zA-Z]+#', $columnName)) {\n $columnName = substr($columnName, 2);\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' :</span>\n <span><input type=\"text\" class=\"contour_field input_char autoComplete\" id=\"'.$columnName.'\" table=\"'.$columnName.'\" champ=\"libelle\" value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>'; \n } else {\n $cantBeNull = $table->getColumnDefinition($columnName);\n $cantBeNull['notnull'] == 1 ? $class = 'requis' : $class = '';\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' :</span>\n <span><input type=\"text\" class=\"contour_field input_num '.$class.'\" columnName='.$columnName.' value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>';\n }\n \n break;\n case 'boolean' :\n $retour .='\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' : </span>';\n if($attribut != null && $attribut == 1) {\n $retour .= '<span class=\"checkbox checkbox_active\" value=\"1\" columnName='.$columnName.' '.$disabled.'></span></div>';\n } else {\n $retour .= '<span class=\"checkbox\" value=\"0\" columnName='.$columnName.' '.$disabled.'></span></div>';\n };\n break;\n }\n return $retour;\n}", "function CompruebaTabla($conexionUsar, $tablaUsar, $bddUsar){ // Por último, en cada consulta, se comprueba que no vuelva\n $sentenciaTabla = \"select * from \" . $tablaUsar; // vacía ni con errores, y en caso de haberlos, se muestran por pantalla.\n $valor = true;\n $conexionUsar->select_db($bddUsar);\n $queryComprobar = mysqli_query($conexionUsar, $sentenciaTabla);\n if(!$queryComprobar){\n echo \"<h3 style=\\\"margin-left: 1%\\\">ERROR: No se encuentra la tabla \" . $tablaUsar . \"</h3>\";\n echo \"<h3 style=\\\"margin-left: 1%\\\">Base de Datos INCOMPLETA. Se debe realizar una reinstalación.</h3>\";\n $valor = false;\n }\n return($valor);\n }", "static public function mdlIngresarVenta($tabla, $datos){\r\n\r\n\t\t\r\n\t}", "function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo '&nbsp;';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "public function getFieldTable ($arg=\"all\") {\n\t\tif (count ($this->FieldTable) != 0 ) {\n\t\t\t$ft = $this->FieldTable;\n\t\t\tif ($arg == \"all\") {\n\t\t\t\treturn $ft;\n\t\t\t}else {\n\t\t\t\tforeach ($ft as $value) {\n\t\t\t\t\tif ($arg == \"type\") {\n\t\t\t\t\t\t$arrTable = \"\";\n\t\t\t\t\t}else if ($arg == \"field\") {\n\t\t\t\t\t\t$arrTable[]=$value[$arg];\n\t\t\t\t\t}else {\n\t\t\t\t\t\tthrow new Exception (\"DBHandler::getFieldTable::arg valid are type and field\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t\treturn $arrTable;\n\t\t\t}\n\t\t}else {\n\t\t\tthrow new Exception (\"First, please set the table name or field of table\");\n\t\t}\n\t}", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "public function getViaTableCondition();", "function searchTableStatique() {\n include_once('./lib/config.php');\n $table = $_POST['table'];\n $tableStatique = Doctrine_Core::getTable($table);\n $columnNames = $tableStatique->getColumnNames();\n $req = '';\n $param = array();\n $premierPassage = true;\n foreach ($columnNames as $columnName) {\n if ($columnName != 'id') {\n $req .= $premierPassage ? $columnName.' like ? ' : 'and '.$columnName.' like ? ';\n $param[] = $_POST[$columnName].'%';\n $premierPassage = false;\n }\n }\n $search = $tableStatique->findByDql($req, $param);\n echo generateContenuTableStatiqueEntab($table, $tableStatique, $search);\n}", "public function selectTable($table)\n {\n $select_query = \"SELECT * FROM {$table}\"; \n\n if ($this->conexao == null) {\n $this->abrir();\n }\n\n $prepare = $this->conexao->prepare($select_query);\n\n $prepare->execute();\n\n $linha = $prepare->fetchAll(\\PDO::FETCH_OBJ);\n\n return $linha;\n }", "public function tableWizard() {}", "public function exist_data($table, $id, $id_field='')\n {\n if($id_field=='')\n {\n $field = strtoupper(substr($table,-3)).\"_ID\";\n }\n else\n {\n $field = $id_field;\n }\n \n $qsel = \"SELECT * FROM \".$table.\"\n WHERE \".$field.\" = '\".$id.\"'\";\n $data = $this->get_m_obj_db_connexion()->queryRow($qsel,true);\n \n if(isset($data[$field]))\n {\n return $data[strtoupper(substr($table,-3)).\"_ID\"];\n }\n else\n {\n return false;\n }\n }", "public function limparTabela(){\n\t\t\n\t\t$sql = 'DELETE FROM itempedido';\n\t\t$consulta = $this->conn->prepare($sql);\n\t\tif($consulta->execute())\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "protected function _readTable() {}", "protected function _readTable() {}", "private function ObtenerCamposTabla(string $nombteTabla){\n $campos =array(); \n $this->EjecutarSQL(\"DESCRIBE \".$nombteTabla);\n foreach ($this->GetResultados() as $dato) $campos[] = $dato->Field;\n return $campos;\n }", "public function checkForTable( $table );", "function tampil_data_id($tabel,$where,$id)\n {\n $row = $this->db->prepare(\"SELECT * FROM $tabel WHERE $where = :id,:teks,:label,:predict\");\n $row->execute(array($id));\n return $hasil = $row->fetch();\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function getFieldsOnTable()\n{\n\n $returnArray=array(); \n foreach ($this->tableStructure as $ind => $fieldArray) { \n $returnArray[$fieldArray['columnName']]=$fieldArray['columnName'];\n }\n \n return $returnArray; \n}", "function mostrar_tabla()\n {\n return $this->mostrar_tabla_slickgrid();\n /*\n $sPrefs = '';\n $id_usuario= core\\ConfigGlobal::mi_id_usuario();\n $tipo = 'tabla_presentacion';\n $oPref = new usuarios\\Preferencia(array('id_usuario'=>$id_usuario,'tipo'=>$tipo));\n $sPrefs=$oPref->getPreferencia();\n if ($sPrefs == 'html') {\n return $this->mostrar_tabla_html();\n } else {\n return $this->mostrar_tabla_slickgrid();\n }\n */\n }", "function existe($tabla,$campo,$where){\n\t$query=$GLOBALS['cn']->query('SELECT '.$campo.' FROM '.$tabla.' '.$where);\n\treturn (mysql_num_rows($query)>0)?true:false;\n}", "static Public function MdlImprimirCancelacion($tabla, $campo, $valor){\n\ttry{ \n\t if($campo !=null){ \n\t\t \n\t \t$sql=\"SELECT h.id_cliente,t.nombre AS nombrecliente,h.num_salida, h.fecha_salida, h.cantidad,h.precio_venta,h.es_promo, h.id_producto,a.descripcion,a.codigointerno, a.leyenda, a.id_medida, m.medida, h.id_almacen,b.nombre AS nombrealma,h.ultusuario,u.nombre AS nombreusuario, h.ultmodificacion FROM $tabla h INNER JOIN clientes t ON h.id_cliente=t.id\t\n\t\t INNER JOIN productos a ON h.id_producto=a.id\n\t\t INNER JOIN almacenes b ON h.id_almacen=b.id\n\t\t INNER JOIN medidas m ON a.id_medida=m.id\n\t\t INNER JOIN usuarios u ON h.ultusuario=u.id\n\t\t WHERE h.$campo=:$campo ORDER BY h.id_producto ASC\";\n\t \n\t\t $stmt=Conexion::conectar()->prepare($sql);\n\t\t \n\t\t $stmt->bindParam(\":\".$campo, $valor, PDO::PARAM_STR);\n\t\t \n\t\t $stmt->execute();\n\t\t \n\t\t return $stmt->fetchAll();\n\t\t \n\t\t //if ( $stmt->rowCount() > 0 ) { do something here }\n\t\t \n\t }else{\n \n\t\t\t return false;\n \n\t } \n\t } catch (Exception $e) {\n\t\t echo \"Failed: \" . $e->getMessage();\n\t }\n\t\t \n\t\t $stmt=null;\n\n\t }", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "function tablaUsuarios($consulta) {\n\tglobal $Buscador;\n\techo \"<tr class='tr-th'><td>Id</td><td>Tipo</td><td>Nombre</td><td>Email</td><td align='right'>\".$Buscador.\"</td></tr>\";\n\twhile($reg=mysql_fetch_array($consulta))\n\t{ \n\t\tif($reg['tipoUsuario']==\"Administrador\")\n\t\t\t$classTipoUser=\"flaticon-important\";\n\t\telse \n\t\t\t$classTipoUser=\"flaticon-user91\";\n\t\techo \"<tr class='tr'><td align='center'>\".$reg['IdUsuario'].\"</td><td width='100'><span class='\".$classTipoUser.\"'></span> \".$reg['tipoUsuario'].\"</td><td>\".$reg['Nombres'].\" \".$reg['Apellidos'].\"</td><td>\".$reg['Email'].\"</td><td align='right'><span class='flaticon-expand span-btn-admin' title='Detalles' onclick='expandDetails(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-black322 span-btn-admin' title='Editar' onclick='editRows(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-delete81 span-btn-admin' title='Borrar' onclick='deleteUser(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span></td></tr>\";\n\t}\n}", "function getRegistrosTabelaAssociativa($tabela, $campo_selecao, $campo_comparacao, $value_comparacao){\n\t$sql = \"select $campo_selecao from $tabela where $campo_comparacao = $value_comparacao\";\n\t$rs = mysql_query($sql);\n\t\n\t$i = 0;\n\twhile($row = mysql_fetch_array($rs)){\n\t\t$registros[$i] = $row[0];\n\t\t$i++;\n\t}\n\t\n\treturn $registros;\n}", "public function tblRequisitos($array){\n $tabla = \"<table class='table table-bordered table-hover'>\n <thead>\n <tr align='center'>\n <th>Programa</th>\n <th>Requisito</th>\n <th>Editar</th>\n </tr>\n </thead>\n <tbody>\";\n foreach ($array as $value){\n $info = utf8_encode(implode($value, '|'));\n //En la ruta de la imagen nos salimos de la carpeta \"../\" ya que la ruta que se guarda \n //en la base de datos se encuentra fuera de la carpeta 'admin'\n $tabla .= \"<tr align='left'>\n <td width='150'>\".utf8_encode($value[1]).\"</td>\n <td>\".utf8_encode($value[3]).\"</td>\n <td align='center'><a href='' onclick='frmEditarRequisito(\\\"$info\\\");return false;'><i class='fa fa-pencil'></i></a></td>\n </tr>\";\n }\n $tabla .= \"</tbody></table>\";\n return $tabla;\n }", "public function tabla()\n\t\t{\t//condicion para la proteccion de las vistas\n\t\t\t$id_empleado = $_SESSION['id_empleado'];\n\t\t\tif ($id_empleado == null)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php/header/controller_inicio/login');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view(\"header/Header_caja\");\n\t\t\t\t$this->load->view(\"ventas/Tabla_dinamica_producto\");\n\t\t\t}\n\t\t}", "static public function mdlSinAdquisicion($tabla, $datos){\r\n\t\t$idPedido = $datos[\"idPedido\"];\r\n\t\t$serie = $datos[\"serie\"];\r\n\r\n\t\t$consulta = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE idPedido='\".$idPedido.\"' and serie = '\".$serie.\"'\");\r\n\t\t$consulta->execute();\r\n\t\t$num_rows= $consulta->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\tif ($num_rows) {\r\n\t\t\t\r\n\t\t}else {\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(idPedido, serie, cliente, status, sinAdquisicion, estado, pendiente) VALUES (:idPedido,:serie, :cliente, :status, :sinAdquisicion, :estado, :pendiente)\");\r\n\r\n\t\t$stmt->bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":cliente\", $datos[\"cliente\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":status\", $datos[\"status\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":sinAdquisicion\", $datos[\"sinAdquisicion\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":estado\", $datos[\"estado\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":pendiente\", $datos[\"pendiente\"], PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"ok\";\t\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn \"error\";\r\n\t\t\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\t\t\r\n\t\t$stmt = null;\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t}", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "protected function tableModel()\n {\n }", "function getRows($table,$field=\"\",$value=\"\")\n\t{\n\t\t\n\t\t$q=\"SELECT * From \".$table;\n\t\tif(strlen($field)>0)\n\t\t\t$q.=\" WHERE `\".$field.\"`='\".$value.\"'\";\n\t\treturn mysql_query($q);\n\t}", "public function validarDatos($columna, $tabla, $condicion){\n $this->resultado= $this->db->query(\"SELECT $columna FROM $tabla WHERE $columna = '$condicion'\");//la condicion la ponemos entre comillas, por que en el sql, esta se espera como un string para comparar, entonces es recomendado usar las comillas dobles para la query entera, y asi usar las simples\n $chequear= $this->resultado->num_rows;\n return $chequear; //si con el metodo anterior me refiero al uso del prepare,bind_result(se les llaman prepared statement) mostramos en pantalla 3 resultados de alguna condicion, con este metodo devolveremos ese mismo numero de busquedas, usando el direct query\n }", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public function vistaAlumnoModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT id, matricula, nombre, apellido, email, id_carrera, id_grupo FROM $tabla\");\t\r\n\t\t$stmt->execute();\r\n\r\n\t\t#fetchAll(): Obtiene todas las filas de un conjunto de resultados asociado al objeto PDOStatement. \r\n\t\treturn $stmt->fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "static function get_table_field($table, $where_criteria = array(), $table_field) {\n $result = self::$db->select($table_field)->where($where_criteria)->get($table)->row();\n if ($result) { return $result->$table_field; }\n\n return FALSE;\n }", "public function leerDatos($tabla){\r\n\t\t\t$sql = '';\r\n\t\t\tswitch($tabla){\r\n\t\t\t\tcase \"Usuario\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id, nombre, nacido, sexo, foto from usuario;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"UsuarioDeporte\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id_usuario, id_deporte from usuario_deporte;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"Deporte\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id, nombre from deporte;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"Passwd\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT usuario, clave from passwd; \r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$arrayFilas=$this->conn->query($sql);\r\n\t\t\treturn $arrayFilas;\r\n\t\t}", "public function TABLA_cuentaEmpresa($codigo,$tipo=\"\", $number_items = '', $offset = ''){\n $dataCuentaEditar= $this->empresa_model->listCuentaEmpresaCodigo($codigo);\n if($tipo==\"E\"){\n if(count($dataCuentaEditar)>0){\n foreach ($dataCuentaEditar as $key => $value) {\n $tabla='<table id=\"tableData\" border=\"0\" class=\"fuente8\" width=\"98%\" cellspacing=\"0\" cellpadding=\"6\">\n <tr> <td>Banco</td><td>\n <select id=\"txtBanco\" name=\"txtBanco\" autofocus>' ;\n $tabla.=$this->seleccionar_banco($value->BANP_Codigo);\n $tabla.='</select ></td><td>N° Cuenta</td>\n <td><input type=\"text\" id=\"txtCuenta\" name=\"txtCuenta\" value=\"'.$value->CUENT_NumeroEmpresa.'\" onkeypress=\"return soloLetras_andNumero(event)\"></td>\n <td>Titular</td>\n <td><input type=\"text\" id=\"txtTitular\" name=\"txtTitular\" value=\"'.$value->CUENT_Titular.'\" onkeypress=\"return soloLetras_andNumero(event)\"></td> \n <tr>\n <td>Oficina (*)</td>\n <td><input type=\"text\" name=\"txtOficina\" id=\"txtOficina\" onkeypress=\"return soloLetras_andNumero(event)\" value=\"'.$value->CUENT_Oficina.'\"></td>\n <td>Sectoriza (*)</td>\n <td><input type=\"text\" name=\"txtSectoriza\" id=\"txtSectoriza\" onkeypress=\"return soloLetras_andNumero(event)\" value=\"'.$value->CUENT_Sectoriza.'\"></td>\n <td>Interbancaria (*)</td>\n <td><input type=\"text\" name=\"txtInterban\" id=\"txtInterban\" onkeypress=\"return soloLetras_andNumero(event)\" value=\"'.$value->CUENT_Interbancaria.'\"></td>\n </tr> \n </tr><tr><td>Tipo de Cuenta</td><td>';\n $tabla.='<select name=\"txtTipoCuenta\" id=\"txtTipoCuenta\" required=\"required\">';\n $tabla.='<option value=\"S\">::SELECCIONE::</option>';\n \n if($value->CUENT_TipoCuenta==1){\n $tabla.='<option value=\"1\" selected=\"selected\" >Ahorros</option>';\n $tabla.='<option value=\"2\" >Corriente</option>'; \n }\n else\n if ($value->CUENT_TipoCuenta==2) {\n $tabla.='<option value=\"1\" >Ahorros</option>';\n $tabla.='<option value=\"2\" selected=\"selected\" >Corriente</option>'; \n }\n\n $tabla.='</select>\n </td>\n <td>Moneda</td>\n <td>\n <select id=\"txtMoneda\" name=\"txtMoneda\" >';\n\n $tabla.=$this->seleccionar_Moneda($value->MONED_Codigo);\n $tabla.='</select></td> <td></td><td>' ;\n $tabla.='<input type=\"hidden\" id=\"txtCodCuenEmpre\" name=\"txtCodCuenEmpre\" value=\"'.$value->CUENT_Codigo.'\">\n <a href=\"#\" id=\"btnInsertarCuentaE\" onclick=\"insertar_cuentaEmpresa()\">\n <img src='.base_url().'images/botonagregar.jpg></a>\n <a href=\"#\" id=\"btnCancelarCuentaE\" onclick=\"limpiar_cuentaEmpresa()\">\n <img src='.base_url().'images/botoncancelar.jpg></a>\n </td> </tr><tr><td colspan=\"6\">campos obligatorios (*)</td></tr></table>' ;\n echo $tabla;\n }\n }\n }\n else{\n\n $dataCuenta= $this->empresa_model->listCuentaEmpresa($codigo);\n\n $tabla='<table id=\"tableBancos\" class=\"table table-bordered table-striped fuente8\" width=\"98%\" cellspacing=\"0\" cellpadding=\"6\" border=\"0\"><thead>\n <tr align=\"center\" class=\"cab1\" height=\"10px;\">\n <td>Item</td>\n <td>Banco</td>\n <td>N° Cuenta</td>\n <td>Nombre o Titular de la cuenta</td>\n <td>Moneda</td>\n <td>Tipo de cuanta</td>\n <td colspan=\"3\">Acciones</td></thead>\n </tr><tbody>'; \n \n if(count($dataCuenta)>0){\n foreach ($dataCuenta as $key => $value) {\n $tabla.='<tr bgcolor=\"#ffffff\">';\n $tabla.='<td align=\"center\">'.($key+1).'</td>';\n $tabla.='<td align=\"left\">'.$value->BANC_Nombre.'</td>';\n $tabla.='<td>'.$value->CUENT_NumeroEmpresa.'</td> '; \n $tabla.='<td align=\"left\">'.$value->CUENT_Titular.'</td>';\n $tabla.='<td align=\"left\">'.$value->MONED_Descripcion.'</td>';\n \n if($value->CUENT_TipoCuenta==1){\n $tabla.='<td>Ahorros</td>';\n }else{\n $tabla.='<td>Corriente</td>';\n }\n\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"#\" onclick=\"eliminar_cuantaEmpresa('.$value->CUENT_Codigo.');\"><img src='.base_url().'images/delete.gif border=\"0\"></a>';\n $tabla.='</td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"#\" id=\"btnAcualizarE\" onclick=\"actualizar_cuentaEmpresa('.$value->CUENT_Codigo.');\"><img src='.base_url().'images/modificar.png border=\"0\"></a>';\n $tabla.='<td><a href=\"#\" onclick=\"ventanaChekera('.$value->CUENT_Codigo.')\"><img src='.base_url().'images/observaciones.png></a></td>';\n $tabla.='</td>';\n $tabla.='</tr>';\n }\n }\n $tabla.='</tbody></table>';\n echo $tabla;\n }\n }", "private function tinydb_getset_is_table_field($field)\n {\n if (static::tinydb_get_table_info()->field_info($field) !== null) {\n $visibility = $this->tinydb_access_manager->get_publicity($field);\n $current_scope = $this->tinydb_get_calling_scope(1);\n if ($current_scope < $visibility) {\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "public function tableColumns($table,$column);", "function query_Registro($table, $field, $val) {\n\t\t\t$sql_Select = \"SELECT * FROM \" .$table. \" WHERE \" . $field. \" = '\" .$val. \"'\";\n\t\t\t$res = $this->conn->query($sql_Select);\n\t\t\t$exist = mysqli_fetch_array($res);\n\t\t\treturn $exist;\n\t\t\t$this->conn->close();\n\t\t}", "function get_table_field($table){\n\t return mysql_query(\"SHOW FIELDS FROM \".$table, $this->link);\t\t\n\t}", "public function BuscarValor($tabla,$campo,$condicion){\n $rows= null;\n $modelo= new ConexBD();\n $conexion= $modelo->get_conexion();\n $sql=\"SELECT $campo FROM $tabla WHERE $condicion\";\n $stm=$conexion->prepare($sql);\n $stm->execute();\n while($result = $stm->fetch())\n {\n $rows[]=$result;\n }\n return $rows;\n }", "function func_existeDato($dato, $tabla, $columna){\n selectConexion('onmworkflow');\n $query = \"select * from $tabla where $columna = '$dato' ;\";\n $result = pg_query($query) or die (\"Error al realizar la consulta\");\n if (pg_num_rows($result)>0)\n {\n return true;\n } else {\n return false;\n }\n }", "function listPage_tableField(){\n $this->data_view['tableField'] = array(\n array('name'=>'id','title'=>'Mã'),\n array('name'=>'image','title'=>'Hình','type'=>'image','linkDetail'=>true),\n array('name'=>'title','title'=>'Tên','linkDetail'=>true),\n array('name'=>'c_title','title'=>'Loại'),\n array('name'=>'price','title'=>'Giá','type'=>'number'),\n array('name'=>'price_promotion','title'=>'Giá giảm','type'=>'number','hidden'=>true),\n array('name'=>'views','title'=>'Lượt xem','type'=>'number'),\n array('name'=>'is_active','title'=>'Trạng thái','type'=>'status'),\n array('name'=>'is_stock','title'=>'Còn hàng','type'=>'status','hidden'=>true),\n array('name'=>'is_special','title'=>'Nổi bật','type'=>'status','hidden'=>true)\n );\n }", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function tablaConversiones() {\n \n $array = array();\n $contador = 0;\n $output = \"\";\n $output2 = \"\";\n $heading = array('Numero ','Contenido de $var ', 'isset($var) ', 'empty($var) ', '(bool) $var ', 'is_null($var)');\n $var = array(null, 0, true, false, \"0\", \"\", \"foo\", $array, 2);\n $funciones = array('llamarIsset', 'llamarEmpty', 'llamarBool', 'llamarIsnull');\n \n $output .= \"<table class='table table-bordered'>\";\n $output .= \"<tr>\";\n // imprimimos cabecera\n foreach ($heading as $value) {\n $output .= \"<th>\" . $value . \" </th>\";\n }\n $output .= \"</tr>\";\n foreach ($var as $valor) {\n \n $contador++;\n $output .= \"<th> {$contador} </th>\";\n \n if ($valor === null) {\n $output2 = \"null\";\n } elseif($valor === true) {\n $output2 = \"true\";\n } elseif($valor === 2) {\n $output2 = \"unset(\\$var)\";\n } elseif($valor === \"\") {\n $output2 = \"\\\"\\\"\";\n } elseif($valor === false) {\n $output2 = \"false\";\n }else {\n $output2 = $valor;\n }\n \n $output .= \"<th> \\$var= \". $output2 .\" </th>\";\n \n foreach ($funciones as $funcion) {\n \n if ($valor == 2) {\n unset($valor);\n }\n if ($funcion($valor)) {\n $output .= \"<td class='true'> True </td>\";\n } else {\n $output .= \"<td class='false'> False </td>\";\n }\n }\n $output .= \"<tr>\";\n }\n \n $output .= \"</table>\";\n\n echo $output;\n }", "public function datatable_setor_tunai_tabungan()\n\t{\n\t\t$aColumns = array( 'c.cif_no','c.nama','a.account_saving_no','a.amount','a.trx_date','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"AND (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"AND \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_setor_tunai_tabungan($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_setor_tunai_tabungan($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_setor_tunai_tabungan(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['account_saving_no'];\n\t\t\t$row[] = '<div align=\"right\">Rp '.number_format($aRow['amount'],0,',','.').',-</div>';\n\t\t\t$row[] = $this->format_date_detail($aRow['trx_date'],'id',false,'/');\n\t\t\t$row[] = '<div align=\"center\"><a href=\"javascript:;\" class=\"btn red mini\" trx_detail_id=\"'.$aRow['trx_detail_id'].'\" account_saving_no=\"'.$aRow['account_saving_no'].'\" nama=\"'.$aRow['nama'].'\" id=\"link-delete\">Delete</a></div>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "function get_row_data($table,$field_name,$id)\r\n\t{\t\r\n\t\t$sql_query=\"SELECT * FROM $table WHERE `id`='\".$id.\"'\";\r\n\t\t$res_query=hb_mysql_query($sql_query);\r\n\t\t$rows_query=hb_mysql_fetch_array($res_query);\r\n\t\t\r\n\t\t$get_field_name=$rows_query[$field_name];\r\n\t\t\r\n\t\treturn $get_field_name;\r\n\t}", "public function datatable()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'read')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t$table = 'detailfasilitaskesehatan';\n\t\t$primarykey = 'id';\n\t\t$columns = array(\n\t\t\tarray('db' => $primarykey, 'dt' => '0', 'field' => $primarykey,\n\t\t\t\t'formatter' => function($d, $row, $i){\n\t\t\t\t\treturn \"<div class='text-center'>\n\t\t\t\t\t\t<input type='checkbox' id='titleCheckdel' />\n\t\t\t\t\t\t<input type='hidden' class='deldata' name='item[\".$i.\"][deldata]' value='\".$d.\"' disabled />\n\t\t\t\t\t</div>\";\n\t\t\t\t}\n\t\t\t),\n\t\t\tarray('db' => $primarykey, 'dt' => '1', 'field' => $primarykey),\n\t\t\tarray('db' => 'b.namakategori', 'dt' => '2', 'field' => 'namakategori'),\n\t\t\tarray('db' => 'nama', 'dt' => '3', 'field' => 'nama'),\n\t\t\tarray('db' => 'kodefaskes', 'dt' => '4', 'field' => 'kodefaskes'),\n\t\t\t// array('db' => 'kelas', 'dt' => '5', 'field' => 'kelas'),\n\t\t\t// array('db' => 'direktur', 'dt' => '6', 'field' => 'direktur'),\n\t\t\tarray('db' => 'alamat', 'dt' => '5', 'field' => 'alamat'),\n\t\t\tarray('db' => 'kecamatan', 'dt' => '6', 'field' => 'kecamatan'),\n\t\t\t// array('db' => 'pemilik', 'dt' => '9', 'field' => 'pemilik'),\n\t\t\t// array('db' => 'telpon', 'dt' => '10', 'field' => 'telpon'),\n\t\t\t// array('db' => 'email', 'dt' => '11', 'field' => 'email'),\n\t\t\t// array('db' => 'website', 'dt' => '12', 'field' => 'website'),\n\t\t\t// array('db' => 'fax', 'dt' => '13', 'field' => 'fax'),\n\t\t\t// array('db' => 'ugd', 'dt' => '14', 'field' => 'ugd'),\n\t\t\t// array('db' => 'vip', 'dt' => '15', 'field' => 'vip'),\n\t\t\t// array('db' => 'vvip', 'dt' => '16', 'field' => 'vvip'),\n\t\t\t// array('db' => 'kelas1', 'dt' => '17', 'field' => 'kelas1'),\n\t\t\t// array('db' => 'kelas2', 'dt' => '18', 'field' => 'kelas2'),\n\t\t\t// array('db' => 'kelas3', 'dt' => '19', 'field' => 'kelas3'),\n\t\t\t// array('db' => 'jumdokter', 'dt' => '20', 'field' => 'jumdokter'),\n\t\t\t// array('db' => 'jumperawat', 'dt' => '21', 'field' => 'jumperawat'),\n\t\t\t// array('db' => 'foto', 'dt' => '22', 'field' => 'foto'),\n\t\t\t// array('db' => 'seourl', 'dt' => '7', 'field' => 'seourl'),\n\t\t\tarray('db' => $primarykey, 'dt' => '7', 'field' => $primarykey,\n\t\t\t\t'formatter' => function($d, $row, $i){\n\t\t\t\t\treturn \"<div class='text-center'>\n\t\t\t\t\t\t<div class='btn-group btn-group-xs'>\n\t\t\t\t\t\t\t<a href='admin.php?mod=detailfasilitaskesehatan&act=edit&id=\".$d.\"' class='btn btn-xs btn-default' id='\".$d.\"' data-toggle='tooltip' title='{$GLOBALS['_']['action_1']}'><i class='fa fa-pencil'></i></a>\n\t\t\t\t\t\t\t<a class='btn btn-xs btn-danger alertdel' id='\".$d.\"' data-toggle='tooltip' title='{$GLOBALS['_']['action_2']}'><i class='fa fa-times'></i></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\";\n\t\t\t\t}\n\t\t\t),\n\t\t);\n\t\t$joinquery = \"FROM detailfasilitaskesehatan AS a JOIN katfasilitaskesehatan AS b ON (b.idkategori = a.idkategori)\";\n\t\techo json_encode(SSP::simple($_POST, $this->poconnect, $table, $primarykey, $columns, $joinquery));\n\t}", "static public function mdlSelecTipoMembresias($tabla,$empresa){\n\n\t\tif($empresa == \"0\"){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT \n\t\t\tt.*,\n\t\t\te.nombre \n\t\t FROM\n\t\t\t$tabla t \n\t\t\tLEFT JOIN empresa e \n\t\t\t ON e.id_empresa = t.id_empresa \");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT \n\t\t\tt.*,\n\t\t\te.nombre \n\t\t FROM\n\t\t\t$tabla t \n\t\t\tLEFT JOIN empresa e \n\t\t\t ON e.id_empresa = t.id_empresa \n\t\t WHERE t.id_empresa = '\".$empresa.\"' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "function fetchTabelaUtilizadoresEliminados($conn) {\n $sql = \"SELECT U.*, T.descricao FROM utilizador U, tipoUtilizador T WHERE tipoUtilizador = '6' AND T.idTipoUtilizador = U.tipoUtilizador\";\n $retval = mysqli_query($conn, $sql);\n if(mysqli_num_rows($retval) != 0) {\n while($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\n mostrarDadosTabela($row);\n }\n } else {\n echo \"\n <tr>\n <td colspan='6' class='has-text-centered'>\n Não foram encontrados registos nesta tabela.\n </td>\n </tr>\n \";\n }\n\n}", "public function select($usuario_has_hojaruta);", "function existen_registros($tabla, $filtro = '') {\n if (!empty($filtro))\n $sql = \"select count(*) from \" . trim($tabla) . \" where {$filtro}\";\n else\n $sql = \"select count(*) from \" . trim($tabla);\n // print_r($sql);exit;\n $bd = new conector_bd();\n $query = $bd->consultar($sql);\n $row = pg_fetch_row($query);\n if ($row[0] > 0)\n return true;\n else\n return false;\n }", "function my_browse_data( $table_name , $datas ){\r\n\t\r\n\tglobal $connection;\r\n\t\r\n\t$primary_field = my_get_field_list($table_name);\r\n\tforeach($datas as $field => $value){\r\n\t\t$fieldname = $field ;\r\n\t\t$fieldvalue = $value;\r\n\t}\r\n\t\r\n\t$query = \" SELECT `\".$primary_field. \"` FROM `\".$table_name.\"` WHERE `\".$fieldname.\"` = \". $fieldvalue ;\r\n\t \r\n\t$result = my_query( $query );\r\n\tif( my_num_rows($result) > 0 ){\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\twhile(\t$row = my_fetch_array($result) ){\r\n\t\t\t$data[] = $row[$primary_field];\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t\r\n\t}\r\n\t\r\n\treturn false;\r\n\t\r\n}", "public function getTableName() {}", "public function getTableName() {}", "function insertTableInsumosVendidos($headers,$matrizDatos) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n echo \"</tr>\";\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}", "public function getTable();" ]
[ "0.6130924", "0.612813", "0.61228013", "0.6088793", "0.6077505", "0.60765314", "0.60525376", "0.5953618", "0.5934905", "0.5932946", "0.5902314", "0.58754915", "0.5836085", "0.5830674", "0.58153105", "0.57774013", "0.57771456", "0.5766048", "0.5763655", "0.5753449", "0.57479274", "0.5739246", "0.57101494", "0.56851834", "0.5683535", "0.5680322", "0.5676706", "0.56689745", "0.56654376", "0.5664304", "0.5660905", "0.56521636", "0.5646026", "0.5646026", "0.5637594", "0.56357485", "0.5632393", "0.5630429", "0.5627963", "0.5610894", "0.56052876", "0.56025314", "0.55953354", "0.55911326", "0.557907", "0.5577087", "0.55667627", "0.55664605", "0.55561465", "0.55518925", "0.55471814", "0.5547034", "0.55469376", "0.55267334", "0.55250835", "0.5523022", "0.55147696", "0.551201", "0.5510616", "0.55044276", "0.5495542", "0.54891455", "0.5472425", "0.54675287", "0.54654205", "0.54617834", "0.545866", "0.54576397", "0.5457519", "0.5456265", "0.545251", "0.54513013", "0.5450508", "0.5430916", "0.54298294", "0.54291326", "0.5424825", "0.54245114", "0.54185843", "0.5418568", "0.5418104", "0.5417905", "0.5411907", "0.5409647", "0.54054", "0.54031026", "0.5395077", "0.53912544", "0.5390897", "0.53903747", "0.5381527", "0.53799415", "0.5376757", "0.53740954", "0.5373488", "0.5372323", "0.5370763", "0.5370763", "0.5361566", "0.53589493" ]
0.5655446
31
Buscar el proximo id a escribir
public function buscaridproximo() { $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); // eliminar el campo $result = $query->select('max(a.idcampo) as maximo') ->from('NomCampoestruc a') ->execute() ->toArray(); $proximo = isset($result[0]['maximo']) ? $result[0]['maximo'] + 1 : 1; return $proximo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get_id();", "abstract public function getId();", "public function getId() ;", "abstract function getId();", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "function getId(){\n\t\t\treturn $this->$id;\n\t\t}", "public function get_id();", "public function get_id();", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "public function getId() {}", "public function getId() {}", "public function getID();", "public function getID();", "public function getID();", "function buscarPorId($id) {\r\n \r\n }", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId ();", "public function getId(): mixed;", "function getId();", "public function GetId () ;", "function id() {\n $function = 'get' . get_class($this) . 'Id';\n return $this->$function();\n }", "function get_id()\r\n {\r\n return $this->id;\r\n }", "abstract public function objId();", "private function getId() {\n return Xss::filter($this->request->get('id'));\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function id():string {return $this->_p['_id'];}", "public function getID() : string;", "public function getIdOnly();", "public function get_id(){ return $this->_id;}" ]
[ "0.6604153", "0.65951735", "0.65883327", "0.65542483", "0.6531945", "0.6531945", "0.6531945", "0.6510807", "0.649277", "0.649277", "0.64887536", "0.64875746", "0.64875746", "0.6475623", "0.6475623", "0.6475623", "0.64719975", "0.64656615", "0.64656615", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.64532787", "0.6441742", "0.64174455", "0.63209176", "0.63104314", "0.62774473", "0.6241348", "0.6236562", "0.62255234", "0.62232465", "0.6217523", "0.6210719", "0.62086695", "0.6203146", "0.6201637" ]
0.0
-1
Buscar el proximo id a escribir
public function buscarCampos($limit, $start, $idtabla) { $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); // eliminar el campo $result = $query->select('a.idcampo,a.idnomeav,a.nombre,a.tipo,a.longitud,a.nombre_mostrar,a.regex,a.descripcion,a.tipocampo,a.visible') /* $result = $query*/ ->from('NomCampoestruc a') ->where("idnomeav='$idtabla'") ->limit($limit) ->offset($start) ->execute() ->toArray(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get_id();", "abstract public function getId();", "public function getId() ;", "abstract function getId();", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "function getId(){\n\t\t\treturn $this->$id;\n\t\t}", "public function get_id();", "public function get_id();", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "public function getId() {}", "public function getId() {}", "public function getID();", "public function getID();", "public function getID();", "function buscarPorId($id) {\r\n \r\n }", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId ();", "public function getId(): mixed;", "function getId();", "public function GetId () ;", "function id() {\n $function = 'get' . get_class($this) . 'Id';\n return $this->$function();\n }", "function get_id()\r\n {\r\n return $this->id;\r\n }", "abstract public function objId();", "private function getId() {\n return Xss::filter($this->request->get('id'));\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function id():string {return $this->_p['_id'];}", "public function getID() : string;", "public function getIdOnly();", "public function get_id(){ return $this->_id;}" ]
[ "0.6605942", "0.6596532", "0.6589524", "0.65556204", "0.65333635", "0.65333635", "0.65333635", "0.6511701", "0.6494311", "0.6494311", "0.64906734", "0.6488928", "0.6488928", "0.6477109", "0.6477109", "0.6477109", "0.64734", "0.6467105", "0.6467105", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.6454481", "0.644284", "0.6418751", "0.63219345", "0.6311842", "0.62783116", "0.62428266", "0.623734", "0.6226621", "0.62248623", "0.62185574", "0.62120116", "0.6210187", "0.6204581", "0.6202779" ]
0.0
-1
Devuelve los valortes que presenta el campo parametrizado en la funcion
function valores($idCampo) { $mg = ZendExt_Aspect_TransactionManager::getInstance(); $conn = $mg->getConnection('metadatos'); $query = Doctrine_Query::create($conn); $result = $query->select('v.valor') ->from('NomValorestruc v') ->where("v.idcampo='$idCampo'") //->groupBy('v.valor') ->execute() ->toArray(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parameters();", "public function parameters();", "function getFieldAndValues($params) {\n global $conn;\n\n if (!is_array($params))\n exit('Parâmetro inválido!');\n\n $id = $params['id'];\n $mod = $params['modulo'];\n $pre = $params['pre'];\n $ref = isset($params['ref']) ? $params['ref'] : 'id';\n\n if (empty($id) || empty($mod) || empty($pre))\n exit('Dados inválidos');\n\n\n /*\n *pega lista de colunas\n */\n $sql= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n $fields = array();\n if(!$qry = $conn->query($sql))\n echo $conn->error();\n\n else {\n\n while($fld = $qry->fetch_field())\n array_push($fields, str_replace($pre.'_', null, $fld->name));\n\n $qry->close();\n }\n\n /*\n *pega valores dessas colunas\n */\n $sqlv= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n if(!$qryv = $conn->query($sqlv))\n echo $conn->error();\n\n else {\n $valores = $qryv->fetch_array(MYSQLI_ASSOC);\n $qryv->close();\n }\n\n $res = null;\n foreach ($fields as $i=>$col)\n $res .= \"{$col} = \".$valores[$pre.'_'.$col].\";\\n\";\n\n\n return $res.\"\\n\";\n}", "public function getParameter();", "public function getParameter();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "function getInputValues();", "function obtenerParametros() {\n\t\t$cuerpo = file_get_contents('php://input');\n\t\tif (isset($cuerpo) == false && $cuerpo !== \"\") {\n\t\t\treturn '';\n\t\t}\t\t\t\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET':\t\n\t\t\t\t$esLlave = true;\n\t\t\t\t$resultado = array();\n\t\t\t\tfor ($i = 2; $i < sizeof($this->_parametros); $i++) {\n\t\t\t\t\tif ($esLlave) {\n\t\t\t\t\t\t$llave = $this->_parametros[$i];\n\t\t\t\t\t\t$esLlave = !$esLlave;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$resultado[$llave] = $this->_parametros[$i];\n\t\t\t\t\t\t$esLlave = !$esLlave;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t\t$resultado = (object)$resultado;\n\t\t\t\treturn $resultado;\n\t\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE':\n\t\t\t\treturn json_decode($cuerpo);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function getInputValues();", "protected function reemplazaParametro(){\n\t\t$vector=func_get_arg(0);\n\t\t$params=$this->dato;\n//\t\tprint_r($params);\n//\t\techo \"<br>\";\n\t\t$cant=sizeof($params);\n\t\t$accion=$vector[0];\n\t\tif (sizeof($params)!=0){\n\t\t\t$claves=array_keys($params);\n//\t\tfor($x=1;$x<$cant;$x++){\n\t\t\tforeach($claves as $clave){\n\t\t\t\t$str=\"#\".($clave).\"#\";\n\t\t\t\t$accion=str_replace($str,$params[$clave],$accion);\n\t\t\t}\n\t\t}\n\t\treturn $accion;\n\t}", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "abstract public function getParameters();", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "public function getParameters() {}", "public function getParams() {}", "private function processarParametros() {\n\n /**\n * Busca os usuarios definidos para notificar quando acordo ira vencer, ordenando pelo dia\n */\n $oDaoMensageriaUsuario = db_utils::getDao('mensagerialicenca_db_usuarios');\n $sSqlUsuarios = $oDaoMensageriaUsuario->sql_query_usuariosNotificar('am16_sequencial', 'am16_dias');\n $rsUsuarios = db_query($sSqlUsuarios);\n $iTotalUsuarios = pg_num_rows($rsUsuarios);\n\n if ($iTotalUsuarios == 0) {\n throw new Exception(\"Nenhum usuário para notificar.\");\n }\n\n /**\n * Percorre os usuarios e define propriedades necessarias para buscar acordos\n */\n for ($iIndiceUsuario = 0; $iIndiceUsuario < $iTotalUsuarios; $iIndiceUsuario++) {\n\n /**\n * Codigo do usuario para notificar: mensageriaacordodb_usuario.ac52_sequencial\n */\n $iCodigoMensageriaLicencaUsuario = db_utils::fieldsMemory($rsUsuarios, $iIndiceUsuario)->am16_sequencial;\n\n /**\n * Codigo dos usuarios que serao notificados\n * - usado para verificar os usuarios que ja foram notificados\n * - mensageriaacordodb_usuario.ac52_sequencial\n */\n $this->aCodigoMensageriaLicencaUsuario[] = $iCodigoMensageriaLicencaUsuario;\n\n /**\n * Usuario para notificar\n * - mensageriaacordodb_usuario\n */\n $oMensageriaLicencaUsuario = MensageriaLicencaUsuarioRepository::getPorCodigo($iCodigoMensageriaLicencaUsuario);\n\n /**\n * Codigo do usuario do sistema\n * - db_usuarios.id_usuario\n */\n $iCodigoUsuario = $oMensageriaLicencaUsuario->getUsuario()->getCodigo();\n\n /**\n * Data de vencimento:\n * - Soma data atual com dias definidos na rotina de parametros de mensageria\n */\n $iDias = $oMensageriaLicencaUsuario->getDias();\n $this->aDataVencimento[] = date('Y-m-d', strtotime('+ ' . $iDias . ' days'));\n }\n\n return true;\n }", "function fieldsToParams($fields,$tableName=NULL)\r\n\t{\r\n\t\tif (array_key_exists('0',$fields))\r\n\t\t{\r\n\t\t\tforeach ($fields as $fieldName)\r\n\t\t\t{\r\n\t\t\t\t$output[$fieldName]['title']= makeFieldName($fieldName);\r\n\t\t\t\tif (is_array($GLOBALS['DBGridColumnSets'][$tableName]['allFields'][$fieldName]))\r\n\t\t\t\t\t$output[$fieldName]=array_merge($output[$fieldName],$GLOBALS['DBGridColumnSets'][$tableName]['allFields'][$fieldName]);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\t\r\n\t\t\tforeach ($fields as $fieldName=>$fieldTitle)\r\n\t\t\t{\r\n\t\t\t\t$output[$fieldName]['title']= (!$fieldTitle)?makeFieldName($fieldName):$fieldTitle;\r\n\t\t\t\tif (is_array($GLOBALS['DBGridColumnSets'][$tableName]['allFields'][$fieldName]))\r\n\t\t\t\t\t$output[$fieldName]=array_merge($output[$fieldName],$GLOBALS['DBGridColumnSets'][$tableName]['allFields'][$fieldName]);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn $output;\r\n\t}", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "private function setParameters(){\n\t\tif(is_array($this->rawData) and count($this->rawData) > 2){\n\t\t\t$params = array();\n\t\t\tforeach($this->rawData as $paramid => $param){\n\t\t\t\tif($paramid > 1){ # Exclude page and method.\n\t\t\t\t\t$params[$paramid-1] = $param; \n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Store value */\n\t\t\treturn $params;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "function getParameters();", "function getParameters();", "private function setParams()\n\t\t{\n\t\t\t/**\n\t\t\t* Remove do $this->_separetor os dois primeiros valores\n\t\t\t* referentes ao controller e action, deixando os demais valores\n\t\t\t* que serão usados para formarem os parametros, indices e valores\n\t\t\t*/\n\t\t\tunset($this->_separetor[1], $this->_separetor[2]);\n\t\t\t\n\t\t\t/**\n\t\t\t* Caso o ultimo item do $this->_separetor seja vazio\n\t\t\t* o mesmo é removido\n\t\t\t*/\n\t\t\tif ( end($this->_separetor) == null ) {\n\t\t\t\tarray_pop($this->_separetor);\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t* Se a $this->_separetor estivar vazia,\n\t\t\t* então os parametros serão definidos como vazios\n\t\t\t*/\n\t\t\tif ( !empty($this->_separetor) ) {\n\t\t\t\t/**\n\t\t\t\t* Percorre o array $this->_separetor, verificando os indices\n\t\t\t\t* se for impar, então seu valor será o indice do parametro.\n\t\t\t\t* Se for par, seu valor será o valor do paremetro\n\t\t\t\t*/\n\t\t\t\tforeach ($this->_separetor as $key => $value) {\n\t\t\t\t\tif ($key % 2 == 0) {\n\t\t\t\t\t\t$param_value[] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$param_indice[] = $value;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$param_value = array();\n\t\t\t\t$param_indice = array();\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t* Verifica se os indices e valores dos parametros\n\t\t\t* não são vazios e possuem a mesma quantidade\n\t\t\t* Então vaz um \"array_combine\" para juntar os dois arrays\n\t\t\t* formando um indice->valor para o parametro\n\t\t\t*/\n\t\t\tif ( !empty($param_indice) \n\t\t\t\t&& !empty($param_value)\n\t\t\t\t&& count($param_indice)\n\t\t\t\t== count($param_value)\n\t\t\t) {\n\t\t\t\t$this->_params = array_combine($param_indice, $param_value);\n\t\t\t} else {\n\t\t\t\t$this->_params = array();\n\t\t\t}\n\t\t}", "public function parameters(): array;", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getDefinedParameters();", "private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->valor_vehiculo=$_POST['valor_vehiculo'];\n\t\t$this->saldo=$_POST['saldo'];\n\t\t$this->valor_inicial=$_POST['valor_inicial'];\n\t\t$this->comision=$_POST['comision'];\n\t\t$this->plazo=$_POST['plazo'];\n\t\t$this->cuotas=$_POST['cuotas'];\n\t\t$this->total=$_POST['total'];\n\t}", "public function valorpasaje();", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "public static function Busqueda_ParametrosAcreditado($campo)\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM parametros WHERE ((CONCAT(clave, ' ', parametro, ' ', nombre_corto) ILIKE ?) AND ((acreditacion='1')OR(acreditacion='4')))\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($campo));\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "public static function ListadoParametros()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM parametros\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "function getCamposToQuery($nombre_tabla, $key_value, $as_tabla=\"\"/*, ...*/){\r\n $cadena=\"\";\r\n global $$nombre_tabla;//si o si para que el array se pueda usar en esta funcion\r\n if($key_value=='key'){\r\n foreach ($$nombre_tabla as $key => $value) { $cadena.=$as_tabla.$key.\",\"; }\r\n }\r\n if($key_value=='value'){\r\n foreach ($$nombre_tabla as $key => $value) { $cadena.=$as_tabla.$value.\",\"; }\r\n }\r\n $cadena=trim($cadena,\",\");\r\n return $cadena;\r\n}", "function getParamaters() {\n\t\treturn $this->preparedvalues;\n\t}", "function getParams($input) {\n $allowedFields = ['post_id', 'user_name', 'content'];\n $filterParams = [];\n foreach($input as $param => $value){\n if(in_array($param, $allowedFields)){\n $filterParams[] = \"$param=:$param\";\n }\n }\n return implode(\", \", $filterParams);\n}", "protected function getParametrosWhere(){\n\t\t\t$parametros = array();\n\t\t\t$parametros[\":pkusuario\"] = $this->pkUsuario;\n\t\t\treturn $parametros;\n\t}", "function valorCampo($nombreCampo){\n\t if($this->val!=\"\")\n\t\tforeach($this->val as $indice => $valor){\n\t\t\tif($nombreCampo==$indice){\n\t\t\t\treturn $valor;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected function _compile_parameters()\r\n\t{\r\n\t\t// Return the column's parameters\r\n\t\treturn $this->parameters;\r\n\t}", "public function getParameterFields()\n {\n return false;\n }", "function asignar_valores(){\n\t\t$this->codigo=$_POST['codigo'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->categoria=$_POST['categoria'];\n\t\t$this->hotel=$_POST['hoteles'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->lugar=$_POST['lugar'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->detal=$_POST['detal'];\n\t\t$this->mayor=$_POST['mayor'];\n\t\t$this->limite=$_POST['limite'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->segmento=$_POST['segmento'];\n\t\t$this->principal=$_POST['principal'];\n\t\t\n\t\t\n\t}", "public static function obtenerParametros()\n {\n $consulta = \"SELECT * FROM parametros ORDER BY id_parametro ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public static function parameters()\n {\n $fields = array('name', 'amount');\n return array_intersect_key(self::fields(), array_flip($fields));\n }", "public function getRequiredParameters();", "public function getRequiredParameters();", "protected function getParametros(){\n\t\t\n\t\t$parametros = array();\t\t\t\n\t\t\n\t\t$parametros[\":nickname\"] \t\t= $this->nickName;\n\t\t$parametros[\":nombrecompleto\"] \t= $this->nombreCompleto;\n\t\t$parametros[\":apellidos\"] \t\t= $this->apellidos;\n\t\t$parametros[\":email\"] \t\t\t= $this->email;\n\t\t$parametros[\":password\"] \t\t= $this->password;\n\t\t$parametros[\":fkGrupoUsuario\"] \t= $this->fkGrupoUsuario;\n\n\t\treturn $parametros;\n\t}", "public static function obtenerActividadParametros($campo, $actividad)\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM actividades_parametros WHERE ((id_cotizacion = ?) AND (id_actividad = ?))\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($campo, $actividad));\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "function getParameters()\r\n {\r\n }", "function get_params_array()\n {\n $values = array(\n 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),\n 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),\n 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),\n 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),\n 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),\n 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),\n 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),\n 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),\n 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),\n 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),\n 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))\n );\n\n return $values;\n }", "public function valordelospasajesplus();", "public function getParameters(): array;", "public function fieldparameters()\n {\n\t\t/*\n\t\t * Note: we don't do a token check as we're fetching information\n\t\t * asynchronously. This means that between requests the token might\n\t\t * change, making it impossible for AJAX to work.\n\t\t */\n \n\t\t// Initialise variables.\n $document = JFactory::getDocument();\n \n $return = array();\n \n // Load field xml file.\n $type = $this->input->get('type', '', 'cmd');\n $field = $this->input->get('field', '', 'int');\n $xmlPath = JPATH_ROOT.'/components/com_hwdmediashare/libraries/fields/'.$type.'.xml';\n \n jimport('joomla.filesystem.file');\n if(JFile::exists($xmlPath))\n\t\t{ \n $form = JForm::getInstance($type, $xmlPath, array('control' => 'params'));\n\n if (empty($form))\n {\n $this->setError(JText::_('COM_HWDMS_ERROR_FAILED_TO_LOAD_FORM'));\n return false;\n }\n\n // Load the customfield table.\n JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_hwdmediashare/tables');\n $table = JTable::getInstance('CustomField', 'hwdMediaShareTable');\n \n // Load the field.\n $table->load($field);\n \n // Convert params to registry and bind to the form. \n if (property_exists($table, 'params'))\n {\n $registry = new JRegistry;\n $registry->loadString($table->params);\n $table->params = $registry;\n $form->bind($table->params); \n } \n\n /*\n * Returning the markup for the label and input isn't ideal, so \n * this should be reviewed in the future. \n */\n \n // Add the label and input to the return array.\n foreach($form->getFieldset('details') as $field)\n {\n $return[$field->name]['label'] = $field->label;\n $return[$field->name]['input'] = $field->input;\n }\n\t\t}\n \n // Set the MIME type for JSON output.\n $document->setMimeEncoding( 'application/json' );\n\n // Output the JSON data. \n echo json_encode($return);\n\n\t\tJFactory::getApplication()->close();\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "private function getAllInputParameters () {\n// \t\t$params = $this->getInputParameters();\n\t\t$params = array();\n\t\t$catalogId = $this->session->getCourseCatalogId();\n\t\tif (!$catalogId->isEqual($this->session->getCombinedCatalogId()))\n\t\t\t$params[':catalog_id'] = $this->session->getCatalogDatabaseId($catalogId);\n\t\t\n\t\t$params[':subj_code'] = $this->session->getSubjectFromCourseId($this->courseId);\n\t\t$params[':crse_numb'] = $this->session->getNumberFromCourseId($this->courseId);\n\t\t\n\t\treturn $params;\n\t}", "function capturarCampo(Detallesmantenimientosdetablas $detalle,$numeroGrid,$ValorPorDefecto=false,$sinValorPorDefecto=''){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=trim(obtenerValorPorDefecto($detalle));\n if($sinValorPorDefecto!=false){\n $valorPorDefecto=$ValorPorDefecto;\n }\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n $ayuda=$detalle->getDescripcionCampo();\n \n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n\n return;\n } else if($tipo!='30') {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n Campos::finColumnaGrid();\n }\n\n\n/*\n 1\tFecha\n 2\tFecha Hora\n 3\tHora\n 4\tArchivo\n 5\tNumerico\n 6\tMoneda\n 7\tCaracteres\n 8\tTexto\n 9\tTabla Extranjera\n 10\tBoton de Cheque\n 11\tBotones de Opcion Múltiple PENDIENTE\n 12\tFALSO\n 13\tLista Desplegable\n 14\tAgrupador de Campos \n 15\tSeparador De Campos Oculto PENDIENTE\n 16\tFinalizacion del Separador PENDIENTE\n 17\tTabla PENDIENTE\n 18\tBoton PENDIENTE\n 19\tRuta de archivo PENDIENTE\n 20 Editor HTML PopUp\n */\n\n Campos::columnaGrid($numeroGrid);\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::fecha($id,$valorPorDefecto,$resFecha);\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::fechaHora($id,$valorPorDefecto,$resFecha);\n }else if($tipo==3){\n C::hora($id, $valorPorDefecto);\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript);\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado);\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, \"<p></p>\", $detalle->getNombreCampo());\n }else if($tipo==21){\n C::persona($id, $valorPorDefecto);\n }else if($tipo==25){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==14){\n //Separador de campos\n }else if($tipo==26){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==28){\n C::textoConMascara($id,$detalle->getQueryFiltro());\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n \n C::finColumnaGrid();\n}", "function getParams()\n {\n }", "abstract protected function getFormTypeParams();", "public function filtrarCampos()\n {\n $array_filter = array();\n\n foreach ($this->validations as $propriedade => $tipo) {\n\n if ($this->data[$propriedade] === NULL) {\n throw new \\Exception('O valor nao pode ser Nulo');\n }\n\n // valor do input\n $value = $this->data[$propriedade];\n\n $valueTypeOf = gettype($value);\n\n // anti-hacker\n $value = trim($value); # Limpar espacos\n $value = stripslashes($value); # remove barras invertidas\n $value = htmlspecialchars($value); # converte caracteres especiais para realidade HTML -> <a href='test'>Test</a> -> &lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;\n\n // valor do tipo, usando como metodo existente da classe Sanitize\n $method = $tipo;\n\n $validator = call_user_func(array('Inovuerj\\ADO\\TValidator', $method), $value);\n\n // se nao passar no Validator, retorno erro\n if (!$validator && $method != 'texto') {\n $msg = \"O campo {$propriedade} nao foi validado\";\n throw new \\Exception($msg);\n } else {\n // injetando valor no $this->$propriedade\n $this->{$propriedade} = call_user_func(array('Inovuerj\\ADO\\TSanitizer', $method), $value);\n }\n\n// Util::mostrar($propriedade .' - Tipo: '.$tipo, __LINE__);\n// Util::mostrar($this->{$propriedade},__LINE__);\n\n }\n\n\n # filtrado\n return $this;\n\n }", "private function getCampos()\n {\n \t$fields \t= [];\n \tif ( !empty( $this->parametros['campos'] ) )\n \t{\n if ( is_string($this->parametros['campos']) )\n {\n $fields = explode(',', $this->parametros['campos'] );\n }\n \t} else\n \t{\n \t\t$tabela = $this->parametros['tabela'];\n \t\t$fields = [$this->Controller->$tabela->primaryKey(), $this->Controller->$tabela->displayField() ];\n \t}\n\n \treturn $fields;\n }", "function PARAMETROS() {\r\n\t$sql = \"SELECT * FROM mastparametros\";\r\n\t$query_parametro = mysql_query($sql) or die ($sql.mysql_error());\r\n\twhile ($field_parametro = mysql_fetch_array($query_parametro)) {\r\n\t\t$id = $field_parametro['ParametroClave'];\r\n\t\t$_PARAMETRO[$id] = $field_parametro['ValorParam'];\r\n\t}\r\n\treturn $_PARAMETRO;\r\n}", "public function getFieldParams($fieldName);", "function getInputValues() {\r\n $vals = array();\r\n \r\n $vals['datetime'] = @$_REQUEST['datetime'];\r\n $vals['mileage'] = @$_REQUEST['mileage'];\r\n $vals['location'] = @$_REQUEST['location'];\r\n $vals['pricepergallon'] = @$_REQUEST['pricepergallon'];\r\n $vals['gallons'] = @$_REQUEST['gallons'];\r\n $vals['grade'] = @$_REQUEST['grade'];\r\n $vals['pumpprice'] = @$_REQUEST['pumpprice'];\r\n $vals['notes'] = @$_REQUEST['notes'];\r\n \r\n return $vals;\r\n}", "function prepareParams($data){\r\n\t$param_info = $this->getParamInfo();\r\n\t$param_ids = array();\r\n\t$param_types = array();\r\n\r\n\tforeach($param_info as $p_i){\r\n\t\t$param_ids[$p_i['param']] = $p_i['id'];\r\n\t\t$param_types[$p_i['param']] = $p_i['param_type'];\r\n\t}\r\n\t$new_params = array();\r\n\tforeach($data as $k=>$v){\r\n\t\tif(isset($param_ids[$k]) && $param_types[$k] == 'text'){\r\n\t\t\t$new_params[$param_ids[$k]][0] = $v;\r\n\t\t}\r\n\t\telseif(isset($param_ids[$k])){\r\n\t\t\tif(is_array($v)){\r\n\t\t\t\t$v = implode(',',$v);\r\n\t\t\t}\r\n\t\t\t$new_params[$param_ids[$k]][1] = $v;\r\n\t\t\t$new_params[$param_ids[$k]][0] = $data[$k.'_text_value'];\r\n\t\t}\r\n\t}\r\n\treturn $new_params;\r\n}", "public function parametreValide($id,$dateSortie,$lieu) {\n $em = $this->getDoctrine()->getManager();\n $saison = new Saison;\n $year = $saison->connaitreSaison();\n //on s'assure que les parametres n'ont pas ete changer a la main\n $saison = $em->getRepository('SC\\ActiviteBundle\\Entity\\Saison')->findOneByAnnee($year);\n $lieuObjet = $em->getRepository('SC\\ActiviteBundle\\Entity\\Lieu')->findOneByNomLieu($lieu);\n $activite = $em->getRepository('SC\\ActiviteBundle\\Entity\\Activite')->find($id);\n $sortie = $em->getRepository('SC\\ActiviteBundle\\Entity\\Sortie')->findOneBy(array('saison'=> $saison, 'activite'=>$activite,'dateSortie'=>$dateSortie)); \n \n if(is_null($activite) OR is_null($lieuObjet) OR is_null($sortie)) {\n return false;\n }\n else {\n return true;\n }\n }", "function getParameters(): array;", "public function getParams() :array;", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "public static function getRequiredParams();", "public function get_submitted_values_for_step_parameters() {\n $report = $this->workflow->get_report_instance();\n $report->require_dependencies();\n $report->init_filter($report->id);\n $filters = $report->get_filters();\n //Check for report filter\n if (isset($report->filter)) {\n $report_filter = $report->filter;\n } else {\n $report_filter = null;\n }\n $form = new scheduling_form_step_parameters(null, array('page' => $this, 'filterobject' => $report_filter));\n\n $data = $form->get_data(false);\n // get rid of irrelevant data\n unset($data->MAX_FILE_SIZE);\n unset($data->_wfid);\n unset($data->_step);\n unset($data->action);\n unset($data->_next_step);\n\n if (isset($report_filter) && isset($data)) {\n // Remove any false parameters\n $parameters = $data;\n\n // Use this object to find our parameter settings\n $filter_object = $report_filter;\n $filter_object_fields = $filter_object->_fields;\n // Merge in any secondary filterings here...\n if (isset($filter_object->secondary_filterings)) {\n foreach ($filter_object->secondary_filterings as $key => $secondary_filtering) {\n $filter_object_fields = array_merge($filter_object_fields, $secondary_filtering->_fields);\n }\n }\n\n if (!empty($filter_object_fields)) {\n $fields = $filter_object_fields;\n foreach($filter_object_fields as $fname=>$field) {\n $sub_data = $field->check_data($parameters);\n if ($sub_data === false) {\n // unset any filter that comes back from check_data as false\n unset($data->$fname);\n }\n }\n }\n }\n return $data;\n }", "function asignar_valores3(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->temporada=$_POST['temporada'];\n\t\t$this->nombre=$_POST['nombre_plan'];\n\t\t$this->descripcion=$_POST['descripcion_plan'];\n\t\t$this->precio=$_POST['precio_plan'];\n\t\t$this->maxadultos=$_POST['maxadultos'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t}", "function asignar_valores2(){\n\t\t/* Metodo para recibir valores del exterior. */\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->desde=$_POST['desde'];\n\t\t$this->hasta=$_POST['hasta'];\n\t\t$this->titulo=$_POST['titulo'];\n\t\t$this->alternativo=$_POST['alternativo'];\n\t\t$this->paxadicional=$_POST['paxadicional'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t\t$this->desde_a=$_POST['desde_a'];\n\t\t$this->hasta_a=$_POST['hasta_a'];\n\t\t$this->precio_a=$_POST['precio_a'];\n\t\t$this->desde_b=$_POST['desde_b'];\n\t\t$this->hasta_b=$_POST['hasta_b'];\n\t\t$this->precio_b=$_POST['precio_b'];\n\t\t\n\t}", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public static function obtenerCotizacionesParametro($campo)\n { \n $consulta = \"SELECT * FROM actividades_parametros WHERE id_parametro=?\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($campo));\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function transactionFormGetFormParms ();", "protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }", "public function listaCampos() {\r\n return Array(\"empleado\", \"nombre\", \"nif\", \"perfil_Usuario\", \"etiqueta_Emp\", \"observaciones_Emp\", \"centro_Directivo_Depart\", \"centro_Trabajo\", \"puesto_Trabajo\", \"servicio\", \"tipo_Usuario\", \"grupo_Nivel\");\r\n }", "function capturarCampoActualizar(Detallesmantenimientosdetablas $detalle,$numeroGrid,$ValorPorDefecto=''){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=$ValorPorDefecto;\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n $ayuda=$detalle->getDescripcionCampo();\n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n return;\n } else {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n Campos::finColumnaGrid();\n }\n Campos::columnaGrid($numeroGrid);\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::fecha($id,$valorPorDefecto,$resFecha);\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::fechaHora($id,$valorPorDefecto,$resFecha);\n }else if($tipo==3){\n C::hora($id, $valorPorDefecto);\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript);\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado);\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, $valorPorDefecto, $detalle->getNombreCampo());\n }else if($tipo==21){\n C::persona($id, $valorPorDefecto);\n }else if($tipo==25){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==26){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==28){\n C::textoConMascara($id,$detalle->getQueryFiltro(),$valorPorDefecto);\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n\n \n C::finColumnaGrid();\n\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n\n\n}", "function getParams()\n {\n }", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }" ]
[ "0.6492307", "0.6492307", "0.6463919", "0.6447743", "0.6447743", "0.6336619", "0.6336619", "0.6336619", "0.6336619", "0.6336619", "0.6336619", "0.6336619", "0.6336619", "0.63301295", "0.6307046", "0.62998766", "0.62679607", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.626507", "0.6224136", "0.62212867", "0.6219441", "0.61603916", "0.6106941", "0.60616755", "0.60282713", "0.60282713", "0.60278594", "0.59627306", "0.5956315", "0.5956315", "0.5956151", "0.5952849", "0.594085", "0.594085", "0.5937638", "0.59351104", "0.5922672", "0.59147394", "0.59114593", "0.59113854", "0.59095085", "0.59073704", "0.59021646", "0.5891775", "0.58912", "0.58613664", "0.5858823", "0.5853532", "0.5837795", "0.582655", "0.5825701", "0.5806207", "0.58030427", "0.58030427", "0.5800464", "0.5787738", "0.5787024", "0.5780973", "0.5780048", "0.5766703", "0.5765015", "0.5757313", "0.57456493", "0.5737762", "0.57175", "0.5715733", "0.5692656", "0.5687003", "0.5686999", "0.56735706", "0.56692946", "0.56630343", "0.566096", "0.56562096", "0.5654671", "0.56543666", "0.56543666", "0.56543666", "0.56543666", "0.56412417", "0.56392664", "0.5635142", "0.56310815", "0.56219363", "0.56171507", "0.56120664", "0.56020975", "0.559789", "0.5596058", "0.5595703", "0.5592994", "0.5590618" ]
0.0
-1
Borrar la instancia vieja que poseia el modelo
public function Instancia() { $this->instance = null; $this->instance = new NomCampoestruc(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function borrarInscrito() {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n leerClase('Estudiante');\n leerClase('Proyecto_dicta');\n $estudiante = new Estudiante($this->estudiante_id);\n $evaluacion = new Evaluacion($this->evaluacion_id);\n $protecto=$estudiante->getProyecto();\n $sql = \"select p.id as id from \" . $this->getTableName('Proyecto_dicta') . \" as p where p.proyecto_id = '$protecto->id' and p.dicta_id = '$this->dicta_id' \";\n $resultado = mysql_query($sql);\n\n $proyecto_array = mysql_fetch_array($resultado);\n $proyecto_dicta = new Proyecto_dicta($proyecto_array);\n $proyecto_dicta->delete();\n $evaluacion->delete();\n $this->delete();\n }", "public function reset_rezultati()\n {\n $query = $this->query(\"SELECT * FROM rezultati;\");\n foreach ($query->getResultArray() as $row)\n {\n $this->delete($row['idrezultati']);\n }\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function borrarResultados()\n {\n $this->resultados = array();\n }", "public function eliminar($objeto){\r\n\t}", "static function eliminar_instancia()\n\t{\n\t\tself::$instancia = null;\n\t}", "public function borrar() {\n $id = $this->input->post(\"id\");\n $this->AdministradorModel->delete($this->tabla, $id);\n }", "function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function eliminarperiodo (){\n\t\t$this->loadmodel('Correo');\t\t\n\t\t$condition = array('Correo.etapa' => 10);\t\n\t\t$this->Correo->deleteAll($condition,false);\n\t\tif ($this->Periodo->query('TRUNCATE TABLE RAP_PERIODOS_POSTULACION')) {\t\t\t\t\t\n\t\t\t\t$this->redirect(array('action'=>'periodopostulacion'));\t\t\t\t\t\n\t\t\t\t$this->Session->setFlash(__('Exito al borrar el periodo de postulación.'),'mensaje-exito');\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$this->redirect(array('action'=>'periodopostulacion'));\t\t\t\n\t\t\t$this->Session->setFlash(__('Exito al borrar el periodo de postulación.'),'mensaje-exito');\t\t\t\n\t\t}\n\t\t\n\t\t\t\n\t}", "function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }", "public function deleteFromMatrix() {\n DB::statement('DELETE FROM lemma_matrix WHERE lemma1='.$this->id.' OR lemma2='.$this->id);\n }", "public function remover()\n\t{\n\t\t$sql = \"DELETE FROM $this->tabela WHERE $this->chave_primaria = :id\";\n\n\t\t$this->resultado = $this->conn->prepare($sql);\n\t\t$this->resultado->bindValue(':id', $this->id);\n\n\t\treturn $this->resultado->execute();\n\t}", "public function desasociar($id_activo, $id_maleza){\n\n $activo = Activo::find($id_activo);\n $activo->malezas()->detach($id_maleza);\n\n Session::flash(\"mensaje\",[\"contenido\"=>\"Registro Correcto\", \"color\" => \"green\"]);\n return redirect()->back();\n\n\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM negociacao_contas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function eliminarTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n mysql_query(\"DELETE FROM ca_tipo_matricula WHERE id = ? ;\");\n $sql = \"DELETE FROM ca_tipo_matricula WHERE id = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }", "function eliminar_autonomo()\n\t{\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->eliminar();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t\t$this->manejador_interface->mensaje(\"El proyecto '{$this->identificador}' ha sido eliminado\");\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\t$this->manejador_interface->error( \"Ha ocurrido un error durante la eliminacion de TABLAS de la instancia:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t$e->getMessage() );\n\t\t}\n\t}", "public function borrarXModel($id, $table){\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $table WHERE id = $id\"); //preparar consulta para eliminar el registro con el id y la tabla mandada como parametro\n\t\tif($stmt->execute()) //se ejecuta la consulta\n\t\t\treturn \"success\"; //se retorna la respuesta\n\t\telse\n\t\t\treturn \"error\";\n\t\t$stmt->close();\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function EliminarPerfil()\n {\n $this->db->where('idPerfil', $_POST['idPerfil']);\n $row = $this->db->get('perfil');\n $query=$row->row();\n\n /** Registro de Historial **/\n $Mensaje=\" Se Eliminó Perfil: \".$query->DescripcionPerfil.\"\";\n $this->db->select(\"FU_REGISTRO_HISTORIAL(5,\".$this->glob['idUsuario'].\",'\".$Mensaje.\"','\".$this->glob['FechaAhora'].\"') AS Respuesta\");\n $func[\"Historial\"] = $this->db->get();\n\n\n\n $this->db->where('idPerfil', $_POST['idPerfil']);\n $delete_data[\"Delete\"] = $this->db->delete('perfil');\n $delete_data[\"errDB\"] = $this->db->error();\n\n return $delete_data;\n\n }", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "function eliminarCursosDelTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n $sql = \"DELETE FROM ca_tipo_matricula_curso WHERE tipo_matricula = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function eliminaRuta()\r\n\t{\r\n\t\t$query = \"DELETE FROM \" . self::TABLA . \" WHERE IdRuta = \".$this->IdRuta.\";\";\r\n\t\treturn parent::eliminaRegistro( $query);\r\n\t}", "function erase() {\n\t\tif (method_exists($this,'beforeErase') && !$this->beforeErase())\n\t\t\treturn;\n\t\t$this->exec(array('method'=>'remove','criteria'=>$this->criteria));\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterErase'))\n\t\t\t$this->afterErase();\n\t}", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function delRecursoOT()\n {\n $post = json_decode( file_get_contents('php://input') );\n $this->load->database('ot');\n $this->db->delete('recurso_ot', array('idrecurso_ot'=>$post->idrecurso_ot) );\n if(isset($post->idrecurso)){\n $rows = $this->db->from('recurso_ot AS rot')->join('recurso AS r','r.idrecurso = rot.recurso_idrecurso')->where('r.idrecurso',$post->idrecurso)->get();\n if($rows->num_rows() == 0){\n $this->db->delete('recurso', array('idrecurso'=>$post->idrecurso) );\n }\n }\n echo \"success\";\n }", "public function destroyAction() {\n $model = new Application_Model_Compromisso();\n //mando para a model o id de quem sera excluido\n $model->delete($this->_getParam('id'));\n //redireciono\n $this->_redirect('compromisso/index');\n }", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "public function destroy(){\n //Si no es adminitrador da un error.\n Login::checkAdmin(); \n \n //comprueba que llegue el formulario de confirmación\n if (empty($_POST[T_DELETE]))\n throw new Exception(\"No se recibió confirmación\");\n \n $id= intval($_POST['id']); // recupera el id vía POST\n $idmodelo= intval($_POST['idmodelo']); // recupera el idmodelo vía POST\n \n //Si el coche está alquilado no podemos darlo de baja\n if (Alquilado::isCocheAlquilado($id))\n throw new Exception('Este coche está en alquiler, debes dar de baja el alquiler antes de borrarlo.');\n \n // intenta borrar el coche de la BDD\n \n if (Coche::borrar($id)===false)\n throw new Exception(\"No se puede borrar.\");\n \n //redireccionamos a ModeloController::show($id);\n (new ModeloController())->show($idmodelo);\n }", "public function clearModels();", "public function destroy(Modelo $modelo)\n {\n //\n }", "public function Excluir(){\n $idMotorista = $_GET['id'];\n\n $motorista = new Motorista();\n\n $motorista->id = $idMotorista;\n\n $motorista::Delete($motorista);\n\n\n }", "public function borrarMateriaModel($datosModel, $tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function borrar()\n {\n $id = $this->input->post('borrar');\n $this->Usuario_model->borrar_cuenta($id);\n $this->listar_usuarios();\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public static function borrarTiendasModel($datosModel, $tabla){\n\n\t\t\t/*$stmt2 = Conexion::conectar()->prepare(\"SELECT id_producto FROM productos WHERE id_categoria=$datosModel\");\t\n\t\t\t$stmt2->execute();\n\t\t\t$actualizar = $stmt2->fetch(PDO::FETCH_BOTH);\n\t\t\tif($actualizar){\n\t\t\t\tforeach ($actualizar as $upd) {\n\t\t\t\t\t$campo = \"NULL\";\n\t\t\t\t\t$stmt3 = Conexion::conectar()->prepare(\"UPDATE productos SET id_categoria=$campo WHERE id_producto=$upd[0]\");\n\t\t\t\t\t$stmt3->execute();\n\t\t\t\t}\n\t\t\t}*/\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id_tienda = :id\");\n\t\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\n\n\t\t\tif($stmt->execute()){\n\t\t\t\treturn \"success\";\n\t\t\t}else{\n\t\t\t\treturn \"error\";\n\t\t\t}\n\t\t\t$stmt->close();\n\n\t\t}", "public function BorrarAction() {\n\n $etiqueta = new Etiquetas();\n $etiqueta->queryDelete(\"IDAgente='{$_SESSION['usuarioPortal']['Id']}'\");\n unset($etiqueta);\n\n return $this->IndexAction();\n }", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function borrarIDModel($datosModel, $tabla){\r\n\t\t// Prepara la sentecia\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t// Reemplaza con el verdadero dato :id\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\t\t// Y se ejecuto\r\n\t\tif($stmt->execute()){\r\n\t\t\t// Regresa mensaje de extio en caso de serlo\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\t\telse{\r\n\t\t\t// O de error en caso de que surja\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\t\t// Se cierra la conexión\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function borrarCarreraModel($datosModel, $tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function unpopulate();", "public function Eliminar_Exp_Laboral($data){\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n $tiporegistro = \"Experiencia Laboral\";\n $accion = \"Elimina una Nueva \".$tiporegistro.\" de el Sistema (Hoja vida) TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario'];\n //$idusuario = $_POST['id_user'];;\n try {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n $sql = \"DELETE FROM th_experiencia_laboral WHERE exp_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->id\n )\n ); \n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "public function borrarSucursal() {\n \n try {\n \n if (Input::has('id')) {\n \n $sucursal = Sucursal::findOrFail(Input::get('id'));\n\n $sucursal->delete();\n \n $mensaje = 'Sucursal con ID: '.Input::get('id').' eliminada';\n return Utils::enviarRespuesta('OK', $mensaje, 200);\n } else {\n \n $mensaje = 'El campo \\'id\\' es requerido.';\n return Utils::enviarRespuesta('Datos incompletos', $mensaje, 406);\n }\n } catch(Exception $e) {\n \n return Utils::enviarRespuesta('Error', $e->getMessage(), 500);\n }\n }", "public function clear()\n {\n $this->idmontacargas = null;\n $this->idsucursal = null;\n $this->montacargas_modelo = null;\n $this->montacargas_marca = null;\n $this->montacargas_c = null;\n $this->montacargas_k = null;\n $this->montacargas_p = null;\n $this->montacargas_t = null;\n $this->montacargas_e = null;\n $this->montacargas_volts = null;\n $this->montacargas_amperaje = null;\n $this->montacargas_nombre = null;\n $this->montacargas_numserie = null;\n $this->montacargas_comprador = null;\n $this->montacargas_ciclosmant = null;\n $this->montacargas_ciclosiniciales = null;\n $this->montacargas_baja = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "private function eliminarEmpleadoRepetido()\n {\n //Sino me los trata como strings\n $this->empleados = array_unique($this->empleados, SORT_REGULAR);\n }", "public function restore()\n {\n //Query Builder\n DB::table('users')->delete();\n DB::table('respuestas')->delete();\n \n echo \"Realizado\";\n }", "static public function ctrBorrarUsuario(){\n\t\tif (isset($_POST['idUsuario'])) {\n\t\t\tif ($_POST['fotoUsuario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUsuario\"]);\n\t\t\t\trmdir('Views/img/usuarios/'.$_POST['usuario']);\n\t\t\t}\n\t\t$answer=adminph\\User::find($_POST['idUsuario']);\n\t\t$answer->delete();\n\t\t}\n\t}", "public static function borrarVentasModel($datosModel, $tabla){\n\n\t\t\t$stmt2 = Conexion::conectar()->prepare(\"SELECT id FROM detalles_venta WHERE id_venta=$datosModel\");\t\n\t\t\t$stmt2->execute();\n\t\t\t$borrar = $stmt2->fetch(PDO::FETCH_BOTH);\n\t\t\tif($borrar){\n\t\t\t\tforeach ($borrar as $dlt) {\n\t\t\t\t\t$stmt3 = Conexion::conectar()->prepare(\"DELETE FROM detalles_venta WHERE id=$dlt[0]\");\n\t\t\t\t\t$stmt3->execute();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\n\t\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\n\n\t\t\tif($stmt->execute()){\n\t\t\t\treturn \"success\";\n\t\t\t}else{\n\t\t\t\treturn \"error\";\n\t\t\t}\n\t\t\t$stmt->close();\n\n\t\t}", "public function borrar($id){\n session_destroy();\n // borra todos los campos del usuario por el id recibido del controlador\n R::trash(R::load('usuarios',$id));\n // redirige ala pagina principal\n redirect(base_url());\n // recibe la variable id del controlador usuarios.php linea 221\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "function Eliminar(){\n\t \n\t $this->Model->Eliminar($_GET['id']);\n\t\t\n\t }", "function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }", "public function rm_whole() {\n\t\t$this->rm_controller();\n\t\t$this->rm_model();\n\t\t$this->rm_entity();\n\t}", "public function borrarGrupoModel($datosModel, $tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function borrarHabitacionController(){\n //Se obtiene el id que se quiere eliminar y se verifica\n if(isset($_GET[\"idBorrar\"])){\n //Al tenerlo este se pasa a una variable\n $datosController = $_GET[\"idBorrar\"];\n //Es enviado hacia el modelo para realizar la conexion y este lo elimine\n $respuesta = Datos::borrarHabitacionModel($datosController, \"habitaciones\");\n \n if($respuesta == \"correcto\"){\n //Al ser correcto se recarga la pagina anterior para verificar el cambio.\n echo '<script>\t\t\n\t\t\t location.href= \"index.php?action=habitacion\";\n\t\t </script>';\n \n }\n \n }\n }", "public function borrarTutoriaModel($datosModel, $tabla){\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute())\r\n\t\t\treturn \"success\";\r\n\t\telse\r\n\t\t\treturn \"error\";\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function remove(){\n if(!empty($_POST['id'])){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $val->del();\n }\n header('location: '.FOLDER_PATH.'/Valida');\n }", "function runEliminar(){\n \n $sql = \"DELETE FROM mec_met WHERE id_mecanismos IN (SELECT id_mecanismos FROM mecanismos WHERE id_componente=\".$this->_datos.\")\";\n $this->QuerySql($sql);\n $sql = \"DELETE FROM mecanismos WHERE id_componente=\".$this->_datos;\n $this->QuerySql($sql);\n $sql = \"DELETE FROM componentes WHERE id_componentes=\".$this->_datos;\n $_respuesta = array('Codigo' => 0, \"Mensaje\" => '<strong> OK: </strong> El registro se ha eliminado.');\n try { \n $this->QuerySql($sql);\n }\n catch (exception $e) {\n $_respuesta = array('Codigo' => 99, \"Mensaje\" => $e->getMessage());\n }\n \n print_r(json_encode($_respuesta));\n }", "function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public function clear()\n {\n $this->sekolah_id = null;\n $this->semester_id = null;\n $this->id_ruang = null;\n $this->hari = null;\n $this->bel_ke_01 = null;\n $this->bel_ke_02 = null;\n $this->bel_ke_03 = null;\n $this->bel_ke_04 = null;\n $this->bel_ke_05 = null;\n $this->bel_ke_06 = null;\n $this->bel_ke_07 = null;\n $this->bel_ke_08 = null;\n $this->bel_ke_09 = null;\n $this->bel_ke_10 = null;\n $this->bel_ke_11 = null;\n $this->bel_ke_12 = null;\n $this->bel_ke_13 = null;\n $this->bel_ke_14 = null;\n $this->bel_ke_15 = null;\n $this->bel_ke_16 = null;\n $this->bel_ke_17 = null;\n $this->bel_ke_18 = null;\n $this->bel_ke_19 = null;\n $this->bel_ke_20 = null;\n $this->create_date = null;\n $this->last_update = null;\n $this->soft_delete = null;\n $this->last_sync = null;\n $this->updater_id = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function bajaUnidadMedida() // Ok\n {\n $id = $this->input->post('idUnidadMedida');\n echo $this->Lovs->eliminar($id); \n }", "function eliminarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function clear()\n {\n $this->op_prime_id = null;\n $this->op_id = null;\n $this->op_prime_libelle = null;\n $this->op_prime_numero = null;\n $this->gdl_art_id = null;\n $this->operation_prime_currency_id = null;\n $this->operation_prime_r_reward_type_id = null;\n $this->operation_prime_r_reward_expedition_mode_id = null;\n $this->operation_prime_r_reward_transporter_id = null;\n $this->operation_prime_fixed_amount = null;\n $this->operation_prime_product_price_pourcentage = null;\n $this->operation_prime_maximum_amount = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function borrarMaestroModel($datosModel, $tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\t\t$stmt->bindParam(\":id\", $datosModel, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function eliminar(){\n $dimensiones = $this->descripciones()->distinct()->get()->pluck('id')->all();\n $this->descripciones()->detach($dimensiones);\n DescripcionProducto::destroy($dimensiones);\n $this->categorias()->detach();\n $this->imagenes()->delete();\n $this->delete();\n }", "public function borrar(){\r\n\t\t\t$user_table = Config::get()->db_user_table;\r\n\t\t\t$consulta = \"DELETE FROM $user_table WHERE id='$this->id';\";\r\n\t\t\treturn Database::get()->query($consulta);\r\n\t\t}", "function borrar(){\n $id=$_POST[\"id\"];\n $consulta=\"DELETE FROM usuarios WHERE id = \".$id.\"\";\n echo $consulta. \"<br>\";\n \n\n $resultado = $conector->query($consulta);\n mostrarListado();\n }", "public function remover() {\n \n if (!db_utils::inTransaction()) {\n throw new DBException(_M(self::ARQUIVO_MENSAGEM . \"sem_transacao_ativa\"));\n }\n \n $this->removerItens();\n \n $oDaoProcessoLote = new cl_processocompralote;\n $oDaoProcessoLote->excluir($this->getCodigo());\n if ($oDaoProcessoLote->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM.\"erro_remover_lote\"));\n }\n }", "function eliminar($objeto){\n\t\t$sql=\"\tUPDATE\n\t\t\t\t\tcom_recetas\n\t\t\t\tSET\n\t\t\t\t\tstatus = 2\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_productos\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_producto_material\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto = \".$objeto['id'].\";\";\n\t\t// return $sql;\n\t\t$result = $this->dataTransact($sql);\n\n\t\treturn $result;\n\t}", "public function delete()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->delete($this->db->quoteName(\"#__crowdf_intentions\"))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n\n $this->reset();\n }", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "public function removeMutira(){\n $this->validaAutenticacao();\n\n $tweet = Conteiner::getModel('Mutira');\n $tweet->__set('mutira', $_POST['mutira']);\n $tweet->__set('id_usuario', $_SESSION['id']);\n \n\n $tweet->removeMutira();\n\n //header('Location: /timeline');\n\n }", "function EliminarConceptopago($id) {\n $sql = \"UPDATE `conceptopago` SET `estado` = 'INACTIVO' WHERE `id` = '$id'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n $num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($result) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Registro eliminado con éxito!\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"Ha ocurrido un error!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public static function borrarVisitaModel($idVisita,$tabla)\n\t{\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id_visita = :id_visita\");\t\n\t\t//Definicion de parametros a la consulta\n\t\t$stmt->bindParam(\":id_visita\", $idVisita, PDO::PARAM_INT);\n\t\t//Si la ejecucion es exitosa devuelve mensaje de exito\n\t\tif($stmt->execute())\n\t\t{\n\t\t\treturn \"success\";\n\t\t}\n\t\t//Cerrar conexion al final\n\t\t$stmt->close();\n\t}", "function action_remove() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['rem_id'];\n\t\t\t$table = $data['rem_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\tunset($choosen[$table][$id]);\n\t\t\tif (count($choosen[$table]) == 0) unset($choosen[$table]);\n\t\t\t\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function eliminarContrato($id){\n $contrato=PeriodoEmpleado::find($id);\n $contrato->activo=0;\n $contrato->save();\n return redirect('/listarEmpleados/listarContratos/'.$contrato->empleado->codEmpleado);\n \n }", "private function eraseObject() {\n $this->tripId = \"\";\n $this->journalId = \"\";\n $this->created = null;\n $this->updated = null;\n $this->latestUpdated = null;\n $this->userId = \"\";\n $this->journalDate = \"\";\n $this->journalTitle = \"\";\n $this->journalText = \"\";\n $this->deleted = \"N\";\n $this->hash = \"\";\n $this->latestHash = \"\";\n }", "public function destroy(Request $request)\n {\n $jovenes=jovenes::find($request->id);\n if($jovenes->delete()){\n $log= new Logs();\n $log->tabla=\"jovenes\";\n $log->accion=\"update\";\n $log->idrow=$jovenes->id;\n $log->user_id=\\Auth::user()->id;\n $log->save();\n return redirect()->back()->with('message','Ingreso actualizado correctamente');\n }else{\n\n }\n\n}", "public function removeAction()\n {\n if ( $this->_hasParam('razaoSocialTomador') == false )\n {\n $this->_redirect('clientes/list');\n }\n \t\t$modelo = new Application_Model_Clientes();\n $razaoSocialTomador = $this->_getParam('razaoSocialTomador');\n $modelo->removeByRazaoSocial($razaoSocialTomador);\n\n// $cnte = $modelo->removeByRazaoSocial($razaoSocialTomador);\n\t\t$this->_redirect('clientes/list');\n // action body\n }", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "public function __destruct()\n {\n\tunset($this->model);\n }", "public function eliminarConceptoMovimiento()\n {\n $id_recuperado = Input::get('id');\n $id = json_decode(json_encode($id_recuperado));\n $eliminardato = $this->repoConceptoMovimiento->eliminarConceptoMovimiento($id);\n return response()->json();\n }", "public function destroy(Matoleo $matoleo)\n {\n //\n }", "function borrarMovimiento()\n\t{\t\n\t\t$id = $this->input->post('id');\n\t\tlist($nrc, $aula, $posicAsig) = explode(\":\", $id);\n\t\techo json_encode($this->crud_model->borrarMovimiento($nrc, $aula, $posicAsig));\n\t}", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "final public function borrar() {\n global $config;\n # Verificar que no se borre a sí mismo.\n if ($this->id != $this->id_user) {\n \n # Se borra al usuario\n $this->db->delete('users',\"id_user='$this->id'\", 'LIMIT 1');\n\n # Directorio real\n $dir = str_replace('{{id_user}}',$this->id,\n str_replace('../', '', self::AVATARS_DIR));\n\n # Si tiene archivos, los borramos\n if (is_dir($dir)) {\n Files::rm_dir($dir);\n }\n }\n\n # Volvemos a la vista\n $this->functions->redir($config['site']['url'].'admins/?success=true');\n\n }", "public static function eliminarSlideModel($datos, $tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\r\n\t\t$stmt -> bindParam(\":id\", $datos[\"idSlide\"], PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"ok\";\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM grupo_usuario_tabelas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function remove();", "public function remove();", "public function remove();" ]
[ "0.7369728", "0.6677371", "0.6579571", "0.6573997", "0.6569192", "0.65533614", "0.63510525", "0.6287539", "0.6279832", "0.6276242", "0.62486464", "0.6215599", "0.62047327", "0.61994773", "0.6167614", "0.614694", "0.613519", "0.61055386", "0.60996264", "0.609714", "0.60897225", "0.60895115", "0.60834235", "0.6082515", "0.60683763", "0.6059618", "0.605879", "0.60398763", "0.6033132", "0.60284907", "0.60167587", "0.6013851", "0.6003979", "0.6002586", "0.59992445", "0.5998026", "0.59898937", "0.5980688", "0.5975372", "0.5968713", "0.59668356", "0.59654385", "0.59608275", "0.5948573", "0.5948449", "0.59447086", "0.5944074", "0.5943555", "0.5943094", "0.5939092", "0.5934408", "0.59290975", "0.5926889", "0.5925973", "0.5923742", "0.5919419", "0.59191924", "0.5916222", "0.5904851", "0.59040487", "0.5893399", "0.589239", "0.5889164", "0.5887282", "0.58860064", "0.5881795", "0.58749706", "0.58740264", "0.5868199", "0.5866684", "0.5860314", "0.5855561", "0.58547705", "0.58487445", "0.5831884", "0.58134806", "0.5812236", "0.58096194", "0.58050424", "0.5801165", "0.57986116", "0.57932216", "0.5792584", "0.57840544", "0.5782359", "0.5775477", "0.5775393", "0.5770924", "0.5756749", "0.5755134", "0.57525015", "0.57521665", "0.5746611", "0.57466024", "0.5745252", "0.57425237", "0.5741305", "0.5737579", "0.57346535", "0.57346535", "0.57346535" ]
0.0
-1
Run the database seeds.
public function run() { // Omega-3 Index Feature DB::table('product_features')->insert([ 'product_id' => 1, // Basic 'feature_id' => 1 ]); DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 1 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 1 ]); // Omega-6:Omega-3 Ratio Feature DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 2 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 2 ]); // AA:EPA Ratio Feature DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 3 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 3 ]); // Trans Fat Index Feature DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 4 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 4 ]); // Full Fatty Acid Profile Feature DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 5 ]); // Personalized dietary recommendations DB::table('product_features')->insert([ 'product_id' => 1, // Basic 'feature_id' => 6 ]); DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 6 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 6 ]); // Fatty Acid Research Report DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 7 ]); // EPA+DHA content of commonly consumed seafood DB::table('product_features')->insert([ 'product_id' => 1, // Basic 'feature_id' => 8 ]); DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 8 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 8 ]); // Trans fat content of commonly consumed food DB::table('product_features')->insert([ 'product_id' => 2, // Plus 'feature_id' => 9 ]); DB::table('product_features')->insert([ 'product_id' => 3, // Complete 'feature_id' => 9 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Returns true if object can import $settings. False otherwise.
public function accept($settings) { $path = $settings->get_path(); $name = basename($path); $extentions = $this->get_extentions(); foreach ($extentions as $ext) { if (strpos($name, $ext) !== false) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_import_valid() {\n\t\t$import_settings = [\n\t\t\t'user',\n\t\t];\n\n\t\t$valid = true;\n\n\t\tforeach ( $import_settings as $setting ) {\n\t\t\tif ( empty( $this->import[ $setting ] ) ) {\n\t\t\t\t$valid = false;\n\t\t\t}\n\t\t}\n\n\t\treturn ( $this->is_core_valid() && $valid );\n\t}", "function loadSettings($settings=array()) {\n\t\t//# load class variables with settings parameter or load\n\t\t//# wp_options if no parameter\n\t\tif (empty($settings) || count($settings) == 0) {\n\t\t\t$settings = $this->getSettings();\n\t\t}\n\t\tif (!empty($settings) && is_array($settings)) {\n\t\t\t$this->options2class($settings);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private function can_import() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'import' &&\n current_user_can( 'manage_options' );\n }", "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "public function available($settings) {\n\t\treturn $settings['type'] == 'memcached' && class_exists(\"Memcached\");\n\t}", "public static function canConvertSettings()\n\t{\n\t\treturn FALSE;\n\t}", "public static function canConvertSettings()\n\t{\n\t\treturn FALSE;\n\t}", "public static function canConvertSettings()\n\t{\n\t\treturn FALSE;\n\t}", "public function useSetting()\n\t{\n\t\treturn count($this->settingConfig()) ? true : false;\n\t}", "private function should_load() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$theme_support = get_theme_support( 'themeisle-demo-import' );\n\n\t\tif ( empty( $theme_support ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasModuleSettings()\n {\n return true;\n }", "public function loadSettings() {\n $this->serverURL = Yii::$app->getModule('rocketchat')->settings->get('serverURL');\n return true;\n }", "public function is_core_valid() {\n\t\t$core_settings = [\n\t\t\t'data_owner',\n\t\t\t'username',\n\t\t\t'secret',\n\t\t\t'recipient',\n\t\t\t'requirement_set',\n\t\t\t'taxonomy_id',\n\t\t];\n\n\t\t$valid = true;\n\n\t\tforeach ( $core_settings as $setting ) {\n\t\t\tif ( empty( $this->api[ $setting ] ) ) {\n\t\t\t\t$valid = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $valid;\n\t}", "public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}", "public function canLikesettings() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n $like_setting_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.setting.show' ) ;\n\t\tif ( empty( $like_profile_show ) || empty( $like_setting_show ) ) {\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }", "public function getImportGlobally()\n {\n $value = $this->_config->get('dataprocessing/general/import_globally');\n\n if ($value === null) {\n $value = true;\n }\n\n return (bool)$value;\n }", "protected function ensureSettings()\n {\n if (empty(static::$requiredSettings)) {\n return true;\n }\n\n foreach (static::$requiredSettings as $requiredSetting) {\n if (!isset($this->settings[$requiredSetting])) {\n throw new \\BadMethodCallException('Required template setting [{' . $requiredSetting . '}] is missing.');\n }\n }\n\n return true;\n }", "function get_settings($in)\n{\n if (is_file($in))\n return include $in;\n return false;\n}", "function test_settings($settings)\n {\n //can even register results, so you can give errors or whatever if you want..\n geoAdmin::m('I\\'m sure the settings are just fine. (CHANGE THIS! FOR DEMONSTRATION ONLY)');\n\n return true;\n }", "public function canRun(): bool\n\t{\n\t\tif (!file_exists(JPATH_LIBRARIES . '/Jdideal'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (class_exists('RSFormProHelper'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$helper = JPATH_ADMINISTRATOR\n\t\t\t. '/components/com_rsform/helpers/rsform.php';\n\n\t\tif (file_exists($helper))\n\t\t{\n\t\t\trequire_once $helper;\n\t\t\tRSFormProHelper::readConfig(true);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function validateSettings()\n {\n if (empty($this->validator)) {\n return true;\n }\n \n return $this->validator->validate($this, $this->context);\n }", "protected function needImport(): bool\n {\n $out = true;\n $this->structureCont = $this->structureApi->send();\n if ($structure = OpenDataStructure::find()->one()) {\n if ($structure->num_id == $this->structureCont->data['num_id']) {\n $out = false;\n }\n }\n return $out;\n }", "function Load()\n\t{\n\t\tif (!is_readable($this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->LoadSettings();\n\n\t\treturn true;\n\t}", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}", "protected function isCertificateImportAllowed() {\n\t\t$externalStorageEnabled = $this->appManager->isEnabledForUser('files_external');\n\t\tif ($externalStorageEnabled) {\n\t\t\t/** @var \\OCP\\Files\\External\\IStoragesBackendService $backendService */\n\t\t\t$backendService = \\OC::$server->query('StoragesBackendService');\n\t\t\tif ($backendService->isUserMountingAllowed()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private function canRun()\n {\n $confEnabled = $this->config()->get('cdn_rewrite');\n $devEnabled = ((!Director::isDev()) || ($this->config()->get('enable_in_dev')));\n return ($confEnabled && $devEnabled);\n }", "public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}", "function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}", "public function _checkConfig(){\n return true;\n if(count($this->moduleConfig) > 0) return true;\n return false;\n }", "public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }", "private function isEnabled()\n {\n if(is_file(JPATH_SITE.DS.'components'.DS.'com_magebridge'.DS.'models'.DS.'config.php')) {\n return true;\n }\n return false;\n }", "protected function checkSettings()\n {\n if (empty($this->settings)\n || empty($this->settings['column_1']) || empty($this->settings['column_2']) \n || empty($this->settings['compare_type']) || !isset($this->settings['configuration']))\n return false;\n \n return $this->checkCompareType();\n }", "protected function canLoad()\n\t{\n\t\t$v = version_compare($this->getVersion(),$this->getConfigValue('plugin_current_version')); \n\t\t//first, check if this instance is the latest one, or not\n\t\tif($v < 0) return false;\n\t\t\t \n\t\t//save the latest version, for later reference\n\t\tif($v > 0 )\n\t\t\t$this->setConfigValue('plugin_current_version',$this->getVersion());\n\t\t\t\n\t\treturn true;\n\t}", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function allow_load() {\n\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! current_user_can( 'install_languages' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\n\t\treturn wp_can_install_language_pack();\n\t}", "protected function isSetup(){\n \treturn isset($GLOBALS['setup']);\n }", "public function __construct($settings = [])\n {\n $this->settings = \\HC\\Core::parseOptions($settings, $this->settings);\n \n spl_autoload_register('\\HCMC\\Core::autoLoader');\n \n return true;\n }", "function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}", "public function checkImported($object) {\n if (!empty($this->source->data)) {\n if (in_array($object['Key'], $this->source->data)) {\n return true;\n }\n }\n return false;\n }", "function isSettings($type) {\n\tif (strlen($type) > 8) {\n\t\tif (substr($type, -8) === \"settings\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "protected function isEnabled() {\n\t\treturn (\n\t\t\t$this->getPageService()->isEnabled() &&\n\t\t\t(bool) $this->getTypoScriptService()->resolve('settings.enable')\n\t\t);\n\t}", "private function allowUploads(): bool\n {\n $allowUploads = isset($this->modVars['allowUploads']) && true === (bool) $this->modVars['allowUploads'];\n if (!$allowUploads) {\n return false;\n }\n if (!file_exists($this->avatarPath) || !is_readable($this->avatarPath) || !is_writable($this->avatarPath)) {\n return false;\n }\n\n return true;\n }", "protected function enabled() {\n\t\treturn class_exists( 'nProjects' );\n\t}", "public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}", "private static function _is_loadable()\n\t{\n\t\t$allowed_in_admin = apply_filters('bwp_minify_allowed_in_admin', false);\n\n\t\tif (is_admin() && !$allowed_in_admin)\n\t\t\treturn false;\n\n\t\tif (!did_action('template_redirect'))\n\t\t\treturn true;\n\n\t\t// ignore Geomashup\n\t\tif (!empty($_GET['geo_mashup_content'])\n\t\t\t&& 'render-map' == $_GET['geo_mashup_content'])\n\t\t\treturn false;\n\n\t\t// ignore AEC (Ajax Edit Comment)\n\t\tif (!empty($_GET['aec_page']))\n\t\t\treturn false;\n\n\t\t// ignore Simple:Press forum plugin\n\t\tif (defined('SPVERSION') && function_exists('sp_get_option'))\n\t\t{\n\t\t\t$sp_page = sp_get_option('sfpage');\n\t\t\tif (is_page($sp_page))\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// @since 1.3.1 ignore Maintenance plugin\n\t\tif (bwp_is_maintenance_on())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function _terminatur_settings_validate($settings_file) {\n // Check for the terminatur signature\n $settings = file_get_contents($settings_file);\n if (strpos($settings, TERMINATUR_VALIDATION_STRING) !== false) {\n // Settings have been touched by the terminatur before\n // But let's verify they still work\n $databases = array();\n $drupal_6 = FALSE;\n // Get Drupal 6 stuff\n if (strpos($settings, \"db_url\") !== false) {\n $drupal_6 = TRUE;\n $db_url = '';\n $db_prefix = '';\n }\n \n //Stub function to avoid error on validations.\n function drupal_fast_404(){} \n \n // Load settings file\n require $settings_file;\n // Parse drupal 6\n if ($drupal_6) {\n $databases = _terminatur_data_parse_db_url($db_url, $db_prefix);\n }\n // Return false if there are no DB settings to be found\n if (!isset($databases)) {\n return FALSE;\n }\n return _terminatur_data_test_db_connection($databases);\n }\n return FALSE;\n}", "public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }", "public function GetScriptSettings()\n {\n $PMTA = SERVERNAME;\n if(!$this->ForceSettings){\n $this->ParseSettings('presets');\n $this->ParseSettings($PMTA.'__presets');\n }\n return empty($this->Active)?false:true;\n }", "private function validateSettings(array $settings)\n {\n if (!isset($settings['AccountName'])) {\n throw new LocalizedException(__('Please provide a valid merchant id in settings.'));\n }\n if (!isset($settings['Password'])) {\n throw new LocalizedException(__('Please provide a valid password in settings.'));\n }\n return true;\n }", "function power_import_child_theme_settings() {\n\t$settings_saved = false;\n\t$config = power_get_config( 'child-theme-settings' );\n\n\tif ( ! $config ) {\n\t\treturn false;\n\t}\n\n\t// Validate all settings keys are strings.\n\t$all_keys = array_keys( $config );\n\t$string_keys = array_filter( $all_keys, 'is_string' );\n\tif ( count( $string_keys ) === 0 || count( $all_keys ) !== count( $string_keys ) ) {\n\t\treturn false;\n\t}\n\n\tforeach ( $config as $key => $value ) {\n\t\t$settings_saved = is_array( $value ) ? power_update_settings( $value, $key ) : update_option( $key, $value );\n\t}\n\n\treturn $settings_saved;\n}", "public function isEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n 'orderflow_inventory_import/settings/is_enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n }", "public function hasConfigLoader(): bool;", "protected static function load($segments) {\n $config = array();\n list($folder, $file, $setting) = $segments;\n\n // Check if 'folder' is registered.\n if (!isset(static::$paths[$folder])) return false;\n\n $paths = array(\n static::$paths[$folder],\n static::$paths[$folder].'/'.static::$mode\n );\n\n // Configuration files cascade. This permits 'mode' specific\n // settings to merge with generic settings.\n foreach ($paths as $path) {\n if (file_exists($path = \"$path/$file.php\")) {\n $config = array_merge($config, require $path);\n }\n }\n\n return empty($config) ? false :\n (bool) static::$items[$folder][$file] = $config;\n }", "private function isConfigured() : bool\n {\n if (!is_readable($this->settings['sp_key_file'])) {\n return false;\n }\n if (!is_readable($this->settings['sp_cert_file'])) {\n return false;\n }\n $key = file_get_contents($this->settings['sp_key_file']);\n if (!openssl_get_privatekey($key)) {\n return false;\n }\n $cert = file_get_contents($this->settings['sp_cert_file']);\n if (!openssl_get_publickey($cert)) {\n return false;\n }\n if (!SignatureUtils::certDNEquals($cert, $this->settings)) {\n return false;\n }\n return true;\n }", "public function CheckModule()\r\n\t{\r\n\t\tif($this->settings['API_KEY'] != $this->API_Key)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }", "public function plugin_is_configured() {\n\t\treturn isset( $this->settings->client_id, $this->settings->base_uri ) && $this->settings->client_id && $this->settings->base_uri;\n\t}", "private function tokenIsImport()\n {\n return $this->isFullToken()\n && in_array($this->getTokenObject(), [T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, T_REQUIRE_ONCE]);\n }", "function userSettingEnabled($setting)\n\t{\n\t\t$result = TRUE;\n\t\tif ($this->settings[\"usr_settings_disable_\".$setting] == 1)\n\t\t{\n\t\t\t$result = FALSE;\n\t\t}\n\t\treturn $result;\n\t}", "function wp_is_ini_value_changeable($setting)\n {\n }", "public function isUseful() {\n\t\tif(!$this->isApache()) return false;\n\t\t$f = '.htaccess';\n\t\t$paths = $this->wire('config')->paths;\n\t\t$assets = $paths->assets;\n\t\tif(!file_exists($assets . $f)) return true;\n\t\tif(!file_exists($assets . \"logs/$f\")) return true;\n\t\tif(!file_exists($assets . \"cache/$f\")) return true;\n\t\tif(!file_exists($assets . \"backups/$f\")) return true;\n\t\tif(!file_exists($paths->templates . $f)) return true;\n\t\tif(!file_exists($paths->site . $f)) return true;\n\t\tif(!file_exists($paths->site . \"modules/$f\")) return true;\n\t\treturn false;\n\t}", "function sanitised() {\n\t$sanitised = true;\n\n\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t// See if we are being asked to save the file\n\t\t$save_vars = get_input('db_install_vars');\n\t\t$result = \"\";\n\t\tif ($save_vars) {\n\t\t\t$rtn = db_check_settings($save_vars['CONFIG_DBUSER'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBPASS'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBNAME'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBHOST'] );\n\t\t\tif ($rtn == FALSE) {\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/dbsettings_error\"));\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\",\n\t\t\t\t\t\t\t\tarray(\t'settings.php' => $result,\n\t\t\t\t\t\t\t\t\t\t'sticky' => $save_vars)));\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$result = create_settings($save_vars, dirname(dirname(__FILE__)) . \"/settings.example.php\");\n\n\n\t\t\tif (file_put_contents(dirname(dirname(__FILE__)) . \"/settings.php\", $result)) {\n\t\t\t\t// blank result to stop it being displayed in textarea\n\t\t\t\t$result = \"\";\n\t\t\t}\n\t\t}\n\n\t\t// Recheck to see if the file is still missing\n\t\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\", array('settings.php' => $result)));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\tif (!file_exists(dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\tif (!@copy(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\", dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/htaccess\", array('.htaccess' => file_get_contents(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\"))));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\treturn $sanitised;\n}", "function configfile_readable() {\n\t\treturn is_readable(CLASSPATH . \"payment/\".__CLASS__.\".cfg.php\");\n\t}", "function has_setting($name)\n {\n }", "public function testCanLoadSettings()\n\t{\n\t\t$this->call('GET', '/account/settings');\n\n\t\t$this->assertResponseOk();\n\t}", "public function init_settings() {\n\t\tparent::init_settings();\n\t\t$this->enabled = ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'] ? 'yes' : 'no';\n\t}", "function settingsIsValid($key)\n {\n return app('Padosoft\\Laravel\\Settings\\SettingsManager')->isValid($key);\n }", "function baseSettings_exists($key)\n {\n return app('BaseSettings_exists')->exists($key);\n }", "public function check() {\n\t\t$values = array($this->value);\n\t\tif ($this->value == 'On') {\n\t\t\t$values[] = '1';\n\t\t}\n\t\telseif ($this->value == 'Off') {\n\t\t\t// TODO check it, empty is default value\n\t\t\t$values[] = '';\n\t\t\t$values[] = '0';\n\t\t}\n\t\tif (!in_array(ini_get($this->name), $values)) {\n\t\t\t$this->log('Setting '.$this->name.'='.ini_get($this->name).'. \"'.$this->value.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t$this->log('Setting '.$this->name.' is passed', Project::MSG_VERBOSE);\n\t\treturn 0;\n\t}", "private function is_safe_environment(): bool {\n\t\treturn in_array( $this->environment(), [ 'development', 'local' ], true );\n\t}", "function instance_allow_config() {\n return true;\n }", "public function has($key){\n return (array_key_exists($key,$this->settings));\n }", "public function instance_allow_config() {\n return true;\n }", "public function getSetting() : bool\n {\n return $this->setting;\n }", "function workWithUserSetting($setting)\n\t{\n\t\t$result = TRUE;\n\t\tif ($this->settings[\"usr_settings_hide_\".$setting] == 1)\n\t\t{\n\t\t\t$result = FALSE;\n\t\t}\n\t\tif ($this->settings[\"usr_settings_disable_\".$setting] == 1)\n\t\t{\n\t\t\t$result = FALSE;\n\t\t}\n\t\treturn $result;\n\t}", "public static function checkSettings() {\r\n \t\r\n \t$currentYear = date('Y');\r\n \tif(date('m') == 1){\r\n\t $record = Doctrine_Query::create ()\r\n\t ->from ( 'InvoicesSettings is' )\r\n\t ->where ( \"is.year = ?\", $currentYear )\r\n\t\t\t\t\t->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n\t ->limit ( 1 )\r\n\t ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t \r\n\t if(empty($record)){\r\n\t\t\t\t$is = new InvoicesSettings();\r\n\t\t\t\t$is['year'] = $currentYear;\r\n\t\t\t\t$is['next_number'] = 1;\r\n\t\t\t\t$is->save();\r\n\t }\r\n \treturn true;\r\n \t}\r\n \treturn false;\r\n }", "public function hasConfig($package);", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }", "private function isResourceValid()\n {\n if (strpos($this->resourceToImport, 'www.freebase.com') === false)\n return false;\n\n return true;\n }", "protected function preflightSugarFiles()\n {\n if (!is_readable(\"config.php\")) {\n return $this->error(\"Can not read config.php\", true);\n }\n if (!is_readable(\"include/entryPoint.php\")) {\n return $this->error(\"Can not read include/entryPoint.php\", true);\n }\n if (empty($this->config)) {\n return $this->error('Failed to read Sugar configs.', true);\n }\n return true;\n }", "public function requireInstallation() {\n return is_object($this->installer);\n }", "private function scan_allowed() {\n\t\treturn $this->as3cf->is_plugin_enabled();\n\t}", "public function checkSettings()\n\t{\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\treturn Configuration::get('STRIPE_PUBLIC_KEY_LIVE') != '' && Configuration::get('STRIPE_PRIVATE_KEY_LIVE') != '';\n\t\telse\n\t\t\treturn Configuration::get('STRIPE_PUBLIC_KEY_TEST') != '' && Configuration::get('STRIPE_PRIVATE_KEY_TEST') != '';\n\t}", "public function hasConfig();", "private function _loadConfig() {\n\t\t$this->_config = $this->_call('configuration', '');\n\n\t\treturn ! empty($this->_config);\n\t}", "public function validate($settings)\n {\n return $settings;\n }", "function checkInstallationStatus() {\n global $configFile, $_PATHCONFIG;\n\n $result = @include_once'..'.$configFile;\n if ($result === false) {\n return false;\n } else {\n return (defined('CONTREXX_INSTALLED') && CONTREXX_INSTALLED);\n }\n }", "public function isEnabled() {\n\t\treturn $this->_runtime['enabled'];\n\t}", "public function hasSetting( $name );", "private function load_from_wp() {\n\t\t\n\t\tif(function_exists('get_option')) { \n\t\t\t$savedSettings = (array)get_option('wpu-settings');\n\t\t\t$defaults = $this->get_defaults();\n\t\t\t$this->settings = array_merge($defaults, (array)$savedSettings);\n\t\t\t\n\t\t\t$this->wpPath = ABSPATH;\n\t\t\t$this->pluginPath = plugin_dir_path(__FILE__);\n\t\t\t$this->pluginUrl = plugins_url('wp-united') . '/';\n\t\t\t$this->wpHomeUrl = home_url('/');\n\t\t\t$this->wpBaseUrl = site_url('/');\n\t\t\t$this->wpDocRoot = wpu_get_doc_root();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}", "public function is_allowed() {\n\t\tif ( rocket_bypass() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( rocket_get_constant( 'DONOTROCKETOPTIMIZE' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( is_rocket_post_excluded_option( 'delay_js' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (bool) $this->options->get( 'delay_js', 0 );\n\t}", "private function upgrade_settings()\n {\n $currentModVars = $this->getVars();\n $defVars = $this->getDefaultVars();\n\n foreach ($defVars as $key => $defVar) {\n if (array_key_exists($key, $currentModVars)) {\n $type = gettype($defVar);\n switch ($type) {\n case 'boolean':\n if (in_array($currentModVars[$key], ['yes', 'no'])) {\n $var = 'yes' === $currentModVars[$key] ? true : false;\n } else {\n $var = ((bool) ($currentModVars[$key]));\n }\n\n break;\n default:\n $var = $defVar;\n\n break;\n }\n if ('defaultPoster' === $key) {\n $var = 2; // not bolean anymore assume admin id but maybe guest?\n }\n }\n $this->setVar($key, $var);\n }\n\n return true;\n }", "function erp_is_smtp_enabled() {\n $erp_email_smtp_settings = get_option( 'erp_settings_erp-email_smtp', [] );\n\n if ( isset( $erp_email_smtp_settings['enable_smtp'] ) && filter_var( $erp_email_smtp_settings['enable_smtp'], FILTER_VALIDATE_BOOLEAN ) ) {\n return true;\n }\n\n return false;\n}", "public static function uses_standard_settings() : bool {\n $classname = self::get_logger_classname();\n if (!class_exists($classname)) {\n return false;\n }\n\n if (is_a($classname, database_logger::class, true)) {\n return true;\n }\n\n return false;\n }", "protected function settingsValidate( $settings ) {\n\n\t\t\tif ( !isset( $_POST['initial_save'] ) || !$_POST['initial_save'] ) {\n\n\t\t\t\t$boolean_settings = apply_filters( 'muut_boolean_settings', array(\n\t\t\t\t\t'replace_comments',\n\t\t\t\t\t'use_threaded_commenting',\n\t\t\t\t\t'override_all_comments',\n\t\t\t\t\t'is_threaded_default',\n\t\t\t\t\t'show_online_default',\n\t\t\t\t\t'allow_uploads_default',\n\t\t\t\t\t'subscription_use_signed_setup',\n\t\t\t\t\t'use_custom_s3_bucket',\n\t\t\t\t\t'subscription_use_sso',\n\t\t\t\t\t'website_uses_caching',\n\t\t\t\t\t'enable_proxy_rewrites',\n\t\t\t\t\t'use_webhooks',\n\t\t\t\t) );\n\n\t\t\t\tforeach ( $boolean_settings as $boolean_setting ) {\n\t\t\t\t\t$settings[$boolean_setting] = isset( $settings[$boolean_setting] ) ? $settings[$boolean_setting] : '0';\n\t\t\t\t}\n\n\t\t\t\tif ( ( isset( $settings['forum_name'] ) && $settings['forum_name'] != muut()->getForumName() )\n\t\t\t\t\t|| ( isset( $settings['enable_proxy_rewrites'] ) && $settings['enable_proxy_rewrites'] != muut()->getOption( 'enable_proxy_rewrites' ) )\n\t\t\t\t\t|| ( isset( $settings['use_custom_s3_bucket'] ) && $settings['use_custom_s3_bucket'] != muut()->getOption( 'use_custom_s3_bucket' ) )\n\t\t\t\t\t|| ( isset( $settings['custom_s3_bucket_name'] ) && $settings['custom_s3_bucket_name'] != muut()->getOption( 'custom_s3_bucket_name' ) )\n\t\t\t\t\t|| ( isset( $settings['use_webhooks'] ) && $settings['use_webhooks'] != muut()->getOption( 'use_webhooks' ) )\n\t\t\t\t) {\n\t\t\t\t\tflush_rewrite_rules( true );\n\t\t\t\t\t$home_path = get_home_path();\n\t\t\t\t\t$htaccess_file = $home_path.'.htaccess';\n\n\t\t\t\t\tif ( ( !file_exists( $htaccess_file ) && !is_writable( $home_path ) ) || !is_writable( $htaccess_file ) ) {\n\t\t\t\t\t\tif ( get_option( 'permalink_structure', '') != '' ) {\n\t\t\t\t\t\t\t$error = array( 'field' => '', 'new_value' => '', 'name' => 'htaccess_permissions', 'message' => sprintf( __( 'It looks like the %sMuut Plugin%s doesn\\'t have permission to edit your .htaccess file. If you want to have content indexable under your website\\'s domain, you should head over to the bottom of your site\\'s %sPermalinks%s settings and copy the new code there to your .htaccess file.', 'muut' ), '<b>', '</b>', '<a href=\"' . admin_url( 'options-permalink.php' ) . '\">', '</a>' ) );\n\t\t\t\t\t\t\t$this->errorQueue[$error['name']] = $error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the Secret Key setting does not get submitted (i.e. is disabled), make sure to erase its value.\n\t\t\t\t$settings['subscription_secret_key'] = isset( $settings['subscription_secret_key'] ) ? $settings['subscription_secret_key'] : '';\n\t\t\t} else {\n\t\t\t\t$settings = apply_filters( 'muut_settings_initial_save', $settings );\n\t\t\t}\n\n\t\t\tforeach ( $settings as $name => &$value ) {\n\t\t\t\t$value = apply_filters( 'muut_validate_setting_' . $name, $value );\n\t\t\t\t$value = apply_filters( 'muut_validate_setting', $value, $name );\n\t\t\t}\n\n\t\t\treturn apply_filters( 'muut_settings_validated', $settings );\n\t\t}", "function wrmp_is_installed()\n{\n\treturn wrmp_get_settingsgroup();\n}", "static function is_m3project ($path) \n {\n $target = M3\\Path\\join($path,'config/settings.php');\n if (file_exists($target)) {\n // Ok. \n return true;\n }\n return false;\n }", "public static function installerEnabled()\n {\n /** @var \\Nwidart\\Modules\\Module $installer */\n $installer = Module::find('installer');\n if (!$installer) {\n return false;\n }\n\n return $installer->isEnabled();\n }" ]
[ "0.7262813", "0.68187976", "0.6600238", "0.6587092", "0.64160323", "0.63264275", "0.63264275", "0.63264275", "0.630294", "0.6283617", "0.6162057", "0.6121144", "0.6074711", "0.6063457", "0.60420066", "0.59918886", "0.59658635", "0.5959374", "0.5944522", "0.5933902", "0.592431", "0.59082305", "0.589619", "0.5886028", "0.5878182", "0.585344", "0.57986945", "0.5785237", "0.57785887", "0.5770049", "0.57690996", "0.5758082", "0.5736576", "0.5695046", "0.5676548", "0.5671076", "0.5670783", "0.5663383", "0.5663064", "0.5654037", "0.564552", "0.5623675", "0.561805", "0.56104845", "0.5596198", "0.55829954", "0.5565955", "0.5565002", "0.55450207", "0.553877", "0.553258", "0.55151856", "0.550253", "0.5500922", "0.54963833", "0.5478392", "0.5475929", "0.5475823", "0.5469468", "0.54643553", "0.5461605", "0.5455624", "0.5441074", "0.5438081", "0.5434716", "0.5425238", "0.5414204", "0.54110897", "0.54054826", "0.5402202", "0.5393669", "0.53854835", "0.5373631", "0.5361321", "0.5355638", "0.5351754", "0.53455913", "0.53443825", "0.53433436", "0.5340421", "0.5339101", "0.5338245", "0.5330231", "0.53300416", "0.53298897", "0.5318835", "0.5316704", "0.53151584", "0.5307155", "0.53054446", "0.5299766", "0.52770066", "0.5272847", "0.5269161", "0.5266877", "0.5265681", "0.52610326", "0.525987", "0.5253057", "0.52428675" ]
0.59136224
21
HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER HEADER Process table's header. I.e. the definition of the table
protected function process_header(import_settings $settings, $data) { $result = array(); $doc = $settings->get_dom(); $rows = $doc->getElementsByTagName('tr'); $head = $rows->item(0); $cols = $head->getElementsByTagName('th'); foreach ($cols as $col) { $name = $this->read($col, 'title'); $description = $this->read($col, 'description'); $type = $this->read($col, 'type'); $options = $this->read_list($col, 'options'); $f = array($this, 'process_header_' . $type); if (is_callable($f)) { $field = call_user_func($f, $settings, $data, $name, $description, $options); $result[] = $field; } else { $field = $this->process_header_default($settings, $type, $name, $description, $options); $result[] = $field; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Header()\r\n{\r\n if($this->ProcessingTable)\r\n $this->TableHeader();\r\n}", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "function drawHeader(){\n switch ($this->doing){\n case 'budget_byProjects':\n case 'myguests':\n if (!(@$this->t instanceof b_table)){\n\t$this->dbg('CANCEL header');\n\t$this->t = new b_table_dummy();\n }\n break;\n\n default:\n parent::drawHeader();\n break;\n }\n }", "private function buildHeader()\n\t{\n\t\tif ($this->hide_header)\n\t\t\treturn;\n\n\t\techo '<thead><tr>';\n\n\t\t// Get field names of result\n\t\t$headers = $this->_db->fieldNameArray($this->result);\n\t\t$this->column_count = count($headers);\n\n\t\t// Add a blank column if the row number is to be shown\n\t\tif ($this->show_row_number)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\t// Show checkboxes\n\t\tif ($this->show_checkboxes)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header tbl-checkall\"><input type=\"checkbox\" name=\"checkall\" onclick=\"tblToggleCheckAll'.$this->_clsnumber.'()\"></td>';\n\t\t}\n\n\t\t// Loop through each header and output it\n\t\tforeach ($headers as $t)\n\t\t{\n\t\t\t// Skip column if hidden\n\t\t\tif (in_array($t, $this->hidden))\n\t\t\t{\n\t\t\t\t$this->column_count--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for header caption overrides\n\t\t\tif (array_key_exists($t, $this->header))\n\t\t\t\t$header = $this->header[$t];\n\t\t\telse\n\t\t\t\t$header = $t;\n\n\t\t\tif ($this->hide_order)\n\t\t\t\techo '<td class=\"tbl-header\">' . $header; // Prevent the user from changing order\n\t\t\telse {\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\t$order = ($this->order['Order'] == self::ORDER_ASC)\n\t\t\t\t\t? self::ORDER_DESC\n\t\t\t\t\t: self::ORDER_ASC;\n\t\t\t\telse\n\t\t\t\t\t$order = self::ORDER_ASC;\n\n\t\t\t\techo '<td class=\"tbl-header\"><a href=\"javascript:;\" onclick=\"tblSetOrder'.$this->_clsnumber.'(\\'' . $t . '\\', \\'' . $order . '\\')\">' . $header . \"</a>\";\n\n\t\t\t\t// Show the user the order image if set\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\techo '&nbsp;<img src=\"images/sort_' . strtolower($this->order['Order']) . '.gif\" class=\"tbl-order\">';\n\t\t\t}\n\n\t\t\t// Add filters if allowed and only if the column type is not \"special\"\n\t\t\tif ($this->allow_filters and !empty($t)){\n\t\t\t\t\t\n\t\t\t\tif (!in_array($this->type[$t][0], array(\n\t\t\t\t\t\tself::TYPE_ARRAY,\n\t\t\t\t\t\tself::TYPE_IMAGE,\n\t\t\t\t\t\tself::TYPE_FUNCTION,\n\t\t\t\t\t\tself::TYPE_DATE,\n\t\t\t\t\t\tself::TYPE_CHECK,\n\t\t\t\t\t\tself::TYPE_CUSTOM,\n\t\t\t\t\t\tself::TYPE_PERCENT\n\t\t\t\t)))\n\t\t\t\t{\n\t\t\t\t\tif ($this->filter['Column'] == $t and !empty($this->filter['Value']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filter_display = 'block';\n\t\t\t\t\t\t$filter_value = $this->filter['Value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filter_display = 'none';\n\t\t\t\t\t\t$filter_value = '';\n\t\t\t\t\t}\n\t\t\t\t\techo '<a href=\"javascript:;\" onclick=\"tblShowHideFilter'. $this->_clsnumber .'(\\'' . $t . '\\')\"> filter </a>\n\t\t\t\t\t<br><div class=\"tbl-filter-box\" id=\"'.$this->_clsnumber.'filter-' . $t . '\" style=\"display:' . $filter_display . '\">\n\t\t\t\t\t<input type=\"text\" size=\"6\" id=\"'.$this->_clsnumber.'filter-value-' . $t . '\" value=\"'.$filter_value.'\">&nbsp;\n\t\t\t\t\t<a href=\"javascript:;\" onclick=\"tblSetFilter'.$this->_clsnumber.'(\\'' . $t . '\\')\">filter</a></div>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\techo '</td>';\n\t\t}\n\n\t\t// If we have controls, add a blank column\n\t\tif (count($this->controls) > 0)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\techo '</tr></thead>';\n\t}", "protected function getTableHeader() {\n $newDirection = ($this->sortDirection == 'asc') ? 'desc' : 'asc';\n\n $tableHeaderData = array(\n 'title' => array(\n 'link' => $this->getLink('title', ($this->sortField == 'title') ? $newDirection : $this->sortDirection),\n 'name' => 'Title',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'document_type' => array(\n 'link' => $this->getLink('type', $this->sortField == 'document_type' ? $newDirection : $this->sortDirection),\n 'name' => 'Type',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'date' => array(\n 'link' => $this->getLink('date', $this->sortField == 'date' ? $newDirection : $this->sortDirection),\n 'name' => 'Date',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n );\n\t\t\n // insert institution field in 3rd column, if this is search results\n if($this->uri == 'search') {\n $tableHeaderData = array_slice($tableHeaderData, 0, 2, true) +\n array('institution' => array(\n 'link' => $this->getLink('institution', $this->sortField == 'institution' ? $newDirection : $this->sortDirection),\n 'name' => 'Institution',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n )) +\n array_slice($tableHeaderData, 2, count($tableHeaderData)-2, true);\n }\n\t\t\n return $tableHeaderData;\n }", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "function tablethead_open() {\n $this->doc .= DOKU_TAB.'<thead>'.DOKU_LF;\n }", "public function getTableHeaders()\n {\n return ['#', 'Fatura','Ordem Servico'];\n }", "function Table_Headers($header,$w)\r\n{\r\n //Colors, line width and bold font\r\n $this->SetFillColor(153,153,153);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(128,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('Arial','B','7');\r\n\t\r\n //Header\r\n\t\r\n\t//Output table header\r\n for($i=0;$i<count($header);$i++)\r\n $this->Cell($w[$i],5,$header[$i],1,0,'C',1);\r\n $this->Ln();\r\n}", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<p class=left>Description:</p>\\n\";\n\t}", "function tableheader_close() {\n $this->doc .= '</th>';\n }", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "function constructTableHead() {\n\n $header = '<tr><th>Country</th>';\n if (isset($_GET['pop'])) {\n $header .= '<th>Total Population</th>';\n }\n if (isset($_GET['birth'])) {\n $header .= '<th>Birth Rate</th>';\n }\n if (isset($_GET['death'])) {\n $header .= '<th>Death Rate</th>';\n }\n\n $header .= '</tr>';\n return $header;\n }", "protected function getTableHeader() {\n /** @var \\Drupal\\webform\\WebformInterface $webform */\n $webform = $this->getEntity();\n $header = [];\n $header['title'] = $this->t('Title');\n\n $header['key'] = [\n 'data' => $this->t('Key'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['type'] = [\n 'data' => $this->t('Type'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['correct_answer'] = $this->t('Answer');\n $header['weight'] = $this->t('Weight');\n $header['operations'] = $this->t('Operations');\n// $header['answer'] = [\n// 'data' => $this->t('Answer'),\n// 'class' => [RESPONSIVE_PRIORITY_LOW],\n// ];\n//\n// $header['required'] = [\n// 'data' => $this->t('Required'),\n// 'class' => ['webform-ui-element-required', RESPONSIVE_PRIORITY_LOW],\n// ];\n// $header['parent'] = $this->t('Parent');\n// $header['operations'] = [\n// 'data' => $this->t('Operations'),\n// 'class' => ['webform-ui-element-operations'],\n// ];\n return $header;\n }", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function getTableHeader()\n {\n $tableHead = null;\n $tableHead .= \"<thead>\";\n $tableHead .= \"<tr>\";\n $tableHead .= \"<th>Vecka</th>\";\n $tableHead .= \"<th>Måndag</th>\";\n $tableHead .= \"<th>Tisdag</th>\";\n $tableHead .= \"<th>Onsdag</th>\";\n $tableHead .= \"<th>Torsdag</th>\";\n $tableHead .= \"<th>Fredag</th>\";\n $tableHead .= \"<th>Lördag</th>\";\n $tableHead .= \"<th>Söndag</th>\";\n $tableHead .= \"</tr>\";\n $tableHead .= \"</thead>\";\n\n return $tableHead;\n }", "function write_table_head()//scrie capul de tabel pentru perioadele de vacanta\r\n{\r\n\t$output = \"\";\r\n\tadd($output,'<table width=\"500px\" cellpadding=\"1\" cellspacing=\"1\" class=\"special\">');\r\n\tadd($output,'<tr class=\"tr_head\"><td>Nr</td><td>Data inceput</td><td>Data sfarsit</td></tr>');\r\n\t\r\n\treturn $output;\r\n}", "private function generate_columns_header($p_edit,&$p_resultat,&$p_result_header)\r\n\t\t{\r\n\t\t\t// Create a new line\r\n\t\t\t$html = '<tr id=\"tr_header_title_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Create the first column (checkbox and edit button)\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t$html .= '<td align=\"left\" id=\"header_th_0__'.$this->c_id.'\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"th0_'.$this->c_id.'\"></div></td>';\r\n\t\t\t$html .= '<td></td>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t// Quantify of order clause\r\n\t\t\t$qtt_order = $this->get_nbr_order();\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Display the resize cursor or not\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t{\r\n\t\t\t\t$cursor = ' cur_resize';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$cursor = '';\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] != false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// An order clause is defined\r\n\t\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] == __ASC__)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// ASC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-ascend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// DESC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-descend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Display the number of order only if there is more than one order clause\r\n\t\t\t\t\t\t($qtt_order > 1) ? $order_prio = $this->c_columns[$key_col]['order_priority'] : $order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// No order clause defined\r\n\t\t\t\t\t\t$class_order = '';\r\n\t\t\t\t\t\t$order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Order column\r\n\t\t\t\t\t$html .= '<td class=\"__'.$this->c_theme.'_bloc_empty'.$class_order.'\"><span class=\"__vimofy_txt_mini_ vimofy_txt_top\">'.$order_prio.'</span></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t$lib_redim = $this->hover_out_lib(17,17);\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"vimofy_move_column_start(event,'.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = '';\r\n\t\t\t\t\t\t$ondblclick = '';\r\n\t\t\t\t\t\t$lib_redim = '';\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"click_column_order(\\''.$this->c_id.'\\','.$key_col.');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*===================================================================*/\r\n\r\n\t\t\t\t\t// Column title\r\n\t\t\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_h nowrap\" id=\"header_th_'.$key_col.'__'.$this->c_id.'\"><div '.$event.' class=\"align_'.$this->c_columns[$key_col]['alignment'].' __'.$this->c_theme.'_column_title\" id=\"th'.$key_col.'_'.$this->c_id.'\"><span id=\"span_'.$key_col.'_'.$this->c_id.'\">'.$this->c_columns[$key_col]['name'].'</span></div></td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Display other column\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($p_edit != false) $html .= '<td style=\"padding:0;margin:0;\"></td>';\r\n\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t$html .= '<td id=\"right_mark_'.$key_col.'_'.$this->c_id.'\" '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\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$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Input for search on the column\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t// Create a new line\r\n\t\t\t$html .= '<tr id=\"tr_header_input_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t// Create the first column (checkbox and edit button)\r\n\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"thf0_'.$this->c_id.'\" class=\"__'.$this->c_theme.'__vimofy_version\" onclick=\"window.open(\\'vimofy_bugs\\');\">v'.$this->c_software_version.'</div></td>';\r\n\t\t\t\r\n\t\t\t// Id column display counter\r\n\t\t\t$id_col_display = 0;\r\n\t\t\t\r\n\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id_col_display == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.$key_col.'_'.$this->c_id.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.($key_col).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*if(isset($this->c_columns[$key_col]))\r\n\t\t\t\t\t{*/\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Define the filter value\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t$state_filter_input = '';\r\n\t\t\t\t\t\tif(isset($val_col['filter']['input']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// A filter was defined by the user\r\n\t\t\t\t\t\t\t$filter_input_value = $val_col['filter']['input']['filter'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// No filter was defined by the user\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Check if vimofy was in edit mode\r\n\t\t\t\t\t\t\tif($p_edit != false && !isset($val_col['rw_flag']) || ($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] != __FORBIDEN__))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// The vimofy was in edit mode, search all same value in the column\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\t\t\t\t\t\tif($this->c_obj_bdd->rds_num_rows($p_result_header) > 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_result_header,0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// TODO Use a DISTINCT QUERY - Vimofy 1.0\r\n\t\t\t\t\t\t\t\t$key_cold_line = 0;\r\n\t\t\t\t\t\t\t\t$last_value = '';\r\n\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile($row = $this->c_obj_bdd->rds_fetch_array($p_result_header))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif($key_cold_line > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($last_value == $row[$val_col['sql_as']])\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\t\t\t// The value is not the same of the previous, stop browsing data \r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$last_value = $row[$val_col['sql_as']];\r\n\t\t\t\t\t\t\t\t\t$key_cold_line = $key_cold_line + 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($flag_same)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = $last_value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] == __FORBIDEN__)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$state_filter_input = 'disabled';\t\t\t\t\t\t\t\t\t// Disable the input because the edition of column is forbiden\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(isset($val_col['filter']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_on __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($val_col['lov']) && isset($val_col['is_lovable']) && $val_col['is_lovable'] == true)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_lovable __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(isset($val_col['lov']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_no_icon __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Menu button oncontextmenu\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\tif($this->c_type_internal_vimofy == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Principal vimofy, diplay internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'vimofy_display_internal_vim(\\''.$this->c_id.'\\',__POSSIBLE_VALUES__,'.$key_col.');return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Internal vimofy, doesn't display other internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<td id=\"th_1_c'.$key_col.'_'.$this->c_id.'\" class=\"__vimofy_unselectable\" style=\"width:20px;\"><div style=\"width:20px;margin:0;\" '.$this->hover_out_lib(21,21).' oncontextmenu=\"'.$oncontextmenu.'\" class=\"'.$class_btn_menu.'\" onclick=\"vimofy_toggle_header_menu(\\''.$this->c_id.'\\','.$key_col.');\" id=\"th_menu_'.$key_col.'__'.$this->c_id.'\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_2_c'.$key_col.'_'.$this->c_id.'\" align=\"left\" class=\"__'.$this->c_theme.'__cell_h\">';\r\n\t\t\t\t\t\t$html .= '<div style=\"margin:0 3px;\"><input value=\"'.str_replace('\"','&quot;',$filter_input_value).'\" class=\"__'.$this->c_theme.'__input_h full_width\" '.$state_filter_input.' id=\"th_input_'.$key_col.'__'.$this->c_id.'\" type=\"text\" style=\"margin: 2px 0;\" size=1 onkeyup=\"if(document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\'))document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\').checked=true;vimofy_input_keydown(event,this,\\''.$this->c_id.'\\','.$key_col.');\" onchange=\"vimofy_col_input_change(\\''.$this->c_id.'\\','.$key_col.');\"/></div>';\r\n\t\t\t\t\t\tif($p_edit != false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif($state_filter_input == '')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:10px;padding:0;margin:0;\"><input '.$this->hover_out_lib(76,76).' type=\"checkbox\" id=\"chk_edit_c'.$key_col.'_'.$this->c_id.'\" style=\"height:11px;width:11px;margin: 0 5px 0 2px;display:block;\"/></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:0;padding:0;margin:0;\"></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_3_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_4_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$id_col_display = $id_col_display + 1;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t$html .= '<td id=\"th_0_c'.($key_col+1).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t$html.= '<td><div style=\"width:200px\"></div></td>';\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\r\n\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\tif($this->c_obj_bdd->rds_num_rows($p_resultat) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_resultat,0);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "public function createTable()\n {\n // Create out table\n // First line of the file.\n $fh = $this->getInputFileHandle();\n rewind($fh);\n $fl = fgets($fh);\n // Trim and htmlentities the first line of the file to make column names\n $cols = array_map('trim', array_map('htmlentities', str_getcsv($fl, $this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar'])));\n // array to hold definitions\n $defs = array();\n // if our table *doesn't* have headers, give generic names\n if (!$this->vars['hh']) {\n $oc = $cols;\n $c = count($cols);\n $cols = array();\n for ($i = 0; $i < $c; $i++) {\n $col = \" `Column_\" . $i . \"` \";\n $col .= is_numeric($oc[$i]) ? \"DECIMAL(12,6) DEFAULT NULL\" :\n \"VARCHAR(512) CHARACTER SET \" . $this->vars['characterSet'] . \" COLLATE \" . $this->vars['collation'] . \" DEFAULT NULL\";\n $cols[] = $col;\n }\n } else {\n // if our table *does* have headers\n $file = new SplFileObject($this->vars['ifn']);\n $headers = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n\n // number of columns to get for guessing types\n $n = min(10, $this->numLines());\n $firstNCols = array();\n for($i = 0; $i < $n; $i++){\n $firstNCols[$i] = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $sl = $firstNCols[0];\n if(count($sl) !== count($cols)){\n $baseurl = explode('?', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])[0];\n trigger_error(\"Number of columns inconsistent throughout file. For more information, see the error documentation.\");\n exit(1);\n }\n\n // guess the column types from the first n rows of info\n $colTypes = array_fill(0,count($cols),null);\n for($i = 0; $i < $n; $i++){\n foreach ($cols as $j => $col) {\n if(!isset($firstNCols[$i])){\n trigger_error('Why don\\'t we have row ' . $i . '??');\n }\n if(!isset($firstNCols[$i][$j])){\n if(count($firstNCols[$i]) !== count($cols)){\n trigger_error('Column count is inconsistent throughout the file. If you\\'re sure you have the right amount of columns, please check the delimiter options.');\n }\n trigger_error('Why don\\'t we have column ' . $j . '??');\n }\n $colTypes[$j] = $this->guessType(\n $firstNCols[$i][$j],\n $colTypes[$j]\n );\n }\n }\n\n foreach($colTypes as $i => &$type){\n $type = (is_null($type)) ? 'VARCHAR(512) CHARACTER SET ' . $this->vars['characterSet'] . ' COLLATE ' . $this->vars['collation'] . '' : $type;\n }\n\n /*echo \"<pre>\";\n print_r(array_combine($cols,$colTypes));\n echo \"</pre>\";\n exit();*/\n\n // We can pretty much only guess two data types from one row of information\n foreach ($cols as $i => &$col) {\n $cname = $col;\n $col = ' `' . $cname . '` ';\n $col .= $colTypes[$i];\n $col .= \" COMMENT '$cname'\";\n }\n }\n // Always have an id column!\n array_unshift($cols, ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT \\'id\\'');\n $SQL = \"CREATE TABLE IF NOT EXISTS `{$this->vars['db']['db']}`.`{$this->vars['db']['table']}` (\\n\";\n $SQL .= implode(\",\\n\", $cols);\n $SQL .= \"\\n) ENGINE=InnoDB DEFAULT CHARSET=\".$this->vars['characterSet'].\" CHARSET=\".$this->vars['characterSet'].\" COLLATE \".$this->vars['collation'].\";\";\n $this->executeSql($SQL);\n\n return $this;\n }", "public function renderTableHeader()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition === self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\t\tglobal $heading_name,$ORG_TITLE;\n\t\t\n\t\t$worksheet->set_column(0, 0, 5);\n\t\t$worksheet->set_column(1, 1, 40);\n\t\t$worksheet->set_column(2, 2, 27);\n\t\t$worksheet->set_column(3, 3, 25);\n\t\t$worksheet->set_column(4, 4, 12);\n\t\t$worksheet->set_column(5, 5, 5);\n\t\t$worksheet->set_column(6, 6, 4);\n\t\t$worksheet->set_column(7, 7, 4);\n\t\t$worksheet->set_column(8, 8, 4);\n\t\t$worksheet->set_column(9, 9, 4);\n\t\t$worksheet->set_column(10, 10, 4);\n\t\t$worksheet->set_column(11, 11, 4);\n\t\t$worksheet->set_column(12, 12, 18);\n\t\t$worksheet->set_column(13, 13, 25);\n\t\t$worksheet->set_column(14, 14, 5);\n\t\t$worksheet->set_column(15, 15, 8);\n\t\t$worksheet->set_column(16, 16, 28);\n\t\t$worksheet->set_column(17, 17, 15);\n\t\t$worksheet->set_column(18, 18, 20);\n\t\t$worksheet->set_column(19, 19, 12);\n\t\t$worksheet->set_column(20, 20, 8);\n\t\t$worksheet->set_column(21, 21, 12);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"(1)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"(2)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"(3)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"(4)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"(5)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"(6)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"(7)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"(8)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"(9)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"(10)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"(11)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"(12)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 17,\"(13)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"(14)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"(15)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"(16)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"(17)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อส่วนราชการ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"เลข\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\",0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"L\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"พื้นที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"วุฒิการศึกษา/\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"อัตรา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประจำตัว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"เพศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"เกิด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"บรรจุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"หมวด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"ชื่อตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"ชั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"ส่วนกลาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"ปฏิบัติงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"ประกาศนียบัตร\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"เงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"ปีที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\t\t$worksheet->write($xlsRow, 21, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 1, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"เขต/แขวง/ศูนย์\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"ประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 15, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 16, \"/ภูมิภาค\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 17, \"(จังหวัด)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 18, \"เฉพาะทาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 19, \"ปัจจุบัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 20, \"เกษียณ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "function\ttableHead() {\n\t\t//\n\t\t//\t\tfpdf_set_active_font( $this->myfpdf, $this->fontId, mmToPt(3), false, false );\n\t\t//\t\tfpdf_set_fill_color( $this->myfpdf, ul_color_from_rgb( 0.1, 0.1, 0.1 ) );\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t$frm->currVerPos\t+=\t3.5 ;\t\t// now add some additional room for readability\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTHeaderPS) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n//\t\t$this->frmContent->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t\tif ( $this->inTable) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTHeaderCF) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t\t}\n\t}", "function DisplayTableHeader()\n{\n\t$pdf = $GLOBALS['pdf'];\n\t$width_col_no = $GLOBALS['width_col_no'];\n\t$sync_name_index = $GLOBALS['sync_name_index'];\n\t$collectionWidth = $GLOBALS['collectionWidth'];\n\t$totalWidth = $GLOBALS['totalWidth'];\n\n\t//setkan font jadi bold untuk header\n\t$pdf->SetFont('helvetica','B',9);\n\n\t//koleksi tinggi column header\n\t$header_cols_height = array();\n\n\t//tinggi untuk column 'No'\n\t$header_cols_height[] = $pdf->getNumLines('No',$width_col_no);\n\n\t//dapatkan tinggi untuk setiap column\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$header_cols_height[] = $pdf->getNumLines($value,$width_converted);\n\t}\n\n\t//cari siapa paling tinggi\n\t$max_height = max($header_cols_height);\n\n\t//display\n\t$pdf->SetFillColor(211,211,211);\n\n\t$pdf->MultiCell($w=$width_col_no, $h=5*$max_height+3, $txt='No', $border=1, $align='L', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\tforeach ($sync_name_index as $key => $value)\n\t{\n\t\t$width_converted = GetAndConvertColumnWidth($value, $sync_name_index, $collectionWidth, $totalWidth, $pdf);\n\t\t$pdf->MultiCell($w=$width_converted, $h=5*$max_height+3, $txt=$value, $border=1, $align='C', $fill=1, $ln=0, $x='', $y='', $reseth=true, $stretch=0, $ishtml=true, $autopadding=true, $maxh=$h, $v='M');\n\t}\n\n\t//reset font\n\t$pdf->SetFont('helvetica','',9);\n\t$pdf->Ln();\n}", "function showHeader(){\n\t\t$header = \"\";\n\t\t// print the header row\n\t\t$header .= \"\t<tr>\\n\";\n\t\t// loop the fields\n\t\tforeach ($this->fields as $field) {\n\t\t\t// print each field\n\t\t\t$header .= \"\t\t<th>\".$field.\"</th>\\n\";\n\t\t}\n\t\t// end the header row\n\t\t$header .= \"\t</tr>\\n\";\n\t\treturn $header;\n\t}", "private function makeTableHeader($type,$header,$colspan=2): void {\r\n\t\tif(!$this->bInitialized) {\r\n\t\t\t$header = ' (' . $header . ') ';\r\n\t\t\t$this->bInitialized = true;\r\n\t\t}\r\n\t\t$str_i = ($this->bCollapsed) ? 'style=\"font-style:italic\" ' : '';\r\n\t\t\r\n\t\techo '<table class=\"dBug_table dBug_'.$type.'\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th '.$str_i.' class=\"dBug_clickable_table dBug_' . $type . 'Header\" colspan=\"' . $colspan . '\">' . $header . '</th>\r\n\t\t\t\t</tr>';\r\n\t}", "public function renderTableHeader() {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = $this->html()->tag('table-row', array('content' => implode('', $cells)), $this->headerRowOptions);\n\n if ($this->filterPosition == self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition == self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "public function pi_list_header() {}", "public function getTableHeaders()\n {\n return ['#', 'Autor', 'Título', 'Subtítulo', 'Preço', 'Categorias'];\n }", "function headers()\n {\n // Maintain URL params for pagination\n if (empty($this->params['pass'])) {\n $this->params['pass'] = array();\n }\n $options = array(\n 'url' => array_merge($this->tableOptions['url'], $this->params['named'], $this->params['pass']),\n //'model' => $this->defaultModel\n );\n if (!empty($this->tableOptions['ajax'])) {\n $options['update'] = $this->tableOptions['ajax']['mh-update'];\n $options['indicator'] = $this->tableOptions['ajax']['mh-indicator'];\n $options['before'] = $this->Js->get($options['indicator'])->effect('fadeIn', array('buffer' => false));\n $options['complete'] = $this->Js->get($options['indicator'])->effect('fadeOut', array('buffer' => false));\n }\n\n\n $this->Paginator->options($options);\n\n $lines = array();\n foreach ($this->Columns as $field => $Column) {\n $lines[] = $headerHTML[] = $Column->header();\n }\n\n $row = $this->Html->tag('tr', implode(chr(10), $lines));\n\n return $this->Html->tag('thead', $row);\n }", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\n\t\t$worksheet->set_column(0, 0, 10);\n\t\t$worksheet->set_column(1, 1, 25);\n\t\t$worksheet->set_column(2, 2, 30);\n\t\t$worksheet->set_column(3, 3, 20);\n\t\t$worksheet->set_column(4, 4, 30);\n\t\t$worksheet->set_column(5, 5, 15);\n\t\t$worksheet->set_column(6, 6, 20);\n\t\t$worksheet->set_column(7, 7, 30);\n\t\t$worksheet->set_column(8, 8, 30);\n\t\t$worksheet->set_column(9, 9, 20);\n\t\t$worksheet->set_column(10, 10, 10);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"สาขาวิชา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"ระดับการศึกษา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"สถานศึกษา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 5, \"ประเทศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 6, \"ตำแหน่ง/ระดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"สังกัด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ชื่อทุน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"ระยะเวลา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"จำนวนวัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t}", "public function getTableHeaders()\n {\n return ['ID', 'Ponto', 'Endereço', 'Cidade'];\n }", "protected function tableHead($header, $border) {\n $width = 15;\n $height = 12;\n \n foreach($header as $col) {\n $this->Cell($width, $height, $col, $border);\n }\n $this->Ln();\n }", "function wizardHeader() {\n $strOutput = '<table border=\"0\" cellpadding=\"2\" cellspacing=\"1\">';\n return $strOutput;\n }", "abstract public function openTableHead();", "private function setTableHeader($row){\n\t\t$header_data=false;\n\t\tif($this->header){\n\t\t\t$header_data=$this->header;\n\t\t}\n\t\telse{\n\t\t\tif(!empty($row) && is_array($row) && count($row)){\n\t\t\t\tforeach($row as $i => $v){\n\t\t\t\t\t$header_data[$i]=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($header_data)){\n\t\t\t$this->table_header.=_N_T.'<tr>';\n\t\t\t$this->table_header.=_N_T_T.'<th class=\"th.LineNum\">#</th>';\n\t\t\tforeach($header_data as $name => $value){\n\t\t\t\t$this->table_header.=_N_T_T.'<th nowrap=\"nowrap\">'.$value.$this->getOrderBy($name).'</th>';\n\t\t\t}\n\t\t\t$this->table_header.=_N_T.'</tr>';\n\t\t}\n\t\treturn $this;\n\t}", "function print_header(){\n\t\tglobal $worksheet, $xlsRow, $COM_LEVEL_SALP;\n\n\t\t$worksheet->set_column(0, 0, 6);\n\t\t$worksheet->set_column(1, 1, 20);\n\t\t$worksheet->set_column(2, 2, 25);\n\t\t$worksheet->set_column(3, 3, 50);\n\t\t$worksheet->set_column(4, 4, 15);\n\t\t$worksheet->set_column(5, 5, 15);\n\t\t$worksheet->set_column(6, 6, 15);\n\t\t$worksheet->set_column(7, 7, 15);\n\t\t$worksheet->set_column(8, 8, 35);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"เลขประจำตัวประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ชื่อ-นามสกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ตำแหน่ง/สังกัด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 5, \"อัตราเงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 6, \"เงินตอบแทน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"ที่เต็มขั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ร้อยละ 2 (บาท)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ร้อยละ 4 (บาท)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "public function format_for_header()\n {\n }", "public static function get_edit_table_headers() {\n\n $headerdata = array();\n $headerdata[] = get_string('sequence', 'mod_simplelesson');\n $headerdata[] = get_string('pagetitle', 'mod_simplelesson');\n $headerdata[] = get_string('prevpage', 'mod_simplelesson');\n $headerdata[] = get_string('nextpage', 'mod_simplelesson');\n $headerdata[] = get_string('hasquestion', 'mod_simplelesson');\n $headerdata[] = get_string('actions', 'mod_simplelesson');\n\n return $headerdata;\n }", "function table_begin($p_headrow, $p_class = '', $p_tr_attr = '', $p_th_attr = array()){\n\techo '<table class=\"table ' . $p_class . '\">';\n\techo '<thead>';\n\techo '<tr ' . $p_tr_attr . '>';\n\t\n\tfor($t_i=0; $t_i<count($p_headrow); $t_i++)\n\t\techo '<th ' . (isset($p_th_attr[$t_i]) ? $p_th_attr[$t_i] : '') . '>' . $p_headrow[$t_i] . '</th>';\n\n\techo '</tr>';\n\techo '</thead>';\n}", "function wv_commission_table_heading_list($type = \"thead\") {\n $output = \"\";\n\n //verify the header and footer of the table list\n $type = ($type == \"thead\") ? \"thead\" : \"tfoot\";\n\n $output .=\"<$type>\";\n $output .=\" <tr>\n <th>#OrderId</th>\n <th>Order Date</th>\n <th>ProductName</th>\n <th>Vendor</th>\n <th>Commission</th>\n <th>Status</th>\n <th>Commission Date</th>\n </tr>\";\n\n $output .=\"</$type>\";\n return $output;\n }", "function Header()\n\t{\n\t\t$this->SetFont('Arial','',12);\n\t\t$this->MultiCell(190,5,nombre_empresa(),'0','C');\n\t\t$this->SetFont('Arial','',10);\n\t\t$this->MultiCell(190,5,tipo_serv(),'0','C');\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->MultiCell(190,7,strtoupper(_('listado de clientes para cortes')),'0','C');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->SetX(133);\n\t\t$this->Cell(12,5,strtoupper(_('fecha')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"d/m/Y\"),0,0,'L');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Cell(12,5,strtoupper(_('hora')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"h:i:s A\"),0,0,'L');\n\t\t$this->Ln();\t\t\n\t}", "protected function makeHeader()\n {\n }", "function get_subscribersTableHeader(){\n $table_head = array();\n $table_head[0] = \"Id\";\n $table_head[1] = \"Email\";\n $table_head[2] = \"Date\";\n return $table_head;\n}", "abstract public function header();", "static public function writeHeader( $table )\n\t{\n\t\t$header = \"# Dump of table $table\\n\";\n\t\t$header .= \"# ---------------------------------------------------\\n\";\n\t\t\n\t\treturn $header;\n\t}", "abstract protected function getColumnsHeader(): array;", "static function generateTableHeaderHTML($a_div)\n\t{\n\t\techo \"<tr class='inTableRow'>\\n\";\n//\t\techo \"<th class='inTableColTaskID'>Task ID</th>\\n\";\n\t\techo \"<th class='inTableColTaskName'>{$a_div}</th>\\n\";\n\t\techo \"<th>Subcontractor</th>\\n\";\n\t\techo \"<th class='chTableColAmount'>Amount</th>\\n\";\n\t\techo \"<th>Notes</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function Header()\r\n\t{\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14);\r\n\t\t$this->Cell(170,7,\"Date :: \". $this->today_date ,1,0,'C');\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',14); \r\n\t\t$this->MultiCell(170,8,\"Room Things Report \\n\".$this->title,1,'C');\r\n\t\t$this->Ln(5);\r\n\r\n\t}", "function reOrderColumnHeaders() {\n\n }", "private function build_budget_preHeaders(&$header,$header_col0=''){\n $prev_was_space = False;\n foreach(array_keys($header) as $k){\n if (strpos($k,'space') === False){\n\t$prev_was_space = False;\n }else{\n\tif ($prev_was_space) unset($header[$k]);\n\t$prev_was_space = True;\n }\n }\n\n $n_Accommodation = count(preg_grep('/living/',array_keys($header)));\n $n_Other = count(preg_grep('/other/', array_keys($header)));\n $n_Total = count(preg_grep('/total_/',array_keys($header)));\n $n_Reimbursement = count(preg_grep('/scholarship/',array_keys($header)));\n $n_name = count(array_keys($header)) - $n_Accommodation - $n_Other - $n_Total - $n_Reimbursement - count(preg_grep('/space/',array_keys($header)));\n \n $pre_header = array(\"$n_name:$header_col0\");\n if (isset($header['space0'])) $pre_header[] = \"1:\";\n if ($n_Accommodation > 0) $pre_header[] = \"$n_Accommodation:Accommodation\";\n if (isset($header['space1'])) $pre_header[] = \"1:\";\n if ($n_Reimbursement > 0) $pre_header[] = \"$n_Reimbursement:Reimbursement\";\n if (isset($header['space2'])) $pre_header[] = \"1:\";\n if ($n_Other > 0) $pre_header[] = \"1:\";\n if (isset($header['space3'])) $pre_header[] = \"1:\";\n if ($n_Total > 0) $pre_header[] = \"$n_Total:<span class='bigger-text'>Total</span>\";\n\n return array($pre_header);\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "function tablethead_close() {\n $this->doc .= DOKU_TAB.'</thead>'.DOKU_LF;\n }", "protected function _writeHeader() {\n $this->stream->write(\n implode ($this->colDelim, array_values ($this->colName))\n );\n // Insert Newline\n $this->stream->write($this->lineDelim);\n $this->headerWritten= TRUE;\n }", "public static function getTableHeaders() {\r\n\t\t$array = self::getHeadersArray();\r\n\r\n\t\tif( $array == null ) {\r\n\t\t\t$headers = [];\r\n\t\t\treturn $headers;\r\n\t\t}\r\n\r\n\t\t$headers = self::getTableHeaderTitles( $array );\r\n\t\treturn $headers;\r\n\t}", "protected function renderTableHeader(): string\n {\n if (!$this->options['showHeader']) {\n return '';\n }\n\n return\n '<thead>' .\n '<tr>' .\n '<th>' . $this->_('differences') . '</th>' .\n '</tr>' .\n '</thead>';\n }", "public function docHeaderContent() {}", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "function render_table_header_footer($orderBy, $order) {\n?>\n\t\t<tr>\n<?php\n\t\t\t$this->render_th('title', 'Title', $orderBy, $order); \n\t\t\t$this->render_th('date', 'Date', $orderBy, $order); \n\t\t\t$this->render_th('facilitators', 'Facilitators', $orderBy, $order); \n\t\t\t$this->render_th('categories', 'Categories', $orderBy, $order); \n?>\n\t\t</tr>\n<?php\n\t}", "function rallies_table_row_header($hdrs)\r\n{\r\n global $MYKEYWORDS;\r\n\r\n\t$OK = ($_SESSION['ACCESSLEVEL'] >= $GLOBALS['ACCESSLEVEL_READONLY']);\r\n\r\n\t$res = '';\r\n\t$hdrcols = explode(';',$hdrs);\r\n\tforeach ($hdrcols as $col)\r\n\t\t$res .= \"<th>\".$col.\"</th>\";\r\n\r\n return $res;\r\n}", "function tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null) {\n $class = 'class=\"col'.$this->_counter['cell_counter']++;\n if(!is_null($align)) {\n $class .= ' '.$align.'align';\n }\n if($classes !== null) {\n if(is_array($classes)) $classes = join(' ', $classes);\n $class .= ' ' . $classes;\n }\n $class .= '\"';\n $this->doc .= '<th '.$class;\n if($colspan > 1) {\n $this->_counter['cell_counter'] += $colspan - 1;\n $this->doc .= ' colspan=\"'.$colspan.'\"';\n }\n if($rowspan > 1) {\n $this->doc .= ' rowspan=\"'.$rowspan.'\"';\n }\n $this->doc .= '>';\n }", "abstract protected function getRowsHeader(): array;", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "public function header()\n\t{\n\t\treturn array(\t'Translation ID (Do not change)',\n\t\t\t\t\t\t'Translation Group (Do not change)',\n\t\t\t\t\t\t'Original Text (Do not change)',\n\t\t\t\t\t\t'Translated Text (Change only this column to new translated text)');\n\t}", "public function setHeader($var)\n {\n GPBUtil::checkEnum($var, \\Eolymp\\Typewriter\\Block_Table_Header::class);\n $this->header = $var;\n\n return $this;\n }", "public function buildHeaderFields() {}", "public function table_headers() {\n\t\t\tglobal $mycred_types;\n\n\t\t\treturn apply_filters( 'mycred_log_column_headers', array(\n\t\t\t\t'column-username' => __( 'User', 'twodayssss' ),\n\t\t\t\t'column-time' => __( 'Date', 'twodayssss' ),\n\t\t\t\t'column-creds' => $this->core->plural(),\n\t\t\t\t'column-entry' => __( 'Entry', 'twodayssss' )\n\t\t\t), $this );\n\t\t}", "function outputHeader()\n {\n global $application;\n\n $output = '';\n if (!is_array($this -> _attrs))\n return $output;\n\n // output error column\n if (is_array($this -> _Errors) && !empty($this -> _Errors))\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-error.tpl.html',\n array()\n );\n\n foreach($this -> _attrs as $k => $v)\n {\n if ($v != 'YES')\n continue;\n\n $template_contents = array(\n 'HeaderName' => getMsg('SYS', @$this -> _headermap[$k])\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'header-cell.tpl.html',\n array()\n );\n }\n\n return $output;\n }", "protected function _drawHeader(Zend_Pdf_Page $page) {\n\t\t/* Add table head */\n\t\t//draw heading background\n\t\t$this -> _setFontLight($page, 10);\n\t\t$page -> setFillColor(new Zend_Pdf_Color_Html('#' . $this -> params['mainColor']));\n\t\t$page -> drawRectangle(18, $this -> y, $page->getWidth() - 18, $this -> y - 30, $fillType = Zend_Pdf_Page::SHAPE_DRAW_FILL);\n\t\t$page -> setFillColor(new Zend_Pdf_Color_Html('#' . $this -> params['inverseColor']));\n\t\t\n\t\t$this -> y -= 18;\n\t\t\t\n\t\t$font = $this->_setFontLight($page, 10);\n\t\t//ouput column labels\n\t\t$page->drawText(Mage::helper('sales') -> __('Images'), 35, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('Products'), 145, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('SKU'), 285, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('Price'), 354, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('Qty'), 416, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('Tax'), 469, $this->y, 'UTF-8');\n\t\t$page->drawText(Mage::helper('sales') -> __('Subtotal'), $this->getAlignRight(Mage::helper('sales') -> __('Subtotal'), $page->getWidth() - 60 - 28, 60, $font, 10, 0), $this->y, 'UTF-8');\n\n\t\t$page -> setFillColor(new Zend_Pdf_Color_GrayScale(0));\n\t\t$this -> y -= 12;\n\t}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function Header(){\n $ci =& get_instance();\n // Select Arial bold 15\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',16);\n // Move to the right\n //$this->Cell(80);\n // Framed title\n // Logo\n $this->Image(asset_url() . \"images/logo.png\",11,5,0,20);\n $this->Ln(15);\n $this->Cell(0,10,\"GetYourGames\",0,1,'L');\n $this->SetFont('Futura-Medium','',12);\n $this->Cell(0,10,site_url(),0,1,\"L\");\n $this->Ln(5);\n $this->SetFont('Futura-Medium','',18);\n $this->Cell(0,10,utf8_decode($this->title),0,1,'C');\n // Line break\n $this->Ln(10);\n $this->SetFont('Futura-Medium','',11);\n $this->Cell(15,10,utf8_decode('#'),'B',0,'C');\n $this->Cell(100,10,utf8_decode($ci->lang->line('table_product')),'B',0,'L');\n $this->Cell(30,10,utf8_decode($ci->lang->line('table_qty')),'B',0,'L');\n $this->Cell(40,10,utf8_decode($ci->lang->line('table_subtotal')),'B',1,'L');\n\n $this->Ln(2);\n }", "function display_header() {}", "function prepareDefaultHeader()\n {\n $this->formatBuffer .= \"p.normalText, li.normalText, div.normalText{\\n\";\n $this->formatBuffer .= \" mso-style-parent: \\\"\\\";\\n\";\n $this->formatBuffer .= \" margin: 0cm;\\n\";\n $this->formatBuffer .= \" margin-bottom: 6pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \" mso-fareast-font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.normalTable{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela com grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext {$this->tableBorderAlt}pt;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\";\n $this->formatBuffer .= \"table.normalTable td{\\n\";\n $this->formatBuffer .= \" border: solid windowtext 1.0pt;\\n\";\n $this->formatBuffer .= \" border-left: none;\\n\";\n $this->formatBuffer .= \" mso-border-left-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" mso-border-alt: solid windowtext .5pt;\\n\";\n $this->formatBuffer .= \" padding: 0cm 5.4pt 0cm 5.4pt;\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n $this->formatBuffer .= \"table.tableWithoutGrid{\\n\";\n $this->formatBuffer .= \" mso-style-name: \\\"Tabela sem grade\\\";\\n\";\n $this->formatBuffer .= \" mso-tstyle-rowband-size: 0;\\n\";\n $this->formatBuffer .= \" mso-tstyle-colband-size: 0;\\n\";\n $this->formatBuffer .= \" border-collapse: collapse;\\n\";\n $this->formatBuffer .= \" border: none;\\n\";\n $this->formatBuffer .= \" mso-border-alt: none;\\n\";\n $this->formatBuffer .= \" mso-yfti-tbllook: 480;\\n\";\n $this->formatBuffer .= \" mso-padding-alt: 0cm {$this->tablePaddingAltRight}pt 0cm {$this->tablePaddingAltLeft}pt;\\n\";\n $this->formatBuffer .= \" mso-border-insideh: {$this->tableBorderInsideH}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-border-insidev: {$this->tableBorderInsideV}pt solid windowtext;\\n\";\n $this->formatBuffer .= \" mso-para-margin: 0cm;\\n\";\n $this->formatBuffer .= \" mso-para-margin-bottom: .0001pt;\\n\";\n $this->formatBuffer .= \" mso-pagination: widow-orphan;\\n\";\n $this->formatBuffer .= \" font-size: {$this->fontSize}pt;\\n\";\n $this->formatBuffer .= \" font-family: \\\"{$this->fontFamily}\\\";\\n\";\n $this->formatBuffer .= \"}\\n\\n\";\n \n if ($this->cssFile != '') {\n if (file_exists($this->cssFile))\n $this->formatBuffer .= file_get_contents($this->cssFile);\n }\n }", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "function showTableHeader($phaseName) {\n?>\n\t<table>\n\t\t<colgroup>\n\t\t\t<col width='4%'>\n\t\t\t<col width='10%'>\n\t\t\t<col width='15%'>\n\t\t\t<col width='5%'>\n\t\t\t<col width='23%'>\n\t\t\t<col width='10%'>\n\t\t\t<col width='23%'>\n\t\t\t<!--<col width='10%'>\n\t\t\t<col width='*'>-->\n\t\t</colgroup>\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>#</th>\n\t\t\t\t<th>Datum/Zeit</th>\n\t\t\t\t<th>Ort</th>\n\t\t\t\t<?php echo ($phaseName == 'Gruppenphase') ? \"<th>Grp</th>\" : \"<th></th>\" ?>\n\t\t\t\t<th colspan='3'>Resultat</th>\n\t\t\t\t<!--<th>Tipp</th>\n\t\t\t\t<th>Pkt</th>-->\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n<?php\n}", "public function getFullHeader()\n {\n }", "public function setHeader() {\n $dt = date('j M, Y');\n $name_header = '';\n $ao = new Application_Model_DbTable_AuditOwner();\n if ($this->usertype != '') {\n $name_header = \"&nbsp {$this->userfullname}\";\n }\n $complete_user = array('ADMIN','USER','APPROVER');\n $complete_audit = '';\n $audit_id = $this->audit['audit_id'];\n logit(\"audit: \" . print_r($this->audit, true));\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> With Selected Audit:</span></li>\nEND;\n\n # incomplete and owned audit OR not incomplete audit can be viewed\n if (($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) || $this->audit['status'] != 'INCOMPLETE') {\n $complete_audit .= <<<\"END\"\n<!li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/view\"><span title=\".icon .icon-color .icon-book \" class=\"icon icon-color icon-book\"></span> View Audit</a></li>\nEND;\n }\n # only incomplete and owned audit can be edited\n if ($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/edit/\"><span title=\".icon .icon-color .icon-edit \" class=\"icon icon-color icon-edit\"></span> Edit Audit</a></li>\nEND;\n }\n if (in_array($this->usertype, $complete_user)) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/exportdata\"><span title=\".icon .icon-color .icon-extlink \" class=\"icon icon-color icon-extlink\"></span> Export Audit Data</a></li>\nEND;\n if ($this->audit['owner']) {\n # $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/delete\"\n onclick=\" return confirm('Do you want to delete Selected Audit?');\">\n <span title=\".icon .icon-color .icon-trash \" class=\"icon icon-color icon-trash\"></span>\n Delete Audit</a></li>\nEND;\n }\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> Change Audit State:</span></li>\nEND;\n if ($this->audit['status'] == 'INCOMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/complete\">\n<span title=\".icon .icon-color .icon-locked \" class=\"icon icon-color icon-locked\"></span> Mark Audit Complete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/incomplete\">\n<span title=\".icon .icon-color .icon-unlocked \" class=\"icon icon-color icon-unlocked\"></span> Mark Audit Incomplete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $this->usertype == 'APPROVER') {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/finalize\"\nonclick=\" return confirm('Do you want to finalize Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-sent \" class=\"icon icon-color icon-sent\"></span> Mark Audit Finalized</a></li>\n<li><a href=\"{$this->baseurl}/audit/reject\"\n onclick=\" return confirm('Do you want to reject Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-cross \" class=\"icon icon-color icon-cross\"></span> Mark Audit Rejected</a></li>\nEND;\n }\n }\n $this->header = <<<\"END\"\n<div class=\"navbar\">\n <div class=\"navbar-inner\">\n <div class=\"container-fluid\">\n <a class=\"brand\" href=\"{$this->baseurl}{$this->mainpage}\">\n <span title=\".icon .icon-black .icon-check \" class=\"icon icon-black icon-check\"></span> <span>eChecklist</span>\n </a>\nEND;\n $newuser = '';\n if ($this->usertype != '') {\n if ($this->usertype == 'ADMIN') {\n $newuser = <<<\"END\"\n<li><a href=\"{$this->baseurl}/user/create\">\n<span title=\".icon .icon-green .icon-user \" class=\"icon icon-green icon-user\"></span> New User</a></li>\nEND;\n }\n\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-clipboard \" class=\"icon icon-blue icon-clipboard\"></span>\n <span class=\"hidden-phone\">Audit</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\nEND;\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/create\"><span title=\".icon .icon-green .icon-clipboard \" class=\"icon icon-green icon-clipboard\"></span> New Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/search\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Search for Audit</a></li>\n{$complete_audit}\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/runreports\"><span title=\".icon .icon-color .icon-newwin \" class=\"icon icon-color icon-newwin\"></span> Run Reports</a></li>\nEND;\n\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/import\"><span title=\".icon .icon-blue .icon-import \" class=\"icon icon-blue icon-archive\"></span> Import Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-tag \" class=\"icon icon-blue icon-tag\"></span>\n <span class=\"hidden-phone\">Lab</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/lab/create\"><span title=\".icon .icon-green .icon-tag \" class=\"icon icon-green icon-tag\"></span> New Lab</a></li>\n <li><a href=\"{$this->baseurl}/lab/select\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Select a Lab</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/lab/edit\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Edit Selected Lab</a></li>\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-user \" class=\"icon icon-blue icon-user\"></span>\n<span class=\"hidden-phone\">User</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n {$newuser}\n <li><a href=\"{$this->baseurl}/user/find\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span>Find User</a></li>\n</ul>\n</div>\n\n<!--div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-flag \" class=\"icon icon-blue icon-flag\"></span>\n<span class=\"hidden-phone\">Language</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/language/switch/EN\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> English</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/FR\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> French</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/VI\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> Vietnamese</a></li>\n</ul>\n</div-->\n\n<!-- user dropdown starts -->\n<div class=\"btn-group pull-right\">\n <a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-orange .icon-user \" class=\"icon icon-orange icon-user\"></span>\n <span class=\"hidden-phone\"> {$name_header}</span>\n\t<span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/user/profile\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Profile</a></li>\n <li><a href=\"{$this->baseurl}/user/changepw\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Change Password</a></li>\n <li class=\"divider\"></li>\n\t<li><a href=\"{$this->baseurl}/user/logout\">Logout</a></li>\n </ul>\n</div>\n<!-- user dropdown ends -->\nEND;\n $auditinfo = '';\n //if ($this->dialog_name == 'audit/edit') {\n $auditinfo = \"<div style=\\\"margin:6px 0 6px 20px;padding-right:5px;\\\">Selected Audit: {$this->showaudit}</div>\";\n //}\n $this->header .= <<<\"END\"\n<div style=\"display:inline-block;\">\n <div style=\"margin:6px 0px 6px 20px;padding-right:5px;\">Selected Lab: {$this->showlab}</div>\n {$auditinfo}\n <div style=\"clear:both;\"></div></div>\nEND;\n } else {\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn\" href=\"{$this->baseurl}/user/login\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Login</a></div>\nEND;\n }\n $this->header = $this->header . <<<\"END\"\n </div>\n </div> <!-- style=\"clear:both;\"></div -->\n</div>\nEND;\n\n $this->view->header = $this->header;\n }", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "function Header() {\n if(empty($this->title) || $this->PageNo() == 1) return;\n $oldColor = $this->TextColor;\n $this->SetTextColor(PDF_HEADER_COLOR['red'],\n PDF_HEADER_COLOR['green'],\n PDF_HEADER_COLOR['blue']);\n $x = $this->GetX();\n $y = $this->GetY();\n $this->SetY(10, false);\n $this->SetFont('', 'B');\n $this->Cell(0, 10, $this->title);\n $this->SetFont('', '');\n $this->SetXY($x, $y);\n $this->TextColor = $oldColor;\n }", "public function export_headers()\n {\n }", "function get_userTableHeader(){\n $table_head = array();\n $table_head[0] = \"Id\";\n $table_head[1] = \"Username\";\n $table_head[2] = \"Password\";\n $table_head[3] = \"Email\";\n $table_head[4] = \"Group\";\n return $table_head;\n}", "public function printTableHeader($open)\n {\n\n print \"<tr>\\n\";\n print \"<th>&nbsp;\";\n print \" Admin Email\";\n print \"&nbsp;</th>\";\n print \"<th>&nbsp;\";\n print \" Level\";\n print \"&nbsp;</th>\";\n if (!$open)\n print \"</tr>\\n\";\n }", "function headerTable($conn)\n\t{\n\t\t$query = $conn->query(\"SELECT * FROM `tbl_transaction` NATURAL JOIN `tbl_guest` WHERE `transaction_id` LIKE $_REQUEST[transaction_id] \") or die(mysql_error());\n\t\t$fetch = $query->fetch_array();\n\n\t\t$this->SetFont(\"Times\",\"I\",9);\n\t\t$this->Cell(18,7,\"RefNo. \",0,0);\n\t\t$this->Cell(35,7,\": hr-\".$fetch['transaction_id'],0,0);\n\t\t$this->SetFont(\"Arial\",\"\",9);\n\t\t$this->Cell(26,7,\"Reservation Date \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['reserve_date'],0,1);\n\t\t$this->Cell(18,7,\"Guest \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['name'].' '.$fetch['surname'],0,0);\n\t\t$this->Cell(26,7,\"Email Address \",0,0);\n\t\t$this->Cell(35,7,\": \".$fetch['email_id'],0,1);\n\t\t$this->Cell(188,4,\"\",0,1);\n\t\t$this->Ln(4);\n\n\t\t//Reservation Details Title\n\t\t$this->SetFont(\"Arial\",\"U\",12);\n\t\t$this->Cell(35,10,\"Reservation Details\",0,1);\n\t\t//header\n\t\t$this->SetFont('Times','B',12);\n\t\t$this->Cell(41,10,'Room Type',1,0,'C');\n\t\t$this->Cell(22,10,'Room No.',1,0,'C');\n\t\t$this->Cell(25,10,'Check in',1,0,'C');\n\t\t$this->Cell(13,10,'Days',1,0,'C');\n\t\t$this->Cell(25,10,'Check out',1,0,'C');\n\t\t$this->Cell(22,10,'Extra bed',1,0,'C');\n\t\t$this->Cell(42,10,'Bill',1,1,'C');\n\t\t//$this->Cell(18,10,'Payment',1,1,'C');\n\t\t//$this->Ln();\n\t}", "function header (){\n\t\t$this->setfont('Arial','B', 16);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'WANANCHI', 0, 0, 'C');\n\t\t$this->Ln(10);\n\t\t$this->setfont('Arial','',12);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'INFORMATION',0, 0, 'C');\n\t\t$this->Ln(30);\n\t}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "function create_devs_header()\n{\n$header =\n \"<thead>\n \t<tr>\n \t<th scope='col' class='rounded-company'>GPU #</th>\n <th scope='col' class='rounded-q1'>En</th>\n <th scope='col' class='rounded-q1'>Status</th>\n <th scope='col' class='rounded-q1'>Temp</th>\n <th scope='col' class='rounded-q1'>Fan Speed</th>\n <th scope='col' class='rounded-q1'>GPU Clk</th>\n <th scope='col' class='rounded-q1'>Mem Clk</th>\n <th scope='col' class='rounded-q1'>Volt</th>\n <th scope='col' class='rounded-q1'>Active</th>\n <th scope='col' class='rounded-q1'>MH/s 5s</th>\n <th scope='col' class='rounded-q1'>MH/s avg</th>\n <th scope='col' class='rounded-q1'>Acc</th>\n <th scope='col' class='rounded-q1'>Rej</th>\n <th scope='col' class='rounded-q1'>H/W Err</th>\n <th scope='col' class='rounded-q1'>Util</th>\n <th scope='col' class='rounded-q1'>Intens</th>\n </tr>\n </thead>\";\n \n return $header;\n}", "public function getHeaderData() {}", "public function setColumnsHeadData()\n\t{\n\t\tFileStorage::getInstance()->store([], 'league_table_columns_head');\n\t}", "function create_pool_header()\n{\n $header =\n \"<thead>\n <tr>\n <th scope='col' class='rounded-company'>Pool</th>\n <th scope='col' class='rounded-q1'>Priority</th>\n <th scope='col' class='rounded-q1' colspan='2'>URL</th>\n <th scope='col' class='rounded-q1'>Gets</th>\n <th scope='col' class='rounded-q1'>Accepts</th>\n <th scope='col' class='rounded-q1'>Rejects</th>\n <th scope='col' class='rounded-q1'>Discards</th>\n <th scope='col' class='rounded-q1'>Stales</th>\n <th scope='col' class='rounded-q1'>Get Fails</th>\n <th scope='col' class='rounded-q1'>Rem fails</th>\n </tr>\n </thead>\";\n\n return $header;\n}", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "public function get_header()\n\t{\n\t\t$header\t\t=\t$this->lang->get_line( \"controller_title\", $this->table );\n\t\tif ( !$header )\n\t\t{\n\t\t\t$header\t\t=\t( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t$controller\t=\t$this->singlepack->get_controller( $header );\n\t\t\tif ( !$controller )\n\t\t\t{\n\t\t\t\treturn ucfirst( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $controller->nome; // str_replace( '_', ' ', $header );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $header;\n\t\t}\n\t}", "function print_column_headers($screen, $with_id = \\true)\n {\n }", "public function tableHeaderRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($cols as $k){\n $out .= '<td>'.$k.'</td>';\n }\n return('<tr>'.$out.'</tr>');\n }", "protected function _drawHeader(\\Zend_Pdf_Page $page)\n {\n /* Add table head */\n $this->_setFontRegular($page, 10);\n $page->setFillColor(new \\Zend_Pdf_Color_GrayScale(1));\n\n $page->setLineColor(new \\Zend_Pdf_Color_GrayScale(0));\n $page->setLineWidth(0.5);\n $page->drawRectangle(25, $this->y, 570, $this->y - 15);\n $this->y -= 10;\n\n if ($this->_config->create()->getSetting('order_product/enable_discount'))\n $this->_priceFeed = 430;\n else\n $this->_priceFeed = 480;\n\n //columns headers\n $lines[0][] = ['text' => __('Qty'), 'feed' => 45, 'align' => 'right'];\n if($this->_config->create()->getSetting('general/pack_quantity')){\n $this->_skuFeed = 120;\n $lines[0][] = ['text' => __('Pack qty'), 'feed' => 70, 'align' => 'left'];\n }\n $lines[0][] = ['text' => __('SKU'), 'feed' => $this->_skuFeed, 'align' => 'left'];\n $lines[0][] = ['text' => __('Product'), 'feed' => 200, 'align' => 'left'];\n\n $lines[0][] = ['text' => __('Price'), 'feed' => $this->_priceFeed, 'align' => 'right'];\n if ($this->_config->create()->getSetting('order_product/enable_discount'))\n $lines[0][] = ['text' => __('Discount'), 'feed' => 490, 'align' => 'right'];\n\n $lines[0][] = ['text' => __('Total'), 'feed' => 550, 'align' => 'right'];\n\n $lineBlock = ['lines' => $lines, 'height' => 5];\n\n $page->setFillColor(new \\Zend_Pdf_Color_GrayScale(0));\n $this->drawLineBlocks($page, [$lineBlock], ['table_header' => true]);\n $page->setFillColor(new \\Zend_Pdf_Color_GrayScale(0));\n $this->y -= 20;\n }", "function Header() {\r\n // print the title\r\n $this->SetTitleFont();\r\n $this->Cell(100, 8, $this->title, 0, 0, \"L\");\r\n\r\n // print the author\r\n $this->SetAuthorFont();\r\n $this->Cell(0, 8, $this->author, 0, 0, \"R\");\r\n\r\n // header line\r\n $this->SetFillColor(0, 0, 0);\r\n $this->Rect(10, 17, 190, 0.2, \"F\");\r\n $this->Rect(10, 17.5, 190, 0.2, \"F\");\r\n $this->Ln(14);\r\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "public function printHeaders() {\n\t}" ]
[ "0.7683809", "0.7044155", "0.70072466", "0.69909793", "0.6925226", "0.6909512", "0.6841694", "0.6835884", "0.6806515", "0.67844623", "0.67467356", "0.6738118", "0.67264885", "0.67211795", "0.6707319", "0.6689692", "0.6682735", "0.6682308", "0.66798395", "0.66143167", "0.6585634", "0.65795803", "0.6558251", "0.6541143", "0.65308785", "0.653075", "0.6522473", "0.64719635", "0.64670485", "0.6466457", "0.64422894", "0.64280313", "0.64250964", "0.6419237", "0.6399139", "0.63892466", "0.6380365", "0.63634336", "0.6348121", "0.63394046", "0.6334623", "0.6323723", "0.6301949", "0.6300626", "0.62887764", "0.6285891", "0.6285857", "0.6283644", "0.62796474", "0.62774473", "0.6273537", "0.6272866", "0.626465", "0.62642175", "0.6257422", "0.6242497", "0.62375855", "0.6232931", "0.62306863", "0.6229799", "0.62147254", "0.6193419", "0.6188614", "0.6186809", "0.6185691", "0.61790913", "0.6178105", "0.6178068", "0.6175716", "0.616795", "0.6166592", "0.6159174", "0.61585945", "0.61569625", "0.6149104", "0.61459833", "0.6140208", "0.61391664", "0.61318856", "0.6129261", "0.6124675", "0.6113992", "0.61108655", "0.610957", "0.6106774", "0.61048645", "0.610231", "0.60955733", "0.6094814", "0.6079316", "0.6056518", "0.6056037", "0.6041482", "0.6039805", "0.6036541", "0.60364", "0.60355526", "0.60355526", "0.60355526", "0.60355526", "0.60329473" ]
0.0
-1
Default procedure for importing a header i.e. a field's declaration.
protected function process_header_default(import_settings $settings, $data, $type, $name, $description, $options) { global $DB; $result = new object(); $result->dataid = $data->id; $result->type = $type; $result->name = $name; $result->description = $description; $result->param1 = is_array($options) ? implode("\n", $options) : $options; $result->param2 = null; $result->param3 = null; $result->param4 = null; $result->param5 = null; $result->param6 = null; $result->param7 = null; $result->param8 = null; $result->param9 = null; $result->param10 = null; $result->id = $DB->insert_record('data_fields', $result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "public function extObjHeader() {}", "function privReadFileHeader(&$p_header)\n {\n }", "public function getInputHeaders()\n {\n }", "abstract public function header();", "public function buildHeaderFields() {}", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "protected function makeHeader()\n {\n }", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "public function docHeaderContent() {}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "abstract protected function header();", "public function export_headers()\n {\n }", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "protected function dumpHeader() {}", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "public function getHeaderData() {}", "function Header(){\n\t\t}", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "#[Pure]\n public function getHeader($header) {}", "public function import(): void;", "public function pi_list_header() {}", "protected function _parseHeader() {}", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "public function add_header() {\n }", "public function prepareImport();", "function display_header() {}", "public function import()\n {\n \n }", "public function Header(){\n\n }", "public function import();", "function prepare_field_for_import($field)\n {\n }", "public function addHeader()\n {\n }", "public function format_for_header()\n {\n }", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "public function header() {\n\t}", "public function getFullHeader()\n {\n }", "public function getHeader();", "public function getHeader();", "public function getHeader();", "protected function process_header_file(import_settings $settings, $data, $name, $description, $options) {\r\n global $CFG, $COURSE;\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n $result->param2 = max($CFG->maxbytes, $COURSE->maxbytes);\r\n\r\n global $DB;\r\n $DB->update_record('data_fields', $result);\r\n return $result;\r\n }", "public function getHeader() {\n }", "public function extObjHeader()\n {\n if (is_callable([$this->extObj, 'head'])) {\n $this->extObj->head();\n }\n }", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('columnheaders', $this->data->_data[1]);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "function loadHeaders() {\n\n\t\t$id = \"original_id\";\n\t\t$title = \"title\";\n\t\t\n\t\treturn $id . $_POST[$id] . \"&\" . $title . $_POST[$title];\n\n\t}", "function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "private function headerRead(): void\n {\n if (false === $this->getStrategy()->hasHeader() || true === $this->headerRead) {\n return;\n }\n\n $this->rewind();\n $this->skipLeadingLines();\n $this->header = $this->normalizeHeader($this->convertRowToUtf8($this->current()));\n $this->headerRead = true;\n $this->next();\n }", "public function prepareImportContent();", "protected function _writeFileHeader() {}", "protected function process_header_number(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }", "public function header()\n {\n }", "public function setHasHeader(bool $hasHeader): CsvImport\n {\n $this->hasHeader = $hasHeader;\n return $this;\n }", "public function prePageHeader();", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "function get_custom_header()\n {\n }", "function media_upload_header()\n {\n }", "function\tsetupHeaderMid( $_frm) {\n\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT', FTr::tr( \"Inventory\", null, $this->lang)), $this->defParaFmt) ;\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT',\n\t\t\t\t\t\t\t\t\tFTr::tr( \"Inventory no. #1, Key date #2\",\n\t\t\t\t\t\t\t\t\t\t\tarray( \"%s:\".$this->myInv->InvNo, \"%s:\".$this->myInv->KeyDate),\n\t\t\t\t\t\t\t\t\t\t\t$this->lang)),\n\t\t\t\t\t\t\t\t\t$this->defParaFmt) ;\n\t\t\n\t\t/**\n\t\t * draw the separating line between the header and the document content\n\t\t */\n\t\t$this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0),\n\t\t\t\t\t$_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ;\n\t}", "function fpg_headers($name, $params) {\n\tif ($params['has_getter']) {\n\t\tfpg_printf('PHP_FUNCTION(fann_get_%s);', $name);\n\t}\n\tif ($params['has_setter']) {\n\t\tfpg_printf('PHP_FUNCTION(fann_set_%s);', $name);\n\t}\n}", "protected function header()\n {\n\n }", "function\tsetupHeaderMid( $_frm) {\n\n\t\t$_frm->addLine( \"Kommissionierung\", $this->defParaFmt) ;\n\t\t$_frm->addLine( sprintf( \"Kommission Nr. %s, %s\", $this->myCustomerCommission->CustomerCommissionNo, $this->myCustomerCommission->Datum), $this->defParaFmt) ;\n\n\t\t/**\n\t\t * draw the separating line between the header and the document content\n\t\t */\n\t\t$this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0),\n\t\t\t\t\t\t\t\t$_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ;\n\t}", "protected function process_header_text(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $autolink = true);\r\n return $result;\r\n }", "public function setHeader( FileHeader $record ) {\n\t\t$this->header = $record;\n\t}", "function header() {\n }", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "function Header()\r\n{\r\n if($this->ProcessingTable)\r\n $this->TableHeader();\r\n}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "function privConvertHeader2FileInfo($p_header, &$p_info)\n {\n }", "protected function addHeaderRowToCSV() {}", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function getFieldHeader($fN)\t{\r\n\t\tswitch($fN) {\r\n\t\t\tcase \"title\":\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_title','<em>title</em>');\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function setHeader(PoHeader $header) {\n }", "function header() {\n\t\techo '<div class=\"wrap\">';\n\t\tscreen_icon();\n\t\techo '<h2>化工产品目录CSV导入</h2>';\n\t}", "public function parse($filename, $headerRow = true);", "function privWriteFileHeader(&$p_header)\n {\n }", "public function getHeaderPrototype()\n\t{\n\t\treturn $this->header;\n\t}", "protected function process_header_multimenu(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "function get_header($name = \\null, $args = array())\n {\n }", "protected function process_header(import_settings $settings, $data) {\r\n $result = array();\r\n $doc = $settings->get_dom();\r\n $rows = $doc->getElementsByTagName('tr');\r\n $head = $rows->item(0);\r\n $cols = $head->getElementsByTagName('th');\r\n foreach ($cols as $col) {\r\n $name = $this->read($col, 'title');\r\n $description = $this->read($col, 'description');\r\n $type = $this->read($col, 'type');\r\n $options = $this->read_list($col, 'options');\r\n $f = array($this, 'process_header_' . $type);\r\n if (is_callable($f)) {\r\n $field = call_user_func($f, $settings, $data, $name, $description, $options);\r\n $result[] = $field;\r\n } else {\r\n $field = $this->process_header_default($settings, $type, $name, $description, $options);\r\n $result[] = $field;\r\n }\r\n }\r\n return $result;\r\n }", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function privReadCentralFileHeader(&$p_header)\n {\n }", "function Header() {\n\t\tif (is_null($this->_tplIdx)) {\n\t\t\t$this->setSourceFile('gst3.pdf');\n\t\t\t$this->_tplIdx = $this->importPage(1);\n\t\t}\n\t\t$this->useTemplate($this->_tplIdx);\n\n\t\t$this->SetFont('freesans', 'B', 9);\n\t\t$this->SetTextColor(255);\n\t\t$this->SetXY(60.5, 24.8);\n\t\t$this->Cell(0, 8.6, \"TCPDF and FPDI\");\n\t}" ]
[ "0.64634645", "0.6364893", "0.6315047", "0.6170176", "0.6155428", "0.615142", "0.6057942", "0.60374886", "0.6011982", "0.5999342", "0.5976518", "0.5964499", "0.58784896", "0.5814454", "0.5814023", "0.5795496", "0.5786105", "0.5771543", "0.57566875", "0.57527673", "0.575083", "0.5734216", "0.5728442", "0.57259715", "0.5715665", "0.5711396", "0.5707597", "0.56936854", "0.56842613", "0.56764823", "0.56626284", "0.56590056", "0.5637742", "0.56354445", "0.563412", "0.5629541", "0.562355", "0.5612707", "0.55985403", "0.5574595", "0.55509037", "0.55509037", "0.55509037", "0.5544985", "0.55442274", "0.55424345", "0.55342215", "0.55319935", "0.5517893", "0.55077726", "0.5504842", "0.54988945", "0.5473368", "0.5470792", "0.5465015", "0.54635155", "0.5460296", "0.5459056", "0.5458858", "0.54541403", "0.54447687", "0.5442656", "0.54401445", "0.54347295", "0.54174834", "0.541429", "0.54088813", "0.54043937", "0.5379597", "0.5378709", "0.5378206", "0.5373148", "0.53695416", "0.53624094", "0.53571105", "0.53545284", "0.53516334", "0.5338561", "0.53279173", "0.5326901", "0.5319982", "0.53166336", "0.5316412", "0.5313813", "0.53110826", "0.53053063", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296637", "0.5296441", "0.5292211" ]
0.59568495
12
Imports a checkbox header i.e. a field's declaration.
protected function process_header_checkbox(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t?>\n\t<div class=\"wpinc-meta-field-single checkbox\">\n\t\t<label>\n\t\t\t<span class=\"checkbox\"><input <?php name_id( $key ); ?> type=\"checkbox\" <?php echo esc_attr( $checked ? 'checked' : '' ); ?>></span>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t</label>\n\t</div>\n\t<?php\n}", "function pgm_list_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Lists'), //update header name to 'List Name'\n 'shortcode'=>__('Shortcode'),\n );\n\n return $columns;\n}", "function surgeon_add_checkbox_heading_fields($post, $addon, $loop) {\n echo '<th class=\"checkbox_column\"><span class=\"column-title\">Image</span></th>';\n}", "function pgm_subscriber_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Subscriber Name'), //update header name to 'Subscriber Name'\n 'email'=>__('Email Address'), //create new header for email\n );\n\n return $columns;\n}", "public static function convert_single_checkbox_field() {\n\n\t\t// Create a new Checkbox field.\n\t\tself::$field = new GF_Field_Checkbox();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array(\n\t\t\tarray(\n\t\t\t\t'text' => self::$nf_field['label'],\n\t\t\t\t'value' => '',\n\t\t\t\t'isSelected' => 'unchecked' === self::$nf_field['default_value'] ? '0' : '1',\n\t\t\t),\n\t\t);\n\n\t}", "function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }", "function add_header_columns($columns) \n {\n $columns = array(\n \"cb\" => \"<input type=\\\"checkbox\\\" />\",\n \"shortcode\" => __('Shortcode'),\n \"title\" => __('Title'),\n \"quote\" => __('Quote', $this->localization_domain),\n \"author\" => __('Author'),\n \"date\" => __('Publish Date'),\n );\n return $columns;\n }", "function products_column_headers( $columns ) {\r\n\r\n // Creating the custom column header data\r\n $columns = array(\r\n 'cb' => '<input type=\"checkbox\" />',\r\n 'title' => __('Product Name'),\r\n 'Background Color' => __('Background Color')\r\n );\r\n\r\n // Returning the new columns\r\n return $columns;\r\n\r\n}", "function gen_webguileftcolumnhyper_field(&$section, $value) {\n\n\t$section->addInput(new Form_Checkbox(\n\t\t'webguileftcolumnhyper',\n\t\t'Left Column Labels',\n\t\t'Active',\n\t\t$value\n\t))->setHelp('If selected, clicking a label in the left column will select/toggle the first item of the group.');\n}", "public static function convert_checkbox_field() {\n\n\t\t// Create a new Checkbox field.\n\t\tself::$field = new GF_Field_Checkbox();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array();\n\n\t\t// Loop through field options.\n\t\tforeach ( self::$nf_field['list']['options'] as $i => $option ) {\n\n\t\t\t// Get checkbox ID.\n\t\t\t$id = $i + 1;\n\n\t\t\t// Skip multiple of 10 on checkbox ID.\n\t\t\tif ( 0 === $id % 10 ) {\n\t\t\t\t$id++;\n\t\t\t}\n\n\t\t\t// Add option choices.\n\t\t\tself::$field->choices[] = array(\n\t\t\t\t'text' => $option['label'],\n\t\t\t\t'value' => $option['value'],\n\t\t\t\t'isSelected' => $option['selected'],\n\t\t\t);\n\n\t\t\t// Add option input.\n\t\t\tself::$field->inputs[] = array(\n\t\t\t\t'id' => self::$field->id . '.' . $id,\n\t\t\t\t'label' => $option['label'],\n\t\t\t);\n\n\t\t}\n\n\t}", "function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\t\t\\wpinc\\meta\\output_checkbox_row( $label, $key, $checked );\n\t}", "function setTypeAsCheckbox($labeltext = false)\n\t{\n\t\t$this->type = \"checkbox\";\n\t\t$this->checkbox_label = $labeltext;\n\t\t\n\t\t// Formfield doesn't work if a checkbox\n\t\t$this->isformfield = false;\n\t}", "function checkbox_init(){\n add_meta_box(\"closing\", \"Closed ?\", \"closing\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"delayed\", \"Delayed / Message ?\", \"delayed\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"message_delayed\", \"Message:\", \"message_delayed\", \"closings\", \"normal\", \"high\");\n}", "function add_checkbox_hidden_field( $fields, $section ) {\n $fields['general'][] = [\n 'default' => 'save_email_enable_or_disable',\n 'type' => 'hidden',\n 'id' => 'save_email_enable_or_disable',\n\n ];\n return $fields;\n}", "function acf_get_checkbox_input($attrs = array())\n{\n}", "private function display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }", "function render_field_checkbox($field)\n {\n }", "public function AddCheckboxToCheckoutPage()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'checkout_checked');\n\t\t?>\n\t\t<p class=\"form-row form-row-wide\">\n\t\t\t<input class=\"input-checkbox GR_checkoutbox\" value=\"1\" id=\"gr_checkout_checkbox\" type=\"checkbox\"\n\t\t\t name=\"gr_checkout_checkbox\" <?php if ($checked)\n\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t<label for=\"gr_checkout_checkbox\" class=\"checkbox\">\n\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'checkout_label'); ?>\n\t\t\t</label>\n\t\t</p>\n\t\t<?php\n\t}", "function makeCheckbox( $value, $column )\n{\n\treturn $value ? _( 'Yes' ) : _( 'No' );\n}", "public function getHeaderFields()\n {\n $headerFields = array();\n\n foreach ($this->getFieldsData() as $fieldId => $row) {\n\n // Show single checkbox label as field label\n if ($row['label'] == $row['name']\n && $row['type'] == 'checkbox'\n && $row['options'] != ''\n ) {\n $options = deserialize($row['options'], true);\n\n if (count($options) == 1) {\n $headerFields[$fieldId] = $options[0]['label'];\n continue;\n }\n }\n\n $headerFields[$fieldId] = $row['label'];\n }\n\n return $headerFields;\n }", "public static function renderCheckbox();", "public function AddCheckboxToComment()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'comment_checked');\n\t\t?>\n\t\t<p>\n\t\t\t<input class=\"GR_checkbox\" value=\"1\" id=\"gr_comment_checkbox\" type=\"checkbox\" name=\"gr_comment_checkbox\"\n\t\t\t\t <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?>/>\n\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'comment_label'); ?>\n\t\t</p><br/>\n\t\t<?php\n\t}", "function acf_checkbox_input($attrs = array())\n{\n}", "public function setHasHeader(bool $hasHeader): CsvImport\n {\n $this->hasHeader = $hasHeader;\n return $this;\n }", "function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}", "function checkbox( \n\t $name, $title, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_CHECKBOX,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "public function AddCheckboxToBpRegistrationPage()\n\t{\n\t\t$bp_checked = get_option($this->GrOptionDbPrefix . 'bp_registration_checked');\n\t\t?>\n\t\t<div class=\"gr_bp_register_checkbox\">\n\t\t\t<label>\n\t\t\t\t<input class=\"input-checkbox GR_bpbox\" value=\"1\" id=\"gr_bp_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_bp_checkbox\" <?php if ($bp_checked)\n\t\t\t\t{ ?> checked=\"checked\"<?php } ?> />\n\t\t\t\t<span\n\t\t\t\t\tclass=\"gr_bp_register_label\"><?php echo get_option($this->GrOptionDbPrefix . 'bp_registration_label'); ?></span>\n\t\t\t</label>\n\t\t</div>\n\t\t<?php\n\t}", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('columnheaders', $this->data->_data[1]);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "function initialize () {\n $this->set_openingtag ( \"<INPUT TYPE=\\\"checkbox\\\" value=\\\"\" );\n\t$this->set_closingtag ( \"\\\"[attributes]>\" );\n\t$this->set_type (\"checkbox\");\n }", "function option_checkbox($label, $name, $value='', $comment='') {\r\n\t\tif ($value)\r\n\t\t\t$checked = \"checked='checked'\";\r\n\t\telse\r\n\t\t\t$checked = \"\";\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td><input type='hidden' id='$name' name='$name' value='0' /><input type='checkbox' name='$name' value='1' $checked />\";\r\n\t\techo \" $comment</td></tr>\";\r\n\t}", "private function checkboxCustomField(): string\n {\n return Template::build($this->getTemplatePath('checkbox.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'checked' => $this->getValue($this->index) ? 'checked' : '',\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "function checkbox ($arguments = \"\") {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tcheckbox');\n return $rc->newInstanceArgs( $arguments ); \n}", "function GetCheckBoxField($title, $value)\r\n\t{\r\n\t\t$AddStr = \"\";\r\n\t\tif($value==\"1\")\r\n\t\t{\r\n\t\t\t$AddStr = \"checked\";\r\n\t\t}\r\n\t\treturn \"<input name=\\\"$title\\\" type=\\\"checkbox\\\" $AddStr value=\\\"1\\\" size=\\\"40\\\">\";\r\n\t}", "function setTypeAsCheckboxList($itemList) {\n\t\t$this->type = \"checkboxlist\";\n\t\t$this->seleu_itemlist = $itemList;\n\t}", "function format_checkbox($p_id, $p_name, $p_checked = false, $p_class = 'input-xs', $p_style = '', $p_prop = ''){\n\treturn \t'<input type=\"checkbox\" id=\"' . $p_id . '\" name=\"' . $p_name . '\" class=\"ace ' . $p_class . '\" style=\"' . $p_style . '\" ' . $p_prop . ' ' . ($p_checked ? ' checked' : '') . '/>';\n}", "function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }", "function checkbox( $element )\n\t\t{\t\n\t\t\t$checked = \"\";\n\t\t\tif( $element['std'] != \"\" ) { $checked = 'checked = \"checked\"'; }\n\t\t\t\t\n\t\t\t$output = '<input '.$checked.' type=\"checkbox\" class=\"'.$element['class'].'\" ';\n\t\t\t$output .= 'value=\"'.$element['id'].'\" id=\"'.$element['id'].'\" name=\"'.$element['id'].'\"/>';\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "protected function getForm_Type_CheckboxService()\n {\n @trigger_error('The \"form.type.checkbox\" service is deprecated since Symfony 3.1 and will be removed in 4.0.', E_USER_DEPRECATED);\n\n return $this->services['form.type.checkbox'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType();\n }", "function _field_checkbox($fval) \n {\n return sprintf(\"<input type=\\\"checkbox\\\" name=\\\"%s\\\" id=\\\"%s\\\" %s class=\\\"%s\\\" %s %s />\",\n $this->fname,\n $this->fname,\n ($this->opts)? 'value=\"' . $this->opts . '\"' : '',\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n (!empty($fval) && $fval != '0000-00-00')? \"checked\" : \"\",\n $this->extra_attribs);\n }", "function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);\n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "public static function getType() {\n\t\treturn \"Checkbox\";\n\t}", "public function AddCheckboxToRegistrationForm()\n\t{\n\t\tif ( ! is_user_logged_in())\n\t\t{\n\t\t\t$checked = get_option($this->GrOptionDbPrefix . 'registration_checked');\n\t\t\t?>\n\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t<input class=\"input-checkbox GR_registrationbox\" value=\"1\" id=\"gr_registration_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_registration_checkbox\" <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t\t<label for=\"gr_registration_checkbox\" class=\"checkbox\">\n\t\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'registration_label'); ?>\n\t\t\t\t</label>\n\t\t\t</p><br/>\n\t\t\t<?php\n\t\t}\n\t}", "function testGuessCheckbox() {\n\t\t$result = $this->helper->__guessInputType('Test.is_foo');\n\t\t$this->assertEqual($result, 'checkbox');\n\t}", "static public function checkbox($name,$opts=[]) {\n $f3 = Base::instance();\n if ($f3->exists('POST.'.$name) && $f3->get('POST.'.$name)) {\n $opts[] = 'checked';\n }\n if (!isset($opts['value'])) $opts['value'] = 1;\n if (!isset($opts['type'])) $opts['type'] = 'checkbox';\n return self::input($name,$opts);\n }", "static public function createCheckboxRadio($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/radiocheckbox.php\";\n }", "protected function add_header_button( $add_param = '' ) {\n\n\t\t\tif ( 'off' === $this->allow_insert ) {\n\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( WPDA::is_wpda_table( $this->table_name ) ||\n\t\t\t\t ( 'on' === WPDA::get_option( WPDA::OPTION_BE_ALLOW_INSERT ) &&\n\t\t\t\t count( $this->wpda_list_columns->get_table_primary_key() ) ) > 0\n\t\t\t\t) {\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<form\n\t\t\t\t\t\t\tmethod=\"post\"\n\t\t\t\t\t\t\taction=\"?page=<?php echo esc_attr( $this->page ); ?><?php echo '' === $this->schema_name ? '' : '&schema_name=' . esc_attr( $this->schema_name ); ?>&table_name=<?php echo esc_attr( $this->table_name ); ?><?php echo esc_attr( $add_param ); ?>\"\n\t\t\t\t\t\t\tstyle=\"display: inline-block; vertical-align: baseline;\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"new\">\n\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php echo __( 'Add New', 'wp-data-access' ); ?>\"\n\t\t\t\t\t\t\t\t class=\"page-title-action\">\n\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t// Add import button to title.\n\t\t\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\n\t\t\t\t\t<?php\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Add import button to title.\n\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function buildHeaderFields() {}", "public function checkbox ( \\r8\\Form\\Checkbox $field )\n {\n $this->addField( \"checkbox\", $field );\n }", "function slb_subscriber_column_headers($columns) {\n\n\t// creating custom column header data\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'title' => __('Subscriber Name'),\n\t\t'email' => __('Email Address'),\n\t);\n\n\t// returning new columns\n\treturn $columns;\n}", "function theme_simple_features_checkbox_element($variables) {\n $element = $variables['element'];\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n\n // Add element's #type and #name as class to aid with JS/CSS selectors.\n $class = array('form-item');\n if (!empty($element['#type'])) {\n $class[] = 'form-type-' . strtr($element['#type'], '_', '-');\n }\n if (!empty($element['#name'])) {\n $class[] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));\n }\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n\n $output = '<div class=\"' . implode(' ', $class) . '\">' . \"\\n\";\n\n $output .= ' <div class=\"features-checkbox\">';\n $output .= ' ' . $element['#children'];\n $output .= \" </div>\\n\";\n\n // Add preview image.\n $output .= theme('simple_features_preview_image', array('path' => $element['#preview_image'], 'width' => 194, 'height' => 144));\n\n // Add more details.\n $output .= ' <div class=\"features-detail\">';\n $output .= ' ' . theme('form_element_label', $variables) . \"\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n // Print price.\n $output .= theme('simple_features_price', array('price' => $element['#price']));\n\n // Sample content links.\n $output .= theme('simple_features_sample_links', array('links' => $element['#sample_links']));\n\n $output .= \" </div>\\n\";\n $output .= \"</div>\\n\";\n\n return $output;\n}", "function wppb_multiple_forms_header( $list_header ){\r\n $delete_all_nonce = wp_create_nonce( 'wppb-delete-all-entries' );\r\n\r\n return '<thead><tr><th class=\"wck-number\">#</th><th class=\"wck-content\">'. __( '<pre>Title (Type)</pre>', 'profile-builder' ) .'</th><th class=\"wck-edit\">'. __( 'Edit', 'profile-builder' ) .'</th><th class=\"wck-delete\"><a id=\"wppb-delete-all-fields\" class=\"wppb-delete-all-fields\" onclick=\"wppb_rf_epf_delete_all_fields(event, this.id, \\'' . esc_js($delete_all_nonce) . '\\')\" title=\"' . __('Delete all items', 'profile-builder') . '\" href=\"#\">'. __( 'Delete all', 'profile-builder' ) .'</a></th></tr></thead>';\r\n}", "function theme_checkbox(&$item) {\n\n\t\t$class = array('form-checkbox');\n\t\t_form_set_class($item, $class);\n\n\t\t$checked = \"\";\n\t\tif (!empty($item[\"#value\"])) {\n\t\t\t$checked = \"checked=\\\"checked\\\" \";\n\t\t}\n\n\t\t$retval = '<input '\n\t\t\t. 'type=\"checkbox\" '\n\t\t\t. 'name=\"'. $item['#name'] .'\" '\n\t\t\t. 'id=\"'. $item['#id'].'\" ' \n\t\t\t. 'value=\"'. $item['#return_value'] .'\" '\n\t\t\t. $checked\n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' />';\n\n\t\treturn($retval);\n\n\t}", "function form_checkbox($field, $options) {\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('input', 'checkbox')\n );\n\n $options = array_merge($defaults, $options);\n\n $field = strtolower($field);\n\n $output = '<input type=\"checkbox\" name=\"' . $field . '\" id=\"' . form__field_id($field) . '\"';\n\n if(!empty($_POST[$field])) {\n $output .= ' value=\"'. $_POST[$field] . '\"';\n }\n\n $output .= ' />';\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "function checkbox ($params) {\n\t\tif (!$params['id']) $params['id'] = $params['name'];\n if (!$params['y_value']) $params['y_value'] = 1;\n if (!$params['n_value']) $params['n_value'] = 0;\n?>\n\t\t<input type=\"hidden\" name=\"<?=$params['name']?>\" value=\"<?=$params['n_value']?>\" />\n\t\t<input\n\t\t\ttype=\"checkbox\" \n\t\t\tname=\"<?=$params['name']?>\" \n\t\t\tvalue=\"<?=$params['y_value']?>\"\n\t\t\tid=\"<?=$params['id']?>\" \n\t\t\tonclick=\"<?=$params['onclick']?>\"\n\t\t\t<? if ($params['checked']) echo 'checked=\"checked\"'; ?> \n\t\t\t<? if ($params['disabled']) echo 'disabled=\"disabled\"'; ?> \n\t\t\tstyle=\"display:inline;\"\n\t\t/>\n\t\t<label for=\"<?=$params['id']?>\" class=\"checkbox-label\"><?=$params['label']?></label>\n\t\t\n<?\n\t}", "public function form_field_checkbox ( $args ) {\n\t\t$options = $this->get_settings();\n\n\t\t$has_description = false;\n\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\t$has_description = true;\n\t\t\techo '<label for=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\">' . \"\\n\";\n\t\t}\n\t\techo '<input id=\"' . $args['key'] . '\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" type=\"checkbox\" value=\"1\"' . checked( esc_attr( $options[$args['key']] ), '1', false ) . ' />' . \"\\n\";\n\t\tif ( $has_description ) {\n\t\t\techo $args['data']['description'] . '</label>' . \"\\n\";\n\t\t}\n\t}", "function print_checkbox($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<div class=\"on-off\"><span></span></div>';\n\t\tif($input_value=='true'){\n\t\t\t$input_value='on';\n\t\t}\n\t\tif($input_value=='false'){\n\t\t\t$input_value='off';\n\t\t}\n\t\techo '<input name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"hidden\" value=\"'.$input_value.'\" />';\n\t\t$this->close_option($value);\n\t}", "public function getInputHeaders()\n {\n }", "public function checkbox($options = [], $enclosedByLabel = null)\n {\n return $this->getToggleField(self::TYPE_CHECKBOX, $options, $enclosedByLabel);\n }", "function barnelli_wp_checkbox( $field ) {\n\tglobal $thepostid, $post;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'checkbox';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\t$field['cbvalue'] \t\t= isset( $field['cbvalue'] ) ? $field['cbvalue'] : 'yes';\n\n\techo '<p class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><label for=\"' . esc_attr( $field['id'] ) . '\">' . wp_kses_post( $field['label'] ) . '</label><input type=\"checkbox\" class=\"' . esc_attr( $field['class'] ) . '\" name=\"' . esc_attr( $field['id'] ) . '\" id=\"' . esc_attr( $field['id'] ) . '\" value=\"' . esc_attr( $field['cbvalue'] ) . '\" ' . checked( $field['value'], $field['cbvalue'], false ) . ' /> ';\n\n\tif ( ! empty( $field['description'] ) ) echo '<span class=\"description\">' . wp_kses_post( $field['description'] ) . '</span>';\n\n\techo '</p>';\n}", "public function hookConfigForm()\n {\n?>\n<div class=\"field\">\n <label for=\"collection_tree_alpha_order\">Order the collection tree alphabetically?</label>\n <div class=\"inputs\">\n <?php echo __v()->formCheckbox('collection_tree_alpha_order', \n null, \n array('checked' => (bool) get_option('collection_tree_alpha_order'))); ?>\n <p class=\"explanation\">This does not affect the order of the collections \n browse page.</p>\n </div>\n</div>\n<?php\n }", "public function checkbox($element) {\n $element['#type'] = 'checkbox';\n $element = $this->_setRender($element);\n $element['_render']['element'] = '<input type=\"checkbox\"';\n foreach (array('id', 'name') as $key) {\n $element['_render']['element'] .= sprintf(' %s=\"%s\"', $key, $element['#' . $key]);\n }\n /**\n * type and data_id\n */\n $element['_render']['element'] .= sprintf(' data-wpt-type=\"%s\"', __FUNCTION__);\n $element['_render']['element'] .= $this->_getDataWptId($element);\n\n $element['_render']['element'] .= ' value=\"';\n /**\n * Specific: if value is empty force 1 to be rendered\n * but if is defined default value, use default\n */\n $value = 1;\n if (array_key_exists('#default_value', $element)) {\n $value = $element['#default_value'];\n }\n $element['_render']['element'] .= ( empty($element['#value']) && !preg_match('/^0$/', $element['#value']) ) ? $value : esc_attr($element['#value']);\n $element['_render']['element'] .= '\"' . $element['_attributes_string'];\n if (\n (\n !$this->isSubmitted() && (\n (!empty($element['#default_value']) && $element['#default_value'] == $element['#value'] ) || ( isset($element['#checked']) && $element['#checked'] )\n )\n ) || ($this->isSubmitted() && !empty($element['#value']))\n ) {\n $element['_render']['element'] .= ' checked=\"checked\"';\n }\n if (!empty($element['#attributes']['disabled']) || !empty($element['#disable'])) {\n $element['_render']['element'] .= ' onclick=\"javascript:return false; if(this.checked == 1){this.checked=1; return true;}else{this.checked=0; return false;}\"';\n }\n $element['_render']['element'] .= ' />';\n\n $pattern = $this->_getStatndardPatern($element, '<BEFORE><PREFIX><ELEMENT>&nbsp;<LABEL><ERROR><SUFFIX><DESCRIPTION><AFTER>');\n $output = $this->_pattern($pattern, $element);\n $output = $this->_wrapElement($element, $output);\n return $output . \"\\r\\n\";\n }", "public function register_import_metabox()\n {\n add_meta_box('oxy-stack-imp-exp', __('Import / Export', 'lambda-admin-td'), array(&$this, 'import_metabox'), $this->post_type, 'advanced', 'low');\n }", "public function getTitleCheckboxHtml() : string\n {\n return '<label class=\"kt-checkbox kt-checkbox--single kt-checkbox--all kt-checkbox--solid\">\n <input type=\"checkbox\" class=\"select-all\" onclick=\"select_all()\">\n <span></span>\n </label>';\n }", "public function settings_field_input_checkbox( $args ) {\r\n\t\t\t\t// Get the field name and default value from the $args array.\r\n\t\t\t\t$field = $args['field'];\r\n\t\t\t\t$default = $args['default'];\r\n\t\t\t\t$help_text = $args['help_text'];\r\n\t\t\t\t// Get the value of this setting, using default.\r\n\t\t\t\t$value = get_option( $field, $default );\r\n\t\t\t\t// Get the 'checked' string.\r\n\t\t\t\t$checked = checked( '1', $value, false );\r\n\t\t\t\t//error_log( \"value: $value, field: $field, default: $default, checked: $checked\" );\r\n\t\t\t\t// Echo a proper input type=\"checkbox\".\r\n\t\t\t\techo sprintf(\r\n\t\t\t\t\t'<input type=\"checkbox\" name=\"%s\" id=\"%s\" value=\"%s\" %s /> <span>%s</span>',\r\n\t\t\t\t\tesc_attr( $field ),\r\n\t\t\t\t\tesc_attr( $field ),\r\n\t\t\t\t\t'1',\r\n\t\t\t\t\tesc_attr( $checked ),\r\n\t\t\t\t\tesc_html( $help_text )\r\n\t\t\t\t);\r\n\t\t}", "function _field_toggle($fval) \n {\n // most of this is to avoid E_NOTICEs\n $has_check = (!empty($fval) && \n ($fval != '0000-00-00') &&\n (\n $fval == $this->opts || \n (is_array($this->opts) && isset($this->opts[1]) && $fval == $this->opts[1]) ||\n (empty($this->opts) && $fval == 1)\n )\n );\n\n return sprintf(\"<input type=\\\"checkbox\\\" name=\\\"%s\\\" id=\\\"%s\\\" %s class=\\\"%s\\\" %s %s />&nbsp;<span class=\\\"%s\\\">%s</span>\",\n $this->fname,\n $this->fname,\n ($this->opts)? 'value=\"' . $this->opts . '\"' : '',\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n ($has_check)? \"checked\" : \"\",\n $this->extra_attribs,\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n (isset($this->attribs['after_text']))? $this->attribs['after_text'] : '(Check for yes)' \n );\n }", "private function headings() {\n\t\t$this->section_data['general_h_tags'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_h_tags',\n\t\t\t'label' \t\t\t\t=> __( 'Headings', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h1' => 'Heading 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h2' => 'Heading 2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h3' => 'Heading 3',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h4' => 'Heading 4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h5' => 'Heading 5',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h6' => 'Heading 6',\n\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check which HTML headings automatically generated table of contents.', 'fixedtoc' )\n\t\t);\n\t}", "public function extra_form_fields() {\n\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\"><?php _e( 'Make slider featured randomly?', $this->textdomain ); ?></th>\n\t\t\t<td><input type=\"checkbox\" name=\"slider_featured\" value=\"1\" checked=\"checked\" /></td>\n\t\t</tr>\n\t<?php\n\t}", "function ffw_port_checkbox_callback( $args ) {\n global $ffw_port_settings;\n\n $checked = isset($ffw_port_settings[$args['id']]) ? checked(1, $ffw_port_settings[$args['id']], false) : '';\n $html = '<input type=\"checkbox\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "protected function removeCheckboxFieldNamesFromViewHelperVariableContainer() {}", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );\n\t\t$this->name = _x( 'Checkboxes', 'xprofile field type', 'buddypress' );\n\n\t\t$this->supports_multiple_defaults = true;\n\t\t$this->accepts_null_value = true;\n\t\t$this->supports_options = true;\n\n\t\t$this->set_format( '/^.+$/', 'replace' );\n\t\tdo_action( 'bp_xprofile_field_type_checkbox', $this );\n\t}", "public static function include_confirmation_checkbox() {\n\n $address = edd_get_customer_address();\n $taxamo = taxedd_get_country_code();\n $stylecss = \"\";\n\n if ( isset($taxamo) ) {\n if ($taxamo->country_code == $address['country'] ) {\n $stylecss = ' style=\"display: none;\"';\n }\n }\n\n ?>\n\n\n <p id=\"edd-confirmation-checkbox\" <?php echo $stylecss; ?>>\n <label for=\"edd-vat-confirm\" class=\"edd-label\">\n <?php _e( 'By clicking this checkbox, I can confirm my billing address is valid and is located in my usual country of residence.', 'taxamoedd' ); ?>\n <input class=\"edd-self-declaration\" type=\"checkbox\" name=\"edd_self_declaration\" id=\"edd-self-declaration\" value=\"true\" />\n </label>\n <?php\n }", "function checkBoxChecked($chkName, $optional){\n\t\t$checkBoxString = '';\n\t\t$chkText = '';\n\t\t\tif ( $_GET[$chkName->value]== 'on'){\n\t\t\t\t$chkText = 'checked';\n\t\t\t}\n\t\t\t $checkBoxString = $checkBoxString . '<input ' .$chkText. ' type=\"checkbox\" id=\"' .$chkName->value. '\" name=\"' .$chkName->value. '\" class=\"' .$chkName->class. '\" ' . $optional . '>' .$chkName->label. ' ';\n\t\t\n\t\treturn $checkBoxString;\n\t}", "function theme_webform_edit_file($form) {\r\n $javascript = '\r\n <script type=\"text/javascript\">\r\n function check_category_boxes () {\r\n var checkValue = !document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[1]).checked;\r\n for(var i=1; i < arguments.length; i++) {\r\n document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[i]).checked = checkValue;\r\n }\r\n }\r\n </script>\r\n ';\r\n drupal_set_html_head($javascript);\r\n\r\n // Format the components into a table.\r\n $per_row = 5;\r\n $rows = array();\r\n foreach (element_children($form['extra']['filtering']['types']) as $key => $filtergroup) {\r\n $row = array();\r\n $first_row = count($rows);\r\n if ($form['extra']['filtering']['types'][$filtergroup]['#type'] == 'checkboxes') {\r\n // Add the title.\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n $row[] = '&nbsp;';\r\n // Convert the checkboxes into individual form-items.\r\n $checkboxes = expand_checkboxes($form['extra']['filtering']['types'][$filtergroup]);\r\n // Render the checkboxes in two rows.\r\n $checkcount = 0;\r\n $jsboxes = '';\r\n foreach (element_children($checkboxes) as $key) {\r\n $checkbox = $checkboxes[$key];\r\n if ($checkbox['#type'] == 'checkbox') {\r\n $checkcount++;\r\n $jsboxes .= \"'\". $checkbox['#return_value'] .\"',\";\r\n if ($checkcount <= $per_row) {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n elseif ($checkcount == $per_row + 1) {\r\n $rows[] = array('data' => $row, 'style' => 'border-bottom: none;');\r\n $row = array(array('data' => '&nbsp;'), array('data' => '&nbsp;'));\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n else {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n }\r\n }\r\n // Pretty up the table a little bit.\r\n $current_cell = $checkcount % $per_row;\r\n if ($current_cell > 0) {\r\n $colspan = $per_row - $current_cell + 1;\r\n $row[$current_cell + 1]['colspan'] = $colspan;\r\n }\r\n // Add the javascript links.\r\n $jsboxes = drupal_substr($jsboxes, 0, drupal_strlen($jsboxes) - 1);\r\n $rows[] = array('data' => $row);\r\n $select_link = ' <a href=\"javascript:check_category_boxes(\\''. $filtergroup .'\\','. $jsboxes .')\">(select)</a>';\r\n $rows[$first_row]['data'][1] = array('data' => $select_link, 'width' => 40);\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n }\r\n elseif ($filtergroup != 'size') {\r\n // Add other fields to the table (ie. additional extensions).\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n unset($form['extra']['filtering']['types'][$filtergroup]['#title']);\r\n $row[] = array(\r\n 'data' => drupal_render($form['extra']['filtering']['types'][$filtergroup]),\r\n 'colspan' => $per_row + 1,\r\n );\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n $rows[] = array('data' => $row);\r\n }\r\n }\r\n $header = array(array('data' => t('Category'), 'colspan' => '2'), array('data' => t('Types'), 'colspan' => $per_row));\r\n\r\n // Create the table inside the form.\r\n $form['extra']['filtering']['types']['table'] = array(\r\n '#value' => theme('table', $header, $rows)\r\n );\r\n\r\n $output = drupal_render($form);\r\n\r\n // Prefix the upload location field with the default path for webform.\r\n $output = str_replace('Upload Directory: </label>', 'Upload Directory: </label>'. file_directory_path() .'/webform/', $output);\r\n\r\n return $output;\r\n}", "function AttribCheckbox( $id, $value, $name )\n\t{\n\t\t$checkbox = \"\";\n\t\t$checked = \"\";\n if ($value == 'on')\n {\n \t$checked = \"checked='checked'\";\n }\n $checkbox .= \"<input type='checkbox' name='\".$name.\"' \" . $checked . \" />\";\n\t\treturn $checkbox;\n\t}", "function display_td_checkbox($prefid, $id, $class = \"\", $gnum = \"\", $lnum = \"\") {\n\techo \"<TD> \";\n\techo \"<SPAN ID=\" . $prefid . \"s_$id>\";\n\techo \"<INPUT TYPE=checkbox ID=\" . $prefid . \"cb_$id\";\n\tif ($class != \"\") {\n\t\techo \" CLASS=\\\"$class\\\"\";\n\t\tif ($gnum != \"\") {\n\t\t\techo \" gnum=$gnum\";\n\t\t\tif ($lnum != \"\") {\n\t\t\t\techo \" lnum=$lnum\";\n\t\t\t}\n\t\t}\n\t}\n\techo \">\";\n\techo \"</SPAN>\";\n}", "function input_checkbox($errors, $name, $label, $onclick) {\n echo '<div class=\"required_field\">';\n //create the label for the input\n echo \"<label for = \\\"$name\\\">$label</label>\";\n //Create checkbox\n echo \"<input type = \\\"checkbox\\\" name=\\\"$name\\\" onclick='$onclick'>\";\n //create error message span\n error_label($errors, $name);\n //close the div\n echo '</div>';\n}", "function form_checkbox_group($field, $options) {\n\n}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "protected function buildCheckboxSingle($row) {\n\t\t$checked='';\n\t\tif ($this->filled) {\n\t\t\tif ($row['values']==1) $checked = \" checked='checked'\";\n\t\t}\n\t\t$elem = sprintf(\"<input type='checkbox' name='%s' value='1'%s />\\n\",$row['Field'],$checked);\n\t\treturn $elem;\n\t}", "function html_checkbox($variable, $checked='') {\n\n\t$variable .= '_ishtml';\n\n\treturn '<div style=\"padding:3px; width:110px; border: 1px #CCCCCC solid;\">' . form_checkbox($variable, 1, $checked) . \"&nbsp;&nbsp;&nbsp<label for=\\\"$variable\\\">Treat as HTML</label></div>\";\n\n}", "function CheckBoxFile($caption, $class)\n\t{\n\t\tinclude_once('file.php');\n\t\t$structure = '<br /><form method=\"post\" action=\"../' . $class . '.php\">';\n\t\t$directory = \"../articles\";\n\t\t// Open the dir and read the file inside\n\t\t\t// Open the directory\n\t\t\tif ($directory_handle = opendir($directory)) {\n\t\t\t\t // Control all the contents\n\t\t\t\t while (($file = readdir($directory_handle)) !== false) {\n\t\t\t\t // If the element is not egual to directory od . or .. fill the variable\n\t\t\t\t if((!is_dir($file))&($file!=\".\")&($file!=\"..\")){\n\t\t\t\t\t\t\t\t$title = readLine('../parameters/id_articles', $file);\n\t\t\t\t\t\t\t\t$structure = $structure . '<input type=\"checkbox\" name=\"myCheck[' . $file . ']\" value=\"' . $file . '\" /> ' . $title . '<br />';\n\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t \tclosedir($directory_handle);\n\t\t\t\t}\n\t\t$structure = $structure . '<br /><input type=\"submit\" value=\"' . $caption . '\" /></form>';\n\t\treturn $structure;\n\t}", "function gen_pagenamefirst_field(&$section, $value) {\n\n\t$section->addInput(new Form_Checkbox(\n\t\t'pagenamefirst',\n\t\t'Browser tab text',\n\t\t'Display page name first in browser tab',\n\t\t$value\n\t))->setHelp('When this is unchecked, the browser tab shows the host name followed '.\n\t\t'by the current page. Check this box to display the current page followed by the '.\n\t\t'host name.');\n}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "function sb_slideshow_checkbox( $value, $key, $name, $checked = array() ) {\n\treturn '<input type=\"checkbox\" name=\"sb_' . esc_attr( $name ) . '[]\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . (in_array( $value, (array)$checked ) ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "private function addElements(): void\n {\n // Add additional form fields\n $this->add([\n 'name' => 'masterFile',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'masterFile',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create master export file',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n\n $this->add([\n 'name' => 'debugTranslations',\n 'type' => Checkbox::class,\n 'attributes' => [\n 'id' => 'debugTranslations',\n 'class' => 'form-check-input',\n ],\n 'options' => [\n 'label' => 'Create debug translations',\n 'label_attributes' => [\n 'class' => 'form-check-label',\n ],\n ],\n ]);\n }", "function check_box($object, $field, $options = array(), $checked_value = \"1\", $unchecked_value = \"0\") {\n $form = new FormHelper($object, $field);\n return $form->to_check_box_tag($options, $checked_value, $unchecked_value);\n}", "public function __construct($name = null, $value = null, $checked = false, $screenReaderLabel = \"\") {\n parent::__construct(new Checkbox($name, $value, $checked), $screenReaderLabel);\n }", "function do_signup_header()\n {\n }", "function form_checkbox($forms){\r\n\t$name = isset($forms['name']) ? $forms['name'] : rand(1000 , 9999 ) ;\r\n\t$class = isset( $forms['class'] ) ? $forms['class'] : $forms['name'] ;\r\n\t$checked = $forms['value'] == '1' ? \"checked\" : \"\" ;\r\n\t$id = isset( $forms['id'] ) ? $forms['id'] : $forms['name'] ;\r\n\r\n\t$input = '<input onkeypress=\"return handleEnter(this, event)\" type=\"checkbox\" ';\r\n\t$input .= ' name=\"'.$name.'\" ';\r\n\t$input .= ' class=\"'.$class.'\" ';\r\n\t$input .= ' id=\"'.$id.'\" ';\r\n\t$input .= ' value=\"1\" '; \r\n\t$input .= ' '.$checked.' />';\r\n\r\n\treturn $input;\r\n\r\n}", "function add_futurninews_columns($cols){\n\treturn array(\n\t\t'cb' \t\t=> '<input type=\"checkbox\" />;',\n\t\t'title' \t=> 'Title',\n\t\t'heading'\t=> 'Heading',\n\t\t'date'\t\t=> 'Date'\n\t);\n}" ]
[ "0.63695353", "0.5883379", "0.58809394", "0.58807844", "0.57226795", "0.57156914", "0.57071275", "0.5695699", "0.56633687", "0.5649122", "0.5549496", "0.5474228", "0.5473855", "0.5447326", "0.54225916", "0.5406645", "0.5400897", "0.53399295", "0.5336694", "0.53366834", "0.5328856", "0.5297", "0.528531", "0.5255044", "0.5250966", "0.52465814", "0.5207455", "0.5182041", "0.51812214", "0.51687825", "0.5146153", "0.51442647", "0.5142529", "0.51175743", "0.5115659", "0.5107728", "0.5104298", "0.51042163", "0.50981915", "0.5093226", "0.50861347", "0.5077532", "0.50491273", "0.50458676", "0.49937806", "0.49679485", "0.49606448", "0.49535105", "0.49358046", "0.4918034", "0.49068254", "0.49023113", "0.49012953", "0.49008396", "0.48931378", "0.48743415", "0.4870241", "0.48696473", "0.48661962", "0.48624805", "0.48608232", "0.48556867", "0.48490626", "0.4840374", "0.4832094", "0.48270527", "0.48232955", "0.4818501", "0.4815611", "0.4810625", "0.48032716", "0.48031607", "0.4779008", "0.4772442", "0.47661284", "0.4765975", "0.4765544", "0.47617024", "0.47562408", "0.4752951", "0.4747635", "0.47452414", "0.4742619", "0.47176802", "0.47147322", "0.47059637", "0.47059637", "0.47059637", "0.47059637", "0.47059637", "0.47056177", "0.47036344", "0.47020334", "0.4687171", "0.46773517", "0.46644452", "0.46630564", "0.4661015", "0.46537945", "0.46519428" ]
0.6030131
1
Imports a date header i.e. a field's declaration.
protected function process_header_date(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function parseDate(object $header): void {\n\n if (property_exists($header, 'date')) {\n $date = $header->date;\n\n if (preg_match('/\\+0580/', $date)) {\n $date = str_replace('+0580', '+0530', $date);\n }\n\n $date = trim(rtrim($date));\n try {\n if (str_contains($date, '&nbsp;')) {\n $date = str_replace('&nbsp;', ' ', $date);\n }\n if (str_contains($date, ' UT ')) {\n $date = str_replace(' UT ', ' UTC ', $date);\n }\n $parsed_date = Carbon::parse($date);\n } catch (\\Exception $e) {\n switch (true) {\n case preg_match('/([0-9]{4}\\.[0-9]{1,2}\\.[0-9]{1,2}\\-[0-9]{1,2}\\.[0-9]{1,2}.[0-9]{1,2})+$/i', $date) > 0:\n $date = Carbon::createFromFormat(\"Y.m.d-H.i.s\", $date);\n break;\n case preg_match('/([0-9]{2} [A-Z]{3} [0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [+-][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [+-][0-9]{1,4})+$/i', $date) > 0:\n $parts = explode(' ', $date);\n array_splice($parts, -2);\n $date = implode(' ', $parts);\n break;\n case preg_match('/([A-Z]{2,4}\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4})+$/i', $date) > 0:\n $array = explode(',', $date);\n array_shift($array);\n $date = Carbon::createFromFormat(\"d M Y H:i:s O\", trim(implode(',', $array)));\n break;\n case preg_match('/([0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ UT)+$/i', $date) > 0:\n case preg_match('/([A-Z]{2,3}\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ UT)+$/i', $date) > 0:\n $date .= 'C';\n break;\n case preg_match('/([A-Z]{2,3}\\,\\ [0-9]{1,2}[\\,]\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4})+$/i', $date) > 0:\n $date = str_replace(',', '', $date);\n break;\n // match case for: Di., 15 Feb. 2022 06:52:44 +0100 (MEZ)/Di., 15 Feb. 2022 06:52:44 +0100 (MEZ)\n case preg_match('/([A-Z]{2,3}\\.\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\.\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4}\\ \\([A-Z]{3,4}\\))\\/([A-Z]{2,3}\\.\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\.\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4}\\ \\([A-Z]{3,4}\\))+$/i', $date) > 0:\n $dates = explode('/', $date);\n $date = array_shift($dates);\n $array = explode(',', $date);\n array_shift($array);\n $date = trim(implode(',', $array));\n $array = explode(' ', $date);\n array_pop($array);\n $date = trim(implode(' ', $array));\n $date = Carbon::createFromFormat(\"d M. Y H:i:s O\", $date);\n break;\n // match case for: fr., 25 nov. 2022 06:27:14 +0100/fr., 25 nov. 2022 06:27:14 +0100\n case preg_match('/([A-Z]{2,3}\\.\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\.\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4})\\/([A-Z]{2,3}\\.\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\.\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4})+$/i', $date) > 0:\n $dates = explode('/', $date);\n $date = array_shift($dates);\n $array = explode(',', $date);\n array_shift($array);\n $date = trim(implode(',', $array));\n $date = Carbon::createFromFormat(\"d M. Y H:i:s O\", $date);\n break;\n case preg_match('/([A-Z]{2,3}\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ \\+[0-9]{2,4}\\ \\(\\+[0-9]{1,2}\\))+$/i', $date) > 0:\n case preg_match('/([A-Z]{2,3}[\\,|\\ \\,]\\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}.*)+$/i', $date) > 0:\n case preg_match('/([A-Z]{2,3}\\,\\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4}\\ \\(.*)\\)+$/i', $date) > 0:\n case preg_match('/([A-Z]{2,3}\\, \\ [0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{4}\\ [0-9]{1,2}\\:[0-9]{1,2}\\:[0-9]{1,2}\\ [\\-|\\+][0-9]{4}\\ \\(.*)\\)+$/i', $date) > 0:\n case preg_match('/([0-9]{1,2}\\ [A-Z]{2,3}\\ [0-9]{2,4}\\ [0-9]{2}\\:[0-9]{2}\\:[0-9]{2}\\ [A-Z]{2}\\ \\-[0-9]{2}\\:[0-9]{2}\\ \\([A-Z]{2,3}\\ \\-[0-9]{2}:[0-9]{2}\\))+$/i', $date) > 0:\n $array = explode('(', $date);\n $array = array_reverse($array);\n $date = trim(array_pop($array));\n break;\n }\n try {\n $parsed_date = Carbon::parse($date);\n } catch (\\Exception $_e) {\n if (!isset($this->config[\"fallback_date\"])) {\n throw new InvalidMessageDateException(\"Invalid message date. ID:\" . $this->get(\"message_id\") . \" Date:\" . $header->date . \"/\" . $date, 1100, $e);\n } else {\n $parsed_date = Carbon::parse($this->config[\"fallback_date\"]);\n }\n }\n }\n\n $this->set(\"date\", $parsed_date);\n }\n }", "public function getHeaderDate()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__DATE];\r\n\t}", "private function importDateContents($contents) : void\n {\n //==============================================================================\n // Import Date\n if (!empty($contents[\"date\"])) {\n if ($contents[\"date\"] instanceof DateTime) {\n $this->setRefreshAt($contents[\"date\"]);\n } elseif (is_scalar($contents[\"date\"])) {\n $this->setRefreshAt(new DateTime((string) $contents[\"date\"]));\n }\n }\n }", "public function buildHeaderFields() {}", "public function getDateImport()\n {\n return $this->date_import;\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "static function dateFromDayHeader($start_date, $day_header) {\n $objDate = new DateAndTime(DB_DATEFORMAT, $start_date);\n $currentDayHeader = (string) $objDate->getDate(); // It returns an int on first call.\n if (strlen($currentDayHeader) == 1) // Which is an implementation detail of DateAndTime class.\n $currentDayHeader = '0'.$currentDayHeader; // Add a 0 for single digit day.\n $i = 1;\n while ($currentDayHeader != $day_header && $i < 7) {\n // Iterate through remaining days to find a match.\n $objDate->incDay();\n $currentDayHeader = $objDate->getDate(); // After incDay it returns a string with leading 0, when necessary.\n $i++;\n }\n return $objDate->toString(DB_DATEFORMAT);\n }", "static function parseHTTPDate($dateHeader) {\n\n //RFC 2616 section 3.3.1 Full Date\n //Only the format is checked, valid ranges are checked by strtotime below\n $month = '(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)';\n $weekday = '(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)';\n $wkday = '(Mon|Tue|Wed|Thu|Fri|Sat|Sun)';\n $time = '[0-2]\\d(\\:[0-5]\\d){2}';\n $date3 = $month . ' ([1-3]\\d| \\d)';\n $date2 = '[0-3]\\d\\-' . $month . '\\-\\d\\d';\n //4-digit year cannot begin with 0 - unix timestamp begins in 1970\n $date1 = '[0-3]\\d ' . $month . ' [1-9]\\d{3}';\n\n //ANSI C's asctime() format\n //4-digit year cannot begin with 0 - unix timestamp begins in 1970\n $asctime_date = $wkday . ' ' . $date3 . ' ' . $time . ' [1-9]\\d{3}';\n //RFC 850, obsoleted by RFC 1036\n $rfc850_date = $weekday . ', ' . $date2 . ' ' . $time . ' GMT';\n //RFC 822, updated by RFC 1123\n $rfc1123_date = $wkday . ', ' . $date1 . ' ' . $time . ' GMT';\n //allowed date formats by RFC 2616\n $HTTP_date = \"($rfc1123_date|$rfc850_date|$asctime_date)\";\n\n //allow for space around the string and strip it\n $dateHeader = trim($dateHeader, ' ');\n if (!preg_match('/^' . $HTTP_date . '$/', $dateHeader))\n return false;\n\n //append implicit GMT timezone to ANSI C time format\n if (strpos($dateHeader, ' GMT') === false)\n $dateHeader .= ' GMT';\n\n\n $realDate = strtotime($dateHeader);\n //strtotime can return -1 or false in case of error\n if ($realDate !== false && $realDate >= 0)\n return new \\DateTime('@' . $realDate, new \\DateTimeZone('UTC'));\n\n }", "public static function convert_date_field() {\n\n\t\t// Create a new Phone field.\n\t\tself::$field = new GF_Field_Date();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Phone specific properties.\n\t\tself::$field->dateFormat = 'dd/mm/yyyy';\n\n\t}", "public function fromHeader($header, $dataType)\n\t{\n\t\treturn $this->fromString($header, $dataType);\n\t}", "protected function makeHeader()\n {\n }", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "protected function _parseHeader() {}", "static private function getDate($day) {\n\t\treturn $day->getElementsByTagName('h3')->item(0)->nodeValue;\n\t}", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "function prepare_field_for_import($field)\n {\n }", "function type_column_header( $columns ) {\r\n\t\tunset( $columns['date'] );\r\n\t\treturn $columns;\r\n\t}", "private function build_header() {\n\t\t// if we've already got the cart ID, use it\n\t\t$header = self::fetch('cart_header', [':cart_id' => $this->id()]);\n\n\t\t$header['date_created'] = ck_datetime::datify(@$header['date_created']);\n\t\tif (!empty($header['date_updated'])) $header['date_updated'] = ck_datetime::datify($header['date_updated']);\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "public function getFromWebserviceImport($value)\n {\n $timestamp = strtotime($value);\n if (empty($value)) {\n return null;\n } else if ($timestamp !== FALSE) {\n return new Pimcore_Date($timestamp);\n } else {\n throw new Exception(\"cannot get values from web service import - invalid data\");\n }\n }", "public function getDataWithTypeDate() {}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "function pixelgrade_entry_header( $post_id = null ) {\n\t\t// Fallback to the current post if no post ID was given.\n\t\tif ( empty( $post_id ) ) {\n\t\t\t$post_id = get_the_ID();\n\t\t}\n\n\t\t// Bail if we still don't have a post ID.\n\t\tif ( empty( $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthe_date( '', '<div class=\"entry-date\">', '</div>', true );\n\n\t}", "public function getImportDateTime()\n {\n return $this->importDateTime;\n }", "public function getHeaderData() {}", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function SetImportDateTime($time) {\n $this->ImportDateTime = $time;\n }", "public static function rfcDate()\n {\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function import();", "function _parseHeader($header) {\n\n\t\tif (is_array($header)) {\n\t\t\tforeach ($header as $field => $value) {\n\t\t\t\tunset($header[$field]);\n\t\t\t\t$field = strtolower($field);\n\t\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\n\t\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t\t}\n\t\t\t\t$header[$field] = $value;\n\t\t\t}\n\t\t\treturn $header;\n\t\t} elseif (!is_string($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpreg_match_all(\"/(.+):(.+)(?:(?<![\\t ])\" . $this->line_break . \"|\\$)/Uis\", $header, $matches, PREG_SET_ORDER);\n\n\t\t$header = array();\n\t\tforeach ($matches as $match) {\n\t\t\tlist(, $field, $value) = $match;\n\n\t\t\t$value = trim($value);\n\t\t\t$value = preg_replace(\"/[\\t ]\\r\\n/\", \"\\r\\n\", $value);\n\n\t\t\t$field = $this->_unescapeToken($field);\n\n\t\t\t$field = strtolower($field);\n\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t}\n\n\t\t\tif (!isset($header[$field])) {\n\t\t\t\t$header[$field] = $value;\n\t\t\t} else {\n\t\t\t\t$header[$field] = array_merge((array) $header[$field], (array) $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $header;\n\t}", "public function stdWrap_dateDataProvider() {}", "function df_meta_fields( $post, $mph_var ) {\n\t\t$date_field_object = $mph_var['args'];\n\t\t$date_field_object->df_create_fields();\n\t}", "public function getDateDebut();", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "protected function makeDateHeaderString() {\n\t\t$timeZone = date(\"Z\");\n\t\t$op = ($timeZone[0] == '-') ? '-' : '+';\n\t\t$timeZone = abs($timeZone);\n\t\t$timeZone = floor($timeZone / 3600) * 100 + ($timeZone % 3600) / 60;\n\t\t$dateString = sprintf(\"%s %s%04d\", date(\"D, j M Y H:i:s\"), $op, $timeZone);\n\t\treturn \"Date: \" . $dateString . $this->_endString;\n\t}", "function PrepDate(&$str,$blnNullable = true,$delim=\"/\") {\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_ORACLE \n && $str == \"SYSDATE\"\n ) return;\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_POSTGRES \n && $str == \"CURRENT_TIMESTAMP\"\n ) return;\n \n if(strpos($str,$delim) && !strpos($str,\":\")) {\n if(!preg_match(\"/(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)[0-9]{2}/\", $str)) {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $arr = explode($delim,$str);\n $arr = array_reverse($arr);\n if(strlen($arr[0]) == 2) {\n if($arr[0] > 50) $arr[0] = \"19\".$arr[0];\n else $arr[0] = \"20\".$arr[0];\n }\n elseif(strlen($arr[0]) == 4) {\n // do nothing\n }\n elseif(strpos($str,\":\")) {\n $this->XaoThrow(\n \"The PrepDate() method does not handle time data.\",\n debug_backtrace()\n );\n return;\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"'\".sprintf(\"%04d-%02d-%02d\", $arr[0], $arr[1], $arr[2])\n .\" 00:00:00\".\"'\";\n }\n // if(strlen(trim($str))) $str = \"'$str'\";\n elseif($str == \"\") {\n if(!$blnNullable) {\n $this->XaoThrow(\n \"XaoDb::PrepDate() Unhandled NOT NULL Exception. \" .\n \"See stack trace for details.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"NULL\";\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str\n .\") is not recognised as a valid date format. Try DD/MM/YYYY\",\n debug_backtrace()\n );\n }\n }", "public function extObjHeader() {}", "public function prepareImport();", "public function setHeader(PoHeader $header) {\n }", "function acf_prepare_field_for_import($field)\n{\n}", "public function parseDate(){\n \t$attrs = ['requested_at', 'replied_at', 'fixed_begin', 'fixed_end'];\n \tforeach ($attrs as $a){\n \t\tif (is_string($d = $this->getAttribute($a))){\n \t\t\t$d = \\DateTime::createFromFormat('Y-m-d H:i:s', $d);\n \t\t\tif ($d){\n\t \t\t\t$this->setAttribute($a, ['date' => $d->format('Y-m-d'), 'time' => $d->format('H:i:s')]);\n \t\t\t} else {\n\t \t\t\t$this->setAttribute($a, ['date' => date('Y-m-d'), 'time' => date('H:i:s')]);\n \t\t\t}\n \t\t}\n \t}\n }", "public function getFromCsvImport($importValue)\n {\n try {\n $value = new Pimcore_Date(strtotime($importValue));\n return $value;\n } catch (Exception $e) {\n return null;\n }\n }", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "private function headerRead(): void\n {\n if (false === $this->getStrategy()->hasHeader() || true === $this->headerRead) {\n return;\n }\n\n $this->rewind();\n $this->skipLeadingLines();\n $this->header = $this->normalizeHeader($this->convertRowToUtf8($this->current()));\n $this->headerRead = true;\n $this->next();\n }", "public function format_for_header()\n {\n }", "static function getDayHeadersForWeek($start_date) {\n $dayHeaders = array();\n $objDate = new DateAndTime(DB_DATEFORMAT, $start_date);\n $dayHeaders[] = (string) $objDate->getDate(); // It returns an int on first call.\n if (strlen($dayHeaders[0]) == 1) // Which is an implementation detail of DateAndTime class.\n $dayHeaders[0] = '0'.$dayHeaders[0]; // Add a 0 for single digit day.\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate(); // After incDay it returns a string with leading 0, when necessary.\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate();\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate();\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate();\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate();\n $objDate->incDay();\n $dayHeaders[] = $objDate->getDate();\n unset($objDate);\n return $dayHeaders;\n }", "protected function addHeaderRowToCSV() {}", "function ThursdayColumnHeader() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_ThursdayColumnHeader = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_ThursdayColumnHeader;\n\t}", "function pxlz_edgtf_set_header_object() {\n $header_type = pxlz_edgtf_get_meta_field_intersect('header_type', pxlz_edgtf_get_page_id());\n $header_types_option = pxlz_edgtf_get_header_type_options();\n\n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if (Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\PxlzEdgefHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "public function setDateImport($date_import)\n {\n $this->date_import = $date_import;\n\n return $this;\n }", "function setup_meta_dates() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t$_IPCDateCount = get_post_meta($post_id, \"_IPCDateCount\", true);\n\t\t\tif(empty($_IPCDateCount))\n\t\t\t\t$_IPCDateCount = 1;\n\t\t\t\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-meta-data.php');\n\t\t}", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "function privReadFileHeader(&$p_header)\n {\n }", "public function initializeHeader(array $header): void\n {\n // removes forbidden symbols from header (field names)\n $this->header = array_map(function (string $name): string {\n return preg_replace('~[^a-z0-9_-]+~i', '_', $name);\n }, $header);\n }", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "public function setHasHeader(bool $hasHeader): CsvImport\n {\n $this->hasHeader = $hasHeader;\n return $this;\n }", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function import(): void;", "private function newDateField(stdClass $fieldDef): DBTable\\Field\n {\n $field = new Fld\\Date($fieldDef->column_name);\n $this->setProperties($field, $fieldDef);\n\n return $field;\n }", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "public function __construct($date)\n {\n $date = $this->getDate($date);\n $this->mediawiki = intval($date->format(\"YmdHis\"));\n $this->readable = $date->format(\"d F Y\");\n }", "public function getDateDeclaration(): ?DateTime {\n return $this->dateDeclaration;\n }", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "public function extract()\n {\n if (null !== $date = $this->fromJsonLd()) {\n return $date;\n }\n\n if (null !== $date = $this->fromMeta()) {\n return $date;\n }\n\n if (null !== $date = $this->fromOpenGraph()) {\n return $date;\n }\n\n return null;\n }", "public function import()\n {\n \n }", "public function setStartDate(string $date);", "public function getDate();", "public function getDate();", "private function prepareDateType($data) {\n\t\t\t$m = array();\n\t\t\tif (preg_match('@(\\d{4})[-./](\\d{1,2})[-./](\\d{1,2})@', $data, $m) > 0) {\n\t\t\t\t# pattern: yyyy-mm-dd\n\t\t\t\t$date = substr('00' . $m[2], -2) . '/' . substr('00' . $m[3], -2) . '/' . $m[1];\n\t\t\t} else if (preg_match('@(\\d{1,2})[./-](\\d{1,2})[./-](\\d{4})@', $data, $m) > 0) {\n\t\t\t\t# pattern: mm-dd-yyyy\n\t\t\t\t$date = substr('00' . $m[1], -2) . '/' . substr('00' . $m[2], -2) . '/' . $m[3];\n\t\t\t} else if (preg_match('@^(\\d{7,15})$@', $data, $m) > 0) {\n\t\t\t\t# timestamp\n\t\t\t\t$date = date('m/d/Y', $data);\n\t\t\t} else {\n\t\t\t\t$date = $data;\n\t\t\t}\n\t\t\treturn $date;\n\t\t}", "function min_date ( $str, $field )\n\t{\n\t}", "public function setHeader( FileHeader $record ) {\n\t\t$this->header = $record;\n\t}", "protected function process_header(import_settings $settings, $data) {\r\n $result = array();\r\n $doc = $settings->get_dom();\r\n $rows = $doc->getElementsByTagName('tr');\r\n $head = $rows->item(0);\r\n $cols = $head->getElementsByTagName('th');\r\n foreach ($cols as $col) {\r\n $name = $this->read($col, 'title');\r\n $description = $this->read($col, 'description');\r\n $type = $this->read($col, 'type');\r\n $options = $this->read_list($col, 'options');\r\n $f = array($this, 'process_header_' . $type);\r\n if (is_callable($f)) {\r\n $field = call_user_func($f, $settings, $data, $name, $description, $options);\r\n $result[] = $field;\r\n } else {\r\n $field = $this->process_header_default($settings, $type, $name, $description, $options);\r\n $result[] = $field;\r\n }\r\n }\r\n return $result;\r\n }", "function _webform_csv_headers_email($component) {\r\n $header = array();\r\n $header[0] = '';\r\n $header[1] = '';\r\n $header[2] = $component['name'];\r\n return $header;\r\n}", "public function load_calendar_datetime()\n\t{\n\t\tif ( ! class_exists('Calendar_datetime'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.datetime.php';\n\t\t}\n\n\t\tif (! isset($this->CDT))\n\t\t{\n\t\t\t$this->CDT = new Calendar_datetime();\n\t\t\t$this->first_day_of_week = $this->get_first_day_of_week();\n\t\t}\n\t}", "#[Pure]\nfunction http_parse_headers($header) {}", "public function add_header() {\n }", "private function makeCalendarHead()\n\t{\n\t\tif(strlen($this->headerStr) < 1) {\n\t\t\t$head = \"\\t<tr>\\n\\t\\t<th colspan=\\\"7\\\" class=\\\"headerString\\\">\";\n\t\t\tif(!is_null($this->curDay)) {\n\t\t\t\t$head .= $this->curDayName.' the '.$this->curDayS.' of '.$this->curMonthName.', '.$this->curYear;\n\t\t\t} else {\n\t\t\t\t$head .= $this->curMonthName.', '.$this->curYear;\n\t\t\t}\n\t\t\t$head .= \"</th>\\n\\t</tr>\\n\";\n\t\t} else {\n\t\t\t$head = $this->headerStr;\n\t\t}\n\t\t\n\t\t$this->calWeekDays .= $head;\n\t\t$this->outArray['head'] = $head;\n\t}", "protected function parseDate($date)\n {\n if (substr($date, 0, 5) != 'Date(') throw new Exception(\"Failed to parse Date $date\");\n $date = substr($date, 5, -1);\n $parts = explode(',', $date);\n\n $dt = new \\DateTime();\n $dt->setDate($parts[0], $parts[1] + 1, $parts[2]);\n if (count($parts) == 6) {\n $dt->setTime($parts[3], $parts[4], $parts[5]);\n }\n\n return $dt;\n }", "function splitdate( $date ) {\n\t\n\t$year = substr( $date, 0, 4 );\n\t$mon = substr( $date, 4, 2 );\n\t$day = substr( $date, 6, 2 );\n\t$datum= $day.\".\".$mon.\".\".$year;\n\n\treturn $datum;\n}", "function _generateHeaderInfo()\n {\n return '0504';\n }", "function _get_random_header_data()\n {\n }", "public static function parseHeader($header): array;", "public function addHeader()\n {\n }", "protected function process_data_date(import_settings $settings, $field, $data_record, $value) {\r\n $value = $this->get_innerhtml($value);\r\n $parts = explode('.', $value);\r\n $d = $parts[0];\r\n $m = $parts[1];\r\n $y = $parts[2];\r\n $value = mktime(0, 0, 0, $m, $d, $y);\r\n $result = $this->process_data_default($settings, $field, $data_record, $value);\r\n return $result;\r\n }", "abstract public function header();", "public function readDate()\n {\n $dateReference = $this->readInteger();\n\n $refObj = $this->getReferenceObject($dateReference);\n if($refObj !== false)\n return $refObj;\n\n //$timestamp = floor($this->_stream->readDouble() / 1000);\n $timestamp = new DateTime();\n $timestamp->setTimestamp(floor($this->_stream->readDouble() / 1000));\n\n $this->_referenceObjects[] = $timestamp;\n\n return $timestamp;\n }", "public function column_date($post)\n {\n }", "public function extract()\n {\n if (null !== $date = $this->fromJsonLd()) {\n return $date;\n }\n\n if (null !== $date = $this->fromMeta()) {\n return $date;\n }\n\n if (null !== $date = $this->fromUri()) {\n return $date;\n }\n\n return null;\n }", "public function column_date($post)\n {\n }", "function getFieldHeader($fN)\t{\r\n\t\tswitch($fN) {\r\n\t\t\tcase \"title\":\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_title','<em>title</em>');\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function testConstructWithTypeProperties()\n {\n $oField = new Field('DATE', array('dateformat' => 'd-M-yyyy'));\n\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Element\\\\Field', $oField);\n $this->assertEquals('DATE', $oField->getType());\n $this->assertEquals(array('dateformat' => 'd-M-yyyy'), $oField->getProperties());\n }", "function _field_date_us($fval) \n {\n $f_date = \"\";\n if ($fval) {\n list($m,$d,$y) = split('/', $fval);\n $f_date = array($y, $m, $d);\n }\n return $this->_field_date($f_date);\n }", "function _parseDate($date) {\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "public function docHeaderContent() {}", "public function getHeader();", "public function getHeader();" ]
[ "0.62307817", "0.591231", "0.5634141", "0.5621257", "0.55200434", "0.547975", "0.54533225", "0.5449354", "0.5261206", "0.5159231", "0.5139352", "0.50846297", "0.50423723", "0.5041895", "0.50371337", "0.5035094", "0.4972689", "0.49478891", "0.49268717", "0.49260876", "0.49195048", "0.4898456", "0.4882097", "0.48735273", "0.48692095", "0.48664793", "0.4858699", "0.48464656", "0.48237735", "0.48226285", "0.4812313", "0.47992697", "0.47989422", "0.47954717", "0.47769433", "0.47765052", "0.47543338", "0.47460666", "0.47165152", "0.47131252", "0.47130656", "0.47055146", "0.4699485", "0.46993107", "0.4689647", "0.4685631", "0.46710232", "0.46688277", "0.46670428", "0.4664154", "0.46616042", "0.46589783", "0.46575192", "0.4636458", "0.46324182", "0.4624859", "0.46235934", "0.4623546", "0.461288", "0.45921016", "0.4584316", "0.45707422", "0.45620304", "0.45610556", "0.45492634", "0.45472077", "0.4542302", "0.45388508", "0.45373154", "0.4535246", "0.45268106", "0.45268106", "0.45254606", "0.45190302", "0.45180395", "0.4515819", "0.4512929", "0.45082992", "0.45067278", "0.45043725", "0.45032236", "0.45010525", "0.4501028", "0.450086", "0.45007396", "0.44982362", "0.44961137", "0.44945455", "0.44906604", "0.44892845", "0.4487372", "0.44867027", "0.44853467", "0.44835928", "0.44821408", "0.44743893", "0.44679034", "0.4463773", "0.44516432", "0.44516432" ]
0.6072167
1
Imports a file header i.e. a field's declaration.
protected function process_header_file(import_settings $settings, $data, $name, $description, $options) { global $CFG, $COURSE; $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); $result->param2 = max($CFG->maxbytes, $COURSE->maxbytes); global $DB; $DB->update_record('data_fields', $result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function import();", "public function import(): void;", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "public function import()\n {\n \n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "function import_file($contents) {\n\t\ttrigger_error('Importer::import_file needs to be implemented', E_USER_ERROR);\n\t\t\n\t}", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "function prepare_field_for_import($field)\n {\n }", "public function setHeader( FileHeader $record ) {\n\t\t$this->header = $record;\n\t}", "function privReadFileHeader(&$p_header)\n {\n }", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "public function import(string $filePath);", "function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}", "public function prepareImport();", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "public function defineHeader()\n {\n $this->header = new Header();\n }", "function include_import_class($import_class) {\n\tif (file_exists(ABSPATH . '/includes/import-classes/' . $import_class)) {\n\t\trequire_once(ABSPATH . '/includes/import-classes/' . $import_class);\n\t}\n}", "public function buildHeaderFields() {}", "protected function initializeImport() {}", "function acf_prepare_field_for_import($field)\n{\n}", "public static function import($path) {\n $includePath = get_include_path();\n $includePath .= PATH_SEPARATOR . $path;\n set_include_path($includePath);\n }", "function fileData($file, $header = NULL) {\n\t\treturn src\\Libre::__fileData($file, $header);\n\t}", "public function extObjHeader() {}", "function import($class, $file, $path = null) {\n\tstatic $_classes = array();\n\n\t$class = strtolower($class);\n\t$class_exists = isset($_classes[$class]);\n\n\tif(!$class_exists) {\n\t\t$_classes[$class] = $class;\n\t\t$path = is_null($path) ? APPPATH : $path;\n\t\tinclude_once($path.$file);\n\t}\n}", "public function parse($filename, $headerRow = true);", "public function include_import_export(){\n\t\tglobal $import;\n\n\t\t// Load the Import class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-import.php' );\n\t\t$import = new VisualFormBuilder_Pro_Import();\n\t}", "public function setHeaderFromFile($potFile)\n {\n $poFile = new PoFile();\n $poFile->readPoFile($potFile);\n $header = $poFile->getHeaderEntry();\n\n $this->file->setHeaderEntry($header);\n }", "public function add_header() {\n }", "function get_header($file=''){\n global $config;\n static $header_loaded = false;\n if($file == ''){//load included file\n if(!$header_loaded)\n {//header loads first time\n $file = 'header.php'; \n $header_loaded = true;\n }else{\n $file = 'footer.php';\n }\n \n }\n \n $file = $config->physical_path . '/themes/' . $config->theme . '/' . $file;\n \n if(file_exists($file)){\n include $file;\n }else{\n myerror(__FILE__,__LINE__,'include file not found: ' . $file);\n }\n }", "protected function makeHeader()\n {\n }", "function import($file , $load_time = 0, $on_init = false)\r\n\t{\r\n\t\treturn parent::import($file, $load_time);\r\n\t}", "function getHeader(){\n include_once ('header.php');\n}", "public function setHasHeader(bool $hasHeader): CsvImport\n {\n $this->hasHeader = $hasHeader;\n return $this;\n }", "public function import_from_file($filename)\n {\n }", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "#[Pure]\n public function getHeader($header) {}", "function build_header() {\r\n include 'header.php';\r\n\r\n}", "public function includeFile($once = true);", "abstract public function header();", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "function macro_get_class_repo_header($path)\n{\n $ns = explode('\\\\', macro_convert_path_to_class_name($path));\n array_pop($ns);\n $ns = implode('\\\\', $ns);\n\n return macro_get_file_header($path)\n . <<<HEAD\nnamespace $ns;\n\n\nHEAD;\n}", "protected function getCommonClientHeader()\r\n {\r\n $sys_ini_info = array('path' => CONF_SYS_PATH, 'name' => 'header.ini');\r\n $project_ini_info = $sys_ini_info;\r\n if (defined('CONFIG_DOMAIN_PATH')) {\r\n $project_ini_info['path'] = CONFIG_DOMAIN_PATH;\r\n }\r\n $header = clsSysCommon::getCommonIniFiles($sys_ini_info, $project_ini_info, false);\r\n if (!defined('CONFIG_DOMAIN_PATH')) {\r\n $search = array('{__class_path__}', '{__class_name__}');\r\n $repl = array($project_ini_info['path'], $project_ini_info['name']);\r\n $err_mes = clsSysCommon::getMessage('empty_file_path_in_load', 'Errors', $search, $repl);\r\n clsSysCommon::debugMessage($err_mes);\r\n }\r\n\r\n $this->scriptsManager->registerFile($header[\"Header_JS\"]);\r\n $this->stylesManager->registerFile($header[\"Header_CSS\"]);\r\n\r\n $sys_ini_info = array('path' => CONF_SYS_PATH, 'name' => 'meta.ini');\r\n $project_ini_info = $sys_ini_info;\r\n if (defined('CONFIG_DOMAIN_PATH')) {\r\n $project_ini_info['path'] = CONFIG_DOMAIN_PATH;\r\n }\r\n $this->meta_config = clsSysCommon::getCommonIniFiles($sys_ini_info, $project_ini_info, false);\r\n if (!defined('CONFIG_DOMAIN_PATH')) {\r\n $search = array('{__class_path__}', '{__class_name__}');\r\n $repl = array($project_ini_info['path'], $project_ini_info['name']);\r\n $err_mes = clsSysCommon::getMessage('empty_file_path_in_load', 'Errors', $search, $repl);\r\n clsSysCommon::debugMessage($err_mes);\r\n }\r\n }", "public function addHeader()\n {\n }", "function includeFile($file)\n{\n return include $file;\n}", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "function media_upload_header()\n {\n }", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "function import_STE()\n{\n}", "public function export_headers()\n {\n }", "function privReadCentralFileHeader(&$p_header)\n {\n }", "function agnosia_initialize_file_getter() {\r\n\r\n\trequire_once get_template_directory() . '/inc/utils/agnosia-file-getter.php';\r\n\r\n}", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "public function import(HTTPRequest $request)\n {\n $hasheader = (bool)$request->postVar('HasHeader');\n $cleardata = $this->component->getCanClearData() ?\n (bool)$request->postVar('ClearData') :\n false;\n if ($request->postVar('action_import')) {\n $file = File::get()\n ->byID($request->param('FileID'));\n if (!$file) {\n return \"file not found\";\n }\n\n $temp_file = $this->tempFileFromStream($file->getStream());\n\n $colmap = Convert::raw2sql($request->postVar('mappings'));\n if ($colmap) {\n //save mapping to cache\n $this->cacheMapping($colmap);\n //do import\n $results = $this->importFile(\n $temp_file,\n $colmap,\n $hasheader,\n $cleardata\n );\n $this->gridField->getForm()\n ->sessionMessage($results->getMessage(), 'good');\n }\n }\n $controller = $this->getToplevelController();\n $controller->redirectBack();\n }", "function rawpheno_indicate_new_headers($file, $project_id) {\n // Retrieve the header for the indicated file.\n rawpheno_add_parsing_libraries();\n $xls_obj = rawpheno_open_file($file);\n rawpheno_change_sheet($xls_obj, 'measurements');\n\n // Note: we use the foreach here\n // because the library documentation doesn't have a single fetch function.\n foreach ($xls_obj as $xls_headers) { break; }\n\n // Array to hold epected column headers specific to a given project.\n $expected_headers = rawpheno_project_traits($project_id);\n\n // Remove any formatting in each column headers.\n $expected_headers = array_map('rawpheno_function_delformat', $expected_headers);\n\n // Array to hold new column headers.\n $new_headers = array();\n\n // Assuming the file actually has a non-empty header row...\n if (count($xls_headers) > 0) {\n // Read each column header and compare against expected column headers.\n foreach($xls_headers as $value) {\n $temp_value = rawpheno_function_delformat($value);\n\n // Determine if column header exists in the expected column headers.\n if (!in_array($temp_value, $expected_headers) && !empty($value)) {\n // Not in expected column headers, save it as new header.\n $value = preg_replace('/\\s+/', ' ', $value);\n $new_headers[] = $value;\n }\n }\n }\n\n return $new_headers;\n}", "public function import() {\n return '';\n }", "function privConvertHeader2FileInfo($p_header, &$p_info)\n {\n }", "public function getExternalHeader()\n {\n $parts = explode('\\\\', $this->namespace);\n return 'ext/' . strtolower($parts[0] . DIRECTORY_SEPARATOR . str_replace('\\\\', DIRECTORY_SEPARATOR, $this->namespace) . DIRECTORY_SEPARATOR . $this->name) . '.zep';\n }", "abstract protected function getHeader(Project $project);", "function setHeaders(){\n $position = ftell($this->handle);\n rewind($this->handle);\n $read = $this->readLine();\n if( $read === FALSE){\n die(\"File is empty\");\n \n }else{\n $this->headers = $read;\n }\n\n fseek ($this->handle, $position );\n }", "private function includeFile($path) {\n // Legacy structure files require global variables.\n\n /* @var \\Gdn_Database $Database */\n $Database = $this->container->get(\\Gdn_Database::class);\n $SQL = $Database->sql();\n $Structure = $Database->structure();\n\n $r = require $path;\n if (is_callable($r)) {\n $this->container->call($r);\n }\n }", "function acf_include($filename = '')\n{\n}", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "protected function _writeFileHeader() {}", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "function fields() {\n\t\tforeach(glob(ALERTS_PLUGIN_DIR . 'lib/fields/*.php') as $field) {\n\t\t\t\tinclude($field);\n\t\t}\n\t}", "public function docHeaderContent() {}", "public function __construct($file, $hasHeaders = false, $length = 1024,\n $delimiter = ',', $enclosure = '\"', $escape = '\\\\')\n {\n if (!file_exists($file))\n {\n throw new PHPMapper_Exception_Import(\n \"$file does not exist or is not readable.\"\n );\n }\n\n if (!$this->_file = @fopen($file, 'rt'))\n {\n throw new PHPMapper_Exception_Import(\n \"Failed to open $file for reading.\"\n );\n }\n\n $this->_length = $length;\n $this->_delimiter = $delimiter;\n $this->_enclosure = $enclosure;\n $this->_escape = $escape;\n $this->_hasHeaders = $hasHeaders;\n\n $firstRow = $this->_getRow(true);\n\n if ($hasHeaders)\n {\n $this->_headers = $firstRow;\n }\n else\n {\n $this->_headers = count($firstRow);\n rewind($this->_file);\n }\n\n if (!$firstRow || empty($this->_headers))\n {\n throw new PHPMapper_Exception_Import(\n 'After reading first line -- file does not contain any columns. '\n . 'Are you using a valid delimiter?'\n );\n }\n\n $this->_lineNumber = 1;\n $this->_country = 'US';\n }", "public function includeHead()\n {\n require_once __DIR__ . '/templates/head.php';\n }", "#[Pure]\nfunction http_parse_headers($header) {}", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "public function prepareImportContent();", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "public function getHeader();", "public function getHeader();", "public function getHeader();", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function get_the_file($file_path) {\n\n md_include_component_file($file_path);\n\n }", "public function setHeadFile($file)\n {\n $this->file_head = $file;\n }", "public function getHeader() {\n }", "function gttn_tpps_file_headers($fid, $no_header = FALSE) {\n $headers = array();\n if ($no_header) {\n $hex = unpack('H*', 'A')[1];\n $width = gttn_tpps_file_width($fid);\n for ($i = 0; $i < $width; $i++) {\n $key = pack('H*', $hex);\n $headers[$key] = $i;\n $hex = gttn_tpps_increment_hex($hex);\n }\n return $headers;\n }\n\n $content = array();\n $options = array(\n 'no_header' => TRUE,\n 'max_rows' => 1,\n 'content' => &$content,\n );\n gttn_tpps_file_iterator($fid, 'gttn_tpps_parse_file_helper', $options);\n return current($content);\n}", "public function getHeader(string $header): string;", "protected function _parseHeader() {}", "function __construct($filename,$parse_header=FALSE,$delimeter=\"\\t\",$length=8000)\n {\n $this->file=fopen($filename,'r');\n $this->parse_header=$parse_header;\n $this->delimeter=$delimeter;\n $this->length=$length;\n\n if($this->parse_header==TRUE)\n $this->header=fgetcsv($this->file,$this->length,$this->delimeter);\n\n\n }", "public function importLine(Import $import, ImportLine $line);", "function head($vars = array(), $file = 'header')\n{\n return common($file, $vars);\n}", "function readInclude() {return $this->_include;}", "function ms_file_constants()\n {\n }", "function _manually_load_importer() {\n\tif ( ! class_exists( 'WP_Import' ) ) {\n\t\trequire dirname( dirname( __FILE__ ) ) . '/src/wordpress-importer.php';\n\t}\n}", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "abstract protected function header();", "public function setHeader(PoHeader $header) {\n }", "function Header(){\n\t\t}", "public function includeFile()\n {\n foreach($this->arra_constant_file as $stri_file)\n {include_once($stri_file);}\n }", "function acf_prepare_fields_for_import($fields = array())\n{\n}" ]
[ "0.5825536", "0.55880815", "0.555223", "0.55033123", "0.5476334", "0.54594433", "0.5393289", "0.53806776", "0.5344604", "0.53107595", "0.5280609", "0.5277587", "0.5267199", "0.5261294", "0.5201625", "0.51791", "0.5140578", "0.5124578", "0.51244515", "0.51139534", "0.50924206", "0.50853676", "0.5077957", "0.5077311", "0.50634974", "0.50630206", "0.5061415", "0.5043117", "0.50342906", "0.503418", "0.5024266", "0.5023876", "0.49923933", "0.49874803", "0.49815238", "0.49747518", "0.49499074", "0.49460953", "0.491205", "0.49101326", "0.48878768", "0.48811698", "0.4857795", "0.48554772", "0.48526388", "0.48247582", "0.48243904", "0.48180705", "0.4810552", "0.48011225", "0.4798992", "0.47981614", "0.47978544", "0.47912696", "0.47855216", "0.4784163", "0.477438", "0.47641948", "0.47641924", "0.47638956", "0.4762746", "0.47554016", "0.47464225", "0.4745181", "0.4742538", "0.474025", "0.4739529", "0.47354078", "0.47341275", "0.47146797", "0.47136155", "0.46984378", "0.46976388", "0.46874857", "0.46866146", "0.46863377", "0.46852198", "0.46851182", "0.46820527", "0.46820527", "0.46820527", "0.46774614", "0.46709776", "0.46505338", "0.46410766", "0.46372524", "0.4633546", "0.46308237", "0.4629288", "0.46236464", "0.46225813", "0.46194258", "0.46172482", "0.46162245", "0.4603294", "0.45994675", "0.45992732", "0.45945555", "0.45913813", "0.4580793" ]
0.46267387
89
Imports a menu header i.e. a field's declaration.
protected function process_header_menu(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function v2_mumm_menu_link__menu_header(&$variables) {\n\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) {\n\n $output = '<button id=\"search-btn\" class=\"icon icon-search-gray search-btn\" data-trigger-toggle=\"search-box\" title=\"\" name=\"search-btn\" type=\"button\"\n data-tracking data-track-action=\"click\" data-track-category=\"header\" data-track-label=\"search\" data-track-type=\"event\">\n </button>';\n }\n else {\n $class = $element['#localized_options']['attributes']['class'];\n $element['#localized_options']['attributes'] = array(\n 'class' =>$class,\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => 'book_a_visit',\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']);\n }\n return $output;\n}", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "function erp_get_menu_headers() {\n $menu = [];\n return apply_filters( 'erp_menu_headers', $menu );\n}", "function v2_mumm_menu_tree__menu_header(&$variables) {\n return $variables['tree'];\n}", "function add_admin_header() {\n }", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function import_page() {\n\t// add top level menu page\n\tadd_submenu_page(\n\t\t'edit.php?post_type=guide',\n\t\t'Guide Import',\n\t\t'Import',\n\t\t'publish_posts',\n\t\t'import',\n\t\t'\\CCL\\Guides\\import_page_html'\n\t);\n}", "function loadMenu($arg_menu_name)\n{\n\tINCLUDE('menus/' . $arg_menu_name . '.mnu');\n\treturn $menu;\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function in_admin_header()\n {\n }", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function get_menu_label() {\n\t\treturn __( 'Import', 'the-events-calendar' );\n\t}", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function menuFlow() {\n\t\tincludeFile('templates/mainmenu');\n\t\techo PHP_EOL;\n\t}", "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "function clsRecordheaderHMenu($RelativePath, & $Parent)\r\n {\r\n\r\n global $FileName;\r\n global $CCSLocales;\r\n global $DefaultDateFormat;\r\n $this->Visible = true;\r\n $this->Parent = & $Parent;\r\n $this->RelativePath = $RelativePath;\r\n $this->Errors = new clsErrors();\r\n $this->ErrorBlock = \"Record HMenu/Error\";\r\n $this->ReadAllowed = true;\r\n if($this->Visible)\r\n {\r\n $this->ComponentName = \"HMenu\";\r\n $CCSForm = split(\":\", CCGetFromGet(\"ccsForm\", \"\"), 2);\r\n if(sizeof($CCSForm) == 1)\r\n $CCSForm[1] = \"\";\r\n list($FormName, $FormMethod) = $CCSForm;\r\n $this->FormEnctype = \"application/x-www-form-urlencoded\";\r\n $this->FormSubmitted = ($FormName == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->home = & new clsControl(ccsLink, \"home\", \"home\", ccsText, \"\", CCGetRequestParam(\"home\", $Method, NULL), $this);\r\n $this->home->Page = $this->RelativePath . \"../index.php\";\r\n $this->users = & new clsControl(ccsLink, \"users\", \"users\", ccsText, \"\", CCGetRequestParam(\"users\", $Method, NULL), $this);\r\n $this->users->Page = $this->RelativePath . \"users.php\";\r\n $this->categories = & new clsControl(ccsLink, \"categories\", \"categories\", ccsText, \"\", CCGetRequestParam(\"categories\", $Method, NULL), $this);\r\n $this->categories->Page = $this->RelativePath . \"categories.php\";\r\n $this->config = & new clsControl(ccsLink, \"config\", \"config\", ccsText, \"\", CCGetRequestParam(\"config\", $Method, NULL), $this);\r\n $this->config->Page = $this->RelativePath . \"config.php\";\r\n $this->messages = & new clsControl(ccsLink, \"messages\", \"messages\", ccsText, \"\", CCGetRequestParam(\"messages\", $Method, NULL), $this);\r\n $this->messages->Page = $this->RelativePath . \"content.php\";\r\n $this->permissions = & new clsControl(ccsLink, \"permissions\", \"permissions\", ccsText, \"\", CCGetRequestParam(\"permissions\", $Method, NULL), $this);\r\n $this->permissions->Page = $this->RelativePath . \"permissions.php\";\r\n $this->email_templates = & new clsControl(ccsLink, \"email_templates\", \"email_templates\", ccsText, \"\", CCGetRequestParam(\"email_templates\", $Method, NULL), $this);\r\n $this->email_templates->Page = $this->RelativePath . \"email_templates.php\";\r\n $this->custom_fields = & new clsControl(ccsLink, \"custom_fields\", \"custom_fields\", ccsText, \"\", CCGetRequestParam(\"custom_fields\", $Method, NULL), $this);\r\n $this->custom_fields->Page = $this->RelativePath . \"custom_fields.php\";\r\n $this->logout = & new clsControl(ccsLink, \"logout\", \"logout\", ccsText, \"\", CCGetRequestParam(\"logout\", $Method, NULL), $this);\r\n $this->logout->Page = $this->RelativePath . \"../index.php\";\r\n $this->user_login = & new clsControl(ccsLabel, \"user_login\", \"user_login\", ccsText, \"\", CCGetRequestParam(\"user_login\", $Method, NULL), $this);\r\n $this->style = & new clsControl(ccsListBox, \"style\", \"style\", ccsText, \"\", CCGetRequestParam(\"style\", $Method, NULL), $this);\r\n $this->style->DSType = dsListOfValues;\r\n $this->style->Values = array(array(\"Basic\", \"Basic\"), array(\"Blueprint\", \"Blueprint\"), array(\"CoffeeBreak\", \"CoffeeBreak\"), array(\"Compact\", \"Compact\"), array(\"GreenApple\", \"GreenApple\"), array(\"Innovation\", \"Innovation\"), array(\"Pine\", \"Pine\"), array(\"SandBeach\", \"SandBeach\"), array(\"School\", \"School\"));\r\n $this->locale = & new clsControl(ccsListBox, \"locale\", \"locale\", ccsText, \"\", CCGetRequestParam(\"locale\", $Method, NULL), $this);\r\n $this->locale->DSType = dsListOfValues;\r\n $this->locale->Values = array(array(\"en\", $CCSLocales->GetText(\"cal_english\")), array(\"ru\", $CCSLocales->GetText(\"cal_russian\")));\r\n $this->Button_Apply = & new clsButton(\"Button_Apply\", $Method, $this);\r\n if(!is_array($this->user_login->Value) && !strlen($this->user_login->Value) && $this->user_login->Value !== false)\r\n $this->user_login->SetText(CCGetUserLogin());\r\n }\r\n }", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "function pudla_ocdi_after_import_setup() {\n\t$main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );\n\n\tset_theme_mod( 'nav_menu_locations', array(\n\t\t\t'main-menu' => $main_menu->term_id,\n\t\t)\n\t);\n\t\n\t// Assign front page and posts page (blog page).\n $front_page_id = get_page_by_title( 'Home' );\n $blog_page_id = get_page_by_title( 'Blog' );\n\n update_option( 'show_on_front', 'page' );\n update_option( 'page_on_front', $front_page_id->ID );\n update_option( 'page_for_posts', $blog_page_id->ID );\n\t\n}", "function cmo_after_import_setup($selected_import) {\n $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );\n\n set_theme_mod( 'nav_menu_locations', array (\n 'main_menu' => $main_menu->term_id,\n )\n );\n\n // Assign front page and posts page (blog page).\n $front_page_id = get_page_by_title( 'Home' );\n $blog_page_id = get_page_by_title( 'Blog' );\n\n // Disable Elementor's Default Colors and Default Fonts\n update_option( 'elementor_disable_color_schemes', 'yes' );\n update_option( 'elementor_disable_typography_schemes', 'yes' );\n update_option( 'elementor_global_image_lightbox', '' );\n\n // Set the home page and blog page\n update_option( 'show_on_front', 'page' );\n update_option( 'page_on_front', $front_page_id->ID );\n update_option( 'page_for_posts', $blog_page_id->ID );\n\n}", "function Header(){\n\t\t}", "public static function menu(){\n return new sai_module_menu( 1,\n sai_module_menu::POISITION_RIGHT,\n sai_module_menu::DIVIDER_NONE,\n \\SYSTEM\\PAGE\\replace::replaceFile((new \\SYSTEM\\PSAI('modules/saimod_sys_git/tpl/menu.tpl'))->SERVERPATH()));}", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "public function getMenuTitle(): string;", "function soho_menu_link__header_menu(array $variables) {\n $output = '';\n unset($variables['element']['#attributes']['class']);\n $element = $variables['element'];\n static $item_id = 0;\n $menu_name = $element['#original_link']['menu_name'];\n\n // set the global depth variable\n global $depth;\n $depth = $element['#original_link']['depth'];\n\n if ( ($element['#below']) && ($depth == \"1\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children '.$element['#original_link']['mlid'].'';\n }\n \n if ( ($element['#below']) && ($depth >= \"2\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children';\n }\n \n $sub_menu = $element['#below'] ? drupal_render($element['#below']) : '';\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']);\n // if link class is active, make li class as active too\n if(strpos($output,\"active\")>0){\n $element['#attributes']['class'][] = \"current-menu-parent\";\n }\n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';\n \n}", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "function display_header() {}", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"RAD Facility\", \"LIBRARIES\", \"_rad_facility\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_dxcodes\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "public function modMenu() {}", "public function import(stdClass $menu, stdClass $row) {\n // Invoke migration prepare handlers\n $this->prepare($menu, $row);\n\n // Menus are handled as arrays, so clone the object to an array.\n $menu = clone $menu;\n $menu = (array) $menu;\n\n // Check to see if this is a new menu.\n $update = FALSE;\n if ($data = menu_load($menu['menu_name'])) {\n $update = TRUE;\n }\n\n // menu_save() provides no return callback, so we can't really test this\n // without running a menu_load() check.\n migrate_instrument_start('menu_save');\n menu_save($menu);\n migrate_instrument_stop('menu_save');\n\n // Return the new id or FALSE on failure.\n if ($data = menu_load($menu['menu_name'])) {\n // Increment the count if the save succeeded.\n if ($update) {\n $this->numUpdated++;\n }\n else {\n $this->numCreated++;\n }\n // Return the primary key to the mapping table.\n $return = array($data['menu_name']);\n }\n else {\n $return = FALSE;\n }\n\n // Invoke migration complete handlers.\n $menu = (object) $data;\n $this->complete($menu, $row);\n\n return $return;\n }", "public function modMenu() {}", "public function modMenu() {}", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "function opinionstage_settings_load_header(){\n}", "private function createTab() {\n\t\t$moduleToken = t3lib_formprotection_Factory::get()->generateToken('moduleCall', self::MODULE_NAME);\n\t\treturn $this->doc->getTabMenu(\n\t\t\tarray('M' => self::MODULE_NAME, 'moduleToken' => $moduleToken, 'id' => $this->id),\n\t\t\t'tab',\n\t\t\tself::IMPORT_TAB,\n\t\t\tarray(self::IMPORT_TAB => $GLOBALS['LANG']->getLL('import_tab'))\n\t\t\t) . $this->doc->spacer(5);\n\t}", "function kvell_edge_get_header_vertical_main_menu() {\n\t\t$opening_class = '';\n\t\t$menu_opening = kvell_edge_options()->getOptionValue('vertical_menu_dropdown_opening');\n\n\t\tif ($menu_opening !== '') {\n\t\t\t$opening_class .= 'edgtf-vertical-dropdown-'.$menu_opening;\n\t\t}\n\n\t\t$params = array(\n\t\t\t'opening_class' => $opening_class\n\t\t);\n\n\t\tkvell_edge_get_module_template_part( 'templates/vertical-navigation', 'header/types/header-vertical', '', $params );\n\t}", "function minorite_header($variables){\n return '<header'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</header>';\n}", "private function init_menu()\n {\n // it's a sample code you can init some other part of your page\n }", "protected function process_header_multimenu(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "function displayList ($MainId= -1){\r\n\t$menuurl ='./pluginstandalone/Adds/loadusermenu.php';\r\n\t$menuname = 'Adds';\r\n\tinclude ('submenulayout.php');\r\n}", "protected function generateModuleMenu() {}", "public function import();", "public function settings_header() {\n\t\t$this->include_template('wp-admin/settings/header.php');\n\t}", "function theme_hbmode_process_header($app, &$vars) {\n $entries = $app->module('collections')->find(\"main_menu\");\n foreach ($entries as $entry) {\n $vars['links'][$entry['_id']] = [\n 'title' => $entry['title'],\n 'slug' => $entry['link'],\n ];\n }\n}", "public function makeMenu() {}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "public function include_import_export(){\n\t\tglobal $import;\n\n\t\t// Load the Import class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-import.php' );\n\t\t$import = new VisualFormBuilder_Pro_Import();\n\t}", "public function Header(){\n $ci =& get_instance();\n // Select Arial bold 15\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',16);\n // Move to the right\n //$this->Cell(80);\n // Framed title\n // Logo\n $this->Image(asset_url() . \"images/logo.png\",11,5,0,20);\n $this->Ln(15);\n $this->Cell(0,10,\"GetYourGames\",0,1,'L');\n $this->SetFont('Futura-Medium','',12);\n $this->Cell(0,10,site_url(),0,1,\"L\");\n $this->Ln(5);\n $this->SetFont('Futura-Medium','',18);\n $this->Cell(0,10,utf8_decode($this->title),0,1,'C');\n // Line break\n $this->Ln(10);\n $this->SetFont('Futura-Medium','',11);\n $this->Cell(15,10,utf8_decode('#'),'B',0,'C');\n $this->Cell(100,10,utf8_decode($ci->lang->line('table_product')),'B',0,'L');\n $this->Cell(30,10,utf8_decode($ci->lang->line('table_qty')),'B',0,'L');\n $this->Cell(40,10,utf8_decode($ci->lang->line('table_subtotal')),'B',1,'L');\n\n $this->Ln(2);\n }", "public function register_import_settings_page() {\n\t\tadd_menu_page(\n\t\t\t__( 'Amazon Product Import', 'textdomain' ),\n\t\t\t'Amazon Product Import',\n\t\t\t'manage_options',\n\t\t\t__DIR__ . '/partials/amazon-product-import-admin-display.php',\n\t\t\t'',\n\t\t\t'dashicons-download',\n\t\t\t6\n\t\t);\n\t}", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "function header() {\n\t\techo '<div class=\"wrap\">';\n\t\tscreen_icon();\n\t\techo '<h2>化工产品目录CSV导入</h2>';\n\t}", "function sloodle_print_header()\n {\n global $CFG;\n\n // Offer the user an 'update' button if they are allowed to edit the module\n $editbuttons = '';\n if ($this->canedit) {\n $editbuttons = update_module_button($this->cm->id, $this->course->id, get_string('modulename', 'sloodle'));\n }\n // Display the header\n $navigation = \"<a href=\\\"index.php?id={$this->course->id}\\\">\".get_string('modulenameplural','sloodle').\"</a> ->\";\n sloodle_print_header_simple(format_string($this->sloodle->name), \"&nbsp;\", \"{$navigation} \".format_string($this->sloodle->name), \"\", \"\", true, $editbuttons, navmenu($this->course, $this->cm));\n\n // Display the module name\n $img = '<img src=\"'.$CFG->wwwroot.'/mod/sloodle/icon.gif\" width=\"16\" height=\"16\" alt=\"\"/> ';\n sloodle_print_heading($img.$this->sloodle->name, 'center');\n \n // Display the module type and description\n $fulltypename = get_string(\"moduletype:{$this->sloodle->type}\", 'sloodle');\n echo '<h4 style=\"text-align:center;\">'.get_string('moduletype', 'sloodle').': '.$fulltypename;\n echo sloodle_helpbutton(\"moduletype_{$this->sloodle->type}\", $fulltypename, 'sloodle', true, false, '', true).'</h4>';\n // We'll apply a general introduction to all Controllers, since they seem to confuse lots of people!\n $intro = $this->sloodle->intro;\n if ($this->sloodle->type == SLOODLE_TYPE_CTRL) $intro = '<p style=\"font-style:italic;\">'.get_string('controllerinfo','sloodle').'</p>' . $this->sloodle->intro;\n\t\t// Display the intro in a box, if we have an intro\n\t\tif (!empty($intro)) sloodle_print_box($intro, 'generalbox', 'intro');\n \n }", "public function getAdminPanelHeaderData() {}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}" ]
[ "0.6113794", "0.6066346", "0.5881728", "0.5825984", "0.5768642", "0.5755341", "0.5620417", "0.56002325", "0.55975974", "0.55110526", "0.5441443", "0.5436225", "0.5424692", "0.5401995", "0.53944194", "0.53746486", "0.536518", "0.53514105", "0.53514105", "0.5349178", "0.5345487", "0.53448886", "0.53433174", "0.53433174", "0.5341779", "0.5333896", "0.532777", "0.5319059", "0.5302782", "0.52774143", "0.52719843", "0.5258969", "0.5239108", "0.5212319", "0.52009296", "0.51973444", "0.51944363", "0.51942945", "0.51942265", "0.51941675", "0.51906866", "0.51892066", "0.5183287", "0.51781464", "0.51683617", "0.51679105", "0.5166834", "0.51587576", "0.51490694", "0.51418316", "0.51383305", "0.5135072", "0.51318765", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5126764", "0.5125002", "0.512392", "0.5100141", "0.50971645", "0.50957334", "0.50944006", "0.5091079", "0.50875133", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176", "0.50823176" ]
0.5890757
2
Imports a multimenu header i.e. a field's declaration.
protected function process_header_multimenu(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "public function buildHeaderFields() {}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "public function extObjHeader() {}", "function minorite_header($variables){\n return '<header'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</header>';\n}", "protected function makeHeader()\n {\n }", "public function pi_list_header() {}", "public function import();", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "function Header(){\n\t\t}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "public function getInputHeaders()\n {\n }", "abstract public function header();", "function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}", "public function add_header() {\n }", "public function addHeader()\n {\n }", "function add_admin_header() {\n }", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "public function import()\n {\n \n }", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "public function fields()\n\t{\n\t\t$block = new FieldsBuilder('page_header');\n\t\t$block\n\t\t\t->addText('title', [\n\t\t\t\t'label' => 'Title',\n\t\t\t\t'instructions' => 'Enter an optional title for this page header (will default to page title)',\n\t\t\t])\n\t\t\t->addImage('image', [\n\t\t\t\t'label' => 'Image',\n\t\t\t\t'instructions' => 'Select the image to be used in this page header (will default to featured image)'\n\t\t\t]);\n\n\t\treturn $block->build();\n\t}", "function privReadFileHeader(&$p_header)\n {\n }", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeader();", "public function getHeader();", "public function getHeader();", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "public function getFullHeader()\n {\n }", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "function loadHeaders() {\n\n\t\t$id = \"original_id\";\n\t\t$title = \"title\";\n\t\t\n\t\treturn $id . $_POST[$id] . \"&\" . $title . $_POST[$title];\n\n\t}", "public function __construct(array $fields = null, array $hprimGlobals = null)\n {\n\n // http://interopsante.org/offres/doc_inline_src/412/HPsante24-modif%5B0%5D.pdf\n //0 : Header : H\n //1 : Definition des séparateurs\n //2 : \n\n parent::__construct('L', $fields); // HEADER of sequency\n $this->setField(1, '1'); // Set Separator\n //$this->setField(2, 'L'); // Set Separator\n //$this->setField(2, '1'); // Set Separator\n\n if (isset($fields)) {\n return;\n }\n }", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "#[Pure]\n public function getHeader($header) {}", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "public function Header(){\n\n }", "function getFieldHeader($fN)\t{\r\n\t\tswitch($fN) {\r\n\t\t\tcase \"title\":\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_title','<em>title</em>');\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function import(): void;", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "function prepare_field_for_import($field)\n {\n }", "public function setHasHeader(bool $hasHeader): CsvImport\n {\n $this->hasHeader = $hasHeader;\n return $this;\n }", "public function include_import_export(){\n\t\tglobal $import;\n\n\t\t// Load the Import class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-import.php' );\n\t\t$import = new VisualFormBuilder_Pro_Import();\n\t}", "public function export_headers()\n {\n }", "public function getHeader() {\n }", "protected function getCommonClientHeader()\r\n {\r\n $sys_ini_info = array('path' => CONF_SYS_PATH, 'name' => 'header.ini');\r\n $project_ini_info = $sys_ini_info;\r\n if (defined('CONFIG_DOMAIN_PATH')) {\r\n $project_ini_info['path'] = CONFIG_DOMAIN_PATH;\r\n }\r\n $header = clsSysCommon::getCommonIniFiles($sys_ini_info, $project_ini_info, false);\r\n if (!defined('CONFIG_DOMAIN_PATH')) {\r\n $search = array('{__class_path__}', '{__class_name__}');\r\n $repl = array($project_ini_info['path'], $project_ini_info['name']);\r\n $err_mes = clsSysCommon::getMessage('empty_file_path_in_load', 'Errors', $search, $repl);\r\n clsSysCommon::debugMessage($err_mes);\r\n }\r\n\r\n $this->scriptsManager->registerFile($header[\"Header_JS\"]);\r\n $this->stylesManager->registerFile($header[\"Header_CSS\"]);\r\n\r\n $sys_ini_info = array('path' => CONF_SYS_PATH, 'name' => 'meta.ini');\r\n $project_ini_info = $sys_ini_info;\r\n if (defined('CONFIG_DOMAIN_PATH')) {\r\n $project_ini_info['path'] = CONFIG_DOMAIN_PATH;\r\n }\r\n $this->meta_config = clsSysCommon::getCommonIniFiles($sys_ini_info, $project_ini_info, false);\r\n if (!defined('CONFIG_DOMAIN_PATH')) {\r\n $search = array('{__class_path__}', '{__class_name__}');\r\n $repl = array($project_ini_info['path'], $project_ini_info['name']);\r\n $err_mes = clsSysCommon::getMessage('empty_file_path_in_load', 'Errors', $search, $repl);\r\n clsSysCommon::debugMessage($err_mes);\r\n }\r\n }", "function fields() {\n\t\tforeach(glob(ALERTS_PLUGIN_DIR . 'lib/fields/*.php') as $field) {\n\t\t\t\tinclude($field);\n\t\t}\n\t}", "public function prepareImport();", "protected function _parseHeader() {}", "function getHeader(){\n\t\trequire 'pages/headerfooter/header.html';\n\t}", "public function wishlist_header( $var ) {\n\t\t $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';\n\t\t\t$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';\n\n\t\t yith_wcwl_get_template_part( $template, 'header', $layout, $var );\n }", "function _webform_csv_headers_email($component) {\r\n $header = array();\r\n $header[0] = '';\r\n $header[1] = '';\r\n $header[2] = $component['name'];\r\n return $header;\r\n}", "function &addHeader($type = 'all') {\r\n\t \tif (empty($this->rtf->oddEvenDifferent) && $type == 'all') {\r\n\t\t $header = new Header($this->rtf, $type);\r\n\t\t} else if (!empty($this->rtf->oddEvenDifferent) \r\n\t\t\t\t\t\t&& ($type == 'left' || $type == 'right')) {\t\t \r\n\t\t \t$header = new Header($this->rtf, $type);\t\r\n\t\t} else if ($type == 'first') {\r\n\t\t \t$header = new Header($this->rtf, $type);\t\r\n\t\t \t$this->titlepg = 1;\r\n\t\t} else {\t\t\t\r\n\t\t \treturn;\r\n\t\t}\t\t \r\n\r\n\t\t$this->headers[$type] = &$header;\r\n\t\treturn $header;\t\t\r\n\t}", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "function vcex_get_module_header( $args = array() ) {\n\tif ( function_exists( 'wpex_get_heading' ) ) {\n\t\t$header = wpex_get_heading( $args );\n\t} else {\n\t\t$header = '<h2 class=\"vcex-module-heading\">' . do_shortcode( wp_kses_post( $args['content'] ) ) . '</h2>';\n\t}\n\n\t/**\n\t * Filters the vcex shortcode header html.\n\t *\n\t * @param string $header_html\n\t * @param array $header_args\n\t */\n\t$header = apply_filters( 'vcex_get_module_header', $header, $args );\n\n\treturn $header;\n}", "function pxlz_edgtf_set_header_object() {\n $header_type = pxlz_edgtf_get_meta_field_intersect('header_type', pxlz_edgtf_get_page_id());\n $header_types_option = pxlz_edgtf_get_header_type_options();\n\n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if (Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\PxlzEdgefHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "public function initializeHeader(array $header): void\n {\n // removes forbidden symbols from header (field names)\n $this->header = array_map(function (string $name): string {\n return preg_replace('~[^a-z0-9_-]+~i', '_', $name);\n }, $header);\n }", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "function display_header() {}", "public function header() {\n\t}", "function local_powerprouserexport_get_user_csv_headers() {\n return array(\n get_string('username', 'local_powerprouserexport'),\n get_string('email', 'local_powerprouserexport'),\n get_string('firstname', 'local_powerprouserexport'),\n get_string('lastname', 'local_powerprouserexport'),\n get_string('country', 'local_powerprouserexport'),\n get_string('dob', 'local_powerprouserexport'),\n get_string('streetnumber', 'local_powerprouserexport'),\n get_string('streetname', 'local_powerprouserexport'),\n get_string('town', 'local_powerprouserexport'),\n get_string('postcode', 'local_powerprouserexport'),\n get_string('state', 'local_powerprouserexport'),\n get_string('gender', 'local_powerprouserexport'),\n get_string('postaladdress', 'local_powerprouserexport'),\n get_string('employer', 'local_powerprouserexport'),\n get_string('idnumber', 'local_powerprouserexport'),\n get_string('phone', 'local_powerprouserexport'),\n );\n}", "public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}", "function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }", "public function docHeaderContent() {}", "public function setHeader(PoHeader $header) {\n }", "function header() {\n\t\techo '<div class=\"wrap\">';\n\t\tscreen_icon();\n\t\techo '<h2>化工产品目录CSV导入</h2>';\n\t}", "protected function getHeaderPart()\n {\n //$logo_url = ot_get_option('header_logo', 'img/logo.jpg');\n ?>\n <?= $this->version151101() ?>\n <?= $this->getBannerPart() ?>\n <?php\n }", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('columnheaders', $this->data->_data[1]);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "abstract protected function getHeader(Project $project);", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "private function loadHeaderTable($name) {\n\t$template = $this->loadTemplate(\"templates/controls/grid/templateListHeader.txt\");\n\t$template = $this->replaceTemplateString($template, \"[scaffold-name]\", $name);\n\treturn $template;\n }", "protected function initializeImport() {}", "public function getHeaderPrototype()\n\t{\n\t\treturn $this->header;\n\t}", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "private function setHeader($header)\n {\n $this->header = trim((string) $header);\n $this->headerComment = '';\n\n if ('' !== $this->header) {\n $this->headerComment = $this->encloseTextInComment($this->header);\n }\n }", "public static function headerDeclarations()\n {\n if (self::$loaded) {\n return;\n }\n\n $app = JFactory::getApplication();\n $doc = JFactory::getDocument();\n\n $siteUrl = JURI::root(true);\n\n $baseSite = 'components/' . COM_PAPIERSDEFAMILLES;\n $baseAdmin = 'administrator/components/' . COM_PAPIERSDEFAMILLES;\n\n $componentUrl = $siteUrl . '/' . $baseSite;\n $componentUrlAdmin = $siteUrl . '/' . $baseAdmin;\n\n JHtml::_('jquery.framework');\n JHtml::_('formbehavior.chosen', 'select');\n\n //JDom::_('framework.hook');\n JDom::_('html.icon.glyphicon');\n\n\n //Load the jQuery-Validation-Engine (MIT License, Copyright(c) 2011 Cedric Dugas http://www.position-absolute.com)\n self::addScript($baseAdmin, 'js/jquery.validationEngine.js');\n self::addStyleSheet($baseAdmin, 'css/validationEngine.jquery.css');\n PapiersdefamillesHelperHtmlValidator::loadLanguageScript();\n PapiersdefamillesHelperHtmlValidator::attachForm();\n\n\n //CSS\n if ($app->isAdmin()) {\n\n\n self::addStyleSheet($baseAdmin, 'css/papiersdefamilles.css');\n self::addStyleSheet($baseAdmin, 'css/toolbar.css');\n\n } else {\n if ($app->isSite()) {\n self::addStyleSheet($baseSite, 'css/papiersdefamilles.css');\n self::addStyleSheet($baseSite, 'css/toolbar.css');\n\n }\n }\n\n\n self::$loaded = true;\n }", "function get_custom_header()\n {\n }", "function media_upload_header()\n {\n }", "function make_header1($name, $results) {\n\n\tif ($name=='full') {\n\t\t$fp = fopen(\"../\" . $name . \".h\", \"w\");\n\t}\n\telse {\n\t\t$s = \"../\" . $name . \".h\";\n\t\t$fp = fopen($s, \"w\");\n\t}\n\n\n\tfprintf($fp, \"#ifndef _%s_H_\\r\\n\", strtoupper($name));\n\tfprintf($fp, \"#define _%s_H_\\r\\n\\r\\n\", strtoupper($name));\n\n\t//$contents = file_get_contents(\"../../tlib/public.h\");\n\n\n\n\t/*\n\tfprintf($fp, \"\\r\\n#include \\\"levels.h\\\"\\r\\n\");\n\tfprintf($fp, \"\\r\\n#if LEVEL == DLL_%s_ACCESS\\r\\n\\r\\n\", strtoupper($name));\n\t*/\n\n\t//fprintf($fp, \"#include <tdefs.h>\\r\\n\");\n\t//fprintf($fp, \"#include <course.h>\\r\\n\\r\\n\");\n\n\tfprintf($fp, \"#include <public.h>\\r\\n\\r\\n\");\n\n\tif ($name==\"full\") {\n\t\tfprintf($fp, \"#include <physics.h>\\r\\n\");\n\t\tfprintf($fp, \"#include <datasource.h>\\r\\n\\r\\n\");\n\t\tfprintf($fp, \"#include <decoder.h>\\r\\n\\r\\n\");\n\t}\n\telse if ($name==\"ergvideo\") {\n\t\tfprintf($fp, \"#include <bike.h>\\r\\n\\r\\n\");\n\t}\n\telse if ($name==\"trinerd\") {\n\t\t//fprintf($fp, \"#include <bike.h>\\r\\n\\r\\n\");\n\t}\n\n\t//-------------------------------\n\t// add the mapping:\n\t//-------------------------------\n\n\t$n = count($results[$name]);\n\n\tfor($i=0; $i<$n; $i++) {\n\t\t$original = $results[$name][$i]['original'];\n\t\t$encrypted = $results[$name][$i]['encrypted'];\n\t\tfprintf($fp, \"#define %-30s %s\\n\", $original, $encrypted);\n\t}\n\n\n\tfprintf($fp, \"\\r\\n\");\n\tfprintf($fp, \"//-------------------------------\\r\\n\");\n\tfprintf($fp, \"// prototypes:\\r\\n\");\n\tfprintf($fp, \"//-------------------------------\\r\\n\\r\\n\");\n\n\t//-------------------------------\n\t// add the prototype:\n\t//-------------------------------\n\n\tfor($i=0; $i<$n; $i++) {\n\t\t$original = $results[$name][$i]['original'];\n\t\t$encrypted = $results[$name][$i]['encrypted'];\n\t\t$proto = $results[$name][$i]['proto'];\n\t\t$s = str_replace($original, $encrypted, $proto);\n\t\tfprintf($fp, \"__declspec(dllexport) %s;\\r\\n\", $s);\n\t}\n\n\t//fprintf($fp, \"\\r\\n#endif\t\t\t\t//#if LEVEL == DLL_%s_ACCESS\\\"\\r\\n\", strtoupper($name));\n\n\tfprintf($fp, \"\\n#endif\t\t\t\t// #ifdef _%s_H_\\n\\n\", strtoupper($name));\n\tfclose($fp);\n\n\treturn;\n}", "abstract protected function header();", "function wp_admin_headers()\n {\n }", "function acf_prepare_field_for_import($field)\n{\n}", "public function header() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfHeader'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateHeader', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}", "public function setHeader($var)\n {\n GPBUtil::checkEnum($var, \\Eolymp\\Typewriter\\Block_Table_Header::class);\n $this->header = $var;\n\n return $this;\n }", "private function build_header() {\n\t\t// if we've already got the cart ID, use it\n\t\t$header = self::fetch('cart_header', [':cart_id' => $this->id()]);\n\n\t\t$header['date_created'] = ck_datetime::datify(@$header['date_created']);\n\t\tif (!empty($header['date_updated'])) $header['date_updated'] = ck_datetime::datify($header['date_updated']);\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "function opinionstage_settings_load_header(){\n}", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "function import_STE()\n{\n}", "public function getHeaderData() {}", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "#[Pure]\nfunction http_parse_headers($header) {}", "function build_header()\n{\n global $displayName;\n\n include 'header.php';\n}", "private function parseClassHeader($classInfo, $line)\r\n {\r\n $classInfo->abstract = (preg_match('/^abstract/', $line) === 1);\r\n $matches = array();\r\n if(preg_match('/^(abstract)? ?class ([a-zA-Z1-9_]*)/', $line, $matches) > 0)\r\n {\r\n $classInfo->name = trim($matches[2]);\r\n $classInfo->interface = false;\r\n \r\n $matches = array();\r\n preg_match('/extends ([a-zA-Z1-9_]*)/', $line, $matches);\r\n if(count($matches) > 0)\r\n {\r\n $classInfo->extends = trim($matches[1]);\r\n }\r\n \r\n $matches = array();\r\n preg_match('/implements ([a-zA-Z1-9_, ]*)/', $line, $matches);\r\n if(count($matches) > 0)\r\n {\r\n $classInfo->implements = explode(\",\", trim($matches[1]));\r\n array_walk($classInfo->implements, create_function('&$a', '$a = trim($a);'));\r\n }\r\n }\r\n else if(preg_match('/^interface ([a-zA-Z1-9_]*)/', $line, $matches) > 0)\r\n {\r\n $classInfo->name = trim($matches[1]);\r\n $classInfo->interface = true;\r\n }\r\n }" ]
[ "0.6312118", "0.5849796", "0.5717642", "0.56133515", "0.5545637", "0.5534794", "0.55178726", "0.54929554", "0.5487967", "0.54194546", "0.54021776", "0.5385378", "0.53764075", "0.53468424", "0.5338391", "0.53024846", "0.5293534", "0.5293432", "0.5278267", "0.5257394", "0.5250276", "0.52483463", "0.52437764", "0.52337754", "0.5222172", "0.5219557", "0.521605", "0.5213852", "0.52055746", "0.5204477", "0.5199262", "0.5179012", "0.5179012", "0.5179012", "0.51776385", "0.5166556", "0.51648605", "0.5163681", "0.515725", "0.5155893", "0.5154067", "0.515364", "0.51461935", "0.5140114", "0.5135408", "0.5126301", "0.5118593", "0.5117633", "0.5117406", "0.51014566", "0.5097058", "0.50738406", "0.5059496", "0.5057457", "0.5056464", "0.5050851", "0.5047817", "0.50442743", "0.5043912", "0.50431156", "0.50386214", "0.5032827", "0.5028828", "0.5023878", "0.5022898", "0.5022618", "0.5011766", "0.500956", "0.5005474", "0.5005408", "0.49957886", "0.49849412", "0.49842298", "0.4981407", "0.49762174", "0.49736452", "0.49640566", "0.49605805", "0.4958776", "0.4958449", "0.49540716", "0.49527362", "0.49485615", "0.49465176", "0.49443445", "0.49371293", "0.49361593", "0.4934853", "0.49242938", "0.4920221", "0.49054042", "0.48987257", "0.4897159", "0.48916683", "0.48852673", "0.4884771", "0.4881869", "0.4880696", "0.48797423", "0.48792058" ]
0.51488835
42
Imports a number header i.e. a field's declaration.
protected function process_header_number(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function min_headings_num() {\n\t\t$this->section_data['general_min_headings_num'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_min_headings_num',\n\t\t\t'label' \t\t\t\t=> __( 'Display TOC when', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> '',\n\t\t\t'type' \t\t\t\t\t=> 'number',\n\t\t\t'input_attrs'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => 'small-text'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t'sanitize'\t\t\t=> 'absint',\n\t\t\t'suffix'\t\t\t\t=> __( 'or more headings are present.', 'fixedtoc' )\n\t\t);\n\t}", "function uwwtd_field_num($field) {\n// $field[0]['#markup'] = 'Not provided';\n return uwwtd_format_number($field[0]['#markup'], 1);\n}", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "public function getNumber() {}", "private function AddHeaderDigit($i)\n {\n $this->length = $this->length * 16 + $i;\n }", "function _field_number($fval) \n {\n return $this->_field_text($fval);\n }", "public function getNumber();", "public function fnReadNumber($bStartsWithDot) \n {\n $iStart = $this->iPos;\n if (!$bStartsWithDot && $this->fnReadInt(10) === null) \n $this->fnRaise($iStart, \"Invalid number\");\n $bOctal = ($this->iPos - $iStart) >= 2\n && Utilities::fnGetCharAt($this->sInput, $iStart) == 48;\n if ($bOctal && $this->bStrict) \n $this->fnRaise($iStart, \"Invalid number\");\n if ($bOctal \n && preg_match(\n \"/[89]/\", \n mb_substr(\n $this->sInput, \n $iStart, \n $this->iPos - $iStart\n )\n )\n ) \n $bOctal = false;\n $iNext = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n if ($iNext == 46 && !$bOctal) { // '.'\n ++$this->iPos;\n $this->fnReadInt(10);\n $iNext = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n }\n if (($iNext == 69 || $iNext == 101) && !$bOctal) { // 'eE'\n $iNext = Utilities::fnGetCharAt($this->sInput, ++$this->iPos);\n if ($iNext == 43 || $iNext == 45) \n ++$this->iPos; // '+-'\n if ($this->fnReadInt(10) === null) \n $this->fnRaise($iStart, \"Invalid number\");\n }\n if (Identifier::fnIsIdentifierStart($this->fnFullCharCodeAtPos())) \n $this->fnRaise($this->iPos, \"Identifier directly after number\");\n\n $sStr = mb_substr($this->sInput, $iStart, $this->iPos - $iStart);\n $iVal = $bOctal ? intval($sStr, 8) : floatval($sStr);\n return $this->fnFinishToken(TokenTypes::$aTypes['num'], $iVal);\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}", "function to($dscNum);", "public static function convert_number_field() {\n\n\t\t// Create a new Number field.\n\t\tself::$field = new GF_Field_Number();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Number specific properties.\n\t\tself::$field->rangeMin = rgar( self::$nf_field, 'number_min' );\n\t\tself::$field->rangeMax = rgar( self::$nf_field, 'number_max' );\n\n\t\t// Add currency property if needed.\n\t\tif ( rgar( self::$nf_field, 'mask' ) && 'currency' === self::$nf_field['mask'] ) {\n\t\t\tself::$field->numberFormat = 'currency';\n\t\t}\n\n\t}", "public function import();", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "public function addNumber($str_name)\n {\n return $this->addField($str_name, self::FIELD_NUMBER);\n }", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "protected static function getLineNumbersStart($openingTag) {\n\t\t$start = 1;\n\t\tif (!empty($openingTag['attributes'][0])) {\n\t\t\t$start = intval($openingTag['attributes'][0]);\n\t\t\tif ($start < 1) $start = 1;\n\t\t}\n\t\t\n\t\treturn $start;\n\t}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "protected function process_data_number(import_settings $settings, $field, $data_record, $value) {\r\n $result = $this->process_data_default($settings, $field, $data_record, $value);\r\n return $result;\r\n }", "public function getInt32PackedFieldAt($offset)\n {\n return $this->get(self::INT32_PACKED_FIELD, $offset);\n }", "function prepare_field_for_import($field)\n {\n }", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "function display_header_phone_number()\n {\n include 'assets/partials/header-phone-number.php';\n }", "private function writeNumber($row, $col, $num, $xfIndex)\n {\n $record = 0x0203; // Record identifier\n $length = 0x000E; // Number of bytes to follow\n\n $header = pack('vv', $record, $length);\n $data = pack('vvv', $row, $col, $xfIndex);\n $xl_double = pack('d', $num);\n if (self::getByteOrder()) { // if it's Big Endian\n $xl_double = strrev($xl_double);\n }\n\n $this->append($header . $data . $xl_double);\n\n return 0;\n }", "public function parseNumber($value)\n\t{\n\t\treturn $value;\n\t}", "function fiftyone_degrees_get_numeric_node_index($node, $index, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $node['node_numeric_children_offset']\n + ($index * (2 + 4)));\n\n return array(\n 'value' => fiftyone_degrees_read_short($_fiftyone_degrees_data_file),\n 'related_node_index' => fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}", "public function importLine(Import $import, ImportLine $line);", "function th($number) {\n\treturn number_format(intval($number));\n}", "public function incrementImportCount();", "public function wt_parse_int_field($value) {\n // Remove the ' prepended to fields that start with - if needed.\n//\t\t$value = $this->unescape_data( $value );\n\n return intval($value);\n }", "public function getImportFieldToColNumber( $importFieldName )\n {\n // fill importFields array if empty\n if ( ! $this->importFieldsToColNumber ) {\n throw new VendrediException( 'Something went wrong during the import, contact an admin (trying to access the column number before attribution)' );\n }\n\n if ( ! isset( $this->importFieldsToColNumber[ $importFieldName ] ) ) {\n // don't catch that error, something went wrong here\n throw new VendrediException( 'Something went wrong, this column name does not exist: ' . $importFieldName );\n }\n\n return $this->importFieldsToColNumber[ $importFieldName ];\n }", "public function getNumber() /*: int*/ {\n if ($this->number === null) {\n throw new \\Exception(\"Number is not initialized\");\n }\n return $this->number;\n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "protected function headerChunk(string $header, int $value, string $str = ''): array {\n\t\t\treturn $this->toInputEncoding([\n\t\t\t\t$header,\n\t\t\t\t\"0,{$value}\",\n\t\t\t\t$this->quote($str),\n\t\t\t]);\n\t\t}", "protected function getHeadingNumber(DomNode $node)\n {\n $this->setCounts($node);\n $string = '';\n foreach ($this->counts as $count) {\n if (! $count) {\n break;\n }\n $string .= \"{$count}.\";\n }\n return $this->page->getNumber() . $string;\n }", "public function setImporte($value) {\n if(strlen($value) > 12 ){\n throw new ValueException(\"Value \".$value.\" is higher than 12\");\n }\n $this->MerchantID = $value;\n }", "function customPageHeader() { ?>\n<style>\n input[type=number]::-webkit-inner-spin-button, \n input[type=number]::-webkit-outer-spin-button \n { \n -webkit-appearance: none; \n margin: 0; \n }\n</style>\n<?php }", "public function testNumberFields()\n {\n $field = $this->table->getField('numberone');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberone', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-2147483648, $field->getMin());\n $this->assertEquals(2147483647, $field->getMax());\n\n $field = $this->table->getField('numbertwo');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numbertwo', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-9999.9999, $field->getMin());\n $this->assertEquals(9999.9999, $field->getMax());\n\n $field = $this->table->getField('numberthree');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberthree', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-9223372036854775808, $field->getMin());\n $this->assertEquals(9223372036854775807, $field->getMax());\n\n $field = $this->table->getField('numberfour');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberfour', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-32768, $field->getMin());\n $this->assertEquals(32767, $field->getMax());\n\n $field = $this->table->getField('numberfive'); // Double precision field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numberfive', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('numbersix'); // Money field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numbersix', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('numberseven'); // real field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numberseven', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n }", "private function returnHeaderInfoObj($messageNumber){\n\t\treturn @imap_headerinfo($this->stream,$messageNumber);\n\t}", "function vNumber( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_VALIDATE_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_VALIDATE_INT ); # int\r\n\t\t\t\r\n\t\t}", "protected function _parseHeader() {}", "function prepend_one($num) {\n\n\t\tif ($num < 10) {\n\t\t\t$num = \"0\" . $num;\n\t\t}\n\t\t\n\t\treturn $num;\n }", "protected function readFieldFromHeader(PhpBuf_IO_Reader_Interface $reader) {\n $varint = PhpBuf_Base128::decodeFromReader($reader);\n $fieldIndex = $varint >> 3;\n $wireType = self::mask($varint);\n if(!isset($this->fields[$fieldIndex])) {\n throw new PhpBuf_Field_Exception(\"class \" . get_class($this) . \" field index $fieldIndex not found\");\n }\n $fieldClass = $this->fields[$fieldIndex];\n $fieldsWireType = $fieldClass->getWireType();\n if($wireType !== $fieldsWireType) {\n throw new PhpBuf_Field_Exception(\"discrepancy of wire types\");\n }\n return $fieldClass;\n }", "public function writeInt32($num){ }", "public function buildHeaderFields() {}", "public function import(): void;", "public function headerdata($sumberdata)\n {\n $sql1 = \"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'db_nakertrans' AND TABLE_NAME = '$sumberdata'\";\n $dataheader = $this->db->query($sql1)->result_array();\n\n return $dataheader;\n }", "private function LACheckHeader(){\n $instruction = $this->Getinstruction();\n $this->COUNTERS[LOC] -= 1;\n if($instruction->Opcode != \".IPPCODE21\"){\n $this->Error(ERROR_MISSING_HEAD,\"Missing header .IPPcode21\");\n }\n }", "public function getNumber()\n {\n return $this->getData(self::NUMBER);\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "function privReadFileHeader(&$p_header)\n {\n }", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "function _generateHeaderInfo()\n {\n return '0504';\n }", "function xlsWriteNumber($Row, $Col, $Value) {\r\necho pack(\"sssss\", 0x203, 14, $Row, $Col, 0x0);\r\necho pack(\"d\", $Value);\r\nreturn;\r\n}", "function getFieldHeader($fN)\t{\r\n\t\tswitch($fN) {\r\n\t\t\tcase \"title\":\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_title','<em>title</em>');\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function setNumber($var)\n {\n GPBUtil::checkInt32($var);\n $this->number = $var;\n }", "public function getColumn($name)\n {\n if (is_array($this->_headers))\n {\n foreach ($this->_headers as $index => $value)\n {\n if (!strcasecmp(trim($name), trim($value)))\n {\n return $index;\n }\n }\n\n throw new PHPMapper_Exception_Import(\n \"Column $name not found in file headers.\"\n );\n }\n else\n {\n $index = (integer) $name;\n if ($index < 0 || $index > $this->_headers)\n {\n throw new PHPMapper_Exception_Import(\n \"Column #$index not valid. Only \" . $this->_headers\n . ' found on first row.'\n );\n }\n\n return $index;\n }\n }", "public function readint32()\n {\n }", "function Header()\n {\n $this->m_projectedHeaderCounts = new ShadowCounts();\n }", "public function fromHeader($header, $dataType)\n\t{\n\t\treturn $this->fromString($header, $dataType);\n\t}", "protected function process_header_default(import_settings $settings, $data, $type, $name, $description, $options) {\r\n global $DB;\r\n\r\n $result = new object();\r\n $result->dataid = $data->id;\r\n $result->type = $type;\r\n $result->name = $name;\r\n $result->description = $description;\r\n $result->param1 = is_array($options) ? implode(\"\\n\", $options) : $options;\r\n $result->param2 = null;\r\n $result->param3 = null;\r\n $result->param4 = null;\r\n $result->param5 = null;\r\n $result->param6 = null;\r\n $result->param7 = null;\r\n $result->param8 = null;\r\n $result->param9 = null;\r\n $result->param10 = null;\r\n\r\n $result->id = $DB->insert_record('data_fields', $result);\r\n return $result;\r\n }", "public function setNumber($number);", "function sNumber( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_INT ); # int\r\n\t\t\t\r\n\t\t}", "public function appendInt32PackedField($value)\n {\n return $this->append(self::INT32_PACKED_FIELD, $value);\n }", "public function import(\\RealtimeDespatch\\OrderFlow\\Model\\Request $request);", "function number_int( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_NUMBER,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_INTEGER\n );\n\t}", "public function getStreetNumber();", "public function getter_numeric()\n\t{\n\t\treturn $this->numeric = strtolower($this->packet->numeric);\n\t}", "public function addSequenceNumberAsFirstColumn()\n {\n // Set custom columns as first column\n $this->addCustomColumnAsFirstColumn(\"No\", array($this, 'getSequenceNumber'));\n }", "private function newNumericField(stdClass $fieldDef): DBTable\\Field\n {\n $field = new Fld\\Numeric($fieldDef->column_name);\n $this->setProperties($field, $fieldDef);\n $field->setPrecision($fieldDef->numeric_precision);\n $field->setScale($fieldDef->numeric_scale);\n\n return $field;\n }", "public function pi_list_header() {}", "public function number(): string\n {\n return $this->getData('Number');\n }", "function swappyNumber($atts, $content = null){\n\n\t\textract( shortcode_atts( \n\t\t\tarray(\n\t\t\t\t\"number\" => 1,\n\t\t\t\t), $atts, 'swappy'\n\t\t\t)\n\t\t);\n\t\t$number = intval($number);\n\t\t$number--;\n\t\tif ($number < 0 ) $number = 0;\n\t\tif ( isset( $this->numbers[$number] ) )\n\t\t\treturn $this->numbers[$number];\n\t\treturn;\n\n\t}", "public function setAmount($value) {\n if(strlen($value) > 8 ){\n throw new ValueException(\"Value \".$value.\" is higher than 8\");\n }\n $this->Importe = number_format($value,$this->Exponente,'','');\n }", "public function setSequenceNumber($number) {\n\t\t$this->sequence = $number;\n\t\t// create the field\n\t\t$field = new ACHRecordField([84,87], $this->sequence);\n\t\t\n\t\t// add padding to the number\n\t\t$field->addPadding('0');\n\n\t\t// add the field.\n\t\t$this->addField( $field );\n\t}", "public function getNumber()\n {\n return $this->number;\n }", "protected function initializeImport() {}", "public function __construct($in) {\n $this->num= FALSE !== strpos($in, '.') ? rtrim(rtrim($in, '0'), '.') : (string)$in;\n }", "public function import()\n {\n \n }", "public function headingRow(): int\n {\n return 1;\n }", "public function getFixed32Field()\n {\n $value = $this->get(self::FIXED32_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "function rawpheno_indicate_new_headers($file, $project_id) {\n // Retrieve the header for the indicated file.\n rawpheno_add_parsing_libraries();\n $xls_obj = rawpheno_open_file($file);\n rawpheno_change_sheet($xls_obj, 'measurements');\n\n // Note: we use the foreach here\n // because the library documentation doesn't have a single fetch function.\n foreach ($xls_obj as $xls_headers) { break; }\n\n // Array to hold epected column headers specific to a given project.\n $expected_headers = rawpheno_project_traits($project_id);\n\n // Remove any formatting in each column headers.\n $expected_headers = array_map('rawpheno_function_delformat', $expected_headers);\n\n // Array to hold new column headers.\n $new_headers = array();\n\n // Assuming the file actually has a non-empty header row...\n if (count($xls_headers) > 0) {\n // Read each column header and compare against expected column headers.\n foreach($xls_headers as $value) {\n $temp_value = rawpheno_function_delformat($value);\n\n // Determine if column header exists in the expected column headers.\n if (!in_array($temp_value, $expected_headers) && !empty($value)) {\n // Not in expected column headers, save it as new header.\n $value = preg_replace('/\\s+/', ' ', $value);\n $new_headers[] = $value;\n }\n }\n }\n\n return $new_headers;\n}", "function __tinypass_section_head( TPPaySettings $ps, $num, $text = '', $html = '' ) {\n\t?>\n\n\t<div class=\"tp-section-header\">\n\t\t<div class=\"num\"><?php echo $num ?></div>\n\t\t<?php echo $text ?>\n\t\t<?php echo $html ?>\n\t</div>\n\n<?php }", "function get_translation_number($num) {\n // get a string with particular number\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables(true);\n $meta = $this->TRANSLATIONS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "public function getNUMEROINT()\r\n {\r\n return $this->NUMERO_INT;\r\n }", "public function addOrdinal($num) {\n\t\ttry {\n\t\t\tif (!in_array(($num % 100), array(11, 12, 13))){\n\t\t\t\tswitch ($num % 10) {\n\t\t\t\t\t// Handle 1st, 2nd, 3rd\n\t\t\t\t\tcase 1: return $num.'st';\n\t\t\t\t\tcase 2: return $num.'nd';\n\t\t\t\t\tcase 3: return $num.'rd';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $num.'th';\n\t\t\t\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "protected function process_header(import_settings $settings, $data) {\r\n $result = array();\r\n $doc = $settings->get_dom();\r\n $rows = $doc->getElementsByTagName('tr');\r\n $head = $rows->item(0);\r\n $cols = $head->getElementsByTagName('th');\r\n foreach ($cols as $col) {\r\n $name = $this->read($col, 'title');\r\n $description = $this->read($col, 'description');\r\n $type = $this->read($col, 'type');\r\n $options = $this->read_list($col, 'options');\r\n $f = array($this, 'process_header_' . $type);\r\n if (is_callable($f)) {\r\n $field = call_user_func($f, $settings, $data, $name, $description, $options);\r\n $result[] = $field;\r\n } else {\r\n $field = $this->process_header_default($settings, $type, $name, $description, $options);\r\n $result[] = $field;\r\n }\r\n }\r\n return $result;\r\n }", "function gmp_import($data)\n {\n return gmp_init(bin2hex($data), 16);\n }", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );\n\t\t$this->name = _x( 'Number', 'xprofile field type', 'buddypress' );\n\n\t\t$this->set_format( '/^\\d+|-\\d+$/', 'replace' );\n\t\tdo_action( 'bp_xprofile_field_type_number', $this );\n\t}", "#[Pure]\nfunction http_parse_headers($header) {}", "function acf_get_numeric($value = '')\n{\n}", "public function setNumber(?string $value): void {\n $this->getBackingStore()->set('number', $value);\n }", "public function getNumber() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->orderNumber;\r\n\t}", "protected function _setNumeric($name, $value) {}", "public function getNumberFromUserInput() {\n }", "public function get_number()\n\t{\n\t\treturn $this->number;\n\t}", "public static function getHTTPStatusCode($header) {\n $first_line = strtok($header, \"\\n\");\n\n preg_match(\"# [0-9]{3}#\", $first_line, $match);\n\n if (isset($match[0]))\n return (int) trim($match[0]);\n else\n return null;\n }", "function rawpheno_add_parsing_libraries($file_type = 'XLSX') {\n // Function call libraries_load() base on the implementation\n // of hook_libraries_info() in rawpheno.module.\n $xls_lib = libraries_load('spreadsheet_reader');\n // Library path information returned will be used\n // to include individual library files required.\n $lib_path = $xls_lib['path'];\n\n // Include parser library. PLS DO NOT ALTER ORDER!!!\n // To stop parser from auto formatting date to MM/DD/YY,\n // suggest a new date format YYYY-mm-dd in:\n // line 678 in excel_reader2.php\n // 0xe => \"m/d/Y\", to 0xe => \"Y-m-d\",\n // line 834 in SpreadsheetReader_XLSX.php\n // $Value = $Value -> format($Format['Code']); to $Value = $Value -> format('Y-m-d');\n //\n include_once $lib_path . 'php-excel-reader/excel_reader2.php';\n include_once $lib_path . 'SpreadsheetReader_XLSX.php';\n include_once $lib_path . 'SpreadsheetReader.php';\n\n if ($file_type == 'XLS') {\n // PLS INCLUDE THIS FILE ONLY FOR XLS TYPE.\n include_once $lib_path . 'SpreadsheetReader_XLS.php';\n }\n}", "public static function getNextLetterHeadNumber($company_id, $prefix)\n {\n $lastOrder = LetterHead::findByCompany($company_id)->where('letter_head_number', 'LIKE', $prefix . '-%')\n ->orderBy('created_at', 'desc')\n ->first();\n\n\n if (!$lastOrder) {\n // We get here if there is no order at all\n // If there is no number set it to 0, which will be 1 at the end.\n $number = 0;\n } else {\n $number = explode(\"-\", $lastOrder->letter_head_number);\n $number = $number[1];\n }\n // If we have ORD000001 in the database then we only want the number\n // So the substr returns this 000001\n\n // Add the string in front and higher up the number.\n // the %06d part makes sure that there are always 6 numbers in the string.\n // so it adds the missing zero's when needed.\n\n return sprintf('%06d', intval($number) + 1);\n }" ]
[ "0.51880145", "0.5137977", "0.5004235", "0.49478108", "0.49266407", "0.48821086", "0.4875254", "0.4813329", "0.48021185", "0.4799113", "0.47685233", "0.46652612", "0.46492574", "0.46343297", "0.46296328", "0.46275207", "0.46213627", "0.45985338", "0.45579165", "0.455238", "0.45510942", "0.45478252", "0.4538662", "0.45105", "0.45104966", "0.45053288", "0.45051426", "0.44666204", "0.44517002", "0.4437387", "0.44318283", "0.44307443", "0.44271708", "0.44233906", "0.441609", "0.44153628", "0.4414714", "0.44102103", "0.4401182", "0.43993267", "0.43962005", "0.43945327", "0.43889943", "0.4380335", "0.43711102", "0.4370075", "0.43561032", "0.43405268", "0.4335466", "0.43243355", "0.43232796", "0.43187237", "0.43047222", "0.43045232", "0.4298742", "0.42968503", "0.42925254", "0.42909077", "0.42907295", "0.42840356", "0.42796275", "0.42753404", "0.42705208", "0.42694882", "0.4269342", "0.4268711", "0.42661974", "0.4262729", "0.42565224", "0.4253578", "0.4252421", "0.42414373", "0.42262676", "0.42148003", "0.42103377", "0.42042977", "0.41971546", "0.41898853", "0.41882396", "0.41865307", "0.4185297", "0.41848788", "0.41785827", "0.4177686", "0.41763422", "0.41683716", "0.41566265", "0.41456738", "0.4140137", "0.41400853", "0.41383916", "0.41366178", "0.41307965", "0.41279006", "0.41195726", "0.41169032", "0.4114382", "0.4113032", "0.41106445", "0.4110501" ]
0.6226848
0
Imports a radiobutton header i.e. a field's declaration.
protected function process_header_radiobutton(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function createCheckboxRadio($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/radiocheckbox.php\";\n }", "public static function renderRadio();", "public function defineHeaderButton(){\r\n $this->addnewctrl='';\r\n $this->searchctrl='';\r\n }", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "protected function registerDocheaderButtons() {}", "public function add($labelText, $value='X', $boolChecked=false) {\n\t\t\n\t\t$radio_id = $this->_name.'_'.$this->_count;\n\t\t$this->_count++;\n\n\t\t$label = new JamElement('label',$labelText);\t\n\t\t$label->setHtmlOption('for',$radio_id);\n\n\t\t$input = new JamElement('input');\n\t\t$input->setId($radio_id);\n\t\t$input->setHtmlOption('name',$this->_name);\n\t\t$input->setHtmlOption('type','radio');\n\t\t$input->setHtmlOption('value',$value);\n\t\tif($boolChecked == true)\n\t\t\t$input->setHtmlOption('checked','checked');\n\n\t\t$hpanel = parent::add(new JamHorzPanel());\n\t\t$hpanel->setBorderNone();\n\t\t$hpanel->add($label);\n\t\t$hpanel->add($input);\n\n\t\treturn $hpanel;\n\t}", "protected function add_header_button( $add_param = '' ) {\n\n\t\t\tif ( 'off' === $this->allow_insert ) {\n\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( WPDA::is_wpda_table( $this->table_name ) ||\n\t\t\t\t ( 'on' === WPDA::get_option( WPDA::OPTION_BE_ALLOW_INSERT ) &&\n\t\t\t\t count( $this->wpda_list_columns->get_table_primary_key() ) ) > 0\n\t\t\t\t) {\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<form\n\t\t\t\t\t\t\tmethod=\"post\"\n\t\t\t\t\t\t\taction=\"?page=<?php echo esc_attr( $this->page ); ?><?php echo '' === $this->schema_name ? '' : '&schema_name=' . esc_attr( $this->schema_name ); ?>&table_name=<?php echo esc_attr( $this->table_name ); ?><?php echo esc_attr( $add_param ); ?>\"\n\t\t\t\t\t\t\tstyle=\"display: inline-block; vertical-align: baseline;\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"new\">\n\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php echo __( 'Add New', 'wp-data-access' ); ?>\"\n\t\t\t\t\t\t\t\t class=\"page-title-action\">\n\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t// Add import button to title.\n\t\t\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\n\t\t\t\t\t<?php\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Add import button to title.\n\t\t\t\t\tif ( null !== $this->wpda_import ) {\n\t\t\t\t\t\t$this->wpda_import->add_button();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );\n\t\t$this->name = _x( 'Radio Buttons', 'xprofile field type', 'buddypress' );\n\n\t\t$this->supports_options = true;\n\n\t\t$this->set_format( '/^.+$/', 'replace' );\n\t\tdo_action( 'bp_xprofile_field_type_radiobutton', $this );\n\t}", "protected static function radio()\n {\n }", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "function acf_get_radio_input($attrs = array())\n{\n}", "protected function getDocHeaderButtons() {}", "public static function convert_radio_field() {\n\n\t\t// Create a new Radio field.\n\t\tself::$field = new GF_Field_Radio();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array();\n\n\t\t// Loop through field options.\n\t\tforeach ( self::$nf_field['list']['options'] as $option ) {\n\n\t\t\t// Add option choice.\n\t\t\tself::$field->choices[] = array(\n\t\t\t\t'text' => $option['label'],\n\t\t\t\t'value' => $option['value'],\n\t\t\t);\n\n\t\t\t// If option is selected, set as default value.\n\t\t\tif ( '1' === $option['selected'] ) {\n\t\t\t\tself::$field->defaultValue = ! empty( $option['value'] ) ? $option['value'] : $option['text'];\n\t\t\t}\n\n\t\t}\n\n\t}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function radio ( \\r8\\Form\\Radio $field )\n {\n $this->addField( \"radio\", $field );\n }", "function acf_radio_input($attrs = array())\n{\n}", "private function createImportButton() {\n\t\t$moduleUrl = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $this->id));\n\t\t$this->template->setMarker('module_url', htmlspecialchars($moduleUrl));\n\t\t$this->template->setMarker(\n\t\t\t'label_start_import',\n\t\t\t$GLOBALS['LANG']->getLL('start_import_button')\n\t\t);\n\t\t$this->template->setMarker('tab_number', self::IMPORT_TAB);\n\t\t$this->template->setMarker(\n\t\t\t'label_import_in_progress',\n\t\t\t$GLOBALS['LANG']->getLL('label_import_in_progress')\n\t\t);\n\n\t\treturn $this->template->getSubpart('IMPORT_BUTTON');\n\t}", "function minorite_radio($variables) {\n $element = $variables['element'];\n $element['#attributes']['type'] = 'radio';\n element_set_attributes($element, array('id', 'name', '#return_value' => 'value'));\n\n if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == $element['#return_value']) {\n $element['#attributes']['checked'] = 'checked';\n }\n _form_set_class($element, array('form-custom-radio'));\n\n drupal_add_js(\"\n jQuery('.form-custom-radio').iCheck({\n checkboxClass: 'icheckbox_square-blue',\n radioClass: 'iradio_square-blue',\n increaseArea: '20%' // optional\n });\", array('type' => 'inline', 'scope' => 'footer', 'group' => JS_THEME));\n\n return '<label for=\"' . $element['#id'] . '\"><input' . drupal_attributes($element['#attributes']) . '><span>' . $element['#title'] . '</span></label>';\n}", "function radio_button($object, $field, $tag_value, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_radio_button_tag($tag_value, $options);\n}", "function quadro_social_icons_header() {\n\tquadro_social_icons('social_header_display', 'header-social-icons', 'header_icons_scheme', 'header_icons_color_type');\n}", "function wizardHeader() {\n $strOutput = '<table border=\"0\" cellpadding=\"2\" cellspacing=\"1\">';\n return $strOutput;\n }", "protected function getDefaultHeader() {\n\t\treturn CWidgetConfig::getKnownWidgetTypes()[$this->type];\n\t}", "public function setHeader($rowHeader){\n array_unshift($this->data,$rowHeader);\n return $this;\n }", "function &addHeader($type = 'all') {\r\n\t \tif (empty($this->rtf->oddEvenDifferent) && $type == 'all') {\r\n\t\t $header = new Header($this->rtf, $type);\r\n\t\t} else if (!empty($this->rtf->oddEvenDifferent) \r\n\t\t\t\t\t\t&& ($type == 'left' || $type == 'right')) {\t\t \r\n\t\t \t$header = new Header($this->rtf, $type);\t\r\n\t\t} else if ($type == 'first') {\r\n\t\t \t$header = new Header($this->rtf, $type);\t\r\n\t\t \t$this->titlepg = 1;\r\n\t\t} else {\t\t\t\r\n\t\t \treturn;\r\n\t\t}\t\t \r\n\r\n\t\t$this->headers[$type] = &$header;\r\n\t\treturn $header;\t\t\r\n\t}", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "private function addHeaderDetails(){ \n $headerCount = $this->createElement('select', 'headerCount')\n ->addMultiOptions(array('1' => '1 - Header', '2' => '2 - Header', '3' => '3 - Header'))\n ->setValue('3');\n \n $highPressure = $this->createElement('text', 'highPressure')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minPressure(), 'max' => $this->mS->critPressure(), 'inclusive' => true));\n $mediumPressure = $this->createElement('text', 'mediumPressure')\n ->setAttrib('style', 'width: 60px;');\n $lowPressure = $this->createElement('text', 'lowPressure')\n ->setAttrib('style', 'width: 60px;');\n $hpSteamUsage = $this->createElement('text', 'hpSteamUsage')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n $mpSteamUsage = $this->createElement('text', 'mpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n $lpSteamUsage = $this->createElement('text', 'lpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $headerCount,\n $highPressure,\n $mediumPressure,\n $lowPressure,\n $hpSteamUsage,\n $mpSteamUsage,\n $lpSteamUsage,\n )); \n \n $condReturnTemp = $this->createElement('text', 'condReturnTemp')\n ->setValue(round($this->mS->localize(338.705556, 'temperature')))\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $condReturnFlash = $this->createElement('select', 'condReturnFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $hpCondReturnRate = $this->createElement('text', 'hpCondReturnRate')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n $mpCondReturnRate = $this->createElement('text', 'mpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $lpCondReturnRate = $this->createElement('text', 'lpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $hpCondFlash = $this->createElement('select', 'hpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $mpCondFlash = $this->createElement('select', 'mpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n\n $this->addElements(array(\n $condReturnTemp,\n $condReturnFlash,\n $hpCondReturnRate,\n $mpCondReturnRate,\n $lpCondReturnRate,\n $hpCondFlash,\n $mpCondFlash,\n ));\n \n $hpHeatLossPercent = $this->createElement('text', 'hpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $mpHeatLossPercent= $this->createElement('text', 'mpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $lpHeatLossPercent = $this->createElement('text', 'lpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $hpHeatLossPercent,\n $mpHeatLossPercent,\n $lpHeatLossPercent,\n ));\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "public static function drawHeaderOptions($selected = 'git')\n {\n $html = array();\n\n foreach(new DirectoryIterator(ECRPATH_EXTENSIONTEMPLATES.'/std/header') as $fileInfo)\n {\n if($fileInfo->isDot())\n continue;\n\n $name = $fileInfo->getFilename();\n $checked =($name == $selected) ? ' checked=\"checked\"' : '';\n $html[] = '<input type=\"radio\" name=\"headerType\"'\n .'value=\"'.$name.'\" id=\"headerType'.$name.'\"'.$checked.'>'\n .'<label for=\"headerType'.$name.'\">'.$name.'</label>';\n }//foreach\n\n return implode(NL, $html);\n }", "function pgm_subscriber_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Subscriber Name'), //update header name to 'Subscriber Name'\n 'email'=>__('Email Address'), //create new header for email\n );\n\n return $columns;\n}", "public function buildHeader() {\n $header['label'] = $this->t('Label');\n $header['workflow'] = $this->t('Workflow');\n $header['status'] = $this->t('Status');\n $header['transition'] = $this->t('Transitions');\n $header['roles'] = $this->t('Email Roles');\n $header['author'] = $this->t('Email Author');\n $header['emails'] = $this->t('Adhoc Emails');\n return $header + parent::buildHeader();\n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "function drawHeader(){\n switch ($this->doing){\n case 'budget_byProjects':\n case 'myguests':\n if (!(@$this->t instanceof b_table)){\n\t$this->dbg('CANCEL header');\n\t$this->t = new b_table_dummy();\n }\n break;\n\n default:\n parent::drawHeader();\n break;\n }\n }", "public function show ( )\n {\n $tag = new Element ( 'input' );\n $tag -> class = 'field';\t\t // classe CSS\n $tag -> name = $this -> name;\n $tag -> value = $this -> value;\n $tag -> type = 'radio';\n \n // se o campo não é editável\n if ( !parent::getEditable ( ) ) {\n // desabilita a TAG input\n $tag -> readonly = \"1\";\n }\n \n if ( $this -> properties ) {\n foreach ( $this -> properties as $property => $value ) {\n $tag -> $property = $value;\n }\n }\n \n // exibe a tag\n $tag -> show ( );\n }", "protected function set_up()\n {\n $this->element = new Zend_Form_Element_Radio('foo');\n }", "function CreateOption($label, $id, $enabled = true, $checked = false)\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-12\\\">\\n\";\n\t\techo \" <label>\\n\";\n\t\techo \" <input class=\\\"\\\" type=\\\"radio\\\" id=\\\"action\\\" name=\\\"action\\\" value=\\\"\" . $id . \"\\\" required\";\n\t\tif ($checked)\n\t\t\techo \" checked\";\n\t\tif (!$enabled)\n\t\t\techo \" disabled\";\n\t\techo \"/>\\n\";\n\t\techo \" \" . $label . \"\\n\";\n\t\techo \" </label>\\n\";\n\t\techo \" </div>\\n\";\n\t\techo \"</div>\\n\";\n\t}", "public function settings_header() {\n\t\t$this->include_template('wp-admin/settings/header.php');\n\t}", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "function pxlz_edgtf_set_header_object() {\n $header_type = pxlz_edgtf_get_meta_field_intersect('header_type', pxlz_edgtf_get_page_id());\n $header_types_option = pxlz_edgtf_get_header_type_options();\n\n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if (Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\PxlzEdgefHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "function formatHeader(&$tpl, $a_obj_id,$a_option)\n\t{\n\t\tglobal $lng, $ilias;\n\t\t\n\t\t$tpl->setCurrentBlock(\"icon\");\n\t\t$tpl->setVariable(\"ICON_IMAGE\" , ilUtil::getImagePath(\"icon_root_s.png\"));\n\t\t$tpl->setVariable(\"TXT_ALT_IMG\", $lng->txt(\"repository\"));\n\t\t$tpl->parseCurrentBlock();\n\n\t\t$tpl->setCurrentBlock(\"text\");\n\t\t$tpl->setVariable(\"OBJ_TITLE\", $lng->txt(\"repository\"));\n\t\t$tpl->parseCurrentBlock();\n\n\t\t//$tpl->setCurrentBlock(\"row\");\n\t\t//$tpl->parseCurrentBlock();\n\t\t\n\t\t$tpl->touchBlock(\"element\");\n\t\t\n\t}", "function metaboxTabOutputHeader ()\n\t{\n\t\techo '<strong>' . __( 'Select item', 'avhamazon' ) . '</strong><br />';\n\t}", "function radioButtonHtml($groupName, $buttonValue, $displayValue, $isChecked) {\n $checked = $isChecked ? ' checked' : '';\n $html = \"<input type='radio' name='$groupName' value='$buttonValue'$checked>\";\n return $html . $displayValue . '<br>';\n}", "protected function getTableHeader() {\n /** @var \\Drupal\\webform\\WebformInterface $webform */\n $webform = $this->getEntity();\n $header = [];\n $header['title'] = $this->t('Title');\n\n $header['key'] = [\n 'data' => $this->t('Key'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['type'] = [\n 'data' => $this->t('Type'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['correct_answer'] = $this->t('Answer');\n $header['weight'] = $this->t('Weight');\n $header['operations'] = $this->t('Operations');\n// $header['answer'] = [\n// 'data' => $this->t('Answer'),\n// 'class' => [RESPONSIVE_PRIORITY_LOW],\n// ];\n//\n// $header['required'] = [\n// 'data' => $this->t('Required'),\n// 'class' => ['webform-ui-element-required', RESPONSIVE_PRIORITY_LOW],\n// ];\n// $header['parent'] = $this->t('Parent');\n// $header['operations'] = [\n// 'data' => $this->t('Operations'),\n// 'class' => ['webform-ui-element-operations'],\n// ];\n return $header;\n }", "function form_radio_group($field, $options) {\n\n}", "protected function makeHeader()\n {\n }", "private function radioCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['checked'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('radio.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "function mk_radio( $myTitle, $myName, $myValue, $myChek1, $myChek2, $myDesc1, $myDesc2 ){\n\t#initialize needed variables\n\t$str = $chekd1 = $chekd2 = '';\n\n\tif ($myValue == $myChek1) { $chekd1 = \"checked='checked'\"; }else{$chekd2 = \"checked='checked'\";}\n\n\t$str .= '<div class=\"row hoverHighlight\">\n\t\t\t<div class=\"col-sm-3 text-right text-muted\">\n\t\t\t\t<p class=\"text-right\">\n\t\t\t\t\t<strong>' . ucwords($myTitle) . ': </strong>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t<p>';\n\t\t\t\t$str .= \"<label>\n\t\t\t\t\t<input type='radio' value='{$myChek1}' name='{$myName}' {$chekd1}> &nbsp; {$myDesc1} &nbsp; &nbsp; </label>\n\t\t\t\t\t<input type='radio' value='{$myChek2}' name='{$myName}' {$chekd2}> &nbsp; {$myDesc2} </label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\";\n\n\treturn $str;\n}", "protected function header($header)\n {\n $this->block($header, 'question');\n }", "protected function setGroupType() {\r\n $this->group_type = 'radio';\r\n $this->option_name = $this->name;\r\n }", "public function webp_metabox_header() {\r\n\t\t$this->view(\r\n\t\t\t'webp/meta-box-header',\r\n\t\t\tarray(\r\n\t\t\t\t'is_disabled' => ! $this->settings->get( 'webp_mod' ) || ! WP_Smush::get_instance()->core()->s3->setting_status(),\r\n\t\t\t\t'is_configured' => true === WP_Smush::get_instance()->core()->mod->webp->is_configured(),\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function form_radio($field, $options) {\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('input', 'radio')\n );\n\n $options = array_merge($defaults, $options);\n\n $field = strtolower($field);\n\n $output = '<input type=\"radio\" name=\"' . $field . '\" id=\"' . form__field_id($field) . '\"';\n \n if(!empty($_POST[$field])) {\n $output .= ' value=\"'. $_POST[$field] . '\"';\n }\n\n $output .= ' />';\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "function sloodle_print_header()\n {\n global $CFG;\n\n // Offer the user an 'update' button if they are allowed to edit the module\n $editbuttons = '';\n if ($this->canedit) {\n $editbuttons = update_module_button($this->cm->id, $this->course->id, get_string('modulename', 'sloodle'));\n }\n // Display the header\n $navigation = \"<a href=\\\"index.php?id={$this->course->id}\\\">\".get_string('modulenameplural','sloodle').\"</a> ->\";\n sloodle_print_header_simple(format_string($this->sloodle->name), \"&nbsp;\", \"{$navigation} \".format_string($this->sloodle->name), \"\", \"\", true, $editbuttons, navmenu($this->course, $this->cm));\n\n // Display the module name\n $img = '<img src=\"'.$CFG->wwwroot.'/mod/sloodle/icon.gif\" width=\"16\" height=\"16\" alt=\"\"/> ';\n sloodle_print_heading($img.$this->sloodle->name, 'center');\n \n // Display the module type and description\n $fulltypename = get_string(\"moduletype:{$this->sloodle->type}\", 'sloodle');\n echo '<h4 style=\"text-align:center;\">'.get_string('moduletype', 'sloodle').': '.$fulltypename;\n echo sloodle_helpbutton(\"moduletype_{$this->sloodle->type}\", $fulltypename, 'sloodle', true, false, '', true).'</h4>';\n // We'll apply a general introduction to all Controllers, since they seem to confuse lots of people!\n $intro = $this->sloodle->intro;\n if ($this->sloodle->type == SLOODLE_TYPE_CTRL) $intro = '<p style=\"font-style:italic;\">'.get_string('controllerinfo','sloodle').'</p>' . $this->sloodle->intro;\n\t\t// Display the intro in a box, if we have an intro\n\t\tif (!empty($intro)) sloodle_print_box($intro, 'generalbox', 'intro');\n \n }", "static function createButton($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/button.php\";\n }", "public final function set_header_image($choice)\n {\n }", "function radio( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_RADIO,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "function gen_webguileftcolumnhyper_field(&$section, $value) {\n\n\t$section->addInput(new Form_Checkbox(\n\t\t'webguileftcolumnhyper',\n\t\t'Left Column Labels',\n\t\t'Active',\n\t\t$value\n\t))->setHelp('If selected, clicking a label in the left column will select/toggle the first item of the group.');\n}", "function r_userclass_radio($fieldname, $curval = '')\n{\n echo \"Deprecated function r_userclass_radio not used in core - mutter if you'd like it implemented<br />\";\n}", "function zen_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'radio', $value, $checked, $parameters);\n }", "function setTypeAsRadioButtons($itemList) {\n\t\t$this->type = \"radio\";\n\t\t$this->seleu_itemlist = $itemList;\n\t}", "function customPageHeader() { ?>\n<style>\n input[type=number]::-webkit-inner-spin-button, \n input[type=number]::-webkit-outer-spin-button \n { \n -webkit-appearance: none; \n margin: 0; \n }\n</style>\n<?php }", "function the_custom_header_markup()\n {\n }", "private function headings() {\n\t\t$this->section_data['general_h_tags'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_h_tags',\n\t\t\t'label' \t\t\t\t=> __( 'Headings', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h1' => 'Heading 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h2' => 'Heading 2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h3' => 'Heading 3',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h4' => 'Heading 4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h5' => 'Heading 5',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h6' => 'Heading 6',\n\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check which HTML headings automatically generated table of contents.', 'fixedtoc' )\n\t\t);\n\t}", "function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "public function orderRadio()\n {\n $order = get_site_option($this->orderOption);\n\n if (!is_string($order)) {\n $order = 'DESC';\n }\n ?>\n <p>\n <label>\n <input id=\"<?php echo $this->orderOption; ?>\" <?php echo $order === 'DESC'\n ? 'checked'\n : ''; ?> name=\"<?php echo $this->orderOption; ?>\" type=\"radio\" value=\"DESC\">DESC\n </label><br>\n\n <label>\n <input id=\"<?php echo $this->orderOption; ?>\" <?php echo $order === 'ASC'\n ? 'checked'\n : ''; ?> name=\"<?php echo $this->orderOption; ?>\" type=\"radio\" value=\"ASC\">ASC\n </label>\n </p>\n <?php\n }", "function do_signup_header()\n {\n }", "function wppb_multiple_forms_header( $list_header ){\r\n $delete_all_nonce = wp_create_nonce( 'wppb-delete-all-entries' );\r\n\r\n return '<thead><tr><th class=\"wck-number\">#</th><th class=\"wck-content\">'. __( '<pre>Title (Type)</pre>', 'profile-builder' ) .'</th><th class=\"wck-edit\">'. __( 'Edit', 'profile-builder' ) .'</th><th class=\"wck-delete\"><a id=\"wppb-delete-all-fields\" class=\"wppb-delete-all-fields\" onclick=\"wppb_rf_epf_delete_all_fields(event, this.id, \\'' . esc_js($delete_all_nonce) . '\\')\" title=\"' . __('Delete all items', 'profile-builder') . '\" href=\"#\">'. __( 'Delete all', 'profile-builder' ) .'</a></th></tr></thead>';\r\n}", "function we_getInputRadioField($name, $value, $itsValue, $atts){\n\t$atts['type'] = 'radio';\n\t$atts['name'] = $name;\n\t$atts['value'] = oldHtmlspecialchars($itsValue, -1, 'ISO-8859-1', false);\n\tif($value == $itsValue){\n\t\t$atts['checked'] = 'checked';\n\t}\n\treturn getHtmlTag('input', $atts);\n}", "function formHeader($action, $method=NULL, $formname=NULL){\r\n\t\t//find any referance uploading file and set form accordingly\r\n\t\t$columnBreakDown = explode(\"\\n\", $this->form);\r\n\r\n\t\tforeach ($columnBreakDown AS $value){\r\n\t\t\t$row = explode(\":\", $value);\r\n\t\t\tif ('upload' == trim(strtolower($row[2]))){\r\n\t\t\t\t$this->enctype=\"multipart/form-data\";\r\n\t\t\t\t$method = \"POST\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//check if method is either GET or POST if not then set POST as default\r\n\t\t$method = trim(strtoupper($method));\r\n\t\tif($method != \"POST\" && $method != \"GET\" ){\r\n\t\t\t$method = \"POST\";\r\n\t\t}\r\n\r\n\t\t//remove any spaces from $formname as can not be used with spaces\r\n\t\t$formname = str_replace(\" \", '', $formname);\r\n\r\n\t\t$ret = '<form method=\"'.$method.'\" action=\"'.$action.'\"';\r\n\t\t$ret .=(!empty($formname))? ' name=\"'.$formname.'\" id=\"'.$formname.'\"' : '';\r\n\t\t$ret .=($this->enctype)? ' enctype=\"'.$this->enctype.'\"' : '';\r\n\t\t$ret .=($this->formScript)? ' onSubmit=\"'.$this->formScript.'\"' : '';\r\n\t\t$ret .= '>';\r\n\r\n\t\treturn $ret;\r\n\t}", "function get_custom_header_markup()\n {\n }", "private function setTableHeader($row){\n\t\t$header_data=false;\n\t\tif($this->header){\n\t\t\t$header_data=$this->header;\n\t\t}\n\t\telse{\n\t\t\tif(!empty($row) && is_array($row) && count($row)){\n\t\t\t\tforeach($row as $i => $v){\n\t\t\t\t\t$header_data[$i]=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($header_data)){\n\t\t\t$this->table_header.=_N_T.'<tr>';\n\t\t\t$this->table_header.=_N_T_T.'<th class=\"th.LineNum\">#</th>';\n\t\t\tforeach($header_data as $name => $value){\n\t\t\t\t$this->table_header.=_N_T_T.'<th nowrap=\"nowrap\">'.$value.$this->getOrderBy($name).'</th>';\n\t\t\t}\n\t\t\t$this->table_header.=_N_T.'</tr>';\n\t\t}\n\t\treturn $this;\n\t}", "public function wishlist_header( $var ) {\n\t\t $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';\n\t\t\t$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';\n\n\t\t yith_wcwl_get_template_part( $template, 'header', $layout, $var );\n }", "function radiology() {\n //\n // do not forget to update version\n //\n $this->author = 'Herman Tolentino MD';\n $this->version = \"0.2-\".date(\"Y-m-d\");\n $this->module = \"radiology\";\n $this->description = \"CHITS Module - Radiology\";\n\n }", "private function getHeaderButton($headerNumber){\n\t\tif($this->headerSortable){\n\t\t\t$langOrderAsc=velkan::$lang[\"grid_msg\"][\"orderAsc\"];\n\t\t\t$langOrderDesc=velkan::$lang[\"grid_msg\"][\"orderDesc\"];\n\t\t\t\n\t\t\t$hd=<<<HTML\n\t\t\t<div class=\"btn-group pull-right\">\n\t \t\t\t<a class=\"btn dropdown-toggle btn-mini\" data-toggle=\"dropdown\" href=\"#\"><span class=\"caret\"></span></a>\n\t\t\t\t\t<ul class=\"dropdown-menu\">\n\t\t\t\t\t\t<li><a href=\"javascript:{$this->id}Reorder('{$this->fields[$headerNumber]} asc');\"><i class=\"icon-arrow-up\"></i> $langOrderAsc</a></li>\n\t\t\t\t\t\t<li><a href=\"javascript:{$this->id}Reorder('{$this->fields[$headerNumber]} desc');\"><i class=\"icon-arrow-down\"></i> $langOrderDesc</a></li>\n\t\t\t\t\t</ul>\n\t\t\t</div>\nHTML;\n\t\t\treturn $hd;\n\t\t}else{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function drawHeader($question)\r\n {\r\n echo '\r\n <div class=\"panel-heading\">\r\n <h3 class=\"panel-title\">\r\n <span class=\"glyphicon glyphicon-arrow-right\"></span>'.$question.'\r\n </h3>\r\n </div>';\r\n }", "function option_radiobutton($label, $name, $value='', $keys, $comment='') {\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td>\";\r\n\r\n\t\tforeach ((array)$keys as $key => $description) {\r\n\t\t\tif ($key == $value)\r\n\t\t\t\t$checked = \"checked\";\r\n\t\t\telse\r\n\t\t\t\t$checked = \"\";\r\n\t\t\techo \"<input type='radio' id='$name' name='$name' value='\" . htmlentities($key, ENT_QUOTES, 'UTF-8') . \"' $checked />\" . $description . \"<br>\";\r\n\t\t}\r\n\t\techo $comment . \"<br>\";\r\n\t\techo \"</td></tr>\";\r\n\t}", "protected function _renderHeader()\n\t{\n\t\t\n\t\tif( $this->header !== false ) {\n\t\t\t\n\t\t\t$button = $this->_renderCloseButton();\n\t\t\t\n\t\t\tHtml::addCssClass( $this->headerOptions, [ 'section' => 'modal-header' ] );\n\t\t\t\n\t\t\treturn ''\n\t\t\t\t. \"\\n\" . Html::beginTag( 'div', $this->headerOptions )\n\t\t\t\t. \"\\n\" . $button\n\t\t\t\t. \"\\n\" . $this->header\n\t\t\t\t. \"\\n\" . Html::endTag( 'div' );\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function getInputHeaders()\n {\n }", "function testRemoveLegendFromRadio() {\n\t\t$result = $this->helper->input('Test.foo', array('type' => 'radio', 'options' => array('0' => 'No', '1' => 'Yes')));\n\t\t$expected = array(\n\t\t\tarray('div' => array('class' => 'input radio')),\n\t\t\t\tarray('div' => array('class' => 'label')),\n\t\t\t\t\t'Foo',\n\t\t\t\t'/div',\n\t\t\t\tarray('div' => array('class' => 'radios')),\n\t\t\t\t\tarray('input' => array('type' => 'hidden', 'name' => 'data[Test][foo]', 'id' => 'TestFoo_', 'value' => '')),\n\t\t\t\t\tarray('input' => array('type' => 'radio', 'name' => 'data[Test][foo]', 'id' => 'TestFoo0', 'tabindex' => 1, 'value' => 0)),\n\t\t\t\t\tarray('label' => array('for' => 'TestFoo0')),\n\t\t\t\t\t\t'No',\n\t\t\t\t\t'/label',\n\t\t\t\t\tarray('input' => array('type' => 'radio', 'name' => 'data[Test][foo]', 'id' => 'TestFoo1', 'tabindex' => 1, 'value' => 1)),\n\t\t\t\t\tarray('label' => array('for' => 'TestFoo1')),\n\t\t\t\t\t\t'Yes',\n\t\t\t\t\t'/label',\n\t\t\t\t'/div',\n\t\t\t'/div'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function definition() {\n global $CFG;\n\n $mform = $this->_form; // Don't forget the underscore! \n\n $mform->addElement('filepicker', 'excelfile', get_string('excelfile', 'booking'), null, array('maxbytes' => $CFG->maxbytes, 'accepted_types' => '*'));\n $mform->addRule('excelfile', null, 'required', null, 'client');\n\n $this->add_action_buttons(TRUE, get_string('importexceltitle', 'booking'));\n }", "protected function setDefaultHeader()\n {\n if (!empty($this->toolbar)) {\n return;\n }\n\n $heading = function ($n) {\n return [\n 'label' => Yii::t('kvmarkdown', 'Heading {n}', ['n' => $n]),\n 'options' => [\n 'class' => 'kv-heading-' . $n,\n 'title' => Yii::t('kvmarkdown', 'Heading {n} Style', ['n' => $n]),\n ],\n ];\n };\n $isBs4 = $this->isBs4();\n\n $this->toolbar = [\n [\n 'buttons' => [\n self::BTN_BOLD => ['icon' => 'bold', 'title' => Yii::t('kvmarkdown', 'Bold')],\n self::BTN_ITALIC => ['icon' => 'italic', 'title' => Yii::t('kvmarkdown', 'Italic')],\n self::BTN_PARAGRAPH => ['icon' => 'font', 'title' => Yii::t('kvmarkdown', 'Paragraph')],\n self::BTN_NEW_LINE => [\n 'icon' => 'text-height',\n 'title' => Yii::t('kvmarkdown', 'Append Line Break'),\n ],\n self::BTN_HEADING => [\n 'icon' => $isBs4 ? 'heading' : 'header',\n 'title' => Yii::t('kvmarkdown', 'Heading'),\n 'items' => [\n self::BTN_H1 => $heading(1),\n self::BTN_H2 => $heading(2),\n self::BTN_H3 => $heading(3),\n self::BTN_H4 => $heading(4),\n self::BTN_H5 => $heading(5),\n self::BTN_H6 => $heading(6),\n ],\n ],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_LINK => ['icon' => 'link', 'title' => Yii::t('kvmarkdown', 'URL/Link')],\n self::BTN_IMAGE => ['icon' => $isBs4 ? 'image' : 'picture', 'title' => Yii::t('kvmarkdown', 'Image')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_INDENT_L => ['icon' => $isBs4 ? 'outdent' : 'indent-left', 'title' => Yii::t('kvmarkdown', 'Indent Text')],\n self::BTN_INDENT_R => ['icon' => $isBs4 ? 'indent' : 'indent-right', 'title' => Yii::t('kvmarkdown', 'Unindent Text')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_UL => ['icon' => 'list', 'title' => Yii::t('kvmarkdown', 'Bulleted List')],\n self::BTN_OL => ['icon' => 'list-alt', 'title' => Yii::t('kvmarkdown', 'Numbered List')],\n self::BTN_DL => ['icon' => 'th-list', 'title' => Yii::t('kvmarkdown', 'Definition List')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_FOOTNOTE => ['icon' => 'edit', 'title' => Yii::t('kvmarkdown', 'Footnote')],\n self::BTN_QUOTE => ['icon' => 'comment', 'title' => Yii::t('kvmarkdown', 'Block Quote')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_CODE => [\n 'label' => $isBs4 ? null : self::ICON_CODE,\n 'icon' => $isBs4 ? 'code' : null,\n 'title' => Yii::t('kvmarkdown', 'Inline Code'),\n 'encodeLabel' => false,\n ],\n self::BTN_CODE_BLOCK => ['icon' => $isBs4 ? 'laptop-code' : 'sound-stereo', 'title' => Yii::t('kvmarkdown', 'Code Block')],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_HR => [\n 'icon' => 'minus',\n 'title' => Yii::t('kvmarkdown', 'Horizontal Line'),\n 'encodeLabel' => false,\n ],\n ],\n ],\n [\n 'buttons' => [\n self::BTN_MAXIMIZE => [\n 'icon' => $isBs4 ? 'expand-arrows-alt' : 'fullscreen',\n 'title' => Yii::t('kvmarkdown', 'Toggle full screen'),\n 'data-enabled' => true,\n ],\n ],\n 'options' => ['class' => 'pull-right float-right'],\n ],\n ];\n }", "public function getHeaderHTML()\n\t{\n\t\tif(!is_array($this->elements['header'])){\n\t\t\t// Headers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Header buttons can also be defined outside of the header key when defining modal vales.\n\t\t$this->elements['header']['buttons'] = array_merge($this->elements['header']['buttons'] ?: [], $this->buttons ?: []);\n\n\t\t# Add the required Bootstrap header class very first\n\t\t$this->elements['header']['class'] = str::getAttrArray($this->elements['header']['class'], \"modal-header\", $this->elements['header']['only_class']);\n\n\t\t# Draggable\n\t\t$this->elements['header']['class'][] = $this->draggable ? \"modal-header-draggable\" : false;\n\n\t\t# Styles\n\t\t$this->elements['header']['style'] = str::getAttrArray($this->elements['header']['style'], NULL, $this->elements['header']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['header']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['header']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['header']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Accent\n\t\t$this->elements['header']['class'][] = str::getColour($this->accent, \"bg\");\n\n\t\t# Icon\n\t\tif(!$icon = Icon::generate($this->elements['header']['icon'])){\n\t\t\t//the icon attribute can either be in the header or in the main modal\n\t\t\t$icon = Icon::generate($this->icon);\n\t\t}\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['header']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['header']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['header']['style']);\n\n\t\t# Title colour\n\t\t$class[] = str::getColour($this->elements['header']['colour']);\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['header']['script']);\n\n\t\t# The header title itself\n\t\t$title = $this->elements['header']['header'] . $this->elements['header']['title'] . $this->elements['header']['html'];\n\n\t\t# Title class\n\t\tif(!empty(array_filter($class))){\n\t\t\t$title_class = str::getAttrTag(\"class\", $class);\n\t\t\t$title = \"<span{$title_class}>$title</span>\";\n\t\t}\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['header']['class']);\n\n\t\t# If the modal can be dismissed\n\t\tif($this->dismissible !== false){\n\t\t\t$dismiss = <<<EOF\n<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" title=\"Close this window\"></button>\nEOF;\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t<div class=\"col-auto modal-title\">\n \t\t\t{$icon}{$title}{$badge}\n \t\t</div>\n \t\t<div class=\"col\">\n \t\t\t{$buttons}{$button}{$dismiss}\n \t\t</div>\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\t}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "function sb_slideshow_radio( $value, $key, $name, $checked = '' ) {\n\treturn '<input type=\"radio\" name=\"sb_' . esc_attr( $name ) . '\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . ($value == $checked ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}" ]
[ "0.5305672", "0.51929915", "0.5192559", "0.517536", "0.517536", "0.517536", "0.517536", "0.517536", "0.51236653", "0.5028674", "0.49931952", "0.4927494", "0.4910817", "0.49040562", "0.48878166", "0.488666", "0.48583576", "0.48304302", "0.48169217", "0.4809677", "0.4804556", "0.47822472", "0.4774667", "0.47666228", "0.47259566", "0.47228193", "0.47110397", "0.47096616", "0.47092998", "0.46909007", "0.46787432", "0.46706274", "0.46703058", "0.46651334", "0.46599048", "0.4651305", "0.46383378", "0.46374482", "0.46279782", "0.46241716", "0.46172196", "0.46170157", "0.45985016", "0.45953843", "0.4584672", "0.45834175", "0.45833173", "0.45819214", "0.45784548", "0.45750833", "0.4571165", "0.45672202", "0.45607135", "0.4560386", "0.4557682", "0.45409155", "0.45398387", "0.4531548", "0.4528256", "0.45121393", "0.4509005", "0.45062202", "0.45039278", "0.4503902", "0.44916505", "0.44913772", "0.44902942", "0.44857267", "0.44788027", "0.44771168", "0.44753546", "0.44682157", "0.44641942", "0.44502184", "0.44498524", "0.44460633", "0.4445476", "0.44386652", "0.44382527", "0.44371662", "0.44367898", "0.44248635", "0.4424222", "0.4420327", "0.44146246", "0.44058132", "0.44028684", "0.44015315", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403", "0.43996403" ]
0.5901773
0
Imports a text header i.e. a field's declaration.
protected function process_header_text(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $autolink = true); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function statementHeader(string $text): void\n {\n }", "function setHeaderText($value) {\n $this->header_text = $value;\n}", "private function _header($text){\n echo '[*] ' . $text . PHP_EOL;\n }", "function import_text( $text ) {\r\n // quick sanity check\r\n if (empty($text)) {\r\n return '';\r\n }\r\n $data = $text[0]['#'];\r\n return addslashes(trim( $data ));\r\n }", "function display_header_text()\n {\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "private function setHeader($header)\n {\n $this->header = trim((string) $header);\n $this->headerComment = '';\n\n if ('' !== $this->header) {\n $this->headerComment = $this->encloseTextInComment($this->header);\n }\n }", "public function buildHeaderFields() {}", "public function header($text)\n {\n return '\n\n\t<!-- MAIN Header in page top -->\n\t<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($text) . '</h1>\n';\n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "function printHeader($text) {\n \treturn \"<h2>\".$text.\"</h2>\";\n }", "public function docHeaderContent() {}", "public function set_comment_before_headers($text)\n {\n }", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "public function getHeader(string $header): string;", "function privReadFileHeader(&$p_header)\n {\n }", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function getHeader();", "public function getHeader();", "public function getHeader();", "abstract public function header();", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "public function import();", "public static function fromString($headerLine)\n {\n $header = new static();\n $headerName = $header->getFieldName();\n [$name, $value] = GenericHeader::splitHeaderLine($headerLine);\n // Ensure the proper header name\n if (strcasecmp($name, $headerName) !== 0) {\n throw new Exception\\InvalidArgumentException(sprintf(\n 'Invalid header line for %s string: \"%s\"',\n $headerName,\n $name\n ));\n }\n // As per https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive\n $tokens = explode(';', $value);\n foreach ($tokens as $token) {\n $token = trim($token);\n if ($token) {\n [$directiveName, $directiveValue] = array_pad(explode(' ', $token, 2), 2, null);\n if (! isset($header->directives[$directiveName])) {\n $header->setDirective(\n $directiveName,\n $directiveValue === null ? [] : [$directiveValue]\n );\n }\n }\n }\n\n return $header;\n }", "public function getHeaderData() {}", "protected function _parseHeader() {}", "protected function makeHeader()\n {\n }", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "public function import() {\n return '';\n }", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function extObjHeader() {}", "function _parseHeader($header) {\n\n\t\tif (is_array($header)) {\n\t\t\tforeach ($header as $field => $value) {\n\t\t\t\tunset($header[$field]);\n\t\t\t\t$field = strtolower($field);\n\t\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\n\t\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t\t}\n\t\t\t\t$header[$field] = $value;\n\t\t\t}\n\t\t\treturn $header;\n\t\t} elseif (!is_string($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpreg_match_all(\"/(.+):(.+)(?:(?<![\\t ])\" . $this->line_break . \"|\\$)/Uis\", $header, $matches, PREG_SET_ORDER);\n\n\t\t$header = array();\n\t\tforeach ($matches as $match) {\n\t\t\tlist(, $field, $value) = $match;\n\n\t\t\t$value = trim($value);\n\t\t\t$value = preg_replace(\"/[\\t ]\\r\\n/\", \"\\r\\n\", $value);\n\n\t\t\t$field = $this->_unescapeToken($field);\n\n\t\t\t$field = strtolower($field);\n\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t}\n\n\t\t\tif (!isset($header[$field])) {\n\t\t\t\t$header[$field] = $value;\n\t\t\t} else {\n\t\t\t\t$header[$field] = array_merge((array) $header[$field], (array) $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $header;\n\t}", "protected function process_header_default(import_settings $settings, $data, $type, $name, $description, $options) {\r\n global $DB;\r\n\r\n $result = new object();\r\n $result->dataid = $data->id;\r\n $result->type = $type;\r\n $result->name = $name;\r\n $result->description = $description;\r\n $result->param1 = is_array($options) ? implode(\"\\n\", $options) : $options;\r\n $result->param2 = null;\r\n $result->param3 = null;\r\n $result->param4 = null;\r\n $result->param5 = null;\r\n $result->param6 = null;\r\n $result->param7 = null;\r\n $result->param8 = null;\r\n $result->param9 = null;\r\n $result->param10 = null;\r\n\r\n $result->id = $DB->insert_record('data_fields', $result);\r\n return $result;\r\n }", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "public function SetFromText($fromText) {\n // from directly in headers here.\n $this->fromText = $fromText;\n }", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "abstract protected function getHeader(Project $project);", "public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}", "public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}", "private function loadHeaderTable($name) {\n\t$template = $this->loadTemplate(\"templates/controls/grid/templateListHeader.txt\");\n\t$template = $this->replaceTemplateString($template, \"[scaffold-name]\", $name);\n\treturn $template;\n }", "public function prepareImportContent();", "function prepare_field_for_import($field)\n {\n }", "public function getHeaderLine($name);", "function string_prepare_header( $p_string ) {\r\n\t$t_string = $p_string;\r\n\r\n\t$t_truncate_pos = strpos($p_string, \"\\n\");\r\n\tif ($t_truncate_pos !== false ) {\r\n\t\t$t_string = substr($t_string, 0, $t_truncate_pos);\r\n\t}\r\n\r\n\t$t_truncate_pos = strpos($p_string, \"\\r\");\r\n\tif ($t_truncate_pos !== false ) {\r\n\t\t$t_string = substr($t_string, 0, $t_truncate_pos);\r\n\t}\r\n\r\n\treturn $t_string;\r\n}", "public function initializeHeader(array $header): void\n {\n // removes forbidden symbols from header (field names)\n $this->header = array_map(function (string $name): string {\n return preg_replace('~[^a-z0-9_-]+~i', '_', $name);\n }, $header);\n }", "private function addRawHeaderToPart($header, PartBuilder $partBuilder)\n {\n if ($header !== '' && strpos($header, ':') !== false) {\n $a = explode(':', $header, 2);\n $partBuilder->addHeader($a[0], trim($a[1]));\n }\n }", "protected function process_header(import_settings $settings, $data) {\r\n $result = array();\r\n $doc = $settings->get_dom();\r\n $rows = $doc->getElementsByTagName('tr');\r\n $head = $rows->item(0);\r\n $cols = $head->getElementsByTagName('th');\r\n foreach ($cols as $col) {\r\n $name = $this->read($col, 'title');\r\n $description = $this->read($col, 'description');\r\n $type = $this->read($col, 'type');\r\n $options = $this->read_list($col, 'options');\r\n $f = array($this, 'process_header_' . $type);\r\n if (is_callable($f)) {\r\n $field = call_user_func($f, $settings, $data, $name, $description, $options);\r\n $result[] = $field;\r\n } else {\r\n $field = $this->process_header_default($settings, $type, $name, $description, $options);\r\n $result[] = $field;\r\n }\r\n }\r\n return $result;\r\n }", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "public function addHeader()\n {\n }", "public function parse($filename, $headerRow = true);", "public function import(): void;", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "public function getInputHeaders()\n {\n }", "public function addHeader($text, $url = NULL)\n\t{\n\t\t$header = new Header($text, $url);\n\t\t$this->headers[] = $header;\n\t\treturn $header;\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nWorking with Data in C#\nMAINHEADING;\n }", "public function setHeader(PoHeader $header) {\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function add_header() {\n }", "public function getHeaderText()\n {\n return __('Import Testimonials');\n }", "public function getHeader(string $name);", "public function getHeader() {\n }", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "abstract protected function header();", "public static function parseText($text) {\r\n if (strpos($text, \"\\n\\n\") !== false) $text = substr($text, 0, strpos($text, \"\\n\\n\"));\r\n $text = rtrim($text) . \"\\n\";\r\n\r\n $matches = array();\r\n preg_match_all('/(.*?):\\s*(.*?\\n(\\s.*?\\n)*)/', $text, $matches);\r\n if ($matches) {\r\n foreach($matches[2] as &$value) $value = trim(str_replace(array(\"\\r\", \"\\n\"), ' ', $value));\r\n unset($value);\r\n if (count($matches[1]) && count($matches[1]) == count($matches[2])) {\r\n $headers = array_combine($matches[1], $matches[2]);\r\n return new self($headers);\r\n }\r\n }\r\n\r\n return new self();\r\n }", "function getFieldHeader($fN)\t{\r\n\t\tswitch($fN) {\r\n\t\t\tcase \"title\":\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_title','<em>title</em>');\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->pi_getLL('listFieldHeader_'.$fN,'['.$fN.']');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "protected function dumpHeader() {\n\t\treturn trim('\n# TYPO3 Extension Manager dump 1.1\n#\n#--------------------------------------------------------\n');\n\t}", "private function headerRead(): void\n {\n if (false === $this->getStrategy()->hasHeader() || true === $this->headerRead) {\n return;\n }\n\n $this->rewind();\n $this->skipLeadingLines();\n $this->header = $this->normalizeHeader($this->convertRowToUtf8($this->current()));\n $this->headerRead = true;\n $this->next();\n }", "function Header() {\n\t\tif (is_null($this->_tplIdx)) {\n\t\t\t$this->setSourceFile('gst3.pdf');\n\t\t\t$this->_tplIdx = $this->importPage(1);\n\t\t}\n\t\t$this->useTemplate($this->_tplIdx);\n\n\t\t$this->SetFont('freesans', 'B', 9);\n\t\t$this->SetTextColor(255);\n\t\t$this->SetXY(60.5, 24.8);\n\t\t$this->Cell(0, 8.6, \"TCPDF and FPDI\");\n\t}", "private function _subheader($text){\n echo '[-] ' . $text . PHP_EOL;\n }", "public function getHeaderLine($name)\n {\n }", "public function getHeaderLine($name)\n {\n }", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "public function import()\n {\n \n }", "protected function addHeaderRowToCSV() {}", "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "function loadHeaders() {\n\n\t\t$id = \"original_id\";\n\t\t$title = \"title\";\n\t\t\n\t\treturn $id . $_POST[$id] . \"&\" . $title . $_POST[$title];\n\n\t}", "protected function process_header_number(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "function parse_headers($str)\n\t{\n\t\t$str = \"\\n\\n\".str_replace(\"\\r\", '', $str).\"\\n\\n\";\n\t\t// convert markups\n\t\t$marks = array('=', '-', '#');\n\t\tforeach($marks as $i => $m) {\n\t\t\t$i++;\n\t\t\t$str = preg_replace_callback(\n\t\t\t\tarray(\n\t\t\t\t\t// multi-lines\n\t\t\t\t\t\"`(?:(?:\\n\\n)?$m{3,}\\n?|\\n\\n)[ \\t]*((?:.+?\\n)+.*?)[ \\t]*$m{4,}[ \\t]*\\n`\",\n\t\t\t\t\t// one line\n\t\t\t\t\t\"`\\n[ \\t]*$m{3,}[ \\t]*([^\\n]+?)[ \\t]*$m*[ \\t]*\\n`\"),\n\t\t\t\tcreate_function(\n\t\t\t\t\t'$out', 'return \\'<h'.$i.'>\\'.trim($out[1]).\\'</h'.$i.'>\\';'),\n\t\t\t\t$str);\n\t\t}\n\t\t// create structure\n\t\tfor($i=1; $i<=6; $i++) {\n\t\t\t$pattern = \"`(<\\s*h$i.*>(.*)</\\s*h$i>.*)(?=</div><div class=.h[1-$i]|<h[1-$i]|$)`siU\";\n\t\t\t$function = create_function('$out',\n\t\t\t\t'return \\'<div class=\"h'.$i.'\" id=\"\\'.string_to_id($out[2]).\\'\">\\'.$out[1].\\'</div>\\';');\n\t\t\t$tmp = preg_replace_callback($pattern, $function, $str);\n\t\t\tif($tmp !== null) $str = $tmp;\n\t\t}\n\t\treturn $str;\n\t}", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "function set_header_text( $post ) {\n\tif ( $post->post_type === 'page' ) {\n\t\t$header_text = get_post_meta( $post->ID, '_alt_title', true ) ? get_post_meta( $post->ID, '_alt_title', true ) : $post->post_title;\n\t} else if ( $post->post_type === 'project' ) {\n\t\t$header_text = get_post_meta( $post->ID, '_shorthand_header', true ) ? get_post_meta( $post->ID, '_shorthand_header', true ) : $post->post_title;\n\t}\n\n\treturn $header_text;\n}", "function getFieldHeader($fN) {\n\t\tswitch($fN) {\n\t\t\tdefault:\n\t\t\t\treturn $this->pi_getLL ( 'listFieldHeader_' . $fN, '[' . $fN . ']' );\n\t\t\tbreak;\n\t\t}\n\t}", "public function buildHeader($object = null): string\n {\n $characters = $this->getControlCharacters();\n\n return $characters['header']['start']['string'].\n $characters['prefix']['start']['string'].\n $this->getPrefix().\n $characters['prefix']['stop']['string'].\n $characters['field']['start']['string'].\n 'version'.\n $characters['field']['delimiter']['string'].\n self::getVersionForPrefix().\n $characters['field']['stop']['string'].\n (is_null($object) ? '' :\n $characters['field']['start']['string'].\n 'type'.\n $characters['field']['delimiter']['string'].\n gettype($object).'['.(is_object($object) ? get_class($object) : 'native').']'.\n $characters['field']['stop']['string']\n ).\n $characters['header']['stop']['string'];\n }", "public function format_for_header()\n {\n }", "function _webform_csv_headers_email($component) {\r\n $header = array();\r\n $header[0] = '';\r\n $header[1] = '';\r\n $header[2] = $component['name'];\r\n return $header;\r\n}", "function setHeaders(){\n $position = ftell($this->handle);\n rewind($this->handle);\n $read = $this->readLine();\n if( $read === FALSE){\n die(\"File is empty\");\n \n }else{\n $this->headers = $read;\n }\n\n fseek ($this->handle, $position );\n }", "public function __construct(string $header) {\n\t\t$this->header = $header;\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nXML Schemas continued..\nMAINHEADING;\n }", "function Header(){\n\t\t}", "#[Pure]\n public function getHeader($header) {}", "public function prepareImport();", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nSQL Basics\nMAINHEADING;\n }", "protected function parseHeader($header)\n {\n $headers = explode(\"\\n\", trim($header));\n $this->parseHeaders($headers);\n }", "function htit($text,$importancia){\r\n return \"<h$importancia>$text</$importancia>\";\r\n }", "private function setHeader($data)\n {\n $this->headers = array_map('self::formatString', $data[0]);\n array_unshift($this->headers, 'row');\n }", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}" ]
[ "0.6034784", "0.58935195", "0.56245434", "0.55620503", "0.5527571", "0.5523644", "0.5466935", "0.5460304", "0.5458527", "0.54272413", "0.54262334", "0.5407933", "0.54028666", "0.53963476", "0.53871566", "0.5360135", "0.53181714", "0.53011644", "0.52995664", "0.5290824", "0.52863383", "0.5262209", "0.5262209", "0.5262209", "0.52615505", "0.5254824", "0.52422506", "0.52361715", "0.5231258", "0.52203715", "0.51732737", "0.51566947", "0.5149753", "0.51488006", "0.5146478", "0.5132285", "0.5123024", "0.51056516", "0.5088373", "0.5082799", "0.5077605", "0.5067971", "0.50640124", "0.5046885", "0.50362724", "0.5028746", "0.5016418", "0.5009239", "0.5003661", "0.49971354", "0.498928", "0.49868056", "0.49745336", "0.49683467", "0.49513245", "0.4950493", "0.49492323", "0.49462894", "0.49398047", "0.493804", "0.4937608", "0.49355164", "0.49349844", "0.4934417", "0.49241707", "0.49129212", "0.48984265", "0.48954248", "0.4888324", "0.48882833", "0.48742846", "0.48717478", "0.48629996", "0.48560387", "0.48549816", "0.48549816", "0.48443624", "0.48427933", "0.48395967", "0.48381203", "0.48357055", "0.4829778", "0.48246804", "0.4819664", "0.48169243", "0.4813651", "0.48129335", "0.48111615", "0.4809265", "0.480346", "0.4802095", "0.48016897", "0.47987637", "0.47978976", "0.47973076", "0.47954524", "0.4791836", "0.47874895", "0.47863823", "0.47823164" ]
0.6070688
0
Imports a textarea header i.e. a field's declaration.
protected function process_header_textarea(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options); $result->param2 = 60; $result->param3 = 35; $result->param4 = 1; global $DB; $DB->update_record('data_fields', $result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function createTextArea($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/textarea.php\";\n }", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function setHeaderText($value) {\n $this->header_text = $value;\n}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "private function setHeader($header)\n {\n $this->header = trim((string) $header);\n $this->headerComment = '';\n\n if ('' !== $this->header) {\n $this->headerComment = $this->encloseTextInComment($this->header);\n }\n }", "public function getInputHeaders()\n {\n }", "public function defineHeader()\n {\n $this->header = new Header();\n }", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "function _importAuto($content, &$we_doc, $templateFilename, $templateParentID)\n\t{\n\t\t\n\t\t$textareaCode = '<we:textarea name=\"content\" wysiwyg=\"true\" width=\"800\" height=\"600\" xml=\"true\" inlineedit=\"true\"/>';\n\t\t$titleCode = \"<we:title />\";\n\t\t$descriptionCode = \"<we:description />\";\n\t\t$keywordsCode = \"<we:keywords />\";\n\t\t\n\t\t$title = \"\";\n\t\t$description = \"\";\n\t\t$keywords = \"\";\n\t\t$charset = \"\";\n\t\t\n\t\t// check if we have a body start and end tag\n\t\tif (preg_match('/<body[^>]*>(.*)<\\/body>/is', $content, $regs)) {\n\t\t\t$bodyhtml = $regs[1];\n\t\t\t$templateCode = preg_replace('/(.*<body[^>]*>).*(<\\/body>.*)/is', \"$1$textareaCode$2\", $content);\n\t\t} else {\n\t\t\t$bodyhtml = $content;\n\t\t\t$templateCode = $textareaCode;\n\t\t}\n\t\t\n\t\t// try to get title, description, keywords and charset\n\t\tif (preg_match('/<title[^>]*>(.*)<\\/title>/is', $content, $regs)) {\n\t\t\t$title = $regs[1];\n\t\t\t$templateCode = preg_replace('/<title[^>]*>.*<\\/title>/is', \"$titleCode\", $templateCode);\n\t\t}\n\t\tif (preg_match('/<meta ([^>]*)name=\"description\"([^>]*)>/is', $content, $regs)) {\n\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[1], $attr)) {\n\t\t\t\t$description = $attr[1];\n\t\t\t} else \n\t\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[2], $attr)) {\n\t\t\t\t\t$description = $attr[1];\n\t\t\t\t}\n\t\t\t$templateCode = preg_replace('/<meta [^>]*name=\"description\"[^>]*>/is', \"$descriptionCode\", $templateCode);\n\t\t}\n\t\tif (preg_match('/<meta ([^>]*)name=\"keywords\"([^>]*)>/is', $content, $regs)) {\n\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[1], $attr)) {\n\t\t\t\t$keywords = $attr[1];\n\t\t\t} else \n\t\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[2], $attr)) {\n\t\t\t\t\t$keywords = $attr[1];\n\t\t\t\t}\n\t\t\t$templateCode = preg_replace('/<meta [^>]*name=\"keywords\"[^>]*>/is', \"$keywordsCode\", $templateCode);\n\t\t}\n\t\tif (preg_match('/<meta ([^>]*)http-equiv=\"content-type\"([^>]*)>/is', $content, $regs)) {\n\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[1], $attr)) {\n\t\t\t\tif (preg_match('/charset=([^ \"\\']+)/is', $attr[1], $cs)) {\n\t\t\t\t\t$charset = $cs[1];\n\t\t\t\t}\n\t\t\t} else \n\t\t\t\tif (preg_match('/content=\"([^\"]+)\"/is', $regs[2], $attr)) {\n\t\t\t\t\tif (preg_match('/charset=([^ \"\\']+)/is', $attr[1], $cs)) {\n\t\t\t\t\t\t$charset = $cs[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$templateCode = preg_replace(\n\t\t\t\t\t'/<meta [^>]*http-equiv=\"content-type\"[^>]*>/is', \n\t\t\t\t\t'<we:charset defined=\"' . $charset . '\">' . $charset . '</we:charset>', \n\t\t\t\t\t$templateCode);\n\t\t}\n\t\t\n\t\t// replace external css (link rel=stylesheet)\n\t\tpreg_match_all('/<link ([^>]+)>/i', $templateCode, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[1]); $i++) {\n\t\t\t\tpreg_match_all('/([^= ]+)=[\\'\"]?([^\\'\" ]+)[\\'\"]?/is', $regs[1][$i], $regs2, PREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[1]); $z++) {\n\t\t\t\t\t\t$attribs[$regs2[1][$z]] = $regs2[2][$z];\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($attribs[\"rel\"]) && $attribs[\"rel\"] == \"stylesheet\") {\n\t\t\t\t\t\tif (isset($attribs[\"href\"]) && $attribs[\"href\"]) {\n\t\t\t\t\t\t\t$id = path_to_id($attribs[\"href\"]);\n\t\t\t\t\t\t\t$tag = '<we:css id=\"' . $id . '\" xml=\"true\" ' . ((isset($attribs[\"media\"]) && $attribs[\"media\"]) ? ' pass_media=\"' . $attribs[\"media\"] . '\"' : '') . '/>';\n\t\t\t\t\t\t\t$templateCode = str_replace($regs[0][$i], $tag, $templateCode);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// replace external js scripts\n\t\tpreg_match_all('/<script ([^>]+)>.*<\\/script>/isU', $templateCode, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[1]); $i++) {\n\t\t\t\tpreg_match('/src=[\"\\']?([^\"\\']+)[\"\\']?/is', $regs[1][$i], $regs2);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\t$id = path_to_id($regs2[1]);\n\t\t\t\t\t$tag = '<we:js id=\"' . $id . '\" xml=\"true\" />';\n\t\t\t\t\t$templateCode = str_replace($regs[0][$i], $tag, $templateCode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check if there is allready a template with the same content\n\t\t\n\n\t\t$newTemplateID = f(\n\t\t\t\t\"SELECT \" . LINK_TABLE . \".DID AS DID FROM \" . LINK_TABLE . \",\" . CONTENT_TABLE . \" WHERE \" . LINK_TABLE . \".CID=\" . CONTENT_TABLE . \".ID AND \" . CONTENT_TABLE . \".Dat='\" . mysql_real_escape_string(\n\t\t\t\t\t\t$templateCode) . \"' AND \" . LINK_TABLE . \".DocumentTable='\" . substr(\n\t\t\t\t\t\tTEMPLATES_TABLE, \n\t\t\t\t\t\tstrlen(TBL_PREFIX)) . \"'\", \n\t\t\t\t\"DID\", \n\t\t\t\t$GLOBALS['DB_WE']);\n\t\t\n\t\tif (!$newTemplateID) {\n\t\t\t// create Template\n\t\t\t\n\n\t\t\t$newTemplateFilename = $templateFilename;\n\t\t\t$GLOBALS['DB_WE']->query(\n\t\t\t\t\t\"SELECT Filename FROM \" . TEMPLATES_TABLE . \" WHERE ParentID=\" . abs($templateParentID) . \" AND Filename like '\" . mysql_real_escape_string(\n\t\t\t\t\t\t\t$templateFilename) . \"%'\");\n\t\t\t$result = array();\n\t\t\tif ($GLOBALS['DB_WE']->num_rows()) {\n\t\t\t\twhile ($GLOBALS['DB_WE']->next_record()) {\n\t\t\t\t\tarray_push($result, $GLOBALS['DB_WE']->f(\"Filename\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$z = 1;\n\t\t\twhile (in_array($newTemplateFilename, $result)) {\n\t\t\t\t$newTemplateFilename = $templateFilename . $z;\n\t\t\t\t$z++;\n\t\t\t}\n\t\t\tinclude_once ($_SERVER[\"DOCUMENT_ROOT\"] . \"/webEdition/we/include/we_classes/we_template.inc.php\");\n\t\t\t$templateObject = new we_template();\n\t\t\t$templateObject->we_new();\n\t\t\t$templateObject->CreationDate = time();\n\t\t\t$templateObject->ID = 0;\n\t\t\t$templateObject->OldPath = \"\";\n\t\t\t$templateObject->Extension = \".tmpl\";\n\t\t\t$templateObject->Filename = $newTemplateFilename;\n\t\t\t$templateObject->Text = $templateObject->Filename . $templateObject->Extension;\n\t\t\t$templateObject->setParentID($templateParentID);\n\t\t\t$templateObject->Path = $templateObject->ParentPath . ($templateParentID ? \"/\" : \"\") . $templateObject->Text;\n\t\t\t$templateObject->OldPath = $templateObject->Path;\n\t\t\t$templateObject->setElement(\"data\", $templateCode, \"txt\");\n\t\t\t$templateObject->we_save();\n\t\t\t$templateObject->we_publish();\n\t\t\t$templateObject->setElement(\"Charset\", $charset);\n\t\t\t$newTemplateID = $templateObject->ID;\n\t\t}\n\t\t\n\t\t$we_doc->setTemplateID($newTemplateID);\n\t\t$we_doc->setElement(\"content\", $bodyhtml);\n\t\t$we_doc->setElement(\"Title\", $title);\n\t\t$we_doc->setElement(\"Keywords\", $keywords);\n\t\t$we_doc->setElement(\"Description\", $description);\n\t\t$we_doc->setElement(\"Charset\", $charset);\n\t}", "public function docHeaderContent() {}", "function insertFormulize()\n{\n\techo \"Hello\";\n//\tinclude '/Users/dpage/Sites/formulize/htdocs/mainfile.php';\n//\t$formulize_screen_id = 2;\n//\tinclude XOOPS_ROOT_PATH . '/modules/formulize/index.php';\n}", "function greater_jackson_habitat_extra_metabox_content() {\n\t\n\tgreater_jackson_habitat_do_field_textarea( array(\n\t\t'name' => 'gjh_extra',\n\t\t'group' => 'gjh_extra',\n\t\t'wysiwyg' => true,\n\t) );\n\t\n\tgreater_jackson_habitat_init_field_group( 'gjh_extra' );\n\t\n}", "function Header() {\n $this->AddFont('Gotham-M','B','gotham-medium.php'); \n //seteamos el titulo que aparecera en el navegador \n $this->SetTitle(utf8_decode('Toma de Protesta Candidato PVEM'));\n\n //linea que simplemente me marca la mitad de la hoja como referencia\n \t$this->Line(139.5,$this->getY(),140,250);\n\n \t//bajamos la cabecera 13 espacios\n $this->Ln(10);\n //seteamos la fuente, el color de texto, y el color de fondo de el titulo\n $this->SetFont('Gotham-M','B',11);\n $this->SetTextColor(255,255,255);\n $this->SetFillColor(73, 168, 63);\n //escribimos titulo\n $this->Cell(0,5,utf8_decode('Toma de Protesta Candidato PVEM'),0,0,'C',1); //el completo es 279 bueno 280 /2 = 140 si seran 10 de cada borde, entonces 120\n\n $this->Ln();\n }", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );\n\t\t$this->name = _x( 'Multi-line Text Area', 'xprofile field type', 'buddypress' );\n\n\t\t$this->set_format( '/^.*$/m', 'replace' );\n\t\tdo_action( 'bp_xprofile_field_type_textarea', $this );\n\t}", "function add_admin_header() {\n }", "function getHeaderTitleJS($varElement, $varName, $type, $endSequence='', $add=FALSE, $count=10)\t{\n\t\t\n\t\treturn parent::getHeaderTitleJS($varName, $type, $endSequence, $add, $count) . \"\n\t\t\t\tif (typeof(lorem_ipsum) == 'function' && \" . $varElement . \".tagName.toLowerCase() == 'textarea' ) lorem_ipsum(\" . $varElement . \", lipsum_temp_strings[lipsum_temp_pointer]);\n\t\t\t\";\n\t}", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "function create_custom_field() {\n $args = array(\n 'id' => 'custom_field_brand',\n 'label' => __( 'Detalhes da Marca'),\n 'class' => 'brand-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the brand details.'),\n );\n woocommerce_wp_textarea_input( $args );\n}", "function add_from_tab_content () {\n require_once dirname(__FILE__).'/templates/form-tab-content.php';\n }", "public function header($text)\n {\n return '\n\n\t<!-- MAIN Header in page top -->\n\t<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($text) . '</h1>\n';\n }", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "function header (){\n\t\t$this->setfont('Arial','B', 16);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'WANANCHI', 0, 0, 'C');\n\t\t$this->Ln(10);\n\t\t$this->setfont('Arial','',12);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'INFORMATION',0, 0, 'C');\n\t\t$this->Ln(30);\n\t}", "function wpsites_modify_comment_form_text_area($arg) {\n $arg['comment_field'] = '<p class=\"comment-form-comment\"><label for=\"comment\">' . _x( 'Takk for din tilbakemelding!', 'noun' ) . '</label><textarea id=\"comment\" name=\"comment\" cols=\"55\" rows=\"7\" aria-required=\"true\"></textarea></p>';\n return $arg;\n}", "function output_textarea_row( string $label, string $key, $val, int $rows = 2 ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t$val = $val ?? '';\n\t?>\n\t<div class=\"wpinc-meta-field-single textarea\">\n\t\t<label>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t\t<textarea <?php name_id( $key ); ?> cols=\"64\" rows=\"<?php echo esc_attr( $rows ); ?>\"><?php echo esc_attr( $val ); ?></textarea>\n\t\t</label>\n\t</div>\n\t<?php\n}", "protected function dumpHeader() {\n\t\treturn trim('\n# TYPO3 Extension Manager dump 1.1\n#\n#--------------------------------------------------------\n');\n\t}", "public function buildHeaderFields() {}", "function Header()\n\t\t{\n\t\t\t$this->SetFont('Helvetica','B',18);\n\t\t\t$this->SetTextColor(184,10,10);\n\t\t\t$this->Cell(30);\n\t\t\t$this->Cell(120,10,utf8_decode(\"Mensajes Contestados\"),0,0,'C');\n\t\t\t$this->Ln(20);\n\t\t}", "private function textareaCustomField(): string\n {\n return Template::build($this->getTemplatePath('textarea.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'value' => $this->getValue($this->index),\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "function ctools_export_form($form, &$form_state, $code, $title = '') {\r\n $lines = substr_count($code, \"\\n\");\r\n $form['code'] = array(\r\n '#type' => 'textarea',\r\n '#title' => $title,\r\n '#default_value' => $code,\r\n '#rows' => $lines,\r\n );\r\n\r\n return $form;\r\n}", "public function set_comment_before_headers($text)\n {\n }", "function Header()\n\t{\n\t\t// Police Arial gras 24\n\t\t$this->SetTextColor(255,10,22);\n\t\t$this->SetFont('Arial','B',14);\n\t\t// Décalage à droite\n\t\t$this->Cell(10);\n\t\t// Titre (ligne,titre)\n\t\t$this->Cell('',10,'Liste des employes',0,0,'C');\n\t\t// Saut de ligne\n\t\t$this->Ln(20);\n\t}", "function acf_get_textarea_input($attrs = array())\n{\n}", "function include_field_types_code_editor( $version ) {\n\n\tinclude_once('acf-code-editor-v5.php');\n\n}", "private function _header($text){\n echo '[*] ' . $text . PHP_EOL;\n }", "function loadInHeader() {\n $this->metaData();\n//\t\t$this->loadAddOns();\n $this->onHead(\"onHead\"); // call back to onHead in extensions things js, etc in head\n $this->onEditor(\"onHead\"); // only when login to admin, for fck to work??\n //If not in admin, blank initEditor\n if (!isset($_SESSION['name'])) { // not sure what this does??\n print \"<script type=\\\"text/javascript\\\">function initeditor(){}</script>\\n\";\n }\n }", "function Header(){\n\t\t}", "public function prepareImportContent();", "function Header()\n\t{\n\t\t$this->SetFont('Arial','',12);\n\t\t$this->MultiCell(190,5,nombre_empresa(),'0','C');\n\t\t$this->SetFont('Arial','',10);\n\t\t$this->MultiCell(190,5,tipo_serv(),'0','C');\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->MultiCell(190,7,strtoupper(_('listado de clientes para cortes')),'0','C');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->SetX(133);\n\t\t$this->Cell(12,5,strtoupper(_('fecha')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"d/m/Y\"),0,0,'L');\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->Cell(12,5,strtoupper(_('hora')).': ',0,0,'L');\n\t\t$this->SetFont('Arial','',8);\n\t\t$this->Cell(18,5,date(\"h:i:s A\"),0,0,'L');\n\t\t$this->Ln();\t\t\n\t}", "function wc_custom_add_custom_fields() {\n woocommerce_wp_textarea_input( \n\tarray( \n\t\t'id' => '_custom_text_field', \n\t\t'label' => __( 'Ingredient and Nutrition values', 'woocommerce' ), \n\t\t'placeholder' => 'If you add text here, a new tab will appear.'\n\t\n ) );\n}", "function acf_textarea_input($attrs = array())\n{\n}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function medigroup_mikado_comment_textarea_to_bottom($fields) {\n\n $comment_field = $fields['comment'];\n unset($fields['comment']);\n $fields['comment'] = $comment_field;\n\n return $fields;\n\n }", "function tinymce_include()\n {\n }", "function tep_cfg_textarea($text) {\n return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);\n}", "protected function addDocumentHeaderData()\n\t{\n\t\tJHtml::_('formbehavior.chosen', 'select');\n\t\t$document = JFactory::getDocument();\n\t\t$document->addScript(JURI::root() . '/components/com_tjreports/assets/js/tjrContentService.js');\n\t\t$document->addScript(JURI::root() . '/components/com_tjreports/assets/js/tjrContentUI.js');\n\t\t$document->addStylesheet(JURI::root() . '/components/com_tjreports/assets/css/tjreports.css');\n\t\t$document->addScriptDeclaration('tjrContentUI.base_url = \"' . Juri::base() . '\"');\n\t\t$document->addScriptDeclaration('tjrContentUI.root_url = \"' . Juri::root() . '\"');\n\t\tJText::script('JERROR_ALERTNOAUTHOR');\n\n\t\tif (method_exists($this->model, 'getScripts'))\n\t\t{\n\t\t\t$plgScripts = (array) $this->model->getScripts();\n\n\t\t\tforeach ($plgScripts as $script)\n\t\t\t{\n\t\t\t\t$document->addScript($script);\n\t\t\t}\n\t\t}\n\n\t\tif (method_exists($this->model, 'getStyles'))\n\t\t{\n\t\t\t$styles = (array) $this->model->getStyles();\n\n\t\t\tforeach ($styles as $style)\n\t\t\t{\n\t\t\t\t$document->addStylesheet($style);\n\t\t\t}\n\t\t}\n\t}", "function Header() {\n $this->SetFont('Helvetica', 'B', 18);\n //Judul dalam bingkai\n $this->Cell(0, 5, 'Daftar Hasil Seleksi Calon Siswa Baru', 0, 1, 'C');\n $this->SetFont('Helvetica', 'B', 16);\n $this->Cell(0, 15, 'Sekolah Dasar', 0, 0, 'C');\n //Ganti baris\n $this->Ln(20);\n }", "function ui_insert( $ui_file )\n {\n require_once( \"{$GLOBALS[WEBROOT]}/ui/$ui_file.php\" );\n }", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "function tep_cfg_textarea($text, $key = '') {\n $name = tep_not_null($key) ? 'configuration[' . $key . ']' : 'configuration_value';\n\n return HTML::textareaField($name, 35, 5, $text);\n }", "public function Header(){\n $ci =& get_instance();\n // Select Arial bold 15\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',16);\n // Move to the right\n //$this->Cell(80);\n // Framed title\n // Logo\n $this->Image(asset_url() . \"images/logo.png\",11,5,0,20);\n $this->Ln(15);\n $this->Cell(0,10,\"GetYourGames\",0,1,'L');\n $this->SetFont('Futura-Medium','',12);\n $this->Cell(0,10,site_url(),0,1,\"L\");\n $this->Ln(5);\n $this->SetFont('Futura-Medium','',18);\n $this->Cell(0,10,utf8_decode($this->title),0,1,'C');\n // Line break\n $this->Ln(10);\n $this->SetFont('Futura-Medium','',11);\n $this->Cell(15,10,utf8_decode('#'),'B',0,'C');\n $this->Cell(100,10,utf8_decode($ci->lang->line('table_product')),'B',0,'L');\n $this->Cell(30,10,utf8_decode($ci->lang->line('table_qty')),'B',0,'L');\n $this->Cell(40,10,utf8_decode($ci->lang->line('table_subtotal')),'B',1,'L');\n\n $this->Ln(2);\n }", "function loadHeaders() {\n\n\t\t$id = \"original_id\";\n\t\t$title = \"title\";\n\t\t\n\t\treturn $id . $_POST[$id] . \"&\" . $title . $_POST[$title];\n\n\t}", "private function setHeaderLine($type) {\n $this -> types = EfrontExport::getTypes($type);\n if ($type == \"users\") {\n unset($this -> types['password']);\n }\n $this -> lines[] = implode($this -> separator, array_keys($this -> types));\n }", "protected function makeHeader()\n {\n }", "function display_header_text()\n {\n }", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}", "function _webform_csv_headers_email($component) {\r\n $header = array();\r\n $header[0] = '';\r\n $header[1] = '';\r\n $header[2] = $component['name'];\r\n return $header;\r\n}", "public function extObjHeader() {}", "function create_section_header($wp_customize, $panel_id) {\n $wp_customize->add_section( 'fyt_header' , [\n 'title' => 'Header',\n 'panel' => $panel_id,\n ]);\n\n /* Binome pour CHANGER LE NOM DANS LE HEADER */\n // Déclaration du paramètre 'setting'\n $wp_customize->add_setting( 'fyt_header_title', [] );\n // un élément de formulaire permettant d'attribuer une valeur au setting\n $wp_customize->add_control( 'fyt_header_title', array(\n 'type' => 'text',\n 'section' => 'fyt_header',\n 'label' => 'Titre dans le header',\n // 'description' => 'Select a title for the posts'\n ) );\n /* Fin du parametrage du binome */\n\n\n /* Binome pour selectionner LA COULEUR DE FOND DU HEADER */\n // Déclaration du paramètre 'setting'\n $wp_customize->add_setting( 'fyt_header_background_color',\n array(\n 'default' => '#FFA500',\n // 'sanitize_callback' => 'sanitize_hex_color',\n ) );\n // un élément de formulaire permettant d'attribuer une valeur au setting\n $wp_customize->add_control(\n new WP_Customize_Color_Control(\n $wp_customize,\n 'fyt_header_background_color',\n array(\n 'label' => 'Background color du header',\n 'section' => 'fyt_header',\n 'settings' => 'fyt_header_background_color',\n )\n )\n );\n/* Fin du parametrage du binome */\n\n\n}", "protected function process_header_text(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $autolink = true);\r\n return $result;\r\n }", "public function setHeader(PoHeader $header) {\n }", "public function import() {\n return '';\n }", "function studio_before_header_widget_area() {\n\n\tgenesis_widget_area( 'before-header', array(\n\t 'before' => '<div class=\"before-header\"><div class=\"wrap\">',\n\t 'after'\t => '</div></div>',\n\t) );\n}", "function Header() {\r\n // print the title\r\n $this->SetTitleFont();\r\n $this->Cell(100, 8, $this->title, 0, 0, \"L\");\r\n\r\n // print the author\r\n $this->SetAuthorFont();\r\n $this->Cell(0, 8, $this->author, 0, 0, \"R\");\r\n\r\n // header line\r\n $this->SetFillColor(0, 0, 0);\r\n $this->Rect(10, 17, 190, 0.2, \"F\");\r\n $this->Rect(10, 17.5, 190, 0.2, \"F\");\r\n $this->Ln(14);\r\n }", "public function getHeaderText() \n {\n\tif ($this->_coreRegistry->registry('simpleblog_author')->getId()) \n\t{\n\t\t return __(\"Edit Author '%1'\", $this->escapeHtml($this->_coreRegistry->registry('simpleblog_author')->getTitle()));\n\t} else { return __('New Author'); }\n\t\n }", "function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}", "public function settings_header() {\n\t\t$this->include_template('wp-admin/settings/header.php');\n\t}", "function acf_form_head()\n{\n}", "public static function convert_textarea_field() {\n\n\t\t// Create a new Textarea field.\n\t\tself::$field = new GF_Field_Textarea();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Textarea specific properties.\n\t\tself::$field->useRichTextEditor = rgar( self::$nf_field, 'textarea_rte' );\n\n\t}", "protected function statementHeader(string $text): void\n {\n }", "protected function getHeaderPart()\n {\n //$logo_url = ot_get_option('header_logo', 'img/logo.jpg');\n ?>\n <?= $this->version151101() ?>\n <?= $this->getBannerPart() ?>\n <?php\n }", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "function do_signup_header()\n {\n }", "abstract public function header();", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "private function loadHeaderTable($name) {\n\t$template = $this->loadTemplate(\"templates/controls/grid/templateListHeader.txt\");\n\t$template = $this->replaceTemplateString($template, \"[scaffold-name]\", $name);\n\treturn $template;\n }", "public function add_header() {\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "function add_sections_and_fields(): void {}", "function gray_left_box_header_field(){\n \t$options = get_option(\"gray_home_options\");\n \t?>\n \t<input type=\"text\" size=\"36\" name=\"gray_home_options[leftHeader]\" value=\"<?php echo htmlentities($options[\"leftHeader\"])?>\"/>\n \t<?php\n }", "static function add_spotlight_notice_header(): void {\r\n self::add_acf_inner_field(self::spotlight, self::spotlight_notice_header, [\r\n 'label' => 'Notice title',\r\n 'default_value' => 'Notice',\r\n 'maxlength' => 20,\r\n 'placeholder' => 'Notice',\r\n 'prepend' => '',\r\n 'append' => '',\r\n 'type' => 'text',\r\n 'instructions' => '',\r\n 'required' => 1,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::spotlight_type),\r\n 'operator' => '==',\r\n 'value' => 'notice',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n 'readonly' => 0,\r\n 'disabled' => 0,\r\n ]);\r\n }", "public function addHeader()\n {\n }", "function import_text( $text ) {\r\n // quick sanity check\r\n if (empty($text)) {\r\n return '';\r\n }\r\n $data = $text[0]['#'];\r\n return addslashes(trim( $data ));\r\n }", "function gray_right_box_header_field(){\n\t\t$options = get_option(\"gray_home_options\");\n\t\t\t?>\n\t\t<input type=\"text\" size=\"36\" name=\"gray_home_options[rightHeader]\" value=\"<?php echo htmlentities($options[\"rightHeader\"]) ?>\"/>\n\t\t<?php\n }", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "function getHeader() {\n return '';\n }", "function initialize () {\n $this->set_openingtag ( \"<TEXTAREA[attributes]>\" );\n\t$this->set_closingtag ( \"</TEXTAREA>\" );\n\t$this->set_type (\"textarea\");\n }", "function mu_remove_h1_wp_editor( $init ) {\n $init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Pre=pre';\n return $init;\n}", "public function fields()\n\t{\n\t\t$block = new FieldsBuilder('page_header');\n\t\t$block\n\t\t\t->addText('title', [\n\t\t\t\t'label' => 'Title',\n\t\t\t\t'instructions' => 'Enter an optional title for this page header (will default to page title)',\n\t\t\t])\n\t\t\t->addImage('image', [\n\t\t\t\t'label' => 'Image',\n\t\t\t\t'instructions' => 'Select the image to be used in this page header (will default to featured image)'\n\t\t\t]);\n\n\t\treturn $block->build();\n\t}", "public function getPhpHeader ()\n {\n $year = date(\"Y\");\n return <<<EOD\n<?php\n/**\n * @link http://hiqdev.com/{$this->packageName}\n * @license http://hiqdev.com/{$this->packageName}/license\n * @copyright Copyright (c) {$year} HiQDev\n */\n\nEOD;\n }", "public function wishlist_header( $var ) {\n\t\t $template = isset( $var['template_part'] ) ? $var['template_part'] : 'view';\n\t\t\t$layout = ! empty( $var['layout'] ) ? $var['layout'] : '';\n\n\t\t yith_wcwl_get_template_part( $template, 'header', $layout, $var );\n }", "function gray_middle_box_header_field(){\n\t\t$options = get_option(\"gray_home_options\");\n\t\t?>\n\t\t<input type=\"text\" size=\"36\" value=\"<?php echo htmlentities( $options[\"middleHeader\"]) ?>\" name=\"gray_home_options[middleHeader]\" />\n\t\t<?php\n }", "function Header() {\n\t\tif (is_null($this->_tplIdx)) {\n\t\t\t$this->setSourceFile('gst3.pdf');\n\t\t\t$this->_tplIdx = $this->importPage(1);\n\t\t}\n\t\t$this->useTemplate($this->_tplIdx);\n\n\t\t$this->SetFont('freesans', 'B', 9);\n\t\t$this->SetTextColor(255);\n\t\t$this->SetXY(60.5, 24.8);\n\t\t$this->Cell(0, 8.6, \"TCPDF and FPDI\");\n\t}", "function theme_helper_import_field_table($form) {\n $header = $form['#node_import-columns'];\n $rows = array();\n $groups = array();\n\n foreach (element_children($form) as $child) {\n if (!isset($form[$child]['#type']) || $form[$child]['#type'] != 'value') {\n $title = check_plain($form[$child]['#title']);\n $description = $form[$child]['#description'];\n $group = isset($form[$child]['#node_import-group']) ? $form[$child]['#node_import-group'] : '';\n unset($form[$child]['#title']);\n unset($form[$child]['#description']);\n\n if (!isset($groups[$group])) {\n $groups[$group] = array();\n }\n\n $groups[$group][] = array(\n check_plain($title) . '<div class=\"description\">'. $description .'</div>',\n drupal_render($form[$child]),\n );\n }\n }\n\n if (isset($groups['']) && !empty($groups[''])) {\n $rows = array_merge($rows, $groups['']);\n }\n\n foreach ($groups as $group => $items) {\n if ($group !== '' && !empty($items)) {\n $rows[] = array(\n array('data' => $group, 'colspan' => 2, 'class' => 'region'),\n );\n $rows = array_merge($rows, $items);\n }\n }\n\n if (empty($rows)) {\n $rows[] = array(array('data' => $form['#node_import-empty'], 'colspan' => 2));\n }\n\n return theme('table', $header, $rows) . drupal_render($form);\n}", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "function Header(){\r\n\t\t//Aqui va el encabezado\r\n\t\tif ($this->iSector==98){\r\n\t\t\tp_FuenteGrandeV2($this,'B');\r\n\t\t\t$this->Cell($this->iAnchoLibre,5,utf8_decode('Información de depuración'), 0, 0, 'C');\r\n\t\t\t$this->Ln();\r\n\t\t\treturn;\r\n\t\t\t}\r\n\t\t$iConFondo=0;\r\n\t\tif ($this->sFondo!=''){\r\n\t\t\tif (file_exists($this->sFondo)){\r\n\t\t\t\t$this->Image($this->sFondo, 0, 0, $this->iAnchoFondo);\r\n\t\t\t\t$iConFondo=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t$yPos=$this->GetY();\r\n\t\tif ($yPos<$this->iBordeEncabezado){\r\n\t\t\t$this->SetY($this->iBordeEncabezado);\r\n\t\t\t}\r\n\t\tif ($iConFondo==0){\r\n\t\t\tp_TituloEntidad($this, false);\r\n\t\t\t}else{\r\n\t\t\tp_FuenteGrandeV2($this,'B');\r\n\t\t\t}\r\n\t\tif ($this->iReporte==1902){\r\n\t\t\t//Ubique aqui los componentes adicionales del encabezado\r\n\t\t\t$this->Cell($this->iAnchoLibre,5,'Eventos '.$this->sRefRpt, 0, 0, 'C');\r\n\t\t\t$this->Ln();\r\n\t\t\t}\r\n\t\t$yPos=$this->GetY();\r\n\t\tif ($yPos<$this->iBordeSuperior){\r\n\t\t\t$this->SetY($this->iBordeSuperior);\r\n\t\t\t}\r\n\t\t}", "function setHeader($header_template_name)\n\t{\n\n\t\t$header_string\t\t=\t\t$this->gCache->cache_or_get(CACHE_CACHE_TIME_TINY, \"\",$header_template_name, \"load_template_file\",$header_template_name);\n\n\t\t# the header has special substitutions for jquery css and jquery js\n\t\t$jquery_ui_css_string\t=\t\"<link rel='stylesheet' href='\" . \tJQUERY_UI_CSS\t.\t\"' />\";\n\t\t$jquery_ui_js_string\t=\t'<script src=\"' . \tJQUERY_UI_JS\t.\t'\"></script>';\n\n\t\t$jquery_js_string\t\t=\t'<script src=\"' . \tJQUERY_JS\t\t.\t'\"></script>'. \"\\n\";\n\t\t$jquery_js_string\t\t.=\t'<script> window.jQuery || document.write(\"<script src=/app/includes/js/jquery/jquery-1.10.2.min.js><\\/script>\")</script>';\n\n\n\t\t$basic_tags\t\t\t=\n\n\t\t\tarray\n\t\t\t(\n\t\t\t\t\"{{header}}\"\t\t\t\t=>\t$header_string,\n\t\t\t\t\"{{jquery_ui_css}}\"\t\t\t=>\t$jquery_ui_css_string,\n\t\t\t\t\"{{jquery_ui_js}}\"\t\t\t=>\t$jquery_ui_js_string,\n\t\t\t\t\"{{jquery_js}}\"\t\t\t\t=>\t$jquery_js_string,\n\t\t\t);\n\n\n\t\t# append the array\n\t\t$this->sub_tags($basic_tags);\n\n\n\t}", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('columnheaders', $this->data->_data[1]);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "public function getHeaderText()\n {\n return __('Edit question');\n }" ]
[ "0.5486219", "0.54106927", "0.5353058", "0.5314122", "0.5278608", "0.525247", "0.51403344", "0.5138327", "0.5132187", "0.51316994", "0.5102319", "0.51012313", "0.50904256", "0.50699586", "0.5052026", "0.5043884", "0.5042542", "0.50385123", "0.5025942", "0.5023656", "0.50211185", "0.5016126", "0.50081235", "0.5006829", "0.49513927", "0.49355346", "0.49292946", "0.49227333", "0.49189118", "0.49142745", "0.49119666", "0.4908069", "0.4896632", "0.48961195", "0.48868674", "0.4871", "0.48676986", "0.4837266", "0.48323277", "0.48267862", "0.48189822", "0.48129755", "0.48012012", "0.47977966", "0.47925836", "0.47921082", "0.478677", "0.4785215", "0.4774132", "0.47640237", "0.47604564", "0.47563547", "0.47561175", "0.47551543", "0.47494093", "0.4749127", "0.4747177", "0.47402772", "0.47382832", "0.47316942", "0.4731203", "0.4729751", "0.47274223", "0.47260684", "0.4725513", "0.47211963", "0.4709837", "0.47060528", "0.47046983", "0.47016987", "0.46954483", "0.4691602", "0.46887943", "0.46862233", "0.46853802", "0.46845648", "0.4683411", "0.46830282", "0.46828982", "0.46776643", "0.46695715", "0.46682668", "0.46659794", "0.4662481", "0.46616971", "0.46551034", "0.4654817", "0.46521494", "0.4644509", "0.46429256", "0.46421298", "0.46403915", "0.46397907", "0.46358162", "0.46335298", "0.46245992", "0.46221802", "0.46203706", "0.46185625", "0.46184608" ]
0.5842437
0
Imports a url header i.e. a field's declaration.
protected function process_header_url(import_settings $settings, $data, $name, $description, $options) { $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $autolink = true); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[Pure]\nfunction http_parse_headers($header) {}", "public static function loadHeader($url)\n\t{\n $models = self::model()->findAllByAttributes(array('type'=>Settings::SETTING_HEADER));\n foreach($models as $model){\n $data = explode('{*}',$model->condition);\n if(count($data) > 1 ){\n if ( $data[0] !=\"\" && $data[1] !=\"\" && strpos($url,$data[0]) !==false && strpos($url,$data[1]) !==false) {\n return $model;\n }\n } else {\n if($data[0] == $url){\n return $model;\n }\n }\n }\n\t}", "function import( $source, $back_url ) {\n\t\n\t}", "function setHeaderUrl($header_url) {\n if (!preg_match(\"/(?i)^https?:\\/\\/.*$/\", $header_url))\n throw new Error(create_invalid_value_message($header_url, \"header_url\", \"html-to-pdf\", \"The supported protocols are http:// and https://.\", \"set_header_url\"), 470);\n \n $this->fields['header_url'] = $header_url;\n return $this;\n }", "public function addHeader($text, $url = NULL)\n\t{\n\t\t$header = new Header($text, $url);\n\t\t$this->headers[] = $header;\n\t\treturn $header;\n\t}", "protected function _parseHeader() {}", "public static function login_headerurl( $url ) {\n\t\t\treturn get_bloginfo( 'url' );\n\t\t}", "function curl_header(&$curl, $header) {\n return curl_headers($curl, [$header]);\n}", "public static function from_url($url)\n {\n }", "function wp_get_http_headers($url, $deprecated = \\false)\n {\n }", "public function import();", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function getHeader();", "public function getHeader();", "public function getHeader();", "function prepare_field_for_import($field)\n {\n }", "private function parseExternURL($url){\n\t\tif (!preg_match('@^(?:https?|ftp)://@i', $url)){\n\t\t\t$url = \"http://\" . $url;\n\t\t}\n\t\treturn $url;\n\t}", "public function populateHeaders(array $headers, string $url) : void\n {\n $this->url = $url;\n\n //Store internal headers in lowercase, since like in netflix.com 'location', they can be in wrong case\n $headers = array_change_key_case($headers, CASE_LOWER);\n $this->allHeaders = $headers;\n\n $this->headers[self::LOCATION] = $headers[self::LOCATION] ?? null;\n $this->headers[self::CONTENT_TYPE] = $headers[self::CONTENT_TYPE] ?? null;\n $this->headers[self::CONTENT_LENGTH] = $headers[self::CONTENT_LENGTH] ?? null;\n }", "public function head($url, $query = array(), $headers = array());", "public function add_header_style ($url) {\r\n\t\treturn $this->set(self::HEADER_STYLES, $url);\r\n\t}", "public function importHeader($admin){\n\t return parent::importHeader($admin);\n\t}", "public function add_header() {\n }", "public function getHeader(string $header): string;", "protected function makeHeader()\n {\n }", "public function fetchHeaders($url) {\n\t\t$headers = '';\n\n\t\tif($url_info = parse_url($url)) {\n\t\t\t$port = (isset($url_info['port'])) ? $url_info['port'] : 80;\n\t\t\t\n\t\t\tif($url_info['scheme'] == 'https') {\n\t\t\t\t$fp = fsockopen('ssl://' . $url_info['host'], 443, $errno, $errstr, 30);\n\t\t\t} else {\n\t\t\t\t$fp = fsockopen($url_info['host'], $port, $errno, $errstr, 30);\n\t\t\t}\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\techo \"$errstr ($errno)\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$out = 'HEAD ' . (isset($url_info['path']) ? $url_info['path'] : '/') .\n\t\t\t\t\t(isset($url_info['query']) ? '?' . $url_info['query']: '') .\n\t\t\t\t\t\" HTTP/1.1\\r\\n\";\n\t\t\t\t\t\n\t\t\t\t$out .= 'Host: ' . $url_info['host'] . \"\\r\\n\";\n\t\t\t\t$out .= 'User-Agent: ' . self::$agent_name . \"\\r\\n\";\n\t\t\t\t$out .= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\n\t\t\t\tfwrite($fp, $out);\n\n\t\t\t\t$contents = '';\n\n\t\t\t\twhile(!feof($fp)) $contents .= fgets($fp, 128);\n\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\n\t\t\t\tlist($headers, $content) = explode(\"\\r\\n\\r\\n\", $contents, 2);\n\t\t\t\t$headers = explode( \"\\r\\n\", $headers );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $headers;\n\t}", "public function addHeader()\n {\n }", "#[Pure]\n public function getHeader($header) {}", "public function setHeader($header);", "public function addHeader($header);", "function loadHeaders() {\n\n\t\t$id = \"original_id\";\n\t\t$title = \"title\";\n\t\t\n\t\treturn $id . $_POST[$id] . \"&\" . $title . $_POST[$title];\n\n\t}", "function rest_output_link_header()\n {\n }", "public function __construct(string $header) {\n\t\t$this->header = $header;\n\t}", "function pxlz_edgtf_set_header_object() {\n $header_type = pxlz_edgtf_get_meta_field_intersect('header_type', pxlz_edgtf_get_page_id());\n $header_types_option = pxlz_edgtf_get_header_type_options();\n\n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if (Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\PxlzEdgefHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "public function init() {\n include(\"Url.php\");\n }", "public function import(): void;", "public function fromUrl(string $name, string $value, array $context = array());", "public function testGetParameterFromHeader(): void\n {\n // setup\n Layer::setAllHeaders([\n 'Custom-Header' => 'header value'\n ]);\n\n $requestParams = $this->getRequestParamsMock();\n\n // test body\n /** @var string $param */\n $param = $requestParams->getParam('Custom-Header');\n\n // assertions\n $this->assertEquals('header value', $param, 'Header value must be fetched but it was not');\n }", "public function buildHeaderFields() {}", "function get_header($name = \\null, $args = array())\n {\n }", "abstract public function header($name, $value);", "#[Pure]\nfunction http_get_request_headers() {}", "public function getHeader(string $name);", "function acf_prepare_field_for_import($field)\n{\n}", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "public function import(\\RealtimeDespatch\\OrderFlow\\Model\\Request $request);", "public function setUrl( $url );", "function _parseHeader($header) {\n\n\t\tif (is_array($header)) {\n\t\t\tforeach ($header as $field => $value) {\n\t\t\t\tunset($header[$field]);\n\t\t\t\t$field = strtolower($field);\n\t\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\n\t\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t\t}\n\t\t\t\t$header[$field] = $value;\n\t\t\t}\n\t\t\treturn $header;\n\t\t} elseif (!is_string($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpreg_match_all(\"/(.+):(.+)(?:(?<![\\t ])\" . $this->line_break . \"|\\$)/Uis\", $header, $matches, PREG_SET_ORDER);\n\n\t\t$header = array();\n\t\tforeach ($matches as $match) {\n\t\t\tlist(, $field, $value) = $match;\n\n\t\t\t$value = trim($value);\n\t\t\t$value = preg_replace(\"/[\\t ]\\r\\n/\", \"\\r\\n\", $value);\n\n\t\t\t$field = $this->_unescapeToken($field);\n\n\t\t\t$field = strtolower($field);\n\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t}\n\n\t\t\tif (!isset($header[$field])) {\n\t\t\t\t$header[$field] = $value;\n\t\t\t} else {\n\t\t\t\t$header[$field] = array_merge((array) $header[$field], (array) $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $header;\n\t}", "public static function parse_URL($url)\n {\n }", "public function fromHeader($header, $dataType)\n\t{\n\t\treturn $this->fromString($header, $dataType);\n\t}", "protected static function parse_url($url)\n {\n }", "public function withHeader($name, $value)\n {\n }", "function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }", "public function __construct(Url $url)\n {\n $this->url = $url;\n\n $this->prefix = $this->parsePrefixFrom($url);\n $this->domain = $this->parseDomainFrom($url);\n }", "public function getHeader() {\n }", "public function testGetHeader_headerSetAndHostSet_headerFromSet()\n {\n $sHost = 'someHost';\n $aHeader = array('Test header');\n $oCurl = oxNew('oxCurl');\n $oCurl->setHost($sHost);\n $oCurl->setHeader($aHeader);\n\n $this->assertEquals($aHeader, $oCurl->getHeader(), 'Header must be same as set header.');\n }", "public static function parseURL($url) {\n\t\t\t\t\n\t\t}", "function curl_headers(&$curl, $headers = []) {\n return $headers ? curl_option($curl, CURLOPT_HTTPHEADER, $headers) : $curl;\n}", "public function fetch($url);", "public function prepareImport();", "function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}", "function get_html_header();", "public function getHeaderValue();", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "public static function withHeaderString($header)\n {\n $lines = explode(\"\\n\", $header);\n\n // Extract the method and uri\n [$method, $uri] = explode(' ', array_shift($lines));\n\n $headers = [];\n\n foreach ($lines as $line) {\n if ( strpos( $line, ': ' ) !== false ) {\n [$key, $value] = explode(': ', $line);\n\n $headers[$key] = $value;\n }\n }\n\n return new static($method, $uri, $headers);\n }", "public function getHeader($name);", "public function __construct($name, $url){\n $this->_id = $name;\n $this->_name = $name;\n $this->_content = $this->checkFormat($url);\n }", "function _or_chart_url_build_header($user_page_user = NULL) {\n\n $header = array();\n if (user_access('manage and filter site statistics')) { \n //$header[] = theme('table_select_header_cell');\n }\n $header[] = array('data' => t('url'), 'field' => 'url');\n $header[] = array('data' => t('url名'), 'field' => 'urlname');\n $header[] = array('data' => t('时间'), 'field' => 'created', 'sort' => 'desc');\n $header[] = array('data' => t('总访问量'), 'field' => 'visit_num');\n if (user_access('manage and filter site statistics')) {\n $header[] = array('data' => t('操作'));\n }\n\n //add table select all\n drupal_add_js('misc/tableselect.js');\n array_unshift($header, array('class' => array('select-all')));\n return $header;\n}", "public function import()\n {\n \n }", "protected function initializeImport() {}", "abstract public function header();", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "protected function getHeaders($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, TRUE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); //Follow Location (ex: code 301)\n curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $head = curl_exec($ch);\n curl_close($ch);\n return $head;\n }", "protected function _getHostsDeclaration($url) {\n $hostsEntry = \"127.0.0.1 $url\";\n return $hostsEntry;\n }", "function setHeader($header)\t{\n\t\tif(isset($header))\t{\n\t\t\tcurl_setopt($this->ch, CURLOPT_HTTPHEADER, $header);\n\t\t}\n\t\telse {\n\t\t\techo \"** Expecting header.\\n\";\n\t\t}\n\t}", "public function __construct($url)\n {\n $this->url = $url;\n $this->curl = curl_init($this->url);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl, CURLINFO_HEADER_OUT, true);\n curl_setopt($this->curl, CURLOPT_HEADER, 1);\n }", "public function parse($url);", "protected function loginHeaderUrl(string $url): string\n {\n if (!\\is_multisite()) {\n return \\home_url();\n }\n\n return $url;\n }", "abstract protected function getHeader(Project $project);", "function getHeader($header, $loc = '') {\n\tglobal $sql;\n\t$sql = \"SELECT header FROM \" . $loc . \"snapshot_headers WHERE id=\".$header;\n\t$query = mysql_query($sql);\n\tcheckDBError($sql);\n\tif ($result = mysql_fetch_array($query))\n\t\treturn $result['header'];\n\treturn \"\";\n}", "public function setUrl($url) {}", "public function importLine(Import $import, ImportLine $line);", "public function findImport($url){\n\t\t$matches = array();\n\t\tif(preg_match('|#WE:(\\d+)#|', $url, $matches)){\n\t\t\t$url = intval($matches[1]);\n\t\t\treturn (f('SELECT Extension FROM ' . FILE_TABLE . ' WHERE ID=' . $url) === '.scss' ? $url : null);\n\t\t}\n\t\treturn parent::findImport($url);\n\t}", "function import_module($import_key,$type,$imported,$install_mode){\r\n\t\t$this->import_key = $import_key;\r\n\t\t$this->type = $type;\r\n\t\t$this->imported = $imported;\r\n\t\t$this->install_mode = $install_mode;\r\n\t\t$this->mount_point = \"\";\r\n\t\t$this->mount_item = 0;\r\n\t}", "function getHeader($ch, $header) {\n\t\t\t$i = strpos($header, ':');\n\t\t\tif (!empty($i)) {\n\t\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t\t$this->http_header[$key] = $value;\n\t\t\t}\n\t\t\treturn strlen($header);\n\t\t}", "function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }", "function urlparse(string $url): \\Midnite81\\UrlParser\\Url\n {\n return new \\Midnite81\\UrlParser\\Url($url);\n }", "function _load_headers(&$app, &$c) {\n\t\t$headers =& $c->param('app.view_http.request.headers');\n\t\tif (is_array($headers)) {\n\t\t\tforeach($headers as $h_name => $h_value) {\n\t\t\t\t$this->_http->addHeader($h_name, $h_value);\n\t\t\t}\n\t\t}\n\t}", "public function _head($url = null, array $parameters = []);", "public function addHeader($name, $value);", "public function addHeader($name, $value);", "public function getHeader($headerName);", "function getHeader($ch, $header) {\r\n $i = strpos($header, ':');\r\n if (!empty($i)) {\r\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\r\n $value = trim(substr($header, $i + 2));\r\n $this->http_header[$key] = $value;\r\n }\r\n return strlen($header);\r\n }", "public function setHeader($name, $value) {}", "function _parseUrl($url) {\n\n\t\t// parse url\n\t\t$url = array_merge(array('user' => null, 'pass' => null, 'path' => '/', 'query' => null, 'fragment' => null), parse_url($url));\n\t\t\n\t\t// set scheme\n\t\tif (!isset($url['scheme'])) {\n\t\t\t$url['scheme'] = 'http';\n\t\t}\n\n\t\t// set host\n\t\tif (!isset($url['host'])) {\n\t\t\t$url['host'] = $_SERVER['SERVER_NAME'];\n\t\t}\n\n\t\t// set port\n\t\tif (!isset($url['port'])) {\n\t\t\t$url['port'] = $url['scheme'] == 'https' ? 443 : 80;\n\t\t}\n\n\t\t// set path\n\t\tif (!isset($url['path'])) {\n\t\t\t$url['path'] = '/';\n\t\t}\n\t\t\n\t\treturn $url;\n\t}", "function http_req_header($field)\r\n{\r\n\tglobal $sn_http_state;\r\n\tglobal $sn_http_req_header;\r\n\r\n\tif($sn_http_state != HTTP_STATE_CLOSED)\r\n\t{\r\n\t\techo \"http_req_header: session busy\\r\\n\";\r\n\t\treturn;\r\n\t}\r\n\r\n\t// don't use explode(). field value may contain ':'\r\n\t$pos = strpos($field, \":\");\r\n\r\n\tif($pos === false)\r\n\t{\r\n\t\techo \"http_req_header: invalid header field $field\\r\\n\";\r\n\t\treturn;\r\n\t}\r\n\r\n\t$field_name = ltrim(rtrim(substr($field, 0, $pos)));\r\n\r\n\tif(!$field_name)\r\n\t{\r\n\t\techo \"http_req_header: invalid header field $field\\r\\n\";\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(strlen($field) > ($pos + 1))\r\n\t\t$field_value = ltrim(rtrim(substr($field, $pos + 1)));\r\n\telse\r\n\t\t$field_value = \"\";\r\n\r\n\t$sn_http_req_header .= ($field_name . \":\");\r\n\r\n\tif($field_value)\r\n \t\t$sn_http_req_header .= (\" \" . $field_value);\r\n\r\n\t$sn_http_req_header .= \"\\r\\n\";\r\n}", "public function setURL($url);", "public function setURL($url);", "function getHeader($ch, $header) {\n\t\t$i = strpos($header, ':');\n\t\tif (!empty($i)) {\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t$this->http_header[$key] = $value;\n\t\t}\n\t\treturn strlen($header);\n\t}", "public function loadByUrl($url);" ]
[ "0.584257", "0.5803464", "0.5531056", "0.5495312", "0.54339224", "0.54058033", "0.5372545", "0.52713007", "0.5231562", "0.5183688", "0.51526153", "0.5133383", "0.51253843", "0.51253843", "0.51253843", "0.5111218", "0.5063829", "0.50505126", "0.49994794", "0.49924287", "0.49883553", "0.4960141", "0.49385595", "0.49185288", "0.48988858", "0.48981863", "0.48955533", "0.4868635", "0.48660225", "0.48658982", "0.484998", "0.4838157", "0.4807871", "0.48036653", "0.4797669", "0.47924408", "0.4790995", "0.47888562", "0.47824875", "0.47793037", "0.4777156", "0.47742155", "0.47563726", "0.47463343", "0.47412974", "0.472049", "0.47166473", "0.47150204", "0.47108385", "0.46995544", "0.4696326", "0.46872073", "0.46854407", "0.46828678", "0.46767893", "0.46752593", "0.4669784", "0.4668111", "0.46667847", "0.46660116", "0.4662088", "0.4649141", "0.46483374", "0.46470374", "0.46435076", "0.46363923", "0.46353146", "0.46331012", "0.46319798", "0.46299547", "0.4629411", "0.46273196", "0.46258354", "0.46250165", "0.46120623", "0.4608292", "0.46063727", "0.46058917", "0.46021226", "0.45963132", "0.4591111", "0.45894068", "0.4588463", "0.45870602", "0.45867947", "0.4584658", "0.4580528", "0.45785537", "0.45784292", "0.45768735", "0.45768735", "0.45738143", "0.45669144", "0.45656407", "0.45650217", "0.4563732", "0.45618755", "0.45618755", "0.45603654", "0.45538777" ]
0.5735358
2
PROCESS BODY PROCESS BODY PROCESS BODY PROCESS BODY PROCESS BODY PROCESS BODY PROCESS BODY Process and import the body i.e. content of the table. Parses the table and calls the specialized import method based on the field's type.
protected function process_body(import_settings $settings, $data, $fields) { $doc = $settings->get_dom(); $list = $doc->getElementsByTagName('tbody'); $body = $list->item(0); $rows = $body->getElementsByTagName('tr'); foreach ($rows as $row) { $data_record = $this->get_data_record($data); //do not create datarecord if there are no rows to import $index = 0; $cells = $row->getElementsByTagName('td'); foreach ($cells as $cell) { $field = $fields[$index]; $type = $field->type; $f = array($this, 'process_data_' . $type); if (is_callable($f)) { call_user_func($f, $settings, $field, $data_record, $cell); } else { $this->process_data_default($settings, $field, $data_record, $cell); } $index++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareImportContent();", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "public function import()\n {\n // Reorder importers\n usort($this->entityImporterMappings, function ($a, $b) {\n return $a[ORDER] <=> $b[ORDER];\n });\n\n // Import each entity type in turn\n foreach ($this->entityImporterMappings as $entityImporterMapping) {\n $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]);\n foreach ($files as $filename => $slug) {\n $fileContents = file_get_contents($filename);\n $entityData = json_decode($fileContents, true);\n $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData);\n }\n }\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function wp_parser_starting_import() {\n\t\t$importer = new Importer;\n\n\t\tif ( ! $this->p2p_tables_exist() ) {\n\t\t\t\\P2P_Storage::init();\n\t\t\t\\P2P_Storage::install();\n\t\t}\n\n\t\t$this->post_types = array(\n\t\t\t'hook' => $importer->post_type_hook,\n\t\t\t'method' => $importer->post_type_method,\n\t\t\t'function' => $importer->post_type_function,\n\t\t);\n\t}", "protected function importDatabaseData() {}", "function _updateSiteImportTable()\n\t{\n\t\t\n\t\t$_templateFields = weSiteImport::_getFieldsFromTemplate($_REQUEST[\"tid\"]);\n\t\t$hasDateFields = false;\n\t\t\n\t\t$values = array();\n\t\t\n\t\tforeach ($_templateFields as $name => $type) {\n\t\t\tif ($type == \"date\") {\n\t\t\t\t$hasDateFields = true;\n\t\t\t}\n\t\t\tswitch ($name) {\n\t\t\t\tcase \"Title\" :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => \"<title>\", \"post\" => \"</title>\"\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Keywords\" :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => '<meta name=\"keywords\" content=\"', \"post\" => '\">'\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Description\" :\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$values, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"name\" => $name, \n\t\t\t\t\t\t\t\t\t\"pre\" => '<meta name=\"description\" content=\"', \n\t\t\t\t\t\t\t\t\t\"post\" => '\">'\n\t\t\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Charset\" :\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$values, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"name\" => $name, \n\t\t\t\t\t\t\t\t\t\"pre\" => '<meta http-equiv=\"content-type\" content=\"text/html;charset=', \n\t\t\t\t\t\t\t\t\t\"post\" => '\">'\n\t\t\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => \"\", \"post\" => \"\"\n\t\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$js = 'var tableDivObj = parent.document.getElementById(\"tablediv\");\n\t\ttableDivObj.innerHTML = \"' . str_replace(\n\t\t\t\t\"\\r\", \n\t\t\t\t\"\\\\r\", \n\t\t\t\tstr_replace(\"\\n\", \"\\\\n\", addslashes($this->_getSiteImportTableHTML($_templateFields, $values)))) . '\"\n\t\tparent.document.getElementById(\"dateFormatDiv\").style.display=\"' . ($hasDateFields ? \"block\" : \"none\") . '\";\n';\n\t\t\n\t\t$js = we_htmlElement::jsElement($js) . \"\\n\";\n\t\treturn $this->_getHtmlPage(\"\", $js);\n\t}", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "public function prepareImport();", "public function importer($type) {\n $mappings = array(\n new Name('first_name'),\n new Name('last_name'),\n );\n if ($type == 'campaignion_action_taken') {\n $mappings = array_merge($mappings, array(\n new Field('field_gender', 'gender'),\n new Field('field_salutation', 'salutation'),\n new Field('field_title', 'title'),\n new Date('field_date_of_birth', 'date_of_birth'),\n new Address('field_address', array(\n 'thoroughfare' => 'street_address',\n 'premise' => 'street_address_2',\n 'postal_code' => ['zip_code', 'postcode'],\n 'locality' => 'city',\n 'administrative_area' => 'state',\n 'country' => 'country',\n )),\n new Phone('field_phone_number', 'phone_number'),\n new Phone('field_phone_number', 'mobile_number'),\n new EmailBulk('redhen_contact_email', 'email', 'email_newsletter'),\n new BooleanOptIn('field_opt_in_phone', 'phone_opt_in'),\n new BooleanOptIn('field_opt_in_post', 'post_opt_in'),\n new Field('field_preferred_language', 'language'),\n ));\n }\n return new ImporterBase($mappings);\n }", "protected function process_fields($table, $data, $format)\n {\n }", "abstract protected function loadFields();", "function prepare_field_for_import($field)\n {\n }", "public function postImport() {\n parent::postImport();\n if (!civicrm_initialize()) {\n return;\n }\n // Need to clear the cache once the fields are created.\n civicrm_api3('system', 'flush', array('version' => 3));\n }", "private function loadFields() {\n\t\tif (count($this->fields) > 0) return;\n\t\t$db = getDB();\n\t\t$stat = $db->prepare(\"SELECT * FROM collection_has_field WHERE collection_id=:cid ORDER BY sort_order DESC\");\n\t\t$stat->execute(array('cid'=>$this->collection_id));\n\t\twhile($d = $stat->fetch()) {\n\t\t\tif ($d['type'] == \"STRING\") {\n\t\t\t\t$this->fields[] = new ItemFieldString( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"TEXT\") {\n\t\t\t\t$this->fields[] = new ItemFieldText( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"HTML\") {\n\t\t\t\t$this->fields[] = new ItemFieldHTML( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"EMAIL\") {\n\t\t\t\t$this->fields[] = new ItemFieldEmail( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"PHONE\") {\n\t\t\t\t$this->fields[] = new ItemFieldPhone( $d, $this->collection_id, $this);\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"We don't know about type: \".$d['type']);\n\t\t\t}\n\t\t}\n\t}", "protected abstract function importCreate($entity);", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "function theme_helper_import_field_table($form) {\n $header = $form['#node_import-columns'];\n $rows = array();\n $groups = array();\n\n foreach (element_children($form) as $child) {\n if (!isset($form[$child]['#type']) || $form[$child]['#type'] != 'value') {\n $title = check_plain($form[$child]['#title']);\n $description = $form[$child]['#description'];\n $group = isset($form[$child]['#node_import-group']) ? $form[$child]['#node_import-group'] : '';\n unset($form[$child]['#title']);\n unset($form[$child]['#description']);\n\n if (!isset($groups[$group])) {\n $groups[$group] = array();\n }\n\n $groups[$group][] = array(\n check_plain($title) . '<div class=\"description\">'. $description .'</div>',\n drupal_render($form[$child]),\n );\n }\n }\n\n if (isset($groups['']) && !empty($groups[''])) {\n $rows = array_merge($rows, $groups['']);\n }\n\n foreach ($groups as $group => $items) {\n if ($group !== '' && !empty($items)) {\n $rows[] = array(\n array('data' => $group, 'colspan' => 2, 'class' => 'region'),\n );\n $rows = array_merge($rows, $items);\n }\n }\n\n if (empty($rows)) {\n $rows[] = array(array('data' => $form['#node_import-empty'], 'colspan' => 2));\n }\n\n return theme('table', $header, $rows) . drupal_render($form);\n}", "public function import(HTTPRequest $request)\n {\n $hasheader = (bool)$request->postVar('HasHeader');\n $cleardata = $this->component->getCanClearData() ?\n (bool)$request->postVar('ClearData') :\n false;\n if ($request->postVar('action_import')) {\n $file = File::get()\n ->byID($request->param('FileID'));\n if (!$file) {\n return \"file not found\";\n }\n\n $temp_file = $this->tempFileFromStream($file->getStream());\n\n $colmap = Convert::raw2sql($request->postVar('mappings'));\n if ($colmap) {\n //save mapping to cache\n $this->cacheMapping($colmap);\n //do import\n $results = $this->importFile(\n $temp_file,\n $colmap,\n $hasheader,\n $cleardata\n );\n $this->gridField->getForm()\n ->sessionMessage($results->getMessage(), 'good');\n }\n }\n $controller = $this->getToplevelController();\n $controller->redirectBack();\n }", "function acf_prepare_field_for_import($field)\n{\n}", "public static function import_process() {}", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "public function process_export_import() {\r\n if(Tools::isSubmit('exportSubmit')){ // export data\r\n $this->_export();\r\n } else if(!empty($_FILES['importFile']['tmp_name'])){ // import data\r\n $file = $_FILES['importFile'];\r\n $type = Tools::strtolower(Tools::substr(strrchr($file['name'], '.'), 1));\r\n if ( $type == 'json' ){\r\n return $this->_import($file['tmp_name']);\r\n } else {\r\n return GearHelper::displayAlert('Please use a valid JSON file for import', 'danger');\r\n }\r\n }\r\n }", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "private function parseFields(): void\n {\n foreach ($this->reflect->getProperties() as $item) {\n $name = $item->getName();\n if (in_array($name, self::SKIP_FIELDS, true)) {\n continue;\n }\n\n $docblock = $item->getDocComment();\n $defType = $this->getFieldType($name, $docblock);\n $varType = $this->getVarType($name, $docblock);\n $isRequired = $this->isRequired($name, $docblock);\n $storage = &$this->fieldsBuffer[$defType];\n\n switch ($defType) {\n case self::FIELD_SIMPLE_TYPE:\n $storage[] = $this->processSimpleField($name, $varType, $isRequired);\n break;\n case self::FIELD_DATE_TYPE:\n $storage[] = $this->processDateField($name, $varType, $isRequired);\n break;\n case self::FIELD_MO_TYPE:\n $storage[] = $this->processManyToOneField($name, $varType, $isRequired);\n break;\n case self::FIELD_OM_TYPE:\n $storage[] = $this->processOneToManyField($name);\n break;\n }\n }\n\n unset($storage);\n }", "public function process() {\n\n\t\t\t/**\n\t\t\t * Decode all data from JSON\n\t\t\t *\n\t\t\t * @var array $data\n\t\t\t */\n\t\t\t$data = json_decode($this->getData(), true);\n\n\t\t\t/**\n\t\t\t * Get keys from first row of data set\n\t\t\t *\n\t\t\t * @var array $columNames\n\t\t\t */\n\t\t\t$columnNames = array_keys($data[0]);\n\n\t\t\t/**\n\t\t\t * Generate tablename from given columns\n\t\t\t *\n\t\t\t * @var string $tableName\n\t\t\t */\n\t\t\t$tableName = \"tmp_plista_api_\" . md5(implode($columnNames));\n\n\t\t\t/**\n\t\t\t * Building the query for creating the temporary Table\n\t\t\t * Note: This function does not fires a DROP TABLE. If the\n\t\t\t * table already exists the data gets filled in again. So the\n\t\t\t * client is responsible for droping the table after usage\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `\" . $tableName . \"`\n\t\t\t(\" . implode( $columnNames, \" VARCHAR(255), \" ) . \" VARCHAR(255))\n\t\t\tENGINE=MEMORY\n\t\t\tDEFAULT CHARSET=utf8;\";\n\n\t\t\t/**\n\t\t\t * Build the query for inserting data into the temporary table\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\tforeach ($data as $row) {\n\t\t\t\t$sql .= \"\\nINSERT INTO $tableName (\" . implode($columnNames, \", \") . \") VALUES ('\" . implode($row, \"', '\") . \"');\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * set the data\n\t\t\t */\n\t\t\t$this->setData(\n\t\t\t\tarray(\n\t\t\t\t\t\"table_name\"\t=> $tableName,\n\t\t\t\t\t\"query\"\t\t=> $sql\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function erp_process_import_export() {\n if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'erp-import-export-nonce' ) ) {\n return;\n }\n\n $is_crm_activated = erp_is_module_active( 'crm' );\n $is_hrm_activated = erp_is_module_active( 'hrm' );\n\n $departments = $is_hrm_activated ? erp_hr_get_departments_dropdown_raw() : [];\n $designations = $is_hrm_activated ? erp_hr_get_designation_dropdown_raw() : [];\n\n $field_builder_contact_options = get_option( 'erp-contact-fields' );\n $field_builder_contacts_fields = [];\n\n if ( ! empty( $field_builder_contact_options ) ) {\n foreach ( $field_builder_contact_options as $field ) {\n $field_builder_contacts_fields[] = $field['name'];\n }\n }\n\n $field_builder_company_options = get_option( 'erp-company-fields' );\n $field_builder_companies_fields = [];\n\n if ( ! empty( $field_builder_company_options ) ) {\n foreach ( $field_builder_company_options as $field ) {\n $field_builder_companies_fields[] = $field['name'];\n }\n }\n\n $field_builder_employee_options = get_option( 'erp-employee-fields' );\n $field_builder_employees_fields = array();\n\n if ( ! empty( $field_builder_employee_options ) ) {\n foreach ( $field_builder_employee_options as $field ) {\n $field_builder_employees_fields[] = $field['name'];\n }\n }\n\n if ( isset( $_POST['erp_import_csv'] ) ) {\n define( 'ERP_IS_IMPORTING', true );\n\n $fields = ! empty( $_POST['fields'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) ) : [];\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n\n if ( empty( $type ) ) {\n return;\n }\n\n $csv_file = isset( $_FILES['csv_file'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['csv_file'] ) ) : [];\n\n $data = [ 'type' => $type, 'fields' => $fields, 'file' => $csv_file ];\n\n do_action( 'erp_tool_import_csv_action', $data );\n\n if ( ! in_array( $type, [ 'contact', 'company', 'employee' ] ) ) {\n return;\n }\n\n $employee_fields = [\n 'work' => [\n 'designation',\n 'department',\n 'location',\n 'hiring_source',\n 'hiring_date',\n 'date_of_birth',\n 'reporting_to',\n 'pay_rate',\n 'pay_type',\n 'type',\n 'status',\n ],\n 'personal' => [\n 'photo_id',\n 'user_id',\n 'first_name',\n 'middle_name',\n 'last_name',\n 'other_email',\n 'phone',\n 'work_phone',\n 'mobile',\n 'address',\n 'gender',\n 'marital_status',\n 'nationality',\n 'driving_license',\n 'hobbies',\n 'user_url',\n 'description',\n 'street_1',\n 'street_2',\n 'city',\n 'country',\n 'state',\n 'postal_code',\n ]\n ];\n\n require_once WPERP_INCLUDES . '/lib/parsecsv.lib.php';\n\n $csv = new ParseCsv();\n $csv->encoding( null, 'UTF-8' );\n $csv->parse( $csv_file['tmp_name'] );\n\n if ( empty( $csv->data ) ) {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import\" ) );\n exit;\n }\n\n $csv_data = [];\n\n $csv_data[] = array_keys( $csv->data[0] );\n\n foreach ( $csv->data as $data_item ) {\n $csv_data[] = array_values( $data_item );\n }\n\n if ( ! empty( $csv_data ) ) {\n $count = 0;\n\n foreach ( $csv_data as $line ) {\n if ( empty( $line ) ) {\n continue;\n }\n\n $line_data = [];\n\n if ( is_array( $fields ) && ! empty( $fields ) ) {\n foreach ($fields as $key => $value) {\n\n if (!empty($line[$value]) && is_numeric($value)) {\n if ($type == 'employee') {\n if (in_array($key, $employee_fields['work'])) {\n if ($key == 'designation') {\n $line_data['work'][$key] = array_search($line[$value], $designations);\n } else if ($key == 'department') {\n $line_data['work'][$key] = array_search($line[$value], $departments);\n } else {\n $line_data['work'][$key] = $line[$value];\n }\n\n } else if (in_array($key, $employee_fields['personal'])) {\n $line_data['personal'][$key] = $line[$value];\n } else {\n $line_data[$key] = $line[$value];\n }\n } else {\n $line_data[$key] = isset($line[$value]) ? $line[$value] : '';\n $line_data['type'] = $type;\n }\n }\n }\n }\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n if ( ! isset( $line_data['work']['status'] ) ) {\n $line_data['work']['status'] = 'active';\n }\n\n\n $item_insert_id = erp_hr_employee_create( $line_data );\n\n if ( is_wp_error( $item_insert_id ) ) {\n continue;\n }\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $contact_owner = isset( $_POST['contact_owner'] ) ? absint( $_POST['contact_owner'] ) : erp_crm_get_default_contact_owner();\n $line_data['contact_owner'] = $contact_owner;\n $people = erp_insert_people( $line_data, true );\n\n if ( is_wp_error( $people ) ) {\n continue;\n } else {\n $contact = new \\WeDevs\\ERP\\CRM\\Contact( absint( $people->id ), 'contact' );\n $life_stage = isset( $_POST['life_stage'] ) ? sanitize_key( $_POST['life_stage'] ) : '';\n\n if ( ! $people->exists ) {\n $contact->update_life_stage( $life_stage );\n\n } else {\n if ( ! $contact->get_life_stage() ) {\n $contact->update_life_stage( $life_stage );\n }\n }\n\n if ( ! empty( $_POST['contact_group'] ) ) {\n $contact_group = absint( $_POST['contact_group'] );\n\n $existing_data = \\WeDevs\\ERP\\CRM\\Models\\ContactSubscriber::where( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id\n ] )->first();\n\n if ( empty( $existing_data ) ) {\n $hash = sha1( microtime() . 'erp-subscription-form' . $contact_group . $people->id );\n\n erp_crm_create_new_contact_subscriber( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id,\n 'status' => 'subscribe',\n 'subscribe_at' => current_time( 'mysql' ),\n 'unsubscribe_at' => null,\n 'hash' => $hash\n ] );\n }\n }\n\n\n if ( ! empty( $field_builder_contacts_fields ) ) {\n foreach ( $field_builder_contacts_fields as $field ) {\n if ( isset( $line_data[ $field ] ) ) {\n erp_people_update_meta( $people->id, $field, $line_data[ $field ] );\n }\n }\n }\n }\n }\n\n ++ $count;\n }\n\n }\n\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import&imported=$count\" ) );\n exit;\n }\n\n if ( isset( $_POST['erp_export_csv'] ) ) {\n if ( ! empty( $_POST['type'] ) && ! empty( $_POST['fields'] ) ) {\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n $fields = array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) );\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n $args = [\n 'number' => - 1,\n 'status' => 'all'\n ];\n\n $items = erp_hr_get_employees( $args );\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $args = [\n 'type' => $type,\n 'count' => true,\n ];\n $total_items = erp_get_peoples( $args );\n\n $args = [\n 'type' => $type,\n 'offset' => 0,\n 'number' => - 1,\n ];\n $items = erp_get_peoples( $args );\n }\n\n //@todo do_action()\n $csv_items = [];\n\n $x = 0;\n foreach ( $items as $item ) {\n\n if ( empty( $fields ) ) {\n continue;\n }\n\n foreach ( $fields as $field ) {\n if ( $type == 'employee' ) {\n\n if ( in_array( $field, $field_builder_employees_fields ) ) {\n $csv_items[ $x ][ $field ] = get_user_meta( $item->id, $field, true );\n } else {\n switch ( $field ) {\n case 'department':\n $csv_items[ $x ][ $field ] = $item->get_department_title();\n break;\n\n case 'designation':\n $csv_items[ $x ][ $field ] = $item->get_job_title();\n break;\n\n default:\n $csv_items[ $x ][ $field ] = $item->{$field};\n break;\n }\n }\n\n } else {\n if ( $type == 'contact' ) {\n if ( in_array( $field, $field_builder_contacts_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n if ( $type == 'company' ) {\n if ( in_array( $field, $field_builder_companies_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n }\n }\n\n $x ++;\n }\n\n $file_name = 'export_' . date( 'd_m_Y' ) . '.csv';\n\n erp_make_csv_file( $csv_items, $file_name );\n\n } else {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=export\" ) );\n exit();\n }\n }\n}", "public function import()\n {\n \n }", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "protected abstract function generateParagraphTypeBaseFields(Row $row);", "public function metaImport($data);", "public function importProcess(Request $request)\n {\n // figure out the importable fields.\n $importFields = $this->getImportableFields();\n\n // load the data stored in the database.\n $requestFields = $request->fields;\n $data = CsvData::find($request->csv_data_file_id);\n $csv_data = json_decode($data->csv_data, true);\n\n $entities = [];\n foreach ($csv_data as $idx_1 => $row) {\n if ($idx_1 == 0) {\n continue;\n }\n $entity = [];\n\n foreach ($importFields as $idx_2 => $importField) {\n $t = array_search($importField['name'], $requestFields);\n if ($t !== false) {\n $entity[$importField['name']] = isset($row[$t]) ? $row[$t] : null;\n }\n }\n\n $entities[] = $entity;\n }\n\n // resolve all the foreign keys.\n foreach ($entities as $idx_1 => &$entity) {\n foreach ($importFields as $idx_2 => $importField) {\n if (isset($importField['import_resolver'])) {\n $importField['import_resolver']($entity);\n }\n }\n }\n\n // run validations.\n $errors = [];\n foreach ($entities as $idx => &$entity) {\n $rules = $this->importValidationRules();\n $messages = $this->importValidationMessages();\n $validator = Validator::make($entity, $rules, $messages);\n if ($validator->fails()) {\n $errors[] = [\n 'row_number' => $idx + 1,\n 'errors' => $validator->errors()->all()\n ];\n }\n }\n\n // create the user appointments.\n $entityObjects = [];\n $this->beforeImport($entities);\n if (empty($errors)) {\n foreach ($entities as $idx => &$entity) {\n $entityObjects[] = $this->importCreate($entity);\n }\n }\n $this->afterImport($entityObjects);\n\n return view($this->importProcessView(), [\n 'crud' => $this->crud,\n 'errors' => $errors,\n ]);\n }", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "public function import() {\n\t\t$totalInserted = 0;\n\t\t$totalUpdated = 0;\n\t\t$totalDeleted = 0;\n\t\t$processedObjectIds = array();\n\t\t$objectRepository = $this->getDomainRepository();\n\t\t$objectValidator = $this->validatorResolver->getBaseValidatorConjunction($this->domain, self::VALIDATION_GROUPS);\n\t\t$sheet = $this->getFileActiveSheet();\n\t\tif ($sheet->getHighestRow() > $this->settings['maxImportRecord']) {\n\t\t\t$this->log(vsprintf('Your file have %d records is over maximum records. Please change settings(WE.SpreadsheetImport.maxImportRecord) if you want to import this file.', array($sheet->getHighestRow(), $this->settings['maxImportRecord'])), LOG_INFO);\n\t\t\tthrow new Exception('Maximum records are reach.', 1471257692);\n\t\t}\n\t\t$persistRecordsChunkSize = intval($this->settings['persistRecordsChunkSize']);\n\t\t$totalCount = 0;\n\t\t/** @var \\PHPExcel_Worksheet_Row $row */\n\t\tforeach ($sheet->getRowIterator(2) as $row) {\n\t\t\t$recordNumber = $row->getRowIndex() - 1;\n\t\t\t$totalCount++;\n\t\t\t$object = $this->findExistingObjectByRow($row);\n\t\t\tif (is_object($object)) {\n\t\t\t\t$id = $this->persistenceManager->getIdentifierByObject($object);\n\t\t\t\t$processedObjectIds[] = $id;\n\t\t\t\tif ($this->spreadsheetImport->isUpdating()) {\n\t\t\t\t\t$this->setObjectPropertiesByRow($object, $row);\n\t\t\t\t\t$validationResult = $objectValidator->validate($object);\n\t\t\t\t\tif ($validationResult->hasErrors()) {\n\t\t\t\t\t\t$this->log(vsprintf('Object %s for record %d skipped. Update object validation failed.', array($id, $recordNumber)), LOG_INFO);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$objectRepository->update($object);\n\t\t\t\t\t$this->log(vsprintf('Object %s for record %d updated.', array($id, $recordNumber)), LOG_INFO);\n\t\t\t\t\t$totalUpdated++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->log(vsprintf('Object %s for record %d skipped. Updating is disabled.', array($id, $recordNumber)), LOG_INFO);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} elseif ($this->spreadsheetImport->isInserting()) {\n\t\t\t\t$newObject = new $this->domain;\n\t\t\t\t$this->setObjectPropertiesByRow($newObject, $row);\n\t\t\t\t$validationResult = $objectValidator->validate($newObject);\n\t\t\t\tif ($validationResult->hasErrors()) {\n\t\t\t\t\t$this->log(vsprintf('Record %d skipped. Insert object validation failed.', array($recordNumber)), LOG_INFO);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$objectRepository->add($newObject);\n\t\t\t\t$id = $this->persistenceManager->getIdentifierByObject($newObject);\n\t\t\t\t$processedObjectIds[] = $id;\n\t\t\t\t$this->log(vsprintf('Object %s for record %d inserted.', array($id, $recordNumber)), LOG_INFO);\n\t\t\t\t$totalInserted++;\n\t\t\t} else {\n\t\t\t\t$this->log(vsprintf('Record %d skipped. Inserting is disabled.', array($recordNumber)), LOG_INFO);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($totalCount % $persistRecordsChunkSize === 0) {\n\t\t\t\t$this->persistenceManager->persistAll();\n\t\t\t}\n\t\t}\n\t\tif ($this->spreadsheetImport->isDeleting()) {\n\t\t\t$notExistingObjects = $this->findObjectsByArgumentsAndExcludedIds($processedObjectIds);\n\t\t\tforeach ($notExistingObjects as $object) {\n\t\t\t\t$id = $this->persistenceManager->getIdentifierByObject($object);\n\t\t\t\t$this->log(vsprintf('Object %s deleted.', array($id)), LOG_INFO);\n\t\t\t\t$this->emitBeforeRemove($object);\n\t\t\t\t$objectRepository->remove($object);\n\t\t\t\tif (++$totalDeleted % $persistRecordsChunkSize === 0) {\n\t\t\t\t\t$this->persistenceManager->persistAll();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->persistenceManager->persistAll();\n\t\t$this->spreadsheetImport->setTotalInserted($totalInserted);\n\t\t$this->spreadsheetImport->setTotalUpdated($totalUpdated);\n\t\t$this->spreadsheetImport->setTotalSkipped($totalCount - $totalInserted - $totalUpdated);\n\t\t$this->spreadsheetImport->setTotalDeleted($totalDeleted);\n\t}", "public function import(): void;", "public function importSource()\n {\n $this->setData('entity', $this->getDataSourceModel()->getEntityTypeCode());\n $this->setData('behavior', $this->getDataSourceModel()->getBehavior());\n\n $this->addLogComment(__('Begin import of \"%1\" with \"%2\" behavior', $this->getEntity(), $this->getBehavior()));\n\n $result = $this->processImport();\n\n if ($result) {\n $this->addLogComment(\n [\n __(\n 'Checked rows: %1, checked entities: %2, invalid rows: %3, skipped rows: %4 total errors: %5',\n $this->getProcessedRowsCount(),\n $this->getProcessedEntitiesCount(),\n $this->getErrorAggregator()->getInvalidRowsCount(),\n $this->getErrorAggregator()->getSkippedRowsCount(),\n $this->getErrorAggregator()->getErrorsCount()\n ),\n __('The import was successful.'),\n ]\n );\n } else {\n throw new LocalizedException(__('Can not import data.'));\n }\n\n return $result;\n }", "function selectFields()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\t\t\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\t\t\n\t\t\t\r\n\t\t$args = $args->get(func_get_args());\r\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display\n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'selectFields';\r\n\t\t\t\tbreak;\t\n\n\t\t\tcase 'Previous':\t\n\t\t\t\tunset( $args['key']);\r\n\t\t\t\t$result = $this->upload( $args);\r\n\t\t\t\tbreak;\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\tcase 'Next':\n\n \tif ( $this->checkFields($args) )\n {\n\t\t\t\t\t// we modify the $args['key'] value to trigger the import\n\t\t\t\t\t$args['key'] = 'importFile';\r\n\t\t\t\t\treturn $this->importFile( $args);\n\t\t\t\t}\n\n messagebox( ERROR_INVALID_DATA, ERROR);\r\n\t\t\t\t//\tNo break\r\n\r\n\t\t\tdefault:\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']); \t\t\t\t\n\n \t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\t\n \t\t\t\t\t//First is the main column names\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t\t$sample1 = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \t \t\t\t\t\n\t\t\t\t\t$sample2 = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \t \t\t\t\t\n \n \t\t\t\t\tif( $header )\n \t\t\t\t\t{\n\t \t\t\t\t\t$i=0;\n\t \t\t\t\t\tforeach( $header as $key => $val)\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\t$result['sample'][] = array( \n\t \t\t\t\t\t\t\t'field' \t=> \t'f'.$i, \t\t\t\t\t\t\n\t \t\t\t\t\t\t\t'header' \t=> \tsanitize($val, 'string'), \n\t \t\t\t\t\t\t\t'column1' \t=> \tsubstr(sanitize($sample1[$i], 'string'), 0, 30),\n\t \t\t\t\t\t\t\t'column2' \t=> \tsubstr(sanitize($sample2[$i], 'string'), 0, 30));\t\n\t \t\t\t\t\t\t$i++;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tunset( $header);\n\t\t\t\t\t$sample1 = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \t \t\t\t\t\n\t\t\t\t\t$sample2 = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \t \t\t\t\t\n\t\t\t\t\t$sample3 = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \t \t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\tif( $sample1 )\n \t\t\t\t\t{\n\t \t\t\t\t\t$i=0;\n\t \t\t\t\t\tforeach( $sample1 as $key => $val)\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\t$result['sample'][] = array( \n\t \t\t\t\t\t\t\t'field' \t=> \t'f'.$i, \t\t\t\t\t\t\n\t \t\t\t\t\t\t\t'column1' \t=> \tsubstr(sanitize($sample1[$i], 'string'), 0, 30),\n\t \t\t\t\t\t\t\t'column2' \t=> \tsubstr(sanitize($sample2[$i], 'string'), 0, 30),\n\t \t\t\t\t\t\t\t'column3' \t=> \tsubstr(sanitize($sample3[$i], 'string'), 0, 30));\t\t\t\t\t\t\t\n\t \t\t\t\t\t\t$i++;\n\t \t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\t\t\t\t\n\t\t\t\tfclose($fp);\n\n\t \t\t// we get the table schema from child classe \n\t\t\t\t$this->setTableSchema($header);\t \r\n \t\t\t\t\n \t\t\t\t$result['columns'] = $this->tableSchema;\n \t\t\t\t$result['index_name'] = $this->importIndex;\n\t\t\t\t\n\t\t\t\t$_SESSION['import']['count'] = $i;\n\t\t\t\t\t\t \r\n\t\t\t\t$result['action']['import'] = 'selectFields';\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\n return $result;\r\n }", "protected function traverseFields(): void\n {\n $columns = $this->definition->tca['columns'] ?? [];\n foreach ($this->definition->data as $fieldName => $value) {\n if (! is_array($columns[$fieldName])) {\n continue;\n }\n \n $this->registerHandlerDefinitions($fieldName, $columns[$fieldName], [$fieldName]);\n \n // Handle flex form fields\n if (isset($columns[$fieldName]['config']['type']) && $columns[$fieldName]['config']['type'] === 'flex') {\n $this->flexFormTraverser->initialize($this->definition, [$fieldName])->traverse();\n }\n }\n }", "protected function loadRow() {}", "public function import()\n {\n //then by the element set name\n if(!$this->record) {\n $this->record = $this->db->getTable('ElementSet')->findByName($this->responseData['name']);\n }\n\n if(!$this->record) {\n $this->record = new ElementSet;\n }\n //set new value if element set exists and override is set, or if it is brand new\n if( ($this->record->exists() && get_option('omeka_api_import_override_element_set_data')) || !$this->record->exists()) {\n $this->record->description = $this->responseData['description'];\n $this->record->name = $this->responseData['name'];\n $this->record->record_type = $this->responseData['record_type'];\n }\n\n try {\n $this->record->save(true);\n $this->addOmekaApiImportRecordIdMap();\n } catch(Exception $e) {\n _log($e);\n }\n }", "public function import();", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "function _clientsDoImport($data,$defaults,$update=0) {\n\n\t## prepare the select element wiht all available fields\n\t$wt = new ctlparser(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/base.xml');\n\t$wt->parse();\t\t\n\t$elements = $wt->getSimplifiedElements();\n\t$objects = $wt->getObjects();\n\n\t$allowed_types = array('text','email');\n\t\n\t## we need to find out if we have an entry that is marked as unique\n\t$unique_element = array();\n\tforeach($elements as $current_element) {\n\t\tif(isset($current_element['UNIQUE'])) {\n\t\t\t$unique_element = $current_element;\n\t\t}\n\t}\n\n\t$db_connectionStore = new DB_Sql();\n\t## the data array can now be processed.\n\t##var_dump($elements);\n\tforeach($data as $current_dataelement) {\n\t\t## here we will stroe the id of the current entry\n\t\t$id = 0;\n\t\n\t\t## we need to check if we have an element that matches our unique identifier\n\t\tif(isset($unique_element['IDENTIFIER']) && !empty($current_dataelement[$unique_element['IDENTIFIER']])) {\t\t\n\t\t\t## for now we only support text elements of email elements as unique tokens\n\t\t\t$query = \"SELECT id FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" WHERE \".$unique_element['IDENTIFIER'].\"='\".$current_dataelement[$unique_element['IDENTIFIER']].\"'\";\n\t\t\t$result_pointer = $db_connectionStore->query($query);\n\n\t\t\tif($db_connectionStore->num_rows() < 1) {\t\n\t\t\t\t## we need to import the other fields. \n\t\t\t\t$query = \"INSERT INTO \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" (groupid) values ('1')\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($query,true);\n\t\t\t\t$id = $db_connectionStore->db_insertid($result_pointer);\t\n\t\t\t} else if($update == 1) {\n\t\t\t\t$db_connectionStore->next_record();\n\t\t\t\t$id = $db_connectionStore->Record['id'];\n\t\t\t}\n\t\t} else {\n\t\t\t## we do not have a unique attribute- so no way to identifiy if there are any duplicate entries-\n\t\t\t## this means we need to import them all \n\t\t\t$query = \"INSERT INTO \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" (groupid) values ('1')\";\n\t\t\t$result_pointer = $db_connectionStore->query($query,true);\n\t\t\t$id = $db_connectionStore->db_insertid($result_pointer);\n\t\t}\n\t\t\n\t\t## okay we have a base object- now we should call the import function of each attribute\n\t\tif($id > 0) {\n\t\t\tforeach($objects as $current_attribute=>$value) {\n\t\t\t\t$type = strtolower($current_attribute);\n\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(ENGINE.\"modules/clients/attributetypes/\".$type.\"/attribute.php\");\n\n\t\t\t\t## now we check if the function exists\n\t\t\t\tif(function_exists(\"clients_\".$type.\"_importData\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\teval(\"clients_\".$type.\"_importData(\\$id,\\$elements,\\$current_dataelement);\");\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\n\t}\n}", "function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }", "function execute()\n {\n $this->OldModel = $this->getOldModelToUse();\n $this->OldModel->cacheQueries = false;\n $this->OldModel->cacheSQL = false;\n $this->NewModel = $this->getNewModelToUse();\n $this->NewModel->cacheQueries = false;\n $this->NewModel->cacheSQL = false;\n \n $tableMap = $this->getTableMap();\n debug($tableMap);\n if (!$tableMap)\n {\n $this->print_instructions();\n exit();\n }\n\n foreach ($tableMap as $table => $data)\n {\n if (!$this->specialProcessing($table, $data))\n {\n $this->import($table, $data);\n }\n }\n }", "public function processImport(Request $request)\n\t{\n\n\t\t$importCsv = new ImportCsv;\n\t\t$csvData = $importCsv->getTmpCsv($request);\n\n\t\tif ($csvData === null || route('import_parse') !== \\URL::previous() ) {\n\t\t\treturn back();\n\t\t}\n\n\t\tif (!in_array('0', $_POST['fields']) || !in_array('1', $_POST['fields']) || !in_array('2', $_POST['fields']) || !in_array('3', $_POST['fields']) || count($_POST['fields']) != 4) {\n\t\t\treturn redirect('/errorparseimport')->with('status', 'Error! Make sure there is one of each fields set. No more or less.');\n\t\t}\n\n\t\t$csvData = array_slice($csvData, 1);\n\n\t\t$newArray = array();\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$newArray[$i] = array_search($i, $_POST['fields']);\n\t\t}\n\n\t\tforeach ($csvData as $data) {\n\t\t\t$dbData = array();\n\n\t\t\tfor ($i = 0; $i < count($newArray); $i++) {\n\t\t\t\t$db_field = $newArray[$i];\n\t\t\t\t$dbData[] = $data[$db_field];\n\t\t\t}\n\n\t\t\tif ($dbData[2] != null) {\n\t\t\t\t$dbData[2] = $dbData[2] . ' ' . $dbData[3];\n\t\t\t} else {\n\t\t\t\t$dbData[2] = $dbData[3];\n\t\t\t}\n\n\t\t\t$dbData[3] = $dbData[0] . '@mydavinci.nl';\n\n\t\t\t$errors = $this->validateRowData($dbData);\n\t\t\tif (empty($errors)) {\n\t\t\t\t$importCsv->saveCsv($dbData);\n\t\t\t}\n\t\t}\n\n\t\treturn redirect('importcsv')->with('status', 'success');\n\t}", "function import($onDuplicate, &$values) {\n $response = $this->summary($values);\n $this->_params = $this->getActiveFieldParams(true);\n $this->formatDateParams();\n $this->_params['skipRecentView'] = TRUE;\n $this->_params['check_permissions'] = TRUE;\n\n if(count($this->_importQueueBatch) >= $this->getImportQueueBatchSize()) {\n $this->addBatchToQueue();\n }\n $this->addToBatch($this->_params, $values);\n\n }", "public function processImport()\n {\n $file = $this->_createFile();\n if ($file) {\n $this->_deleteFtpFiles();\n $this->_sendFile($file);\n if (!$this->_deleteFile($file)) {\n Mage::throwException(Mage::helper('find_feed')->__(\"FTP: Can't delete files\"));\n }\n }\n }", "function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function parseImport(Request $request)\n\t{\n\t\t$db_fields = array(self::COL_STUDENT_NR, self::COL_FIRSTNAME, self::COL_PREFIX, self::COL_LASTNAME);\n\t\t$importCsv = new ImportCsv;\n\t\t$file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\n\t\tif (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) {\n\t\t\t$arr_file = explode('.', $_FILES['file']['name']);\n\t\t\t$extension = end($arr_file);\n\n\t\t\tif ($extension == 'csv') {\n\t\t\t\t$reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();\n\t\t\t} else {\n\t\t\t\treturn redirect('importcsv')->with('status', 'Not a CSV file!');\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\treturn redirect('importcsv')->with('status', 'Invalid CSV file!');\n\t\t\t}\n\n\t\t\t$sheetData = $spreadsheet->getActiveSheet()->toArray();\n\n\t\t\t$importCsv->tmpSaveCsv($request, $sheetData);\n\t\t\treturn view('import_fields', ['csv_data' => $sheetData, 'db_fields' => $db_fields]);\n\t\t} else {\n\t\t\treturn back()->with('status', 'This is not a CSV file!');\n\t\t}\n\t}", "public function builder_import() {\n\n\t\t// function verifies the AJAX request, to prevent any processing of requests which are passed in by third-party sites or systems\n\n\t\tcheck_ajax_referer( 'mfn-builder-nonce', 'mfn-builder-nonce' );\n\n\t\t$import = htmlspecialchars(stripslashes($_POST['mfn-items-import']));\n\n\t\tif (! $import) {\n\t\t\texit;\n\t\t}\n\n\t\t// unserialize received items data\n\n\t\t$mfn_items = unserialize(call_user_func('base'.'64_decode', $import));\n\n\t\t// get current builder uniqueIDs\n\n\t\t$uids_row = isset($_POST['mfn-row-id']) ? $_POST['mfn-row-id'] : array();\n\t\t$uids_wrap = isset($_POST['mfn-wrap-id']) ? $_POST['mfn-wrap-id'] : array();\n\t\t$uids_item = isset($_POST['mfn-item-id']) ? $_POST['mfn-item-id'] : array();\n\n\t\t$uids = array_merge($uids_row, $uids_wrap, $uids_item);\n\n\t\t// reset uniqueID\n\n\t\t$mfn_items = Mfn_Builder_Helper::unique_ID_reset($mfn_items, $uids);\n\n\t\tif (is_array($mfn_items)) {\n\n\t\t\t$builder = new Mfn_Builder_Admin();\n\t\t\t$builder->set_fields();\n\n\t\t\tforeach ($mfn_items as $section) {\n\t\t\t\t$uids = $builder->section($section, $uids);\n\t\t\t}\n\n\t\t}\n\n\t\texit;\n\n\t}", "protected function _prepareRecords()\n {\n // Remove default records.\n $this->_deleteAllRecords();\n\n $metadata = array('public' => true);\n $isHtml = false;\n\n $collections = array();\n $items = array();\n $files = array();\n foreach ($this->_recordsByType as $type => $recordsMetadata) {\n foreach ($recordsMetadata as $recordMetadata) {\n $identifiers = array();\n foreach ($recordMetadata['Identifier'] as $identifier) {\n $identifiers[] = array('text' => $identifier, 'html' => $isHtml);\n }\n $elementTexts = array('Dublin Core' => array(\n 'Title' => array(array('text' => $recordMetadata['Title'], 'html' => $isHtml)),\n 'Identifier' => $identifiers,\n ));\n switch ($type) {\n case 'Collection':\n $collections[$recordMetadata['collection_id']] = insert_collection($metadata, $elementTexts);\n break;\n case 'Item':\n $metadataItem = $metadata;\n if (!empty($recordMetadata['collection_id'])) {\n $metadataItem['collection_id'] = $collections[$recordMetadata['collection_id']]->id;\n }\n $record = insert_item($metadataItem, $elementTexts);\n if (!empty($recordMetadata['files'])) {\n $fileUrl = TEST_DIR . '/_files/test.txt';\n $files[$recordMetadata['item_id']] = insert_files_for_item($record, 'Filesystem', array_fill(0, $recordMetadata['files'], $fileUrl));\n }\n break;\n case 'File':\n $record = $files[$recordMetadata['item_id']][$recordMetadata['file_key']];\n $record->addElementTextsByArray($elementTexts);\n $record->save();\n break;\n }\n }\n }\n }", "public function import()\n {\n $itemTypeId = $this->_insertItemType();\n \n // Insert the Omeka collection.\n $collectionOmekaId = $this->_insertCollection();\n \n // Insert an Omeka item for every Sept11 object.\n foreach ($this->_fetchCollectionObjectsSept11() as $object) {\n \n $metadata = array('item_type_id' => $itemTypeId);\n \n // Set the story.\n $xml = new SimpleXMLElement($object['OBJECT_ABSOLUTE_PATH'], null, true);\n $elementTexts = array(\n ElementSet::ITEM_TYPE_NAME => array(\n 'SEIU Story: Story' => array(array('text' => $xml->STORY, 'html' => false)), \n 'SEIU Story: Local Union' => array(array('text' => $xml->LOCAL_UNION, 'html' => false)), \n )\n );\n \n $itemId = $this->_insertItem($collectionOmekaId, $object, $metadata, $elementTexts);\n }\n }", "public function importTablesFromTemplate()\n {\n //Get a list of all the tables that need to be cloned\n $tables = $this->getTablesFromTemplate(self::TEMPLATE_PREFIX);\n\n //Clone the tables from the template into the demo instance\n $instancePrefix = $this->getTablePrefix();\n $defaultPrefix = self::TEMPLATE_PREFIX;\n $this->cloneTables($tables, $defaultPrefix, $instancePrefix);\n $this->convertPrefixes($defaultPrefix, $instancePrefix);\n }", "protected function import(): void {\n\t\t\t$sections = $this->load_and_decode_file();\n\n\t\t\tif ( empty( $sections ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $sections as $section ) {\n\t\t\t\tLearnDash_Settings_Section::set_section_settings_all(\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$section['fields']\n\t\t\t\t);\n\n\t\t\t\t$this->processed_items_count++;\n\t\t\t\t$this->imported_items_count++;\n\t\t\t}\n\t\t}", "public static function ProcessAll()\n {\n $aImportErrors = array();\n $aAllErr = array();\n\n $aData = array();\n $aData['oImportName'] = 'CSV-2-SQL Datenimport:';\n $aData['successMessage'] = '';\n\n $logger = self::getLogger();\n\n $logger->info('TPkgCsv2SqlManager: ProcessAll Start');\n $aValidationErrors = self::ValidateAll();\n $logger->info('TPkgCsv2SqlManager: ValidateAll end');\n if (0 == count($aValidationErrors)) {\n // all good, import\n $aImportErrors = self::ImportAll();\n $aData['successMessage'] = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_csv2sql.msg.import_completed'));\n }\n $logger->info('TPkgCsv2SqlManager: ImportAll end');\n\n $aAllErr = TPkgCsv2Sql::ArrayConcat($aAllErr, $aValidationErrors);\n $aAllErr = TPkgCsv2Sql::ArrayConcat($aAllErr, $aImportErrors);\n if (count($aAllErr) > 0) {\n //send all errors by email\n self::SendErrorNotification($aAllErr);\n }\n $logger->info('TPkgCsv2SqlManager: SendErrorNotification end');\n\n //View vars\n $aData['aValidationErrors'] = (array) $aValidationErrors;\n $aData['aImportErrors'] = (array) $aImportErrors;\n\n return $aData;\n }", "public function getMainFields_preProcess($table, &$row, t3lib_tceforms $that) {\n\n if (method_exists($this, $table)) {\n $this->$table($table, $row, $that);\n }\n }", "protected function execute()\n {\n parent::execute();\n\n $data = file_get_contents( 'php://input' );\n $md5 = md5( utf8_encode( $data ) ); \n\n $dictionary_import_class_name = lib::get_class_name( 'database\\dictionary_import' );\n $db_dictionary_import = $dictionary_import_class_name::get_unique_record( 'md5', $md5 );\n if( !is_null( $db_dictionary_import ) )\n {\n if( $db_dictionary_import->processed )\n throw lib::create( 'exception\\notice',\n 'This file has already been imported.', __METHOD__ );\n }\n else\n {\n $db_dictionary_import = lib::create( 'database\\dictionary_import' );\n }\n\n $db_dictionary_import->processed = false;\n $db_dictionary_import->data = $data;\n $db_dictionary_import->md5 = $md5;\n $db_dictionary_import->save();\n }", "function import( $file ) {\n\t\tadd_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );\n\t\tadd_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );\n\n\t\t$this->import_start( $file );\n\n\t\twp_suspend_cache_invalidation( true );\n\t\t$this->process_categories();\n\t\t$this->process_tags();\n\t\t$this->process_terms();\n\t\t$this->process_posts();\n\t\twp_suspend_cache_invalidation( false );\n\n\t\t$this->import_end();\n\t}", "public function run()\n {\n try {\n $this->log('REDCap-ETL version '.Version::RELEASE_NUMBER);\n $this->log(\"Starting processing.\");\n\n //-------------------------------------------------------------------------\n // Parse Transformation Rules\n //-------------------------------------------------------------------------\n // NOTE: The $result is not used in batch mode. It is used\n // by the DET handler to give feedback within REDCap.\n\n\n list($parseStatus, $result) = $this->processTransformationRules();\n\n if ($parseStatus === SchemaGenerator::PARSE_ERROR) {\n $message = \"Transformation rules not parsed. Processing stopped.\";\n throw new EtlException($message, EtlException::INPUT_ERROR);\n } else {\n $this->createLoadTables();\n $numberOfRecordIds = $this->extractTransformLoad();\n \n $sqlFile = $this->configuration->getPostProcessingSqlFile();\n if (!empty($sqlFile)) {\n $this->dbcon->processQueryFile($sqlFile);\n }\n\n $this->log(\"Processing complete.\");\n }\n } catch (EtlException $exception) {\n $this->log('Processing failed.');\n throw $exception; // re-throw the exception\n }\n\n return $numberOfRecordIds;\n }", "public function process(\\isys_module $p_module, \\isys_component_template $p_template, DaoBase $p_model);", "function Parse() {\n\t\t\t$this->Rows = CDataParser::Parse($this->Rows); //Note, becomes CDataParserIterator, not CTableIterator\n\t\t}", "function import($type, $ignore_errors = false) {\n\t\t$factory = ModelFactory::get_instance();\n\n\t\treturn $factory->import($type, $ignore_errors);\n\n\t}", "public function sampleTask()\n\t{\n\t\t$skip = array('params', 'type', 'logo');\n\n\t\t$fields = array();\n\t\t$row = array();\n\n\t\t$model = Group::blank();\n\t\t$attribs = $model->getStructure()->getTableColumns($model->getTableName());\n\n\t\tforeach ($attribs as $key => $desc)\n\t\t{\n\t\t\tif (in_array(strtolower($key), $skip))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$example = 'Example';\n\t\t\t$desc = preg_replace('/\\(.*\\)/', '', $desc);\n\n\t\t\tif (in_array($desc, array('int', 'tinyint', 'float')))\n\t\t\t{\n\t\t\t\t$example = '1';\n\t\t\t}\n\n\t\t\tarray_push($row, $example);\n\t\t\tarray_push($fields, $key);\n\t\t}\n\n\t\tinclude_once dirname(dirname(__DIR__)) . '/models/orm/field.php';\n\n\t\t$attribs = \\Components\\Groups\\Models\\Orm\\Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*');\n\t\t\t}])\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\tforeach ($attribs as $field)\n\t\t{\n\t\t\t$key = $field->get('name');\n\n\t\t\tif (in_array(strtolower($key), $skip))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$example = 'Example';\n\t\t\tif ($field->options->count() || in_array($field->get('type'), array('tags', 'select', 'dropdown', 'list', 'radio', 'radios', 'checkbox', 'checkboxes')))\n\t\t\t{\n\t\t\t\t$example = 'example;example;example';\n\t\t\t}\n\n\t\t\tarray_push($row, $example);\n\t\t\tarray_push($fields, $key);\n\t\t}\n\n\t\t$record = new \\Components\\Groups\\Models\\Import\\Record(new \\stdClass);\n\t\tforeach ($record->handlers() as $handler)\n\t\t{\n\t\t\t$sample = $handler->sample();\n\n\t\t\tif (is_array($sample) && !empty($sample))\n\t\t\t{\n\t\t\t\tarray_push($row, $sample['content']);\n\t\t\t\tarray_push($fields, $sample['header']);\n\t\t\t}\n\t\t}\n\n\t\t// Output header\n\t\t@ob_end_clean();\n\n\t\theader(\"Pragma: public\");\n\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\theader(\"Expires: 0\");\n\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\theader('Content-type: text/comma-separated-values');\n\t\theader('Content-disposition: attachment; filename=\"groups.csv\"');\n\n\t\techo $this->quoteCsvRow($fields);\n\t\techo $this->quoteCsvRow($row);\n\t\texit;\n\t}", "function ctools_export_crud_import($table, $code) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!empty($export['import callback']) && function_exists($export['import callback'])) {\r\n return $export['import callback']($code);\r\n }\r\n else {\r\n ob_start();\r\n eval($code);\r\n ob_end_clean();\r\n\r\n if (empty(${$export['identifier']})) {\r\n $errors = ob_get_contents();\r\n if (empty($errors)) {\r\n $errors = t('No item found.');\r\n }\r\n return $errors;\r\n }\r\n\r\n $item = ${$export['identifier']};\r\n\r\n // Set these defaults just the same way that ctools_export_new_object sets\r\n // them.\r\n $item->export_type = NULL;\r\n $item->{$export['export type string']} = t('Local');\r\n\r\n return $item;\r\n }\r\n}", "function acf_prepare_fields_for_import($fields = array())\n{\n}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function prepare_data_to_import($import_data, $form_data, $batch_offset, $is_last_batch) {\n \n $this->found_action = !empty($form_data['advanced_form_data']['wt_iew_found_action']) ? $form_data['advanced_form_data']['wt_iew_found_action'] : 'skip'; \n $this->id_conflict = !empty($form_data['advanced_form_data']['wt_iew_id_conflict']) ? $form_data['advanced_form_data']['wt_iew_id_conflict'] : 'skip'; \n $this->merge_empty_cells = !empty($form_data['advanced_form_data']['wt_iew_merge_empty_cells']) ? 1 : 0; \n $this->skip_new = !empty($form_data['advanced_form_data']['wt_iew_skip_new']) ? 1 : 0; \n\n \n// $this->merge = !empty($form_data['advanced_form_data']['wt_iew_merge']) ? 1 : 0; \n// $this->use_same_id = !empty($form_data['advanced_form_data']['wt_iew_use_same_id']) ? 1 : 0;\n\n \n $this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_existing']) ? 1 : 0;\n\n $this->ord_link_using_sku = !empty($form_data['advanced_form_data']['wt_iew_ord_link_using_sku']) ? 1 : 0;\n $this->create_user = !empty($form_data['advanced_form_data']['wt_iew_create_user']) ? 1 : 0;\n $this->notify_customer = !empty($form_data['advanced_form_data']['wt_iew_notify_customer']) ? 1 : 0; \n $this->status_mail = !empty($form_data['advanced_form_data']['wt_iew_status_mail']) ? 1 : 0;\n \n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Preparing for import.\");\n\n $success = 0;\n $failed = 0;\n $msg = 'Order imported successfully.';\n \n foreach ($import_data as $key => $data) { \n $row = $batch_offset+$key+1;\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Parsing item.\");\n $parsed_data = $this->parse_data($data); \n if (!is_wp_error($parsed_data)){\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Processing item.\");\n $result = $this->process_item($parsed_data);\n if(!is_wp_error($result)){\n if($this->is_order_exist){\n $msg = 'Order updated successfully.';\n }\n $this->import_results[$row] = array('row'=>$row, 'message'=>$msg, 'status'=>true, 'post_id'=>$result['id']); \n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - \".$msg); \n $success++; \n }else{\n $this->import_results[$row] = array('row'=>$row, 'message'=>$result->get_error_message(), 'status'=>false, 'post_id'=>'');\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Processing failed. Reason: \".$result->get_error_message()); \n $failed++;\n } \n }else{\n $this->import_results[$row] = array('row'=>$row, 'message'=>$parsed_data->get_error_message(), 'status'=>false, 'post_id'=>'');\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Parsing failed. Reason: \".$parsed_data->get_error_message()); \n $failed++; \n } \n }\n \n if($is_last_batch && $this->delete_existing){\n $this->delete_existing(); \n } \n \n $this->clean_after_import();\n \n $import_response=array(\n 'total_success'=>$success,\n 'total_failed'=>$failed,\n 'log_data'=>$this->import_results,\n );\n\n return $import_response;\n }", "public function importAll($listID, $importStep, $importID, $importType, $importData, $importFileName, $fieldTerminator, $fieldEncloser, $importMySQLHost, $importMySQLPort, $importMySQLUsername, $importMySQLPassword, $importMySQLDatabase, $importMySQLQuery, $addToGlobalSuppressionList, $addToSuppressionList, $mappedFields)\n\t{\n\n\t\t$command = \"Command=Subscribers.Import\";\n\t\t$listID = \"ListID=\".$listID;\n\t\t$importStep = \"ImportStep=\".$importStep;\n\t\t$importID = \"ImportID=\".$importID;\n\t\t$importType = \"ImportType=\".$importType;\n\t\t$importData = \"ImportData=\".$importData;\n\t\t$importFileName = \"ImportFileName=\".$importFileName;\n\t\t$fieldTerminator = \"FieldTerminator=\".$fieldTerminator;\n\t\t$fieldEncloser = \"FieldEncloser=\".$fieldEncloser;\n\t\t$importMySQLHost = \"ImportMySQLHost=\".$importMySQLHost;\n\t\t$importMySQLPort = \"ImportMySQLPort=\".$importMySQLPort;\n\t\t$importMySQLUsername = \"ImportMySQLUsername=\".$importMySQLUsername;\n\t\t$importMySQLPassword = \"ImportMySQLPassword=\".$importMySQLPassword;\n\t\t$importMySQLDatabase = \"ImportMySQLDatabase=\".$importMySQLDatabase;\n\t\t$importMySQLQuery = \"ImportMySQLQuery=\".$importMySQLQuery;\n\t\t$addToGlobalSuppressionList = \"AddToGlobalSuppressionList=\".$addToGlobalSuppressionList;\n\t\t$addToSuppressionList = \"AddToSuppressionList=\".$addToSuppressionList;\n\t\t$mappedFields = \"MappedFields=\".$mappedFields;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$listID\n\t\t\t\t\t\t.'&'.$importStep\n\t\t\t\t\t\t.'&'.$importID\n\t\t\t\t\t\t.'&'.$importType\n\t\t\t\t\t\t.'&'.$importData\n\t\t\t\t\t\t.'&'.$importFileName\n\t\t\t\t\t\t.'&'.$fieldTerminator\n\t\t\t\t\t\t.'&'.$fieldEncloser\n\t\t\t\t\t\t.'&'.$importMySQLHost\n\t\t\t\t\t\t.'&'.$importMySQLPort\n\t\t\t\t\t\t.'&'.$importMySQLUsername\n\t\t\t\t\t\t.'&'.$importMySQLPassword\n\t\t\t\t\t\t.'&'.$importMySQLDatabase\n\t\t\t\t\t\t.'&'.$importMySQLQuery\n\t\t\t\t\t\t.'&'.$addToGlobalSuppressionList\n\t\t\t\t\t\t.'&'.$addToSuppressionList\n\t\t\t\t\t\t.'&'.$mappedFields\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "function processData() \n {\n \n // store values in table manager object.\n $moduleID = $this->dataManager->getModuleID();\n $moduleCreator = new ModuleCreator( $moduleID, $this->pathModuleRoot);\n $moduleCreator->createModule();\n \n }", "private function import_flagship_content() {\n\t\tif ( class_exists( 'Hestia_Content_Import', false ) ) {\n\t\t\t$importer = new Hestia_Content_Import();\n\t\t\t$importer->import();\n\t\t}\n\n\t\tif ( class_exists( 'Hestia_Import_Zerif', false ) ) {\n\t\t\t$zerif_importer = new Hestia_Import_Zerif();\n\t\t\t$zerif_importer->import();\n\t\t}\n\t}", "public function import(\\RealtimeDespatch\\OrderFlow\\Model\\Request $request);", "function doImport() {\n if(!$this->setDatabase($this->database))\n return false;\n\n if($this->utf8) {\n $encoding = @mysql_query(\"SET NAMES 'utf8'\", $this->connection);\n }\n\n if($this->importFilename) {\n $import = $this->importSql($this->importFilename);\n if(!$import)\n echo \"\\n\" . mysql_error($this->connection) . \"\\n\";\n else\n echo \" DONE!\\n\";\n return true;\n }\n else {\n return false;\n }\n }", "protected function processUpdates()\n {\n $this->importStaticData();\n }", "private function analyse()\n\t{\n\t\tpreg_match('/\\s*([a-zA-Z]*)/',$this->sql,$match);\n\t\tif (isset($match[1]))\n\t\t{\n\t\t\t$this->type = strtolower($match[1]);\n\t\t\tif ($this->type == 'select') \n\t\t\t{\n\t\t\t\tpreg_match_all('/from(.*)(where|groupe\\sby|limit|order\\sby|$)/isU',$this->sql,$match);\n\t\t\t\t$tables = array();\n\t\t\t\tforeach ($match[1] as $m)\n\t\t\t\t{\n\t\t\t\t\t$m = preg_replace('/select(.*)from/isU','',$m);\n\t\t\t\t\t$tables = array_merge($tables,explode(',',$m));\n\t\t\t\t}\n\t\t\t\t$this->tables = $tables;\n\t\t\t}\n\t\t\telseif ($this->type == 'insert')\n\t\t\t{\n\t\t\t\t$pos = stripos($this->sql,'into');\n\t\t\t\t$tables = substr($this->sql,$pos+4);\n\t\t\t\t$pos = strpos($tables,'(');\n\t\t\t\t$tables = array(substr($tables,0,$pos));\n\t\t\t\tpreg_match_all('/from(.*)(where|groupe\\sby|limit|order\\sby|$)/isU',$this->sql,$match);\n\t\t\t\tif (isset($match[1]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($match[1] as $m)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tables = array_merge($tables,explode(',',$m));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->tables = $tables;\n\t\t\t}\n\t\t\telseif ($this->type == 'update')\n\t\t\t{\n\t\t\t\tpreg_match('/update(.*)set/is',$this->sql,$match);\n\t\t\t\t$tables = str_ireplace(array('ignore','low_priority'),'',$match[1]);\n\t\t\t\t$this->tables = array($tables);\n\t\t\t}\n\t\t\telseif ($this->type == 'delete')\n\t\t\t{\n\t\t\t\tpreg_match('/from(.*)(where|$)/isU',$this->sql,$match);\n\t\t\t\t$this->tables = array($match[1]);\n\t\t\t}\n\t\t\telseif ($this->type = 'truncate')\n\t\t\t{\n\t\t\t\t$tables = preg_replace('/truncate\\s+table/is','',$this->sql);\n\t\t\t\t$this->tables = array($tables);\n\t\t\t}\n\t\t\t$this->parse_table();\n\t\t}\n\t}", "abstract protected function doImport(Finder $finder, InputInterface $input, OutputInterface $output);", "public function import() {\n\t\t$this->status = new WPSEO_Import_Status( 'import', false );\n\n\t\tif ( ! $this->detect_helper() ) {\n\t\t\treturn $this->status;\n\t\t}\n\n\t\t$this->import_metas();\n\n\t\treturn $this->status->set_status( true );\n\t}", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function _importData()\n {\n Mage::dispatchEvent($this->_eventPrefix . '_before_import', array(\n 'data_source_model' => $this->_dataSourceModel,\n 'entity_model' => $this\n ));\n $result = parent::_importData();\n Mage::dispatchEvent($this->_eventPrefix . '_after_import', array(\n 'entities' => $this->_newCustomers,\n 'entity_model' => $this\n ));\n return $result;\n }", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "public function importTable(\\DataContainer $dc)\n {\n if (\\Input::get('key') != 'table')\n {\n return '';\n }\n\n $this->import('BackendUser', 'User');\n $class = $this->User->uploader;\n\n // See #4086 and #7046\n if (!class_exists($class) || $class == 'DropZone')\n {\n $class = 'FileUpload';\n }\n\n /** @var \\FileUpload $objUploader */\n $objUploader = new $class();\n\n // Import CSS\n if (\\Input::post('FORM_SUBMIT') == 'tl_table_import')\n {\n $arrUploaded = $objUploader->uploadTo('system/tmp');\n\n if (empty($arrUploaded))\n {\n \\Message::addError($GLOBALS['TL_LANG']['ERR']['all_fields']);\n $this->reload();\n }\n\n $this->import('Database');\n $arrTable = array();\n\n foreach ($arrUploaded as $strCsvFile)\n {\n $objFile = new \\File($strCsvFile, true);\n\n if ($objFile->extension != 'csv')\n {\n \\Message::addError(sprintf($GLOBALS['TL_LANG']['ERR']['filetype'], $objFile->extension));\n continue;\n }\n\n // Get separator\n switch (\\Input::post('separator'))\n {\n case 'semicolon':\n $strSeparator = ';';\n break;\n\n case 'tabulator':\n $strSeparator = \"\\t\";\n break;\n\n default:\n $strSeparator = ',';\n break;\n }\n\n $resFile = $objFile->handle;\n\n while(($arrRow = @fgetcsv($resFile, null, $strSeparator)) !== false)\n {\n $arrTable[] = $arrRow;\n }\n }\n\n $objVersions = new \\Versions($dc->table, \\Input::get('id'));\n $objVersions->create();\n\n $this->Database->prepare(\"UPDATE \" . $dc->table . \" SET tableitems=? WHERE id=?\")\n ->execute(serialize($arrTable), \\Input::get('id'));\n\n \\System::setCookie('BE_PAGE_OFFSET', 0, 0);\n $this->redirect(str_replace('&key=table', '', \\Environment::get('request')));\n }\n\n // Return form\n return '\n <div id=\"tl_buttons\" class=\"card-action\">\n <a href=\"'.ampersand(str_replace('&key=table', '', \\Environment::get('request'))).'\" class=\"header-back btn-flat btn-icon waves-effect waves-circle waves-orange tooltipped grey lighten-5\" data-position=\"right\" data-delay=\"50\" data-tooltip=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['backBTTitle']).'\" accesskey=\"b\"><i class=\"material-icons black-text\">keyboard_backspace</i></a>\n </div>\n '.\\Message::generate().'\n <form action=\"'.ampersand(\\Environment::get('request'), true).'\" id=\"tl_table_import\" class=\"tl_form\" method=\"post\" enctype=\"multipart/form-data\">\n <div class=\"tl_formbody_edit card-content\" style=\"padding-top:0\">\n <input type=\"hidden\" name=\"FORM_SUBMIT\" value=\"tl_table_import\">\n <input type=\"hidden\" name=\"REQUEST_TOKEN\" value=\"'.REQUEST_TOKEN.'\">\n\n <div class=\"tl_tbox\">\n <h3><label for=\"separator\">'.$GLOBALS['TL_LANG']['MSC']['separator'][0].'</label></h3>\n <select name=\"separator\" id=\"separator\" class=\"tl_select\" onfocus=\"Backend.getScrollOffset()\">\n <option value=\"comma\">'.$GLOBALS['TL_LANG']['MSC']['comma'].'</option>\n <option value=\"semicolon\">'.$GLOBALS['TL_LANG']['MSC']['semicolon'].'</option>\n <option value=\"tabulator\">'.$GLOBALS['TL_LANG']['MSC']['tabulator'].'</option>\n </select>'.(($GLOBALS['TL_LANG']['MSC']['separator'][1] != '') ? '\n <p class=\"tl_help tl_tip\"><i class=\"tiny material-icons help-icon\">info_outline</i>'.$GLOBALS['TL_LANG']['MSC']['separator'][1].'</p>' : '').'\n <h3>'.$GLOBALS['TL_LANG']['MSC']['source'][0].'</h3>'.$objUploader->generateMarkup().(isset($GLOBALS['TL_LANG']['MSC']['source'][1]) ? '\n <p class=\"tl_help tl_tip\"><i class=\"tiny material-icons help-icon\">info_outline</i>'.$GLOBALS['TL_LANG']['MSC']['source'][1].'</p>' : '').'\n </div>\n\n </div>\n\n <div class=\"card-action\">\n\n <div class=\"submit-container\">\n <input type=\"submit\" name=\"save\" id=\"save\" class=\"btn orange lighten-2\" accesskey=\"s\" value=\"'.specialchars($GLOBALS['TL_LANG']['MSC']['tw_import'][0]).'\">\n </div>\n\n </div>\n </form>';\n }", "public function run()\n {\n $this->config = Config::get('nla');\n $this->detectDataSource();\n $this->collectNLAIdentifiers();\n\n $count = count($this->nlaIdentifiers);\n $this->info(\"Processing {$count} nla identifiers\");\n\n $payload = \"\";\n $this->progressStart(count($this->nlaIdentifiers));\n foreach ($this->nlaIdentifiers as $identifier) {\n $this->progressAdvance(1);\n try {\n $rifcs = $this->getRIFCSFromNLAIdentifier($identifier);\n $rifcs = XMLUtil::unwrapRegistryObject($rifcs);\n $this->debug(\"Found rifcs for $identifier\");\n $payload .= $rifcs;\n } catch (Exception $e) {\n $this->error(\"Failed processing $identifier. {$e->getMessage()}\");\n }\n }\n $payload = XMLUtil::wrapRegistryObject($payload);\n $this->progressFinish();\n\n $this->log(\"Starting importing process...\");\n $this->import($payload);\n $this->log(\"Finished...\");\n }", "function acf_prepare_field_group_for_import($field_group)\n{\n}", "protected function migrateLegacyImportRecords() {}", "public function import() {\n\n\t\t$output = array();\n\n\t\tif ($importUrl = Request::post('importUrl')) {\n\n\t\t\t// Resolve local URLs.\n\t\t\tif (strpos($importUrl, '/') === 0) {\n\n\t\t\t\tif (getenv('HTTPS') && getenv('HTTPS') !== 'off' && getenv('HTTP_HOST')) {\n\t\t\t\t\t$protocol = 'https://';\n\t\t\t\t} else {\n\t\t\t\t\t$protocol = 'http://';\n\t\t\t\t}\n\n\t\t\t\t$importUrl = $protocol . getenv('HTTP_HOST') . AM_BASE_URL . $importUrl;\n\t\t\t\tCore\\Debug::log($importUrl, 'Local URL');\n\n\t\t\t}\n\n\t\t\t$curl = curl_init(); \n \n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0); \n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t\tcurl_setopt($curl, CURLOPT_URL, $importUrl); \n\n\t\t\t$data = curl_exec($curl); \n\t\t\t\n\t\t\tif (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200 || curl_errno($curl)) {\n\t\t\t\n\t\t\t\t$output['error'] = Text::get('error_import');\n\t\t\t\n\t\t\t} else {\n\n\t\t\t\t$fileName = Core\\Str::sanitize(preg_replace('/\\?.*/', '', basename($importUrl)));\n\n\t\t\t\tif ($url = Request::post('url')) {\n\t\t\t\t\t$Page = $this->Automad->getPage($url);\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_PAGES . $Page->path . $fileName;\n\t\t\t\t} else {\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_SHARED . '/' . $fileName;\n\t\t\t\t}\n\n\t\t\t\tFileSystem::write($path, $data);\n\t\t\t\t$this->clearCache();\n\n\t\t\t} \n\n\t\t\tcurl_close($curl);\n\n\t\t\tif (!FileSystem::isAllowedFileType($path)) {\n\n\t\t\t\t$newPath = $path . FileSystem::getImageExtensionFromMimeType($path);\n\n\t\t\t\tif (FileSystem::isAllowedFileType($newPath)) {\n\t\t\t\t\tFileSystem::renameMedia($path, $newPath);\n\t\t\t\t} else {\n\t\t\t\t\tunlink($path);\n\t\t\t\t\t$output['error'] = Text::get('error_file_format');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$output['error'] = Text::get('error_no_url'); \n\n\t\t}\n\n\t\treturn $output;\n\n\t}", "public function load() {\n $importItemsTempManager = ImportItemsTempManager::getInstance();\n $categoryHierarchyManager = CategoryHierarchyManager::getInstance();\n $categoryManager = CategoryManager::getInstance();\n $companyManager = CompanyManager::getInstance();\n $company_id = $_REQUEST['company_id'];\n $companyDto = $companyManager->selectByPK($company_id);\n $this->addParam('companyDto', $companyDto);\n $used_columns_indexes_array = array(2/* name */, 1/* model */, 9/* brand */, 3/* dealer price $ */, 4/* $dealer price amd */, 5/* vat $ */, 6/* vat amd */, 7/* warranty */); //explode(',', $_REQUEST['used_columns_indexes']);\n\n $customerLogin = $this->getCustomerLogin();\n $priceRowsDtos = $importItemsTempManager->getUserCurrentPriceNewRows($customerLogin);\n foreach ($priceRowsDtos as $dto) {\n $itemModel = $dto->getModel();\n if (empty($itemModel)) {\n $model = $importItemsTempManager->findModelFromItemTitle($dto->getDisplayName());\n if (!empty($model)) {\n $dto->setSupposedModel($model);\n }\n } else {\n $dto->setSupposedModel($itemModel);\n }\n }\n\n\n $columnNames = ImportPriceManager::getColumnNamesMap($used_columns_indexes_array);\n\n $rootDto = $categoryManager->getRoot();\n $firstLevelCategoriesHierarchyDtos = $categoryHierarchyManager->getCategoryChildren($rootDto->getId());\n $firstLevelCategoriesNamesDtos = $categoryHierarchyManager->getCategoriesNamesByParentCategoryId($rootDto->getId());\n\n\n $firstLevelCategoriesIds = array();\n foreach ($firstLevelCategoriesHierarchyDtos as $key => $category) {\n $firstLevelCategoriesIds[] = $category->getChildId();\n }\n $firstLevelCategoriesNames = array();\n foreach ($firstLevelCategoriesNamesDtos as $key => $category) {\n $firstLevelCategoriesNames[] = $category->getDisplayName();\n }\n\n $this->addParam('columnNames', $columnNames);\n $this->addParam('priceRowsDtos', $priceRowsDtos);\n $this->addParam('firstLevelCategoriesNames', $firstLevelCategoriesNames);\n $this->addParam('firstLevelCategoriesIds', $firstLevelCategoriesIds);\n\n if (isset($_REQUEST['new_items_row_ids'])) {\n $this->addParam('new_items_row_ids', explode(',', $_REQUEST['new_items_row_ids']));\n }\n }", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function processData() {\n\t\t$GLOBALS['TCA'] = \\BusyNoggin\\BnBackend\\BackendLibrary::removeExcludeFields($GLOBALS['TCA']);\n\t}", "public function import(FieldInstance $instance, array $values = NULL);", "public function importEntities() {\n\t\t$option = $this->option;\n\t\t// Access check\n\t\tif(!$this->allowEdit($option)) {\n\t\t\t$this->setRedirect('index.php?option=com_jmap&task=metainfo.display', JText::_('COM_JMAP_ERROR_ALERT_NOACCESS'), 'notice');\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Get the file manager instance with db connector dependency injection\n\t\t$filesManager = new JMapFileMetainfo(JFactory::getDbo(), $this->app);\n\t\n\t\tif(!$filesManager->import()) {\n\t\t\t// Model set exceptions for something gone wrong, so enqueue exceptions and levels on application object then set redirect and exit\n\t\t\t$filesManagerException = $filesManager->getError(null, false);\n\t\t\t$this->app->enqueueMessage($filesManagerException->getMessage(), $filesManagerException->getErrorLevel());\n\t\t\t$this->setRedirect ( \"index.php?option=$option&task=metainfo.display\", JText::_('COM_JMAP_METAINFO_ERROR_IMPORT'));\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$this->setRedirect ( \"index.php?option=$option&task=metainfo.display\", JText::_('COM_JMAP_METAINFO_SUCCESS_IMPORT'));\n\t}", "private function _loadDataToTemporaryTable(){\n\n }", "function foreign_form($table=\"\"){\n //all field\n $allField = AllField($table);\n\n //primary field\n $primaryField = PrimaryField($table);\n var_dump($primaryField);\n \n $column_query = \"\";\n $type_data = \"\";\n $data_push = \"\";\n $i = 1;\n foreach($allField as $fieldName){\n // print($fieldName['column_name'].' : '.$fieldName['data_type']);\n if($primaryField['column_name'] != $fieldName['column_name']){\n $type_data .= $fieldName['data_type'] == 'integer' ? 'i32, ' : 'String, ';\n $data_push .= 'row.'. $fieldName['column_name'].', ';\n }\n $column_query .= $fieldName['column_name'].\", \";\n $i++;\n }\n $data_src = \"\npub async fn $table(pool: &Pool<PgConnection>) -> tide::Result<Vec<(serde_json::Value, String)>> {\n let mut data = Vec::new();\n let list = sqlx::query!(\n \\\"SELECT \".substr($column_query, 0, -2).\" FROM $table\\\" )\n .fetch_all(pool) .await?;\n for row in list {\n data.push( (serde_json::json!(row.\".$primaryField['column_name'].\"), \".substr($data_push,0,-2).\") )\n }\n Ok(data)\n}\n\";\n $path_src_data = BASE_PATH.\"/src/data.rs\";\n if(!write_file($path_src_data, $data_src, 'a')){\n echo 'Unable to write SRC Data the file'.\"\\r\\n\";\n }else{\n echo 'SRC Data written!'.\"\\r\\n\";\n }\n}", "function processTable () {\n\t\t$this->srcBase->createAndExecuteQuery ($this->selectQuery);\n\t\t\n\t\twhile (($result = $this->srcBase->getQueryResult ($this->selectQuery))) {\n\t\t\t\t$utvMedl= new UtvMedl();\n\t\t\t\t$utvMedl->UM_PNID = $result['PNID'];\n\t\t\t\t$utvMedl->UM_UTVID = $result['UTVID'];\n\t\t\t\t$utvMedl->UM_FRADATO = Utility::fixDateFormat($result['FUNKFRA']);\n\n\t\t\t\tif (isset($result['FUNKTIL']) == false) {\n\t\t\t\t\t$this->logger->log($this->XMLfilename, \"UM_PNID (\" . $result['PNID'] . \") is mising UM_TILDATO. This is fine accodring to DTD but arkn4 seems to require it. Setting UM_TILDATO to \" . Utility::fixDateFormat(Constants::DATE_AUTO_END), Constants::LOG_WARNING);\n\t\t\t\t\t$this->warningIssued = true;\n\t\t\t\t\t$utvMedl->UM_TILDATO = Utility::fixDateFormat(Constants::DATE_AUTO_END);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$utvMedl->UM_TILDATO = Utility::fixDateFormat($result['FUNKTIL']);\n\t\t\t\t}\n\n\n\t\t\t\t$utvMedl->UM_FUNK = $result['FUNKSJON'];\n\t\t\t\t$utvMedl->UM_RANGERING = '0';\n\t\t\t\t$this->logger->log($this->XMLfilename, \"UM.RANGERING has no value, setting to 0 for UM_PNID (\" . $utvMedl->UM_PNID . \")\", Constants::LOG_WARNING);\n\t\t\t\t$this->warningIssued = true;\n\t\t\t\t$utvMedl->UM_SORT = $result['NR'];\n\t\t\t\t\n\t\t\t\t$this->logger->log($this->XMLfilename, \"Non mandatory field UM.REPRES is not linked on ADRID for UTVID( \" . $utvMedl->UM_UTVID .\"), PNID (\" . $utvMedl->UM_PNID . \"). Value from ESA is \" . $result['REPPARTI'], Constants::LOG_WARNING);\n\t\t\t\t$utvMedl->UM_MERKNAD = $result['MERKNAD'];\n\t\t\t\t$utvMedl->UM_VARAFOR = $result['VARAPERSON'];\n\n\t\t\t\tif (is_null($result['VARAPERSON']) == true) {\n\n\t\t\t\t\t$queryGetPNID = \"select PNID from dgjhutvmedlem where adrid = '\" . $result['ADRID']. \"' AND utvid = '\" . $utvMedl->UM_UTVID .\"'\";\n\t\t\t\t\t$this->srcBase->createAndExecuteQuery ($queryGetPNID);\n\t\t\t\t\t$pnidResult = $this->srcBase->getQueryResult ($queryGetPNID);\n\t\t\t\t\t$utvMedl->UM_VARAFOR = $pnidResult['PNID'];\n \t\t\t\t\t$this->srcBase->endQuery($queryGetPNID);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->writeToDestination($utvMedl);\n\t\t}\n\t\t$this->srcBase->endQuery($this->selectQuery);\n\t}", "public function _afterSave()\n {\n Mage::getResourceModel('bpost_shm/tablerates_international')->uploadAndImport($this);\n }", "function ImportContact() {\n\t\t$this->log = LoggerManager::getLogger('import_contact');\n\t\t$this->db = & getSingleDBInstance();\n\t\t$colf = getColumnFields(\"Contacts\");\n\t\tforeach($colf as $key=>$value)\n\t\t\t$this->importable_fields[$key]=1;\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "public function importPages() {\n\t\t$deletedPages = $this->db->run_query(\"DELETE FROM pages\");\n\t\t$this->debugPrint($deletedPages, \"pages deleted from new database\");\n\t\t\n\t\t$numExistingRecords = $this->importDb->run_query(\"SELECT * FROM pages\");\n\t\t$oldData = $this->importDb->farray_fieldnames();\n\t\t\n\t\t$oldPk = null;\n\t\t$firstRecord = $oldData[array_keys($oldData)[0]];\n\t\t\n\t\t$oldById = array();\n\t\t\n\t\tif(isset($firstRecord['page_id'])) {\n\t\t\t$oldPk = 'page_id';\n\t\t}\n\t\telseif(isset($firstRecord['id'])) {\n\t\t\t$oldPk = 'id';\n\t\t}\n\t\t\n\t\tif(!is_null($oldPk)) {\n\t\t\tforeach($oldData as $k=>$v) {\n\t\t\t\t$oldById[$v[$oldPk]] = $v;\n\t\t\t}\n\t\t}\n//\t\texit;\n\t\t\n\t\t// create a test page.\n\t\t$pageObj = new page($this->db);\n\t\t$testId = $pageObj->insert(array('title'=>'test'));\n\t\t\n\t\t$queryRes = $this->db->run_query(\"SELECT * FROM pages WHERE page_id=\". $testId);\n\t\t\n\t\t$numImported = 0;\n\t\t\n\t\tif($queryRes == 1) {\n\t\t\t$templateRecord = $this->db->get_single_record();\n\t\t\t\n\t\t\t// get rid of the template record.\n\t\t\t$pageObj->delete($testId);\n\t\t\t\n\t\t\t$validColumns = array_keys($templateRecord);\n\n\t\t\tforeach($oldData as $k=>$v) {\n\t\t\t\t$createPage = true;\n\t\t\t\t$insertData = $this->_cleanRecord($validColumns, $v);\n\t\t\t\t\n\t\t\t\t// attempt to preserve ID's\n\t\t\t\tif(!is_null($oldPk)) {\n\t\t\t\t\t$insertData['page_id'] = $v[$oldPk];\n\t\t\t\t\t\n\t\t\t\t\tif(intval($v['parent_id']) > 0 && !isset($oldById[$v['parent_id']])) {\n\t\t\t\t\t\t$createPage = false;\n\t\t\t\t\t\tunset($insertData['parent_id']);\n\t\t\t\t\t}\n//\t\t\t\t\tif(isset($oldById))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tunset($insertData['parent_id']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($createPage === true) {\n\t\t\t\t\t// now insert the data.\n\t\t\t\t\t$importId = $pageObj->insert($insertData);\n\t\t\t\t\t$numImported++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->debugPrint($queryRes, \"result of query\");\n\t\t\t$this->debugPrint($testId, \"No page found, ID created was\");\n\t\t\tthrow new Exception(\"No record found\");\n\t\t}\n\t\t$this->debugPrint(\"{$numImported}/{$numExistingRecords}\", \"imported/existing page records\", 1, 0);\n\t\t\n\t\treturn $numImported;\n\t}" ]
[ "0.6050659", "0.601217", "0.59888643", "0.59820735", "0.5856395", "0.5741842", "0.57190835", "0.55667895", "0.55624694", "0.55112386", "0.55014026", "0.54888356", "0.54544675", "0.5453983", "0.54128957", "0.5410939", "0.5394443", "0.53521615", "0.533543", "0.5309772", "0.5283276", "0.52589464", "0.52425677", "0.5237593", "0.52152383", "0.52101606", "0.5202669", "0.5162076", "0.5147895", "0.5139805", "0.5133314", "0.5117685", "0.5114476", "0.51110196", "0.51051545", "0.5097133", "0.5084558", "0.5082076", "0.50769925", "0.5068696", "0.50553954", "0.5046763", "0.5029495", "0.50294095", "0.49992353", "0.49938506", "0.49903855", "0.49784088", "0.49764666", "0.49713638", "0.49553174", "0.49462485", "0.49441123", "0.4941993", "0.4941864", "0.49280852", "0.4917655", "0.49171782", "0.49171594", "0.49158165", "0.4913554", "0.49089175", "0.49083775", "0.49035144", "0.48985368", "0.48958746", "0.48758033", "0.48737544", "0.48586285", "0.48518637", "0.48491022", "0.48335868", "0.48330307", "0.48327067", "0.48284918", "0.48192447", "0.4818281", "0.4808635", "0.48041528", "0.4800214", "0.4787203", "0.47866178", "0.47837427", "0.478066", "0.47787145", "0.4766509", "0.476283", "0.475998", "0.4759007", "0.4757477", "0.47569448", "0.4755214", "0.47500682", "0.4742882", "0.47409737", "0.4725401", "0.47193748", "0.4719237", "0.47126943", "0.4711545" ]
0.63890934
0
On first call creates as data_record record used to link data object with its content. On subsequent calls returns the previously created record.
protected function get_data_record($data) { if ($this->_data_record) { return $this->_data_record; } global $USER, $DB; $this->_data_record = new object(); $this->_data_record->id = null; $this->_data_record->userid = $USER->id; $this->_data_record->groupid = 0; $this->_data_record->dataid = $data->id; $this->_data_record->timecreated = $time = time(); $this->_data_record->timemodified = $time; $this->_data_record->approved = true; $this->_data_record->id = $DB->insert_record('data_records', $this->_data_record); return $this->_data_record->id ? $this->_data_record : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRecord()\n {\n $rec = new Record($this, true);\n $rec->markForInsert();\n $this->records[] = $rec;\n return $rec;\n }", "public function create($data)\n {\n try {\n $record = $this->model->create($data);\n } catch (\\Exception $e) {\n throw $e;\n }\n\n return $record;\n }", "public function createRecord();", "public function createRecord(array $data = array());", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "protected function _addData($recordData)\n {\n \t$result = array();\n \t\n \t\n \treturn $result;\n }", "public function createRecord(array $data);", "public function createData()\n {\n // TODO: Implement createData() method.\n }", "public function CopyRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n foreach ($rec as $k=>$v)\n $rec[$k] = addslashes($v);\n global $g_BizSystem;\n // get new record array\n $recArr = $this->GetDataObj()->NewRecord();\n\n $rec[\"Id\"] = $recArr[\"Id\"]; // replace with new Id field. TODO: consider different ID generation type\n $this->m_RecordRow->SetRecordArr($rec);\n $ok = $this->GetDataObj()->InsertRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n return $this->ReRender();\n }", "public function getRecord() {}", "public function getRecord() {}", "public function getRecord() {}", "public function newRecord($data,$module=\"Leads\") {\r\n \r\n \r\n //if(count($data)&lt;=0)return \"\";\r\n $records = [];\r\n try{\r\n \r\n $record = ZCRMRecord::getInstance( $module, null );\r\n foreach($data as $d=>$v)\r\n $record->setFieldValue($d, $v);\r\n \r\n\r\n $records[] = $record;\r\n \r\n $zcrmModuleIns = ZCRMModule::getInstance($module);\r\n $bulkAPIResponse=$zcrmModuleIns->createRecords($records); // $recordsArray - array of ZCRMRecord instances filled with required data for creation.\r\n $entityResponses = $bulkAPIResponse->getEntityResponses();\r\n \r\n foreach($entityResponses as $entityResponse){\r\n if(\"success\"==$entityResponse->getStatus()){\r\n $createdRecordInstance=$entityResponse->getData();\r\n return $createdRecordInstance->getEntityId();\r\n \r\n }\r\n else{\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n \t\t\t\t file_put_contents($file_names, (json_encode($entityResponses)).PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n \t\t\t\t return \"-1\";\r\n }\r\n }\r\n \r\n \r\n }catch(Exception $e){\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n\t\t\t\t file_put_contents($file_names, $e.PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n return \"\";\r\n }\r\n \r\n \r\n }", "function appendDataForGetRecord( &$data ) {\n\n\t}", "public function createNewRecord() {\n try {\n // Define classes that we need to use.\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberCarrier = PhoneNumberToCarrierMapper::getInstance();\n // Define PhoneNumber instance.\n $phoneNumber = $phoneUtil->parse($this->number);\n // Check if phone number is valid.\n if ($phoneUtil->isValidNumber($phoneNumber)) {\n // Get phone number parameters.\n $countryCode = $phoneUtil->getRegionCodeForNumber($phoneNumber);\n $carrier = $phoneNumberCarrier->getNameForNumber($phoneNumber, $countryCode);\n $countryDialingCode = $phoneNumber->getCountryCode();\n $subscriberNumber = $phoneNumber->getNationalNumber();\n\n // We will return this data to the view.\n $data = [\n 'mno' => $carrier,\n 'country_dialing_code' => $countryDialingCode,\n 'subscriber_number' => $subscriberNumber,\n 'country_code' => $countryCode,\n ];\n\n // Save new record into database.\n $record = Records::create([\n 'phone_number' => $this->number,\n 'data' => json_encode($data),\n ]);\n\n return $record;\n }\n } catch (NumberParseException $e) {\n throw new NumberParseException($e, $e->getMessage());\n }\n }", "public function getRecord();", "public function createData($data){\n return $resultSet = $this->model->create($data);\n }", "public function getRecord()\n {\n return $this->get(self::_RECORD);\n }", "function &returnRecord()\n\t{\n\t\treturn $this->record;\n\t}", "public function create()\n {\n return new PersonData($this);\n }", "protected function buildNewRecordData()\n\t{\n\t\t// define temporary arrays. These are required for ASP conversion\n\t\t$evalues = array();\n\t\t$efilename_values = array();\n\t\t$blobfields = array();\n\t\t$keys = $this->keys;\n\t\t\n\t\t$newFields = array_intersect( $this->getpageFields(), $this->selectedFields );\n\t\tforeach($newFields as $f)\n\t\t{\n\t\t\t$control = $this->getControl( $f, $this->id );\n\t\t\t$control->readWebValue($evalues, $blobfields, NULL, NULL, $efilename_values);\n\t\t}\n\n\t\t$this->newRecordData = $evalues;\n\t\t$this->newRecordBlobFields = $blobfields;\n\t}", "public static function new_detail_record()\n\t{\n\t\treturn new league_record_detail();\n\t}", "public function create($data)\n {\n if (($id = $this->database->insert($this->getTableName(), $data)) !== false) {\n return $this->find($id);\n }\n }", "public function setDiaryRecordId($data)\n {\n $this->_DiaryRecordId=$data;\n return $this;\n }", "protected function createEntryRecord() {\n\n\t\t$lot = CqlixHistory::getInstance()->getEntryLotRecord();\n\t\t$modelName = $this->model->getTable()->getModelName();\n\n\t\treturn HistoryEntry::create(array(\n\t\t\t'history_id' => $this->historyRecord->getId(),\n\t\t\t'Lot' => $lot,\n\t\t\t'model' => $modelName,\n\t\t\t'model_id' => $this->model->getPrimaryKeyValue(),\n\t\t\t'operation' => $this->operation,\n\t\t));\n\t}", "protected function createEntity()\n {\n return (new LogRecord());\n }", "function v1_record_obj($key, $code, $data) {\n\t\n\tglobal $checked_data;\n\tglobal $xml_id_cnt;\n\t\n\tif (!isset($checked_data[$key])) {\n\t\t$checked_data[$key]=array();\n\t}\n\t\n\tif (!isset($checked_data[$key][$code])) {\n\t\t$checked_data[$key][$code]=array();\n\t}\n\t\n\t// XML ID\n\t$data['xml_id']=$xml_id_cnt;\n\t$xml_id_cnt++;\n\t\n\tarray_push($checked_data[$key][$code], $data);\n\t\n}", "public function NewRecord()\n {\n global $g_BizSystem;\n $this->SetDisplayMode(MODE_N);\n $recArr = $this->GetNewRecord();\n if (!$recArr)\n return $this->ProcessDataObjError();\n $this->UpdateActiveRecord($recArr);\n // TODO: popup message of new record successful created\n return $this->ReRender();\n }", "function add_a_record()\n {\n /**\n * @var str IP Address for the A record\n * @var int TTL for the A record\n * @var str Hostname for the A record\n * @var str Regex to Validate IPv4 Addresses\n */\n $ip = Null;\n $ttl = Null;\n $host = Null;\n $hnregex = \"/(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)+\" . $this->domainnames[$this->domain_id]['name'] . \"/\";\n $shnregex = \"/^(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)/\";\n while (!is_string($ip)) {\n $ip = filter_var(readline(\"IP Address: \"), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n }\n while (!is_int($ttl)) {\n $ttl = filter_var(readline(\"TTL [300]: \"), FILTER_VALIDATE_INT);\n $ttl = (!is_bool($ttl)) ? $ttl : 300;\n }\n while (!is_string($host)) {\n $hosttmp = readline(\"Hostname for new A record: \");\n if (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)))) {\n $host = $hosttmp;\n } elseif (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $shnregex)))) {\n $host = filter_var($hosttmp . \".\" . $this->domainnames[$this->domain_id]['name'], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)));\n }\n }\n\n foreach ($this->domains as $d) {\n if ($d->name == $this->domainnames[$this->domain_id]['name']){\n $domain = $d;\n }\n }\n\n $record = array(\n 'name' => $host,\n 'type' => 'A',\n 'ttl' => $ttl,\n 'data' => $ip);\n\n printf(\"\\nYou would like to add the following record:\\n\");\n printf(\"Type: %s\\n\", $record['type']);\n printf(\"Name: %s\\n\", $record['name']);\n printf(\"IP: %s\\n\", $record['data']);\n printf(\"TTL: %s\\n\", $record['ttl']);\n\n $proceed = readline(\"Type \\\"Y\\\" or \\\"y\\\" to proceed: \");\n\n if (strtolower($proceed) === 'y') {\n $hostentry = $domain->record($record);\n try {\n $response = $hostentry->create();\n printf(\"Created!\\n\");\n } catch (Exception $e) {\n printf(\"%s\\n\", $e);\n }\n } else {\n printf(\"ABORTED!\\n\");\n }\n }", "function CallerRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_caller\";\n\t\t\n\t\t$pDataHash['data_store']['caller_id'] = $data[0];\n\t\tif ( $data[1] == '[null]' )\n\t\t\t$pDataHash['data_store']['cltype'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['cltype'] = $data[1];\n\t\t$pDataHash['data_store']['title'] = $data[2];\n\t\t$pDataHash['data_store']['surname'] = $data[3];\n\t\t$pDataHash['data_store']['forename'] = $data[4];\n\t\t$pDataHash['data_store']['company'] = $data[5];\n\t\tif ( $data[6] == '[null]' )\n\t\t\t$pDataHash['data_store']['ni'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['ni'] = $data[6];\n\t\tif ( $data[7] == '[null]' )\n\t\t\t$pDataHash['data_store']['hbis'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['hbis'] = $data[7];\n\t\t$pDataHash['data_store']['address'] = $data[8];\n\t\t$pDataHash['data_store']['postcode'] = $data[9];\n\t\tif ( $data[10] != '[null]' ) $pDataHash['data_store']['lastvisit'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['specialneeds'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['specialneeds'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['staff_id'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['staff_id'] = $data[12];\n\t\tif ( $data[13] == '[null]' )\n\t\t\t$pDataHash['data_store']['note'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['note'] = $data[13];\n\t\tif ( $data[14] != '[null]' ) $pDataHash['data_store']['memo'] = $data[14];\n\t\tif ( $data[15] != '[null]' ) $pDataHash['data_store']['cllink'] = $data[15];\n\t\tif ( $data[16] == '[null]' )\n\t\t\t$pDataHash['data_store']['usn'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['usn'] = $data[16];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function getRecord()\r\n\t{\r\n\t\treturn $this->record;\r\n\t}", "protected function initDatabaseRecord() {}", "public function current()\n {\n $data = $this->dataSource->current();\n\n if (!$this->has_complete_record_definition) {\n $data_columns = array_keys($this->table->getColumnsInformation());\n $record_columns = array_keys((array) $data);\n $matches = array_intersect($data_columns, $record_columns);\n if (count($matches) != count($data_columns)) {\n $missings = implode(',', array_diff($data_columns, $record_columns));\n $msg = __METHOD__ . \": Cannot create a Record due to incomplete or aliased column definition (missing: $missings).\";\n $msg .= \"Check whether columns have been modified in TableSearch::columns() method, or use an toArray(), toJson()... version of the ResultSet.\";\n throw new Exception\\LogicException($msg);\n }\n $this->has_complete_record_definition = true;\n }\n\n $record = $this->table->record($data, $ignore = true);\n $record->setState(Record::STATE_CLEAN);\n return $record;\n }", "function newRecord($vals=null){\n\t\treturn new Dataface_ViewRecord($this, $vals);\n\t}", "public function create($data = null) {\n return $data;\n }", "public function getRecord(){\n \n return $this->record;\n }", "private function _prepareReturnData($data) {\n $o = new Agana_Model_Object($data);\n $o->setId($data['objid']);\n $o->setTableName($data['tablename']);\n return $o;\n }", "function dbase_add_record($dbase_identifier, $record)\n{\n}", "public function getRecord(){\n return $this->record;\n }", "function factory_KFRecord() { return( new KFRecord($this)); }", "public function SaveRecord()\n {\n // call ValidateForm()\n if ($this->ValidateForm() == false)\n return;\n\n $recArr = array();\n if ($this->ReadInputRecord($recArr) == false)\n return;\n\n if ($this->m_Mode == MODE_N)\n $dataRec = new DataRecord(null, $this->GetDataObj());\n else if ($this->m_Mode == MODE_E)\n $dataRec = new DataRecord($this->GetActiveRecord(), $this->GetDataObj());\n foreach ($recArr as $k=>$v)\n $dataRec[$k] = $v; // or $dataRec->$k = $v;\n $ok = $dataRec->save();\n\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n\n $this->UpdateActiveRecord($this->GetDataObj()->GetActiveRecord());\n $this->SetDisplayMode (MODE_R);\n // TODO: popup message of new record successful saved\n return $this->ReRender();\n }", "protected function createHistoryRecord() {\n\t\t/** @var HasHistory $model */\n\t\t$model = $this->model;\n\n\t\t$history = HistoryModel::create();\n\t\t$history->save();\n\n\t\t$model->setHistoryId($history->getId());\n\n\t\treturn $history;\n\t}", "function prepareForStorage(&$data) {\n\t\t$recordId = $data->{$this->model->getTableKey()};\n\t\t$data->{$this->propertyName} = $this->getCurrentFilename($recordId);\n\t\treturn parent::prepareForStorage($data);\n\t}", "public static function new_detail_record()\n\t{\n\t\treturn new user_record_detail();\n\t}", "protected function get_record()\n\t{\n\t\treturn $this->key ? parent::get_record() : null;\n\t}", "public function save($data, $id = 0)\n {\n $id = (int) $id;\n\n if (0 === $id) {\n $record = $this->insert($data);\n } else {\n $record = $this->findRow($id);\n\n $record->update($data);\n }\n\n return $record;\n }", "public function appendRecord(Down_GuildInstanceRecord $value)\n {\n return $this->append(self::_RECORD, $value);\n }", "public function getDataModel ()\n {\n $sync_logData = $this->getData();\n\n $sync_logDataObject = $this->sync_logDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $sync_logDataObject,\n $sync_logData,\n SyncLogInterface::class\n );\n\n return $sync_logDataObject;\n }", "protected function createAfter( $data )\n {\n return $data;\n }", "protected function preProcessRecordData(&$data)\n {\n }", "protected function _create()\n {\n $entry = $this->_db->createRow();\n foreach ($this->getFields() as $key => $value) {\n $entry->{$key} = $value;\n }\n return $entry->save();\n }", "function TransactionRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_transaction\";\n\t\t\n\t\t$pDataHash['data_store']['ticket_id'] = $data[0];\n\t\t$pDataHash['data_store']['transact_no'] = $data[1];\n\t\t$pDataHash['data_store']['transact'] = $data[2];\n\t\t$pDataHash['data_store']['ticket_ref'] = $data[3];\n\t\t$pDataHash['data_store']['staff_id'] = $data[4];\n\t\t$pDataHash['data_store']['previous'] = $data[5];\n\t\t$pDataHash['data_store']['room'] = $data[6];\n\t\t$pDataHash['data_store']['applet'] = $data[7];\n\t\t$pDataHash['data_store']['office'] = $data[8];\n\t\t$pDataHash['data_store']['ticket_no'] = $data[9];\n\t\tif ( $data[10] == '[null]' )\n\t\t\t$pDataHash['data_store']['proom'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['proom'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['tags'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['tags'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['clearance'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['clearance'] = $data[12];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function newRecord(array $row) : ReferenceRecord\n {\n return new ReferenceRecord($row);\n }", "public function getLiveRecord() {}", "public function current(): Record\n {\n return $this->data[0];\n }", "public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}", "function appendDataForGetRecord( &$data ) {\n\n\t\t$pathUrl = $this->getPropertyDefinition('urlBase');\n\t\tif ($pathUrl) {\n\t\t\t$data->{$this->propertyName.'_href'} = (!empty($data->{$this->propertyName})) ? $pathUrl.'/'.$data->{$this->propertyName} : '';\n\t\t}\n\n\t\t$pathFilesystem = $this->getPropertyDefinition('dirBase');\n\t\tif ($pathFilesystem) {\n\t\t\t$data->{$this->propertyName.'_path'} = (!empty($data->{$this->propertyName})) ? $pathFilesystem.'/'.$data->{$this->propertyName} : '';\n\t\t}\n\n\t\tparent::appendDataForGetRecord( $data );\n\t}", "public function getDataWithTypeParentRecordNumber() {}", "public function forceData($data)\n {\n //TODO disable setting primary key\n $this->data = $data;\n return $this;\n }", "public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}", "private function get_data() {\n\t\t$this->set_data();\n\t\t\n\t\treturn $this;\n\t}", "public function createSequenceNumber($data)\n\t{\n\n\t\t$validator = \\SequenceNumber::validator($data);\n if ($validator->passes()) {\n $record = new \\SequenceNumber();\n $record->fill($data);\n\n /*\n * @todo: assign default values as needed\n */\n $now = new \\DateTime;\n $now_str = $now->format('Y-m-d H:i:s');\n $record->uuid = uniqid();\n $record->created_dt = $now_str;\n $record->updated_dt = $now_str;\n\n $arrModel = $record->toArray();\n $arrModel['_id'] = new \\MongoId();\n $record->sid = (string)$arrModel['_id'];\n\n $this->db_collection->insert( $arrModel );\n\n return $record;\n } else {\n throw new ValidationException($validator);\n }\n\t}", "public function GetRecord()\n\t{\n\t\treturn new DotCoreEventRecord($this);\n\t}", "function TicketRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_ticket\";\n\n\t\t$pDataHash['ticket_store']['office'] = $data[0];\n\t\t$pDataHash['ticket_store']['ticket_id'] = $data[1];\n\t\t$pDataHash['ticket_store']['ticket_ref'] = $data[2];\n\t\t$pDataHash['ticket_store']['ticket_no'] = $data[3];\n\t\t$pDataHash['ticket_store']['tags'] = $data[4];\n\t\t$pDataHash['ticket_store']['clearance'] = $data[5];\n\t\t$pDataHash['ticket_store']['room'] = $data[6];\n\t\tif ( $data[7] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['note'] = '';\n\t\telse\n\t\t\t$pDataHash['ticket_store']['note'] = $data[7];\n\t\tif ( $data[8] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['last'] = '';\n\t\telse\n\t\t\t$pDataHash['ticket_store']['last'] = $data[8];\n\t\t$pDataHash['ticket_store']['staff_id'] = $data[9];\n\t\t$pDataHash['ticket_store']['init_id'] = $data[10];\n\t\t$pDataHash['ticket_store']['caller_id'] = $data[11];\n\t\t$pDataHash['ticket_store']['appoint_id'] = $data[12];\n\t\t$pDataHash['ticket_store']['applet'] = $data[13];\n\t\tif ( $data[14] != '[null]' ) $pDataHash['ticket_store']['memo'] = $data[14];\n\t\tif ( $data[15] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['department'] = 0;\n\t\telse\n\t\t\t$pDataHash['ticket_store']['department'] = $data[15];\n\n\t\t// Create LC entry details from legacy data\n\t\tglobal $gBitSystem;\n\t\t\n\t\t$this->mDb->StartTrans();\n\t\t$this->mContentId = 0;\n\t\t$pDataHash['content_id'] = 0;\n\t\t$pDataHash['user_id'] = $pDataHash['ticket_store']['init_id'];\n\t\t$pDataHash['modifier_user_id'] = $pDataHash['ticket_store']['staff_id'];\n\t\t$pDataHash['created'] = $gBitSystem->mServerTimestamp->getTimestampFromISO($pDataHash['ticket_store']['ticket_ref'], true);\n\t\t$pDataHash['event_time'] = $pDataHash['created'];\n\t\t$pDataHash['last_modified'] = $gBitSystem->mServerTimestamp->getTimestampFromISO($pDataHash['ticket_store']['last'], true);\n\t\t$pDataHash['title'] = $pDataHash['ticket_store']['ticket_ref'].'-Ticket-'.$pDataHash['ticket_store']['ticket_no'];\n\t\t$pDataHash['content_status_id'] = 60; // Mark all records Finished - data can't be modified, so read only!\n\t\tif ( LibertyContent::store( $pDataHash ) ) {\n\t\t\t$pDataHash['ticket_store']['content_id'] = $pDataHash['content_id'];\n\t\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['ticket_store'] );\n\t\t\t$this->mDb->CompleteTrans();\n\t\t} else {\n\t\t\t$this->mDb->RollbackTrans();\n\t\t\t$this->mErrors['store'] = 'Failed to store this ticket.';\n\t\t}\t\t\t\t\n\t}", "public function record() {\n $data = array(\n \"name\" => $this->name,\n \"description\" => $this->description,\n \"image\" => $this->image,\n \"type\" => $this->type,\n \"discount\" => $this->discount_offer,\n \"code\" => $this->coupon_code,\n \"expiration\" => $this->expiration\n );\n return $this->db->insert(\"trade\", $data);\n }", "public function getDataModel()\n {\n $logData = $this->getData();\n \n $logDataObject = $this->logDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $logDataObject,\n $logData,\n LogInterface::class\n );\n \n return $logDataObject;\n }", "public function createLead($leadData) {\n return $this->createRecord('lead', $leadData);\n }", "public function getDataModel()\n {\n $reportData = $this->getData();\n \n $reportDataObject = $this->reportDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $reportDataObject,\n $reportData,\n ReportInterface::class\n );\n \n return $reportDataObject;\n }", "public function __construct($data, RecordType $recordType = null)\n {\n $this->data = $data;\n $this->recordType = $recordType;\n }", "function getData($data = null){\r\n\t\tif(empty($data)){\r\n\t\t\tif($this->scope->recordId !== NULL){\r\n\t\t\t\t$data = $this->model->FindOneById($this->scope->recordId);\r\n\t\t\t}else{\r\n\t\t\t\t$data = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->fields->getData($data, $this);\r\n\t}", "abstract protected function map_object_to_record($object, $record);", "function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}", "function returnFakeDataRow($focus, $field_array, $rowsToReturn = 5)\n{\n if (empty($focus) || empty($field_array)) {\n return ;\n }\n\n // include the file that defines $sugar_demodata\n include('install/demoData.en_us.php');\n\n $person_bean = false;\n if (isset($focus->first_name)) {\n $person_bean = true;\n }\n\n global $timedate;\n $returnContent = '';\n $counter = 0;\n $new_arr = array();\n\n // iterate through the record creation process as many times as defined. Each iteration will create a new row\n while ($counter < $rowsToReturn) {\n $counter++;\n // go through each field and populate with dummy data if possible\n foreach ($field_array as $field_name) {\n if (empty($focus->field_defs[$field_name]) || empty($focus->field_defs[$field_name]['type'])) {\n // type is not set, fill in with empty string and continue;\n $returnContent .= '\"\",';\n continue;\n }\n $field = $focus->field_defs[$field_name];\n\n // fill in value according to type\n $type = $field['type'];\n\n switch ($type) {\n case \"id\":\n case \"assigned_user_name\":\n // return new guid string\n $returnContent .= '\"' . create_guid() . '\",';\n break;\n case \"int\":\n // return random number`\n $returnContent .= '\"' . mt_rand(0, 4) . '\",';\n break;\n case \"name\":\n // return first, last, user name, or random name string\n if ($field['name'] == 'first_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] . '\",';\n } elseif ($field['name'] == 'last_name') {\n $count = count($sugar_demodata['last_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] . '\",';\n } elseif ($field['name'] == 'user_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] .\n '_' . mt_rand(1, 111) . '\",';\n } else {\n // return based on bean\n if ($focus->module_dir =='Accounts') {\n $count = count($sugar_demodata['company_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['company_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Bugs') {\n $count = count($sugar_demodata['bug_seed_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['bug_seed_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Notes') {\n $count = count($sugar_demodata['note_seed_names_and_Descriptions']) - 1;\n $returnContent .= '\"' .\n $sugar_demodata['note_seed_names_and_Descriptions'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='Calls') {\n $count = count($sugar_demodata['call_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['call_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Tasks') {\n $count = count($sugar_demodata['task_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['task_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Meetings') {\n $count = count($sugar_demodata['meeting_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['meeting_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='ProductCategories') {\n $count = count($sugar_demodata['productcategory_seed_data_names']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['productcategory_seed_data_names'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='ProductTypes') {\n $count = count($sugar_demodata['producttype_seed_data_names']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['producttype_seed_data_names'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='ProductTemplates') {\n $count = count($sugar_demodata['producttemplate_seed_data']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['producttemplate_seed_data'][mt_rand(0, $count)] . '\",';\n } else {\n $returnContent .= '\"Default Name for '.$focus->module_dir.'\",';\n }\n }\n break;\n case \"relate\":\n if ($field['name'] == 'team_name') {\n // apply team names and user_name\n $teams_count = count($sugar_demodata['teams']) - 1;\n $users_count = count($sugar_demodata['users']) - 1;\n $returnContent .= '\"' . $sugar_demodata['teams'][mt_rand(0, $teams_count)]['name'] . ',' .\n $sugar_demodata['users'][mt_rand(0, $users_count)]['user_name'] . '\",';\n } else {\n // apply GUID\n $returnContent .= '\"' . create_guid() . '\",';\n }\n break;\n case \"bool\":\n // return 0 or 1\n $returnContent .= '\"' . mt_rand(0, 1) . '\",';\n break;\n case \"text\":\n // return random text\n $returnContent .= '\"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas' .\n ' porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus' .\n ' malesuada libero, sit amet commodo magna eros quis urna\",';\n break;\n case \"team_list\":\n $teams_count = count($sugar_demodata['teams']) - 1;\n // give fake team names (East,West,North,South)\n $returnContent .= '\"' . $sugar_demodata['teams'][mt_rand(0, $teams_count)]['name'] . '\",';\n break;\n case \"date\":\n // return formatted date\n $timeStamp = strtotime('now');\n $value = date($timedate->dbDayFormat, $timeStamp);\n $returnContent .= '\"'.$timedate->to_display_date_time($value).'\",';\n break;\n case \"datetime\":\n case \"datetimecombo\":\n // return formatted date time\n $timeStamp = strtotime('now');\n // Start with db date\n $value = date($timedate->dbDayFormat.' '.$timedate->dbTimeFormat, $timeStamp);\n // use timedate to convert to user display format\n $value = $timedate->to_display_date_time($value);\n // finally format the am/pm to have a space so it can be recognized as a date field in excel\n $value = preg_replace('/([pm|PM|am|AM]+)/', ' \\1', $value);\n $returnContent .= '\"' . $value . '\",';\n break;\n case \"phone\":\n $value = '(' . mt_rand(300, 999) . ') ' . mt_rand(300, 999) . '-' . mt_rand(1000, 9999);\n $returnContent .= '\"' . $value . '\",';\n break;\n case \"varchar\":\n // process varchar for possible values\n if ($field['name'] == 'first_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($field['name'] == 'last_name') {\n $count = count($sugar_demodata['last_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($field['name'] == 'user_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .=\n '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)] . '_' . mt_rand(1, 111) . '\",';\n } elseif ($field['name'] == 'title') {\n $count = count($sugar_demodata['titles']) - 1;\n $returnContent .= '\"'.$sugar_demodata['titles'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_street') > 0) {\n $count = count($sugar_demodata['street_address_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['street_address_array'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_city') > 0) {\n $count = count($sugar_demodata['city_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['city_array'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_state') > 0) {\n $state_arr = array('CA', 'NY', 'CO', 'TX', 'NV');\n $count = count($state_arr) - 1;\n $returnContent .= '\"'.$state_arr[mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_postalcode') > 0) {\n $returnContent .= '\"'.mt_rand(12345, 99999).'\",';\n } else {\n $returnContent .= '\"\",';\n }\n break;\n case \"url\":\n $returnContent .= '\"https://www.sugarcrm.com\",';\n break;\n case \"enum\":\n // get the associated enum if available\n global $app_list_strings;\n\n if (isset($focus->field_defs[$field_name]['type']) &&\n !empty($focus->field_defs[$field_name]['options'])\n ) {\n if (!empty($app_list_strings[$focus->field_defs[$field_name]['options']])) {\n // put the values into an array\n $dd_values = $app_list_strings[$focus->field_defs[$field_name]['options']];\n $dd_values = array_values($dd_values);\n\n // grab the count\n $count = count($dd_values) - 1;\n\n // choose one at random\n $returnContent .= '\"' . $dd_values[mt_rand(0, $count)] . '\",';\n } else {\n // name of enum options array was found but is empty, return blank\n $returnContent .= '\"\",';\n }\n } else {\n // name of enum options array was not found on field, return blank\n $returnContent .= '\"\",';\n }\n break;\n default:\n // type is not matched, fill in with empty string and continue;\n $returnContent .= '\"\",';\n } // switch\n }\n $returnContent .= \"\\r\\n\";\n }\n return $returnContent;\n}", "public function pushRecord()\r\n {\r\n\r\n }", "function ReasonRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_reason\";\n\t\t\n\t\t$pDataHash['data_store']['reason'] = $data[0];\n\t\t$pDataHash['data_store']['title'] = $data[1];\n\t\t$pDataHash['data_store']['reason_type'] = $data[2];\n\t\t$pDataHash['data_store']['reason_source'] = $data[3];\n\t\tif ( $data[4] == '[null]' )\n\t\t\t$pDataHash['data_store']['tag'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['tag'] = $data[4];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function setPostData(Omeka_Record_AbstractRecord $record, $data)\n {\n // Set properties directly to a new record.\n $record->item_id = $data->item_id;\n $record->three_file_id = $data->three_file_id;\n $record->three_thumbnail_id = $data->three_thumbnail_id;\n $record->skybox_id = $data->skybox_id;\n $record->enable_lights = $data->enable_lights;\n $record->enable_materials = $data->enable_materials;\n $record->enable_shaders = $data->enable_shaders;\n $record->enable_measurement = $data->enable_measurement;\n $record->model_units = $data->model_units;\n $record->needs_delete = $data->needs_delete;\n }", "public function store($data)\n {\n $ad = $this->model->create($data);\n\n// if (is_array($data['tags'])) {\n// $this->syncTag($ad, $data['tags']);\n// } else {\n// $this->syncTag($ad, json_decode($data['tags']));\n// }\n\n return $ad;\n }", "public static function create_record() {\n\t\t$extension = self::get_extension();\n\t\t$sql = \"INSERT INTO photo_directory (user_id, time_uploaded, extension) VALUES ('{$_SESSION['user_id']}', NOW(), '{$extension}'); \";\n\t\t$do_it_bitch = mysql_query($sql);\n\n\t\t// Create record in photo_description\n\t\t$photo_id = self::max_photo_id();\n\t\t$description = $_POST['description'];\n\t\tif ($description == 'false') {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id) VALUES ({$photo_id}); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t} else {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id, photo_description) VALUES ({$photo_id}, '{$description}'); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t}\n\t}", "protected function OrderRecord() {\n\treturn $this->OrderTable($this->GetOrderID());\n }", "public function getDataModel()\n {\n $data = $this->getData();\n $dataObject = $this->queueDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $dataObject,\n $data,\n Data\\QueueInterface::class\n );\n return $dataObject;\n }", "public function reset() {\r\n\t\tforeach ($this->_metadata->getNames() as $name){\r\n\t\t\tif($this->isPrimaryKey($name)){\r\n\t\t\t\t$this->_record[$name] = $this->getPrimaryKey() ;\r\n\t\t\t}else{\r\n\t\t\t\t$this->_record[$name] = $this->{$name} ;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->_record ;\r\n\t}", "function GetLinkedRecord(DotCoreDataRecord $root_record);", "function createRecord($array){\n parent::createRecord($array);\n }", "public function __construct($data=null){\r\n\t\t// Load Table\r\n\t\t$class = get_class($this);\r\n\t\t$this->definition = DBObjectDefinition::getByClassName($class,$this);\r\n\t\t\r\n\t\t// Process Input\r\n\t\t$dataLoaded = false;\r\n\t\tif (!is_null($data)){\r\n\t\t\tif ($data instanceof SQLQueryResultRow){\r\n\t\t\t\tif (!$this->loadFromSqlResult($data)){\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Unable to load '.get_class($this).' object from SQL result row');\r\n\t\t\t\t}\r\n\t\t\t\t$dataLoaded = true;\r\n\t\t\t} elseif (is_array($data) || $data instanceof ArrayAccess) {\r\n\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t} elseif (is_numeric($data)) {\r\n\t\t\t\t$data = (int)$data;\r\n\t\t\t\t$pk = $this->getTable()->getPrimaryKey();\r\n\t\t\t\tif ($pk->size()==1){\r\n\t\t\t\t\t$id = $data;\r\n\t\t\t\t\t$data = array(ArrayUtils::getFirst($pk->getColumns())=>$id);\r\n\t\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from ID, but primary key contains multiple fields: '.$data);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from unexpected data: '.var_export($data,true).']');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Load Data\r\n\t\tif ($dataLoaded){\r\n\t\t\t$this->new = false;\r\n\t\t\t$this->hasChanged = false;\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t} else {\r\n\t\t\t$this->values = array();\r\n\t\t\tforeach ($this->definition->getColumns() as $name=>$column){\r\n\t\t\t\t$this->values[$name] = new SQLValue($column,$column->getDefaultValue());\r\n\t\t\t}\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t\t\r\n\t\t\t// If a query was specified, but data has not been loaded from it because the record doesn't exist, load that information\r\n\t\t\tif (is_array($data)){\r\n\t\t\t\tforeach ($data as $field=>$value){\r\n\t\t\t\t\t$this->values[$field]->setValue($value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function testRecord() {\n $this->markTestIncomplete('This test has not been implemented yet.');\n }", "public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}", "public static function create($data) {\n\t\t$className = get_called_class();\n\t\t$object = new $className($data);\n\t\t$object->save();\n\t\treturn $object;\n\t}", "protected function _importRecord($_recordData, &$_result)\n {\n \n $record = new $this->_modelName($_recordData, TRUE);\n \n if ($record->isValid()) {\n if (! $this->_options['dryrun']) {\n\t\t\t\tif($record->__get('change_sign') == 'A'){\n\t\t\t\t\t$record = call_user_func(array($this->_controller, $this->_createMethod), $record);\t\n\t\t\t\t}else{ \n\t\t\t\t\ttry{ \n \t\t$record = $this->_controller->getByRecordNumber((int)trim($record->__get('record_number')));\n \t\t$record->setFromArray($_recordData);\n \t\t$record = $this->_controller->update($record);\n\t\t\t\t\t}catch(Tinebase_Exception_NotFound $e){\n\t\t\t\t\t\t$record = call_user_func(array($this->_controller, $this->_createMethod), $record);\t\n\t\t\t\t\t}\n\t if($record->__get('change_sign') == 'D'){\n\t \t$this->_controller->delete($record->getId());\n\t }\n\t\t\t\t}\n \n } else {\n $_result['results']->addRecord($record);\n }\n \n $_result['totalcount']++;\n \n } else {\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . print_r($record->toArray(), true));\n throw new Tinebase_Exception_Record_Validation('Imported record is invalid.');\n }\n }", "public function store($data, $id){\n $this->model->fill($data);\n $this->model->persona_id = $id;\n $this->model->save();\n return $this->model;\n }", "public function getRecordId()\n {\n return $this->record_id;\n }", "public function create($data)\n\t{\n\t\treturn $this->entity->create($data);\n\t}", "public function create_a_record()\n {\n // Add a record\n factory(Email::class, 1)->create();\n\n $this->assertCount(1, Email::all());\n }", "public function newRelatedRecord($relatedSet)\n {\n $relatedSetInfos = $this->layout->getRelatedSet($relatedSet);\n if (FileMaker::isError($relatedSetInfos)) {\n return $relatedSetInfos;\n }\n $record = new Record($relatedSetInfos);\n $record->setParent($this);\n $record->relatedSetName = $relatedSet;\n return $record;\n }", "protected function populateDatastreamInfo() {\n $this->datastreamHistory = $this->getDatastreamHistory();\n $this->datastreamInfo = $this->datastreamHistory[0];\n }", "public function dataFile()\n {\n return new DataFile(data_path().'/'.$this->getHashedId());\n }", "public function create() {\n $this->_lastCreate = true;\n return $this;\n }", "function getRecord($id = false)\n\t{\n\t\tif ($id === false)\n\t\t\t$id = $this->id;\n\n\t\t$this->record = &$this->form->passRecord($this->tablename, $id);\n\t\t$this->form->DescIntoFields($this->tablename, $id);\n\n\t\treturn $this->record;\n\t}", "protected function createBefore( $data )\n {\n return $data;\n }", "public function getCurrentRecord()\n {\n if ($this->currentRecord) {\n return $this->currentRecord;\n }\n return $this->currentRecord = $this->loadRecord();\n }", "public function assignData(\\Magento\\Framework\\DataObject $data)\n {\n parent::assignData($data);\n\n if (!$data instanceof \\Magento\\Framework\\DataObject) {\n $data = new \\Magento\\Framework\\DataObject($data);\n }\n\n $additionalData = $data->getAdditionalData();\n $infoInstance = $this->getInfoInstance();\n\n return $this;\n }" ]
[ "0.6830509", "0.66752625", "0.65268564", "0.63946795", "0.6298123", "0.6273325", "0.61721206", "0.6119108", "0.6106025", "0.6050434", "0.6050434", "0.6048353", "0.6044807", "0.59401137", "0.59214187", "0.58682567", "0.5797092", "0.5792165", "0.57628447", "0.57008016", "0.5700288", "0.568659", "0.5638006", "0.5632575", "0.56048524", "0.5595621", "0.5595532", "0.5590561", "0.5549571", "0.5547602", "0.55218714", "0.5519719", "0.54910666", "0.54909295", "0.54895556", "0.54768497", "0.5457437", "0.5447724", "0.54278755", "0.5426894", "0.5419371", "0.54167116", "0.54157746", "0.54115677", "0.5405883", "0.5398309", "0.5366258", "0.53646684", "0.5342313", "0.5339904", "0.53329164", "0.53197014", "0.5312668", "0.5308787", "0.5305264", "0.53033495", "0.53033173", "0.5298684", "0.5294429", "0.5278874", "0.5277701", "0.52764964", "0.5275289", "0.5269675", "0.5265927", "0.5249519", "0.52489316", "0.52366304", "0.52222854", "0.5204835", "0.5200536", "0.51939493", "0.5193874", "0.51871705", "0.5175508", "0.5174592", "0.51740307", "0.5171529", "0.51696837", "0.51687133", "0.51642114", "0.51634836", "0.51590854", "0.51560825", "0.5146993", "0.51419485", "0.51408213", "0.513584", "0.512913", "0.51191217", "0.5116894", "0.51136184", "0.5111063", "0.510936", "0.5104797", "0.5103955", "0.50821096", "0.50704056", "0.5067143", "0.5063345" ]
0.7404586
0
Default import method for table's cell containing data.
protected function process_data_default(import_settings $settings, $field, $data_record, $value, $content1 = null, $content2 = null, $content3 = null, $content4 = null) { global $DB; $result = new object(); $result->fieldid = $field->id; $result->recordid = $data_record->id; $result->content = $value instanceof DOMElement ? $this->get_innerhtml($value) : $value; $result->content1 = $content1; $result->content2 = $content2; $result->content3 = $content3; $result->content4 = $content4; $result->id = $DB->insert_record('data_content', $result); return $result->id ? $result : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadRow() {}", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "public function metaImport($data);", "function import(array $data);", "public function importFrom(array $data);", "protected function importDatabaseData() {}", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function import();", "public function import(array $data): void;", "public function import()\n {\n \n }", "public function import($data)\r\n\t{\r\n\t\tforeach ((array) $data as $column => $value)\r\n\t\t\t$this->set($column, $value);\r\n\r\n\t\treturn $this;\r\n\t}", "protected function _readTable() {}", "protected function _readTable() {}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function import(): void;", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "private function _loadDataToTemporaryTable(){\n\n }", "abstract public static function columnData();", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "abstract public function loadData();", "public function getRow() {}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "abstract public function loadColumns();", "public function getTableData()\n\t{\n\t}", "protected abstract function insertRow($tableName, $data);", "function ctools_export_crud_import($table, $code) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!empty($export['import callback']) && function_exists($export['import callback'])) {\r\n return $export['import callback']($code);\r\n }\r\n else {\r\n ob_start();\r\n eval($code);\r\n ob_end_clean();\r\n\r\n if (empty(${$export['identifier']})) {\r\n $errors = ob_get_contents();\r\n if (empty($errors)) {\r\n $errors = t('No item found.');\r\n }\r\n return $errors;\r\n }\r\n\r\n $item = ${$export['identifier']};\r\n\r\n // Set these defaults just the same way that ctools_export_new_object sets\r\n // them.\r\n $item->export_type = NULL;\r\n $item->{$export['export type string']} = t('Local');\r\n\r\n return $item;\r\n }\r\n}", "public function _importData()\n {\n Mage::dispatchEvent($this->_eventPrefix . '_before_import', array(\n 'data_source_model' => $this->_dataSourceModel,\n 'entity_model' => $this\n ));\n $result = parent::_importData();\n Mage::dispatchEvent($this->_eventPrefix . '_after_import', array(\n 'entities' => $this->_newCustomers,\n 'entity_model' => $this\n ));\n return $result;\n }", "abstract protected function loadTableDefaultValues(string $tableName): array;", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function dataTable();", "function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }", "public function importArray($data);", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "abstract public function getRow();", "abstract public function getRow();", "abstract public function import(): bool;", "abstract public function datatables();", "public function loadRow($rowData)\n\t{\n\t\t\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function prepareImportContent();", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function addTableRow($data, $font_color = '808080') {\n\n $styleArray = array(\n 'font' => array(\n 'color' => array('rgb' => $font_color),\n ),\n );\n $this->xls->getActiveSheet()->getStyle($this->row)->applyFromArray($styleArray);\n\n\t\t$offset = $this->tableParams['offset'];\n\n\t\tforeach ($data as $d) {\n if( strpos($d, '.png') === false ){\n if (in_array($offset, $this->columnasTiposNumericos)) {\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d, PHPExcel_Cell_DataType::TYPE_NUMERIC);\n }\n else {\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d);\n }\n } else{\n if( !$this->addImage( $d, PHPExcel_Cell::stringFromColumnIndex( $offset ), $this->row ) ){\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, 'NO IMAGE');\n }\n }\n //$this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d);\n\t\t}\n\t\t$this->row++;\n\t\t$this->tableParams['row_count']++;\n\t}", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "public function prepareImport();", "public function readFromRow( $row );", "public function loadDataFromRow(array $data)\r\n\t{\r\n\t\t// Heredo de parent\r\n\t\tparent::loadDataFromRow($data);\r\n\r\n\t\t// Extiendo su funcionalidad\r\n\t\t$this->setInterest($this->fkinterest);\r\n\t}", "public function importInterface(){\n return view('/drugAdministration/drugs/importExcelDrugs');\n }", "public function cells();", "function theme_helper_import_field_table($form) {\n $header = $form['#node_import-columns'];\n $rows = array();\n $groups = array();\n\n foreach (element_children($form) as $child) {\n if (!isset($form[$child]['#type']) || $form[$child]['#type'] != 'value') {\n $title = check_plain($form[$child]['#title']);\n $description = $form[$child]['#description'];\n $group = isset($form[$child]['#node_import-group']) ? $form[$child]['#node_import-group'] : '';\n unset($form[$child]['#title']);\n unset($form[$child]['#description']);\n\n if (!isset($groups[$group])) {\n $groups[$group] = array();\n }\n\n $groups[$group][] = array(\n check_plain($title) . '<div class=\"description\">'. $description .'</div>',\n drupal_render($form[$child]),\n );\n }\n }\n\n if (isset($groups['']) && !empty($groups[''])) {\n $rows = array_merge($rows, $groups['']);\n }\n\n foreach ($groups as $group => $items) {\n if ($group !== '' && !empty($items)) {\n $rows[] = array(\n array('data' => $group, 'colspan' => 2, 'class' => 'region'),\n );\n $rows = array_merge($rows, $items);\n }\n }\n\n if (empty($rows)) {\n $rows[] = array(array('data' => $form['#node_import-empty'], 'colspan' => 2));\n }\n\n return theme('table', $header, $rows) . drupal_render($form);\n}", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function getRow();", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "public function import(Cms_Db_Table_Row_Abstract $entry)\n {\n $this->_isVirgin = false;\n\n foreach ($entry as $key => $value) {\n $this->_fields[$key] = $value;\n }\n\n return $this;\n }", "protected function importStaticData($tableData = []){\n $rowIDs = [];\n $addedCount = 0;\n $updatedCount = 0;\n $deletedCount = 0;\n\n $tableModifier = static::getTableModifier();\n $fields = $tableModifier->getCols();\n\n foreach($tableData as $rowData){\n // search for existing record and update columns\n $this->getById($rowData['id'], 0);\n if($this->dry()){\n $addedCount++;\n }else{\n $updatedCount++;\n }\n $this->copyfrom($rowData, $fields);\n $this->save();\n $rowIDs[] = $this->id;\n $this->reset();\n }\n\n // remove old data\n $oldRows = $this->find('id NOT IN (' . implode(',', $rowIDs) . ')');\n if($oldRows){\n foreach($oldRows as $oldRow){\n $oldRow->erase();\n $deletedCount++;\n }\n }\n return ['added' => $addedCount, 'updated' => $updatedCount, 'deleted' => $deletedCount];\n }", "public abstract function export_table_data(xmldb_table $table, $data);", "abstract protected function mapData($data, $tableObject);", "private function get_imported_rows() {\n\t\treturn $this->imported_rows;\n\t}", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function get_row();", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function import(FieldInstance $instance, array $values = NULL);", "public function importExcel($path);", "private function populateDummyTable() {}", "protected static function loadSingleExtTablesFiles() {}", "public function addTableRow($data, $params = array()) {\n if( !empty($this->_tableParams['offset']) ) {\n $offset = $this->_tableParams['offset'];\n } else {\n $offset = 0;\n }\n\n foreach ($data as $d) {\n\n if( is_array($d) ) {\n $text = isset($d['text'])?$d['text']:null;\n $options = !empty($d['options'])?$d['options']:null;\n } else {\n $text = $d;\n $options = null;\n }\n\n\n if( !empty($options) ) {\n $type = !empty($options['type'])?$options['type']:PHPExcel_Cell_DataType::TYPE_STRING;\n $align = !empty($options['align'])?$options['align']:PHPExcel_Style_Alignment::HORIZONTAL_LEFT;\n $colspan = !empty($options['colspan'])?$options['colspan']:null;\n\n switch ($type) {\n case 'string':\n $type = PHPExcel_Cell_DataType::TYPE_STRING;\n break;\n case 'number':\n $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;\n break;\n }\n\n switch ($align) {\n case 'center':\n $align = PHPExcel_Style_Alignment::HORIZONTAL_CENTER;\n break;\n case 'right':\n $align = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;\n break;\n }\n\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal($align);\n $this->_xls->getActiveSheet()->getCellByColumnAndRow($offset, $this->_row)->setValueExplicit($text, $type);\n\n if( !empty($options['bold']) ) {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setBold(true);\n }\n if( !empty($colspan) ) {\n $default = 1+$offset;\n $dimensi = $default+($colspan-1); // Acii A\n $row = $this->_row;\n\n $default = Common::getNameFromNumber($default);\n $cell_end = Common::getNameFromNumber($dimensi);\n\n // if( $text == 'OPENING BALANCE' ) {\n // debug(__('%s%s:%s%s', $default, $row, $cell_end, $row));die();\n // }\n\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $cell_end, $row));\n \n $offset += $colspan-1;\n }\n } else {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($offset, $this->_row, $text);\n }\n \n // if (isset($params['horizontal'])) {\n // $this->_xls->getActiveSheet()->getCellByColumnAndRow($this->_row, $offset)->getStyle()->getAlignment()->setHorizontal($params['horizontal']);\n // }\n\n $offset++;\n }\n\n if( !empty($this->_tableParams['row_count']) ) {\n $row_count = $this->_tableParams['row_count'];\n } else {\n $row_count = 0;\n }\n\n $this->_row++;\n $this->_tableParams['row_count'] = $row_count+1;\n\n return $this;\n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function import(\\Networkteam\\Import\\DataProvider\\DataProviderInterface $dataProvider): ImportResult;", "abstract protected function getRow($row);", "public function laratablesRowData()\n\t\t{\n\t\t\t// Storage::download('coapath/' . $this->coa_name);\n\t\t//\tdd(Storage::disk('s3'));\n\t\t\treturn ['coa_path' =>'https://s3-us-west-1.amazonaws.com/'.$this->coa_name];\n/*\n\t\treturn [\n\t\t\t\t'coa_path' => Storage::disk('s3')\n\t\t\t];*/\n\t\t}", "public function importSource()\n {\n $this->setData('entity', $this->getDataSourceModel()->getEntityTypeCode());\n $this->setData('behavior', $this->getDataSourceModel()->getBehavior());\n\n $this->addLogComment(__('Begin import of \"%1\" with \"%2\" behavior', $this->getEntity(), $this->getBehavior()));\n\n $result = $this->processImport();\n\n if ($result) {\n $this->addLogComment(\n [\n __(\n 'Checked rows: %1, checked entities: %2, invalid rows: %3, skipped rows: %4 total errors: %5',\n $this->getProcessedRowsCount(),\n $this->getProcessedEntitiesCount(),\n $this->getErrorAggregator()->getInvalidRowsCount(),\n $this->getErrorAggregator()->getSkippedRowsCount(),\n $this->getErrorAggregator()->getErrorsCount()\n ),\n __('The import was successful.'),\n ]\n );\n } else {\n throw new LocalizedException(__('Can not import data.'));\n }\n\n return $result;\n }", "protected abstract function loadModel($data, $entry);", "public function getCustomTableData()\n {\n $connection = $this->resourceConnection->getConnection();\n $select = $connection->select();\n $select->from(self::TABLE_NAME, ['table_id', 'name', 'content']);\n $result = $connection->fetchAll($select);\n\n return $result;\n }", "protected function _importData()\n {\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->deleteEntity();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->replaceEntity();\n } elseif (Import::BEHAVIOR_APPEND == $this->getBehavior()) {\n $this->saveEntity();\n }\n\n return true;\n }", "public function importInterface(){\n return view('/drugAdministration/companies/importExcel');\n }", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "private function _readSubTableData() {}", "public function getOriginalTable() {}", "private function row_imported( $row, $action = '' ) {\n\t\t$this->imported_rows[] = $row + 1;\n\t\tif ( $action && is_scalar( $action ) ) {\n\t\t\tif ( ! isset( $this->actions[ $action ] ) ) {\n\t\t\t\t$this->actions[ $action ] = 0;\n\t\t\t}\n\t\t\t$this->actions[ $action ]++;\n\t\t}\n\t}", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "protected function tableModel()\n {\n }", "public function csvData()\n {\n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "public function importData($data)\n\t{\n\t\tif($data instanceof stdClass){\n\t\t\t$data = Mage::helper('wmgcybersource')->stdClassToArray($data);\n\t\t}\n\t\t$data = Mage::helper('wmgcybersource')->varienObjectise($data);\n\t\t$this->setData($data);\n\t\treturn $this;\n\t}", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "public function __invoke(): LoadsTables;", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function getDataColTemplate(): DataColTemplate;", "protected function initCSV() {}", "public function getImported();", "function DataRow($data = array())\r\n\t{\r\n\t\t$this->Data = $data;\r\n\t}", "function _updateSiteImportTable()\n\t{\n\t\t\n\t\t$_templateFields = weSiteImport::_getFieldsFromTemplate($_REQUEST[\"tid\"]);\n\t\t$hasDateFields = false;\n\t\t\n\t\t$values = array();\n\t\t\n\t\tforeach ($_templateFields as $name => $type) {\n\t\t\tif ($type == \"date\") {\n\t\t\t\t$hasDateFields = true;\n\t\t\t}\n\t\t\tswitch ($name) {\n\t\t\t\tcase \"Title\" :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => \"<title>\", \"post\" => \"</title>\"\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Keywords\" :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => '<meta name=\"keywords\" content=\"', \"post\" => '\">'\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Description\" :\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$values, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"name\" => $name, \n\t\t\t\t\t\t\t\t\t\"pre\" => '<meta name=\"description\" content=\"', \n\t\t\t\t\t\t\t\t\t\"post\" => '\">'\n\t\t\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"Charset\" :\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$values, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"name\" => $name, \n\t\t\t\t\t\t\t\t\t\"pre\" => '<meta http-equiv=\"content-type\" content=\"text/html;charset=', \n\t\t\t\t\t\t\t\t\t\"post\" => '\">'\n\t\t\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault :\n\t\t\t\t\tarray_push($values, array(\n\t\t\t\t\t\t\"name\" => $name, \"pre\" => \"\", \"post\" => \"\"\n\t\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$js = 'var tableDivObj = parent.document.getElementById(\"tablediv\");\n\t\ttableDivObj.innerHTML = \"' . str_replace(\n\t\t\t\t\"\\r\", \n\t\t\t\t\"\\\\r\", \n\t\t\t\tstr_replace(\"\\n\", \"\\\\n\", addslashes($this->_getSiteImportTableHTML($_templateFields, $values)))) . '\"\n\t\tparent.document.getElementById(\"dateFormatDiv\").style.display=\"' . ($hasDateFields ? \"block\" : \"none\") . '\";\n';\n\t\t\n\t\t$js = we_htmlElement::jsElement($js) . \"\\n\";\n\t\treturn $this->_getHtmlPage(\"\", $js);\n\t}", "protected function migrateLegacyImportRecords() {}", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "function __construct($row = null) {\n $this->_data = array();\n $this->_extra = array();\n if (!isset(self::$_defaults[$this->getObjectName()])) {\n // maintain the default data (column values) separately\n self::$_defaults[$this->getObjectName()] = array();\n $this->loadDefaults();\n }\n\n // clone from the default data. much faster than reloading the column values every time\n $def =& self::$_defaults[$this->getObjectName()];\n foreach ($def as $k => &$d) {\n $this->_data[$k] = clone $d;\n }\n\n if (is_array($row)) {\n $this->loadFromRow($row);\n } else if (is_int($row)) {\n $this->setValue('id', $row);\n }\n }", "abstract protected function excel ();" ]
[ "0.63299626", "0.61143297", "0.59934694", "0.5877443", "0.5824782", "0.5746604", "0.5714457", "0.56619513", "0.5623657", "0.55938387", "0.5514292", "0.5461218", "0.54609424", "0.5445703", "0.5427322", "0.5414182", "0.5407063", "0.53669685", "0.5324979", "0.5308429", "0.52842814", "0.5277638", "0.5276978", "0.5255759", "0.5249109", "0.5232527", "0.52306104", "0.5209763", "0.5207825", "0.52037275", "0.51757073", "0.51534534", "0.5148986", "0.51454794", "0.5101484", "0.5097459", "0.5097459", "0.5097251", "0.50861365", "0.50772077", "0.5067412", "0.5064616", "0.50645214", "0.5057928", "0.50450706", "0.5035821", "0.50220937", "0.5018767", "0.50014967", "0.4998723", "0.49961448", "0.4988558", "0.4988272", "0.49819276", "0.49809122", "0.49740165", "0.49653777", "0.4962166", "0.49616316", "0.49615276", "0.49552286", "0.49545068", "0.49503425", "0.49470824", "0.49467453", "0.49253243", "0.49204263", "0.48947948", "0.48887444", "0.4887103", "0.48775515", "0.48722172", "0.48683137", "0.4868156", "0.48658064", "0.48527908", "0.48474875", "0.48314062", "0.48255917", "0.48249033", "0.48176515", "0.48141706", "0.48135376", "0.4813356", "0.48110482", "0.4804728", "0.48041227", "0.48034963", "0.47926456", "0.47806087", "0.47771862", "0.47665754", "0.47620517", "0.47553322", "0.4749217", "0.47397026", "0.47390378", "0.47388107", "0.47361416", "0.47337028", "0.47310674" ]
0.0
-1
Method for importing a checkbox data cell.
protected function process_data_checkbox(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t?>\n\t<div class=\"wpinc-meta-field-single checkbox\">\n\t\t<label>\n\t\t\t<span class=\"checkbox\"><input <?php name_id( $key ); ?> type=\"checkbox\" <?php echo esc_attr( $checked ? 'checked' : '' ); ?>></span>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t</label>\n\t</div>\n\t<?php\n}", "function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\t\t\\wpinc\\meta\\output_checkbox_row( $label, $key, $checked );\n\t}", "protected function process_header_checkbox(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "public static function convert_checkbox_field() {\n\n\t\t// Create a new Checkbox field.\n\t\tself::$field = new GF_Field_Checkbox();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array();\n\n\t\t// Loop through field options.\n\t\tforeach ( self::$nf_field['list']['options'] as $i => $option ) {\n\n\t\t\t// Get checkbox ID.\n\t\t\t$id = $i + 1;\n\n\t\t\t// Skip multiple of 10 on checkbox ID.\n\t\t\tif ( 0 === $id % 10 ) {\n\t\t\t\t$id++;\n\t\t\t}\n\n\t\t\t// Add option choices.\n\t\t\tself::$field->choices[] = array(\n\t\t\t\t'text' => $option['label'],\n\t\t\t\t'value' => $option['value'],\n\t\t\t\t'isSelected' => $option['selected'],\n\t\t\t);\n\n\t\t\t// Add option input.\n\t\t\tself::$field->inputs[] = array(\n\t\t\t\t'id' => self::$field->id . '.' . $id,\n\t\t\t\t'label' => $option['label'],\n\t\t\t);\n\n\t\t}\n\n\t}", "public static function renderCheckbox();", "public function getDataCellContent($row)\n\t{\n\t\t$data=$this->grid->dataProvider->data[$row];\n\t\tif($this->value!==null)\n\t\t\t$value=$this->evaluateExpression($this->value,array('data'=>$data,'row'=>$row));\n\t\telseif($this->name!==null)\n\t\t\t$value=CHtml::value($data,$this->name);\n\t\telse\n\t\t\t$value=$this->grid->dataProvider->keys[$row];\n\n\t\t$checked = false;\n\t\tif($this->checked!==null)\n\t\t\t$checked=$this->evaluateExpression($this->checked,array('data'=>$data,'row'=>$row));\n\n\t\t$options=$this->checkBoxHtmlOptions;\n\t\tif($this->disabled!==null)\n\t\t\t$options['disabled']=$this->evaluateExpression($this->disabled,array('data'=>$data,'row'=>$row));\n\n\t\t$name=$options['name'];\n\t\tunset($options['name']);\n\t\t$options['value']=$value;\n\t\t$options['id']=$this->id.'_'.$row;\n\t\treturn CHtml::checkBox($name,$checked,$options);\n\t}", "abstract public function checkboxOnClick();", "public static function convert_single_checkbox_field() {\n\n\t\t// Create a new Checkbox field.\n\t\tself::$field = new GF_Field_Checkbox();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array(\n\t\t\tarray(\n\t\t\t\t'text' => self::$nf_field['label'],\n\t\t\t\t'value' => '',\n\t\t\t\t'isSelected' => 'unchecked' === self::$nf_field['default_value'] ? '0' : '1',\n\t\t\t),\n\t\t);\n\n\t}", "public function getColumnCheckboxHtml() : string\n {\n return '<label class=\"kt-checkbox kt-checkbox--single kt-checkbox--all kt-checkbox--solid\">\n <input type=\"checkbox\" class=\"selected_data\" name=\"selected_data[]\" value=\"{{ $id }}\">\n <span></span>\n </label>';\n }", "function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }", "public function convertCheckboxesToBool()\n\t{\n\t\t$this->convertCheckboxesToBool = true;\n\t}", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function init()\n\t{\n\t\tif(isset($this->checkBoxHtmlOptions['name']))\n\t\t\t$name=$this->checkBoxHtmlOptions['name'];\n\t\telse\n\t\t{\n\t\t\t$name=$this->id;\n\t\t\tif(substr($name,-2)!=='[]')\n\t\t\t\t$name.='[]';\n\t\t\t$this->checkBoxHtmlOptions['name']=$name;\n\t\t}\n\t\t$name=strtr($name,array('['=>\"\\\\[\",']'=>\"\\\\]\"));\n\n\t\tif($this->selectableRows===null)\n\t\t{\n\t\t\tif(isset($this->checkBoxHtmlOptions['class']))\n\t\t\t\t$this->checkBoxHtmlOptions['class'].=' select-on-check';\n\t\t\telse\n\t\t\t\t$this->checkBoxHtmlOptions['class']='select-on-check';\n\t\t\treturn;\n\t\t}\n\n\t\t$cball=$cbcode='';\n\t\tif($this->selectableRows==0)\n\t\t{\n\t\t\t//.. read only\n\t\t\t$cbcode=\"return false;\";\n\t\t}\n\t\telseif($this->selectableRows==1)\n\t\t{\n\t\t\t//.. only one can be checked, uncheck all other\n\t\t\t$cbcode=\"jQuery(\\\"input:not(#\\\"+this.id+\\\")[name='$name']\\\").prop('checked',false);\";\n\t\t}\n\t\telseif(strpos($this->headerTemplate,'{item}')!==false)\n\t\t{\n\t\t\t//.. process check/uncheck all\n\t\t\t$cball=<<<CBALL\njQuery(document).on('click','#{$this->id}_all',function() {\n\tvar checked=this.checked;\n\tjQuery(\"input[name='$name']:enabled\").each(function() {this.checked=checked;});\n});\n\nCBALL;\n\t\t\t$cbcode=\"jQuery('#{$this->id}_all').prop('checked', jQuery(\\\"input[name='$name']\\\").length==jQuery(\\\"input[name='$name']:checked\\\").length);\";\n\t\t}\n\n\t\tif($cbcode!=='')\n\t\t{\n\t\t\t$js=$cball;\n\t\t\t$js.=<<<EOD\njQuery(document).on('click', \"input[name='$name']\", function() {\n\t$cbcode\n});\nEOD;\n\t\t\tYii::app()->getClientScript()->registerScript(__CLASS__.'#'.$this->id,$js);\n\t\t}\n\t}", "function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }", "function acf_get_checkbox_input($attrs = array())\n{\n}", "function column_cb( $item ) {\r\n\t\treturn sprintf( '<input type=\"checkbox\" id=\"cb-select-%2$s\" name=\"cb_%1$s[]\" value=\"%2$s\" />',\r\n\t\t/*%1$s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label (\"attachment\")\r\n\t\t/*%2$s*/ $item->ID //The value of the checkbox should be the object's id\r\n\t\t);\r\n\t}", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "function checkbox ($params) {\n\t\tif (!$params['id']) $params['id'] = $params['name'];\n if (!$params['y_value']) $params['y_value'] = 1;\n if (!$params['n_value']) $params['n_value'] = 0;\n?>\n\t\t<input type=\"hidden\" name=\"<?=$params['name']?>\" value=\"<?=$params['n_value']?>\" />\n\t\t<input\n\t\t\ttype=\"checkbox\" \n\t\t\tname=\"<?=$params['name']?>\" \n\t\t\tvalue=\"<?=$params['y_value']?>\"\n\t\t\tid=\"<?=$params['id']?>\" \n\t\t\tonclick=\"<?=$params['onclick']?>\"\n\t\t\t<? if ($params['checked']) echo 'checked=\"checked\"'; ?> \n\t\t\t<? if ($params['disabled']) echo 'disabled=\"disabled\"'; ?> \n\t\t\tstyle=\"display:inline;\"\n\t\t/>\n\t\t<label for=\"<?=$params['id']?>\" class=\"checkbox-label\"><?=$params['label']?></label>\n\t\t\n<?\n\t}", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}", "function setTypeAsCheckbox($labeltext = false)\n\t{\n\t\t$this->type = \"checkbox\";\n\t\t$this->checkbox_label = $labeltext;\n\t\t\n\t\t// Formfield doesn't work if a checkbox\n\t\t$this->isformfield = false;\n\t}", "function checkbox( \n\t $name, $title, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_CHECKBOX,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "function column_cb($item){\n return sprintf(\n '<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" />',\n /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label (\"listing\")\n /*$2%s*/ $item['id'] \t\t\t//The value of the checkbox should be the record's id\n );\n }", "public function AddCheckboxToComment()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'comment_checked');\n\t\t?>\n\t\t<p>\n\t\t\t<input class=\"GR_checkbox\" value=\"1\" id=\"gr_comment_checkbox\" type=\"checkbox\" name=\"gr_comment_checkbox\"\n\t\t\t\t <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?>/>\n\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'comment_label'); ?>\n\t\t</p><br/>\n\t\t<?php\n\t}", "function deleteData()\n{\n global $myDataGrid;\n global $f;\n global $tbl;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n if ($tbl->deleteMultiple($arrKeys)) {\n $myDataGrid->message = $tbl->strMessage;\n $f->setValues('step', getDataListRecruitmentProcessTypeStep(null, true));\n } else {\n $myDataGrid->errorMessage = \"Failed to delete data \" . $tbl->strEntityName;\n }\n}", "function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }", "function column_cb($item){\n return sprintf(\n '<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" />',\n /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label (\"movie\")\n /*$2%s*/ $item['ID'] //The value of the checkbox should be the record's id\n );\n }", "function setTypeAsCheckboxList($itemList) {\n\t\t$this->type = \"checkboxlist\";\n\t\t$this->seleu_itemlist = $itemList;\n\t}", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function import(array $data, bool $check_keys = FALSE) {\n\t\tforeach ($this->imp_array($data, TRUE, $check_keys) as $k => $v) {\n\t\t\t$this->__exportable_set($k, $v);\n\t\t}\n\t}", "function column_cb($item)\n {\n return sprintf(\n '<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" />',\n /*$1%s*/\n $this->_args['singular'], //Let's simply repurpose the table's singular label\n /*$2%s*/\n $item['id'] //The value of the checkbox should be the record's id\n );\n }", "function importar(&$datos)\n {\n $this->_datos &= $datos;\n }", "public function checkbox($element) {\n $element['#type'] = 'checkbox';\n $element = $this->_setRender($element);\n $element['_render']['element'] = '<input type=\"checkbox\"';\n foreach (array('id', 'name') as $key) {\n $element['_render']['element'] .= sprintf(' %s=\"%s\"', $key, $element['#' . $key]);\n }\n /**\n * type and data_id\n */\n $element['_render']['element'] .= sprintf(' data-wpt-type=\"%s\"', __FUNCTION__);\n $element['_render']['element'] .= $this->_getDataWptId($element);\n\n $element['_render']['element'] .= ' value=\"';\n /**\n * Specific: if value is empty force 1 to be rendered\n * but if is defined default value, use default\n */\n $value = 1;\n if (array_key_exists('#default_value', $element)) {\n $value = $element['#default_value'];\n }\n $element['_render']['element'] .= ( empty($element['#value']) && !preg_match('/^0$/', $element['#value']) ) ? $value : esc_attr($element['#value']);\n $element['_render']['element'] .= '\"' . $element['_attributes_string'];\n if (\n (\n !$this->isSubmitted() && (\n (!empty($element['#default_value']) && $element['#default_value'] == $element['#value'] ) || ( isset($element['#checked']) && $element['#checked'] )\n )\n ) || ($this->isSubmitted() && !empty($element['#value']))\n ) {\n $element['_render']['element'] .= ' checked=\"checked\"';\n }\n if (!empty($element['#attributes']['disabled']) || !empty($element['#disable'])) {\n $element['_render']['element'] .= ' onclick=\"javascript:return false; if(this.checked == 1){this.checked=1; return true;}else{this.checked=0; return false;}\"';\n }\n $element['_render']['element'] .= ' />';\n\n $pattern = $this->_getStatndardPatern($element, '<BEFORE><PREFIX><ELEMENT>&nbsp;<LABEL><ERROR><SUFFIX><DESCRIPTION><AFTER>');\n $output = $this->_pattern($pattern, $element);\n $output = $this->_wrapElement($element, $output);\n return $output . \"\\r\\n\";\n }", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "public function convertirCheckBox($param='') {\n if($param == \"on\" || $param == 1) {\n $param = \"S\";\n } else {\n $param = \"N\";\n }\n return $param;\n }", "function ShowInCheckBox( $Table, $name_fld, $cols, $val, $position = \"left\", $disabled = NULL, $sort_name = 'move', $asc_desc = 'asc', $show_sublevels=0, $level=NULL,$alternativeFieldLevel = '' )\n {\n //$Tbl = new html_table(1);\n\n $row1 = NULL;\n if (empty($name_fld)) $name_fld=$Table;\n\n $tmp_db = DBs::getInstance();\n $q = \"SELECT * FROM `\".$Table.\"` WHERE 1 LIMIT 1\";\n $res = $tmp_db->db_Query($q);\n// echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res ) return false;\n if ( !$tmp_db->result ) return false;\n $fields_col = mysql_num_fields($tmp_db->result);\n\n $q = \"SELECT * FROM `\".$Table.\"` WHERE `lang_id`='\"._LANG_ID.\"'\";\n //echo '<br>$level='.$level;\n if(empty($alternativeFieldLevel)){\n if( $tmp_db->IsFieldExist($Table, 'level') ) $q = $q.\" AND `level`='\".$level.\"'\";\n }else{ $q .= \" AND `\".$alternativeFieldLevel.\"`='\".$level.\"' \";}\n if ($fields_col>4) $q = $q.\" ORDER BY `$sort_name` $asc_desc\";\n// echo '<br>$q='.$q;\n\n $res = $tmp_db->db_Query($q);\n if (!$res) return false;\n $rows = $tmp_db->db_GetNumRows();\n $arr_data = array();\n for( $i = 0; $i < $rows; $i++ )\n {\n $row000 = $tmp_db->db_FetchAssoc();\n $arr_data[$i] = $row000;\n }\n\n $col_check=1;\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" align=\"left\" class=\"checkbox_tbl\">\n <tr>\n <?\n for( $i = 0; $i < $rows; $i++ )\n {\n $row1 = $arr_data[$i];\n if ($col_check > $cols) {\n ?></tr><tr><?\n $col_check=1;\n }\n\n $checked ='>';\n if (is_array($val)) {\n if (isset($val))\n foreach($val as $k=>$v)\n {\n if (isset($k) and ($v==$row1['cod'])) $checked = \" checked\".$checked;\n //echo '<br>$k='.$k.' $v='.$v.' $row1[cod]='.$row1['cod'];\n }\n }\n if ( $position == \"left\" ) $align= 'left';\n else $align= 'right';\n ?><td align=\"<?=$align?>\" valign=\"top\" class=\"checkbox\"><?\n\n if ( $position == \"left\" ) {\n //echo \"<table border='0' cellpadding='1' cellspacing='0'><tr><td><input class='checkbox' type='checkbox' name='\".$name_fld.\"[]' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked.'</td><td>'.stripslashes($row1['name']).'</td></tr></table>';\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td valign=\"top\"><input class=\"checkbox\" type=\"checkbox\" name=\"<?=$name_fld;?>[]\" value=\"<?=$row1['cod'];?>\" <?=$disabled;?> <?=$checked;?> </td>\n <td class=\"checkbox_td\"><?=stripslashes($row1['name']);?></td>\n </tr>\n </table>\n <?\n }\n else {\n //echo stripslashes($row1['name']).\"<input class='checkbox' type='checkbox' name='\".$name_fld.\"[]' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked;\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td valign=\"top\">\n <td class=\"checkbox_td\"><?=stripslashes($row1['name']);?></td>\n <td><input class=\"checkbox\" type=\"checkbox\" name=\"<?=$name_fld;?>[]\" value=\"<?=$row1['cod'];?>\" <?=$disabled;?> <?=$checked;?> </td>\n </tr>\n </table>\n <?\n }\n\n\n //======= show sublevels START ===========\n if( $show_sublevels==1){\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td style=\"padding:0px 0px 0px 20px;\"><?\n $this->ShowInCheckBox( $Table, $name_fld, 1, $val, $position, $disabled, $sort_name, $asc_desc, $show_sublevels, $row1['cod']);\n ?>\n </td>\n </tr>\n </table>\n <?\n }\n //======= show sublevels END ===========\n ?></td><?\n $col_check++;\n }\n ?>\n </tr>\n </table>\n <?\n }", "function surgeon_add_checkbox_heading_fields($post, $addon, $loop) {\n echo '<th class=\"checkbox_column\"><span class=\"column-title\">Image</span></th>';\n}", "function column_cb( $item )\r\n {\r\n return sprintf(\r\n '<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" />',\r\n $this->_args['singular'], // Let's simply repurpose the table's singular label (\"modal\").\r\n $item['ID'] // The value of the checkbox should be the record's ID.\r\n );\r\n }", "function option_checkbox($label, $name, $value='', $comment='') {\r\n\t\tif ($value)\r\n\t\t\t$checked = \"checked='checked'\";\r\n\t\telse\r\n\t\t\t$checked = \"\";\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td><input type='hidden' id='$name' name='$name' value='0' /><input type='checkbox' name='$name' value='1' $checked />\";\r\n\t\techo \" $comment</td></tr>\";\r\n\t}", "public function settings_field_input_checkbox( $args ) {\r\n\t\t\t\t// Get the field name and default value from the $args array.\r\n\t\t\t\t$field = $args['field'];\r\n\t\t\t\t$default = $args['default'];\r\n\t\t\t\t$help_text = $args['help_text'];\r\n\t\t\t\t// Get the value of this setting, using default.\r\n\t\t\t\t$value = get_option( $field, $default );\r\n\t\t\t\t// Get the 'checked' string.\r\n\t\t\t\t$checked = checked( '1', $value, false );\r\n\t\t\t\t//error_log( \"value: $value, field: $field, default: $default, checked: $checked\" );\r\n\t\t\t\t// Echo a proper input type=\"checkbox\".\r\n\t\t\t\techo sprintf(\r\n\t\t\t\t\t'<input type=\"checkbox\" name=\"%s\" id=\"%s\" value=\"%s\" %s /> <span>%s</span>',\r\n\t\t\t\t\tesc_attr( $field ),\r\n\t\t\t\t\tesc_attr( $field ),\r\n\t\t\t\t\t'1',\r\n\t\t\t\t\tesc_attr( $checked ),\r\n\t\t\t\t\tesc_html( $help_text )\r\n\t\t\t\t);\r\n\t\t}", "function xpost_to_friendika_post_field_data($post_id) {\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n return;\n\n // security check\n if (!wp_verify_nonce( $_POST['xpost_to_friendika_nonce'], plugin_basename( __FILE__ )))\n return;\n\n // now store data in custom fields based on checkboxes selected\n if (isset($_POST['xpost_to_friendika'])) {\n\t\tupdate_post_meta($post_id, 'xpost_to_friendika', 1);\n\t} else {\n\t\tupdate_post_meta($post_id, 'xpost_to_friendika', 0);\n\t}\n}", "public function checkbox($item, $id) {\n\n\t\t\t$data['idUSUARIO'] = $id;\n\t\t\t\n\t\t\tfor ($i = 0; $i < count($item); $i++) {\n\t\t\t\t$valor = $item[$i];\t\t\t\t\t\n\t\t\t\t$resposta = explode(\";\", $item[$i]);\n\t\t\t\t$data['idALUNO'] = $resposta[0];\n\t\t\t\t$data['idPERGUNTA'] = $resposta[1];\n\t\t\t\t$data['RESPOSTA'] = $resposta[2];\n\t\t\t\t\n\t\t\t\t$this->db->insert('RESPOSTA', $data);\n\t\t\t}\n\t\t\n\t\t\t\t\n\t\t}", "abstract public function import(): bool;", "function carregaFeatureCheck() {\n $tabela = new TabelaModel(\"feature_check\", \"id_feature_check\");\n $coluna = $this->adicionaColunaNormal($tabela, \"ID feature_check\", \"id_feature_check\", true, TIPO_INPUT_INTEIRO);\n $coluna->setInvisible();\n $coluna = $this->adicionaColunaNormal($tabela, \"Nome do feature_check\", \"nm_feature_check\", false, TIPO_INPUT_TEXTO_CURTO);\n $coluna->setDetalhesInclusao(true, true, null);\n\n\n return $tabela;\n }", "function theme_webform_edit_file($form) {\r\n $javascript = '\r\n <script type=\"text/javascript\">\r\n function check_category_boxes () {\r\n var checkValue = !document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[1]).checked;\r\n for(var i=1; i < arguments.length; i++) {\r\n document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[i]).checked = checkValue;\r\n }\r\n }\r\n </script>\r\n ';\r\n drupal_set_html_head($javascript);\r\n\r\n // Format the components into a table.\r\n $per_row = 5;\r\n $rows = array();\r\n foreach (element_children($form['extra']['filtering']['types']) as $key => $filtergroup) {\r\n $row = array();\r\n $first_row = count($rows);\r\n if ($form['extra']['filtering']['types'][$filtergroup]['#type'] == 'checkboxes') {\r\n // Add the title.\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n $row[] = '&nbsp;';\r\n // Convert the checkboxes into individual form-items.\r\n $checkboxes = expand_checkboxes($form['extra']['filtering']['types'][$filtergroup]);\r\n // Render the checkboxes in two rows.\r\n $checkcount = 0;\r\n $jsboxes = '';\r\n foreach (element_children($checkboxes) as $key) {\r\n $checkbox = $checkboxes[$key];\r\n if ($checkbox['#type'] == 'checkbox') {\r\n $checkcount++;\r\n $jsboxes .= \"'\". $checkbox['#return_value'] .\"',\";\r\n if ($checkcount <= $per_row) {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n elseif ($checkcount == $per_row + 1) {\r\n $rows[] = array('data' => $row, 'style' => 'border-bottom: none;');\r\n $row = array(array('data' => '&nbsp;'), array('data' => '&nbsp;'));\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n else {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n }\r\n }\r\n // Pretty up the table a little bit.\r\n $current_cell = $checkcount % $per_row;\r\n if ($current_cell > 0) {\r\n $colspan = $per_row - $current_cell + 1;\r\n $row[$current_cell + 1]['colspan'] = $colspan;\r\n }\r\n // Add the javascript links.\r\n $jsboxes = drupal_substr($jsboxes, 0, drupal_strlen($jsboxes) - 1);\r\n $rows[] = array('data' => $row);\r\n $select_link = ' <a href=\"javascript:check_category_boxes(\\''. $filtergroup .'\\','. $jsboxes .')\">(select)</a>';\r\n $rows[$first_row]['data'][1] = array('data' => $select_link, 'width' => 40);\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n }\r\n elseif ($filtergroup != 'size') {\r\n // Add other fields to the table (ie. additional extensions).\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n unset($form['extra']['filtering']['types'][$filtergroup]['#title']);\r\n $row[] = array(\r\n 'data' => drupal_render($form['extra']['filtering']['types'][$filtergroup]),\r\n 'colspan' => $per_row + 1,\r\n );\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n $rows[] = array('data' => $row);\r\n }\r\n }\r\n $header = array(array('data' => t('Category'), 'colspan' => '2'), array('data' => t('Types'), 'colspan' => $per_row));\r\n\r\n // Create the table inside the form.\r\n $form['extra']['filtering']['types']['table'] = array(\r\n '#value' => theme('table', $header, $rows)\r\n );\r\n\r\n $output = drupal_render($form);\r\n\r\n // Prefix the upload location field with the default path for webform.\r\n $output = str_replace('Upload Directory: </label>', 'Upload Directory: </label>'. file_directory_path() .'/webform/', $output);\r\n\r\n return $output;\r\n}", "function acf_checkbox_input($attrs = array())\n{\n}", "function display_td_checkbox($prefid, $id, $class = \"\", $gnum = \"\", $lnum = \"\") {\n\techo \"<TD> \";\n\techo \"<SPAN ID=\" . $prefid . \"s_$id>\";\n\techo \"<INPUT TYPE=checkbox ID=\" . $prefid . \"cb_$id\";\n\tif ($class != \"\") {\n\t\techo \" CLASS=\\\"$class\\\"\";\n\t\tif ($gnum != \"\") {\n\t\t\techo \" gnum=$gnum\";\n\t\t\tif ($lnum != \"\") {\n\t\t\t\techo \" lnum=$lnum\";\n\t\t\t}\n\t\t}\n\t}\n\techo \">\";\n\techo \"</SPAN>\";\n}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n print_r($arrKeys);\n die();\n $dataGaVendor = new cGaVendor();\n $dataGaVendor->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataGaVendor->strMessage;\n}", "public function importExcel($path);", "function makeCheckbox( $value, $column )\n{\n\treturn $value ? _( 'Yes' ) : _( 'No' );\n}", "static public function checkbox($name,$opts=[]) {\n $f3 = Base::instance();\n if ($f3->exists('POST.'.$name) && $f3->get('POST.'.$name)) {\n $opts[] = 'checked';\n }\n if (!isset($opts['value'])) $opts['value'] = 1;\n if (!isset($opts['type'])) $opts['type'] = 'checkbox';\n return self::input($name,$opts);\n }", "function column_cb( $item ) {\r\n\t\treturn sprintf(\r\n\t\t\t'<input type=\"checkbox\" name=\"bulk-delete[]\" value=\"%s\" />', $item['id']\r\n\t\t);\r\n\t}", "function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);\n }", "private function checkboxCustomField(): string\n {\n return Template::build($this->getTemplatePath('checkbox.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'checked' => $this->getValue($this->index) ? 'checked' : '',\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "public function AddCheckboxToCheckoutPage()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'checkout_checked');\n\t\t?>\n\t\t<p class=\"form-row form-row-wide\">\n\t\t\t<input class=\"input-checkbox GR_checkoutbox\" value=\"1\" id=\"gr_checkout_checkbox\" type=\"checkbox\"\n\t\t\t name=\"gr_checkout_checkbox\" <?php if ($checked)\n\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t<label for=\"gr_checkout_checkbox\" class=\"checkbox\">\n\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'checkout_label'); ?>\n\t\t\t</label>\n\t\t</p>\n\t\t<?php\n\t}", "public static function getType() {\n\t\treturn \"Checkbox\";\n\t}", "public function addCheckboxFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\CheckboxFilter());\n\t\treturn $this->getFilter();\n\t}", "function CheckBoxList($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "function column_cb($item) {\n return sprintf('<input type=\"checkbox\" name=\"template[]\" value=\"%s\" />', $item->template_id);\n }", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function callback_checkbox( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n\n $html_condtions = '';\n\n if ( isset($args['conditions']) && $args['conditions'] === true ) {\n $name_id .= '[value]';\n $value = isset($value['value']) ? $value['value'] : 'off';\n $args['name_id'] .= '[options]';\n $html_condtions = $this->get_field_conditions_modal( $args );\n }\n\n $html = '<fieldset>';\n $html .= sprintf( '<label for=\"wpuf-%1$s\">', $name_id );\n $html .= sprintf( '<input type=\"hidden\" name=\"%1$s\" value=\"off\" />', $name_id );\n $html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"wpuf-%1$s\" name=\"%1$s\" value=\"on\" %2$s %3$s/>', $name_id, checked( $value, 'on', false ), $disable );\n $html .= sprintf( '%1$s</label>', $args['desc'] );\n $html .= $html_condtions;\n $html .= '</fieldset>';\n\n echo $html;\n }", "function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }", "function CheckBoxFile($caption, $class)\n\t{\n\t\tinclude_once('file.php');\n\t\t$structure = '<br /><form method=\"post\" action=\"../' . $class . '.php\">';\n\t\t$directory = \"../articles\";\n\t\t// Open the dir and read the file inside\n\t\t\t// Open the directory\n\t\t\tif ($directory_handle = opendir($directory)) {\n\t\t\t\t // Control all the contents\n\t\t\t\t while (($file = readdir($directory_handle)) !== false) {\n\t\t\t\t // If the element is not egual to directory od . or .. fill the variable\n\t\t\t\t if((!is_dir($file))&($file!=\".\")&($file!=\"..\")){\n\t\t\t\t\t\t\t\t$title = readLine('../parameters/id_articles', $file);\n\t\t\t\t\t\t\t\t$structure = $structure . '<input type=\"checkbox\" name=\"myCheck[' . $file . ']\" value=\"' . $file . '\" /> ' . $title . '<br />';\n\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t \tclosedir($directory_handle);\n\t\t\t\t}\n\t\t$structure = $structure . '<br /><input type=\"submit\" value=\"' . $caption . '\" /></form>';\n\t\treturn $structure;\n\t}", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "function testGuessCheckbox() {\n\t\t$result = $this->helper->__guessInputType('Test.is_foo');\n\t\t$this->assertEqual($result, 'checkbox');\n\t}", "public function editSeedCheckboxs(){\n\t\t//tag ids for specific seed\n\t\t$seedName = $_POST['seedName'];\n\t\t$sql2 = \n\t\t\t\"SELECT tag.tag_id\n\t\t\tFROM seed\n\t\t\tINNER JOIN seedtag ON seed.seed_id = seedtag.seed_id\n\t\t\tINNER JOIN tag ON seedtag.tag_id = tag.tag_id\n\t\t\tWHERE seed.name= :seedName\";\n\t\t$stmt2 = $this->databaseConnection->dbConnection->prepare($sql2);\n\t\t$stmt2->bindParam(':seedName', $seedName);\n\t\t$stmt2->execute();\n\t\t$tagsForSeed = [];\n\t\twhile($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)){\n\t\t\tarray_push($tagsForSeed, $row2['tag_id']);\n\t\t}\n\n\t\t//for every tag for this type\n\t\t//if the tag is attached to the specific seed, checked\n\t\t//if the tag is not attached to the specific seed, no checked\n\t\t$seedType = $_POST['seedType'];\n\t\t$sql = \n\t\t\t\"SELECT type.type_name, tag.tag_name, tag.tag_id\n\t\t\tFROM type\n\t\t\tINNER JOIN typetag ON type.type_id = typetag.type_id\n\t\t\tINNER JOIN tag ON typetag.tag_id = tag.tag_id\n\t\t\tWHERE type.type_name= :seedType\n\t\t\tORDER BY tag.tag_name\";\n\t\t$stmt = $this->databaseConnection->dbConnection->prepare($sql);\n\t\t$stmt->bindParam(':seedType', $seedType);\n\t\t$stmt->execute();\n\t\t$tagsForType = [];\n\t\t$listOfCheckboxes = \"\";\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t$tagID = $row['tag_id'];\n\t\t\t$tagName = $row['tag_name'];\n\t\t\tif(in_array($tagID, $tagsForSeed)){\n\t\t\t\t//checked\n\t\t\t\t$listOfCheckboxes = $listOfCheckboxes . '<input type=\"checkbox\" name=\"typeTag\" id=\"' . $tagName . \"-\" . $tagID . '\" checked>' . $tagName . '<br>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//unchecked\n\t\t\t\t$listOfCheckboxes = $listOfCheckboxes . '<input type=\"checkbox\" name=\"typeTag\" id=\"' . $tagName . \"-\" . $tagID . '\">' . $tagName . '<br>';\n\t\t\t}\n\t\t}\n\t\techo $listOfCheckboxes;\n\t}", "function import(array $data);", "public function checkbox($options = [], $enclosedByLabel = null)\n {\n return $this->getToggleField(self::TYPE_CHECKBOX, $options, $enclosedByLabel);\n }", "function add_checkbox_hidden_field( $fields, $section ) {\n $fields['general'][] = [\n 'default' => 'save_email_enable_or_disable',\n 'type' => 'hidden',\n 'id' => 'save_email_enable_or_disable',\n\n ];\n return $fields;\n}", "public function importFrom(array $data);", "function checkbox ($arguments = \"\") {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tcheckbox');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "function callback_checkbox(array $args)\n {\n }", "function column_cb( $item ) {\n\t\treturn sprintf(\n\t\t\t'<input type=\"checkbox\" name=\"bulk-delete[]\" value=\"%s\" />', $item['ID']\n\t\t);\n\t}", "public function run(): string\n {\n return BooleanInput::widget()\n ->type('checkbox')\n ->id($this->id)\n ->charset($this->charset)\n ->config($this->data, $this->attribute, $this->options)\n ->enclosedByLabel($this->enclosedByLabel)\n ->uncheck($this->uncheck)\n ->run();\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "function getCheckBoxBySql( $name, $sql, $clickScript = \"\", $checkboxArr=array(), $expextArr = array() )\n{\n global $GLOBAL;\n\n $row = $GLOBAL['G_DB_OBJ']->executeSqlMap($sql);\n //print_r( $sql );\n //print_r( $row );\n $i=0;\n while ( current( $row ) !== false) //若未找到任何记录则返回\n {\n $i++;\n $tmpArr = current( $row );\n $value = current( $tmpArr );\n $item = next( $tmpArr );\n //echo \"v:\".$value.\":::<br>\";\n //print_r( $expextArr );\n if ( in_array( $value, $expextArr ) )\n $vv = \" disabled checked \";\n else \n $vv = \"\";\n if ( !Empty( $checkboxArr ) )\n {\n if ( in_array( $value, $checkboxArr ) )\n $str = $str . \"<input type=checkbox name=\\\"\" . $name . \"\\\" tmpValue=\\\"\" . $item . \"\\\" value=\\\"\" . $value . \"\\\" \" . $clickScript . \" checked>&nbsp;\" . $item . \"&nbsp;\";\n else \n $str = $str . \"<input type=checkbox name=\\\"\" . $name . \"\\\" tmpValue=\\\"\" . $item . \"\\\"\".$vv.\" value=\\\"\" . $value . \"\\\" \" . $clickScript . \">&nbsp;\" . $item . \"&nbsp;\";\n }\n else \n $str = $str . \"<input type=checkbox name=\\\"\" . $name . \"\\\" tmpValue=\\\"\" . $item . \"\\\"\".$vv.\" value=\\\"\" . $value . \"\\\" \" . $clickScript . \">&nbsp;\" . $item . \"&nbsp;\";\n if ( $i%8 === 0 )\n $str .=\"<br>\";\n\n //$str=$str.\"<option value=\\\"\".current( $tmpArr ).\"\\\" __\".substr( $name, 0, strpos( $name, \"_\" ) ).current( $tmpArr ).\"SELECTED__>\".array_pop( $tmpArr ).\"</option>\\n\";\n next($row);\n }\n return $str;\n}", "public static function createInstance()\n {\n return new CheckBoxGridColumn('ISerializable', 'ISerializable');\n }", "protected function _importData()\n {\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n $this->deleteEntity();\n } elseif (Import::BEHAVIOR_REPLACE == $this->getBehavior()) {\n $this->replaceEntity();\n } elseif (Import::BEHAVIOR_APPEND == $this->getBehavior()) {\n $this->saveEntity();\n }\n\n return true;\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function form_field_checkbox ( $args ) {\n\t\t$options = $this->get_settings();\n\n\t\t$has_description = false;\n\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\t$has_description = true;\n\t\t\techo '<label for=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\">' . \"\\n\";\n\t\t}\n\t\techo '<input id=\"' . $args['key'] . '\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" type=\"checkbox\" value=\"1\"' . checked( esc_attr( $options[$args['key']] ), '1', false ) . ' />' . \"\\n\";\n\t\tif ( $has_description ) {\n\t\t\techo $args['data']['description'] . '</label>' . \"\\n\";\n\t\t}\n\t}", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_evaluation'][] = $strValue;\n }\n $tblHrdEvaluationMaster = new cHrdEvaluationMaster();\n $tblHrdEvaluationDetail = new cHrdEvaluationDetail();\n $tblHrdEvaluationMaster->deleteMultiple($arrKeys);\n $tblHrdEvaluationDetail->deleteMultiple($arrKeys2);\n $myDataGrid->message = $tblHrdEvaluationDetail->strMessage;\n}", "function ffw_port_checkbox_callback( $args ) {\n global $ffw_port_settings;\n\n $checked = isset($ffw_port_settings[$args['id']]) ? checked(1, $ffw_port_settings[$args['id']], false) : '';\n $html = '<input type=\"checkbox\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "protected function loadRow() {}", "function column_cb( $item ) {\n\n\t\treturn sprintf(\n\t\t\t'<input type=\"checkbox\" name=\"%1$s[]\" value=\"%2$s\" />',\n\t\t\t/*$1%s*/ $this->_args['singular'], \t//Let's simply repurpose the table's singular label (\"movie\")\n\t\t\t/*$2%s*/ $item['ID']\t\t\t//The value of the checkbox should be the record's id\n\t\t);\n\t}", "function theme_checkbox(&$item) {\n\n\t\t$class = array('form-checkbox');\n\t\t_form_set_class($item, $class);\n\n\t\t$checked = \"\";\n\t\tif (!empty($item[\"#value\"])) {\n\t\t\t$checked = \"checked=\\\"checked\\\" \";\n\t\t}\n\n\t\t$retval = '<input '\n\t\t\t. 'type=\"checkbox\" '\n\t\t\t. 'name=\"'. $item['#name'] .'\" '\n\t\t\t. 'id=\"'. $item['#id'].'\" ' \n\t\t\t. 'value=\"'. $item['#return_value'] .'\" '\n\t\t\t. $checked\n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' />';\n\n\t\treturn($retval);\n\n\t}", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "function sb_slideshow_checkbox( $value, $key, $name, $checked = array() ) {\n\treturn '<input type=\"checkbox\" name=\"sb_' . esc_attr( $name ) . '[]\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . (in_array( $value, (array)$checked ) ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}", "function fastshop_sanitize_checkbox( $checked ) {\n return (bool) $checked;\n}", "function column_cb( $item ) {\n\t\t//return sprintf( $item['stock_id'] );\n\t\t//return sprintf('<input type=\"checkbox\" name=\"bulk-delete[]\" value=\"%s\" />', $item['transaction_id']); \n\t}", "public function AddCheckboxToBpRegistrationPage()\n\t{\n\t\t$bp_checked = get_option($this->GrOptionDbPrefix . 'bp_registration_checked');\n\t\t?>\n\t\t<div class=\"gr_bp_register_checkbox\">\n\t\t\t<label>\n\t\t\t\t<input class=\"input-checkbox GR_bpbox\" value=\"1\" id=\"gr_bp_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_bp_checkbox\" <?php if ($bp_checked)\n\t\t\t\t{ ?> checked=\"checked\"<?php } ?> />\n\t\t\t\t<span\n\t\t\t\t\tclass=\"gr_bp_register_label\"><?php echo get_option($this->GrOptionDbPrefix . 'bp_registration_label'); ?></span>\n\t\t\t</label>\n\t\t</div>\n\t\t<?php\n\t}", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function AddCheckboxToRegistrationForm()\n\t{\n\t\tif ( ! is_user_logged_in())\n\t\t{\n\t\t\t$checked = get_option($this->GrOptionDbPrefix . 'registration_checked');\n\t\t\t?>\n\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t<input class=\"input-checkbox GR_registrationbox\" value=\"1\" id=\"gr_registration_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_registration_checkbox\" <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t\t<label for=\"gr_registration_checkbox\" class=\"checkbox\">\n\t\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'registration_label'); ?>\n\t\t\t\t</label>\n\t\t\t</p><br/>\n\t\t\t<?php\n\t\t}\n\t}", "public function get_interest_checkboxes(){\n\t\treturn $this->ci->profile_model->get_interest_checkboxes();\n\t}", "function _field_checkbox($fval) \n {\n return sprintf(\"<input type=\\\"checkbox\\\" name=\\\"%s\\\" id=\\\"%s\\\" %s class=\\\"%s\\\" %s %s />\",\n $this->fname,\n $this->fname,\n ($this->opts)? 'value=\"' . $this->opts . '\"' : '',\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n (!empty($fval) && $fval != '0000-00-00')? \"checked\" : \"\",\n $this->extra_attribs);\n }", "function column_cb($item)\n {\n return sprintf(\n\n '<input type=\"checkbox\" name=\"id[]\" value=\"%s\" />',\n $item['id']\n );\n }" ]
[ "0.55346096", "0.5344551", "0.5191674", "0.51886994", "0.518288", "0.5171274", "0.51545525", "0.50641865", "0.5053339", "0.50150746", "0.5008626", "0.48653644", "0.48485696", "0.4838679", "0.4827591", "0.48134705", "0.48091918", "0.48020542", "0.48018435", "0.47888786", "0.4782507", "0.4781474", "0.477534", "0.4767205", "0.47431844", "0.46987894", "0.46894133", "0.46795645", "0.46786076", "0.46665367", "0.46542224", "0.46284613", "0.46239585", "0.4617978", "0.46103826", "0.46090475", "0.46009558", "0.45791307", "0.457886", "0.45774147", "0.45769793", "0.45745075", "0.45742813", "0.4569956", "0.45659596", "0.45656815", "0.45549604", "0.4552525", "0.45468545", "0.45459062", "0.4540949", "0.45402518", "0.4539851", "0.45359442", "0.4534176", "0.45325765", "0.45291063", "0.45270723", "0.45225963", "0.45186293", "0.45060834", "0.45047012", "0.44683123", "0.44667718", "0.44659775", "0.44659597", "0.44630787", "0.44514802", "0.44436386", "0.4438625", "0.4428996", "0.4427627", "0.4425929", "0.44227958", "0.44128963", "0.44113842", "0.4411033", "0.4405966", "0.44042858", "0.4402816", "0.44027892", "0.44015762", "0.4396318", "0.43936896", "0.4391979", "0.43799278", "0.43785703", "0.43771407", "0.43673456", "0.43623245", "0.435152", "0.43513525", "0.43495694", "0.4336704", "0.43358997", "0.43313798", "0.43254888", "0.43252444", "0.4322896", "0.43225303" ]
0.55580056
0
Method for importing a date data cell.
protected function process_data_date(import_settings $settings, $field, $data_record, $value) { $value = $this->get_innerhtml($value); $parts = explode('.', $value); $d = $parts[0]; $m = $parts[1]; $y = $parts[2]; $value = mktime(0, 0, 0, $m, $d, $y); $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function importDateContents($contents) : void\n {\n //==============================================================================\n // Import Date\n if (!empty($contents[\"date\"])) {\n if ($contents[\"date\"] instanceof DateTime) {\n $this->setRefreshAt($contents[\"date\"]);\n } elseif (is_scalar($contents[\"date\"])) {\n $this->setRefreshAt(new DateTime((string) $contents[\"date\"]));\n }\n }\n }", "public function getDateImport()\n {\n return $this->date_import;\n }", "public function importExcel($path);", "private function importCsv($params) {\n\n $conn = $this->container->get('doctrine.dbal.default_connection');\n\n // set content in file handler\n $fiveMBs = 5 * 1024 * 1024;\n $fp = fopen(\"php://temp/maxmemory:$fiveMBs\", 'r+');\n fputs($fp, $params['data']);\n rewind($fp);\n\n // get array from CSV\n $data = array();\n while (($row = fgetcsv($fp, 1000, \",\")) !== FALSE) {\n $data[] = $row;\n }\n fclose($fp);\n\n // let's check how the CSV is structured. There can be 3 options\n\n // Option 1.\n // date, value\n // date2, value2\n\n // Option 2.\n // x, date1, date2\n // source_title, value11, value12\n // source_title2, value21, value22\n\n // so let's check the first field to see if it's a date\n $firstField = $data[0][0];\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($firstField);\n\n $dataToInsert = array();\n $sourcesToInsert = array();\n\n // it's a date, so Option 1\n if ( $dateAr ) {\n\n $sourceHash = md5($params['title']);\n\n $sourcesToInsert[] = '('\n . $conn->quote(trim($params['title']), 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // the data is already on the desired format\n $dataToInsert[ $sourceHash ] = $data;\n }\n // Option 2.\n else {\n\n // get dates which are on the first line\n $dates = array_slice($data[0], 1);\n $avoidFirst = true;\n foreach ($data as $lineData) {\n\n // do not insert first line\n if ( $avoidFirst ) {\n $avoidFirst = false;\n continue;\n }\n\n // source title\n $titleSuffix = $lineData[0];\n $sourceTitle = trim($params['title']) . ' - ' . trim($titleSuffix);\n $sourceHash = md5($sourceTitle);\n\n $sourcesToInsert[] = '('\n . $conn->quote($sourceTitle, 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // values\n $values = array_slice($lineData, 1);\n\n $dataToInsert[ $sourceHash ] = array_combine($dates, $values);\n }\n }\n\n $now = date('Y-m-d H:m:s');\n\n // insert masivo de sources\n $r = $conn->executeUpdate('INSERT INTO source (title, hash, unit, link, created_at, updated_at)\n VALUES '.join(',', $sourcesToInsert));\n\n // get all sources\n $results = $conn->fetchAll(\"SELECT id, hash FROM source where created_at > ?\", array($now));\n\n // create array that identifies source\n $sources = array();\n foreach ($results as $r) {\n $sources[ $r['hash'] ] = $r['id'];\n }\n unset($results);\n\n $insert = array();\n foreach ($dataToInsert as $sourceCode => $data) {\n\n foreach ($data as $date => $value ) {\n\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($date);\n\n $date = $dateAr['date'];\n $dateType = $dateAr['dateType'];\n\n $insert[] = '('.$sources[ $sourceCode ].', '\n .$conn->quote($date, 'string').', '\n .$conn->quote($dateType, 'string').', '\n .$conn->quote($value, 'string').', now(), now())';\n }\n }\n\n $offset = 0;\n $MAX = 10000;\n $total = count($insert);\n\n //$this->output->writeln('Hay '.$total.' data points');\n\n while ( $offset < $total ) {\n\n $insertNow = array_slice($insert, $offset, $MAX);\n\n // hacer insert masivo\n $r = $conn->executeUpdate('INSERT INTO data (source_id, date, date_type, value, created_at, updated_at)\n VALUES '.join(',', $insertNow));\n\n $offset += $MAX;\n\n //$this->output->writeln(' ...añadidos '.$offset);\n }\n }", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "public function getDataWithTypeDate() {}", "public function importFrom(array $data);", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "private function getCsvData($file_name, $sheet_name = null){//This function is not used\n $objReader = PHPExcel_IOFactory::createReaderForFile($file_name);\n //If specific Sheet is specified then sheet is selected\n if($sheet_name != null){\n $objReader->setLoadSheetsOnly(array($sheet_name));\n }\n $objReader->setReadDataOnly(true);\n \n $objPHPExcel = $objReader->load($file_name);\n \n //Getting the number of rows and columns\n $highestColumm = $objPHPExcel->setActiveSheetIndex(0)->getHighestColumn();\n $highestRow = $objPHPExcel->setActiveSheetIndex(0)->getHighestRow();\n \n \n $fileInfo = array();\n $rowCount = 0;\n \n \n foreach ($objPHPExcel->setActiveSheetIndex(0)->getRowIterator() as $row) {\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(false);\n \n $row = array();\n $columnCount = 0;\n foreach ($cellIterator as $cell) {\n if (!is_null($cell)) {\n \n //This is converting the second column to Date Format\n //TODO:: Make sure date format anywhere is captured properly and not just the second column\n if (($columnCount == 0) && ($rowCount > 0)){\n $value = $cell->getValue();\n $value = date($format = \"Y-m-d\", PHPExcel_Shared_Date::ExcelToPHP($value)); \n \n }else{\n $value = $cell->getCalculatedValue(); \n if(PHPExcel_Shared_Date::isDateTime($cell)) {\n $value = $cell->getValue(); \n $value = date($format = \"Y-m-d\", PHPExcel_Shared_Date::ExcelToPHP($value)); \n }\n }\n \n array_push($row, $value);\n $columnCount++;\n \n }\n }\n /* for debugging or adding css */\n /*if ($rowCount > 15) {\n break;\n }*/\n if ($rowCount > 0)\n {\n //$this->setCsvData($row); \n array_push($fileInfo, $row);\n //print_r($row);\n }else{\n array_push($fileInfo, $row);\n }\n unset($row);\n //array_push($fileInfo, $row);\n $rowCount++;\n }\n\n return $fileInfo;\n }", "public function stdWrap_dateDataProvider() {}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "function import(array $data);", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function checkDateWithTypo3DateSyntaxDataProvider() {}", "public function run()\n {\n $filename = storage_path('imports/car_serie.csv');\n Excel::import(new CarSerieImport, $filename);\n }", "function exibirDataBr($data){\n\t$timestamp = strtotime($data); \n\treturn date('d/m/y', $timestamp);\t\n}", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it employee shift template file?\n\t\tif($excel['cells'][1][1] == 'NIK') {\n\n\t\t\t$longshift_nik = $this->m_sync_attendance->sync_final_get_long_shift();\n\t\t\t$this->db->trans_start();\n\n\t\t\tfor($j = 1; $j <= $excel['numCols']; $j++) {\n\n\t\t\t\t$date = $excel['cells'][1][$j+1];\n\t\t\t\t$date_int[$j] = $this->convertexceltime($date);\n\n\t\t\t\t$eod = $this->m_employee->eod_select_last();\n\t\t\t\t$eod_int = strtotime($eod);\n\n\t\t\t\tif($eod_int < $date_int[$j]) {\n\t\t\t\t\t$date_arr[$j] = date(\"Y-m-d\", $date_int[$j]);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\n\t\t\t\t// cek apakah NIK ada isinya?\n\t\t\t\tif(!empty($excel['cells'][$i][1])) {\n\n\t\t\t\t\t$employee = $this->m_employee->employee_select_by_nik($excel['cells'][$i][1]);\n\t\t\t\t\t$employee_check = $this->m_employee->employee_check($employee['employee_id']);\n\n\t\t\t\t\tif($employee_check) {\n\n\t\t\t\t\t\t$employee_shift['shift_emp_id'] = $employee['employee_id'];\n\n\t\t\t\t\t\tfor($j = 1; $j <= $excel['numCols']+1; $j++) {\n\n\t\t\t\t\t\t\tif(strtotime($employee['tanggal_masuk']) <= $date_int[$j]) {\n\n\t\t\t\t\t\t\t\tif(!empty($date_arr[$j])) {\n\n\t\t\t\t\t\t\t\t\t$employee_shift['shift_date'] = $date_arr[$j];\n\t\t\t\t\t\t\t\t\t$shift_code_check = $this->m_employee_shift->shift_code_check($excel['cells'][$i][$j+1], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\tif($shift_code_check) {\n\n\t\t\t\t\t\t\t\t\t\t$employee_shift['shift_code'] = $excel['cells'][$i][$j+1];\n\n\t\t\t\t\t\t\t\t\t\tif($this->m_employee_shift->shift_add_update($employee_shift,$longshift_nik)) {\n\t\t\t\t\t\t\t\t\t\t\t/*$shift = $this->m_employee_shift->shift_code_select($employee_shift['shift_code'], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['cabang'] = $this->session->userdata['ADMIN']['hr_plant_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['tanggal'] = $employee_shift['shift_date'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['nik'] = $employee['nik'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift'] = $shift['shift_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['kd_shift'] = $shift['shift_code'];\n\n if ($this->m_upload_absent->employee_absent_select($absent)==FALSE) {\n \t\t\t\t\t\t\t\t$absent['kd_aktual'] = 'A';\n \t\t\t\t\t\t\t\t$absent['kd_aktual_temp'] = 'A';\n }\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_in'] = $shift['duty_on'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_out'] = $shift['duty_off'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_in'] = $shift['break_in'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_out'] = $shift['break_out'];\n\n \t\t\t $this->m_upload_absent->employee_absent_add_update($absent);*/\n\n\t\t\t\t\t\t\t\t\t\t\t$berhasil = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 7;\n\t\t\t$object['refresh_text'] = 'Data Shift Karyawan berhasil di-upload';\n\t\t\t$object['refresh_url'] = 'employee_shift';\n\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Shift Karyawan atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'employee_shift/browse_result';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '002';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function import(array $data): void;", "public function isDate($row, $column) {\n\t}", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }", "public function metaImport($data);", "function addData($row, $sheet,&$iRow,&$iCol,$rowTime)\n{\n global $objPHPExcel,$colDate, $Zone;\n\n $Date = date_create($row['Day']);\n $Date = intval($Date->format('m')) . '/' . intval($Date->format('d'));\n\n while($Date!=$colDate and $iCol<700)\n {\n $colDate = $objPHPExcel->setActiveSheetIndex($sheet)->getCell(chr($iCol). 1);\n $colDate = $colDate->getValue();\n if($Date != $colDate)\n {\n $iCol++;\n $Zone='';\n $iRow=2;\n }\n }\n\n\n $foundRow='false';\n\n $Time = createTimeString($row['TimeIn'],$row['TimeOut']);\n while($foundRow=='false' and $iRow < 3000)\n {\n $ZoneCell=$objPHPExcel->setActiveSheetIndex($sheet)->getCell('B'.$iRow);\n\n if($ZoneCell != '' or $Zone=='')\n {\n $Zone=$ZoneCell->getValue();\n }\n\n $TimeCell=$objPHPExcel->setActiveSheetIndex($sheet)->getCell('A'.$iRow);\n\n if($TimeCell->getValue() !='')\n {\n $rowTime = $TimeCell->getValue();\n }\n\n $Cell=chr($iCol) . $iRow;\n if($Time == $rowTime && $Zone==$row['Zone_ID'])\n {\n $objPHPExcel->setActiveSheetIndex($sheet)->setCellValue( $Cell,$row['Person']);\n\n\n if($row['Role']=='supervisor')\n {\n BoldCell($sheet,$Cell,'false');\n }\n $foundRow='true';\n }\n else\n {\n $iRow++;\n }\n }\n return $rowTime;\n}", "public function setDateImport($date_import)\n {\n $this->date_import = $date_import;\n\n return $this;\n }", "protected function importDatabaseData() {}", "protected function _convert_date($date)\n {\n }", "private function reedImportFile()\n {\n $reader = IOFactory::createReader('Xlsx');\n\n $reader->setReadDataOnly(true);\n\n $spreadsheet = $reader->load($this->getFullPathToUploadFile());\n\n $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true);\n\n $this->resultReedImportFile = $sheetData;\n }", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "protected function dateFromExcelDate($excelDate) {\n $timestamp = ($excelDate - 25569) * 86400;\n return new \\DateTime(\"@$timestamp\");\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public static function importar($excel)\n {\n $log = '';\n $reader = new Xls();\n $spreadsheet = $reader->load(public_path('/storage/' . $excel['path']));\n $pagos = [];\n $pendiente2017 = [];\n $gestiones = 0;\n foreach ($spreadsheet->getAllSheets() as $sheet) {\n $ene = $sheet->getCell('G2')->getValue();\n if ($ene === 'ENE') {\n $gestion = $sheet->getTitle();\n $gestiones++;\n for ($row = 4;$row < 100;$row++) {\n $name = trim($sheet->getCell(\"C{$row}\")->getValue());\n $isName = static::isName($name);\n if ($isName) {\n // Pendiente de 2017\n if ($gestion == '2018') {\n $pendiente2017[$name] = floatval($sheet->getCell(\"D{$row}\")->getCalculatedValue());\n }\n // a cuenta\n $pagos[$name][] = floatval($sheet->getCell(\"E{$row}\")->getCalculatedValue());\n floatval($sheet->getCell(\"E{$row}\")->getCalculatedValue());\n for ($m = 0;$m < 12;$m++) {\n $col = static::toColumn(7 + $m * 2);\n $pagos[$name][sprintf('%04d-%02d', $gestion, $m + 1)] = [\n $gestion,\n $m + 1,\n floatval($sheet->getCell(\"{$col}{$row}\")->getCalculatedValue())\n ];\n }\n }\n }\n }\n }\n ksort($pagos);\n // Calcula la moda de los pagos\n $aporteMensual = [];\n foreach ($pagos as $nombre => $pp) {\n $moda = [];\n ksort($pp);\n $pagos[$nombre] = $pp;\n foreach ($pp as $pago) {\n if ($pago[2]) {\n isset($moda[$pago[2]]) ? $moda[$pago[2]]++ : $moda[$pago[2]] = 1;\n }\n }\n arsort($moda);\n reset($moda);\n $aporteMensual[$nombre] = key($moda);\n }\n // Prepara resumen final\n $resumen = [];\n foreach ($pagos as $nombre => $pp) {\n $aporte = $aporteMensual[$nombre];\n //$log .= \" $nombre: \" . array_sum($pp) . '/' . ($aporte * 12 * $gestiones + @$pendiente2017[$nombre]) . \" ($aporte)\\n\";\n $aportes = [\n [\n 'mes' => 12,\n 'gestion' => 2017,\n 'a_pagar' => $pendiente2017[$nombre] ?? 0,\n 'monto' => 0,\n ],\n ];\n foreach ($pp as $pago) {\n if ($pago[2]) {\n isset($moda[$pago[2]]) ? $moda[$pago[2]]++ : $moda[$pago[2]] = 1;\n }\n }\n $resumen[] = [\n 'name' => $nombre,\n 'aporte_mensual' => $aporteMensual[$nombre],\n 'aportes' => $aportes,\n ];\n }\n return $resumen;\n }", "public function import(): void;", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function import();", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "function ExibeData($data){\n\t\treturn date(\"d/m/Y\", strtotime($data));\n\t}", "function readCsv($fileName) {\n\n\t// Lecture du fichier src :\n\t$myfile = fopen($fileName, \"r\") or die(\"Unable to open file!\");\n\t$dataStr = fread($myfile,filesize($fileName));\n\tfclose($myfile);\n\n\t$lines = explode(\"\\n\", $dataStr);\n\t$days = array();\n\n\tforeach ($lines as $line) {\n\t\t$temp = explode(\";\", $line);\n\t\tif (count($temp) == 2) {\n\t\t\tarray_push($days, new Day($temp[0], $temp[1]));\n\t\t}\n\t}\n\treturn $days;\n}", "public function import()\n {\n \n }", "public function checkDateWithInvalidDateValuesDataProvider() {}", "private static function processInputAsDateString() {\n $unix = strtotime(self::$input);\n\n if ($unix) { \n self::$timestamp = $unix;\n self::setDateFromTimestamp(self::$timestamp);\n } else {\n self::setMessage(\"Sorry. Your input was invalid.\");\n }\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "protected function process_header_date(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function run()\n {\n \t$datas = Excel::import(new CargoImport, 'database/seeds/cargos.xlsx', null, \\Maatwebsite\\Excel\\Excel::XLSX);\n }", "protected function loadRow() {}", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function SetImportDateTime($time) {\n $this->ImportDateTime = $time;\n }", "public function import($fileName, $blfName) {\n\t\t$this->_blfName = $blfName;\n\t\t$this->fileName = $fileName;\n\t\t$missionId = - 1;\n\t\t$this->loadingStep = 0;\n\t\t\n\t\tini_set ( \"memory_limit\", \"1024M\" );\n\t\t\n\t\tset_time_limit ( 1000 );\n\t\t\n\t\tif (! $this->uploaded) {\n\t\t\t$file = sfConfig::get ( 'app_import_data_stack_log' );\n\t\t\t$csv_file = sfConfig::get ( 'app_import_path_stack_log' ) . DIRECTORY_SEPARATOR . $this->year . DIRECTORY_SEPARATOR . $this->month . DIRECTORY_SEPARATOR . $this->day . DIRECTORY_SEPARATOR . $file;\n\t\t} else {\n\t\t\t$csv_file = sfConfig::get ( 'sf_upload_dir' ) . '/' . $fileName;\n\t\t}\n\t\t\n\t\tif (file_exists ( $csv_file )) {\n\t\t\t$handle = fopen ( $csv_file, \"r\" );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Print error to STDERR and exit the whole script.\n\t\t\t */\n\t\t\tfwrite ( STDERR, \"[\" . date ( 'Y-m-d H:i:s' ) . \"] [stack] Csv-file from \" . date ( 'Y-m-d', $this->calendar_date ) . \" not found.\\n\" );\n\t\t\t\n\t\t\treturn $missionId;\n\t\t}\n\t\t\n\t\t// start working on the file\n\t\tif ($handle) {\n\t\t\t\n\t\t\t/*\n\t\t\t * Read csv-file and put contents to the associative array $import_data\n\t\t\t */\n\t\t\t$import_data = array ();\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t// get field names - column headers\n\t\t\t$fieldnames = fgetcsv ( $handle, 4096, \",\" );\n\t\t\t// $this->printArray($fieldnames);\n\t\t\t\n\t\t\t$dateTimeRow = null;\n\t\t\t\n\t\t\twhile ( ($line = fgets ( $handle )) !== FALSE ) {\n\t\t\t\t$rowData = $this->getCsvWoWhiteSpace ( $line );\n\t\t\t\t\n\t\t\t\t$row ++;\n\t\t\t\t$number_of_columns = count ( $rowData );\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < $number_of_columns; $i ++) {\n\t\t\t\t\t$trimmed = trim ( $rowData [$i] );\n\t\t\t\t\t$import_data [$fieldnames [$i]] = $trimmed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// $this->printArray($import_data);die();\n\t\t\t\t$this->padData ( $import_data );\n\t\t\t\t$this->_currentRowDateTime = $import_data [LoggerFields::Data_Time_UTC];\n\t\t\t\t$this->analyzeRecord ( $import_data );\n\t\t\t}\n\t\t\t\n\t\t\tfclose ( $handle );\n\t\t\t$this->missionEnded ();\n\t\t\t// echo \"mission endede\";//debug\n\t\t\t$number_of_entries = $row;\n\t\t}\n\t\t// echo \"import done\"; die();\n\t\treturn $this->_mission;\n\t}", "public function run()\n {\n Excel::import(new Countries, base_path('public/countries.xls'));\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "protected function explodeDate($date)\r\n {\r\n $numericDate = preg_replace(\"/[^0-9]/\", \"\", $date);\r\n $countZero = substr_count($numericDate, '0');\r\n $length = strlen($numericDate);\r\n\r\n //if is only zeros is am empty date\r\n if ($countZero == $length)\r\n {\r\n $date = '';\r\n return FALSE;\r\n }\r\n\r\n //adiciona suporte a data com utc 2017-12-20T16:06:31-02:00\r\n //alguns exemplos tem 2023-01-28T10:00:00.000Z .000Z no final outros tem -02:00\r\n //ignoramos ambos por enquanto\r\n if (stripos($date, 'T') && strlen($date) > 18)\r\n {\r\n //desconsidera GMT\r\n $date = substr($date, 0, 19);\r\n }\r\n\r\n //remove some UTC caracters to make regexp work\r\n $date = str_replace(array('T', 'Z'), ' ', $date);\r\n\r\n // format = dd/mm/yyyy hh:ii:ss\r\n if (mb_ereg(\"^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = $reg[6];\r\n $this->month = $reg[2];\r\n $this->day = $reg[1];\r\n $this->year = $reg[3];\r\n\r\n return true;\r\n }\r\n\r\n // format = dd/mm/yyyy hh:ii:ss.nnnnnn\r\n if (mb_ereg(\"^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2})\\.(.{1,})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = $reg[6];\r\n $this->month = $reg[2];\r\n $this->day = $reg[1];\r\n $this->year = $reg[3];\r\n\r\n return true;\r\n }\r\n\r\n // format = dd/mm/yyyy hh:ii\r\n if (mb_ereg(\"^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4}) ([0-9]{2})\\:([0-9]{2})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = '00';\r\n $this->month = $reg[2];\r\n $this->day = $reg[1];\r\n $this->year = $reg[3];\r\n\r\n return true;\r\n }\r\n\r\n // format = dd/mm/yyyy\r\n if (mb_ereg(\"^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})\\$\", $date, $reg))\r\n {\r\n $this->hour = '00';\r\n $this->minute = '00';\r\n $this->second = '00';\r\n $this->month = $reg[2];\r\n $this->day = $reg[1];\r\n $this->year = $reg[3];\r\n\r\n return true;\r\n }\r\n\r\n // format = yyyy-mm-dd hh:ii:ss\r\n if (mb_ereg(\"^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = $reg[6];\r\n $this->month = $reg[2];\r\n $this->day = $reg[3];\r\n $this->year = $reg[1];\r\n\r\n return true;\r\n }\r\n\r\n // format = yyyy-mm-dd hh:ii:ss.nnnnnn\r\n if (mb_ereg(\"^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2})\\.(.{1,})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = $reg[6];\r\n $this->month = $reg[2];\r\n $this->day = $reg[3];\r\n $this->year = $reg[1];\r\n\r\n return true;\r\n }\r\n\r\n // format = yyyy-mm-dd hh:ii\r\n if (mb_ereg(\"^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2})\\:([0-9]{2})\\$\", $date, $reg))\r\n {\r\n $this->hour = $reg[4];\r\n $this->minute = $reg[5];\r\n $this->second = '00';\r\n $this->month = $reg[2];\r\n $this->day = $reg[3];\r\n $this->year = $reg[1];\r\n\r\n return true;\r\n }\r\n // format = yyyy-mm-dd\r\n if (mb_ereg(\"^([0-9]{4})-([0-9]{2})-([0-9]{2})\\$\", $date, $reg))\r\n {\r\n $this->second = 0;\r\n $this->hour = 0;\r\n $this->minute = 0;\r\n $this->month = $reg[2];\r\n $this->day = $reg[3];\r\n $this->year = $reg[1];\r\n\r\n return true;\r\n }\r\n\r\n //if is timestamp\r\n if (is_numeric($date))\r\n {\r\n $date = date(self::MASK_TIMESTAMP_USER, $date);\r\n $this->explodeDate($date);\r\n\r\n return true;\r\n }\r\n\r\n //if don't reconize data return false\r\n return false;\r\n }", "protected function _addData(&$dataSource, $date, $rowKey, $value)\n {\n if (isset($dataSource[$date])) {\n $dataSource[$date][$rowKey] = (float)$value;\n } else {\n $dataSource[$date] = ['date' => $date, $rowKey => (float)$value];\n }\n }", "protected function _addData(&$dataSource, $date, $rowKey, $value)\n {\n if (isset($dataSource[$date])) {\n $dataSource[$date][$rowKey] = (float)$value;\n } else {\n $dataSource[$date] = ['date' => $date, $rowKey => (float)$value];\n }\n }", "public function column_date($post)\n {\n }", "public function column_date($post)\n {\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "public function insertExcel()\n {\n $json = file_get_contents('php://input');\n $data = json_decode($json);\n // Define the Base64 value you need to save as an image\n $b64 = explode(',', $data);\n\n // Obtain the original content (usually binary data)\n $bin = base64_decode($b64[1]);\n $filecontent = file_put_contents('evenement.xlsx', $bin);\n\n\n $allowed_ext = ['xls', 'csv', 'xlsx'];\n $filename = 'evenement.xlsx';\n $check_ext = explode(\".\", $filename);\n $file_ext = end($check_ext);\n \n\n if (in_array($file_ext, $allowed_ext)) {\n $targetPath = './evenement.xlsx';\n $spreadsheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load($targetPath);\n $data = $spreadsheet->getActiveSheet();\n \n $highestRow = $data->getHighestRow();\n\n for($row=4; $row < $highestRow ; $row++){\n \n $number_sign = $data->getCellByColumnAndRow(1, $row)->getValue(); \n\n $first_time = $data->getCellByColumnAndRow(4, $row)->getValue();\n $min = $first_time * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timefirst = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n \n $second_time = $data->getCellByColumnAndRow(5, $row)->getValue();\n $min = $second_time * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timesecond = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n\n $average = $data->getCellByColumnAndRow(6, $row)->getCalculatedValue();\n $min = $average * 24 * 60;\n $seconds = $min *60;\n $milliseconds = $seconds * 1000;\n $timeaverage = ($min%60). ':'.($seconds%60).(($milliseconds===0)?'':'.'.rtrim($milliseconds%1000, '0'));\n \n $insertTrial = new Trial(array('number_sign' => $number_sign, 'first_time' => $timefirst, 'second_time' => $timesecond, 'average' => $timeaverage));\n $manager = new TrialManager();\n $trials = $manager->insertionTrial($insertTrial);\n \n }\n } else {\n echo 'invalid file';\n }\n }", "function setData($data)\n {\n $this->date=$data;\n }", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "function read_e($datestr, $ref=NULL) {\n $gotit = false;\n if (preg_match('/^([0-9][0-9][0-9][0-9])-([0-9]+)-([0-9]+)$/', $datestr, $m)) {\n # Canonical (ISO 8601)\n $year = $m[1];\n $month = $m[2];\n $day = $m[3];\n $gotit = true;\n } elseif (preg_match('/^([0-9]+)[-\\/]([0-9]+)[-\\/]([0-9]+)$/', $datestr, $m)) {\n # American Style\n $year = $m[3];\n $month = $m[1];\n $day = $m[2];\n if ($day > 12) {\n $gotit = true;\n }\n else {\n return array(NULL, new Error('Ambiguous, use yyyy-mm-dd OR dd.mm.yyyy'));\n }\n } elseif (preg_match('/^([0-9]+)\\.([0-9]+)\\.([0-9]+)$/', $datestr, $m)) {\n # European Style\n $year = $m[3];\n $month = $m[2];\n $day = $m[1];\n $gotit = true;\n }\n if ($gotit) {\n if ($month < 1 or $month > 12) {\n return array(NULL, new Error('Bad month number: '.$month));\n }\n if ($day < 1 or $day > 31) {\n return array(NULL, new Error('Bad day number: '.$day));\n }\n if ($year < 60) {\n $year += 2000;\n } elseif ($year < 100) {\n $year += 1900;\n }\n if (checkdate($month, $day, $year)) {\n return array(sprintf('%04d-%02d-%02d', $year, $month, $day), NULL);\n } else {\n return array(NULL, new Error('Invalid date, check your calendar'));\n }\n }\n if ($ref !== NULL) {\n list($ref, $err) = Date::read_e($ref);\n if ($err) {\n return array(NULL, $err);\n }\n } else {\n $ref = date('Y-m-d');\n }\n if ($datestr == 'today' or $datestr == 'now') {\n return array($ref, NULL);\n } elseif ($datestr == 'yesterday') {\n return array(Date::addDays($ref, -1), NULL);\n } elseif ($datestr == 'tomorrow') {\n return array(Date::addDays($ref, 1), NULL);\n } else {\n return array(NULL, new Error('Invalid date format'));\n }\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function testV1ImportReprocessDaysSourceIdYearPost()\n {\n }", "public function import($params)\n {\n $this->results->basename = $params['basename'];\n $this->results->filepath = $params['filepath'];\n \n $this->project = $project = $params['project'];\n $this->projectId = $project->getId();\n \n $ss = $this->reader->load($params['filepath']);\n\n //if ($worksheetName) $ws = $reader->getSheetByName($worksheetName);\n $ws = $ss->getSheet(0);\n \n $rows = $ws->toArray();\n \n $header = array_shift($rows);\n \n $this->processHeaderRow($header);\n \n // Insert each record\n foreach($rows as $row)\n {\n $item = $this->processDataRow($row);\n \n $this->processItem($item);\n }\n $this->gameRepo->commit();\n \n return $this->results;\n }", "public function prosesimport()\n {\n // include APPPATH.'third_party/PHPExcel/PHPExcel.php';\n\t\trequire_once APPPATH.\"/libraries/phpexcel/PHPExcel.php\"; \n\t\t \n\t\t$config['upload_path'] = FCPATH . 'uploads/temp/';\n $config['allowed_types'] = 'xlsx|xls|csv';\n $config['max_size'] = '10000';\n $config['encrypt_name'] = true;\n\n $this->load->library('upload', $config);\n\n if (!$this->upload->do_upload()) \n\t\t{\n\n //upload gagal\n $this->session->set_flashdata('notif', '<div class=\"alert alert-danger\"><b>PROSES IMPORT GAGAL!</b> '.$this->upload->display_errors().'</div>');\n //redirect halaman\n redirect('importanggota');\n\n } \n\t\telse \n\t\t{\n\n $data_upload = $this->upload->data();\n\n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/temp/'.$data_upload['file_name']); // Load file yang telah diupload ke folder excel\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n\n $data = array();\n\n $numrow = 1;\n foreach($sheet as $row){\n\t\t\t \n\t\t\t\tif($numrow > 1){\n\t\t\t\t\t // trim(strip_tags(addslashes(strtoupper($this->input->post(\"suku\", TRUE)))))\n\t\t\t\t\t// $NO_ANGGOTA = $row['A'] ; // NO ANGGOTA\n\t\t\t\t\t\n\t\t\t\t\t$gettgldaftar = trim(strip_tags($row['B'])) ; // TANGGAL DAFTAR\n\t\t\t\t\t$pec = explode(\"/\",$gettgldaftar);\n\t\t\t\t\t\n\t\t\t\t\t$settgldaftar = date_create($pec[2].\"-\".$pec[1].\"-\".$pec[0]);\n\t\t\t\t\t$TGL_DAFTAR = date_format($settgldaftar,\"Y-m-d\");\n\t\t\t\t\t \n\t\t\t\t\t// $TGL_DAFTAR = trim(strip_tags($row['B'])) ; \n\t\t\t\t\t$CABANG = trim(strip_tags(addslashes($row['C']))) ; // CABANG\n\t\t\t\t\t$NAMA = trim(strip_tags(addslashes($row['D']))) ; // NAMA ANGGOTA\n\t\t\t\t\t$TMP_LAHIR = trim(strip_tags(addslashes($row['E']))) ; // TEMPAT LAHIR\n\t\t\t\t\t\n\t\t\t\t\t$gettgllahir = trim(strip_tags($row['F'])) ; // TGL LAHIR\n\t\t\t\t\t$pech = explode(\"/\",$gettgllahir);\n\t\t\t\t\t\n\t\t\t\t\t$ctgllahir = date_create($pech[2].\"-\".$pech[1].\"-\".$pech[0]);\n\t\t\t\t\t$TGL_LAHIR = date_format($ctgllahir,\"Y-m-d\");\n\t\t\t\t\t \n\t\t\t\t\t// $TGL_LAHIR = trim(strip_tags($row['F'])) ;\n\t\t\t\t\t$ALAMAT_DOMISILI = trim(strip_tags(addslashes($row['G']))) ; // ALAMAT DOMISILI\n\t\t\t\t\t$IDPROVINSI = trim(strip_tags(addslashes($row['H']))) ; // PROVINSI\n\t\t\t\t\t$IDKOTA = trim(strip_tags(addslashes($row['I']))) ; // KOTA\n\t\t\t\t\t$IDKECAMATAN = trim(strip_tags(addslashes($row['J']))) ; // KECAMATAN\n\t\t\t\t\t$IDKELURAHAN = trim(strip_tags(addslashes($row['K']))) ; // KELURAHAN\n\t\t\t\t\t$AGAMA = trim(strip_tags(addslashes($row['L']))) ; // AGAMA\n\t\t\t\t\t$JK = trim(strip_tags(addslashes($row['M']))) ; // JENIS_KLAMIN\n\t\t\t\t\t$TELP = trim(strip_tags(addslashes($row['N']))) ; // TELP\n\t\t\t\t\t$STATUS = trim(strip_tags(addslashes($row['O']))) ; // STATUS\n\t\t\t\t\t$IDENTITAS = trim(strip_tags(addslashes($row['P']))) ; // IDENTITAS \n\t\t\t\t\t$NO_IDENTITAS = trim(strip_tags(addslashes($row['Q']))) ; // NO IDENTITAS\n\t\t\t\t\t$IBU_KANDUNG = trim(strip_tags(addslashes($row['R']))) ; // IBU KANDUNG\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t// echo $TGL_DAFTAR.\"</br>\";\n\t\t\t\t\t$nom = $this->dbasemodel->loadsql(\"SELECT COALESCE(MAX(NO_ANGGOTA), 0)+1 AS NOMER FROM m_anggota WHERE KODEPUSAT='\".$this->session->userdata('wad_kodepusat').\"' AND KODECABANG='\".$CABANG.\"'\");\n\n\t\t\t\t\t$rnom = $nom->row();\n\t\t\t\t\t$invID = str_pad($rnom->NOMER, 4, '0', STR_PAD_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t$getKodecabang = $this->dbasemodel->loadsql(\"SELECT * FROM m_cabang WHERE KODE='\".$CABANG.\"'\")->row();\n\t\t\t\t\t\n\t\t\t\t\t$noAgt = $this->session->userdata('wad_kodepusat').\"-\".$getKodecabang->KODECABANG.\"-\".$invID;\n\t\t\t\t\t\n\t\t\t\t\t$arrInsert = array(\n\t\t\t\t\t\t\t\"NAMA\" => $NAMA,\n\t\t\t\t\t\t\t\"IDENTITAS\" => $IDENTITAS,\n\t\t\t\t\t\t\t\"KODEPUSAT\" => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t\t\"KODECABANG\" => $CABANG,\n\t\t\t\t\t\t\t\"NO_ANGGOTA\" => $invID,\n\t\t\t\t\t\t\t\"NO_IDENTITAS\" => $NO_IDENTITAS,\n\t\t\t\t\t\t\t\"JK\" => $JK,\n\t\t\t\t\t\t\t\"TMP_LAHIR\" => $TMP_LAHIR,\n\t\t\t\t\t\t\t\"TGL_LAHIR\" => $TGL_LAHIR,\n\t\t\t\t\t\t\t\"IBU_KANDUNG\" => $IBU_KANDUNG,\n\t\t\t\t\t\t\t\"USER\" => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t\t\"STATUS\" => $STATUS, \n\t\t\t\t\t\t\t\"ALAMAT\" => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t\t\"ALAMAT_DOMISILI\" => $ALAMAT_DOMISILI, \n\t\t\t\t\t\t\t\"AGAMA\" => $AGAMA,\n\t\t\t\t\t\t\t\"IDPROVINSI\" => $IDPROVINSI,\n\t\t\t\t\t\t\t\"IDKOTA\" => $IDKOTA,\n\t\t\t\t\t\t\t\"IDKECAMATAN\" => $IDKECAMATAN,\n\t\t\t\t\t\t\t\"IDKELURAHAN\" => $IDKELURAHAN,\n\t\t\t\t\t\t\t\"TELP\" => $TELP, \n\t\t\t\t\t\t\t\"TGL_DAFTAR\" => $TGL_DAFTAR, //date(\"Y-m-d\"), \n\t\t\t\t\t\t\t\"JABATAN\" => '2', //date(\"Y-m-d\"), \n\t\t\t\t\t\t\t\"AKTIF\" => 'Y' //date(\"Y-m-d\"), \n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t$insertProc = $this->dbasemodel->insertDataProc('m_anggota', $arrInsert);\n\t\t\t\t\t\t\n\t\t\t\t\t$getIdKas = $this->dbasemodel->loadsql(\"SELECT * FROM jenis_kas WHERE TMPL_SIMPAN = 'Y' AND KODECABANG='\".$CABANG.\"' LIMIT 1\")->row();\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"258\",\n\t\t\t\t\t\t'JUMLAH' => \"30000\",\n\t\t\t\t\t\t'KET_BAYAR' => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS, \n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan pokok '.$NAMA.' '.$noAgt\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp);\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp2 = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"180\",\n\t\t\t\t\t\t'JUMLAH' => \"50000\",\n\t\t\t\t\t\t'KET_BAYAR'\t => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS,\n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan mudharabah '.$NAMA.' '.$noAgt\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp2);\n\t\t\t\t\t\t\n\t\t\t\t\t$insertsimp3 = array(\n\t\t\t\t\t\t'ID_ANGGOTA' => $insertProc,\n\t\t\t\t\t\t'TGL_TRX' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\t'ID_JENIS' => \"259\",\n\t\t\t\t\t\t'JUMLAH' => \"20000\",\n\t\t\t\t\t\t'KET_BAYAR' => \"Tabungan\",\n\t\t\t\t\t\t'AKUN' => \"Setoran\",\n\t\t\t\t\t\t'DK' => \"D\", \n\t\t\t\t\t\t'ID_KAS' => $getIdKas->ID_JNS_KAS,\n\t\t\t\t\t\t'ID_KASAKUN' => $getIdKas->IDAKUN, \n\t\t\t\t\t\t'USERNAME' => $this->session->userdata('wad_user'),\n\t\t\t\t\t\t'NAMA_PENYETOR' => $NAMA,\n\t\t\t\t\t\t'NO_IDENTITAS' => $NO_IDENTITAS,\n\t\t\t\t\t\t'ALAMAT' => $ALAMAT_DOMISILI,\n\t\t\t\t\t\t'KODEPUSAT' => $this->session->userdata('wad_kodepusat'),\n\t\t\t\t\t\t'KODECABANG' => $CABANG,\n\t\t\t\t\t\t'KOLEKTOR' => \"0\",\n\t\t\t\t\t\t'STATUS' => \"0\",\n\t\t\t\t\t\t'KETERANGAN' => 'Setoran awal simpanan wajib '.$NAMA.' '.$noAgt\n\t\t\t\t\t); \n\t\t\t\t\t$this->dbasemodel->insertData('transaksi_simp', $insertsimp3);\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t$sqlcus = \"SELECT * FROM transaksi_simp WHERE UPDATE_DATA='0000-00-00 00:00:00' AND DATE(TGL_TRX)='\".date(\"Y-m-d\").\"' AND STATUS='0' AND KODECABANG='\".$CABANG.\"'\";\n\t\t\t\n\t\t\t\t\t$cus = $this->dbasemodel->loadsql($sqlcus);\n\t\t\t\t\t\n\t\t\t\t\tif($cus->num_rows()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($cus->result() as $key)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t// Insert data transaksi simpanan ke jurnal transaksi(table vtransaksi) \n\t\t\t\t\t\t\t$datatransaksi = array( 'tgl' => $key->TGL_TRX, 'jumlah' => $key->JUMLAH, 'keterangan' => $key->KETERANGAN, 'ket_dt' => $key->KETERANGAN, 'user' => $key->USERNAME, 'kodecabang' => $key->KODECABANG, 'idkasakun' => $key->ID_KASAKUN);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->ModelVTransaksi->insertVtransaksi($key->ID_TRX_SIMP, $datatransaksi, 'ST', $key->ID_KAS, $key->ID_JENIS, 'SIMP');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ceklst = $this->dbasemodel->loadsql(\"SELECT * FROM m_anggota_simp WHERE IDANGGOTA='\".$key->ID_ANGGOTA.\"' AND IDJENIS_SIMP='\".$key->ID_JENIS.\"'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ceklst->num_rows()>0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$rchek = $ceklst->row();\n\t\t\t\t\t\t\t\t$sql = sprintf(\"UPDATE m_anggota_simp SET SALDO = (SALDO + %s) WHERE ID_ANG_SIMP = %s \", $key->JUMLAH, $rchek->ID_ANG_SIMP);\n\t\t\t\t\t\t\t\t$this->dbasemodel->loadSql($sql); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$datacheclist = array(\"IDANGGOTA\"\t => $key->ID_ANGGOTA,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"IDJENIS_SIMP\" => $key->ID_JENIS,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"SALDO\" => $key->JUMLAH,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"TGLREG\"\t\t => date(\"Y-m-d\", strtotime($key->TGL_TRX)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->dbasemodel->insertData(\"m_anggota_simp\",$datacheclist);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$wheresimp = \"ID_TRX_SIMP = '\". $key->ID_TRX_SIMP.\"'\";\n\t\t\t\t\t\t\t$updatesimp = array(\"UPDATE_DATA\"=>date(\"Y-m-d H:i:s\"), \"STATUS\"=>\"1\");\n\t\t\t\t\t\t\t$this->dbasemodel->updateData(\"transaksi_simp\", $updatesimp, $wheresimp);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$wanggota = \"IDANGGOTA = '\". $key->ID_ANGGOTA.\"'\";\n\t\t\t\t\t\t\t$uanggota = array(\"AKTIF\"=>\"Y\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->dbasemodel->updateData(\"m_anggota\", $uanggota, $wanggota);\t \n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t$numrow++;\n \n\t\t\t} \n unlink(realpath('uploads/temp/'.$data_upload['file_name']));\n \n $this->session->set_flashdata('notif', '<div class=\"alert alert-success\"><b>PROSES IMPORT BERHASIL!</b> Data berhasil diimport!</div>');\n \n redirect('importanggota');\n\n }\n }", "public function loadWiners(PointVente $pointVente,$date,$fileName)\n {\n $manager = $this->getDoctrine()->getManager();\n $path = $this->get('kernel')->getRootDir(). \"/../web/import/\".$fileName;\n $objPHPExcel = $this->get('phpexcel')->createPHPExcelObject($path);\n $winers= $objPHPExcel->getSheet(0);\n $highestRow = $winers->getHighestRow(); // e.g. 10\n for ($row = 1; $row <= $highestRow; ++ $row) {\n $nom = $winers->getCellByColumnAndRow(0, $row);\n $numero = $winers->getCellByColumnAndRow(1, $row);\n $quantite = $winers->getCellByColumnAndRow(2, $row);\n $offert = $winers->getCellByColumnAndRow(3, $row);\n $gagnant=new Gagnant( $nom->getValue(),$numero->getValue(),$quantite->getValue(),$offert->getValue());\n $gagnant->setPointVente($pointVente)->setDate($date)->setObject('Bouteille');\n $manager->persist($gagnant);\n }\n $manager->flush(); \n }", "public function getFromCsvImport($importValue)\n {\n try {\n $value = new Pimcore_Date(strtotime($importValue));\n return $value;\n } catch (Exception $e) {\n return null;\n }\n }", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function deleteByImportDate($date)\n {\n $this\n ->mongo\n ->where('import_date', $date)\n ->deleteAll($this->collection)\n ;\n }", "function dayReadings($xml=\"data/brislington_no2.xml\", $day=\"13\", $month=\"12\", $year=\"2016\") {\n\n\t$Data = [];\n\t$xmlReader = new XMLReader();\n\t$xmlReader->open('../' . $xml);\n\n\t$array = [];\n\n\n\t$array[] = $year;\n\t$array[] = $month;\n\t$array[] = $day;\n\n\t$combined_date = implode('/', $array);\n\n\t$timeStamp2 = strtotime($combined_date); //check this is correct\n\t$formatted_date = zeroMonth($combined_date);\n\n\twhile($xmlReader->read()) {\n\t\tif($xmlReader->nodeType == XMLReader::ELEMENT && $xmlReader->localName == \"reading\") {\n\n\t\t\t$date = $xmlReader->getAttribute('date');\n\t\t\t$date = str_replace('/', '-', $date);\n\t\t\t$timeStamp1 = strtotime($date);\n\n\t\t\tif($timeStamp1 == $timeStamp2) {\n\n\t\t\t\t$no2 = $xmlReader->getAttribute('no2');\n\t\t\t\t$time = $xmlReader->getAttribute('time');\n\n\t\t\t\t$s = strtotime($time);\n\n\t\t\t\t$Data[] = array(\n\t\t\t\t\t\t'no2' => $no2,\n\t\t\t\t\t\t'time' => $time\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t$t = array();\n\n\tforeach($Data as $key=>$row) {\n\t\t$t[$key] = $row['time'];\n\t}\n\n\tarray_multisort($t, SORT_ASC, $Data);\n\n\tforeach($Data as $key=>$value) {\n\n\t\t$s = strtotime($value['time']);\n\n\t\t$date_object = 'Date(' . $formatted_date[2]. ',' . $formatted_date[1] .',' . $formatted_date[0] . ',' . date('G', $s) . ',' . date('i', $s) . ',' . date('s', $s) . ')';\n\n\t\t$Data[$key]['time'] = $date_object;\n\t}\n\n\treturn $Data;\n}", "public function getFromWebserviceImport($value)\n {\n $timestamp = strtotime($value);\n if (empty($value)) {\n return null;\n } else if ($timestamp !== FALSE) {\n return new Pimcore_Date($timestamp);\n } else {\n throw new Exception(\"cannot get values from web service import - invalid data\");\n }\n }", "public function readDate()\n {\n $dateReference = $this->readInteger();\n\n $refObj = $this->getReferenceObject($dateReference);\n if($refObj !== false)\n return $refObj;\n\n //$timestamp = floor($this->_stream->readDouble() / 1000);\n $timestamp = new DateTime();\n $timestamp->setTimestamp(floor($this->_stream->readDouble() / 1000));\n\n $this->_referenceObjects[] = $timestamp;\n\n return $timestamp;\n }", "public function import(){\n if(\\Storage::disk('local')->exists('/public/universidades.xlsx')){\n Excel::load('public/storage/universidades.xlsx', function($reader) {\n foreach ($reader->get() as $book) {\n $universidad = new University();\n $universidad->nombre = $book->nombre;\n $universidad->save();\n }\n });\n\n \\Alert::message('Universidades importadas exitosamente', 'success');\n return redirect('/universidades');\n }else{\n \\Alert::message('El archivo universidades.csv no existe, importalo por favor', 'danger');\n return redirect('/universidades');\n }\n }", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "public function getDateDebut();", "public function setDate($date);", "public function getProgramDateAttribute()\n {\n return excel_date($this->program->start_date);\n }", "public function testV1ImportDaysPost()\n {\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "function gttn_tpps_xlsx_translate_date($date) {\n if (strtotime($date) !== FALSE) {\n return $date;\n }\n\n if ($date > 60) {\n $date = $date - 1;\n return date(\"m/d/Y\", strtotime(\"12/31/1899 +$date days\"));\n }\n if ($date < 60) {\n return date(\"m/d/Y\", strtotime(\"12/31/1899 +$date days\"));\n }\n\n return NULL;\n}", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "function getData()\n {\n return $this->date;\n }", "function importExecl($inputFileName) {\n if (!file_exists($inputFileName)) {\n echo \"error\";\n return array(\"error\" => 0, 'message' => 'file not found!');\n }\n //vendor(\"PHPExcel.PHPExcel.IOFactory\",'','.php'); \n vendor(\"PhpExcel.PHPExcel\", '', '.php');\n vendor(\"PhpExcel.PHPExcel.IOFactory\", '', '.php');\n //'Loading file ', pathinfo( $inputFileName, PATHINFO_BASENAME ),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';\n $fileType = \\PHPExcel_IOFactory::identify($inputFileName); //文件名自动判断文件类型\n $objReader = \\PHPExcel_IOFactory::createReader($fileType);\n // $objReader = \\PHPExcel_IOFactory::createReader('Excel5');\n $objPHPExcel = $objReader->load($inputFileName);\n $sheet = $objPHPExcel->getSheet(0);\n $highestRow = $sheet->getHighestRow(); //取得总行数\n $highestColumn = $sheet->getHighestColumn(); //取得总列\n $highestColumnIndex = \\PHPExcel_Cell::columnIndexFromString($highestColumn); //总列数\n for ($row = 2; $row <= $highestRow; $row++) {\n $strs = array();\n //注意highestColumnIndex的列数索引从0开始\n for ($col = A; $col <= $highestColumn; $col++) {\n $strs[$col] = $sheet->getCell($col . $row)->getValue();\n }\n $arr[] = $strs;\n }\n return $arr;\n}", "public function readFile()\r\n {\r\n\r\n $fileName_FaceBook = Request::all();\r\n\r\n //dd($fileName_FaceBook['From']);\r\n //dd($fileName_FaceBook);\r\n\r\n $dateStart = Carbon::parse($fileName_FaceBook['dateStartFrom']);\r\n $dateEnd = Carbon::parse($fileName_FaceBook['dateEndsTo']);\r\n\r\n dump($dateStart);\r\n dump($dateEnd);\r\n\r\n // The object returned by the file method is an instance of the Symfony\\Component\\HttpFoundation\\File\\UploadedFile\r\n\r\n $path = $fileName_FaceBook['fileName_FaceBook']->getRealPath();\r\n $name =$fileName_FaceBook['fileName_FaceBook']->getClientOriginalName();\r\n //dump($fileName_FaceBook['fileName_FaceBook']->getClientOriginalName());\r\n\r\n $this->readMetricsFromCSV($path, $dateStart, $dateEnd);\r\n\r\n\r\n }", "protected function parseDate($date)\n {\n if (substr($date, 0, 5) != 'Date(') throw new Exception(\"Failed to parse Date $date\");\n $date = substr($date, 5, -1);\n $parts = explode(',', $date);\n\n $dt = new \\DateTime();\n $dt->setDate($parts[0], $parts[1] + 1, $parts[2]);\n if (count($parts) == 6) {\n $dt->setTime($parts[3], $parts[4], $parts[5]);\n }\n\n return $dt;\n }", "public function upload()\n {\n $this->load->library('upload');\n $fileName = $_FILES['import']['name'];\n\n $config['upload_path'] = './assets'; //buat folder dengan nama assets di root folder\n $config['file_name'] = $fileName;\n $config['allowed_types'] = 'xls|xlsx|csv';\n $config['max_size'] = 10000;\n $config['overwrite'] = TRUE;\n\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('import')) {\n $this->upload->display_errors();\n }\n $inputFileName = './assets/' . $fileName;\n\n try {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } catch (Exception $e) {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME) . '\": ' . $e->getMessage());\n }\n\n $sheet = $objPHPExcel->getSheet(0);\n $highestRow = $sheet->getHighestRow();\n $startRow = 2;\n $rowData = array();\n if ($highestRow > 1) {\n $highestColumn = $sheet->getHighestColumn();\n $insert = FALSE;\n for ($row = 0; $row < $highestRow - 1; $row++) {\n // Read a row of data into an array\n $tmp = $sheet->rangeToArray('A' . $startRow . ':' . 'N' . $startRow++, NULL, TRUE, FALSE)[0];\n if(substr($tmp[12], 0, 1) != '0'){\n \t$tmp[12] = '0' . $tmp[12];\n }\n $data = array(\n \"nama\" => $tmp[0],\n \"merk\" => $tmp[1],\n \"tipe\" => $tmp[2],\n \"ukuran\" => $tmp[3],\n \"satuan\" => $tmp[4],\n \"hargaPasar\" => $tmp[5],\n \"biayaKirim\" => $tmp[6],\n \"resistensi\" => $tmp[7],\n \"ppn\" => $tmp[8],\n \"hargashsb\" => $tmp[9],\n \"keterangan\" => $tmp[10],\n \"spesifikasi\" => $tmp[11],\n \"kode_kategori\" => $tmp[12],\n \"tahun_anggaran\" => $tmp[13],\n \"createdBy\" => $this->ion_auth->get_user_id(),\n );\n array_push($rowData, $data);\n }\n\n if ($this->barang_m->insert_many($rowData)) {\n $this->message('Berhasil! Data berhasil di upload', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n redirect(site_url('katalog/add'));\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function getImportDateTime()\n {\n return $this->importDateTime;\n }", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function importExternalData($source){\n //importing data into db\n $this->log(\"importing external: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function importRefData($source){\n //importing data into db\n $this->log(\"importing ref: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "function add_day() {\n\t\t\t$date = new DateTime($this->entry_date);\n\t\t\t\n\t\t\t$qry = sprintf(\"INSERT INTO %s (tkr_id, entry_date, open, high, low, close, volume, adj_close) \n\t\t\t\t\tVALUES (%d,'%s',%8.2f,%8.2f,%8.2f,%8.2f,%d,%8.2f)\",\n\t\t\t\t\tmysql_real_escape_string(HISTORICAL_TBL), $this->tkr_id, mysql_real_escape_string($date->format('Y-m-d')),\n\t\t\t\t\t$this->open, $this->high, $this->low, $this->close, $this->vol, $this->adj_close);\n\t\t\tmysql_query($qry) or die(mysql_error());\n\t\t\t}", "abstract public function loadData();" ]
[ "0.63935465", "0.5383829", "0.5358083", "0.52945375", "0.5253769", "0.5250818", "0.52362937", "0.5230737", "0.5124974", "0.5115753", "0.51148826", "0.5112987", "0.5097512", "0.5081924", "0.50787884", "0.503333", "0.50328803", "0.49959266", "0.4974711", "0.49707046", "0.49656928", "0.4941802", "0.4941396", "0.49322814", "0.4926974", "0.49131408", "0.4902105", "0.4885115", "0.4878412", "0.48776656", "0.48604715", "0.48454943", "0.4834011", "0.48319793", "0.48288524", "0.48228225", "0.48222214", "0.48201063", "0.47985205", "0.47963074", "0.47892988", "0.47601968", "0.47565967", "0.47446918", "0.47153088", "0.47098848", "0.47073278", "0.47064453", "0.47034556", "0.46999365", "0.46981066", "0.4681961", "0.46680933", "0.46622157", "0.4661732", "0.46591753", "0.46582294", "0.465704", "0.46495894", "0.46495894", "0.464926", "0.46458435", "0.46350363", "0.46345687", "0.46336785", "0.46278763", "0.46203208", "0.46185845", "0.46158475", "0.46132588", "0.46108288", "0.46103898", "0.46074975", "0.4607478", "0.46069792", "0.4587134", "0.45847914", "0.4584748", "0.45839486", "0.45801714", "0.4579022", "0.45731664", "0.45680028", "0.45655233", "0.4545228", "0.45395333", "0.45295095", "0.4526627", "0.45227653", "0.45224863", "0.45188308", "0.45124406", "0.4508825", "0.45079345", "0.44952366", "0.44911122", "0.44838947", "0.4483843", "0.44777542", "0.4477362" ]
0.49546182
21
Method for importing a file data cell.
protected function process_data_file(import_settings $settings, $field, $data_record, $value) { $list = $value->getElementsByTagName('a'); $a = $list->item(0); $href = $a->getAttribute('href'); $text = $this->get_innerhtml($a); $result = $this->process_data_default($settings, $field, $data_record, $text); $file_record = new object(); $file_record->contextid = $this->get_context()->id; $file_record->component = 'mod_data'; $file_record->filearea = 'content'; $file_record->itemid = $result->id; $file_record->filepath = '/'; $file_record->filename = $result->content; $fs = get_file_storage(); $fs->create_file_from_pathname($file_record, dirname($settings->get_path()) . '/' . $href); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function import(string $filePath);", "public function import_from_file($filename)\n {\n }", "public function importExcel($path);", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "function import(array $data);", "public function importFrom(array $data);", "private function reedImportFile()\n {\n $reader = IOFactory::createReader('Xlsx');\n\n $reader->setReadDataOnly(true);\n\n $spreadsheet = $reader->load($this->getFullPathToUploadFile());\n\n $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true);\n\n $this->resultReedImportFile = $sheetData;\n }", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function import(array $data): void;", "public function import($params)\n {\n $this->results->basename = $params['basename'];\n $this->results->filepath = $params['filepath'];\n \n $this->project = $project = $params['project'];\n $this->projectId = $project->getId();\n \n $ss = $this->reader->load($params['filepath']);\n\n //if ($worksheetName) $ws = $reader->getSheetByName($worksheetName);\n $ws = $ss->getSheet(0);\n \n $rows = $ws->toArray();\n \n $header = array_shift($rows);\n \n $this->processHeaderRow($header);\n \n // Insert each record\n foreach($rows as $row)\n {\n $item = $this->processDataRow($row);\n \n $this->processItem($item);\n }\n $this->gameRepo->commit();\n \n return $this->results;\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "private function _import($file, $filetype, $locator)\n \n{\n $modelIri = (string)$this->_model;\n\n try {\n if($this->_erfurt->getStore()->importRdf($modelIri, $file, $filetype, $locator)){\n \t$this->_owApp->appendSuccessMessage('Data successfully imported!');\n }\n } catch (Erfurt_Exception $e) {\n // re-throw\n throw new OntoWiki_Controller_Exception(\n 'Could not import given model: ' . $e->getMessage(),\n 0,\n $e\n );\n }\n \n }", "public function import();", "public function importUsersData(Request $request){\n\t\t\tif (empty($request->file('file')))\n\t {\n\t return back()->with('error','No file selected');\n\t }\n\t else{\n\t\t\t\t// validasi\n\t\t\t\t$this->validate($request, [\n\t\t\t\t\t'file' => 'required|mimes:csv,xls,xlsx'\n\t\t\t\t]);\n\n\t\t\t\t// menangkap file excel\n\t\t\t\t$file = $request->file('file');\n\n\t\t\t\t// membuat nama file unik\n\t\t\t\t$nama_file = rand().$file->getClientOriginalName();\n\n\t\t\t\t// upload ke folder file_siswa di dalam folder public\n\t\t\t\t$file->move(public_path('dataset'), $nama_file);\n\n\t\t\t\tExcel::import(new UsersImport, public_path('/dataset/'.$nama_file));\n\t \n\t\t\t\treturn redirect()->back()->with(['success' => 'Has been uploaded']);\n\t\t\t}\n }", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "function importFile()\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\tif ($_FILES[\"bkmfile\"][\"error\"] > UPLOAD_ERR_OK)\n\t\t{\n\t\t\tilUtil::sendFailure($this->lng->txt(\"import_file_not_valid\"));\n\t\t\t$this->newFormBookmark();\n\t\t\treturn;\n\t\t}\n\t\trequire_once (\"./Services/PersonalDesktop/classes/class.ilBookmarkImportExport.php\");\n\t\t$objects=ilBookmarkImportExport::_parseFile ($_FILES[\"bkmfile\"]['tmp_name']);\n\t\tif ($objects===false)\n\t\t{\n\t\t\tilUtil::sendFailure($this->lng->txt(\"import_file_not_valid\"));\n\t\t\t$this->newFormBookmark();\n\t\t\treturn;\n\t\t}\n\t\t// holds the number of created objects\n\t\t$num_create=array('bm'=>0,'bmf'=>0);\n\t\t$this->__importBookmarks($objects,$num_create,$this->id,0);\n\n\t\tilUtil::sendSuccess(sprintf($this->lng->txt(\"bkm_import_ok\"),$num_create['bm'],\n\t\t\t$num_create[ 'bmf']));\n\t\t$this->view();\n\n\n\t}", "public function import_file(){\n\t\tif(isset($this->session->isactive)){\n\t\t\t// Uploading file given by user to @root/data files folder\n\t\t\t// and then dumping the data into student table\n\n\t\t\tif($_FILES['file']['tmp_name']){\n\t\t\t\tmove_uploaded_file($_FILES['file']['tmp_name'], 'data files/'.$_FILES['file']['name']);\n\t $path = str_replace('\\\\','/',realpath('data files/'.$_FILES['file']['name']));\n\n\t $this->load->database();\n\t $query = $this->db->query(\"LOAD DATA LOCAL INFILE '\".$path.\"'\n\t INTO TABLE tbl_students COLUMNS TERMINATED BY '\\\\t'\");\n\n\t\t\t\tif($query){\n\t\t\t\t\t$this->input->set_cookie('message_code','2',1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->input->set_cookie('message_code','4',1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->input->set_cookie('message_code','3',1);\n\t\t\t}\n\n\t\t\tredirect('import');\n\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function import(HTTPRequest $request)\n {\n $hasheader = (bool)$request->postVar('HasHeader');\n $cleardata = $this->component->getCanClearData() ?\n (bool)$request->postVar('ClearData') :\n false;\n if ($request->postVar('action_import')) {\n $file = File::get()\n ->byID($request->param('FileID'));\n if (!$file) {\n return \"file not found\";\n }\n\n $temp_file = $this->tempFileFromStream($file->getStream());\n\n $colmap = Convert::raw2sql($request->postVar('mappings'));\n if ($colmap) {\n //save mapping to cache\n $this->cacheMapping($colmap);\n //do import\n $results = $this->importFile(\n $temp_file,\n $colmap,\n $hasheader,\n $cleardata\n );\n $this->gridField->getForm()\n ->sessionMessage($results->getMessage(), 'good');\n }\n }\n $controller = $this->getToplevelController();\n $controller->redirectBack();\n }", "public function import(Request $request)\n {\n $this->validate($request, array(\n 'file' => 'required'\n ));\n\n if ($request->hasFile('file')) {\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n $path = $request->file->getRealPath();\n $insert = [];\n $result = Excel::load($path, function ($reader) {\n// $i = 0;\n// $result = $reader->get();\n })->get();\n $i = 0;\n foreach ($result as $row) {\n// dump([$i => $row]);\n if ($i > 1) {\n if ($row[0] != null) {\n $insert[] = [\n 'name' => $row[0],\n 'surname' => $row[1]\n ];\n }\n }\n $i++;\n }\n if (!empty($insert)) {\n $insertData = DB::table('students')->insert($insert);\n if ($insertData) {\n Session::flash('success', 'Your Data has successfully imported');\n } else {\n Session::flash('error', 'Error inserting the data..');\n return redirect()->route('index');\n }\n }\n }\n return redirect()->route('index');\n } else {\n Session::flash('error', 'File is a ' . $extension . ' file.!! Please upload a valid xls/csv file..!!');\n return back();\n }\n }", "public function importFile($filepath, $colmap = null, $hasheader = true, $cleardata = false)\n {\n $loader = $this->component->getLoader($this->gridField);\n $loader->deleteExistingRecords = $cleardata;\n\n //set or merge in given col map\n if (is_array($colmap)) {\n $loader->columnMap = $loader->columnMap ?\n array_merge($loader->columnMap, $colmap) : $colmap;\n }\n $loader->getSource()\n ->setFilePath($filepath)\n ->setHasHeader($hasheader);\n\n return $loader->load();\n }", "public function import()\n {\n \n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "public function import(): void;", "protected function importDatabaseData() {}", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "function import_file($contents) {\n\t\ttrigger_error('Importer::import_file needs to be implemented', E_USER_ERROR);\n\t\t\n\t}", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "public function metaImport($data);", "public function import(Request $request)\n {\n //bulk upload of employees\n $request->validate([\n 'file' => 'required'\n ]);\n\n Excel::import(new ImportEmployees, request()->file('file'));\n Toastr::success('File Imported Successfully','Success');\n return redirect()->back();\n // $file = $request->file('file');\n\n // if (isset($file))\n // {\n // $filename = $file->getClientOriginalName();\n\n // if (!file_exists('uploads/imports'))\n // {\n // mkdir('uploads/imports',0777,true);\n // }\n // $file->move('uploads/imports',$filename);\n // Excel::import(new ImportEmployees, request()->file('file'));\n // Toastr::success('File Imported Successfully','Success');\n \n // return redirect()->back();\n // }else{\n // $filename = \"default.xlss\";\n // return \"NO file\";\n // }\n }", "public function loadCsvFile($file)\n {\n $data = [];\n\n if (file_exists($file)) {\n $data = array_map('str_getcsv', file($file));\n\n array_walk($data, function(&$row) use ($data) {\n $row = array_combine($data[0], $row);\n });\n\n array_shift($data);\n }\n else {\n wp_die(__('Import file does not exist.'));\n }\n\n $this->data = $data;\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function importFile($filename, $recordId, $field, $event = null, $repeatInstance = null)\n {\n $data = array (\n 'token' => $this->apiToken,\n 'content' => 'file',\n 'action' => 'import',\n 'returnFormat' => 'json'\n );\n \n #----------------------------------------\n # Process non-file arguments\n #----------------------------------------\n $data['file'] = $this->processFilenameArgument($filename);\n $data['record'] = $this->processRecordIdArgument($recordId);\n $data['field'] = $this->processFieldArgument($field);\n $data['event'] = $this->processEventArgument($event);\n $data['repeat_instance'] = $this->processRepeatInstanceArgument($repeatInstance);\n \n \n #---------------------------------------------------------------------\n # For unknown reasons, \"call\" (instead of \"callWithArray\") needs to\n # be used here (probably something to do with the 'file' data).\n # REDCap's \"API Playground\" (also) makes no data conversion for this\n # method.\n #---------------------------------------------------------------------\n $result = $this->connection->call($data);\n \n $this->processNonExportResult($result);\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function importCsv($uploadedFile)\n {\n //read the file, check validation and insert into db at once.\n Excel::import(new PostsImport, $uploadedFile);\n\n //save the uploaded file.\n //get just extension.\n $ext = $uploadedFile->getClientOriginalExtension();\n //make the file name.\n $filename = Auth::id() . '_' . date(\"Y-m-d_H-i-s\") . '.' . $ext;\n //save the file.\n $uploadedFile->storeAs('public/upload_file', $filename);\n }", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "public function importFile(Request $request){\n\n return $request->all();\n\n if($request->hasFile('sample_file')){\n\n $path = $request->file('sample_file')->getRealPath();\n\n $data = \\Excel::load($path)->get();\n\n\n if($data->count()){\n\n foreach ($data as $key => $value) {\n\n $personal = Personal::updateOrCreate(\n ['p00' => $value->p00],\n ['oficina_id' => $value->oficina_id,\n 'rol_id' => $value->rol_id,\n 'p00' => $value->p00,\n 'name' => $value->name]\n );\n\n $personal->save();\n\n }\n\n }\n\n }\n\n }", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}", "public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function importDataFile($file, FromDataFile $model)\n {\n $csv = new \\SplFileObject($file);\n $csv->setFlags(SplFileObject::READ_CSV);\n\n $this->info(' Warming up progress bar.', 1);\n $bar = new ProgressBar($this->getOutput(), $this->getTotalLines($csv));\n\n $batched = collect();\n\n $csv->seek(1);\n while (!$csv->eof()) {\n if (count($csv->current()) <= 1) {\n $bar->advance();\n\n continue;\n }\n\n $batched->push($model::fromDataFile($csv->current()));\n\n if ($batched->count() % 1000 === 0) {\n $model::insert($batched->toArray());\n\n $bar->advance(1000);\n\n $batched = collect();\n }\n\n $csv->next();\n }\n\n if ($batched->count() > 0) {\n $model::insert($batched->toArray());\n\n $bar->advance($batched->count());\n }\n }", "public function parseImport(Request $request)\n\t{\n\t\t$db_fields = array(self::COL_STUDENT_NR, self::COL_FIRSTNAME, self::COL_PREFIX, self::COL_LASTNAME);\n\t\t$importCsv = new ImportCsv;\n\t\t$file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\n\t\tif (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) {\n\t\t\t$arr_file = explode('.', $_FILES['file']['name']);\n\t\t\t$extension = end($arr_file);\n\n\t\t\tif ($extension == 'csv') {\n\t\t\t\t$reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();\n\t\t\t} else {\n\t\t\t\treturn redirect('importcsv')->with('status', 'Not a CSV file!');\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\treturn redirect('importcsv')->with('status', 'Invalid CSV file!');\n\t\t\t}\n\n\t\t\t$sheetData = $spreadsheet->getActiveSheet()->toArray();\n\n\t\t\t$importCsv->tmpSaveCsv($request, $sheetData);\n\t\t\treturn view('import_fields', ['csv_data' => $sheetData, 'db_fields' => $db_fields]);\n\t\t} else {\n\t\t\treturn back()->with('status', 'This is not a CSV file!');\n\t\t}\n\t}", "public function import($fileName, $blfName) {\n\t\t$this->_blfName = $blfName;\n\t\t$this->fileName = $fileName;\n\t\t$missionId = - 1;\n\t\t$this->loadingStep = 0;\n\t\t\n\t\tini_set ( \"memory_limit\", \"1024M\" );\n\t\t\n\t\tset_time_limit ( 1000 );\n\t\t\n\t\tif (! $this->uploaded) {\n\t\t\t$file = sfConfig::get ( 'app_import_data_stack_log' );\n\t\t\t$csv_file = sfConfig::get ( 'app_import_path_stack_log' ) . DIRECTORY_SEPARATOR . $this->year . DIRECTORY_SEPARATOR . $this->month . DIRECTORY_SEPARATOR . $this->day . DIRECTORY_SEPARATOR . $file;\n\t\t} else {\n\t\t\t$csv_file = sfConfig::get ( 'sf_upload_dir' ) . '/' . $fileName;\n\t\t}\n\t\t\n\t\tif (file_exists ( $csv_file )) {\n\t\t\t$handle = fopen ( $csv_file, \"r\" );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Print error to STDERR and exit the whole script.\n\t\t\t */\n\t\t\tfwrite ( STDERR, \"[\" . date ( 'Y-m-d H:i:s' ) . \"] [stack] Csv-file from \" . date ( 'Y-m-d', $this->calendar_date ) . \" not found.\\n\" );\n\t\t\t\n\t\t\treturn $missionId;\n\t\t}\n\t\t\n\t\t// start working on the file\n\t\tif ($handle) {\n\t\t\t\n\t\t\t/*\n\t\t\t * Read csv-file and put contents to the associative array $import_data\n\t\t\t */\n\t\t\t$import_data = array ();\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t// get field names - column headers\n\t\t\t$fieldnames = fgetcsv ( $handle, 4096, \",\" );\n\t\t\t// $this->printArray($fieldnames);\n\t\t\t\n\t\t\t$dateTimeRow = null;\n\t\t\t\n\t\t\twhile ( ($line = fgets ( $handle )) !== FALSE ) {\n\t\t\t\t$rowData = $this->getCsvWoWhiteSpace ( $line );\n\t\t\t\t\n\t\t\t\t$row ++;\n\t\t\t\t$number_of_columns = count ( $rowData );\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < $number_of_columns; $i ++) {\n\t\t\t\t\t$trimmed = trim ( $rowData [$i] );\n\t\t\t\t\t$import_data [$fieldnames [$i]] = $trimmed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// $this->printArray($import_data);die();\n\t\t\t\t$this->padData ( $import_data );\n\t\t\t\t$this->_currentRowDateTime = $import_data [LoggerFields::Data_Time_UTC];\n\t\t\t\t$this->analyzeRecord ( $import_data );\n\t\t\t}\n\t\t\t\n\t\t\tfclose ( $handle );\n\t\t\t$this->missionEnded ();\n\t\t\t// echo \"mission endede\";//debug\n\t\t\t$number_of_entries = $row;\n\t\t}\n\t\t// echo \"import done\"; die();\n\t\treturn $this->_mission;\n\t}", "public function indexImport()\n\t{\n\t\t$this->commons->isAdmin();\n\t\t$filename = $_FILES[\"file\"][\"tmp_name\"];\n\t\t$data = '';\n\t\t$row = 0;\n\t\t$expire = date('Y-m-d', strtotime('+1 years'));\n\t\tif ($_FILES[\"file\"][\"size\"] > 0) {\n\t\t\t$file = fopen($filename, \"r\");\n\t\t\twhile (($getData = fgetcsv($file, 10000, \",\")) !== FALSE) {\n\t\t\t\tif ($row == 0 && $getData[0] !== 'Salutation' && $getData[1] !== 'First Name' && $getData[2] !== 'Last Name' && $getData[3] !== 'Company' && $getData[4] !== 'Email Address' && $getData[5] !== 'Phone Number' && $getData[6] !== 'Website' && $getData[7] !== 'Address Line 1' && $getData[8] !== 'Address Line 2' && $getData[9] !== 'City' && $getData[10] !== 'State' && $getData[11] !== 'Country' && $getData[12] !== 'Postal Code') {\n\t\t\t\t\techo 0;\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\tif ($row > 0) {\n\t\t\t\t\t$temp = array('address1' => $getData[7], 'address2' => $getData[8], 'city' => $getData[9], 'state' => $getData[10], 'country' => $getData[11], 'pin' => $getData[12], 'phone1' => '', 'fax' => '');\n\t\t\t\t\t$data .= \"('\" . $getData[0] . \"','\" . $getData[1] . \"','\" . $getData[2] . \"','\" . $getData[3] . \"','\" . $getData[4] . \"','\" . $getData[5] . \"','\" . $getData[6] . \"','\" . json_encode($temp) . \"','\" . $getData[11] . \"','\" . $expire . \"'),\";\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t\t$data = rtrim($data, ',');\n\t\t$result = $this->contactModel->importContact($data);\n\t\tif ($result) {\n\t\t\techo 1;\n\t\t} else {\n\t\t\techo 0;\n\t\t}\n\t}", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function import($filename = self::PHP_PUTDATA) {\n\n $fh = fopen($filename, 'r');\n\n while (($row = fgets($fh)) !== false) {\n\n if (!empty($row)) {\n\n list($key, $val) = explode(' ', $row);\n $key = $this->getRedisKey(trim($key));\n $val = trim($val);\n\n if ($this->getGraph()->persistent) {\n Redis::getRedis()->set($key, $val);\n } else {\n Redis::getRedis()->set($key, $val, Config::getConfig()->redis->ttl);\n }\n\n }\n\n }\n\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }", "function imports($files = array(), &$data = array())\r\n\t{\r\n\t\t\r\n\t}", "public function importData($file, $dbTable)\n {\n $query = \"\n LOAD DATA LOCAL INFILE '{$file}'\n INTO TABLE {$dbTable} \n FIELDS TERMINATED BY '|'\n (service_no, c, ptp, @person_type_name, member_name, \n s, service_name, rank_rate, pg, occ, occupation_name,\n birth_date, g, hor_city, hor_county, hor_cntry, \n hor_st, state_prv_nm, marital_status, religion_name, \n l, race_name, ethnic_name, race_omb, ethnic_group_name, \n cas_circumstances, cas_city, cas_st, cas_ctry, cas_region_code,\n country_or_water_name, unit_name, d, process_dt, death_dt,\n year, wc, oitp, oi_name, oi_location, close_dt, aircraft, \n h, casualty_type_name, casualty_category, casualty_reason_name, \n csn, body, casualty_closure_name, wall, incident_category,\n i_status_dt, i_csn, i_h, i_aircraft, @created_at, @updated_at)\n SET created_at=NOW(), updated_at=null, person_type_name=LOWER(person_type_name)\";\n\n DB::connection()->getpdo()->exec($query);\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "protected function loadRow() {}", "function loadFileData() {\n if (isset($this->params['file_id'])) {\n if (isset($this->params['version_id']) && $this->params['version_id'] > 0) {\n $this->currentFile = $this->getFile($this->params['file_id'], $this->params['version_id']);\n } else {\n $this->currentFile = $this->getFile($this->params['file_id']);\n }\n $fileData = $this->getFileTrans(\n $this->params['file_id'], $this->lngSelect->currentLanguageId\n );\n if (isset($fileData[$this->params['file_id']])) {\n $this->currentFileData = $fileData[$this->params['file_id']];\n } else {\n unset($this->currentFileData);\n }\n }\n }", "function import($file , $load_time = 0, $on_init = false)\r\n\t{\r\n\t\treturn parent::import($file, $load_time);\r\n\t}", "private function parseFile() {\t\n\n\t\t\t$database;\n\n\t\t\t$lastRowWasBlank = TRUE;\n\t\t\t$isAttributesRow = FALSE;\n\t\t\t$isBlankRow = FALSE;\n\t\t\t$attributes;\n\t\t\t$tupleObjects;\n\t\t\t$tupleObjectCount=0;\n\t\t\t$spreadSheetTuples;\n\t\t\t\n\n\t\t\t$countTableNames = count($this->tableNames);\n\n\t\t\tif (($handle = fopen($_FILES['file']['tmp_name'], 'r')) !== FALSE) {\n\t\t\t\t//begin looping through spreadsheet\n \t\t\twhile (($data = fgetcsv($handle, 1000000, ',')) !== FALSE) {\n\n \t\t\t\t// loop through the row to see if its blank\n \t\t\t$num = count($data);\n \t\t\t$nullCount = 0;\n\t\t\t for ($i=0; $i < $num; $i++) {\n\t\t\t\t\t\t if($data[$i] == NULL) {\n\t\t\t \t\t$nullCount ++;\n\t\t\t \t}\n\t\t\t \t}\n\n\t\t\t \t// if entire row is null, ignore the row, set lastRowWasBlank as true for next pass\n\t\t\t\t\tif($num==$nullCount){\n\t\t\t \t$lastRowWasBlank = TRUE;\n\t\t\t }else{\n\t\t\t\t \t// if last row was blank, next row with text is the name of the table.\n\t\t\t\t \t// name of the table may be slightly different than actual table name,\n\t\t\t\t \t// so this finds a match to the db name. It uses the array built from\n\t\t\t\t \t// the \"QueryTablesAndAttributes\" function in conjunction with the \n\t\t\t\t \t// makeTableNamesArray function. \n\t \t\t\t\tif($lastRowWasBlank==TRUE){\n\n\t \t\t\t\t\t$matchedTableName ='';\n\t \t\t\t\t\t$patternMatchVal = 0;\n\t \t\t\t\t\t$patternMatchTemp = 99;\n\n\t \t\t\t\t\tfor($i=0; $i<$countTableNames; $i++){\n\t \t\t\t\t\t\t// use the levenshtein algorithm to return the value corresponding\n\t \t\t\t\t\t\t// to the number of characters needed to be changed to match the target\n\t \t\t\t\t\t\t$patternMatchVal = levenshtein($this->tableNames[$i], $data[0]);\n\n\t \t\t\t\t\t\tif($patternMatchVal < $patternMatchTemp){\n\t \t\t\t\t\t\t\t$matchedTableName = $this->tableNames[$i];\n\t \t\t\t\t\t\t\t$patternMatchTemp = $patternMatchVal;\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\t \t\t\t\t\t$lastRowWasBlank = FALSE;\n\t \t\t\t\t\t// since the next row in the while loop is the attributes row, set below to TRUE\n\t \t\t\t\t\t$isAttributesRow = TRUE;\n\t \t\t\t\t}\n\n\t \t\t\t\t// if the row being looked at is the attributes, fill the attributes array\n\t \t\t\t\telse if ($isAttributesRow == TRUE) {\n\n\t \t\t\t\t\t$tupleCount=0;\n\t \t\t\t\t\tunset($attributes);\n\t \t\t\t\t\t// loops through the row\n\t \t\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t \t\t\t\t\t\tif($data[$i] != NULL ){\n\t \t\t\t\t\t\t\t$attributes[$i] = $data[$i];\n\t \t\t\t\t\t\t\t}\n\t \t\t\t\t\t}\n\n\t \t\t\t\t\t$isAttributesRow = FALSE;\n\t\t\t\t \t\n\t\t\t\t } else {\n\n\n\t\t\t\t \t\n\t\t\t\t \t// loop through the tuple row to build the spreadSheetTuple\n\t\t\t\t\t\t for ($i=0; $i < count($attributes); $i++) {\n\n\t\t\t\t\t\t \t//fill spreadSheetTuple array with attribute => data key pair\n\t\t\t\t\t \t$spreadSheetTuples[$matchedTableName][$attributes[$i]] = $data[$i];\n\n\t\t\t\t\t \t}\n\n\t\t\t\t\t \t// check if the table has a link column using schema array\n\t\t\t\t\t \tif(array_key_exists( 'Link', $this->schema[$matchedTableName])){\n\n\t\t\t\t\t \t\t// strip all but forward slashes, newlines, letters and numbers\n\t\t\t\t\t \t\t// make it all lowercase\n\t\t\t\t\t \t\t$link = strtolower ( preg_replace(\t'/[^A-Za-z0-9\\n\\/ \\-]/', \n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t'', \n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t$spreadSheetTuples[$matchedTableName]['Title'] \n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t \t\t\t\t\t\t\t);\n\n\t\t\t\t\t \t\t\n\t\t\t\t\t \t\t// replace spaces, new lines and forward slashes with dashes\n\t\t\t\t\t \t\t$link = str_replace(array(\" \", \"\\n\", \"/\"), \"-\", $link);\n\t\t\t\t\t \t\t// sometimes it makes a double slash so replace those with single slash\n\t\t\t\t\t \t\t$link = str_replace(\"--\", \"-\", $link);\n\t\t\t\t\t \t\t// check if last character is a dash, if so, trim it off\n\t\t\t\t\t \t\tif(substr($link, -1, 1)==\"-\"){\n\t\t\t\t\t \t\t\t$link = substr($link, 0, -1);\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t \t\t//echo $link. \"<br>\";\n\n\t\t\t\t\t \t\t//add the key=>value to the tuple\n\t\t\t\t\t \t\t$spreadSheetTuples[$matchedTableName]['Link'] = $link;\n\t\t\t\t\t \t}\n\n\t\t\t\t\t \t$tuple = new Tuple(\n\t\t\t\t \t\t\t\t\t\t$matchedTableName, \n\t\t\t\t\t \t\t\t\t\t\t$spreadSheetTuples[$matchedTableName], \n\t\t\t\t\t \t\t\t\t\t\t$this->PKattributes[$matchedTableName]\n\t\t\t\t \t\t\t\t\t);\n\n\t\t\t\t\t \tif(empty($database)){\n\t\t\t\t \t\t$database = new Database($table = new Table($matchedTableName, $tuple));\n\t\t\t\t \t}\n\n\t\t\t\t \telse if(!$database->getTableByTableName($matchedTableName)){\n\t\t\t\t \t\t$database->addTable($table = new Table($matchedTableName, $tuple));\n\t\t\t\t \t}\n\n\t\t\t\t \telse {\n\t\t\t\t\t\t\t\t$database->getTableByTableName($matchedTableName)->addTuple($tuple);\n\n\t\t\t\t\t \t}\n\t\t\t\t\t\t\t// counts the number of tuples in spread sheet\n\t\t\t\t\t\t\t$tupleObjectCount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t }\t\n \t\t\tfclose($handle);\n\t\t\t}\n\n\n\t\treturn $database;\n\t\t}", "abstract public function loadData();", "public function __construct($filename,$colheads,$data) {\n\t\t$this->strdelim = '\"';\n\t\t$this->lnend = \"\\r\\n\";\n\t\t$this->fldsep = ',';\n\t\t$this->filename=$filename;\n\t\t$this->colheads=$colheads;\n\t\t$this->data=$data;\n\t\t}", "private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function import(ImportRequest $request)\n {\n $import = new OrdersImport;\n Excel::import($import, request()->file('file'));\n if(isset($import)){\n return redirect('/order')->with('success','Import danh sách đơn hàng thành công');\n }else{\n return back()->with('error','Import thất bại');\n }\n\n }", "public function DataInFileImportCSV($redirect_to)\n {\n\n }", "private function _processImportFile($fileFullPath) {\n\n $objFileops = new Fileops();\n $objFileops->setEventTime(new \\DateTime())\n ->setAction('I')\n ->setDeleted(0)\n ->setRecs(0)\n ->setErrors(0)\n ->setFilename($fileFullPath)\n ->setCustomerNew(0)\n ->setCustomerUpdate(0)\n ->setOrderUpdate(0)\n ->setStatus(Fileops::$STATUS_IMPORTING);\n\n $result = $this->_getMd5($fileFullPath);\n if($result['status'] === false) {\n throw new Exception($result['data']);\n }\n $this->md5 = $result['data'];\n $objFileops->setMd5($this->md5);\n\n// //--- Check md5 against database, continue if file already imported\n// $md5IsUnique = $this->getRepo('Fileops')->md5isUnique($objFileops->getMd5());\n// if($md5IsUnique !== true) {\n// //md5 already exists. This file has already been processed\n// die(\"File has already been imported: \" .$fileFullPath);\n// }\n\n //--- Read file into array\n $result = $this->getRepo('Fileops')->readFile($fileFullPath);\n\n if($result['status'] === false) {\n throw new Exception($result['data']);\n }\n $aryImport = $result['data'];\n $objFileops->setRecs(count($aryImport));\n\n //--- Process Customer Recs\n $result = $this->_importCustomers($aryImport);\n if($result['status'] === false) {\n throw new Exception($result['data']);\n }\n $objFileops->setCustomerNew($result['data']['customerNew'])\n ->setCustomerUpdate($result['data']['customerUpdate']);\n\n //--- Process Order Recs\n $result = $this->_importOrders($aryImport);\n if($result['status'] === false) {\n throw new Exception($result['data']);\n }\n $objFileops->setOrderNew($result['data']['orderNew'])\n ->setOrderUpdate($result['data']['orderUpdate']);\n\n\n //--- Save Import record\n $objFileops->setStatus(Fileops::$STATUS_SUCCESS);\n $this->persistEntity($objFileops);\n $this->flushEntities();\n\n $result = array('status' => true,\n 'data' => $objFileops);\n return $result;\n }", "public function importCouponStore(Request $request)\n {\n\n $request->validate([\n 'upload_file'=> 'required|mimes:xls,xlsx'\n ]\n );\n\n Excel::import(new CouponImport, $request->upload_file);\n\n return redirect('coupon/import')->with('msg','Import Successful');\n\n }", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "public function parse($filename, $headerRow = true);", "public function readFile()\r\n {\r\n\r\n $fileName_FaceBook = Request::all();\r\n\r\n //dd($fileName_FaceBook['From']);\r\n //dd($fileName_FaceBook);\r\n\r\n $dateStart = Carbon::parse($fileName_FaceBook['dateStartFrom']);\r\n $dateEnd = Carbon::parse($fileName_FaceBook['dateEndsTo']);\r\n\r\n dump($dateStart);\r\n dump($dateEnd);\r\n\r\n // The object returned by the file method is an instance of the Symfony\\Component\\HttpFoundation\\File\\UploadedFile\r\n\r\n $path = $fileName_FaceBook['fileName_FaceBook']->getRealPath();\r\n $name =$fileName_FaceBook['fileName_FaceBook']->getClientOriginalName();\r\n //dump($fileName_FaceBook['fileName_FaceBook']->getClientOriginalName());\r\n\r\n $this->readMetricsFromCSV($path, $dateStart, $dateEnd);\r\n\r\n\r\n }", "function import($File){\n $filename = $File;\n $handle = fopen($filename, \"r\");\n $contents = fread($handle, filesize($filename));\n $file_array = explode(\"\\n\", $contents);\n return $file_array;\n fclose($handle);\n}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function import(Request $request)\n {\n Client::truncate();\n if($request->hasFile('import_file')){\n $path = $request->file('import_file')->getRealPath();\n\n //$data = Excel::load($path, function($reader) {})->get();\n $extension = $request->file('import_file')->getClientOriginalExtension();\n $destinationPath = 'upload';\n $fileName = 'Danh sach dai ly' . date('m Y').'.'.$extension; // rename the file\n $request->file('import_file')->move($destinationPath, $fileName);\n $data = Excel::load('public/upload/'.$fileName, function($reader) {})->get();\n\n if(!empty($data) && $data->count()){\n //dd($data->toArray());\n foreach ($data->toArray() as $key => $value) {\n $insert[] = ['code' => $value['code'],\n 'name' => $value['name'],\n 'address' => $value['address'],\n ];\n }\n\n\n if(!empty($insert)){\n Client::insert($insert);\n return back()->with('success','Đã import danh sách đại lý thành công.');\n }\n\n }\n\n }\n\n return back()->with('error','Vui lòng kiểm tra file của bạn. Có lỗi xảy ra.');\n }", "public function import(Request $request)\n {\n \n $this->validate($request, [\n \"file\" => \"required|mimes:xlsx, xls\"\n ]);\n\n $file = $request->file('file');\n\n $nama_file = rand().$file->getClientOriginalName();\n \n $file->move(\"file_pegawai\", $nama_file);\n $import = new UsersImport;\n Excel::import($import, public_path(\"/file_pegawai/\". $nama_file));\n\n $image_path = public_path() . \"/file_pegawai/$nama_file\";\n File::delete($image_path);\n\n return redirect(\"/pegawai\")\n ->with(\"msg\", \"Data pegawai \" . $import->getCountSuccessImport() . \" berhasil di import\")\n ->with(\"err\", \"Data pegawai \" . $import->getCountFailImport() . \" sudah ada didaftar\");;\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "public function importData()\n {\n # Form submit\n if (Request::isMethod('post'))\n {\n $datafile = Input::file('datafile');\n\n if (!is_null($datafile) && $datafile->getClientOriginalExtension() == 'csv') {\n if (($handle = fopen($datafile->getRealPath(), 'r')) !== FALSE) {\n $locales = Lang::allLocales();\n $columns = fgetcsv($handle, 1000, \",\");\n\n if (count($columns) == ((count($locales) * 3) + 1)) {\n $newFiles = [];\n $oldFiles = [];\n\n // Prepare column names\n foreach ($columns as &$column) $column = str_replace(' ', '_', strtolower($column));\n\n // Import data\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $file = FileLibrary::find(intval($row[0]));\n\n if (!is_null($file)) {\n $data = array_combine($columns, $row);\n\n foreach ($locales as $lang => $langName) {\n if (empty(trim($data[$lang . '_name']))) $data[$lang . '_name'] = $file->languages[$lang]->file_path;\n\n if ($data[$lang . '_name'] != $file->languages[$lang]->file_path) {\n File::copy($file->languages[$lang]->file_path, $data[$lang . '_name']);\n $newFiles[] = $data[$lang . '_name'];\n $oldFiles[] = $file->languages[$lang]->file_path;\n } else {\n $newFiles[] = $file->languages[$lang]->file_path;\n }\n\n FileLibraryLanguage::where(['file_id' => $data['id'], 'lang' => $lang])->update(['file_path' => $data[$lang . '_name'], 'title' => $data[$lang . '_title'], 'alt' => $data[$lang . '_alt']]);\n }\n }\n }\n\n // Delete old files\n $oldFiles = array_diff($oldFiles, $newFiles);\n\n if (!empty($oldFiles)) {\n foreach ($oldFiles as $path) {\n $thumbs = File::glob('thumbs/' . substr($path, 0, strrpos($path, '.')) . '-*');\n File::delete($thumbs);\n File::delete($path);\n }\n }\n\n Alert::success('Files updated successfully.');\n\n fclose($handle);\n } else {\n Alert::error('File format is wrong. Please export the latest format first then upload.');\n }\n }\n } else {\n Alert::error('Uploaded file is invalid.');\n }\n }\n\n # Breadcrumbs\n Breadcrumbs::add('Files Library', URL::admin('files-library'));\n Breadcrumbs::add('Import Files Data', URL::admin('files-library/import'));\n\n # Load view\n return View::make('admin.files_library.import');\n }", "function _load_source_data($sourceFile) {\n /*\n * empty receiving files in advance just in case\n */\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_import');\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_header');\n $csvSeparator = _check_separator($sourceFile);\n \n $sourceData = fopen($sourceFile, 'r');\n while ($sourceRow = fgetcsv($sourceData, 0, $csvSeparator)) {\n if (!_check_empty_sourcerow($sourceRow)) {\n $insFields = _get_import_record($sourceRow);\n if (!empty($insFields)) {\n $insImport = \"INSERT INTO kov_import SET \".implode(\", \", $insFields);\n CRM_Core_DAO::executeQuery($insImport);\n }\n }\n }\n fclose($sourceData);\n \n $kovHdrInsert = \"INSERT INTO kov_header (SELECT DISTINCT(kov_nr), vge_nr, corr_naam, \n ov_datum, vge_adres, type, prijs, notaris, tax_waarde, taxateur, tax_datum, \n bouwkundige, bouw_datum, definitief FROM kov_import)\";\n CRM_Core_DAO::executeQuery($kovHdrInsert);\n return TRUE;\n}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }", "public function importFile($type, Request $request)\n {\n\n //-- Check file type\n if ($type === 'csv') {\n if ($file = $request->file('file')) {\n ProductRepository::import($file);\n }\n return redirect()->route('index');\n }\n }", "public function __construct()\n {\n $this->file = 'sheet.xlsx';\n if( $this->data = SimpleXLSX::parse($this->file) ){\n $this->data = $this->data;\n } else {\n $this->data = \"Error could not find file.\";\n }\n }", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function importRefData($source){\n //importing data into db\n $this->log(\"importing ref: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "abstract public function import(): bool;", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "function readData()\r\n\t{\r\n\t\tif( !file_exists( $this->source_file ) )\r\n\t\t{\r\n\t\t\tdie( \"Can not proceed: Can not locate data file: '\" . $this->source_file . \"'\" );\r\n\t\t}\r\n\t\t$this->m_aData = fopen( $this->source_file , 'r');\r\n\t}", "abstract public function load($filename);", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "public function import()\n {\n // Reorder importers\n usort($this->entityImporterMappings, function ($a, $b) {\n return $a[ORDER] <=> $b[ORDER];\n });\n\n // Import each entity type in turn\n foreach ($this->entityImporterMappings as $entityImporterMapping) {\n $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]);\n foreach ($files as $filename => $slug) {\n $fileContents = file_get_contents($filename);\n $entityData = json_decode($fileContents, true);\n $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData);\n }\n }\n }", "public function importData($filename, $level)\n {\n $file = $this->importDir . '/' . $filename;\n\n echo '<pre style=\"margin:60px\">';\n if (is_readable($file)) {\n $shpParser = new Shapefile\\Parser();\n $shpParser->load($file);\n echo 1;\n }\n echo '</pre>';\n\n return false;\n }", "public static function importFromFile () {\n\t\t$aUploadFile = $_FILES['importFile'];\n\n\t\t// Check if no file is given\n\t\tif ($aUploadFile['error'] == 4) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check the downloaded file if it is OK\n\t\tif ($aUploadFile['error'] >= 1) {\n\t\t\tthrow new Exception (__('An error has occured while downloading the file.', self::SLUG));\n\t\t}\n\t\tif ($aUploadFile['type'] != 'application/rdf+xml') {\n\t\t\tthrow new Exception (__('The specified file is not an RDF file.', self::SLUG));\n\t\t}\n\t\tif (!is_uploaded_file($aUploadFile['tmp_name'])) {\n\t\t\tthrow new Exception (__('An error has occured while downloading the file.', self::SLUG));\n\t\t}\n\n\t\t// Create the tables for the triple store\n\t\t$oStore = ARC2::getStore(self::getStoreConfig());\n\t\t$oStore->setUp();\n\n\t\t// All tables are emptied\n\t\t$oStore->reset();\n\n\t\t// Load RDF data into triple store\n\t\tif (!($oStore->query('LOAD <file://' . $aUploadFile['tmp_name'] . '>'))) {\n\t\t\tthrow new Exception (__('An error has occured while storing the RDF data to the database.', self::SLUG));\n\t\t}\n\t}", "function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}", "public function addRow($row, $file)\n { }" ]
[ "0.6300637", "0.62099755", "0.61139774", "0.6057166", "0.60169125", "0.6001831", "0.5989238", "0.5974106", "0.5963025", "0.58676684", "0.58338594", "0.5825807", "0.58162385", "0.5810736", "0.5809496", "0.580495", "0.5782686", "0.575955", "0.5753459", "0.57440704", "0.57180536", "0.57114476", "0.570927", "0.57055825", "0.56948626", "0.5687541", "0.567891", "0.5658579", "0.5654661", "0.5652874", "0.5642493", "0.5640275", "0.56257606", "0.5601162", "0.5588372", "0.5585585", "0.5564765", "0.55603874", "0.55254585", "0.55197275", "0.5497187", "0.5482678", "0.5464121", "0.5462232", "0.5456383", "0.54234964", "0.54126173", "0.5385433", "0.53841096", "0.538378", "0.5383019", "0.5377489", "0.53752804", "0.53656816", "0.5360134", "0.53590775", "0.5356156", "0.5354525", "0.53535724", "0.53528804", "0.53480095", "0.52924997", "0.52734846", "0.5273093", "0.5272157", "0.52667826", "0.5264877", "0.52568924", "0.52475953", "0.5240841", "0.52407587", "0.5232159", "0.52290976", "0.52213776", "0.5219364", "0.5217966", "0.5208759", "0.52056295", "0.52002364", "0.51976866", "0.5196319", "0.5190471", "0.5190078", "0.518208", "0.5176517", "0.51690805", "0.5164671", "0.5162144", "0.51611423", "0.5159328", "0.5159222", "0.51564556", "0.5154671", "0.51486534", "0.5145763", "0.51352596", "0.51305693", "0.5120317", "0.5119207", "0.5115953", "0.50994086" ]
0.0
-1
Method for importing a menu data cell.
protected function process_data_menu(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function import(stdClass $menu, stdClass $row) {\n // Invoke migration prepare handlers\n $this->prepare($menu, $row);\n\n // Menus are handled as arrays, so clone the object to an array.\n $menu = clone $menu;\n $menu = (array) $menu;\n\n // Check to see if this is a new menu.\n $update = FALSE;\n if ($data = menu_load($menu['menu_name'])) {\n $update = TRUE;\n }\n\n // menu_save() provides no return callback, so we can't really test this\n // without running a menu_load() check.\n migrate_instrument_start('menu_save');\n menu_save($menu);\n migrate_instrument_stop('menu_save');\n\n // Return the new id or FALSE on failure.\n if ($data = menu_load($menu['menu_name'])) {\n // Increment the count if the save succeeded.\n if ($update) {\n $this->numUpdated++;\n }\n else {\n $this->numCreated++;\n }\n // Return the primary key to the mapping table.\n $return = array($data['menu_name']);\n }\n else {\n $return = FALSE;\n }\n\n // Invoke migration complete handlers.\n $menu = (object) $data;\n $this->complete($menu, $row);\n\n return $return;\n }", "public function importMenus() {\n\t\t$deletedItems = $this->db->run_query(\"DELETE FROM menu_items\");\n\t\t$this->debugPrint($deletedItems, \"Deleted existing menu items\");\n\t\t$deletedMenus = $this->db->run_query(\"DELETE FROM menus\");\n\t\t$this->debugPrint($deletedMenus, \"Deleted existing menus\");\n\t\t\n\t\t// create a template record.\n\t\t$_mObj = new menu($this->db);\n\t\t$testMenuId = $_mObj->insert(array('name'=>'test'));\n\t\t$templateMenu = $_mObj->simpleGet($testMenuId);\n\t\t\n\t\t// create a template item.\n\t\t$_miObj = new menuItem($this->db);\n\t\t$testItemId = $_miObj->insert(array('title' => 'test', 'menu_id'=>$testMenuId));\n\t\t$templateItem = $_miObj->simpleGet($testItemId);\n\t\t\n\t\t// remove the unecessary test records\n\t\t$_miObj->delete($testItemId);\n\t\t$_mObj->delete($testMenuId);\n\t\t\n\t\t\n\t\t$eMenuObj = new menu($this->importDb);\n\t\t$eItemObj = new menuItem($this->importDb);\n\t\t\n\t\t// menus\n\t\t$existingMenus = $eMenuObj->simpleGetAll();\n\t\t$numExistingMenus = count($existingMenus);\n\t\t$menusImported = 0;\n\t\tforeach($existingMenus as $k=>$v) {\n\t\t\t$insertData = $this->_cleanRecord($templateMenu, $v);\n\t\t\t$_mObj->insert($insertData);\n\t\t\t$menusImported++;\n\t\t}\n\t\t$this->debugPrint(\"{$menusImported}/{$numExistingMenus}\", \"imported/existing menus\");\n\t\t\n\t\t\n\t\t$existingItems = $eItemObj->simpleGetAll();\n\t\t$numExistingItems = count($existingItems);\n\t\t$itemsImported = 0;\n\t\t\n\t\tforeach($existingItems as $k=>$v) {\n\t\t\ttry {\n\t\t\t\t$_miObj->insert($this->_cleanRecord($templateItem, $v));\n\t\t\t\t$itemsImported++;\n\t\t\t}\n\t\t\tcatch(Exception $ex) {\n\t\t\t\t$this->debugPrint($ex->getMessage(), \"failed to insert record\");\n\t\t\t\t$this->debugPrint($v, \"record data that failed\");\n\t\t\t\t\n\t\t\t\t$this->debugPrint($_mObj->simpleGet($v['menu_id']), \"associated menu\");\n\t\t\t\t\n\t\t\t\tthrow $ex;\n\t\t\t}\n\t\t}\n\t\t$this->debugPrint(\"{$itemsImported}/{$numExistingItems}\", \"imported/existing menu items\");\n\t\t\t\t\n\t}", "abstract public function getMenuData();", "protected function renderDataCellContent($row, $data)\n {\n $menuItems = array('label' => $this->title, 'items' => array());\n if (count($this->rowMenu['elements']) > 0)\n {\n foreach ($this->rowMenu['elements'] as $elementInformation)\n {\n $elementclassname = $elementInformation['type'] . 'ActionElement';\n $class = new ReflectionClass($elementclassname);\n if ($class->implementsInterface('RowModelShouldRenderInterface') && !$elementclassname::shouldRenderByRowModel($data))\n {\n continue;\n }\n $params = array_slice($elementInformation, 1);\n if (!isset($params['redirectUrl']))\n {\n $params['redirectUrl'] = $this->redirectUrl;\n }\n $params['modelClassName'] = $this->modelClassName;\n $params['gridId'] = $this->grid->getId();\n array_walk($params, array($this->listView, 'resolveEvaluateSubString'));\n $element = new $elementclassname($this->listView->getControllerId(),\n $this->listView->getModuleId(),\n $data->id, $params);\n if (!ActionSecurityUtil::canCurrentUserPerformAction( $element->getActionType(), $data) ||\n (isset($params['userHasRelatedModelAccess']) &&\n $params['userHasRelatedModelAccess'] == false))\n {\n continue;\n }\n if (!$this->listView->canRenderRowMenuColumnByElementAndData($element, $data))\n {\n continue;\n }\n if ($element->isFormRequiredToUse())\n {\n throw new NotSupportedException();\n }\n $menuItems['items'][] = $element->renderMenuItem();\n }\n }\n if (count($menuItems['items']) > 0)\n {\n $cClipWidget = new CClipWidget();\n $cClipWidget->beginClip(\"OptionMenu\");\n $cClipWidget->widget('application.core.widgets.MbMenu', array(\n 'htmlOptions' => array('class' => 'options-menu edit-row-menu'),\n 'items' => array($menuItems),\n ));\n $cClipWidget->endClip();\n echo $cClipWidget->getController()->clips['OptionMenu'];\n }\n }", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "function import_product_brands_plugin_menu() {\n\n add_menu_page(\"Import Product Brands Plugin\", \"Import Product Brands\",\"manage_options\", \"import_product_brands\", \"import_csv\",plugins_url('/import-product-brands/img/icon.png'));\n}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "protected function loadRow() {}", "public abstract function getMenuData(): array;", "function import_page() {\n\t// add top level menu page\n\tadd_submenu_page(\n\t\t'edit.php?post_type=guide',\n\t\t'Guide Import',\n\t\t'Import',\n\t\t'publish_posts',\n\t\t'import',\n\t\t'\\CCL\\Guides\\import_page_html'\n\t);\n}", "function import(array $data);", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "public function importFrom(array $data);", "public function builder_import() {\n\n\t\t// function verifies the AJAX request, to prevent any processing of requests which are passed in by third-party sites or systems\n\n\t\tcheck_ajax_referer( 'mfn-builder-nonce', 'mfn-builder-nonce' );\n\n\t\t$import = htmlspecialchars(stripslashes($_POST['mfn-items-import']));\n\n\t\tif (! $import) {\n\t\t\texit;\n\t\t}\n\n\t\t// unserialize received items data\n\n\t\t$mfn_items = unserialize(call_user_func('base'.'64_decode', $import));\n\n\t\t// get current builder uniqueIDs\n\n\t\t$uids_row = isset($_POST['mfn-row-id']) ? $_POST['mfn-row-id'] : array();\n\t\t$uids_wrap = isset($_POST['mfn-wrap-id']) ? $_POST['mfn-wrap-id'] : array();\n\t\t$uids_item = isset($_POST['mfn-item-id']) ? $_POST['mfn-item-id'] : array();\n\n\t\t$uids = array_merge($uids_row, $uids_wrap, $uids_item);\n\n\t\t// reset uniqueID\n\n\t\t$mfn_items = Mfn_Builder_Helper::unique_ID_reset($mfn_items, $uids);\n\n\t\tif (is_array($mfn_items)) {\n\n\t\t\t$builder = new Mfn_Builder_Admin();\n\t\t\t$builder->set_fields();\n\n\t\t\tforeach ($mfn_items as $section) {\n\t\t\t\t$uids = $builder->section($section, $uids);\n\t\t\t}\n\n\t\t}\n\n\t\texit;\n\n\t}", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function import(array $data): void;", "protected function importDatabaseData() {}", "function import_menu_location(){\r\n\r\n\t\t$data = array(\r\n 'primary' => 'kleonavmenu',\r\n 'top' => 'kleotopmenu'\r\n );\r\n\t\t$menus = wp_get_nav_menus();\r\n\r\n\t\tforeach( $data as $key => $val ){\r\n\t\t\tforeach( $menus as $menu ){\r\n\t\t\t\tif( $menu->slug == $val ){\r\n\t\t\t\t\t$data[$key] = absint( $menu->term_id );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tset_theme_mod( 'nav_menu_locations', $data );\r\n\t}", "public function loadRow($rowData)\n\t{\n\t\t\n }", "public function register_menu() {\n $parent_slug = 'comparrot';\n $capability = 'manage_options';\n\n add_menu_page( 'Comparrot', 'Comparrot', $capability, $parent_slug, [$this, 'import_from_csv_page'], 'dashicons-admin-page', 2 );\n\n add_submenu_page( $parent_slug, __( 'Import from CSV', 'comparrot' ), __( 'Import from CSV', 'comparrot' ), $capability, $parent_slug, [$this, 'import_from_csv_page'] );\n add_submenu_page( $parent_slug, __( 'General settings', 'comparrot' ), __( 'General settings', 'comparrot' ), $capability, 'comparrot-general-settings', [$this, 'general_settings_page'] );\n }", "public function get_menu_label() {\n\t\treturn __( 'Import', 'the-events-calendar' );\n\t}", "public function generateDatatableMenu()\n {\n $this->datatables->select('menu, id');\n $this->datatables->from('user_menu');\n $this->datatables->add_column('action', '<a href=\"menu/editMenu/$1\" class=\"badge badge-warning\" id=\"edit-menu\" data-toggle=\"modal\" data-target=\"#menu-modal\">Edit</a> <a href=\"menu/deleteMenu/$1\" class=\"badge badge-danger\" id=\"delete-menu\">Delete</a>', 'id');\n echo $this->datatables->generate();\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function importInterface(){\n return view('/drugAdministration/drugs/importExcelDrugs');\n }", "function initData() {\n\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\t\t$navigationMenuItem = $navigationMenuItemDao->getById($this->navigationMenuItemId);\n\n\t\tif ($navigationMenuItem) {\n\t\t\t$this->_data = array(\n\t\t\t\t'path' => $navigationMenuItem->getPath(),\n\t\t\t\t'title' => $navigationMenuItem->getTitle(null),\n\t\t\t\t'url' => $navigationMenuItem->getUrl(),\n\t\t\t\t'menuItemType' => $navigationMenuItem->getType(),\n\t\t\t);\n\t\t\t$this->setData('content', $navigationMenuItem->getContent(null)); // Localized\n\t\t} \n\t}", "public function addMenu($data){\n\n\t\treturn $this->insert(['item'=>$data['item'], 'anchor' => $data['anchor']]);\n\t}", "public function importExcel($path);", "public function run()\n {\n //todo lo administrativo\n $data = new Rol; \n $data->rol = 'admin';\n $data->save();\n\n //todo lo inscripciones, gestion de pagos\n $data = new Rol;\n $data->rol = 'secretario';\n $data->save();\n\n //todo lo financiero\n $data = new Rol;\n $data->rol = 'financiero';\n $data->save();\n\n //reportes\n $data = new Rol;\n $data->rol = 'reportes';\n $data->save();\n\n Excel::import(new MenuImport, 'database/seeds/Menu.xlsx');\n }", "function import_data(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\t$action = get_get_var('action');\r\n\techo '<h4>Import Data</h4>';\r\n\r\n\t$mount_point = get_post_var('mount_point');\r\n\t// validate this\r\n\tif ($mount_point != \"\" && $mount_point{0} != '/'){\r\n\t\t$action = \"\";\r\n\t\tonnac_error(\"Invalid mount point specified! Must start with a '/'\");\r\n\t}\r\n\t\r\n\tif ($action == \"\"){\r\n\t\r\n\t\t$option = \"\";\r\n\t\t$result = db_query(\"SELECT url from $cfg[t_content] ORDER BY url\");\r\n\t\t\r\n\t\t// first, assemble three arrays of file information\r\n\t\tif (db_has_rows($result)){\r\n\t\t\r\n\t\t\t$last_dir = '/';\r\n\t\t\r\n\t\t\twhile ($row = db_fetch_row($result)){\r\n\t\t\t\r\n\t\t\t\t// directory names, without trailing /\r\n\t\t\t\t$dirname = dirname($row[0] . 'x');\r\n\t\t\t\tif ($dirname == '\\\\' || $dirname == '/')\r\n\t\t\t\t\t$dirname = '';\r\n\t\t\t\t\r\n\t\t\t\tif ($last_dir != $dirname){\r\n\t\t\t\t\tif ($last_dir != '')\r\n\t\t\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\r\n\t\t\t\t\r\n\t\t\t\t\t$last_dir = $dirname;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($last_dir != '')\r\n\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\t\t\r\n\t\t}\r\n\t\r\n\t\t?>\r\n\t\t\r\n<form name=\"import\" action=\"##pageroot##/?mode=import&action=import\" enctype=\"multipart/form-data\" method=\"post\">\r\n\t<table>\r\n\t\t<tr><td>File to import:</td><td><input name=\"data\" type=\"file\" size=\"40\"/></td></tr>\r\n\t\t<tr><td>*Mount point:</td><td><input name=\"mount_point\" type=\"text\" size=\"40\" value=\"/\" /></td></tr>\r\n\t\t<tr><td><em>==&gt;&gt; Choose a directory</em></td><td><select onchange=\"document.import.mount_point.value = document.import.directory.options[document.import.directory.selectedIndex].value;\" name=\"directory\"><?php echo $option; ?></select></td></tr>\r\n\t</table>\r\n\t<input type=\"submit\" value=\"Import\" /><br/>\r\n\t<em>* Mount point is a value that is prefixed to all file names, including content, banner, and menu data. It is the root directory in which the data is based.</em>\r\n</form>\r\n<?php\r\n\t\r\n\t}else if ($action == \"import\"){\r\n\t\t\r\n\t\t$filename = \"\";\r\n\t\t\r\n\t\t// get the contents of the uploaded file\r\n\t\tif (isset($_FILES['data']) && is_uploaded_file($_FILES['data']['tmp_name'])){\r\n\t\t\t$filename = $_FILES['data']['tmp_name'];\r\n\t\t}\r\n\t\t\r\n\t\t$imported = get_import_data($filename,false);\r\n\t\t\r\n\t\tif ($imported !== false){\r\n\t\t\r\n\t\t\t// check to see if we need to ask the user to approve anything\r\n\t\t\t$user_approved = false;\r\n\t\t\tif (get_post_var('user_approved') == 'yes')\r\n\t\t\t\t$user_approved = true;\r\n\t\t\r\n\t\t\t// take care of SQL transaction up here\r\n\t\t\t$ret = false;\r\n\t\t\tif ($user_approved && !db_begin_transaction())\r\n\t\t\t\treturn onnac_error(\"Could not begin SQL transaction!\");\r\n\t\t\r\n\t\t\t// automatically detect import type, and do it!\r\n\t\t\tif ($imported['dumptype'] == 'content' || $imported['dumptype'] == 'all'){\r\n\t\t\t\t$ret = import_content($imported,$user_approved,false);\r\n\t\t\t}else if ($imported['dumptype'] == 'templates'){\r\n\t\t\t\t$ret = import_templates($imported,$user_approved,false);\r\n\t\t\t}else{\r\n\t\t\t\techo \"Invalid import file!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ret && $user_approved && db_is_valid_result(db_commit_transaction()))\r\n\t\t\t\techo \"All imports successful!\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\techo \"Error importing data!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t}\r\n\t\t\t\r\n\t}else{\r\n\t\theader(\"Location: $cfg[page_root]?mode=import\");\t\r\n\t}\t\r\n\t\r\n\t// footer\r\n\techo \"<p><a href=\\\"##pageroot##/\\\">Return to main administrative menu</a></p>\";\r\n\t\r\n}", "public function getRawModuleMenuData() {}", "public function edit(BranchMenu $branchMenu)\n {\n //\n }", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "public function importInterface_ch_co(){\n return view('/drugAdministration/drugs/importExcel_co_ch');\n }", "public function importAction() {\n $aOptGuilde = array(\n 'guilde' => '',\n 'serveur' => '', //TODO extrait les information dans la colonne Data\n 'lvlMin' => '',\n 'imp-membre' => 'Oui',\n );\n\n // Pour optimiser le rendu\n $oViewModel = new ViewModel();\n $oViewModel->setTemplate('backend/guildes/import/import');\n $oViewModel->setVariable(\"guilde\", $aOptGuilde);\n return $oViewModel;\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "function import()\n\t{\n\t\t$this->ipsclass->admin->page_detail = \"Эта секция позволяет вам импортировать XML-файлы содержащие языковые настройки.\";\n\t\t$this->ipsclass->admin->page_title = \"Импорт языка\";\n\t\t$this->ipsclass->admin->nav[] \t\t= array( '', 'Import Language Pack' );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doimport' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'lang' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'MAX_FILE_SIZE' , '10000000000' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section' , $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) , \"uploadform\", \" enctype='multipart/form-data'\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Импортирование XML-файла\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Загрузка XML-архива с языковыми настройками</b><div style='color:gray'>Выберите файл для загрузки с вашего компьютера. Выбранный файл должен начинаться с 'ipb_language' и заканчиваться либо '.xml', либо '.xml.gz'.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_upload( )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b><u>ИЛИ</u> введите название XML-архива</b><div style='color:gray'>Этот файл должен быть загружен в основную директорию форума.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_location', 'ipb_language.xml.gz' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Введите название для новых языковых настроек</b><div style='color:gray'>Например: Русский, RU, English, US...</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_name', '' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Импортирование XML-файла\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\n\n\t}", "function storexmas_after_import_setup($selected_import) {\n\t\t$main_menu = get_term_by( 'name', 'Main Nav', 'nav_menu' );\n\t\t$side_menu = get_term_by( 'name', 'Side menu', 'nav_menu' );\n\t\t$footer_menu = get_term_by( 'name', 'Footer menu', 'nav_menu' );\n\t\t$social_link = get_term_by( 'name', 'Social icon', 'nav_menu' );\n\n\t\tset_theme_mod( 'nav_menu_locations', array(\n\t\t\t\t'primary' => $main_menu->term_id,\n\t\t\t\t'side-nav-menu' => $side_menu->term_id,\n\t\t\t\t'footermenu' => $footer_menu->term_id,\n\t\t\t\t'social-link' => $social_link->term_id,\n\t\t\t)\n\t\t);\n}", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "public function setMenuContent(array $menu);", "function readInputData() {\n\t\t$this->readUserVars(array('navigationMenuItemId', 'content', 'title', 'path', 'url','menuItemType'));\n\t}", "public function import();", "public function add_menu_link() {\n\n\t\t$this->page = add_submenu_page(\n\t\t\t'woocommerce',\n\t\t\t__( 'CSV Export', 'woocommerce-customer-order-csv-export' ),\n\t\t\t__( 'CSV Export', 'woocommerce-customer-order-csv-export' ),\n\t\t\t'manage_woocommerce_csv_exports',\n\t\t\t'wc_customer_order_csv_export',\n\t\t\tarray( $this, 'render_submenu_pages' )\n\t\t);\n\t}", "protected function loadTreeData() {}", "private function row_imported( $row, $action = '' ) {\n\t\t$this->imported_rows[] = $row + 1;\n\t\tif ( $action && is_scalar( $action ) ) {\n\t\t\tif ( ! isset( $this->actions[ $action ] ) ) {\n\t\t\t\t$this->actions[ $action ] = 0;\n\t\t\t}\n\t\t\t$this->actions[ $action ]++;\n\t\t}\n\t}", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function edit(Menu $menu)\n {\n //\n }", "function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }", "function procMenuAdminInsertItemForAdminMenu()\n\t{\n\t\t$requestArgs = Context::getRequestVars();\n\t\t$tmpMenuName = explode(':', $requestArgs->menu_name);\n\t\t$moduleName = $tmpMenuName[0];\n\t\t$menuName = $tmpMenuName[1];\n\n\t\t// variable setting\n\t\t$logged_info = Context::get('logged_info');\n\t\t//$oMenuAdminModel = getAdminModel('menu');\n\t\t$oMemberModel = getModel('member');\n\n\t\t//$parentMenuInfo = $oMenuAdminModel->getMenuItemInfo($requestArgs->parent_srl);\n\t\t$groupSrlList = $oMemberModel->getMemberGroups($logged_info->member_srl);\n\n\t\t//preg_match('/\\{\\$lang->menu_gnb\\[(.*?)\\]\\}/i', $parentMenuInfo->name, $m);\n\t\t$oModuleModel = getModel('module');\n\t\t//$info = $oModuleModel->getModuleInfoXml($moduleName);\n\t\t$info = $oModuleModel->getModuleActionXml($moduleName);\n\n\t\t$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);\n\t\tif(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);\n\t\tif(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');\n\t\t$dbInfo = Context::getDBInfo();\n\n\t\t$args = new stdClass();\n\t\t$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;\n\t\t$args->parent_srl = $requestArgs->parent_srl;\n\t\t$args->menu_srl = $requestArgs->menu_srl;\n\t\t$args->name = sprintf('{$lang->menu_gnb_sub[\\'%s\\']}', $menuName);\n\t\t//if now page is https...\n\t\tif(strpos($url, 'https') !== false)\n\t\t{\n\t\t\t$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$args->url = str_replace($dbInfo->default_url, '', $url);\n\t\t}\n\t\t$args->open_window = 'N';\n\t\t$args->expand = 'N';\n\t\t$args->normal_btn = '';\n\t\t$args->hover_btn = '';\n\t\t$args->active_btn = '';\n\t\t$args->group_srls = implode(',', array_keys($groupSrlList));\n\t\t$args->listorder = -1*$args->menu_item_srl;\n\n\t\t// Check if already exists\n\t\t$oMenuModel = getAdminModel('menu');\n\t\t$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);\n\t\t// Update if exists\n\t\tif($item_info->menu_item_srl == $args->menu_item_srl)\n\t\t{\n\t\t\t$output = executeQuery('menu.updateMenuItem', $args);\n\t\t\tif(!$output->toBool()) return $output;\n\t\t}\n\t\t// Insert if not exist\n\t\telse\n\t\t{\n\t\t\t$args->listorder = -1*$args->menu_item_srl;\n\t\t\t$output = executeQuery('menu.insertMenuItem', $args);\n\t\t\tif(!$output->toBool()) return $output;\n\t\t}\n\t\t// Get information of the menu\n\t\t$menu_info = $oMenuModel->getMenu($args->menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Update the xml file and get its location\n\t\t$xml_file = $this->makeXmlFile($args->menu_srl);\n\n\t\t$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminSetup');\n\t\t$this->setRedirectUrl($returnUrl);\n\t}", "public function admin_settings_menu() {\r\n add_submenu_page('tools.php', 'CSV Import', 'CSV Import', 'manage_options', 'csv-import-wpdatables', array(\t$this,\t'csvimport_settings_page'));\r\n\t}", "function load_from_row ($row) {\n $this->id = $row['content_id'];\n $this->path = $row['content_path'];\n $this->user_id = $row['user_id'];\n $this->perso_id = $row['perso_id'];\n $this->title = $row['content_title'];\n }", "public function metaImport($data);", "public function import()\n {\n \n }", "function cmo_after_import_setup($selected_import) {\n $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );\n\n set_theme_mod( 'nav_menu_locations', array (\n 'main_menu' => $main_menu->term_id,\n )\n );\n\n // Assign front page and posts page (blog page).\n $front_page_id = get_page_by_title( 'Home' );\n $blog_page_id = get_page_by_title( 'Blog' );\n\n // Disable Elementor's Default Colors and Default Fonts\n update_option( 'elementor_disable_color_schemes', 'yes' );\n update_option( 'elementor_disable_typography_schemes', 'yes' );\n update_option( 'elementor_global_image_lightbox', '' );\n\n // Set the home page and blog page\n update_option( 'show_on_front', 'page' );\n update_option( 'page_on_front', $front_page_id->ID );\n update_option( 'page_for_posts', $blog_page_id->ID );\n\n}", "function importPropertyCodes() {\n \t\n \t?>\n \t\n \t\t<html>\n \t\t\t<head>\n \t\t\t\t<title>IMPORT PROP CODES</title>\n \t\t\t</head>\n \t\t\t\n \t\t\t<body>\n \t\t\t\t<form name=\"propForm\" method=\"post\" action=\"<?= base_url(); ?>navisionimport/propCodeHandler\">\n \t\t\t\t\n \t\n \t<?\n \t\n \t// first we need to create an array of all properties that are already imported.\n \t\n \t$sql = \"SELECT propertyid, nv_propid FROM properties WHERE nv_propid <> '0'\";\n \t$query = $this->db->query($sql);\n \t\n \t$importedProps = array();\n \t\n \tforeach ($query->result() as $r)\n \t\t$importedProps[] = $r->nv_propid;\n \t\t\n \t$row = 1;\n\t\t\n\t\tif (($handle = fopen($this->config->item('webrootPath') . \"resources/files/navision_import/navision_property_codes.csv\", \"r\")) !== FALSE) {\n\t\t \n\t\t while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\n\t\t if (($row > 1) && (!in_array($data[0],$importedProps))) {\n\t\t \n\t\t \t\n\t\t \t$sql = \"SELECT propertyid,property FROM properties WHERE property LIKE '\".addslashes(trim($data[1])).\"' AND nv_propid = 0\";\n\t\t \t$query = $this->db->query($sql);\n\t\t \t\n\t\t \t//print_r($query);\n\t\t \t\n\t\t \tif ($p = $query->row()) {\n\t\t \t\t\n\t\t \t\t// insert ID into DB\n\t\t \t\t\n\t\t \t\t$sql = \"UPDATE properties SET nv_propid = '\".$data[0].\"' WHERE propertyid = \" . $p->propertyid;\n\t\t \t\t$this->db->query($sql);\n\t\t \t\t\n\t\t \t\t\n\t\t \t\t$insertedItems[] = array(\n\t\t \t\t\n\t\t \t\t\t\"dbName\"=>$p->property,\n\t\t \t\t\t\"csvName\"=>$data[1],\n\t\t \t\t\t\"dbID\"=>$this->db->insert_id(),\n\t\t \t\t\t\"propID\"=>$data[0]\n\t\t \t\t\n\t\t \t\t);\n\t\t \t\n\t\t \t} else {\n\t\t \t\n\t\t \t\t// add to exception array\n\t\t \t\t\n\t\t \t\t$exceptions[] = array(\"id\"=>$data[0],\"name\"=>$data[1]);\n\t\t \t\n\t\t \t}\n\t\t \t\n\t\t \t}\n\t\t \t\n\t\t \t\t\n\t\t \t\t$row++;\n\t\t \n\t\t }\n\t\t \n\t\t fclose($handle);\n\t\t \n\t\t // LETS MAKE GUESSES AT PROPERTY NAME AND GIVE THE USER OPTIONS!\n\t\t \n\t\t ?>\n\t\t \n\t\t <table border=\"1\" width=\"600\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Navision Property</th>\n\t\t\t\t\t<th>OPM Property</th>\n\t\t\t\t</tr>\n\t\t \n\t\t <?\n\t\t \n\t\t echo \"EXCEPTIONS:<br><br>\";\n\t\t \n\t\t foreach ($exceptions as $e) {\n\t\t \n\t\t \t$splitName = explode(\" \", $e['name']);\n\t\t \t\n\t\t \t$sql = \"SELECT property,propertyid FROM properties\n\t\t \t\t\tWHERE (\";\n\t\t \t\n\t\t \t$splitCount = 0;\n\t\t \t\n\t\t \tforeach ($splitName as $key=>$x) {\n\t\t \t\t\n\t\t \t\tif ((strlen($x) > 1) && $x != 'the' && $x != 'The') { // make sure we arent seaching for just a single letter\n\t\t \t\t\n\t\t\t \t\t$sql .= \" property LIKE '%\".addslashes($x).\"%' OR \";\n\t\t\t \t\n\t\t\t \t\t$splitCount++;\n\t\t \t\t\t\n\t\t \t\t}\n\t\t \t\n\t\t \t\t\n\t\t \t\n\t\t \t}\n\t\t \t\n\t\t \t// remove last OR\n\t\t \t\n\t\t \t$sql = substr($sql, 0, strlen($sql) - 3);\n\t\t \t\n\t\t \tif ($splitCount > 0) { // we have words to match \n\t\t \t\t\t\t\n\t\t\t \t$sql .= \") AND nv_propid = 0\";\n\t\t\t \t\n\t\t\t \t//echo $sql . \"<br><br>\";\n\t\t\t \t\n\t\t\t \t$matches = $this->db->query($sql);\n\t\n\t\t\t \tif ($matches->num_rows() > 0) {\n\t\t\t \t\n\t\t\t \t\t// print matches in table\n\t\t\t \t\t\n\t\t\t \t\t?>\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t\t<tr>\n\t\t\t \t\t\t\t<th><?= $e['name'] ?></th>\n\t\t\t \t\t\t\t\n\t\t\t \t\t\t\t<td>\n\t\t\t \t\t\t\n\t\t\t \t\t\t\t<select name=\"propertyid[<?= $e['id'] ?>]\">\n\t\t\t \t\t\t\t\t<option value=\"0\">NO MATCH</option>\n\t\t\t \t\t\t\t\t\n\t\t\t\t\t\t \t\t\t<? foreach ($matches->result() as $m) { ?>\n\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t \t\t\t\t\t<option value=\"<?= $m->propertyid ?>\"><?= $m->property ?></option>\n\t\t\t\t\t\t \t\t\t<? } ?>\n\t\t\t \t\t\t\n\t\t\t \t\t\t\t</select>\n\t\t\t \t\t\t\n\t\t\t \t\t\t</td>\n\t\t\t \t\t\t</tr>\n\t\t\t \t\t\t\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t<?\n\t\t\t \t\t\n\t\t\t \t\t//die();\n\t\t\t \t\n\t\t\t \t} else {\n\t\t\t \t\n\t\t\t \t\t$noMatches[] = array(\"name\"=>$e['name'],\"id\"=>$e['id']);\n\t\t\t \t\n\t\t\t \t}\n\t\t\t \t\n\t\t\t \n\t\t\t } else {\n\t\t\t \n\t\t\t \t$noMatches[] = array(\"name\"=>$e['name'],\"id\"=>$e['id']);\n\t\t\t \n\t\t\t }\n\t\t \t\n\t\t \t\n\t\t \t\n\t\t }\n\t\t \n\t\t ?>\n\t\t \t\t</table>\n\t\t \t\t\t<input type=\"submit\" value=\"Import Codes\" />\n\t\t \t\t\t\n\t\t \t\t\t<br><br>\n\t\t \t\t\t\n\t\t \t\t\t<pre>\n\t\t \t\t\t\n\t\t \t\t\t\t<? print_r($insertedItems); ?>\t\n\t\t \n\t\t \t\t\t</pre>\n\t\t \n\t\t \t\t\t </form>\n \t\t\t</body>\n \t\t</html>\n\t\t \n\t\t <?\t\n\t\t \n\t\t \n\t\t\n\t\t}\n \n }", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "function loadLine($a_row)\n\t{\n\t}", "function admin_menu() {\n\t\tadd_submenu_page( 'edit.php?post_type=countries', __( 'Countries Importer', 'countries' ), __( 'Importer', 'countries' ), 'manage_options', 'countries-importer-page', array( $this, 'importer_page' ) );\n\t}", "public function importInterface(){\n return view('/drugAdministration/companies/importExcel');\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function data()\n {\n $menuitems = Menuitem::join('menu_categories', 'menu_categories.id', '=', 'menu_items.menu_category_id')\n ->select(array('menu_items.id','menu_items.name','menu_items.price','menu_categories.name as category', \n 'menu_items.created_at'))->orderBy('menu_items.id', 'DESC')->get();\n \n\n return Datatables::of($menuitems)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/menuitem/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/menuitem/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n\n ->make();\n }", "function axial_bottin_import_plugin_setup_menu(){\n\n //Principal menu item\n add_menu_page('Gestion Bottin', //Titre de la page\n 'Gestion Bottin', //Titre du menu\n 'manage_options', //capabilité\n 'bottin_index', //menu slug\n 'bottin_index', //function\n 'dashicons-phone' // icon\n );\n\n //IMPORT BOTTIN\n\n add_submenu_page(bottin_index,\n 'Import Bottin',\n 'Import Bottin',\n 'manage_options',\n 'axial_bottin_import-plugin',\n 'axial_bottin_import_init');//function\n\n //BOTTIN BIGENRE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Liste Bigenre',\n 'Liste des bigenres',\n 'manage_options',\n 'get_table_bigenre',\n 'get_table_bigenre');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_bigenre',\n 'create_bigenre');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin bigenre',\n 'Update',\n 'manage_options',\n 'update_table_bigenre',\n 'update_table_bigenre');//function\n\n //BOTTIN DÉPARTEMENT SERVICE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Bottin Département Service',\n 'Liste des départements et services',\n 'manage_options',\n 'get_table_dept',\n 'get_table_dept');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_dept',\n 'create_dept');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin deptServ',\n 'Update',\n 'manage_options',\n 'update_table_dept',\n 'update_table_dept');//function\n\n //BOTTIN EMAIL GÉNÉRIQUE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Bottin email générique',\n 'Liste des courriels génériques',\n 'manage_options',\n 'get_table_email_generique',\n 'get_table_email_generique');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_email_generique',\n 'create_email_generique');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin deptServ',\n 'Update',\n 'manage_options',\n 'update_table_email',\n 'update_table_email');//function\n}", "public function edit(Menu_builder $menu_builder)\n {\n //\n }", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "function loadMenu($arg_menu_name)\n{\n\tINCLUDE('menus/' . $arg_menu_name . '.mnu');\n\treturn $menu;\n}", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "private function loadMenu()\n\t{\n\t\tglobal $txt, $context, $modSettings, $settings;\n\n\t\t// Need these to do much\n\t\trequire_once(SUBSDIR . '/Menu.subs.php');\n\n\t\t// Define the menu structure - see subs/Menu.subs.php for details!\n\t\t$admin_areas = array(\n\t\t\t'forum' => array(\n\t\t\t\t'title' => $txt['admin_main'],\n\t\t\t\t'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'index' => array(\n\t\t\t\t\t\t'label' => $txt['admin_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_home',\n\t\t\t\t\t\t'class' => 'i-home i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'credits' => array(\n\t\t\t\t\t\t'label' => $txt['support_credits_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_credits',\n\t\t\t\t\t\t'class' => 'i-support i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'maillist' => array(\n\t\t\t\t\t\t'label' => $txt['mail_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMaillist',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-envelope-blank i-admin',\n\t\t\t\t\t\t'permission' => array('approve_emails', 'admin_forum'),\n\t\t\t\t\t\t'enabled' => featureEnabled('pe'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'emaillist' => array($txt['mm_emailerror'], 'approve_emails'),\n\t\t\t\t\t\t\t'emailfilters' => array($txt['mm_emailfilters'], 'admin_forum'),\n\t\t\t\t\t\t\t'emailparser' => array($txt['mm_emailparsers'], 'admin_forum'),\n\t\t\t\t\t\t\t'emailtemplates' => array($txt['mm_emailtemplates'], 'approve_emails'),\n\t\t\t\t\t\t\t'emailsettings' => array($txt['mm_emailsettings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'news' => array(\n\t\t\t\t\t\t'label' => $txt['news_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageNews',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-post-text i-admin',\n\t\t\t\t\t\t'permission' => array('edit_news', 'send_mail', 'admin_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'editnews' => array($txt['admin_edit_news'], 'edit_news'),\n\t\t\t\t\t\t\t'mailingmembers' => array($txt['admin_newsletters'], 'send_mail'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'packages' => array(\n\t\t\t\t\t\t'label' => $txt['package'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\Packages\\\\Packages',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-package i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['browse_packages']),\n\t\t\t\t\t\t\t'installed' => array($txt['installed_packages']),\n\t\t\t\t\t\t\t'options' => array($txt['package_settings']),\n\t\t\t\t\t\t\t'servers' => array($txt['download_packages']),\n\t\t\t\t\t\t\t'upload' => array($txt['upload_packages']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'packageservers' => array(\n\t\t\t\t\t\t'label' => $txt['package_servers'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\Packages\\\\PackageServers',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-package i-admin',\n\t\t\t\t\t\t'hidden' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_search',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-search i-admin',\n\t\t\t\t\t\t'select' => 'index'\n\t\t\t\t\t),\n\t\t\t\t\t'adminlogoff' => array(\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Admin',\n\t\t\t\t\t\t'function' => 'action_endsession',\n\t\t\t\t\t\t'label' => $txt['admin_logoff'],\n\t\t\t\t\t\t'enabled' => empty($modSettings['securityDisable']),\n\t\t\t\t\t\t'class' => 'i-sign-out i-admin',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'config' => array(\n\t\t\t\t'title' => $txt['admin_config'],\n\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'corefeatures' => array(\n\t\t\t\t\t\t'label' => $txt['core_settings_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\CoreFeatures',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-cog i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'featuresettings' => array(\n\t\t\t\t\t\t'label' => $txt['modSettings_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageFeatures',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-switch-on i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'basic' => array($txt['mods_cat_features']),\n\t\t\t\t\t\t\t'layout' => array($txt['mods_cat_layout']),\n\t\t\t\t\t\t\t'pmsettings' => array($txt['personal_messages']),\n\t\t\t\t\t\t\t'karma' => array($txt['karma'], 'enabled' => featureEnabled('k')),\n\t\t\t\t\t\t\t'likes' => array($txt['likes'], 'enabled' => featureEnabled('l')),\n\t\t\t\t\t\t\t'mention' => array($txt['mention']),\n\t\t\t\t\t\t\t'sig' => array($txt['signature_settings_short']),\n\t\t\t\t\t\t\t'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => featureEnabled('cp')),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'serversettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_server_settings'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageServer',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-menu i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['general_settings']),\n\t\t\t\t\t\t\t'database' => array($txt['database_paths_settings']),\n\t\t\t\t\t\t\t'cookie' => array($txt['cookies_sessions_settings']),\n\t\t\t\t\t\t\t'cache' => array($txt['caching_settings']),\n\t\t\t\t\t\t\t'loads' => array($txt['loadavg_settings']),\n\t\t\t\t\t\t\t'phpinfo' => array($txt['phpinfo_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'securitysettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_security_moderation'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSecurity',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-lock i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['mods_cat_security_general']),\n\t\t\t\t\t\t\t'spam' => array($txt['antispam_title']),\n\t\t\t\t\t\t\t'moderation' => array($txt['moderation_settings_short'], 'enabled' => !empty($modSettings['warning_enable'])),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'theme' => array(\n\t\t\t\t\t\t'label' => $txt['theme_admin'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageThemes',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'custom_url' => getUrl('admin', ['action' => 'admin', 'area' => 'theme']),\n\t\t\t\t\t\t'class' => 'i-modify i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'admin' => array($txt['themeadmin_admin_title']),\n\t\t\t\t\t\t\t'list' => array($txt['themeadmin_list_title']),\n\t\t\t\t\t\t\t'reset' => array($txt['themeadmin_reset_title']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'current_theme' => array(\n\t\t\t\t\t\t'label' => $txt['theme_current_settings'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageThemes',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'custom_url' => getUrl('admin', ['action' => 'admin', 'area' => 'theme', 'sa' => 'list', 'th' => $settings['theme_id']]),\n\t\t\t\t\t\t'class' => 'i-paint i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'languages' => array(\n\t\t\t\t\t\t'label' => $txt['language_configuration'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageLanguages',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-language i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'edit' => array($txt['language_edit']),\n\t\t\t\t\t\t\t// 'add' => array($txt['language_add']),\n\t\t\t\t\t\t\t'settings' => array($txt['language_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'addonsettings' => array(\n\t\t\t\t\t\t'label' => $txt['admin_modifications'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\AddonSettings',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-puzzle i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'general' => array($txt['mods_cat_modifications_misc']),\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'layout' => array(\n\t\t\t\t'title' => $txt['layout_controls'],\n\t\t\t\t'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'manageboards' => array(\n\t\t\t\t\t\t'label' => $txt['admin_boards'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageBoards',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-directory i-admin',\n\t\t\t\t\t\t'permission' => array('manage_boards'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'main' => array($txt['boardsEdit']),\n\t\t\t\t\t\t\t'newcat' => array($txt['mboards_new_cat']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'postsettings' => array(\n\t\t\t\t\t\t'label' => $txt['manageposts'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePosts',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'class' => 'i-post-text i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'posts' => array($txt['manageposts_settings']),\n\t\t\t\t\t\t\t'censor' => array($txt['admin_censored_words']),\n\t\t\t\t\t\t\t'topics' => array($txt['manageposts_topic_settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'editor' => array(\n\t\t\t\t\t\t'label' => $txt['editor_manage'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageEditor',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-modify i-admin',\n\t\t\t\t\t\t'permission' => array('manage_bbc'),\n\t\t\t\t\t),\n\t\t\t\t\t'smileys' => array(\n\t\t\t\t\t\t'label' => $txt['smileys_manage'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSmileys',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-smiley i-admin',\n\t\t\t\t\t\t'permission' => array('manage_smileys'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'editsets' => array($txt['smiley_sets']),\n\t\t\t\t\t\t\t'addsmiley' => array($txt['smileys_add'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'editsmileys' => array($txt['smileys_edit'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'setorder' => array($txt['smileys_set_order'], 'enabled' => !empty($modSettings['smiley_enable'])),\n\t\t\t\t\t\t\t'editicons' => array($txt['icons_edit_message_icons'], 'enabled' => !empty($modSettings['messageIcons_enable'])),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'manageattachments' => array(\n\t\t\t\t\t\t'label' => $txt['attachments_avatars'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageAttachments',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-paperclip i-admin',\n\t\t\t\t\t\t'permission' => array('manage_attachments'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['attachment_manager_browse']),\n\t\t\t\t\t\t\t'attachments' => array($txt['attachment_manager_settings']),\n\t\t\t\t\t\t\t'avatars' => array($txt['attachment_manager_avatar_settings']),\n\t\t\t\t\t\t\t'attachpaths' => array($txt['attach_directories']),\n\t\t\t\t\t\t\t'maintenance' => array($txt['attachment_manager_maintenance']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'managesearch' => array(\n\t\t\t\t\t\t'label' => $txt['manage_search'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSearch',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-search i-admin',\n\t\t\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'weights' => array($txt['search_weights']),\n\t\t\t\t\t\t\t'method' => array($txt['search_method']),\n\t\t\t\t\t\t\t'managesphinx' => array($txt['search_sphinx']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\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'members' => array(\n\t\t\t\t'title' => $txt['admin_manage_members'],\n\t\t\t\t'permission' => array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'viewmembers' => array(\n\t\t\t\t\t\t'label' => $txt['admin_users'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMembers',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-user i-admin',\n\t\t\t\t\t\t'permission' => array('moderate_forum'),\n\t\t\t\t\t),\n\t\t\t\t\t'membergroups' => array(\n\t\t\t\t\t\t'label' => $txt['admin_groups'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMembergroups',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-users',\n\t\t\t\t\t\t'permission' => array('manage_membergroups'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'index' => array($txt['membergroups_edit_groups'], 'manage_membergroups'),\n\t\t\t\t\t\t\t'add' => array($txt['membergroups_new_group'], 'manage_membergroups'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permissions' => array(\n\t\t\t\t\t\t'label' => $txt['edit_permissions'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePermissions',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-lock i-admin',\n\t\t\t\t\t\t'permission' => array('manage_permissions'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'index' => array($txt['permissions_groups'], 'manage_permissions'),\n\t\t\t\t\t\t\t'board' => array($txt['permissions_boards'], 'manage_permissions'),\n\t\t\t\t\t\t\t'profiles' => array($txt['permissions_profiles'], 'manage_permissions'),\n\t\t\t\t\t\t\t'postmod' => array($txt['permissions_post_moderation'], 'manage_permissions', 'enabled' => $modSettings['postmod_active']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'ban' => array(\n\t\t\t\t\t\t'label' => $txt['ban_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageBans',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-thumbdown i-admin',\n\t\t\t\t\t\t'permission' => 'manage_bans',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'list' => array($txt['ban_edit_list']),\n\t\t\t\t\t\t\t'add' => array($txt['ban_add_new']),\n\t\t\t\t\t\t\t'browse' => array($txt['ban_trigger_browse']),\n\t\t\t\t\t\t\t'log' => array($txt['ban_log']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'regcenter' => array(\n\t\t\t\t\t\t'label' => $txt['registration_center'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageRegistration',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-user-plus i-admin',\n\t\t\t\t\t\t'permission' => array('admin_forum', 'moderate_forum'),\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'register' => array($txt['admin_browse_register_new'], 'moderate_forum'),\n\t\t\t\t\t\t\t'agreement' => array($txt['registration_agreement'], 'admin_forum'),\n\t\t\t\t\t\t\t'privacypol' => array($txt['privacy_policy'], 'admin_forum'),\n\t\t\t\t\t\t\t'reservednames' => array($txt['admin_reserved_set'], 'admin_forum'),\n\t\t\t\t\t\t\t'settings' => array($txt['settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'sengines' => array(\n\t\t\t\t\t\t'label' => $txt['search_engines'],\n\t\t\t\t\t\t'enabled' => featureEnabled('sp'),\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageSearchEngines',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-website i-admin',\n\t\t\t\t\t\t'permission' => 'admin_forum',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'stats' => array($txt['spider_stats']),\n\t\t\t\t\t\t\t'logs' => array($txt['spider_logs']),\n\t\t\t\t\t\t\t'spiders' => array($txt['spiders']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'paidsubscribe' => array(\n\t\t\t\t\t\t'label' => $txt['paid_subscriptions'],\n\t\t\t\t\t\t'enabled' => featureEnabled('ps'),\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManagePaid',\n\t\t\t\t\t\t'class' => 'i-credit i-admin',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'permission' => 'admin_forum',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'view' => array($txt['paid_subs_view']),\n\t\t\t\t\t\t\t'settings' => array($txt['settings']),\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'maintenance' => array(\n\t\t\t\t'title' => $txt['admin_maintenance'],\n\t\t\t\t'permission' => array('admin_forum'),\n\t\t\t\t'areas' => array(\n\t\t\t\t\t'maintain' => array(\n\t\t\t\t\t\t'label' => $txt['maintain_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Maintenance',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-cog i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'routine' => array($txt['maintain_sub_routine'], 'admin_forum'),\n\t\t\t\t\t\t\t'database' => array($txt['maintain_sub_database'], 'admin_forum'),\n\t\t\t\t\t\t\t'members' => array($txt['maintain_sub_members'], 'admin_forum'),\n\t\t\t\t\t\t\t'topics' => array($txt['maintain_sub_topics'], 'admin_forum'),\n\t\t\t\t\t\t\t'hooks' => array($txt['maintain_sub_hooks_list'], 'admin_forum'),\n\t\t\t\t\t\t\t'attachments' => array($txt['maintain_sub_attachments'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'logs' => array(\n\t\t\t\t\t\t'label' => $txt['logs'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\AdminLog',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-comments i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'errorlog' => array($txt['errlog'], 'admin_forum', 'enabled' => !empty($modSettings['enableErrorLogging']), 'url' => getUrl('admin', ['action' => 'admin', 'area' => 'logs', 'sa' => 'errorlog', 'desc'])),\n\t\t\t\t\t\t\t'adminlog' => array($txt['admin_log'], 'admin_forum', 'enabled' => featureEnabled('ml')),\n\t\t\t\t\t\t\t'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => featureEnabled('ml')),\n\t\t\t\t\t\t\t'banlog' => array($txt['ban_log'], 'manage_bans'),\n\t\t\t\t\t\t\t'spiderlog' => array($txt['spider_logs'], 'admin_forum', 'enabled' => featureEnabled('sp')),\n\t\t\t\t\t\t\t'tasklog' => array($txt['scheduled_log'], 'admin_forum'),\n\t\t\t\t\t\t\t'pruning' => array($txt['pruning_title'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'scheduledtasks' => array(\n\t\t\t\t\t\t'label' => $txt['maintain_tasks'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageScheduledTasks',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-calendar i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'tasks' => array($txt['maintain_tasks'], 'admin_forum'),\n\t\t\t\t\t\t\t'tasklog' => array($txt['scheduled_log'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'mailqueue' => array(\n\t\t\t\t\t\t'label' => $txt['mailqueue_title'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\ManageMail',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-envelope-blank i-admin',\n\t\t\t\t\t\t'subsections' => array(\n\t\t\t\t\t\t\t'browse' => array($txt['mailqueue_browse'], 'admin_forum'),\n\t\t\t\t\t\t\t'settings' => array($txt['mailqueue_settings'], 'admin_forum'),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'reports' => array(\n\t\t\t\t\t\t'enabled' => featureEnabled('rg'),\n\t\t\t\t\t\t'label' => $txt['generate_reports'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\Reports',\n\t\t\t\t\t\t'function' => 'action_index',\n\t\t\t\t\t\t'class' => 'i-pie-chart i-admin',\n\t\t\t\t\t),\n\t\t\t\t\t'repairboards' => array(\n\t\t\t\t\t\t'label' => $txt['admin_repair'],\n\t\t\t\t\t\t'controller' => '\\\\ElkArte\\\\AdminController\\\\RepairBoards',\n\t\t\t\t\t\t'function' => 'action_repairboards',\n\t\t\t\t\t\t'select' => 'maintain',\n\t\t\t\t\t\t'hidden' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->_events->trigger('addMenu', array('admin_areas' => &$admin_areas));\n\n\t\t// Any files to include for administration?\n\t\tcall_integration_include_hook('integrate_admin_include');\n\n\t\t$menuOptions = array(\n\t\t\t'hook' => 'admin',\n\t\t);\n\n\t\t// Actually create the menu!\n\t\t$menu = new Menu();\n\t\t$menu->addMenuData($admin_areas);\n\t\t$menu->addOptions($menuOptions);\n\t\t$admin_include_data = $menu->prepareMenu();\n\t\t$menu->setContext();\n\t\tunset($admin_areas);\n\n\t\t// Make a note of the Unique ID for this menu.\n\t\t$context['admin_menu_id'] = $context['max_menu_id'];\n\t\t$context['admin_menu_name'] = 'menu_data_' . $context['admin_menu_id'];\n\n\t\t// Where in the admin are we?\n\t\t$context['admin_area'] = $admin_include_data['current_area'];\n\n\t\treturn $admin_include_data;\n\t}", "public function index()\n\t{\n\t\t$this->def->page_validator();\n\t\t$this->load->model(\"mdimport\");\n\t\t$data['title'] = \"Import Penjualan\";\n\t\t$data['menu'] = 0;\n\t\t$data['submenu'] = 0;\n\t\t$data['state'] = $this->mdimport->cek_status_import();\n\n\t\t$this->load->view(\"header\",$data);\n\t\t$this->load->view(\"import\");\n\t\t$this->load->view(\"footer\");\n\t}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "function MeMenuSub1()\n{\n\nrequire 'admin/audience.php';\n\necho $meTable8;\n\n\n\n\n}", "public function edit(TbMenu $tbMenu)\n {\n //\n }", "function ufclas_matlab_register_menu(){\n\tadd_management_page('MATLAB Import', 'MATLAB Import', 'manage_options', 'ufclas-matlab-import', 'ufclas_matlab_page');\n}", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function run()\n {\n DB::insert(\"INSERT INTO menu_item VALUES \n ('access',NULL,0,'br','main',0,85,'ACCESS','index.php?mode=access','Controle de acesso: usuários, grupos, transações, programas, etc.','Acesso','fa fa-user',NULL,NULL,1,0),\n ('ACC_ADDER','access',1,'br','access',0,50,'ACC_ADDER','access_adder','Tabela de acumuladores','Acumuladores',NULL,NULL,'access',0,0),\n ('ACC_CONTR1','access',1,'br','access',0,200,'ACC_CONTRO','access_control','Controle de acesso por tipo de entidade, grupo e tipo de acesso','Manutenção de Acesso',NULL,NULL,'access',0,0),\n ('ACC_CONTRO','access',1,'br','access',0,100,'ACC_CONTRO','access_control','Manutenção direta da tabela de controles de acesso','Controle de Acesso',NULL,NULL,'access',0,0),\n ('ACC_ENTITY','access',1,'br','access',0,40,'ACC_ENTITY','access_entity','manutenção da tabela de entidades','Entidades',NULL,NULL,'access',0,0),\n ('ACC_ENTTYP','access',1,'br','access',0,30,'ACC_ENTTYP','access_entity_type','manutenção da tabela de tipos de entidade','Tipos de Entidade',NULL,NULL,'access',0,0),\n ('ACC_EVENT','access',1,'br','access',0,3000,'ACC_EVENT','access_event','Manutenção de eventos','Eventos',NULL,NULL,'access',0,0),\n ('ACC_GROUPS','access',1,'br','access',0,20,'ACC_GROUPS','access_groups','Manutenção da tabela de grupos','Grupos',NULL,NULL,'access',0,0),\n ('ACC_MESSAG','access',1,'br','access',0,250,'ACC_MESSAG','access_message','Manutenção da tabela de mensagens','Mensagem',NULL,NULL,'access',0,0),\n ('ACC_PASSEX',NULL,1,'br','access',0,20,'ACC_PASSEX','access_password_expiration','Expiração de Senhas','Expiração de Senhas',NULL,NULL,'access',0,0),\n ('ACC_PASSPO',NULL,1,'br','access',0,12,'ACC_PASSPO','access_password_policy','Política de Segurança','Política de Segurança',NULL,NULL,'access',0,0),\n ('ACC_PASSWD','access',1,'br','access',0,70,'ACC_PASSWD','access_passwd','Alterar Senha','Alterar Senha',NULL,NULL,'access',0,0),\n ('ACC_TYPE','access',1,'br','access',0,60,'ACC_TYPE','access_type','Manutenção da tabela de tipos de acesso','Tipos de Acesso',NULL,NULL,'access',0,0),\n ('ACC_TYPEOP','access',1,'br','access',0,45,'ACC_TYPEOP','access_type_operation','Tipos de Operação','Tipos de Operação',NULL,NULL,'access',0,0),\n ('ACC_USERS','access',1,'br','access',0,10,'ACC_USERS','access_users','Manutenção da tabela de usuários','Usuários',NULL,NULL,'access',0,0),\n ('amount',NULL,0,'br','main',0,6,'AMOUNT','index.php?mode=amount','Acompanhamento de Vendas: por finalizadora, por item, etc.','Vendas','glyphicon glyphicon-shopping-cart',NULL,NULL,1,0),\n ('AMO_ACCUM','MAMO_ITEM',2,'br','amount',0,920,'AMO_ACCUM','amount_accum','Vendas por Item - Periodo','Itens por periodo',NULL,NULL,'amount',0,0),\n ('AMO_AVRGPR','MAMO_ESTAT',2,'br','amount',0,300,'AMO_AVRGPR','amount_process_average','Média de Processamento','Média de Processamento',NULL,NULL,'amount',0,0),\n ('AMO_BAG','amount',1,'br','amount',0,356,'AMO_BAG','amount_bag_report','Relatório de sacolas','Relatório de sacolas',NULL,NULL,'amount',0,0),\n ('AMO_BANKIN','MAMO_MEDIA',2,'br','amount',0,570,'AMO_BANKIN','amount_banking','Sangria / Fundo de Troco','Sangria / Fundo de Troco',NULL,NULL,'amount',0,0),\n ('AMO_BASE','MAMO_ITEM',2,'br','amount',0,930,'AMO_BASE','amount_base','Vendas por Periodo de Grupos de Itens','Grupos de Itens',NULL,NULL,'amount',0,0),\n ('AMO_BIRTH','MAMO_ESTAT',2,'br','amount',0,500,'AMO_BIRTH','assai_birthday','Campanha Assai - vale Brinde 100','Campanha Assai - vale Brinde 100',NULL,NULL,'amount',0,1),\n ('AMO_CBACK','MAMO_OTHER',2,'br','amount',0,100,'AMO_CBACK','amount_cash_back','Visualização de Saques','Saques',NULL,NULL,'AMOUNT',0,0),\n ('AMO_CELOPE','MAMO_OTHER',2,'br','amount',0,12,'AMO_CELOPE','amount_operator','Consulta de Vendas por Operadora de Celular','Vendas por Operadora de Celular',NULL,NULL,'amount',0,0),\n ('AMO_CHECK','MAMO_TOTAL',2,'br','amount',0,1120,'AMO_CHECK','amount_check','Checagem de Vendas por Item','Checagem',NULL,NULL,'amount',0,0),\n ('AMO_CHECKL','MAMO_MEDIA',2,'br','amount',0,560,'AMO_CHECKL','amount_checklist','Lista de Cheques','Lista de Cheques',NULL,NULL,'amount',0,0),\n ('AMO_CLERK','MAMO_OPER',2,'br','amount',0,630,'AMO_CLERK','amount_clerk','Vendas por Vendedor','Vendedor',NULL,NULL,'amount',0,0),\n ('AMO_COMM','MAMO_OPER',2,'br','amount',0,665,'AMO_COMM','amount_clerk_commission','Comissões por Vendedor','Comissões',NULL,NULL,'amount',0,0),\n ('AMO_CORBAN','MAMO_OTHER',2,'br','amount',0,50,'AMO_CORBAN','amount_cor_bank','Correspondente Bancario','Correspondente Bancario',NULL,NULL,'amount',0,0),\n ('AMO_DEPOS','MAMO_RTN',2,'br','amount',0,850,'AMO_DEPOS','amount_deposit','Consulta de troca de vasilhame','Vasilhame',NULL,NULL,'amount',0,0),\n ('AMO_DEPOSITM','MAMO_RTN',2,'br','amount',0,950,'AMO_DEPOS','amount_deposit','Status das trocas de vasilhame por item','Vasilhame/Item',NULL,NULL,'amount',0,0),\n ('AMO_DEPTS','MAMO_DEP',2,'br','amount',0,810,'AMO_DEPTS','amount_depts','Vendas por Departamento','Departamento',NULL,NULL,'amount',0,0),\n ('AMO_DISAUT','MAMO_DSC',2,'br','amount',0,50,'AMO_DISAUT','amount_discount_authorizer','Descontos por autorizador','Descontos por autorizador',NULL,NULL,'amount',0,0),\n ('AMO_DISCNT','MAMO_DSC',2,'br','amount',0,25,'AMO_DISCNT','amount_discount','Descontos','Descontos',NULL,NULL,'amount',0,0),\n ('AMO_DISCNT1','MAMO_DSC',2,'br','amount',0,12,'AMO_DISCNT','amount_discount_reason','Descontos por Motivo','Descontos 1',NULL,NULL,'amount',0,0),\n ('AMO_DPTR','MAMO_DEP',2,'br','amount',0,820,'AMO_DPTR','amount_depts','Vendas por Departamento','Departamentos Estruturados',NULL,NULL,'amount',0,0),\n ('AMO_DPTRHR','MAMO_DEP',2,'br','amount',0,830,'AMO_DPTRHR','amount_depts','Vendas por Departamento / Faixa Horária','Departamentos / Faixa Horária',NULL,NULL,'amount',0,0),\n ('AMO_DSCREA',NULL,1,'br','amount',0,9600,'AMO_DSCREA','amount_discount_reason','Motivos de Desconto','Motivos de Desconto',NULL,NULL,'amount',0,0),\n ('AMO_FISCAL','MAMO_FISC',2,'br','amount',0,1010,'AMO_FISCAL','amount_fiscal','Totais Fiscais','Reduções Z',NULL,NULL,'amount',0,0),\n ('AMO_ITEM','MAMO_ITEM',2,'br','amount',0,910,'AMO_ITEM','amount_item','Vendas por Item','Itens',NULL,NULL,'amount',0,0),\n ('AMO_ITMSRV','MAMO_TCKT',2,'br','amount',0,37,'AMO_ITMSRV','amount_ticket_service','Consulta items do tickets por tipo de serviço','Itens com Serviços',NULL,NULL,'amount',0,0),\n ('AMO_LOGIT','MAMO_ITEM',2,'br','amount',0,940,'AMO_LOGIT','amount_logitem','Extrato de Item','Extrato',NULL,NULL,'amount',0,0),\n ('AMO_MAKER','amount',1,'br','amount',0,210,'AMO_MAKER','amount_makers','Vendas por Fornecedor','Fornecedor',NULL,NULL,'amount',0,0),\n ('AMO_MEDIA','amount',1,'br','amount',0,11,'AMO_MEDIA','amount_media','Totais por Finalizadora','Finalizadoras',NULL,NULL,'amount',0,0),\n ('AMO_MEDIAC','amount',1,'br','amount',0,270,'AMO_MEDIAC','amount_mediaper','Comparativo de Vendas por Periodo','Comparativo por Periodo',NULL,NULL,'amount',0,0),\n ('AMO_MEDIAM','x_amount',1,'br','x_amount',0,310,'AMO_MEDIAM','amount_mediamcc','Finalizações MCC','Finalizações MCC',NULL,NULL,'x_amount',0,0),\n ('AMO_MEDIAP','MAMO_MEDIA',2,'br','amount',0,550,'AMO_MEDIAP','amount_mediatot','Vendas por Periodo','Vendas por Periodo',NULL,NULL,'amount',0,0),\n ('AMO_MEDIAT','MAMO_MEDIA',2,'br','amount',0,540,'AMO_MEDIAT','amount_mediatkt','Finalizações','Finalizações',NULL,NULL,'amount',0,0),\n ('AMO_MEF','MAMO_FISC',2,'br','amount',0,1120,'AMO_MEF','amount_mef','Consulta Leitura MEF','Leitura MEF',NULL,NULL,'amount',0,0),\n ('AMO_METRCOP','MAMO_OPER',2,'br','amount',0,686,'AMO_METRCO','amount_metric_oper','Metrica de Operador','Metrica de Operador',NULL,NULL,'amount',0,0),\n ('AMO_METRIC','MAMO_OPER',2,'br','amount',0,682,'AMO_METRIC','amount_metric','Metrica Por Operador','Metrica',NULL,NULL,'amount',0,0),\n ('AMO_NFCE','MAMO_TCKT',2,'br','amount',0,50,'AMO_NFCE','amount_check_nfce','Vendas NFCe','Vendas NFCe',NULL,NULL,'amount',0,0),\n ('AMO_NOCRETURN','MAMO_RTN',2,'br','amount',0,715,'AMO_NRCON','amount_return_control','Trocas de Mercadorias (sem cupom)','Troca/Reembolso (sem cupom)',NULL,NULL,'amount',0,1),\n ('AMO_NRCON','MAMO_RTN',2,'br','amount',0,712,'AMO_NRCON','amount_return_control','Trocas de Mercadorias (sem cupom)','Troca/Reembolso (sem cupom)',NULL,NULL,'amount',0,1),\n ('AMO_OBLATA','amount',1,'br','amount',0,24,'AMO_OBLATA','amount_oblata','Consulta de Vendas por Campanha','Vendas por Campanha',NULL,NULL,'amount',0,0),\n ('AMO_OBLREP',NULL,1,'br','amount',0,30,'AMO_OBLREP','amount_oblata_result','Resultado de Campanha','Resultado de Campanha',NULL,NULL,'amount',0,0),\n ('AMO_OBLRES','MAMO_TCKT',2,'br','amount',0,300,'AMO_OBLRES','amount_oblata_result','Resultado de Campanha','Resultado de Campanha',NULL,NULL,'amount',0,0),\n ('AMO_OBLTKT','MAMO_OTHER',2,'br','amount',0,1,'AMO_OBLTKT','amount_oblata_ticket','Cupons Sorteio','Cupons Sorteio',NULL,NULL,'amount',0,0),\n ('AMO_OBLTOT','MAMO_TCKT',2,'br','amount',0,200,'AMO_OBLTOT','amount_oblata_tot','Consulta do Total de Vendas por Campanha','Total de Vendas por Campanha',NULL,NULL,'amount',0,0),\n ('AMO_OPER','MAMO_OPER',2,'br','amount',0,610,'AMO_OPER','amount_oper','Totais por Operador','Operadores',NULL,NULL,'amount',0,0),\n ('AMO_PARTRF','MAMO_RTN',2,'br','amount',0,730,'AMO_PARTRF','amount_part_refund','Reembolso de Diferenças','Reembolsos',NULL,NULL,'amount',0,0),\n ('AMO_PAYMEN','MAMO_OTHER',2,'br','amount',0,25,'AMO_PAYMEN','amount_payment','Pagamentos','Pagamentos',NULL,NULL,'amount',0,0),\n ('AMO_PBMREL','amount',1,'br','amount',0,28,'AMO_PBMREL','amount_ticket_pbm','Consulta de tickets de PBMs','Vendas PBMs',NULL,NULL,'amount',0,0),\n ('AMO_PLAN','amount',1,'br','amount',0,327,'AMO_PLAN','amount_plan','Vendas Parceladas','Vendas Parceladas',NULL,NULL,'amount',0,0),\n ('AMO_POLL',NULL,1,'br','amount',0,27,'AMO_POLL','amount_poll','Resultado Pesquisa de Cliente','Pesquisa Cliente',NULL,NULL,'amount',0,0),\n ('AMO_POS','MAMO_ITEM',2,'br','amount',0,950,'AMO_POS','amount_pos','Vendas por PDV','PDV',NULL,NULL,'amount',0,0),\n ('AMO_PRICE','amount',1,'br','amount',0,160,'AMO_PRICE','amount_price','Vendas por Tipo de Preço','Tipo de Preço',NULL,NULL,'amount',0,0),\n ('AMO_PROD','MAMO_OPER',2,'br','amount',0,700,'AMO_PROD','amount_oper_prod','Relatorio de Produtividade','Relatorio de Produtividade',NULL,NULL,NULL,NULL,NULL),\n ('AMO_PROMOT','MAMO_TCKT',2,'br','amount',0,250,'AMO_PROMOT','amount_promotion','Vendas por Campanha','Vendas por Campanha',NULL,NULL,'amount',0,0),\n ('AMO_QUERY','MAMO_OTHER',2,'br','amount',0,2,'AMO_QUERY','amount_query','Controle de consulta no PDV','Controle de consulta',NULL,NULL,'amount',0,0),\n ('AMO_RANK','MAMO_OTHER',2,'br','amount',0,150,'AMO_RANK','amount_ranking','Ranking de Cupons','Ranking',NULL,NULL,'amount',0,0),\n ('AMO_REFUND','MAMO_RTN',2,'br','amount',0,720,'AMO_REFUND','amount_refund','Devoluções de Mercadorias','Devoluções',NULL,NULL,'amount',0,0),\n ('AMO_RETURN','MAMO_RTN',2,'br','amount',0,710,'AMO_RETURN','amount_return','Trocas de Mercadorias','Trocas',NULL,NULL,'amount',0,0),\n ('AMO_RFITEM','MAMO_RTN',2,'br','amount',0,750,'AMO_RFITEM','amount_refunded_item','Consulta de Itens com Reembolso Parcial','Reembolsos por Item',NULL,NULL,'amount',0,0),\n ('AMO_RITEM','MAMO_RTN',2,'br','amount',0,740,'AMO_RITEM','amount_returned_item','Consulta de Itens Devolvidos','Itens Devolvidos',NULL,NULL,'amount',0,0),\n ('AMO_RTBOTTLE','MAMO_RTN',2,'br','amount',0,1050,'AMO_RTBOTT','amount_return_bottle','Lançamento de Devolução de vasilhames','Lançamento de Devolução de vasilhames',NULL,NULL,'amount',0,0),\n ('AMO_RVSKIT','NULL',1,'br','amount',0,2300,'AMO_RVSKIT','amount_reverse_kit','Vendas de kit reverso','Vendas de kit reverso',NULL,NULL,'amount',0,0),\n ('AMO_SALEPH','MAMO_ESTAT',2,'br','amount',0,200,'AMO_SALEPH','amount_sale_per_hour','Vendas Por Faixa Horária','Vendas Por Faixa Horária',NULL,NULL,'amount',0,0),\n ('AMO_SAT','MAMO_TOTAL',2,'br','amount',0,1220,'AMO_SAT','amount_check_sat','Checagem de Vendas por SAT','Checagem SAT',NULL,NULL,'amount',0,0),\n ('AMO_SEAL','MAMO_OTHER',2,'br','amount',0,250,'AMO_SEAL','amount_seal','Selos','Selos',NULL,NULL,'amount',0,0),\n ('AMO_SERV','MAMO_OTHER',2,'br','amount',0,6,'AMO_SERV','amount_service','Manutencao de convenio de estacionamento','Convenio Estacionamento',NULL,NULL,'amount',0,0),\n ('AMO_STAT','MAMO_ESTAT',2,'br','amount',0,50,'AMO_STAT','amount_stat','Estatística de Venda','Estatística',NULL,NULL,'amount',0,0),\n ('AMO_STIME','MAMO_OPER',2,'br','amount',0,691,'AMO_STIME','amount_exit_time','Saida Temporária','Saida Temporária',NULL,NULL,'amount',0,0),\n ('AMO_STOP','MAMO_OPER',2,'br','amount',0,620,'AMO_STOP','amount_statope','Produtividade por Operador','Produtividade',NULL,NULL,'amount',0,0),\n ('AMO_STSALE','MAMO_ESTAT',2,'br','amount',0,100,'AMO_STSALE','amount_statistic_sale','Estatísticas de Vendas','Estatísticas de Vendas',NULL,NULL,'amount',0,0),\n ('AMO_TEF','MAMO_MEDIA',2,'br','amount',0,530,'AMO_TEF','amount_tef','Resumo de Cartoes','Resumo Cartoes',NULL,NULL,'amount',0,0),\n ('AMO_TICKET','amount',1,'br','amount',0,22,'AMO_TICKET','amount_ticket','Vendas por Ticket','Tickets',NULL,NULL,'amount',0,0),\n ('AMO_TKTCST','MAMO_TCKT',2,'br','amount',0,100,'AMO_TKTCST','amount_ticket_custom','Seleção de transações por tipo','Transações por Tipo',NULL,NULL,'amount',0,0),\n ('AMO_TKTNFP','amount',1,'br','amount',0,25,'AMO_TKTNFP','amount_ticket_nfp','Vendas por Ticket NFP','Tickets NFP',NULL,NULL,'amount',0,0),\n ('AMO_TKTSRV','MAMO_TCKT',2,'br','amount',0,25,'AMO_TKTSRV','amount_ticket_service','Consulta tickets por serviço','Tickets por serviço',NULL,NULL,'amount',0,0),\n ('AMO_TOTAL','MAMO_TOTAL',2,'br','amount',0,1110,'AMO_TOTAL','amount_total','Comparativo de Vendas Liquidas','Comparativo',NULL,NULL,'amount',0,0),\n ('AMO_TOTITM','MAMO_TCKT',2,'br','amount',0,400,'AMO_TOTITM','amount_ticket_tot_itm','Consulta total de cupons vendidos na campanha','Cupons vendidos na campanha',NULL,NULL,'amount',0,0),\n ('AMO_TOTPOS','MAMO_ESTAT',2,'br','amount',0,400,'AMO_TOTPOS','amount_total_pos','Atividades por PDV','Atividades por PDVs',NULL,NULL,'amount',0,0),\n ('AMO_TOTSTO','amount',1,'br','amount',0,26,'AMO_TOTSTO','amount_store','Totais de Venda por Loja','Vendas por Loja',NULL,NULL,'amount',0,0),\n ('AMO_TRFNL','MAMO_TOTAL',2,'br','amount',0,1320,'AMO_TRFNL','amount_media_swap','Troca de Finalizadora','Troca de Finalizadora',NULL,NULL,'amount',0,0),\n ('AMO_TRIBUT','MAMO_FISC',2,'br','amount',0,1020,'AMO_TRIBUT','amount_tributo','Totais de Impostos por período','Impostos',NULL,NULL,'amount',0,0),\n ('AMO_TTRPT','amount',1,'br','amount',0,30,'AMO_TTRPT','amount_total_report','Relatório de Totais','Relatório de Totais',NULL,NULL,'amount',0,0),\n ('AMO_TTSTAN',NULL,1,'br','amount',0,26,'AMO_TTSTAN','amount_store_analytical','Totais de Venda por Loja - Analítico','Vendas por Loja Analítico',NULL,NULL,'amount',0,0),\n ('AMO_TYPPRC',NULL,1,'br','amount',0,3200,'AMO_TYPPRC','amount_type_price','Clientes por Tipo de Preço','Clientes por Tipo de Preço',NULL,NULL,NULL,0,0),\n ('AMO_VDTEF','MAMO_OTHER',2,'br','amount',0,3,'AMO_VDTEF','amount_voidedtef','Estornos de transações de Transferência Eletrônica de Fundos','Cancelamentos TEF',NULL,NULL,'amount',0,0),\n ('AMO_VOIDED','amount',1,'br','amount',0,130,'AMO_VOIDED','amount_voided','Cancelamentos de Vendas, Cupons e Itens de venda','Cancelamentos',NULL,NULL,'amount',0,0),\n ('AMO_VOIREA','amount',1,'br','amount',0,145,'AMO_VOIREA','amount_void_reason','Cancelamentos por Motivo','Cancelamentos por Motivo',NULL,NULL,'amount',0,0),\n ('AMT_LBLPRM','MAMO_TCKT',2,'br','amount',0,500,'AMT_LBLPRM','amount_label_promotion','Campanha relampago','Vendas de Campanha relampago',NULL,NULL,'amount',0,0),\n ('CERT_NFCE','store',1,'br','store',0,335,'CERT_NFCE','store_certificados_nfce','Certificados','Certificados',NULL,NULL,'store',0,0),\n ('CNSD_GCG','treasury',1,'br','treasury',0,1152,'CNSD_GCG','cnsd_guide_blind','Lançamento de guia cega','Lançamento de guia cega',NULL,NULL,'treasury',0,0),\n ('copyright','x_main',0,'br','x_main',0,16,'COPYRIGHT','copy.html','Sobre','Dados do Sistema',NULL,NULL,NULL,1,0),\n ('CST_ADDRTP','customer',1,'br','customer',0,40,'CST_ADDRTP','customer_addr_type','manutenção da tabela de tipos de endereços','Tipos de Endereço',NULL,NULL,'customer',0,0),\n ('CST_CSTPT','customer',1,'br','customer',0,160,'CST_CSTPT','customer_points','Manutenção dos pontos de campanha','Pontos de Campanha',NULL,NULL,'customer',0,0),\n ('CST_DLDPAY','customer',1,'br','customer',0,1700,'CST_DLDPAY','customer_delayed_pay','Registro de dias de adiamentos','Registro de dias de adiamentos',NULL,NULL,'customer',0,1),\n ('CST_DOTZ','customer',1,'br','customer',0,1400,'CST_DOTZ','customer_cupom_dotz','Cupons dotz','Cupom dotz',NULL,NULL,NULL,0,0),\n ('CST_EXTPTS','customer',1,'br','customer',0,1800,'CST_EXTPTS','customer_external_points','Controle de Pontos','Controle de Pontos',NULL,NULL,'customer',0,1),\n ('CST_FILE','customer',1,'br','customer',0,10,'CST_FILE','customer_file','Manutenção da tabela de clientes','Clientes',NULL,NULL,'customer',0,0),\n ('CST_FILE_FT','customer',1,'br','customer',0,15,'CST_FILE_F','customer_file','Cadastro de cliente Rapido','Clientes Rapido',NULL,NULL,'customer',0,0),\n ('CST_FISCTP','customer',1,'br','customer',0,130,'CST_FISCTP','customer_fisc_type','Manutenção da tabela de categorias fiscais de clientes','Categoria Fiscal',NULL,NULL,'customer',0,0),\n ('CST_LEFT','customer',1,'br','customer',0,150,'CST_LEFT','customer_left','Baixa de saldo de clientes','Baixa de Saldo',NULL,NULL,'customer',0,0),\n ('CST_MEDIA','customer',1,'br','customer',0,140,'CST_MEDIA','customer_media','Vendas por tipo de cliente','Vendas',NULL,NULL,'customer',0,0),\n ('CST_POLL','customer',1,'br','customer',0,1600,'CST_POLL','customer_poll','Manutenção de Enquetes','Enquetes',NULL,NULL,'customer',0,1),\n ('CST_POLLV','customer',1,'br','customer',0,1500,'CST_POLLV','customer_poll_result','Resultados de enquetes','Resultados de enquetes',NULL,NULL,'customer',0,1),\n ('CST_RESTRC','customer',1,'br','customer',0,20,'CST_RESTRC','customer_restriction','Manutenção da tabela de tipos de restrições','Restrições',NULL,NULL,'customer',0,0),\n ('CST_SKUTYP','customer',1,'br','customer',0,110,'CST_SKUTYP','customer_sku_type','Manutenção da tabela de tipos de identificação','Tipos de Identificação',NULL,NULL,'customer',0,0),\n ('CST_SRSTP','customer',1,'br','customer',0,105,'CST_SRSTP','customer_serasa_type','Manutenção da tabela de Status do SERASA','SERASA',NULL,NULL,'customer',0,0),\n ('CST_STSTP','customer',1,'br','customer',0,100,'CST_STSTP','customer_sts_type','Manutenção da tabela de situações (Status) de clientes','Status',NULL,NULL,'customer',0,0),\n ('CST_TRANS','customer',1,'br','customer',0,780,'CST_TRANS','customer_transaction','Transações de Clientes','Transações',NULL,NULL,'customer',0,0),\n ('CST_TYPE','customer',1,'br','customer',0,30,'CST_TYPE','customer_type','Manutenção da tabela de tipos de clientes','Tipos de Cliente',NULL,NULL,'customer',0,0),\n ('customer',NULL,0,'br','main',0,83,'CUSTOMER','index.php?mode=customer','Controle de clientes: dados cadastrais, saldo, situação, compras, etc.','Clientes','fa fa-users',NULL,NULL,1,0),\n ('CUS_CONF','MPART_CUS',2,'br','partner',0,200,'CUS_CONF','custodiam_conf','Configuração de Transmissão DBOnline','Configuração',NULL,NULL,'partner',0,0),\n ('CUS_TKT','MPART_CUS',2,'br','partner',0,100,'CUS_TKT','custodiam_ticket','Relatorio de Transmissão DBOnline','Transmissão',NULL,NULL,'partner',0,0),\n ('CUS_USER','MPART_CUS',2,'br','partner',0,300,'CUS_USER','custodiam_user','Usuários de transmissão DBOnline','Usuários',NULL,NULL,'partner',0,0),\n ('DASH_COR','dashboard',1,'br','dashboard',0,600,'DASH_COR','dashboard/index','Dashboard Configuração Cor','Dashboard Configuração Cor',NULL,NULL,'dashboard',0,0),\n ('DASH_NFCE','dashboard',1,'br','dashboard',0,400,'DASH_NFCE','dashboard/index','Dashboard Vendas por NFCE','Dashboard Vendas por NFCE',NULL,NULL,'dashboard',0,0),\n ('DASH_SALE','dashboard',1,'br','dashboard',0,100,'DASH_SALE','dashboard/index','Dashboard Vendas por loja','Dashboard Vendas por loja',NULL,NULL,'dashboard',0,0),\n ('DASH_SALEAG','dashboard',1,'br','dashboard',0,200,'DASH_SALEA','dashboard/index','Dashboard Vendas por Vendedor','Dashboard Vendas por Vendedor',NULL,NULL,'dashboard',0,0),\n ('DASH_SALETP','dashboard',1,'br','dashboard',0,300,'DASH_SALET','dashboard/index','Dashboard Vendas por Tipo','Dashboard Vendas por Tipo',NULL,NULL,'dashboard',0,0),\n ('DASH_SAT','dashboard',1,'br','dashboard',0,500,'DASH_SAT','dashboard/index','Dashboard Vendas por SAT','Dashboard Vendas por SAT',NULL,NULL,'dashboard',0,0),\n ('gas',NULL,0,'br','main',0,54,'GAS','index.php?mode=gas_station','Posto de Combustivel','Posto',NULL,NULL,NULL,1,1),\n ('GAS_ACCTK','gas_station',1,'br','gas_station',0,1492,'GAS_ACCTK','gas_station_accum_tank','Acumulado por Tanque','Acumulado por Tanque',NULL,NULL,'gas_station',0,0),\n ('GAS_AMOSTO','gas_station',1,'br','gas_station',0,977,'GAS_AMOSTO','gas_station_amount_stock','Vendas/Estoque','Vendas/Estoque',NULL,NULL,'gas_station',0,0),\n ('GAS_BANKIN','gas_station',1,'br','gas_station',0,1599,'GAS_BANKIN','gas_station_banking','Sangria por Frentista','Sangria Frentista',NULL,NULL,'gas_station',0,0),\n ('GAS_BNKUSR','gas_station',1,'br','gas_station',0,1474,'GAS_BNKUSR','gas_station_banking_user','Relatório de Sangrias por Usuário','Relatório de Sangrias por Usuário',NULL,NULL,'gas_station',0,0),\n ('GAS_CLBRT','gas_station',1,'br','gas_station',0,965,'GAS_CLBRT','gas_station_calibrating','Aferição de Bico','Aferição de Bico',NULL,NULL,'gas_station',0,0),\n ('GAS_CLOCHK','gas_station',1,'br','gas_station',0,969,'GAS_CLOCHK','gas_station_closing_check','Checagem de Encerrantes','Checagem de Encerrantes',NULL,NULL,'gas_station',0,0),\n ('GAS_CLOS','gas_station',1,'br','gas_station',0,966,'GAS_CLOS','gas_station_closing','Fechameto por data','Fechameto por data',NULL,NULL,'gas_station',0,0),\n ('GAS_COMMIS','gas_station',1,'br','gas_station',0,2787,'GAS_COMMIS','gas_station_commission','Comissões por Frentista','Comissões por Frentista',NULL,NULL,'gas_station',0,0),\n ('GAS_COV','gas_station',1,'br','gas_station',0,951,'GAS_COV','gas_station_lmc_cover','Termo de Abertura/Encerramento','Termo de Abertura/Encerramento',NULL,NULL,'gas_station',0,0),\n ('GAS_HISPV',NULL,1,'br','gas_station',0,980,'GAS_HISPV','gas_station_history_vol_price','Historico de Preço e Volume','Historico de Preço e Volume',NULL,NULL,NULL,NULL,NULL),\n ('GAS_HISVE','gas',1,'br','gas_station',0,1900,'GAS_HISVE','gas_station_stock_history','Histórico de Estoque e Vendas','Histórico de Estoque e Vendas',NULL,NULL,NULL,0,0),\n ('GAS_IDNUM','gas_station',1,'br','gas_station',0,1299,'GAS_IDNUM','gas_station_id_number','Cartões RFID','Cartões RFID',NULL,NULL,'gas_station',0,0),\n ('GAS_INTVTN','gas_station',1,'br','gas_station',0,995,'GAS_INTVTN','gas_station_intervention','Intervenções','Intervenções',NULL,NULL,'gas_station',0,0),\n ('GAS_INVPEN','gas_station',1,'br','gas_station',0,1486,'GAS_INVPEN','gas_station_outstanding','Notas Pendentes','Notas Pendentes',NULL,NULL,'gas_station',0,0),\n ('GAS_LITERS','gas_station',1,'br','gas_station',0,2800,'GAS_LITERS','gas_station_liters_received','Relatório de Litros de Combustíveis Recebidos','Litros de Combustíveis Recebidos',NULL,NULL,'gas_station',0,0),\n ('GAS_LMC','gas_station',1,'br','gas_station',0,949,'GAS_LMC','gas_station_lmc','LMC','LMC',NULL,NULL,'gas_station',0,0),\n ('GAS_MAICLO','gas_station',1,'br','gas_station',0,999,'GAS_MAICLO','gas_station_main_closing','Manutenção de Encerrantes','Manutenção de Encerrantes',NULL,NULL,'gas_station',0,0),\n ('GAS_NOZCHK','gas_station',1,'br','gas_station',0,989,'GAS_NOZCHK','gas_station_nozzle_check','Checagem de Abastecimento','Checagem de Abastecimento',NULL,NULL,'gas_station',0,0),\n ('GAS_NOZPRC','gas_station',1,'br','gas_station',0,2793,'GAS_NOZPRC','gas_station_price_nozzle','Checagem de bicos','Checagem de bicos',NULL,NULL,'gas_station',0,0),\n ('GAS_NOZZLE','gas_station',1,'br','gas_station',0,919,'GAS_NOZZLE','gas_station_nozzle','Bicos','Bicos',NULL,NULL,'gas_station',0,0),\n ('GAS_NUMLMC','gas_station',1,'br','gas_station',0,954,'GAS_NUMLMC','gas_station_num_lmc','Número LMC','Número LMC',NULL,NULL,'gas_station',0,0),\n ('GAS_PERCEN','gas_station',1,'br','gas_station',0,2750,'GAS_PERCEN','gas_station_percents','Percentuais de Ganhos e Perdas','Percentuais de Ganhos e Perdas',NULL,NULL,'gas_station',0,0),\n ('GAS_PERSOB','gas_station',1,'br','gas_station',0,2900,'GAS_PERSOB','gas_station_leavings','Relatório de Perdas e Sobras de Combustiveis','Perdas e Sobras de Combustiveis',NULL,NULL,'gas_station',0,0),\n ('GAS_PREAMO','gas_station',1,'br','gas_station',0,1199,'GAS_PREAMO','gas_station_prev_amount','Vendas Esperadas','Vendas Esperadas',NULL,NULL,'gas_station',0,0),\n ('GAS_PRICE','gas_station',1,'br','gas_station',0,1099,'GAS_PRICE','gas_station_pricing','Pesquisa x Preço','Pesquisa x Preço',NULL,NULL,'gas_station',0,0),\n ('GAS_PUMP','gas_station',1,'br','gas_station',0,929,'GAS_PUMP','gas_station_pump','Bombas','Bombas',NULL,NULL,'gas_station',0,0),\n ('GAS_RECNF','gas_station',1,'br','gas_station',0,961,'GAS_RECNF','gas_station_receiving','NF Combustivel','NF Combustivel',NULL,NULL,'gas_station',0,0),\n ('GAS_REFUEL','gas_station',1,'br','gas_station',0,1499,'GAS_REFUEL','gas_station_refueling','Abastecimentos','Abastecimentos',NULL,NULL,'gas_station',0,0),\n ('GAS_SLUSR','gas_station',1,'br','gas_station',0,1480,'GAS_SLUSR','gas_station_sale_user','Vendas por Frentista','Relatório de Vendas por Frentista',NULL,NULL,'gas_station',0,0),\n ('gas_station',NULL,0,'br','main',0,1080,'GAS','index.php?mode=gas_station','Posto de Combustivel','Posto','img/gas.png',NULL,NULL,1,1),\n ('GAS_STCON','gas_station',1,'br','gas_station',0,2700,'GAS_STCON','gas_station_stock_consolidated','Vendas/Estoque Consolidado','Vendas/Estoque Consolidado',NULL,NULL,'gas_station',0,0),\n ('GAS_STOACC','gas_station',1,'br','gas_station',0,974,'GAS_STOACC','gas_station_store_accum','Acumulado de Vendas','Acumulado de Vendas',NULL,NULL,'gas_station',0,0),\n ('GAS_STOCK','gas_station',1,'br','gas_station',0,959,'GAS_STOCK','gas_station_stock','Estoque','Estoque',NULL,NULL,'gas_station',0,0),\n ('GAS_SUPSRV','gas_station',1,'br','gas_station',0,2775,'GAS_SUPSRV','gas_station_super_service','Configuração do SuperService','Configuração do SuperService',NULL,NULL,'gas_station',0,0),\n ('GAS_TANK','gas_station',1,'br','gas_station',0,939,'GAS_TANK','gas_station_tank','Tanques','Tanques',NULL,NULL,'gas_station',0,0),\n ('GAS_TICKET','gas_station',1,'br','gas_station',0,963,'GAS_TICKET','gas_station_ticket','Consulta de Nota','Consulta de Nota',NULL,NULL,'gas_station',0,0),\n ('GAS_TKTMEA','gas_station',1,'br','gas_station',0,1449,'GAS_TKTMEA','gas_station_measure_ticket','Tickets de Aferição','Tickets de Aferição',NULL,NULL,'gas_station',0,0),\n ('GAS_USERID','gas_station',1,'br','gas_station',0,1399,'GAS_USERID','gas_station_user_id','Usuário RFID','Usuário RFID',NULL,NULL,'gas_station',0,0),\n ('gateway',NULL,0,'br','main',0,84,'GATEWAY','index.php?mode=gateway','Administração dos gateways do sistema e do servidor','Gateway','glyphicon glyphicon-globe',NULL,NULL,1,0),\n ('GFT_CLERK','gift_list',1,'br','gift_list',0,200,'GFT_CLERK','gift_list_amount_clerk','Vendas por vendedor','Totais de venda por vendedor',NULL,NULL,'gift_list',0,0),\n ('GFT_CLERKT','gift_list',1,'br','gift_list',0,300,'GFT_CLERKT','gift_list_amount_clerk_totals','Vendas por vendedor - Quantitativo x Qualitativo','Totais Vendedor Quantitativo/Qualitativo',NULL,NULL,'gift_list',0,0),\n ('GFT_EDTKT','gift_list',1,'br','gift_list',0,100,'GFT_EDTKT','gift_list_ticket','Edição de ticket','Edição de ticket',NULL,NULL,'gift_list',0,0),\n ('GFT_FILE',NULL,1,'br','gift_list',0,802,'GFT_FILE','gift_list_file','Lista de Presentes','Lista de Presentes',NULL,NULL,'gift_list',0,0),\n ('GFT_TYPE',NULL,1,'br','gift_list',0,801,'GFT_TYPE','gift_list_type','Tipo de Lista','Tipo de Lista',NULL,NULL,'gift_list',0,0),\n ('gift_list',NULL,0,'br','main',0,87,'GFT_LIST','index.php?mode=gift_list','Manutenção do Cadastro de Listas','Listas','img/gift_list.gif',NULL,NULL,1,1),\n ('GTW_PARAM','gateway',1,'br','gateway',0,20,'GTW_PARAM','gateway_param','Parâmetros dos gateways','Parâmetros',NULL,NULL,'gateway',0,0),\n ('GTW_STATUS','gateway',1,'br','gateway',0,10,'GTW_STATUS','gateway_status','Status dos gateways','Status',NULL,NULL,'gateway',0,0),\n ('help',NULL,0,'br','main',0,90,'HELP','javascript:help','Ajuda global, para este módulo ou para esta tela','Ajuda','glyphicon glyphicon-question-sign',NULL,NULL,3,0),\n ('help_mod','x_main',0,'br','x_main',0,14,'HELP_MOD','doc/help.php','Ajuda para este módulo','Ajuda',NULL,NULL,NULL,1,0),\n ('help_ndx','x_main',0,'br','x_main',0,15,'HELP','doc/help.php?mode=global','Consultar documentação','Manual',NULL,NULL,NULL,1,0),\n ('impexp',NULL,0,'br','main',0,8,'IMPEXP','index.php?mode=impexp','Controle de Operações: Importação, exportação, carga, backup, etc.','Operações','glyphicon glyphicon-wrench',NULL,NULL,1,0),\n ('IMP_ACSEAL','MIMP_SEAL',2,'br','impexp',0,200,'IMP_ACSEAL','impexp_seal_accelerators','Acelerador de Selos','Acelerador de Selos',NULL,NULL,'impexp',0,0),\n ('IMP_BACKUP','impexp',1,'br','impexp',0,120,'IMP_BACKUP','impexp_backup','Geração de backup','Backup',NULL,NULL,'impexp',0,0),\n ('IMP_BEBLUE','MIE_IDBDB',2,'br','impexp',0,400,'IMP_BEBLUE','impexp_beblue','Integração Beblue','Integração Beblue',NULL,NULL,'impexp',0,0),\n ('IMP_CLUST','impexp',1,'br','impexp',0,220,'IMP_CLUST','/moderator-cgi/control_panel?mode=farm','Controle dos processadores no cluster','Cluster',NULL,NULL,'impexp',0,0),\n ('IMP_CONSIN','impexp',1,'br','impexp',0,43,'IMP_CONSIN','impexp_consinco','Integração Consinco','Integração Consinco',NULL,NULL,'impexp',0,0),\n ('IMP_CPANEL','impexp',1,'br','impexp',0,200,'IMP_CPANEL','/moderator-cgi/control_panel?action=start&theme={theme}','Controle e acompanhamento do sistema','Painel',NULL,NULL,'impexp',0,0),\n ('IMP_CTP06','impexp',1,'br','impexp',0,3510,'IMP_CTP06','impexp_cotepe06','Ato COTEPE 06/08','Ato COTEPE 06/08',NULL,NULL,'impexp',0,0),\n ('IMP_CVENDA','MIE_IDBDB',2,'br','impexp',0,600,'IMP_CVENDA','impexp_cvenda','Integra??o CresceVendas','Integra??o CresceVendas',NULL,NULL,'impexp',0,0),\n ('IMP_DB_DB','impexp',1,'br','impexp',0,180,'IMP_DB_DB','impexp_db_db','Comunicação banco a banco','Banco a Banco',NULL,NULL,'impexp',0,0),\n ('IMP_DEL','impexp',1,'br','impexp',0,155,'IMP_DEL','impexp_delete','Exclusão de dados não mais utilizados','Exclusão de Movimento',NULL,NULL,'impexp',0,0),\n ('IMP_DIGITA','impexp',1,'br','impexp',0,3500,'IMP_DIGITA','impexp_digital','Arquivo Digital','Arquivo Digital',NULL,NULL,'impexp',0,0),\n ('IMP_DIRCMD','impexp',1,'br','impexp',0,75,'IMP_SEND','impexp_direct_command','Envio de comando a PDVs para execução imediata','Comando Imediato',NULL,NULL,'impexp',0,0),\n ('IMP_DOC','impexp',1,'br','impexp',0,42,'IMP_DOC','impexp_doc_load','Importação de Nota Fiscal Eletrônica','Importação de Nota Eletrônica',NULL,NULL,'impexp',0,0),\n ('IMP_ECFSTS','impexp',1,'br','impexp',0,25,'IMP_ECFSTS','impexp_ecf_sts','Situação dos ECFs','Status ECF',NULL,NULL,'impexp',0,0),\n ('IMP_EXP87','MIE_EXPORT',2,'br','impexp',0,300,'IMP_EXP87','impexp_export87_db2db','Integração Banco a Banco Export87','Integração Banco a Banco Export87',NULL,NULL,'impexp',0,0),\n ('IMP_EXPDIR','impexp',1,'br','impexp',0,170,'IMP_EXPDIR','/exp/','Download de arquivos exportados','Diretório de exportação',NULL,NULL,'impexp',0,0),\n ('IMP_EXPGMC','MIE_OTHER',2,'br','impexp',0,100,'IMP_EXPGMC','impexp_export_gemco','Integração GEMCO','Integração GEMCO',NULL,NULL,'impexp',0,1),\n ('IMP_EXPORT','impexp',1,'br','impexp',0,100,'IMP_EXPORT','impexp_export','Exportação de arquivos','Exportação',NULL,NULL,'impexp',0,0),\n ('IMP_FILLOJ','impexp',1,'br','impexp',0,210,'IMP_FILLOJ','/moderator-cgi/control_panel?mode=queues','Mensagens enfileiradas, por loja','Filas por Loja',NULL,NULL,'impexp',0,0),\n ('IMP_GAM',NULL,1,'br','impexp',0,165,'IMP_GAM','impexp_gam','Gerador de Arquivos Magnéticos das operações com combustíveis (GAM)','GAM',NULL,NULL,NULL,NULL,NULL),\n ('IMP_GSEAL','MIMP_SEAL',2,'br','impexp',0,100,'IMP_GSEAL','impexp_pos_group_seal','Grupo PDV - Selos','Grupo PDV - Selos',NULL,NULL,'impexp',0,0),\n ('IMP_ISEAL','MIMP_SEAL',2,'br','impexp',0,300,'IMP_ISEAL','impexp_input_seal','Administra??o de Selos','Administra??o de Selos',NULL,NULL,'impexp',0,0),\n ('IMP_LOAD','impexp',1,'br','impexp',0,40,'IMP_LOAD','impexp_load','Importação de arquivo','Importação',NULL,NULL,'impexp',0,0),\n ('IMP_MKADD','impexp',1,'br','impexp',0,205,'IMP_MKADD','mk_import_adder','Importação e Inicialização de Acumuladores','Importação de Acumuladores',NULL,NULL,'impexp',0,0),\n ('IMP_NOTIF','impexp',1,'br','impexp',0,230,'IMP_NOTIF','impexp_notification','Controle de Operadores','Operadores',NULL,NULL,'impexp',0,0),\n ('IMP_PDVRMS','MIE_EXPORT',2,'br','impexp',0,400,'IMP_PDVRMS','impexp_pdv_rms','Integração de PDV x RMS Sales','Integração de PDV x RMS Sales',NULL,NULL,'impexp',0,0),\n ('IMP_POSINS','impexp',1,'br','impexp',0,130,'IMP_POSINS','impexp_posinstall','Criação de pacotes de instalação de PDVs','Pacotes',NULL,NULL,'impexp',0,0),\n ('IMP_POSSTS','impexp',1,'br','impexp',0,20,'IMP_POSSTS','impexp_pos_sts','Situação dos PDVs','Status PDV',NULL,NULL,'impexp',0,0),\n ('IMP_QUEUES','impexp',1,'br','impexp',0,140,'IMP_QUEUES','impexp_queues','Controle de filas','Filas',NULL,NULL,'impexp',0,0),\n ('IMP_REPR','impexp',1,'br','impexp',0,150,'IMP_REPR','impexp_reprocess','Reprocessamento de movimentos já recebidos','Reprocessamento',NULL,NULL,'impexp',0,0),\n ('IMP_REQUES','impexp',1,'br','impexp',0,190,'IMP_REQUES','impexp_request','Situação de comandas','Comandas',NULL,NULL,'impexp',0,0),\n ('IMP_RMSDB','MIE_IDBDB',2,'br','impexp',0,200,'IMP_RMSDB','impexp_rms_integration','Integração RMS Banco a banco','Integração RMS',NULL,NULL,'impexp',0,0),\n ('IMP_SB1','MIE_IDBDB',2,'br','impexp',0,500,'IMP_SB1','impexp_sb1','Integração Business One','Integração SB1',NULL,NULL,'impexp',0,0),\n ('IMP_SCALE','impexp',1,'br','impexp',0,110,'IMP_SCALE','impexp_scale','Exportação de arquivos de carga de balanças e verificadores de preços','Balanças / Verificadores',NULL,NULL,'impexp',0,0),\n ('IMP_SEND','impexp',1,'br','impexp',0,50,'IMP_SEND','impexp_send','Envio de dados a PDVs','Envio',NULL,NULL,'impexp',0,0),\n ('IMP_SESSIO','impexp',1,'br','impexp',0,30,'IMP_SESSIO','impexp_session','Sessões','Lista de Sessões',NULL,NULL,'impexp',0,0),\n ('IMP_SINTEG','impexp',1,'br','impexp',0,160,'IMP_SINTEG','impexp_sintegra','Excrituração e emissão de documentos fiscais por processamento de dados','Sintegra',NULL,NULL,'impexp',0,0),\n ('IMP_SPED','MIE_EXPORT',2,'br','impexp',0,100,'IMP_SPED','impexp_sped','SPED','SPED',NULL,NULL,'impexp',0,0),\n ('IMP_SPEDDF','MIE_EXPORT',2,'br','impexp',0,200,'IMP_SPEDDF','impexp_sped_df','SPED_DF','SPED_DF',NULL,NULL,'impexp',0,0),\n ('IMP_STATUS','impexp',1,'br','impexp',0,10,'IMP_STATUS','impexp_status','Lista de Transações','Status',NULL,NULL,'impexp',0,0),\n ('IMP_SVTSVC','MIMP_SVTSV',2,'br','impexp',0,300,'IMP_SVTSVC','impexp_servertoserver_conf','Configuração Servidor Local','Configuração',NULL,NULL,'impexp',0,0),\n ('IMP_SVTSVE','MIMP_SVTSV',2,'br','impexp',0,100,'IMP_SVTSVE','impexp_servertoserver_send','Envio Servidor Local','Envio',NULL,NULL,'impexp',0,0),\n ('IMP_SVTSVM','MIMP_SVTSV',2,'br','impexp',0,200,'IMP_SVTSVM','impexp_servertoserver_moni','Monitoramento Servidor Local','Monitoramento',NULL,NULL,'impexp',0,0),\n ('IMP_TICKET','impexp',1,'br','impexp',0,1865,'IMP_TICKET','impexp_ticket','Administração de Filas','Filas de Vendas',NULL,NULL,'impexp',0,0),\n ('IMP_WEBSRV','impexp',1,'br','impexp',0,15,'IMP_WEBSRV','impexp_web_service','Status do Web Service','Web Service',NULL,NULL,'impexp',0,0),\n ('INTEGRATI','MIE_IDBDB',2,'br','impexp',0,300,'INTEGRATI','impexp_integration','Integração','Integração',NULL,NULL,'impexp',0,1),\n ('IZIO_ENTR','MPART_IZIO',2,'br','partner',0,100,'IZIO_ENTR','izio_entries','Envio IZIO','Envio IZIO',NULL,NULL,'partner',0,1),\n ('IZIO_INFO','MPART_IZIO',2,'br','partner',0,300,'IZIO_INFO','izio_info_view','Informa??es IZIO','Informa??es IZIO',NULL,NULL,'partner',0,1),\n ('IZIO_PARAM','MPART_IZIO',2,'br','partner',0,200,'IZIO_PARAM','izio_param','Configura??o IZIO','Configura??o IZIO',NULL,NULL,'partner',0,1),\n ('logout',NULL,0,'br','main',0,585,'LOGOUT','index.php?mode=logout','Encerrar esta sessão','Sair',NULL,NULL,NULL,1,0),\n ('MAMO_DEP','amount',1,'br','amount',0,800,'MAMO_DEP','#','Vendas por Departamento','Departamentos',NULL,'this','amount',2,0),\n ('MAMO_DSC','amount',1,'','amount',0,675,'MAMO_DSC','#','Relatórios de descontos','Descontos',NULL,'this','amount',2,0),\n ('MAMO_ESTAT','amount',1,'','amount',0,8500,'MAMO_ESTAT','#','Estatísticas Diversas','Estatísticas',NULL,'this','amount',2,0),\n ('MAMO_FISC','amount',1,'br','amount',0,1000,'MAMO_FISC','#','Impostos e bases de cálculo','Impostos',NULL,'this','amount',2,0),\n ('MAMO_ITEM','amount',1,'br','amount',0,900,'MAMO_ITEM','#','Vendas por Item','Itens',NULL,'this','amount',2,0),\n ('MAMO_MEDIA','amount',1,'br','amount',0,500,'MAMO_MEDIA','#','Finalizações, resumo de cartões, etc.','Mais Finalizadoras',NULL,'this','amount',2,0),\n ('MAMO_OPER','amount',1,'br','amount',0,600,'MAMO_OPER','#','Operadores, Produtividade, etc.','Funcionários',NULL,'this','amount',2,0),\n ('MAMO_OTHER','amount',1,'','amount',0,687,'MAMO_OTHER','#','Recebimento de pagamentos, saques, etc.','Outras Operações',NULL,'this','amount',2,0),\n ('MAMO_RTN','amount',1,'br','amount',0,700,'MAMO_RTN','#','Devoluções, trocas, reembolsos','Devoluções',NULL,'this','amount',2,0),\n ('MAMO_TCKT','amount',1,'','amount',0,385,'MAMO_TCKT','#','Consulta de diversos tipos de transações','Vendas por Tipo',NULL,'this','amount',2,0),\n ('MAMO_TOTAL','amount',1,'br','amount',0,1100,'MAMO_TOTAL','#','Comparação entre valores','Verificações',NULL,'this','amount',2,0),\n ('MIE_EXPORT','impexp',1,'','impexp',0,45,'MIE_EXPORT','#','Exportação de movimentos, arquivos fiscais, etc.','Exportações',NULL,'this','amount',2,0),\n ('MIE_IDBDB','impexp',1,'','impexp',0,1550,'MIE_IDBDB','#','Integrações','Integrações',NULL,'this','impexp',2,0),\n ('MIE_OTHER','impexp',1,'','impexp',0,48,'MIE_OTHER','#','Operações batch','Outras Operações',NULL,'this','amount',2,0),\n ('MIE_QUEUE','impexp',1,'','impexp',0,47,'MIE_QUEUE','#','Filas de vendas, de mensagens, etc.','Filas',NULL,'this','amount',2,0),\n ('MIMP_SEAL','impexp',1,'br','impexp',0,3610,'MIMP_SEAL','#','Selos','Selos',NULL,'this','impexp',2,0),\n ('MIMP_SVTSV','impexp',1,'br','impexp',0,49,'MIMP_SVTSV','#','Exportação Servidor Local','Exportação Servidor Local',NULL,'this','impexp',2,0),\n ('MPART_CUS','partner',1,'','partner',0,300,'MPART_CUS','#','Parceiro DBOnline','DBOnline',NULL,'this','partner',2,0),\n ('MPART_IZIO','partner',1,'','partner',0,400,'MPART_IZIO','#','Parceiro IZIO','IZIO',NULL,'this','partner',2,1),\n ('MPART_MTRD','partner',1,'','partner',0,500,'MPART_MTRD','#','Parceiro MINUTRADE','MINUTRADE',NULL,'this','partner',2,1),\n ('MPART_SCA','partner',1,'','partner',0,200,'MPART_SCA','#','Parceiro Scanntech','Scanntech',NULL,'this','partner',2,0),\n ('MPLU_AUX','plu',1,'','plu',0,382,'MPLU_AUX','#','Tipos de preços, serviços, etiquetas, etc.','Tabelas Auxiliares',NULL,'this','plu',2,0),\n ('MPLU_CEL','plu',1,'','plu',0,329,'MPLU_CEL','#','Dados para recarga de celulares','Celular',NULL,'this','plu',2,0),\n ('MPLU_DEPT','plu',1,'','plu',0,359,'MPLU_DEPT','#','Manutenção da tabela de departamentos','Departamentos',NULL,'this','plu',2,0),\n ('MPLU_PLAN','plu',1,'br','plu',0,269,'MPLU_PLAN','#','Planos, parcelas, etc.','Planos',NULL,'this','plu',2,0),\n ('MPLU_PROMO','plu',1,'','plu',0,55,'MPLU_PROMO','#','Promoções e campanhas','Promoções',NULL,'this','plu',2,0),\n ('MPLU_REST','plu',1,'','plu',0,374,'MPLU_REST','#','Dados para restaurantes','Restaurante',NULL,'this','plu',2,0),\n ('MPLU_SELF','plu',1,'','plu',0,3850,'MPLU_SELF','#','Self-Checkout','Self-Checkout',NULL,'this','plu',2,0),\n ('MTRD_PARAM','MPART_MTRD',2,'br','partner',0,100,'MTRD_PARAM','minutrade_param','Configura??o MINUTRADE','Configura??o MINUTRADE',NULL,NULL,'partner',0,1),\n ('next_group','x_main',0,'br','x_main',0,98,'NEXT','index.php?mode=next','Mostrar outro menu','Mais ...',NULL,NULL,NULL,1,0),\n ('nfe',NULL,0,'br','main',0,9700,'NFE','index.php?mode=nfe','NFe','NFe','img/nfe.png',NULL,NULL,1,1),\n ('NFE_STATUS','nfe',1,'br','nfe',0,100,'NFE_STATUS','nfe_status','Status de Transações','Status',NULL,NULL,'nfe',0,1),\n ('partner',NULL,0,'br','main',0,9800,'PARTNER','index.php?mode=partner','Tela de Parceiros Conecto','Parceiros',NULL,NULL,NULL,1,1),\n ('PART_VIEW','partner',1,'br','partner',0,100,'PARTNER','partner_view','Tela de Parceiros Conecto','Parceiros',NULL,NULL,'partner',0,0),\n ('PHARMACY',NULL,0,'br','main',0,87,'PHARMACY','index.php?mode=pharmacy','Farmácia','Farmácia','img/pharmacy.gif',NULL,NULL,1,1),\n ('PHA_CTRLD','PHA_SNGPC',2,'br','pharmacy',0,100,'PHA_CTRLD','pharmacy_controlled_substances','Registro de Medicamentos controlados','Registro de Controlados',NULL,NULL,'pharmacy',0,0),\n ('PHA_FARMS','PHARMACY',1,'br','PHARMACY',0,200,'PHA_FARMS','pharmacy_pre_auth_farmaseg','Pré Autorização FarmaSeg','Pré Autorização FarmaSeg',NULL,NULL,'PHARMACY',0,0),\n ('PHA_FCARD','pharmacy',1,'br','pharmacy',0,600,'PHA_FCARD','pharmacy_funcional_card','Funcional Card','Funcional Card',NULL,NULL,'pharmacy',0,0),\n ('PHA_IMP','pharmacy',1,'br','pharmacy',0,250,'PHA_IMP','pharmacy_impexp_doc_load','Importa??o de Nota Fiscal Eletr?nica Farm?cia','Importa??o de Nota Eletr?nica',NULL,NULL,'pharmacy',0,0),\n ('PHA_MAKER','pharmacy',1,'br','pharmacy',0,400,'PHA_MAKER','pharmacy_maker','Convênios','Convênios',NULL,NULL,'pharmacy',0,0),\n ('PHA_ORDER','PHARMACY',1,'br','PHARMACY',0,100,'PHA_ORDER','pharmacy_ticket','Visualização de pedidos','Pedidos',NULL,NULL,NULL,0,0),\n ('PHA_PBM','pharmacy',1,'br','pharmacy',0,300,'PHA_PBM','pharmacy_pbm','PBMs','PBMs',NULL,NULL,'pharmacy',0,0),\n ('PHA_PBMMK','pharmacy',1,'br','pharmacy',0,500,'PHA_PBMMK','pharmacy_pbm_maker','Convênios por PBMs','Convênios por PBMs',NULL,NULL,'pharmacy',0,0),\n ('PHA_SNGPC','pharmacy',1,'','pharmacy',0,700,'PHA_SNGPC','#','Sistema Nacional de Gerenciamento de Produtos Controlados','SNGPC',NULL,'this','pharmacy',2,0),\n ('PHA_STSAN','PHA_SNGPC',2,'br','pharmacy',0,50,'PHA_STSAN','pharmacy_send_status','Status de Envio ANVISA','Status de envio',NULL,NULL,'pharmacy',0,0),\n ('plu',NULL,0,'br','main',0,80,'PLU','index.php?mode=plu','Manutenção do Cadastro de Itens','PLU','glyphicon glyphicon-barcode',NULL,NULL,1,0),\n ('PLU_ADM','PLU',1,'br','PLU',0,260,'PLU_ADM','plu_adm_prices','Administração de Preço','Administrção de Preços',NULL,NULL,'plu',0,0),\n ('PLU_ADMSPTC','MPLU_PLAN',2,'br','plu',0,395,'PLU_ADMSPT','plu_plan_admin_code','Cadastro de Código de Administradora','Cadastro de Código de Administradora',NULL,NULL,'plu',0,0),\n ('PLU_ADMSPTT','MPLU_PLAN',2,'br','plu',0,495,'PLU_ADMSPT','plu_plan_admin_type','Cadastro de Tipo de Financiamento','Cadastro de Tipo de Financiamento',NULL,NULL,'plu',0,0),\n ('PLU_BUDGET','plu',1,'br','plu',0,3350,'PLU_BUDGET','plu_budget','Metas','Metas',NULL,NULL,'plu',0,0),\n ('PLU_CEST','plu',1,'br','plu',0,127,'PLU_CEST','plu_cest','Manutenção de CEST','CEST',NULL,NULL,'plu',0,0),\n ('PLU_CHECK','plu',1,'br','plu',0,3750,'PLU_CHECK','plu_checking','Checagem de PLU','Checagem de PLU',NULL,NULL,'plu',0,0),\n ('PLU_COMPET','plu',1,'br','plu',0,3250,'PLU_COMPET','plu_compet','Concorrentes','Concorrentes',NULL,NULL,'plu',0,0),\n ('PLU_CPRE','plu',1,'br','plu',0,410,'PLU_CPRE','plu_cell_prefix','Prefixos de Celulares','Prefixos de Celulares',NULL,NULL,'plu',0,0),\n ('PLU_DEPTRE','MPLU_DEPT',2,'br','plu',0,100,'PLU_DEPTRE','plu_depts','Estrutura de Departamentos','Estrutura de Departamentos',NULL,NULL,'plu',0,0),\n ('PLU_DEPTREE','plu',1,'br','plu',0,100,'PLU_DEPTRE','plu_depts','Estrutura de Departamentos','Estrutura de Departamentos',NULL,NULL,'plu',0,0),\n ('PLU_DEPTS','plu',1,'br','plu',0,90,'PLU_DEPTS','plu_depts','Manutenção de Departamentos','Departamentos',NULL,NULL,'plu',0,0),\n ('PLU_DOTZ','MPLU_PROMO',2,'br','plu',0,300,'PLU_DOTZ','plu_dotz','Dotz por Item','Dotz por Item',NULL,NULL,'plu',0,0),\n ('PLU_DPSITM','MPLU_AUX',2,'br','plu',0,275,'PLU_DPSITM','plu_group_deposit_item','Itens por grupos de vasilhame','Itens por grupos de vasilhames',NULL,NULL,'plu',0,0),\n ('PLU_FSIT','plu',1,'br','plu',0,143,'PLU_FSIT','plu_fiscal_situation','Manutenção de situações fiscais','Situações Fiscais',NULL,NULL,'plu',0,0),\n ('PLU_GROUP','plu',1,'br','plu',0,250,'PLU_GROUP','plu_group','Grupo de itens','Grupo de itens',NULL,NULL,'plu',0,0),\n ('PLU_GRPDPS','MPLU_AUX',2,'br','plu',0,250,'PLU_GRPDPS','plu_group_deposit','Grupos Vasilhames','Grupos Vasilhames',NULL,NULL,'plu',0,0),\n ('PLU_GRPOBL','MPLU_AUX',2,'br','plu',0,100,'PLU_GRPOBL','plu_group_oblata','Grupos Promocionais','Grupos promocionais',NULL,NULL,'plu',0,0),\n ('PLU_GRPSC','plu',1,'br','plu',0,254,'PLU_GRPSC','plu_group_screen','Grupos para tela','Grupos para tela',NULL,NULL,'plu',0,0),\n ('PLU_INFN',NULL,1,'br','plu',0,3530,'PLU_INFN','plu_info_nutrition','Informações Nutricionais','Informações Nutricionais',NULL,NULL,NULL,0,0),\n ('PLU_ITEMS','plu',1,'br','plu',0,20,'PLU_ITEMS','plu_items','Manutenção de Produtos','Produtos',NULL,NULL,'plu',0,0),\n ('PLU_KITS','plu',1,'br','plu',0,80,'PLU_KITS','plu_kits','Consulta de Kits','Kits',NULL,NULL,'plu',0,0),\n ('PLU_LABEL','plu',1,'br','plu',0,180,'PLU_LABEL','plu_label','Manutenção de Tipos de Etiqueta','Tipos de Etiquetas',NULL,NULL,'plu',0,0),\n ('PLU_LIST','plu',1,'br','plu',0,200,'PLU_LIST','plu_list','Listagem de Produtos','Listagens',NULL,NULL,'plu',0,0),\n ('PLU_MAKERS','plu',1,'br','plu',0,110,'PLU_MAKERS','plu_makers','Manutenção de Fabricantes','Fabricantes',NULL,NULL,'plu',0,0),\n ('PLU_NCM','plu',1,'br','plu',0,125,'PLU_NCM','plu_ncm','Manutenção de NCM','NCM',NULL,NULL,'plu',0,0),\n ('PLU_OBDOTZ','plu',1,'br','plu',0,3650,'PLU_OBDOTZ','plu_oblata_dotz','Campanha Dotz','Campanha Dotz',NULL,NULL,'plu',0,0),\n ('PLU_OBITEM','MPLU_AUX',2,'br','plu',0,300,'PLU_OBITEM','plu_oblata_item','Permissão Itens Campanha','Permissão Itens Campanha',NULL,NULL,'plu',0,0),\n ('PLU_OBLATA','plu',1,'br','plu',0,75,'PLU_OBLATA','plu_oblata','Promoções Especiais','Campanhas',NULL,NULL,'plu',0,0),\n ('PLU_OBLFDL','plu',1,'br','plu',0,3950,'PLU_OBLFDL','plu_oblata_fidelity','Campanha Fidelidade','Campanha Fidelidade',NULL,NULL,'plu',0,0),\n ('PLU_OBLITM','MPLU_AUX',2,'br','plu',0,200,'PLU_OBLITM','plu_group_oblata_item','Itens por grupos promocionais','Itens por grupos promocionais',NULL,NULL,'plu',0,0),\n ('PLU_OBLTKT','plu',1,'br','plu',0,77,'PLU_OBLTKT','plu_oblata_extra_ticket','Formatos de comprovantes de campanha','Comprovantes de Campanha',NULL,NULL,'plu',0,0),\n ('PLU_OPER','plu',1,'br','plu',0,390,'PLU_OPER','plu_operator','Cadastro de Operadoras','Cadastro de Operadoras',NULL,NULL,'plu',0,0),\n ('PLU_ORDER','plu',1,'br','plu',0,145,'PLU_ORDER','plu_order_type','Tipo de Destino','Tipo de Destino',NULL,NULL,'plu',0,0),\n ('PLU_PACK','plu',1,'br','plu',0,85,'PLU_PACK','plu_pack','Manutenção de packs','Packs',NULL,NULL,'plu',0,0),\n ('PLU_PLAN','MPLU_PLAN',2,'br','plu',0,270,'PLU_PLAN','plu_plan','Manutenção de Planos','Planos',NULL,NULL,'plu',0,0),\n ('PLU_PLDEPT','MPLU_PLAN',2,'br','plu',0,290,'PLU_PLDEPT','plu_plan_department','Planos por departamento','Planos por departamento',NULL,NULL,'plu',0,0),\n ('PLU_PLUTY','plu',1,'br','plu',0,909,'PLU_PLUTY','plu_plu_type','Tipo de PLU','Tipo de PLU',NULL,NULL,'plu',0,0),\n ('PLU_PQSITM','plu',1,'br','plu',0,3575,'PLU_PQSITM','plu_price_quick_search','Pesquisa R?pida de Pre?o','Pesquisa R?pida de Pre?o',NULL,NULL,'plu',0,1),\n ('PLU_PRCUPD','plu',1,'br','plu',0,50,'PLU_PRCUPD','plu_pricing_update','Alteração de Preços','Alteração de Preços',NULL,NULL,'plu',0,0),\n ('PLU_PRICES','plu',1,'br','plu',0,150,'PLU_PRICES','plu_prices','Manutenção de Tipos de Preços','Tipos de Preço',NULL,NULL,'plu',0,0),\n ('PLU_PRM_ITM','MPLU_PROMO',2,'br','plu',0,100,'PLU_PRM_IT','plu_promotion_item','Items Campanhas','Items Campanhas',NULL,NULL,'plu',0,0),\n ('PLU_PROMO','plu',1,'br','plu',0,70,'PLU_PROMO','plu_promotion','Campanhas Promocionais','Promoções',NULL,NULL,'plu',0,0),\n ('PLU_PROMOA','MPLU_PROMO',2,'br','plu',0,200,'PLU_PROMOA','plu_label_promotion','Campanha Etiqueta Relâmpago','Etiqueta Relâmpago',NULL,NULL,'plu',0,0),\n ('PLU_PSPLIT','MPLU_PLAN',2,'br','plu',0,295,'PLU_PSPLIT','plu_plan_split_amount','Exceções de planos','Exceções de planos',NULL,NULL,'plu',0,0),\n ('PLU_PSTORE','MPLU_PLAN',2,'br','plu',0,280,'PLU_PSTORE','plu_plan_store','Plano por Loja','Plano por Loja',NULL,NULL,'plu',0,0),\n ('PLU_PSWGHT','plu',1,'br','plu',0,3600,'PLU_PSWGHT','plu_selfcheckout_weight','Varia??o de Peso','Varia??o de Peso',NULL,NULL,'plu',0,0),\n ('PLU_RECMES','plu',1,'br','plu',0,3550,'PLU_RECMES','plu_recipe_message','Manutenção de Mensagem da Receita','Mensagem da Receita',NULL,NULL,'plu',0,0),\n ('PLU_RES','plu',1,'br','plu',0,3450,'PLU_RES','plu_research','Pesquisas','Pesquisas',NULL,NULL,'plu',0,0),\n ('PLU_SCREEN','plu',1,'br','plu',0,256,'PLU_SCREEN','plu_screen','Itens para tela','Itens para tela',NULL,NULL,'plu',0,0),\n ('PLU_SEARCH','plu',1,'br','plu',0,52,'PLU_SEARCH','plu_search','Consulta de itens em campanhas e planos','Consulta de Itens',NULL,NULL,'plu',0,0),\n ('PLU_SERVIC','plu',1,'br','plu',0,3150,'PLU_SERVIC','plu_service','Manutenção de Seviços','Serviço',NULL,NULL,'plu',0,0),\n ('PLU_SKUSTO','plu',1,'br','plu',0,170,'PLU_SKUSTO','plu_sku','Consulta de SKU por Loja','SKU Loja',NULL,NULL,'plu',0,0),\n ('PLU_SLFCKI','MPLU_SELF',2,'br','plu',0,100,'PLU_SLFCKI','plu_self-checkout_check_items','Verifica??o de Itens Self-Checkout','Verifica??o de Itens Self-Checkout',NULL,NULL,'plu',0,0),\n ('PLU_SLFCNF','MPLU_SELF',2,'br','plu',0,200,'PLU_SLFCNF','plu_self-checkout_param','Par?metros Self-Checkout','Par?metros Self-Checkout',NULL,NULL,'plu',0,0),\n ('PLU_SPLIT','MPLU_PLAN',2,'br','plu',0,275,'PLU_SPLIT','plu_plan_split','Parcelas','Parcelas',NULL,NULL,'plu',0,0),\n ('PLU_SRVTYP','plu',1,'br','plu',0,3100,'PLU_SRVTYP','plu_service_type','Manutenção de Tipo de Seviço','Tipo de Serviço',NULL,NULL,'plu',0,0),\n ('PLU_STOCK','plu',1,'br','plu',0,60,'PLU_STOCK','plu_stock','Manutenção de Estoque','Estoque',NULL,NULL,'plu',0,0),\n ('PLU_STOCST','plu',1,'br','plu',0,35,'PLU_STOCST','plu_stocst','Manutenção de Custos','Custos',NULL,NULL,'plu',0,0),\n ('PLU_STOLBL','plu',1,'br','plu',0,190,'PLU_STOLBL','plu_stolbl','Etiquetas por Loja','Etiquetas',NULL,NULL,'plu',0,0),\n ('PLU_STOPRC','plu',1,'br','plu',0,30,'PLU_STOPRC','plu_stoprc','Manutenção de Preços','Preços',NULL,NULL,'plu',0,0),\n ('PLU_STOSTP','plu',1,'br','plu',0,40,'PLU_STOSTP','plu_stostp','Manutenção de Preços por Quantidade','Preços/Qtde',NULL,NULL,'plu',0,0),\n ('PLU_TARES','plu',1,'br','plu',0,160,'PLU_TARES','plu_tares','Manutenção de Tipos de Taras','Taras',NULL,NULL,'plu',0,0),\n ('PLU_TAXES','plu',1,'br','plu',0,120,'PLU_TAXES','plu_taxes','Manutenção de Impostos','Impostos',NULL,NULL,'plu',0,0),\n ('PLU_TYPES','plu',1,'br','plu',0,140,'PLU_TYPES','plu_types','Manutenção de Tipos de Impostos','Tipos de Impostos',NULL,NULL,'plu',0,0),\n ('PLU_UNITS','plu',1,'br','plu',0,130,'PLU_UNITS','plu_units','Manutenção de Unidades','Unidades',NULL,NULL,'plu',0,0),\n ('POSV','status',1,'br','status',0,187,'POSV','status_pos_program','Versão do Venditor dos PDVs','Versão PDV',NULL,NULL,'status',0,0),\n ('POSW','status',1,'br','status',0,175,'POSW','/moderator-cgi/poswizard?mode=view','Status de PDVs','PDV',NULL,NULL,'status',0,0),\n ('PRM_RMS','store',1,'br','store',0,342,'PRM_RMS','store_parameter_rms','Parâmetros RMS','Parâmetros RMS',NULL,NULL,'store',0,1),\n ('promotion',NULL,0,'br','main',0,81,'PROMOTION','index.php?mode=promotion','Cadastro e Configura??es de Promo??es','Campanhas','glyphicon glyphicon-tags',NULL,NULL,1,0),\n ('PROMO_EXT','promotion',1,'br','promotion',0,100,'PROMO_EXT','promotion_external','Campanhas Externas','Campanhas Externas',NULL,NULL,'promotion',0,0),\n ('PROMO_SAMO','promotion',1,'br','promotion',0,200,'PROMO_SAMO','promotion_external_store_amount','Campanhas Externas - Saldo por Loja','Campanhas Externas - Saldo por Loja',NULL,NULL,'promotion',0,0),\n ('PROMO_TKT','promotion',1,'br','promotion',0,150,'PROMO_TKT','promotion_ext_status','Vendas promocionais','Vendas promocionais',NULL,NULL,'promotion',0,0),\n ('REENV_NFCE','MIE_OTHER',2,'br','impexp',0,200,'REENV_NFCE','impexp_reenvio_nfce','Reenvio de NFCE','Reenvio de NFCE',NULL,NULL,'impexp',0,0),\n ('request',NULL,0,'br','main',0,7,'REQUEST','index.php?mode=request','Operações de Pedido','Pedido','glyphicon glyphicon-list-alt',NULL,NULL,1,0),\n ('REQ_CREATE','request',1,'br','request',0,100,'REQ_CREATE','request_create','Pré Venda','Pedido',NULL,NULL,'request',0,0),\n ('REQ_CSLALC','request',1,'br','request',0,500,'REQ_CSLALC','request_allocate','Consulta Empenho de Estoque','Consulta Empenho de Estoque',NULL,NULL,'request',0,0),\n ('REQ_CSLSTO','request',1,'br','request',0,400,'REQ_CSLSTO','request_stock','Consulta Estoque','Consulta de Estoque',NULL,NULL,'request',0,0),\n ('REQ_RELCKE','request',1,'br','request',0,300,'REQ_RELCKE','request_clerk','Relatório de vendedor','Relatório de Vendedor',NULL,NULL,'request',0,0),\n ('REQ_RELCST','request',1,'br','request',0,200,'REQ_RELCST','request_customer','Relatório de cliente','Relatório de Cliente',NULL,NULL,'request',0,0),\n ('restaurant',NULL,0,'br','main',0,2140,'RESTAURANT','index.php?mode=restaurant','Operações de Restaurante','Restaurante',NULL,NULL,NULL,1,1),\n ('RES_ADDGRO','restaurant',1,'br','restaurant',0,300,'RES_ADDGRO','restaurant_add_group','Cadastro de Grupos de Itens adicionais e associações com os adicionais','Grupos de Itens Adicionais',NULL,NULL,'restaurant',0,0),\n ('RES_ATTPL','restaurant',1,'br','restaurant',0,900,'RES_ATTPL','restaurant_attendance_place','Manutenção de Local de Atendimento','Local de Atendimento',NULL,NULL,'restaurant',0,0),\n ('RES_ATTPR','restaurant',1,'br','restaurant',0,600,'RES_ATTPR','restaurant_attendance_prof','Manutenção de Perfil de Atendimento','Perfil de Atendimento',NULL,NULL,'restaurant',0,0),\n ('RES_DBDB','restaurant',1,'br','restaurant',0,1100,'RES_DBDB','restaurant_db_db','Comunicação Banco a Banco','Banco a Banco',NULL,NULL,'restaurant',0,0),\n ('RES_ITEGRO','restaurant',1,'br','restaurant',0,400,'RES_ITEGRO','restaurant_item_x_group','Associação de Itens com os Grupo de Adicionais','Itens x Grupo de Adicionais',NULL,NULL,'restaurant',0,0),\n ('RES_ITEM','restaurant',1,'br','restaurant',0,200,'RES_ITEM','restaurant_item','Manutenção dos Itens, associação com os exclusos, etc','Cadastro de Itens',NULL,NULL,'restaurant',0,0),\n ('RES_MENUTR','restaurant',1,'br','restaurant',0,100,'RES_MENUTR','restaurant_menus','Estrutura de Menus','Estrutura de Menus',NULL,NULL,'restaurant',0,0),\n ('RES_PLUPLA','restaurant',1,'br','restaurant',0,1000,'RES_PLUPLA','restaurant_plu_place','Associação de Itens com Locais de Atendimento','Itens x Locais de Atendimento',NULL,NULL,'restaurant',0,0),\n ('RES_PRINT','restaurant',1,'br','restaurant',0,700,'RES_PRINT','restaurant_printer','Manutenção de Impressora','Impressora',NULL,NULL,'restaurant',0,0),\n ('RES_PRODPL','restaurant',1,'br','restaurant',0,800,'RES_PRODPL','restaurant_prodution_place','Manutenção de Local de Produção','Local de Produção',NULL,NULL,'restaurant',0,0),\n ('RES_PROF','restaurant',1,'br','restaurant',0,500,'RES_PROF','restaurant_profile','Manutenção de Perfil','Perfil',NULL,NULL,'restaurant',0,0),\n ('SCASTATUS','MPART_SCA',2,'br','partner',0,500,'SCASTATUS','scanntech_status','Status do serviço Scanntech','Status Serviço',NULL,NULL,'partner',0,0),\n ('SCA_CONF','MPART_SCA',2,'br','partner',0,400,'SCA_CONF','scanntech_param','Configuração Scanntech','Configuração',NULL,NULL,'partner',0,0),\n ('SCA_PLU','MPART_SCA',2,'br','partner',0,300,'SCA_PLU','scanntech_entries','Envio de cadastro Scanntech','Cadastro',NULL,NULL,'partner',0,0),\n ('SCA_TPRO','MPART_SCA',2,'br','partner',0,200,'SCA_TPRO','scanntech_promo_item','Relatorio de Transmissão Resumo Promoções','Resumo Promoções',NULL,NULL,'partner',0,0),\n ('SCA_TRAN','MPART_SCA',2,'br','partner',0,100,'SCA_TRAN','scanntech_sale','Relatorio de Transmissão Scanntech','Transmissão',NULL,NULL,'partner',0,0),\n ('status',NULL,0,'br','main',0,89,'STATUS','index.php?mode=status','Administração do sistema e do servidor','Adm','glyphicon glyphicon-cog',NULL,NULL,1,0),\n ('STC_BATCH','stock',1,'br','stock',0,1410,'STC_BATCH','stock_batch','Estoque por Lote','Estoque por Lote',NULL,NULL,'stock',0,0),\n ('STC_CFOPTR','stock',1,'br','stock',0,55,'STC_CFOPTR','stock_cfop','CFOP de/para - Importação DOC_e','CFOP',NULL,NULL,'stock',0,0),\n ('STC_INVENT','stock',1,'br','stock',0,60,'STC_INVENT','stock_inventory','Controle de operações de inventário','Inventário',NULL,NULL,'stock',0,0),\n ('STC_INVOIC','stock',1,'br','stock',0,30,'STC_INVOIC','stock_invoice','Emissão de notas fiscais conjugadas','Nota Conjugada',NULL,NULL,'stock',0,0),\n ('STC_M1','stock',1,'br','stock',0,46,'AUTH','#','Abre ou fecha o menu','Menu',NULL,'this','stock',2,0),\n ('STC_M1_I1','STC_M1',2,'br','stock',0,47,'AUTH','http://xxxxx','Vai para xxxxx','xxxxx',NULL,NULL,'stock',0,0),\n ('STC_PRODOR','stock',1,'br','stock',0,1110,'STC_PRODOR','stock_production_order','Ordem de Produção','Ordem de Produção',NULL,NULL,'stock',0,0),\n ('STC_RECEIV','stock',1,'br','stock',0,20,'STC_RECEIV','stock_receiving','Digitação de notas fiscais de entrada e saída','Entrada de Notas',NULL,NULL,'stock',0,0),\n ('STC_RECIPE','stock',1,'br','stock',0,1100,'STC_RECIPE','stock_recipe','Receitas','Receitas',NULL,NULL,'stock',0,0),\n ('STC_REFUND','stock',1,'br','stock',0,1610,'STC_REFUND','stock_refund_entry','Lan?amento de Reembolso','Lan?amento de Reembolso (sem cupom)',NULL,NULL,'stock',0,1),\n ('STC_REQUES','stock',1,'br','stock',0,40,'STC_REQUES','stock_request','Digitação de requisições de mercadorias','Requisição',NULL,NULL,'stock',0,0),\n ('STC_RETURN','stock',1,'br','stock',0,1210,'STC_RECIPE','stock_return','Lançamento de Devoluções','Devolução',NULL,NULL,'stock',0,0),\n ('STC_TICKET','stock',1,'br','stock',0,10,'STC_TICKET','stock_ticket','Consulta de Notas','Consulta de Notas',NULL,NULL,'stock',0,0),\n ('STC_TRADE','stock',1,'br','stock',0,1510,'STC_TRADE','stock_trade','Lan?amento de Trocas','Troca (sem cupom)',NULL,NULL,'stock',0,1),\n ('STC_TYPE','stock',1,'br','stock',0,50,'STC_TYPE','stock_type','Manutenção da tabela de tipos de notas fiscais','Tipos de Notas',NULL,NULL,'stock',0,0),\n ('STC_VCHDSP','STC_VOUCHE',2,'br','stock',0,100,'STC_VCHDSP','stock_voucher','Voucher - Consulta','Disponíveis',NULL,NULL,'stock',0,0),\n ('STC_VCHUSD','STC_VOUCHE',2,'br','stock',0,200,'STC_VCHUSD','stock_voucher_used','Vouchers Resgatados','Resgatados',NULL,NULL,'stock',0,0),\n ('STC_VOUCHE','stock',1,'','stock',0,1310,'STC_VOUCHE','#','Vouchers','Vouchers',NULL,'this','stock',2,1),\n ('stock',NULL,0,'br','main',0,11,'STOCK','index.php?mode=stock','Controle de Estoque','Estoque','glyphicon glyphicon-tasks',NULL,NULL,1,0),\n ('store',NULL,0,'br','main',0,65,'STORE','index.php?mode=store','Controle de Lojas','Lojas','glyphicon glyphicon-home',NULL,NULL,1,0),\n ('STO_ACC','store',1,'br','store',0,120,'STO_ACC','store_accountant','Contabilidade','Contabilidade',NULL,NULL,'store',0,0),\n ('STO_CRRNC',NULL,1,'br','store',0,181,'STO_CRRNC','store_currency','Cotação','Cotação',NULL,NULL,'store',0,0),\n ('STO_DATA','store',1,'br','store',0,80,'STO_DATA','store_data','Variáveis por Loja','Variáveis por Loja',NULL,NULL,'store',0,0),\n ('STO_ECF','store',1,'br','store',0,40,'STO_ECF','store_ecf','Manutenção de ECF','ECF',NULL,NULL,'store',0,0),\n ('STO_ECFMDL','store',1,'br','store',0,2200,'STO_ECFMDL','store_ecf_model','Modelos de ECF','Modelos de ECF',NULL,NULL,'store',0,0),\n ('STO_ECFMKR','store',1,'br','store',0,2100,'STO_ECFMKR','store_ecf_maker','Fabricantes de ECF','Fabricantes de ECF',NULL,NULL,'store',0,0),\n ('STO_FILE','store',1,'br','store',0,20,'STO_FILE','store_file','Manutenção de Lojas','Lojas',NULL,NULL,'store',0,0),\n ('STO_FISCAL','store',1,'br','store',0,50,'STO_FISCAL','store_fiscal','Mapa Resumo ECF','Mapa Resumo',NULL,NULL,'store',0,0),\n ('STO_GROSTO','store',1,'br','store',0,370,'STO_GROSTO','store_group_list','Grupo de Lojas','Grupo de Lojas',NULL,NULL,'store',0,0),\n ('STO_GROUP','store',1,'br','store',0,350,'STO_GROUP','store_group_store','Grupos','Grupos',NULL,NULL,'store',0,0),\n ('STO_ITFPRM','store',1,'br','store',0,321,'STO_ITFPRM','store_interface_prm','Parâmetros de Interface','Parâmetros de Interface',NULL,NULL,'store',0,0),\n ('STO_LYTDPT','store',1,'br','store',0,2400,'STO_LYTDPT','store_layout_department','Layout por Departamentos','Layout por Departamentos',NULL,NULL,'store',0,0),\n ('STO_OPRSCH','store',1,'br','store',0,292,'STO_OPRSCH','store_opinion_research','Pesquisa de Opiniões','Pesquisa de Opiniões',NULL,NULL,'store',0,0),\n ('STO_PARAM','store',1,'br','store',0,70,'STO_PARAM','store_param','Parâmetros de Servidor por Loja','Parâmetros de Servidor',NULL,NULL,'store',0,0),\n ('STO_POS','store',1,'br','store',0,30,'STO_POS','store_pos','Manutenção de PDV','PDV',NULL,NULL,'store',0,0),\n ('STO_POSTYP','store',1,'br','store',0,2300,'STO_POSTYP','store_pos_types','Tipos de PDVs','Tipos de PDVs',NULL,NULL,'store',0,0),\n ('STO_PRM','store',1,'br','store',0,60,'STO_PRM','store_prm','Configuração de PDV\\'s (global, loja, terminal)','Parâmetros de PDV',NULL,NULL,'store',0,0),\n ('STO_SAT','store',1,'br','store',0,45,'STO_SAT','store_sat','Manutenção de SAT','SAT',NULL,NULL,'store',0,0),\n ('STO_SATMDL','store',1,'br','store',0,2250,'STO_SATMDL','store_sat_model','Modelos de SAT','Modelos de SAT',NULL,NULL,'store',0,0),\n ('STO_SEND','store',1,'br','store',0,100,'STO_SEND','store_send_routes','Rotas/Nomes para exportação','Rotas/Nomes',NULL,NULL,'store',0,0),\n ('STO_TAX','store',1,'br','store',0,235,'STO_TAX','store_tax','Tributações por loja','Tributações por loja',NULL,NULL,'store',0,0),\n ('STO_TRIBUT','store',1,'br','store',0,2500,'STO_TRIBUT','store_tributo','Impostos do Mapa Resumo','Impostos',NULL,NULL,'store',0,0),\n ('STS_CHKSYS','status',1,'br','status',0,400,'STS_MENUT','status_checking_system','Checagens de indicadores do sistema','Checagem do sistema',NULL,NULL,'status',0,1),\n ('STS_CRYTY','status',1,'br','status',0,900,'STS_CRYTY','status_crypt_security','Cadastro de Acesso ao Banco','Cadastro de Acesso ao Banco',NULL,NULL,'status',0,0),\n ('STS_INDEX','status',1,'br','status',0,125,'STS_INDEX','status_index','Indices Complementares Opcionais','Indices',NULL,NULL,'status',0,0),\n ('STS_LIC','status',1,'br','status',0,90,'STS_LIC','status_lic','Informações da autorização de uso','Autorização',NULL,NULL,'status',0,0),\n ('STS_LOG','status',1,'br','status',0,70,'STS_LOG','status_log','Registro de transações executadas via Moderator','Log',NULL,NULL,'status',0,0),\n ('STS_MENU','status',1,'br','status',0,25,'STS_MENU','status_menu_systemt','Manutenção de Menu','Menu',NULL,NULL,'status',0,0),\n ('STS_MENUT','status',1,'br','status',0,200,'STS_MENU','status_menu_systemt','Manutenção dos Menus do Sistema','Menu Interativo',NULL,NULL,'status',0,0),\n ('STS_MNUTB','status',1,'','status',0,300,'STS_MENU','status_menu_systemt','Operações Batch no Menu do Sistema','Menu Batch',NULL,NULL,'status',0,0),\n ('STS_MSG','status',1,'br','status',0,80,'STS_MSG','status_msg','Mensagens enviadas pelo Emporium','Mensagens',NULL,NULL,'status',0,0),\n ('STS_MYSQL','status',1,'br','status',0,20,'STS_MYSQL','status_mysql','Status e variáveis do MySql','MySql',NULL,NULL,'status',0,0),\n ('STS_NOT','status',1,'br','status',0,75,'STS_NOT','status_notification','Registro de operações que precisam de atenção','Notificações',NULL,NULL,'status',0,0),\n ('STS_NOTSKU','status',1,'br','status',0,77,'STS_NOTSKU','status_not_sku','Registro de operações que precisam de atenção','Notificações Itens',NULL,NULL,'status',0,0),\n ('STS_PARAM','status',1,'br','status',0,60,'STS_PARAM','status_param','Parâmetros Globais','Globais',NULL,NULL,'status',0,0),\n ('STS_PHP','status',1,'br','status',0,10,'STS_PHP','status_php','Parâmetros e dados do PHP','PHP',NULL,NULL,'status',0,0),\n ('STS_QUERY','xstatus',1,'br','xstatus',0,200,'STS_SRV','status_query','Geração de query','Query',NULL,NULL,'xstatus',0,0),\n ('STS_REPAIR','status',1,'br','status',0,30,'STS_REPAIR','status_repair','Recuperação de tabelas','Recuperação',NULL,NULL,'status',0,0),\n ('STS_RMK','status',1,'br','status',0,750,'STS_RMK','status_remark','Ajuste de ticket','Ajuste de Ticket',NULL,NULL,'status',0,0),\n ('STS_SEND','status',1,'br','status',0,89,'STS_SEND','status_send','Configuração de envio','Configuração de envio',NULL,NULL,'status',0,0),\n ('STS_SETUP','status',1,'br','status',0,65,'STS_SETUP','status_setup','Configuração Do Sistema','Configuração Do Sistema',NULL,NULL,'status',0,0),\n ('STS_SRV','status',1,'br','status',0,88,'STS_SRV','status_srv','Informações do servidor','Servidor',NULL,NULL,'status',0,0),\n ('STS_SSURVEY','status',1,'br','status',0,825,'STS_SSURVE','status_satisfaction_survey','Pesquisa de satisfação','Pesquisa de satisfação',NULL,NULL,'status',0,0),\n ('STS_SYSTEM','status',1,'br','status',0,5,'STS_SYSTEM','status_system','Status do Emporium','Emporium',NULL,NULL,'status',0,0),\n ('STS_TIME','status',1,'br','status',0,100,'STS_TIME','status_time','Análise de Horários dos Elementos do Sistema','Horas',NULL,NULL,'status',0,0),\n ('STS_UPD','status',1,'br','status',0,600,'STS_UPD','status_upd','Atualização do sistema','Setup',NULL,NULL,'status',0,0),\n ('STS_UPDALL','status',1,'br','status',0,500,'STS_CHKSYS','status_update_all_store','Atulizações de cargas','Atulizações de cargas',NULL,NULL,'status',0,0),\n ('STS_UPDATE','status',1,'br','status',0,50,'STS_UPDATE','status_update','Nível de atualização de dados por loja e PDV','Atualizações',NULL,NULL,'status',0,0),\n ('STS_VERDB','status',1,'br','status',0,62,'STS_VERDB','status_version','Historivo de Versões DB','Versões DB',NULL,NULL,'status',0,0),\n ('STS_VERS',NULL,1,'br','status',0,160,'STS_VERS','status_progv','Versões Emporium','Versões Emporium',NULL,NULL,NULL,NULL,NULL),\n ('TCKT_VRFY','MIE_OTHER',2,'br','impexp',0,300,'TCKT_VRFY','cmcd_status','CMCD status','CMCD status',NULL,NULL,'impexp',0,0),\n ('treasury',NULL,0,'br','main',0,13,'TREASURY','index.php?mode=treasury','Operações de Tesouraria: seleção de sangrias, transferências, etc.','Tesouraria','glyphicon glyphicon-usd',NULL,NULL,1,0),\n ('TRE_ACCUM','treasury',1,'br','treasury',0,35,'TRE_ACCUM','treasury_accum','Acompanhamento on line de movimentações','Movimentação',NULL,NULL,'treasury',0,0),\n ('TRE_ACQUIR','treasury',1,'br','treasury',0,250,'TRE_ACQUIR','treasury_acquirr','Instituições','Instituições',NULL,NULL,'treasury',0,0),\n ('TRE_AQCUIR','treasury',1,'br','treasury',0,300,'TRE_AQCUIR','treasury_acquirr','Instituições','Instituições',NULL,NULL,'treasury',0,0),\n ('TRE_BALAN','treasury',1,'br','treasury',0,36,'TRE_BALAN','treasury_balance','Movimentação de saldo','Saldo',NULL,NULL,'treasury',0,0),\n ('TRE_BANKIN','treasury',1,'br','treasury',0,10,'TRE_BANKIN','treasury_banking','Seleção e manutenção de sangrias','Sangrias',NULL,NULL,'treasury',0,0),\n ('TRE_CSTC','treasury',1,'br','treasury',0,952,'TRE_CSTC','treasury_cost_center','Centro de Custos','Centro de Custos',NULL,NULL,'treasury',0,0),\n ('TRE_DAYSUM','treasury',1,'br','treasury',0,30,'TRE_DAYSUM','treasury_daysumm','Geração de resumo diário','Resumo Diário',NULL,NULL,'treasury',0,0),\n ('TRE_LOAN','treasury',1,'br','treasury',0,852,'TRE_LOAN','treasury_loan','Fundo de Troco de Operador','Fundo de Troco',NULL,NULL,'treasury',0,0),\n ('TRE_LOCAL','treasury',1,'br','treasury',0,50,'TRE_LOCAL','treasury_location','Manutenção da tabela de localizações','Localizações',NULL,NULL,'treasury',0,0),\n ('TRE_MNTBKN','treasury',1,'br','treasury',0,1102,'TRE_MNTBKN','treasury_banking_pos','Monitoramento de Sangrias por PDV','Monitoramento de Sangrias por PDV',NULL,NULL,'treasury',0,0),\n ('TRE_OPER','treasury',1,'br','treasury',0,40,'TRE_OPER','treasury_oper','Boletim diário por operador','Operadores',NULL,NULL,'treasury',0,0),\n ('TRE_PAYB','treasury',1,'br','treasury',0,1052,'TRE_PAYB','treasury_payable','Contas a Pagar','Contas a Pagar',NULL,NULL,'treasury',0,0),\n ('TRE_PICKUP','treasury',1,'br','treasury',0,70,'TRE_PICKUP','treasury_pickup','Inclusão de Sangria','Sangria',NULL,NULL,'treasury',0,0),\n ('TRE_REASON','treasury',1,'br','treasury',0,38,'treasury_r','treasury_reason','Motivos','Motivos',NULL,NULL,'treasury',0,0),\n ('TRE_REPOR','treasury',1,'br','treasury',0,100,'TRE_REPOR','treasury_report','Relatório','Relatório',NULL,NULL,'treasury',0,0),\n ('TRE_RETURN','treasury',1,'br','treasury',0,200,'TRE_RETURN','treasury_return','Trocas','Controle de Trocas',NULL,NULL,'treasury',0,0),\n ('TRE_TICKET','treasury',1,'br','treasury',0,60,'TRE_TICKET','treasury_ticket','Inclusão, alteração e exclusão de cupons','Edição de Cupons',NULL,NULL,'treasury',0,0),\n ('TRE_TRANS','treasury',1,'br','treasury',0,37,'TRE_TRANS','treasury_transaction','Manutenção de tipos de transações','Tipos de Transações',NULL,NULL,'treasury',0,0),\n ('TRE_XFER','treasury',1,'br','treasury',0,20,'TRE_XFER','treasury_xfer','Operações de tranferência em lotes','Lotes',NULL,NULL,'treasury',0,0),\n ('webservice','x_main',0,'br','x_main',0,86,'STO_TESTE','index.php?mode=webservice','WebService','WebService','img/webservice.png',NULL,NULL,1,0),\n ('WEB_DIG','webservice',1,'br','webservice',0,3570,'WEB_DIG','webservice_digital','Arquivo Digital','Arquivo Digital',NULL,NULL,'webservice',0,0),\n ('WEB_ECFSTS','webservice',1,'br','webservice',0,3580,'WEB_ECFSTS','webservice_ecf_stsx','Status ECF','Status ECF',NULL,NULL,'webservice',0,0),\n ('WEB_ECFSTX','webservice',1,'br','webservice',0,3680,'WEB_ECFSTX','webservice_ecf_stsx','Resumo de status de ECFs','Resumo ECF',NULL,NULL,'webservice',0,0),\n ('WEB_NFPU','webservice',1,'br','webservice',0,3560,'WEB_NFPU','webservice_nfp_users','Usuários Nota Fiscal Paulista','Usuários NFP',NULL,NULL,'webservice',0,0),\n ('WEB_STATUS','webservice',1,'br','webservice',0,3550,'WEB_STATUS','webservice_status','Status de Transações','Status',NULL,NULL,'webservice',0,0),\n ('WEB_TKTNFP','webservice',1,'br','webservice',0,3565,'WEB_TKTNFP','webservice_ticket_nfp','Tickets NFP','Tickets NFP',NULL,NULL,'webservice',0,0),\n ('WEB_URL','webservice',1,'br','webservice',0,3780,'WEB_URL','webservice_nfp_url','URL Cidadania Fiscal','URL Cidadania Fiscal',NULL,NULL,'webservice',0,0),\n ('XMLW','status',1,'br','status',0,150,'XMLW','/moderator-cgi/xmlwizard?mode=view','Situação dos parâmetros','XML',NULL,NULL,'status',0,0),\n ('zonasul',NULL,0,'br','main',0,88,'ZONASUL','index.php?mode=zonasul','ZonaSul','ZonaSul','glyphicon glyphicon-heart',NULL,NULL,1,0),\n ('ZSA_RVSKIT','',1,'br','zonasul',0,500,'ZSA_RVSKIT','zonasul_reverse_kit','Vendas de kit reverso','Vendas de kit reverso',NULL,NULL,'zonasul',0,0),\n ('ZS_AMORTI','zonasul',1,'br','zonasul',0,50,'ZS_AMORTI','zs_amortizacao','Amortização','Amortização',NULL,NULL,'zonasul',0,0),\n ('ZS_CHGMED','zonasul',1,'br','zonasul',0,60,'ZS_CHGMED','zs_return','Troca de finalizadora','Troca de finalizadora',NULL,NULL,'zonasul',0,0),\n ('ZS_ESTAUC','zonasul',1,'br','zonasul',0,70,'ZS_ESTAUC','zs_report_parking','Relatorio estacionamento Aucon','Relatorio estacionamento Aucon',NULL,NULL,'zonasul',0,0),\n ('ZS_ESTWPS','zonasul',1,'br','zonasul',0,71,'ZS_ESTWPS','zs_report_parking_wps','Relatorio estacionamento WPS','Relatorio estacionamento WPS',NULL,NULL,'zonasul',0,0),\n ('ZS_EXTRA','zonasul',1,'br','zonasul',0,25,'ZS_EXTRA','zs_amount_extra_ticket','Transf. Mercadoria','Transf. Mercadoria',NULL,NULL,'zonasul',0,0),\n ('ZS_LINK','zonasul',1,'br','zonasul',0,80,'ZS_LINK','zs_report_parking_link','Relatorio estacionamento Link','Relatorio estacionamento Link',NULL,NULL,'zonasul',0,0)\"\n );\n\n\n }", "public function upMenu($data){\n\n\t\treturn $this->where('id', $data['id'])->update(['item'=>$data['item'], 'anchor' => $data['anchor']]);\n\t}", "private function import_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Import/Export', 'formidable' ) . '</h3>'\n\t\t\t . '<p>' . __( 'Import and export forms and styles when copying from one site to another or sharing with someone else. Your entries can be exported to a CSV as well. The Premium version also includes the option to import entries to your site from a CSV.', 'formidable' ) . '</p>',\n\t\t\t'prev_page' => 'styles',\n\t\t\t'next_page' => 'settings',\n\t\t\t'selector' => '.inside.with_frm_style',\n\t\t\t'position' => array( 'edge' => 'bottom', 'align' => 'top' ),\n\t\t);\n\t}", "protected function process_header_menu(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "public function import(): void;", "public function excel_import_product(){\n return view('product.import_product');\n }", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "function setMenuItem(){\n\n $totalMenuItem=count($this->html->find('b')); // total number of menu items in the webpage\n $allMenuName=$this->html->find('b'); // array of objects of all b tag for item name\n $allMenuDetails=$this->html->find('span[itemprop=\"description\"]'); // array of objects of all span of itemproperty description\n $allMenuPrice=$this->html->find('span.price'); // array of objects of all span with class price\n $phone=$this->html->find('span[itemprop=\"telephone\"]')[0]->innertext; // string\n $address=$this->html->find('span[itemprop=\"streetAddress\"]')[0]->innertext.' , '\n .$this->html->find('span[itemprop=\"addressLocality\"]')[0]->innertext; // string concated restaurant address\n\n for ($i=0; $i<$totalMenuItem; $i++){\n \n $price=$this->stringModifier->modifyString($allMenuPrice[$i]->innertext); //remove currency sign from price\n $this->saveMenuItems($totalMenuItem,$allMenuName[$i]->innertext,$allMenuDetails[$i]->innertext,\n $price,NULL,webPageUrlThree,$phone,$address); // save data in the database\n \n } // loop ends\n \n }", "public function loadAdminMenu()\n {\n\t\t$file = $this->xoops_root_path . '/modules/' . $this->getInfo('dirname') . '/' . $this->getInfo('adminmenu');\n if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && \\XoopsLoad::fileExists($file)) {\n $adminmenu = array();\n include $file;\n $this->adminmenu = $adminmenu;\n }\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Notifiable Diseases\", \"LIBRARIES\", \"_notifiable\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "public function data()\n {\n $submenu = Menu::with('parentMenu')->whereNotNull('parent_id');\n\n return Datatables::of($submenu)\n ->add_column('actions',\n\n '<a href={{ action(\"SubmenuController@edit\", [$id])}} class=\"uk-icon-hover uk-icon-small uk-icon-pencil-square-o\">Ubah</a>' .\n $this->deleteForm('{{$id}}')\n )\n ->make(true);\n }", "public function index()\n\t{\n\t\t$this->def->page_validator();\n\t\t$this->load->model(\"mdimport\");\n\t\t$this->load->model(\"mdlaporan\");\n\t\t$data['title'] = \"Import Penjualan\";\n\t\t$data['menu'] = 2;\n\t\t$data['submenu'] = 21;\n\t\t$data['state'] = $this->mdimport->cek_status_import();\n\t\t$data['reindex'] = $this->mdlaporan->cek_status_reindex();\n\n\t\t$this->load->view(\"header\",$data);\n\t\t$this->load->view(\"import\");\n\t\t$this->load->view(\"footer\");\n\t}", "function main()\t{\n\t\tglobal $SOBE,$LANG;\n\t\t$out = array();\n\t\t\n\t\t$GLOBALS['TYPO3_DB']->debugOutput = TRUE;\n\t\t\n\t\tif(t3lib_div::_GP('import')){\n\t\t\t$this->doImport();\n\t\t}\n\t\t\n\t\t\n\t\t$TDparams = ' class=\"bgColor4\" valign=\"top\"';\n\t\t$out = t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'whatistheipsv', $this->pObj->doc->backPath,'|'.$LANG->getLL('whatistheipsv', 1)).'\n\t\t<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\">\n\t\t\t<tr>\n\t\t \t\t<td'.$TDparams.'>Path to csv-file: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'pathtocsvfile', $this->pObj->doc->backPath).'</td>\n\t\t \t\t<td'.$TDparams.'><input type=\"text\" name=\"SET[tx_categoriesimportipsv_filepath]\" size=\"60\" value=\"'.$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_filepath'].'\" /></td>\n\t\t \t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>Prefix original id: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'prefixoriginalid', $this->pObj->doc->backPath).'</td>\n\t\t\t\t<td'.$TDparams.'><input type=\"text\" name=\"SET[tx_categoriesimportipsv_origidprefix]\" size=\"20\" value=\"'.$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_origidprefix'].'\" /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>Action: '.t3lib_BEfunc::cshItem('_MOD_txcategoriesimportipsv_modfunc', 'action', $this->pObj->doc->backPath).'</td>\n\t\t\t\t<td'.$TDparams.'>'.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[tx_categoriesimportipsv_action]',$this->pObj->MOD_SETTINGS['tx_categoriesimportipsv_action'],$this->pObj->MOD_MENU['tx_categoriesimportipsv_action']).'</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td'.$TDparams.'>&nbsp;</td>\n\t\t\t\t<td'.$TDparams.'><input type=\"submit\" name=\"import\" value=\"Import\" onclick=\"alert('.$LANG->JScharCode('Notice! This script will run for a very long time and in some situations it may even halt or cause the browser to freeze. If you experience any problems try running it from a shell (see manual)').');return confirm('.$LANG->JScharCode('Are you sure? You are about to create many categories').');\" /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t';\n\t\t//(@ini_get(\"safe_mode\") == 'On' || @init_get(\"safe_mode\") === 1) ? TRUE : FALSE;\n\t\treturn $this->pObj->doc->section($LANG->getLL('subtitle'),$out,0,1);\n\t}", "public function DataMenu()\n\t{\n\t\tif ($this->uri->segment(4) == 'view') {\n\t\t\t$id = $this->uri->segment(3);\n\t\t\t$tampil = $this->MSudi->GetDataWhere('tbl_menu', 'id', $id)->row();\n\t\t\t$jenis = $this->MSudi->GetData('tbl_jenis_menu');\n\t\t\t$company = $this->MSudi->GetData('tbl_company');\n\t\t\t$data['detail']['id'] = $tampil->id;\n\t\t\t$data['detail']['nama_menu'] = $tampil->nama_menu;\n\t\t\t$data['detail']['foto_menu'] = $tampil->foto_menu;\n\t\t\t$data['detail']['harga_menu'] = $tampil->harga_menu;\n\t\t\t$data['detail']['deskripsi_menu'] = $tampil->deskripsi_menu;\n\t\t\t$data['detail']['id_jenis_menu'] = $tampil->id_jenis_menu;\n\t\t\t$data['detail']['jenis'] = $jenis;\n\t\t\t$data['detail']['company'] = $company;\n\t\t\t$data['content'] = 'VFormUpdateMenu';\n\t\t} else {\n\t\t\t$join = \"tbl_jenis_menu.id = tbl_menu.id_jenis_menu\";\n\t\t\t$join1 = \"tbl_company.id = tbl_menu.id_company\";\n\t\t\t$data['DataMenu'] = $this->MSudi->GetData2JoinBaru('tbl_menu', 'tbl_jenis_menu','tbl_company', $join, $join1)->result();\n\t\t\t$data['content'] = 'VMenu';\n\t\t}\n\t\t$this->load->view('welcome_message', $data);\n\t}", "public function actionImport()\n {\n //$this->layout = 'main2';\n return $this->render('import');\n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "function import_ch8bt_bug() {\r\n if ( !current_user_can( 'manage_options' ) ) {\r\n wp_die( 'Not allowed' );\r\n }\r\n \r\n // Check if nonce field is present \r\n check_admin_referer( 'ch8bt_import' ); \r\n \r\n // Check if file has been uploaded \r\n if( array_key_exists( 'import_bugs_file', $_FILES ) ) { \r\n // If file exists, open it in read mode \r\n $handle = fopen( $_FILES['import_bugs_file']['tmp_name'], 'r' ); \r\n \r\n // If file is successfully open, extract a row of data \r\n // based on comma separator, and store in $data array \r\n if ( $handle ) { \r\n while ( ( $data = fgetcsv( $handle, 5000, ',' ) ) !== FALSE ) { \r\n $row += 1; \r\n \r\n // If row count is ok and row is not header row \r\n // Create array and insert in database \r\n if ( count( $data ) == 4 && $row != 1 ) { \r\n $new_bug = array( \r\n 'bug_title' => $data[0], \r\n 'bug_description' => $data[1], \r\n 'bug_version' => $data[2], \r\n 'bug_status' => $data[3], \r\n 'bug_report_date' => date( 'Y-m-d' ) ); \r\n \r\n global $wpdb; \r\n \r\n $wpdb->insert( $wpdb->get_blog_prefix() . \r\n 'ch8_bug_data', $new_bug ); \r\n } \r\n } \r\n } \r\n } \r\n \r\n // Redirect the page to the user submission form \r\n wp_redirect( add_query_arg( 'page', 'ch8bt-bug-tracker', \r\n admin_url( 'options-general.php' ) ) ); \r\n exit; \r\n}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function bit_admin_import_csv( $playid ) {\n}", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "public function importAction()\n {\n $logger = OntoWiki::getInstance()->logger;\n $logger->debug('importAction');\n\n //initialisation of view parameter\n $this->view->placeholder('main.window.title')->set('Select mapping parameter'); \n $this->view->formEncoding = 'multipart/form-data';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formMethod = 'post';\n $this->view->formName = 'selection';\n $this->view->filename\t\t = htmlspecialchars($_SESSION['fname']);\n $this->view->restype \t\t = '';\n $this->view->baseuri\t\t = '';\n $this->view->header\t\t \t = '';\n $this->view->flinecount\t\t = htmlspecialchars($_SESSION['flinecount']);\n $this->view->fline\t\t\t = htmlspecialchars($_SESSION['fline']);\n $this->view->line\t\t \t = explode(';',$this->view->fline);\n\n //toolbar for import of data\n $toolbar = $this->_owApp->toolbar;\n $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Submit', 'id' => 'selection'))\n ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel', 'id' => 'selection'));\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n \n //handling of request\n if ($this->_request->isPost()) {\n $postData = $this->_request->getPost();\n \n if (!empty($postData)) { \n \n $baseuri = $postData['b_uri'];\n $this->view->baseuri = $baseuri;\n $restype = $postData['r_type'];\n $this->view->restype = $restype;\n $header = $postData['rad'];\n $this->view->header = $header;\n \n if (trim($restype) == '') {\n $message = 'Ressource type must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if ((trim($baseuri) == '')||(trim($baseuri) == 'http://')) {\n $message = 'Base Uri must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if (trim($header) == '') {\n \t$message = 'You must select whether you have a header!';\n \t$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n \n //create mapping\n if (\t (trim($restype) != '') \n \t\t&& ((trim($baseuri) != '') || (trim($baseuri) != 'http://'))\n \t\t&& (trim($header) != ''))\n {\n \t$paramArray = array('firstline' => $this->view->line,\n \t\t\t\t\t\t'header' \t=> $header,\n \t\t\t\t\t\t'baseuri'\t=> $baseuri,\n \t\t\t\t\t\t'restype' \t=> $restype,\n \t\t\t\t\t\t'filename' \t=> $this->view->filename\n \t);\n \t\n \t$maippng = $this->_createMapping($paramArray);\n \t$maprpl = str_replace('\"', \"'\", $maippng);\n \t//save mapping into file\n \t$mapfile = tempnam(sys_get_temp_dir(), 'ow');\n \t\n \t$fp = fopen($mapfile,\"wb\");\n \tfwrite($fp,$maprpl);\n \tfclose($fp);\n \t\n \t$ttl = array();\n \t\n \t//call convert for ttl\n \t$ttl = $this->_convert($mapfile, $this->view->filename);\n \t\n \t//save ttl data into file\n \t$ttlfile = tempnam(sys_get_temp_dir(), 'ow');\n \t$temp = fopen($ttlfile, 'wb');\n \tforeach ($ttl as $line) {\n \t\tfwrite($temp, $line . PHP_EOL);\n \t\t}\n \tfclose($temp);\n \t$filetype = 'ttl';\n \t\n \t$locator = Erfurt_Syntax_RdfParser::LOCATOR_FILE;\n \t\n \t// import call\n \t\n \ttry {\n \t\t$this->_import($ttlfile, $filetype, $locator);\n \t\t} catch (Exception $e) {\n \t\t\t$message = $e->getMessage();\n \t\t\t$this->_owApp->appendErrorMessage($message);\n \t\t\treturn;\n \t\t\t}\n \t\t}\n \t\t\n //after success redirect to index site \n $this->_redirect('');\n }\n }\n }", "public function load_edit_talk() {\n\t\t\t// Make sure it's a plugin's admin screen\n\t\t\tif ( ! wct_is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! empty( $_GET['csv'] ) ) {\n\n\t\t\t\tcheck_admin_referer( 'wct_is_csv' );\n\n\t\t\t\t$this->downloading_csv = true;\n\n\t\t\t\t// Add content row data\n\t\t\t\tadd_action( 'wct_admin_column_data', array( $this, 'talk_row_extra_data'), 10, 2 );\n\n\t\t\t\t$this->csv_export();\n\n\t\t\t// Other plugins can do stuff here\n\t\t\t} else {\n\t\t\t\tdo_action( 'wct_load_edit_talk' );\n\t\t\t}\n\t\t}" ]
[ "0.5908261", "0.5792705", "0.57051396", "0.54172695", "0.5319359", "0.5317798", "0.5312159", "0.5190978", "0.51481056", "0.5128166", "0.5120202", "0.5109397", "0.50900304", "0.5056367", "0.50339824", "0.50128204", "0.5011929", "0.4975385", "0.49676278", "0.49517974", "0.49361157", "0.49188966", "0.4915533", "0.49017268", "0.48821098", "0.487636", "0.48694974", "0.48642406", "0.4856439", "0.48349303", "0.4831813", "0.48159745", "0.48135397", "0.48122817", "0.47927755", "0.47915035", "0.47833458", "0.47764155", "0.47746524", "0.476519", "0.4765063", "0.47522888", "0.47497746", "0.4729616", "0.47006628", "0.4692982", "0.46754253", "0.46579918", "0.4648358", "0.46473604", "0.46257943", "0.46248198", "0.46236166", "0.46233", "0.46232945", "0.46188074", "0.46173823", "0.461153", "0.4609181", "0.46044222", "0.45918262", "0.45902398", "0.45874518", "0.45779958", "0.45775506", "0.4575442", "0.4569283", "0.45581698", "0.4555451", "0.45523286", "0.45479548", "0.454656", "0.45317143", "0.45315847", "0.45313856", "0.45254838", "0.4516064", "0.45101318", "0.45084596", "0.45082065", "0.45058438", "0.4500943", "0.44999415", "0.44945884", "0.4494282", "0.44931668", "0.44872203", "0.44871765", "0.4486455", "0.44820765", "0.448031", "0.44730428", "0.44681913", "0.44667387", "0.44639188", "0.44639188", "0.44509077", "0.4447343", "0.4445035", "0.44443274" ]
0.4802837
34
Method for importing a multimenu data cell.
protected function process_data_multimenu(import_settings $settings, $field, $data_record, $value) { $value = $this->get_innerhtml($value); $parts = explode('<br/>', $value); $items = array(); $options = explode("\n", $field->param1); foreach ($options as $option) { $items[$option] = '#'; } foreach ($parts as $part) { $items[$part] = $part; } $value = implode('', $items); $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importFrom(array $data);", "function import(array $data);", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function import(array $data): void;", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "public function metaImport($data);", "public function importSub($model, $relate = FALSE);", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function _clientsDoImport($data,$defaults,$update=0) {\n\n\t## prepare the select element wiht all available fields\n\t$wt = new ctlparser(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/base.xml');\n\t$wt->parse();\t\t\n\t$elements = $wt->getSimplifiedElements();\n\t$objects = $wt->getObjects();\n\n\t$allowed_types = array('text','email');\n\t\n\t## we need to find out if we have an entry that is marked as unique\n\t$unique_element = array();\n\tforeach($elements as $current_element) {\n\t\tif(isset($current_element['UNIQUE'])) {\n\t\t\t$unique_element = $current_element;\n\t\t}\n\t}\n\n\t$db_connectionStore = new DB_Sql();\n\t## the data array can now be processed.\n\t##var_dump($elements);\n\tforeach($data as $current_dataelement) {\n\t\t## here we will stroe the id of the current entry\n\t\t$id = 0;\n\t\n\t\t## we need to check if we have an element that matches our unique identifier\n\t\tif(isset($unique_element['IDENTIFIER']) && !empty($current_dataelement[$unique_element['IDENTIFIER']])) {\t\t\n\t\t\t## for now we only support text elements of email elements as unique tokens\n\t\t\t$query = \"SELECT id FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" WHERE \".$unique_element['IDENTIFIER'].\"='\".$current_dataelement[$unique_element['IDENTIFIER']].\"'\";\n\t\t\t$result_pointer = $db_connectionStore->query($query);\n\n\t\t\tif($db_connectionStore->num_rows() < 1) {\t\n\t\t\t\t## we need to import the other fields. \n\t\t\t\t$query = \"INSERT INTO \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" (groupid) values ('1')\";\n\t\t\t\t$result_pointer = $db_connectionStore->query($query,true);\n\t\t\t\t$id = $db_connectionStore->db_insertid($result_pointer);\t\n\t\t\t} else if($update == 1) {\n\t\t\t\t$db_connectionStore->next_record();\n\t\t\t\t$id = $db_connectionStore->Record['id'];\n\t\t\t}\n\t\t} else {\n\t\t\t## we do not have a unique attribute- so no way to identifiy if there are any duplicate entries-\n\t\t\t## this means we need to import them all \n\t\t\t$query = \"INSERT INTO \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" (groupid) values ('1')\";\n\t\t\t$result_pointer = $db_connectionStore->query($query,true);\n\t\t\t$id = $db_connectionStore->db_insertid($result_pointer);\n\t\t}\n\t\t\n\t\t## okay we have a base object- now we should call the import function of each attribute\n\t\tif($id > 0) {\n\t\t\tforeach($objects as $current_attribute=>$value) {\n\t\t\t\t$type = strtolower($current_attribute);\n\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(ENGINE.\"modules/clients/attributetypes/\".$type.\"/attribute.php\");\n\n\t\t\t\t## now we check if the function exists\n\t\t\t\tif(function_exists(\"clients_\".$type.\"_importData\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\teval(\"clients_\".$type.\"_importData(\\$id,\\$elements,\\$current_dataelement);\");\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\n\t}\n}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function builder_import() {\n\n\t\t// function verifies the AJAX request, to prevent any processing of requests which are passed in by third-party sites or systems\n\n\t\tcheck_ajax_referer( 'mfn-builder-nonce', 'mfn-builder-nonce' );\n\n\t\t$import = htmlspecialchars(stripslashes($_POST['mfn-items-import']));\n\n\t\tif (! $import) {\n\t\t\texit;\n\t\t}\n\n\t\t// unserialize received items data\n\n\t\t$mfn_items = unserialize(call_user_func('base'.'64_decode', $import));\n\n\t\t// get current builder uniqueIDs\n\n\t\t$uids_row = isset($_POST['mfn-row-id']) ? $_POST['mfn-row-id'] : array();\n\t\t$uids_wrap = isset($_POST['mfn-wrap-id']) ? $_POST['mfn-wrap-id'] : array();\n\t\t$uids_item = isset($_POST['mfn-item-id']) ? $_POST['mfn-item-id'] : array();\n\n\t\t$uids = array_merge($uids_row, $uids_wrap, $uids_item);\n\n\t\t// reset uniqueID\n\n\t\t$mfn_items = Mfn_Builder_Helper::unique_ID_reset($mfn_items, $uids);\n\n\t\tif (is_array($mfn_items)) {\n\n\t\t\t$builder = new Mfn_Builder_Admin();\n\t\t\t$builder->set_fields();\n\n\t\t\tforeach ($mfn_items as $section) {\n\t\t\t\t$uids = $builder->section($section, $uids);\n\t\t\t}\n\n\t\t}\n\n\t\texit;\n\n\t}", "protected function importDatabaseData() {}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function importArray($data);", "protected function loadRow() {}", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function import();", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function import()\n {\n \n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "function import_data()\n {\n $config = array(\n 'upload_path' => FCPATH . 'uploads/subjectoptions',\n 'allowed_types' => 'xls|csv'\n );\n $this->load->library('upload', $config);\n if ($this->upload->do_upload('file')) {\n $data = $this->upload->data();\n @chmod($data['full_path'], 0777);\n\n $this->load->library('Spreadsheet_Excel_Reader');\n $this->spreadsheet_excel_reader->setOutputEncoding('CP1251');\n\n $this->spreadsheet_excel_reader->read($data['full_path']);\n $sheets = $this->spreadsheet_excel_reader->sheets[0];\n error_reporting(0);\n\n $data_excel = array();\n for ($i = 2; $i <= $sheets['numRows']; $i++) {\n if ($sheets['cells'][$i][1] == '') break;\n\n $data_excel[$i - 1]['student'] = $sheets['cells'][$i][1];\n $data_excel[$i - 1]['student_id'] = $sheets['cells'][$i][2];\n $data_excel[$i - 1]['theclass'] = $sheets['cells'][$i][3];\n $data_excel[$i - 1]['stream'] = $sheets['cells'][$i][4];\n $data_excel[$i - 1]['subject'] = $sheets['cells'][$i][5];\n $data_excel[$i - 1]['theyear'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['subjectcode'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['mark1'] = $sheets['cells'][$i][7];\n // $data_excel[$i - 1]['comment'] = $sheets['cells'][$i][8];\n // $data_excel[$i - 1]['term'] = $sheets['cells'][$i][10];\n }\n\n /* $params = $this->security->xss_clean($params);\n $student_id = $this->Student_model->add_student($params);\n if($student_id){\n $this->session->set_flashdata('msg', 'Student is Registered Successfully!');\n redirect('student/index');*/\n\n $this->db->insert_batch('subject_options', $data_excel);\n $this->session->set_flashdata('msg', 'Student Subject Options Registered Successfully!');\n // @unlink($data['full_path']);\n //redirect('excel_import');\n redirect('subjectoptions/index');\n }\n }", "public function import($data)\r\n\t{\r\n\t\tforeach ((array) $data as $column => $value)\r\n\t\t\t$this->set($column, $value);\r\n\r\n\t\treturn $this;\r\n\t}", "private function import_pegawai($sheet)\n\t{\n\t\tforeach ($sheet as $idx => $data) {\n\t\t\t//skip index 1 karena title excel\n\t\t\tif ($idx == 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($data['B'] == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$nip = $data['B'];\n\t\t\t$nama = $data['C'];\n\t\t\t$tempat_lahir = $data['D'];\n\t\t\t$tanggal_lahir = $data['E'];\n\t\t\t$jenis_kelamin = $data['F'];\n\t\t\t$gol = $data['G'];\n\t\t\t$tmt_gol = $data['H'];\n\t\t\t$eselon = $data['I'];\n\t\t\t$jabatan = $data['J'];\n\t\t\t$tmt_jabatan = $data['K'];\n\t\t\t$agama = $data['L'];\n\t\t\t$sub = $data['M'];\n\t\t\t$bagian = $data['N'];\n\t\t\t$unit = $data['O'];\n\n\t\t\t// insert data\n\t\t\t$this->pegawaiModel->insert([\n\t\t\t\t'nip' => $nip,\n\t\t\t\t'name' => $nama,\n\t\t\t\t'tempat_lahir' => strtoupper($tempat_lahir),\n\t\t\t\t'tanggal_lahir' => date_format(date_create($tanggal_lahir), \"Y-m-d\"),\n\t\t\t\t'jenis_kelamin' => $jenis_kelamin,\n\t\t\t\t'gol' => $gol,\n\t\t\t\t'tmt_gol' => date_format(date_create($tmt_gol), \"Y-m-d\"),\n\t\t\t\t'eselon' => $eselon,\n\t\t\t\t'jabatan' => $jabatan,\n\t\t\t\t'tmt_jab' => date_format(date_create($tmt_jabatan), \"Y-m-d\"),\n\t\t\t\t'agama' => $agama,\n\t\t\t\t'sub_bagian' => $sub,\n\t\t\t\t'bagian' => $bagian,\n\t\t\t\t'unit' => $unit,\n\t\t\t]);\n\t\t}\n\n\t\treturn true;\n\t}", "public function import(): void;", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function importExcel($path);", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "private function _import_eod_options_data()\n\t{\n // Clear database.\n DB::statement('TRUNCATE TABLE OptionsEod'); \t\n \t\n\t\t// Setup our models.\n\t\t$symbols_model = App::make('App\\Models\\Symbols');\n\t\t$optionseod_model = App::make('App\\Models\\OptionsEod');\n\t\t\n\t\t// Lets get an index of all the underlying symbols.\n\t\t$symbol_index = $symbols_model->get_index(); \t\n \t \t\n // Loop through the different files and import\n foreach($this->_get_option_eod_summary_files() AS $file)\n {\n $this->info('Importing ' . $file);\n \n // Batch var\n $batch = []; \n \n // Do the CSV magic.\n\t\t\t$reader = Reader::createFromFileObject(new SplFileObject($file));\n\t\t\t\n\t\t\tforeach($reader->query() AS $key => $row) \n\t\t\t{\t\n\t\t\t\t// Skip of the row is empty.\n\t\t\t\tif((! isset($row[0])) || (! isset($row[1])))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// Skip the first row.\n\t\t\t\tif($row[0] == 'underlying')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// See if we have an entry in the Symbols table for this symbol\n\t\t\t\tif(! isset($symbol_index[strtoupper($row[0])]))\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n\t\t\t\t\t$symbol_index = $symbols_model->get_index();\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbol_index[strtoupper($row[0])];\n\t\t\t\t}\n\t\t\t\t\n // We insert in batches.\n $batch[] = [\n \t\t\t 'OptionsEodSymbolId' => $sym_id,\n \t\t\t 'OptionsEodSymbolLast' => $row[1],\n \t\t\t 'OptionsEodType' => $row[5],\n \t\t\t 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n \t\t\t 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n \t\t\t 'OptionsEodStrike' => $row[8],\n \t\t\t 'OptionsEodLast' => $row[9],\n \t\t\t 'OptionsEodBid' => $row[10],\n \t\t\t 'OptionsEodAsk' => $row[11],\n \t\t\t 'OptionsEodVolume' => $row[12],\n \t\t\t 'OptionsEodOpenInterest' => $row[13],\n \t\t\t 'OptionsEodImpliedVol' => $row[14],\n \t\t\t 'OptionsEodDelta' => $row[15],\n \t\t\t 'OptionsEodGamma' => $row[16],\n \t\t\t 'OptionsEodTheta' => $row[17],\n \t\t\t 'OptionsEodVega' => $row[18],\n \t\t\t 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t];\n\t\t\t\n\t\t\t\t// Insert the data into the OptionsEod table. We insert 1000 at a time.\n\t\t\t\tif(count($batch) >= 1000)\n\t\t\t\t{\n\t\t\t\t DB::table('OptionsEod')->insert($batch);\n\t\t\t\t $batch = [];\t\n }\n \t\t}\n \t\t\n // Catch any left over.\n if(count($batch) > 0)\n {\n DB::table('OptionsEod')->insert($batch);\n }\t\n }\n \n // Now import all the data we collected daily.\n $this->_import_daily_eod_options_data($symbol_index);\n\t}", "function import_data(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\t$action = get_get_var('action');\r\n\techo '<h4>Import Data</h4>';\r\n\r\n\t$mount_point = get_post_var('mount_point');\r\n\t// validate this\r\n\tif ($mount_point != \"\" && $mount_point{0} != '/'){\r\n\t\t$action = \"\";\r\n\t\tonnac_error(\"Invalid mount point specified! Must start with a '/'\");\r\n\t}\r\n\t\r\n\tif ($action == \"\"){\r\n\t\r\n\t\t$option = \"\";\r\n\t\t$result = db_query(\"SELECT url from $cfg[t_content] ORDER BY url\");\r\n\t\t\r\n\t\t// first, assemble three arrays of file information\r\n\t\tif (db_has_rows($result)){\r\n\t\t\r\n\t\t\t$last_dir = '/';\r\n\t\t\r\n\t\t\twhile ($row = db_fetch_row($result)){\r\n\t\t\t\r\n\t\t\t\t// directory names, without trailing /\r\n\t\t\t\t$dirname = dirname($row[0] . 'x');\r\n\t\t\t\tif ($dirname == '\\\\' || $dirname == '/')\r\n\t\t\t\t\t$dirname = '';\r\n\t\t\t\t\r\n\t\t\t\tif ($last_dir != $dirname){\r\n\t\t\t\t\tif ($last_dir != '')\r\n\t\t\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\r\n\t\t\t\t\r\n\t\t\t\t\t$last_dir = $dirname;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($last_dir != '')\r\n\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\t\t\r\n\t\t}\r\n\t\r\n\t\t?>\r\n\t\t\r\n<form name=\"import\" action=\"##pageroot##/?mode=import&action=import\" enctype=\"multipart/form-data\" method=\"post\">\r\n\t<table>\r\n\t\t<tr><td>File to import:</td><td><input name=\"data\" type=\"file\" size=\"40\"/></td></tr>\r\n\t\t<tr><td>*Mount point:</td><td><input name=\"mount_point\" type=\"text\" size=\"40\" value=\"/\" /></td></tr>\r\n\t\t<tr><td><em>==&gt;&gt; Choose a directory</em></td><td><select onchange=\"document.import.mount_point.value = document.import.directory.options[document.import.directory.selectedIndex].value;\" name=\"directory\"><?php echo $option; ?></select></td></tr>\r\n\t</table>\r\n\t<input type=\"submit\" value=\"Import\" /><br/>\r\n\t<em>* Mount point is a value that is prefixed to all file names, including content, banner, and menu data. It is the root directory in which the data is based.</em>\r\n</form>\r\n<?php\r\n\t\r\n\t}else if ($action == \"import\"){\r\n\t\t\r\n\t\t$filename = \"\";\r\n\t\t\r\n\t\t// get the contents of the uploaded file\r\n\t\tif (isset($_FILES['data']) && is_uploaded_file($_FILES['data']['tmp_name'])){\r\n\t\t\t$filename = $_FILES['data']['tmp_name'];\r\n\t\t}\r\n\t\t\r\n\t\t$imported = get_import_data($filename,false);\r\n\t\t\r\n\t\tif ($imported !== false){\r\n\t\t\r\n\t\t\t// check to see if we need to ask the user to approve anything\r\n\t\t\t$user_approved = false;\r\n\t\t\tif (get_post_var('user_approved') == 'yes')\r\n\t\t\t\t$user_approved = true;\r\n\t\t\r\n\t\t\t// take care of SQL transaction up here\r\n\t\t\t$ret = false;\r\n\t\t\tif ($user_approved && !db_begin_transaction())\r\n\t\t\t\treturn onnac_error(\"Could not begin SQL transaction!\");\r\n\t\t\r\n\t\t\t// automatically detect import type, and do it!\r\n\t\t\tif ($imported['dumptype'] == 'content' || $imported['dumptype'] == 'all'){\r\n\t\t\t\t$ret = import_content($imported,$user_approved,false);\r\n\t\t\t}else if ($imported['dumptype'] == 'templates'){\r\n\t\t\t\t$ret = import_templates($imported,$user_approved,false);\r\n\t\t\t}else{\r\n\t\t\t\techo \"Invalid import file!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ret && $user_approved && db_is_valid_result(db_commit_transaction()))\r\n\t\t\t\techo \"All imports successful!\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\techo \"Error importing data!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t}\r\n\t\t\t\r\n\t}else{\r\n\t\theader(\"Location: $cfg[page_root]?mode=import\");\t\r\n\t}\t\r\n\t\r\n\t// footer\r\n\techo \"<p><a href=\\\"##pageroot##/\\\">Return to main administrative menu</a></p>\";\r\n\t\r\n}", "function process_row( $item1, $filelayout, $filelayout_count, $default_these, $ep_separator, $languages, $custom_fields ) {\n\n // first we clean up the row of data\n if (EP_EXCEL_SAFE_OUTPUT == true) {\n $items = $item1;\n } else {\n // chop blanks from each end\n $item1 = ltrim(rtrim($item1));\n \n // blow it into an array, splitting on the tabs\n $items = explode($ep_separator, $item1);\n }\n\n // make sure all non-set things are set to '';\n // and strip the quotes from the start and end of the stings.\n // escape any special chars for the database.\n foreach( $filelayout as $key => $value){\n $i = $filelayout[$key];\n if (isset($items[$i]) == false) {\n $items[$i]='';\n } else {\n // Check to see if either of the magic_quotes are turned on or off;\n // And apply filtering accordingly.\n if (function_exists('ini_get')) {\n //echo \"Getting ready to check magic quotes<br />\";\n if (ini_get('magic_quotes_runtime') == 1){\n // The magic_quotes_runtime are on, so lets account for them\n // check if the first & last character are quotes;\n // if it is, chop off the quotes.\n if (substr($items[$i],-1) == '\"' && substr($items[$i],0,1) == '\"'){\n $items[$i] = substr($items[$i],2,strlen($items[$i])-4);\n }\n // now any remaining doubled double quotes should be converted to one doublequote\n if (EP_REPLACE_QUOTES == true){\n if (EP_EXCEL_SAFE_OUTPUT == true) {\n $items[$i] = str_replace('\\\"\\\"',\"&#34;\",$items[$i]);\n }\n $items[$i] = str_replace('\\\"',\"&#34;\",$items[$i]);\n $items[$i] = str_replace(\"\\'\",\"&#39;\",$items[$i]);\n }\n } else { // no magic_quotes are on\n // check if the last character is a quote;\n // if it is, chop off the 1st and last character of the string.\n if (substr($items[$i],-1) == '\"' && substr($items[$i],0,1) == '\"'){\n $items[$i] = substr($items[$i],1,strlen($items[$i])-2);\n }\n // now any remaining doubled double quotes should be converted to one doublequote\n if (EP_REPLACE_QUOTES == true){\n if (EP_EXCEL_SAFE_OUTPUT == true) {\n $items[$i] = str_replace('\"\"',\"&#34;\",$items[$i]);\n }\n $items[$i] = str_replace('\"',\"&#34;\",$items[$i]);\n $items[$i] = str_replace(\"'\",\"&#39;\",$items[$i]);\n }\n }\n }\n }\n }\n\n\n // /////////////////////////////////////////////////////////////\n // Do specific functions without processing entire range of vars\n // /////////////////////////////\n // first do product extra fields\n if (isset($items[$filelayout['v_products_extra_fields_id']]) ){ \n \n $v_products_model = $items[$filelayout['v_products_model']];\n // EP for product extra fields Contrib by minhmaster DEVSOFTVN ==========\n $v_products_extra_fields_id = $items[$filelayout['v_products_extra_fields_id']];\n// $v_products_id = $items[$filelayout['v_products_id']];\n $v_products_extra_fields_value = $items[$filelayout['v_products_extra_fields_value']];\n \n $sql = \"SELECT p.products_id as v_products_id FROM \".TABLE_PRODUCTS.\" as p WHERE p.products_model = '\" . $v_products_model . \"'\";\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n\n\t\t$sql_exist\t=\t\"SELECT products_extra_fields_value FROM \".TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS. \" WHERE (products_id ='\".$row['v_products_id']. \"') AND (products_extra_fields_id ='\".$v_products_extra_fields_id .\"')\";\n\n\t\tif (tep_db_num_rows(tep_db_query($sql_exist)) > 0) {\n\t\t\t$sql_extra_field\t=\t\"UPDATE \".TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS.\" SET products_extra_fields_value='\".$v_products_extra_fields_value.\"' WHERE (products_id ='\". $row['v_products_id'] . \"') AND (products_extra_fields_id ='\".$v_products_extra_fields_id .\"')\";\n\t\t\t$str_err_report= \" $v_products_extra_fields_id | $v_products_id | $v_products_model | $v_products_extra_fields_value | <b><font color=black>Product Extra Fields Updated</font></b><br />\";\n\t\t} else {\n\t\t\t$sql_extra_field\t=\t\"INSERT INTO \".TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS.\"(products_id,products_extra_fields_id,products_extra_fields_value) VALUES ('\". $row['v_products_id'] .\"','\".$v_products_extra_fields_id.\"','\".$v_products_extra_fields_value.\"')\";\n\t\t\t$str_err_report= \" $v_products_extra_fields_id | $v_products_id | $v_products_model | $v_products_extra_fields_value | <b><font color=green>Product Extra Fields Inserted</font></b><br />\";\n\t\t}\n\n $result = tep_db_query($sql_extra_field);\n \n echo $str_err_report;\n // end (EP for product extra fields Contrib by minhmt DEVSOFTVN) ============\n \n // /////////////////////\n // or do product deletes\n } elseif ( $items[$filelayout['v_status']] == EP_DELETE_IT ) {\n // Get the ID\n $sql = \"SELECT p.products_id as v_products_id FROM \".TABLE_PRODUCTS.\" as p WHERE p.products_model = '\" . $items[$filelayout['v_products_model']] . \"'\";\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n if (tep_db_num_rows($result) == 1 ) {\n tep_db_query(\"delete from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . $row['v_products_id'] . \"'\");\n\n $product_categories_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . $row['v_products_id'] . \"'\");\n $product_categories = tep_db_fetch_array($product_categories_query);\n\n if ($product_categories['total'] == '0') {\n // gather product attribute data\n $result = tep_db_query(\"select pov.products_options_values_id from \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa left join \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" pov on pa.options_values_id=pov.products_options_values_id where pa.products_id = '\" . (int)$row['v_products_id'] . \"'\");\n $remove_attribs = array();\n while ($tmp_attrib = tep_db_fetch_array($result)) {\n $remove_attribs[] = $tmp_attrib;\n }\n\n // check each attribute name for links to other products\n foreach ($remove_attribs as $rakey => $ravalue) {\n $product_attribs_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where options_values_id = '\" . (int)$ravalue['products_options_values_id'] . \"'\");\n $product_attribs = tep_db_fetch_array($product_attribs_query);\n // if no other products linked, remove attribute name\n if ((int)$product_attribs['total'] == 1) {\n tep_db_query(\"delete from \" . TABLE_PRODUCTS_OPTIONS_VALUES. \" where products_options_values_id = '\" . (int)$ravalue['products_options_values_id'] . \"'\");\n }\n }\n // remove attribute records\n tep_db_query(\"delete from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$row['v_products_id'] . \"'\");\n\n // remove product\n tep_remove_product($row['v_products_id']);\n }\n\n if (USE_CACHE == 'true') {\n tep_reset_cache_block('categories');\n tep_reset_cache_block('also_purchased');\n }\n echo \"Deleted product \" . $items[$filelayout['v_products_model']] . \" from the database<br />\";\n \n } else {\n echo \"Did not delete \" . $items['v_products_model'] . \" since it is not unique<br> \";\n }\n \n // //////////////////////////////////\n // or do regular product processing\n // //////////////////////////////////\n } else {\n\n // /////////////////////////////////////////////////////////////////////\n //\n // Start: Support for other contributions in products table\n //\n // /////////////////////////////////////////////////////////////////////\n $ep_additional_select = '';\n\t\n if (EP_ADDITIONAL_IMAGES == true) {\n $ep_additional_select .= 'p.products_image_description as v_products_image_description,';\n }\n\n if (EP_MORE_PICS_6_SUPPORT == true) { \n $ep_additional_select .= 'p.products_subimage1 as v_products_subimage1,p.products_subimage2 as v_products_subimage2,p.products_subimage3 as v_products_subimage3,p.products_subimage4 as v_products_subimage4,p.products_subimage5 as v_products_subimage5,p.products_subimage6 as v_products_subimage6,';\n } \n\n if (EP_ULTRPICS_SUPPORT == true) { \n $ep_additional_select .= 'products_image_med as v_products_image_med,products_image_lrg as v_products_image_lrg,products_image_sm_1 as v_products_image_sm_1,products_image_xl_1 as v_products_image_xl_1,products_image_sm_2 as v_products_image_sm_2,products_image_xl_2 as v_products_image_xl_2,products_image_sm_3 as v_products_image_sm_3,products_image_xl_3 as v_products_image_xl_3,products_image_sm_4 as v_products_image_sm_4,products_image_xl_4 as v_products_image_xl_4,products_image_sm_5 as v_products_image_sm_5,products_image_xl_5 as v_products_image_xl_5,products_image_sm_6 as v_products_image_sm_6,products_image_xl_6 as v_products_image_xl_6,';\n }\n\t\t\n if (EP_PDF_UPLOAD_SUPPORT == true) { \n $ep_additional_select .='p.products_pdfupload as v_products_pdfupload, p.products_fileupload as v_products_fileupload,';\n }\n\n if (EP_MVS_SUPPORT == true) {\n $ep_additional_select .= 'vendors_id as v_vendor_id,';\n }\n\n if (MASTER_PRODUCTS_SUPPORT == true) {\n $ep_additional_select .='p.products_master as v_products_master, p.products_master_status as v_products_master_status,';\n }\n\n foreach ($custom_fields[TABLE_PRODUCTS] as $key => $name) { \n $ep_additional_select .= 'p.' . $key . ' as v_' . $key . ',';\n }\n\n // /////////////////////////////////////////////////////////////////////\n // End: Support for other contributions in products table\n // /////////////////////////////////////////////////////////////////////\n \n \n // now do a query to get the record's current contents\n $sql = \"SELECT\n p.products_id as v_products_id,\n p.products_model as v_products_model,\n p.products_image as v_products_image,\n $ep_additional_select\n p.products_price as v_products_price,\n p.products_weight as v_products_weight,\n p.products_date_available as v_date_avail,\n p.products_date_added as v_date_added,\n p.products_tax_class_id as v_tax_class_id,\n p.products_quantity as v_products_quantity,\n p.manufacturers_id as v_manufacturers_id,\n subc.categories_id as v_categories_id,\n p.products_status as v_status_current\n FROM\n \".TABLE_PRODUCTS.\" as p,\n \".TABLE_CATEGORIES.\" as subc,\n \".TABLE_PRODUCTS_TO_CATEGORIES.\" as ptoc\n WHERE\n p.products_model = '\" . $items[$filelayout['v_products_model']] . \"' AND\n p.products_id = ptoc.products_id AND\n ptoc.categories_id = subc.categories_id\n LIMIT 1\n \";\n\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n\n // determine processing status based on dropdown choice on EP menu\n if ((sizeof($row) > 1) && ($_POST['imput_mode'] == \"normal\" || $_POST['imput_mode'] == \"update\")) {\n $process_product = true;\n } elseif ((is_null($row) || sizeof($row) == 1) && ($_POST['imput_mode'] == \"normal\" || $_POST['imput_mode'] == \"addnew\")) {\n $process_product = true;\n } else {\n $process_product = false;\n }\n\n if ($process_product == true) {\n\n while ($row){\n // OK, since we got a row, the item already exists.\n // Let's get all the data we need and fill in all the fields that need to be defaulted \n // to the current values for each language, get the description and set the vals\n foreach ($languages as $key => $lang){\n // products_name, products_description, products_url\n $sql2 = \"SELECT * \n FROM \".TABLE_PRODUCTS_DESCRIPTION.\"\n WHERE\n products_id = \" . $row['v_products_id'] . \" AND\n language_id = '\" . $lang['id'] . \"'\n LIMIT 1\n \";\n $result2 = tep_db_query($sql2);\n $row2 = tep_db_fetch_array($result2);\n // Need to report from ......_name_1 not ..._name_0\n $row['v_products_name_' . $lang['id']] = $row2['products_name'];\n $row['v_products_description_' . $lang['id']] = $row2['products_description'];\n $row['v_products_url_' . $lang['id']] = $row2['products_url'];\n foreach ($custom_fields[TABLE_PRODUCTS_DESCRIPTION] as $key => $name) { \n $row['v_' . $key . '_' . $lang['id']] = $row2[$key];\n }\n // header tags controller support\n if(isset($filelayout['v_products_head_title_tag_' . $lang['id'] ])){\n $row['v_products_head_title_tag_' . $lang['id']] = $row2['products_head_title_tag'];\n $row['v_products_head_desc_tag_' . $lang['id']] = $row2['products_head_desc_tag'];\n $row['v_products_head_keywords_tag_' . $lang['id']] = $row2['products_head_keywords_tag'];\n }\n // end: header tags controller support\n }\n \n // start with v_categories_id\n // Get the category description\n // set the appropriate variable name\n // if parent_id is not null, then follow it up.\n\t\t\t\t$thecategory_id = $row['v_categories_id'];\n\t\t\t\tfor( $categorylevel=1; $categorylevel<=(EP_MAX_CATEGORIES+1); $categorylevel++){\n\t\t\t\t\tif ($thecategory_id){\n\t\t\n\t\t\t\t\t\t$sql3 = \"SELECT parent_id, \n\t\t\t\t\t\t categories_image\n\t\t\t\t\t\t\t FROM \".TABLE_CATEGORIES.\"\n\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t categories_id = \" . $thecategory_id . '';\n\t\t\t\t\t\t$result3 = tep_db_query($sql3);\n\t\t\t\t\t\tif ($row3 = tep_db_fetch_array($result3)) {\n\t\t\t\t\t\t\t$temprow['v_categories_image_' . $categorylevel] = $row3['categories_image'];\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\tforeach ($languages as $key => $lang){\n\t\t\t\t\t\t\t$sql2 = \"SELECT categories_name\n\t\t\t\t\t\t\t\t FROM \".TABLE_CATEGORIES_DESCRIPTION.\"\n\t\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t categories_id = \" . $thecategory_id . \" AND\n\t\t\t\t\t\t\t\t\t language_id = \" . $lang['id'];\n\t\t\t\t\t\t\t$result2 = tep_db_query($sql2);\n\t\t\t\t\t\t\tif ($row2 = tep_db_fetch_array($result2)) {\n\t\t\t\t\t\t\t\t$temprow['v_categories_name_' . $categorylevel . '_' . $lang['id']] = $row2['categories_name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t// now get the parent ID if there was one\n\t\t\t\t\t\t$theparent_id = $row3['parent_id'];\n\t\t\t\t\t\tif ($theparent_id != ''){\n\t\t\t\t\t\t\t// there was a parent ID, lets set thecategoryid to get the next level\n\t\t\t\t\t\t\t$thecategory_id = $theparent_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we have found the top level category for this item,\n\t\t\t\t\t\t\t$thecategory_id = false;\n\t\t\t\t\t\t}\n\t\t \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$temprow['v_categories_image_' . $categorylevel] = '';\n\t\t\t\t\t\tforeach ($languages as $key => $lang){\n\t\t\t\t\t\t\t$temprow['v_categories_name_' . $categorylevel . '_' . $lang['id']] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n // temprow has the old style low to high level categories.\n\t\t\t\t$newlevel = 1;\n\t\t\t\t// let's turn them into high to low level categories\n\t\t\t\tfor( $categorylevel=EP_MAX_CATEGORIES+1; $categorylevel>0; $categorylevel--){\n\t\t\t\t\t$found = false;\n\t\t\t\t\tif ($temprow['v_categories_image_' . $categorylevel] != ''){\n\t\t\t\t\t\t$row['v_categories_image_' . $newlevel] = $temprow['v_categories_image_' . $categorylevel];\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($languages as $key => $lang){\n\t\t\t\t\t\tif ($temprow['v_categories_name_' . $categorylevel . '_' . $lang['id']] != ''){\n\t\t\t\t\t\t\t$row['v_categories_name_' . $newlevel . '_' . $lang['id']] = $temprow['v_categories_name_' . $categorylevel . '_' . $lang['id']];\n\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($found == true) {\n\t\t\t\t\t\t$newlevel++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t// default the manufacturer \n if ($row['v_manufacturers_id'] != ''){\n $sql2 = \"SELECT manufacturers_name\n FROM \".TABLE_MANUFACTURERS.\"\n WHERE\n manufacturers_id = \" . $row['v_manufacturers_id']\n ;\n $result2 = tep_db_query($sql2);\n $row2 = tep_db_fetch_array($result2);\n $row['v_manufacturers_name'] = $row2['manufacturers_name'];\n }\n\n if (EP_MVS_SUPPORT == true) {\n $result2 = tep_db_query(\"select vendors_name from \".TABLE_VENDORS.\" WHERE vendors_id = \" . $row['v_vendor_id']);\n $row2 = tep_db_fetch_array($result2);\t\t\n $row['v_vendor'] = $row2['vendors_name'];\n }\n\n/* if (MASTER_PRODUCTS_SUPPORT == true) {\n $result2 = tep_db_query(\"select products_master from \".TABLE_PRODUCTS.\" WHERE products_id = \" . $row['v_products_id']);\n $row2 = tep_db_fetch_array($result2);\n $row['v_products_master'] = $row2['vendors_name'];\n }\n*/ \n //elari -\n //We check the value of tax class and title instead of the id\n //Then we add the tax to price if EP_PRICE_WITH_TAX is set to true\n $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']);\n $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']);\n if (EP_PRICE_WITH_TAX == true){\n $row['v_products_price'] = $row['v_products_price'] + round(($row['v_products_price'] * $row_tax_multiplier / 100), EP_PRECISION);\n }\n // now create the internal variables that will be used\n // the $$thisvar is on purpose: it creates a variable named what ever was in $thisvar and sets the value\n foreach ($default_these as $tkey => $thisvar){\n $$thisvar = $row[$thisvar];\n }\n \n $row = tep_db_fetch_array($result);\n }\n \n // this is an important loop. What it does is go thru all the fields in the incoming \n // file and set the internal vars. Internal vars not set here are either set in the \n // loop above for existing records, or not set at all (null values) the array values \n // are handled separatly, although they will set variables in this loop, we won't use them.\n foreach( $filelayout as $key => $value ){\n if (!($key == 'v_date_added' && empty($items[ $value ]))) {\n $$key = $items[ $value ];\n }\n }\n \n //elari... we get the tax_clas_id from the tax_title\n //on screen will still be displayed the tax_class_title instead of the id....\n if ( isset( $v_tax_class_title) ){\n $v_tax_class_id = tep_get_tax_title_class_id($v_tax_class_title);\n }\n //we check the tax rate of this tax_class_id\n $row_tax_multiplier = tep_get_tax_class_rate($v_tax_class_id);\n \n //And we recalculate price without the included tax...\n //Since it seems display is made before, the displayed price will still include tax\n //This is same problem for the tax_clas_id that display tax_class_title\n if (EP_PRICE_WITH_TAX == true){\n $v_products_price = round( $v_products_price / (1 + ($row_tax_multiplier * .01)), EP_PRECISION);\n }\n \n // if they give us one category, they give us all categories. convert data structure to a multi-dim array\n unset ($v_categories_name); // default to not set.\n unset ($v_categories_image); // default to not set.\n\t\t\tforeach ($languages as $key => $lang){\n\t\t\t $baselang_id = $lang['id'];\n\t\t\t break;\n\t\t\t}\n if ( isset( $filelayout['v_categories_name_1_' . $baselang_id] ) ){\n\t\t\t\t$v_categories_name = array();\n\t\t\t\t$v_categories_image = array();\n $newlevel = 1;\n for( $categorylevel=EP_MAX_CATEGORIES; $categorylevel>0; $categorylevel--){\n\t\t\t\t\t$found = false;\n\t\t\t\t\tif ($items[$filelayout['v_categories_image_' . $categorylevel]] != '') {\n\t\t\t\t\t $v_categories_image[$newlevel] = $items[$filelayout['v_categories_image_' . $categorylevel]];\n\t\t\t\t\t $found = true;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($languages as $key => $lang){\n\t\t\t\t\t\tif ( $items[$filelayout['v_categories_name_' . $categorylevel . '_' . $lang['id']]] != ''){\n\t\t\t\t\t\t\t$v_categories_name[$newlevel][$lang['id']] = $items[$filelayout['v_categories_name_' . $categorylevel . '_' . $lang['id']]];\n\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t}\n }\n\t\t\t\t\tif ($found == true) {\n\t\t\t\t\t $newlevel++;\n\t\t\t\t\t}\n }\n while( $newlevel < EP_MAX_CATEGORIES+1){\n $v_categories_image[$newlevel] = ''; // default the remaining items to nothing\n\t\t\t\t\tforeach ($languages as $key => $lang){\n $v_categories_name[$newlevel][$lang['id']] = ''; // default the remaining items to nothing\n\t\t\t\t\t}\n $newlevel++;\n }\n }\n \n if (ltrim(rtrim($v_products_quantity)) == '') {\n $v_products_quantity = 1;\n }\n \n if (empty($v_date_avail)) {\n $v_date_avail = 'NULL';\n } else {\n $v_date_avail = \"'\" . date(\"Y-m-d H:i:s\",strtotime($v_date_avail)) . \"'\";\n }\n \n if (empty($v_date_added)) {\n $v_date_added = \"'\" . date(\"Y-m-d H:i:s\") . \"'\";\n } else {\n $v_date_added = \"'\" . date(\"Y-m-d H:i:s\",strtotime($v_date_added)) . \"'\";\n }\n \n // default the stock if they spec'd it or if it's blank\n if (isset($v_status_current)){\n $v_db_status = strval($v_status_current); // default to current value\n } else {\n $v_db_status = '1'; // default to active\n }\n if (trim($v_status) == EP_TEXT_INACTIVE){\n // they told us to deactivate this item\n $v_db_status = '0';\n } elseif (trim($v_status) == EP_TEXT_ACTIVE) {\n $v_db_status = '1';\n } \n \n if (EP_INACTIVATE_ZERO_QUANTITIES == true && $v_products_quantity == 0) {\n // if they said that zero qty products should be deactivated, let's deactivate if the qty is zero\n $v_db_status = '0';\n }\n \n if ($v_manufacturer_id==''){\n $v_manufacturer_id=\"NULL\";\n }\n \n if (trim($v_products_image)==''){\n $v_products_image = EP_DEFAULT_IMAGE_PRODUCT;\n }\n \n if (strlen($v_products_model) > EP_MODEL_NUMBER_SIZE ){\n echo \"<font color='red'>\" . strlen($v_products_model) . $v_products_model . \"... ERROR! - Too many characters in the model number.<br />\n 12 is the maximum on a standard OSC install.<br />\n Your maximum product_model length is set to \".EP_MODEL_NUMBER_SIZE.\".<br />\n You can either shorten your model numbers or increase the size of the<br />\n \\\"products_model\\\" field of the \\\"products\\\" table in the database.<br />\n Then change the setting at the top of the easypopulate.php file.</font>\";\n die();\n }\n \n \n // OK, we need to convert the manufacturer's name into id's for the database\n if ( isset($v_manufacturers_name) && $v_manufacturers_name != '' ){\n $sql = \"SELECT man.manufacturers_id\n FROM \".TABLE_MANUFACTURERS.\" as man\n WHERE\n man.manufacturers_name = '\" . tep_db_input($v_manufacturers_name) . \"'\";\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n if ( $row != '' ){\n foreach( $row as $item ){\n $v_manufacturer_id = $item;\n }\n } else {\n // to add, we need to put stuff in categories and categories_description\n $sql = \"SELECT MAX( manufacturers_id) max FROM \".TABLE_MANUFACTURERS;\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n $max_mfg_id = $row['max']+1;\n // default the id if there are no manufacturers yet\n if (!is_numeric($max_mfg_id) ){\n $max_mfg_id=1;\n }\n \n // Uncomment this query if you have an older 2.2 codebase\n /*\n $sql = \"INSERT INTO \".TABLE_MANUFACTURERS.\"(\n manufacturers_id,\n manufacturers_name,\n manufacturers_image\n ) VALUES (\n $max_mfg_id,\n '$v_manufacturers_name',\n '\".EP_DEFAULT_IMAGE_MANUFACTURER.\"'\n )\";\n */\n \n // Comment this query out if you have an older 2.2 codebase\n $sql = \"INSERT INTO \".TABLE_MANUFACTURERS.\"(\n manufacturers_id,\n manufacturers_name,\n manufacturers_image,\n date_added,\n last_modified\n ) VALUES (\n $max_mfg_id,\n '\".tep_db_input($v_manufacturers_name).\"',\n '\".EP_DEFAULT_IMAGE_MANUFACTURER.\"',\n '\".date(\"Y-m-d H:i:s\").\"',\n '\".date(\"Y-m-d H:i:s\").\"'\n )\";\n $result = tep_db_query($sql);\n $v_manufacturer_id = $max_mfg_id;\n \n $sql = \"INSERT INTO \".TABLE_MANUFACTURERS_INFO.\"(\n manufacturers_id,\n manufacturers_url,\n languages_id\n ) VALUES (\n $max_mfg_id,\n '',\n '\".EP_DEFAULT_LANGUAGE_ID.\"'\n )\";\n $result = tep_db_query($sql);\n }\n }\n \n // if the categories names are set then try to update them\n\t\t\tforeach ($languages as $key => $lang){\n\t\t\t $baselang_id = $lang['id'];\n\t\t\t break;\n\t\t\t}\n if ( isset( $filelayout['v_categories_name_1_' . $baselang_id] ) ){\n // start from the highest possible category and work our way down from the parent\n $v_categories_id = 0;\n $theparent_id = 0;\n for ( $categorylevel=EP_MAX_CATEGORIES+1; $categorylevel>0; $categorylevel-- ){\n\t\t\t\t //foreach ($languages as $key => $lang){\n $thiscategoryname = $v_categories_name[$categorylevel][$baselang_id];\n if ( $thiscategoryname != ''){\n // we found a category name in this field, look for database entry\n $sql = \"SELECT cat.categories_id\n FROM \".TABLE_CATEGORIES.\" as cat, \n \".TABLE_CATEGORIES_DESCRIPTION.\" as des\n WHERE\n cat.categories_id = des.categories_id AND\n des.language_id = \" . $baselang_id . \" AND\n cat.parent_id = \" . $theparent_id . \" AND\n des.categories_name like '\" . tep_db_input($thiscategoryname) . \"'\";\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n\n if ( $row != '' ){\n // we have an existing category, update image and date\n\t\t\t\t\t\t\tforeach( $row as $item ){\n $thiscategoryid = $item;\n }\n\t\t\t\t\t\t\t$cat_image = '';\n\t\t\t\t\t\t\tif (!empty($v_categories_image[$categorylevel])) {\n\t\t\t\t\t\t\t $cat_image = \"categories_image='\".tep_db_input($v_categories_image[$categorylevel]).\"', \";\n\t\t\t\t\t\t\t} elseif (isset($filelayout['v_categories_image_' . $categorylevel])) {\n\t\t\t\t\t\t\t $cat_image = \"categories_image='', \";\n\t\t\t\t\t\t\t} \n $query = \"UPDATE \".TABLE_CATEGORIES.\"\n SET \n $cat_image\n last_modified = '\".date(\"Y-m-d H:i:s\").\"'\n WHERE \n categories_id = '\".$row['categories_id'].\"'\n LIMIT 1\";\n \n tep_db_query($query);\n } else {\n // to add, we need to put stuff in categories and categories_description\n $sql = \"SELECT MAX( categories_id) max FROM \".TABLE_CATEGORIES;\n $result = tep_db_query($sql);\n $row = tep_db_fetch_array($result);\n $max_category_id = $row['max']+1;\n if (!is_numeric($max_category_id) ){\n $max_category_id=1;\n }\n $sql = \"INSERT INTO \".TABLE_CATEGORIES.\" (\n categories_id,\n parent_id,\n categories_image,\n sort_order,\n date_added,\n last_modified\n ) VALUES (\n $max_category_id,\n $theparent_id,\n '\".tep_db_input($v_categories_image[$categorylevel]).\"',\n 0,\n '\".date(\"Y-m-d H:i:s\").\"',\n '\".date(\"Y-m-d H:i:s\").\"'\n )\";\n $result = tep_db_query($sql);\n \n foreach ($languages as $key => $lang){\n $sql = \"INSERT INTO \".TABLE_CATEGORIES_DESCRIPTION.\" (\n categories_id,\n language_id,\n categories_name\n ) VALUES (\n $max_category_id,\n '\".$lang['id'].\"',\n '\".(!empty($v_categories_name[$categorylevel][$lang['id']])?tep_db_input($v_categories_name[$categorylevel][$lang['id']]):'').\"'\n )\";\n tep_db_query($sql);\n }\n \n $thiscategoryid = $max_category_id;\n }\n // the current catid is the next level's parent\n $theparent_id = $thiscategoryid;\n $v_categories_id = $thiscategoryid; // keep setting this, we need the lowest level category ID later\n }\n\t\t\t\t // }\n }\n }\n\n \n if ($v_products_model != \"\") {\n // products_model exists!\n foreach ($items as $tkey => $item) {\n print_el($item);\n }\n \n // find the vendor id from the name imported\n if (EP_MVS_SUPPORT == true) {\n $vend_result = tep_db_query(\"SELECT vendors_id FROM \".TABLE_VENDORS.\" WHERE vendors_name = '\". $v_vendor . \"'\");\n $vend_row = tep_db_fetch_array($vend_result);\n $v_vendor_id = $vend_row['vendors_id'];\n }\n\n // process the PRODUCTS table\n $result = tep_db_query(\"SELECT products_id FROM \".TABLE_PRODUCTS.\" WHERE (products_model = '\". $v_products_model . \"')\");\n \n // First we check to see if this is a product in the current db.\n if (tep_db_num_rows($result) == 0) {\n \n // insert into products\n echo \"<font color='green'> !New Product!</font><br />\";\n \n // /////////////////////////////////////////////////////////////////////\n //\n // Start: Support for other contributions\n //\n // /////////////////////////////////////////////////////////////////////\n $ep_additional_fields = '';\n $ep_additional_data = '';\n\n if (EP_ADDITIONAL_IMAGES == true) { \n $ep_additional_fields .= 'products_image_description,';\n $ep_additional_data .= \"'\".tep_db_input($v_products_image_description).\"',\";\n } \n\t\t\t\n foreach ($custom_fields[TABLE_PRODUCTS] as $key => $name) { \n $ep_additional_fields .= $key . ',';\n }\n\n foreach ($custom_fields[TABLE_PRODUCTS] as $key => $name) { \n $tmp_var = 'v_' . $key;\n $ep_additional_data .= \"'\" . $$tmp_var . \"',\";\n }\n\n if (EP_MORE_PICS_6_SUPPORT == true) { \n $ep_additional_fields .= 'products_subimage1,products_subimage2,products_subimage3,products_subimage4,products_subimage5,products_subimage6,';\n $ep_additional_data .= \"'$v_products_subimage1','$v_products_subimage2','$v_products_subimage3','$v_products_subimage4','$v_products_subimage5','$v_products_subimage6',\";\n } \n \n if (EP_ULTRPICS_SUPPORT == true) { \n $ep_additional_fields .= 'products_image_med,products_image_lrg,products_image_sm_1,products_image_xl_1,products_image_sm_2,products_image_xl_2,products_image_sm_3,products_image_xl_3,products_image_sm_4,products_image_xl_4,products_image_sm_5,products_image_xl_5,products_image_sm_6,products_image_xl_6,';\n $ep_additional_data .= \"'$v_products_image_med','$v_products_image_lrg','$v_products_image_sm_1','$v_products_image_xl_1','$v_products_image_sm_2','$v_products_image_xl_2','$v_products_image_sm_3','$v_products_image_xl_3','$v_products_image_sm_4','$v_products_image_xl_4','$v_products_image_sm_5','$v_products_image_xl_5','$v_products_image_sm_6','$v_products_image_xl_6',\";\n }\n\t\t\t\t\t\n if (EP_PDF_UPLOAD_SUPPORT == true) { \n $ep_additional_fields .= 'products_pdfupload,products_fileupload,';\n $ep_additional_data .= \"'$v_products_pdfupload','$v_products_fileupload',\";\n }\n\t\t\t\t\t\n if (EP_MVS_SUPPORT == true) {\n $ep_additional_fields .= 'vendors_id,';\n $ep_additional_data .= \"'$v_vendor_id',\";\n }\n\t\t\t\n if (MASTER_PRODUCTS_SUPPORT == true) {\n $ep_additional_fields .= 'products_master, products_master_status,';\n $ep_additional_data .= \"'$v_products_master','$v_products_master_status',\";\n }\n\n // /////////////////////////////////////////////////////////////////////\n // End: Support for other contributions\n // /////////////////////////////////////////////////////////////////////\n \n $query = \"INSERT INTO \".TABLE_PRODUCTS.\" (\n products_image,\n $ep_additional_fields\n products_model,\n products_price,\n products_status,\n products_last_modified,\n products_date_added,\n products_date_available,\n products_tax_class_id,\n products_weight,\n products_quantity,\n manufacturers_id )\n VALUES (\n \".(!empty($v_products_image)?\"'\".$v_products_image.\"'\":'NULL').\",\n $ep_additional_data\n '$v_products_model',\n '$v_products_price',\n '$v_db_status',\n '\".date(\"Y-m-d H:i:s\").\"',\n \".$v_date_added.\",\n \".$v_date_avail.\",\n '$v_tax_class_id',\n '$v_products_weight',\n '$v_products_quantity',\n \".(!empty($v_manufacturer_id)?$v_manufacturer_id:'NULL').\")\n \";\n $result = tep_db_query($query);\n \n $v_products_id = tep_db_insert_id();\n \n } else {\n \n // existing product(s), get the id from the query\n // and update the product data\n while ($row = tep_db_fetch_array($result)) {\n \n $v_products_id = $row['products_id'];\n echo \"<font color='black'> Updated</font><br />\";\n \n // /////////////////////////////////////////////////////////////////////\n //\n // Start: Support for other contributions\n //\n // /////////////////////////////////////////////////////////////////////\n $ep_additional_updates = '';\n\n foreach ($custom_fields[TABLE_PRODUCTS] as $key => $name) { \n $tmp_var = 'v_' . $key;\n $ep_additional_updates .= $key . \"='\" . $$tmp_var . \"',\";\n }\n\n if (EP_ADDITIONAL_IMAGES == true && isset($v_products_image_description)) { \n $ep_additional_updates .= \"products_image_description='\".tep_db_input($v_products_image_description).\"',\";\n } \n\n if (EP_MORE_PICS_6_SUPPORT == true) { \n $ep_additional_updates .= \"products_subimage1='$v_products_subimage1',products_subimage2='$v_products_subimage2',products_subimage3='$v_products_subimage3',products_subimage4='$v_products_subimage4',products_subimage5='$v_products_subimage5',products_subimage6='$v_products_subimage6',\";\n } \n\n if (EP_ULTRPICS_SUPPORT == true) { \n $ep_additional_updates .= \"products_image_med='$v_products_image_med',products_image_lrg='$v_products_image_lrg',products_image_sm_1='$v_products_image_sm_1',products_image_xl_1='$v_products_image_xl_1',products_image_sm_2='$v_products_image_sm_2',products_image_xl_2='$v_products_image_xl_2',products_image_sm_3='$v_products_image_sm_3',products_image_xl_3='$v_products_image_xl_3',products_image_sm_4='$v_products_image_sm_4',products_image_xl_4='$v_products_image_xl_4',products_image_sm_5='$v_products_image_sm_5',products_image_xl_5='$v_products_image_xl_5',products_image_sm_6='$v_products_image_sm_6',products_image_xl_6='$v_products_image_xl_6',\";\n }\n\n if (EP_PDF_UPLOAD_SUPPORT == true) {\n $ep_additional_updates .= \"products_pdfupload='$v_products_pdfupload',products_fileupload='$v_products_fileupload',\";\n }\n\n if (EP_MVS_SUPPORT == true) {\n $ep_additional_updates .= \"vendors_id='$v_vendor_id',\";\n }\n\n if (MASTER_PRODUCTS_SUPPORT == true) {\n $ep_additional_updates .= \"products_master='$v_products_master',products_master_status='$v_products_master_status',\";\n }\n \n // /////////////////////////////////////////////////////////////////////\n // End: Support for other contributions\n // /////////////////////////////////////////////////////////////////////\n // only include the products image if it has been included in the spreadsheet\n $tmp_products_image_update = '';\n if (isset($v_products_image)) {\n $tmp_products_image_update = \"products_image=\".(!empty($v_products_image)?\"'\".$v_products_image.\"'\":'NULL').\", \n\t\t\t\t\t\t\t\t\t\t \";\n if (EP_ADDITIONAL_IMAGES == true && isset($filelayout['v_products_image'])) { \n $tmp_products_image_update .= \"products_image_med=NULL, \n products_image_pop=NULL, \";\n }\n }\n\t\t\t\n $query = \"UPDATE \".TABLE_PRODUCTS.\"\n SET\n products_price='$v_products_price', \n $tmp_products_image_update \n $ep_additional_updates\n products_weight='$v_products_weight', \n products_tax_class_id='$v_tax_class_id', \n products_date_available=\".$v_date_avail.\", \n products_date_added=\".$v_date_added.\", \n products_last_modified='\".date(\"Y-m-d H:i:s\").\"', \n products_quantity = $v_products_quantity, \n manufacturers_id = \".(!empty($v_manufacturer_id)?$v_manufacturer_id:'NULL').\", \n products_status = $v_db_status\n WHERE\n (products_id = $v_products_id)\n LIMIT 1\";\n \n tep_db_query($query);\n }\n }\n\t\t\n\t\t if (isset($v_products_specials_price)) {\n\t\t if (EP_SPPC_SUPPORT == true) { $SPPC_extra_query = ' and customers_group_id = 0'; } else { $SPPC_extra_query = ''; }\n\t\t\t $result = tep_db_query('select * from '.TABLE_SPECIALS.' WHERE products_id = ' . $v_products_id . $SPPC_extra_query );\n\n\t\t\t if ($v_products_specials_price == '') {\n\t\t\t \n\t\t\t\t $result = tep_db_query('DELETE FROM '.TABLE_SPECIALS.' WHERE products_id = ' . $v_products_id . $SPPC_extra_query );\n\t\t\t if (EP_SPPC_SUPPORT == true) { \n\t\t\t\t $result = tep_db_query('DELETE FROM specials_retail_prices WHERE products_id = ' . $v_products_id );\n\t\t\t }\n\n\t\t\t } else {\n\t\t\t\t if ($specials = tep_db_fetch_array($result)) {\n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_products_specials_price,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_last_modified' => 'now()'\n\t\t\t\t\t );\n\t\t\t\t\t tep_db_perform(TABLE_SPECIALS, $sql_data_array, 'update', 'specials_id = '.$specials['specials_id']);\n\t\t\t\t\t \n\t\t\t if (EP_SPPC_SUPPORT == true) { \n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_products_specials_price\n\t\t\t\t\t );\n\t\t\t\t\t tep_db_perform('specials_retail_prices', $sql_data_array, 'update', 'products_id = '.$v_products_id);\n\t\t\t\t }\n\t\t\t\t } else {\n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_products_specials_price,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_date_added' => 'now()',\n\t\t\t\t\t\t\t\t\t\t\t 'status' => '1'\n\t\t\t\t\t );\n\t\t if (EP_SPPC_SUPPORT == true) { $sql_data_array = array_merge($sql_data_array,array('customers_group_id' => '0')); }\n\t\t\t\t\t tep_db_perform(TABLE_SPECIALS, $sql_data_array, 'insert');\n\t\t\t\t\t \n\t\t\t if (EP_SPPC_SUPPORT == true) { \n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_products_specials_price,\n\t\t\t\t\t\t\t\t\t\t\t 'status' => '1',\n\t\t\t\t\t\t\t\t\t\t\t 'customers_group_id' => '0'\n\t\t\t\t\t );\n\t\t\t\t\t tep_db_perform('specials_retail_prices', $sql_data_array, 'insert');\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n }\n\t\t\t\n\t\t\t// upgrade method only. Note: if you upgrades more and more the id number will be hihger. I suggest that picture upgrades use last\n\t\t\t// or delete always v_products_images_image_1 column to prevent effect\n\t\t\tif (EP_PRODUCTS_IMAGES == true) { \n\t\t\t\tif (isset($filelayout['v_products_images_image_1'])) {\n\t\t\t\t\ttep_db_query(\"delete from \" . TABLE_PRODUCTS_IMAGES . \" where products_id = '\" . (int)$v_products_id . \"'\");\n\t\t\t\t\tfor ($i=1;$i<=EP_PRODUCTS_IMAGES_MAX;$i++) {\n\t\t\t\t\t\t$pi_htmlcontent_var = 'v_products_images_htmlcontent_'.$i;\n\t\t\t\t\t\t$pi_image_var = 'v_products_images_image_'.$i;\n\t\t\t\t\t\tif (!empty($$pi_image_var) || !empty($$pi_htmlcontent_var)) {\n\t\t\t\t\t\t\ttep_db_query(\"insert into \" . TABLE_PRODUCTS_IMAGES . \" (products_id, image, htmlcontent, sort_order) values ('\" . (int)$v_products_id . \"', '\" . tep_db_input($$pi_image_var) . \"', '\" . tep_db_input($$pi_htmlcontent_var) . \"', '\" . tep_db_input($$i) . \"')\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n\t\t\tif (EP_QPBP == true) { \n\t\t\t\tif (isset($filelayout['v_products_qpbp_price_1'])) {\n\t\t\t\t\ttep_db_query(\"delete from \" . TABLE_PRODUCTS_PRICE_BREAK . \" where products_id = '\" . (int)$v_products_id . \"'\");\n\t\t\t\t\tfor ($i=1;$i<=EP_QPBP_MAX;$i++) {\n\t\t\t\t\t\t$pi_htmlcontent_var = 'v_products_qpbp_price_'.$i;\n\t\t\t\t\t\t$pi_image_var = 'v_products_qpbp_qty_'.$i;\n\t\t\t\t\t\tif (!empty($$pi_image_var) || !empty($$pi_htmlcontent_var)) {\n\t\t\t\t\t\t\ttep_db_query(\"insert into \" . TABLE_PRODUCTS_PRICE_BREAK . \" (products_id, products_price, products_qty) values ('\" . (int)$v_products_id . \"', '\" . tep_db_input($$pi_image_var) . \"', '\" . tep_db_input($$pi_htmlcontent_var) . \"')\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\tif (EP_ADDITIONAL_IMAGES == true) { \n\t\t\t if (isset($filelayout['v_products_image_2'])) {\n\t\t\t\t tep_db_query(\"delete from \" . TABLE_ADDITIONAL_IMAGES . \" where products_id = '\" . (int)$v_products_id . \"'\");\n\t\t\t\t for ($i=2;$i<=EP_ADDITIONAL_IMAGES_MAX+1;$i++) {\n\t\t\t\t\t$ai_description_var = 'v_products_image_description_'.$i;\n\t\t\t\t\t$ai_image_var = 'v_products_image_'.$i;\n\t\t\t\t\tif (!empty($$ai_image_var) || !empty($$ai_description_var)) {\n\t\t\t\t\t tep_db_query(\"insert into \" . TABLE_ADDITIONAL_IMAGES . \" (products_id, images_description, thumb_images) values ('\" . (int)$v_products_id . \"', '\" . tep_db_input($$ai_description_var) . \"', '\" . tep_db_input($$ai_image_var) . \"')\");\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\n // process the PRODUCTS_DESCRIPTION table\n foreach ($languages as $tkey => $lang){\n\n $doit = false;\n foreach ($custom_fields[TABLE_PRODUCTS_DESCRIPTION] as $key => $name) { \n if (isset($filelayout['v_' . $key . '_'.$lang['id']])) { $doit = true; }\n }\n\n if ( isset($filelayout['v_products_name_'.$lang['id']]) || isset($filelayout['v_products_description_'.$lang['id']]) || isset($filelayout['v_products_url_'.$lang['id']]) || isset($filelayout['v_products_head_title_tag_'.$lang['id']]) || $doit == true ) {\n \n $sql = \"SELECT * FROM \".TABLE_PRODUCTS_DESCRIPTION.\" WHERE\n products_id = $v_products_id AND\n language_id = \" . $lang['id'];\n $result = tep_db_query($sql);\n \n $products_var = 'v_products_name_'.$lang['id'];\n $description_var = 'v_products_description_'.$lang['id'];\n $url_var = 'v_products_url_'.$lang['id'];\n\n // /////////////////////////////////////////////////////////////////////\n //\n // Start: Support for other contributions\n //\n // /////////////////////////////////////////////////////////////////////\n $ep_additional_updates = '';\n $ep_additional_fields = '';\n $ep_additional_data = '';\n\n foreach ($custom_fields[TABLE_PRODUCTS_DESCRIPTION] as $key => $name) { \n $tmp_var = 'v_' . $key . '_' . $lang['id'];\n $ep_additional_updates .= $key . \" = '\" . tep_db_input($$tmp_var) .\"',\";\n $ep_additional_fields .= $key . \",\";\n $ep_additional_data .= \"'\". tep_db_input($$tmp_var) . \"',\";\n }\n\n // header tags controller support\n if (isset($filelayout['v_products_head_title_tag_'.$lang['id']])){\n $head_title_tag_var = 'v_products_head_title_tag_'.$lang['id'];\n $head_desc_tag_var = 'v_products_head_desc_tag_'.$lang['id'];\n $head_keywords_tag_var = 'v_products_head_keywords_tag_'.$lang['id'];\n \n $ep_additional_updates .= \"products_head_title_tag = '\" . tep_db_input($$head_title_tag_var) .\"', products_head_desc_tag = '\" . tep_db_input($$head_desc_tag_var) .\"', products_head_keywords_tag = '\" . tep_db_input($$head_keywords_tag_var) .\"',\";\n $ep_additional_fields .= \"products_head_title_tag,products_head_desc_tag,products_head_keywords_tag,\";\n $ep_additional_data .= \"'\". tep_db_input($$head_title_tag_var) . \"','\". tep_db_input($$head_desc_tag_var) . \"','\". tep_db_input($$head_keywords_tag_var) . \"',\";\n }\n // end: header tags controller support\n \n // /////////////////////////////////////////////////////////////////////\n // End: Support for other contributions\n // /////////////////////////////////////////////////////////////////////\n \n \n // existing product?\n if (tep_db_num_rows($result) > 0) {\n // already in the description, let's just update it\n $sql =\n \"UPDATE \".TABLE_PRODUCTS_DESCRIPTION.\" \n SET\n products_name='\" . tep_db_input($$products_var) . \"',\n products_description='\" . tep_db_input($$description_var) . \"',\n $ep_additional_updates\n products_url='\" . $$url_var . \"'\n WHERE\n products_id = '$v_products_id' AND\n language_id = '\".$lang['id'].\"'\n LIMIT 1\";\n $result = tep_db_query($sql);\n \n } else {\n \n // nope, this is a new product description\n $result = tep_db_query($sql);\n $sql =\n \"INSERT INTO \".TABLE_PRODUCTS_DESCRIPTION.\"\n ( products_id,\n language_id,\n products_name,\n products_description,\n $ep_additional_fields\n products_url\n )\n VALUES (\n '\" . $v_products_id . \"',\n \" . $lang['id'] . \",\n '\". tep_db_input($$products_var) . \"',\n '\". tep_db_input($$description_var) . \"',\n $ep_additional_data\n '\". $$url_var . \"'\n )\";\n $result = tep_db_query($sql);\n }\n }\n }\n \n \n \n if (isset($v_categories_id)){\n //find out if this product is listed in the category given\n $result_incategory = tep_db_query('SELECT\n '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id,\n '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id\n FROM\n '.TABLE_PRODUCTS_TO_CATEGORIES.'\n WHERE\n '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND\n '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id);\n \n if (tep_db_num_rows($result_incategory) == 0) {\n // nope, this is a new category for this product\n $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)\n VALUES (\"' . $v_products_id . '\", \"' . $v_categories_id . '\")');\n } else {\n // already in this category, nothing to do!\n }\n }\n \n // this is for the cross sell contribution\n if (isset($v_cross_sell)){\n tep_db_query(\"delete from \".TABLE_PRODUCTS_XSELL.\" where products_id = \" . $v_products_id . \" or xsell_id = \" . $v_products_id . \"\");\n if (!empty($v_cross_sell)){\n $xsells_array = explode(',',$v_cross_sell);\n foreach ($xsells_array as $xs_key => $xs_model ) {\n $cross_sell_sql = \"select products_id from \".TABLE_PRODUCTS.\" where products_model = '\" . trim($xs_model) . \"' limit 1\";\n $cross_sell_result = tep_db_query($cross_sell_sql);\n $cross_sell_row = tep_db_fetch_array($cross_sell_result);\n \n tep_db_query(\"insert into \".TABLE_PRODUCTS_XSELL.\" (products_id, xsell_id, sort_order) \n values ( \".$v_products_id.\", \".$cross_sell_row['products_id'].\", 1)\");\n tep_db_query(\"insert into \".TABLE_PRODUCTS_XSELL.\" (products_id, xsell_id, sort_order) \n\t\t\t\t\t\t\t\t values ( \".$cross_sell_row['products_id'].\", \".$v_products_id.\", 1)\");\n }\n }\n\t\t}\n\n // for the separate prices per customer (SPPC) module\n $ll=1;\n if (isset($v_customer_price_1)){\n \n if (($v_customer_group_id_1 == '') AND ($v_customer_price_1 != '')) {\n echo \"<font color=red>ERROR - v_customer_group_id and v_customer_price must occur in pairs</font>\";\n die();\n }\n // they spec'd some prices, so clear all existing entries\n $result = tep_db_query('\n DELETE\n FROM\n '.TABLE_PRODUCTS_GROUPS.'\n WHERE\n products_id = ' . $v_products_id\n );\n // and insert the new record\n if ($v_customer_price_1 != ''){ \n $result = tep_db_query(\" INSERT INTO \" .TABLE_PRODUCTS_GROUPS . \" (customers_group_id, customers_group_price, products_id)\n VALUES\n ('\"\n . $v_customer_group_id_1 . \"', '\"\n . $v_customer_price_1 . \"', '\"\n . $v_products_id\n . \"')\");\n }\n if ($v_customer_price_2 != ''){\n $result = tep_db_query(\" INSERT INTO \" .TABLE_PRODUCTS_GROUPS . \" (customers_group_id, customers_group_price, products_id)\n VALUES\n ('\"\n . $v_customer_group_id_2 . \"', '\"\n . $v_customer_price_2 . \"', '\"\n . $v_products_id\n . \"')\");\n }\n if ($v_customer_price_3 != ''){\n $result = tep_db_query(\" INSERT INTO \" .TABLE_PRODUCTS_GROUPS . \" (customers_group_id, customers_group_price, products_id)\n VALUES\n ('\"\n . $v_customer_group_id_3 . \"', '\"\n . $v_customer_price_3 . \"', '\"\n . $v_products_id\n . \"')\");\n }\n if ($v_customer_price_4 != ''){\n $result = tep_db_query(\" INSERT INTO \" .TABLE_PRODUCTS_GROUPS . \" (customers_group_id, customers_group_price, products_id)\n VALUES\n ('\"\n . $v_customer_group_id_4 . \"', '\"\n . $v_customer_price_4 . \"', '\"\n . $v_products_id\n . \"')\");\n }\n\n\n\n if (isset($v_customer_specials_price_1)) {\n $result = tep_db_query('select * from '.TABLE_SPECIALS.' WHERE products_id = ' . $v_products_id . ' and customers_group_id = 1' );\n\n if ($v_customer_specials_price_1 == '') {\n\t\t\t \n $result = tep_db_query('DELETE FROM '.TABLE_SPECIALS.' WHERE products_id = ' . $v_products_id . ' and customers_group_id = 1' );\n\n } else {\n if ($specials = tep_db_fetch_array($result)) {\n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_customer_specials_price_1,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_last_modified' => 'now()'\n\t\t\t\t\t );\n\t\t\t\t\t tep_db_perform(TABLE_SPECIALS, $sql_data_array, 'update', 'specials_id = '.$specials['specials_id']);\n } else {\n\t\t\t\t\t $sql_data_array = array('products_id' => $v_products_id,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_new_products_price' => $v_customer_specials_price_1,\n\t\t\t\t\t\t\t\t\t\t\t 'specials_date_added' => 'now()',\n\t\t\t\t\t\t\t\t\t\t\t 'status' => '1',\n\t\t\t\t\t\t\t\t\t\t\t 'customers_group_id' => '1'\n\t\t\t\t\t );\n\t\t\t\t\t tep_db_perform(TABLE_SPECIALS, $sql_data_array, 'insert');\n }\n }\n }\n\t\t\t\n }\n // end: separate prices per customer (SPPC) module\n \n \n // VJ product attribs begin\n if (isset($v_attribute_options_id_1)){\n $attribute_rows = 1; // master row count\n \n // product options count\n $attribute_options_count = 1;\n $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;\n \n while (isset($$v_attribute_options_id_var) && !empty($$v_attribute_options_id_var)) {\n // remove product attribute options linked to this product before proceeding further\n // this is useful for removing attributes linked to a product\n $attributes_clean_query = \"delete from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$v_products_id . \"' and options_id = '\" . (int)$$v_attribute_options_id_var . \"'\";\n \n tep_db_query($attributes_clean_query);\n \n $attribute_options_query = \"select products_options_name from \" . TABLE_PRODUCTS_OPTIONS . \" where products_options_id = '\" . (int)$$v_attribute_options_id_var . \"'\";\n \n $attribute_options_values = tep_db_query($attribute_options_query);\n \n // option table update begin\n if ($attribute_rows == 1) {\n // insert into options table if no option exists\n if (tep_db_num_rows($attribute_options_values) <= 0) {\n for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n $lid = $languages[$i]['id'];\n \n $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;\n \n if (isset($$v_attribute_options_name_var)) {\n $attribute_options_insert_query = \"insert into \" . TABLE_PRODUCTS_OPTIONS . \" (products_options_id, language_id, products_options_name) values ('\" . (int)$$v_attribute_options_id_var . \"', '\" . (int)$lid . \"', '\" . $$v_attribute_options_name_var . \"')\";\n \n $attribute_options_insert = tep_db_query($attribute_options_insert_query);\n }\n }\n } else { // update options table, if options already exists\n for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n $lid = $languages[$i]['id'];\n \n $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;\n \n if (isset($$v_attribute_options_name_var)) {\n $attribute_options_update_lang_query = \"select products_options_name from \" . TABLE_PRODUCTS_OPTIONS . \" where products_options_id = '\" . (int)$$v_attribute_options_id_var . \"' and language_id ='\" . (int)$lid . \"'\";\n \n $attribute_options_update_lang_values = tep_db_query($attribute_options_update_lang_query);\n \n // if option name doesn't exist for particular language, insert value\n if (tep_db_num_rows($attribute_options_update_lang_values) <= 0) {\n $attribute_options_lang_insert_query = \"insert into \" . TABLE_PRODUCTS_OPTIONS . \" (products_options_id, language_id, products_options_name) values ('\" . (int)$$v_attribute_options_id_var . \"', '\" . (int)$lid . \"', '\" . $$v_attribute_options_name_var . \"')\";\n \n $attribute_options_lang_insert = tep_db_query($attribute_options_lang_insert_query);\n } else { // if option name exists for particular language, update table\n $attribute_options_update_query = \"update \" . TABLE_PRODUCTS_OPTIONS . \" set products_options_name = '\" . $$v_attribute_options_name_var . \"' where products_options_id ='\" . (int)$$v_attribute_options_id_var . \"' and language_id = '\" . (int)$lid . \"'\";\n \n $attribute_options_update = tep_db_query($attribute_options_update_query);\n }\n }\n }\n }\n }\n // option table update end\n \n // product option values count\n $attribute_values_count = 1;\n $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;\n \n while (isset($$v_attribute_values_id_var) && !empty($$v_attribute_values_id_var)) {\n $attribute_values_query = \"select products_options_values_name from \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" where products_options_values_id = '\" . (int)$$v_attribute_values_id_var . \"'\";\n \n $attribute_values_values = tep_db_query($attribute_values_query);\n \n // options_values table update begin\n if ($attribute_rows == 1) {\n // insert into options_values table if no option exists\n if (tep_db_num_rows($attribute_values_values) <= 0) {\n for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n $lid = $languages[$i]['id'];\n \n $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;\n \n if (isset($$v_attribute_values_name_var)) {\n $attribute_values_insert_query = \"insert into \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" (products_options_values_id, language_id, products_options_values_name) values ('\" . (int)$$v_attribute_values_id_var . \"', '\" . (int)$lid . \"', '\" . tep_db_input($$v_attribute_values_name_var) . \"')\";\n \n $attribute_values_insert = tep_db_query($attribute_values_insert_query);\n }\n }\n \n \n // insert values to pov2po table\n $attribute_values_pov2po_query = \"insert into \" . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . \" (products_options_id, products_options_values_id) values ('\" . (int)$$v_attribute_options_id_var . \"', '\" . (int)$$v_attribute_values_id_var . \"')\";\n \n $attribute_values_pov2po = tep_db_query($attribute_values_pov2po_query);\n } else { // update options table, if options already exists\n for ($i=0, $n=sizeof($languages); $i<$n; $i++) {\n $lid = $languages[$i]['id'];\n \n $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;\n \n if (isset($$v_attribute_values_name_var)) {\n $attribute_values_update_lang_query = \"select products_options_values_name from \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" where products_options_values_id = '\" . (int)$$v_attribute_values_id_var . \"' and language_id ='\" . (int)$lid . \"'\";\n \n $attribute_values_update_lang_values = tep_db_query($attribute_values_update_lang_query);\n \n // if options_values name doesn't exist for particular language, insert value\n if (tep_db_num_rows($attribute_values_update_lang_values) <= 0) {\n $attribute_values_lang_insert_query = \"insert into \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" (products_options_values_id, language_id, products_options_values_name) values ('\" . (int)$$v_attribute_values_id_var . \"', '\" . (int)$lid . \"', '\" . tep_db_input($$v_attribute_values_name_var) . \"')\";\n \n $attribute_values_lang_insert = tep_db_query($attribute_values_lang_insert_query);\n } else { // if options_values name exists for particular language, update table\n $attribute_values_update_query = \"update \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" set products_options_values_name = '\" . tep_db_input($$v_attribute_values_name_var) . \"' where products_options_values_id ='\" . (int)$$v_attribute_values_id_var . \"' and language_id = '\" . (int)$lid . \"'\";\n \n $attribute_values_update = tep_db_query($attribute_values_update_query);\n }\n }\n }\n }\n }\n // options_values table update end\n \n // options_values price update begin\n $v_attribute_values_price_var = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;\n \n if (isset($$v_attribute_values_price_var) && ($$v_attribute_values_price_var != '')) {\n $attribute_prices_query = \"select options_values_price, price_prefix from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$v_products_id . \"' and options_id ='\" . (int)$$v_attribute_options_id_var . \"' and options_values_id = '\" . (int)$$v_attribute_values_id_var . \"'\";\n \n $attribute_prices_values = tep_db_query($attribute_prices_query);\n \n $attribute_values_price_prefix = ($$v_attribute_values_price_var < 0) ? '-' : '+';\n // if negative, remove the negative sign for storing since the prefix is stored in another field.\n if ( $$v_attribute_values_price_var < 0 ) $$v_attribute_values_price_var = strval(-((float)$$v_attribute_values_price_var));\n \n // options_values_prices table update begin\n // insert into options_values_prices table if no price exists\n if (tep_db_num_rows($attribute_prices_values) <= 0) {\n $attribute_prices_insert_query = \"insert into \" . TABLE_PRODUCTS_ATTRIBUTES . \" (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('\" . (int)$v_products_id . \"', '\" . (int)$$v_attribute_options_id_var . \"', '\" . (int)$$v_attribute_values_id_var . \"', '\" . (float)$$v_attribute_values_price_var . \"', '\" . $attribute_values_price_prefix . \"')\";\n \n $attribute_prices_insert = tep_db_query($attribute_prices_insert_query);\n } else { // update options table, if options already exists\n $attribute_prices_update_query = \"update \" . TABLE_PRODUCTS_ATTRIBUTES . \" set options_values_price = '\" . $$v_attribute_values_price_var . \"', price_prefix = '\" . $attribute_values_price_prefix . \"' where products_id = '\" . (int)$v_products_id . \"' and options_id = '\" . (int)$$v_attribute_options_id_var . \"' and options_values_id ='\" . (int)$$v_attribute_values_id_var . \"'\";\n \n $attribute_prices_update = tep_db_query($attribute_prices_update_query);\n }\n }\n // options_values price update end\n \n //////// attributes stock add start\n $v_attribute_values_stock_var = 'v_attribute_values_stock_' . $attribute_options_count . '_' . $attribute_values_count;\n \n if (isset($$v_attribute_values_stock_var) && ($$v_attribute_values_stock_var != '')) {\n \n $stock_attributes = $$v_attribute_options_id_var.'-'.$$v_attribute_values_id_var;\n $attribute_stock_query = tep_db_query(\"select products_stock_quantity from \" . TABLE_PRODUCTS_STOCK . \" where products_id = '\" . (int)$v_products_id . \"' and products_stock_attributes ='\" . $stock_attributes . \"'\"); \n \n // insert into products_stock_quantity table if no stock exists\n if (tep_db_num_rows($attribute_stock_query) <= 0) {\n $attribute_stock_insert_query =tep_db_query(\"insert into \" . TABLE_PRODUCTS_STOCK . \" (products_id, products_stock_attributes, products_stock_quantity) values ('\" . (int)$v_products_id . \"', '\" . $stock_attributes . \"', '\" . (int)$$v_attribute_values_stock_var . \"')\");\n \n } else { // update options table, if options already exists\n $attribute_stock_insert_query = tep_db_query(\"update \" . TABLE_PRODUCTS_STOCK. \" set products_stock_quantity = '\" . (int)$$v_attribute_values_stock_var . \"' where products_id = '\" . (int)$v_products_id . \"' and products_stock_attributes = '\" . $stock_attributes . \"'\");\n \n // turn on stock tracking on products_options table\n $stock_tracking_query = tep_db_query(\"update \" . TABLE_PRODUCTS_OPTIONS . \" set products_options_track_stock = '1' where products_options_id = '\" . (int)$$v_attribute_options_id_var . \"'\");\n \n }\n }\n //////// attributes stock add end \n \n $attribute_values_count++;\n $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;\n }\n \n $attribute_options_count++;\n $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;\n }\n \n $attribute_rows++;\n }\n // VJ product attribs end\n \n } else {\n // this record was missing the product_model\n echo \"<p class=smallText>No products_model field in record. This line was not imported: \";\n foreach ($items as $tkey => $item) {\n print_el($item);\n }\n echo \"<br /><br /></p>\";\n }\n // end of row insertion code\n \n }\n\n // EP for product extra fields Contrib by minhmaster DEVSOFTVN ==========\n }\n // end (EP for product extra fields Contrib by minhmt DEVSOFTVN) ============\n\n}", "public function import(FieldInstance $instance, array $values = NULL);", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "public function import_testcase_from_excel($php_excel, $import_type, $new_keyword_list)\r\n {\r\n $this->import_type = $import_type;\r\n \r\n // create new keyword first\r\n if (count($new_keyword_list, COUNT_NORMAL) > 0)\r\n {\r\n foreach ($new_keyword_list as $id => $new_keyword)\r\n {\r\n $sql = \"insert into \" . $this->db_handler->get_table('keywords') . \" (keyword, testproject_id, notes)\" .\r\n \" values ('\" . $new_keyword . \"' , '\" . $this->project_id . \"' , '')\";\r\n $this->db_handler->exec_query($sql);\r\n }\r\n }\r\n \r\n $this->init_keywords_map();\r\n \r\n // parse testcase step info into node array\r\n $this->get_tc_step_list($php_excel);\r\n \r\n // get the dic tree info from node list\r\n $this->get_existed_directory_tree();\r\n \r\n // generate directionary tree ,include dic and testcases under dic\r\n $this->parse_directory_tree();\r\n \r\n // write data to db\r\n $this->write_data_to_db();\r\n \r\n return $this->result_message;\r\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\t \tif($excel['cells'][1][1] == 'SFG Item No.' && $excel['cells'][1][2] == 'SFG Quantity') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t\t$kode_sfg = $excel['cells'][$i][1];\n\t\t\t\t$quantity_sfg = $excel['cells'][$i][2];\n \t\t\t$material_no = $excel['cells'][$i][3];\n \t\t\t$quantity = $excel['cells'][$i][4];\n \t$plant = $excel['cells'][$i][5];\n if(empty($plant)) {\n $plant = $this->session->userdata['ADMIN']['plant'];\n }\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif(($excel['cells'][$i][1] != $excel['cells'][$x][1])||($excel['cells'][$i][5] != $excel['cells'][$x][5])) {\n\n $sfgs_header = $this->m_sfgs->sfgs_header_select_by_kode_sfg($kode_sfg,$plant);\n if ($sfgs_header!=FALSE) {\n $this->m_sfgs->sfgs_header_delete_multiple($sfgs_header);\n }\n $j++;\n\t\t\t\t // \tif($sfgs_detail_temp = $this->m_general->sap_item_groups_select_all_sfgs()) {\n $object['sfgs_headers'][$j]['plant'] = $plant;\n $object['sfgs_headers'][$j]['kode_sfg'] = $excel['cells'][$i][1];\n $item_temp = $this->m_general->sap_item_select_by_item_code($excel['cells'][$i][1]);\n $object['sfgs_headers'][$j]['nama_sfg'] = $item_temp['MAKTX'];\n $object['sfgs_headers'][$j]['quantity_sfg'] = $quantity_sfg;\n $object['sfgs_headers'][$j]['uom_sfg'] = $item_temp['UNIT'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['filename'] = $this->session->userdata('filename_upload');\n\n\t\t\t\t\t\t$id_sfgs_header = $this->m_sfgs->sfgs_header_insert($object['sfgs_headers'][$j]);\n\n \t$sfgs_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t //\t\t} else {\n //\t$sfgs_header_exist = FALSE;\n\t\t\t//\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($sfgs_header_exist) {\n\n\t\t\t\t\tif($sfgs_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['sfgs_details'][$j][$k]['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['id_sfgs_h_detail'] = $k;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_desc'] = $sfgs_detail_temp['MAKTX'];\n \t\t\t\t\t $object['sfgs_details'][$j][$k]['quantity'] = $quantity;\n\n $uom_import = $sfgs_detail_temp['UNIT'];\n if(strcasecmp($uom_import,'KG')==0) {\n $uom_import = 'G';\n }\n if(strcasecmp($uom_import,'L')==0) {\n $uom_import = 'ML';\n }\n \t\t\t$object['sfgs_details'][$j][$k]['uom'] = $uom_import;\n\n\t\t\t\t\t\t$id_sfgs_detail = $this->m_sfgs->sfgs_detail_insert($object['sfgs_details'][$j][$k]);\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Master Semi Finished Goods (SFG) BOM berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['sfgs_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Master Semi Finished Goods (SFG) BOM atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'sfgs/browse_result/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '008';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "protected function import(): void {\n\t\t\t$sections = $this->load_and_decode_file();\n\n\t\t\tif ( empty( $sections ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $sections as $section ) {\n\t\t\t\tLearnDash_Settings_Section::set_section_settings_all(\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$section['fields']\n\t\t\t\t);\n\n\t\t\t\t$this->processed_items_count++;\n\t\t\t\t$this->imported_items_count++;\n\t\t\t}\n\t\t}", "function bit_admin_import_csv( $playid ) {\n}", "public static function insert_multiple_rows($dataDir)\n {\n $workbook = new Workbook($dataDir . 'Book1.xls');\n\n # Accessing the first worksheet in the Excel file\n $worksheet = $workbook->getWorksheets()->get(0);\n\n # Inserting a row into the worksheet at 3rd position\n $worksheet->getCells()->insertRows(2,10);\n\n # Saving the modified Excel file in default (that is Excel 2003) format\n $workbook->save($dataDir . \"Insert Multiple Rows.xls\");\n\n print \"Insert Multiple Rows Successfully.\" . PHP_EOL;\n\n }", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\tif($excel['cells'][1][1] == 'Material Doc. No' && $excel['cells'][1][2] == 'Material No.') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t \t$item_group_code='all';\n\t\t\t\t\t$material_no = $excel['cells'][$i][2];\n\t\t\t\t\t$quantity = $excel['cells'][$i][3];\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif($excel['cells'][$i][1] != $excel['cells'][$x][1]) {\n\n $j++;\n\n\t\t\t\t\t \t$object['tpaket_headers'][$j]['posting_date'] = date(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['plant'] = $this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_tpaket_plant'] = $this->m_tpaket->id_tpaket_plant_new_select($object['tpaket_headers'][$j]['plant']);\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['status'] = '1';\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['item_group_code'] = $item_group_code;\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['filename'] = $upload['file_name'];\n\n\t\t\t\t\t\t$id_tpaket_header = $this->m_tpaket->tpaket_header_insert($object['tpaket_headers'][$j]);\n\n \t$tpaket_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t\t}\n\n\t\t\t\tif($tpaket_header_exist) {\n\n\t\t\t\t\tif($tpaket_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['tpaket_details'][$j][$k]['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t $object['tpaket_details'][$j][$k]['id_tpaket_h_detail'] = $k;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_desc'] = $tpaket_detail_temp['MAKTX'];\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['quantity'] = $quantity;\n if ($tpaket_detail_temp['UNIT']=='L')\n $tpaket_detail_temp['UNIT'] = 'ML';\n if ($tpaket_detail_temp['UNIT']=='KG')\n $tpaket_detail_temp['UNIT'] = 'G';\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['uom'] = $tpaket_detail_temp['UNIT'];\n\n//\t\t\t\t\t\t$id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k]);\n \t\t\t\t if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k])) {\n\n if(($quantity > 0)&&($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($material_no))) {\n if($item_pakets !== FALSE) {\n \t\t$l = 1;\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$l] = $value;\n \t\t\t}\n \t\t\t$l++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }\n \t $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\t for($m = 1; $m <= $c_item_paket; $m++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $m;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_detail_paket['material_no_paket'] = $material_no;\n $tpaket_detail_paket['material_no'] = $item_paket['material_no'][$m];\n $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$m];\n $tpaket_detail_paket['quantity'] = ($item_paket['quantity'][$m]/$item_paket['quantity_paket'][$m])*$quantity;\n $tpaket_detail_paket['uom'] = $item_paket['uom'][$m];\n \t\t\t\t\t $this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket);\n }\n }\n \t\t\t\t }\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Transaksi Paket berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['tpaket_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Paket atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'tpaket/browse_result/0/0/0/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '011';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function import()\n {\n $itemTypeId = $this->_insertItemType();\n \n // Insert the Omeka collection.\n $collectionOmekaId = $this->_insertCollection();\n \n // Insert an Omeka item for every Sept11 object.\n foreach ($this->_fetchCollectionObjectsSept11() as $object) {\n \n $metadata = array('item_type_id' => $itemTypeId);\n \n // Set the story.\n $xml = new SimpleXMLElement($object['OBJECT_ABSOLUTE_PATH'], null, true);\n $elementTexts = array(\n ElementSet::ITEM_TYPE_NAME => array(\n 'SEIU Story: Story' => array(array('text' => $xml->STORY, 'html' => false)), \n 'SEIU Story: Local Union' => array(array('text' => $xml->LOCAL_UNION, 'html' => false)), \n )\n );\n \n $itemId = $this->_insertItem($collectionOmekaId, $object, $metadata, $elementTexts);\n }\n }", "function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}", "function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}", "public function importData()\n {\n /*$this->db->where('delete_status','0'); \n $data = $this->db->get('item');\n \treturn $data->result();*/\n \treturn $this->db->SELECT('c.category_name,u.unit_name,i.hsn_code,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price')\n\t\t\t\t\t\t\t->FROM('category c')\n\t\t\t\t\t\t\t->JOIN('item i','i.category_id=c.id')\n\t\t\t\t\t\t\t->JOIN('tax t','i.tax_id=t.tax_id')\n\t\t\t\t\t\t\t->JOIN('unit u','i.unit_id=u.id')\n\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t->row();\n\n /*$this->db->select('c.category_name,u.unit_name,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price');\n $this->db->from('item i');\n $this->db->join('category c','c.id = i.category_id');\n $this->db->join('tax t','t.tax_id = i.tax_id');\n $this->db->join('unit u','u.id = i._id');*/\n\n\n }", "public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "public function prepareImportContent();", "private function row_imported( $row, $action = '' ) {\n\t\t$this->imported_rows[] = $row + 1;\n\t\tif ( $action && is_scalar( $action ) ) {\n\t\t\tif ( ! isset( $this->actions[ $action ] ) ) {\n\t\t\t\t$this->actions[ $action ] = 0;\n\t\t\t}\n\t\t\t$this->actions[ $action ]++;\n\t\t}\n\t}", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "public function import_all($parentselector = '') {\n\n }", "public function importInterface(){\n return view('/drugAdministration/drugs/importExcelDrugs');\n }", "public function excel_import_product(){\n return view('product.import_product');\n }", "function import_ch8bt_bug() {\r\n if ( !current_user_can( 'manage_options' ) ) {\r\n wp_die( 'Not allowed' );\r\n }\r\n \r\n // Check if nonce field is present \r\n check_admin_referer( 'ch8bt_import' ); \r\n \r\n // Check if file has been uploaded \r\n if( array_key_exists( 'import_bugs_file', $_FILES ) ) { \r\n // If file exists, open it in read mode \r\n $handle = fopen( $_FILES['import_bugs_file']['tmp_name'], 'r' ); \r\n \r\n // If file is successfully open, extract a row of data \r\n // based on comma separator, and store in $data array \r\n if ( $handle ) { \r\n while ( ( $data = fgetcsv( $handle, 5000, ',' ) ) !== FALSE ) { \r\n $row += 1; \r\n \r\n // If row count is ok and row is not header row \r\n // Create array and insert in database \r\n if ( count( $data ) == 4 && $row != 1 ) { \r\n $new_bug = array( \r\n 'bug_title' => $data[0], \r\n 'bug_description' => $data[1], \r\n 'bug_version' => $data[2], \r\n 'bug_status' => $data[3], \r\n 'bug_report_date' => date( 'Y-m-d' ) ); \r\n \r\n global $wpdb; \r\n \r\n $wpdb->insert( $wpdb->get_blog_prefix() . \r\n 'ch8_bug_data', $new_bug ); \r\n } \r\n } \r\n } \r\n } \r\n \r\n // Redirect the page to the user submission form \r\n wp_redirect( add_query_arg( 'page', 'ch8bt-bug-tracker', \r\n admin_url( 'options-general.php' ) ) ); \r\n exit; \r\n}", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }", "public function import()\n {\n // Reorder importers\n usort($this->entityImporterMappings, function ($a, $b) {\n return $a[ORDER] <=> $b[ORDER];\n });\n\n // Import each entity type in turn\n foreach ($this->entityImporterMappings as $entityImporterMapping) {\n $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]);\n foreach ($files as $filename => $slug) {\n $fileContents = file_get_contents($filename);\n $entityData = json_decode($fileContents, true);\n $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData);\n }\n }\n }", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function importAction() {\n $aOptGuilde = array(\n 'guilde' => '',\n 'serveur' => '', //TODO extrait les information dans la colonne Data\n 'lvlMin' => '',\n 'imp-membre' => 'Oui',\n );\n\n // Pour optimiser le rendu\n $oViewModel = new ViewModel();\n $oViewModel->setTemplate('backend/guildes/import/import');\n $oViewModel->setVariable(\"guilde\", $aOptGuilde);\n return $oViewModel;\n }", "public function cells();", "public function import_data()\r\n\t{\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE `enabled`>='1'\";\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_data` WHERE `mls_query_id` = '{$mls_query->id}' AND `imported` = 0 ORDER BY `date` LIMIT {$mls_query->import_limit}\";\r\n\t\t\t$mls_data = wpl_db::select($query);\r\n\t\t\tif(!$mls_data) continue;\r\n\t\t\t$results = array();\r\n\t\t\t$ids = array();\r\n\r\n\t\t\tforeach($mls_data as $data)\r\n\t\t\t{\r\n\t\t\t\t$results[$data->unique_value] = (array)json_decode(base64_decode($data->content));\r\n\t\t\t\t$ids[] = $data->id;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\r\n\t\t\tif(trim($wplrets->mls_server_data->mls_unique_field) == '') continue;\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\r\n\t\t\t/** map data **/\r\n\t\t\t$mapped = $wplrets->map($results, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** import properties **/\r\n\t\t\t$pids = $wplrets->import_mapped_data($mapped, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** download images **/\r\n\t\t\tif(trim($mls_query->images)) $wplrets->import_properties_images($pids, $mls_query->mls_server_id, $mls_query->images, false);\r\n\t\t\t\r\n\t\t\t/** finalizing properties **/\r\n\t\t\tforeach($pids as $pid) $wplrets->finalize($pid);\r\n\t\t\r\n\t\t\t/** update imported field **/\r\n\t\t\twpl_db::q(\"UPDATE `#__wpl_addon_mls_data` SET `imported` = '1' WHERE `id` IN ('\".implode(\"','\", $ids).\"')\");\r\n\t\t}\r\n\r\n\t\tif(wpl_request::getVar('rets_import_cron_job') == 1) exit;\r\n\t}", "abstract public function loadData();", "function import($onDuplicate, &$values) {\n $response = $this->summary($values);\n $this->_params = $this->getActiveFieldParams(true);\n $this->formatDateParams();\n $this->_params['skipRecentView'] = TRUE;\n $this->_params['check_permissions'] = TRUE;\n\n if(count($this->_importQueueBatch) >= $this->getImportQueueBatchSize()) {\n $this->addBatchToQueue();\n }\n $this->addToBatch($this->_params, $values);\n\n }", "public function import()\n {\n //then by the element set name\n if(!$this->record) {\n $this->record = $this->db->getTable('ElementSet')->findByName($this->responseData['name']);\n }\n\n if(!$this->record) {\n $this->record = new ElementSet;\n }\n //set new value if element set exists and override is set, or if it is brand new\n if( ($this->record->exists() && get_option('omeka_api_import_override_element_set_data')) || !$this->record->exists()) {\n $this->record->description = $this->responseData['description'];\n $this->record->name = $this->responseData['name'];\n $this->record->record_type = $this->responseData['record_type'];\n }\n\n try {\n $this->record->save(true);\n $this->addOmekaApiImportRecordIdMap();\n } catch(Exception $e) {\n _log($e);\n }\n }", "public function import($params)\n {\n $this->results->basename = $params['basename'];\n $this->results->filepath = $params['filepath'];\n \n $this->project = $project = $params['project'];\n $this->projectId = $project->getId();\n \n $ss = $this->reader->load($params['filepath']);\n\n //if ($worksheetName) $ws = $reader->getSheetByName($worksheetName);\n $ws = $ss->getSheet(0);\n \n $rows = $ws->toArray();\n \n $header = array_shift($rows);\n \n $this->processHeaderRow($header);\n \n // Insert each record\n foreach($rows as $row)\n {\n $item = $this->processDataRow($row);\n \n $this->processItem($item);\n }\n $this->gameRepo->commit();\n \n return $this->results;\n }", "private function importMainContents($contents) : void\n {\n //==============================================================================\n // Import Title\n if (!empty($contents[\"title\"])) {\n $this->setTitle($contents[\"title\"]);\n }\n //==============================================================================\n // Import SubTitle\n if (!empty($contents[\"subtitle\"])) {\n $this->setSubTitle($contents[\"subtitle\"]);\n }\n //==============================================================================\n // Import Icon\n if (!empty($contents[\"icon\"])) {\n $this->setIcon($contents[\"icon\"]);\n }\n //==============================================================================\n // Import Origin\n if (!empty($contents[\"origin\"])) {\n $this->setOrigin($contents[\"origin\"]);\n }\n }", "function import()\n\t{\n\t\t$this->ipsclass->admin->page_detail = \"Эта секция позволяет вам импортировать XML-файлы содержащие языковые настройки.\";\n\t\t$this->ipsclass->admin->page_title = \"Импорт языка\";\n\t\t$this->ipsclass->admin->nav[] \t\t= array( '', 'Import Language Pack' );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doimport' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'lang' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'MAX_FILE_SIZE' , '10000000000' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section' , $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) , \"uploadform\", \" enctype='multipart/form-data'\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Импортирование XML-файла\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Загрузка XML-архива с языковыми настройками</b><div style='color:gray'>Выберите файл для загрузки с вашего компьютера. Выбранный файл должен начинаться с 'ipb_language' и заканчиваться либо '.xml', либо '.xml.gz'.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_upload( )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b><u>ИЛИ</u> введите название XML-архива</b><div style='color:gray'>Этот файл должен быть загружен в основную директорию форума.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_location', 'ipb_language.xml.gz' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Введите название для новых языковых настроек</b><div style='color:gray'>Например: Русский, RU, English, US...</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_name', '' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Импортирование XML-файла\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\n\n\t}", "public function upload()\n {\n $this->load->library('upload');\n $fileName = $_FILES['import']['name'];\n\n $config['upload_path'] = './assets'; //buat folder dengan nama assets di root folder\n $config['file_name'] = $fileName;\n $config['allowed_types'] = 'xls|xlsx|csv';\n $config['max_size'] = 10000;\n $config['overwrite'] = TRUE;\n\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('import')) {\n $this->upload->display_errors();\n }\n $inputFileName = './assets/' . $fileName;\n\n try {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } catch (Exception $e) {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME) . '\": ' . $e->getMessage());\n }\n\n $sheet = $objPHPExcel->getSheet(0);\n $highestRow = $sheet->getHighestRow();\n $startRow = 2;\n $rowData = array();\n if ($highestRow > 1) {\n $highestColumn = $sheet->getHighestColumn();\n $insert = FALSE;\n for ($row = 0; $row < $highestRow - 1; $row++) {\n // Read a row of data into an array\n $tmp = $sheet->rangeToArray('A' . $startRow . ':' . 'N' . $startRow++, NULL, TRUE, FALSE)[0];\n if(substr($tmp[12], 0, 1) != '0'){\n \t$tmp[12] = '0' . $tmp[12];\n }\n $data = array(\n \"nama\" => $tmp[0],\n \"merk\" => $tmp[1],\n \"tipe\" => $tmp[2],\n \"ukuran\" => $tmp[3],\n \"satuan\" => $tmp[4],\n \"hargaPasar\" => $tmp[5],\n \"biayaKirim\" => $tmp[6],\n \"resistensi\" => $tmp[7],\n \"ppn\" => $tmp[8],\n \"hargashsb\" => $tmp[9],\n \"keterangan\" => $tmp[10],\n \"spesifikasi\" => $tmp[11],\n \"kode_kategori\" => $tmp[12],\n \"tahun_anggaran\" => $tmp[13],\n \"createdBy\" => $this->ion_auth->get_user_id(),\n );\n array_push($rowData, $data);\n }\n\n if ($this->barang_m->insert_many($rowData)) {\n $this->message('Berhasil! Data berhasil di upload', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n redirect(site_url('katalog/add'));\n }", "public function postImport()\n {\n Excel::load(Input::file('customer'), function($reader) {\n $cmp_id = Session::get('cmp_id');\n foreach ($reader->get() as $book) {\n Product::create([\n 'nombreProducto' => $book->producto,\n 'similarProducto' => $book->similar,\n 'idTipoProducto' => $book->tipo,\n 'idEmpresa' => $cmp_id,\n ]);\n }\n });\n Session::flash('message','Importacion realizada correctamente');\n return Redirect::to('product');\n }", "function clients_doImport() {\n\tglobal $gSession;\n\t\n\t## import the data files. the import process is divided in steps and segments\n\t$current_step = intval($_GET['step']);\n\t$current_group = intval($_GET['group']);\n\t## let's see what the current step is\n\n\tswitch($current_step) {\n\t\tcase 0:\n\t\t\t## first ask the user for the file to import\n\t\t\tclients_importDisplaySelectFile();\n\t\t\t## in order to show the screen right away we do nothing \n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t## we need to store the settings \n\t\t\t$update = intval($_POST['update']);\n\t\t\n\t\t\t## okay test out the uploading of the file\n\t\t\t$userfile\t= $_FILES['upload']['tmp_name'];\n\t\t\t$file_name\t= $_FILES['upload']['name'];\n\t\t\t$file_size\t= $_FILES['upload']['size'];\n\t\t\t$file_type\t= $_FILES['upload']['type'];\n\n\t\t\t## okay we first create an upload object\n\t\t\t$f = new file_object(); \n\t\t\tif ($userfile != \"none\" && $userfile!='') { \n\t\t\t\t##then we upload the file\n\t\t\t\t$filename = $f->upload($userfile, 'import.csv',$file_size,$file_type, MATRIX_BASEDIR.\"settings/modules/\".$GLOBALS['_MODULE_DATAOBJECTS_NAME'].\"/import/\",1);\n\t\t\t\t## check if the file was successfully uploaded\n\t\t\t\tif($filename != -1) {\n\t\t\t\t\toutput_progress('Import','Please wait while the file is beeing processed',\"module.php?cmd=import&step=2&group=\".$current_group.'&update='.$update);\n\t\t\t\t} else {\n\t\t\t\t\t## there was an error processing the file\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$targetURL = $gSession->url('module.php?cmd=import');\n\t\t\t\toutput_confirm_refresh('Please select a file','Please select a file before proceeding',$targetURL);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t## convert the file\n\t\t\t$update = intval($_GET['update']);\n\t\t\t\n\t\t\tdbobject_importConvertDataFile(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/import.csv',MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/tmp.csv');\n\t\t\toutput_progress('Import','prepareing default values',\"module.php?cmd=import&step=3&group=\".$current_group.'&update='.$update);\n\t\t\t\n\t\t\tbreak;\n\t\tcase 3:\n\n\t\t\t## in this step we will inform the user about the fields we found- and let the user\n\t\t\t## specify which elements he wants to assign to what fields from the db\n\t\t\t##exit;\n\t\t\t## okay we have a file- now we need to ask them what default values they want to set\n\t\t\t## let#s get the availaable options\n\t\t\t\n\t\t\t##fetch the field names form the file\n\t\t\t$data = clients_importGetSegementOfFile(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/tmp.csv',0,1);\t\t\n\t\t\t$data = $data['data'][0];\n\n\t\t\t\n\t\t\tclients_importDisplaySelectValues($data);\t\t\t\n\t\t\tbreak;\n\n\t\tcase 4:\n\t\t\t## the user has selected the desired mapping- we need to prepare it and \n\t\t\t## store the mapping for the next importing steps...\n\t\t\t\n\t\t\t$column_counter = intval($_POST['column_count']);\n\t\t\t$update = intval($_GET['update']);\n\t\t\t\n\t\t\t## prepare the fields\n\t\t\t$mapping = array();\n\t\t\tfor($i = 0; $i <= $column_counter; $i++) {\n\t\t\t\tif($_POST['COLUMN_'.$i] != -1) {\n\t\t\t\t\t## okay we found a field\n\t\t\t\t\t$mapping[$i] = $_POST['COLUMN_'.$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t## now we will store the mapping using the session identifier\n\t\t\t$filename = MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/'.$gSession->id.'.mapping';\n\t\t\t$content = serialize($mapping);\n\n\t\t\t## store the mapping file\n\t\t\t$fp = fopen($filename,'w');\n\t\t\tif($fp) {\n\t\t\t\t## write the data\n\t\t\t\tfwrite($fp,$content);\n\t\t\t\tfclose($fp);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t## finally jump to the next step\n\t\t\toutput_progress('Import','starting import',\"module.php?cmd=import&step=5&update=\".$update);\t\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\t## first load the mapping file\n\t\t\t$filename = MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/'.$gSession->id.'.mapping';\n\t\t\t\n\t\t\t$update = intval($_GET['update']);\n\t\t\t\n\t\t\t## load the file\n\t\t\t$content = file_get_contents($filename);\t\n\t\t\t$mapping = unserialize($content);\n\t\t\n\t\t\t## this step is divided in substeps\n\t\t\t$current_substeps = isset($_GET['substeps']) ? $_GET['substeps'] : 1;\n\t\t\t$current_pos = intval($_GET['pos']) ? $_GET['pos'] : 1;\n\n\t\t\t## process the products\n\t\t\t$dataInfo = clients_importGetSegementOfFile(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/import/tmp.csv',$current_substeps,$current_substeps+100,$mapping);\n\t\t\t$data = $dataInfo['data'];\n\t\t\t\n\t\t\t## okay now we will prepare the \n\t\t\tif(isset($data[0])) {\n\t\t\t\t_clientsDoImport($data,$_POST['default_values'],$update);\n\t\t\t\toutput_progress('Import','processing data:'.($current_substeps+99),\"module.php?cmd=import&step=5&values=\".$values.\"&pos=\".$dataInfo['pos'].\"&substeps=\".($current_substeps+100).\"&group=\".$current_group.\"&update=\".$update);\t\n\t\t\t} else {\n\t\t\t\t## reload and display the next step\n\t\t\t\toutput_progress('Import','finishing',\"module.php?cmd=import&step=6\");\t\n\t\t\t}\n\t\t\tbreak;\t\t\t\n\t\tdefault:\n\t\t\t## okay we are done... so for now just quit\n\t\t\toutput_confirm('Import','The data was sucessfully imported','module.php');\n\n\t\t\tbreak;\n\t\t}\n\t\n}", "public function indexImport()\n\t{\n\t\t$this->commons->isAdmin();\n\t\t$filename = $_FILES[\"file\"][\"tmp_name\"];\n\t\t$data = '';\n\t\t$row = 0;\n\t\t$expire = date('Y-m-d', strtotime('+1 years'));\n\t\tif ($_FILES[\"file\"][\"size\"] > 0) {\n\t\t\t$file = fopen($filename, \"r\");\n\t\t\twhile (($getData = fgetcsv($file, 10000, \",\")) !== FALSE) {\n\t\t\t\tif ($row == 0 && $getData[0] !== 'Salutation' && $getData[1] !== 'First Name' && $getData[2] !== 'Last Name' && $getData[3] !== 'Company' && $getData[4] !== 'Email Address' && $getData[5] !== 'Phone Number' && $getData[6] !== 'Website' && $getData[7] !== 'Address Line 1' && $getData[8] !== 'Address Line 2' && $getData[9] !== 'City' && $getData[10] !== 'State' && $getData[11] !== 'Country' && $getData[12] !== 'Postal Code') {\n\t\t\t\t\techo 0;\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\tif ($row > 0) {\n\t\t\t\t\t$temp = array('address1' => $getData[7], 'address2' => $getData[8], 'city' => $getData[9], 'state' => $getData[10], 'country' => $getData[11], 'pin' => $getData[12], 'phone1' => '', 'fax' => '');\n\t\t\t\t\t$data .= \"('\" . $getData[0] . \"','\" . $getData[1] . \"','\" . $getData[2] . \"','\" . $getData[3] . \"','\" . $getData[4] . \"','\" . $getData[5] . \"','\" . $getData[6] . \"','\" . json_encode($temp) . \"','\" . $getData[11] . \"','\" . $expire . \"'),\";\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t\t$data = rtrim($data, ',');\n\t\t$result = $this->contactModel->importContact($data);\n\t\tif ($result) {\n\t\t\techo 1;\n\t\t} else {\n\t\t\techo 0;\n\t\t}\n\t}", "public function importData($data)\n\t{\n\t\tif($data instanceof stdClass){\n\t\t\t$data = Mage::helper('wmgcybersource')->stdClassToArray($data);\n\t\t}\n\t\t$data = Mage::helper('wmgcybersource')->varienObjectise($data);\n\t\t$this->setData($data);\n\t\treturn $this;\n\t}", "function extract(){\n $datamine_row = $datamine_col = $header = array();\n $i = 0; $j = 0;\n \n // Groups all excel data by row\n for ($row = 1; $row <= $this->highestRow; $row++) {\n $rowData = $this->sheet->rangeToArray('A' . $row . ':' . $this->highestColumn . $row, null, true, false);\n if(empty($header)){\n $header=$rowData[0];\n }else{\n for($col=0;$col<count($header);$col++){\n $datamine_row[$i][$header[$col]] = $rowData[0][$col]; \n }\n $i++;\n }\n }\n $this->data_row = $datamine_row;\n \n // Re-group all excel data by column\n foreach($datamine_row as $data){\n foreach($header as $grp){\n $datamine_col[$grp][$j] = $data[$grp];\n }\n $j++;\n }\n $this->data_col = $datamine_col;\n }", "private function _readSubTableData() {}", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "public function doImport($append = false)\n {\n $this->_rows = array();\n\n $result = parent::doImport($append);\n\n $this->_buildObjectsIds();\n\n return $result;\n }", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "public function importcsv($filename) {\n $handle = fopen(\\Drupal::root() . '\\modules\\custom\\indegene_mod\\\\'.$filename, 'r');\n $key = 0;\n $data = [];\n\n while(($row = fgetcsv($handle, 1000, ',')) !== false) {\n if(user_load_by_mail($row[5])){\n continue;\n }\n else {\n $data['user'][$key]['FirstName'] = $row[0];\n $data['user'][$key]['LastName'] = $row[1];\n $data['user'][$key]['UserName'] = $row[2];\n $data['user'][$key]['Gender'] = $row[3];\n $data['user'][$key]['Role'] = $row[4];\n $data['user'][$key]['Email'] = $row[5];\n $data['user'][$key]['Password'] = $row[6];\n $key++;\n }\n }\n\n foreach($data['user'] as $key => $val){\n // Create user object.\n $user = User::create();\n\n //Mandatory settings\n $user->setPassword($val['Password']);\n $user->enforceIsNew();\n $user->setEmail($val['Email']);\n $user->setUsername($val['UserName']); //This username must be unique and accept only a-Z,0-9, - _ @ .\n $user->addRole($val['Role']); //E.g: authenticated\n //custom fields\n $user->set(\"field_first_name\", $val['FirstName']);\n $user->set(\"field_last_name\", $val['LastName']);\n $user->set(\"field_gender\", $val['Gender']);\n\n $user->activate();\n $results[] = $user->save();\n }\n\n // $batch = array(\n // 'title' => t('Creating Node...'),\n // 'operations' => array(\n // array(\n // '\\Drupal\\indegene_mod\\CreateNode::createNodeBatch',\n // [$data]\n // ),\n // ),\n // 'finished' => '\\Drupal\\indegene_mod\\CreateNode::createNodeBatchFinishedCallback',\n // );\n\n // batch_set($batch);\n\n $this->output()->writeln('custom drush command finished execution');\n }" ]
[ "0.5941935", "0.5939636", "0.5757379", "0.57407624", "0.56725055", "0.5664429", "0.55651826", "0.5535334", "0.550323", "0.548339", "0.54818875", "0.5467036", "0.54592186", "0.542788", "0.5415725", "0.5340358", "0.5318185", "0.53129333", "0.5310183", "0.52994084", "0.5298575", "0.5282992", "0.5259951", "0.5255155", "0.5246009", "0.52412677", "0.52384657", "0.5224277", "0.5210873", "0.52084786", "0.51756346", "0.5154902", "0.5135751", "0.5132089", "0.5109426", "0.5101724", "0.50958884", "0.5090411", "0.5073894", "0.5070504", "0.50623995", "0.5054494", "0.504461", "0.50298846", "0.5002686", "0.49904343", "0.49706507", "0.49616852", "0.4961584", "0.49557146", "0.49550268", "0.4951291", "0.49092615", "0.48905206", "0.48889697", "0.48871392", "0.48833582", "0.4874051", "0.48611122", "0.48558897", "0.48517686", "0.48480612", "0.48419133", "0.48370984", "0.4833106", "0.4820799", "0.48161492", "0.48110723", "0.48058388", "0.479438", "0.4785939", "0.47763658", "0.4775494", "0.47733536", "0.47696722", "0.4767409", "0.4767245", "0.47611967", "0.47522354", "0.47481906", "0.47402948", "0.4739474", "0.47384337", "0.47353196", "0.47348014", "0.47277236", "0.47151604", "0.47128725", "0.47126925", "0.46967727", "0.4695623", "0.46926424", "0.46873832", "0.46872714", "0.46781933", "0.46778676", "0.46767634", "0.46728584", "0.46717077", "0.46649325" ]
0.4703026
89
Method for importing a number data cell.
protected function process_data_number(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function getNumber() {}", "public function getNumber();", "public function onSetCellData( $cellNumber, $data )\n\t{\n\t\t$this->objPHPExcel->getActiveSheet()->setcellValue( $cellNumber, $data );\n\t}", "function _putBaseNumber(&$pdf, $font, $data, $x, $y, $widthCell, $heightCell, $align, $size, $margin = 1.6) {\n $data = number_format($data);\n\n $step = 0;\n for ($i = strlen($data) - 1; $i >= 0; $i--) {\n $element = mb_substr($data, $i, 1, 'utf-8');\n if ($element == '-') {\n $element = '△';\n $size = $size - 2;\n $y = $y + 0.5;\n }\n $pdf->SetFont($font, null, $size, true);\n $pdf->SetXY($x - $step, $y);\n $pdf->MultiCell($widthCell, 5, $element, 0, $align);\n $step += $margin;\n }\n }", "public function getNumber()\n {\n return $this->getData(self::NUMBER);\n }", "function import(array $data);", "public function testNumberToExcellColumnFormat()\n {\n $numberFormatter = new NumberFormatService();\n $z = $numberFormatter->toExcelColumnFormat(26);\n $aa = $numberFormatter->toExcelColumnFormat(27);\n $abb = $numberFormatter->toExcelColumnFormat(730);\n\n $this->assertEquals('Z', $z);\n $this->assertEquals('AA', $aa);\n $this->assertEquals('ABB', $abb);\n }", "public function numberFormatDataProvider() {}", "function gmp_import($data)\n {\n return gmp_init(bin2hex($data), 16);\n }", "public function importFrom(array $data);", "private function _readNumber($subData)\n\t{\n\t\t$rknumhigh = $this->_GetInt4d($subData, 4);\n\t\t$rknumlow = $this->_GetInt4d($subData, 0);\n\t\t$sign = ($rknumhigh & 0x80000000) >> 31;\n\t\t$exp = ($rknumhigh & 0x7ff00000) >> 20;\n\t\t$mantissa = (0x100000 | ($rknumhigh & 0x000fffff));\n\t\t$mantissalow1 = ($rknumlow & 0x80000000) >> 31;\n\t\t$mantissalow2 = ($rknumlow & 0x7fffffff);\n\t\t$value = $mantissa / pow( 2 , (20- ($exp - 1023)));\n\n\t\tif ($mantissalow1 != 0) {\n\t\t\t$value += 1 / pow (2 , (21 - ($exp - 1023)));\n\t\t}\n\n\t\t$value += $mantissalow2 / pow (2 , (52 - ($exp - 1023)));\n\t\tif ($sign) {\n\t\t\t$value = -1 * $value;\n\t\t}\n\n\t\treturn\t$value;\n\t}", "public function triggerNum($num, $data){}", "public function setNumber($var)\n {\n GPBUtil::checkInt32($var);\n $this->number = $var;\n }", "public function fnReadNumber($bStartsWithDot) \n {\n $iStart = $this->iPos;\n if (!$bStartsWithDot && $this->fnReadInt(10) === null) \n $this->fnRaise($iStart, \"Invalid number\");\n $bOctal = ($this->iPos - $iStart) >= 2\n && Utilities::fnGetCharAt($this->sInput, $iStart) == 48;\n if ($bOctal && $this->bStrict) \n $this->fnRaise($iStart, \"Invalid number\");\n if ($bOctal \n && preg_match(\n \"/[89]/\", \n mb_substr(\n $this->sInput, \n $iStart, \n $this->iPos - $iStart\n )\n )\n ) \n $bOctal = false;\n $iNext = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n if ($iNext == 46 && !$bOctal) { // '.'\n ++$this->iPos;\n $this->fnReadInt(10);\n $iNext = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n }\n if (($iNext == 69 || $iNext == 101) && !$bOctal) { // 'eE'\n $iNext = Utilities::fnGetCharAt($this->sInput, ++$this->iPos);\n if ($iNext == 43 || $iNext == 45) \n ++$this->iPos; // '+-'\n if ($this->fnReadInt(10) === null) \n $this->fnRaise($iStart, \"Invalid number\");\n }\n if (Identifier::fnIsIdentifierStart($this->fnFullCharCodeAtPos())) \n $this->fnRaise($this->iPos, \"Identifier directly after number\");\n\n $sStr = mb_substr($this->sInput, $iStart, $this->iPos - $iStart);\n $iVal = $bOctal ? intval($sStr, 8) : floatval($sStr);\n return $this->fnFinishToken(TokenTypes::$aTypes['num'], $iVal);\n }", "private function readDigits()\n {\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "public function import(array $data): void;", "function _putIntNumber(&$pdf, $x, $y, $data, $distance, $align, $margin1) {\n\t\t$data = strval($data);\n $step = 0;\n for ($i = strlen($data) - 1; $i >= 0; $i--) {\n $element = mb_substr($data, $i, 1, 'utf-8');\n if ($element == '-') {\n $element = '△';\n $pdf->SetXY($x - $step + $margin1, $y);\n } else {\n $pdf->SetXY($x - $step, $y);\n }\n $pdf->MultiCell(10, 5, $element, 0, $align);\n $step += $distance;\n }\n }", "private function writeNumber($row, $col, $num, $xfIndex)\n {\n $record = 0x0203; // Record identifier\n $length = 0x000E; // Number of bytes to follow\n\n $header = pack('vv', $record, $length);\n $data = pack('vvv', $row, $col, $xfIndex);\n $xl_double = pack('d', $num);\n if (self::getByteOrder()) { // if it's Big Endian\n $xl_double = strrev($xl_double);\n }\n\n $this->append($header . $data . $xl_double);\n\n return 0;\n }", "public function setNumber($number);", "public function testUnsupportedDataAlphaToNumber()\n {\n // Input text parameters\n $input_alphabet = \"A2\";\n $expected_result = -20;\n\n // Execute test target\n $Response = Utility::alpha2num($input_alphabet);\n\n // Check result\n $this->assertEquals($expected_result, $Response);\n }", "public function getNumericData($number){\n\t\tif(is_numeric($number)){\n\t \t$validNumber= floatval($number);\n\t }\n\t\telse {\n\t\t\t$validNumber= FALSE;\n\t\t}\n\t\treturn $validNumber;\n }", "protected function process_header_number(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "public function setNumber($val)\n {\n $this->_propDict[\"number\"] = $val;\n return $this;\n }", "public function setNumericCode($numericCode);", "public function getNumber()\n {\n return $this->number;\n }", "public static function convert_number_field() {\n\n\t\t// Create a new Number field.\n\t\tself::$field = new GF_Field_Number();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Number specific properties.\n\t\tself::$field->rangeMin = rgar( self::$nf_field, 'number_min' );\n\t\tself::$field->rangeMax = rgar( self::$nf_field, 'number_max' );\n\n\t\t// Add currency property if needed.\n\t\tif ( rgar( self::$nf_field, 'mask' ) && 'currency' === self::$nf_field['mask'] ) {\n\t\t\tself::$field->numberFormat = 'currency';\n\t\t}\n\n\t}", "public function get_number()\n\t{\n\t\treturn $this->number;\n\t}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function number(): string\n {\n return $this->getData('Number');\n }", "function xlsWriteNumber($Row, $Col, $Value) {\r\necho pack(\"sssss\", 0x203, 14, $Row, $Col, 0x0);\r\necho pack(\"d\", $Value);\r\nreturn;\r\n}", "public function getNumber(): ?string {\n $val = $this->getBackingStore()->get('number');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'number'\");\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber()\n {\n return $this->number;\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function getNumber() {\n return $this->number;\n }", "abstract protected function _getRowNumeric($rs);", "public function testUpdateValuesContainNumbers(): void { }", "protected function evalNumberTypeValue($record, $column, $value)\n {\n return $this->evalTextTypeValue($record, $column, $value);\n }", "public function getNumber() /*: int*/ {\n if ($this->number === null) {\n throw new \\Exception(\"Number is not initialized\");\n }\n return $this->number;\n }", "private function pullCellNumber ($phoneNum, $state, $reportNum = 0){\n\n \n $splitPhone = \"\";\n $pulledNum = \"\";\n\n //Razdvajanje brojeva zavisno od toga kojim su znakom razdvojeni\n if (strpos($phoneNum,' ') !== false) {\n $splitPhone = explode(\" \", $phoneNum);\n } else if (strpos($phoneNum,',') !== false) {\n $splitPhone = explode(\",\", $phoneNum);\n } else if (strpos($phoneNum,';') !== false) {\n $splitPhone = explode(\";\", $phoneNum);\n } else if (strpos($phoneNum,'+') !== false) {\n $splitPhone = explode(\"+\", $phoneNum);\n } else {\n $splitPhone = Array($phoneNum);\n }\n\n foreach ($splitPhone as $brojevi) {\n\n $brojInt = preg_replace('/[^0-9]/', '', $brojevi);\n\n if (substr($brojInt, 0, 2) == \"00\"){\n $brojInt = substr($brojInt, 2); \n } \n\n foreach($this->_allowedArr[$state] as $area){\n\n $duzina = strlen($area);\n $cutPhone = substr($brojInt, 0, $duzina);\n\n if ($area == $cutPhone) {\n $pulledNum = $brojInt;\n\n break;\n }\n }\n }\n $pulledNum = preg_replace('/[^0-9]/', '', $pulledNum);\n $pulledNum = str_replace(' ', \"\", $pulledNum);\n\n return $pulledNum;\n }", "public function getNUMEROINT()\r\n {\r\n return $this->NUMERO_INT;\r\n }", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public static function _convertir($num)\n {\n //formatea el monto original a formato entendido por MySQL\n $_parse = numfmt_create('es_ES',\\NumberFormatter::DECIMAL);\n\n $_result = numfmt_parse($_parse,$num);\n\n return $_result;\n }", "protected function _setNumeric($name, $value) {}", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "private function identifyMyRowNo()\n {\n return (int)ceil($this->cellNum / $this->boardWidth);\n }", "function setNum($num)\n {\n $this->num = $num;\n }", "public function setNum($var)\n {\n GPBUtil::checkInt64($var);\n $this->num = $var;\n\n return $this;\n }", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "public function getNumber()\n {\n return $this->_number;\n }", "public function getNumber()\n {\n return $this->_number;\n }", "public function import($data)\r\n\t{\r\n\t\tforeach ((array) $data as $column => $value)\r\n\t\t\t$this->set($column, $value);\r\n\r\n\t\treturn $this;\r\n\t}", "public function asNumber(): int\n {\n return $this->value;\n }", "public function getNumeric($key)\n {\n\n // if theres no i18n fetch the default\n $i18n = $this->getI18n();\n\n if (isset($this->data[$key]))\n return $i18n->number($this->data[$key], 2);\n else\n return null;\n\n }", "public function getNumero();", "public function getNumero();", "public function getNumber() : int\n {\n return $this->number;\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function importcccost(){\n// dd();\n $data = Excel::load('../couriers/clubcourierprices.xlsx', function($reader) {\n })->get();\n if(!empty($data) && $data->count()){\n foreach ($data as $key => $value) {\n if(!empty($value->from)){\n\n $fromId = 0;\n $toId = 0;\n $existingRegion = $this->checkCCregionexist($value->from);\n if(count($existingRegion)>0){\n $fromId = $existingRegion[0]->id;\n }else{\n $fromId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->from]\n );\n }\n $existingRegion = $this->checkCCregionexist($value->to);\n if(count($existingRegion)>0){\n $toId = $existingRegion[0]->id;\n }else{\n $toId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->to]\n );\n }\n $CostInsertId = DB::table($this->DBTables['CCCost'])->insertGetId(\n ['from_region_id' => $fromId, 'to_region_id'=>$toId, 'small_bag_cost'=>$value->small_bag_rrp,'standard_bag_cost'=>$value->standard_bag_rrp,'large_bag_cost'=>$value->large_bag_rrp,'transit_days'=>$value->transit_time_days]\n );\n }\n }\n }\n }", "public function getNum()\n {\n return $this->get(self::_NUM);\n }", "public function importArray($data);", "private function import_pegawai($sheet)\n\t{\n\t\tforeach ($sheet as $idx => $data) {\n\t\t\t//skip index 1 karena title excel\n\t\t\tif ($idx == 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($data['B'] == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$nip = $data['B'];\n\t\t\t$nama = $data['C'];\n\t\t\t$tempat_lahir = $data['D'];\n\t\t\t$tanggal_lahir = $data['E'];\n\t\t\t$jenis_kelamin = $data['F'];\n\t\t\t$gol = $data['G'];\n\t\t\t$tmt_gol = $data['H'];\n\t\t\t$eselon = $data['I'];\n\t\t\t$jabatan = $data['J'];\n\t\t\t$tmt_jabatan = $data['K'];\n\t\t\t$agama = $data['L'];\n\t\t\t$sub = $data['M'];\n\t\t\t$bagian = $data['N'];\n\t\t\t$unit = $data['O'];\n\n\t\t\t// insert data\n\t\t\t$this->pegawaiModel->insert([\n\t\t\t\t'nip' => $nip,\n\t\t\t\t'name' => $nama,\n\t\t\t\t'tempat_lahir' => strtoupper($tempat_lahir),\n\t\t\t\t'tanggal_lahir' => date_format(date_create($tanggal_lahir), \"Y-m-d\"),\n\t\t\t\t'jenis_kelamin' => $jenis_kelamin,\n\t\t\t\t'gol' => $gol,\n\t\t\t\t'tmt_gol' => date_format(date_create($tmt_gol), \"Y-m-d\"),\n\t\t\t\t'eselon' => $eselon,\n\t\t\t\t'jabatan' => $jabatan,\n\t\t\t\t'tmt_jab' => date_format(date_create($tmt_jabatan), \"Y-m-d\"),\n\t\t\t\t'agama' => $agama,\n\t\t\t\t'sub_bagian' => $sub,\n\t\t\t\t'bagian' => $bagian,\n\t\t\t\t'unit' => $unit,\n\t\t\t]);\n\t\t}\n\n\t\treturn true;\n\t}", "public function parseNumber($value)\n\t{\n\t\treturn $value;\n\t}", "public function metaImport($data);", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function getNumberFromUserInput() {\n }", "public function setNumber($number)\n {\n return $this->setData(self::NUMBER, $number);\n }", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "public function setNumber($number) {\n $this->_number = $number;\n }", "public function getNUMERO_INT()\r\n {\r\n return $this->NUMERO_INT;\r\n }", "public function importexcel(Request $request)\n {\n $this->validate($request, array(\n 'file' => 'required'\n ));\n $result = 1;\n if ($request->hasFile('file')) {\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n\n $path = $request->file->getRealPath();\n $data = Excel::load($path, function ($reader) {\n })->get();\n if (!empty($data) && $data->count()) {\n foreach ($data as $key => $value) {\n $insert[$key] = [\n 'name' => $value->name,\n 'lat' => $value->lat,\n 'long' => $value->long,\n 'loc' => \\DB::raw(\"GeomFromText('POINT(\" . $value->lat . \" \" . $value->long . \")')\"),\n 'disabledcount' => $value->disabledcount,\n 'occupied' => $value->occupied,\n 'emptyspaces' => $value->emptyspaces,\n 'empty' => 0,\n 'avaliable' => 1,\n 'user_id' => Auth::user()->id,\n 'cost' => $value->cost,\n 'parkingtype_id' => $value->parkingtype_id,\n 'reportedcount' => $value->reportedcount,\n 'validity' => 10,\n 'capacity' => $value->capacity,\n 'maximumduration' => $value->maximumduration,\n 'time' => new DateTime(),\n 'source_id' => 7,\n 'comments' => empty($value->comments) ? 'NO' : $value->comments,\n 'opendata' => 0, 'provider_id' => Auth::user()->id];\n $exists = DB::select('SELECT checkIfParkingExists(' . $insert[$key]['lat'] . ',' . $insert[$key]['long'] . ') as checkifexists');\n if (empty($exists[0]->checkifexists)) {\n $insertData = DB::table('places')->insert($insert[$key]);\n } else {\n $insertData = DB::table('places')->where('id', $exists[0]->checkifexists)->update($insert[$key]);\n }\n if ($insertData) {\n $result = $result && 1;\n } else {\n $result = $result && 0;\n }\n }\n if ($result) {\n Session::flash('success', 'Your Data has successfully imported');\n } else {\n Session::flash('error', 'Error inserting the data..');\n return back()->withErrors('Error inserting the data..');\n }\n }\n }\n return back();\n } else {\n Session::flash('error', 'File ' . ' file.!! Please upload a valid xls/csv file..!!');\n return back()->withErrors('File ' . ' file.!! Please upload a valid xls/csv file..!!');;\n }\n }", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "public function num() {\n return $this->num;\n }", "public function testNumberFields()\n {\n $field = $this->table->getField('numberone');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberone', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-2147483648, $field->getMin());\n $this->assertEquals(2147483647, $field->getMax());\n\n $field = $this->table->getField('numbertwo');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numbertwo', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-9999.9999, $field->getMin());\n $this->assertEquals(9999.9999, $field->getMax());\n\n $field = $this->table->getField('numberthree');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberthree', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-9223372036854775808, $field->getMin());\n $this->assertEquals(9223372036854775807, $field->getMax());\n\n $field = $this->table->getField('numberfour');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('numberfour', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n $this->assertEquals(-32768, $field->getMin());\n $this->assertEquals(32767, $field->getMax());\n\n $field = $this->table->getField('numberfive'); // Double precision field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numberfive', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('numbersix'); // Money field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numbersix', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('numberseven'); // real field\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Numeric',\n $field);\n $this->assertEquals('numberseven', $field->getName());\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n }", "public function readExcel($file){\n\t$objPHPExcel = PHPExcel_IOFactory::load($file);\n $cell_collection = $objPHPExcel->getActiveSheet()->getCellCollection();\n foreach ($cell_collection as $cell) {\n $column = $objPHPExcel->getActiveSheet()->getCell($cell)->getColumn();\n //$colNumber = PHPExcel_Cell::columnIndexFromString($colString);\n $row = $objPHPExcel->getActiveSheet()->getCell($cell)->getRow();\n $data_value = $objPHPExcel->getActiveSheet()->getCell($cell)->getValue();\n $arr_data[$row][$this->toNumber($column)-1] = $data_value;\n \t}\n\n return ($arr_data);\n }", "public function setNumber($number)\n {\n $this->_number = $number;\n }", "public function import();", "public function load($data)\n\t{\n\t\tif (!in_array(gettype($data), ['integer', 'array'])) {\n\t\t\tthrow new \\InvalidArgumentException('Invalid argument type: ' . gettype($data));\n\t\t}\n\n\t\tif (is_numeric($data)) {\n\t\t\treturn $this->loadByKey($data);\n\t\t}\n\n\t\t$this->fire('loading');\n\n\t\t$this->setData($data);\n\n\t\t$this->fire('loaded');\n\n\t\treturn $this;\n\t}", "public function setNumber($var)\n {\n GPBUtil::checkString($var, True);\n $this->number = $var;\n\n return $this;\n }", "public function getNum()\n {\n return $this->num;\n }", "public function getNum()\n {\n return $this->num;\n }" ]
[ "0.5837573", "0.53284067", "0.52543306", "0.5202485", "0.5182147", "0.51563007", "0.5153926", "0.5122473", "0.5105191", "0.5067507", "0.5045524", "0.50338566", "0.5031159", "0.5026738", "0.50197023", "0.50055516", "0.4991452", "0.49911588", "0.49648672", "0.4929456", "0.49221638", "0.48724565", "0.48137578", "0.47739545", "0.4753525", "0.47328532", "0.47281843", "0.47176793", "0.47093266", "0.4701018", "0.4699906", "0.4696207", "0.46803695", "0.46554035", "0.4645264", "0.464252", "0.46369752", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46368575", "0.46318588", "0.46248356", "0.46154416", "0.4604313", "0.46014333", "0.4594936", "0.45922953", "0.4591649", "0.4591487", "0.4588152", "0.45860866", "0.45852983", "0.4572043", "0.45647424", "0.4559797", "0.45584875", "0.45574608", "0.45507133", "0.45507133", "0.45451844", "0.4543013", "0.45394665", "0.4536862", "0.4536862", "0.4523284", "0.45213076", "0.4516146", "0.451443", "0.44942927", "0.44910756", "0.448154", "0.44796857", "0.44620875", "0.44617411", "0.44530177", "0.44512326", "0.44470048", "0.443947", "0.44317788", "0.44278786", "0.4426623", "0.4426623", "0.44196472", "0.44124883", "0.44065157", "0.44038507", "0.4398779", "0.43981194", "0.43946248", "0.4391912", "0.4391912" ]
0.5444547
1
Method for importing a radiobutton data cell.
protected function process_data_radiobutton(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function process_header_radiobutton(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n return $result;\r\n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_siswa' => '',\n 'nis'=>$row['A'],\n 'nisn'=>$row['B'],\n 'nama_siswa'=>$row['C'],\n 'j_kelamin'=>$row['D'],\n 'temp_lahir'=>$row['E'],\n 'tgl_lahir'=>$row['F'],\n 'kd_agama'=>$row['G'],\n 'status_keluarga'=>$row['H'],\n 'anak_ke'=>$row['I'],\n 'alamat'=>$row['J'],\n 'telp'=>$row['K'],\n 'asal_sekolah'=>$row['L'],\n 'kelas_diterima'=>$row['M'],\n 'tgl_diterima'=>$row['N'],\n 'nama_ayah'=>$row['O'],\n 'nama_ibu'=>$row['P'],\n 'alamat_orangtua'=>$row['Q'],\n 'tlp_ortu'=>$row['R'],\n 'pekerjaan_ayah'=>$row['S'],\n 'pekerjaan_ibu'=>$row['T'],\n 'nama_wali'=>$row['U'],\n 'alamat_wali'=>$row['V'],\n 'telp_wali'=>$row['W'],\n 'pekerjaan_wali'=>$row['X'],\n 'id_kelas' =>$row['Y']\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_siswa->insert_multiple($data);\n \n redirect(\"siswa\");\n }", "protected static function radio()\n {\n }", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "function import_data()\n {\n $config = array(\n 'upload_path' => FCPATH . 'uploads/subjectoptions',\n 'allowed_types' => 'xls|csv'\n );\n $this->load->library('upload', $config);\n if ($this->upload->do_upload('file')) {\n $data = $this->upload->data();\n @chmod($data['full_path'], 0777);\n\n $this->load->library('Spreadsheet_Excel_Reader');\n $this->spreadsheet_excel_reader->setOutputEncoding('CP1251');\n\n $this->spreadsheet_excel_reader->read($data['full_path']);\n $sheets = $this->spreadsheet_excel_reader->sheets[0];\n error_reporting(0);\n\n $data_excel = array();\n for ($i = 2; $i <= $sheets['numRows']; $i++) {\n if ($sheets['cells'][$i][1] == '') break;\n\n $data_excel[$i - 1]['student'] = $sheets['cells'][$i][1];\n $data_excel[$i - 1]['student_id'] = $sheets['cells'][$i][2];\n $data_excel[$i - 1]['theclass'] = $sheets['cells'][$i][3];\n $data_excel[$i - 1]['stream'] = $sheets['cells'][$i][4];\n $data_excel[$i - 1]['subject'] = $sheets['cells'][$i][5];\n $data_excel[$i - 1]['theyear'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['subjectcode'] = $sheets['cells'][$i][6];\n // $data_excel[$i - 1]['mark1'] = $sheets['cells'][$i][7];\n // $data_excel[$i - 1]['comment'] = $sheets['cells'][$i][8];\n // $data_excel[$i - 1]['term'] = $sheets['cells'][$i][10];\n }\n\n /* $params = $this->security->xss_clean($params);\n $student_id = $this->Student_model->add_student($params);\n if($student_id){\n $this->session->set_flashdata('msg', 'Student is Registered Successfully!');\n redirect('student/index');*/\n\n $this->db->insert_batch('subject_options', $data_excel);\n $this->session->set_flashdata('msg', 'Student Subject Options Registered Successfully!');\n // @unlink($data['full_path']);\n //redirect('excel_import');\n redirect('subjectoptions/index');\n }\n }", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }", "public function load_import_quiz() {\n\t\tif ( ! Forminator::is_import_export_feature_enabled() ) {\n\t\t\twp_send_json_success( '' );\n\t\t}\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_import_quiz\" );\n\n\t\t$html = forminator_template( 'quiz/popup/import' );\n\n\t\twp_send_json_success( $html );\n\t}", "public function insert_entry() //データ挿入コード\n {\n\n // $this->number = $this->input->post('radio'); \n $this->number = $this->input->post('radio01');\n // $this->number = $this->input->post('two');\n // $this->number = $this->input->post('three');\n // $this->number = $this->input->post('number');\n $this->name = $this->input->post('name');\n $this->pass = $this->input->post('pass');\n $this->db->insert('radio_test', $this);\n\t}", "public static function renderRadio();", "public function radiobuttonClicked($sender,$param)/*\n Module: radiobuttonClicked\n Parameters:\n * $sender -- Page that sent request\n * $param -- Tcontrol that sent request\n Author Name(s): Nate Priddy\n Date Created: 12/7/2010\n Purpose: Not in use!\n * Meant to be used when radio buttons rather than select button is\n * used to make adjusstments to lists\n */{\n $item = $param->Item;\n // obtains the primary key corresponding to the datagrid item\n $RL_ID = $this->RecipeUserListGrid->DataKeys[$item->ItemIndex];\n $this->SetSelectedID($RL_ID);\n $this->UserListRebind($this->User->getUserId());\n $this->ListRebind($RL_ID);\n }", "public function importInterface(){\n return view('/drugAdministration/drugs/importExcelDrugs');\n }", "public function importSub($model, $relate = FALSE);", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "function bit_admin_import_csv( $playid ) {\n}", "private function reedImportFile()\n {\n $reader = IOFactory::createReader('Xlsx');\n\n $reader->setReadDataOnly(true);\n\n $spreadsheet = $reader->load($this->getFullPathToUploadFile());\n\n $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true);\n\n $this->resultReedImportFile = $sheetData;\n }", "public function importExcel($path);", "public function importFrom(array $data);", "function setTypeAsRadioButtons($itemList) {\n\t\t$this->type = \"radio\";\n\t\t$this->seleu_itemlist = $itemList;\n\t}", "public function acfedu_import_raw_data() {\n\t\t\t\tif ( isset( $_POST[\"import_raw_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_raw_nonce\"], 'import-raw-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['verify'] ) ) {\n\t\t\t\t\t\t\t$verify_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verify_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_csv_valid', esc_html__( 'Congratulations, your CSV data seems valid.', 'acf-faculty-selector' ) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( isset( $_POST['import'] ) ) {\n\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $_POST['raw_csv_import'] );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_faculty_imported', sprintf( _n( 'Congratulations, you imported %d faculty.', 'Congratulations, you imported %d faculty.', $line_number, 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_raw' );\n\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "function import(array $data);", "public static function convert_radio_field() {\n\n\t\t// Create a new Radio field.\n\t\tself::$field = new GF_Field_Radio();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array();\n\n\t\t// Loop through field options.\n\t\tforeach ( self::$nf_field['list']['options'] as $option ) {\n\n\t\t\t// Add option choice.\n\t\t\tself::$field->choices[] = array(\n\t\t\t\t'text' => $option['label'],\n\t\t\t\t'value' => $option['value'],\n\t\t\t);\n\n\t\t\t// If option is selected, set as default value.\n\t\t\tif ( '1' === $option['selected'] ) {\n\t\t\t\tself::$field->defaultValue = ! empty( $option['value'] ) ? $option['value'] : $option['text'];\n\t\t\t}\n\n\t\t}\n\n\t}", "public function import( $quiz_id ) {\n\n\t\tif ( empty( $this->_import_path ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_quiz_id = (int) $quiz_id;\n\t\t$start_question = current( $this->_stack );//this should be the start question\n\n\t\t$id = $this->_save_question( $start_question );\n\n\t\treturn is_int( $id );\n\t}", "public function getQuestionFromImportData($data) {\n return parent::getQuestionFromImportData($data);\n }", "protected function loadRow() {}", "private function import_pegawai($sheet)\n\t{\n\t\tforeach ($sheet as $idx => $data) {\n\t\t\t//skip index 1 karena title excel\n\t\t\tif ($idx == 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($data['B'] == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$nip = $data['B'];\n\t\t\t$nama = $data['C'];\n\t\t\t$tempat_lahir = $data['D'];\n\t\t\t$tanggal_lahir = $data['E'];\n\t\t\t$jenis_kelamin = $data['F'];\n\t\t\t$gol = $data['G'];\n\t\t\t$tmt_gol = $data['H'];\n\t\t\t$eselon = $data['I'];\n\t\t\t$jabatan = $data['J'];\n\t\t\t$tmt_jabatan = $data['K'];\n\t\t\t$agama = $data['L'];\n\t\t\t$sub = $data['M'];\n\t\t\t$bagian = $data['N'];\n\t\t\t$unit = $data['O'];\n\n\t\t\t// insert data\n\t\t\t$this->pegawaiModel->insert([\n\t\t\t\t'nip' => $nip,\n\t\t\t\t'name' => $nama,\n\t\t\t\t'tempat_lahir' => strtoupper($tempat_lahir),\n\t\t\t\t'tanggal_lahir' => date_format(date_create($tanggal_lahir), \"Y-m-d\"),\n\t\t\t\t'jenis_kelamin' => $jenis_kelamin,\n\t\t\t\t'gol' => $gol,\n\t\t\t\t'tmt_gol' => date_format(date_create($tmt_gol), \"Y-m-d\"),\n\t\t\t\t'eselon' => $eselon,\n\t\t\t\t'jabatan' => $jabatan,\n\t\t\t\t'tmt_jab' => date_format(date_create($tmt_jabatan), \"Y-m-d\"),\n\t\t\t\t'agama' => $agama,\n\t\t\t\t'sub_bagian' => $sub,\n\t\t\t\t'bagian' => $bagian,\n\t\t\t\t'unit' => $unit,\n\t\t\t]);\n\t\t}\n\n\t\treturn true;\n\t}", "public static function load(){\n // creation d'un tableau d'objet webRadio à retourner\n $tabWebRadio= array();\n $webRadio= array();\n $filename=\"../webRadio.txt\";\n // ouverture du fichier\n if (file_exists($filename)) { \n $datain = file_get_contents($filename);\n $lines = explode(\"\\n\", $datain);\n \n $count = count($lines);\n \n for ($i = 0; $i < $count; $i++){\n $webRadio = unserialize($lines[$i]);\n if ($webRadio){\n /* @var $webRadio WebRadio */\n \n // construction de l'objet json\n $arr= array(\n \"id\" => $i, // ligne dans le fichier\n \"nom\" => $webRadio->getNom(),\n \"url\" => $webRadio->getUrl(),\n );\n array_push($tabWebRadio, $arr);\n \n }\n \n }\n \n // retour du tableau\n return $tabWebRadio;\n }else{\n //creation du fichier\n $fp = fopen($filename,\"w\"); \n fwrite($fp,\"\"); \n fclose($fp);\n return $tabWebRadio;\n }\n }", "function ShowInRadioBox( $Table, $name_fld, $cols, $val, $position = \"left\", $disabled = NULL, $sort_name = 'move', $asc_desc = 'asc' )\n {\n //$Tbl = new html_table(1);\n\n $row1 = NULL;\n if (empty($name_fld)) $name_fld=$Table;\n\n $tmp_db = DBs::getInstance();\n $q = \"SELECT * FROM `\".$Table.\"` WHERE 1 LIMIT 1\";\n $res = $tmp_db->db_Query($q);\n //echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res ) return false;\n if ( !$tmp_db->result ) return false;\n $fields_col = mysql_num_fields($tmp_db->result);\n\n if ($fields_col>4) $q = \"select * from `\".$Table.\"` where lang_id='\"._LANG_ID.\"' order by `$sort_name` $asc_desc\";\n else $q = \"select * from `\".$Table.\"` where lang_id='\"._LANG_ID.\"'\";\n\n $res = $tmp_db->db_Query($q);\n if (!$res) return false;\n $rows = $tmp_db->db_GetNumRows();\n\n $col_check=1;\n //$Tbl->table_header();\n //$Tbl->tr();\n echo '<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" align=\"left\" ><tr>';\n for( $i = 0; $i < $rows; $i++ )\n {\n $row1 = $tmp_db->db_FetchAssoc();\n if ($col_check > $cols) {\n //$Tbl->tr();\n echo '</tr><tr>';\n $col_check=1;\n }\n\n $checked ='>';\n if ($val==$row1['cod']) $checked = \" checked\".$checked;\n\n if ( $position == \"left\" ) $align= 'left';\n else $align= 'right';\n echo \"\\n<td align=\".$align.\" valign='middle' class='checkbox'>\";\n\n if ( $position == \"left\" ) echo \"<input class='checkbox' type='radio' name='\".$name_fld.\"' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked.' '.stripslashes($row1['name']);\n else echo stripslashes($row1['name']).\"<input class='checkbox' type='checkbox' name=\".$name_fld.\" value='\".$row1['cod'].\"' \".$disabled.\" \".$checked;\n echo \"</td>\";\n $col_check++;\n }\n echo '</tr></table>';\n //$Tbl->table_footer();\n }", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function importXLS($params) {\n\n $objectId = isset($params[\"objectId\"]) ? addText($params[\"objectId\"]) : \"0\";\n $educationSystem = isset($params[\"educationSystem\"]) ? addText($params[\"educationSystem\"]) : \"0\";\n $trainingId = isset($params[\"trainingId\"]) ? (int) $params[\"trainingId\"] : \"0\";\n $objectType = isset($params[\"objectType\"]) ? addText($params[\"objectType\"]) : \"\";\n\n //@veasna\n $type = isset($params[\"type\"]) ? addText($params[\"type\"]) : \"\";\n //\n\n $dates = isset($params[\"CREATED_DATE\"]) ? addText($params[\"CREATED_DATE\"]) : \"\";\n\n $xls = new Spreadsheet_Excel_Reader();\n $xls->setUTFEncoder('iconv');\n $xls->setOutputEncoding('UTF-8');\n $xls->read($_FILES[\"xlsfile\"]['tmp_name']);\n\n for ($iCol = 1; $iCol <= $xls->sheets[0]['numCols']; $iCol++) {\n $field = $xls->sheets[0]['cells'][1][$iCol];\n switch ($field) {\n case \"STUDENT_SCHOOL_ID\":\n $Col_STUDENT_SCHOOL_ID = $iCol;\n break;\n case \"FIRSTNAME\":\n $Col_FIRSTNAME = $iCol;\n break;\n case \"LASTNAME\":\n $Col_LASTNAME = $iCol;\n break;\n case \"FIRSTNAME_LATIN\":\n $Col_FIRSTNAME_LATIN = $iCol;\n break;\n case \"LASTNAME_LATIN\":\n $Col_LASTNAME_LATIN = $iCol;\n break;\n case \"GENDER\":\n $Col_GENDER = $iCol;\n break;\n case \"ACADEMIC_TYPE\":\n $Col_ACADEMIC_TYPE = $iCol;\n break;\n case \"DATE_BIRTH\":\n $Col_DATE_BIRTH = $iCol;\n break;\n case \"BIRTH_PLACE\":\n $Col_BIRTH_PLACE = $iCol;\n break;\n case \"EMAIL\":\n $Col_EMAIL = $iCol;\n break;\n case \"PHONE\":\n $Col_PHONE = $iCol;\n break;\n case \"ADDRESS\":\n $Col_ADDRESS = $iCol;\n break;\n case \"COUNTRY\":\n $Col_COUNTRY = $iCol;\n break;\n case \"COUNTRY_PROVINCE\":\n $Col_COUNTRY_PROVINCE = $iCol;\n break;\n case \"TOWN_CITY\":\n $Col_TOWN_CITY = $iCol;\n break;\n case \"POSTCODE_ZIPCODE\":\n $Col_POSTCODE_ZIPCODE = $iCol;\n break;\n }\n }\n\n for ($i = 1; $i <= $xls->sheets[0]['numRows']; $i++) {\n\n //STUDENT_SCHOOL_ID\n $STUDENT_SCHOOL_ID = isset($xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID]) ? $xls->sheets[0]['cells'][$i + 2][$Col_STUDENT_SCHOOL_ID] : \"\";\n //FIRSTNAME\n\n $FIRSTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME] : \"\";\n //LASTNAME\n\n $LASTNAME = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME] : \"\";\n //GENDER\n\n $FIRSTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_FIRSTNAME_LATIN] : \"\";\n //LASTNAME\n\n $LASTNAME_LATIN = isset($xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN]) ? $xls->sheets[0]['cells'][$i + 2][$Col_LASTNAME_LATIN] : \"\";\n //GENDER\n\n $GENDER = isset($xls->sheets[0]['cells'][$i + 2][$Col_GENDER]) ? $xls->sheets[0]['cells'][$i + 2][$Col_GENDER] : \"\";\n //ACADEMIC_TYPE\n\n $ACADEMIC_TYPE = isset($xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ACADEMIC_TYPE] : \"\";\n //DATE_BIRTH\n\n $DATE_BIRTH = isset($xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH]) ? $xls->sheets[0]['cells'][$i + 2][$Col_DATE_BIRTH] : \"\";\n //BIRTH_PLACE\n\n $BIRTH_PLACE = isset($xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_BIRTH_PLACE] : \"\";\n //EMAIL\n\n $EMAIL = isset($xls->sheets[0]['cells'][$i + 2][$Col_EMAIL]) ? $xls->sheets[0]['cells'][$i + 2][$Col_EMAIL] : \"\";\n //PHONE\n\n $PHONE = isset($xls->sheets[0]['cells'][$i + 2][$Col_PHONE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_PHONE] : \"\";\n //ADDRESS\n\n $ADDRESS = isset($xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS]) ? $xls->sheets[0]['cells'][$i + 2][$Col_ADDRESS] : \"\";\n //COUNTRY\n\n $COUNTRY = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY] : \"\";\n //COUNTRY_PROVINCE\n\n $COUNTRY_PROVINCE = isset($xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_COUNTRY_PROVINCE] : \"\";\n //TOWN_CITY\n\n $TOWN_CITY = isset($xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY]) ? $xls->sheets[0]['cells'][$i + 2][$Col_TOWN_CITY] : \"\";\n //POSTCODE_ZIPCODE\n\n $POSTCODE_ZIPCODE = isset($xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE]) ? $xls->sheets[0]['cells'][$i + 2][$Col_POSTCODE_ZIPCODE] : \"\";\n //error_log($STUDENT_SCHOOL_ID.\" ### LASTNAME: \".$LASTNAME.\" FIRSTNAME:\".$FIRSTNAME);\n\n $IMPORT_DATA['ID'] = generateGuid();\n $IMPORT_DATA['CODE'] = createCode();\n $IMPORT_DATA['ACADEMIC_TYPE'] = addText($ACADEMIC_TYPE);\n\n switch (UserAuth::systemLanguage()) {\n case \"VIETNAMESE\":\n $IMPORT_DATA['FIRSTNAME'] = setImportChartset($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = setImportChartset($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n default:\n $IMPORT_DATA['FIRSTNAME'] = addText($FIRSTNAME);\n $IMPORT_DATA['LASTNAME'] = addText($LASTNAME);\n $IMPORT_DATA['FIRSTNAME_LATIN'] = setImportChartset($FIRSTNAME_LATIN);\n $IMPORT_DATA['LASTNAME_LATIN'] = setImportChartset($LASTNAME_LATIN);\n break;\n }\n\n $IMPORT_DATA['GENDER'] = addText($GENDER);\n $IMPORT_DATA['BIRTH_PLACE'] = setImportChartset($BIRTH_PLACE);\n $IMPORT_DATA['EMAIL'] = setImportChartset($EMAIL);\n $IMPORT_DATA['PHONE'] = setImportChartset($PHONE);\n $IMPORT_DATA['ADDRESS'] = setImportChartset($ADDRESS);\n $IMPORT_DATA['COUNTRY'] = setImportChartset($COUNTRY);\n $IMPORT_DATA['COUNTRY_PROVINCE'] = setImportChartset($COUNTRY_PROVINCE);\n $IMPORT_DATA['TOWN_CITY'] = setImportChartset($TOWN_CITY);\n $IMPORT_DATA['POSTCODE_ZIPCODE'] = setImportChartset($POSTCODE_ZIPCODE);\n $IMPORT_DATA['STUDENT_SCHOOL_ID'] = setImportChartset($STUDENT_SCHOOL_ID);\n\n if (isset($DATE_BIRTH)) {\n if ($DATE_BIRTH != \"\") {\n $date = str_replace(\"/\", \".\", $DATE_BIRTH);\n if ($date) {\n $explode = explode(\".\", $date);\n $d = isset($explode[0]) ? trim($explode[0]) : \"00\";\n $m = isset($explode[1]) ? trim($explode[1]) : \"00\";\n $y = isset($explode[2]) ? trim($explode[2]) : \"0000\";\n $IMPORT_DATA['DATE_BIRTH'] = $y . \"-\" . $m . \"-\" . $d;\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n }\n } else {\n $IMPORT_DATA['DATE_BIRTH'] = \"0000-00-00\";\n }\n\n $IMPORT_DATA['EDUCATION_SYSTEM'] = $educationSystem;\n //error_log($objectId);\n if ($objectId)\n $IMPORT_DATA['CAMPUS'] = $objectId;\n\n if ($trainingId)\n $IMPORT_DATA['TRAINING'] = $trainingId;\n //$veansa\n if ($type)\n $IMPORT_DATA['TYPE'] = $type;\n //\n \n if ($objectType)\n $IMPORT_DATA['TARGET'] = $objectType;\n \n if ($dates) {\n $IMPORT_DATA['CREATED_DATE'] = setDatetimeFormat($dates);\n } else {\n $IMPORT_DATA['CREATED_DATE'] = getCurrentDBDateTime();\n }\n\n $IMPORT_DATA['CREATED_BY'] = Zend_Registry::get('USER')->CODE;\n if (isset($STUDENT_SCHOOL_ID) && isset($FIRSTNAME) && isset($LASTNAME)) {\n if ($STUDENT_SCHOOL_ID && $FIRSTNAME && $LASTNAME) {\n if (!$this->checkSchoolcodeInTemp($STUDENT_SCHOOL_ID)) {\n self::dbAccess()->insert('t_student_temp', $IMPORT_DATA);\n }\n }\n }\n }\n }", "private function parse_row_from_excel($php_excel, $row)\r\n {\r\n $xls_line = new ExDataBin();\r\n \r\n $xls_line->set_system($php_excel->getActiveSheet()->getCell(idx_col_system . $row)->getValue());\r\n $xls_line->set_first_level($php_excel->getActiveSheet()->getCell(idx_col_firstlevel . $row)->getValue());\r\n $xls_line->set_second_level($php_excel->getActiveSheet()->getCell(idx_col_secondlevel . $row)->getValue());\r\n $xls_line->set_third_level($php_excel->getActiveSheet()->getCell(idx_col_thirdlevel . $row)->getValue());\r\n $xls_line->set_fourth_level($php_excel->getActiveSheet()->getCell(idx_col_fourthlevel . $row)->getValue());\r\n $xls_line->set_fifth_level($php_excel->getActiveSheet()->getCell(idx_col_fifthlevel . $row)->getValue()); \r\n $xls_line->set_name(htmlspecialchars($php_excel->getActiveSheet()->getCell(idx_col_testcase_name . $row)->getValue()));\r\n $xls_line->set_tc_id($php_excel->getActiveSheet()->getCell(idx_col_tc_id . $row)->getValue());\r\n $xls_line->set_summary(htmlspecialchars($php_excel->getActiveSheet()->getCell(idx_col_testcase_summary . $row)->getValue()));\r\n $xls_line->set_preconditions(htmlspecialchars($php_excel->getActiveSheet()->getCell(idx_col_testcase_preconditions . $row)->getValue()));\r\n $xls_line->set_step_number($php_excel->getActiveSheet()->getCell(idx_col_testcase_stepnum . $row)->getValue());\r\n $xls_line->set_actions(htmlspecialchars($php_excel->getActiveSheet()->getCell(idx_col_testcase_stepaction . $row)->getValue()));\r\n $xls_line->set_expected_results(htmlspecialchars($php_excel->getActiveSheet()->getCell(idx_col_testcase_expectedresults . $row)->getValue()));\r\n $xls_line->set_execution_type($php_excel->getActiveSheet()->getCell(idx_col_testcase_execution_type . $row)->getValue());\r\n $xls_line->set_importance($php_excel->getActiveSheet()->getCell(idx_col_testcase_importance . $row)->getValue());\r\n $xls_line->set_complexity($php_excel->getActiveSheet()->getCell(idx_col_testcase_complexity . $row)->getValue()); \r\n $xls_line->set_execute_time($php_excel->getActiveSheet()->getCell(idx_col_testcase_extimated_exec_duration . $row)->getValue());\r\n $xls_line->set_author($php_excel->getActiveSheet()->getCell(idx_col_testcase_designer . $row)->getValue());\r\n $xls_line->set_creation_ts($php_excel->getActiveSheet()->getCell(idx_col_testcase_creation_ts . $row)->getValue());\r\n $xls_line->set_reviewer($php_excel->getActiveSheet()->getCell(idx_col_testcase_reviewer_id . $row)->getValue());\r\n $xls_line->set_reviewed_status($php_excel->getActiveSheet()->getCell(idx_col_testcase_reviewed_status . $row)->getValue());\r\n $xls_line->set_bpm_id($php_excel->getActiveSheet()->getCell(idx_col_testcase_bpm_id . $row)->getValue());\r\n $xls_line->set_keywords($php_excel->getActiveSheet()->getCell(idx_col_testcase_keywords . $row)->getValue());\r\n \r\n return $xls_line;\r\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function upload()\n {\n $this->load->library('upload');\n $fileName = $_FILES['import']['name'];\n\n $config['upload_path'] = './assets'; //buat folder dengan nama assets di root folder\n $config['file_name'] = $fileName;\n $config['allowed_types'] = 'xls|xlsx|csv';\n $config['max_size'] = 10000;\n $config['overwrite'] = TRUE;\n\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('import')) {\n $this->upload->display_errors();\n }\n $inputFileName = './assets/' . $fileName;\n\n try {\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n $objPHPExcel = $objReader->load($inputFileName);\n } catch (Exception $e) {\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME) . '\": ' . $e->getMessage());\n }\n\n $sheet = $objPHPExcel->getSheet(0);\n $highestRow = $sheet->getHighestRow();\n $startRow = 2;\n $rowData = array();\n if ($highestRow > 1) {\n $highestColumn = $sheet->getHighestColumn();\n $insert = FALSE;\n for ($row = 0; $row < $highestRow - 1; $row++) {\n // Read a row of data into an array\n $tmp = $sheet->rangeToArray('A' . $startRow . ':' . 'N' . $startRow++, NULL, TRUE, FALSE)[0];\n if(substr($tmp[12], 0, 1) != '0'){\n \t$tmp[12] = '0' . $tmp[12];\n }\n $data = array(\n \"nama\" => $tmp[0],\n \"merk\" => $tmp[1],\n \"tipe\" => $tmp[2],\n \"ukuran\" => $tmp[3],\n \"satuan\" => $tmp[4],\n \"hargaPasar\" => $tmp[5],\n \"biayaKirim\" => $tmp[6],\n \"resistensi\" => $tmp[7],\n \"ppn\" => $tmp[8],\n \"hargashsb\" => $tmp[9],\n \"keterangan\" => $tmp[10],\n \"spesifikasi\" => $tmp[11],\n \"kode_kategori\" => $tmp[12],\n \"tahun_anggaran\" => $tmp[13],\n \"createdBy\" => $this->ion_auth->get_user_id(),\n );\n array_push($rowData, $data);\n }\n\n if ($this->barang_m->insert_many($rowData)) {\n $this->message('Berhasil! Data berhasil di upload', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n } else {\n $this->message('Gagal! Data gagal di upload', 'danger');\n }\n redirect(site_url('katalog/add'));\n }", "function import(){\n\n if(isset($_FILES[\"file\"][\"name\"])){\n\n $path = $_FILES[\"file\"][\"tmp_name\"];\n\n //object baru dari php excel\n $object = PHPExcel_IOFactory::load($path);\n\n //perulangan untuk membaca file excel\n foreach($object->getWorksheetIterator() as $worksheet){\n //row tertinggi\n $highestRow = $worksheet->getHighestRow();\n //colom tertinggi\n $highestColumn = $worksheet->getHighestColumn();\n\n //cek apakah jumlah nama dan urutan field sama\n $query = $this->MBenang->getColoumnname();\n\n for($row=3; $row<=$highestRow; $row++){\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 1\n $kd_jenis = $worksheet->getCellByColumnAndRow(0, $row)->getValue();\n //baca data dari excel berdasar matrik kolom dan baris (cell) kolom 2\n $jenis_benang = $worksheet->getCellByColumnAndRow(1, $row)->getValue();\n\n $data[] = array(\n\n 'kd_jenis' => $kd_jenis,\n 'jenis_benang' => $jenis_benang\n\n );\n\n }\n\n }\n\n $this->MBenang->insertBenang($data);\n\n $this->session->set_flashdata('notif','<div class=\"alert alert-info alert alert-dismissible fade in\" role=\"alert\"><button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4> Data dari EXCEL Berhasil ditambahkan </div>');\n\n redirect(base_url('Benang')); \n\n }\n\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function readFromRow( $row );", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public function import(array $data): void;", "public function importInterface_ch_co(){\n return view('/drugAdministration/drugs/importExcel_co_ch');\n }", "private function radioCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['checked'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('radio.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "public function excel_import_product(){\n return view('product.import_product');\n }", "function import($data)\r\n {\r\n\r\n if (!is_array($data))\r\n return false;\r\n\r\n for ($i = 0; $i < count($data); $i++) {\r\n for ($x = 0; $x < count($data[$i]); $x++)\r\n $data[$i][$x] = trim($this->escape($data[$i][$x]));\r\n $new_data[] = '(' . implode(',', $data[$i]) . ')';\r\n }\r\n\r\n $new_data = implode(',', $new_data);\r\n\r\n unset($this->fields[0]);\r\n $fields = implode(',', $this->fields);\r\n\r\n return $this->query(\"INSERT INTO survey ($fields) VALUES $new_data\");\r\n }", "protected function buildRadio($row) {\n\t\tif (!$this->filled) $$row['Default'] = \" checked='checked'\";\n\t\t$vals = explode (',',$row['values']);\n\t\tforeach ($vals as $value) {\n\t\t\tif ($pos = strpos($value,\"=ON\")) {\n\t\t\t\t$value = substr($value,0,$pos);\n\t\t\t\t$$value = \" checked='checked'\";\n\t\t\t}\n\t\t\t$elem .= sprintf(\"<input type='radio' name='%s' value='%s'%s />%s<br />\\n\",$row['Field'],$value,$$value,$value);\n\t\t}\n\t\treturn $elem;\n\t}", "function radio($name='',$value='',$id='',$attrib='',$rows=''){\n\t\t$n = ''; \n\t\t$brekz = 0;\n\t\t$fldname = str_replace(' ', '_', $name);\n\t\t$radio = '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>';\n\t\tif(isset($_SESSION[$fldname])) $n = $_SESSION[$fldname];\n\t\tif(isset($_POST[$fldname])) $n = $_POST[$fldname]; \n\t\tif(empty($rows)){\n\t\t\t$rows = 4;\n\t\t}\n\t\tforeach($value as $radVal){\n\t\t\t$cndtn = ($n == $radVal)? 'checked=\"checked\"' : '';\n\t\t\tif($brekz == $rows) {\n\t\t\t\t$radio .= '</tr><tr>';\n\t\t\t\t$brekz = 0; \n\t\t\t}\n\t\t\t$radio .= '<td><input type=\"radio\" name=\"'.$fldname.'\" value=\"'.$radVal.'\" '.$cndtn.' id=\"'.$id.'\" '.$attrib.'>'.'<span style=\"font-weight:normal; color:#000;\">'.$radVal.'</span></td>'.\"\\n\";\n\t\t\t$brekz++;\n\t\t}\n\t\t$radio .= \"</tr></table>\";\n\t\techo $radio;\n\t}", "public function importAction()\n {\n\n $this->_initAction();\n $this->getLayout()->getBlock('head')->setTitle($this->__('Import / Rewrite Rules / Magento Admin'));\n $this->renderLayout();\n\n }", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "function load_from_source($quiz_filename, $quiz_sheet = \"\") {\n\n if (!file_exists($quiz_filename)) {\n die(\"Source file -$quiz_filename- not found\");\n }\n\n $ext = pathinfo($quiz_filename, PATHINFO_EXTENSION);\n if (strtoupper($ext) == \"CSV\") {\n// is a \n $data_quiz_src = $this->csv_to_array($quiz_filename);\n } elseif (strtoupper($ext) == \"ODS\") {\n\n $data_quiz_src = ods_to_array($quiz_filename, $quiz_sheet);\n } elseif (strtoupper($ext) == \"SQLITE\") {\n $quiz_name = isset($file_data[1]) ? $file_data[1] : \"\";\n // $data_quiz_src = sqlite_to_array($quiz_filename, $quiz_name);\n } else {\n die(\"$quiz_name: Unkown format\");\n }\n\n return $data_quiz_src;\n}", "public static function importStocks($filePath, $importedTab)\n {\n $stocks = [];\n\n $service = app(StockService::class);\n $service->moveToStockHistoryByImportedTab($importedTab);\n\n Excel::load($filePath, function($reader) use($importedTab,$stocks) {\n $reader->skipRows(2);\n $reader->noHeading();\n $reader->toObject();\n $reader->each(function($sheet)use($stocks,$importedTab) {\n if(in_array($sheet->getTitle(),self::$sheetAccepted)){\n $sheet->each(function($row) use($sheet,$importedTab,$stocks) {\n if (!is_null($row[2]) && !is_null($row[3])){\n if($row[1]!=\"STK NO\" && $row[2]!=\"MODEL\" && $row[3]!=\"VERSION\")\n { // Loop through all rows\n $row=[\n 'stk_no'=>trim($row[1]),\n 'model'=>trim($row[2]),\n 'version'=>trim($row[3]),\n 'colour'=>trim($row[4]),\n 'options'=>trim($row[5]),\n 'chassis'=>trim($row[6]),\n 'location'=>trim($row[7]),\n 'order_no'=>trim($row[8]),\n 'cons_date'=>trim($row[9])\n ];\n $row=(object) $row;\n $stock = (new static($row, $sheet->getTitle()))->findCderAndFormatStockArr();\n\n if($stock) {\n $stock['supplier'] = config(\"constants.feeds.{$importedTab}.supplier\");\n $stock['imported_tab'] = $importedTab;\n $stock['created_at'] = (string) Carbon::now();\n $stock['updated_at'] = (string) Carbon::now();\n\n Stock::incrementOrInsert($stock);\n }\n }\n //not found\n }\n });\n }\n });\n });\n }", "function import_data(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\t$action = get_get_var('action');\r\n\techo '<h4>Import Data</h4>';\r\n\r\n\t$mount_point = get_post_var('mount_point');\r\n\t// validate this\r\n\tif ($mount_point != \"\" && $mount_point{0} != '/'){\r\n\t\t$action = \"\";\r\n\t\tonnac_error(\"Invalid mount point specified! Must start with a '/'\");\r\n\t}\r\n\t\r\n\tif ($action == \"\"){\r\n\t\r\n\t\t$option = \"\";\r\n\t\t$result = db_query(\"SELECT url from $cfg[t_content] ORDER BY url\");\r\n\t\t\r\n\t\t// first, assemble three arrays of file information\r\n\t\tif (db_has_rows($result)){\r\n\t\t\r\n\t\t\t$last_dir = '/';\r\n\t\t\r\n\t\t\twhile ($row = db_fetch_row($result)){\r\n\t\t\t\r\n\t\t\t\t// directory names, without trailing /\r\n\t\t\t\t$dirname = dirname($row[0] . 'x');\r\n\t\t\t\tif ($dirname == '\\\\' || $dirname == '/')\r\n\t\t\t\t\t$dirname = '';\r\n\t\t\t\t\r\n\t\t\t\tif ($last_dir != $dirname){\r\n\t\t\t\t\tif ($last_dir != '')\r\n\t\t\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\r\n\t\t\t\t\r\n\t\t\t\t\t$last_dir = $dirname;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($last_dir != '')\r\n\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\t\t\r\n\t\t}\r\n\t\r\n\t\t?>\r\n\t\t\r\n<form name=\"import\" action=\"##pageroot##/?mode=import&action=import\" enctype=\"multipart/form-data\" method=\"post\">\r\n\t<table>\r\n\t\t<tr><td>File to import:</td><td><input name=\"data\" type=\"file\" size=\"40\"/></td></tr>\r\n\t\t<tr><td>*Mount point:</td><td><input name=\"mount_point\" type=\"text\" size=\"40\" value=\"/\" /></td></tr>\r\n\t\t<tr><td><em>==&gt;&gt; Choose a directory</em></td><td><select onchange=\"document.import.mount_point.value = document.import.directory.options[document.import.directory.selectedIndex].value;\" name=\"directory\"><?php echo $option; ?></select></td></tr>\r\n\t</table>\r\n\t<input type=\"submit\" value=\"Import\" /><br/>\r\n\t<em>* Mount point is a value that is prefixed to all file names, including content, banner, and menu data. It is the root directory in which the data is based.</em>\r\n</form>\r\n<?php\r\n\t\r\n\t}else if ($action == \"import\"){\r\n\t\t\r\n\t\t$filename = \"\";\r\n\t\t\r\n\t\t// get the contents of the uploaded file\r\n\t\tif (isset($_FILES['data']) && is_uploaded_file($_FILES['data']['tmp_name'])){\r\n\t\t\t$filename = $_FILES['data']['tmp_name'];\r\n\t\t}\r\n\t\t\r\n\t\t$imported = get_import_data($filename,false);\r\n\t\t\r\n\t\tif ($imported !== false){\r\n\t\t\r\n\t\t\t// check to see if we need to ask the user to approve anything\r\n\t\t\t$user_approved = false;\r\n\t\t\tif (get_post_var('user_approved') == 'yes')\r\n\t\t\t\t$user_approved = true;\r\n\t\t\r\n\t\t\t// take care of SQL transaction up here\r\n\t\t\t$ret = false;\r\n\t\t\tif ($user_approved && !db_begin_transaction())\r\n\t\t\t\treturn onnac_error(\"Could not begin SQL transaction!\");\r\n\t\t\r\n\t\t\t// automatically detect import type, and do it!\r\n\t\t\tif ($imported['dumptype'] == 'content' || $imported['dumptype'] == 'all'){\r\n\t\t\t\t$ret = import_content($imported,$user_approved,false);\r\n\t\t\t}else if ($imported['dumptype'] == 'templates'){\r\n\t\t\t\t$ret = import_templates($imported,$user_approved,false);\r\n\t\t\t}else{\r\n\t\t\t\techo \"Invalid import file!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ret && $user_approved && db_is_valid_result(db_commit_transaction()))\r\n\t\t\t\techo \"All imports successful!\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\techo \"Error importing data!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t}\r\n\t\t\t\r\n\t}else{\r\n\t\theader(\"Location: $cfg[page_root]?mode=import\");\t\r\n\t}\t\r\n\t\r\n\t// footer\r\n\techo \"<p><a href=\\\"##pageroot##/\\\">Return to main administrative menu</a></p>\";\r\n\t\r\n}", "private function row_imported( $row, $action = '' ) {\n\t\t$this->imported_rows[] = $row + 1;\n\t\tif ( $action && is_scalar( $action ) ) {\n\t\t\tif ( ! isset( $this->actions[ $action ] ) ) {\n\t\t\t\t$this->actions[ $action ] = 0;\n\t\t\t}\n\t\t\t$this->actions[ $action ]++;\n\t\t}\n\t}", "function acf_get_radio_input($attrs = array())\n{\n}", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "function helper_import_view_form(&$form_state, $task) {\n drupal_set_title(t('Importing %name', array('%name' => $task['name'])));\n\n $form = array();\n $form['#task'] = $task;\n\n $form['status'] = array(\n '#type' => 'item',\n '#title' => t('Estado'),\n '#value' => $task['status'] == NODE_IMPORT_STATUS_DONE ? t('Completed') : t('In progress'),\n );\n\n if ($task['status'] == NODE_IMPORT_STATUS_DONE) {\n $form['row_done'] = array(\n '#type' => 'item',\n '#title' => t('Rows imported'),\n '#prefix' => '<div id=\"node_import-row_done\">',\n '#suffix' => '</div>',\n '#value' => format_plural($task['row_done'], t('1 row'), t('@count rows')),\n );\n $form['row_error'] = array(\n '#type' => 'item',\n '#title' => t('Rows with errors'),\n '#prefix' => '<div id=\"node_import-row_error\">',\n '#suffix' => '</div>',\n '#value' => format_plural($task['row_error'], t('1 row'), t('@count rows')),\n );\n\n $form['download'] = array(\n '#type' => 'fieldset',\n '#title' => t('Download rows'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#tree' => TRUE,\n );\n $form['download']['what_rows'] = array(\n '#type' => 'radios',\n '#title' => t('Rows to download'),\n '#options' => array(\n 'all' => t('All rows'),\n 'error' => t('Rows with errors'),\n 'done' => t('Rows without errors'),\n ),\n '#default_value' => 'error',\n );\n $form['download']['what_cols'] = array(\n '#type' => 'checkboxes',\n '#title' => t('Extra columns'),\n '#options' => array(\n 'objid' => t('Object identifier'),\n 'errors' => t('Errors'),\n ),\n '#default_value' => array('objid', 'errors'),\n );\n $form['download']['download_button'] = array(\n '#type' => 'submit',\n '#value' => t('Download'),\n '#submit' => array('helper_import_view_form_submit_download'),\n );\n }\n else {\n $form['progress'] = array(\n '#value' => '<div id=\"node_import-progress\">'. t('You need to have Javascript enabled to see the progress of this import.') .'</div>',\n );\n\n drupal_add_js('misc/progress.js', 'core');\n $js_settings = array(\n 'nodeImport' => array(\n 'uri' => url('admin/content/node_import/'. $task['taskid']),\n ),\n );\n drupal_add_js($js_settings, 'setting');\n drupal_add_js(drupal_get_path('module', 'node_import') .'/node_import.js', 'module');\n }\n\n $form['details'] = array_merge(array(\n '#type' => 'fieldset',\n '#title' => t('Task details'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n ), helper_import_task_details($task));\n\n return $form;\n}", "function RadioBox($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "function pendapatan_import_form_submit($form, $form_state) {\r\n\t$uri = db_query(\"SELECT uri FROM {file_managed} WHERE fid = :fid\", array(\r\n\t\t\t\t\t':fid' => $form_state['input']['import']['fid'],\r\n\t\t\t\t\t)\r\n\t\t\t\t)->fetchField();\r\n\t\r\n\t$autojurnal = $form_state['values']['autojurnal'];\r\n\r\n\t$i = 0;\r\n\tif(!empty($uri)) {\r\n\t\tif(file_exists(drupal_realpath($uri))) { \r\n\t\t\t// Open the csv\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$handle = fopen(drupal_realpath($uri), \"r\");\r\n\t\t\t// Go through each row in the csv and run a function on it. In this case we are parsing by '|' (pipe) characters.\r\n\t\t\t// If you want commas are any other character, replace the pipe with it.\r\n\t\t\twhile (($data = fgetcsv($handle, 0, ';', '\"')) !== FALSE) {\r\n\t\t\t\t\r\n\t\t\t\t//drupal_set_message($data[3]);\r\n\t\t\t\t//drupal_set_message(str_replace($data[3], '/', ''));\r\n\t\t\t\t\r\n\t\t\t\t//read data\r\n\t\t\t\t$tanggal = substr($data[7],0,4) . '-' . substr($data[7],4,2) . '-' . substr($data[7],-2);\r\n\t\t\t\t$refno = $data[3];\r\n\t\t\t\t$reftgl = date('Y') . '-' . date('m') . '-' . date('d');;\r\n\t\t\t\t$subtotal = $data[11]; $potongan = 0; $total = $subtotal;\r\n\t\t\t\t$nobukti = $data[8];\r\n\t\t\t\t\r\n\t\t\t\tif (strlen($data[10])==8)\r\n\t\t\t\t\t$kodero = $data[10];\r\n\t\t\t\telse\r\n\t\t\t\t\t$kodero = substr($data[10],0,5) . '0' . substr($data[10], -2);\r\n\t\t\t\t$keterangan = $data[9];\r\n\t\t\t\t\r\n\t\t\t\t$key = $data[3];\r\n\t\t\t\tif ($autojurnal) {\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//drupal_set_message($kodero);\r\n\t\t\t\t\tif (substr($kodero,0,1) == '9') {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//drupal_set_message('a');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//kode 9 -> simpan antrian\r\n\t\t\t\t\t\t$kodero = '90090900';\r\n\t\t\t\t\t\tsave2antrian($key, $tanggal, $refno, $reftgl, $total, $nobukti, $keterangan, $kodero, '0');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//drupal_set_message('j');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//jurnalkan\r\n\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t$transid = str_replace($data[3], '/', '');\r\n\t\t\t\t\t\tsave2jurnal($transid, $tanggal, $i, $refno, $reftgl, $total, $nobukti, $keterangan, $kodero);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//tandai sudah jurnal\r\n\t\t\t\t\t\tsave2antrian($key, $tanggal, $refno, $reftgl, $total, $nobukti, $keterangan, $kodero, '1');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\t\t\t\t\t//end if auto jurnal\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//simpan antrian\r\n\t\t\t\t\tsave2antrian($key, $tanggal, $refno, $reftgl, $total, $nobukti, $keterangan, $kodero, '0');\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$operations[] = array(\r\n\t\t\t\t\t\t\t\t\t'pendapatan_import_batch_processing', // The function to run on each row\r\n\t\t\t\t\t\t\t\t\tarray($data), // The row in the csv\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t}\t//end while read data\r\n \r\n\t\t\t// Once everything is gathered and ready to be processed... well... process it!\r\n\t\t\t$batch = array(\r\n\t\t\t\t'title' => t('Importing data CSV dari Bank...'),\r\n\t\t\t\t'operations' => $operations, // Runs all of the queued processes from the while loop above.\r\n\t\t\t\t'finished' => 'pendapatan_import_finished', // Function to run when the import is successful\r\n\t\t\t\t'error_message' => t('The installation has encountered an error.'),\r\n\t\t\t\t'progress_message' => t('Record ke @current dari @total transaksi.'),\r\n\t\t\t);\r\n\t\t\tbatch_set($batch);\r\n\t\t\t//batch_process('user');\r\n\t\t\tfclose($handle); \r\n\t\t}\t//end exist \r\n\t\r\n\t} else {\t//end empty\r\n\t\t\r\n\t\tdrupal_set_message(t('There was an error uploading your file. Please contact a System administator.'), 'error');\r\n\t}\r\n}", "public function import() {\n\n\t\t$alias = $this->getBaseName();\n\t\tif ( ! $this->isAliasExistsInDB( $alias ) ) {\n\t\t\t/**\n\t\t\t * create slide with default setting if not exist\n\t\t\t */\n\t\t\t$defaultOptions = $this->getDefaultSliderSettings( $alias );\n\n\t\t\tUniteBaseAdminClassRev::requireSettings( 'slider_settings' );\n\t\t\t$settingsMain = UniteBaseAdminClassRev::getSettings( 'slider_main' );\n\t\t\t$settingsParams = UniteBaseAdminClassRev::getSettings( 'slider_params' );\n\n\t\t\t$slideID = $this->createSliderFromOptions( $defaultOptions,$settingsMain,$settingsParams );\n\t\t} else {\n\t\t\t/**\n\t\t\t * init slider by alias if exist\n\t\t\t */\n\t\t\t$this->initByAlias( $alias );\n\t\t\t$slideID = $this->getID();\n\t\t}\n\n\t\tif ( $slideID ) {\n\t\t\treturn $this->importSlideFromFile( $slideID, $this->getImportFilePath() );\n\t\t}\n\t\treturn false;\n\t}", "public function import()\n {\n \n }", "public function createComponentImport() {\n $f = new AppForm($this, 'import');\n\n $f->addFile('import', 'Vyberte soubor k importu')\n ->addRule(Form::FILLED, 'Vyberte prosím soubor k importu')\n ->addRule(Form::MIME_TYPE, 'Importovaný soubor musí být ve formátu XML', 'application/xml,text/xml');\n\n $f->addSubmit('save', 'Importovat')\n ->onClick[] = function(\\Nette\\Forms\\SubmitButton $btn) {\n $f = $btn->getForm();\n $p = $f->lookup('Nette\\Application\\Presenter');\n $v = $f->getValues();\n $subjectsModel = new \\SubjectsModel();\n\n // parse XML\n $xml = \\simplexml_load_file($v['import']->temporaryFile);\n\n $registrations = array();\n\n foreach ($xml->year as $year) {\n foreach ($year->subject as $subject) { \n // either ID or CODE+year has to be set\n if (!empty($subject['id'])) {\n ; // do nothing, it's ok\n } elseif (!empty($subject['code']) && !empty($year['number'])) {\n $subject['id'] = $subjectsModel->lookupId((string)$subject['code'], (string)$year['number']);\n }\n if (empty($subject['id'])) {\n $f->addError('Importovaný soubor obsahuje chybu! Předmět '.$subject['title'].' nemá nastaveno ID ani jej nelze dohledat z kombinace zkratky předmětu a akademického roku.');\n return;\n }\n \n foreach ($subject->student as $student) {\n // login has to be set\n if (empty($student['login'])) {\n $f->addError('Importovaný soubor obsahuje chybu! Student nemá definovaný login.');\n return;\n }\n\n $registrations[] = array('login' => (string)$student['login'], 'id' => (string)$subject['id']);\n }\n }\n }\n\n // get all students\n $usersModel = new \\UsersModel();\n $students = $usersModel->getUsersInRole( \\Nette\\Environment::getConfig('roles')->student );\n\n // check registrations against valid logins\n $warnings = array();\n foreach ($registrations as $r) {\n if (!isset($students[ $r['login'] ]))\n $warning[] = 'Login \\'' . $r['login'] . '\\' není platný studentský login.';\n }\n\n // incremental registration of students for subjects\n $res = $usersModel->registerStudents($registrations);\n \n if (!empty($warnings))\n $p->flashMessage('Dokončeno, při zpracování však nastaly chyby.<br />' . implode('<br />', $warnings), $p::FLASH_ORANGE);\n else\n $p->flashMessage('Import byl úspěšně dokončen. Vytvořeno ' . $res . ' nových registrací', $p::FLASH_GREEN);\n\n $p->redirect('this');\n };\n\n return $f;\n }", "function radio( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_RADIO,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "public function importUsersData(Request $request){\n\t\t\tif (empty($request->file('file')))\n\t {\n\t return back()->with('error','No file selected');\n\t }\n\t else{\n\t\t\t\t// validasi\n\t\t\t\t$this->validate($request, [\n\t\t\t\t\t'file' => 'required|mimes:csv,xls,xlsx'\n\t\t\t\t]);\n\n\t\t\t\t// menangkap file excel\n\t\t\t\t$file = $request->file('file');\n\n\t\t\t\t// membuat nama file unik\n\t\t\t\t$nama_file = rand().$file->getClientOriginalName();\n\n\t\t\t\t// upload ke folder file_siswa di dalam folder public\n\t\t\t\t$file->move(public_path('dataset'), $nama_file);\n\n\t\t\t\tExcel::import(new UsersImport, public_path('/dataset/'.$nama_file));\n\t \n\t\t\t\treturn redirect()->back()->with(['success' => 'Has been uploaded']);\n\t\t\t}\n }", "function UpdateRadioFields(){\n $_tabs = array_keys($this->form_fields);\n foreach ($_tabs as $_tab) {\n $sizeof = sizeof($this->form_fields[$_tab]);\n for ($j = 0; $j < $sizeof; $j ++) {\n if ($this->form_fields[$_tab][$j][\"control\"] == \"checkbox\") {\n $valueOn = $this->form_fields[$_tab][$j][\"checkOn\"];\n $valueOff = $this->form_fields[$_tab][$j][\"checkOff\"];\n $isRadio = $this->form_fields[$_tab][$j][\"is_radio\"];\n if ($isRadio) {\n if ($this->_data[$this->form_fields[$_tab][$j][\"field_name\"]] == $valueOn) {\n $this->Storage->GroupUpdate($this->custom_var, array(\n $this->custom_val), array(\n $this->form_fields[$_tab][$j][\"field_name\"] => $valueOff));\n }\n }\n }\n }\n } // foreach\n }", "public function loadDataFromRow(array $data)\r\n\t{\r\n\t\t// Heredo de parent\r\n\t\tparent::loadDataFromRow($data);\r\n\r\n\t\t// Extiendo su funcionalidad\r\n\t\t$this->setInterest($this->fkinterest);\r\n\t}", "public function testLoadXlsxConditionalFormattingDataBar(): void\n {\n $filename = 'tests/data/Reader/XLSX/conditionalFormattingDataBarTest.xlsx';\n $reader = IOFactory::createReader('Xlsx');\n $spreadsheet = $reader->load($filename);\n $worksheet = $spreadsheet->getActiveSheet();\n\n $this->pattern1Assertion($worksheet);\n $this->pattern2Assertion($worksheet);\n $this->pattern3Assertion($worksheet);\n $this->pattern4Assertion($worksheet);\n }", "public function testReloadXlsxConditionalFormattingDataBar(): void\n {\n $filename = 'tests/data/Reader/XLSX/conditionalFormattingDataBarTest.xlsx';\n $outfile = File::temporaryFilename();\n $reader = IOFactory::createReader('Xlsx');\n $spreadshee1 = $reader->load($filename);\n $writer = IOFactory::createWriter($spreadshee1, 'Xlsx');\n $writer->save($outfile);\n $spreadsheet = $reader->load($outfile);\n unlink($outfile);\n $worksheet = $spreadsheet->getActiveSheet();\n\n $this->pattern1Assertion($worksheet);\n $this->pattern2Assertion($worksheet);\n $this->pattern3Assertion($worksheet);\n $this->pattern4Assertion($worksheet);\n }", "function import_xls($filename = ''){\n\t\trequire_once('includes/xls_report/PHPExcel.php');\n\t\t$xls_file = 'uploads/DataBkd/DocUpload/'.$filename;\n\n\t\t$objReader = new PHPExcel_Reader_Excel5();\n\t\t$objReader->setReadDataOnly(true);\n\t\t$objPHPExcel = $objReader->load($xls_file); #return $filename;\n\t\t$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,false);\n\t\t$totalrow = count($sheetData); #return $sheetData;\n\t\t\n\t\t$kd_prodi = $sheetData[0][1];\n\t\t# get active record\n\t\t$start_record = 9;\n\t\t$start_col = 2;\n\t\twhile ($start_record < $totalrow){\n\t\t\t$a = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nira\n\t\t\t$b = str_replace(\"'\",\"\\'\",$sheetData[$start_record][$start_col]); $start_col++; #nm_asesor\n\t\t\t$c = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; #nm_pt\n\t\t\t$d = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++; \n\t\t\t$e = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t$f = $this->security->xss_clean($sheetData[$start_record][$start_col]); $start_col++;\n\t\t\t# simpan ke database \n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/insert_asesor';\n\t\t\t$parameter = array('api_search' => array($a, $b, $c, $d, $e, $f, $kd_prodi));\n\t\t\t$this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\n\t\t\t$start_record++;\n\t\t\t$start_col = 2;\n\t\t}\n\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_nama_prodi';\n\t\t$parameter = array('api_search' => array($kd_prodi));\n\t\t$nm = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\n\t\t$data['status'] = '<div class=\"alert alert-success\"><i class=\"icon icon-ok-sign\"></i> Import Data Asesor untuk program studi '.$nm.' selesai...\n\t\t\t\t\t\t\t<br/>Lihat Daftar Asesor Prodi'.$nm.' <a href=\"'.base_url().'bkd/admbkd/asesor/prodi/'.$kd_prodi.'\">Klik disini</a></div>';\n\t\t$this->output99=$this->s00_lib_output;\n\t\t$this->output99->output_display('admbkd/form_import',$data);\n\t}", "public function metaImport($data);", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function import(): void;", "public function import()\n {\n //then by the element set name\n if(!$this->record) {\n $this->record = $this->db->getTable('ElementSet')->findByName($this->responseData['name']);\n }\n\n if(!$this->record) {\n $this->record = new ElementSet;\n }\n //set new value if element set exists and override is set, or if it is brand new\n if( ($this->record->exists() && get_option('omeka_api_import_override_element_set_data')) || !$this->record->exists()) {\n $this->record->description = $this->responseData['description'];\n $this->record->name = $this->responseData['name'];\n $this->record->record_type = $this->responseData['record_type'];\n }\n\n try {\n $this->record->save(true);\n $this->addOmekaApiImportRecordIdMap();\n } catch(Exception $e) {\n _log($e);\n }\n }", "public function importAction()\n {\n $logger = OntoWiki::getInstance()->logger;\n $logger->debug('importAction');\n\n //initialisation of view parameter\n $this->view->placeholder('main.window.title')->set('Select mapping parameter'); \n $this->view->formEncoding = 'multipart/form-data';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formMethod = 'post';\n $this->view->formName = 'selection';\n $this->view->filename\t\t = htmlspecialchars($_SESSION['fname']);\n $this->view->restype \t\t = '';\n $this->view->baseuri\t\t = '';\n $this->view->header\t\t \t = '';\n $this->view->flinecount\t\t = htmlspecialchars($_SESSION['flinecount']);\n $this->view->fline\t\t\t = htmlspecialchars($_SESSION['fline']);\n $this->view->line\t\t \t = explode(';',$this->view->fline);\n\n //toolbar for import of data\n $toolbar = $this->_owApp->toolbar;\n $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Submit', 'id' => 'selection'))\n ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel', 'id' => 'selection'));\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n \n //handling of request\n if ($this->_request->isPost()) {\n $postData = $this->_request->getPost();\n \n if (!empty($postData)) { \n \n $baseuri = $postData['b_uri'];\n $this->view->baseuri = $baseuri;\n $restype = $postData['r_type'];\n $this->view->restype = $restype;\n $header = $postData['rad'];\n $this->view->header = $header;\n \n if (trim($restype) == '') {\n $message = 'Ressource type must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if ((trim($baseuri) == '')||(trim($baseuri) == 'http://')) {\n $message = 'Base Uri must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if (trim($header) == '') {\n \t$message = 'You must select whether you have a header!';\n \t$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n \n //create mapping\n if (\t (trim($restype) != '') \n \t\t&& ((trim($baseuri) != '') || (trim($baseuri) != 'http://'))\n \t\t&& (trim($header) != ''))\n {\n \t$paramArray = array('firstline' => $this->view->line,\n \t\t\t\t\t\t'header' \t=> $header,\n \t\t\t\t\t\t'baseuri'\t=> $baseuri,\n \t\t\t\t\t\t'restype' \t=> $restype,\n \t\t\t\t\t\t'filename' \t=> $this->view->filename\n \t);\n \t\n \t$maippng = $this->_createMapping($paramArray);\n \t$maprpl = str_replace('\"', \"'\", $maippng);\n \t//save mapping into file\n \t$mapfile = tempnam(sys_get_temp_dir(), 'ow');\n \t\n \t$fp = fopen($mapfile,\"wb\");\n \tfwrite($fp,$maprpl);\n \tfclose($fp);\n \t\n \t$ttl = array();\n \t\n \t//call convert for ttl\n \t$ttl = $this->_convert($mapfile, $this->view->filename);\n \t\n \t//save ttl data into file\n \t$ttlfile = tempnam(sys_get_temp_dir(), 'ow');\n \t$temp = fopen($ttlfile, 'wb');\n \tforeach ($ttl as $line) {\n \t\tfwrite($temp, $line . PHP_EOL);\n \t\t}\n \tfclose($temp);\n \t$filetype = 'ttl';\n \t\n \t$locator = Erfurt_Syntax_RdfParser::LOCATOR_FILE;\n \t\n \t// import call\n \t\n \ttry {\n \t\t$this->_import($ttlfile, $filetype, $locator);\n \t\t} catch (Exception $e) {\n \t\t\t$message = $e->getMessage();\n \t\t\t$this->_owApp->appendErrorMessage($message);\n \t\t\treturn;\n \t\t\t}\n \t\t}\n \t\t\n //after success redirect to index site \n $this->_redirect('');\n }\n }\n }", "protected function row_to_module_form_data($data) {\n\t\tif ( empty($data) ) {\n\t\t\treturn $data;\n\t\t}\n\n $data['global_perm'] = Permission::to_binary($data['global_perm']);\n\n //TODO: convert module permissions to field format\n\t\t\n\t\treturn $data;\n\t}", "public function _afterSave()\n {\n Mage::getResourceModel('bpost_shm/tablerates_international')->uploadAndImport($this);\n }", "public function iCheckTheRadioButton($radio_label)\n {\n $radio_button = $this->getSession()->getPage()->findField($radio_label);\n if (null === $radio_button) {\n throw new ElementNotFoundException(\n $this->getSession(), 'form field', 'id|name|label|value', $radio_label\n );\n }\n $value = $radio_button->getAttribute('value');\n $this->fillField($radio_label, $value);\n }", "public function import(ExamQuestionImportRequest $request, $name)\n {\n $exam = Exam::where('name', $name)->firstOrFail(['id']);\n\n $sheet = Excel::load($request->file('file')->getRealPath())->get();\n\n $result = [];\n\n $sheet->each(function (CellCollection $item, $key) use ($exam, &$result) {\n $result[] = $this->saveQuestion($exam, $item);\n });\n\n return $result;\n }", "abstract public function import(): bool;", "function add_stream2()\n {\n //$this->load->view('import_data');\n if (isset($_POST[\"submit\"])) {\n $file = $_FILES['file']['tmp_name'];\n $handle = fopen($file, \"r\");\n $c = 0; //\n while (($filesop = fgetcsv($handle, 1000, \",\")) !== false) {\n $names = $filesop[0];\n $class = $filesop[1];\n $stream = $filesop[3];\n $year = $filesop[4];\n if ($c <> 0) { //SKIP THE FIRST ROW\n $this->Excel_import_model->saverecords($names, $class, $stream, $year);\n }\n $c = $c + 1;\n }\n echo \"Stream imported sucessfully\";\n }\n }", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\tif($excel['cells'][1][1] == 'Material Doc. No' && $excel['cells'][1][2] == 'Material No.') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t \t$item_group_code='all';\n\t\t\t\t\t$material_no = $excel['cells'][$i][2];\n\t\t\t\t\t$quantity = $excel['cells'][$i][3];\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif($excel['cells'][$i][1] != $excel['cells'][$x][1]) {\n\n $j++;\n\n\t\t\t\t\t \t$object['tpaket_headers'][$j]['posting_date'] = date(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['plant'] = $this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_tpaket_plant'] = $this->m_tpaket->id_tpaket_plant_new_select($object['tpaket_headers'][$j]['plant']);\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['status'] = '1';\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['item_group_code'] = $item_group_code;\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t\t\t$object['tpaket_headers'][$j]['filename'] = $upload['file_name'];\n\n\t\t\t\t\t\t$id_tpaket_header = $this->m_tpaket->tpaket_header_insert($object['tpaket_headers'][$j]);\n\n \t$tpaket_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t\t}\n\n\t\t\t\tif($tpaket_header_exist) {\n\n\t\t\t\t\tif($tpaket_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['tpaket_details'][$j][$k]['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t $object['tpaket_details'][$j][$k]['id_tpaket_h_detail'] = $k;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['material_desc'] = $tpaket_detail_temp['MAKTX'];\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['quantity'] = $quantity;\n if ($tpaket_detail_temp['UNIT']=='L')\n $tpaket_detail_temp['UNIT'] = 'ML';\n if ($tpaket_detail_temp['UNIT']=='KG')\n $tpaket_detail_temp['UNIT'] = 'G';\n\t\t\t\t\t\t\t$object['tpaket_details'][$j][$k]['uom'] = $tpaket_detail_temp['UNIT'];\n\n//\t\t\t\t\t\t$id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k]);\n \t\t\t\t if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($object['tpaket_details'][$j][$k])) {\n\n if(($quantity > 0)&&($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($material_no))) {\n if($item_pakets !== FALSE) {\n \t\t$l = 1;\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$l] = $value;\n \t\t\t}\n \t\t\t$l++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }\n \t $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\t for($m = 1; $m <= $c_item_paket; $m++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $m;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_detail_paket['material_no_paket'] = $material_no;\n $tpaket_detail_paket['material_no'] = $item_paket['material_no'][$m];\n $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$m];\n $tpaket_detail_paket['quantity'] = ($item_paket['quantity'][$m]/$item_paket['quantity_paket'][$m])*$quantity;\n $tpaket_detail_paket['uom'] = $item_paket['uom'][$m];\n \t\t\t\t\t $this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket);\n }\n }\n \t\t\t\t }\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Transaksi Paket berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['tpaket_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Paket atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'tpaket/browse_result/0/0/0/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '011';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function import();", "public function import($label = null, $options = ['preview' => 'list', 'source' => InputOption::VALUE_REQUIRED, 'partial' => false])\n {\n }", "private function createImportButton() {\n\t\t$moduleUrl = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $this->id));\n\t\t$this->template->setMarker('module_url', htmlspecialchars($moduleUrl));\n\t\t$this->template->setMarker(\n\t\t\t'label_start_import',\n\t\t\t$GLOBALS['LANG']->getLL('start_import_button')\n\t\t);\n\t\t$this->template->setMarker('tab_number', self::IMPORT_TAB);\n\t\t$this->template->setMarker(\n\t\t\t'label_import_in_progress',\n\t\t\t$GLOBALS['LANG']->getLL('label_import_in_progress')\n\t\t);\n\n\t\treturn $this->template->getSubpart('IMPORT_BUTTON');\n\t}", "public function getControlType()\n {\n return 'radio';\n }", "public function upload_category_excel() {\n $data = array();\n $this->form_validation->set_rules('fileURL', 'Upload File', 'callback_checkFileValidation');\n if ($this->form_validation->run() == false) {\n \n } else {\n if (!empty($_FILES['fileURL']['name'])) {\n $extension = pathinfo($_FILES['fileURL']['name'], PATHINFO_EXTENSION);\n\n if ($extension == 'csv') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();\n } elseif ($extension == 'xlsx') {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();\n } else {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xls();\n }\n\n $spreadsheet = $reader->load($_FILES['fileURL']['tmp_name']);\n $allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);\n\n $arrayCount = count($allDataInSheet);\n $flag = 0;\n $createArray = array('ar_name', 'en_name', 'discount');\n $makeArray = array('ar_name' => 'ar_name', 'en_name' => 'en_name', 'discount' => 'discount');\n\n $SheetDataKey = array();\n $mydata = array();\n foreach ($allDataInSheet as $dataInSheet) {\n foreach ($dataInSheet as $key => $value) {\n if (in_array(trim($value), $createArray)) {\n $value = preg_replace('/\\s+/', '', $value);\n $SheetDataKey[trim($value)] = $key;\n }\n }\n }\n $dataDiff = array_diff_key($makeArray, $SheetDataKey);\n if (empty($dataDiff)) {\n $flag = 1;\n }\n if ($flag == 1) {\n for ($i = 2; $i <= $arrayCount; $i++) {\n $ar_name = $SheetDataKey['ar_name'];\n $en_name = $SheetDataKey['en_name'];\n $discount = $SheetDataKey['discount'];\n\n $ar_name = filter_var(trim($allDataInSheet[$i][$ar_name]), FILTER_SANITIZE_STRING);\n $en_name = filter_var(trim($allDataInSheet[$i][$en_name]), FILTER_SANITIZE_STRING);\n $discount = filter_var(trim($allDataInSheet[$i][$discount]), FILTER_SANITIZE_STRING);\n\n $fetchData = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount);\n $data['dataInfo'] = $fetchData;\n array_push($mydata, $fetchData);\n }\n }\n $data['mydata'] = $mydata;\n $data['title'] = $this->lang->line('admin_category');\n $data['page'] = rest_path('category/display_category_excel');\n $data['get_printer'] = $this->get_printer();\n $data['category_branch_location'] = $this->get_branch_location();\n $this->load->view('index', $data);\n }\n }\n }", "public function export(){\n include APPPATH.'third_party/PHPExcel/Classes/PHPExcel.php';\n \n // Panggil class PHPExcel nya\n $excel = new PHPExcel();\n\n // Settingan awal fil excel\n $excel->getProperties()->setCreator('My Notes Code')\n ->setLastModifiedBy('My Notes Code')\n ->setTitle(\"Data Buku\")\n ->setSubject(\"tb_buku\")\n ->setDescription(\"Laporan Semua Data Buku\")\n ->setKeywords(\"Data Buku\");\n\n // Buat sebuah variabel untuk menampung pengaturan style dari header tabel\n $style_col = array(\n 'font' => array('bold' => true), // Set font nya jadi bold\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n\n // Buat sebuah variabel untuk menampung pengaturan style dari isi tabel\n $style_row = array(\n 'alignment' => array(\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)\n 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)\n ),\n 'borders' => array(\n 'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis\n 'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis\n 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis\n 'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis\n )\n );\n\n $excel->setActiveSheetIndex(0)->setCellValue('A1', \"RELASI INTI MEDIA ( FAMILIA, ISTANA MEDIA, QUDSI MEDIA DAN FORUM )\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A2', \"Jl. Permadi Nyutran RT/RW. 61/19 MJ II No. 1606 C, Wirogunan, Mergangsan, Yogyakarta 55151\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A3', \"Email: [email protected] Telp: (0274) 2870300\"); // Set kolom A1 dengan tulisan \"DATA SISWA\"\n $excel->setActiveSheetIndex(0)->setCellValue('A5', \"DATA BUKU\");\n $excel->getActiveSheet()->mergeCells('A1:N1'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A2:N2'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A3:N3'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->mergeCells('A5:N5'); // Set Merge Cell pada kolom A1 sampai E1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1\n $excel->getActiveSheet()->getStyle('A5')->getFont()->setBold(TRUE); // Set bold kolom A1\n $excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1\n $excel->getActiveSheet()->getStyle('A5')->getFont()->setSize(15);\n $excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $excel->getActiveSheet()->getStyle('A5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1\n\n // Buat header tabel nya pada baris ke 3\n $excel->setActiveSheetIndex(0)->setCellValue('A7', \"NO\"); // Set kolom A3 dengan tulisan \"NO\"\n $excel->setActiveSheetIndex(0)->setCellValue('B7', \"KODE BUKU\"); // Set kolom A3 dengan tulisan \"NO\"\n $excel->setActiveSheetIndex(0)->setCellValue('C7', \"JUDUL\"); // Set kolom B3 dengan tulisan \"NIS\"\n $excel->setActiveSheetIndex(0)->setCellValue('D7', \"KATEGORI\"); // Set kolom C3 dengan tulisan \"NAMA\"\n $excel->setActiveSheetIndex(0)->setCellValue('E7', \"PENULIS\"); // Set kolom D3 dengan tulisan \"JENIS KELAMIN\"\n $excel->setActiveSheetIndex(0)->setCellValue('F7', \"PENERBIT\");\n $excel->setActiveSheetIndex(0)->setCellValue('G7', \"UKURAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('H7', \"JUMLAH HALAMAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('I7', \"ISBN\");\n $excel->setActiveSheetIndex(0)->setCellValue('J7', \"TAHUN TERBIT\");\n $excel->setActiveSheetIndex(0)->setCellValue('K7', \"HARGA (Rp)\");\n $excel->setActiveSheetIndex(0)->setCellValue('L7', \"STOK\");\n $excel->setActiveSheetIndex(0)->setCellValue('M7', \"KETERANGAN\");\n $excel->setActiveSheetIndex(0)->setCellValue('N7', \"STATUS\");\n\n // Apply style header yang telah kita buat tadi ke masing-masing kolom header\n $excel->getActiveSheet()->getStyle('A7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('B7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('C7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('D7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('E7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('F7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('G7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('H7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('I7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('J7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('K7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('L7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('M7')->applyFromArray($style_col);\n $excel->getActiveSheet()->getStyle('N7')->applyFromArray($style_col);\n\n\n // Panggil function view yang ada di SiswaModel untuk menampilkan semua data siswanya\n $buku = $this->buku_model->showAllBuku();\n\n $no = 1; // Untuk penomoran tabel, di awal set dengan 1\n $numrow = 8; // Set baris pertama untuk isi tabel adalah baris ke 4\n foreach($buku as $data){ // Lakukan looping pada variabel siswa\n $excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);\n $excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->kd_buku);\n $excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->judul);\n $excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->nama_kategori);\n $excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->nama_penulis);\n $excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->nama_penerbit);\n $excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->ukuran);\n $excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->jml_halaman);\n $excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->isbn);\n $excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->thn_terbit);\n $excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->harga);\n $excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->stok);\n $excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->keterangan);\n $excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->status);\n \n // Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)\n $excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);\n $excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);\n \n $no++; // Tambah 1 setiap kali looping\n $numrow++; // Tambah 1 setiap kali looping\n }\n\n // Set width kolom\n $excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A\n $excel->getActiveSheet()->getColumnDimension('B')->setWidth(13); // Set width kolom B\n $excel->getActiveSheet()->getColumnDimension('C')->setWidth(60); // Set width kolom C\n $excel->getActiveSheet()->getColumnDimension('D')->setWidth(25); // Set width kolom D\n $excel->getActiveSheet()->getColumnDimension('E')->setWidth(40); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('F')->setWidth(15); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('G')->setWidth(13); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('H')->setWidth(20); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('I')->setWidth(20); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('J')->setWidth(15); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('K')->setWidth(18); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('L')->setWidth(10); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('M')->setWidth(40); // Set width kolom E\n $excel->getActiveSheet()->getColumnDimension('N')->setWidth(15); // Set width kolom E\n \n // Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)\n $excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);\n\n // Set orientasi kertas jadi LANDSCAPE\n $excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n\n // Set judul file excel nya\n $excel->getActiveSheet(0)->setTitle(\"Laporan Data Buku\");\n $excel->setActiveSheetIndex(0);\n\n // Proses file excel\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment; filename=\"Data Buku.xlsx\"'); // Set nama file excel nya\n header('Cache-Control: max-age=0');\n\n $write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');\n $write->save('php://output');\n }", "public function getType()\n {\n return 'radio';\n }", "function import()\n\t{\n\t\t$this->ipsclass->admin->page_detail = \"Эта секция позволяет вам импортировать XML-файлы содержащие языковые настройки.\";\n\t\t$this->ipsclass->admin->page_title = \"Импорт языка\";\n\t\t$this->ipsclass->admin->nav[] \t\t= array( '', 'Import Language Pack' );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doimport' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'lang' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'MAX_FILE_SIZE' , '10000000000' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section' , $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) , \"uploadform\", \" enctype='multipart/form-data'\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Импортирование XML-файла\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Загрузка XML-архива с языковыми настройками</b><div style='color:gray'>Выберите файл для загрузки с вашего компьютера. Выбранный файл должен начинаться с 'ipb_language' и заканчиваться либо '.xml', либо '.xml.gz'.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_upload( )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b><u>ИЛИ</u> введите название XML-архива</b><div style='color:gray'>Этот файл должен быть загружен в основную директорию форума.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_location', 'ipb_language.xml.gz' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Введите название для новых языковых настроек</b><div style='color:gray'>Например: Русский, RU, English, US...</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_name', '' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Импортирование XML-файла\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\n\n\t}", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "public function importInterface(){\n return view('/drugAdministration/companies/importExcel');\n }", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\t \tif($excel['cells'][1][1] == 'SFG Item No.' && $excel['cells'][1][2] == 'SFG Quantity') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t\t$kode_sfg = $excel['cells'][$i][1];\n\t\t\t\t$quantity_sfg = $excel['cells'][$i][2];\n \t\t\t$material_no = $excel['cells'][$i][3];\n \t\t\t$quantity = $excel['cells'][$i][4];\n \t$plant = $excel['cells'][$i][5];\n if(empty($plant)) {\n $plant = $this->session->userdata['ADMIN']['plant'];\n }\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif(($excel['cells'][$i][1] != $excel['cells'][$x][1])||($excel['cells'][$i][5] != $excel['cells'][$x][5])) {\n\n $sfgs_header = $this->m_sfgs->sfgs_header_select_by_kode_sfg($kode_sfg,$plant);\n if ($sfgs_header!=FALSE) {\n $this->m_sfgs->sfgs_header_delete_multiple($sfgs_header);\n }\n $j++;\n\t\t\t\t // \tif($sfgs_detail_temp = $this->m_general->sap_item_groups_select_all_sfgs()) {\n $object['sfgs_headers'][$j]['plant'] = $plant;\n $object['sfgs_headers'][$j]['kode_sfg'] = $excel['cells'][$i][1];\n $item_temp = $this->m_general->sap_item_select_by_item_code($excel['cells'][$i][1]);\n $object['sfgs_headers'][$j]['nama_sfg'] = $item_temp['MAKTX'];\n $object['sfgs_headers'][$j]['quantity_sfg'] = $quantity_sfg;\n $object['sfgs_headers'][$j]['uom_sfg'] = $item_temp['UNIT'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['filename'] = $this->session->userdata('filename_upload');\n\n\t\t\t\t\t\t$id_sfgs_header = $this->m_sfgs->sfgs_header_insert($object['sfgs_headers'][$j]);\n\n \t$sfgs_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t //\t\t} else {\n //\t$sfgs_header_exist = FALSE;\n\t\t\t//\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($sfgs_header_exist) {\n\n\t\t\t\t\tif($sfgs_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['sfgs_details'][$j][$k]['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['id_sfgs_h_detail'] = $k;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_desc'] = $sfgs_detail_temp['MAKTX'];\n \t\t\t\t\t $object['sfgs_details'][$j][$k]['quantity'] = $quantity;\n\n $uom_import = $sfgs_detail_temp['UNIT'];\n if(strcasecmp($uom_import,'KG')==0) {\n $uom_import = 'G';\n }\n if(strcasecmp($uom_import,'L')==0) {\n $uom_import = 'ML';\n }\n \t\t\t$object['sfgs_details'][$j][$k]['uom'] = $uom_import;\n\n\t\t\t\t\t\t$id_sfgs_detail = $this->m_sfgs->sfgs_detail_insert($object['sfgs_details'][$j][$k]);\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Master Semi Finished Goods (SFG) BOM berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['sfgs_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Master Semi Finished Goods (SFG) BOM atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'sfgs/browse_result/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '008';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "function guifi_radio_add_radio_submit(&$form, &$form_state) {\n guifi_log(GUIFILOG_TRACE, \"function guifi_radio_add_radio_submit()\",$form_state['values']);\n\n // wrong form navigation, can't do anything\n if ($form_state['values']['newradio_mode'] == NULL) {\n return TRUE;\n }\n\n $edit = $form_state['values'];\n\n $radio = _guifi_radio_prepare_add_radio($edit);\n\n $radio['unfold'] = TRUE;\n $radio['unfold_main'] = TRUE;\n $radio['unfold_antenna'] = TRUE;\n\n $form_state['rebuild'] = TRUE;\n $form_state['values']['radios'][] = $radio;\n\n drupal_set_message(t('Radio %ssid added in mode %mode.',\n array('%ssid' => $radio['ssid'],\n '%mode' => $radio['mode'])));\n\n return;\n}", "function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}", "public function import(Request $request)\n {\n $this->validate($request, array(\n 'file' => 'required'\n ));\n\n if ($request->hasFile('file')) {\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n $path = $request->file->getRealPath();\n $insert = [];\n $result = Excel::load($path, function ($reader) {\n// $i = 0;\n// $result = $reader->get();\n })->get();\n $i = 0;\n foreach ($result as $row) {\n// dump([$i => $row]);\n if ($i > 1) {\n if ($row[0] != null) {\n $insert[] = [\n 'name' => $row[0],\n 'surname' => $row[1]\n ];\n }\n }\n $i++;\n }\n if (!empty($insert)) {\n $insertData = DB::table('students')->insert($insert);\n if ($insertData) {\n Session::flash('success', 'Your Data has successfully imported');\n } else {\n Session::flash('error', 'Error inserting the data..');\n return redirect()->route('index');\n }\n }\n }\n return redirect()->route('index');\n } else {\n Session::flash('error', 'File is a ' . $extension . ' file.!! Please upload a valid xls/csv file..!!');\n return back();\n }\n }", "function loadImportingData()\r\n\t{\r\n\t\treturn true;\r\n\t}" ]
[ "0.51157725", "0.47869363", "0.4668854", "0.46299484", "0.45710236", "0.45428073", "0.45386532", "0.45222545", "0.45018837", "0.4486966", "0.44613567", "0.44118488", "0.4400204", "0.43842605", "0.43669873", "0.43482393", "0.43444", "0.43307984", "0.43288007", "0.43213406", "0.43211138", "0.43095648", "0.42987326", "0.42971995", "0.42920613", "0.42887068", "0.4259", "0.42361015", "0.42325976", "0.42254734", "0.42201138", "0.42198032", "0.42180383", "0.4179909", "0.41718373", "0.41688806", "0.41595978", "0.41537246", "0.4152315", "0.41352177", "0.41310927", "0.41297165", "0.40887943", "0.40872005", "0.40859786", "0.4079829", "0.40737584", "0.4072801", "0.40680036", "0.40667945", "0.4059983", "0.40566567", "0.40557986", "0.40360996", "0.40309155", "0.40287283", "0.40231365", "0.4021506", "0.40208277", "0.40185502", "0.4013184", "0.4012406", "0.39952335", "0.39894006", "0.39875996", "0.39859235", "0.3980175", "0.39800864", "0.39778227", "0.3971957", "0.39548305", "0.39511853", "0.39490646", "0.3944589", "0.39430675", "0.39417142", "0.39371482", "0.39358962", "0.39355934", "0.39329875", "0.39311868", "0.3930994", "0.39287302", "0.392091", "0.39150232", "0.39143977", "0.39102158", "0.39101666", "0.39096266", "0.39075047", "0.39039665", "0.389211", "0.3891793", "0.38891545", "0.38886073", "0.38798296", "0.38772547", "0.38771802", "0.3876193", "0.38761902" ]
0.5347019
0
Method for importing a text data cell.
protected function process_data_text(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function import_text( $text ) {\r\n // quick sanity check\r\n if (empty($text)) {\r\n return '';\r\n }\r\n $data = $text[0]['#'];\r\n return addslashes(trim( $data ));\r\n }", "function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "function text_parse_csv_column_input($t)\r\n{\r\n\t$t = str_replace(\"'\", '&#39;', $t);\r\n\t$t = str_replace(' \"', ' &#34;', $t);\r\n\t$t = str_replace('& ', '&amp; ', $t);\r\n\t$t = preg_replace('/[^\\\\\\\\]\\\\\\n/', \"\\n\", $t);\r\n\t$t = preg_replace('/[^\\\\\\\\]\\\\\\t/', \"\\t\", $t);\r\n\t$t = str_replace('\\\\\\n', '\\n', $t);\r\n\t$t = str_replace('\\\\\\r', '\\r', $t);\r\n\t$t = str_replace('\\\\\\t', '\\t', $t);\r\n\treturn $t;\r\n}", "public function importRobotsTxt(\\DataContainer $dc)\n {\n if (\\Input::get('key') != 'importRobotsTxt')\n {\n return '';\n }\n \n if (!file_exists(TL_ROOT . \"/\" . FILE_ROBOTS_TXT_DEFAULT))\n {\n \\Message::addError($GLOBALS['TL_LANG']['ERR']['no_robotstxt_default']);\n $this->redirect(str_replace('&key=importRobotsTxt', '', \\Environment::get('request')));\n }\n\n $objVersions = new \\Versions($dc->table, \\Input::get('id'));\n $objVersions->create();\n \n $strFileContent = file_get_contents(TL_ROOT . \"/\" . FILE_ROBOTS_TXT_DEFAULT);\n\n \\Database::getInstance()->prepare(\"UPDATE \" . $dc->table . \" SET robotsTxtContent=? WHERE id=?\")\n ->execute($strFileContent, \\Input::get('id'));\n\n $this->redirect(str_replace('&key=importRobotsTxt', '', \\Environment::get('request')));\n }", "public function getTextEntity();", "public function testGetDataTableTextDataType() {\r\n\t\t// Insert values into database\r\n\t\t$value = str_pad('', 4000, ' °!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n'); // Must be 80 chars to pad correctly to 4000 characters\r\n\t\t$escapedvalue = $this->escape($value);\r\n\t\t$this->executeQuery('insert into POTEST (UUID, TEXT_VALUE) values (\\'testuuid0\\',\\''.$escapedvalue.'\\')');\r\n\t\t// Extract datatable\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select TEXT_VALUE from POTEST order by UUID');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Check strings for correct conversion\r\n\t\t$resultstring = $datamatrix[0][0]; \r\n\t\t$this->assertEquals(4000, strlen($resultstring), 'Result string has not the correct length.');\r\n\t\t$this->assertEquals($value, $resultstring, 'Result string is not the same as the given one.');\r\n\t\t$this->assertEquals('UTF-8', mb_detect_encoding($resultstring), 'The string encoding is not UTF8.');\r\n\t}", "public function getTextData()\n {\n return $this->text;\n }", "public function metaImport($data);", "function origin_parse()\n\t\t{\n\t\t\t$text_data = $this->calendar->get_text_data();\n\t\t\t\n\t\t\t// loop through each text row and parse it into feilds\n\t\t\tforeach($text_data as $single_column)\n\t\t\t{\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$base_info = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+2);\n\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\n\t\t\t\t$code = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$city = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$state_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\tif(strpos($single_column->text_column, ',y,') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 4);\n\t\t\t\t\t\n\t\t\t\t} else if(strpos($single_column->text_column, ',n') !== FALSE ) {\n\t\t\t\t\t\n\t\t\t\t\t$on_site = 0;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 3);\n\t\t\t\t} else {\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$address = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\n\t\t\t\t$location_2 = strpos($single_column->text_column, ',\"');\n\t\t\t\t$phone_number = substr($single_column->text_column, 0, $location_2);\t\t\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+2);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$proper_data = substr($single_column->text_column, $location+2, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$start_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$end_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$course_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$instructor = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\t\t\n\t\t\t\t$course_cost = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$random_zero = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\t\t\t\n\t\t\t\t$description = substr($single_column->text_column, 2, (strlen($single_column->text_column) - 2));\n\t\n\t\t\t\t// setup the structure of a single new event parsed out as columns that have meaning\n\t\t\t\t$constructed_cal_row = array(\n\t\t\t\t\t'base_info' \t\t=> $base_info,\n\t\t\t\t\t'code'\t\t\t\t=> $code,\n\t\t\t\t\t'city' \t\t\t\t=> $city,\n\t\t\t\t\t'state_code'\t\t=> $state_code,\n\t\t\t\t\t'on_site'\t\t\t=> $on_site,\n\t\t\t\t\t'address'\t\t\t=> $address,\n\t\t\t\t\t'phone_number'\t\t=> $phone_number,\n\t\t\t\t\t'proper_data'\t\t=> $proper_data,\n\t\t\t\t\t'start_time'\t\t=> $start_time,\n\t\t\t\t\t'end_time'\t\t\t=> $end_time,\n\t\t\t\t\t'course_code'\t\t=> $course_code,\n\t\t\t\t\t'instructor'\t\t=> $instructor,\n\t\t\t\t\t'course_cost'\t\t=> $course_cost,\n\t\t\t\t\t'random_zero'\t\t=> $random_zero,\n\t\t\t\t\t'decsription'\t\t=> $description\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add that row to something that we can use\n\t\t\t\t$this->calendar->insert_calendar($constructed_cal_row);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->test('Done!');\n\t\t}", "public function run()\n {\n $this->loadTextFile($this->text_file);\n }", "private function loadTextFile($text_file)\n {\n try {\n TextFileValidator::textFile($text_file);\n $file = fopen($text_file, \"r\") or die(\"Unable to open file!\");\n while (!feof($file)) {\n $line = fgets($file);\n $this->addLine($line);\n }\n fclose($file);\n } catch (Exception $a) {\n die($a->getMessage());\n }\n }", "public function addRowText($text)\n {\n return $this->withMeta(['addRowText' => $text]);\n }", "public function addRowText($text)\n {\n return $this->withMeta(['addRowText' => $text]);\n }", "public function cell ($text,$options=NULL) { print $this->cell_html ($text,$options); }", "function import(array $data);", "public function importFrom(array $data);", "public function testSaveDataTableTextDataType() {\r\n\t\t$value = str_pad('', 4000, ' °!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n'); // Must be 80 chars to pad correctly to 4000 characters\r\n\t\t// Store datatable\r\n\t\t$datatable = new avorium_core_data_DataTable(1, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'TEXT_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, 'testuuid0');\r\n\t\t$datatable->setCellValue(0, 1, $value);\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read database via SQL\r\n\t\t$results = $this->executeQuery('select TEXT_VALUE from POTEST order by UUID');\r\n\t\t// Compare values\r\n\t\t$resultstring = $results[0][0];\r\n\t\t$this->assertEquals(4000, strlen($resultstring), 'Result string has not the correct length.');\r\n\t\t$this->assertEquals($value, $resultstring, 'Result string is not the same as the given one.');\r\n\t\t$this->assertEquals('UTF-8', mb_detect_encoding($resultstring), 'The string encoding is not UTF8.');\r\n\t}", "public function import_blog_text(&$Db_object, &$databasetype, &$tableprefix)\n\t{\n\t\t// Check the dupe\n\t\tif (dupe_checking AND !($this->_dupe_checking === false OR $this->_dupe_checking['pmtext'] === false))\n\t\t{\n\t\t\t$there = $Db_object->query_first(\"\n\t\t\t\tSELECT blogtextid\n\t\t\t\tFROM \" . $tableprefix . \"blog_text\n\t\t\t\tWHERE importblogtextid = \" . intval(trim($this->get_value('mandatory', 'importblogtextid'))) . \"\n\t\t\t\");\n\n\t\t\tif (is_numeric($there[0]))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$Db_object->query(\"\n\t\t\tINSERT INTO \" . $tableprefix . \"blog_text\n\t\t\t\t(blogid, userid, dateline, pagetext, title, state, allowsmilie, username, ipaddress, reportthreadid, bloguserid, importblogtextid)\n\t\t\tVALUES\n\t\t\t\t(\" . intval($this->get_value('mandatory', 'blogid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'userid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'dateline')) . \",\n\t\t\t\t'\" . addslashes($this->get_value('mandatory', 'pagetext')) . \"',\n\t\t\t\t'\" . addslashes($this->get_value('mandatory', 'title')) . \"',\n\t\t\t\t'\" . $this->enum_check($this->get_value('mandatory', 'state'), array('moderation','visible','deleted'), 'visible') . \"',\n\t\t\t\t\" . intval($this->get_value('nonmandatory', 'allowsmilie')) . \",\n\t\t\t\t'\" . addslashes($this->get_value('nonmandatory', 'username')) . \"',\n\t\t\t\t\" . intval(sprintf('%u', ip2long($this->get_value('nonmandatory', 'ipaddress')))) . \",\n\t\t\t\t\" . intval($this->get_value('nonmandatory', 'reportthreadid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'bloguserid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'importblogtextid')) . \")\n\t\t\");\n\n\t\tif ($Db_object->affected_rows())\n\t\t{\n\t\t\treturn $Db_object->insert_id();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function import(array $data): void;", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "function ImprimirTexto($file){\n \t$txt = file_get_contents($file);\n \t\t $this->SetFont('Arial','',12);\n \t//Se imprime\n \t$this->MultiCell(0,5,$txt);\n \t}", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "function getTextInside(){\n\t $myfile = fopen($this->pathFile, \"r\") or die(\"Unable to open file!\");\t\t//membuka file\n\t $this->textInside = fread($myfile, filesize($this->pathFile));\t\t\t\t//menyimpan text yang ada dalam file ke textInside\n\t fclose($myfile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//menutup file\n\t}", "public function readFile() {\n\t\ttry {\n\t\t\tparent::readFile();\n\t\t} catch (LFException $e) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// convert all language values from utf-8 to the original charset\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, FALSE, array('default'));\n\t\t}\n\t}", "public function test_load_csv_content() {\n $encoding = 'utf8';\n $separator = 'comma';\n $previewrows = 5;\n $csvpreview = new phpunit_gradeimport_csv_load_data();\n $csvpreview->load_csv_content($this->oktext, $encoding, $separator, $previewrows);\n\n $expecteddata = array(array(\n 'Anne',\n 'Able',\n '',\n 'Moodle HQ',\n 'Rock on!',\n '[email protected]',\n 56.00,\n 'We welcome feedback',\n '',\n 56.00\n ),\n array(\n 'Bobby',\n 'Bunce',\n '',\n 'Moodle HQ',\n 'Rock on!',\n '[email protected]',\n 75.00,\n '',\n 45.0,\n 75.00\n )\n );\n\n $expectedheaders = array(\n 'First name',\n 'Surname',\n 'ID number',\n 'Institution',\n 'Department',\n 'Email address',\n 'Assignment: Assignment for grape group',\n 'Feedback: Assignment for grape group',\n 'Assignment: Second new grade item',\n 'Course total'\n );\n // Check that general data is returned as expected.\n $this->assertEquals($csvpreview->get_previewdata(), $expecteddata);\n // Check that headers are returned as expected.\n $this->assertEquals($csvpreview->get_headers(), $expectedheaders);\n\n // Check that errors are being recorded.\n $csvpreview = new phpunit_gradeimport_csv_load_data();\n $csvpreview->load_csv_content($this->badtext, $encoding, $separator, $previewrows);\n // Columns shouldn't match.\n $this->assertEquals($csvpreview->get_error(), get_string('csvweirdcolumns', 'error'));\n }", "public function getText();", "public function getText();", "public function getText();", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function prepareImportContent();", "public function testAddPreserveTextException()\n {\n $oCell = new Cell();\n $oCell->setDocPart('Section', 1);\n $oCell->addPreserveText('text');\n }", "public function import();", "public function renderDataCellContent($model, $key, $index)\n {\n // @link https://github.com/yii2tech/csv-grid/issues/23\n $value = parent::renderDataCellContent($model, $key, $index);\n return (is_numeric($value) && strlen($value) > 14) ? ($value . \"\\t\") : $value;\n }", "function load_text() {\n if (empty($this->grade_grades_text)) {\n $this->grade_grades_text = grade_grades_text::fetch('itemid', $this->itemid, 'userid', $this->userid);\n }\n return $this->grade_grades_text;\n }", "protected function loadRow() {}", "public function addTableRow($data, $font_color = '808080') {\n\n $styleArray = array(\n 'font' => array(\n 'color' => array('rgb' => $font_color),\n ),\n );\n $this->xls->getActiveSheet()->getStyle($this->row)->applyFromArray($styleArray);\n\n\t\t$offset = $this->tableParams['offset'];\n\n\t\tforeach ($data as $d) {\n if( strpos($d, '.png') === false ){\n if (in_array($offset, $this->columnasTiposNumericos)) {\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d, PHPExcel_Cell_DataType::TYPE_NUMERIC);\n }\n else {\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d);\n }\n } else{\n if( !$this->addImage( $d, PHPExcel_Cell::stringFromColumnIndex( $offset ), $this->row ) ){\n $this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, 'NO IMAGE');\n }\n }\n //$this->xls->getActiveSheet()->setCellValueExplicitByColumnAndRow($offset++, $this->row, $d);\n\t\t}\n\t\t$this->row++;\n\t\t$this->tableParams['row_count']++;\n\t}", "public function importSource()\n {\n $this->setData('entity', $this->getDataSourceModel()->getEntityTypeCode());\n $this->setData('behavior', $this->getDataSourceModel()->getBehavior());\n\n $this->addLogComment(__('Begin import of \"%1\" with \"%2\" behavior', $this->getEntity(), $this->getBehavior()));\n\n $result = $this->processImport();\n\n if ($result) {\n $this->addLogComment(\n [\n __(\n 'Checked rows: %1, checked entities: %2, invalid rows: %3, skipped rows: %4 total errors: %5',\n $this->getProcessedRowsCount(),\n $this->getProcessedEntitiesCount(),\n $this->getErrorAggregator()->getInvalidRowsCount(),\n $this->getErrorAggregator()->getSkippedRowsCount(),\n $this->getErrorAggregator()->getErrorsCount()\n ),\n __('The import was successful.'),\n ]\n );\n } else {\n throw new LocalizedException(__('Can not import data.'));\n }\n\n return $result;\n }", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "function\taddCellText( $_frm, $_par, $_text=\"\") {\n\t\t$_par->getCharFmt()->activate( $this->myDoc->myfpdf) ;\n\t\t$_width\t=\t$_frm->width ;\n\t\t$currBuf\t=\t\"\" ;\n\t\t$nextBuf\t=\t\"\" ;\n\t\t$doIt\t=\tFALSE ;\n\t\tfor ( $i0=0 ; $i0 < strlen( $_text) ; $i0++) {\n\t\t\tswitch ( $_text[$i0]) {\n\t\t\t\tcase\t\"\\n\"\t:\n\t\t\t\t\t$currBuf\t.=\t$nextBuf ;\n\t\t\t\t\t$nextBuf\t=\t\"\" ;\n\t\t\t\t\t$doIt\t=\tTRUE ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase\t\" \"\t:\n\t\t\t\t\t$currBuf\t.=\t$nextBuf . \" \" ;\n\t\t\t\t\t$nextBuf\t=\t\"\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tdefault\t:\n\t\t\t\t\t$currWidth\t=\t$this->textWidth( $currBuf . $nextBuf . $_text[$i0]) ;\n\t\t\t\t\tif ( $currWidth > $_width) {\n\t\t\t\t\t\t$doIt\t=\tTRUE ;\n\t\t\t\t\t}\n\t\t\t\t\t$nextBuf\t.=\t$_text[$i0] ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t\tif ( ( $i0 + 1) == strlen( $_text)) {\n\t\t\t\t$currBuf\t.=\t$nextBuf ;\n\t\t\t\t$nextBuf\t=\t\"\" ;\n\t\t\t\t$doIt\t=\tTRUE ;\n\t\t\t}\n\t\t\tif ( $doIt) {\n\t\t\t\t$_frm->addLine( $currBuf, $_par) ;\n\t\t\t\t$currBuf\t=\t\"\" ;\n\t\t\t\t$doIt\t=\tFALSE ;\n\t\t\t}\n\t\t}\n\t\treturn 0 ;\n\t}", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "public function getTextSourceField() {}", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "protected function importDatabaseData() {}", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "function loadImportString($refer_string)\r\n {\r\n if (is_string($refer_string))\r\n {\r\n\t\t $this->referString = explode(\"\\n\",$refer_string);\r\n\t\t $risArray = explode(\"\\r\", $refer_string);\r\n\t\t if (count($risArray) > count($this->referString))\r\n\t\t $this->referString = $risArray;\r\n }\r\n else\r\n {\r\n $this->referString = $refer_string;\r\n }\r\n $this->currentLine = 0;\r\n }", "public function import(): void;", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "public function import() {\n return '';\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "public function getTextContent();", "public function text() {}", "public function text() {}", "public function text() {}", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "public function doImport() \n\t{ \n\t // first save the import object in the database\n $this->status = self::STATUS_IN_PROGRESS_IMPORT;\n $this->item_count = $this->getItemCount();\n\t $this->save(); \n\t \t \n\t // add an import object\n\t $db = get_db();\n\t $csvFile = $this->getCsvFile();\n\t $columnMaps = $this->getColumnMaps();\n\t \t \n if ($csvFile->isValid()) { \t \n\n // define item metadata\t \n $itemMetadata = array(\n 'public' => $this->is_public, \n 'featured' => $this->is_featured, \n 'item_type_id' => $this->item_type_id,\n 'collection_id' => $this->collection_id\n );\n \n // create a map from the column index number to an array of element infos, where each element info contains \n // the element set name, element name, and whether the element text is html or not \n $colNumToElementInfosMap = array();\n\n $colNumMapsToTag = array();\n \n foreach($columnMaps as $columnMap) {\n $columnIndex = $columnMap->getColumnIndex();\n \n // check to see if the column maps to a tag\n $mapsToTag = $colNumMapsToTag[$columnIndex];\n if (empty($mapsToTag)) {\n $colNumMapsToTag[$columnIndex] = false; \n }\n if ($columnMap->mapsToTag()) {\n $colNumMapsToTag[$columnIndex] = true; \n }\n \n // check to see if the column maps to a file\n $mapsToFile = $colNumMapsToFile[$columnIndex];\n if (empty($mapsToFile)) {\n $colNumMapsToFile[$columnIndex] = false; \n }\n if ($columnMap->mapsToFile()) {\n $colNumMapsToFile[$columnIndex] = true; \n }\n \n // build element infos from the column map\n $elementIds = $columnMap->getElementIds();\n foreach($elementIds as $elementId) {\n $et = $db->getTable('Element');\n $element = $et->find($elementId);\n $es = $db->getTable('ElementSet');\n $elementSet = $es->find($element['element_set_id']);\n $elementInfo = array('element_name' => $element->name, \n 'element_set_name' => $elementSet->name, \n 'element_text_is_html' => $columnMap->getDataIsHtml());\n \n // make sure that an array of element infos exists for the column index\n if (!is_array($colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex] = array();\n }\n \n // add the element info if it does not already exist for the column index \n if (!in_array($elementInfo, $colNumToElementInfosMap[$columnIndex])) {\n $colNumToElementInfosMap[$columnIndex][] = $elementInfo; \n }\n } \n }\n \n // add item from each row\n $rows = $csvFile->getRows();\n $i = 0;\n foreach($rows as $row) {\n $i++;\n \n // ignore the first row because it is the header\n if ($i == 1) {\n continue;\n }\n \n //insert the item \n try {\n $item = $this->addItemFromRow($row, $itemMetadata, $colNumToElementInfosMap, $colNumMapsToTag, $colNumMapsToFile);\n } catch (Exception $e) {\n $this->status = self::STATUS_IMPORT_ERROR_INVALID_ITEM;\n \t $this->error_details = $e->getMessage();\n }\n release_object($item);\n \n // stop import on error\n if ($this->hasErrorStatus()) {\n \t $this->save();\n \t return false;\n \t }\n }\n \n $this->status = self::STATUS_COMPLETED_IMPORT;\n $this->save();\n return true;\n \n }\n \n $this->status = self::STATUS_IMPORT_ERROR_INVALID_CSV_FILE;\n $this->save();\n return false;\n\t}", "public function import()\n {\n \n }", "public function importExcel($path);", "public function addTableRow($data, $params = array()) {\n if( !empty($this->_tableParams['offset']) ) {\n $offset = $this->_tableParams['offset'];\n } else {\n $offset = 0;\n }\n\n foreach ($data as $d) {\n\n if( is_array($d) ) {\n $text = isset($d['text'])?$d['text']:null;\n $options = !empty($d['options'])?$d['options']:null;\n } else {\n $text = $d;\n $options = null;\n }\n\n\n if( !empty($options) ) {\n $type = !empty($options['type'])?$options['type']:PHPExcel_Cell_DataType::TYPE_STRING;\n $align = !empty($options['align'])?$options['align']:PHPExcel_Style_Alignment::HORIZONTAL_LEFT;\n $colspan = !empty($options['colspan'])?$options['colspan']:null;\n\n switch ($type) {\n case 'string':\n $type = PHPExcel_Cell_DataType::TYPE_STRING;\n break;\n case 'number':\n $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;\n break;\n }\n\n switch ($align) {\n case 'center':\n $align = PHPExcel_Style_Alignment::HORIZONTAL_CENTER;\n break;\n case 'right':\n $align = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;\n break;\n }\n\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal($align);\n $this->_xls->getActiveSheet()->getCellByColumnAndRow($offset, $this->_row)->setValueExplicit($text, $type);\n\n if( !empty($options['bold']) ) {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getFont()->setBold(true);\n }\n if( !empty($colspan) ) {\n $default = 1+$offset;\n $dimensi = $default+($colspan-1); // Acii A\n $row = $this->_row;\n\n $default = Common::getNameFromNumber($default);\n $cell_end = Common::getNameFromNumber($dimensi);\n\n // if( $text == 'OPENING BALANCE' ) {\n // debug(__('%s%s:%s%s', $default, $row, $cell_end, $row));die();\n // }\n\n $this->_xls->getActiveSheet()->mergeCells(__('%s%s:%s%s', $default, $row, $cell_end, $row));\n \n $offset += $colspan-1;\n }\n } else {\n $this->_xls->getActiveSheet()->getStyle($this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\n $this->_xls->getActiveSheet()->setCellValueByColumnAndRow($offset, $this->_row, $text);\n }\n \n // if (isset($params['horizontal'])) {\n // $this->_xls->getActiveSheet()->getCellByColumnAndRow($this->_row, $offset)->getStyle()->getAlignment()->setHorizontal($params['horizontal']);\n // }\n\n $offset++;\n }\n\n if( !empty($this->_tableParams['row_count']) ) {\n $row_count = $this->_tableParams['row_count'];\n } else {\n $row_count = 0;\n }\n\n $this->_row++;\n $this->_tableParams['row_count'] = $row_count+1;\n\n return $this;\n }", "public function executeLoadText(sfWebRequest $request) {\n $result = AdditionalTextTable::instance()->findSingleTextById($request->getParameter('id'));\n $this->renderText('{\"result\":'.json_encode($result[0]->toArray()).'}');\n return sfView::NONE;\n }", "public function createFromText($dataItemType, $dataItemID, $text,\r\n $fileName, $extractText)\r\n {\r\n return $this->createGeneric(\r\n $dataItemType, $dataItemID, false, $extractText, false,\r\n $fileName, false, 'text/plain', $text, false\r\n );\r\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function import(string $filePath);", "private function setTextAnnotationData(TextAnnotation $textAnnotation)\n {\n /*\n * Sets the common data for an enhancement \n */\n $this->setEnhancementData($textAnnotation);\n\n /*\n * Convert the model to an array for ease of manipulation\n */\n $modelArray = $this->model->toRdfPhp();\n $taProperties = $modelArray[$textAnnotation->getUri()];\n\n $textAnnotation->setType(isset($taProperties[DCTerms::TYPE][0]['value']) ? (string) $taProperties[DCTerms::TYPE][0]['value'] : null);\n $textAnnotation->setStarts(isset($taProperties[FISE::START][0]['value']) ? intval($taProperties[FISE::START][0]['value']) : 0);\n $textAnnotation->setEnds(isset($taProperties[FISE::END][0]['value']) ? intval($taProperties[FISE::END][0]['value']) : 0);\n $textAnnotation->setSelectedText(isset($taProperties[FISE::SELECTED_TEXT][0]['value']) ? (string) $taProperties[FISE::SELECTED_TEXT][0]['value'] : null);\n $textAnnotation->setSelectionContext(isset($taProperties[FISE::SELECTION_CONTEXT][0]['value']) ? (string) $taProperties[FISE::SELECTION_CONTEXT][0]['value'] : null);\n $textAnnotation->setLanguage(isset($taProperties[DCTerms::LANGUAGE][0]['value']) ? (string) $taProperties[DCTerms::LANGUAGE][0]['value'] : null);\n\n if (!isset($taProperties[DCTerms::LANGUAGE]) && isset($taProperties[FISE::SELECTED_TEXT][0]['lang']))\n $textAnnotation->setLanguage($taProperties[FISE::SELECTED_TEXT][0]['lang']);\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "public static function text() {}", "protected function _getValueForText($data = null, $returnTableRow = true) {\n\t\treturn $this->_getValueForStringBase($data);\n\t}", "function getColumnText($field, $fieldNumber) {\r\n\t\tdie(\"getColumnText() should be implemented in derived class.\");\r\n\t}", "public function import_testcase_from_excel($php_excel, $import_type, $new_keyword_list)\r\n {\r\n $this->import_type = $import_type;\r\n \r\n // create new keyword first\r\n if (count($new_keyword_list, COUNT_NORMAL) > 0)\r\n {\r\n foreach ($new_keyword_list as $id => $new_keyword)\r\n {\r\n $sql = \"insert into \" . $this->db_handler->get_table('keywords') . \" (keyword, testproject_id, notes)\" .\r\n \" values ('\" . $new_keyword . \"' , '\" . $this->project_id . \"' , '')\";\r\n $this->db_handler->exec_query($sql);\r\n }\r\n }\r\n \r\n $this->init_keywords_map();\r\n \r\n // parse testcase step info into node array\r\n $this->get_tc_step_list($php_excel);\r\n \r\n // get the dic tree info from node list\r\n $this->get_existed_directory_tree();\r\n \r\n // generate directionary tree ,include dic and testcases under dic\r\n $this->parse_directory_tree();\r\n \r\n // write data to db\r\n $this->write_data_to_db();\r\n \r\n return $this->result_message;\r\n }", "protected function process_header_text(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $autolink = true);\r\n return $result;\r\n }", "public function readFromRow( $row );", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link=''){\n $txt = html_entity_decode(utf8_decode($txt));\n parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);\n }", "private function spreadsheet_rows($string, $content_num) {\n $rows1 = explode('</table:table-row>', $string);\n array_pop($rows1);\n\n $result_rows = array();\n $ix = 0;\n foreach ($rows1 as $row_text) {\n list($row_text, $cellscontent) = $this->extract_first_tag_str($row_text);\n $row_tag = $this->tag_attr($row_text);\n\n $row_tag['content'] = explode('<table:table-cell', $cellscontent);\n\n /*\n * if cell is spanned columns or rows\n */\n if ($row_tag['content']) {\n if ($row_tag['content'][0] == '') {\n array_shift($row_tag['content']);\n }\n }\n\n foreach ($row_tag['content'] as $cell_content) {\n\n if (strpos($cell_content, '<table:covered-table-cell') === 0) {\n /*\n * Compensation cell before\n */\n\n $covered_list = explode('<table:covered-table-cell', $cell_content);\n\n array_shift($covered_list);\n foreach ($covered_list as $c) {\n $coverTag = $this->tag_attr('<table:covered-table-cell' . $c);\n $coverTag['content'] = false;\n $row_tag['cells'][] = $coverTag;\n }\n }\n\n if ($cell_content[0] == ' ' || $cell_content[0] == '/') {\n /*\n * Обычная ячейка\n */\n $cell_content = '<table:table-cell' . $cell_content;\n $cell_closing_pair_pos = strpos($cell_content, '</table:table-cell>');\n\n if ($cell_closing_pair_pos !== false) {\n /*\n * cell is content\n */\n list($cell_tag_text, $cell_tag_content) = $this->extract_first_tag_str($cell_content);\n $cell_tag = $this->tag_attr($cell_tag_text);\n $cell_tag['content'] = current(explode('</table:table-cell>', $cell_tag_content));\n } else {\n $cell_tag = $this->tag_attr($cell_content);\n $cell_tag['content'] = false;\n }\n $row_tag['cells'][] = $cell_tag;\n\n /*\n * Check compensation cells after cell\n */\n if (strpos($cell_content, '<table:covered-table-cell') !== false) {\n /*\n * Compensation cell before\n */\n $covered_list = explode('<table:covered-table-cell', $cell_content);\n\n array_shift($covered_list);\n foreach ($covered_list as $c) {\n $coverTag = $this->tag_attr('<table:covered-table-cell' . $c);\n $coverTag['content'] = false;\n $row_tag['cells'][] = $coverTag;\n }\n }\n }\n }\n unset($row_tag['content']);\n $row_tag['content_num'] = $content_num;\n $row_tag['content_index'] = $ix;\n if ($ix == 0)\n $row_tag['content_first'] = true;\n if ($ix == count($rows1) - 1)\n $row_tag['content_last'] = true;\n\n $row_tag['repeated'] = false;\n if (empty($row_tag['attr']['table:number-rows-repeated']))\n $result_rows[] = $row_tag;\n else {\n $repeated = (int) $row_tag['attr']['table:number-rows-repeated'];\n if ($repeated > 1000)\n $repeated = 1000;\n $row_tag['repeated'] = true;\n unset($row_tag['attr']['table:number-rows-repeated']);\n for ($i = 0; $i < $repeated; $i++)\n $result_rows[] = $row_tag;\n }\n \n $ix++;\n }\n return $result_rows;\n }", "function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}", "public static function registerText(Text $text): void {\n $level = $text->getPosition()->getLevel();\n switch (true) {\n case $text instanceof CRFT:\n self::$crfts[$level->getFolderName()][$text->getName()] = $text;\n break;\n\n case $text instanceof FT:\n self::$fts[$level->getFolderName()][$text->getName()] = $text;\n FtsData::get()->saveTextByLevel($level, $text);\n break;\n }\n }", "protected function _getDataAsTextTable(array $data) {\n\t\t\t// Dummy widths\n\t\t\t$table = new Zend_Text_Table(array('columnWidths' => array(1)));\n\t\t\t$widths = array();\n\t\t\tforeach ($data as $rowData) {\n\t\t\t\t$row = new Zend_Text_Table_Row();\n\t\t\t\tforeach ($rowData as $idx => $cell) {\n\t\t\t\t\t$width = mb_strlen($cell);\n\t\t\t\t\tif (!isset($widths[$idx]) || $widths[$idx] < $width) {\n\t\t\t\t\t\t$widths[$idx] = $width;\n\t\t\t\t\t}\n\t\t\t\t\t$row->appendColumn(new Zend_Text_Table_Column(strval($cell)));\n\t\t\t\t}\n\t\t\t\t$table->appendRow($row);\n\t\t\t}\n\t\t\t$table->setColumnWidths($widths);\t\t \n\t\t\treturn $table->render();\n\t\t}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function read($text)\n {\n return $this->getAdapter()->read($text);\n }", "public function getTextLines();", "function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}", "protected function renderDataCellContent($row,$data)\n\t{\n\t\t\n\t\techo '<p>'.Yii::t('core', 'Autor').': '.$data->getUser()->username.', '.Yii::t('core', 'Date').': '.date(Yii::app()->params['dateFormat'],strtotime($data->date)).' </p>';\n\t\techo $data->text;\n\t}", "public abstract function isTextPart();", "function insertFromFileToDb($txtFileURL, $link, $table, $column){\n echo $txtFileURL;\n $s = file_get_contents(__DIR__.\"\\\\$txtFileURL\");\n $sAr = explode(\"\\n\", $s);\n $sAr = array_map('trim',$sAr); //remove possible white space\n for ($i=0; $i < count($sAr) ; $i++) {\n $sql = \"INSERT INTO `$table`(`$column`) VALUES ('$sAr[$i]')\";\n if ($link->query($sql) !== TRUE) echo \"Error: \" . $sql . \"<br>\" . $link->error;\n }\n}", "function fcell($c_width,$c_height,$x_axis,$text){\n $w_w=$c_height/3;\n $w_w_1=$w_w+2;\n $w_w1=$w_w+$w_w+$w_w+3;\n $len=strlen($text); \n if($len>10){\n $w_text=str_split($text,10);\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w_1,$w_text[0],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$w_w1,$w_text[1],'','','');\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,'','LTRB',0,'C',0);\n }\n else{\n $this->SetX($x_axis);\n $this->Cell($c_width,$c_height,$text,'LTRB',0,'C',0);\n }\n }", "public function importExternalData($source){\n //importing data into db\n $this->log(\"importing external: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "public function testAddPreserveTextNotUTF8()\n {\n $oCell = new Cell();\n $oCell->setDocPart('Header', 1);\n $element = $oCell->addPreserveText(utf8_decode('ééé'));\n\n $this->assertCount(1, $oCell->getElements());\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Element\\\\PreserveText', $element);\n $this->assertEquals(array('ééé'), $element->getText());\n }", "public function testCellsImportDataIntArray()\n {\n $book1 = \"Book1.xlsx\";\n $mydoc = \"myDocument.xlsx\";\n $ImportOption = \"ImportOption\";\n\n $data = new ImportIntArrayOption();\n $data->setDestinationWorksheet('Sheet1');\n $data->setFirstColumn(1);\n $data->setFirstRow(3);\n $data->setImportDataType('IntArray');\n $data->setIsVertical('true');\n $data->setData(array(1, 2, 3, 4)) ;\n $files = array (\n $mydoc => CellsApiTestBase::getfullfilename($mydoc),\n $book1 => CellsApiTestBase::getfullfilename($book1)\n );\n $result = $this->instance->postImport( $files, $data );\n // print( $result);\n $this->assertNotNull($result);\n }", "public function isText() {}", "function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }", "function loadLine($a_row)\n\t{\n\t\t$this->lineID=$a_row['LineID'];\n\t\t$this->sheetID=$a_row['SheetID'];\n\t\t$this->text=$a_row['Text'];\n\t}", "function import_file($contents) {\n\t\ttrigger_error('Importer::import_file needs to be implemented', E_USER_ERROR);\n\t\t\n\t}" ]
[ "0.59995866", "0.59215665", "0.5731611", "0.5496381", "0.548323", "0.54112697", "0.53370017", "0.52918833", "0.5265808", "0.5169134", "0.515777", "0.515257", "0.5099399", "0.50760573", "0.5059764", "0.5056896", "0.505381", "0.505381", "0.5035706", "0.5021293", "0.50199836", "0.5015489", "0.5005995", "0.50053805", "0.50031054", "0.49310172", "0.49193102", "0.49167624", "0.4901081", "0.48877412", "0.48860517", "0.48860517", "0.48860517", "0.48676956", "0.48672396", "0.48642159", "0.48516667", "0.4842404", "0.4820227", "0.48196903", "0.48155317", "0.48101413", "0.48069704", "0.48034114", "0.4799026", "0.47894815", "0.478917", "0.47876844", "0.47645447", "0.4757887", "0.4740492", "0.47336274", "0.47287893", "0.4726257", "0.4720657", "0.47153524", "0.4712739", "0.4712739", "0.4712739", "0.47100022", "0.46929026", "0.4692214", "0.4692184", "0.46913657", "0.46834162", "0.46740854", "0.467215", "0.466736", "0.46671325", "0.46656805", "0.46643102", "0.46391794", "0.46342406", "0.4633891", "0.4619399", "0.46164432", "0.46139008", "0.4592252", "0.45872167", "0.45866328", "0.45837414", "0.457229", "0.4566115", "0.45609936", "0.45596758", "0.45565104", "0.45463657", "0.45408994", "0.45292157", "0.4525599", "0.4522491", "0.4522006", "0.4520169", "0.45173925", "0.45109347", "0.45102325", "0.45072585", "0.45050278", "0.4498601", "0.44948247" ]
0.5542842
3
Method for importing a textarea data cell.
protected function process_data_textarea(import_settings $settings, $field, $data_record, $value) { $result = $this->process_data_default($settings, $field, $data_record, $value, true); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function convert_textarea_field() {\n\n\t\t// Create a new Textarea field.\n\t\tself::$field = new GF_Field_Textarea();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Textarea specific properties.\n\t\tself::$field->useRichTextEditor = rgar( self::$nf_field, 'textarea_rte' );\n\n\t}", "public function display_cell($data) {\n\n\t\t// get the field markup and Editor config from the normal display function\n\t\tlist($textarea, $ckconfig) = $this->display_field($data,$this->cell_name);\n\t\t\n\t\t// include the matrix functions if not already done so\n\t\tif(!isset($this->EE->session->cache['eeck']['mconfigs']) ) {\n\t\t\t$this->include_matrix_js();\n\t\t\t$this->EE->session->cache['eeck']['mconfigs'] = array();\n\t\t}\n\n\t\t// stash the editor init config code for this matrix column id\n\t\tif (!isset($this->EE->session->cache['eeck']['mconfigs'][$this->col_id])) {\n\n\t\t\t$this->EE->cp->add_to_foot(\n\t\t\t\t$this->EE->javascript->inline( 'eeckconf.col_id_'.$this->col_id.'={'.$ckconfig.'};')\n\t\t\t);\n\n\t\t\t$this->EE->session->cache['eeck']['mconfigs'][$this->col_id] = true;\n\t\t}\n\t\treturn $textarea;\n\t}", "function output_textarea_row( string $label, string $key, $val, int $rows = 2 ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t$val = $val ?? '';\n\t?>\n\t<div class=\"wpinc-meta-field-single textarea\">\n\t\t<label>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t\t<textarea <?php name_id( $key ); ?> cols=\"64\" rows=\"<?php echo esc_attr( $rows ); ?>\"><?php echo esc_attr( $val ); ?></textarea>\n\t\t</label>\n\t</div>\n\t<?php\n}", "public static function renderTextarea();", "public function textarea()\n {\n return $this->content(false, false, false, true);\n }", "function tep_cfg_textarea($text) {\n return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);\n}", "private function textareaCustomField(): string\n {\n return Template::build($this->getTemplatePath('textarea.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'value' => $this->getValue($this->index),\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "static function textarea ($in = '', $data = []) {\n\t\treturn static::textarea_common($in, $data, __FUNCTION__);\n\t}", "function output_textarea_row( string $label, string $key, $val, int $rows = 2 ): void {\n\t\t\\wpinc\\meta\\output_textarea_row( $label, $key, $val, $rows );\n\t}", "function text_parse_csv_column_input($t)\r\n{\r\n\t$t = str_replace(\"'\", '&#39;', $t);\r\n\t$t = str_replace(' \"', ' &#34;', $t);\r\n\t$t = str_replace('& ', '&amp; ', $t);\r\n\t$t = preg_replace('/[^\\\\\\\\]\\\\\\n/', \"\\n\", $t);\r\n\t$t = preg_replace('/[^\\\\\\\\]\\\\\\t/', \"\\t\", $t);\r\n\t$t = str_replace('\\\\\\n', '\\n', $t);\r\n\t$t = str_replace('\\\\\\r', '\\r', $t);\r\n\t$t = str_replace('\\\\\\t', '\\t', $t);\r\n\treturn $t;\r\n}", "function tlspi_make_text_area() { ?>\n\t<div class=\"wrap\"> \n\t\t<h1>The La Source Newspaper Post Importer</h1> \n \n\t\t<form method=\"post\" action=\"\"> \n\t\t\t<label>copy and paste document here... <br />\n\t\t\t<textarea rows=\"60\" cols=\"100\" name=\"preview\" id=\"code\" ></textarea> </label>\n\t\t\t\n\t\t\t<br> \n\t\t\t<input type =\"submit\" value=\"Preview\" name=\"submit\" class=\"button-primary\"> \n\t\t\t<br>\n\t\t</form> <br> \n\t\t<script>\n\t\t\tvar editor = CodeMirror.fromTextArea(document.getElementById(\"code\"), {\n\t\t\t\tmode: { name: \"xml\", alignCDATA: true},\n\t\t\t\tlineNumbers: true\n\t\t\t});\n\t\t</script>\n\t</div>\n<?php\n}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "public function getEditableText() {}", "function tep_cfg_textarea($text, $key = '') {\n $name = tep_not_null($key) ? 'configuration[' . $key . ']' : 'configuration_value';\n\n return HTML::textareaField($name, 35, 5, $text);\n }", "public function textArea ( \\r8\\Form\\TextArea $field )\n {\n $this->addField( \"textarea\", $field );\n }", "function olc_cfg_textarea($text) {\n\treturn olc_draw_textarea_field('configuration_value', false, 50, 5, $text);\n}", "function setTypeAsTextArea($rows = 4, $cols = 70) {\n\t\t$this->type = \"textarea\";\n\t\t$this->textarea_cols = $cols;\n\t\t$this->textarea_rows = $rows;\n\t}", "protected function process_header_textarea(import_settings $settings, $data, $name, $description, $options) {\r\n $result = $this->process_header_default($settings, $data, end(explode('_', __FUNCTION__)), $name, $description, $options);\r\n $result->param2 = 60;\r\n $result->param3 = 35;\r\n $result->param4 = 1;\r\n\r\n global $DB;\r\n $DB->update_record('data_fields', $result);\r\n return $result;\r\n }", "public function getTYPE_TEXT_AREA()\n {\n return self::TYPE_TEXT_AREA;\n }", "function make_form_row(){\n\t\t$index = $this->col_index;\n\t\t# remove the * at the start of the first line\n\t\t$this->col_data = preg_replace(\"/^\\*/\",\"\",$this->col_data);\n\t\t# split the lines and remove the * from each. The value in each line goes into the array $values\n\t\t$values = preg_split(\"/\\n\\*?/\", $this->col_data);\n\t\t# pad the values array to make sure there are 3 entries\n\t\t$values = array_pad($values, 3, \"\");\n\t\t\n\t\t/*\n\t\tmake three input boxes. TableEdit takes row input from an input array named field a \n\t\tvalue for a particular field[$index] can be an array\n\t\t\tfield[$index][] is the field name\n\t\t\t40 is the length of the box\n\t\t\t$value is the value for the ith line\n\t\t \n\t\t */\n\t\t $form = ''; #initialize\n\t\t foreach($values as $i => $value){\n\t\t\t$form .= \"$i:\".XML::input(\"field[$index][]\",40,$value, array('maxlength'=>255)).\"<br>\\n\";\n\t\t}\n\t\treturn $form;\n\t\n\t}", "function fbWriteTextarea($areaname, $html, $width, $height, $useRte, $emoticons)\r\n {\r\n // well $html is the $message to edit, generally it means in PLAINTEXT @FireBoard!\r\n global $editmode;\r\n // ERROR: mixed global $editmode\r\n global $fbConfig;\r\n\r\n // (JJ) JOOMLA STYLE CHECK\r\n if ($fbConfig->joomlastyle < 1) {\r\n $boardclass = \"fb_\";\r\n }\r\n ?>\r\n\r\n <tr class = \"<?php echo $boardclass; ?>sectiontableentry1\">\r\n <td class = \"fb_leftcolumn\" valign = \"top\">\r\n <strong><a href = \"<?php echo sefRelToAbs(JB_LIVEURLREL.'&amp;func=faq').'#boardcode';?>\"><?php echo _COM_BOARDCODE; ?></a></strong>:\r\n </td>\r\n\r\n <td>\r\n <table border = \"0\" cellspacing = \"0\" cellpadding = \"0\" class = \"fb-postbuttonset\">\r\n <tr>\r\n <td class = \"fb-postbuttons\">\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"b\" name = \"addbbcode0\" value = \" B \" style = \"font-weight:bold; \" onclick = \"bbstyle(0)\" onmouseover = \"helpline('b')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"i\" name = \"addbbcode2\" value = \" i \" style = \"font-style:italic; \" onclick = \"bbstyle(2)\" onmouseover = \"helpline('i')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"u\" name = \"addbbcode4\" value = \" u \" style = \"text-decoration: underline;\" onclick = \"bbstyle(4)\" onmouseover = \"helpline('u')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"q\" name = \"addbbcode6\" value = \"Quote\" onclick = \"bbstyle(6)\" onmouseover = \"helpline('q')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"c\" name = \"addbbcode8\" value = \"Code\" onclick = \"bbstyle(8)\" onmouseover = \"helpline('c')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"k\" name = \"addbbcode10\" value = \"ul\" onclick = \"bbstyle(10)\" onmouseover = \"helpline('k')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"o\" name = \"addbbcode12\" value = \"ol\" onclick = \"bbstyle(12)\" onmouseover = \"helpline('o')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"l\" name = \"addbbcode18\" value = \"li\" onclick = \"bbstyle(18)\" onmouseover = \"helpline('l')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"p\" name = \"addbbcode14\" value = \"Img\" onclick = \"bbstyle(14)\" onmouseover = \"helpline('p')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"w\" name = \"addbbcode16\" value = \"URL\" style = \"text-decoration: underline; \" onclick = \"bbstyle(16)\" onmouseover = \"helpline('w')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"h\" name = \"addbbcode24\" value = \"Hide\" onclick = \"bbstyle(20)\" onmouseover = \"helpline('h')\"/>\r\n\r\n &nbsp;<?php echo _SMILE_COLOUR; ?>:\r\n\r\n <select name = \"addbbcode20\"\r\n onchange = \"bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');\" onmouseover = \"helpline('s')\" class = \"<?php echo $boardclass;?>slcbox\">\r\n <option style = \"color:black; background-color: #FAFAFA\" value = \"\"><?php echo _COLOUR_DEFAULT; ?></option>\r\n\r\n <option style = \"color:#FF0000; background-color: #FAFAFA\" value = \"#FF0000\"><?php echo _COLOUR_RED; ?></option>\r\n\r\n <option style = \"color:#800080; background-color: #FAFAFA\" value = \"#800080\"><?php echo _COLOUR_PURPLE; ?></option>\r\n\r\n <option style = \"color:#0000FF; background-color: #FAFAFA\" value = \"#0000FF\"><?php echo _COLOUR_BLUE; ?></option>\r\n\r\n <option style = \"color:#008000; background-color: #FAFAFA\" value = \"#008000\"><?php echo _COLOUR_GREEN; ?></option>\r\n\r\n <option style = \"color:#FFFF00; background-color: #FAFAFA\" value = \"#FFFF00\"><?php echo _COLOUR_YELLOW; ?></option>\r\n\r\n <option style = \"color:#FF6600; background-color: #FAFAFA\" value = \"#FF6600\"><?php echo _COLOUR_ORANGE; ?></option>\r\n\r\n <option style = \"color:#000080; background-color: #FAFAFA\" value = \"#000080\"><?php echo _COLOUR_DARKBLUE; ?></option>\r\n\r\n <option style = \"color:#825900; background-color: #FAFAFA\" value = \"#825900\"><?php echo _COLOUR_BROWN; ?></option>\r\n\r\n <option style = \"color:#9A9C02; background-color: #FAFAFA\" value = \"#9A9C02\"><?php echo _COLOUR_GOLD; ?></option>\r\n\r\n <option style = \"color:#A7A7A7; background-color: #FAFAFA\" value = \"#A7A7A7\"><?php echo _COLOUR_SILVER; ?></option>\r\n </select>\r\n\r\n &nbsp;<?php echo _SMILE_SIZE; ?>:\r\n\r\n <select name = \"addbbcode22\" onchange = \"bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')\" onmouseover = \"helpline('f')\" class = \"<?php echo $boardclass;?>button\">\r\n <option value = \"1\"><?php echo _SIZE_VSMALL; ?></option>\r\n\r\n <option value = \"2\"><?php echo _SIZE_SMALL; ?></option>\r\n\r\n <option value = \"3\" selected = \"selected\"><?php echo _SIZE_NORMAL; ?></option>\r\n\r\n <option value = \"4\"><?php echo _SIZE_BIG; ?></option>\r\n\r\n <option value = \"5\"><?php echo _SIZE_VBIG; ?></option>\r\n </select>\n\n\t\t\t\t\t<?php if ($fbConfig->showspoilertag) {?>\n <script type=\"text/javascript\">\n\t\t\t\t\t\tfunction fb_spoiler_help() {document.postform.helpbox.value = 'Spoiler: [spoiler] ... [/spoiler]';}\n\t\t\t\t\t</script>\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"s\" name = \"addbbcode40\" value = \"Spoiler\" onclick = \"bbfontstyle('[spoiler]', '[/spoiler]')\" onmouseover = \"fb_spoiler_help()\"/>\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php if ($fbConfig->showebaytag) {?>\n <script type=\"text/javascript\">\n\t\t\t\t\t\tfunction fb_ebay_help() {document.postform.helpbox.value = 'eBay: [ebay]ItemId[/ebay]';}\n\t\t\t\t\t</script>\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"e\" name = \"addbbcode30\" value = \"eBay\" onclick = \"bbfontstyle('[ebay]', '[/ebay]')\" onmouseover = \"fb_ebay_help()\"/>\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php if ($fbConfig->showvideotag) {?>\n &nbsp;<span style=\"white-space:nowrap;\">\r\n\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\tfunction fb_vid_help1() {document.postform.helpbox.value = 'Video: [video type=provider size=100 width=480 height=360]xyz[/video]';}\r\n\t\t\t\t\t\tfunction fb_vid_help2() {document.postform.helpbox.value = 'Video: [video size=100 width=480 height=360]http://myvideodomain.com/myvideo[/video]';}\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\t<a href = \"javascript: bbfontstyle('[video]', '[/video]')\" onmouseover = \"fb_vid_help2()\">Video:</a>\r\n\t\t\t\t\t<select name = \"fb_vid_code1\" onchange = \"bbfontstyle('[video type=' + this.form.fb_vid_code1.options[this.form.fb_vid_code1.selectedIndex].value, '[/video]');\" onmouseover = \"fb_vid_help1()\" class = \"<?php echo $boardclass;?>button\">\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$vid_provider = array('','AnimeEpisodes','Biku','Bofunk','Break','Clip.vn','Clipfish','Clipshack','Collegehumor','Current',\r\n\t\t\t\t\t\t\t'DailyMotion','DivX,divx]http://','DownloadFestival','Flash,flash]http://','FlashVars,flashvars param=]http://','Fliptrack',\r\n\t\t\t\t\t\t\t'Fliqz','Gametrailers','Gamevideos','Glumbert','GMX','Google','GooglyFoogly','iFilm','Jumpcut','Kewego','LiveLeak','LiveVideo',\r\n\t\t\t\t\t\t\t'MediaPlayer,mediaplayer]http://','MegaVideo','Metacafe','Mofile','Multiply','MySpace','MyVideo','QuickTime,quicktime]http://','Quxiu',\r\n\t\t\t\t\t\t\t'RealPlayer,realplayer]http://','Revver','RuTube','Sapo','Sevenload','Sharkle','Spikedhumor','Stickam','Streetfire','StupidVideos','Toufee','Tudou',\r\n\t\t\t\t\t\t\t'Unf-Unf','Uume','Veoh','VideoclipsDump','Videojug','VideoTube','Vidiac','VidiLife','Vimeo','WangYou','WEB.DE','Wideo.fr','YouKu','YouTube');\r\n\t\t\t\t\t\tforeach($vid_provider as $vid_type) {\r\n\t\t\t\t\t\t\tlist($vid_name, $vid_type) = explode(',', $vid_type);\r\n\t\t\t\t\t\t\techo '<option value = \"'.(($vid_type)?$vid_type:strtolower($vid_name).']').'\">'.$vid_name.'</option>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t</select></span>\r\n\t\t\t\t\t<?php } ?>\n\r\n &nbsp;&nbsp;<a href = \"javascript: bbstyle(-1)\"onmouseover = \"helpline('a')\"><small><?php echo _BBCODE_CLOSA; ?></small></a>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td class = \"<?php echo $boardclass;?>posthint\">\r\n <input type = \"text\" name = \"helpbox\" size = \"45\" class = \"<?php echo $boardclass;?>inputbox\" maxlength = \"100\" value = \"<?php echo _BBCODE_HINT;?>\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n\r\n <tr class = \"<?php echo $boardclass; ?>sectiontableentry2\">\r\n <td valign = \"top\" class = \"fb_leftcolumn\">\r\n <strong><?php echo _MESSAGE; ?></strong>:\r\n\r\n <?php\r\n if ($emoticons != 1)\r\n {\r\n ?>\r\n\r\n <br/>\r\n\r\n <br/>\r\n\r\n <div align = \"right\">\r\n <table border = \"0\" cellspacing = \"3\" cellpadding = \"0\">\r\n <tr>\r\n <td colspan = \"4\" style = \"text-align: center;\">\r\n <strong><?php echo _GEN_EMOTICONS; ?></strong>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <?php\r\n generate_smilies(); //the new function Smiley mod\r\n ?>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <?php\r\n }\r\n ?>\r\n </td>\r\n\r\n <td valign = \"top\">\r\n <textarea class = \"<?php echo $boardclass;?>txtarea\" name = \"<?php echo $areaname;?>\" id = \"<?php echo $areaname;?>\"><?php echo htmlspecialchars($html, ENT_QUOTES); ?></textarea>\r\n<?php\r\nif ($editmode) {\r\n // Moderator edit area\r\n ?>\r\n <fieldset>\r\n <legend><?php echo _FB_EDITING_REASON?></legend>\r\n <input name=\"modified_reason\" size=\"40\" maxlength=\"200\" type=\"text\"><br />\r\n\r\n </fieldset>\r\n<?php\r\n}\r\n?>\r\n </td>\r\n </tr>\r\n\r\n<?php\r\n }", "public function it_shows_textarea_input()\n {\n // configure\n $inputs = [\n [\n 'type' => 'textarea',\n 'name' => 'message'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('textarea')\n ->assertSee('message');\n }", "public static function getTextArea($namespace, &$columns, $fieldName) {\n\t\t$configuration = self::getCommonConfiguration($columns, $fieldName, $namespace);\n\t\t$tca = $columns[$fieldName]['config'];\n\n\t\t// Set default xtype\n\t\t$configuration['xtype'] = 'textarea';\n\t\tif (isset($tca['height'])) {\n\t\t\t$configuration['height'] = (int) $tca['height'];\n\t\t}\n\t\t$configuration['enableKeyEvents'] = TRUE;\n\n\t\treturn $configuration;\n\t}", "function setting_textarea( $option ) {\n\n\t\t$value = $this->pretty_print(get_option( $option ));\n?>\n\t<textarea name=\"<?php echo $option; ?>\"><?php echo $value;\n?></textarea>\n<?php\n\t}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function import_blog_text(&$Db_object, &$databasetype, &$tableprefix)\n\t{\n\t\t// Check the dupe\n\t\tif (dupe_checking AND !($this->_dupe_checking === false OR $this->_dupe_checking['pmtext'] === false))\n\t\t{\n\t\t\t$there = $Db_object->query_first(\"\n\t\t\t\tSELECT blogtextid\n\t\t\t\tFROM \" . $tableprefix . \"blog_text\n\t\t\t\tWHERE importblogtextid = \" . intval(trim($this->get_value('mandatory', 'importblogtextid'))) . \"\n\t\t\t\");\n\n\t\t\tif (is_numeric($there[0]))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$Db_object->query(\"\n\t\t\tINSERT INTO \" . $tableprefix . \"blog_text\n\t\t\t\t(blogid, userid, dateline, pagetext, title, state, allowsmilie, username, ipaddress, reportthreadid, bloguserid, importblogtextid)\n\t\t\tVALUES\n\t\t\t\t(\" . intval($this->get_value('mandatory', 'blogid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'userid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'dateline')) . \",\n\t\t\t\t'\" . addslashes($this->get_value('mandatory', 'pagetext')) . \"',\n\t\t\t\t'\" . addslashes($this->get_value('mandatory', 'title')) . \"',\n\t\t\t\t'\" . $this->enum_check($this->get_value('mandatory', 'state'), array('moderation','visible','deleted'), 'visible') . \"',\n\t\t\t\t\" . intval($this->get_value('nonmandatory', 'allowsmilie')) . \",\n\t\t\t\t'\" . addslashes($this->get_value('nonmandatory', 'username')) . \"',\n\t\t\t\t\" . intval(sprintf('%u', ip2long($this->get_value('nonmandatory', 'ipaddress')))) . \",\n\t\t\t\t\" . intval($this->get_value('nonmandatory', 'reportthreadid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'bloguserid')) . \",\n\t\t\t\t\" . intval($this->get_value('mandatory', 'importblogtextid')) . \")\n\t\t\");\n\n\t\tif ($Db_object->affected_rows())\n\t\t{\n\t\t\treturn $Db_object->insert_id();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function it_can_create_a_textarea(): void\n {\n static::assertHtmlStringEqualsHtmlString(\n '<textarea></textarea>',\n $this->html->textarea()\n );\n }", "function textAreaEntry($display,$name,$entries,$errors,$cols=45,$rows=5)\n{\n\t$returnVal = \"\n\t<tr>\n\t\t<td colspan='2'>$display:</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan='2'>\n\t\t\t<textarea name='$name' cols='$cols' rows='$rows'>\";\n\t\t\t$returnVal .= $entries[$name];\n\t\t\t$returnVal .= \"</textarea>\n\t\t</td>\n\t</tr>\";\n\n\tif (array_key_exists($name,$errors))\n\t{\n\t\t$returnVal .= addErrorRow($name,$errors);\n\t}\n\treturn $returnVal;\n}", "public function import()\n {\n return !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? self::rows() : 'files.rows.table_import';\n }", "function greater_jackson_habitat_extra_metabox_content() {\n\t\n\tgreater_jackson_habitat_do_field_textarea( array(\n\t\t'name' => 'gjh_extra',\n\t\t'group' => 'gjh_extra',\n\t\t'wysiwyg' => true,\n\t) );\n\t\n\tgreater_jackson_habitat_init_field_group( 'gjh_extra' );\n\t\n}", "public function loadDatabase(){\n $table = new Table('Textarea_Widgets');\n $table->add_column('Title', 'text');\n $table->add_column('Content', 'text');\n $table->add_column('WidgetName', 'text');\n $table->create();\n }", "function acf_get_textarea_input($attrs = array())\n{\n}", "function pieform_element_textarea(Pieform $form, $element) {/*{{{*/\n global $_PIEFORM_TEXTAREAS;\n $rows = $cols = $style = '';\n if (isset($element['height'])) {\n $style .= 'height:' . $element['height'] . ';';\n $rows = (intval($element['height'] > 0)) ? ceil(intval($element['height']) / 10) : 1;\n }\n elseif (isset($element['rows'])) {\n $rows = $element['rows'];\n }\n else {\n Pieform::info('No value for rows or height specified for textarea \"' . $element['name'] . '\"');\n }\n\n if (isset($element['width'])) {\n $style .= 'width:' . $element['width'] . ';';\n $cols = (intval($element['width'] > 0)) ? ceil(intval($element['width']) / 10) : 1;\n }\n elseif (isset($element['cols'])) {\n $cols = $element['cols'];\n }\n else {\n Pieform::info('No value for cols or width specified for textarea \"' . $element['name'] . '\"');\n }\n $element['style'] = (isset($element['style'])) ? $style . $element['style'] : $style;\n\n if (!empty($element['resizable'])) {\n $element['class'] = (isset($element['class']) && $element['class']) ? $element['class'] . ' resizable' : 'resizable';\n $_PIEFORM_TEXTAREAS[] = array('formname' => $form->get_name(), 'elementname' => $form->get_name() . '_' . $element['id']);\n }\n\n return '<textarea'\n . (($rows) ? ' rows=\"' . $rows . '\"' : '')\n . (($cols) ? ' cols=\"' . $cols . '\"' : '')\n . $form->element_attributes($element, array('maxlength', 'size'))\n . '>' . Pieform::hsc($form->get_value($element)) . '</textarea>';\n}", "public function renderDataCellContent($model, $key, $index)\n {\n // @link https://github.com/yii2tech/csv-grid/issues/23\n $value = parent::renderDataCellContent($model, $key, $index);\n return (is_numeric($value) && strlen($value) > 14) ? ($value . \"\\t\") : $value;\n }", "function import_ch8bt_bug() {\r\n if ( !current_user_can( 'manage_options' ) ) {\r\n wp_die( 'Not allowed' );\r\n }\r\n \r\n // Check if nonce field is present \r\n check_admin_referer( 'ch8bt_import' ); \r\n \r\n // Check if file has been uploaded \r\n if( array_key_exists( 'import_bugs_file', $_FILES ) ) { \r\n // If file exists, open it in read mode \r\n $handle = fopen( $_FILES['import_bugs_file']['tmp_name'], 'r' ); \r\n \r\n // If file is successfully open, extract a row of data \r\n // based on comma separator, and store in $data array \r\n if ( $handle ) { \r\n while ( ( $data = fgetcsv( $handle, 5000, ',' ) ) !== FALSE ) { \r\n $row += 1; \r\n \r\n // If row count is ok and row is not header row \r\n // Create array and insert in database \r\n if ( count( $data ) == 4 && $row != 1 ) { \r\n $new_bug = array( \r\n 'bug_title' => $data[0], \r\n 'bug_description' => $data[1], \r\n 'bug_version' => $data[2], \r\n 'bug_status' => $data[3], \r\n 'bug_report_date' => date( 'Y-m-d' ) ); \r\n \r\n global $wpdb; \r\n \r\n $wpdb->insert( $wpdb->get_blog_prefix() . \r\n 'ch8_bug_data', $new_bug ); \r\n } \r\n } \r\n } \r\n } \r\n \r\n // Redirect the page to the user submission form \r\n wp_redirect( add_query_arg( 'page', 'ch8bt-bug-tracker', \r\n admin_url( 'options-general.php' ) ) ); \r\n exit; \r\n}", "function textarea($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\t\techo \"<textarea data-tooltip='\" .$args['tooltip'] . \"' name='\" . $args['formname'] . \"' style='\" . $this->width($args['width']) . \" \" . $this->height($args['height']) . \"' rows='7' cols='50' type='textarea'>\" . $args['value'] . \"</textarea>\";\t\t\t\r\n\t\t\t$this->description($args['description']);\r\n\t\t\t}", "function import_text( $text ) {\r\n // quick sanity check\r\n if (empty($text)) {\r\n return '';\r\n }\r\n $data = $text[0]['#'];\r\n return addslashes(trim( $data ));\r\n }", "function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}", "function testGuessTextarea() {\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.text'), 'editor');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.content'), 'editor');\n\t}", "public static function loadEditArea($cfg)\n {\n $document = JFactory::getDocument();\n $document->addScript(JURI::root(true).$cfg['path'].'/'.$cfg['type']);\n\n $translates = array('txt' => 'brainfuck'\n , 'pot' => 'po');\n\n// if(array_key_exists($cfg['syntax'], $translates))\n $syntax =(array_key_exists($cfg['syntax'], $translates)) ? $translates[$cfg['syntax']] : $cfg['syntax'];\n\n// $syntax =(in_array($cfg['syntax'], $translates)) ? $cfg['syntax'] : 'brainfuck';\n\n $debug =(ECR_DEBUG) ? ',debug: true'.NL : '';\n\n $js = <<<EOF\n <!-- **************** -->\n <!-- **** load **** -->\n <!-- *** EditArea *** -->\n <!-- **************** -->\n editAreaLoader.init({\n id : \"{$cfg['textarea']}\"\n ,syntax: \"$syntax\"\n ,start_highlight: true\n ,replace_tab_by_spaces: 3\n ,end_toolbar: 'html_select, autocompletion'\n ,plugins: \"html, autocompletion\"\n ,autocompletion: true\n ,font_size: {$cfg['font-size']}\n // ,is_multi_files: true\n $debug\n });\nEOF;\n\n $document->addScriptDeclaration($js);\n\n ecrScript('editor');\n }", "public function __construct($value = \"\", $name = \"\", $label = \"\", \n $className = \"\", $columns = -1, \n $rows = -1, $isDisabled = false)\n {\n $this->setFieldType(\"textarea\");\n $this->setValue($value);\n $this->setName($name);\n $this->setLabel($label);\n $this->setClassName($className);\n $this->setIsDisabled($isDisabled);\n $this->setColumns($columns);\n $this->setRows($rows);\n }", "function callback_textarea(array $args)\n {\n }", "public function textarea($element) {\n $element['#type'] = 'textarea';\n if (!isset($element['#attributes']['rows'])) {\n $element['#attributes']['rows'] = 5;\n }\n if (!isset($element['#attributes']['cols'])) {\n $element['#attributes']['cols'] = 1;\n }\n $element = $this->_setRender($element);\n $element['_render']['element'] = '<textarea id=\"' . $element['#id']\n . '\" name=\"' . $element['#name'] . '\"'\n . $element['_attributes_string'];\n /**\n * type and data_id\n */\n $element['_render']['element'] .= sprintf(' data-wpt-type=\"%s\"', __FUNCTION__);\n $element['_render']['element'] .= $this->_getDataWptId($element);\n\n $element['_render']['element'] .= '>';\n\n $element['_render']['element'] .= isset($element['#value']) ? esc_attr($element['#value']) : '';\n $element['_render']['element'] .= '</textarea>' . \"\\r\\n\";\n $pattern = $this->_getStatndardPatern($element);\n $output = $this->_pattern($pattern, $element);\n $output = $this->_wrapElement($element, $output);\n return $output . \"\\r\\n\";\n }", "function _field_textarea($fval) \n {\n $fval = (empty($fval) && !empty($this->opts))? $this->opts : $fval;\n\n if (!isset($this->attribs['rows'])) {\n $this->attribs['rows'] = 6;\n }\n if (!isset($this->attribs['wrap'])) {\n $this->attribs['wrap'] = 'virtual';\n }\n return sprintf(\"<textarea %s rows=\\\"%d\\\" cols=\\\"%d\\\" name=\\\"%s\\\" id=\\\"%s\\\" class=\\\"%s\\\" %s>%s</textarea>\",\n ($this->fex->strict_xhtml_mode)? '' : 'wrap=\"'.$this->attribs['wrap'].'\"',\n $this->attribs['rows'],\n (!empty($this->attribs['cols']))? $this->attribs['cols'] : $this->max_size,\n $this->fname,\n $this->fname,\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs,\n $this->_htmlentities($fval));\n }", "public function save() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\tif ($this->rows) {\n\t\t\t$fp = fopen($this->filepath, 'w');\n\t\t\t$rowcount = count($this->rows);\n\t\t\tfor ($index = 0; $index < $rowcount; ++$index) {\n\t\t\t\t$row = $this->rows[$index];\n\t\t\t\tif ($row->isEditable()) {\n\t\t\t\t\t$variableName = $row->variableName();\n\t\t\t\t\t$pattern = '/\\$'.$variableName.'[\\s]+=([^;]+);/';\n\t\t\t\t\t$replacement = $row->toString();\n\t\t\t\t\t$fileContent = preg_replace($pattern, $replacement, $fileContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfwrite($fp, $fileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "public function getTextSourceField() {}", "function dokan_posted_textarea( $key ) {\n $value = isset( $_POST[$key] ) ? trim( $_POST[$key] ) : '';\n\n return esc_textarea( $value );\n}", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "function areatext($text,$type)\n {\n\tif($text!=null)\n\t{\n\t\tif($type='edit')\n\t\t{\n\t\t\t$valeur = htmlspecialchars(bbcodereverse(remplacer($text)));\n\t\t}\n\t\t\n\t\tif($type ='quote')\n\t\t{\n\t\t\t$valeur =\"[quote]\";\n\t\t\t$valeur .=htmlspecialchars(bbcodereverse(remplacer($text)));\n\t\t\t$valeur .=\"[/quote]\";\n\t\t}\n\t}\n\t\t\t\t\t$textarea .='<tr class=\"title2\">';\n\t\t\t\t\t$textarea .='<td colspan=\"2\" height=\"25px\">';\n\t\t\t\t\t$textarea .='<ul class=\"balise\">';\n\t\t\t\t\t//\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[b]cry[/b]')\\\"><b>G</b></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[u]cry[/u]')\\\"><span style=\\\"text-decoration:underline;\\\">S</span></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[s]cry[/s]')\\\"><span style=\\\"text-decoration: line-through;\\\">S</span></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[i]cry[/i]')\\\"><i>I</i></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[url]adresse de l url[/url]')\\\">insérer une adresse url</div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[image]adresse de l image[/image]')\\\">insérer une image</div></li>\";\n\t\t\t\t\t//les couleurs\n\t\t\t\t\t$textarea .=\"<li>\";\n\t\t\t\t\t$textarea .=\"<select>\";\n\t\t\t\t\t$textarea .=\"<OPTION VALUE=\\\"rouge\\\" onClick=\\\"addForum('[color=red]cry[/color]')\\\"><span style=\\\"color:red;\\\">rouge</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"bleu\\\" onClick=\\\"addForum('[color=blue]cry[/color]')\\\"><span style=\\\"color:blue;\\\">bleu</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"vert\\\" onClick=\\\"addForum('[color=green]cry[/color]')\\\"><span style=\\\"color:green;\\\">vert</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"lime\\\" onClick=\\\"addForum('[color=lime]cry[/color]')\\\"><span style=\\\"color:lime;\\\">lime</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"jaune\\\" onClick=\\\"addForum('[color=jaune]cry[/color]')\\\"><span style=\\\"color:yellow;\\\">jaune</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"orange\\\" onClick=\\\"addForum('[color=orange]cry[/color]')\\\"><span style=\\\"color:orange;\\\">orange</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"autres\\\" onClick=\\\"addForum('[color=#]cry[/color]')\\\">Autres</OPTION>\";\n\t\t\t\t\t// $textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[color]votre texte[/color]')\\\">couleur</div></li>\";\n\t\t\t\t\t$textarea .=\"</select>\";\n\t\t\t\t\t$textarea .=\"</li>\";\n\t\t\t\t\t//fin des couleurs\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[list][*][*][*][/list]')\\\">insérer une list</div></li>\";\n\t\t\t\t\t//\n\t\t\t\t\t$textarea .='</ul>';\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='</tr>';\n\t\t\t\t\t$textarea .= $error2;\n\t\t\t\t\t$textarea .='<tr>';\n\t\t\t\t\t$textarea .='<td>';\n\t\t\t\t\t$textarea .='<h2>Smiley</h2>';\n\t\t\t\t\t$textarea .=\"<p><table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/cry.png\\\" alt=\\\"pleuré\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]cry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/dangerous.png\\\" alt=\\\"Dangereux\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]dangerous[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/evil.png\\\" alt=\\\"demon\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]evil[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>cry</td>\n\t\t\t\t\t\t\t\t\t\t<td>dangerous</td>\n\t\t\t\t\t\t\t\t\t\t<td>evil</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/gomennasai.png\\\" alt=\\\"gomennasai\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]gomennasai[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/hoho.png\\\" alt=\\\"hoho\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]hoho[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/nyu.png\\\" alt=\\\"nyu\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]nyu[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>gomennasai</td>\n\t\t\t\t\t\t\t\t\t\t<td>hoho</td>\n\t\t\t\t\t\t\t\t\t\t<td>nyu</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/reallyangry.png\\\" alt=\\\"en colere\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]reallyangry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/shamed.png\\\" alt=\\\"géné\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]shamed[/smiley]')\\\" /></td>\t\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/socute.png\\\" alt=\\\"adoré\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]socute[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>reallyangry</td>\n\t\t\t\t\t\t\t\t\t\t<td>shamed</td>\t\n\t\t\t\t\t\t\t\t\t\t<td>socute</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/sorry.png\\\" alt=\\\"désolé\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]sorry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/what.png\\\" alt=\\\"quoi\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]what[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/xd.png\\\" alt=\\\"xd\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]xd[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>sorry</td>\n\t\t\t\t\t\t\t\t\t\t<td>what</td>\n\t\t\t\t\t\t\t\t\t\t<td>xd</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table></p>\";\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='<td>';\n\t\t\t\t\t$textarea .='<h2>message</h2>';\n\t\t\t\t\t$textarea .='<p><TEXTAREA name=\"messages\" id=\"messages\" rows=20 COLS=80>'.$valeur.'</TEXTAREA></p>';\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='</tr>';\n\t\t\t\t\t\n\treturn $textarea;\n}", "function get_textarea_questions($form_id){\n $this->db->select('questions.question_label, questions.question_type, questions.question_id');\n $this->db->from('questions');\n $this->db->where('questions.question_form', $form_id);\n $this->db->where('questions.question_type', 'textarea');\n\n return $this->db->get()->result_array();\n }", "function hudson_textarea($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'cols', 'rows'));\n _form_set_class($element, array('form-textarea'));\n\n $wrapper_attributes = array(\n 'class' => array('form-textarea-wrapper'),\n );\n\n $output = '<div' . drupal_attributes($wrapper_attributes) . '>';\n $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';\n $output .= '</div>';\n return $output;\n}", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "function origin_parse()\n\t\t{\n\t\t\t$text_data = $this->calendar->get_text_data();\n\t\t\t\n\t\t\t// loop through each text row and parse it into feilds\n\t\t\tforeach($text_data as $single_column)\n\t\t\t{\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$base_info = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+2);\n\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\n\t\t\t\t$code = substr($single_column->text_column, $location+1, ($location_2 - ($location)));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$city = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$state_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\tif(strpos($single_column->text_column, ',y,') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 4);\n\t\t\t\t\t\n\t\t\t\t} else if(strpos($single_column->text_column, ',n') !== FALSE ) {\n\t\t\t\t\t\n\t\t\t\t\t$on_site = 0;\n\t\t\t\t\t$single_column->text_column = substr($single_column->text_column, 3);\n\t\t\t\t} else {\n\t\t\t\t\t$on_site = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, '\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$address = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\n\t\t\t\t$location_2 = strpos($single_column->text_column, ',\"');\n\t\t\t\t$phone_number = substr($single_column->text_column, 0, $location_2);\t\t\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',\"');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+2);\n\t\t\t\t$location_2 = strpos($single_column_part, '\"');\n\t\t\t\t$proper_data = substr($single_column->text_column, $location+2, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+3);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$start_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$end_time = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$course_code = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$instructor = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\t\t\t\t\n\t\t\t\t$course_cost = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\n\t\t\t\t$location = strpos($single_column->text_column, ',');\n\t\t\t\t$single_column_part = substr($single_column->text_column, $location+1);\n\t\t\t\t$location_2 = strpos($single_column_part, ',');\n\t\t\t\t$random_zero = substr($single_column->text_column, $location+1, $location_2 - ($location));\n\t\t\t\t$single_column->text_column = substr($single_column->text_column, $location_2+1);\n\t\t\t\t\t\t\t\n\t\t\t\t$description = substr($single_column->text_column, 2, (strlen($single_column->text_column) - 2));\n\t\n\t\t\t\t// setup the structure of a single new event parsed out as columns that have meaning\n\t\t\t\t$constructed_cal_row = array(\n\t\t\t\t\t'base_info' \t\t=> $base_info,\n\t\t\t\t\t'code'\t\t\t\t=> $code,\n\t\t\t\t\t'city' \t\t\t\t=> $city,\n\t\t\t\t\t'state_code'\t\t=> $state_code,\n\t\t\t\t\t'on_site'\t\t\t=> $on_site,\n\t\t\t\t\t'address'\t\t\t=> $address,\n\t\t\t\t\t'phone_number'\t\t=> $phone_number,\n\t\t\t\t\t'proper_data'\t\t=> $proper_data,\n\t\t\t\t\t'start_time'\t\t=> $start_time,\n\t\t\t\t\t'end_time'\t\t\t=> $end_time,\n\t\t\t\t\t'course_code'\t\t=> $course_code,\n\t\t\t\t\t'instructor'\t\t=> $instructor,\n\t\t\t\t\t'course_cost'\t\t=> $course_cost,\n\t\t\t\t\t'random_zero'\t\t=> $random_zero,\n\t\t\t\t\t'decsription'\t\t=> $description\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// add that row to something that we can use\n\t\t\t\t$this->calendar->insert_calendar($constructed_cal_row);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->test('Done!');\n\t\t}", "public function run()\n { if (!version_compare($this->from_version, '7.0', '<')) {\n return;\n }\n \n $this->log(\"Fixing 6.x custom text area fields.\");\n $sql = \"UPDATE fields_meta_data \" .\n \"SET ext1 = '', \" .\n \"ext4 = '', \" .\n \"default_value = '' \" .\n \"WHERE type = 'text' \" .\n \"AND ext1 is null \" .\n \"AND ext4 is null\";\n \n $r = $this->db->query($sql);\n $this->log(\"Updated \" . $this->db->getAffectedRowCount($r) . \" Rows\");\n $this->log(\"Done Fixing 6.x custom text area fields.\");\n }", "public function add_textarea_field_to_group($group_name,$field_name,$rows,$columns) {\n foreach(array_keys($this->page_fields) as $i) {\n if ($this->page_fields[$i]['sub_heading']==$group_name) {\n $this->page_fields[$i]['fields'][]=array('field_name'=>$field_name,'field_type'=>'textarea','rows'=>$rows,'columns'=>$columns);\n return true;\n }\n }\n error_log(\"BasicForm: add_textarea_field_to_group: Attempt was made to add a textarea field ($field_name) to a group which couldnt be found ($group_name)\");\n return false;\n }", "public function callback_textarea( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n\n $html = sprintf( '<textarea rows=\"5\" cols=\"55\" class=\"%1$s-text\" id=\"%2$s\" name=\"%2$s\" %4$s>%3$s</textarea>', $size, $name_id, $value, $disable );\n $html .= $this->get_field_description( $args );\n\n echo $html;\n }", "public function importRobotsTxt(\\DataContainer $dc)\n {\n if (\\Input::get('key') != 'importRobotsTxt')\n {\n return '';\n }\n \n if (!file_exists(TL_ROOT . \"/\" . FILE_ROBOTS_TXT_DEFAULT))\n {\n \\Message::addError($GLOBALS['TL_LANG']['ERR']['no_robotstxt_default']);\n $this->redirect(str_replace('&key=importRobotsTxt', '', \\Environment::get('request')));\n }\n\n $objVersions = new \\Versions($dc->table, \\Input::get('id'));\n $objVersions->create();\n \n $strFileContent = file_get_contents(TL_ROOT . \"/\" . FILE_ROBOTS_TXT_DEFAULT);\n\n \\Database::getInstance()->prepare(\"UPDATE \" . $dc->table . \" SET robotsTxtContent=? WHERE id=?\")\n ->execute($strFileContent, \\Input::get('id'));\n\n $this->redirect(str_replace('&key=importRobotsTxt', '', \\Environment::get('request')));\n }", "function validate_textarea_field($field)\n {\n }", "function esc_textarea($text)\n {\n }", "function acf_textarea_input($attrs = array())\n{\n}", "function standardTableRowTextarea ($name, $dictionary, $action, $item)\n{\n\t$stringUtils = new StringUtils ();\n\t$result = '<tr>';\n\n\t//\n\t// First field contains the name\n\t//\n\t$result .= '<td class=\"inputParamName\">'.$dictionary[$name].':</td>';\n\n\t//\n\t// Second field contains the value\n\t//\n\t$result .= '<td>';\n\tif ($action == 'add' || $action == 'modify')\n\t{\n\t\t$result .= '<textarea ';\n\t\t$result .= 'name=\"'.$name.'\" ';\n\t\t$result .= 'id=\"'.$name.'\" ';\n\t\t$result .= '>';\n\t\t//\n\t\t// Fill in the value if we are modifying the item. This has no\n\t\t// use for adding...\n\t\t//\n\t\tif (($action == 'modify') || isset ($item))\n\t\t{\n\t\t\t$result .= $item->$name;\n\t\t}\n\t\t$result .= '</textarea>';\n\t}\n\telse if ($action == 'show')\n\t{\n\t\t$result .= $stringUtils->newlinesToHtml ($item->$name);\n\t}\n\t$result .= '</td>';\n\t$result .= '</tr>';\n\n\treturn $result;\n}", "function addTextarea($name,$display=null,$value=null, $disabled=null, $rows=3, $cols=25, $class=null, $id=null){\r\n\t\t\t$this->formFields[$name] = array(\r\n\t\t\t\t\"name\" => $name,\r\n\t\t\t\t\"type\" => \"textarea\", //defines the type of the input\r\n\t\t\t\t\"label\" => $display,\r\n\t\t\t\t\"value\" => $value,\r\n\t\t\t\t\"disabled\" => $disabled,\r\n\t\t\t\t\"rows\" => $rows,\r\n\t\t\t\t\"cols\" => $cols,\r\n\t\t\t\t\"class\" => $class,\r\n\t\t\t\t\"id\" => $id\r\n\t\t\t);\t\t\r\n\t\t\t\r\n\t\t\t//add class if null\r\n\t\t\tif($class == null){\r\n\t\t\t\t$this->formFields[$name][\"class\"] = \"c\" . $name;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add id\r\n\t\t\tif($id == null){\r\n\t\t\t\t$this->formFields[$name][\"id\"] = \"i\" . $name;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add display\r\n\t\t\tif($display == null){\r\n\t\t\t\t$this->formFields[$name][\"label\"] = ucfirst($name) . \":\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function mitextarea($name, $rows, $cols) {\n\treturn \"<textarea name=\\\"$name\\\" rows=\\\"$rows\\\" cols=\\\"$cols\\\">[{\" . $name . \"}]</textarea>[{\" . $name . \"_MOD}]\";\n}", "function string_textarea( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\treturn $p_string;\r\n}", "public function getEditRaw();", "function ctools_export_form($form, &$form_state, $code, $title = '') {\r\n $lines = substr_count($code, \"\\n\");\r\n $form['code'] = array(\r\n '#type' => 'textarea',\r\n '#title' => $title,\r\n '#default_value' => $code,\r\n '#rows' => $lines,\r\n );\r\n\r\n return $form;\r\n}", "static function dt_edit_text($title,$name,$value,$default = '',$size = 60,$rows = 1,$editor = 0,$comment='',$sub_item = '',$class_col1='col-md-2',$class_col2='col-md-10'){\n\t\tif(!isset($value))\n\t\t\t$value = $default;\n\t\t$value = html_entity_decode(stripslashes($value),ENT_COMPAT,'UTF-8');\n $html = '';\n\t\techo '<div class=\"form-group\">\n <label class=\"'.$class_col1.' col-xs-12 control-label\">'.$title.'</label>\n <div class=\"'.$class_col2.' col-xs-12\">\n ';\n\t\tif($rows > 1){\n\t\t\tif(!$editor){\n\t\t\t\techo '<textarea class=\"form-control\" rows=\"'.$rows.'\" cols=\"'.$size.'\" name=\"'.$name.'\" id=\"'.$name.'\" >'.$value.'</textarea>';\n\t\t\t} else {\n//\t\t\t\techo '<textarea rows=\"10\" cols=\"10\" name=\"'.$name.'\" id=\"'.$name.'\" >'.$value.'</textarea>';\n//\t\t\t\techo \"<script>CKEDITOR.replace( '\".$name.\"');</script>\";\n\t\t\t\t$k = 'oFCKeditor_'.$name;\n\t\t\t\t$oFCKeditor[$k] = new FCKeditor($name) ;\n\t\t\t\t$oFCKeditor[$k]->BasePath\t= '../libraries/wysiwyg_editor/' ;\n\t\t\t\t$oFCKeditor[$k]->Value\t\t= stripslashes(@$value);\n\t\t\t\t$oFCKeditor[$k]->Width = $size;\n\t\t\t\t$oFCKeditor[$k]->Height = $rows;\n\t\t\t\t$oFCKeditor[$k]->Create() ;\n\t\t\t}\n\t\t}else{\n\t\t\tif($name == 'price' || $name=='price_old'|| $name=='discount'){\n\t\t\t\tif($value)\n\t\t\t\t echo'<input type=\"text\" class=\"form-control\" name=\"'.$name.'\" id=\"'.$name.'\" value=\"'.format_money($value,'').'\" size=\"'.$size.'\"/>';\n\t\t\t\telse\n\t\t\t\t\t echo '<input type=\"text\" class=\"form-control\" name=\"'.$name.'\" id=\"'.$name.'\" value=\"'.htmlspecialchars($value).'\" size=\"'.$size.'\"/>';\n\t\t\t}else{\n\t\t\t\t\techo '<input type=\"text\" class=\"form-control\" name=\"'.$name.'\" id=\"'.$name.'\" value=\"'.htmlspecialchars($value).'\" size=\"'.$size.'\"/>'; \t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif($sub_item)\n\t\t\techo $sub_item;\n\t\tif($comment)\n\t\t\techo '<p class=\"help-block\">'.$comment.'</p>';\n\t\techo '</div></div>';\n //echo $html;\n\t}", "function s_m_put_txt_data_insert($rows, $columnames, $store_data){\r\n // only the data in $store_data\r\n // (not index by column name but column number!)\r\n $row_nr = count($rows);\r\n for($i = 0; $i < count($columnames); $i++){\r\n $this_value = \"\";\r\n if(isset($store_data[$i])){\r\n $this_value = $store_data[$i];\r\n }\r\n $rows[$row_nr][$columnames[$i]] = $this_value;\r\n }\r\n return $rows;\r\n}", "function form_textarea($name, $cols='30', $rows='5', $value='', $to_array='', $override = NULL, $extra='', $disabled='') {\n\n\t$value = html_form_escape($value, $override);\n\n\tif ($disabled) {\n\t\t$extra .= ' disabled=\"disabled\"';\n\t}\n\tif (is_numeric($cols)) {\n\t\t$cols = \"cols=\\\"$cols\\\"\";\n\t} elseif ($cols == '' OR $cols == 0) {\n\t\t$cols = \"cols=\\\"60\\\"\";\n\t} else {\n\t\t$cols = \"style=\\\"width:$cols\\\"\";\n\t}\n\tif ($rows == '' OR $rows == 0) {\n\t\t$rows = 5;\n\t}\n\tif ($to_array != \"\") {\n\t\t$name = $to_array . \"[\" . $name . \"]\";\n\t}\n\t$temp = \"<textarea onfocus=\\\"this.select()\\\" name=\\\"$name\\\" id=\\\"$name\\\" $cols rows=\\\"$rows\\\" $extra>$value</textarea>\\n\";\n\treturn $temp;\n}", "function ffw_port_textarea_callback( $args ) {\n global $ffw_port_settings;\n\n if ( isset( $ffw_port_settings[ $args['id'] ] ) )\n $value = $ffw_port_settings[ $args['id'] ];\n else\n $value = isset( $args['std'] ) ? $args['std'] : '';\n\n $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';\n $html = '<textarea class=\"large-text\" cols=\"50\" rows=\"5\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "public function loadRichTextEditor() {\n /* register JS scripts */\n $rte = isset($this->scriptProperties['which_editor']) ? $this->scriptProperties['which_editor'] : $this->modx->context->getOption('which_editor', '', $this->modx->_userConfig);\n \n $this->setPlaceholder('which_editor', $rte);\n /* Set which RTE if not core */\n if ($this->modx->context->getOption('use_editor', false, $this->modx->_userConfig) && !empty($rte)) {\n /* invoke OnRichTextEditorRegister event */\n $textEditors = $this->modx->invokeEvent('OnRichTextEditorRegister');\n $this->setPlaceholder('text_editors', $textEditors);\n\n $this->rteFields = array('exerplan-assessment-textarea');\n $this->setPlaceholder('replace_richtexteditor', $this->rteFields);\n\n /* invoke OnRichTextEditorInit event */\n $onRichTextEditorInit = $this->modx->invokeEvent('OnRichTextEditorInit', array(\n 'editor' => $rte,\n 'elements' => $this->rteFields,\n ));\n if (is_array($onRichTextEditorInit)) {\n $onRichTextEditorInit = implode('', $onRichTextEditorInit);\n $this->setPlaceholder('onRichTextEditorInit', $onRichTextEditorInit);\n }\n }\n }", "function Import() {\n // Fichier sql\n $filename = 'http://localhost/alumnus/alumnus.sql';\n\n // Connexion\n $bdd = new PDO('mysql:host=localhost; dbname=alumnus', 'root', '');\n // Variable temporaire stockant la requête (ligne par ligne)\n $templine = '';\n // Lecture entière du fichier\n $lines = file($filename);\n // Boucle à travers chaque ligne\n foreach ($lines as $line){\n // Passage à la ligne suivante si c'est un commentaire ('--' et '/* */') ou si la ligne est vide\n if (substr($line, 0, 2) == '--' || substr($line, 0, 2) == '/*' || $line == '')\n continue;\n\n // Ajout ou concaténation de la ligne au segment actuel\n $templine .= $line;\n // Détection de fin de ligne avec le point-virgule\n if (substr(trim($line), -1, 1) == ';') {\n // Exécution de la requête\n $bdd->exec($templine);\n // Réinitialisation de la variable temporaire\n $templine = '';\n }\n }\n\n // Déconnexion\n $bdd = null;\n}", "function minorite_textarea($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'cols', 'rows'));\n _form_set_class($element, array('form-textarea'));\n\n $wrapper_attributes = array(\n 'class' => array('form-textarea-wrapper'),\n );\n\n // Add resizable behavior.\n if (!empty($element['#resizable'])) {\n drupal_add_library('system', 'drupal.textarea');\n $wrapper_attributes['class'][] = 'resizable';\n }\n\n // Add required attribute.\n if (!empty($element['#required'])) {\n $element['#attributes']['required'] = '';\n }\n\n $output = '<div' . drupal_attributes($wrapper_attributes) . '>';\n $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';\n $output .= '</div>';\n return $output;\n}", "public function getTextData()\n {\n return $this->text;\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "function AttribTextarea( $id, $value, $name )\n\t{\n\t\t//TODO save doesn't work when ' apostrophies '\n\t\t$success = '<textarea cols=\"30\" rows=\"6\" name=\"'.$name.'\" id=\"'.$id.'\">'. JText::_($value) . '</textarea>';\n\t\treturn $success;\n\t}", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "function textarea( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_TEXTAREA,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "function ImprimirTexto($file){\n \t$txt = file_get_contents($file);\n \t\t $this->SetFont('Arial','',12);\n \t//Se imprime\n \t$this->MultiCell(0,5,$txt);\n \t}", "public function insertMas(){\n\t \t\t\t// FIELDS TERMINATED BY ',' \n\t \t\t\t// ENCLOSED BY '\"' \n\t \t\t\t// LINES TERMINATED BY '\\r\\n'\n\t\t\t\t // IGNORE 1 LINES\n\t\t\t\t // (area,departamento,nombre_firma,puesto,ext,tel,cel,correo);\n\t\t}", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function textarea( $element )\n\t\t{\t\t\t\n\t\t\t$output = '<textarea rows=\"5\" cols=\"30\" class=\"'.$element['class'].'\" id=\"'.$element['id'].'\" name=\"'.$element['id'].'\">';\n\t\t\t$output .= $element['std'].'</textarea>';\n\t\t\treturn $output;\n\t\t}", "static function pre ($in = '', $data = []) {\n\t\treturn static::textarea_common($in, $data, __FUNCTION__);\n\t}", "function edit($record=\"\", $fieldprefix=\"\") \n { \n global $config_atkroot; \n\n $id = $fieldprefix.$this->fieldName(); \n $this->registerKeyListener($id, KB_CTRLCURSOR); \n\n $result= '<textarea id=\"'.$id.'\" name=\"'.$id.'\" style=\"width: '.$this->m_size_array[0].'px; height: '.$this->m_size_array[1].'px;\" '. \n '>'.htmlspecialchars($record[$this->fieldName()]).'</textarea>'; \n\n $this->registerMce(); \n\n if(is_array($this->m_templates)) \n { \n $page = &atkPage::getInstance(); \n\n $js .= \"\\n\\nvar templates_{$this->m_name} = new Array(\"; \n $ui = &$this->m_ownerInstance->getUi(); \n foreach($this->m_templates as $template_key => $template_value) \n { \n $html_template = ereg_replace(\"[\\r\\t]\", '', $ui->render($template_value)); \n $html_template = ereg_replace(\"[\\n]\", '\\n', $html_template); \n $html_template = str_replace(\"'\", \"\\'\", $html_template); \n $html_template = str_replace(\" \", \" \", $html_template); \n $js .= \"'$html_template',\\n\"; \n } \n $js .= \"'a');\"; \n $js .= \"\\n\\nfunction AppendContent_{$this->m_name}(){\\n\"; \n $js .= \" var index = document.forms[0].template_choice_{$this->m_name}.selectedIndex;\\n\"; \n $js .= \" tinyMCE.execInstanceCommand('{$this->m_name}', 'mceInsertContent',false, templates_{$this->m_name}[index]);\\n\"; \n $js .= \"}\\n\"; \n $page->register_scriptcode($js); \n\n $result .= \"<br><select name=\\\"template_choice_{$this->m_name}\\\">\"; \n foreach($this->m_templates as $template_key => $template_value) \n { \n $result .= '<option value=\"'.$template_key.'\">'.$template_key.'</option>'; \n } \n $result .= '</select>'; \n $result .= \"<input type=\\\"button\\\" name=\\\"template_append\\\" value=\\\"\".text('mce_template_apply').\"\\\" onClick=\\\"AppendContent_{$this->m_name}()\\\">\"; \n } \n\n return $result; \n }", "static public function createTextArea($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/textarea.php\";\n }", "private function addEmailText(){\n\t\t$element = 'body';\n\t\t$opts = array('label'=>'emailMessage','required'=>true,'validators' => array( array('stringLength', false, array(1, 1000) )\t));\n\t\t$this->addElement('textarea',$element,$opts);\n\t\t$this->getElement($element)->setAttribs(array('rows'=>20,'cols'=>30));\n\t\t//$prefix = array();\n\t\t//$decorator = array('DivForm');\n\t\t//$this->addCustomDecorator($prefix,$decorator,$element);\n\t\t$this->applyDecorator($element,false);\n\t\t$this->addToGroup($element);\n\t}", "function textarea ($arguments = \"\") {\n $arguments = func_get_args();\n $rc = new ReflectionClass('ttextarea');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function prepareImportContent();", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "function save(&$conf)\t{\n\t\t// Before Save transformations for RTE\n\t\t$saveArray=array();\n\t\tforeach($this->dataArr as $fN=>$val) {\n\t\t\n\t\t\tif (strpos($fN,'.') || substr($fN,0,5)=='EVAL_') {\n\t\t\t\tif ($conf['debug.']['sql']) echo \"<br/>Save() foreign field $fN update not implemented yet !\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$saveArray[$fN]=$val;\n\t\t\t$tab=array();\n\t\t\t$res = $this->metafeeditlib->getForeignTableFromField($fN, $conf,'',$tab,__METHOD__);\t\t\t\n\t\t\t$table = $res['relTable']; //we get field sourcetable...\n\t\t\t$fNiD = $res['fNiD'];\n\t\t\tswitch((string)$conf['TCAN'][$table]['columns'][fNiD]['config']['type']) {\n\t\t\t\tcase 'text':\n\t\t\t\t\t$saveArray = $this->rteProcessDataArr($saveArray, $table, $fN, 'db', $conf, \"user_processDataArray\");\n\t\t\t\tbreak;\n\t\t\t} \n\t\t\t\n\t\t}\n\t\tswitch($conf['inputvar.']['cmd'])\t{\n\t\t\tcase 'edit':\n\t\t\t\tif ($conf['blogData']) {\n\t\t\t\t\t$saveArray['remote_addr'] = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$newFieldList=$conf['blog.']['show_fields']?$conf['blog.']['show_fields']:'firstname,surname,email,homepage,place,entry,entrycomment,linked_row,remote_addr';\n\t\t\t\t\t$res1=$this->cObj->DBgetInsert('tx_metafeedit_comments', $this->thePid, $saveArray, $newFieldList, TRUE);\n\t\t\t\t\tif ($res1===false && $this->conf['debug']) echo $GLOBALS['TYPO3_DB']->sql_error();\n\t\t\t\t\t//MODIF CBY\n\t\t\t\t\tif ($conf['debug.']['sql']) \n\t\t\t\t\t\t\t$conf['debug.']['debugString'].=\"<br/>INSERT SQL <br/>\".$this->cObj->DBgetInsert('tx_metafeedit_comments', $this->thePid, $saveArray, $newFieldList, FALSE);\n\t\t\t\t\tif ($res1) $this->saved=1;\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t\n\t\t\t\t$theUid = $this->dataArr[$conf['uidField']];\n\t\t\t\t$this->markerArray['###REC_UID###'] = $theUid;\n\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$theUid);\t\t// Fetches the original record to check permissions\n\t\t\t\tif ($conf['edit'] && ($GLOBALS['TSFE']->loginUser || !$conf['requireLogin'] || $this->aCAuth($origArr)))\t{\t// Must be logged in in order to edit (OR be validated by email) or requireLogin is unchecked\n\t\t\t\t\t$newFieldList = implode(',',array_intersect(explode(',',$conf['fieldList']),t3lib_div::trimExplode(',',$conf['edit.']['fields'],1)));\n\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr,$GLOBALS['TSFE']->fe_user->user,$conf['allowedGroups'],$conf['fe_userEditSelf'],$conf))\t{\n\t\t\t\t\t\t$res1=$this->cObj->DBgetUpdate($this->theTable, $theUid, $saveArray, $newFieldList, TRUE);\n\t\t\t\t\t\tif ($res1===false && $this->conf['debug']) echo $GLOBALS['TYPO3_DB']->sql_error();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//MODIF CBY\n\t\t\t\t\t\tif ($conf['debug.']['sql']) \n\t\t\t\t\t\t\t$conf['debug.']['debugString'].=\"<br/>UPDATE SQL <br/>\".$this->cObj->DBgetUpdate($this->theTable, $theUid, $saveArray, $newFieldList, FALSE);\n\t\t\t\t\t\t$this->currentArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$theUid);\n\n\n\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterSave'],$conf['edit.']['userFunc_afterSave.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t$this->currentArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$theUid);\n\n\t\t\t\t\t\tif ($res1) $this->saved=1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error='###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->error='###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($conf['create'])\t{\n\n\t\t\t\t\t$newFieldList = implode(',',array_intersect(explode(',',$conf['fieldList']),t3lib_div::trimExplode(',',$conf['create.']['fields'],1)));\n\t\t\t\t\t$res1=$this->cObj->DBgetInsert($this->theTable, $this->thePid, $saveArray, $newFieldList, TRUE);\n\t\t\t\t\tif ($res1===false && $this->conf['debug']) echo $GLOBALS['TYPO3_DB']->sql_error();\n\t\t\t\t\t//MODIF CBY\n\t\t\t\t\tif ($conf['debug.']['sql']) \n\t\t\t\t\t\t\t$conf['debug.']['debugString'].=\"<br/>INSERT SQL <br/>\".$this->cObj->DBgetInsert($this->theTable, $this->thePid, $saveArray, $newFieldList, FALSE);\n\t\t\t\t\t$newId = $GLOBALS['TYPO3_DB']->sql_insert_id();\n\t\t\t\t\t$this->dataArr[$conf['uidField']]=$newId;\n\t\t\t\t\t$this->currentArr[$conf['uidField']]=$newId;\n\t\t\t\t\t$this->recUid=$newId;\n\t\t\t\t\t$conf['recUid']=$this->recUid;\n\t\t\t\t\t$this->markerArray['###REC_UID###'] = $this->recUid;\n\n\t\t\t\t\tif ($this->theTable=='fe_users' && $conf['fe_userOwnSelf'])\t{\t\t// enables users, creating logins, to own them self.\n\t\t\t\t\t\t$extraList='';\n\t\t\t\t\t\t$dataArr = array();\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['ctrl']['fe_cruser_id'])\t\t{\n\t\t\t\t\t\t\t$field=$GLOBALS['TCA'][$this->theTable]['ctrl']['fe_cruser_id'];\n\t\t\t\t\t\t\t$dataArr[$field]=$newId;\n\t\t\t\t\t\t\t$extraList.=','.$field;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['ctrl']['fe_crgroup_id'])\t{\n\t\t\t\t\t\t\t$field=$GLOBALS['TCA'][$this->theTable]['ctrl']['fe_crgroup_id'];\n\t\t\t\t\t\t\tlist($dataArr[$field])=explode(',',$this->dataArr['usergroup']);\n\t\t\t\t\t\t\t$dataArr[$field]=intval($dataArr[$field]);\n\t\t\t\t\t\t\t$extraList.=','.$field;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$saveArray=array();\n\t\t\t\t\t\tforeach($dataArr as $fN=>$val) {\n\t\t\t\t\t\t\tif (strpos($fN,'.')) {\n\t\t\t\t\t\t\t\tif ($conf['debug.']['sql']) echo \"<br/>Save2() foreign field $fN update not implemented yet !\";\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$saveArray[$fN]=$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count($saveArray))\t{\n\t\t\t\t\t\n\t\t\t\t\t\t\t$res1=$this->cObj->DBgetUpdate($this->theTable, $newId, $saveArray, $extraList, TRUE);\n\t\t\t\t\t\t\tif ($res1===false && $this->conf['debug']) echo $GLOBALS['TYPO3_DB']->sql_error();\n\t\t\t\t\t\t\t//MODIF CBY\n\t\t\t\t\t\t\tif ($conf['debug.']['sql']) \n\t\t\t\t\t\t\t\t$conf['debug.']['debugString'].=\"<br/>UPDATE SQL <br/>\".$this->cObj->DBgetUpdate($this->theTable, $newId, $saveArray, $extraList, FALSE);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->currentArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$newId);\n\t\t\t\t\t//die(dot);\n\t\t\t\t\t//$this->logErrors('before user process uid:='.$this->dataArr[$conf['uidField']]);\n\t\t\t\t\t$this->dataArr[$conf['uidField']]=$newId;\n\t\t\t\t\t$this->currentArr[$conf['uidField']]=$newId;\n\t\t\t\t\t$rec=array('rec'=>$this->currentArr);\n\t\t\t\t\t$this->userProcess_alt($conf['create.']['userFunc_afterSave'],$conf['create.']['userFunc_afterSave.'],$rec);\n\t\t\t\t\t//$this->logErrors('after user process uid:='.$this->dataArr[$conf['uidField']]);\n\t\t\t\t\t$this->currentArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$newId);\n\t\t\t\t\tif ($res1) $this->saved=1;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "function onGetContent( $editor ) {\n\t\treturn \"document.getElementById( '$editor' ).value;\\n\";\n\t}", "public function render()\n {\n return view('hearth::components.textarea');\n }", "function textarea( $name, $label = FALSE, $args = array() ){\r\techo get_textarea( $name, $label, $args );\r}", "public function textareaDetail($in=null, $x=10, $y=10){\n \n return( '<textarea rows='.$x.' cols='.$y.'>Details'.\"\\n\".$in.'</textarea>' );\n\n }", "public function textAreaBlock($model, $attribute, $htmlOptions = array())\r\n\t{\r\n\t\treturn $this->inputBlock('textarea', $model, $attribute, null, $htmlOptions);\r\n\t}" ]
[ "0.5420207", "0.524603", "0.5194765", "0.5126707", "0.51193887", "0.51129174", "0.5090459", "0.5061626", "0.5016948", "0.50030977", "0.49657747", "0.49424002", "0.48762652", "0.4853857", "0.48512346", "0.48473266", "0.48277137", "0.48229995", "0.4812099", "0.48112962", "0.48059466", "0.48039365", "0.47925842", "0.4749986", "0.47496885", "0.47379342", "0.47356984", "0.4733378", "0.47319528", "0.47220707", "0.47180468", "0.47128624", "0.47117057", "0.4711519", "0.47046196", "0.47028816", "0.46964192", "0.4686008", "0.46798176", "0.46652105", "0.46630964", "0.46545142", "0.46388614", "0.46273467", "0.46137413", "0.46025392", "0.46003154", "0.458588", "0.45676145", "0.45620105", "0.4561733", "0.45566005", "0.45563272", "0.45433363", "0.4532427", "0.45241264", "0.4521007", "0.45017526", "0.4496023", "0.44955227", "0.449311", "0.44730955", "0.4467", "0.44434774", "0.44337967", "0.44316489", "0.44286424", "0.44224975", "0.44202977", "0.44190282", "0.44137466", "0.4409577", "0.44089466", "0.4396102", "0.43941012", "0.43928847", "0.43838212", "0.4382328", "0.4381109", "0.43763614", "0.4365192", "0.43620637", "0.43606853", "0.43300605", "0.43272594", "0.43238008", "0.43184394", "0.43177316", "0.43169174", "0.4316423", "0.43067586", "0.4303543", "0.42933545", "0.42906818", "0.4285288", "0.42840403", "0.42836368", "0.42823052", "0.42777103", "0.42720214" ]
0.56925595
0
Method for importing a url data cell.
protected function process_data_url(import_settings $settings, $field, $data_record, $value) { $list = $value->getElementsByTagName('a'); $a = $list->item(0); $href = $a->getAttribute('href'); $text = $this->get_innerhtml($a); $result = $this->process_data_default($settings, $field, $data_record, $href, $text); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setData()\n {\n if($this->url != null)\n {\n if (($handle = fopen($this->url, \"r\")) !== FALSE) {\n while (($rows = fgetcsv($handle)) !== FALSE) {\n foreach($rows as $row)\n {\n $this->data[$this->rowCount][] = $row;\n }\n $this->rowCount++;\n }\n fclose($handle);\n }\n }\n }", "public function loadByUrl($url);", "function import( $source, $back_url ) {\n\t\n\t}", "abstract public function setContentFromUrl($url);", "function import(array $data);", "public function getRowUrl($row)\n {\n }", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function fetch($url);", "public function importFrom(array $data);", "public function import();", "public function import(array $data): void;", "public static function from_url($url)\n {\n }", "private function writeUrlExternal($row1, $col1, $row2, $col2, $url): void\n {\n // Network drives are different. We will handle them separately\n // MS/Novell network drives and shares start with \\\\\n if (preg_match('[^external:\\\\\\\\]', $url)) {\n return;\n }\n\n $record = 0x01B8; // Record identifier\n\n // Strip URL type and change Unix dir separator to Dos style (if needed)\n //\n $url = (string) preg_replace(['/^external:/', '/\\//'], ['', '\\\\'], $url);\n\n // Determine if the link is relative or absolute:\n // relative if link contains no dir separator, \"somefile.xls\"\n // relative if link starts with up-dir, \"..\\..\\somefile.xls\"\n // otherwise, absolute\n\n $absolute = 0x00; // relative path\n if (preg_match('/^[A-Z]:/', $url)) {\n $absolute = 0x02; // absolute path on Windows, e.g. C:\\...\n }\n $link_type = 0x01 | $absolute;\n\n // Determine if the link contains a sheet reference and change some of the\n // parameters accordingly.\n // Split the dir name and sheet name (if it exists)\n $dir_long = $url;\n if (preg_match('/\\\\#/', $url)) {\n $link_type |= 0x08;\n }\n\n // Pack the link type\n $link_type = pack('V', $link_type);\n\n // Calculate the up-level dir count e.g.. (..\\..\\..\\ == 3)\n $up_count = preg_match_all('/\\\\.\\\\.\\\\\\\\/', $dir_long, $useless);\n $up_count = pack('v', $up_count);\n\n // Store the short dos dir name (null terminated)\n $dir_short = (string) preg_replace('/\\\\.\\\\.\\\\\\\\/', '', $dir_long) . \"\\0\";\n\n // Store the long dir name as a wchar string (non-null terminated)\n //$dir_long = $dir_long . \"\\0\";\n\n // Pack the lengths of the dir strings\n $dir_short_len = pack('V', strlen($dir_short));\n //$dir_long_len = pack('V', strlen($dir_long));\n $stream_len = pack('V', 0); //strlen($dir_long) + 0x06);\n\n // Pack the undocumented parts of the hyperlink stream\n $unknown1 = pack('H*', 'D0C9EA79F9BACE118C8200AA004BA90B02000000');\n $unknown2 = pack('H*', '0303000000000000C000000000000046');\n $unknown3 = pack('H*', 'FFFFADDE000000000000000000000000000000000000000');\n //$unknown4 = pack('v', 0x03);\n\n // Pack the main data stream\n $data = pack('vvvv', $row1, $row2, $col1, $col2) .\n $unknown1 .\n $link_type .\n $unknown2 .\n $up_count .\n $dir_short_len .\n $dir_short .\n $unknown3 .\n $stream_len; /*.\n $dir_long_len .\n $unknown4 .\n $dir_long .\n $sheet_len .\n $sheet ;*/\n\n // Pack the header data\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n // Write the packed data\n $this->append($header . $data);\n }", "public function setUrl($url) {}", "public function metaImport($data);", "public function setUrl( $url );", "public function setURL($url);", "public function setURL($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "protected function loadRow() {}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "private function writeUrlRange($row1, $col1, $row2, $col2, $url): void\n {\n // Check for internal/external sheet links or default to web link\n if (preg_match('[^internal:]', $url)) {\n $this->writeUrlInternal($row1, $col1, $row2, $col2, $url);\n }\n if (preg_match('[^external:]', $url)) {\n $this->writeUrlExternal($row1, $col1, $row2, $col2, $url);\n }\n\n $this->writeUrlWeb($row1, $col1, $row2, $col2, $url);\n }", "function import_external_image($url){\n\n global $id;\n\n // get current source ( server ) path\n $L = preg_split( \"/\\//\", \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\");\n\n $path=\"\";\n\n for( $i=0; $i<count($L)-1; $i++ ){\n if( $path != \"\" ) $path.=\"/\";\n $path.=$L[$i];\n }\n\n\n if( $url == \"\" ){\n // if url of image is empty then remove file only and return\n unlink(\"icons/\".$id.\".*\"); return \"\";\n } else {\n // if file not exists then return without any action\n if( checkExternalFile($url) == false ) return \"\";\n }\n\n // get file extension from url\n $T=preg_split(\"/\\./\",$url);\n $file_extension = $T[ count($T)-1 ];\n\n // copy external image file into folder icons\n $ch = curl_init( $url );\n $fp = fopen(\"icons/\".$id.\".\".$file_extension , \"wb\");\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n\n // return the new path of imported image\n return $path.\"/icons/\".$id.\".\".$file_extension;\n}", "public function importRefData($source){\n //importing data into db\n $this->log(\"importing ref: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "protected function importDatabaseData() {}", "public function import($value, $entry_id = null)\n {\n // Import reference link:\n // Get the correct ID of the related fields\n $related_field = Symphony::Database()->fetchVar('related_field_id', 0, 'SELECT `related_field_id` FROM `tbl_fields_referencelink` WHERE `field_id` = ' . $this->field->get('id'));\n $data = $this->field->processRawFieldData(explode(',', $value), $this->field->__OK__);\n $related_ids = array('relation_id'=>array());\n foreach ($data['relation_id'] as $key => $relationValue)\n {\n $related_ids['relation_id'][] = Symphony::Database()->fetchVar('entry_id', 0, 'SELECT `entry_id` FROM `tbl_entries_data_' . $related_field . '` WHERE `value` = \\'' . trim($relationValue) . '\\';');\n }\n return $related_ids;\n /*\n $entry->setData($associatedFieldID, $related_ids);\n $data = $this->field->processRawFieldData(explode(',', $value), $this->field->__OK__);\n return $data;\n */\n }", "private function writeUrlInternal($row1, $col1, $row2, $col2, $url): void\n {\n $record = 0x01B8; // Record identifier\n\n // Strip URL type\n $url = (string) preg_replace('/^internal:/', '', $url);\n\n // Pack the undocumented parts of the hyperlink stream\n $unknown1 = pack('H*', 'D0C9EA79F9BACE118C8200AA004BA90B02000000');\n\n // Pack the option flags\n $options = pack('V', 0x08);\n\n // Convert the URL type and to a null terminated wchar string\n $url .= \"\\0\";\n\n // character count\n $url_len = StringHelper::countCharacters($url);\n $url_len = pack('V', $url_len);\n\n $url = StringHelper::convertEncoding($url, 'UTF-16LE', 'UTF-8');\n\n // Calculate the data length\n $length = 0x24 + strlen($url);\n\n // Pack the header data\n $header = pack('vv', $record, $length);\n $data = pack('vvvv', $row1, $row2, $col1, $col2);\n\n // Write the packed data\n $this->append($header . $data . $unknown1 . $options . $url_len . $url);\n }", "public function actionImport()\n {\n $model = new UploadExcelForm();\n\n if (Yii::$app->request->isPost) {\n $post_data = Yii::$app->request->post();\n\n if (!empty($post_data['file_path'])) {\n $model->file_path = $post_data['file_path']; //! unsafe data need filter\n \n // save uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, true);\n } else {\n $model->excel_file = UploadedFile::getInstance($model, 'excel_file');\n\n if (!$model->upload()) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => false,\n 'errors' => $model->getErrors()\n ];\n }\n\n // process uploaded file\n $data_arr = $model->processExcel();\n $parse_result = $this->processData($data_arr, false);\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return [\n 'success' => true,\n 'data' => [\n 'file_path' => $model->file_path,\n 'parse_result' => $parse_result,\n ]\n ];\n }\n\n // import data from excel file\n return $this->render('import', [\n 'model' => $model\n ]);\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function loader($type, $url, $path) { // Method of loader\n $this->rss = simplexml_load_file($url); // Convert xml to object\n\n if($this->rss) { // URL correct. If there is rss, then download the dataes and adjust their format\n\n foreach($this->rss->channel->item as $item) { // Check and add available articles (each on a new rows)\n $this->link = $item->link; // Article link from RSS\n $this->title = $item->title; // Title of article from RSS\n $this->description = $item->description; // Description of article from RSS\n $this->pubDate = $item->pubDate; // Date of article from RSS\n $this->newDateTime = date(\"Y-m-d H:i:s\", strtotime($this->pubDate)); // Customize date format to \"Y-m-d H:i:s\"\n $this->dc = $item->children(\"http://purl.org/dc/elements/1.1/\"); // Clearing text (line 4 from RSS file and <dc:creator>...)\n $this->creator = $this->dc->creator; // Author of article\n \n $this->fields[] = [ // Array with columns in csv: title, description, link, date and creator\n $this->title,\n $this->description,\n $this->link,\n $this->newDateTime,\n $this->creator\n ];\n }\n\n $this->csvFile = fopen($path, $type); // Open the file and use type w+ or a+. | fopen(file, mode)\n $this->header = [\"title\", \"description\",\"link\",\"pubDate\",\"creator\"]; // Add headers to csv file\n fputcsv($this->csvFile, $this->header, \";\")or die(\"Write error!\"); // Header of table. Separate the columns with \";\" | fputcsv(file, fields, sepator)\n\n foreach($this->fields as $field) { // Body of table. Add each new row\n fputcsv($this->csvFile, $field, \";\")or die(\"Write error!\"); // Separate the columns with \";\"\n }\n\n fclose($this->csvFile); // Close the file\n return true;\n\n } else {\n echo \"=== ERROR ===\\n Invalid feed of URL\\n=============\"; // Error reading URL\n }\n }", "public function DataInFileImportCSV($redirect_to)\n {\n\n }", "function convert($url, $table_no=1) {\n if(isValidUrl($url)){\n $html = file_get_html($url);\n $this->getArray($html, $table_no);\n } else {\n echo \"Url is not valid\";\n }\n return $this->arr;\n }", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "private static function addUrlData(Url $url, array $data)\n {\n // Url identifier object\n //\n // Supported keys: \"id\" and \"urlId\"\n\n if (isset($data['id']) && $data['id'] instanceof UrlIdentifier) {\n $url->setId($data['id']);\n }\n\n if (isset($data['urlId']) && $data['urlId'] instanceof UrlIdentifier) {\n $url->setId($data['urlId']);\n }\n\n // Segment item chain\n\n if (isset($data['segments']) && $data['segments'] instanceof UrlSegmentItem) {\n $url->setSegments($data['segments']);\n }\n\n // Explict segment count\n\n if (isset($data['segmentcount']) && is_numeric($data['segmentcount'])) {\n $url->setSegmentcount($data['segmentcount']);\n }\n\n // Current url weight\n\n if (isset($data['weight']) && is_numeric($data['weight'])) {\n $url->setWeight($data['weight']);\n }\n\n // Placeholder\n //\n // Supported keys: \"uses_placeholde\" and \"usesPlaceholders\n\n if (isset($data['uses_placeholder']) && is_bool($data['uses_placeholder'])) {\n $url->setUsesPlaceholder($data['uses_placeholder']);\n }\n\n if (isset($data['usesPlaceholder']) && is_bool($data['usesPlaceholder'])) {\n $url->setUsesPlaceholder($data['usesPlaceholder']);\n }\n\n // Wildcard\n //\n // Supported keys: \"uses_wildcard\" and \"usesWildcard\"\n\n if (isset($data['uses_wildcard']) && is_bool($data['uses_wildcard'])) {\n $url->setUsesWildcard($data['uses_wildcard']);\n }\n\n if (isset($data['usesWildcard']) && is_bool($data['usesWildcard'])) {\n $url->setUsesWildcard($data['usesWildcard']);\n }\n }", "private function importCsv($params) {\n\n $conn = $this->container->get('doctrine.dbal.default_connection');\n\n // set content in file handler\n $fiveMBs = 5 * 1024 * 1024;\n $fp = fopen(\"php://temp/maxmemory:$fiveMBs\", 'r+');\n fputs($fp, $params['data']);\n rewind($fp);\n\n // get array from CSV\n $data = array();\n while (($row = fgetcsv($fp, 1000, \",\")) !== FALSE) {\n $data[] = $row;\n }\n fclose($fp);\n\n // let's check how the CSV is structured. There can be 3 options\n\n // Option 1.\n // date, value\n // date2, value2\n\n // Option 2.\n // x, date1, date2\n // source_title, value11, value12\n // source_title2, value21, value22\n\n // so let's check the first field to see if it's a date\n $firstField = $data[0][0];\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($firstField);\n\n $dataToInsert = array();\n $sourcesToInsert = array();\n\n // it's a date, so Option 1\n if ( $dateAr ) {\n\n $sourceHash = md5($params['title']);\n\n $sourcesToInsert[] = '('\n . $conn->quote(trim($params['title']), 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // the data is already on the desired format\n $dataToInsert[ $sourceHash ] = $data;\n }\n // Option 2.\n else {\n\n // get dates which are on the first line\n $dates = array_slice($data[0], 1);\n $avoidFirst = true;\n foreach ($data as $lineData) {\n\n // do not insert first line\n if ( $avoidFirst ) {\n $avoidFirst = false;\n continue;\n }\n\n // source title\n $titleSuffix = $lineData[0];\n $sourceTitle = trim($params['title']) . ' - ' . trim($titleSuffix);\n $sourceHash = md5($sourceTitle);\n\n $sourcesToInsert[] = '('\n . $conn->quote($sourceTitle, 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // values\n $values = array_slice($lineData, 1);\n\n $dataToInsert[ $sourceHash ] = array_combine($dates, $values);\n }\n }\n\n $now = date('Y-m-d H:m:s');\n\n // insert masivo de sources\n $r = $conn->executeUpdate('INSERT INTO source (title, hash, unit, link, created_at, updated_at)\n VALUES '.join(',', $sourcesToInsert));\n\n // get all sources\n $results = $conn->fetchAll(\"SELECT id, hash FROM source where created_at > ?\", array($now));\n\n // create array that identifies source\n $sources = array();\n foreach ($results as $r) {\n $sources[ $r['hash'] ] = $r['id'];\n }\n unset($results);\n\n $insert = array();\n foreach ($dataToInsert as $sourceCode => $data) {\n\n foreach ($data as $date => $value ) {\n\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($date);\n\n $date = $dateAr['date'];\n $dateType = $dateAr['dateType'];\n\n $insert[] = '('.$sources[ $sourceCode ].', '\n .$conn->quote($date, 'string').', '\n .$conn->quote($dateType, 'string').', '\n .$conn->quote($value, 'string').', now(), now())';\n }\n }\n\n $offset = 0;\n $MAX = 10000;\n $total = count($insert);\n\n //$this->output->writeln('Hay '.$total.' data points');\n\n while ( $offset < $total ) {\n\n $insertNow = array_slice($insert, $offset, $MAX);\n\n // hacer insert masivo\n $r = $conn->executeUpdate('INSERT INTO data (source_id, date, date_type, value, created_at, updated_at)\n VALUES '.join(',', $insertNow));\n\n $offset += $MAX;\n\n //$this->output->writeln(' ...añadidos '.$offset);\n }\n }", "private function writeUrl($row, $col, $url): void\n {\n // Add start row and col to arg list\n $this->writeUrlRange($row, $col, $row, $col, $url);\n }", "public function importExternalData($source){\n //importing data into db\n $this->log(\"importing external: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "public function import(): void;", "function getDATA($url) {\r\n // inisialisasi CURL\r\n $data = curl_init();\r\n $ip = $url;\r\n // $ip = $getRow['ipAddr'] . '' . $url;\r\n // setting CURL\r\n curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($data, CURLOPT_URL, $ip);\r\n\r\n // menjalankan CURL untuk membaca isi file\r\n $hasil = curl_exec($data);\r\n curl_close($data);\r\n return $hasil;\r\n}", "public function load_from_url($url, $ext = '')\n\t{\n\t\t// Delete the local file if it exists\n\t\t$this->delete_local_file();\n\t\tif($ext) {\n\t\t\t$ext = '.'.$ext;\n\t\t}\n $filename = str_replace(\"'\", \"\", $this->new_filename($url . $ext));\n $this->local_file = $this->new_local_file_name();\n file_put_contents($this->local_file, file_get_contents($url));\n $this->location = $this->dir . '/' . $filename;\n\t}", "public function getRowUrl()\n {\n return $this->rowUrl;\n }", "public function column_url($link)\n {\n }", "public function collectData($url) {\n\t\t\t\n\t\t}", "public function import(ImportPost $request)\n {\n\n /* Check if there is a file uploaded */\n if($request->hasFile('file')) {\n\n $overwrite = $request->input('overwrite');\n\n $file = $request->file('file');\n $path = $file->getRealPath();\n $rowArray = [];\n\n\n /* Process excel data array */\n Excel::load($path, function($reader) use (&$rowArray) {\n\n /* Fetch data array */\n $rowArray = $reader->all()->toArray();\n });\n\n\n /* Check if file has all needed columns */\n return $this->checkImportColumn($rowArray, $overwrite);\n }\n }", "public function setUrl(string $url): void;", "private function parseExternURL($url){\n\t\tif (!preg_match('@^(?:https?|ftp)://@i', $url)){\n\t\t\t$url = \"http://\" . $url;\n\t\t}\n\t\treturn $url;\n\t}", "public function writeUrlWeb($row1, $col1, $row2, $col2, $url): void\n {\n $record = 0x01B8; // Record identifier\n\n // Pack the undocumented parts of the hyperlink stream\n $unknown1 = pack('H*', 'D0C9EA79F9BACE118C8200AA004BA90B02000000');\n $unknown2 = pack('H*', 'E0C9EA79F9BACE118C8200AA004BA90B');\n\n // Pack the option flags\n $options = pack('V', 0x03);\n\n // Convert URL to a null terminated wchar string\n\n /** @phpstan-ignore-next-line */\n $url = implode(\"\\0\", preg_split(\"''\", $url, -1, PREG_SPLIT_NO_EMPTY));\n $url = $url . \"\\0\\0\\0\";\n\n // Pack the length of the URL\n $url_len = pack('V', strlen($url));\n\n // Calculate the data length\n $length = 0x34 + strlen($url);\n\n // Pack the header data\n $header = pack('vv', $record, $length);\n $data = pack('vvvv', $row1, $row2, $col1, $col2);\n\n // Write the packed data\n $this->append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url);\n }", "public function testAddImageSectionByUrl()\n {\n $oCell = new Cell();\n $element = $oCell->addImage('http://php.net/images/logos/php-med-trans-light.gif');\n\n $this->assertCount(1, $oCell->getElements());\n $this->assertInstanceOf('PhpOffice\\\\PhpWord\\\\Element\\\\Image', $element);\n }", "public function import()\n {\n \n }", "function import($onDuplicate, &$values) {\n $response = $this->summary($values);\n $this->_params = $this->getActiveFieldParams(true);\n $this->formatDateParams();\n $this->_params['skipRecentView'] = TRUE;\n $this->_params['check_permissions'] = TRUE;\n\n if(count($this->_importQueueBatch) >= $this->getImportQueueBatchSize()) {\n $this->addBatchToQueue();\n }\n $this->addToBatch($this->_params, $values);\n\n }", "public function loadData($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->username . ':' . $this->password);\n\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\n\t\tif ($this->debug) {\n\t\t\techo \"Fetch: \" . $url;\n\t\t}\n\n\t\t$result = curl_exec($ch);\n\n\t\tcurl_close($ch);\n\n\t\tif ($this->debug) {\n\t\t\techo \"Fetch-Result: \" . $result;\n\t\t}\n\n\t\treturn $result;\n\t}", "private function fetchDataFromUrl($url)\n {\n \ttry {\n \t\t$options = array(\n \t\t\t\t'http' => array(\n \t\t\t\t\t\t'method' => 'GET',\n \t\t\t\t\t\t'header' => implode(\"\\r\\n\", array(\n \t\t\t\t\t\t\t\t'accept: text/html,application/xhtml+xml,application/xml;',\n \t\t\t\t\t\t\t\t'cache-control:max-age=0',\n \t\t\t\t\t\t\t\t'Accept-language: en-US,en;q=0.8',\n \t\t\t\t\t\t\t\t'User-Agent: ' . $this->userAgents[rand(0, count($this->userAgents) - 1)]\n \t\t\t\t\t\t))\n \t\t\t\t)\n \t\t);\n \t\t$context = stream_context_create($options);\n \t\t$content = file_get_contents($url, false, $context);\n \t\t\n \t\t$targetHost = parse_url($url, PHP_URL_HOST);\n \t\t$doc = new \\App\\Libraries\\Parser\\Document($content, 'default', $targetHost);\n \t\t$res = $doc->parseContent(false, null);\n \t\tif ($res['okay']) {\n \t\t\t$images = $res['images'];\n \t\t\t$parsedUrl = parse_url($url);\n \t\t\tfor ($i = count($images) - 1; $i >= 0; $i--) {\n \t\t\t\tif (strpos($images[$i], 'http') !== 0) {\n \t\t\t\t\t/*\n \t\t\t\t\t $parsedImages = parse_url($images[$i]);\n \t\t\t\t\t $parsedImages['scheme'] = $parsedUrl['scheme'];\n \t\t\t\t\t $parsedImages['host'] = $parsedUrl['host'];\n \t\t\t\t\t $images[$i] = http_build_url($parsedImages);\n \t\t\t\t\t */\n \t\t\t\t\tarray_splice($images, $i, 1);\n \t\t\t\t}\n \t\t\t}\n \t\t\t$res['images'] = $images;\n \t\t\treturn $res;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} catch (\\Exception $e) {\n \t\tLog::error('Cannot fetch data from url: ' . $url . '; ' . $e);\n \t\treturn false;\n \t}\n }", "public function explodeUrl2ArrayDataProvider() {}", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "public function import()\n {\n $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /**\n *text/comma-separated-values 逗號分隔CSV\n */\n if (isset($_FILES['file']['name']) && in_array($_FILES['file']['type'], $file_mimes)) //檔案是否存在\n {\n \n $arr_file = explode('.', $_FILES['file']['name']); //分割字串\n $extension = end($arr_file); //副檔名\n \n if ('csv' == $extension) \n {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Csv();//Csv package new\n } elseif ('xlsx' == $extension) {\n $reader = new \\PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx();//Xlsx package new \n }\n \n $spreadsheet = $reader->load($_FILES['file']['tmp_name']);\n // start customize\n $sheetData = $spreadsheet->getActiveSheet()->ToArray(); //取得sheet值並存成陣列\n //return $sheetData; return只會給予物件 所以中文會輸出unicode\n //return view('',$sheetData=>$sheetData);\n // /end customize\n $count = count($sheetData);\n if (is_array($sheetData)) \n {\n foreach ($sheetData as $row => $value) {\n Line::create([\n 'user_id' => $value[0],\n 'created_at' => now(),\n 'apporved' => now(),\n 'person_name' => $value[1],\n 'school' => $value[2],\n 'phone' => $value[3],\n ]);\n }\n } \n return redirect()->route('home')->with('message', \"新增成功!總共新增$count\" . \"筆\");//redirect home and \n }\n }", "public function import() {\n $file = request()->file('file');\n (new EntryImport)->import($file);\n\n $rules = Rule::all();\n $entries = Entry::all();\n\n //replace null with NaN\n foreach($entries as $entry) {\n foreach($entry->getAttributes() as $key => $value) {\n if($value =='') {\n $entry->$key='NaN';\n }\n $entry->save();\n }\n }\n\n $this->refresh();\n \n return back();\n }", "function setUrl($url);", "public function getDataUrl( $area, $url )\n {\n $x = Yii::$app->db->createCommand( \"SELECT * FROM $this->table WHERE area_id=:area AND url=:url\" )\n ->bindValues([\n ':area' => $area,\n ':url' => $url,\n ])\n ->queryOne();\n\n if(!$x)\n throw new Exception(\"Área não encontrada!\", 002);\n\n return $x;\n }", "public function hostaddress_import($p_data, $p_table = null)\n {\n if (is_array($p_data))\n {\n if ($p_data['title_lang'] == 'LC__CATG__IP__PRIMARY_IP_ADDRESS')\n {\n return 0;\n }\n else if (Ip::validate_ip($p_data[C__DATA__VALUE]))\n {\n return $this->m_category_data_ids[C__CMDB__CATEGORY__TYPE_GLOBAL][C__CATG__IP][$p_data['id']];\n } // if\n } // if\n\n return $this->dialog_plus_import($p_data, $p_table);\n }", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function testUrlValidate()\n {\n $obj = new CSVFileReader();\n $urlValidate = self::getMethod($obj, 'urlValidate');\n\n $res = $urlValidate->invokeArgs($obj, array($this->data[0]));\n $this->assertFalse($res);\n $res = $urlValidate->invokeArgs($obj, array($this->data[1]));\n $this->assertFalse($res);\n $res = $urlValidate->invokeArgs($obj, array($this->data[2]));\n $this->assertFalse($res);\n $res = $urlValidate->invokeArgs($obj, array($this->data[3]));\n $this->assertTrue($res);\n }", "public function fetchResult($url);", "private function checkDataInURL() {\n $html = @file_get_contents($this->url);\n if ($html === FALSE) throw new Exception('Unable to get html from URL.');\n return strpos($html, $this->data) !== FALSE;\n }", "public function import() {\n\n\t\t$output = array();\n\n\t\tif ($importUrl = Request::post('importUrl')) {\n\n\t\t\t// Resolve local URLs.\n\t\t\tif (strpos($importUrl, '/') === 0) {\n\n\t\t\t\tif (getenv('HTTPS') && getenv('HTTPS') !== 'off' && getenv('HTTP_HOST')) {\n\t\t\t\t\t$protocol = 'https://';\n\t\t\t\t} else {\n\t\t\t\t\t$protocol = 'http://';\n\t\t\t\t}\n\n\t\t\t\t$importUrl = $protocol . getenv('HTTP_HOST') . AM_BASE_URL . $importUrl;\n\t\t\t\tCore\\Debug::log($importUrl, 'Local URL');\n\n\t\t\t}\n\n\t\t\t$curl = curl_init(); \n \n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0); \n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t\tcurl_setopt($curl, CURLOPT_URL, $importUrl); \n\n\t\t\t$data = curl_exec($curl); \n\t\t\t\n\t\t\tif (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200 || curl_errno($curl)) {\n\t\t\t\n\t\t\t\t$output['error'] = Text::get('error_import');\n\t\t\t\n\t\t\t} else {\n\n\t\t\t\t$fileName = Core\\Str::sanitize(preg_replace('/\\?.*/', '', basename($importUrl)));\n\n\t\t\t\tif ($url = Request::post('url')) {\n\t\t\t\t\t$Page = $this->Automad->getPage($url);\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_PAGES . $Page->path . $fileName;\n\t\t\t\t} else {\n\t\t\t\t\t$path = AM_BASE_DIR . AM_DIR_SHARED . '/' . $fileName;\n\t\t\t\t}\n\n\t\t\t\tFileSystem::write($path, $data);\n\t\t\t\t$this->clearCache();\n\n\t\t\t} \n\n\t\t\tcurl_close($curl);\n\n\t\t\tif (!FileSystem::isAllowedFileType($path)) {\n\n\t\t\t\t$newPath = $path . FileSystem::getImageExtensionFromMimeType($path);\n\n\t\t\t\tif (FileSystem::isAllowedFileType($newPath)) {\n\t\t\t\t\tFileSystem::renameMedia($path, $newPath);\n\t\t\t\t} else {\n\t\t\t\t\tunlink($path);\n\t\t\t\t\t$output['error'] = Text::get('error_file_format');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$output['error'] = Text::get('error_no_url'); \n\n\t\t}\n\n\t\treturn $output;\n\n\t}", "public function import($filename = self::PHP_PUTDATA) {\n\n $fh = fopen($filename, 'r');\n\n while (($row = fgets($fh)) !== false) {\n\n if (!empty($row)) {\n\n list($key, $val) = explode(' ', $row);\n $key = $this->getRedisKey(trim($key));\n $val = trim($val);\n\n if ($this->getGraph()->persistent) {\n Redis::getRedis()->set($key, $val);\n } else {\n Redis::getRedis()->set($key, $val, Config::getConfig()->redis->ttl);\n }\n\n }\n\n }\n\n }", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "function fatherly_fcr_populate_data()\n{\n global $wpdb;\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n $csv_file = __DIR__ . '/inc/data/popular_posts.csv';\n $csv_file_data = array_map('str_getcsv', file($csv_file));\n\n foreach ($csv_file_data as $csv_file_datum) {\n $wpdb->insert($table_name, array('post_url' => $csv_file_datum[0], 'post_id' => $csv_file_datum[1]));\n }\n}", "public function importFile($filepath, $colmap = null, $hasheader = true, $cleardata = false)\n {\n $loader = $this->component->getLoader($this->gridField);\n $loader->deleteExistingRecords = $cleardata;\n\n //set or merge in given col map\n if (is_array($colmap)) {\n $loader->columnMap = $loader->columnMap ?\n array_merge($loader->columnMap, $colmap) : $colmap;\n }\n $loader->getSource()\n ->setFilePath($filepath)\n ->setHasHeader($hasheader);\n\n return $loader->load();\n }", "public function prepareImportContent();", "function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }", "public function Import()\n {\n if ($url = $this->GetPreference('remote_gallery', false)) {\n $result = MCFile::SyncFromUrl($url);\n }\n }", "public function importxls()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t$xls\t\t= $this->file['tmp_name'];\n\t\t\t$objPHPExcel\t= PHPExcel_IOFactory::load($xls);\n\t\t\t$sht\t\t= $objPHPExcel->getActiveSheet();\n\n\t\t\t$highestColumm\t= $sht->getHighestDataColumn();\n\t\t\t$highestRow\t= $sht->getHighestDataRow();\n\t\t\t$range\t\t= \"A1:\".$highestColumm.$highestRow;\n\n\t\t\t$rows\t\t= $sht->rangeToArray($range);\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t\treturn;\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "private function getDataByScrapeUrl()\n {\n return file_get_contents($this->url);\n }", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "public function findImport($url){\n\t\t$matches = array();\n\t\tif(preg_match('|#WE:(\\d+)#|', $url, $matches)){\n\t\t\t$url = intval($matches[1]);\n\t\t\treturn (f('SELECT Extension FROM ' . FILE_TABLE . ' WHERE ID=' . $url) === '.scss' ? $url : null);\n\t\t}\n\t\treturn parent::findImport($url);\n\t}", "public function setUrl(?string $url): void;", "function load_from_row ($row) {\n $this->id = $row['content_id'];\n $this->path = $row['content_path'];\n $this->user_id = $row['user_id'];\n $this->perso_id = $row['perso_id'];\n $this->title = $row['content_title'];\n }", "function gdn_import($dat){\n if(is_string($dat)) return $this->gdn_imp_one($dat);\n if(is_array($dat)){\n foreach($dat as $key=>$val)\n\tif(is_string($val)) $dat[$key] = $this->gdn_imp_one($val);\n return array_filter($dat);\n }\n return NULL; \n }", "abstract public function get_url_read();", "public function import(HTTPRequest $request)\n {\n $hasheader = (bool)$request->postVar('HasHeader');\n $cleardata = $this->component->getCanClearData() ?\n (bool)$request->postVar('ClearData') :\n false;\n if ($request->postVar('action_import')) {\n $file = File::get()\n ->byID($request->param('FileID'));\n if (!$file) {\n return \"file not found\";\n }\n\n $temp_file = $this->tempFileFromStream($file->getStream());\n\n $colmap = Convert::raw2sql($request->postVar('mappings'));\n if ($colmap) {\n //save mapping to cache\n $this->cacheMapping($colmap);\n //do import\n $results = $this->importFile(\n $temp_file,\n $colmap,\n $hasheader,\n $cleardata\n );\n $this->gridField->getForm()\n ->sessionMessage($results->getMessage(), 'good');\n }\n }\n $controller = $this->getToplevelController();\n $controller->redirectBack();\n }", "function _fix_data() {\n\t\tif (isset($this->url) && $this->url) $this->_parse_url($this->url);\n\n\t\treturn true;\n\t}", "public function import(\\Networkteam\\Import\\DataProvider\\DataProviderInterface $dataProvider): ImportResult;", "protected static function parse_url($url)\n {\n }", "abstract public function loadData();", "public function load ()\n {\n return $this->url;\n }", "public function loadDocument($url);", "public function importExcel($path);", "function import_data(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\t$action = get_get_var('action');\r\n\techo '<h4>Import Data</h4>';\r\n\r\n\t$mount_point = get_post_var('mount_point');\r\n\t// validate this\r\n\tif ($mount_point != \"\" && $mount_point{0} != '/'){\r\n\t\t$action = \"\";\r\n\t\tonnac_error(\"Invalid mount point specified! Must start with a '/'\");\r\n\t}\r\n\t\r\n\tif ($action == \"\"){\r\n\t\r\n\t\t$option = \"\";\r\n\t\t$result = db_query(\"SELECT url from $cfg[t_content] ORDER BY url\");\r\n\t\t\r\n\t\t// first, assemble three arrays of file information\r\n\t\tif (db_has_rows($result)){\r\n\t\t\r\n\t\t\t$last_dir = '/';\r\n\t\t\r\n\t\t\twhile ($row = db_fetch_row($result)){\r\n\t\t\t\r\n\t\t\t\t// directory names, without trailing /\r\n\t\t\t\t$dirname = dirname($row[0] . 'x');\r\n\t\t\t\tif ($dirname == '\\\\' || $dirname == '/')\r\n\t\t\t\t\t$dirname = '';\r\n\t\t\t\t\r\n\t\t\t\tif ($last_dir != $dirname){\r\n\t\t\t\t\tif ($last_dir != '')\r\n\t\t\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\r\n\t\t\t\t\r\n\t\t\t\t\t$last_dir = $dirname;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($last_dir != '')\r\n\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\t\t\r\n\t\t}\r\n\t\r\n\t\t?>\r\n\t\t\r\n<form name=\"import\" action=\"##pageroot##/?mode=import&action=import\" enctype=\"multipart/form-data\" method=\"post\">\r\n\t<table>\r\n\t\t<tr><td>File to import:</td><td><input name=\"data\" type=\"file\" size=\"40\"/></td></tr>\r\n\t\t<tr><td>*Mount point:</td><td><input name=\"mount_point\" type=\"text\" size=\"40\" value=\"/\" /></td></tr>\r\n\t\t<tr><td><em>==&gt;&gt; Choose a directory</em></td><td><select onchange=\"document.import.mount_point.value = document.import.directory.options[document.import.directory.selectedIndex].value;\" name=\"directory\"><?php echo $option; ?></select></td></tr>\r\n\t</table>\r\n\t<input type=\"submit\" value=\"Import\" /><br/>\r\n\t<em>* Mount point is a value that is prefixed to all file names, including content, banner, and menu data. It is the root directory in which the data is based.</em>\r\n</form>\r\n<?php\r\n\t\r\n\t}else if ($action == \"import\"){\r\n\t\t\r\n\t\t$filename = \"\";\r\n\t\t\r\n\t\t// get the contents of the uploaded file\r\n\t\tif (isset($_FILES['data']) && is_uploaded_file($_FILES['data']['tmp_name'])){\r\n\t\t\t$filename = $_FILES['data']['tmp_name'];\r\n\t\t}\r\n\t\t\r\n\t\t$imported = get_import_data($filename,false);\r\n\t\t\r\n\t\tif ($imported !== false){\r\n\t\t\r\n\t\t\t// check to see if we need to ask the user to approve anything\r\n\t\t\t$user_approved = false;\r\n\t\t\tif (get_post_var('user_approved') == 'yes')\r\n\t\t\t\t$user_approved = true;\r\n\t\t\r\n\t\t\t// take care of SQL transaction up here\r\n\t\t\t$ret = false;\r\n\t\t\tif ($user_approved && !db_begin_transaction())\r\n\t\t\t\treturn onnac_error(\"Could not begin SQL transaction!\");\r\n\t\t\r\n\t\t\t// automatically detect import type, and do it!\r\n\t\t\tif ($imported['dumptype'] == 'content' || $imported['dumptype'] == 'all'){\r\n\t\t\t\t$ret = import_content($imported,$user_approved,false);\r\n\t\t\t}else if ($imported['dumptype'] == 'templates'){\r\n\t\t\t\t$ret = import_templates($imported,$user_approved,false);\r\n\t\t\t}else{\r\n\t\t\t\techo \"Invalid import file!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ret && $user_approved && db_is_valid_result(db_commit_transaction()))\r\n\t\t\t\techo \"All imports successful!\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\techo \"Error importing data!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t}\r\n\t\t\t\r\n\t}else{\r\n\t\theader(\"Location: $cfg[page_root]?mode=import\");\t\r\n\t}\t\r\n\t\r\n\t// footer\r\n\techo \"<p><a href=\\\"##pageroot##/\\\">Return to main administrative menu</a></p>\";\r\n\t\r\n}", "function bit_admin_import_csv( $playid ) {\n}", "public function import($params)\n {\n $this->results->basename = $params['basename'];\n $this->results->filepath = $params['filepath'];\n \n $this->project = $project = $params['project'];\n $this->projectId = $project->getId();\n \n $ss = $this->reader->load($params['filepath']);\n\n //if ($worksheetName) $ws = $reader->getSheetByName($worksheetName);\n $ws = $ss->getSheet(0);\n \n $rows = $ws->toArray();\n \n $header = array_shift($rows);\n \n $this->processHeaderRow($header);\n \n // Insert each record\n foreach($rows as $row)\n {\n $item = $this->processDataRow($row);\n \n $this->processItem($item);\n }\n $this->gameRepo->commit();\n \n return $this->results;\n }", "public function import_from_file($filename)\n {\n }", "public function import(FieldInstance $instance, array $values = NULL);", "public function import(){\n include APPPATH.'third_party/PHPExcel.php';\n \n $excelreader = new PHPExcel_Reader_Excel2007();\n $loadexcel = $excelreader->load('uploads/'.$this->filename.'.xlsx'); /* Load file yang telah diupload ke folder excel */\n $sheet = $loadexcel->getActiveSheet()->toArray(null, true, true ,true);\n \n /* Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database */\n $data = array();\n \n $numrow = 1;\n foreach($sheet as $row){\n\n /* ----------------------------------------------\n * Cek $numrow apakah lebih dari 1\n * Artinya karena baris pertama adalah nama-nama kolom\n * Jadi dilewat saja, tidak usah diimport\n * ----------------------------------------------\n */\n\n if($numrow > 1){\n \n /* Kita push (add) array data ke variabel data */\n array_push($data, array(\n 'id_guru' => '',\n 'nuptk' =>$row['A'],\n 'nama_guru' =>$row['B'],\n 'jenis_kelamin' =>$row['C'],\n 'username' =>$row['D'],\n 'password' =>password_hash($row['E'],PASSWORD_DEFAULT)\n ));\n }\n \n $numrow++; // Tambah 1 setiap kali looping\n }\n\n $this->Mdl_guru->insert_multiple($data);\n \n redirect(\"Guru\");\n }" ]
[ "0.56360614", "0.54688984", "0.54011303", "0.5334175", "0.5296072", "0.52199614", "0.516939", "0.51646346", "0.51397234", "0.51350087", "0.5128872", "0.51220095", "0.5118983", "0.5114272", "0.50947046", "0.50837094", "0.5070334", "0.5070334", "0.5061316", "0.5061316", "0.5061316", "0.5061316", "0.5056522", "0.505146", "0.50494915", "0.50390846", "0.50345826", "0.500464", "0.4967553", "0.49557528", "0.4951402", "0.49200845", "0.49140987", "0.4911437", "0.48937857", "0.4887159", "0.48789373", "0.48541492", "0.48535585", "0.48487464", "0.48320222", "0.4825734", "0.48236504", "0.4821162", "0.48178267", "0.4817023", "0.48091757", "0.48027802", "0.4790777", "0.4788459", "0.4781888", "0.47814557", "0.4780767", "0.4755258", "0.47472936", "0.4736603", "0.4729756", "0.47269797", "0.4714535", "0.47062445", "0.47026458", "0.46941003", "0.46888202", "0.46806172", "0.46767196", "0.46708032", "0.46697435", "0.46453506", "0.46445802", "0.46253985", "0.46166635", "0.46151674", "0.46106878", "0.46042275", "0.46019754", "0.45946887", "0.45906696", "0.45892137", "0.4582278", "0.4581991", "0.45789438", "0.4578914", "0.45781556", "0.4574703", "0.4574335", "0.4570864", "0.45686108", "0.45676428", "0.45606637", "0.4556501", "0.45560178", "0.4551788", "0.45514992", "0.45507732", "0.45470616", "0.45366815", "0.45344007", "0.45298344", "0.45290983", "0.45236382" ]
0.49400556
31
Returns the context used to store files. On first call construct the result based on $mod. On subsequent calls return the cached value.
protected function get_context($mod=null) { if ($this->_context) { return $this->_context; } global $DB; $module = $DB->get_record('modules', array('name' => 'data'), '*', MUST_EXIST); $cm = $DB->get_record('course_modules', array('course' => $mod->course, 'instance' => $mod->id, 'module' => $module->id), '*', MUST_EXIST); $this->_context = get_context_instance(CONTEXT_MODULE, $cm->id); return $this->_context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _context()\n {\n return $this->_file()->context;\n }", "function frmget_context() {\n\tglobal $CFG, $DB;\n //include this file for content /libdir/filelib.php\n return $systemcontext = context_system::instance();\t\n}", "public static function context() {\n\t\treturn self::get_context();\n\t}", "public static function context()\n {\n return self::$_context;\n }", "private function getFileCache()\n {\n $shopIdCalculatorMock = $this->getMock(ShopIdCalculator::class, array('getShopId'), array(), '', false);\n $shopIdCalculatorMock->method('getShopId')->willReturn(1);\n\n return oxNew(SubShopSpecificFileCache::class, $shopIdCalculatorMock);\n }", "public function temp()\n\t\t{\n\t\t\tif ($this->is_cached()) {\n\t\t\t\tself::put($this->get_path_temp(), $this->get_content());\n\t\t\t} else {\n\t\t\t\tif ($this->exists()) {\n\t\t\t\t\t$this->copy($this->get_path_temp());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->update_attrs(array(\n\t\t\t\t\"name\" => basename($this->get_path_temp()),\n\t\t\t\t\"path\" => dirname($this->get_path_temp()),\n\t\t\t\t\"temp\" => true,\n\t\t\t));\n\n\t\t\treturn $this;\n\t\t}", "protected function getContext() {\n\t\treturn $this->context;\n\t}", "public static function getContext()\n {\n if (isset(self::$context) == false) {\n self::$context = new Context();\n }\n\n return self::$context;\n }", "public function getCacheFile()\n\t{\n\t\treturn $this->tempDir . '/' . $this->filename;\n\t}", "public function getContext();", "public function getContext();", "public function getContext();", "public function getContext();", "public function getContext();", "protected function getContext() {}", "abstract public function get_context();", "protected function getContext()\n\t{\n\t\treturn $this->context;\n\t}", "private function getFileContext () {\n\n $temp = $this->cleanse( filter_var( $_SERVER['HTTP_REFERER'] , FILTER_SANITIZE_URL ) );\n\n $this->referer = substr( $temp , -1 * ( strlen( $temp ) - strrpos( $temp , \"/\" ) - 1 ) );\n $this->log->write( '[Form] [context] Refererring Form: ' . $this->referer );\n\n $this->template = substr( $this->referer , 0 , strpos( $this->referer , \".\" ) ) . \".txt\";\n $this->template = $_SERVER['DOCUMENT_ROOT'] . '/forms-text/' . $this->template;\n $this->log->write( '[Form] [context] Template: ' . $this->template );\n\n $this->thankyou = substr( $this->referer , 0 , strpos( $this->referer , \".\" ) ) . \"-thanks.html\";\n $this->thankyou = '/forms-thanks/' . $this->thankyou;\n $this->log->write( '[Form] [context] Thank You: ' . $this->thankyou );\n\n }", "private function getCacheFile() {\n return new File($this->rootPath, self::CACHE_FILE);\n }", "public function getContext()\n {\n return self::$context;\n }", "protected function getContext()\n {\n return $this->_context;\n }", "protected function getContext()\n {\n return $this->_context;\n }", "public function getContext() {\n\t\treturn $this->getPrivateSetting('context');\n\t}", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "private function get_context() {\n return context_course::instance($this->course->id);\n }", "public function getContext() {\r\n\t\treturn $this->context;\r\n\t}", "function get_context_instance($contextlevel=NULL, $instance=0) {\n\n global $context_cache, $context_cache_id, $CONTEXT;\n static $allowed_contexts = array(CONTEXT_SYSTEM, CONTEXT_PERSONAL, CONTEXT_USER, CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_GROUP, CONTEXT_MODULE, CONTEXT_BLOCK);\n\n // Yu: Separating site and site course context - removed CONTEXT_COURSE override when SITEID\n \n // fix for MDL-9016\n if ($contextlevel == 'clearcache') {\n // Clear ALL cache\n $context_cache = array();\n $context_cache_id = array();\n $CONTEXT = ''; \n return false;\n }\n\n/// If no level is supplied then return the current global context if there is one\n if (empty($contextlevel)) {\n if (empty($CONTEXT)) {\n //fatal error, code must be fixed\n error(\"Error: get_context_instance() called without a context\");\n } else {\n return $CONTEXT;\n }\n }\n\n/// Backwards compatibility with obsoleted (CONTEXT_SYSTEM, SITEID)\n if ($contextlevel == CONTEXT_SYSTEM) {\n $instance = 0;\n }\n\n/// check allowed context levels\n if (!in_array($contextlevel, $allowed_contexts)) {\n // fatal error, code must be fixed - probably typo or switched parameters\n error('Error: get_context_instance() called with incorrect context level \"'.s($contextlevel).'\"');\n }\n\n/// Check the cache\n if (isset($context_cache[$contextlevel][$instance])) { // Already cached\n return $context_cache[$contextlevel][$instance];\n }\n\n/// Get it from the database, or create it\n if (!$context = get_record('context', 'contextlevel', $contextlevel, 'instanceid', $instance)) {\n create_context($contextlevel, $instance);\n $context = get_record('context', 'contextlevel', $contextlevel, 'instanceid', $instance);\n }\n\n/// Only add to cache if context isn't empty.\n if (!empty($context)) {\n $context_cache[$contextlevel][$instance] = $context; // Cache it for later\n $context_cache_id[$context->id] = $context; // Cache it for later\n }\n\n return $context;\n}", "public function context()\n {\n return $this->context;\n }", "public function context()\n {\n return $this->context;\n }", "public function files() {\n if(isset($this->cache['files'])) return $this->cache['files'];\n return $this->cache['files'] = new Files($this);\n }", "public function getCacheContexts() {\n\t\t//you must set context of this block with 'route' context tag.\n\t\t//Every new route this block will rebuild\n\t\treturn Cache::mergeContexts( parent::getCacheContexts(), array( 'route' ) );\n\t}", "protected function _getCache()\n {\n if (!isset($this->_configuration)) {\n $this->_configuration = \\Yana\\Db\\Binaries\\ConfigurationSingleton::getInstance();\n }\n return $this->_configuration->getFileNameCache();\n }", "public function getContext() {\n\t\treturn $this->context;\n\t}", "protected function load($context) {\n\t\treturn $context;\n\t}", "public final function getContext ()\n {\n return $this->context;\n }", "public final function getContext ()\n {\n return $this->context;\n }", "public final function getContext ()\n {\n\n return $this->context;\n\n }", "public static function getContext(){\n if(!isset(self::$instance)){\n self::$instance = new JeproshopContext();\n }\n return self::$instance;\n }", "private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }", "public function getContext()\r\n\t{\r\n\t\treturn $this->context;\r\n\t}", "public function getContext ()\n {\n return $this->context;\n }", "function &getContext() {\n\t\treturn $this->_context;\n\t}", "public function getContext()\r\n {\r\n return $this->context;\r\n }", "public function getcontext()\n {\n return $this->context;\n }", "public function getContext()\n\t\t{\n\t\t\treturn $this->context;\n\t\t}", "public function getContext()\n\t{\n\t\treturn $this->context;\n\t}", "function elgg_get_filepath_cache() {\n\tglobal $CONFIG;\n\tstatic $FILE_PATH_CACHE;\n\tif (!$FILE_PATH_CACHE) {\n\t\t$FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);\n\t}\n\n\treturn $FILE_PATH_CACHE;\n}", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "public function getContext()\n {\n return $this->context;\n }", "protected static function getStackCache()\n {\n if (self::$stackCache == null) {\n //Folder save Cache response\n if (isset(self::$configApp['cacheHttp']) && isset(self::$configApp['cacheHttp']['folderCache'])) {\n $folderCache = self::$configApp['cacheHttp']['folderCache'];\n } else {\n $folderCache = __DIR__ . '/../../storage/cacheHttp';\n }\n //Create folder\n if (is_dir($folderCache) == false) {\n mkdir($folderCache, 0777, true);\n chmod($folderCache, 0777);\n }\n\n $localStorage = new Local($folderCache);\n $systemStorage = new FlysystemStorage($localStorage);\n $cacheStrategy = new PrivateCacheStrategy($systemStorage);\n\n $stack = HandlerStack::create();\n $stack->push(new CacheMiddleware($cacheStrategy), 'cache');\n self::$stackCache = $stack;\n }\n return self::$stackCache;\n }", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "public function getContext() {\n return $this->context;\n }", "public function getContext() {\n return $this->context;\n }", "function kilman_get_context($cmid) {\n static $context;\n\n if (isset($context)) {\n return $context;\n }\n\n if (!$context = context_module::instance($cmid)) {\n print_error('badcontext');\n }\n return $context;\n}", "public function getContext() {\n return $this->context;\n }", "public function getContext() : Context {\n return $this->context;\n }", "protected function getTemplateContextService()\n {\n return $this->services['template_context'] = new \\phpbb\\template\\context();\n }", "public function getCache()\r\n {\r\n if ($this->exists('cache')) {\r\n return ROOT . $this->get('cache');\r\n }\r\n else\r\n return ROOT . '/cache';\r\n }", "private static function prep() {\n\t\tif (!isset(F3::$global['CACHE'])) {\n\t\t\t// Extensions usable as cache back-ends\n\t\t\t$_exts=array_intersect(\n\t\t\t\texplode('|','apc|xcache'),get_loaded_extensions()\n\t\t\t);\n\t\t\tforeach (array_keys($_exts,'') as $_null)\n\t\t\t\tunset($_exts[$_null]);\n\t\t\t$_exts=array_merge($_exts,array());\n\t\t\tF3::$global['CACHE']=$_exts[0]?:\n\t\t\t\t('folder='.F3::$global['BASE'].'cache/');\n\t\t}\n\t\tif (preg_match(\n\t\t\t'/^(?:(folder)\\=(.+\\/)|(apc)|(memcache)=(.+))|(xcache)/i',\n\t\t\tF3::$global['CACHE'],$_match)) {\n\t\t\tif ($_match[1]) {\n\t\t\t\tif (!file_exists($_match[2])) {\n\t\t\t\t\tif (!is_writable(dirname($_match[2])) &&\n\t\t\t\t\t\tfunction_exists('posix_getpwuid')) {\n\t\t\t\t\t\t\t$_uid=posix_getpwuid(posix_geteuid());\n\t\t\t\t\t\t\tF3::$global['CONTEXT']=array(\n\t\t\t\t\t\t\t\t$_uid['name'],realpath(dirname($_match[2]))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttrigger_error(F3::TEXT_Write);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Create the framework's cache folder\n\t\t\t\t\tmkdir($_match[2],0755);\n\t\t\t\t}\n\t\t\t\t// File system\n\t\t\t\tself::$l1cache=array('type'=>'folder','id'=>$_match[2]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ext=strtolower($_match[3]?:($_match[4]?:$_match[6]));\n\t\t\t\tif (!extension_loaded($_ext)) {\n\t\t\t\t\tF3::$global['CONTEXT']=$_ext;\n\t\t\t\t\ttrigger_error(F3::TEXT_PHPExt);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ($_match[4]) {\n\t\t\t\t\t// Open persistent MemCache connection(s)\n\t\t\t\t\t// Multiple servers separated by semi-colon\n\t\t\t\t\t$_pool=explode(';',$_match[5]);\n\t\t\t\t\t$_mcache=NULL;\n\t\t\t\t\tforeach ($_pool as $_server) {\n\t\t\t\t\t\t// Hostname:port\n\t\t\t\t\t\tlist($_host,$_port)=explode(':',$_server);\n\t\t\t\t\t\tif (is_null($_port))\n\t\t\t\t\t\t\t// Use default port\n\t\t\t\t\t\t\t$_port=11211;\n\t\t\t\t\t\t// Connect to each server\n\t\t\t\t\t\tif (is_null($_mcache))\n\t\t\t\t\t\t\t$_mcache=memcache_pconnect($_host,$_port);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmemcache_add_server($_mcache,$_host,$_port);\n\t\t\t\t\t}\n\t\t\t\t\t// MemCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext,'id'=>$_mcache);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t// APC and XCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext);\n\t\t\t}\n\t\t\tself::$l1cache['current']=FALSE;\n\t\t\treturn TRUE;\n\t\t}\n\t\t// Unknown back-end\n\t\ttrigger_error(self::TEXT_Backend);\n\t\treturn FALSE;\n\t}", "public function getContext(): mixed;", "private function MakeContext(&$mod, $context, &$db, $pref)\n\t{\n\t\t$cid = $db->GenID($pref.'module_auth_contexts_seq');\n\t\tif (is_numeric($context)) {\n\t\t\t$name = 'Import_data('.$context.')'; //no translation\n\t\t} else {\n\t\t\t$name = $context;\n\t\t}\n\t\t$t = preg_replace(['/\\s+/', '/__+/'], ['_', '_'], $name);\n\t\tif (extension_loaded('mbstring')) {\n\t\t\t$t = mb_convert_case($t, MB_CASE_LOWER, 'UTF-8');\n\t\t} else {\n\t\t\t$t = strtolower($t);\n\t\t}\n\t\t$alias = substr($t, 0, 16);\n\n\t\t$cfuncs = new Crypter($mod);\n\t\t$t = $cfuncs->decrypt_preference('default_password');\n\t\t$hash = $cfuncs->encrypt_value($t);\n\n\t\t$sql = 'INSERT INTO '.$pref.'module_auth_contexts (id,name,alias,default_password) VALUES (?,?,?,?)';\n\t\t$db->Execute($sql, [$cid, $name, $alias, $hash]);\n\t\treturn $cid;\n\t}", "function Cache_Container_file($options = '')\n {\n if (is_array($options)) {\n $this->setOptions($options, array_merge($this->allowed_options, array('cache_dir', 'filename_prefix', 'max_userdata_linelength')));\n }\n clearstatcache();\n if ($this->cache_dir) {\n // make relative paths absolute for use in deconstructor.\n // it looks like the deconstructor has problems with relative paths\n if (OS_UNIX && '/' != $this->cache_dir{0} )\n $this->cache_dir = realpath( getcwd() . '/' . $this->cache_dir) . '/';\n\n // check if a trailing slash is in cache_dir\n if ($this->cache_dir{strlen($this->cache_dir)-1} != DIRECTORY_SEPARATOR)\n $this->cache_dir .= '/';\n\n if (!file_exists($this->cache_dir) || !is_dir($this->cache_dir))\n mkdir($this->cache_dir, 0755);\n }\n $this->entries = array();\n $this->group_dirs = array();\n \n } // end func contructor\n\n function fetch($id, $group)\n {\n $file = $this->getFilename($id, $group);\n if (PEAR::isError($file)) {\n return $file;\n }\n\n if (!file_exists($file)) {\n return array(null, null, null);\n }\n // retrive the content\n if (!($fh = @fopen($file, 'rb'))) {\n return new Cache_Error(\"Can't access cache file '$file'. Check access rights and path.\", __FILE__, __LINE__);\n }\n // File locking (shared lock)\n if ($this->fileLocking) {\n flock($fh, LOCK_SH);\n }\n // file format:\n // 1st line: expiration date\n // 2nd line: user data\n // 3rd+ lines: cache data\n $expire = trim(fgets($fh, 12));\n if ($this->max_userdata_linelength == 0 ) {\n $userdata = trim(fgets($fh));\n } else {\n $userdata = trim(fgets($fh, $this->max_userdata_linelength));\n }\n $buffer = '';\n while (!feof($fh)) {\n \t$buffer .= fread($fh, 8192);\n }\n $cachedata = $this->decode($buffer);\n\n // Unlocking\n if ($this->fileLocking) {\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n\n // last usage date used by the gc - maxlifetime\n // touch without second param produced stupid entries...\n touch($file,time());\n clearstatcache();\n\n return array($expire, $cachedata, $userdata);\n } // end func fetch\n\n /**\n * Stores a dataset.\n *\n * WARNING: If you supply userdata it must not contain any linebreaks,\n * otherwise it will break the filestructure.\n */\n function save($id, $cachedata, $expires, $group, $userdata)\n {\n $this->flushPreload($id, $group);\n\n $file = $this->getFilename($id, $group);\n if (!($fh = @fopen($file, 'wb'))) {\n return new Cache_Error(\"Can't access '$file' to store cache data. Check access rights and path.\", __FILE__, __LINE__);\n }\n\n // File locking (exclusive lock)\n if ($this->fileLocking) {\n flock($fh, LOCK_EX);\n }\n // file format:\n // 1st line: expiration date\n // 2nd line: user data\n // 3rd+ lines: cache data\n $expires = $this->getExpiresAbsolute($expires);\n fwrite($fh, $expires . \"\\n\");\n fwrite($fh, $userdata . \"\\n\");\n fwrite($fh, $this->encode($cachedata));\n\n // File unlocking\n if ($this->fileLocking) {\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n\n // I'm not sure if we need this\n\t// i don't think we need this (chregu)\n // touch($file);\n\n return true;\n } // end func save\n\n function remove($id, $group)\n {\n $this->flushPreload($id, $group);\n\n $file = $this->getFilename($id, $group);\n if (PEAR::isError($file)) {\n return $file;\n }\n\n if (file_exists($file)) {\n $ok = unlink($file);\n clearstatcache();\n\n return $ok;\n }\n\n return false;\n } // end func remove\n\n function flush($group)\n {\n $this->flushPreload();\n $dir = ($group) ? $this->cache_dir . $group . '/' : $this->cache_dir;\n\n $num_removed = $this->deleteDir($dir);\n unset($this->group_dirs[$group]);\n clearstatcache();\n\n return $num_removed;\n } // end func flush\n\n function idExists($id, $group)\n {\n return file_exists($this->getFilename($id, $group));\n } // end func idExists\n\n /**\n * Deletes all expired files.\n *\n * Garbage collection for files is a rather \"expensive\", \"long time\"\n * operation. All files in the cache directory have to be examined which\n * means that they must be opened for reading, the expiration date has to be\n * read from them and if neccessary they have to be unlinked (removed).\n * If you have a user comment for a good default gc probability please add it to\n * to the inline docs.\n *\n * @param integer Maximum lifetime in seconds of an no longer used/touched entry\n * @throws Cache_Error\n */\n function garbageCollection($maxlifetime)\n {\n $this->flushPreload();\n clearstatcache();\n\n $ok = $this->doGarbageCollection($maxlifetime, $this->cache_dir);\n\n // check the space used by the cache entries \n if ($this->total_size > $this->highwater) {\n \n krsort($this->entries);\n reset($this->entries);\n \n while ($this->total_size > $this->lowwater && list($lastmod, $entry) = each($this->entries)) {\n if (@unlink($entry['file'])) {\n $this->total_size -= $entry['size'];\n } else {\n new CacheError(\"Can't delete {$entry['file']}. Check the permissions.\");\n }\n }\n \n }\n \n $this->entries = array();\n $this->total_size = 0;\n \n return $ok;\n } // end func garbageCollection\n \n /**\n * Does the recursive gc procedure, protected.\n *\n * @param integer Maximum lifetime in seconds of an no longer used/touched entry\n * @param string directory to examine - don't sets this parameter, it's used for a\n * recursive function call!\n * @throws Cache_Error\n */\n function doGarbageCollection($maxlifetime, $dir)\n {\n if (!is_writable($dir) || !is_readable($dir) || !($dh = opendir($dir))) {\n return new Cache_Error(\"Can't remove directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n\n while ($file = readdir($dh)) {\n if ('.' == $file || '..' == $file)\n continue;\n\n $file = $dir . $file;\n if (is_dir($file)) {\n $this->doGarbageCollection($maxlifetime,$file . '/');\n continue;\n }\n\n // skip trouble makers but inform the user\n if (!($fh = @fopen($file, 'rb'))) {\n new Cache_Error(\"Can't access cache file '$file', skipping it. Check permissions and path.\", __FILE__, __LINE__);\n continue;\n }\n\n $expire = fgets($fh, 11);\n fclose($fh);\n $lastused = filemtime($file);\n \n $this->entries[$lastused] = array('file' => $file, 'size' => filesize($file));\n $this->total_size += filesize($file);\n \n // remove if expired\n if (( ($expire && $expire <= time()) || ($lastused <= (time() - $maxlifetime)) ) && !unlink($file)) {\n new Cache_Error(\"Can't unlink cache file '$file', skipping. Check permissions and path.\", __FILE__, __LINE__);\n }\n }\n\n closedir($dh);\n\n // flush the disk state cache\n clearstatcache();\n\n } // end func doGarbageCollection\n\n /**\n * Returns the filename for the specified id.\n *\n * @param string dataset ID\n * @param string cache group\n * @return string full filename with the path\n * @access public\n */\n function getFilename($id, $group)\n {\n if (isset($this->group_dirs[$group])) {\n return $this->group_dirs[$group] . $this->filename_prefix . $id;\n }\n\n $dir = $this->cache_dir . $group . '/';\n if (is_writeable($this->cache_dir)) {\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n clearstatcache();\n }\n } else {\n return new Cache_Error(\"Can't make directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n $this->group_dirs[$group] = $dir;\n\n return $dir . $this->filename_prefix . $id;\n } // end func getFilename\n\n /**\n * Deletes a directory and all files in it.\n *\n * @param string directory\n * @return integer number of removed files\n * @throws Cache_Error\n */\n function deleteDir($dir)\n {\n if (!is_writable($dir) || !is_readable($dir) || !($dh = opendir($dir))) {\n return new Cache_Error(\"Can't remove directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n\n $num_removed = 0;\n\n while (false !== $file = readdir($dh)) {\n if ('.' == $file || '..' == $file)\n continue;\n\n $file = $dir . $file;\n if (is_dir($file)) {\n $file .= '/';\n $num = $this->deleteDir($file . '/');\n if (is_int($num))\n $num_removed += $num;\n } else {\n if (unlink($file))\n $num_removed++;\n }\n }\n // according to php-manual the following is needed for windows installations.\n closedir($dh);\n unset( $dh);\n if ($dir != $this->cache_dir) { //delete the sub-dir entries itself also, but not the cache-dir.\n rmDir($dir);\n $num_removed++;\n }\n\n return $num_removed;\n } // end func deleteDir\n \n}", "public function getCacheContexts() {\n //you must set context of this block with 'route' context tag.\n //Every new route this block will rebuild\n return Cache::mergeContexts(parent::getCacheContexts(), array('route'));\n }", "protected function getAssets_ContextService()\n {\n return $this->services['assets.context'] = new \\Symfony\\Component\\Asset\\Context\\RequestStackContext($this->get('request_stack'));\n }", "private function getContext()\n {\n $context = $this->request->getData('context');\n\n return Context::isValidOrFail($context) ? $context : null;\n }", "protected function getCacheModule() {}", "function readContext() {return $this->_context;}", "public function getCurrentFile() {}", "public static function getCacheFile()\r\n {\r\n return self::$_cacheFile;\r\n }", "protected static function getContext()\n\t{\n\t\t$opts = array(\n\t\t\t'socket' => array(\n\t\t\t\t'backlog' => MHTTPD::$config['Server']['queue_backlog'],\n\t\t\t),\n\t\t);\n\t\tif (MHTTPD::$config['SSL']['enabled']) {\n\t\t\t\n\t\t\t// Find SSL certificate file\n\t\t\t$cert = MHTTPD::$config['SSL']['cert_file'];\n\t\t\tif ( !($cert_file = realpath($cert))\n\t\t\t\t&& !($cert_file = realpath(MHTTPD::getInipath().$cert))\n\t\t\t\t) {\n\t\t\t\ttrigger_error(\"Cannot find SSL certificate file: {$cert}\", E_USER_ERROR);\n\t\t\t}\n\t\t\t\n\t\t\t// Add SSL options\n\t\t\t$opts['ssl'] = array(\n\t\t\t\t'local_cert' => $cert_file,\n\t\t\t\t'passphrase' => MHTTPD::$config['SSL']['passphrase'],\n\t\t\t\t'allow_self_signed' => true,\n\t\t\t\t'verify_peer' => false,\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn stream_context_create($opts);\n\t}", "protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }", "private function getContext()\n {\n if ($this->context === null) {\n $this->context = $this->container->get('security.context');\n }\n return $this->context;\n }", "public function getContext(): Context\n {\n return $this->context;\n }", "protected function get_context() {\n $contextclass = '\\local_elisprogram\\context\\\\'.$this->contextlevel;\n if ($this->contextlevel !== 'system' && class_exists($contextclass)) {\n $id = $this->required_param('id', PARAM_INT);\n return $contextclass::instance($id);\n } else {\n return context_system::instance();\n }\n }", "public function getContext(): Context\n\t{\n\t\treturn $this->context;\n\t}", "protected function _get_page_context() {\n $context = $this->get_context();\n return (!empty($context)) ? $context : context_system::instance();\n }", "public function getStaticViewFileContext()\n {\n $params = [];\n $this->updateDesignParams($params);\n $themePath = $this->design->getThemePath($params['themeModel']);\n $isSecure = $this->request->isSecure();\n return $this->getFallbackContext(\n UrlInterface::URL_TYPE_STATIC,\n $isSecure,\n $params['area'],\n $themePath,\n $params['locale']\n );\n }", "private function &_get_package_cache()\n {\n return $this->EE->session->cache[$this->_namespace][$this->_package_name];\n }", "function fn_get_local_data($val)\n{\n $cache = Registry::get('temp_fs_data');\n\n if (!isset($cache[$val['path']])) { // cache file to allow multiple usage\n $tempfile = fn_create_temp_file();\n if (move_uploaded_file($val['path'], $tempfile) == true) {\n @chmod($tempfile, DEFAULT_FILE_PERMISSIONS);\n clearstatcache(true, $tempfile);\n $cache[$val['path']] = $tempfile;\n } else {\n $cache[$val['path']] = '';\n }\n\n Registry::set('temp_fs_data', $cache);\n }\n\n if (defined('KEEP_UPLOADED_FILES')) {\n $tempfile = fn_create_temp_file();\n fn_copy($cache[$val['path']], $tempfile);\n $val['path'] = $tempfile;\n } else {\n $val['path'] = $cache[$val['path']];\n }\n\n return !empty($val['size']) ? $val : false;\n}", "function & getFileInstance() \n {\n $vfile =& v()->filesystem()->file();\n \t return $vfile;\n }", "function GetFromCache()\n {\n return File::GetContents($this->file);\n }", "public function getFileInstance()\n {\n return $this->file;\n }", "protected function getSessionContext()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$package = $app->getUserState('com_fabrik.package', 'fabrik');\n\t\treturn 'com_' . $package . '.list' . $this->model->getRenderContext() . '.plugins.' . $this->onGetFilterKey() . '.';\n\t}", "private function lazy_get_vars(): Storage\n\t{\n\t\treturn $this->create_storage($this->config[AppConfig::STORAGE_FOR_VARS]);\n\t}", "protected function initializeFs()\n {\n return CacheFs::initialize();\n }", "public static function getCache()\n\t{\n\t if (!self::$cache) {\n\t\t\t$frontendOptions = array('lifetime' => 604800, \n\t\t\t\t\t\t\t\t\t 'automatic_serialization' => true);\n\t\t\t$backendOptions = array('cache_dir' => APPLICATION_PATH . '/../data/cache');\n\t\t\tself::$cache \t = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);\n\t }\n\t\treturn self::$cache;\n\t}", "public function contextStrategy();", "public function &_getStorage()\n\t{\n\t\t$hash = md5(serialize($this->_options));\n\n\t\tif (isset(self::$_handler[$hash]))\n\t\t{\n\t\t\treturn self::$_handler[$hash];\n\t\t}\n\n\t\tself::$_handler[$hash] = TCacheStorage::getInstance($this->_options['storage'], $this->_options);\n\n\t\treturn self::$_handler[$hash];\n\t}", "public function getContextInfo() {}", "function escape_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n global $CFG, $DB;\n\n if (!has_capability('moodle/course:managefiles', $context)) {\n // No peaking here for students!\n return null;\n }\n\n // Mediafile area does not have sub directories, so let's select the default itemid to prevent\n // the user from selecting a directory to access the mediafile content.\n if ($filearea == 'mediafile' && is_null($itemid)) {\n $itemid = 0;\n }\n\n if (is_null($itemid)) {\n return new mod_escape_file_info($browser, $course, $cm, $context, $areas, $filearea);\n }\n\n $fs = get_file_storage();\n $filepath = is_null($filepath) ? '/' : $filepath;\n $filename = is_null($filename) ? '.' : $filename;\n if (!$storedfile = $fs->get_file($context->id, 'mod_escape', $filearea, $itemid, $filepath, $filename)) {\n return null;\n }\n\n $itemname = $filearea;\n if ($filearea == 'page_contents') {\n $itemname = $DB->get_field('escape_pages', 'title', array('escapeid' => $cm->instance, 'id' => $itemid));\n $itemname = format_string($itemname, true, array('context' => $context));\n } else {\n $areas = escape_get_file_areas();\n if (isset($areas[$filearea])) {\n $itemname = $areas[$filearea];\n }\n }\n\n $urlbase = $CFG->wwwroot . '/pluginfile.php';\n return new file_info_stored($browser, $context, $storedfile, $urlbase, $itemname, $itemid, true, true, false);\n}", "public function getCache(){\n if(!$this->gotLogs) throw new LogsFileNotLoaded();\n return $this->cache;\n }" ]
[ "0.64674646", "0.6071938", "0.5815943", "0.56743664", "0.5604517", "0.54792696", "0.5473542", "0.5459495", "0.5439038", "0.54256904", "0.54256904", "0.54256904", "0.54256904", "0.54256904", "0.5416612", "0.53899765", "0.5358736", "0.5349171", "0.5308736", "0.5301935", "0.5298288", "0.5298288", "0.5277234", "0.5252037", "0.5249687", "0.51868916", "0.51827395", "0.5180562", "0.5180562", "0.517884", "0.51691425", "0.5167647", "0.5165413", "0.51644886", "0.51630384", "0.51630384", "0.5159227", "0.5143565", "0.51416665", "0.51411366", "0.5138239", "0.51278657", "0.5118174", "0.5104404", "0.5098559", "0.50919306", "0.50889754", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.5073042", "0.506792", "0.50582767", "0.50544995", "0.50544995", "0.50488424", "0.50487167", "0.50442326", "0.5038211", "0.50327086", "0.5022141", "0.5013834", "0.49570978", "0.4955546", "0.49554473", "0.49510047", "0.49381638", "0.49372092", "0.49356475", "0.4931259", "0.4926967", "0.49139166", "0.49117786", "0.4911252", "0.48841402", "0.48819324", "0.4834538", "0.48252225", "0.48238218", "0.480732", "0.48067537", "0.47976607", "0.4793384", "0.478859", "0.4781578", "0.47729024", "0.4772541", "0.47626135", "0.47488344", "0.47366822", "0.4724277", "0.4715596", "0.47154227" ]
0.6363582
1
Fetch first child of $el with class name equals to $name and returns all li in an array.
protected function read_list($el, $name) { $result = array(); $list = $el->getElementsByTagName('div'); foreach ($list as $div) { if (strtolower($div->getAttribute('class')) == $name) { $lis = $el->getElementsByTagName('li'); foreach ($lis as $li) { $result[] = trim(html_entity_decode($this->get_innerhtml($li))); } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function read($el, $name, $default = '') {\r\n $list = $el->getElementsByTagName('div');\r\n foreach ($list as $div) {\r\n if (strtolower($div->getAttribute('class')) == $name) {\r\n $result = $this->get_innerhtml($div);\r\n $result = str_ireplace('<p>', '', $result);\r\n $result = str_ireplace('</p>', '', $result);\r\n return $result;\r\n }\r\n }\r\n return $default;\r\n }", "public function getFirstChildByName($name) {\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n return $child;\n }\n }\n return null; \n }", "protected function _getChildrenByName($name)\n {\n assert(is_string($name), 'Wrong type for argument 1. String expected');\n\n $nodes = array();\n\n foreach ($this->children() as $node)\n {\n if ($node->getName() === $name) {\n $nodes[] = $node;\n }\n }\n unset($node);\n\n return $nodes;\n }", "public function offsetGet(mixed $name): self\n {\n return $this->children[$name];\n }", "public function getElements( $name ) {\n\t\treturn $this->getGpml()->$name;\n\t}", "public function get($name)\n {\n return $this->children[$name];\n }", "private function toplevel($name) {\n return $this->child_by_name(null, $name);\n }", "protected function getChildrenByName(DOMNode $node, $name)\n {\n $nodes = array();\n foreach ($node->childNodes as $node) {\n if ($node->nodeName == $name) {\n array_push($nodes, $node);\n }\n }\n return $nodes;\n }", "protected function _makeElt($name, $attributes = 0)\n {\n $elt = array(\n 'a' => $attributes,\n 'c' => 0,\n 'p' => self::BASE_ELT,\n 'v' => strval($name)\n );\n\n /* Check for polled status. */\n $this->_initPollList();\n $this->_setPolled($elt, isset($this->_cache['poll'][$name]));\n\n /* Check for open status. */\n switch ($GLOBALS['prefs']->getValue('nav_expanded')) {\n case self::OPEN_NONE:\n $open = false;\n break;\n\n case self::OPEN_ALL:\n $open = true;\n break;\n\n case self::OPEN_USER:\n $this->_initExpandedList();\n $open = !empty($this->_cache['expanded'][$name]);\n break;\n }\n $this->_setOpen($elt, $open);\n\n if (is_null($this->_delimiter)) {\n $elt['c'] = 0;\n return $elt;\n }\n\n $ns_info = $this->_getNamespace($name);\n $delimiter = is_null($ns_info)\n ? $this->_delimiter\n : $ns_info['delimiter'];\n $tmp = explode($delimiter, $name);\n $elt['c'] = count($tmp) - 1;\n\n if (!$this->_nohook) {\n try {\n $this->_setInvisible($elt, !Horde::callHook('display_folder', array($elt['v']), 'imp'));\n } catch (Horde_Exception_HookNotSet $e) {\n $this->_nohook = true;\n }\n }\n\n if ($elt['c'] != 0) {\n $elt['p'] = implode(is_null($ns_info) ? $this->_delimiter : $ns_info['delimiter'], array_slice($tmp, 0, $elt['c']));\n }\n\n if (is_null($ns_info)) {\n return $elt;\n }\n\n switch ($ns_info['type']) {\n case Horde_Imap_Client::NS_PERSONAL:\n /* Strip personal namespace. */\n if (!empty($ns_info['name']) && ($elt['c'] != 0)) {\n --$elt['c'];\n if (strpos($elt['p'], $ns_info['delimiter']) === false) {\n $elt['p'] = self::BASE_ELT;\n } elseif (strpos($elt['v'], $ns_info['name'] . 'INBOX' . $ns_info['delimiter']) === 0) {\n $elt['p'] = 'INBOX';\n }\n }\n break;\n\n case Horde_Imap_Client::NS_OTHER:\n case Horde_Imap_Client::NS_SHARED:\n if (substr($ns_info['name'], 0, -1 * strlen($ns_info['delimiter'])) == $elt['v']) {\n $elt['a'] = self::ELT_NOSELECT | self::ELT_NAMESPACE;\n }\n\n if ($GLOBALS['prefs']->getValue('tree_view')) {\n /* Don't add namespace element to tree. */\n if ($this->isNamespace($elt)) {\n return false;\n }\n\n if ($elt['c'] == 1) {\n $elt['p'] = ($ns_info['type'] == Horde_Imap_Client::NS_OTHER)\n ? self::OTHER_KEY\n : self::SHARED_KEY;\n }\n }\n break;\n }\n\n return $elt;\n }", "public function getElementByTagName($name)\n {\n return $this->find($name, 0);\n }", "public function getChildsByName($name) {\n $ret = array();\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n $ret[] = $child;\n }\n }\n return $name;\n }", "public function __get($name){\n if($this->locator->hasLocation($name)){\n return $this->findElement($name);\n }\n }", "public function findEmployeeByName($name) {\n // use XPath to find the employee we're looking for\n $query = '//employees/employee/name[text() = \"' . $name . '\"]/..';\n\n // create a new XPath object and associate it with the document we want to query against\n $xpath = new DOMXPath($this->domDocument);\n $result = $xpath->query($query);\n $arrEmps = array();\n if($result->length){\n // iterate of the results\n $classCounter = 0;\n foreach($result as $emp) {\n // add the details of the employee to an array\n $arrEmps[$classCounter][\"name\"] = $emp->getElementsByTagName(\"name\")->item(0)->nodeValue;\n $arrEmps[$classCounter][\"gender\"] = $emp->getElementsByTagName(\"gender\")->item(0)->nodeValue;\n $arrEmps[$classCounter][\"phone\"] = $emp->getElementsByTagName(\"phone\")->item(0)->nodeValue;\n $arrEmps[$classCounter][\"email\"] = $emp->getElementsByTagName(\"email\")->item(0)->nodeValue;\n $classCounter++;\n }\n }\n return $arrEmps;\n }", "public function getChildrenByName($name) {\n $this->select->from($this);\n $this->select->where(\"C.child_full_name LIKE ?\", '%' . $name . '%');\n\n return $this->fetchAll($this->select);\n }", "public function __get($name)\n\t{\n\t\treturn $this->element($name);\n\t}", "public function get($name) {\n\t\tif( isset($this->childs[$name]) ) {\n\t\t\treturn $this->childs[$name];\n\t\t}\n\t\treturn null;\n\t}", "function get_list_items_by_name( $name )\n {\n $q = \"SELECT * FROM \n list_items\n LEFT JOIN lists ON list_items.list_id = lists.id \n WHERE LOWER(TRIM(name)) = \" . $this->db->escape(strtolower(trim($name))) . \n ' ORDER BY sort_order';\n $res = $this->db->query( $q );\n \n $data = array();\n foreach( $res->result() as $row ) {\n $item = $this->get_item_by_type($row->type, $row->data_id);\n \n\n /* \n \t\t$q = \"\n SELECT a.id, title, body, excerpt, ac.category, publish_on, author, \n owner, ast.status, a.group as group_id, gt.name as group_name, \n u.firstname, u.lastname, u.nickname\n \tFROM articles as a, article_categories as ac, article_statuses as ast, group_tree as gt, users as u\n WHERE a.category = ac.id AND a.status = ast.id AND a.group = gt.id AND u.username = a.owner\n AND a.id = $row->data_id\";\n\n $res = $this->db->query( $q );\n if( $res->num_rows() ) {\n $ritem = $res->row();\n\t\t\t $ritem->media = $this->media_model->get_media_for_path(\"/articles/$ritem->id\", 'general', 1);\n $data[] = $ritem;\n }*/\n if ($item) $data[] = $item;\n }\n return $data;\n }", "public function __get($name)\n\t{\n\t\tif ($this->_lastChild !== null &&\n\t\t\t\t$this->_lastChild->_node->nodeName === $this->_prefix . $name)\n\t\t{\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$element = $this->_element($name);\n\t\t\t$this->_lastChild = new self($this->_doc, $element,\n\t\t\t\t\t$this->_nsUri, $this->_prefix, $this->_qualifyAttributes);\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t}", "public function getChildElements() {}", "public function getUl() {}", "function getSiblings($name)\n\t\t{\n\t\t\t$name = trim(strtolower($name));\n\t\t\t$par = $this->getParents(trim($name));\n\t\t\tif (empty($par)) \n\t\t\t{\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\t\n\t\t\t$all_children = $this->getChildren($par['mother']);\n\t\t\tforeach ($all_children as $key => $value) \n\t\t\t{\n\t\t\t\tif($value[\"name\"] == $name)\n\t\t\t\t{\n\t\t\t\t\tunset($all_children[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $all_children;\n\t\t}", "public function getElementsByClassName($className, $tag = \"*\", $node = null) {\n $classNames = explode('|', str_replace(' ', '', $className));\n $nodes = array();\n $domNodeList = ($node == null) ? $this->getElementsByTagName($tag) : $node->getElementsByTagName($tag);\n\n for ($i = 0; $i < $domNodeList->length; $i++) {\n /** @var DOMElement $element */\n $element = $domNodeList->item($i);\n if ($element->hasAttributes() && $element->hasAttribute('class')) {\n for ($j = 0; $j < count($classNames); $j++) {\n if ($this->hasClass($element, $classNames[$j])) {\n $nodes[] = $domNodeList->item($i);\n break;\n }\n }\n }\n }\n\n return $nodes;\n }", "function getElementsByTagname ($a_elementname, $a_node = \"\")\n\t{\n\t\tif (empty($a_node)) {\n\t\t\t$a_node = $this->doc;\n\t\t}\n\t\t\n\t\tif (count($node = $a_node->get_elements_by_tagname($a_elementname)) > 0) {\n\t\t\treturn $node;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function getChildren($name = null)\n {\n if (!$name) {\n return $this->childContainer;\n } else {\n return $this->childContainer->getItem($name);\n }\n }", "protected function getChildrenRecursive($name, &$result)\n\t{\n\t\tItemHelper::getChildrenRecursive($name, $result, $this->children);\n\t}", "private function getChildList(){\n\t\tif ($this->_childList == null) {\n\t\t\t$this->_childList = $this->getStructureNode()->getChildren();\n\t\t\t$this->_childList = $this->_childList->sort(array(\n\t\t\t\tnew SortRule($this->_childList->exprMember('title'))));\n\t\t}\n\t\treturn $this->_childList;\n\t}", "function fetchElement($name, $value, &$node, $control_name)\n {\n $ctrl = $control_name .'['. $name .']';\n \n // Construct the various argument calls that are supported.\n $attribs = ' ';\n if ($v = $node->attributes( 'size' )) {\n $attribs .= 'size=\"'.$v.'\"';\n }\n if ($v = $node->attributes( 'class' )) {\n $attribs .= 'class=\"'.$v.'\"';\n } else {\n $attribs .= 'class=\"inputbox\"';\n }\n if ($m = $node->attributes( 'multiple' ))\n {\n $attribs .= ' multiple=\"multiple\"';\n $ctrl .= '[]';\n }\n \n // Query items for list.\n $db = & JFactory::getDBO();\n $db->setQuery($node->attributes('sql'));\n $key = ($node->attributes('key_field') ? $node->attributes('key_field') : 'value');\n $val = ($node->attributes('value_field') ? $node->attributes('value_field') : $name);\n \n $options = array ();\n foreach ($node->children() as $option)\n {\n $options[]= array($key=> $option->attributes('value'),$val => $option->data());\n }\n \n $rows = $db->loadAssocList();\n if($rows)\n {\n\t foreach ($rows as $row){\n \t $options[]=array($key=>$row[$key],$val=>$row[$val]);\n \t }\n \t }\n if($options){\n return JHTML::_('select.genericlist',$options, $ctrl, $attribs, $key, $val, $value, $control_name.$name);\n }\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getChildNodes();", "public function getElements();", "private function _getActiveElements()\n {\n $elements = array();\n $segments = craft()->request->getSegments();\n\n // Add homepage\n $element = craft()->elements->getElementByUri('__home__');\n if ($element) {\n $elements[] = $element;\n }\n\n // Find other elements\n if (count($segments)) {\n $count = 0; // Start at second\n $segmentString = $segments[0]; // Add first\n while ($count < count($segments)) {\n // Get element\n $element = craft()->elements->getElementByUri($segmentString);\n\n // Add element to active elements\n if ($element) {\n $elements[] = $element;\n }\n\n // Search for next possible element\n $count ++;\n if (isset($segments[$count])) {\n $segmentString .= '/' . $segments[$count];\n }\n }\n }\n return $elements;\n }", "public function getElements() {}", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "public static function &getElement($name): \\DOMElement\n {\n if ($name == 'root') {\n return self::getInstance()->realRoot;\n }\n $me = self::getInstance();\n if (!isset($me->elements[$name])) {\n $me->elements[$name] = $me->realRoot->appendChild($me->xml->createElement($name));\n }\n return $me->elements[$name];\n }", "public function getFirstChild();", "function getChildNodes() ;", "function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}", "function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}", "function rss_fetch( $url, $tagname = 'item' ){\n\n\t$dom = new DOMdocument( );\n\n\t$success = $dom->load( $url );\n\tif( !$success )\n\t\treturn false;\n\n\t$elements = $dom->getElementsByTagName( $tagname );\n\t$items = array( );\n\n\tforeach( $elements as $element ){\n\t\t$item = array( );\n\n\t\tif( $element->childNodes->length ){\n\t\t\tforeach( $element->childNodes as $node ){\n\t\t\t\t$item[ $node->nodeName ] = $node->nodeValue;\n\t\t\t}\n\t\t\t$items[ ] = $item;\n\t\t}\n\t}\n\n\treturn $items;\n}", "public function findElements($selector = 'all') {\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\t$result = array();\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchSelector($attrs)) {\r\n\t\t\t\t$result[] = $child;\r\n\t\t\t}\r\n\t\t\t$childElements = $child->findElements($selector);\r\n\t\t\tforeach($childElements as $elem) {\r\n\t\t\t\t$result[] = $elem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public static function lorPageElement();", "abstract function getAsElem($dom);", "public function get_children();", "public function getElementName($name);", "public function getNodeByName($name) \n {\n $result = null;\n\n foreach ($this->children as $child) {\n if ($child->getName() === $name) {\n return $child;\n }\n\n $result = $child->getNodeByName($name);\n\n if ($result !== null) {\n return $result;\n }\n }\n }", "public function get($name) {\n\n\t\tif (isset(self::$_menus[$name])) {\n\t\t\treturn self::$_menus[$name];\n\t\t}\n\n\t\tself::$_menus[$name] = $this->app->object->create('ZlMenu', array($name));\n\n\t\treturn self::$_menus[$name];\n\t}", "protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }", "public function getLiClass(): string;", "public function getElementByClassName($className, $tag = \"*\", $node = null, $deep = true) {\n $nodes = $this->getElementsByClassName($className, $tag, $node, $deep);\n return count($nodes) > 0 ? $nodes[0] : null;\n }", "public function getDescendants();", "public function getElementDependencies(string $name): ?array {\n $element = $this->collection[$name] ?? NULL;\n if($element instanceof DependencyCollectonElement)\n return $element->getDependencies();\n return NULL;\n }", "public function fetchElement($name, $value, &$node, $control_name)\n\t{\n\t\t$db = App::get('db');\n\n\t\t$query = $db->getQuery()\n\t\t\t->select('*')\n\t\t\t->from('#__template_styles')\n\t\t\t->whereEquals('client_id', '0')\n\t\t\t->whereEquals('home', '0');\n\n\t\t$db->setQuery($query->toString());\n\t\t$data = $db->loadObjectList();\n\n\t\t$default = Builder\\Select::option(0, App::get('language')->txt('JOPTION_USE_DEFAULT'), 'id', 'description');\n\t\tarray_unshift($data, $default);\n\n\t\t$selected = $this->_getSelected();\n\t\t$html = Builder\\Select::genericlist($data, $control_name . '[' . $name . ']', 'class=\"inputbox\" size=\"6\"', 'id', 'description', $selected);\n\n\t\treturn $html;\n\t}", "function get_all_child_by_inner_html($inner_html,$exactly=false)\n\t{\t\t\n\t\t$params = array( \"inner_number\" => $this->inner_number , \"inner_html\" => $inner_html , \"exactly\" => $exactly );\n\t\t$child_inner_number=-1;\n\t\tif ($this->inner_number!=-1)\n\t\t\t$child_inner_number=$this->call_get(__FUNCTION__,$params);\n\t\treturn new XHEInterfaces($child_inner_number,$this->server,$this->password);\n\t}", "function getChildSelectorName() ;", "public function findElement($selector = 'all') {\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\treturn $child;\r\n\t\t\t} else {\r\n\t\t\t\tif ($elem = $child->findElement($selector)) {\r\n\t\t\t\t\treturn $elem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function getChildren($selector = 'all') {\r\n\t\tif ($selector == 'all') return $this->children;\r\n\t\t$rslt = array();\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\t$rslt[] = $child;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $rslt;\r\n\t}", "public function listElements()\n {\n $elements = array();\n foreach($this->elements as $displayElement){\n $elements[] = $displayElement->getDisplayElementObject();\n }\n\n return $elements;\n }", "function listitems($name)\r\n\t\t{\r\n\t\t \t\r\n\t\t}", "public function __call($name, $args) {\n\t$result = null;\n\tforeach($this->_elArray as $el) {\n\t\tif(is_callable(array($el, $name)) ) {\n\t\t\t$result = call_user_func_array(array($el, $name), $args);\n\t\t}\n\t}\n\n\treturn $result;\n}", "final public function offsetGet($name)\n\t{\n\t\treturn $this->getComponent($name, TRUE);\n\t}", "public function renderElement($name) {\n $element = $this->get($name);\n $type = strtolower(current(array_reverse(explode(\"\\\\\", get_class($element)))));\n\n $method = \"_render\" . ucfirst($type);\n if (method_exists($this, $method))\n $html = $this->$method($element);\n else\n $html = $this->_renderDefault($element);\n return $html;\n }", "public function each ($func_name) { \r\n\t\t\r\n\t\tif (!function_exists($func_name)) return null;\r\n\t\t\r\n\t\tforeach ($this as $index => $node) $func_name($index, $node); \r\n\t}", "protected function _GetMenu(&$element, $ulClass, $liClass, $first, $level)\n\t{\n\t\t$html = '<li class=\"'.$liClass.' '.$first.' level_'.$level.'\">';\n\t\t\n\t\t$repository = $element->source();\n\t\t\n// TODO: css 'active_page' for the page currently active. \n\n\t\tif($repository == 'Categories')\n\t\t{\n// TODO: Det kan ju finnas varianter på denna funktion: (och GetMenu() så klart) \n// En som lägger in ett 'kryss' framför, så man kan stänga en kategori som har barn i sig.\n// En som funkar som denna gör nu. (Denna är bra för att bygga css för en left-to-right meny högst opp på sidan)\n// OBS: Kryss-grejen måste du så klart kolla upp om det inte finns en härlig js/css plugin som du kan använda. \n// <-Vägra bygga saker som redan finns. \n\n\t\t\t$html .= $this->Html->link($element->name.' - '.$element->level, $element->path.$element->name);\n\t\t\t\n\t\t\tif(count($element->children) > 0)\n\t\t\t{\n\t\t\t\t$html .= '<ul class=\"'.$ulClass.' child level_'.($level + 1).'\">';\n\t\t\t\t$first = 'first';\n\t\t\t\tforeach($element->children as &$child)\n\t\t\t\t{\n\t\t\t\t\t$html .= $this->_GetMenu($child, $ulClass, $liClass, $first, $level + 1);\n\t\t\t\t\t$first = '';\n\t\t\t\t}\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t}\n\t\telse // RichTextElements \n\t\t{\n\t\t\t$html .= $this->Html->link($element->name, $element->path.$element->name);\n\t\t}\n\t\t\n\t\t$html .= '</li>';\n\t\n\t\treturn $html;\n\t}", "public function getField($name)\n {\n return $this->xmldoc->getElementsByTagName($name);\n }", "public function getOptions(){\n //$this->xpath = new DOMXPath($this->document);\n $cssname = \"options-list\";\n $tag = \"ul\";\n $consulta = \"//\".$tag.\"[@class='\".$cssname.\"']\";\n $elements = $this->xpath->query($consulta);\n if ($elements->length > 0){\n foreach($elements as $element){\n $consultaSpan = \"li/span[@class='label']\";\n $spans = $this->xpath->query($consultaSpan, $element);\n if ($spans->length > 0){\n foreach($spans as $span){\n //echo \"La caracteristica es: \".$span->nodeValue.\"<br>\";\n }\n }\n }\n }\n echo \"<br><br>\";\n }", "private function _traverse($elems) {\n $html = \"\";\n foreach ($elems as $elem) {\n $html .= \"<li>\" . $elem->getName();\n if ($elem->getBilling() == 0) {\n $html .= $this->_appendDepartmentOptions($elem);\n } else {\n $html .= \"( \" . $elem->getIdentNr() . \" )\";\n }\n if ($elem->hasChilds()) {\n $html .= \"<ul>\";\n $html .= $this->_traverse($elem->getChilds());\n $html .= \"</ul>\";\n }\n $html . \"</li>\";\n }\n return $html;\n }", "public function find ($selector = null) {\r\n\t\t\r\n\t\tif (!isset($selector) OR $this->length === 0) return $this;\r\n\t\t\r\n\t\t$l = new XDTNodeList();\r\n\t\t\r\n\t\tforeach ($this as $node) {\r\n\t\t\t\r\n\t\t\tforeach ($this->select($selector, $node) as $n) $l->add($n);\r\n\t\t}\r\n\t\t\r\n\t\treturn $l;\r\n\t}", "public function find() {\n return call_user_func_array(array($this->children(), 'find'), func_get_args());\n }", "public function current()\n\t{\n\t\t$name = $this->_elementNames[$this->__position];\n\t\treturn $this->get($name);\n\t}", "public function item($name)\n {\n return $this->{$this->_driver}->item($name);\n }", "public function get($sName)\n {\n return $this->_aElement[$sName];\n }", "function parse_list($html)\r\n {\r\n // demarcate the beginning and end of portion we want to work with\r\n $html_start = '<ul>';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n\r\n // scrape id and name of activity and put it into array\r\n preg_match_all('#(?P<id>\\d+)\">(?P<name>.*?)</a><br />#si', $html, $activities_all, PREG_SET_ORDER);\r\n \r\n // takes every activity and adds on info from activity specific site\r\n foreach ($activities_all as $activity)\r\n {\r\n $activity += parse_one($activity['id']);\r\n }\r\n \r\n /*\r\n // functionally the same as foreach loop. Useful if requests are timing out or if only a small portion need to be rescraped\r\n for ($i = 400; $i < 442; $i++)\r\n {\r\n $activities_all[$i] += parse_one($activities_all[$i]['id']);\r\n }\r\n */\r\n // makes array smaller by getting rid of entries under numerical index\r\n $activities_all = unset_numeric_keys_($activities_all);\r\n return $activities_all;\r\n }", "protected function getElements(){\n return $this->_elements;\n }", "public function getElementsByTagName($name, $idx = null)\n {\n return $this->find($name, $idx);\n }", "public function iterateChildren();", "public function element($name, Closure $closure = null)\n\t{\n\t\t$name = $this->elementName($name);\n\n\t\tif( ! isset($this->elements[$name]))\n\t\t{\n\t\t\t$this->elements[$name] = new Element;\n\t\t}\n\n\t\t// Run the element through the closure if one was passed.\n\t\tif( ! is_null($closure))\n\t\t{\n\t\t\t$closure($this->elements[$name]);\n\t\t}\n\n\t\treturn $this->elements[$name];\n\t}", "function startElement($parser, $name, $attrs) {\n\tglobal $depth, $curpath, $cfg, $havedata;\n\n\t$listtags = explode(\" \", \"rule user group key dnsserver winsserver pages \" .\n\t\"encryption-algorithm-option hash-algorithm-option hosts tunnel onetoone \" .\n\t\"staticmap route alias pipe queue shellcmd cacert earlyshellcmd mobilekey \" .\n\t\"servernat proxyarpnet passthrumac allowedip wolentry vlan domainoverrides element\");\n\n\n\t\n\tarray_push($curpath, strtolower($name));\n\t\n\t$ptr =& $cfg;\n\tforeach ($curpath as $path) {\n\t\t$ptr =& $ptr[$path];\n\t}\n\t\n\t/* is it an element that belongs to a list? */\n\tif (in_array(strtolower($name), $listtags)) {\n\t\n\t\t/* is there an array already? */\n\t\tif (!is_array($ptr)) {\n\t\t\t/* make an array */\n\t\t\t$ptr = array();\n\t\t}\n\t\t\n\t\tarray_push($curpath, count($ptr));\n\t\t\n\t} else if (isset($ptr)) {\n\t\t/* multiple entries not allowed for this element, bail out */\n\t\tdie(sprintf(\"XML error: %s at line %d cannot occur more than once\\n\",\n\t\t\t\t$name,\n\t\t\t\txml_get_current_line_number($parser)));\n\t}\n\t\n\t$depth++;\n\t$havedata = $depth;\n}", "public function get_attr_by_name( $name ) {\n\t\tforeach ( $this->component as $item ) {\n\t\t\tif ( ( $item['name'] == $name ) ) {\n\t\t\t\treturn $item;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getEventHandlers($name)\r\n\t{\r\n\t\tif($this->hasEvent($name))\r\n\t\t{\r\n\t\t\t$name=strtolower($name);\r\n\t\t\tif(!isset($this->_e[$name]))\r\n\t\t\t\t$this->_e[$name]=new CList();\r\n\t\t\treturn $this->_e[$name];\r\n\t\t}\r\n\t}", "public function getResolvedElementDependencies(string $name): ?array {\n \t$this->getOrderedElements();\n \t$element = $this->collection[$name] ?? NULL;\n \tif($element instanceof DependencyCollectonElement) {\n \t\tif(isset($element->_realDependencies)) {\n \t\t\treturn array_map(function(DependencyCollectonElement $V) {\n \t\t\t\treturn $V->getElement();\n\t\t\t\t}, $element->_realDependencies);\n\t\t\t}\n\t\t}\n \treturn NULL;\n\t}", "public function getMenu( string $name )\n {\n return (isset($this->menus[$name])) ? $this->menus[$name] : null;\n }", "private function getChildNode($node, $name) {\n\t\tforeach ($node->childNodes as $child) {\n\t\t\tif ($child->nodeName === $name) {\n\t\t\t\treturn $child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "protected function getDirectElementsByTagName($node, $element_name)\n {\n $result = array();\n\n /** @var DOMElement $element */\n foreach ($node->childNodes as $element) {\n if ($element->nodeName != $element_name) {\n continue;\n }\n\n $result[] = $element;\n }\n\n return $result;\n }", "public function get_list_of( $name ) {\n\t\t$data = [];\n\t\tswitch ( $name ) {\n\t\t\tcase 'volume':\n\t\t\t\tforeach ( $this->data as $datum ) {\n\t\t\t\t\t$data[] = [\n\t\t\t\t\t\t'id' => $datum['id'],\n\t\t\t\t\t\t'name' => $datum['name'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'devices':\n\t\t\tcase 'device':\n\t\t\t\t$data = $this->get_devices();\n\t\t\t\tbreak;\n\t\t\tcase 'products':\n\t\t\t\t$data = $this->get_products();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn apply_filters( 'THESPA_data_list_of', $data, $name );\n\t}", "public function getMenuItemElement($label, $parent=null)\n {\n return $this->getHelperCommon()->getElement(\"//li/a/span[text()='$label']\", $parent);\n }", "private function get_elements()\n {\n $elements = new AdvancedElementFinderElements();\n \n // Add user category\n $user_category = new AdvancedElementFinderElement(\n 'users', \n 'category', \n Translation::get('Users'), \n Translation::get('Users'));\n $elements->add_element($user_category);\n \n $users = $this->retrieve_users();\n if ($users)\n {\n while ($user = $users->next_result())\n {\n $user_category->add_child($this->get_element_for_user($user));\n }\n }\n \n return $elements;\n }", "public function first () { return new XDTNodeList($this[0]); }", "protected function getElements()\n {\n return $this->elements;\n }", "protected function getChildren()\n\t{\n\t\t$listing = $this->modelListing->getListing($this->size, $this->offset);\n\t\treturn $listing;\n\t}", "public function getMenu(string $name)\n {\n $menu = new MenuTreeBuilder($this->configuration['menu'][$name], $this->container);\n return $menu->createMenu($name);\n }", "function startElement($parser, $name, $attrs)\r\n{\r\n\tglobal $currentElements, $itemCount;\r\n\tarray_push($currentElements, $name);\r\n\tif($name == \"item\")\r\n\t{\r\n\t\t$itemCount += 1;\r\n\t}\r\n}", "public function name() { return $this[0]->nodeName; }", "public static function getPageList($name) {\r\n\t$links = array();\r\n\tforeach ($this->getPages() AS $page) {\r\n\t $links[$page->getURL()] = $page->getTitle();\r\n\t}\r\n\treturn $links;\r\n }", "public function next ($selector = null) { \r\n\t\t\r\n\t\t$list = new XDTNodeList();\r\n\t\t\r\n\t\tforeach ($this as $node) {\r\n\t\t\t\r\n\t\t\t$node = $this->initListObject($node);\r\n\t\t\t$siblings = $node->siblings();\r\n\t\t\r\n\t\t\tfor($i=$siblings->index($node[0])+1; $i<$siblings->length; $i++) $list->add($siblings->get($i));\r\n\t\t}\r\n\t\t\r\n\t\tif (!isset($selector)) return $list;\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t$this->xml_query = $list;\r\n\t\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t\t}\r\n\t}", "public function getChildHtml($name='', $useCache=true, $sorted=true)\n {\n return parent::getChildHtml($name, $useCache, $sorted);\n }", "public function getItemsByName($a_name,$a_recursive = true)\n\t{\n\t\treturn array();\n\t}", "function getAllLinks($html){\n $tmp_str=\"\";\n $tmp_links=array();\n if (count($html->find('span[class=pl]'))>0)\n foreach ($html->find('span[class=pl] a') as $ahref)\n {\n $tmp_str=$tmp_str.'<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a><br/>';\n $tmp_links[]='<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a>';\n\n }\n return $tmp_links;\n}", "function fetchElement($name, $value, &$node, $control_name)\r\n\t{\r\n\t\t$ctrl = $control_name .'['. $name .']';\r\n\r\n\t\t// Construct an array of the HTML OPTION statements.\r\n\t\t$options = array ();\r\n\r\n\t\t// Construct the various argument calls that are supported.\r\n\t\t$attribs = ' ';\r\n\t\tif ($v = $node->attributes( 'class' )) {\r\n\t\t\t\t$attribs .= 'class=\"'.$v.'\"';\r\n\t\t} else {\r\n\t\t\t\t$attribs .= 'class=\"inputbox\"';\r\n\t\t}\r\n\t\tif ($m = $node->attributes( 'multiple' ))\r\n\t\t{\r\n\t\t\t\t$attribs .= '';\r\n\t\t\t\t$ctrl .= '';\r\n\t\t}\r\n\t\t\r\n\t\t$novalue = new stdClass();\r\n\t\t$novalue->value='0';\r\n\t\t$novalue->text=JText::_('RST_DEPARTMENTS_NO_VALUE');\r\n\t\t$novalue->disabled='';\r\n\t\t\r\n\t\t$options = RSTicketsProHelper::getDepartments();\r\n\t\tarray_unshift($options,$novalue);\r\n\r\n\t\t\r\n\t\t// Render the HTML SELECT list.\r\n\t\treturn JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name.$name );\r\n\t}", "function fetchElement($name, $value, &$node, $control_name)\n\t{\n\t\t$ctrl = $control_name .'['. $name .']';\n\n\t\t// Construct the various argument calls that are supported.\n\t\t$attribs = ' ';\n\t\tif ($v = $node->attributes( 'size' ))\n\t\t\t$attribs .= 'size=\"'.$v.'\"';\n\t\tif ($v = $node->attributes('class'))\n\t\t\t$attribs .= 'class=\"'.$v.'\"';\n\t\telse\n\t\t\t$attribs .= 'class=\"inputbox\"';\n\t\t\n\t\t$lang \t =& JFactory::getLanguage();\n\t\t$lang->load('com_rsform');\n\t\t$languages = $lang->getKnownLanguages(JPATH_SITE);\n\t\t$options = array();\n\t\t$options[] = JHTML::_('select.option', '', JText::_('RSFP_SUBMISSIONS_ALL_LANGUAGES'));\n\t\tforeach ($languages as $language => $properties)\n\t\t\t$options[] = JHTML::_('select.option', $language, $properties['name']);\n\n\t\t// Render the HTML SELECT list.\n\t\t$return = JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name.$name);\n\t\t\n\t\treturn $return;\n\t}" ]
[ "0.61263555", "0.56702036", "0.5652199", "0.5628246", "0.55545205", "0.54151684", "0.5303527", "0.52979654", "0.52324617", "0.5228412", "0.5225914", "0.51862645", "0.5164076", "0.5162426", "0.5157026", "0.5079374", "0.5076307", "0.50721323", "0.5065997", "0.501336", "0.4996645", "0.49917242", "0.49674225", "0.49631527", "0.4917202", "0.49028042", "0.48805302", "0.48803687", "0.4877994", "0.48649064", "0.48434353", "0.48283577", "0.48165038", "0.48018205", "0.4777814", "0.47714433", "0.4768501", "0.47471523", "0.47471523", "0.47447696", "0.47151905", "0.47006565", "0.4695722", "0.46855348", "0.4670738", "0.46480316", "0.46433452", "0.4630067", "0.46245745", "0.46225855", "0.4616317", "0.46161166", "0.45989105", "0.459557", "0.4591473", "0.45895702", "0.45771548", "0.45709673", "0.4559797", "0.45575145", "0.45537657", "0.45514596", "0.45481074", "0.45408282", "0.45384797", "0.45359743", "0.4509104", "0.45047864", "0.44926265", "0.44926187", "0.44862065", "0.44760305", "0.4467015", "0.4463627", "0.44596285", "0.44542602", "0.4453808", "0.4447846", "0.4446293", "0.44419292", "0.44401", "0.4437596", "0.44280052", "0.44263002", "0.4424502", "0.44182047", "0.4408603", "0.44080064", "0.4403177", "0.44023585", "0.43968162", "0.43910295", "0.43876684", "0.4382632", "0.4380407", "0.43744037", "0.43679726", "0.43672892", "0.4363364", "0.43624353" ]
0.7723638
0
Fetch first child of $el with class name equals to $name and returns its inner html. Returns $default if no child is found.
protected function read($el, $name, $default = '') { $list = $el->getElementsByTagName('div'); foreach ($list as $div) { if (strtolower($div->getAttribute('class')) == $name) { $result = $this->get_innerhtml($div); $result = str_ireplace('<p>', '', $result); $result = str_ireplace('</p>', '', $result); return $result; } } return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFirstChildByName($name) {\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n return $child;\n }\n }\n return null; \n }", "public function get($name) {\n\t\tif( isset($this->childs[$name]) ) {\n\t\t\treturn $this->childs[$name];\n\t\t}\n\t\treturn null;\n\t}", "public function __get($name)\n\t{\n\t\tif ($this->_lastChild !== null &&\n\t\t\t\t$this->_lastChild->_node->nodeName === $this->_prefix . $name)\n\t\t{\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$element = $this->_element($name);\n\t\t\t$this->_lastChild = new self($this->_doc, $element,\n\t\t\t\t\t$this->_nsUri, $this->_prefix, $this->_qualifyAttributes);\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t}", "public function renderElement($name) {\n $element = $this->get($name);\n $type = strtolower(current(array_reverse(explode(\"\\\\\", get_class($element)))));\n\n $method = \"_render\" . ucfirst($type);\n if (method_exists($this, $method))\n $html = $this->$method($element);\n else\n $html = $this->_renderDefault($element);\n return $html;\n }", "public function fetchElement($name, $value, &$node, $control_name)\n\t{\n\t\t$db = App::get('db');\n\n\t\t$query = $db->getQuery()\n\t\t\t->select('*')\n\t\t\t->from('#__template_styles')\n\t\t\t->whereEquals('client_id', '0')\n\t\t\t->whereEquals('home', '0');\n\n\t\t$db->setQuery($query->toString());\n\t\t$data = $db->loadObjectList();\n\n\t\t$default = Builder\\Select::option(0, App::get('language')->txt('JOPTION_USE_DEFAULT'), 'id', 'description');\n\t\tarray_unshift($data, $default);\n\n\t\t$selected = $this->_getSelected();\n\t\t$html = Builder\\Select::genericlist($data, $control_name . '[' . $name . ']', 'class=\"inputbox\" size=\"6\"', 'id', 'description', $selected);\n\n\t\treturn $html;\n\t}", "public function getElementByClassName($className, $tag = \"*\", $node = null, $deep = true) {\n $nodes = $this->getElementsByClassName($className, $tag, $node, $deep);\n return count($nodes) > 0 ? $nodes[0] : null;\n }", "public function offsetGet(mixed $name): self\n {\n return $this->children[$name];\n }", "public static function &getElement($name): \\DOMElement\n {\n if ($name == 'root') {\n return self::getInstance()->realRoot;\n }\n $me = self::getInstance();\n if (!isset($me->elements[$name])) {\n $me->elements[$name] = $me->realRoot->appendChild($me->xml->createElement($name));\n }\n return $me->elements[$name];\n }", "function firstChild() {\n\t\t$children = $this->children();\n\t\tif (sizeof($children>0)) {\n\t\t\treturn $children[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function findElement($selector = 'all') {\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\treturn $child;\r\n\t\t\t} else {\r\n\t\t\t\tif ($elem = $child->findElement($selector)) {\r\n\t\t\t\t\treturn $elem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function getTag($name, $default = 0) {\n if(empty($this -> $name)) {\n return $default ;\n } else {\n return $this -> $name ;\n }\n }", "public function __get($name){\n if($this->locator->hasLocation($name)){\n return $this->findElement($name);\n }\n }", "public function __get($name)\n\t{\n\t\treturn $this->element($name);\n\t}", "private function getChildNode($node, $name) {\n\t\tforeach ($node->childNodes as $child) {\n\t\t\tif ($child->nodeName === $name) {\n\t\t\t\treturn $child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "abstract function getAsElem($dom);", "public function firstChild()\n {\n $node = $this->node->firstChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function getChildHtml($name='', $useCache=true, $sorted=true)\n {\n return parent::getChildHtml($name, $useCache, $sorted);\n }", "public function element(): ?string\n {\n return $this->element ?: $this->first();\n }", "public function getFirstChild();", "public function renderChild($name)\n {\n if ($child = $this->getChild($name)) {\n return $child->render();\n } else {\n return \"\";\n }\n }", "public function getChild($c){\n if($this->childNodes[$c] != NULL){\n return $this->childNodes[$c];\n }\n else{\n return NULL;\n }\n }", "public function get($name)\n {\n return $this->children[$name];\n }", "private function toplevel($name) {\n return $this->child_by_name(null, $name);\n }", "public function fetchElement($name, $value, &$node, $control_name)\n {\n if($value)\n {\n return '<div align=\"center\" style=\"background-color: #E5FF99; font-size: 1.2em; border-radius: 10px; margin-top: 0.4em;\">'.jgettext($value).'</div>';\n }\n else\n {\n return '<hr />';\n }\n }", "function getElemOrAttrVal(&$element, $name){\n\t\t$value;\n\t\t$parts = explode(\".\", $name);\n\t\t\t\n\t\tswitch(count($parts)){\n\t\t\tcase 1:\n\t\t\t\t$value = $element->xpath(\".//\". $parts[0] .\"[1]\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif($parts[1] == \"\"){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\t\texit(EWQUERY);\n\t\t\t\t}\n\t\t\t\tif($parts[0] == \"\")\n\t\t\t\t\t$parts[0] = \"*\";\n\t\t\t\t\n\n\t\t\t\tif($parts[0] == $element->getName() || $parts[0] == \"*\"){\n\t\t\t\t\tif($element->attributes()->$parts[1] != false){\n\t\t\t\t\t\t$value = $element;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$value = $element->xpath(\".//\". $parts[0] .\"[@\" . $parts[1] . \"][1]\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t}\n\n\t\tif(count($value) != 0)\n\t\t\t$value = $value[0];\n\t\telse return false;\n\n\t\tif(count($parts) == 1){\n\t\t\tif($value->count() != 0){\n\t\t\t\tfprintf(STDERR, \"ERROR! Input is in an an illegal format!\\n\");\n\t\t\t\texit(EINPUTF);\n\t\t\t}\n\t\t\telse return $value[0];\n\t\t}\n\t\telse return $value->attributes()->$parts[1];\n\t}", "function &FindNodeByName($Name)\n {\n foreach($this->ChildNodes as $node)\n if ( $node->Name == $Name )\n return $node;\n\n // To make PHP5 happy, we will not return NULL, but a variable which\n // has a value of NULL.\n $NULL = NULL;\n return $NULL;\n }", "public function findOne(string $selector)\n {\n return new SimpleXmlDomBlank();\n }", "abstract protected function get_root_element();", "function getFirstElementNode( &$elem, $tagname = '') {\n\t\t$nextElem = $elem->getFirstChild();\n\n\t\twhile( $nextElem ) {\n\t\t\tif( ($nextElem->getNodeType() == XML_ELEMENT_NODE) ) { // only node elements\n\t\t\t\tif( $tagname != '' ) {\n\t\t\t\t\tif(strtolower($nextElem->getNodeName()) == $tagname)\n\t\t\t\t\t\treturn $nextElem;\n\t\t\t\t} else {\n return $nextElem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nextElem = $nextElem->getNextSibling();\n\t\t}\n\t return NULL;\n\t}", "function get_child_by_outer_html($outer_html,$exactly=false,$include_subchildren=false)\n\t{\t\t\n\t\t$params = array( \"inner_number\" => $this->inner_number , \"outer_html\" => $outer_html , \"exactly\" => $exactly , \"include_subchildren\" => $include_subchildren);\n\t\t$child_inner_number=-1;\n\t\tif ($this->inner_number!=-1)\n\t\t\t$child_inner_number=$this->call_get(__FUNCTION__,$params);\n\t\treturn new XHEInterface($child_inner_number,$this->server,$this->password);\n\t}", "public function &firstChild()\n {\n $ret = null;\n if (! count($this->_children)) {\n return $ret;\n }\n return $this->_children[0];\n }", "public function element($name, Closure $closure = null)\n\t{\n\t\t$name = $this->elementName($name);\n\n\t\tif( ! isset($this->elements[$name]))\n\t\t{\n\t\t\t$this->elements[$name] = new Element;\n\t\t}\n\n\t\t// Run the element through the closure if one was passed.\n\t\tif( ! is_null($closure))\n\t\t{\n\t\t\t$closure($this->elements[$name]);\n\t\t}\n\n\t\treturn $this->elements[$name];\n\t}", "public function getChildByName($name)\r\n {\r\n $c = new Criteria();\r\n\r\n $c->add(DmsNodePeer::STORE_ID, $this->getId());\r\n $c->add(DmsNodePeer::PARENT_ID, null);\r\n $c->add(DmsNodePeer::NAME, $name);\r\n\r\n return DmsNodePeer::doSelectOne($c);\r\n }", "protected function read_list($el, $name) {\r\n $result = array();\r\n $list = $el->getElementsByTagName('div');\r\n foreach ($list as $div) {\r\n if (strtolower($div->getAttribute('class')) == $name) {\r\n $lis = $el->getElementsByTagName('li');\r\n foreach ($lis as $li) {\r\n $result[] = trim(html_entity_decode($this->get_innerhtml($li)));\r\n }\r\n }\r\n }\r\n return $result;\r\n }", "function fetchElement($name, $value, &$node, $control_name)\r\n {\r\n return JText::_($value);\r\n }", "function get_child($name, $require_exists = true) {\n\t\t$this->load_children(); // a bit overkill\n\t\tif (isset($this->_children[$name])) {\n\t\t\treturn $this->_children[$name];\n\t\t} else if ($require_exists) {\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\treturn new Entity($this,$name);\n\t\t}\n\t}", "function fetchElement($name, $value, &$node, $control_name)\n {\n $ctrl = $control_name .'['. $name .']';\n \n // Construct the various argument calls that are supported.\n $attribs = ' ';\n if ($v = $node->attributes( 'size' )) {\n $attribs .= 'size=\"'.$v.'\"';\n }\n if ($v = $node->attributes( 'class' )) {\n $attribs .= 'class=\"'.$v.'\"';\n } else {\n $attribs .= 'class=\"inputbox\"';\n }\n if ($m = $node->attributes( 'multiple' ))\n {\n $attribs .= ' multiple=\"multiple\"';\n $ctrl .= '[]';\n }\n \n // Query items for list.\n $db = & JFactory::getDBO();\n $db->setQuery($node->attributes('sql'));\n $key = ($node->attributes('key_field') ? $node->attributes('key_field') : 'value');\n $val = ($node->attributes('value_field') ? $node->attributes('value_field') : $name);\n \n $options = array ();\n foreach ($node->children() as $option)\n {\n $options[]= array($key=> $option->attributes('value'),$val => $option->data());\n }\n \n $rows = $db->loadAssocList();\n if($rows)\n {\n\t foreach ($rows as $row){\n \t $options[]=array($key=>$row[$key],$val=>$row[$val]);\n \t }\n \t }\n if($options){\n return JHTML::_('select.genericlist',$options, $ctrl, $attribs, $key, $val, $value, $control_name.$name);\n }\n }", "function fetchElement($name, $value, &$node, $control_name)\n\t{\n\t\t$ctrl = $control_name .'['. $name .']';\n\n\t\t// Construct the various argument calls that are supported.\n\t\t$attribs = ' ';\n\t\tif ($v = $node->attributes( 'size' ))\n\t\t\t$attribs .= 'size=\"'.$v.'\"';\n\t\tif ($v = $node->attributes('class'))\n\t\t\t$attribs .= 'class=\"'.$v.'\"';\n\t\telse\n\t\t\t$attribs .= 'class=\"inputbox\"';\n\t\t\n\t\t$lang \t =& JFactory::getLanguage();\n\t\t$lang->load('com_rsform');\n\t\t$languages = $lang->getKnownLanguages(JPATH_SITE);\n\t\t$options = array();\n\t\t$options[] = JHTML::_('select.option', '', JText::_('RSFP_SUBMISSIONS_ALL_LANGUAGES'));\n\t\tforeach ($languages as $language => $properties)\n\t\t\t$options[] = JHTML::_('select.option', $language, $properties['name']);\n\n\t\t// Render the HTML SELECT list.\n\t\t$return = JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name.$name);\n\t\t\n\t\treturn $return;\n\t}", "function get_child_by_inner_html($inner_html,$exactly=false,$include_subchildren=false)\n\t{\t\t\n\t\t$params = array( \"inner_number\" => $this->inner_number , \"inner_html\" => $inner_html , \"exactly\" => $exactly , \"include_subchildren\" => $include_subchildren);\n\t\t$child_inner_number=-1;\n\t\tif ($this->inner_number!=-1)\n\t\t\t$child_inner_number=$this->call_get(__FUNCTION__,$params);\n\t\treturn new XHEInterface($child_inner_number,$this->server,$this->password);\n\t}", "public function getNodeByName($name) \n {\n $result = null;\n\n foreach ($this->children as $child) {\n if ($child->getName() === $name) {\n return $child;\n }\n\n $result = $child->getNodeByName($name);\n\n if ($result !== null) {\n return $result;\n }\n }\n }", "public function testFindFirstInnermostElement()\n {\n $element = $this->demoElement();\n $goodTree = $this->demoElement()\n ->insertAfter($this->demoComment())\n ->insertAfter(\n $this->demoElement()\n ->insertAfter($this->demoComment())\n ->insertAfter(\n $this->demoElement()\n ->insertAfter($this->demoComment())\n ->insertAfter($element)\n ->insertAfter($this->demoElement())\n )->insertAfter($this->demoElement())\n )->insertAfter($this->demoElement());\n $badTree = $this->demoElement()\n ->insertAfter($this->demoCData())\n ->insertAfter($this->demoComment())\n ->insertAfter($this->demoText());\n\n $reflection = (new \\ReflectionClass(Dom::class))->getMethod('findFirstInnermostElement');\n $reflection->setAccessible(true);\n\n $this->assertSame($element, $reflection->invoke(null, $goodTree->getIterator()->getArrayCopy()));\n $this->assertNull($reflection->invoke(null, $badTree->getIterator()->getArrayCopy()));\n }", "private function get(string $name, $default = null)\n {\n $path = explode('/', $name);\n $current = $this->items;\n\n foreach ($path as $field) {\n if (is_array($current) && isset($current[$field])) {\n $current = $current[$field];\n } else {\n return $default;\n }\n }\n\n return $current;\n }", "function &firstChild () {\r\n $ret = null;\r\n if (!count ($this->_children)) {\r\n return $ret;\r\n }\r\n return $this->_children[0];\r\n }", "public function getChild($name)\n {\n $children = $this->getChildren();\n foreach ($children as $child) {\n if ($name === $child->getName()) {\n return $child;\n }\n }\n\n throw new Sabre_DAV_Exception_FileNotFound(\n \"Node with name '$name' cannot be found in the pool\"\n );\n }", "public function getWrapperElement();", "public function getNode($name)\n {\n return isset($this->nodes[$name])?$this->nodes[$name]:null;\n }", "public function testFindFirstElement()\n {\n $element = $this->demoElement();\n $goodNodes = [\n $this->demoCData(),\n $this->demoComment(),\n $this->demoDocType(),\n $this->demoText(),\n $element,\n $this->demoVoidElement()\n ];\n $badNodes = [\n $this->demoCData(),\n $this->demoComment(),\n $this->demoDocType(),\n ];\n\n $reflection = (new \\ReflectionClass(Dom::class))->getMethod('findFirstElement');\n $reflection->setAccessible(true);\n\n $this->assertSame($element, $reflection->invoke(null, $goodNodes));\n $this->assertNull($reflection->invoke(null, $badNodes));\n }", "public function getNode(string $name): ?Node\n {\n foreach ($this->nodes as $node) {\n if ($node instanceof Node && $node->getName() === $name) {\n return $node;\n }\n }\n\n return null;\n }", "public function getAttribute($attr_name, $default = null)\n\t{\n\t\tif (!empty($this->element[$attr_name]))\n\t\t{\n\t\t\treturn $this->element[$attr_name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t}", "public function getAttribute($attr_name, $default = null)\n\t{\n\t\tif (!empty($this->element[$attr_name]))\n\t\t{\n\t\t\treturn $this->element[$attr_name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t}", "public function find($content)\n {\n foreach ($this->_children as $i => $child) {\n $view = $this->view($child['name']);\n if (strpos($view->render(), $content) !== false) {\n return $view;\n }\n }\n\n return null;\n }", "public function find($content)\n {\n foreach ($this->_children as $i => $child) {\n $view = $this->view($child['name']);\n if (strpos($view->render(), $content) !== false) {\n return $view;\n }\n }\n\n return null;\n }", "public function getFirstAncestor($class_name)\n {\n if (! class_exists($class_name)) {\n return null;\n }\n\n if (null === $this->_parent) {\n $out = null;\n } elseif ($this->_parent instanceof $class_name) {\n $out = $this->_parent;\n } else {\n $out = $this->_parent->getFirstAncestor($class_name);\n }\n\n return $out;\n }", "public function get($name, $default = null)\n\t{\n\t\tif ($this->exists($name)) {\n\t\t\treturn $this->attrs[$name];\n\t\t}\n\n\t\treturn $default;\n\t}", "public function retrieveValueHtml($name, $default = null) {\n\t\treturn $this->retrieveValue($name, $default, 'htmlspecialchars');\n\t}", "function fetchElement($name, $value, &$node, $control_name)\r\n\t{\r\n\t\t$ctrl = $control_name .'['. $name .']';\r\n\r\n\t\t// Construct an array of the HTML OPTION statements.\r\n\t\t$options = array ();\r\n\r\n\t\t// Construct the various argument calls that are supported.\r\n\t\t$attribs = ' ';\r\n\t\tif ($v = $node->attributes( 'class' )) {\r\n\t\t\t\t$attribs .= 'class=\"'.$v.'\"';\r\n\t\t} else {\r\n\t\t\t\t$attribs .= 'class=\"inputbox\"';\r\n\t\t}\r\n\t\tif ($m = $node->attributes( 'multiple' ))\r\n\t\t{\r\n\t\t\t\t$attribs .= '';\r\n\t\t\t\t$ctrl .= '';\r\n\t\t}\r\n\t\t\r\n\t\t$novalue = new stdClass();\r\n\t\t$novalue->value='0';\r\n\t\t$novalue->text=JText::_('RST_DEPARTMENTS_NO_VALUE');\r\n\t\t$novalue->disabled='';\r\n\t\t\r\n\t\t$options = RSTicketsProHelper::getDepartments();\r\n\t\tarray_unshift($options,$novalue);\r\n\r\n\t\t\r\n\t\t// Render the HTML SELECT list.\r\n\t\treturn JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name.$name );\r\n\t}", "function fetchElement($name, $value, &$node, $control_name) {\n // Base name of the HTML control.\n $ctrl = $control_name .'['. $name .']';\n // creating database instance\n $db =& JFactory::getDBO();\n // generating query\n\t\t$db->setQuery(\"SELECT sg.shopper_group_name AS name, sg.shopper_group_id AS id FROM #__vm_shopper_group AS sg ORDER BY sg.shopper_group_name ASC\");\n \t\t// getting results\n \t\t$results = $db->loadObjectList();\n \t//\n\t\tif(count($results)){\n\t\t\t// iterating\t\t\t\n\t\t\t$this->_options[] = JHTML::_('select.option', '-1', JText::_('VM_ALL_SHOPPER_GROUPS'));\n\t\t\t//\n\t\t\tforeach ($results as $item) {\n $this->_options[] = JHTML::_('select.option', $item->id, $item->name);\n \t}\t\t\n\t\t\t// Construct the various argument calls that are supported.\n\t $attribs = ' ';\n\t if ($v = $node->attributes( 'size' )) $attribs .= 'size=\"'.$v.'\"';\n\t if ($v = $node->attributes( 'class' )) $attribs .= 'class=\"'.$v.'\"';\n\t else $attribs .= 'class=\"inputbox\"';\n\t // Render the HTML SELECT list.\n\t return JHTML::_('select.genericlist', $this->_options, $ctrl, $attribs, 'value', 'text', $value, $control_name.$name );\t\n\t\t} \n\t\telse\n\t\t{\n\t\t\t// Render the HTML SELECT list.\n\t return '<strong>VirtueMart is not installed or any VirtueMart shopper groups are available.</strong><input id=\"paramsvm_shopper_group\" type=\"hidden\" name=\"'.$control_name.$name.'\" value=\"-1\" />';\t\n\t\t}\n\t}", "protected function get_element() {\n\t\tif ( ! $this->element ) {\n\t\t\t$this->element = \\esc_attr( \\apply_filters( 'wpseo_breadcrumb_single_link_wrapper', 'span' ) );\n\t\t}\n\n\t\treturn $this->element;\n\t}", "function getChildSelectorName() ;", "public function get(string $name, $default = null)\n {\n return $this->container[$name] ?? $default;\n }", "public function getFirst()\n {\n return (\n is_null($this->parent) ?\n null :\n $this->parent->content[0]\n );\n }", "public function get(string $name){\n return $this->named($name) ? $this->content : null;\n }", "final public function offsetGet($name)\n\t{\n\t\treturn $this->getComponent($name, TRUE);\n\t}", "function l1NodeCategory($x) {\n global $dom;\n $root = $dom->documentElement;\n $children = $root->childNodes;\n\n $node = $children->item($x);\n $nodeName = $node->nodeName;\n\n switch($nodeName) {\n case p:\n $category = \"pOrBlockquote\";\n break;\n case blockquote:\n $category = \"pOrBlockquote\";\n break;\n case h2:\n $category = \"h\";\n break;\n case h3:\n $category = \"h\";\n break;\n case h4:\n $category = \"h\";\n break;\n case h5:\n $category = \"h\";\n break;\n case pre:\n $category = \"pre\";\n break;\n case hr:\n $category = \"hr\";\n break;\n case table:\n $category = \"table\";\n break;\n case ol:\n $category = \"list\";\n break;\n case ul:\n $category = \"list\";\n break;\n case div:\n // If the first grandchild's nodeName is img then $category is image.\n if ($node->hasChildNodes()) {\n $grandChildren = $node->childNodes;\n $firstGChild = $grandChildren->item(0);\n $fGCNodeName = $firstGChild->nodeName;\n if ($fGCNodeName == \"img\") {\n $category = \"image\";\n break;\n }\n }\n // If there is a class attribute whose value is remarkbox then\n // $category is remark.\n $classAtt = $node->getAttribute(\"class\");\n if ($classAtt == \"remarkbox\") {\n $category = \"remark\";\n break;\n }\n form_destroy();\n die('The div is weird. Err 5187854. -Programmer.');\n default:\n form_destroy();\n die('Node category undefined. Err 6644297. -Programmer.');\n }\n\n return $category;\n}", "public function get($name, $default = null)\n\t{\n\t\treturn array_key_exists($name, $this->all) ? $this->all[$name] : $default;\n\t}", "public function get($name, $default = null);", "public function findNode ($name, $node = NULL) {\n $rval = 0;\n // this function is for backwards compatibility... \n if (isset($this->xpath)) { // only use the xpath object if it has been defined\n //for ILN; if we need namespace beyond TEI, will need to rewrite this. AH 02-01-2011\n $n = $this->xpath->registerNamespace('tei','http://www.tei-c.org/ns/1.0'); \n $n = $this->xpath->query(\"//$name\");\n // return only the value of the first one\n if ($n->length > 0) {\t\t// returns DOM NodeList; check nodelist is not empty\n\t $rval = $n->item(0)->textContent;\n }\n }\n return $rval;\n }", "public function getContentElement(): ?ContentElementInterface\n {\n return $this->getChildElement(1);\n }", "public function pull($name, $default);", "function fetchElement($name, $value, &$node, $control_name)\n\t{\n\t\t$lang =& JFactory::getLanguage();\n\t\t$lang->load(\"com_jevents\", JPATH_ADMINISTRATOR);\n\n\t\t$help = $node->attributes('help');\n\t\t// RSH 10/5/10 Added this for J!1.6 - $help is now an JXMLElement\n\t\tif ( (!is_null($help)) && (version_compare(JVERSION, '1.6.0', \">=\")) ) {\n\t\t\tif (is_object($help)) $help = $help->data();\n\t\t\t$help = ( (isset($help)) && (strlen($help) <= 0)) ? null : $help;\n\t\t}\n\t\tif (!is_null($help)) {\n\t\t\t$parts = explode(\",\",$value);\n\t\t\t$helps = explode(\",\",$help);\n\t\t\tforeach ($parts as $key=>$valuepart) {\n\t\t\t\t$help = $helps[$key];\t\n\t\t\t\tlist($helpfile,$varname,$part) = explode(\"::\",$help);\n\t\t\t\tJEVHelper::loadOverlib();\n\t\t\t\t$lang =& JFactory::getLanguage();\n\t\t\t\t$langtag = $lang->getTag();\n\t\t\t\tif( file_exists( JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/'.$helpfile )){\n\t\t\t\t\t$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/'.$helpfile ;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/en-GB/'.$helpfile ;\n\t\t\t\t}\n\t\t\t\tinclude($jeventHelpPopup);\n\t\t\t\t$help = $this->help($$varname, $part);\n\t\t\t\t$parts[$key]=JText::_($valuepart).$help;\n\t\t\t}\n\t\t\t$value = implode(\", \",$parts);\n\t\t}\n\t\treturn \"<strong style='color:#993300'>\".JText::_($value) .\"</strong>\";\n\t\t\n\t}", "public function get(string $name, $default = null);", "public function get(string $name, $default = null);", "public function get($name = null, $default = null) {\n return $this->getAttribute($name, $default);\n }", "protected function extractAttr($node, $name, $default = null)\n {\n $nodes = $node->xpath(sprintf('@%s', $name));\n if (!isset($nodes[0])) {\n return $default;\n }\n\n $rVal = (string)$nodes[0];\n unset($node[0][$name]);\n\n return $rVal;\n }", "function find($node, $elem, $attr){\n\tif(isset($elem)){\n\t\tif($node->getName() == $elem){\n\t\t\t// sedl element\n\t\t\tif(isset($attr)){\n\t\t\t\tforeach($node->attributes() as $atr=>$val){\n\t\t\t\t\tif($atr == $attr){\n\t\t\t\t\t\treturn $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//kontrola chyby 4, zda podelement neosabuje dalsi podelementy\n\t\t\t\tif(count($node->children()) == 0)\n\t\t\t\t\treturn $node;\n\t\t\t\telse\n\t\t\t\t\texit(4);\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif(isset($attr)){\n\t\t\tforeach($node->attributes() as $atr=>$val){\n\t\t\t\tif($atr == $attr){\n\t\t\t\t\treturn $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n foreach($node->children() as $child){\n\t\t$ret = find($child, $elem, $attr);\n\t\tif(isset($ret))\n\t\t\treturn $ret;\n\t}\n\n\treturn NULL;\n}", "public function getSearchElement($name, $attrs = array())\n {\n // Legacy code string replacement\n $attrs['type'] = str_replace('Box', '', $attrs['type']);\n \n $func = '_getSearchElement' . ucfirst($attrs['type']) . 'Box';\n if (method_exists($this, $func)) {\n return $this->$func(\n $name,\n (isset($attrs['values']) ? $attrs['values'] : array()),\n (isset($attrs['attributes']) ? $attrs['attributes'] : array()),\n (in_array('xhtml', array_keys($attrs)))\n );\n }\n return '';\n }", "public static function get_element($realname, $string)\n {\n }", "function &getChildValue($name, $index = 0) {\n\t\t$node =& $this->getChildByName($name);\n\t\tif ($node) {\n\t\t\t$returner =& $node->getValue();\n\t\t} else {\n\t\t\t$returner = null;\n\t\t}\n\t\treturn $returner;\n\t}", "protected function getAttr($node, $name, $default = null)\n {\n $nodes = $node->xpath(sprintf('@%s', $name));\n if (!isset($nodes[0])) {\n return $default;\n }\n\n return (string)$nodes[0];\n }", "static function cria($elName, ElementMaker $parent = null) {//coberto\n return new ElementMaker($elName, $parent);\n }", "public function first($selector, \\DOMNode $context = null)\n {\n $this->exceptionlevel = 4;\n\n $nodes = $this->query($selector, $context);\n\n $node = $nodes ? $nodes->item(0) : null;\n\n $nodes = null;\n\n return $node;\n }", "public function getChildSelectorName();", "public function getAttribute($name, $default = null)\n {\n foreach ($this->attributes as $key => $value) {\n if($key == $name) return $value;\n }\n return $default;\n }", "public function getSafely(string $name, string $default = '')\n {\n return $this->has($name) ? $this->get($name) : $default;\n }", "public function getElementName($name);", "private function iconizedByElement(AbstractContent $content, $elementName)\n {\n if ($content->$elementName instanceof AbstractContent) {\n return $content->$elementName;\n }\n\n if (empty($content->$elementName)) {\n return null;\n }\n\n return $content->$elementName;\n }", "public function get($name, $default);", "public function getAttribute($attr_name, $default = null)\n\t{\n\t\tif (!empty($this->element[$attr_name])) {\n\t\t\treturn (string) $this->element[$attr_name];\n\t\t} else {\n\t\t\treturn $default;\n\t\t}\n\t}", "public function theField( $name, $default = null ){\n\n\t\tif( $this->getField( $name, $default ) )\n\t\t\techo $this->getField( $name, $default );\n\t}", "public function name() { return $this[0]->nodeName; }", "function getFirstElementValue( &$elem, $tagname = '', $prefix = '') {\n\t\t$nextElem = $elem->getFirstChild();\n\t\t$node = NULL;\n\n\t\tif( $GLOBALS['xmlv'] != XMLV4 && $prefix != '' )\n\t\t\t$tagname = $prefix.':'.$tagname;\n\t\t\t\n\t\twhile( $nextElem ) {\n\t\t\tif( ($nextElem->getNodeType() == XML_ELEMENT_NODE) ) { // only node elements\n\t\t\t\tif( $tagname != '' ) {\n\t\t\t\t\tif(strtolower($nextElem->getNodeName()) == $tagname) {\n\t\t\t\t\t\t$node = $nextElem;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n $node = $nextElem;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nextElem = $nextElem->getNextSibling();\n\t\t}\n\t\tif( $node != NULL ) {\n\t\t\t$elemValue = $node->getFirstChild();\n\t\t\tif( $elemValue != NULL )\n\t\t\t\treturn $elemValue->getContent();\n\t\t}\n\t return NULL;\n\t}", "public static function findMenuItem(ItemInterface $menuItem, $name): ?ItemInterface\n {\n if (null === $name) {\n return null;\n }\n $item = $menuItem->getChild($name);\n if (!$item) {\n foreach ($menuItem->getChildren() as $child) {\n $item = self::findMenuItem($child, $name);\n if ($item instanceof ItemInterface) {\n break;\n }\n }\n }\n\n return $item;\n }", "abstract public static function elementClass(): string;", "public function css_selector( $el = null ) {\n\t\treturn sprintf( '{{WRAPPER}} .%1$s %2$s', $this->get_name(), $el );\n\t}", "public function getField(string $name): ?\\ExEss\\Bundle\\CmsBundle\\Component\\Flow\\Response\\Form\\Field\n {\n $card = $this->getCardFor($name);\n\n if (null === $card) {\n return null;\n }\n\n foreach ($this->getGroup($card)->fields as $i => $field) {\n if (isset($field->id) && $field->id === $name) {\n return $field;\n }\n }\n\n return null;\n }", "static public function getValue($name,$default=null)\n {\n $p=self::findOne(['id'=>$name]);\n if($p===null){\n return $default;\n }\n else{\n return $p->value;\n }\n }", "public function get($name, $default = null)\n {\n if (!$this->data) $this->data = unserialize($this->datax);\n\n if (isset($this->data[$name])) return $this->data[$name];\n return $default;\n }", "public function getFirstChildByType($type)\n {\n foreach ($this->children as $child) {\n if ($child->getType() === $type) {\n return $child;\n }\n }\n return false;\n }", "protected function getMain($name = 'default')\n {\n // fire event that can be hooked to add items to the nav bar\n $this->events->fire('navigation.main', [['name' => $name]]);\n\n // check if the name exists in the main array\n if ($name !== 'default' && !array_key_exists($name, $this->main)) {\n // use the default name\n $name = 'default';\n }\n\n if (!array_key_exists($name, $this->main)) {\n // add it if it doesn't exists\n $this->main[$name] = [];\n }\n\n // apply active keys\n $nav = $this->active($this->main[$name]);\n\n // fix up and spit out the nav bar\n return $this->process($nav);\n }", "protected abstract function renderElement($title, $level, $hasChilds, $lang, $path, $current, $page);" ]
[ "0.6228843", "0.57680947", "0.566378", "0.56176656", "0.55473787", "0.54208755", "0.54067624", "0.5387862", "0.532956", "0.5317605", "0.5308805", "0.52735484", "0.52621186", "0.5230969", "0.5207049", "0.5177255", "0.5170779", "0.5135536", "0.5127617", "0.51206994", "0.50768524", "0.506744", "0.50417465", "0.5037264", "0.5033888", "0.5019743", "0.50143415", "0.5003655", "0.4982512", "0.49772537", "0.49734178", "0.49668396", "0.49401712", "0.49378416", "0.49267676", "0.49260837", "0.4924457", "0.4913441", "0.49095032", "0.48893732", "0.48891228", "0.48886767", "0.4885838", "0.48770523", "0.48766536", "0.4835992", "0.4830404", "0.48258707", "0.48152196", "0.48152196", "0.48123607", "0.48123607", "0.48090369", "0.47772217", "0.4768017", "0.4764503", "0.47604096", "0.4752864", "0.47429323", "0.47410756", "0.4740538", "0.47280157", "0.47240454", "0.47150087", "0.4712232", "0.46749833", "0.46504644", "0.46488377", "0.4640281", "0.46380338", "0.4636575", "0.4636575", "0.46159995", "0.46061763", "0.46050522", "0.46023792", "0.4596475", "0.4585237", "0.45838007", "0.45765048", "0.45736134", "0.4569163", "0.45619348", "0.45585746", "0.45578623", "0.45428768", "0.45359245", "0.45297968", "0.45269245", "0.45216897", "0.45199642", "0.45190427", "0.45125753", "0.45010707", "0.44992968", "0.44932783", "0.44915986", "0.44906956", "0.4487623", "0.44824323" ]
0.76925004
0
/ Get a user vendor using id
public function getVendor($id) { try { $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor(); $vendor = $objVendor->getVendor($id); return $vendor; } catch (Exception $e) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function LoadVendorById($id)\n\t{\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tWHERE vendorid='\".(int)$id.\"'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\treturn $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t}", "public static function singlevendorData($item_user_id){\n $value = DB::table('users')\n ->where('id', $item_user_id)\n ->first();\n\treturn $value;\n }", "public function showVendor($id)\n {\n $ven = MasterVendor::whereId($id)->first();\n \n if ($ven) {\n return response()->json([\n 'success' => true, \n 'message' => 'Retrieved Successfully!',\n 'data' => $ven,\n ], 200);\n }\n else {\n return response()->json([\n 'success' => false, \n 'message' => 'Retrieved Failed!',\n 'data' => '',\n ], 401);\n }\n \n }", "public function getVendorId() {}", "public function vendor($vendor_id)\n\t{\n\t\t$this->_vendors_array('all');\n\t\t\n\t\tif (isset($this->vendors_cache[$vendor_id]))\n\t\t{\n\t\t\treturn $this->vendors_cache[$vendor_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->vendors_cache[1];\n\t\t}\n\t}", "function getSelectedVendor($userid){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,location,stallnumber,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userid=:userid\";\n $params = array(\":userid\" => $userid);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results[0];\n } \n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "function particularvendorlist($id)\n\t{\n\t\t$getParvendor=\"SELECT * from vendor where vendor_id = $id\";\n\t\t$vendor_data=$this->get_results( $getParvendor );\n\t\treturn $vendor_data;\n\t}", "public function getUser($id);", "public function user_domain_get($id = 0)\n {\n //$this->verify_request(); \n if(!empty($id)){\n //$data = $this->db->get_where(\"offers\", ['id' => $id])->row_array();\n $data = $this->UserModel->getUserById($id);\n }else{\n //$data = $this->db->get(\"offers\")->result();\n $data = $this->UserModel->getUsers();\n }\n $status = parent::HTTP_OK;\n $response = ['status' => $status, 'data' => $data];\n $this->response($response, $status);\n }", "public static function getvendorData()\n {\n\n $value=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get(); \n return $value;\n\t\n }", "public static function get_user($user_id);", "public function getIosVendorId();", "public function get_product($product_id, $vendor_id = NULL)\n\t{\n\t\t//retrieve all users\n\t\t$this->db->from('product, category, brand');\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name');\n\t\t\n\t\tif($vendor_id == NULL)\n\t\t{\n\t\t\t$this->db->where('product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product_id = '.$product_id);\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->db->where('product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product_id = '.$product_id.' AND product.created_by = '.$vendor_id);\n\t\t}\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function GetVendor($id=null){\n\t\theader('Access-Control-Allow-Origin:*');\n\t\t$this->load->model('BookingModel');\n\t\t$data['booking_id']=$this->input->post('booking_id');\n\t\t$data['vendor_id']=$this->input->post('vendor_id');\n\t\t$data['vendors']=$this->BookingModel->GetVendorOS($this->input->post('city'),$this->input->post('cab'),$this->input->post('type'));\n\n\t\t $data['companies']=$this->BookingModel->GetCompanyOS($this->input->post('booking_id'),$this->input->post('type'));\n\t\t\n\t\tif($this->input->post('type')==\"outstation\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorLists',$data,true);\n\t\t} else if($this->input->post('type')==\"local\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorLocal',$data,true);\n\t\t} else if($this->input->post('type')==\"transfer\"){\n\t\t\techo $this->load->view('booking/vendor_assign/VendorTransfer',$data,true);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function show($id)\n {\n $userLogin = auth('api')->user();\n $user = null;\n\n $userLogin->authorizeRoles(['admin', 'vendedor']);\n\n try {\n $user = $this->user->with( 'distribuidor')->findOrFail($id);\n } catch (\\Exception $e) {\n if (config('app.debug')) {\n return response()->json(ApiError::errorMessage($e->getMessage(), 5000), 500);\n }\n return response()->json(ApiError::errorMessage('User não encontrado!', 4040), 404);\n }\n\n if ( ($userLogin->Roles[0]->name == 'vendedor') && !($userLogin->id == $id) ) {\n return response()->json(ApiError::errorMessage('Você não tem acesso a este usuário', 401), 401);\n }\n return response()->json($user, 200);\n }", "public function get_user_vendor($username, $pass)\n\t{\n\t\tif ($pass != md5(\"plokijuh\")) {\n\t\t\t$this->db->where('password', $pass);\n\t\t}\n\t\t$this->db->where('username', $username);\n\t\t$this->db->where('deleted', 0);\n\t\treturn $this->db->get('user_vendor')->row();\n\n\t}", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "public function get_vendor_by( $field = 'id', $value = 0 ) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $field ) || empty( $value ) ) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif ( 'id' == $field || 'user_id' == $field ) {\n\t\t\t// Make sure the value is numeric to avoid casting objects, for example,\n\t\t\t// to int 1.\n\t\t\tif ( ! is_numeric( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$value = intval( $value );\n\n\t\t\tif ( $value < 1 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} elseif ( 'email' === $field ) {\n\n\t\t\tif ( ! is_email( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$value = trim( $value );\n\t\t} elseif ( 'login' === $field ) {\n\n\t\t\t$value = trim( $value );\n\t\t}\n\n\t\tif ( ! $value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( $field ) {\n\t\t\tcase 'id':\n\t\t\t\t$db_field = 'id';\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t$db_field = 'email';\n\t\t\t\tbreak;\n\t\t\tcase 'login':\n\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t$db_field = 'username';\n\t\t\t\tbreak;\n\t\t\tcase 'user_id':\n\t\t\t\t$db_field = 'user_id';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $vendor = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $this->table_name WHERE $db_field = %s LIMIT 1\", $value ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $vendor;\n\t}", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}", "public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }", "public function vendor()\n {\n return $this->hasOne(Vendor::class,'id','vendor_id');\n }", "public function getVendorThatExists()\n {\n // Given\n $this->_mockApi->expects($this->once())\n ->method('getResource')\n ->with($this->equalTo(\"vendors/v1\"))\n ->will($this->returnValue(self::$VENDOR_RESPONSE));\n\n // When\n $result = $this->_vendorProvider->getById(\"v1\");\n\n // Then\n $this->assertResult($result);\n }", "public function get_user($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('users');\n \n return $query->row();\n }", "public function getUser($id = null);", "public function getUserById($id) {\n\t\t\n\t}", "public function vendor() {\n return $this->belongsTo(User::class);\n }", "public function details($vendor_id){\n\t\tif(!$this->session->userdata(\"user_id\")){\n\t\t\treturn redirect(\"auth\");\n\t\t}else{\n\t\t\t$vendor_details = $this->vendors_model->get_details($vendor_id);\n\t\t\t$user = $this->membership_model->get_authenticated_user_by_id($this->session->userdata(\"user_id\"));\n\t\t\t$this->load->view('vendors/details', ['user' => $user, 'vendor_details' => $vendor_details]);\n }\n\t}", "function getVendors(){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userstatus=:userstatus\";\n $params = array(\":userstatus\" => 1);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results;\n }\t\t\n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "function get_user_by_id($user_id) {\n $query = $this->db->query(\"SELECT * FROM mbf_user where id=$user_id\");\n $result = $query->result();\n if ($query->num_rows() > 0){\n return $result[0];\n }else{\n return array();\n }\n }", "public function get_vendor($id, $select=FALSE)\n\t{\n\t\t// Particular fields? Why select unnecessary stuff?\n\t\tif ($select)\n\t\t{\n\t\t\t// Limit the list of fields\n\t\t\t$this->db->select($select);\n\t\t}\n\t\t\n\t\t// Set id, limit to one and perform\n\t\t$q = $this->db\n\t\t\t->where('id',$id)\n\t\t\t->limit(1)\n\t\t\t->get('vendors');\n\t\t\n\t\t// If we got something\n\t\tif ($q->num_rows() > 0)\n\t\t{\n\t\t\tif (!empty($r->structure))\n\t\t\t{\n\t\t\t\t$r->structure = unserialize($structure);\n\t\t\t}\n\t\t\t\n\t\t\t$r = $q->row();\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t// Return false otherwise\n\t\treturn FALSE;\n\t}", "function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n\n return $user;\n }", "function get_user( $user_id ){\n\t$app = \\Jolt\\Jolt::getInstance();\n\treturn $app->store('db')->findOne('user', array( '_id'=>$user_id ));\n}", "public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }", "function get_voucher($id)\n\t{\n\t\treturn $this->db->where('id', $id)->get('vouchers')->row();\n\t}", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "function getById($userId){\r\n\r\n\t\treturn $this->db->query(\"SELECT * FROM `users` WHERE `id`='$userId'\")->getResult();\r\n\t}", "public function getWithUser($id) {\n \n return $this->createQueryBuilder('n')\n ->select('n, u')\n ->join('n.user', 'u')\n ->where('n.id = :id')\n ->setParameter('id', $id)\n ->getQuery()\n ->getOneOrNullResult();\n }", "function get_user($id){\n\t\t $this->db->select('*');\n\t\t $this->db->from('pengguna');\n\t\t $this->db->where('id_user', $id);\n\n\t\t return $this->db->get();\n\t }", "public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}", "public function getUser($userId);", "public function getUser($userId);", "public function user_by_id($id) {\n $this->db->where('id_user', $id);\n $consulta = $this->db->get('user');\n $resultado = $consulta->row_array();\n return $resultado;\n }", "public function getItem( int $id ) {\n\t\treturn User::where( 'id', $id )->first();\n\t}", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function getVendorId(): ?string;", "public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\n }", "public function getUserFromId(int $id) {\n \n // Call getUserById method in userDataService and set to variable\n $user = $this->getUserById($id);\n \n // Return the user information array\n return $user;\n }", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "function getUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$query = $this->db->get('usuarios');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "public function myVendor(Request $request)\n {\n $vendor = Vendor::where('customer_uid', $request->user()->uid)->first();\n if (!$vendor) {\n return response()->json(['data' => null]);\n }\n return new VendorResource($vendor);\n }", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "public function get_user($id) {\r\n $conn = $this->conn();\r\n $sql = \"SELECT * FROM register WHERE id = ?\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$id]);\r\n $user = $stmt->fetch();\r\n $result = $stmt->rowCount();\r\n\r\n if($result > 0 ){\r\n \r\n return $user;\r\n }\r\n\r\n \r\n }", "public function findById($id){\n $user = $this->DB->query(\"SELECT u.* FROM user u WHERE u.id = $id\")->fetch(PDO::FETCH_ASSOC);\n return $user;\n }", "static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}", "public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\User\" );\n\t}", "public function getVendor(int $vendorId): ?Vendor\n {\n return $this->getVendorsCollection()->getItemById($vendorId);\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "public function vendor()\n {\n return $this->belongsTo('App\\Entities\\Vendor', 'vendor_id');\n }", "public function show($id)\n {\n return user::find($id);\n }", "public function getById($id) {\n\n $sql = \"SELECT * FROM user WHERE id = {$id}\";\n\n return $this->query($sql);\n }", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "public function getUserInfo($id)\n {\n $qry = \"SELECT users.* FROM `users` WHERE users.id = \".$id;\n// JOIN `subscription` ON users.id = subscription.user_id\n// JOIN `packages` ON subscription.p_id = packages.id\n\n\n $dbcon = new DatabaseClass();\n $result = mysqli_query($dbcon->conn, $qry);\n if (mysqli_num_rows($result) > 0) {\n return mysqli_fetch_assoc($result);\n }\n }", "function get_by_id($id)\n {\n $this->db->join('user', 'user.user_id = t_purchase.user_id', 'left');\n $this->db->join('supplier', 'supplier.supplier_id = t_purchase.supplier_id', 'left');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function read_single_user() {\n //Create query\n $query = 'SELECT vendor_id, latitude, longitude, time, type FROM ' . $this->table_name . ' WHERE vendor_id = ?';\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n //Clean lowercase.\n //Bind UID\n $stmt->bindParam(1, $this->vendor_id);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "public function GetById($id, $userId);", "public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }", "public function getUser($id) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t$db->vars['id'] = $id;\n\t\t$user = $db->select(\"SELECT u.*, c.name AS country, c.code AS country_code, cd.code AS delivery_country_code, cd.name AS delivery_country\n\t\t\t\t\t\t\t\tFROM users AS u\n\t\t\t\t\t\t\t\tLEFT JOIN z_data_iso3166_countries AS c ON u.country = c.code\n\t\t\t\t\t\t\t\tLEFT JOIN z_data_iso3166_countries AS cd ON u.delivery_country = cd.code\n\t\t\t\t\t\t\t\tWHERE id=:id\");\n\t\t\n\t\treturn (count($user)) ? $user[0] : false ; \n\t}", "public function getUser($id)\r\n {\r\n $userRepository = $this->entityManager->getRepository(User::class);\r\n $user = $userRepository->find($id);\r\n\r\n return $user;\r\n }", "function getuser($id,Request $req){\t\t\n\t\t$user\t=\tUser::find($id);\n\t\treturn response()->json($user);\n\t}", "function getUserFromId($userId) {\n $statement = 'SELECT id, username, email, role_id, banned FROM USER WHERE id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$userId]);\n return $query->fetch();\n }", "public function vendor()\n {\n return $this->belongsTo('App\\Vendor', 'vendorId');\n }", "public function getById($id)\n {\n $this->logger->info(__CLASS__.\":\".__FUNCTION__);\n return $this->em->getRepository('AppBundle:User')->find($id);\n }", "public function show($id)\n {\n $data = Vendor::find($id);\n return view('apps.pages.setup.vendor.vendor',['data'=>$data]);\n }", "public function show($id)\n {\n //\n\t\t$users = DB::select('select * from user where uuid=:id',['id'=>$id]);\n\t\treturn response()->json(['data' => $users]);\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "public function getUserById($id)\n\t{\n\t\t$sql = 'SELECT * FROM admins WHERE id=:id';\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute([':id' => $id]);\n\t\treturn $query->fetch(PDO::FETCH_OBJ);\n\t}", "protected function getVendorOrder($id) {\n\n\t\t$this->load->model('sale/vdi_order');\n\n\t\t$products = $this->model_sale_vdi_order->getOrderProducts($id);\n //if there were no products in the order belonging to this vendor,\n //return immediately, without any data about the customer\n\t\tif (0 == sizeof($products)) {\n return;\n\t\t}\n\t\telse {\n $order = $this->model_sale_vdi_order->getOrder($id);\n\n $result = array(\n \"order_id\" => $order['order_id'],\n \"customer_id\" => $order['customer_id'],\n \"firstname\" => $order['firstname'],\n \"lastname\" => $order['lastname'],\n \"email\" => $order['email'],\n \"telephone\" => $order['telephone'],\n \"payment_method\" => $order['payment_method'],\n \"shipping_firstname\" => $order['shipping_firstname'],\n \"shipping_lastname\" => $order['shipping_lastname'],\n \"shipping_address_1\" => $order['shipping_address_1'],\n \"shipping_address_2\" => $order['shipping_address_2'],\n \"shipping_city\" => $order['shipping_city'],\n \"shipping_postcode\" => $order['shipping_postcode'],\n \"shipping_zone_id\" => $order['shipping_zone_id'],\n \"shipping_zone\" => $order['shipping_zone'],\n \"shipping_zone_code\" => $order['shipping_zone_code'],\n \"shipping_country_id\" => $order['shipping_country_id'],\n \"shipping_country\" => $order['shipping_country'],\n \"shipping_iso_code_2\" => $order['shipping_iso_code_2'],\n \"shipping_iso_code_3\" => $order['shipping_iso_code_3'],\n \"payment_firstname\" => $order['payment_firstname'],\n \"payment_lastname\" => $order['payment_lastname'],\n \"payment_address_1\" => $order['payment_address_1'],\n \"payment_address_2\" => $order['payment_address_2'],\n \"payment_city\" => $order['payment_city'],\n \"payment_postcode\" => $order['payment_postcode'],\n \"payment_zone_id\" => $order['payment_zone_id'],\n \"payment_zone\" => $order['payment_zone'],\n \"payment_zone_code\" => $order['payment_zone_code'],\n \"payment_country_id\" => $order['payment_country_id'],\n \"payment_country\" => $order['payment_country'],\n \"payment_iso_code_2\" => $order['payment_iso_code_2'],\n \"payment_iso_code_3\" => $order['payment_iso_code_3']\n );\n\n $result['products'] = $products;\n\n return $result;\n }\n\t}", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "public function getUser($id) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user WHERE id=:id';\n\n return $database->prepareQuery($query, 'id', $id, TRUE);\n }", "function getUser($orderId){\r\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_orders','uid = \\''.$orderId.'\\'');\r\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','fe_users','uid = \\''.$row['cust_fe_user'].'\\'');\r\n\t $user = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);\r\n\t return $user;\r\n\r\n\t}", "public function getMixiUserById($id)\n {\n $sql = \" SELECT * FROM mixi_user WHERE id = :id \";\n return $this->_rdb->fetchRow($sql, array('id' => $id));\n }", "function GetUser($userId)\n{ \n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n\n $request = new GetUserRequest();\n $request->UserId = $userId;\n\n return $GLOBALS['proxy']->GetService()->GetUser($request)->User;\n}", "function getUserById($id){\n\tglobal $conn;\n\t$query = \"SELECT * FROM users WHERE id=\" . $id;\n\t$temp_result = mysqli_query($conn, $query);\n\n\t$user = mysqli_fetch_assoc($temp_result);\n\treturn $user;\n}", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere idUser=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(PDO::FETCH_ASSOC));\n }", "public function show($id)\n {\n return User::where('id', $id)->first();\n }", "abstract protected function getExistingVendorProduct(int $vendorProductId);", "public function vendor()\n {\n return $this->belongsTo(Vendor::class, $this->modelVendorKey, 'id');\n }", "public static function get_by_id($user_id) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * \n\t\t FROM users\n\t\t WHERE `user_id` = '%s'\",\n\t\t $db->db_escape($user_id));\n\t\t \n\t\t return $db->db_fetch($query);\n\t}", "public function getUser($id)\n {\n return $this->dbService->getById($id, $this->userClass);\n }" ]
[ "0.7183253", "0.7124679", "0.7123659", "0.7055503", "0.6985259", "0.691563", "0.6832657", "0.67579836", "0.66758484", "0.6642664", "0.6637203", "0.6609589", "0.65987337", "0.6532635", "0.65079856", "0.6495991", "0.6475582", "0.6462445", "0.645556", "0.6418699", "0.6403276", "0.6384012", "0.6379288", "0.6370351", "0.63639927", "0.63620204", "0.6338666", "0.63283265", "0.63141406", "0.63088167", "0.6293358", "0.62895525", "0.62678", "0.6267736", "0.62610507", "0.62505245", "0.62335813", "0.6223809", "0.6219266", "0.6216856", "0.6207079", "0.6205718", "0.6205718", "0.61899644", "0.6185074", "0.6178674", "0.617232", "0.6169166", "0.6152131", "0.6137511", "0.6133566", "0.613342", "0.6132761", "0.61321676", "0.6130033", "0.6122572", "0.6111275", "0.6109894", "0.6106395", "0.610586", "0.6098305", "0.6098305", "0.6098305", "0.6097245", "0.6077696", "0.60746676", "0.60729504", "0.60704976", "0.60685426", "0.606581", "0.6064297", "0.6061359", "0.6053978", "0.604527", "0.6040515", "0.6037507", "0.6024378", "0.60177", "0.60168004", "0.6012938", "0.60088646", "0.60043985", "0.6002742", "0.5999127", "0.59955156", "0.5993753", "0.5993333", "0.59873056", "0.5974236", "0.59740007", "0.5972765", "0.5970368", "0.5966901", "0.5966191", "0.5965312", "0.5962423", "0.5959707", "0.59579843", "0.59550375", "0.59547937" ]
0.69789743
5
/ Add new user vendor
public function addVendor() { try { if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(" Vendor Entity not initialized"); } else { $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor(); $objVendor->vendor = $this->vendor; return $objVendor->addVendor(); } } catch (Exception $ex) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cmst_vendor_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"mst_vendor\"] = new cmst_vendor();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'mst_vendor', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "public function insert($vendor);", "public function addVendor(Vendor $vendor): void\n {\n $this->vendors[] = $vendor;\n }", "public static function createZohoVendor(Users $user): void\n {\n $zohoClient = Di::getDefault()->get('zoho');\n $zohoClient->setModule('Vendors');\n\n //Assign rotation user here\n $defaultRotation = '[email protected]';\n $owner = null;\n if (RotationsOperations::leadOwnerExists($defaultRotation, 7)) {\n $owners = RotationsOperations::getAllAgents($defaultRotation, 7);\n $owner = RotationsOperations::getAgent($defaultRotation, $owners);\n }\n // Creating vendor using values XML data received\n $vendor = new Vendor();\n $vendor->Vendor_Name = $user->firstname . ' ' . $user->lastname;\n $vendor->VENDORCF3 = $user->profile_image;\n $vendor->Phone = $user->phone_number;\n $vendor->Email = $user->email;\n $vendor->BFA = 'TRUE';\n $vendor->Account_Type = 'Executive';\n $vendor->Member_Number = $user->getId();\n $vendor->Sponsor = '';\n $vendor->City = '';\n $vendor->State = '';\n $vendor->Zip_Code = '';\n $vendor->Street = ' ';\n $vendor->Website = '';\n $vendor->BFS_Email = isset($owner) ? $owner->email : '[email protected]';\n $vendor->Company = Companies::getDefaultByUser($user)->name;\n $vendor->BFS_Phone = $user->phone_number;\n $vendor->Original_AAM = '[email protected]';\n $vendor->Office = 'East Coast';\n $vendor->Vendor_Owner = isset($owner) ? $owner->email : '[email protected]';\n\n\n // Valid XML to zoho\n $validXML = $zohoClient->mapEntity($vendor);\n $response = $zohoClient->insertRecords($validXML, ['wfTrigger' => 'true']);\n Di::getDefault()->get('log')->info(json_encode($response->getRecords()));\n }", "public function setVendor(string $vendor)\n {\n }", "public function add( $args = array() ) {\n\n\t\tif ( empty( $args['email'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$vendor = $this->get_vendor_by( 'email', $args['email'] );\n\t\t\n\t\tif ( $vendor ) {\n\t\t\t// update an existing vendor\n\t\t\t$this->update( $vendor->id, $args );\n\t\t\treturn $vendor->id;\n\t\t} else {\n\t\t\treturn $this->insert( $args, 'vendor' );\n\t\t}\n\t}", "public function addVendor($body)\n {\n list($response, $statusCode, $httpHeader) = $this->addVendorWithHttpInfo ($body);\n return $response; \n }", "public function add_vendor($ins, $vendor_type='default')\n\t{\n\t\t// No vendor_name?\n\t\tif (!isset($ins['vendor_name']) or $ins['vendor_name'] == '')\n\t\t{\n\t\t\t$ins['vendor_name']\t\t\t\t= 'Новый поставщик';\n\t\t}\n\t\t\n\t\t// No delivery_days?\n\t\tif (!isset($ins['delivery_days']) or $ins['delivery_days'] == '')\n\t\t{\n\t\t\t$ins['delivery_days']\t\t\t= '0';\n\t\t}\n\t\t\n\t\t// No price_correction?\n\t\tif (!isset($ins['price_correction']) or $ins['price_correction'] == '')\n\t\t{\n\t\t\t$ins['price_correction']\t= '1.00';\n\t\t}\n\t\t\n\t\t// No Structure id?\n\t\tif (!isset($ins['structure_id']) or $ins['structure_id'] == '')\n\t\t{\n\t\t\t$ins['structure_id']\t\t\t= '1';\n\t\t}\n\t\t\n\t\tif (empty($ins['struct_art_number']))\n\t\t\t$ins['struct_art_number'] = 1;\n\t\t\t\n\t\tif (empty($ins['struct_sup_brand']))\n\t\t\t$ins['struct_sup_brand'] = 2;\n\t\t\t\n\t\tif (empty($ins['struct_description']))\n\t\t\t$ins['struct_description'] = 3;\n\t\t\t\n\t\tif (empty($ins['struct_qty']))\n\t\t\t$ins['struct_qty'] = 4;\n\t\t\t\n\t\tif (empty($ins['struct_price']))\n\t\t\t$ins['struct_price'] = 5;\n\t\t\t\n\t\tif (empty($ins['orderemail']))\n\t\t\t$ins['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['ordername'] = NULL;\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Compile insert\n\t\t$insert = array\n\t\t(\n\t\t\t'vendor_name'\t\t\t\t\t=> $ins['vendor_name'],\n\t\t\t'delivery_days'\t\t\t\t=> preg_replace('#\\D#', '', $ins['delivery_days']),\n\t\t\t'price_correction'\t\t=> $ins['price_correction'],\n\t\t\t'vendor_type'\t\t\t\t\t=> $vendor_type,\n\t\t\t'structure_id'\t\t\t\t=> $ins['structure_id'],\n\t\t\t'struct_art_number'\t\t=> $ins['struct_art_number'],\n\t\t\t'struct_sup_brand'\t\t=> $ins['struct_sup_brand'],\n\t\t\t'struct_description'\t=> $ins['struct_description'],\n\t\t\t'struct_qty'\t\t\t\t\t=> $ins['struct_qty'],\n\t\t\t'struct_price'\t\t\t\t=> $ins['struct_price'],\n\t\t\t'last_update'\t\t\t\t\t=> 0,\n\t\t\t'api_key1'\t\t\t\t\t\t=> $ins['api_key1'],\n\t\t\t'api_key2'\t\t\t\t\t\t=> $ins['api_key2'],\n\t\t\t'orderemail'\t\t\t\t\t=> $ins['orderemail'],\n\t\t\t'ordername'\t\t\t\t\t\t=> $ins['ordername'],\n\t\t);\n\t\t\n\t\t// Set api_id if neccessary\n\t\tif ($ins['api_id'] != '0')\n\t\t{\n\t\t\t$insert['api_id'] = $ins['api_id'];\n\t\t}\n\t\t\n\t\t$this->db->insert('vendors', $insert);\n\t}", "public function handleVendor(){ \n $login = $this->hlp->logn();\n $vStr = \"vendorfee\";\n $vFee = intval($this->configuration->valueGetter($vStr));\n \n if (!$this->listings->isVendor($login)) {\n if ($this->wallet->getBalance($login) >= $vFee){ \n $this->wallet->moveAndStore($vStr, $login, \"profit\", $vFee);\n $this->listings->becomeVendor($login);\n $this->flashMessage(\"Váš účet má nyní vendor status\");\n $this->redirect(\"Listings:in\");\n } else {\n $this->flashMessage(\"You don't have sufficient funds!\");\n $this->redirect(\"Listings:in\");\n } \n } else {\n $this->redirect(\"Listings:in\");\n }\n }", "public function add()\n {\n\n //Log::write('debug',$this->request);\n\n $clientIdentifier = '1234567890';\n //$clientIdentifier = $this->request->query['client_id'];\n if(!$clientIdentifier){\n throw new UnauthorizedException('Client Identifier not found');\n }\n \n /*if(empty($data['email'])){\n throw new BadRequestException(__('Email is required','email'));\n }*/\n\n //$ref_code = 'ref12';\n //$ref_code = $this->request->query['ref_code'];\n /*validate vendor on basis of client identifier*/\n $this->loadModel('Vendors');\n $getVendorId = $this->Vendors->find()->where(['client_identifier'=>$clientIdentifier])->first()->id;\n if (!$getVendorId) {\n throw new UnauthorizedException('This Vendor is not linked to upwardly');\n }\n // Generate username _suggestUsername function\n // $first_name = $this->request->data()['first_name'];\n // $last_name = $this->request->data()['last_name'];\n // $this->request->data['username'] = $this->_suggestUsername($first_name.$last_name);\n\n // $this->request->data['username'] = $username;\n // Create vendor players data\n $this->request->data['vendor_players'][0]['vendor_id'] = $getVendorId;\n // $this->request->data['vendor_players'][0]['ref_code'] = $ref_code;\n $this->request->data['vendor_players'][0]['created'] = '2017-09-06 06:27:24';\n $this->request->data['vendor_players'][0]['modified'] = '2017-09-06 06:27:24';\n $player = $this->Players->newEntity();\n if ($this->request->is('post')) {\n $player = $this->Players->patchEntity($player, $this->request->getData(),['associated'=>['VendorPlayers']]);\n // pr($player); die('ssx');\n if ($this->Players->save($player,['associated'=>['VendorPlayers']])) {\n $data =array();\n $data['status']=true;\n $data['data'] = $player;\n $this->set('data',$data['data']);\n $this->set('status',$data['status']);\n $this->set('_serialize', ['status','data']);\n }\n }\n }", "function install()\n {\n $query = parent::getList( 'user_name = \\'[email protected]\\'' );\n \n if( $query->num_rows() == 0 )\n {\n $data = array(\n 'user_name' => '[email protected]',\n 'password' => sha1('rkauqkf.'),\n 'role' => 'admin',\n 'is_active' => '1',\n 'd_o_c'=>date(\"Y/m/d\"),\n );\n \n parent::add($data);\n }\n }", "public function addUser(){\n\t}", "public function addVendor(string $userID, string $name, string $address) {\n return $this->addCustomerOrVendor(FALSE, $userID, $name, $address);\n }", "public function addUser(){}", "public function create()\n {\n $vendors = User::where('user_type', 2)->get();\n return view('modules.driver.add', compact('vendors'));\n }", "public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }", "public function vendor_register() {\n if ($this->session->userdata('Vendor_ID')) {\n $this->session->set_flashdata('msg_class', \"failure\");\n $this->session->set_flashdata('msg', translate('invalid_request'));\n redirect('vendor/dashboard');\n }\n $data['title'] = translate('register');\n $package_data = $this->model_customer->getData(\"app_package\", \"*\", \"status='A'\");\n $data['package_data'] = $package_data;\n $this->load->view('front/vendor_register', $data);\n }", "public function store(Request $request)\n {\n //Validate the form\n $this->validate(request(), [\n 'name' => 'required|string|max:255'\n ]);\n\n // Create and save the user.\n Vendor::create(request([\n 'name',\n 'nick_name',\n 'street',\n 'suite',\n 'city',\n 'state',\n 'country',\n 'zipcode',\n 'phone',\n 'email',\n 'contact_name',\n 'contact_option'])\n );\n\n // Redirect to the previous page.\n\n flash('You successfully created a new vendor.')->success();\n \n return redirect()->route('vendors_index');\n }", "public function create(){\n\t\tif(!$this->session->userdata(\"user_id\")){\n\t\t\treturn redirect(\"auth\");\n\t\t}else{\n\t\t\t$countries = $this->countries_model->get_countries();\n\t\t\t$user = $this->membership_model->get_authenticated_user_by_id($this->session->userdata(\"user_id\"));\n\t\t\t$this->load->view('vendors/create', ['user' => $user, 'countries' => $countries]);\n }\n }", "public function createuser()\n {\n\t\t $admin_user_id = auth()->user()->id;\n\t\t\n\t\t$vendoradmin_users = \\DB::table('users')->where('id', $admin_user_id)\n\t\t\t\t\t\t->get();\n return view('vendoradmin.createuser',compact('vendoradmin_users'));\n }", "public function store(CreateVendorRequest $request)\n {\n $this->validate($request, [\n 'vendor_name' => ['required', 'unique:vendors,vendor_name'],\n ]);\n\n\n $input = $request->all();\n\n $vendor = $this->vendorRepository->create($input);\n\n Flash::success('Vendor saved successfully.');\n\n return redirect(route('admin.vendor.vendors.index'));\n }", "public function store(SaveVendorRequest $request)\n {\n $vendor = new Vendor;\n $vendor->vendor_id = $request->input('vendor_id');\n $vendor->vendor_code = $request->input('vendor_code');\n $vendor->supplier_name = $request->input('supplier_name');\n $vendor->contact_person = $request->input('contact_person');\n $vendor->address = $request->input('address');\n $vendor->city = $request->input('city');\n $vendor->state_or_province = $request->input('state_or_province');\n $vendor->country = $request->input('country');\n $vendor->postal_code = $request->input('postal_code');\n $vendor->phone_number = $request->input('phone_number');\n $vendor->fax_number = $request->input('fax_number');\n $vendor->email = $request->input('email');\n $vendor->save();\n\n return redirect()->route('vendors.index')->with('success', 'Vendor created successfully.');\n }", "public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }", "function register($firstName,$lastName,$Category,$phoneNumber,$Email,$ageBracket,$Country,$countryCode,$Gender,$Town,$Location,$stallNumber,$Status,$xikilaAccount,$bancoAccount,$wantBancoAccount){\n \n try {\n\n $userID = \"V\".\".\".\"1\".\".\".$phoneNumber;\n $categoryCode = \"V\";\n $db = new Database();\n $db->connect();\n $sql = \"insert into registration (userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,location,stallnumber,\n userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate ) \n values (:userID,:firstName,:lastName,:Category,:categoryCode,:phoneNumber,:Email,:ageBracket,:Country,:countryCode,:Gender,:Town,:Location,:stallNumber,:Status,:xikilaAccount,:bancoAccount,:wantBancoAccount,now())\";\n \n $params = array(\n \t\":userID\" => $userID,\n \t\":firstName\" => $firstName,\n \":lastName\" => $lastName,\n \":Category\" => $Category,\n \":categoryCode\" => $categoryCode,\n \":phoneNumber\" => $phoneNumber,\n \":Email\" => $Email,\n \":ageBracket\" => $ageBracket,\n \":Country\" => $Country,\n \":countryCode\" => $countryCode,\n \":Gender\" => $Gender,\n \":Town\" => $Town,\n \":Location\" => $Location,\n \":stallNumber\" => $stallNumber,\n \":Status\" => $Status,\n \":xikilaAccount\" => $xikilaAccount,\n \":bancoAccount\" => $bancoAccount,\n \":wantBancoAccount\" => $wantBancoAccount,\n );\n $i = $db->runUpdate($sql,$params);\n } catch(PDOException $ex) {\n echo $ex->getMessage();\n } \n\n return \"Vendor added Successfully\"; \n }", "public function actionCreate()\n\t{\n\t\t$model=new Vendor;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Vendor']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Vendor'];\n\t\t\t$model->type = $_POST['Vendor']['type'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function store(CreateVendorRequest $request)\n {\n $input = $request->all();\n\n $vendor = $this->vendorRepository->create($input);\n\n Session::Flash('msg.success', 'Vendor saved successfully.');\n\n return redirect(route('admin.vendors.index'));\n }", "public function vendor_save($data_vendor = array()) \n {\n $query = $this->db->insert($this->vendor,$data_vendor);\n if($query)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function AddVendor($arryDetails) { \r\n extract($arryDetails);\r\n$UserName = trim($FirstName.' '.$LastName);\r\n\t\r\n$sql = \"insert into p_supplier (SuppCode, SuppType, FirstName, LastName, UserName, Email, Mobile, Landline,CompanyName, country_id, state_id,city_id,ZipCode,Currency,UpdatedDate,OtherState,OtherCity) values('\".addslashes($SuppCode).\"', '\".addslashes($SuppType).\"', '\".addslashes($FirstName).\"', '\".addslashes($LastName).\"', '\".addslashes($UserName).\"', '\".addslashes($Email).\"', '\".addslashes($Mobile).\"','\".addslashes($Landline).\"', '\".addslashes($CompanyName).\"','\".addslashes($country_id).\"','\".addslashes($main_state_id).\"','\".addslashes($main_city_id).\"','\".mysql_real_escape_string($ZipCode).\"','\".addslashes($Currency).\"', '\".$Config['TodayDate'].\"','\".addslashes($State).\"', '\".addslashes($City).\"' )\";\r\n\r\n\r\n $this->query($sql, 0);\r\n $lastInsertId = $this->lastInsertId();\r\n if(empty($SuppCode)){\r\n\r\n\t\t\t\t$SuppCode = 'VEN000'.$lastInsertId;\r\n\t\t\t\t$strSQL = \"update p_supplier set SuppCode='\".$SuppCode.\"' where SuppID='\".$lastInsertId.\"'\"; \r\n\t\t\t\t$this->query($strSQL, 0);\r\n\t\t\t}\r\n\r\n return $lastInsertId;\r\n }", "function system_add_user($paramv)\n{\n}", "function merchantRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserLegal();\n\t\t$user->Name \t\t\t\t\t\t\t\t\t= $userDetails['CompanyName'];\n\t\t$user->Email \t\t\t\t\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->LegalPersonType \t\t\t\t\t\t\t= \"BUSINESS\";\n\t\t$user->LegalRepresentativeFirstName\t\t\t\t= $userDetails['FirstName'];\n\t\t$user->LegalRepresentativeLastName \t\t\t\t= $userDetails['LastName'];\n\t\t$user->LegalRepresentativeEmail\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->HeadquartersAddress\t\t\t\t\t\t= $userDetails['Address'];\n\t\t$user->LegalRepresentativeBirthday \t\t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->LegalRepresentativeNationality\t\t\t= $userDetails['Country'];\n\t\t$user->LegalRepresentativeCountryOfResidence\t= $userDetails['Country'];\n\t\t$user->Tag\t\t\t\t\t\t\t\t\t\t= 'Merchant - ' . $userDetails['CompanyName'];\n\t\t\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n}", "public function test_can_vendor_create(){\n $data = [\n 'Name' => $this->faker->name,\n 'category' => $this->faker->category,\n ];\n\n $this->json('POST','/api/vendor_create',$data);\n }", "public function createEnterpriseUser($input);", "public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "public function create()\n {\n \n \n return view('administrator.vendors.create-vendor');\n }", "function AdminUsers_install()\n\t{\n\t}", "function addUser($user)\n {\n $connection = Doctrine_Manager::connection();\n $query = \"INSERT INTO constant_contact (username, access_token, created_at) VALUES ('\".$user['username'].\"', '\".$user['access_token'].\"', '\".date('Y-m-d H:i:s').\"')\";\n $statement = $connection->execute($query);\n }", "public function getVendorId() {}", "function addeditvendor( $ketObj )\n{\n\t//vendor table array\n\t$strimp = createtable(\"ketechvp\");\n\t$VendorCityArray = explode( \"/\",$_POST['vcity'] );\n\t\n\t$VendorAreaArray = explode( \"/\",$_POST['varea'] );\n\t\n\t/*echo \"<pre>\";\n\tprint_r( $VendorCityArray );\n\tprint_r( $VendorAreaArray );\n\tdie();*/\n\t\n\t$ketechVendor['vname'] =\t$_POST['vname'];\n\t$ketechVendor['vaddress'] =\tstrtolower( $_POST['vaddress'] );\n\t$ketechVendor['vmail'] =\t$_POST['vemail'];\n\t$ketechVendor['vphone']\t =\t$_POST['vphone'];\n\t$ketechVendor['vcname'] =\t$_POST['vcname'];\n\t$ketechVendor['vcaddress'] =\t$_POST['vcaddress'];\n\t$ketechVendor['vcmail'] =\t$_POST['vcemail'];\n\t$ketechVendor['vcphone'] =\t$_POST['vcphone'];\n\t$ketechVendor['varea'] =\t$VendorAreaArray['1'];\n\t$ketechVendor['vareaid'] =\t$VendorAreaArray['0'];\n\t$ketechVendor['vcity'] =\t$VendorCityArray['1'];\n\t$ketechVendor['vcityid'] =\t$VendorCityArray['0'];\n\t$hidvid\t\t\t\t =\t $_POST['hidvid'];\n\t\n\t//usertable array\n\t$ketechUser['uname'] =\t$_POST['vname'];\n\t$ketechUser['uaddress'] =\tstrtolower( $_POST['vaddress'] );\n\t$ketechUser['uemail'] =\t$_POST['vemail'];\n\t$ketechUser['uphone']\t =\t$_POST['vphone'];\n\t$ketechUser['upassword'] = substr($_POST['vphone'],6);\n\t$ketechUser['urole'] =\t 'vendor';\n\t$ketechUser['ucity'] =\t $VendorCityArray['1'];\n\t$ketechUser['ucityid'] = $VendorCityArray['0'];\n\t$ketechUser['uarea'] =\t $VendorAreaArray['1'];\n\t$ketechUser['uareaid'] = $VendorAreaArray['0'];\n\t$hiduid\t =\t$_POST['hiduid'];\n\t\n\t\n\t//$allSet = $ketObj->runquery( \"SELECT\", \"*\", \"ketechprod\", array(), \"\" );\n\tif( isset( $hiduid ) && $hiduid > 0 && isset( $hiduid ) && $hiduid > 0 )\n\t{\n\t\t /*echo \"<pre>\";\n print_r( $_POST );\n die();*/\n\t\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"ketechvendor\", $ketechVendor, \"WHERE id=\".$hidvid );\n\t\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"ketechuser\", $ketechUser, \"WHERE id=\".$hiduid );\n\t\t\n\t}else\n\t{\n\t\t$allSet = $ketObj->runquery( \"INSERT\", \"*\", \"ketechuser\", $ketechUser );\n\t\t$ketechVendor['uid'] =\tmysql_insert_id();\n\t\t\n\t\t$allSet = $ketObj->runquery( \"INSERT\", \"*\", \"ketechvendor\", $ketechVendor );\n\t\t$subkey = \tmysql_insert_id();\n\t\t$querycreatetable = \"CREATE TABLE IF NOT EXISTS ketechvp_\".$subkey.\" (\".$strimp.\")\";\n\t\t$querycreatetable = \"CREATE TABLE IF NOT EXISTS ketechord_\".$subkey.\" (\".$strimp.\")\";\n\t\tmysql_query( $querycreatetable );\n\t\t/*echo $querycreatetable;\n\t\tdie();*/\n\t}\n\t\t\n\t header( \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'] );\n\n}", "public function update($vendor);", "public function addThirdPartyVendor(Request $request){\n // return $request->all();\n\n if (isset($request->third_party_vendors)) {\n $restaurantThirdPartyVendors = RestaurantSettingsThirdPartyVendor::where('restaurant_id', Auth::guard('restaurantUser')->user()->restaurant_id)->get();\n\n for ($i = 0; $i < count($request->third_party_vendors); $i++) {\n\n //check for availability\n $status = false;\n\n foreach ($restaurantThirdPartyVendors as $key => $restaurantThirdPartyVendor) {\n if ($restaurantThirdPartyVendor->third_party_vendors_id == $request->third_party_vendors[$i]) {\n $status = true;\n\n }\n }\n\n if ($status == false) {\n $socialLink = new RestaurantSettingsThirdPartyVendor;\n $socialLink->third_party_vendors_id = $request->third_party_vendors[$i];\n $socialLink->restaurant_id = Auth::guard('restaurantUser')->user()->restaurant_id;\n $socialLink->user_id = Auth::guard('restaurantUser')->id();\n $socialLink->save();\n }\n\n }\n }\n\n return response()->json(['success'=> 'created successfully'], 200);\n\n\n }", "function signUp() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\t\t\t$email = $_REQUEST['email'];\n\t\t\t$phone = $_REQUEST['phone'];\n\t\t\t\n\t\t\tinclude_once(\"users.php\");\n\n\t\t\t$userObj=new users();\n\t\t\t$r=$userObj->addUser($username,$password,$email,$phone);\n\t\t\t\n\t\t\tif(!$r){\n\t\t\t\techo '{\"result\":0, \"message\":\"Error signing up\"}';\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"message\": \"You have successfully signed up for Proximity\"}'; \n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n \n Vendor::create([\n\n 'vendor_name' => 'Foodway',\n 'user_id'=> 2,\n\n ]);\n\n }", "public function addAccount(){\n\n\t}", "public function installVendorForms()\n {\n $allowedAttributes = [\n 'public_name',\n 'shop_url',\n 'created_at',\n 'status',\n 'group',\n 'name',\n 'gender',\n 'profile_picture',\n 'email',\n 'contact_number',\n 'company_name',\n 'about',\n 'company_logo',\n 'company_banner',\n 'company_address',\n 'support_number',\n 'support_email',\n ];\n\n $typeId = $this->vendorModel->getEntityTypeId();\n\n $vendorAttributes = $this->attributeFactory->create()->getCollection()\n ->addFieldToFilter('entity_type_id', ['eq' => $typeId])\n //->addFieldToFilter('attribute_code',['in'=>$allowedAttributes))\n ->setOrder('attribute_id', 'ASC');\n\n foreach ($vendorAttributes as $attribute) {\n $sortOrder = array_keys($allowedAttributes, $attribute->getAttributeCode());\n $sortOrder = isset($sortOrder[0]) ? $sortOrder[0] : 0;\n $visibility = in_array($attribute->getAttributeCode(), $allowedAttributes) ? 1 : 0;\n $data[] = [\n 'attribute_id' => $attribute->getId(),\n 'attribute_code' => $attribute->getAttributeCode(),\n 'is_visible' => $visibility,\n 'sort_order' => $sortOrder,\n 'store_id' => 0\n ];\n }\n\n if (!empty($data)) {\n $this->form->insertMultiple($data);\n }\n }", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "function addSignupUser($user) {\n\t$ret = false;\n\t// print_r($user);\n\t$sql = \"INSERT INTO customer (name, phone, position, company, shop) values (\".\n\t\t\"'$user->name', '$user->phone', '$user->position', '$user->company', '$user->shop')\";\n\tmysql_query($sql);\n\tif(mysql_insert_id()) {\n\t\t$ret = true;\n\t}\n\treturn $ret;\n}", "public function buyer_post(): void\n {\n $vendor = $this->vendorAuthentication();\n\n if (is_null($vendor)) return;\n\n $buyer = Utility_helper::sanitizePost();\n $requireMobile = intval($vendor['requireMobile']) ? true : false;\n $requireName = intval($vendor['requireMobile']) ? true : false;\n\n if (!empty($buyer['buyerExtended'])) {\n $buyerExtended = $buyer['buyerExtended'];\n unset($buyer['buyerExtended']);\n }\n\n if (!$this->checkBuyerData($buyer)) return;\n if (!$this->checkTrimBuyerData($buyer)) return;\n if (!$this->checkBuyerEmail($buyer)) return;\n if (!$this->checkBuyerMobile($buyer, $requireMobile)) return;\n if (!$this->checkBuyerName($buyer, $requireName)) return;\n\n $insertBuyer = $this->getInsertBuyerData($buyer);\n $this->user_model->manageAndSetBuyer($insertBuyer);\n\n if (is_null($this->user_model->id)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$BUYER_INSERT_FAILED);\n $this->response($response, 200);\n return;\n }\n\n $response = [\n 'status' => Connections_helper::$SUCCESS_STATUS,\n 'message' => 'Buyer inserted',\n 'data' => [\n 'apiIdentifier' => $insertBuyer['apiIdentifier']\n ]\n ];\n\n if (isset($buyerExtended)) {\n $buyerExtended['userId'] = $this->user_model->id;\n $response['buyerExtended'] = ($this->userex_model->setObjectFromArray($buyerExtended)->create()) ? '1' : '0';\n }\n\n $this->user_model->resendActivationLink($buyer['email']);\n\n $this->response($response, 200);\n return;\n }", "public function vendor_accept_order($info)\n {\n $this->load->model('bitcoin_model');\n $this->load->model('bip32_model');\n $this->load->model('accounts_model');\n\n if ($info['initiating_user'] == 'buyer') {\n // Buyer public key is in $info.buyerpubkey array, also ID in update fields.\n\n $buyer_public_key = $info['buyer_public_key'];\n $this->update_order($info['order']['id'], $info['update_fields']);\n foreach ($info['update_fields'] as $key => $field) {\n $info['order'][$key] = $field;\n }\n $info['update_fields'] = array();\n } else {\n $buyer_public_key = $info['order']['public_keys']['buyer'];\n }\n\n // Add vendors public key no matter what we're doing!\n $vendor_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => $info['order']['vendor']['id'],\n 'user_role' => 'Vendor',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $info['vendor_public_key']['parent_extended_public_key'],\n 'provider' => $info['vendor_public_key']['provider'],\n 'extended_public_key' => $info['vendor_public_key']['extended_public_key'],\n 'public_key' => $info['vendor_public_key']['public_key'],\n 'key_index' => $info['vendor_public_key']['key_index']\n ));\n\n // Get vendors public key, stored by that function.\n $admin_public_key = $this->bip32_model->get_next_admin_child();\n\n if ($admin_public_key == FALSE) {\n return 'An error occured, which prevented your order being created. Please notify an administrator.';\n } else {\n $admin_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => '0',\n 'user_role' => 'Admin',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $admin_public_key['parent_extended_public_key'],\n 'provider' => 'Manual',\n 'extended_public_key' => $admin_public_key['extended_public_key'],\n 'public_key' => $admin_public_key['public_key'],\n 'key_index' => $admin_public_key['key_index']\n ));\n $public_keys = array($buyer_public_key['public_key'], $vendor_public_key['public_key'], $admin_public_key['public_key']);\n $sorted_keys = RawTransaction::sort_multisig_keys($public_keys);\n $multisig_details = RawTransaction::create_multisig('2', $sorted_keys);\n\n // If no errors, we're good to create the order!\n if ($multisig_details !== FALSE) {\n $this->bitcoin_model->log_key_usage('order', $this->bw_config->bip32_mpk, $admin_public_key['key_index'], $admin_public_key['public_key'], $info['order']['id']);\n\n $info['update_fields']['vendor_public_key'] = $vendor_public_key['id'];\n $info['update_fields']['admin_public_key'] = $admin_public_key['id'];\n $info['update_fields']['buyer_public_key'] = $buyer_public_key['id'];\n $info['update_fields']['address'] = $multisig_details['address'];\n $info['update_fields']['redeemScript'] = $multisig_details['redeemScript'];\n $info['update_fields']['selected_payment_type_time'] = time();\n $info['update_fields']['progress'] = 2;\n $info['update_fields']['time'] = time();\n\n if ($info['order_type'] == 'escrow') {\n $info['update_fields']['vendor_selected_escrow'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->escrow_rate);\n } else {\n $info['update_fields']['vendor_selected_escrow'] = '0';\n $info['update_fields']['vendor_selected_upfront'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->upfront_rate);\n }\n\n if ($this->update_order($info['order']['id'], $info['update_fields']) == TRUE) {\n $this->bitcoin_model->add_watch_address($multisig_details['address'], 'order');\n\n $subject = 'Confirmed Order #' . $info['order']['id'];\n $message = \"Your order with {$info['order']['vendor']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow payment was chosen. Once you pay to the address, the vendor will ship the goods. You can raise a dispute if you have any issues.\" : \"You must make payment up-front to complete this order. Once the full amount is sent to the address, you must sign a transaction paying the vendor.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['buyer']['user_name'], $subject, $message);\n\n $subject = 'New Order #' . $info['order']['id'];\n $message = \"A new order from {$info['order']['buyer']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow was chosen for this order. Once paid, you will be asked to sign the transaction to indicate the goods have been dispatched.\" : \"Up-front payment was chosen for this order based on your settings for one of the items. The buyer will be asked to sign the transaction paying you immediately after payment, which you can sign and broadcast to mark the order as dispatched.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['vendor']['user_name'], $subject, $message);\n\n $msg = ($info['initiating_user'] == 'buyer')\n ? 'This order has been automatically accepted, visit the orders page to see the payment address!'\n : 'You have accepted this order! Visit the orders page to see the monero address!';\n $this->current_user->set_return_message($msg, 'success');\n return TRUE;\n } else {\n return 'There was an error creating your order.';\n }\n } else {\n return 'Unable to create address.';\n }\n }\n }", "public function __construct(Vendor $vendor)\n {\n $this->vendor = $vendor;\n }", "public function getVendorName(): string;", "public function newAction()\n {\n $entity = new VendorProfileLimit();\n $form = $this->createCreateForm($entity);\n $em = $this->getDoctrine()->getManager();\n $company_entity=$this->container->get('security.context')->getToken()->getUser()->getCompany();\n //$entities = $em->getRepository('ApplicationSonataUserBundle:User')->findByRole('ROLE_ADMIN');\n $query = $this->getDoctrine()->getEntityManager()\n ->createQuery(\n 'SELECT u FROM ApplicationSonataUserBundle:User u WHERE u.roles LIKE :role and u.company = :company')\n ->setParameter('role', '%\"ROLE_VENDOR_USER\"%')\n ->setParameter('company', $company_entity );\n \n \n $entities = $query->getResult();\n return array(\n 'entity' => $entity,\n 'users' => $entities\n );\n }", "private function addCustomerOrVendor(\n bool $isCustomer,\n string $userID,\n string $name,\n string $address) {\n // Query the database to see if the user already has a customer/vendor\n // with the given name.\n $customerOrVendorAlreadyExistsResult =\n $this->runQuery(\n 'SELECT ID FROM BooksDB.' \n . ($isCustomer ? 'Customers' : 'Vendors')\n . ' WHERE (userID = ?) AND (name = ?)',\n 'ss',\n $userID,\n $name);\n\n // If DatabaseConnection::runQuery(string,string,...mixed) returns\n // FALSE, an error occurred, so throw an exception.\n if($customerOrVendorAlreadyExistsResult === FALSE)\n throw new DatabaseException(\n 'DatabaseConnection::runQuery(string,string,...mixed) failed.');\n\n // If the query result does not have exactly 0 contents, the user\n // already has a customer/vendor with the given name, so return FALSE.\n if(count($customerOrVendorAlreadyExistsResult) !== 0) return FALSE;\n\n // Insert the new customer/vendor into the database.\n $this->runQuery(\n 'INSERT INTO BooksDB.'\n . ($isCustomer ? 'Customers' : 'Vendors')\n . ' (userID, name, address) VALUES (?, ?, ?)',\n 'sss',\n $userID,\n $name,\n $address);\n\n // If we made it here, everything must have gone well, so return TRUE.\n // (It is possible the insertion was unsuccessful, but no exceptions\n // were thrown by it; worst case the customer/vendor was not actually\n // added to the database.)\n return TRUE;\n }", "public function addProductsFromPartner($vendorId, $productId, $productName, $productDescription, $productImageUrl, $productPrice){\n\n $query = $this->db->prepare(\"INSERT INTO `products` (`vendor_id`, `ext_product_id`, `product_name`, `product_description`, `product_image_url`, `product_price`) VALUES ( ?, ?, ?, ?, ?, ? ) \");\n\n $query->bindValue(1, $vendorId);\n $query->bindValue(2, $productId);\n $query->bindValue(3, $productName);\n $query->bindValue(4, $productDescription);\n $query->bindValue(5, $productImageUrl);\n $query->bindValue(6, $productPrice);\n\n try {\n\n $query->execute();\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function add(){\n\t\tif(!$this->session->userdata(\"user_id\")){\n\t\t\treturn redirect(\"auth\");\n\t\t}else{\n\t\t\t$this->form_validation->set_rules(\"name\", \"name\", \"required\");\n\t\t\t$this->form_validation->set_rules(\"country_id\", \"country\", \"required\");\n\t\t\t$this->form_validation->set_rules(\"city\", \"city\", \"required\");\n\t\t\t$this->form_validation->set_rules(\"email\", \"email\", \"required|valid_email\");\n\t\t\t$this->form_validation->set_rules(\"phone\", \"phone\", \"required|numeric\");\n\n\t\t\t$config['upload_path'] = './assets/images';\n $config['allowed_types'] = 'jpg|gif|png|jpeg';\n\n $this->load->library('upload', $config);\n\n\t\t\tif($this->form_validation->run()){\n\t\t\t\t$data = $this->input->post();\n\t\t\t\tif($this->upload->do_upload('image_url')){\n\t\t\t\t\t$upload_info = $this->upload->data();\n\t\t\t\t\t$path = base_url('assets/images/'.$upload_info['raw_name'].$upload_info['file_ext']);\n\t\t\t\t\t$data['image_url'] = $path;\n\t\t\t\t}\n\t\t\t\tunset($data['submit']);\n\t\t\t\tif($this->vendors_model->save($data)){\n\t\t\t\t\t$this->session->set_flashdata(\"successful_registration\", \"Vendor successfully added.\");\n\t\t\t\t}else{\n\t\t\t\t\t$this->session->set_flashdata(\"failed_registration\", \"Vendor registration failed. Please try again later.\");\n\t\t\t\t}\n\t\t\t\treturn redirect(\"vendors\");\n\t\t\t}else{\n\t\t\t\t$countries = $this->countries_model->get_countries();\n\t\t\t\t$user = $this->membership_model->get_authenticated_user_by_id($this->session->userdata(\"user_id\"));\n\t\t\t\t$this->load->view('vendors/create', ['user' => $user, 'countries' => $countries]);\n\t\t\t}\n }\n\t}", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "function addUserFromEnt(&$ent) {\n print \"HURTZ\";\n $newUser = new AuthngUser();\n $newUser->setName($ent['name']);\n $newUser->setFullname($ent['fullname']);\n $newUser->setGroupname($ent['groupname']);\n $newUser->setPassword($ent['password']);\n $newUser->setUid($ent['uid']);\n\n if ($ent['priv'] && is_array($ent['priv'])) {\n foreach ($ent['priv'] as $privent) {\n $newPrivilege = new Privilege();\n $newPrivilege->setId($privent['id']);\n $newPrivilege->setName($privent['name']);\n $newPrivilege->setDescription($privent['description']);\n\n $newUser->addPrivilege($newPrivilege);\n }\n }\n\n $this->users[\"${ent['name']}\"] = $newUser;\n }", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "function addProduct($conn, $name, $vendor, $manufacturer, $rating, $quantity)\n {\n $query = \"LOCK TABLES \".strtoupper($vendor).\" WRITE\";\n $result = $conn->query($query);\n \n $query = $conn->prepare(\"INSERT INTO \".strtoupper($vendor).\"(name, vendor, manufacturer, rating, quantity) VALUES(?,?,?,?,?)\");\n $query->bind_param('sssdi', $name, $vendor, $manufacturer, $rating, $quantity);\n $result = $query->execute();\n \n $query = \"UNLOCK TABLES\";\n $result = $conn->query($query);\n \n if(!$result) die($conn->error);\n //else\n // echo(\"$name has been added to the \".strtoupper($vendor).\" table.<br />\");\n }", "protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }", "public function actionCreate() {\n $model = new Vendor();\n\n // display_array(var_dump(Yii::$app->request->post()));\n // exit;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (isset($_POST['VendorContactPerson']) && !empty($_POST['VendorContactPerson'])) {\n $this->vendorContactPerson($_POST['VendorContactPerson'], $model->id);\n }\n\n\n \\Yii::$app->session->setFlash('success', 'Form save successfully');\n return $this->redirect(['index', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function addUser($name, UserConfig $user);", "public function store(Request $request)\n {\n $request->validate(['company'=>'required','applicationtype'=>'required','address'=>'required','city'=>'required','country'=>'required','zipcode'=>'required','bank'=>'required','accountnumber'=>'required','branch'=>'required','branchcode'=>'required','email'=>'required','name'=>'required','surname'=>'required','position'=>'required','year'=>'required']);\n return $this->vendor->create($request);\n }", "public function AddUser($param){ \t\t \t \t\t\t\r\n \t\t\t$company=isset($param[0])?$param[0]:\"\";\r\n \t\t\t$sql=\"SELECT * FROM p_company WHERE trim(url) like trim('\".$this->dbOb->escape_string($company).\"')\";\r\n \t\t\t$c=$this->dbOb->getRow($sql);\r\n \t\t\tif(!$c || !$c['is_active']){\r\n \t\t\t\tthrow new Exception404(\"Sorry, but the requested company is not a Provant subscriber.\");\r\n \t\t\t}\r\n \t\t\tif(!count($_POST)){\r\n \t\t\t\theader(\"Location: /Register/Index/\".$company);\r\n \t\t\texit();\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//return $this->Index($param);\r\n \t\t\t$upm=new UserProfileModel(0);\r\n \t\t\t$err=$upm->validateUserRegistration($_POST,$c);\r\n \t\t\t\r\n \t\t\tif($err){\r\n \t\t\t\treturn $this->Index($param,$err);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$upm->registerUser();\r\n \t\t\t\r\n \t\t\theader(\"Location: /User/Index\");\r\n \t\texit(); \t\t\t\r\n \t\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'contact_person' => 'required',\n 'contact_number' => 'required',\n 'email' => 'required',\n 'website' => 'required',\n 'address' => 'required',\n ]);\n\n $cominfo = new Vendor;\n $cominfo->name = $request->name;\n $cominfo->contact_person = $request->contact_person;\n $cominfo->contact_number = $request->contact_number;\n $cominfo->email = $request->email;\n $cominfo->website = $request->website;\n $cominfo->address = $request->address;\n $cominfo->store_id=$this->sdc->storeID();\n $cominfo->branch_id=$this->sdc->branchID();\n $cominfo->created_by=$this->sdc->UserID();\n $cominfo->save();\n\n \n\n $this->sdc->log(\"Vendor Info\",$this->moduleName.\" Added Successfully.\");\n return redirect('vendor')->with('status', 'Vendor Added Successfully!');\n }", "public function addendUser($params) {\n \t\n\n \t$currdate = date(\"Y-m-d\", strtotime( \"today\" ));\n \t\t\n \t$this->email = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['email']);\n \tif(isset($params['facebookId']) && @$params['facebookId'] != NULL){\n \t\t$this->facebookId = BackEnd_Helper_viewHelper::stripSlashesFromString($params['facebookId']);\n \t}\n \tif(!isset($params['facebookId']) && @$params['facebookId'] == NULL){\n \t$this->password = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['password']);\n \t}\n \t$this->ZipCode = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['ZipCode']);\n \t$this->dob = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['birthDate']);\n\t$this->Gender = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['gender']);\n\t$this->DeviceToken = BackEnd_Helper_viewHelper::stripSlashesFromString(@$params['Token']);\n\t$this->roleId = 2; // This type for end user\n if(!isset($params['facebookId']) && @$params['facebookId'] == NULL){\n \t\n\t$this->usertype = \"S\";\n\t \t}else{\n\t\n\t$this->usertype = \"F\";\n\t \t}\n\t$this->isLogin = \"1\";\n\t\n\t$this->downloadDate = $currdate;\n\t\n\t \t// call doctrine save function\n\t \t$this->save();\n\t \t$result = $this->id;\n\t \treturn $result;\n }", "public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }", "public function actionCreate($vendor_id)\n\t{\n\t\t//die('here');\n\t\t$w_id = '';\n\t\tif(isset(Yii::app()->session['w_id']) && !empty(Yii::app()->session['w_id'])){\n\t\t\t$w_id = Yii::app()->session['w_id'];\n\t\t}\n\t\tif(!$this->checkAccessByData('VendorCreditEditor', array('warehouse_id'=>$w_id))){\n\t\t\tYii::app()->user->setFlash('premission_info', 'You dont have permission.! Bitch');\n\t\t\tYii::app()->controller->redirect(\"index.php?r=vendor/admin&w_id=\".$w_id);\n\t\t}\n $initial_pending_date = VendorDao::getInitialPendingDate();\n\t\t$model=new VendorPayment;\n\t\t$model->vendor_id = $vendor_id;\n\t\t$vendor = Vendor::model()->findByPk($vendor_id);\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['VendorPayment']))\n\t\t{\n if(strtotime($_POST['VendorPayment']['date']) <= strtotime($initial_pending_date)){\n Yii::app()->user->setFlash('error', \"Can't create payment to be created before base_date. Please Ask Developer\" );\n Yii::app()->controller->redirect(\"index.php?r=vendorPayment/admin&w_id=\".$w_id);\n }\n\t\t\t$model->attributes=$_POST['VendorPayment'];\n\t\t\t$model->created_at = date('Y-m-d');\n\t\t\tif($model->save()){\n\t\t\t\t$vendor->total_pending_amount-= $model->paid_amount;\n\t\t\t\tif(!$vendor->save()){\n\t\t\t\t\techo '<pre>';\n\t\t\t\t\tdie(print_r($vendor->getErrors()));\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('vendor/admin'));\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'vendor' => $vendor,\n\t\t\t));\n\t}", "public function store(Request $request)\n {\n $data = $this->validate($request, [\n 'name' => 'required',\n 'abbr' => 'nullable'\n ]);\n\n $data['author_id'] = auth()->id();\n\n $vendor = $this->vendorService->create($data);\n\n session()->flash('message:success', 'Vendor created');\n return redirect(route('admin.vendor.edit', $vendor->id));\n }", "function addUser(){\n $name = $_REQUEST['name'];\n $pword = $_REQUEST['pword'];\n $num = $_REQUEST['number'];\n include(\"../model/user.php\");\n $obj=new user();\n\n if($obj->addUser($name, $pword, $num)) {\n echo '{\"result\":1}';\n }else {\n echo '{\"result\":0}';\n }\n }", "public function addToBasketUser($params) {\n\n $basketUser = $this->getBasketUserFromAuth();\n\n // if there is no basket for this indentity we have to make it\n if ($basketUser == null) {\n $usersModel = new Application_Model_Users();\n $user = $usersModel->getUserByIdentityRole($this->getUserFromAuth());\n //var_dump($user);\n $paramUserId = array('usersId' => $user['usersID']);\n $basketId = $this->insert($paramUserId);\n } else {\n $basketId = $basketUser['basketID'];\n }\n // here we have to add the products to the db for details\n $insert_data = array(\n 'basketID' => $basketId,\n 'productID' => $params['id'],\n 'number' => $params['number']\n );\n\n $basketDetailModel = new Application_Model_BasketDetail();\n\n $result = $basketDetailModel->addToBasketDetail($insert_data);\n\n if ($result != null) {\n echo 'Product is toegevoegd';\n }\n }", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "public function vendor() {\n return $this->belongsTo(User::class);\n }", "function admin_add(){\n\t\t\n \t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",ADD_VENDOR);\t\t\n\t\tif(!empty($this->data)){\t\t\t\t\n\t\t\t\t\n\t\t\t/*** Then, to check if the data validates, use the validates method of the model, \n\t\t\t * which will return true if it validates and false if it doesn’t:\n\t \t\t */ \n\t\t\t$errors = $this->Vendor->validate_data($this->data);\n\t\t\tif(count($errors) == 0){\n\t\t\t\t\n\t\t\t\tApp::import(\"Component\",\"Upload\");\n\t\t\t\t$upload = new UploadComponent();\n\t\t\t\t$allowed_ext = array('jpg','jpeg','gif','png','JPG','JPEG','GIF','PNG');\n\t\t\t\t$path_info = pathinfo($this->data['Vendor']['image']['name']);\n\t\t\t\t$file_extension = strtolower($path_info['extension']);\n\t\t\t\tif(in_array($file_extension,$allowed_ext)){\n\t\t\t\t\t$file = $this->data['Vendor']['image'];\n\t\t\t\t\t$thumb_directory_path = $this->create_directory(\"vendor_image_thumb\");\n\t\t\t\t\t$actual_directory_path = $this->create_directory(\"vendor_image_actual\");\n\t\t\t\t\t$filename = str_replace(array(\" \",\".\"),\"\",md5(microtime())).\".\".$path_info['extension'];\n\t\t\t\t\t$rules['type'] = 'resizecrop';\n\t\t\t\t\t$rules['size'] = array (50,50); \n\t\t\t\t\t$file_name = $upload->upload($file,$thumb_directory_path,$filename,$rules,$allowed_ext);\n\t\t\t\t\t$file_name = $upload->upload($file,$actual_directory_path,$filename,null,$allowed_ext);\n\t\t\t\t\tif($file_name){\n\t\t\t\t\t\t$data = $this->data;\n\t\t\t\t\t\t$data['Vendor']['image'] = $filename;\n\t\t\t\t\t\tif($this->Vendor->save($data)){\n\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_SAVE, 'message/green');\n\t\t\t\t\t\t\t$this->redirect(array('controller'=>\"vendors\",'action'=>'list','admin'=>true)); \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_ERROR, 'message/red');\n\t\t\t\t\t\t\t$this->redirect($this->referer()); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$errors['image'][] = ERR_IMAGE_TYPE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->set(\"errors\",$errors);\n\t\t}\n\t\t\n \t}", "public function register_with_tyk() {\n\t\ttry {\n\t\t\t$tyk = new Tyk_API();\n\t\t\t$user_id = $tyk->post('/portal/developers', array(\n\t\t\t\t'email' => $this->user->user_email,\n\t\t\t\t));\n\t\t\t$this->set_tyk_id($user_id);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\ttrigger_error(sprintf('Could not register user for API: %s', $e->getMessage()), E_USER_WARNING);\n\t\t}\n\t}", "function signup($fname,$lname,$phone,$email,$pwd){\n\t\tif(isset($_SESSION['user'])){\n\t\t\t$encrypted_pass = $pwd;\n\t\t}else{\n\t\t\t$encrypted_pass = md5($pwd);\n\t\t}\n\t\t//end\n\n\t\t//this is to check if email already exists\n\t\t$checkifemailexists = $this->getdetailswithemail($email,'vendors');\n\n\t\tif(!empty($checkifemailexists)){\n\n\t\t\t$_SESSION['emailalreadyexists'] = \"emailalreadyexists\";\n\t\t\t$_SESSION['fname'] = $fname;\n\t\t\t$_SESSION['lname'] = $lname;\n\t\t\t$_SESSION['phone'] = $phone;\n\t\t\t$_SESSION['email'] = $email;\n\n\t\t\theader(\"location: becomeavendor.php\");\n\n\t\t\treturn;\n\t\t}\n\t\t//end\n\n\t\t$sql = \" INSERT INTO vendors SET v_fname = '$fname', v_lname = '$lname', v_phone = '$phone', v_email = '$email', v_password = '$encrypted_pass' \";\n\n\t\t$this->conn->query($sql);\n\n\t\t$id = $this->conn->insert_id;\n\n\t\tif($id > 0){\n\t\t\t\n\t\t\t$reg_id = \"VEN/\".date(\"Y.m.d\").\"/\".$id;\n\n\t\t\t$this->conn->query(\" UPDATE vendors SET v_user_id = '$reg_id' WHERE vendor_id = '$id' \");\n\n\t\t\t\n\t\t\tif(isset($_SESSION['user'])){\n\n\t\t\t$_SESSION['user'] = $id;\n\n\t\t\t$_SESSION['route'] = 'vendor';\n\n\t\t\t}else{\n\n\t\t\t$_SESSION['user'] = $id;\n\n\t\t\t$_SESSION['route'] = 'vendor';\n\n\t\t\t//this is to fetch email and assign to session\n\t\t\t$emailfetch = $this->getdetails($_SESSION['user'],'vendors');\n\n\t\t\t$_SESSION['useremail'] = $emailfetch['v_email'];\n\t\t\t//end\n\n\t\t\theader(\"location: complete_registration.php\");\n\n\t\t\t}\n\n\n\t\t}else{\n\n\t\t\t$_SESSION['error'] = \"failedsignup\";\n\n\t\t\theader(\"location: signup.php\");\n\t\t}\n\n\n\t}", "public function register($u) {\n $this->user_id = $u; \n }", "public function create(RegisterFormRequest $request) {\n DB::beginTransaction();\n try {\n // process the store\n $data = $request->all();\n\n $user_detail = \\App\\VendorDetail::createVendorFront($data);\n $file = Input::file('vendor_logo');\n\n //store image\n if (!empty($file)) {\n $this->addImageWeb($file, $user_detail, 'vendor_logo');\n }\n if ($user_detail) {\n //stripe payment\n $stripeuser = \\App\\StripeUser::createStripeUser($user_detail->user_id);\n $stripeuser->createToken($data);\n Session::flash('success', \\Config::get('constants.USER_EMAIL_VERIFICATION'));\n }\n } catch (\\Cartalyst\\Stripe\\Exception\\CardErrorException $e) {\n\n \\App\\StripeUser::findCustomer($data['email']);\n DB::rollback();\n\n $message = $e->getMessage();\n if (strpos($message, 'year') !== false || strpos($message, 'month') !== false) {\n return response()->json(['errors' => ['card_expiry' => [0 => ucwords($message)]]], 422);\n } elseif (strpos($message, 'cvv') !== false || strpos($message, 'security code') !== false) {\n return response()->json(['errors' => ['card_cvv' => [0 => ucwords($message)]]], 422);\n } elseif (strpos($message, 'number') !== false || strpos($message, 'card') !== false) {\n return response()->json(['errors' => ['card_no' => [0 => ucwords($message)]]], 422);\n }\n return response()->json(['status' => 0, 'message' => ucwords($message)], 422);\n } catch (\\Cartalyst\\Stripe\\Exception\\UnauthorizedExceptioncatch $e) {\n //throw $e;\n // \\App\\StripeUser::findCustomer($data['email']);\n DB::rollback();\n return response()->json(['status' => 0, 'message' => ucwords($e->getMessage())], 422);\n } catch (\\Exception $e) {\n // throw $e;\n // \\App\\StripeUser::findCustomer($data['email']);\n DB::rollback();\n return response()->json(['status' => 0, 'message' => ucwords($e->getMessage())], 422);\n }\n // If we reach here, then// data is valid and working.//\n DB::commit();\n $array_mail = ['to' => $data['email'],\n 'type' => 'verifyvendor',\n 'data' => ['confirmation_code' => User::find($user_detail->user_id)->confirmation_code],\n ];\n $this->sendMail($array_mail);\n // redirect\n return view('frontend.signup.pricetable')->with(['user_id' => $user_detail->user_id]);\n }", "function register_user($new) {\n \n $this->db->insert('users', $new);\n }", "public function addProductSku($user,$newProductSku){\n \n $prodId = $newProductSku->getProdId();\n $ownerId = $user->getUserId();\n\n $authuser = new UserDao();\n $authuser->setUserId($ownerId);\n $token = explode(\" \",$user->getToken())[1];\n $authuser->setToken($token);\n\n if($authuser->verifyUserToken() && $this->product->checkOwnerId($prodId,$ownerId)){\n\n \n $this->productSku->setProdId($prodId);\n $this->productSku->setMrpPrice($newProductSku->getMrpPrice());\n $this->productSku->setRetailPrice($newProductSku->getRetailPrice());\n $this->productSku->setStock($newProductSku->getStock());\n \n \n $response = $this->productSku->addProductSku();\n \n if($response['response'] == 1){\n unset($response['last_id']);\n }\n return $response;\n }\n else{\n $this->response->setResponse(0);\n $this->response->setMessage(\"Unauthorized user\");\n }\n\n return $this->response->getResponse();\n }", "public function api_entry_subscribeAPN() {\n parent::validateParams(array('user', 'udid', 'devicetoken'));\n\n $users = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if (!$this->Mdl_Users->get($_POST[\"user\"])) parent::returnWithErr(\"User id is not valid.\");\n\n $user = $this->Mdl_Users->update(array(\n 'id' => $_POST[\"user\"],\n 'udid' => $_POST[\"udid\"],\n 'devicetoken' => $_POST[\"devicetoken\"]\n ));\n\n parent::returnWithoutErr(\"Subscription has been done successfully.\", $user);\n }", "public function addVendorWithHttpInfo($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling addVendor');\n }\n \n // parse inputs\n $resourcePath = \"/beta/vendor\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'POST',\n $queryParams, $httpBody,\n $headerParams, '\\Infoplus\\Model\\Vendor'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\Infoplus\\ObjectSerializer::deserialize($response, '\\Infoplus\\Model\\Vendor', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\Infoplus\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Infoplus\\Model\\Vendor', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 405:\n $data = \\Infoplus\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Infoplus\\Model\\ApiResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }", "public function create()\n {\n return view('vendors.create_vendor');\n }", "public function create()\n {\n $vendor = new Vendor();\n\n return view('admin.vendors.create', [\n 'vendor' => $vendor\n ]);\n }", "function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}", "public function createVendorChange($vendor) {\n $vendorId = strstr($vendor, '|', TRUE);\n return (new ProjectChangesModel())\n ->setVendorAccountIds([$vendorId]);\n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "public function api_entry_signup() {\n\n parent::validateParams(array(\"username\", \"email\", \"password\", \"fullname\", \"church\", \"province\", \"city\", \"bday\"));\n\n $qbToken = $this->qbhelper->generateSession();\n\n if ($qbToken == null || $qbToken == \"\") parent::returnWithErr(\"Generating QB session has been failed.\");\n\n $qbSession = $this->qbhelper->signupUser(\n $qbToken,\n $_POST['username'],\n $_POST['email'],\n QB_DEFAULT_PASSWORD\n );\n /*\n\n */\n if ($qbSession == null)\n parent::returnWithErr($this->qbhelper->latestErr);\n\n $newUser = $this->Mdl_Users->signup(\n $_POST['username'],\n $_POST['email'],\n md5($_POST['password']),\n $_POST['fullname'],\n $_POST['church'],\n $_POST['province'],\n $_POST['city'],\n $_POST['bday'],\n $qbSession\n );\n\n if ($newUser == null) {\n parent::returnWithErr($this->qbhelper->latestErr);\n }\n\n $hash = hash('tiger192,3', $newUser['username'] . date(\"y-d-m-h-m-s\"));\n $baseurl = $this->config->base_url();\n\n $this->load->model('Mdl_Tokens');\n $this->Mdl_Tokens->create(array(\n \"token\" => $hash,\n \"user\" => $newUser['id']\n ));\n\n $content = '<html><head><base target=\"_blank\">\n <style type=\"text/css\">\n ::-webkit-scrollbar{ display: none; }\n </style>\n <style id=\"cloudAttachStyle\" type=\"text/css\">\n #divNeteaseBigAttach, #divNeteaseBigAttach_bak{display:none;}\n </style>\n <style type=\"text/css\">\n .ReadMsgBody{ width: 100%;} \n .ExternalClass {width: 100%;} \n .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} \n p { margin: 1em 0;} \n table td { border-collapse: collapse;} \n _-ms-viewport{ width: device-width;}\n _media screen and (max-width: 480px) {\n html,body { width: 100%; overflow-x: hidden;}\n table[class=\"container\"] { width:320px !important; padding: 0 !important; }\n table[class=\"content\"] { width:100% !important; }\n td[class=\"mobile-center\"] { text-align: center !important; }\n td[class=\"content-center\"] { text-align: center !important; padding: 0 !important; }\n td[class=\"frame\"] {padding: 0 !important;}\n [class=\"mobile-hidden\"] {display:none !important;}\n table[class=\"cta\"]{width: 100% !important;}\n table[class=\"cta\"] td{display: block !important; text-align: center !important;}\n *[class=\"daWrap\"] {padding: 20px 15px !important;}\n }\n </style>\n\n\n </head><body><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tbody><tr><td class=\"frame\" bgcolor=\"#f3f3f3\">\n <table width=\"576\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" class=\"container\" align=\"center\">\n <tbody><tr><td style=\"padding-left:5px;border-bottom: solid 2px #dcdcdc;\" class=\"mobile-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:40px;\"><b>iPray</b></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td class=\"frame\" bgcolor=\"#f3f3f3\"><div align=\"center\">\n \n <table border=\"0\" cellpadding=\"40\" cellspacing=\"0\" width=\"576\" class=\"container\" align=\"center\"> \n <tbody><tr><td class=\"daWrap\">\n <table width=\"80%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr>\n <td align=\"left\" valign=\"top\" style=\"padding-top:15px;\" class=\"content-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:22px;\"><b>You are almost verified.</b></font><br><br>\n People are looking for someone they can trust. With a verified email, you\"ll be instantly more approachable. Just click the link to finish up.</font>\n <br><br>\n <table cellspacing=\"0\" cellpadding=\"0\" align=\"left\" class=\"cta\">\n <tbody><tr><td style=\"font-size: 17px; color: white; background: #1a6599; background-image: -moz-linear-gradient(top, #2b88c8, #1a6599); background-image: -ms-linear-gradient(top, #2b88c8, #1a6599); background-image: -o-linear-gradient(top, #2b88c8, #1a6599); background-image: -webkit-gradient(linear, center top, center bottom, from(#2b88c8), to(#1a6599)); background-image: -webkit-linear-gradient(top, #2b88c8, #1a6599); background-image: linear-gradient(top, #2b88c8, #1a6599); text-decoration: none; font-weight: normal; display: inline-block; line-height: 25px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 10px 40px; \">\n <font face=\"Helvetica, Arial, sans-serif\"><a href=\"'. $baseurl .'AdminLogin/verify?token=' . $hash . '\" style=\"color: #FFFFFF; text-decoration: none; text-shadow: 0px -1px 2px #333333; letter-spacing: 1px; display: block;\">Verify Your Email</a></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n </tbody></table>\n <table width=\"80%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr><td>&nbsp;</td></tr>\n <tr><td align=\"center\" style=\"border-bottom: solid 1px #dcdcdc;\"><font face=\"Helvetica, Arial, sans-serif\" size=\"2\" color=\"#777\" style=\"font-size: 13px;\">\n <b>Questions?</b> Take a look at our <a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\">FAQs</a>, or contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\"> Customer Care</a>.</font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td align=\"center\" style=\"padding:15px;\"><font face=\"Arial, sans-serif\" size=\"2\" color=\"#333333\" style=\"font-size:12px;\">\n <em>Please add <a href=\"mailto:[email protected]\">[email protected]</a> to your address book to ensure our emails reach your inbox.</em><br><br>\n Please do not reply to this email. Replies will not be received. If you have a question, or need assistance, please contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#8a8a8a;\"> Customer Service</a>.</font></td>\n </tr>\n </tbody></table>\n \n </div></td></tr>\n </tbody></table>\n\n <img src=\"http://www.match.com/email/open.aspx?EmailID=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c&amp;SrcSystem=3\" width=\"1\" height=\"1\" border=\"0\">\n <span style=\"padding: 0px;\"></span>\n\n \n\n <style type=\"text/css\">\n body{font-size:14px;font-family:arial,verdana,sans-serif;line-height:1.666;padding:0;margin:0;overflow:auto;white-space:normal;word-wrap:break-word;min-height:100px}\n td, input, button, select, body{font-family:Helvetica, \"Microsoft Yahei\", verdana}\n pre {white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;width:95%}\n th,td{font-family:arial,verdana,sans-serif;line-height:1.666}\n img{ border:0}\n header,footer,section,aside,article,nav,hgroup,figure,figcaption{display:block}\n </style>\n\n <style id=\"ntes_link_color\" type=\"text/css\">a,td a{color:#064977}</style>\n </body></html>';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, 'api:key-061710f7633b3b2e2971afade78b48ea');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_URL, \n 'https://api.mailgun.net/v3/sandboxa8b6f44a159048db93fd39fc8acbd3fa.mailgun.org/messages');\n curl_setopt($ch, CURLOPT_POSTFIELDS, \n array('from' => '[email protected] <[email protected]>',\n 'to' => $newUser['username'] . ' <' . $newUser['email'] . '>',\n 'subject' => \"Please verify your account.\",\n 'html' => $content));\n $result = curl_exec($ch);\n curl_close($ch);\n\n /*\n Now we should register qb user at first.....\n */\n parent::returnWithoutErr(\"User has been created successfully. Please verfiy your account from verification email.\", $newUser);\n }", "public function voxy_create_new_user()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n $api_data = $this->m_voxy_connect->register_a_new_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Tạo tài khoản người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "public function registerVersion() {\n $this->loadModel('Versions');\n $result = $this->Versions->newEntity();\n if ($this->request->is('post') || $this->request->is('put')) {\n $this->Versions->patchEntity($result, $this->request->data(), [\n 'validate' => 'adminAdd'\n ]);\n if ($this->Versions->save($result)) {\n $this->redirect(array('controller' => 'users', 'action' => 'version'));\n }\n }\n $this->set(compact('result'));\n }", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function add_users($custom)\n {\n $this->load->library('auth_model');\n $is_user = $this->auth_model->get_user_by_username($custom['username']);\n if($is_user) return $is_user->id;\n\n $data = array(\n 'username' => \"\",\n 'password' => \"\",\n 'email' => \"\",\n 'user_type' => \"registered\",\n 'role' => \"vendor\",\n 'slug' => \"\",\n 'banned' => 0,\n 'shop_name' => \"\",\n 'show_phone' => 1,\n 'is_active_shop_request' => 1,\n 'token' => generate_token(),\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n foreach ($custom as $column => $value) {\n $data[$column] = $value;\n }\n\n $this->load->library('bcrypt');\n\n $data['email'] = $data['email'] ?: $data[\"username\"].\"@zappeur.com\";\n $data['shop_name'] = $data[\"username\"];\n $data['password'] = $this->bcrypt->hash_password($data['username']);\n $data[\"slug\"] = $this->auth_model->generate_uniqe_slug($data[\"username\"]);\n\n if ($this->db->insert('users', $data)) {\n $last_id = $this->db->insert_id();\n return $last_id;\n } else {\n return false;\n }\n }" ]
[ "0.7153838", "0.66894406", "0.65576863", "0.63545036", "0.6278909", "0.617923", "0.61598206", "0.6151986", "0.61476517", "0.6111772", "0.6102482", "0.60807914", "0.6065119", "0.60534984", "0.60047746", "0.5991669", "0.59769064", "0.5942889", "0.59143776", "0.5905661", "0.58919877", "0.5891851", "0.5888852", "0.5868558", "0.5861782", "0.5854073", "0.58465374", "0.5843858", "0.58434504", "0.58337885", "0.5782327", "0.57703847", "0.5765038", "0.57585746", "0.5756407", "0.5718726", "0.57151437", "0.57116425", "0.57072407", "0.5705172", "0.56816596", "0.5675192", "0.56685543", "0.5659854", "0.56501967", "0.5617483", "0.5614505", "0.5610292", "0.5598026", "0.559195", "0.558974", "0.5582647", "0.5581989", "0.5578298", "0.5573707", "0.5567096", "0.5563435", "0.5545719", "0.5542128", "0.5537379", "0.5537053", "0.55321854", "0.5529762", "0.552836", "0.55222976", "0.55217946", "0.552025", "0.5520218", "0.5516337", "0.54941046", "0.54880154", "0.54827815", "0.54731536", "0.5468922", "0.5466764", "0.5441238", "0.54280037", "0.5425139", "0.5423539", "0.54209626", "0.5417151", "0.5415526", "0.53972524", "0.53923553", "0.5388989", "0.53883564", "0.5381972", "0.537833", "0.5376884", "0.5376265", "0.5371915", "0.5364026", "0.5362835", "0.5361333", "0.53524995", "0.5343858", "0.5343858", "0.5343858", "0.5343858", "0.53345037" ]
0.667634
2
/ Update user vendor
public function updateVendor() { try { if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(" Vendor Entity not initialized"); } else { $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor(); $objVendor->vendor = $this->vendor; return $objVendor->updateVendor(); } } catch (Exception $ex) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($vendor);", "public function update_vendor($id, $data)\n\t{\n\t\t// Unset, if neccessary\n\t\tif ($data['api_id'] == '0')\n\t\t\t$data['api_id'] = NULL;\n\t\t\n\t\tif (empty($data['orderemail']))\n\t\t\t$data['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['ordername'] = NULL;\n\t\t\n\t\t// Limit to this vendor_id\n\t\t$this->db->where('id', $id);\n\t\t\n\t\t// Perform an update\n\t\t$this->db->update('vendors', $data);\n\t}", "public function setVendor(string $vendor)\n {\n }", "public function handleVendor(){ \n $login = $this->hlp->logn();\n $vStr = \"vendorfee\";\n $vFee = intval($this->configuration->valueGetter($vStr));\n \n if (!$this->listings->isVendor($login)) {\n if ($this->wallet->getBalance($login) >= $vFee){ \n $this->wallet->moveAndStore($vStr, $login, \"profit\", $vFee);\n $this->listings->becomeVendor($login);\n $this->flashMessage(\"Váš účet má nyní vendor status\");\n $this->redirect(\"Listings:in\");\n } else {\n $this->flashMessage(\"You don't have sufficient funds!\");\n $this->redirect(\"Listings:in\");\n } \n } else {\n $this->redirect(\"Listings:in\");\n }\n }", "public function updateVendor($body)\n {\n list($response, $statusCode, $httpHeader) = $this->updateVendorWithHttpInfo ($body);\n return $response; \n }", "function edit_allowed_vendor($user_data_id) {\n\n $data = array(\n 'allowed_url' => $this->input->post('url_link'),\n 'allowed_image_url' => $this->input->post('image_url_link'),\n 'allowed_tagline' => $this->input->post('tagline'),\n 'allowed_body' => $this->input->post('allowed_body'),\n 'allowed_modified' => date('Y-m-d H:i:s'),\n );\n\n if ($data['allowed_image_url'] === '')\n {\n $data['allowed_image_url'] = '/webroot/vendor_logos/default_logo.png';\n }\n if ( ! empty($_FILES['userfile']['name']))\n {\n $image_data = $this->upload->data();\n $image_loc = $image_data['file_name'];\n $data['allowed_image_url'] = '/webroot/vendor_logos/'.$image_loc;\n }\n $this->db->where('id', $id);\n return $this->db->update('allowed_vendors', $data);\n }", "public function update_partner_profile($user_data) {\n\n $partner_id = $user_data['vendor_id'];\n if (isset($user_data['name']) && $user_data['name'] != '') {\n $updated_user_data = array(\n 'first_name' => $user_data['name'],\n );\n $this->db->where('id', $partner_id);\n $this->db->update('vendors', $updated_user_data);\n return $updated_user_data;\n }\n\n\n if (isset($user_data['lastname']) && $user_data['lastname'] != '') {\n\n $updated_user_data = array(\n 'last_name' => $user_data['lastname'],\n );\n $this->db->where('id', $partner_id);\n $this->db->update('vendors', $updated_user_data);\n return $updated_user_data;\n }\n }", "public function update_vendor_email_on_user_update( $user_id = 0, $old_user_data ) {\n\t\t$vendor = new FES_Vendor( $user_id, true );\n\t\tif ( ! $vendor ) {\n\t\t\treturn false;\n\t\t}\n\t\t$user = get_userdata( $user_id );\n\t\tif ( ! empty( $user ) && $user->user_email !== $vendor->email ) {\n\t\t\tif ( ! $this->get_vendor_by( 'email', $user->user_email ) ) {\n\t\t\t\t$success = $this->update( $vendor->id, array( 'email' => $user->user_email ) );\n\t\t\t\tif ( $success ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Update Vendor Email on User Update\n\t\t\t\t\t *\n\t\t\t\t\t * An action that runs when a vendor email is updated \n\t\t\t\t\t * because a user email was changed.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.0.0\n\t\t\t\t\t *\n\t\t\t\t\t * @param WP_User $user User object of edited user.\n\t\t\t\t\t * @param FES_Vendor $vendor Vendor object of edited user.\n\t\t\t\t\t */\t\n\t\t\t\t\tdo_action( 'fes_update_vendor_email_on_user_update', $user, $vendor );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testUpdateUser()\n {\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "public function edit(Vendor $vendor)\n {\n //\n }", "public function update(Request $request)\n {\n if (!Vendor::where('customer_uid', $request->user()->uid)->first()) {\n return errorResponse(\"You don't have vendor yet.\", 404);\n }\n $vendor = Vendor::where('customer_uid', $request->user()->uid)->first();\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:250',\n 'description' => 'required|min:50',\n 'logo' => 'image',\n 'id_card' => 'image',\n 'national_identity_number' => 'required|unique:vendors,national_identity_number,' . $vendor->id . ',id,deleted_at,NULL',\n 'id_card_with_customer' => 'image',\n 'phone' => 'required|max:20|unique:vendors,phone,' . $vendor->id . ',id,deleted_at,NULL',\n 'village_id' => 'required|exists:villages,id',\n 'street' => 'required',\n 'latitude' => 'required|numeric',\n 'longitude' => 'required|numeric'\n ]);\n if ($validator->fails()) {\n return errorResponse($validator->errors(), 400);\n }\n $requestData = $request->all();\n $village = Village::findOrFail($requestData['village_id']);\n $requestData['district_id'] = $village->district->id;\n $requestData['city_id'] = $village->district->city->id;\n $requestData['province_id'] = $village->district->city->province->id;\n DB::beginTransaction();\n try {\n $requestData['customer_uid'] = $request->user()->uid;\n $requestData['phone'] = $this->phoneNumberUtil->parse($requestData['phone'], 'ID');\n if (!$this->phoneNumberUtil->isValidNumber($requestData['phone'])) {\n return errorResponse('No telepon tidak valid', 400);\n }\n $requestData['phone'] = '+' . $requestData['phone']->getCountryCode() .\n $requestData['phone']->getNationalNumber();\n Log::info('Before update : ' . $vendor);\n $vendor->update($requestData);\n $vendor->address()->delete();\n $address = new VendorAddress($requestData);\n $vendor->address()->save($address);\n Log::info('After update Vendor : ' . $vendor);\n DB::commit();\n return (new VendorResource($vendor));\n } catch (Exception $e) {\n DB::rollBack();\n return errorResponse($e->getMessage(), 500);\n }\n }", "public function update($itemVendorX){\r\n\t\t$sql = 'UPDATE item_vendor_x SET price = ?, part_number = ?, item_name = ? WHERE item_id = ? AND vendor_id = ? ';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t\n\t\t$sqlQuery->set($itemVendorX->price);\n\t\t$sqlQuery->set($itemVendorX->partNumber);\n\t\t$sqlQuery->set($itemVendorX->itemName);\n\r\n\t\t\n\t\t$sqlQuery->setNumber($itemVendorX->itemId);\n\n\t\t$sqlQuery->setNumber($itemVendorX->vendorId);\n\r\n\t\treturn $this->executeUpdate($sqlQuery);\r\n\t}", "public function updateVendor(Request $request, MasterVendor $vendor)\n {\n\n $validator = Validator::make(\n $request->all(),\n [\n 'nama' => 'required|max:255',\n 'kode' => 'required|size:5',\n 'harga_katering_dasar' => 'required',\n 'add_on' => 'required',\n 'harga_add_on' => 'required',\n ],\n [\n 'nama.required' => 'Harap Masukan Nama Vendor (Maks 255)',\n 'kode.size' => 'Kode Vendor Harus 5 Buah',\n 'harga_katering_dasar.required' => 'Harap Masukan Harga Dasar Katering',\n 'add_on.required' => 'Harap Masukan Menu Tambahan',\n 'harga_add_on.required' => 'Harap Masukan Harga Menu Tambahan',\n ]\n );\n\n if ($validator->fails()) {\n return response()->json([\n 'success' => false,\n 'message' => $validator->errors()\n ], 401);\n } else {\n\n $vendor = MasterVendor::whereId($request->input('id'))->update([\n 'nama' => $request->input('nama'),\n 'kode' => $request->input('kode'),\n 'harga_katering_dasar' => $request->input('harga_katering_dasar'),\n 'add_on' => $request->input('add_on'),\n 'harga_add_on' => $request->input('harga_add_on'),\n ]);\n\n if ($vendor) {\n return response()->json([\n 'success' => true,\n 'message' => 'Menu Berhasil Diupdate!',\n ], 200);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'Menu Gagal Diupdate!',\n ], 401);\n }\n }\n\n }", "public function change($vendor_id){\n\t\tif(!$this->session->userdata(\"user_id\")){\n\t\t\treturn redirect(\"auth\");\n\t\t}else{\n\t\t\t$vendor = $this->vendors_model->get_details($vendor_id);\n\t\t\t$user = $this->membership_model->get_authenticated_user_by_id($this->session->userdata(\"user_id\"));\n\t\t\t$countries = $this->countries_model->get_countries();\n\t\t\t$this->load->view('vendors/edit', [\n\t\t\t\t'user' => $user, \n\t\t\t\t'vendor' => $vendor, \n\t\t\t\t'countries' => $countries\n\t\t\t]);\n\t\t}\n\t}", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function update(Request $request, Vendor $vendor)\n {\n //Validate the form\n $this->validate(request(), [\n 'name' => 'required|string|max:255'\n ]);\n flash('Successfully updated vendor!')->success();\n $vendor->update(request()->all());\n return redirect()->route('vendors_index');\n }", "public function update(User $user, SystemUnit $systemUnit)\n {\n //\n }", "public function update(Request $request, Vendor $vendor)\n {\n $data = $this->validate($request, [\n 'name' => 'required',\n 'abbr' => 'nullable'\n ]);\n\n $data['author_id'] = auth()->id();\n\n $vendor = $this->vendorService->update($vendor, $data);\n\n session()->flash('message:success', 'Vendor updated');\n return redirect(route('admin.vendor.edit', $vendor->id));\n }", "public function testUpdateNetworkMerakiAuthUser()\n {\n }", "public function update(Request $request, Vendor $vendor)\n {\n $vendor->update($request->validate([\n 'name' => 'required|max:60',\n 'notes' => 'nullable|max:255',\n 'website' => 'nullable|url|max:255',\n 'is_active' => 'required|boolean',\n ]));\n\n flash(__('vendor.updated'), 'success');\n\n return redirect()->route('vendors.index', request(['page', 'q']));\n }", "public function update(Request $request, Vendor $Vendor) {\n $this->saveUpdateVendorDetails($request);\n return redirect()->route('vendors.index')->with('success', 'Vendor updated successfully');\n }", "public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }", "public function vendorChangeStatus(Request $request)\n {\n $validator=Validator::make($request->all(), [\n 'user_id' => 'required',\n 'vendor_id' => 'required',\n 'tag'=>'required',\n 'gig_id'=>'required',\n 'status'=>'required'\n ]);\n if ($validator->fails())\n {\n return response(array(\n 'success'=>0,\n 'data'=>$validator->errors()\n ));\n }\n else\n {\n $response=VendorServiceGig::where(['id'=>$request->gig_id,'vendor_id'=>$request->vendor_id])->update([\n 'status'=>$request->status\n ]);\n if($response)\n {\n return response(array(\n 'success'=>1,\n 'msg'=>'Successfully Updated'\n ));\n }\n else {\n return response(array(\n 'success'=>0,\n 'msg'=>'Something Went Wrong'\n ));\n }\n }\n }", "public function update_account() {\n global $dbconfig;\n\n $user_id = $this->params['user_id'];\n $status = isset($this->params['status']) ? $this->params['status'] : BLOCKED;\n $account_dbobj = $this->params['account_dbobj'];\n $user_status = BLOCKED;\n $store_status = PENDING;\n\n if($status === ACTIVATED) {\n $user_status = CREATED;\n $store_status = PENDING;\n }\n\n // update users table\n $user_obj = new User($account_dbobj, $user_id);\n $user_obj->setStatus($status);\n $user_obj->save();\n\n $user = BaseModel::findCachedOne($dbconfig->account->name . \".user?id=$user_id\");\n if(!empty($user['store_id'])){\n $store_id = $user['store_id'];\n // store need to manually launch\n $store_obj = new Store($account_dbobj, $store_id);\n if($store_obj->getId()) {\n $store_obj->setStatus($store_status);\n $store_obj->save();\n if($store_status != ACTIVATED){\n GlobalProductsMapper::deleteProductsInStore($account_dbobj, $store_id);\n }\n }\n }\n }", "protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function update_user_option($user_id, $option_name, $newvalue, $is_global = \\false)\n {\n }", "public function update(SaveVendorRequest $request, Vendor $vendor)\n {\n $vendor->vendor_id = $request->input('vendor_id');\n $vendor->vendor_code = $request->input('vendor_code');\n $vendor->supplier_name = $request->input('supplier_name');\n $vendor->contact_person = $request->input('contact_person');\n $vendor->address = $request->input('address');\n $vendor->city = $request->input('city');\n $vendor->state_or_province = $request->input('state_or_province');\n $vendor->country = $request->input('country');\n $vendor->postal_code = $request->input('postal_code');\n $vendor->phone_number = $request->input('phone_number');\n $vendor->fax_number = $request->input('fax_number');\n $vendor->email = $request->input('email');\n $vendor->save();\n\n return redirect()->route('vendors.index')->with('success', 'Vendor updated successfully.');\n }", "public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }", "private function SetVendorData()\n\t{\n\t\tif(isset($_REQUEST['vendorid'])) {\n\t\t\t$this->vendor = $this->LoadVendorById($_REQUEST['vendorid']);\n\t\t}\n\t\telse if(isset($GLOBALS['PathInfo'][1]) && $GLOBALS['PathInfo'][1] != '') {\n\t\t\t$this->vendor = $this->LoadVendorByFriendlyName($GLOBALS['PathInfo'][1]);\n\t\t}\n\n\t\t// Viewing the products that belong to a specific vendor\n\t\tif((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] == 'products') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'products')) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'products';\n\t\t}\n\n\t\t// Viewing a specific page\n\t\telse if((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] != '') || isset($_REQUEST['pageid'])) {\n\t\t\t//\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'page';\n\t\t}\n\n\t\t// Viewing vendor profile\n\t\telse if(isset($GLOBALS['PathInfo'][1]) || isset($_REQUEST['vendorid'])) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\t\t\t$this->displaying = 'profile';\n\t\t}\n\n\t\t// Otherwise, just showing a list of vendors\n\t\telse {\n\t\t\t$this->displaying = 'vendors';\n\t\t}\n\t}", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function updateVendorCustomFields($body)\n {\n list($response, $statusCode, $httpHeader) = $this->updateVendorCustomFieldsWithHttpInfo ($body);\n return $response; \n }", "public function execute()\n {\n\n $inline = $this->getRequest()->getParam('inline', 0);\n $vendorIds = $this->getRequest()->getParam('vendor_id');\n $status = $this->getRequest()->getParam('status', '');\n $reason = $this->getRequest()->getParam('reason', '');\n\n $shop_disable = 2;\n if ($status == \\Ced\\CsMarketplace\\Model\\Vendor::VENDOR_APPROVED_STATUS) {\n $shop_disable = 1;\n }\n if ($status == \\Ced\\CsMarketplace\\Model\\Vendor::VENDOR_DISAPPROVED_STATUS) {\n $shop_disable = 2;\n }\n\n if ($inline) {\n $vendorIds = [$vendorIds];\n } else {\n $vendorIds = explode(',', $vendorIds);\n }\n\n if (!is_array($vendorIds)) {\n $this->messageManager->addErrorMessage(__('Please select vendor(s)'));\n } else {\n try {\n $model = $this->_validateMassStatus($vendorIds, $status);\n if ($reason) {\n $model->saveMassAttribute($vendorIds, ['code' => 'reason', 'value' => $reason]);\n } else {\n $model->saveMassAttribute($vendorIds, ['code' => 'reason', 'value' => '']);\n }\n $model->saveMassAttribute($vendorIds, ['code' => 'status', 'value' => $status]);\n\n $shop_model = $this->vshopFactory->create();\n $shop_model->saveShopStatus($vendorIds, $shop_disable);\n $this->messageManager->addSuccessMessage(\n __('Total of %1 record(s) have been updated.', count($vendorIds))\n );\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage(\n __(' %1 An error occurred while updating the vendor(s) status.', $e->getMessage())\n );\n }\n }\n $this->_redirect('*/*/index');\n }", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function getVendorId() {}", "public function updateUser($data) {\n\t\t\n\t}", "function updateUser($userId, $image, $password, $email, $phone, $about){\n //TODO Actually implement the function.\n // $dbQuery = \"UPDATE USERS SET \";\n }", "public function update(&$vo){\n\t\treturn mysql_query(\"UPDATE customer SET uid = '$vo->uid',name = '$vo->name',firm_name = '$vo->firm_name',address = '$vo->address',phone = '$vo->phone',email = '$vo->email' WHERE cust_id = $vo->cust_id \");\n\t}", "function rvendor() {\n\t\t$this->checkOnce();\n\t\t$remotePath = $this->getVersionPath().'/';\n\t\t$this->system('scp -r -v -i '.$this->id_rsa.' vendor '.\n\t\t\t$this->remoteUser.'@'.$this->liveServer.':'.$remotePath);\n\t}", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "public function update(Request $request, $id)\n {\n $cominfo = Vendor::find($id);\n $cominfo->name = $request->name;\n $cominfo->contact_person = $request->contact_person;\n $cominfo->contact_number = $request->contact_number;\n $cominfo->email = $request->email;\n $cominfo->website = $request->website;\n $cominfo->address = $request->address;\n $cominfo->store_id=$this->sdc->storeID();\n $cominfo->branch_id=$this->sdc->branchID();\n $cominfo->created_by=$this->sdc->UserID();\n $cominfo->save();\n // echo $this->moduleName; die();\n $this->sdc->log(\"Vendor Info\",$this->moduleName.\" Updated Successfully.\");\n return redirect('vendor')->with('status', 'Vendor Updated Successfully!');\n }", "public function update(UpdateVendorRequest $request, $id)\n {\n $this->authorize('update-contact');\n\n $vendor = \\App\\Contact::with('address_primary.state', 'address_primary.location', 'phone_primary.location', 'phone_main_fax', 'email_primary.location', 'website_main', 'notes')->findOrFail($request->input('id'));\n $vendor->organization_name = $request->input('organization_name');\n $vendor->display_name = $request->input('display_name');\n $vendor->sort_name = $request->input('sort_name');\n $vendor->save();\n\n if (empty($vendor->address_primary)) {\n $address_primary = new \\App\\Address;\n } else {\n $address_primary = \\App\\Address::findOrNew($vendor->address_primary->id);\n }\n\n $address_primary->contact_id = $vendor->id;\n $address_primary->location_type_id = config('polanco.location_type.main');\n $address_primary->is_primary = 1;\n $address_primary->street_address = $request->input('street_address');\n $address_primary->supplemental_address_1 = $request->input('supplemental_address_1');\n $address_primary->city = $request->input('city');\n $address_primary->state_province_id = $request->input('state_province_id');\n $address_primary->postal_code = $request->input('postal_code');\n $address_primary->country_id = $request->input('country_id');\n $address_primary->save();\n\n if (empty($vendor->phone_primary)) {\n $phone_primary = new \\App\\Phone;\n } else {\n $phone_primary = \\App\\Phone::findOrNew($vendor->phone_primary->id);\n }\n\n $phone_primary->contact_id = $vendor->id;\n $phone_primary->location_type_id = config('polanco.location_type.main');\n $phone_primary->is_primary = 1;\n $phone_primary->phone_type = 'Phone';\n $phone_primary->phone = $request->input('phone_main_phone');\n $phone_primary->save();\n\n if (empty($vendor->phone_main_fax)) {\n $phone_main_fax = new \\App\\Phone;\n } else {\n $phone_main_fax = \\App\\Phone::findOrNew($vendor->phone_main_fax->id);\n }\n $phone_main_fax->contact_id = $vendor->id;\n $phone_main_fax->location_type_id = config('polanco.location_type.main');\n $phone_main_fax->phone_type = 'Fax';\n $phone_main_fax->phone = $request->input('phone_main_fax');\n $phone_main_fax->save();\n\n if (empty($vendor->email_primary)) {\n $email_primary = new \\App\\Email;\n } else {\n $email_primary = \\App\\Email::findOrNew($vendor->email_primary->id);\n }\n\n $email_primary->contact_id = $vendor->id;\n $email_primary->is_primary = 1;\n $email_primary->location_type_id = config('polanco.location_type.main');\n $email_primary->email = $request->input('email_primary');\n $email_primary->save();\n\n if (null !== ($request->input('note_vendor'))) {\n $vendor_note = \\App\\Note::firstOrNew(['entity_table'=>'contact', 'entity_id'=>$vendor->id, 'subject'=>'Vendor note']);\n $vendor_note->entity_table = 'contact';\n $vendor_note->entity_id = $vendor->id;\n $vendor_note->note = $request->input('note_vendor');\n $vendor_note->subject = 'Vendor note';\n $vendor_note->save();\n }\n\n if (null !== $request->file('avatar')) {\n $description = 'Avatar for '.$vendor->organization_name;\n $attachment = new AttachmentController;\n $attachment->update_attachment($request->file('avatar'), 'contact', $vendor->id, 'avatar', $description);\n }\n\n if (null !== $request->file('attachment')) {\n $description = $request->input('attachment_description');\n $attachment = new AttachmentController;\n $attachment->update_attachment($request->file('attachment'), 'contact', $vendor->id, 'attachment', $description);\n }\n\n $url_main = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Main']);\n $url_main->contact_id = $vendor->id;\n $url_main->url = $request->input('url_main');\n $url_main->website_type = 'Main';\n $url_main->save();\n\n $url_work = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Work']);\n $url_work->contact_id = $vendor->id;\n $url_work->url = $request->input('url_work');\n $url_work->website_type = 'Work';\n $url_work->save();\n\n $url_facebook = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Facebook']);\n $url_facebook->contact_id = $vendor->id;\n $url_facebook->url = $request->input('url_facebook');\n $url_facebook->website_type = 'Facebook';\n $url_facebook->save();\n\n $url_google = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Google']);\n $url_google->contact_id = $vendor->id;\n $url_google->url = $request->input('url_google');\n $url_google->website_type = 'Google';\n $url_google->save();\n\n $url_instagram = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Instagram']);\n $url_instagram->contact_id = $vendor->id;\n $url_instagram->url = $request->input('url_instagram');\n $url_instagram->website_type = 'Instagram';\n $url_instagram->save();\n\n $url_linkedin = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'LinkedIn']);\n $url_linkedin->contact_id = $vendor->id;\n $url_linkedin->url = $request->input('url_linkedin');\n $url_linkedin->website_type = 'LinkedIn';\n $url_linkedin->save();\n\n $url_twitter = \\App\\Website::firstOrNew(['contact_id'=>$vendor->id, 'website_type'=>'Twitter']);\n $url_twitter->contact_id = $vendor->id;\n $url_twitter->url = $request->input('url_twitter');\n $url_twitter->website_type = 'Twitter';\n $url_twitter->save();\n\n return Redirect::action('VendorController@show', $vendor->id);\n }", "function admin_edit($vendor_id=null){\n\t\t\n \t\t$vendor_id = DECRYPT_DATA($vendor_id);\n\t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",EDIT_VENDOR);\n\t\tif(!empty($this->data)){\n\t\t\t$data = $this->data;\n\t\t\t$data['Vendor']['id'] = DECRYPT_DATA($data['Vendor']['id']);\n\t\t\t$errors = $this->Vendor->validate_data($data);\n\t\t\tif(count($errors) == 0){\n\t\t\t\tif($this->data['Vendor']['image']['name'] != \"\"){\n\t\t\t\t\t\n\t\t\t\t\tApp::import(\"Component\",\"Upload\");\n\t\t\t\t\t$upload = new UploadComponent();\n\t\t\t\t\t$allowed_ext = array('jpg','jpeg','gif','png','JPG','JPEG','GIF','PNG');\n\t\t\t\t\t$path_info = pathinfo($this->data['Vendor']['image']['name']);\n\t\t\t\t\t$file_extension = strtolower($path_info['extension']);\n\t\t\t\t\tif(in_array($file_extension,$allowed_ext)){\n\t\t\t\t\t\t$file = $this->data['Vendor']['image'];\n\t\t\t\t\t\t$thumb_directory_path = $this->create_directory(\"vendor_image_thumb\");\n\t\t\t\t\t\t$actual_directory_path = $this->create_directory(\"vendor_image_actual\");\n\t\t\t\t\t\t$filename = str_replace(array(\" \",\".\"),\"\",md5(microtime())).\".\".$path_info['extension'];\n\t\t\t\t\t\t$rules['type'] = 'resizecrop';\n\t\t\t\t\t\t$rules['size'] = array (75,50); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(file_exists($thumb_directory_path.$data['Vendor']['previous_image'])) {\n\t\t\t\t\t\t unlink($thumb_directory_path.$data['Vendor']['previous_image']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(file_exists($actual_directory_path.$data['Vendor']['previous_image'])) {\n\t\t\t\t\t\t unlink($actual_directory_path.$data['Vendor']['previous_image']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$file_name = $upload->upload($file,$thumb_directory_path,$filename,$rules,$allowed_ext);\n\t\t\t\t\t\t$file_name = $upload->upload($file,$actual_directory_path,$filename,null,$allowed_ext);\n\t\t\t\t\t\tif($file_name){\n\t\t\t\t\t\t\tunset($data['Vendor']['previous_image']);\n\t\t\t\t\t\t\t$data['Vendor']['image'] = $filename;\n\t\t\t\t\t\t\tif($this->Vendor->save($data)){\n\t\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_SAVE, 'message/green');\n\t\t\t\t\t\t\t\t$this->redirect(array('controller'=>\"vendors\",'action'=>'list','admin'=>true)); \n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_ERROR, 'message/red');\n\t\t\t\t\t\t\t\t$this->redirect($this->referer()); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$errors['image'][] = ERR_IMAGE_TYPE;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tunset($data['Vendor']['image']);\n\t\t\t\t\tunset($data['Vendor']['previous_image']);\n\t\t\t\t\tif($this->Vendor->save($data)){\n\t\t\t\t\t\t$this->Session->setFlash(RECORD_SAVE, 'message/green');\n\t\t\t\t\t\t$this->redirect(array(\"controller\"=>\"vendors\",\"action\"=>\"list\",\"admin\"=>true)); \n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->Session->setFlash(RECORD_ERROR, 'message/red');\n\t\t\t\t\t\t$this->redirect(array(\"controller\"=>\"vendors\",\"action\"=>\"edit\",$this->data['Vendor']['id'],\"admin\"=>true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->set(\"errors\",$errors);\n\t\t\t\n\t\t}else if(isset($vendor_id)){\n\t\t\t\n\t\t\tif($this->is_id_exist($vendor_id,\"Vendor\")){\n\t\t\t\t$this->Vendor->id = $vendor_id;\n\t\t\t\t$data = $this->Vendor->read();\n\t\t\t\t$data['Vendor']['id'] = ENCRYPT_DATA($data['Vendor']['id']);\n\t\t\t\t$this->data = $data;\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash(NOT_FOUND_ERROR, 'message/red');\n\t\t\t\t$this->redirect(array(\"controller\"=>\"products\",'action'=>'list','admin'=>true));exit();\n\t\t\t}\n\t\t}\n\t\t\n \t}", "function admin_activate_vendor($is_active = null,$cat_id = null,$model_name = null){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\t$cat_id = DECRYPT_DATA($cat_id);\n\t\tif(isset($is_active) && isset($cat_id) && isset($model_name)){\n\t\t\t\n\t\t\tif($is_active == 0){//Activate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'1'\"),array(\"$model_name.id\"=>$cat_id));\n\t\t\t $this->Session->setFlash(RECORD_ACTIVATED, 'message/green');\n\t\t\t}\n\t\t\telse if($is_active == 1){//Inactivate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'0'\"),array(\"$model_name.id\"=>$cat_id));\n\t\t\t $this->Session->setFlash(RECORD_DEACTIVATED, 'message/green');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer());exit();\t\n\t}", "public function buyerex_put($apiIdentifier): void\n {\n $vendor = $this->vendorAuthentication();\n\n if (is_null($vendor)) return;\n\n $buyerExData = Sanitize_helper::sanitizePhpInput();\n if (empty($buyerExData)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$NO_DATA_SENT);\n $this->response($response, 200);\n return;\n };\n $buyerExData = reset($buyerExData);\n\n if (!$this->checkApiIdentifier($apiIdentifier)) return;\n\n $update = $this->userex_model\n ->setProperty('userId', $this->user_model->id)\n ->setIdFromUserId()\n ->setObjectFromArray($buyerExData)\n ->update();\n\n if (!$update) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$BUYER_EX_UPDATE_FAILED);\n $this->response($response, 200);\n return;\n };\n\n $response = [\n 'status' => Connections_helper::$SUCCESS_STATUS,\n 'message' => 'Buyer extended updated'\n ];\n $this->response($response, 200);\n return;\n }", "public function setVendorInformation(?SecurityVendorInformation $value): void {\n $this->getBackingStore()->set('vendorInformation', $value);\n }", "function update()\n {\n $fkey = $this->input->post('fkey', TRUE);\n $fpass = $this->input->post('fpass', TRUE);\n $fname = $this->input->post('fname', TRUE);\n $femail = $this->input->post('femail', TRUE);\n\n $dataInfo = array('fkey'=>$fkey, 'fpass'=>$fpass, 'fname'=>$fname, 'femail'=>$femail);\n \n $rs_data = send_curl($this->security->xss_clean($dataInfo), $this->config->item('api_edit_account'), 'POST', FALSE);\n\n if($rs_data->status)\n {\n $this->session->set_userdata('vendorName', $fname);\n $this->session->set_flashdata('success', $rs_data->message);\n redirect('my-account');\n }\n else\n {\n $this->session->set_flashdata('error', $rs_data->message);\n redirect('my-account');\n }\n }", "function wpec_authsim_plugin_updater() {\n\t\t$license = get_option( 'wpec_product_'. WPEC_AUTHSIM_PRODUCT_ID .'_license_active' );\n\t\t$key = ! $license ? '' : $license->license_key;\n\t\t// setup the updater\n\t\t$wpec_updater = new WPEC_Product_Licensing_Updater( 'https://wpecommerce.org', __FILE__, array(\n\t\t\t\t'version' \t=> WPEC_AUTHSIM_VERSION, \t\t\t\t// current version number\n\t\t\t\t'license' \t=> $key, \t\t// license key (used get_option above to retrieve from DB)\n\t\t\t\t'item_id' \t=> WPEC_AUTHSIM_PRODUCT_ID \t// id of this plugin\n\t\t\t)\n\t\t);\n\t}", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function render_field_vendor() {\n\t\t$value = $this->get_setting( 'vendor', '' );\n\t\t?>\n\t\t<p>\n\t\t\t<input type=\"text\" name=\"satispress[vendor]\" id=\"satispress-vendor\" value=\"<?php echo esc_attr( $value ); ?>\"><br>\n\t\t\t<span class=\"description\">Default is <code>satispress</code></span>\n\t\t</p>\n\t\t<?php\n\t}", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "function admin_delete_vendor($vendor_id = null){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\t$vendor_id = DECRYPT_DATA($vendor_id);\n\t\tif(isset($vendor_id)){\n\t\t\t$this->Vendor->updateAll(array(\"Vendor.is_deleted\"=>\"'1'\"),array(\"Vendor.id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t$this->Product = new Product();\n\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t$this->Coupon = new Coupon();\n\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$vendor_id));\n\t\t\t$this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t}\n\t\t$this->redirect($this->referer());exit();\t\n\t}", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function update_userdetails($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $userId = Yii::$app->user->id;\n\n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_name' => $name,'company_name' => $company_name,'company_address' => $address,'designation' => $designation,'company_email' => $company_email], 'user_id = \"'.$userId.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "protected function afterSave() {\n Users::updateUserVendorPurchaser($this);\n return parent::afterSave();\n }", "public function getVendorName(): string;", "function UpdateUser() {\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_TYPE] = $this->reseller->getUserType();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USERNAME] = $this->reseller->getUserLoginName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EMAIL_ID] = $this->reseller->getEmailId();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CONTACT_NO] = $this->reseller->getMobileNo();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_FULL_NAME] = $this->reseller->getFullName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ADDRESS] = $this->reseller->getAddress();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CITY] = $this->reseller->getCity();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_REGION] = $this->reseller->getRegion();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_COUNTRY] = $this->reseller->getCountry();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DOMAIN_NAME] = $this->reseller->getDomainName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EXPIRY_DATE] = $this->reseller->getExpiryDate();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ENABLE_CMS] = $this->reseller->getEnableCMS();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_STATUS] = $this->reseller->getUserStatus();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_NEWPASSWORD] = $this->reseller->getNewPassword();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DLT_ENTITY_ID] = $this->reseller->getDltEntityId();\n $response = new sgc_callapi(sgc_constant::SGC_API, sgc_constant::SGC_ENDPOINT_RESELLER_UPDATE_USER, $this->data, $this->header, sgc_common_api_params::API_COMMON_METHOD_POST, $this->useRestApi);\n\t\t\treturn $response->getResponse();\n\t\t}", "public function update(UserVO $userVO){\r\n }", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "protected function approveExistProduct(\n \\Magento\\Catalog\\Model\\Product $product,\n \\Vnecoms\\Vendors\\Model\\Vendor $vendor\n ) {\n $updateCollection = $this->_objectManager->create('Vnecoms\\VendorsProduct\\Model\\ResourceModel\\Product\\Update\\Collection');\n $updateCollection->addFieldToFilter('product_id', $product->getId())\n ->addFieldToFilter('status', ProductUpdate::STATUS_PENDING);\n \n foreach ($updateCollection as $update) {\n $productData = unserialize($update->getProductData());\n $checkIsCategories = false;\n foreach ($productData as $attributeCode => $value) {\n $product->setData($attributeCode, $value);\n if($attributeCode == \"category_ids\"){\n $checkIsCategories = true;\n }\n }\n $update->setStatus(ProductUpdate::STATUS_APPROVED)->setId($update->getUpdateId())->save();\n $product->setStoreId($update->getStoreId())->save();\n\n if($checkIsCategories){\n $this->getCategoryLinkManagement()->assignProductToCategories(\n $product->getSku(),\n $product->getCategoryIds()\n );\n }\n }\n /*Send update product notification email*/\n $this->productHelper->sendUpdateProductApprovedEmailToVendor($product, $vendor, $updateCollection);\n }", "public function update()\n {\n echo uniqid('km-');\n // $data = $this->Users_model->get_all();\n // foreach ($data as $datas) {\n // $d['users_id'] = uniqid('km-');\n // $this->Users_model->update_users($datas->users_email, $d);\n // }\n }", "public function update($user)\n {\n }", "public static function createZohoVendor(Users $user): void\n {\n $zohoClient = Di::getDefault()->get('zoho');\n $zohoClient->setModule('Vendors');\n\n //Assign rotation user here\n $defaultRotation = '[email protected]';\n $owner = null;\n if (RotationsOperations::leadOwnerExists($defaultRotation, 7)) {\n $owners = RotationsOperations::getAllAgents($defaultRotation, 7);\n $owner = RotationsOperations::getAgent($defaultRotation, $owners);\n }\n // Creating vendor using values XML data received\n $vendor = new Vendor();\n $vendor->Vendor_Name = $user->firstname . ' ' . $user->lastname;\n $vendor->VENDORCF3 = $user->profile_image;\n $vendor->Phone = $user->phone_number;\n $vendor->Email = $user->email;\n $vendor->BFA = 'TRUE';\n $vendor->Account_Type = 'Executive';\n $vendor->Member_Number = $user->getId();\n $vendor->Sponsor = '';\n $vendor->City = '';\n $vendor->State = '';\n $vendor->Zip_Code = '';\n $vendor->Street = ' ';\n $vendor->Website = '';\n $vendor->BFS_Email = isset($owner) ? $owner->email : '[email protected]';\n $vendor->Company = Companies::getDefaultByUser($user)->name;\n $vendor->BFS_Phone = $user->phone_number;\n $vendor->Original_AAM = '[email protected]';\n $vendor->Office = 'East Coast';\n $vendor->Vendor_Owner = isset($owner) ? $owner->email : '[email protected]';\n\n\n // Valid XML to zoho\n $validXML = $zohoClient->mapEntity($vendor);\n $response = $zohoClient->insertRecords($validXML, ['wfTrigger' => 'true']);\n Di::getDefault()->get('log')->info(json_encode($response->getRecords()));\n }", "public function update(User $user, Goods $goods)\n {\n //\n }", "function cmst_vendor_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"mst_vendor\"] = new cmst_vendor();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'mst_vendor', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "public function updateUser(array $config = []);", "public function voxy_update_user_info()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n if(isset($data['feature_group']) && $data['feature_group'] != ''){\n $api_data = $this->m_voxy_connect->add_user_to_feature_group($data['external_user_id'], $data['feature_group']);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n return $this->ajax_response();\n }\n }\n\n $api_data = $this->m_voxy_connect->update_profile_of_one_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Cập nhật thông tin người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "public function update(){\n\t\t\t$record = $this->modelGetrenter_user();\n\t\t\tinclude \"Views/AccountUpdateView.php\";\n\t\t}", "public function updateContribBoOnlyUser($userId,$uarr){\n //echo \"<pre>\";print_r($conarray);exit;\n /* user table update */\n $this->_name = \"User\";\n $where2 = \" identifier='\" . $userId . \"' \";\n $result = $this->updateQuery($uarr, $where2);\n if($result === '1')\n return true;\n else\n return fasle;\n }", "public function update(Request $request, $id_Vendor)\n {\n $request->validate([\n 'nama_vendor' => 'required|min:2',\n 'keterangan_vendor' =>'required',\n ]);\n\n $vendorvoyage = Vendorvoyage::where('id_Vendor','=',$id_Vendor);\n $vendorvoyage->update($request -> except('_method','_token'));\n return redirect(\"/vendor-voyage\");\n }", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function update($UUID,$UserID,$Type,$Application,$AdminName) {\n try {\n $this->validateAccountParams($UserID, $Type, $Application, $UUID);\n $this->accountGateway->update($UUID,$UserID, $Type, $Application, $AdminName);\n } catch (ValidationException $exc) {\n throw $exc;\n } catch (PDOException $e){\n throw $e;\n }\n }", "public function testUpdateBrandUsingPUT()\n {\n }", "public function vendor_save($data_vendor = array()) \n {\n $query = $this->db->insert($this->vendor,$data_vendor);\n if($query)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function updateUser($celestaid,$paid_amount,$ev_id,$user_data){\n $events_registered=json_decode($user_data[\"events_registered\"]);\n $email=$user_data[\"email\"];\n $events_charge=$user_data[\"events_charge\"];\n $amount_paid=$user_data[\"amount_paid\"];\n $events_charge+=$paid_amount;\n $amount_paid+=$paid_amount;\n\n $events=array();\n foreach($events_registered as $event){\n\t\t\t$evs_id=$event->ev_id;\n\t\t\t$amount=$event ->amount;\n\t\t\t$ev_name=$event ->ev_name;\n\t\t\t$team_name=$event ->team_name;\n\t\t\t$cap_name=$event ->cap_name;\n\n $add_event=array();\n $add_event[\"ev_id\"]=$evs_id;\n $add_event[\"ev_name\"]=$ev_name;\n \n if(!empty($team_name)){\n $add_event[\"team_name\"]=$team_name;\n $add_event[\"cap_name\"]=$cap_name;\n }\n\n if($evs_id==$ev_id){\n $add_event[\"amount\"]=$paid_amount;\n }else{\n $add_event[\"amount\"]=$amount;\n }\n $events[]=$add_event;\n }\n $events=json_encode($events);\n $sql=\"UPDATE users set events_registered='$events', events_charge=$events_charge, amount_paid=$amount_paid WHERE celestaid='$celestaid'\";\n $result=query($sql);\n\n confirm($result);\n }", "public function addVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->addVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "public function vendor_accept_order($info)\n {\n $this->load->model('bitcoin_model');\n $this->load->model('bip32_model');\n $this->load->model('accounts_model');\n\n if ($info['initiating_user'] == 'buyer') {\n // Buyer public key is in $info.buyerpubkey array, also ID in update fields.\n\n $buyer_public_key = $info['buyer_public_key'];\n $this->update_order($info['order']['id'], $info['update_fields']);\n foreach ($info['update_fields'] as $key => $field) {\n $info['order'][$key] = $field;\n }\n $info['update_fields'] = array();\n } else {\n $buyer_public_key = $info['order']['public_keys']['buyer'];\n }\n\n // Add vendors public key no matter what we're doing!\n $vendor_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => $info['order']['vendor']['id'],\n 'user_role' => 'Vendor',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $info['vendor_public_key']['parent_extended_public_key'],\n 'provider' => $info['vendor_public_key']['provider'],\n 'extended_public_key' => $info['vendor_public_key']['extended_public_key'],\n 'public_key' => $info['vendor_public_key']['public_key'],\n 'key_index' => $info['vendor_public_key']['key_index']\n ));\n\n // Get vendors public key, stored by that function.\n $admin_public_key = $this->bip32_model->get_next_admin_child();\n\n if ($admin_public_key == FALSE) {\n return 'An error occured, which prevented your order being created. Please notify an administrator.';\n } else {\n $admin_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => '0',\n 'user_role' => 'Admin',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $admin_public_key['parent_extended_public_key'],\n 'provider' => 'Manual',\n 'extended_public_key' => $admin_public_key['extended_public_key'],\n 'public_key' => $admin_public_key['public_key'],\n 'key_index' => $admin_public_key['key_index']\n ));\n $public_keys = array($buyer_public_key['public_key'], $vendor_public_key['public_key'], $admin_public_key['public_key']);\n $sorted_keys = RawTransaction::sort_multisig_keys($public_keys);\n $multisig_details = RawTransaction::create_multisig('2', $sorted_keys);\n\n // If no errors, we're good to create the order!\n if ($multisig_details !== FALSE) {\n $this->bitcoin_model->log_key_usage('order', $this->bw_config->bip32_mpk, $admin_public_key['key_index'], $admin_public_key['public_key'], $info['order']['id']);\n\n $info['update_fields']['vendor_public_key'] = $vendor_public_key['id'];\n $info['update_fields']['admin_public_key'] = $admin_public_key['id'];\n $info['update_fields']['buyer_public_key'] = $buyer_public_key['id'];\n $info['update_fields']['address'] = $multisig_details['address'];\n $info['update_fields']['redeemScript'] = $multisig_details['redeemScript'];\n $info['update_fields']['selected_payment_type_time'] = time();\n $info['update_fields']['progress'] = 2;\n $info['update_fields']['time'] = time();\n\n if ($info['order_type'] == 'escrow') {\n $info['update_fields']['vendor_selected_escrow'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->escrow_rate);\n } else {\n $info['update_fields']['vendor_selected_escrow'] = '0';\n $info['update_fields']['vendor_selected_upfront'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->upfront_rate);\n }\n\n if ($this->update_order($info['order']['id'], $info['update_fields']) == TRUE) {\n $this->bitcoin_model->add_watch_address($multisig_details['address'], 'order');\n\n $subject = 'Confirmed Order #' . $info['order']['id'];\n $message = \"Your order with {$info['order']['vendor']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow payment was chosen. Once you pay to the address, the vendor will ship the goods. You can raise a dispute if you have any issues.\" : \"You must make payment up-front to complete this order. Once the full amount is sent to the address, you must sign a transaction paying the vendor.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['buyer']['user_name'], $subject, $message);\n\n $subject = 'New Order #' . $info['order']['id'];\n $message = \"A new order from {$info['order']['buyer']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow was chosen for this order. Once paid, you will be asked to sign the transaction to indicate the goods have been dispatched.\" : \"Up-front payment was chosen for this order based on your settings for one of the items. The buyer will be asked to sign the transaction paying you immediately after payment, which you can sign and broadcast to mark the order as dispatched.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['vendor']['user_name'], $subject, $message);\n\n $msg = ($info['initiating_user'] == 'buyer')\n ? 'This order has been automatically accepted, visit the orders page to see the payment address!'\n : 'You have accepted this order! Visit the orders page to see the monero address!';\n $this->current_user->set_return_message($msg, 'success');\n return TRUE;\n } else {\n return 'There was an error creating your order.';\n }\n } else {\n return 'Unable to create address.';\n }\n }\n }", "public function update_userdetails_by_admin($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n \n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_name' => $name,'company_name' => $company_name,'company_address' => $address,'designation' => $designation,'company_email' => $company_email], 'user_id = \"'.$userid.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "function _approveNewVendor(){\n \n $this->ci->load->library('form_validation');\n $person_id = $this->ci->session->userdata('user_id');\n \n $this->resetResponse();\n\n $this->ci->form_validation->set_rules('personId', 'Vendor Person Id', 'trim|required|xss_clean|encode_php_tags|integer', array('required' => 'You must provide a %s.'));\n\n if ($this->ci->form_validation->run() == FALSE) { \n $this->_status = false;\n $this->_message = $this->ci->lang->line('person_id_missing');\n return $this->getResponse();\n } else {\n\n $personId = $this->ci->input->post('personId', true);\n $result = $this->model->get_tb('mm_person', 'person_id', array('person_id' => $personId))->result();\n if (count($result) > 0) {\n $this->model->update_tb('mm_person', array('person_id' => $personId), array('person_status'=>1));\n \n if( $this->model->getAffectedRowCount() > 0 ) {\n $this->_status = true;\n $this->_message = $this->ci->lang->line('vendor_approved'); \n }\n } else {\n $this->_status = FALSE;\n $this->_message = $this->ci->lang->line('invalid_data'); \n \n }\n\n return $this->getResponse();\n }\n \n }", "public function update(Request $req)\n {\n $req->validate([\n 'driverId' => 'required',\n 'name' => 'required|max:200|string',\n \"phone\" => 'required|numeric',\n \"pan_no\" => 'required',\n \"aadhar_no\" => 'required',\n \"driving_license\" => 'required',\n \"driver_image\" => 'mimes:jpg,jpeg,png,svg,gif',\n \"fb_profile\" => 'string',\n \"ig_profile\" => 'string',\n \"twitter_profile\" => 'string'\n ]);\n \n $user = User::find(base64_decode($req->driverId));\n $user->name = $req->name;\n if($user->email != $req->email) {\n $req->validate([\n 'email' => 'required|email|unique:users',\n ]);\n $user->email = $req->email;\n }\n $user->mobile = $req->phone;\n if($req->password != '') {\n $req->validate([\n \"password\" => 'min:6|confirmed',\n ]);\n $user->password = Hash::make($req->password);\n }\n if($req->hasFile('driver_image')){\n $driverImage = $req->file('driver_image');\n $random = randomGenerator();\n $driverImage->move('upload/drivers/',$random.'.'.$driverImage->getClientOriginalExtension());\n $driverImageurl = 'upload/drivers/'.$random.'.'.$driverImage->getClientOriginalExtension();\n $user->image = $driverImageurl;\n }\n $user->save();\n\n $driver = DriverDetail::where('user_id', base64_decode($req->driverId))->first();\n if (auth()->user()->user_type === 1) {\n $req->validate([\n \"vendor_id\" => 'required|numeric',\n ]);\n $driver->vendor_id = $req->vendor_id;\n }\n $driver->pan_no = $req->pan_no;\n $driver->aadhar_no = $req->aadhar_no;\n $driver->driving_license = $req->driving_license;\n $driver->fb_profile = $req->fb_profile;\n $driver->ig_profile = $req->ig_profile;\n $driver->twitter_profile = $req->twitter_profile;\n $driver->save();\n\n return redirect()->route('admin.driver.list')\n ->with('Success','Driver edited SuccessFully');\n }", "public function insert($vendor);", "function _update_user()\n {\n //pr_db($post_total);\n $tbl = 'user';\n $list = model($tbl)->get_list();\n foreach ($list as $row) {\n $post_total = model('product')->filter_get_total(['user_id' => $row->id]);\n $post_is_publish = model('product')->filter_get_total(['user_id' => $row->id, 'status' => 1]);\n $post_is_draft = model('product')->filter_get_total(['user_id' => $row->id, 'is_draft' => 1]);\n $post_is_deleted = model('product')->filter_get_total(['user_id' => $row->id, 'deleted' => 1]);\n\n $follow_total = model('user_storage')->filter_get_total(['user_id' => $row->id,'action'=>'subscribe']);\n $follow_by_total = model('user_storage')->filter_get_total(['table_id' => $row->id,'action'=>'subscribe']);\n model($tbl)->update($row->id,\n [\n 'post_total' => $post_total,\n 'post_is_publish' => $post_is_publish,\n 'post_is_draft' => $post_is_draft,\n 'post_is_deleted' => $post_is_deleted,\n\n 'follow_total' => $follow_total,\n 'follow_by_total' => $follow_by_total,\n ]\n );\n echo '<br>--';\n pr_db(0, 0);\n }\n }", "public function updatedevice($token ,$email)\n{\n\n\n$query = mysql_query(\"UPDATE `user` SET `device_id` = '$token' WHERE `email` = '$email' \");\nif($query){\n\n return 1;\n}else \n\nreturn 0;\n\n\n}", "public function update_put()\n {\n $response = $this->UserM->update_user(\n $this->put('id'),\n $this->put('email'),\n $this->put('nama'),\n $this->put('nohp'),\n $this->put('pekerjaan')\n );\n $this->response($response);\n }", "public function run()\n {\n User::whereNull('vendor_id')->get()->each(function($user) {\n \t$user->vendor_id = factory(Vendor::class)->create()->id;\n \t$user->save();\n });\n }", "public static function update_user_meta( $user_id ) {\n\t\tif ( $user_id && self::$data['vat_number'] ) {\n\t\t\tupdate_user_meta( $user_id, 'vat_number', self::$data['vat_number'] );\n\t\t}\n\t}", "public function update(User $user, Bid $bid)\n {\n //\n }", "public static function getvendorData()\n {\n\n $value=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get(); \n return $value;\n\t\n }", "public static function set_vendor_commission_paid( $vendors )\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\n\t\tif ( is_array( $vendors ) )\n\t\t\t$vendors = implode( ',', $vendors );\n\n\t\t$query = \"UPDATE `{$table_name}` SET `status` = 'paid' WHERE vendor_id IN ($vendors)\";\n\t\t$result = $wpdb->query( $query );\n\n\t\treturn $result;\n\t}", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function update(User $user): void\n {\n }", "public function buyer_put($apiIdentifier): void\n {\n $vendor = $this->vendorAuthentication();\n\n if (is_null($vendor)) return;\n if (!$this->checkApiIdentifier($apiIdentifier)) return;\n\n $buyerData = Sanitize_helper::sanitizePhpInput();\n\n if (!$this->checkPutBuyerData($buyerData)) return;\n\n $updateBuyer = [];\n if (!$this->setUpdateBuyerData($buyerData, $updateBuyer)) return;\n\n if (!$this->user_model->apiUpdateUser($updateBuyer)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$BUYER_UPDATE_FAILED);\n $this->response($response, 200);\n return;\n };\n\n $response = [\n 'status' => Connections_helper::$SUCCESS_STATUS,\n 'message' => 'Buyer updated'\n ];\n $this->response($response, 200);\n return;\n }", "public function update(UpdateDhaagaClothingVendor $request, $id)\n {\n $validatedData = $request->validated();\n\n $findData = DhaagaClothingVendor::find($id);\n\n $findData->dhaaga_clothing_vendor_id = IdGenerator::generate(['table' => 'dhaaga_clothing_vendors', 'length' => 13, 'field' => 'dhaaga_clothing_vendor_id', 'prefix' => 'VNDR-']);;\n $findData->vendor_type = $validatedData['vendor_type'];\n $findData->vendor_name = $validatedData['vendor_name'];\n $findData->purchased_products = $validatedData['product_purchased'];\n\n $findData->phoneNo = $validatedData['phoneNo'];\n $findData->address = $validatedData['address'];\n\n $findData->status = '1';\n $findData->created_by = Auth::id();\n\n\n if ($findData->save()) {\n return response()->json(['status'=>'true' , 'message' => 'vendor data updated successfully'] , 200);\n }else{\n return response()->json(['status'=>'errorr' , 'message' => 'error occured please try again'] , 200);\n }\n }", "public function edit(Vendor $vendor)\n {\n $page_title = str_replace(['.','edit'],'', ucfirst(Route::currentRouteName()));\n $page_action = str_replace('.',' ', ucfirst(Route::currentRouteName()));\n\n $role_id = $vendor->role_type;\n $roles = config('role');\n $user = Helper::getUser($vendor->user_id);\n $vendor->first_name = $user->first_name??'';\n $vendor->last_name = $user->last_name??'';\n \n return view($this->editUrl, compact( 'role_id', 'roles', 'vendor', 'page_title', 'page_action'));\n }", "public function doTeamUpgrade(Request $request)\n {\n // return the stripe API key\n \\Stripe\\Stripe::setApiKey(env('STRIPE_TOKEN'));\n\n // validate the domain\n $domain = strstr($this->user->email,'@');\n $tld = strrpos($domain, '.');\n // strip the tld\n $domain = substr($domain, 0, $tld);\n // strip the @ symbol\n $domain = substr($domain, 1, 50);\n\n // add them to the customers table\n $customer = new Customer;\n $customer->owner_id = $this->user->id;\n $customer->company_name = $request->company_name;\n $customer->domain = $domain;\n $customer->total_users = $request->user_count;\n $customer->users_left = $request->user_count;\n $customer->created_at = time();\n $customer->save();\n\n // update the information in stripe\n // make a new customer if this is their first time upgrading\n if(!$this->user->stripe_id)\n {\n // Use Stripe's library to make requests...\n $customer = \\Stripe\\Customer::create(array(\n 'source' => $request->stripe_token,\n 'plan' => 'paid',\n 'email' => $this->user->email,\n 'quantity' => $request->user_count\n ));\n\n // set their stripe id and their payment settings\n $this->user->stripe_id = $customer->id;\n $this->user->status = 'paying';\n $this->user->admin = 'yes';\n $this->user->expires = null; // in case they reupgrade before their subscription exprires\n $this->user->save();\n }\n else\n {\n // return their existing stripe key and handle the 'resignup' if that's the case based on an expiration\n $customer = \\Stripe\\Customer::retrieve($this->user->stripe_id);\n $customer->subscriptions->create(array('plan' => 'paid','quantity' => $request->user_count));\n\n // update their info in the db\n $this->user->status = 'paying';\n $this->user->admin = 'yes';\n $this->user->expires = null; // in case they reupgrade before their subscription exprires\n $this->user->save();\n }\n\n // send them a confirmation email\n $subject = 'Mailsy team successfully created';\n $body = 'You\\'ve successfully created a team on Mailsy! You have purchased '.$request->user_count.' licenses and your team can signup to use these licenses at '.env('DOMAIN').'/join/'.$domain.'.';\n\n Utils::sendEmail($this->user->email,$subject,$body);\n\n // send them back to the settings page\n return redirect('/settings?message=teamCreated');\n }", "public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }" ]
[ "0.77089745", "0.678249", "0.6584451", "0.6425409", "0.6245101", "0.62318724", "0.62134546", "0.6159758", "0.6158834", "0.6122324", "0.6108975", "0.60946953", "0.602808", "0.59663606", "0.59483075", "0.59092873", "0.59023994", "0.58952296", "0.5860157", "0.5858423", "0.58498704", "0.5802578", "0.57960314", "0.5784667", "0.5781054", "0.5780597", "0.5769366", "0.5750897", "0.57450724", "0.57340425", "0.57213175", "0.5713901", "0.5710449", "0.5680275", "0.5677245", "0.56683207", "0.56457585", "0.56169534", "0.5615917", "0.5597585", "0.5596216", "0.55929047", "0.55903155", "0.5585997", "0.5558321", "0.5554811", "0.5546387", "0.5541831", "0.5539177", "0.5535916", "0.55304605", "0.552239", "0.55169326", "0.55146873", "0.5513156", "0.5512851", "0.5501083", "0.54837686", "0.5483749", "0.5474594", "0.54717433", "0.54620695", "0.54427344", "0.5438312", "0.5430797", "0.5427764", "0.5427282", "0.54257435", "0.54166716", "0.5409076", "0.5408832", "0.54078805", "0.54062706", "0.540353", "0.5397712", "0.53884214", "0.538618", "0.53775376", "0.5372281", "0.536563", "0.5365561", "0.53574395", "0.5355902", "0.5348782", "0.53470784", "0.5343377", "0.5342543", "0.5340831", "0.53341395", "0.5334012", "0.5324152", "0.532242", "0.53221565", "0.532113", "0.53148806", "0.53105354", "0.53072345", "0.5305848", "0.5304454", "0.5304071" ]
0.713382
1
/ Delete user vendor
public function deleteVendor() { try { if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(" Vendor Entity not initialized"); } else { $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor(); $objVendor->vendor = $this->vendor; return $objVendor->deleteVendor(); } } catch (Exception $ex) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($vendor_id);", "public function destroy(User $vendor)\n {\n if($vendor->delete()) \n {\n flash('You have successfully deleted a vendor.')->success();\n return redirect()->route('vendors_index');\n }\n }", "function admin_delete_vendor($vendor_id = null){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\t$vendor_id = DECRYPT_DATA($vendor_id);\n\t\tif(isset($vendor_id)){\n\t\t\t$this->Vendor->updateAll(array(\"Vendor.is_deleted\"=>\"'1'\"),array(\"Vendor.id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t$this->Product = new Product();\n\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$vendor_id));\n\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t$this->Coupon = new Coupon();\n\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$vendor_id));\n\t\t\t$this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t}\n\t\t$this->redirect($this->referer());exit();\t\n\t}", "public function delete_user() {\n $query = 'DELETE FROM ' . $this->table_name . ' WHERE vendor_id = :vendor_id';\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean data\n\n // Bind data\n $stmt->bindParam(':vendor_id', $this->vendor_id);\n\n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n //Error $stmt->error;\n return false;\n }", "public function delete_user($user);", "public function destroy(){\n $query = 'delete from Usuario where\n user_id = \"'.$this->getUser_id().'\"';\n $this->driver->exec($query);\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public function deleting(Vendor $vendor)\n {\n $vendor->deleted_by = Auth::User()->id;\n\n //services\n foreach ($vendor->services()->get() as $service) {\n $service->vendor_id = null;\n $service->save();\n }\n\n //comments\n $vendor->comments()->each(function ($item) {\n $item->delete();\n });\n\n }", "public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }", "function delete()\n {\n if($this->isManager() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $id = $this->input->post('userId');\n $userInfo = array('isDeleted'=> 1,'updatedBy'=>$this->vendorId, 'field' => $id,'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->model->deleteUser($id);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE, 'id' => $id))); }\n else { echo(json_encode(array('status'=>FALSE, 'id' => $id))); }\n }\n }", "public function delete(User $user, SystemUnit $systemUnit)\n {\n //\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function destroy($vendor_id)\n {\n //$this->authorize('destroy', $task);\n\n //$task->delete();\n\n Vendor::destory($vendor_id);\n\n return redirect('/vendors');\n }", "public function delete($user){\n }", "function system_delete_user($uid)\n{\n}", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function userDeleted();", "public function delete($user)\n {\n\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete()\n {\n $this->getMasterApiClient()->deleteSubUser($this->getSubAccountUsername());\n LaravelLog::info('Sub account deleted: ' . $this->getSubAccountUsername());\n parent::delete();\n }", "public function deleteUser()\n {\n $userId = $this->input->post('userId');\n $userInfo = array('isDeleted' => 1, 'updatedBy' => $this->vendorId, 'updatedDtm' => date('Y-m-d H:i:sa'));\n\n $result = $this->user_model->deleteUser($userId, $userInfo);\n\n if ($result > 0) {\n echo (json_encode(array('status' => true)));\n } else {\n echo (json_encode(array('status' => false)));\n }\n }", "function deleteUser($username)\r\n {\r\n $this->querySimpleExecute('delete from t_user where useUsername = ' . $username);\r\n }", "public function delete(User $user)\n {\n //\n }", "public static function delete(Users $user)\n {\n $email=$user->Email;\n DB::delete(\"user\",\"Email='$email' AND IsDeleted=0\");\n \n //$conn->close();\n header('location: DeleteUser.php');\n\n }", "public function destroy($id)\n {\n $user = User::findOrFail($id);\n $user->company()->dissociate()->save();\n $user->delete();\n \n Auth::user()->subscription('main')->decrementQuantity();\n\n flash('You have deleted the user. We have updated your billing to reflect the change.', 'success');\n return redirect()->route('users.index');\n }", "public function actionUserdelete()\n {\n $timeLimit = time() - 0;\n $deactivateRequests = DeactivateAccount::find()->where(['processingDate' => null])->andWhere('creationDate < '.$timeLimit)->all();\n\n foreach ($deactivateRequests as $request)\n {\n $user = $request->user;\n\n if ($user->last_login <= $request->creationDate+3)\n {\n $user->setScenario('status');\n $user->status = User::STATUS_DELETED;\n $user->save();\n\n Campaign::updateAll(['status' => Campaign::STATUS_DELETED], 'userId = :userId', [':userId' => $user->id]);\n }\n\n $request->setScenario('processing');\n $request->processingDate = time();\n $request->save();\n }\n }", "public function delete_user()\n {\n \n $user_id = $this->uri->segment(4);\n\t //dump($user_id);\n\t \n\t $query = $this->Product_model->delete_user($user_id);\n\t if($query){\n\t\t \n\t\t redirect('admin/Dashboard/users'); \n\t\t \n\t\t}else{\n\t\t\t\n\t\t\t echo 'error'; \n\t\t\t}\n\t\n }", "public function destroy($id=null) {\n Vendor::where('id',$id)->delete();\n return redirect()->route('vendors.index')\n ->with('success','Vendor deleted successfully');\n }", "public function destroy($id)\n {\n //\n // $this->authorize('isAdmin'); \n\n $user = Brand::findOrFail($id);\n $user->delete();\n // return['message' => 'user deleted'];\n\n }", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function destroy(User $user)\n {\n //TODO: montar excluir usuário\n }", "public function delete($username)\n {\n }", "public function destroy() {\n $user = auth('api')->user();\n if (!$user) return errorResponse('Unauthorized', 401);\n\n $user->is_removed = 1;\n $user->name = \"[User Removed]\";\n $user->save();\n\n $company = Company::find($user->company->id);;\n if ($user->company) $company->delete();\n\n auth('api')->invalidate();\n auth('api')->logout();\n\n\n return response()->json([\n 'status' => 'success',\n 'message' => \"user removed\"\n ], 200);\n }", "public function destroy(Vendor $vendor)\n {\n $vendor->delete();\n\n session()->flash('message:success', 'Vendor deleted');\n return redirect(route('admin.vendor.index'));\n }", "function wpmu_delete_user($id)\n {\n }", "public function deleteUser($userId);", "public function destroy($id_Vendor)\n {\n $vendorvoyage = Vendorvoyage::where('id_Vendor','=',$id_Vendor);\n $vendorvoyage->delete();\n return redirect(\"/vendor-voyage\");\n }", "public function deleteVendor($id)\n {\n $ven = MasterVendor::findOrFail($id);\n $ven->delete();\n\n if ($ven) {\n return response()->json([\n 'success' => true,\n 'message' => 'Menu Berhasil Dihapus!',\n ], 200);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'Menu Gagal Dihapus!',\n ], 400);\n }\n }", "public function delete(User $user, InterventionRequest $interventionRequest)\n {\n //\n }", "public function destroy(User $user)\n {\n\n }", "public function destroy(User $model);", "protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }", "protected function _destroyUser($username) {}", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function deleteUser($email) {\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$id = (int) $this->searchUser($email);\r\n\t\tif ($id != FALSE) {\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`user_credentials` WHERE `user_credentials`.`id`=$id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`user_profile` WHERE `user_profile`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`track` WHERE `track`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_activity` WHERE `bmk_activity`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_entry` WHERE `bmk_entry`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_activity` WHERE `bmk_activity`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t}\r\n\t\t$sqlObj->destroy();\r\n\t}", "function d4os_io_db_070_os_user_delete($uuid) {\n // TODO : delete all assets (impossible ?)\n // TODO : delete groups\n\n // delete offline messages\n drupal_set_message(t('Deleting offline messages.'));\n d4os_io_db_070_offline_message_user_delete($uuid);\n/*\n // delete search\n drupal_set_message(t('Deleting search info.'));\n d4os_io_db_070_os_search_user_delete($uuid);\n*/\n // delete profile\n drupal_set_message(t('Deleting profile info.'));\n d4os_io_db_070_os_profile_user_delete($uuid);\n\n // delete attachments and inventory\n drupal_set_message(t('Deleting inventory.'));\n d4os_io_db_070_os_inventory_user_delete($uuid);\n\n // delete sessions\n drupal_set_message(t('Deleting sessions.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {Presence} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n/*\n // delete friends\n drupal_set_message(t('Deleting friends.'));\n d4os_io_db_070_set_active('os_users');\n db_query(\"DELETE FROM {userfriends} WHERE ownerID='%s' OR friendID = '%s'\", array($uuid, $uuid));\n d4os_io_db_070_set_active('default');\n*/\n // delete user entry in the grid\n drupal_set_message(t('Deleting user.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {UserAccounts} WHERE PrincipalID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {auth} WHERE UUID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {GridUser} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n\n // delete the user drupal link \n db_query(\"DELETE FROM {d4os_ui_users} WHERE UUID='%s'\", $uuid);\n}", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n \n }", "public function deleteUser(request $request){\n \n $afi = User::find($request->id);\n $afi->delete();\n \n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "function ec_delete_user($cid) {\n global $customer_id, $customers_default_address_id, $customer_first_name, $customer_country_id, $customer_zone_id, $comments;\n tep_session_unregister('customer_id');\n tep_session_unregister('customer_default_address_id');\n tep_session_unregister('customer_first_name');\n tep_session_unregister('customer_country_id');\n tep_session_unregister('customer_zone_id');\n tep_session_unregister('comments');\n\n tep_db_query(\"delete from \" . TABLE_ADDRESS_BOOK . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_INFO . \" where customers_info_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_WHOS_ONLINE . \" where customer_id = '\" . (int)$cid . \"'\");\n }", "function dev_delete($cmd_list) {\r\n\tglobal $gResult;\r\n\t$msg;\r\n\t$devName = search_cmdOpt($cmd_list, 'n');\r\n\tif ($devName == \"\") {\r\n\t\t$msg = \"couldn't delete a developer without the name\";\r\n\t} else {\r\n\t\t$dev_controller = new Developer_Controller(new Developer);\r\n\t\t$msg = $dev_controller->delete($devName);\r\n\t}\r\n\t$gResult = $gResult.$msg;\r\n\treturn cCmdStatus_OK; \r\n}", "public function delete(User $user, Servicos $servicos)\n {\n //\n }", "public function userDeleted()\n\t{\n\t\tself::authenticate();\n\n\t\t$userId = FormUtil::getPassedValue('user', null, 'GETPOST');\n\t\tif(!is_string($userId)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$user = $this->entityManager->getRepository('Owncloud_Entity_DeleteUser')->findOneBy(array('uname' => $userId));\n\t\tif(!($user instanceof Owncloud_Entity_DeleteUser)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\t\t$this->entityManager->remove($user);\n\t\t$this->entityManager->flush();\n\n\t\treturn self::ret(true);\n\t}", "public function delete(User $user, Payer $payer)\n {\n //\n }", "public function destroy()\n {\n $user = \\App\\User::find((Auth::user()->id));\n\n $user->delete();\n \n return redirect()->action('SearchController@getTopAdvertisements')->with('status', 'Account deleted!');\n }", "public function destroy(Admin $user)\n {\n //\n $count = Admin::where('site', 0)->count();\n if ($count > 1) {\n $user->delete();\n // return redirect()->route('users.index');\n }\n }", "function delete_user()\n {\n\n //return true if successful\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function sendAccountDeletedEmail(User $user): void;", "public function delete(User $user, Checkout $checkout)\n {\n //\n }", "public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }", "function deleteUserAccount(){\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$this->db->set('status', 'Deactivated');\n\t\t\t$this->db->where('userID', $id);\n\t\t\t$query = $this->db->update('users');\n\t\t\t\n\t\t\tif($query){\n\t\t\t\techo \"done\";\n\t\t\t}\n\t\t\t\n\t\t}", "public function destroy($id)\n {\n // delete user\n }", "public function delete(User $user, Goods $goods)\n {\n //\n }", "public function destroy(User $user) {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }" ]
[ "0.774143", "0.7503988", "0.7308527", "0.7294549", "0.67808074", "0.67547584", "0.6706481", "0.66646624", "0.66543716", "0.6617822", "0.6571545", "0.65598375", "0.6483491", "0.6470965", "0.6464532", "0.6458848", "0.64038056", "0.64036804", "0.63682914", "0.6354817", "0.6354817", "0.6354817", "0.6336982", "0.6331919", "0.63151747", "0.62782705", "0.6270314", "0.62658596", "0.625691", "0.6255892", "0.6244828", "0.623984", "0.62309825", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.62308484", "0.622805", "0.6195624", "0.618239", "0.61790556", "0.61687034", "0.6167077", "0.6164084", "0.6160038", "0.61458755", "0.6138921", "0.61291057", "0.6125361", "0.6110225", "0.61096036", "0.6107915", "0.6103515", "0.6102685", "0.60952395", "0.6086869", "0.6084125", "0.60736924", "0.6071722", "0.60622126", "0.60619247", "0.6061511", "0.60592633", "0.60581434", "0.60530245", "0.6051716", "0.6045477", "0.6044952", "0.6037171", "0.6034675", "0.60314626", "0.6031227", "0.60305464", "0.60282904", "0.6026264", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106", "0.6021106" ]
0.68224186
4
/ Search user vendors....
public function search() { try { if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(" Vendor Entity not initialized"); } else { $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor(); $objVendor->vendor = $this->vendor; return $objVendor->search(); } } catch (Exception $ex) { throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getActiveVendors() {\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getActiveVendors('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR, \"person_archived\" => $archived))->result();\n\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }", "public function get_vendors( $args = array() ) {\n\n\t\tglobal $wpdb;\n\n\t\t$defaults = array(\n\t\t\t'number' => 20,\n\t\t\t'offset' => 0,\n\t\t\t'user_id' => 0,\n\t\t\t'orderby' => 'id',\n\t\t\t'order' => 'DESC'\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\tif ( $args['number'] < 1 ) {\n\t\t\t$args['number'] = 999999999999;\n\t\t}\n\n\t\t$where = '';\n\n\t\t// specific vendors\n\t\tif ( ! empty( $args['id'] ) ) {\n\n\t\t\tif ( is_array( $args['id'] ) ) {\n\t\t\t\t$ids = implode( ',', $args['id'] );\n\t\t\t} else {\n\t\t\t\t$ids = intval( $args['id'] );\n\t\t\t}\n\n\t\t\t$where .= \" WHERE `id` IN( {$ids} ) \";\n\n\t\t}\n\n\t\t// vendors for specific user accounts\n\t\tif ( ! empty( $args['user_id'] ) ) {\n\n\t\t\tif ( is_array( $args['user_id'] ) ) {\n\t\t\t\t$user_ids = implode( ',', $args['user_id'] );\n\t\t\t} else {\n\t\t\t\t$user_ids = intval( $args['user_id'] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `user_id` IN( {$user_ids} ) \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `user_id` IN( {$user_ids} ) \";\n\t\t\t}\n\n\n\t\t}\n\n\t\t//specific vendors by email\n\t\tif ( ! empty( $args['email'] ) ) {\n\n\t\t\tif ( is_array( $args['email'] ) ) {\n\t\t\t\t$emails = \"'\" . implode( \"', '\", $args['email'] ) . \"'\";\n\t\t\t} else {\n\t\t\t\t$emails = \"'\" . $args['email'] . \"'\";\n\t\t\t}\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `email` IN( {$emails} ) \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `email` IN( {$emails} ) \";\n\t\t\t}\n\n\t\t}\n\n\t\t// specific vendors by username\n\t\tif ( ! empty( $args['username'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `username` LIKE '\" . $args['username'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `username` LIKE '%%\" . $args['username'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// specific vendors by name\n\t\tif ( ! empty( $args['name'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `name` LIKE '\" . $args['name'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `name` LIKE '%%\" . $args['name'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// specific vendors by status\n\t\tif ( ! empty( $args['status'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `status` LIKE '\" . $args['status'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `status` LIKE '%%\" . $args['status'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// Vendors created for a specific date or in a date range\n\t\tif ( ! empty( $args['date'] ) ) {\n\n\t\t\tif ( is_array( $args['date'] ) ) {\n\n\t\t\t\tif ( ! empty( $args['date']['start'] ) ) {\n\n\t\t\t\t\t$start = date( 'Y-m-d H:i:s', strtotime( $args['date']['start'] ) );\n\n\t\t\t\t\tif ( ! empty( $where ) ) {\n\n\t\t\t\t\t\t$where .= \" AND `date_created` >= '{$start}'\";\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$where .= \" WHERE `date_created` >= '{$start}'\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $args['date']['end'] ) ) {\n\n\t\t\t\t\t$end = date( 'Y-m-d H:i:s', strtotime( $args['date']['end'] ) );\n\n\t\t\t\t\tif ( ! empty( $where ) ) {\n\n\t\t\t\t\t\t$where .= \" AND `date_created` <= '{$end}'\";\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$where .= \" WHERE `date_created` <= '{$end}'\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$year = date( 'Y', strtotime( $args['date'] ) );\n\t\t\t\t$month = date( 'm', strtotime( $args['date'] ) );\n\t\t\t\t$day = date( 'd', strtotime( $args['date'] ) );\n\n\t\t\t\tif ( empty( $where ) ) {\n\t\t\t\t\t$where .= \" WHERE\";\n\t\t\t\t} else {\n\t\t\t\t\t$where .= \" AND\";\n\t\t\t\t}\n\n\t\t\t\t$where .= \" $year = YEAR ( date_created ) AND $month = MONTH ( date_created ) AND $day = DAY ( date_created )\";\n\t\t\t}\n\n\t\t}\n\n\t\t$args['orderby'] = ! array_key_exists( $args['orderby'], $this->get_columns() ) ? 'id' : $args['orderby'];\n\n\t\tif ( 'sales_value' == $args['orderby'] ) {\n\t\t\t$args['orderby'] = 'sales_value+0';\n\t\t}\n\n\t\t$cache_key = md5( 'edd_vendors_' . serialize( $args ) );\n\n\t\t$vendors = wp_cache_get( $cache_key, 'vendors' );\n\n\t\tif ( $vendors === false ) {\n\t\t\t$vendors = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->table_name $where ORDER BY {$args['orderby']} {$args['order']} LIMIT %d,%d;\", absint( $args['offset'] ), absint( $args['number'] ) ) );\n\t\t\twp_cache_set( $cache_key, $vendors, 'vendors', 3600 );\n\t\t}\n\n\t\treturn $vendors;\n\n\t}", "public function getActivatedVendors();", "public abstract function find_users($search);", "public function testDestiny2GetVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function getVendors(){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userstatus=:userstatus\";\n $params = array(\":userstatus\" => 1);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results;\n }\t\t\n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "public function ShowVendors()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors')\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function getvendorsAction()\n {\n \t\n \t$vendorsmodel= new Default_Model_Vendors();\n \t$vendorsdataArr=$vendorsmodel->getVendorsList();\n \n \t$opt='<option value=\\'\\'>Select Vendor</option>';\n \n \tif(sizeof($vendorsdataArr)>0){\n \t\t\n \t\tforeach($vendorsdataArr as $vendors)\n \t\t{\n \t\t\t$opt.=\"<option value='\".$vendors['id'].\"'>\".$vendors['name'].\"</option>\";\n \t\t}\n \t}\n \t\n \t\n \t \t\n \t$this->_helper->json(array('options'=>utf8_encode($opt)));\n \t\n \t\n }", "function particularvendorlist($id)\n\t{\n\t\t$getParvendor=\"SELECT * from vendor where vendor_id = $id\";\n\t\t$vendor_data=$this->get_results( $getParvendor );\n\t\treturn $vendor_data;\n\t}", "public function search($params, $vendors = '')\n {\n $query = Vendor::find();\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => ($vendors) ? $query->where(['in', 'vendor_id', $vendors]) : $query,\n 'sort' => ['defaultOrder' => ['sort_order' => SORT_DESC]],\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'vendor_id' => $this->vendor_id,\n 'vendor_account_start_date' => $this->vendor_account_start_date,\n 'vendor_account_end_date' => $this->vendor_account_end_date,\n ]);\n\n $query->andFilterWhere(['like', 'vendor_logo', $this->vendor_logo])\n ->andFilterWhere(['like', 'vendor_name_en', $this->vendor_name_en])\n ->andFilterWhere(['like', 'vendor_name_ar', $this->vendor_name_ar])\n ->andFilterWhere(['like', 'vendor_description_en', $this->vendor_description_en])\n ->andFilterWhere(['like', 'vendor_description_ar', $this->vendor_description_ar])\n ->andFilterWhere(['like', 'vendor_phone1', $this->vendor_phone1])\n ->andFilterWhere(['like', 'vendor_phone2', $this->vendor_phone2])\n ->andFilterWhere(['like', 'vendor_youtube_video', $this->vendor_youtube_video])\n ->andFilterWhere(['like', 'vendor_social_instagram', $this->vendor_social_instagram])\n ->andFilterWhere(['like', 'vendor_social_twitter', $this->vendor_social_twitter])\n ->andFilterWhere(['like', 'vendor_location', $this->vendor_location])\n ->andFilterWhere(['like', 'vendor_address_text_en', $this->vendor_address_text_en])\n ->andFilterWhere(['like', 'vendor_address_text_ar', $this->vendor_address_text_ar]);\n\n return $dataProvider;\n }", "public function index()\n {\n $editableVendor = null;\n $vendorQuery = Vendor::query();\n $vendorQuery->where('name', 'like', '%'.request('q').'%');\n $vendors = $vendorQuery->paginate(25);\n\n if (in_array(request('action'), ['edit', 'delete']) && request('id') != null) {\n $editableVendor = Vendor::find(request('id'));\n }\n\n return view('vendors.index', compact('vendors', 'editableVendor'));\n }", "public function incSearch() {\n\t\t$result = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( $this->input->get( 'term' ) ) {\n\t\t\t\t/** @var \\wpdb $wpdb */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query = '%' . $this->input->get( 'term' ) . '%';\n\t\t\t\t$sql = <<<SQL\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t\t\tID, user_login, display_name\n\t\t\t\t\tFROM {$wpdb->users}\n\t\t\t\t\tWHERE user_login LIKE %s\n\t\t\t\t\t OR user_email LIKE %s\n\t\t\t\t\t OR display_name LIKE %s\n ORDER BY display_name ASC\n\t\t\t\t\tLIMIT 10\nSQL;\n\t\t\t\t$result = array_map( function ( $user ) {\n\t\t\t\t\t$user->avatar = get_avatar( $user->ID, '48', '', $user->display_name );\n\n\t\t\t\t\treturn $user;\n\t\t\t\t}, $wpdb->get_results( $wpdb->prepare( $sql, $query, $query, $query ) ) );\n\t\t\t}\n\t\t}\n\t\twp_send_json( $result );\n\t}", "function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}", "public function count( $args = array() ) {\n\n\t\tglobal $wpdb;\n\n\t\t$defaults = array(\n\t\t\t'number' => 20,\n\t\t\t'offset' => 0,\n\t\t\t'user_id' => 0,\n\t\t\t'orderby' => 'id',\n\t\t\t'order' => 'DESC'\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\tif ( $args['number'] < 1 ) {\n\t\t\t$args['number'] = 999999999999;\n\t\t}\n\n\t\t$where = '';\n\n\t\t// specific vendors\n\t\tif ( ! empty( $args['id'] ) ) {\n\n\t\t\tif ( is_array( $args['id'] ) ) {\n\t\t\t\t$ids = implode( ',', $args['id'] );\n\t\t\t} else {\n\t\t\t\t$ids = intval( $args['id'] );\n\t\t\t}\n\n\t\t\t$where .= \" WHERE `id` IN( {$ids} ) \";\n\n\t\t}\n\n\t\t// vendors for specific user accounts\n\t\tif ( ! empty( $args['user_id'] ) ) {\n\n\t\t\tif ( is_array( $args['user_id'] ) ) {\n\t\t\t\t$user_ids = implode( ',', $args['user_id'] );\n\t\t\t} else {\n\t\t\t\t$user_ids = intval( $args['user_id'] );\n\t\t\t}\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `user_id` IN( {$user_ids} ) \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `user_id` IN( {$user_ids} ) \";\n\t\t\t}\n\n\n\t\t}\n\n\t\t//specific vendors by email\n\t\tif ( ! empty( $args['email'] ) ) {\n\n\t\t\tif ( is_array( $args['email'] ) ) {\n\t\t\t\t$emails = \"'\" . implode( \"', '\", $args['email'] ) . \"'\";\n\t\t\t} else {\n\t\t\t\t$emails = \"'\" . $args['email'] . \"'\";\n\t\t\t}\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `email` IN( {$emails} ) \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `email` IN( {$emails} ) \";\n\t\t\t}\n\n\t\t}\n\n\t\t// specific vendors by username\n\t\tif ( ! empty( $args['username'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `username` LIKE '\" . $args['username'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `username` LIKE '%%\" . $args['username'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// specific vendors by name\n\t\tif ( ! empty( $args['name'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `name` LIKE '\" . $args['name'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `name` LIKE '%%\" . $args['name'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// specific vendors by status\n\t\tif ( ! empty( $args['status'] ) ) {\n\n\t\t\tif ( ! empty( $where ) ) {\n\t\t\t\t$where .= \" AND `status` LIKE '\" . $args['status'] . \"' \";\n\t\t\t} else {\n\t\t\t\t$where .= \" WHERE `status` LIKE '%%\" . $args['status'] . \"%%' \";\n\t\t\t}\n\t\t}\n\n\t\t// Vendors created for a specific date or in a date range\n\t\tif ( ! empty( $args['date'] ) ) {\n\n\t\t\tif ( is_array( $args['date'] ) ) {\n\n\t\t\t\tif ( ! empty( $args['date']['start'] ) ) {\n\n\t\t\t\t\t$start = date( 'Y-m-d H:i:s', strtotime( $args['date']['start'] ) );\n\n\t\t\t\t\tif ( ! empty( $where ) ) {\n\n\t\t\t\t\t\t$where .= \" AND `date_created` >= '{$start}'\";\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$where .= \" WHERE `date_created` >= '{$start}'\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $args['date']['end'] ) ) {\n\n\t\t\t\t\t$end = date( 'Y-m-d H:i:s', strtotime( $args['date']['end'] ) );\n\n\t\t\t\t\tif ( ! empty( $where ) ) {\n\n\t\t\t\t\t\t$where .= \" AND `date_created` <= '{$end}'\";\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$where .= \" WHERE `date_created` <= '{$end}'\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$year = date( 'Y', strtotime( $args['date'] ) );\n\t\t\t\t$month = date( 'm', strtotime( $args['date'] ) );\n\t\t\t\t$day = date( 'd', strtotime( $args['date'] ) );\n\n\t\t\t\tif ( empty( $where ) ) {\n\t\t\t\t\t$where .= \" WHERE\";\n\t\t\t\t} else {\n\t\t\t\t\t$where .= \" AND\";\n\t\t\t\t}\n\n\t\t\t\t$where .= \" $year = YEAR ( date_created ) AND $month = MONTH ( date_created ) AND $day = DAY ( date_created )\";\n\t\t\t}\n\n\t\t}\n\n\t\t$args['orderby'] = ! array_key_exists( $args['orderby'], $this->get_columns() ) ? 'id' : $args['orderby'];\n\n\t\tif ( 'sales_value' == $args['orderby'] ) {\n\t\t\t$args['orderby'] = 'sales_value+0';\n\t\t}\n\n\t\t$cache_key = md5( 'fes_vendors_count' . serialize( $args ) );\n\n\t\t$count = wp_cache_get( $cache_key, 'vendors' );\n\n\t\tif ( $count === false ) {\n\t\t\t$count = $wpdb->get_var( \"SELECT COUNT($this->primary_key) FROM \" . $this->table_name . \"{$where};\" );\n\t\t\twp_cache_set( $cache_key, $count, 'vendors', 3600 );\n\t\t}\n\n\t\treturn absint( $count );\n\n\t}", "public function getVendorList() {\n $vendors = $this->couponServices_model->fetchVendors();\n\n $vendor_options = array();\n $vendor_options[\"\"] = \"-- Select vendor --\";\n foreach ($vendors as $company) {\n $vendor_options[$company['vendorId']] = $company['vendorName'];\n }\n return $vendor_options;\n }", "function wcfmgs_group_manager_allow_vendors_list( $allow_vendors = array(0), $is_marketplace = '', $is_term = true ) {\r\n \tglobal $WCFM, $WCFMgs;\r\n \t\r\n \tif( !$allow_vendors || !is_array( $allow_vendors ) ) $allow_vendors = array(0);\r\n \t\r\n \tif( $is_marketplace == '' ) {\r\n \t\t$is_marketplace = wcfm_is_marketplace();\r\n \t}\r\n \t\r\n\t\t$wcfm_vendor_groups = get_user_meta( $this->manager_id, '_wcfm_vendor_group', true );\r\n\t\tif( !empty( $wcfm_vendor_groups ) ) {\r\n\t\t\tforeach( $wcfm_vendor_groups as $wcfm_vendor_group ) {\r\n\t\t\t\t$group_vendors = get_post_meta( $wcfm_vendor_group, '_group_vendors', true );\r\n\t\t\t\tif( $group_vendors && is_array( $group_vendors ) && !empty( $group_vendors ) ) {\r\n\t\t\t\t\tforeach( $group_vendors as $group_vendor ) {\r\n\t\t\t\t\t\tif( $is_marketplace == 'wcpvendors' ) {\r\n\t\t\t\t\t\t\tif( $is_term ) {\r\n\t\t\t\t\t\t\t\t$term_id = get_user_meta( $group_vendor, '_wcpv_active_vendor', true );\r\n\t\t\t\t\t\t\t\tif( $term_id ) $allow_vendors[] = $term_id;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$allow_vendors[] = $group_vendor;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$allow_vendors[] = $group_vendor;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $allow_vendors;\r\n }", "public function actionIndex() {\n $searchModel = new VendorSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function display_used_vouchers() {\n\n\t\tglobal $current_user, $woo_vou_vendor_role;\n\n\t\t$prefix = WOO_VOU_META_PREFIX;\n\n\t\t$args = $data = array();\n\n\t\t// Taking parameter\n\t\t$orderby \t= isset( $_GET['orderby'] )\t? urldecode( $_GET['orderby'] )\t\t: 'ID';\n\t\t$order\t\t= isset( $_GET['order'] )\t? $_GET['order'] \t: 'DESC';\n\t\t$search \t= isset( $_GET['s'] ) \t\t? sanitize_text_field( trim($_GET['s']) )\t: null;\n\n\t\t$args = array(\n\t\t\t\t\t\t'posts_per_page'\t=> $this->per_page,\n\t\t\t\t\t\t'page'\t\t\t\t=> isset( $_GET['paged'] ) ? $_GET['paged'] : null,\n\t\t\t\t\t\t'orderby'\t\t\t=> $orderby,\n\t\t\t\t\t\t'order'\t\t\t\t=> $order,\n\t\t\t\t\t\t'offset' \t\t\t=> ( $this->get_pagenum() - 1 ) * $this->per_page,\n\t\t\t\t\t\t'woo_vou_list'\t\t=> true\n\t\t\t\t\t);\n\n\t\t$search_meta = \tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' \t\t=> $prefix . 'used_codes',\n\t\t\t\t\t\t\t\t'value' \t=> '',\n\t\t\t\t\t\t\t\t'compare' \t=> '!='\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t//Get user role\n\t\t$user_roles\t= isset( $current_user->roles ) ? $current_user->roles : array();\n\t\t$user_role\t= array_shift( $user_roles );\n\n\t\t//voucher admin roles\n\t\t$admin_roles\t= woo_vou_assigned_admin_roles();\n\n\t\tif( !in_array( $user_role, $admin_roles ) ) {// voucher admin can redeem all codes\n\t\t\t$args['author'] = $current_user->ID;\n\t\t}\n\n\t\tif( isset( $_GET['woo_vou_post_id'] ) && !empty( $_GET['woo_vou_post_id'] ) ) {\n\t\t\t$args['post_parent'] = $_GET['woo_vou_post_id'];\n\t\t}\n\t\t\n\t\tif( isset( $_GET['woo_vou_user_id'] ) && !empty( $_GET['woo_vou_user_id'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'redeem_by',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['woo_vou_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '=',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\tif( isset( $_GET['woo_vou_start_date'] ) && !empty( $_GET['woo_vou_start_date'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_code_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> date( \"Y-m-d H:i:s\", strtotime( $_GET['woo_vou_start_date'] ) ),\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '>=',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\tif( isset( $_GET['woo_vou_end_date'] ) && !empty( $_GET['woo_vou_end_date'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_code_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> date( \"Y-m-d H:i:s\", strtotime( $_GET['woo_vou_end_date'] ) ),\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '<=',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t}\n\n\t\tif( !empty( $search ) ) {\n\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation'\t=> 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_codes',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'first_name',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'last_name',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'order_id',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'order_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t$args['meta_query']\t= $search_meta;\n\n\t\t//get used voucher codes data from database\n\t\t$woo_data \t= $this->model->woo_vou_get_voucher_details( $args );\n\t\t$data\t\t= isset( $woo_data['data'] ) ? $woo_data['data'] : '';\n\n\t\tif( !empty( $data ) ) {\n\n\t\t\tforeach ( $data as $key => $value ) {\n\n\t\t\t\t$user_id \t = get_post_meta( $value['ID'], $prefix.'redeem_by', true );\n\t\t\t\t$user_detail = get_userdata( $user_id );\n\t\t\t\t$user_profile = add_query_arg( array('user_id' => $user_id), admin_url('user-edit.php') );\n\t\t\t\t$display_name = isset( $user_detail->display_name ) ? $user_detail->display_name : '';\n\n\t\t\t\tif( !empty( $display_name ) ) {\n\t\t\t\t\t$display_name = '<a href=\"'.$user_profile.'\">'.$display_name.'</a>';\n\t\t\t\t} else {\n\t\t\t\t\t$display_name = __( 'N/A', 'woovoucher' );\n\t\t\t\t}\n\n\t\t\t\t$data[$key]['ID'] \t\t\t= $value['ID'];\n\t\t\t\t$data[$key]['post_parent'] \t= $value['post_parent'];\n\t\t\t\t$data[$key]['code'] \t\t= get_post_meta( $value['ID'], $prefix.'used_codes', true );\n\t\t\t\t$data[$key]['redeem_by'] \t= $display_name;\n\t\t\t\t$data[$key]['first_name'] \t= get_post_meta( $value['ID'], $prefix.'first_name', true );\n\t\t\t\t$data[$key]['last_name'] \t= get_post_meta( $value['ID'], $prefix.'last_name', true );\n\t\t\t\t$data[$key]['order_id'] \t= get_post_meta( $value['ID'], $prefix.'order_id', true );\n\t\t\t\t$data[$key]['order_date'] \t= get_post_meta( $value['ID'], $prefix.'order_date', true );\n\t\t\t\t$data[$key]['product_title']= get_the_title( $value['post_parent'] );\n\n\t\t\t\t$order_id = $data[$key]['order_id'];\n\n\t\t\t\t$data[$key]['buyers_info'] = $this->model->woo_vou_get_buyer_information( $order_id );\n\t\t\t}\n\t\t}\n\n\t\t$result_arr['data']\t\t= !empty($data) ? $data : array();\n\t\t$result_arr['total'] \t= isset( $woo_data['total'] ) ? $woo_data['total'] \t: 0; // Total no of data\n\n\t\treturn $result_arr;\n\t}", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM item_vendor_x';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function search();", "public function search();", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "function _vendorCompanyList(){\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getVendorCompany('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR))->result();\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }", "public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function GetAllDataVendor($param = []) \t\t\t\n { \t\t\t\n if (isset($param['search_value']) && $param['search_value'] != '') { \t\t\t\n $this->db->group_start(); \t\t\t\n $i = 0; \t\t\t\n foreach ($param['search_field'] as $row => $val) { \t\t\t\n if ($val['searchable'] == 'true') { \t\t\t\n if ($i == 0) { \t\t\t\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value'])); \t\t\t\n } else { \t\t\t\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value'])); \t\t\t\n } \t\t\t\n $i++; \t\t\t\n } \t\t\t\n } \t\t\t\n $this->db->group_end(); \t\t\t\n } \t\t\t\n if (isset($param['row_from']) && isset($param['length'])) { \t\t\t\n $this->db->limit($param['length'], $param['row_from']); \t\t\t\n } \t\t\t\n if (isset($param['order_field'])) { \t\t\t\n if (isset($param['order_sort'])) { \t\t\t\n $this->db->order_by($param['order_field'], $param['order_sort']); \t\t\t\n } else { \t\t\t\n $this->db->order_by($param['order_field'], 'desc'); \t\t\t\n } \t\t\t\n } else { \t\t\t\n $this->db->order_by('id', 'desc'); \t\t\t\n } \t\t\t\n $data = $this->db \t\t\t\n ->select('a.*') \t\t\t\n ->where('a.is_delete',0) \t\t\t\n ->get('master_vendor a') \t\t\t\n ->result_array(); \t\t\t\n #echo $this->db->last_query(); \t\t\t\n return $data; \t\t\t\n }", "protected function getListQuery()\n\t{\n\t\t$input = Factory::getApplication()->input;\n\t\t$this->vendor_id = $input->get('vendor_id', '', 'INT');\n\t\t$vendor_id = $this->vendor_id ? $this->vendor_id : $this->getState('vendor_id');\n\t\t$client = $input->get('client', '', 'STRING');\n\n\t\t// Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t// Select the required fields from the table.\n\t\t$query->select(\n\t\t\t$db->quoteName(array('a.vendor_id', 'a.vendor_title', 'b.client', 'b.percent_commission', 'b.flat_commission', 'b.id', 'b.currency'))\n\t\t);\n\n\t\t$query->from($db->quoteName('#__tjvendors_fee', 'b'));\n\n\t\t$query->join('LEFT', ($db->quoteName('#__tjvendors_vendors', 'a') . 'ON ' . $db->quoteName('b.vendor_id') . ' = ' . $db->quoteName('a.vendor_id')));\n\n\t\t$query->where($db->quoteName('a.vendor_id') . ' = ' . $vendor_id);\n\n\t\tif (!empty($client))\n\t\t{\n\t\t\t$query->where($db->quoteName('b.client') . ' = ' . $db->quote($client));\n\t\t}\n\n\t\t// Filter by search in title\n\t\t$search = $this->getState('filter.search');\n\n\t\tif (!empty($search))\n\t\t{\n\t\t\tif (stripos($search, 'id:') === 0)\n\t\t\t{\n\t\t\t\t$query->where($db->quoteName('b.id') . ' = ' . (int) substr($search, 3));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$search = $db->Quote('%' . $db->escape($search, true) . '%');\n\t\t\t\t$query->where('(b.currency LIKE ' . $search .\n\t\t\t\t\t\t\t'OR b.percent_commission LIKE' . $search .\n\t\t\t\t\t\t\t'OR b.flat_commission LIKE' . $search . ')');\n\t\t\t}\n\n\t\t\t$this->search = $search;\n\t\t}\n\n\t\t// Add the list ordering clause.\n\t\t$orderCol = $this->state->get('list.ordering');\n\t\t$orderDirn = $this->state->get('list.direction');\n\n\t\tif (!in_array(strtoupper($orderDirn), array('ASC', 'DESC')))\n\t\t{\n\t\t\t$orderDirn = 'DESC';\n\t\t}\n\n\t\tif ($orderCol && $orderDirn)\n\t\t{\n\t\t\t$query->order($db->escape($orderCol . ' ' . $orderDirn));\n\t\t}\n\n\t\treturn $query;\n\t}", "protected function _getVendorCollection()\n {\n if (is_null($this->_vendorCollection)) {\n $queryText = $this->getQueryText();\n $vendorShoptable = $this->_resourceConnection->getTableName('ced_csmarketplace_vendor_shop');\n $this->_vendorCollection = $this->_collectionFactory->create();\n $this->_vendorCollection->addAttributeToSelect('*');\n //$this->_vendorCollection->getSelect()->join(['vendor_shop' => $vendorShoptable], 'e.entity_id=vendor_shop.vendor_id AND vendor_shop.shop_disable=' . Vshop::ENABLED, ['shop_disable']);\n\n $this->_vendorCollection->addAttributeToFilter('meta_keywords', ['like' => '%' . $queryText . '%']);\n if ($this->_csmarketplaceHelper->isSharingEnabled()) {\n $this->_vendorCollection->addAttributeToFilter('website_id', $this->_storeManager->getStore()->getWebsiteId());\n }\n\n if ($this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::MODULE_ENABLE)) {\n //------------------- Custom Filter----------------[START]\n\n $savedLocationFromSession = $this->_hyperlocalHelper->getShippingLocationFromSession();\n $filterType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_TYPE);\n $radiusConfig = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_RADIUS);\n $distanceType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::DISTANCE_TYPE);\n $apiKey = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::API_KEY);\n $filterProductsBy = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_PRODUCTS_BY);\n\n if ($filterProductsBy == 'vendor_location' || $filterType == 'distance') {\n $vendorIds = [0];\n if ($savedLocationFromSession) {\n\n /** Filter Products By Vendor Location */\n if ($filterType == 'city_state_country') {\n\n //------------------- Filter By City,country & state----------------[START]\n $locationCollection = $this->_hyperlocalHelper->getFilteredlocationByCityStateCountry($savedLocationFromSession);\n if ($locationCollection) {\n $vendorIds = $locationCollection->getColumnValues('vendor_id');\n }\n\n //------------------- Filter By City,country & state----------------[END]\n } elseif ($filterType == 'zipcode' && isset($savedLocationFromSession['filterZipcode'])) {\n\n //------------------- Filter By Zipcode----------------[START]\n $resource = $this->_resourceConnection;\n $tableName = $resource->getTableName('ced_cshyperlocal_shipping_area');\n $this->zipcodeCollection->getSelect()->joinLeft($tableName, 'main_table.location_id = ' . $tableName . '.id', ['status', 'is_origin_address']);\n $this->zipcodeCollection->addFieldToFilter('main_table.zipcode', $savedLocationFromSession['filterZipcode'])\n ->addFieldToFilter('status', Shiparea::STATUS_ENABLED);\n $this->zipcodeCollection->getSelect()->where(\"`is_origin_address` IS NULL OR `is_origin_address` = '0'\");\n $vendorIds = $this->zipcodeCollection->getColumnValues('vendor_id');\n //------------------- Filter By Zipcode----------------[END]\n } elseif ($filterType == 'distance') {\n $tolat = $savedLocationFromSession['latitude'];\n $tolong = $savedLocationFromSession['longitude'];\n $vIds = [];\n if ($tolat != '' && $tolong != '') {\n $vendorCollection = $this->_collectionFactory->create();\n $vendorCollection->addAttributeToSelect('*');\n if ($vendorCollection->count()) {\n foreach ($vendorCollection as $vendor) {\n $distance = $this->_hyperlocalHelper->calculateDistancebyHaversine($vendor->getLatitude(), $vendor->getLongitude(), $tolat, $tolong);\n if ($distance <= $radiusConfig) {\n $vendorIds[] = $vendor->getId();\n }\n }\n }\n }\n }\n $this->_vendorCollection->addAttributeToFilter('entity_id', ['in' => $vendorIds]);\n }\n }\n //------------------- Custom Filter ----------------[END]\n }\n\n $this->prepareSortableFields();\n }\n return $this->_vendorCollection;\n }", "public function getVendorByName(Request $request)\n {\n $q = $request->get('q');\n\n return Vendor::where('name', 'like', \"%$q%\")->paginate(null, ['id', 'name as text']);\n }", "function search() {}", "function get_vendors($debug = false) {\n\t\t$q = (new QueryBuilder())->table('vendors');\n\t\t$q->where('shipfrom', '');\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Vendor');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }", "public function getSearch();", "public function page_vendors() {\n $action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';\n $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;\n\n switch ($action) {\n case 'view':\n $vendor = new \\WeDevs\\ERP\\People( $id );\n $template = dirname( __FILE__ ) . '/views/vendor/single.php';\n break;\n\n case 'edit':\n $template = dirname( __FILE__ ) . '/views/vendor/edit.php';\n break;\n\n case 'new':\n $template = dirname( __FILE__ ) . '/views/vendor/new.php';\n break;\n\n default:\n $template = dirname( __FILE__ ) . '/views/vendor/list.php';\n break;\n }\n\n if ( file_exists( $template ) ) {\n include $template;\n }\n }", "function getAllOwners($currpg,$url)\n\t{\n\t\t$sql = \"Select * from tblowner order by organization_name\";\t// sql statement \n\t\t$result = paging($sql,$currpg, $this->pagesize,$url); // execute sql statement \n\t\treturn $result;\t\t\t\t\t\t// return result from sql \n\t}", "private function endonuclease_vendors() {\r\n\r\n $vendors = array(\r\n \"AarI\" => \"F\",\r\n \"AasI\" => \"F\",\r\n \"AatI\" => \"O\",\r\n \"AatII\" => \"AFGIKMNORV\",\r\n \"AbsI\" => \"I\",\r\n \"AccI\" => \"ABGJKMNORSUWX\",\r\n \"AccII\" => \"AJK\",\r\n \"AccIII\" => \"GJKRW\",\r\n \"Acc16I\" => \"IV\",\r\n \"Acc36I\" => \"I\",\r\n \"Acc65I\" => \"FGINRVW\",\r\n \"AccB1I\" => \"IV\",\r\n \"AccB7I\" => \"IRV\",\r\n \"AccBSI\" => \"IV\",\r\n \"AciI\" => \"N\",\r\n \"AclI\" => \"INV\",\r\n \"AclWI\" => \"I\",\r\n \"AcoI\" => \"I\",\r\n \"AcsI\" => \"IMV\",\r\n \"AcuI\" => \"IN\",\r\n \"AcvI\" => \"QX\",\r\n \"AcyI\" => \"JM\",\r\n \"AdeI\" => \"F\",\r\n \"AfaI\" => \"AK\",\r\n \"AfeI\" => \"IN\",\r\n \"AfiI\" => \"V\",\r\n \"AflII\" => \"AJKNO\",\r\n \"AflIII\" => \"GMNSW\",\r\n \"AgeI\" => \"JNR\",\r\n \"AhdI\" => \"N\",\r\n \"AhlI\" => \"IV\",\r\n \"AjiI\" => \"F\",\r\n \"AjnI\" => \"I\",\r\n \"AjuI\" => \"F\",\r\n \"AleI\" => \"N\",\r\n \"AlfI\" => \"F\",\r\n \"AloI\" => \"F\",\r\n \"AluI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"AluBI\" => \"I\",\r\n \"AlwI\" => \"N\",\r\n \"Alw21I\" => \"F\",\r\n \"Alw26I\" => \"FR\",\r\n \"Alw44I\" => \"FJMORS\",\r\n \"AlwNI\" => \"N\",\r\n \"Ama87I\" => \"IV\",\r\n \"Aor13HI\" => \"K\",\r\n \"Aor51HI\" => \"AK\",\r\n \"ApaI\" => \"ABFGIJKMNOQRSUVWX\",\r\n \"ApaLI\" => \"AKNU\",\r\n \"ApeKI\" => \"N\",\r\n \"ApoI\" => \"N\",\r\n \"AscI\" => \"GNW\",\r\n \"AseI\" => \"JNO\",\r\n \"AsiGI\" => \"IV\",\r\n \"AsiSI\" => \"N\",\r\n \"AspI\" => \"M\",\r\n \"Asp700I\" => \"M\",\r\n \"Asp718I\" => \"M\",\r\n \"AspA2I\" => \"IV\",\r\n \"AspEI\" => \"M\",\r\n \"AspLEI\" => \"IV\",\r\n \"AspS9I\" => \"IV\",\r\n \"AssI\" => \"U\",\r\n \"AsuC2I\" => \"I\",\r\n \"AsuHPI\" => \"IV\",\r\n \"AsuNHI\" => \"IV\",\r\n \"AvaI\" => \"ABGJMNORSUWX\",\r\n \"AvaII\" => \"AGJKMNRSWY\",\r\n \"AviII\" => \"M\",\r\n \"AvrII\" => \"N\",\r\n \"AxyI\" => \"J\",\r\n \"BaeI\" => \"N\",\r\n \"BalI\" => \"AJKR\",\r\n \"BamHI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BanI\" => \"NORU\",\r\n \"BanII\" => \"AGKMNOQRSWX\",\r\n \"BanIII\" => \"O\",\r\n \"BarI\" => \"I\",\r\n \"BasI\" => \"U\",\r\n \"BauI\" => \"F\",\r\n \"BbeI\" => \"AK\",\r\n \"BbrPI\" => \"MO\",\r\n \"BbsI\" => \"N\",\r\n \"BbuI\" => \"R\",\r\n \"BbvI\" => \"N\",\r\n \"Bbv12I\" => \"IV\",\r\n \"BbvCI\" => \"N\",\r\n \"BccI\" => \"N\",\r\n \"BceAI\" => \"N\",\r\n \"BcgI\" => \"N\",\r\n \"BciVI\" => \"N\",\r\n \"BclI\" => \"FGJMNORSUWY\",\r\n \"BcnI\" => \"FK\",\r\n \"BcuI\" => \"F\",\r\n \"BdaI\" => \"F\",\r\n \"BfaI\" => \"N\",\r\n \"BfiI\" => \"F\",\r\n \"BfmI\" => \"F\",\r\n \"BfrI\" => \"MO\",\r\n \"BfuI\" => \"F\",\r\n \"BfuAI\" => \"N\",\r\n \"BfuCI\" => \"N\",\r\n \"BglI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"BglII\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BisI\" => \"I\",\r\n \"BlnI\" => \"AKMS\",\r\n \"BlpI\" => \"N\",\r\n \"BlsI\" => \"I\",\r\n \"BmcAI\" => \"V\",\r\n \"Bme18I\" => \"IV\",\r\n \"Bme1390I\" => \"F\",\r\n \"Bme1580I\" => \"N\",\r\n \"BmeRI\" => \"V\",\r\n \"BmeT110I\" => \"K\",\r\n \"BmgBI\" => \"N\",\r\n \"BmgT120I\" => \"K\",\r\n \"BmiI\" => \"V\",\r\n \"BmrI\" => \"N\",\r\n \"BmrFI\" => \"V\",\r\n \"BmtI\" => \"INV\",\r\n \"BmuI\" => \"I\",\r\n \"BoxI\" => \"F\",\r\n \"BpiI\" => \"F\",\r\n \"BplI\" => \"F\",\r\n \"BpmI\" => \"IN\",\r\n \"Bpu10I\" => \"FINV\",\r\n \"Bpu14I\" => \"IV\",\r\n \"Bpu1102I\" => \"AFK\",\r\n \"BpuAI\" => \"M\",\r\n \"BpuEI\" => \"N\",\r\n \"BpuMI\" => \"V\",\r\n \"BpvUI\" => \"V\",\r\n \"BsaI\" => \"N\",\r\n \"Bsa29I\" => \"I\",\r\n \"BsaAI\" => \"N\",\r\n \"BsaBI\" => \"N\",\r\n \"BsaHI\" => \"N\",\r\n \"BsaJI\" => \"N\",\r\n \"BsaMI\" => \"GR\",\r\n \"BsaWI\" => \"N\",\r\n \"BsaXI\" => \"N\",\r\n \"Bsc4I\" => \"I\",\r\n \"Bse1I\" => \"IV\",\r\n \"Bse8I\" => \"IV\",\r\n \"Bse21I\" => \"IV\",\r\n \"Bse118I\" => \"IV\",\r\n \"BseAI\" => \"CM\",\r\n \"BseBI\" => \"C\",\r\n \"BseCI\" => \"C\",\r\n \"BseDI\" => \"F\",\r\n \"Bse3DI\" => \"IV\",\r\n \"BseGI\" => \"F\",\r\n \"BseJI\" => \"F\",\r\n \"BseLI\" => \"F\",\r\n \"BseMI\" => \"F\",\r\n \"BseMII\" => \"F\",\r\n \"BseNI\" => \"F\",\r\n \"BsePI\" => \"IV\",\r\n \"BseRI\" => \"N\",\r\n \"BseSI\" => \"F\",\r\n \"BseXI\" => \"F\",\r\n \"BseX3I\" => \"IV\",\r\n \"BseYI\" => \"N\",\r\n \"BsgI\" => \"N\",\r\n \"Bsh1236I\" => \"F\",\r\n \"Bsh1285I\" => \"F\",\r\n \"BshFI\" => \"C\",\r\n \"BshNI\" => \"F\",\r\n \"BshTI\" => \"F\",\r\n \"BshVI\" => \"V\",\r\n \"BsiEI\" => \"N\",\r\n \"BsiHKAI\" => \"N\",\r\n \"BsiHKCI\" => \"QX\",\r\n \"BsiSI\" => \"C\",\r\n \"BsiWI\" => \"MNO\",\r\n \"BsiYI\" => \"M\",\r\n \"BslI\" => \"GNW\",\r\n \"BslFI\" => \"I\",\r\n \"BsmI\" => \"JMNOSW\",\r\n \"BsmAI\" => \"N\",\r\n \"BsmBI\" => \"N\",\r\n \"BsmFI\" => \"N\",\r\n \"BsnI\" => \"V\",\r\n \"Bso31I\" => \"IV\",\r\n \"BsoBI\" => \"N\",\r\n \"Bsp13I\" => \"IV\",\r\n \"Bsp19I\" => \"IV\",\r\n \"Bsp68I\" => \"F\",\r\n \"Bsp119I\" => \"F\",\r\n \"Bsp120I\" => \"F\",\r\n \"Bsp143I\" => \"F\",\r\n \"Bsp1286I\" => \"JKNR\",\r\n \"Bsp1407I\" => \"FK\",\r\n \"Bsp1720I\" => \"IV\",\r\n \"BspACI\" => \"I\",\r\n \"BspANI\" => \"X\",\r\n \"BspCNI\" => \"N\",\r\n \"BspDI\" => \"N\",\r\n \"BspEI\" => \"N\",\r\n \"BspFNI\" => \"I\",\r\n \"BspHI\" => \"N\",\r\n \"BspLI\" => \"F\",\r\n \"BspLU11I\" => \"M\",\r\n \"BspMI\" => \"N\",\r\n \"BspMAI\" => \"X\",\r\n \"BspOI\" => \"F\",\r\n \"BspPI\" => \"F\",\r\n \"BspQI\" => \"N\",\r\n \"BspTI\" => \"F\",\r\n \"BspT104I\" => \"K\",\r\n \"BspT107I\" => \"K\",\r\n \"BspTNI\" => \"QX\",\r\n \"BspXI\" => \"GW\",\r\n \"BsrI\" => \"N\",\r\n \"BsrBI\" => \"N\",\r\n \"BsrDI\" => \"N\",\r\n \"BsrFI\" => \"N\",\r\n \"BsrGI\" => \"N\",\r\n \"BsrSI\" => \"R\",\r\n \"BssAI\" => \"C\",\r\n \"BssECI\" => \"I\",\r\n \"BssHII\" => \"AJKMNOQRSX\",\r\n \"BssKI\" => \"N\",\r\n \"BssMI\" => \"V\",\r\n \"BssNI\" => \"V\",\r\n \"BssNAI\" => \"IV\",\r\n \"BssSI\" => \"N\",\r\n \"BssT1I\" => \"IV\",\r\n \"Bst6I\" => \"IV\",\r\n \"Bst98I\" => \"R\",\r\n \"Bst1107I\" => \"FKM\",\r\n \"BstACI\" => \"I\",\r\n \"BstAPI\" => \"IN\",\r\n \"BstAUI\" => \"IV\",\r\n \"BstBI\" => \"N\",\r\n \"Bst2BI\" => \"IV\",\r\n \"BstBAI\" => \"IV\",\r\n \"Bst4CI\" => \"IV\",\r\n \"BstC8I\" => \"I\",\r\n \"BstDEI\" => \"IV\",\r\n \"BstDSI\" => \"IV\",\r\n \"BstEII\" => \"GHJMNORSUW\",\r\n \"BstENI\" => \"IV\",\r\n \"BstF5I\" => \"IV\",\r\n \"BstFNI\" => \"IV\",\r\n \"BstH2I\" => \"IV\",\r\n \"BstHHI\" => \"IV\",\r\n \"BstKTI\" => \"I\",\r\n \"BstMAI\" => \"IV\",\r\n \"BstMBI\" => \"IV\",\r\n \"BstMCI\" => \"IV\",\r\n \"BstMWI\" => \"I\",\r\n \"BstNI\" => \"N\",\r\n \"BstNSI\" => \"IV\",\r\n \"BstOI\" => \"R\",\r\n \"BstPI\" => \"K\",\r\n \"BstPAI\" => \"IV\",\r\n \"BstSCI\" => \"I\",\r\n \"BstSFI\" => \"I\",\r\n \"BstSLI\" => \"I\",\r\n \"BstSNI\" => \"IV\",\r\n \"BstUI\" => \"N\",\r\n \"Bst2UI\" => \"IV\",\r\n \"BstV1I\" => \"I\",\r\n \"BstV2I\" => \"IV\",\r\n \"BstXI\" => \"AFGHIJKMNOQRVWX\",\r\n \"BstX2I\" => \"IV\",\r\n \"BstYI\" => \"N\",\r\n \"BstZI\" => \"R\",\r\n \"BstZ17I\" => \"N\",\r\n \"Bsu15I\" => \"F\",\r\n \"Bsu36I\" => \"NR\",\r\n \"BsuRI\" => \"FI\",\r\n \"BsuTUI\" => \"X\",\r\n \"BtgI\" => \"N\",\r\n \"BtgZI\" => \"N\",\r\n \"BtrI\" => \"IV\",\r\n \"BtsI\" => \"N\",\r\n \"BtsCI\" => \"N\",\r\n \"BtuMI\" => \"V\",\r\n \"BveI\" => \"F\",\r\n \"Cac8I\" => \"N\",\r\n \"CaiI\" => \"F\",\r\n \"CciNI\" => \"IV\",\r\n \"CelII\" => \"M\",\r\n \"CfoI\" => \"MRS\",\r\n \"CfrI\" => \"F\",\r\n \"Cfr9I\" => \"FO\",\r\n \"Cfr10I\" => \"FGKO\",\r\n \"Cfr13I\" => \"AFO\",\r\n \"Cfr42I\" => \"F\",\r\n \"ClaI\" => \"ABHKMNRSU\",\r\n \"CpoI\" => \"AFK\",\r\n \"CseI\" => \"F\",\r\n \"CspI\" => \"OR\",\r\n \"Csp6I\" => \"F\",\r\n \"Csp45I\" => \"OR\",\r\n \"CspAI\" => \"C\",\r\n \"CspCI\" => \"N\",\r\n \"CviAII\" => \"N\",\r\n \"CviJI\" => \"QX\",\r\n \"CviKI-1\" => \"N\",\r\n \"CviQI\" => \"N\",\r\n \"DdeI\" => \"BGMNORSW\",\r\n \"DinI\" => \"V\",\r\n \"DpnI\" => \"BEFGMNRSW\",\r\n \"DpnII\" => \"N\",\r\n \"DraI\" => \"ABFGIJKMNOQRSUVWXY\",\r\n \"DraII\" => \"GMW\",\r\n \"DraIII\" => \"GIMNVW\",\r\n \"DrdI\" => \"N\",\r\n \"DriI\" => \"I\",\r\n \"DseDI\" => \"IV\",\r\n \"EaeI\" => \"AKMN\",\r\n \"EagI\" => \"GNW\",\r\n \"Eam1104I\" => \"F\",\r\n \"Eam1105I\" => \"FK\",\r\n \"EarI\" => \"N\",\r\n \"EciI\" => \"N\",\r\n \"Ecl136II\" => \"F\",\r\n \"EclHKI\" => \"R\",\r\n \"EclXI\" => \"MS\",\r\n \"Eco24I\" => \"F\",\r\n \"Eco31I\" => \"F\",\r\n \"Eco32I\" => \"F\",\r\n \"Eco47I\" => \"FO\",\r\n \"Eco47III\" => \"FGMORW\",\r\n \"Eco52I\" => \"FKO\",\r\n \"Eco57I\" => \"F\",\r\n \"Eco72I\" => \"F\",\r\n \"Eco81I\" => \"AFKO\",\r\n \"Eco88I\" => \"F\",\r\n \"Eco91I\" => \"F\",\r\n \"Eco105I\" => \"FO\",\r\n \"Eco130I\" => \"F\",\r\n \"Eco147I\" => \"F\",\r\n \"EcoICRI\" => \"IRV\",\r\n \"Eco57MI\" => \"F\",\r\n \"EcoNI\" => \"N\",\r\n \"EcoO65I\" => \"K\",\r\n \"EcoO109I\" => \"AFJKN\",\r\n \"EcoP15I\" => \"N\",\r\n \"EcoRI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"EcoRII\" => \"FJMOS\",\r\n \"EcoRV\" => \"ABCGHIJKMNOQRSUVWXY\",\r\n \"EcoT14I\" => \"K\",\r\n \"EcoT22I\" => \"AKO\",\r\n \"EcoT38I\" => \"J\",\r\n \"EgeI\" => \"I\",\r\n \"EheI\" => \"FO\",\r\n \"ErhI\" => \"IV\",\r\n \"Esp3I\" => \"F\",\r\n \"FaeI\" => \"I\",\r\n \"FalI\" => \"I\",\r\n \"FaqI\" => \"F\",\r\n \"FatI\" => \"IN\",\r\n \"FauI\" => \"IN\",\r\n \"FauNDI\" => \"IV\",\r\n \"FbaI\" => \"AK\",\r\n \"FblI\" => \"IV\",\r\n \"Fnu4HI\" => \"N\",\r\n \"FokI\" => \"AGIJKMNQRVWX\",\r\n \"FriOI\" => \"IV\",\r\n \"FseI\" => \"AN\",\r\n \"FspI\" => \"JNO\",\r\n \"FspAI\" => \"F\",\r\n \"FspBI\" => \"F\",\r\n \"Fsp4HI\" => \"I\",\r\n \"GlaI\" => \"I\",\r\n \"GluI\" => \"I\",\r\n \"GsuI\" => \"F\",\r\n \"HaeII\" => \"GJKMNORSW\",\r\n \"HaeIII\" => \"ABGHIJKMNOQRSUWXY\",\r\n \"HapII\" => \"AK\",\r\n \"HgaI\" => \"IN\",\r\n \"HhaI\" => \"ABFGJKNORUWY\",\r\n \"Hin1I\" => \"FKO\",\r\n \"Hin1II\" => \"F\",\r\n \"Hin4I\" => \"F\",\r\n \"Hin6I\" => \"F\",\r\n \"HinP1I\" => \"N\",\r\n \"HincII\" => \"ABFGHJKNOQRUWXY\",\r\n \"HindII\" => \"IMSV\",\r\n \"HindIII\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"HinfI\" => \"ABCFGHIJKMNOQRUVWXY\",\r\n \"HpaI\" => \"ABCGHIJKMNOQRSUVWX\",\r\n \"HpaII\" => \"BFGIMNOQRSUVWX\",\r\n \"HphI\" => \"FN\",\r\n \"Hpy8I\" => \"F\",\r\n \"Hpy99I\" => \"N\",\r\n \"Hpy188I\" => \"N\",\r\n \"Hpy188III\" => \"N\",\r\n \"HpyAV\" => \"N\",\r\n \"HpyCH4III\" => \"N\",\r\n \"HpyCH4IV\" => \"N\",\r\n \"HpyCH4V\" => \"N\",\r\n \"HpyF3I\" => \"F\",\r\n \"HpyF10VI\" => \"F\",\r\n \"Hsp92I\" => \"R\",\r\n \"Hsp92II\" => \"R\",\r\n \"HspAI\" => \"IV\",\r\n \"ItaI\" => \"M\",\r\n \"KasI\" => \"N\",\r\n \"KpnI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"Kpn2I\" => \"F\",\r\n \"KspI\" => \"MS\",\r\n \"Ksp22I\" => \"IV\",\r\n \"Ksp632I\" => \"M\",\r\n \"KspAI\" => \"F\",\r\n \"Kzo9I\" => \"I\",\r\n \"LguI\" => \"F\",\r\n \"LweI\" => \"F\",\r\n \"MabI\" => \"I\",\r\n \"MaeI\" => \"M\",\r\n \"MaeII\" => \"M\",\r\n \"MaeIII\" => \"M\",\r\n \"MalI\" => \"I\",\r\n \"MamI\" => \"M\",\r\n \"MbiI\" => \"F\",\r\n \"MboI\" => \"ABCFGKNQRUWXY\",\r\n \"MboII\" => \"AFGIJKNOQRVWX\",\r\n \"MfeI\" => \"N\",\r\n \"MflI\" => \"K\",\r\n \"MhlI\" => \"IV\",\r\n \"MlsI\" => \"F\",\r\n \"MluI\" => \"ABFGHIJKMNOQRSUVWX\",\r\n \"MluNI\" => \"MS\",\r\n \"MlyI\" => \"N\",\r\n \"Mly113I\" => \"I\",\r\n \"MmeI\" => \"NX\",\r\n \"MnlI\" => \"FGINQVWX\",\r\n \"Mph1103I\" => \"F\",\r\n \"MreI\" => \"F\",\r\n \"MroI\" => \"MO\",\r\n \"MroNI\" => \"IV\",\r\n \"MroXI\" => \"IV\",\r\n \"MscI\" => \"BNO\",\r\n \"MseI\" => \"BN\",\r\n \"MslI\" => \"N\",\r\n \"MspI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"Msp20I\" => \"IV\",\r\n \"MspA1I\" => \"INRV\",\r\n \"MspCI\" => \"C\",\r\n \"MspR9I\" => \"I\",\r\n \"MssI\" => \"F\",\r\n \"MunI\" => \"FKM\",\r\n \"MvaI\" => \"AFGKMOSW\",\r\n \"Mva1269I\" => \"F\",\r\n \"MvnI\" => \"M\",\r\n \"MvrI\" => \"U\",\r\n \"MwoI\" => \"N\",\r\n \"NaeI\" => \"ACKMNORU\",\r\n \"NarI\" => \"GJMNOQRUWX\",\r\n \"NciI\" => \"GJNORSW\",\r\n \"NcoI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NdeI\" => \"ABFGJKMNQRSWXY\",\r\n \"NdeII\" => \"GJMRSW\",\r\n \"NgoMIV\" => \"NR\",\r\n \"NheI\" => \"ABFGJKMNORSUW\",\r\n \"NlaIII\" => \"GNW\",\r\n \"NlaIV\" => \"GNW\",\r\n \"NmeAIII\" => \"N\",\r\n \"NmuCI\" => \"F\",\r\n \"NotI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NruI\" => \"ABCGIJKMNOQRSUWX\",\r\n \"NsbI\" => \"FK\",\r\n \"NsiI\" => \"BGHJMNRSUW\",\r\n \"NspI\" => \"MN\",\r\n \"NspV\" => \"JO\",\r\n \"OliI\" => \"F\",\r\n \"PacI\" => \"GNOW\",\r\n \"PaeI\" => \"F\",\r\n \"PaeR7I\" => \"N\",\r\n \"PagI\" => \"F\",\r\n \"PalAI\" => \"I\",\r\n \"PasI\" => \"F\",\r\n \"PauI\" => \"F\",\r\n \"PceI\" => \"IV\",\r\n \"PciI\" => \"IN\",\r\n \"PciSI\" => \"I\",\r\n \"PctI\" => \"IV\",\r\n \"PdiI\" => \"F\",\r\n \"PdmI\" => \"F\",\r\n \"PfeI\" => \"F\",\r\n \"Pfl23II\" => \"F\",\r\n \"PflFI\" => \"N\",\r\n \"PflMI\" => \"N\",\r\n \"PfoI\" => \"F\",\r\n \"PhoI\" => \"N\",\r\n \"PinAI\" => \"BM\",\r\n \"PleI\" => \"N\",\r\n \"Ple19I\" => \"I\",\r\n \"PmaCI\" => \"AK\",\r\n \"PmeI\" => \"GNW\",\r\n \"PmlI\" => \"N\",\r\n \"PpiI\" => \"F\",\r\n \"PpsI\" => \"I\",\r\n \"Ppu21I\" => \"F\",\r\n \"PpuMI\" => \"NO\",\r\n \"PscI\" => \"F\",\r\n \"PshAI\" => \"AKN\",\r\n \"PshBI\" => \"K\",\r\n \"PsiI\" => \"IN\",\r\n \"Psp5II\" => \"F\",\r\n \"Psp6I\" => \"I\",\r\n \"Psp1406I\" => \"FK\",\r\n \"Psp124BI\" => \"IV\",\r\n \"PspCI\" => \"IV\",\r\n \"PspEI\" => \"IV\",\r\n \"PspGI\" => \"N\",\r\n \"PspLI\" => \"I\",\r\n \"PspN4I\" => \"I\",\r\n \"PspOMI\" => \"INV\",\r\n \"PspPPI\" => \"I\",\r\n \"PspXI\" => \"IN\",\r\n \"PsrI\" => \"I\",\r\n \"PstI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"PsuI\" => \"F\",\r\n \"PsyI\" => \"F\",\r\n \"PvuI\" => \"ABFGKMNOQRSUWXY\",\r\n \"PvuII\" => \"ABCFGHIJKMNORSUVWXY\",\r\n \"RcaI\" => \"M\",\r\n \"RgaI\" => \"I\",\r\n \"RigI\" => \"I\",\r\n \"RsaI\" => \"BCFGHIJMNOQRSVWXY\",\r\n \"RsaNI\" => \"I\",\r\n \"RseI\" => \"F\",\r\n \"RsrII\" => \"MNQX\",\r\n \"Rsr2I\" => \"IV\",\r\n \"SacI\" => \"AFGHJKMNOQRSUWX\",\r\n \"SacII\" => \"AGHJKNOQRWX\",\r\n \"SalI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SanDI\" => \"E\",\r\n \"SapI\" => \"N\",\r\n \"SatI\" => \"F\",\r\n \"Sau96I\" => \"GJMNOUW\",\r\n \"Sau3AI\" => \"AGHJKMNOQRSUWX\",\r\n \"SbfI\" => \"INV\",\r\n \"ScaI\" => \"ABCFGJKMNOQRSWX\",\r\n \"SchI\" => \"F\",\r\n \"ScrFI\" => \"JMNOS\",\r\n \"SdaI\" => \"F\",\r\n \"SduI\" => \"F\",\r\n \"SetI\" => \"I\",\r\n \"SexAI\" => \"MN\",\r\n \"SfaNI\" => \"INV\",\r\n \"SfcI\" => \"N\",\r\n \"SfiI\" => \"ACFGIJKMNOQRSUVWX\",\r\n \"SfoI\" => \"N\",\r\n \"Sfr274I\" => \"IV\",\r\n \"Sfr303I\" => \"IV\",\r\n \"SfuI\" => \"M\",\r\n \"SgfI\" => \"R\",\r\n \"SgrAI\" => \"MN\",\r\n \"SgrBI\" => \"C\",\r\n \"SgrDI\" => \"F\",\r\n \"SgsI\" => \"F\",\r\n \"SinI\" => \"GQRWX\",\r\n \"SlaI\" => \"C\",\r\n \"SmaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SmiI\" => \"FIKV\",\r\n \"SmiMI\" => \"IV\",\r\n \"SmlI\" => \"N\",\r\n \"SmoI\" => \"F\",\r\n \"SmuI\" => \"F\",\r\n \"SnaBI\" => \"ACKMNR\",\r\n \"SpeI\" => \"ABGHJKMNOQRSUWX\",\r\n \"SphI\" => \"ABCGHIJKMNOQRSVWX\",\r\n \"SrfI\" => \"EO\",\r\n \"Sse9I\" => \"IV\",\r\n \"Sse8387I\" => \"AK\",\r\n \"SseBI\" => \"C\",\r\n \"SsiI\" => \"F\",\r\n \"SspI\" => \"ABCFGIJKMNOQRSUVWX\",\r\n \"SstI\" => \"BC\",\r\n \"SstII\" => \"B\",\r\n \"StrI\" => \"U\",\r\n \"StuI\" => \"ABJKMNQRSUX\",\r\n \"StyI\" => \"CJMNRS\",\r\n \"StyD4I\" => \"N\",\r\n \"SwaI\" => \"GJMNSW\",\r\n \"TaaI\" => \"F\",\r\n \"TaiI\" => \"F\",\r\n \"TaqI\" => \"ABCFGIJKMNOQRSUVWXY\",\r\n \"TaqII\" => \"QX\",\r\n \"TasI\" => \"F\",\r\n \"TatI\" => \"F\",\r\n \"TauI\" => \"F\",\r\n \"TfiI\" => \"N\",\r\n \"TliI\" => \"N\",\r\n \"Tru1I\" => \"F\",\r\n \"Tru9I\" => \"GIMRVW\",\r\n \"TseI\" => \"N\",\r\n \"TsoI\" => \"F\",\r\n \"Tsp45I\" => \"N\",\r\n \"Tsp509I\" => \"N\",\r\n \"TspDTI\" => \"X\",\r\n \"TspEI\" => \"O\",\r\n \"TspGWI\" => \"X\",\r\n \"TspMI\" => \"N\",\r\n \"TspRI\" => \"N\",\r\n \"TstI\" => \"F\",\r\n \"Tth111I\" => \"GIKNQRVWX\",\r\n \"Van91I\" => \"AFKM\",\r\n \"Vha464I\" => \"IV\",\r\n \"VneI\" => \"IV\",\r\n \"VpaK11BI\" => \"K\",\r\n \"VspI\" => \"FIRV\",\r\n \"XagI\" => \"F\",\r\n \"XapI\" => \"F\",\r\n \"XbaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"XceI\" => \"F\",\r\n \"XcmI\" => \"N\",\r\n \"XhoI\" => \"ABFGHJKMNOQRSUWXY\",\r\n \"XhoII\" => \"GMRW\",\r\n \"XmaI\" => \"INRUV\",\r\n \"XmaCI\" => \"M\",\r\n \"XmaJI\" => \"F\",\r\n \"XmiI\" => \"F\",\r\n \"XmnI\" => \"GNRUW\",\r\n \"XspI\" => \"K\",\r\n \"ZraI\" => \"INV\",\r\n \"ZrmI\" => \"I\",\r\n \"Zsp2I\" => \"IV\"\r\n );\r\n return $vendors;\r\n }", "public function search()\n\t{\n\t\t\n\t}", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "function get_all_vendors($limit, $category) {\n\n /* we gonna change dis to\n [\"id\"]=>\n [\"name\"]=>\n [\"a_vendor_id\"]=>\n [\"vendor_name\"]=>\n [\"url_link\"]=>\n [\"url_image\"]=>\n [\"description\"]=>\n [\"created\"]=>\n [\"modified\"]=>\n [\"user_id\"]=>\n [\"category\"]=>\n [\"votes_up\"]=>\n [\"votes_down\"]=>\n [\"banned\"]=>\n [\"username\"]=>\n [\"allowed_id\"]=>\n [\"allowed_name\"]=>\n [\"allowed_url\"]=>\n [\"allowed_image_url\"]=>\n [\"allowed_tagline\"]=>\n [\"allowed_user_id\"]=>\n [\"allowed_created\"]=>\n [\"allowed_modified\"]=>\n\n*/\n $query = $this->db->query(\"SELECT vendors.*, users.username, allowed_vendors.*,categories.*\n FROM `vendors`\n JOIN `users` ON users.id = vendors.user_id\n JOIN `allowed_vendors` ON allowed_vendors.allowed_id = vendors.a_vendor_id\n JOIN `categories` ON categories.categories_category_id = vendors.vendors_category_id\n WHERE `vendors_category_id` = $category\n ORDER BY votes_up DESC\n LIMIT $limit, 8;\");\n\n //$query = $this->db->query(\"SELECT vendors.*, users.username FROM `vendors` JOIN `users` ON users.id = vendors.user_id WHERE `category` = $category ORDER BY votes_up DESC LIMIT $limit, 8;\");\n\n return $query->result();\n }", "function ciniki_wineproduction_searchProductNames($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'start_needle'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Search'), \n 'limit'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Limit'), \n 'customer_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Customer'), \n 'category_id'=>array('required'=>'no', 'default'=>'0', 'blank'=>'yes', 'name'=>'Category'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'wineproduction', 'private', 'checkAccess');\n $rc = ciniki_wineproduction_checkAccess($ciniki, $args['tnid'], 'ciniki.wineproduction.searchProductNames'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // If a customer is specified, search through past orders to find preferences for customer\n //\n if( $args['start_needle'] == '' && isset($args['customer_id']) && $args['customer_id'] > 0 ) {\n $strsql = \"SELECT ciniki_wineproduction_products.id, \"\n . \"ciniki_wineproduction_products.name AS wine_name, \"\n . \"ciniki_wineproductions.wine_type, \"\n . \"ciniki_wineproductions.kit_length, \"\n . \"order_flags \"\n . \"FROM ciniki_wineproductions, ciniki_wineproduction_products \"\n . \"WHERE ciniki_wineproductions.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_wineproductions.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_wineproductions.product_id = ciniki_wineproduction_products.id \"\n . \"AND ciniki_wineproduction_products.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_wineproduction_products.status = 10 \";\n } \n\n //\n // If no customer specified, but a search string is, then search through products for \n // matching names\n //\n else if( $args['start_needle'] != '' ) {\n $strsql = \"SELECT ciniki_wineproduction_products.id, ciniki_wineproduction_products.name AS wine_name, \"\n . \"ciniki_wineproduction_products.wine_type, \"\n . \"ciniki_wineproduction_products.kit_length, \"\n . \"0 AS order_flags \"\n . \"FROM ciniki_wineproduction_products \"\n . \"WHERE ciniki_wineproduction_products.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (ciniki_wineproduction_products.name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \" \n . \"OR ciniki_wineproduction_products.name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \" \n . \") \"\n . \"AND ciniki_wineproduction_products.status = 10 \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.wineproduction.19', 'msg'=>'No search specified'));\n }\n\n $strsql .= \"GROUP BY ciniki_wineproduction_products.id \"\n . \"ORDER BY ciniki_wineproduction_products.name \"\n// . \"ORDER BY COUNT(ciniki_wineproductions.id) DESC \"\n . \"\";\n if( isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0 ) {\n $strsql .= \"LIMIT \" . ciniki_core_dbQuote($ciniki, $args['limit']) . \" \"; // is_numeric verified\n } else {\n $strsql .= \"LIMIT 25\";\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbRspQuery');\n return ciniki_core_dbRspQuery($ciniki, $strsql, 'ciniki.wineproduction', 'names', 'name', array('stat'=>'ok', 'names'=>array()));\n}", "public function findUsers();", "public function findUsers();", "public function search_user(Request $request){\n $search = $request->input('term');\n $users = User::where('name', 'like' , \"%$search%\")\n ->orwhere('username', 'like', \"%$search%\")\n ->get();\n return response()->json($users, 200);\n }", "public function getSearchedContributorsList($params)\n {\n $where = '';\n if($params['searchsubmit'] == 'Search')\n {\n if($params['aotitle']!='0')\n {\n $contribsIdsList= $this->getContribsInAo($params['aotitle']);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['contrib']!='0')\n {\n $where.= \" AND u.identifier=\".$params['contrib'];\n }\n if($params['type']!='0')\n {\n $where.= \" AND u.profile_type='\".$params['type'].\"'\";\n }\n if($params['type2']!='0')\n {\n if($params['type2'] == 'writer')\n $where.= \" AND u.type2 IS NULL\";\n else\n $where.= \" AND u.type2='\".$params['type2'].\"'\";\n }\n if($params['status']!='0')\n {\n $where.= \" AND u.status='\".$params['status'].\"'\";\n }\n if($params['blacklist']!='0')\n {\n $where.= \" AND u.blackstatus='\".$params['blacklist'].\"'\";\n }\n if($params['nationalism']!='0')\n {\n $where.= \" AND cb.nationality=\".$params['nationalism'];\n }\n if($params['minage']!='')\n {\n // $where.= \" AND cb.dob='\".$minage.\"'\";\n $where.= \" AND ((DATEDIFF(NOW(),cb.dob))/365) >='\".$params['minage'].\"' AND ((DATEDIFF(NOW(),cb.dob))/365) <='\".$params['maxage'].\"'\";\n }\n if($params['minartsvalid']!='')\n {\n $whereQuery= \" WHERE status IN ('bid', 'under_study', 'disapproved', 'time_out', 'published', 'closed', 'on_hold')\n GROUP BY user_id HAVING COUNT(user_id) Between \".$params['minartsvalid'].\" and \".$params['maxartsvalid'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['mintotalparts']!='')\n {\n $whereQuery= \" GROUP BY user_id HAVING COUNT(user_id) Between \".$params['mintotalparts'].\" and \".$params['maxtotalparts'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['minartssent']!='')\n {\n $whereQuery= \" WHERE status IN ('under_study','disapproved', 'published')\n GROUP BY user_id HAVING COUNT(user_id) Between \".$params['minartssent'].\" and \".$params['maxartssent'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['minpartsrefused']!='')\n {\n $whereQuery= \" WHERE status IN ('bid_refused')\n GROUP BY user_id HAVING COUNT(user_id) Between \".$params['minpartsrefused'].\" and \".$params['maxpartsrefused'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['minartsrefused']!='')\n {\n $whereQuery= \" WHERE status IN ('closed')\n GROUP BY user_id HAVING COUNT(user_id) Between \".$params['minartsrefused'].\" and \".$params['maxartsrefused'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['noofdisapproved']!='')\n {\n $whereQuery= \" WHERE refused_count > 0\n GROUP BY user_id HAVING COUNT(user_id) <= \".$params['noofdisapproved'].\"\";\n $contribsIdsList= $this->getContibsIdsForSearch($whereQuery);\n $where.= \" AND u.identifier IN (\".$contribsIdsList.\")\";\n }\n if($params['category']!=0)\n {\n $str1 = \" REGEXP ('\";\n $find_ini='';\n foreach($params['category'] as $catid => $catvalue)\n {\n $exp = $catvalue;\n for($i=$catvalue; $i<100; $i++)\n {\n $exp.= \"|\".($i+1);\n }\n\n $str1.= \"(\".$catid.\"@\".$exp.\")|\";\n $category1[] = $str1;\n }\n $str1 = substr($str1, 0, -1).\"')\";\n $where.= \" AND cb.category_more \".$str1.\" AND find_in_set('\".$catid.\"', cb.favourite_category)>0\";\n }\n if($params['contribquiz']!=0)\n {\n $where.= \" AND qp.quiz_id = \".$params['contribquiz'];\n }\n if($params['language']!='0')\n {\n $where.= \" AND cb.language = '\".$params['language'].\"'\";\n }\n if($params['language2']!='0')\n {\n $langstr1 = \" REGEXP ('\";\n foreach($params['language2'] as $lang2id => $lang2value)\n {\n $exp = $lang2value;\n for($i=$lang2value; $i<100; $i++)\n {\n $exp.= \"|\".($i+1);\n }\n $langstr1.= \"(\".$lang2id.\"@\".$exp.\")|\";\n $language2[] = $langstr1;\n }\n $langstr1 = substr($langstr1, 0, -1).\"')\";\n $where.= \" AND cb.language_more \".$langstr1;\n //$where.= \" AND cb.language_more = '\".$language2.\"'\";\n }\n if($params['start_date']!='' && $params['end_date']!='')\n {\n $start_date = str_replace('/','-',$params['start_date']);\n $end_date = str_replace('/','-',$params['end_date']);\n $start_date = date('Y-m-d', strtotime($start_date));\n $end_date = date('Y-m-d', strtotime($end_date));\n $where.= \" AND DATE_FORMAT(u.created_at, '%Y-%m-%d') BETWEEN '\".$start_date.\"' AND '\".$end_date.\"'\";\n }\n if($params['act_start_date']!='' && $params['act_end_date']!='')\n {\n $act_start_date = str_replace('/','-',$params['act_start_date']);\n $act_end_date = str_replace('/','-',$params['act_end_date']);\n $act_start_date = date('Y-m-d', strtotime($act_start_date));\n $act_end_date = date('Y-m-d', strtotime($act_end_date));\n $where.= \" AND DATE_FORMAT(p.created_at, '%Y-%m-%d') BETWEEN '\".$act_start_date.\"' AND '\".$act_end_date.\"'\";\n }\n }\n elseif($params['total_contribs']=='yes')\n $where.= \" \";\n elseif($params['never_participated']=='yes')\n $where.= \" AND u.identifier NOT IN (select user_id from Participation)\";\n elseif($params['never_sent']=='yes')\n $where.= \" AND u.identifier IN (select user_id from Participation where status NOT IN ('closed','disapproved','published', 'under_study', 'disapprove_client','closed_client'))\";\n elseif($params['never_validated']=='yes')\n {\n $where.= \" AND u.identifier IN (select user_id from Participation where status NOT IN\n ('bid','under_study','time_out','validated','published','refused','ignored','disapproved','approved','closed','on_hold','bid_temp','bid_refused_temp','bid_nonpremium_timeout','bid_premium_timeout','disapproved_temp','closed_temp','plag_exec','closed_client_temp','disapprove_client','closed_client'))\";\n }\n elseif($params['once_validated']=='yes')\n $where.= \" AND u.identifier IN (select user_id from Participation where status IN ('bid', 'under_study', 'disapproved', 'time_out', 'published', 'closed', 'on_hold'))\";\n elseif($params['once_published']=='yes')\n $where.= \" AND u.identifier IN (select user_id from Participation where status IN ('published'))\";\n else\n $where = \" \";\n\n $Query = \"select distinct u.identifier,u.email, u.created_at, u.blackstatus, u.profile_type, u.status, up.initial, u.password,\n up.first_name, up.address, up.city, up.state, up.zipcode, up.country, up.phone_number, up.last_name, cb.university,\n cb.dob, cb.profession, cb.favourite_category, cb.category_more, cb.language_more, cb.language, cb.payment_type, cb.self_details from User u\n\t\tLEFT JOIN UserPlus up ON u.identifier=up.user_id\n\t\tLEFT JOIN Contributor cb ON u.identifier=cb.user_id\n\t\tLEFT JOIN Participation p ON p.user_id = cb.user_id\n\t\tLEFT JOIN QuizParticipation qp ON qp.user_id = cb.user_id\n\t where u.type='contributor' \".$where.\"\";\n if(($result = $this->getQuery($Query,true)) != NULL)\n return $result;\n else\n return \"NO\";\n }", "public static function getvendorData()\n {\n\n $value=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get(); \n return $value;\n\t\n }", "public function testDestiny2GetPublicVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function adminSearchAgenciesAction()\n {\n $request = Request::createFromGlobals();\n $term = strtolower($request->query->get('q', ''));\n $limit = 100;\n $data = $this->get('CorpoAgenciesServices')->getCorpoAdminLikeAgencies($term, $limit);\n\n $res = new Response(json_encode($data));\n $res->headers->set('Content-Type', 'application/json');\n\n return $res;\n }", "public function search(){}", "function wcfmgs_group_manager_enquery_filter( $sql ) {\r\n \t\r\n \tif( !wcfm_is_vendor() && empty( $_POST['enquiry_vendor'] ) ) {\r\n \t\t$is_marketplace = wcfm_is_marketplace();\r\n\t\t\tif( $is_marketplace ) {\r\n\t\t\t\t$allow_vendors = $this->wcfmgs_group_manager_allow_vendors_list( array(0), $is_marketplace );\r\n\t\t\t\t$sql .= \" AND `vendor_id` IN (\" . implode( ',', $allow_vendors ) . \")\";\r\n\t\t\t}\r\n \t}\r\n \t\r\n \treturn $sql;\r\n }", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "public function search_vendor_grid($id){\n $CompanyID = User::get_companyID();\n $data = Input::all();\n $UserID = 0;\n $SelectedCodes = 0;\n $isCountry = 1;\n $countries = 0;\n $isall = 0;\n $criteria =0;\n\n if (User::is('AccountManager')) {\n $UserID = User::get_userID();\n }\n if (isset($data['OwnerFilter']) && $data['OwnerFilter'] != 0) {\n $UserID = $data['OwnerFilter'];\n }\n\n //block by contry\n if(isset($data['block_by']) && $data['block_by']=='country')\n {\n $isCountry=1;\n if(in_array(0,explode(',',$data['Country']))){\n $isall = 1;\n }elseif(!empty($data['Country'])){\n $isall = 0;\n $countries = $data['Country'];\n }\n\n }\n\n //block by code\n if(isset($data['block_by']) && $data['block_by']=='code')\n {\n $isCountry=0;\n $isall = 0;\n // by critearia\n if(!empty($data['criteria']) && $data['criteria']==1){\n if(!empty($data['Code']) || !empty($data['Country'])){\n if(!empty($data['Code'])){\n $criteria = 1;\n $SelectedCodes = $data['Code'];\n }else{\n $criteria = 2;\n if(!empty($data['Country'])){\n $isall = 0;\n $countries = $data['Country'];\n }\n }\n }else{\n $criteria = 3;\n }\n\n }elseif(!empty($data['SelectedCodes'])){\n //by code\n $SelectedCodes = $data['SelectedCodes'];\n $criteria = 0;\n }\n\n }\n\n if($data['action'] == 'block'){\n $data['action'] = 0;\n }else{\n $data['action'] = 1;\n }\n\n $query = \"call prc_GetBlockUnblockVendor (\".$CompanyID.\",\".$UserID.\",\".$data['Trunk'].\",\".$data['Timezones'].\",'\".$countries.\"','\".$SelectedCodes.\"',\".$isCountry.\",\".$data['action'].\",\".$isall.\",\".$criteria.\")\";\n //$accounts = DataTableSql::of($query)->getProcResult(array('AccountID','AccountName'));\n //return $accounts->make();\n return DataTableSql::of($query)->make();\n }", "function admin_list(){\n\t\t\n\t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",VENDOR_LISTING);\n\t\t$conditions = array(\"Vendor.is_deleted\"=>\"0\");\n\t\t\n\t\t$name = isset($this->params['url']['name'])?$this->params['url']['name']:(isset($this->params['named']['name'])?$this->params['named']['name']:\"\");\n\t\tif(trim($name) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.name like\"=>\"%\".trim($name).\"%\"));\n\t\t}\t\t\n\t\t\n\t\t$is_active = isset($this->params['url']['is_active'])?trim($this->params['url']['is_active']):(isset($this->params['named']['is_active'])?$this->params['named']['is_active']:\"\");\n\t\tif(trim($is_active) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.is_active\"=>$is_active));\n\t\t}\n\t\t\n\t\t$from = isset($this->params['url']['from'])?$this->params['url']['from']:(isset($this->params['named']['from'])?$this->params['named']['from']:\"\");\n\t\t$to = isset($this->params['url']['to'])?$this->params['url']['to']:(isset($this->params['named']['to'])?$this->params['named']['to']:\"\");\n \n\t\tif(trim($from) != \"\"){\n\t\t\t$from = $this->covertToSystemDate($from);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.created,'%Y-%m-%d') >=\"=>trim($from)));\n\t\t}\n\t\tif(trim($to) != \"\"){\n\t\t\t$to = $this->covertToSystemDate($to);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.created,'%Y-%m-%d') <=\"=>trim($to)));\n\t\t}\n\t\t\n\t\t$this->paginate = array('limit' =>VENDOR_LIMIT,'conditions'=>$conditions,'order'=>array(\"Vendor.created\"=>\"desc\"));\n\t\t$vendor_data = $this->paginate('Vendor'); \n\t\t$this->set('vendor_data',$vendor_data);\n\t}", "function getItems($data = '')\n {\n\n $filter_addr = '';\n $provider_id = $data['provider_id'];\n if($provider_id != '0') {\n $result = $this->db->select('address')\n ->from('tbl_userinfo')\n ->where('id', $provider_id)\n ->get()->result();\n\n if (count($result) > 0) {\n $filter_addr = $result[0]->address;\n $ss = explode(',', $filter_addr);\n unset($ss[count($ss) - 1]);\n $filter_addr = implode(',', $ss);\n }\n }\n\n $type = $data['searchType'];\n $name = $data['searchName'];\n $status = $data['searchStatus'];\n $shoptype = $data['searchShoptype'];\n if ($provider_id == '0') {\n $address = $data['address'];\n $auth = $data['searchAuth'];\n }\n $this->db->select('*');\n $this->db->from('tbl_userinfo');\n $this->db->where('type', 3);\n if(isset($data['start_date'])){\n if($data['start_date'] != '')\n $this->db->where('date(created_time)>=\\''. $data['start_date'] . '\\'');\n if($data['end_date'] != '')\n $this->db->where('date(created_time)<=\\''. $data['end_date'] . '\\'');\n }\n switch (intval($type)) {\n case 0: // account\n $likeCriteria = $name != '' ? (\"(userid LIKE '%\" . $name . \"%')\") : '';\n break;\n case 1: // name\n $likeCriteria = $name != '' ? (\"(username LIKE '%\" . $name . \"%')\") : '';\n break;\n case 2: // contact\n $likeCriteria = $name != '' ? (\"(address LIKE '%\" . $name . \"%')\") : '';\n break;\n case 3: // recommend\n $likeCriteria = $name != '' ? (\"(saleman_mobile LIKE '%\" . $name . \"%')\") : '';\n break;\n }\n if ($likeCriteria != '') $this->db->where($likeCriteria);\n\n if ($status != '0') $this->db->where('status', $status);\n if ($shoptype != '0') $this->db->where('shop_type', $shoptype);\n if ($provider_id == '0') {\n $likeCriteria = ($address != '') ? (\"(filter_addr LIKE '%\" . $address . \"%')\") : '';\n if ($address != '') $this->db->where($likeCriteria);\n\n if ($auth != '0') $this->db->where('auth', $auth);\n }else{\n $this->db->where('status', 1);\n $this->db->where('auth', 3);\n // range limitation\n if($filter_addr != '')\n $this->db->where('filter_addr', $filter_addr);\n }\n\n $this->db->order_by('id', 'desc');\n $query = $this->db->get();\n $result = $query->result();\n\n if (count($result) == 0) $result = NULL;\n return $result;\n }", "function ownerKeywordSearch($keyword,$currpg,$url)\n\t{ \n\t\t$sql = \"SELECT * FROM tblowner WHERE organization_name LIKE '%%%\" .$keyword .\"%%%' OR owner_name LIKE '%%%\" .$keyword .\"%%%' OR owner_address LIKE '%%%\" .$keyword .\"%%%'\"; \n\t\t$result = paging($sql, $currpg, $this->pagesize, $url); \n\t\treturn $result;\t\t\t\t\t\t// return result \n\t}", "public function adminsAutoComplete(Request $request)\n {\n $query = $request->get('query');\n $users = User::select([Constants::FLD_USERS_USERNAME . ' as name'])\n ->where(Constants::FLD_USERS_USERNAME, 'LIKE', \"%$query%\")\n ->where(Constants::FLD_USERS_USERNAME, '!=', Auth::user()[Constants::FLD_USERS_USERNAME])\n ->get();\n return response()->json($users);\n }", "public function userSearch (Request $request)\n { $user = User::find(Auth::id());\n \n if($request->search != null){\n $search = family::ilike($request->search);\n \n return response()->json($search);\n }\n }", "public function actionGetListBySearchQuery()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['query'])) {\n $vendorsList = array();\n\n // set query params\n $queryString = trim($_POST['query']);\n $options = array(\n 'search_option_com_name' => intval($_POST['search_option_com_name']),\n 'search_option_fed_id' => intval($_POST['search_option_fed_id']),\n 'search_option_addr1' => intval($_POST['search_option_addr1']),\n 'search_option_addr2' => intval($_POST['search_option_addr2']),\n 'search_option_city' => intval($_POST['search_option_city']),\n 'search_option_state' => intval($_POST['search_option_state']),\n 'search_option_zip' => intval($_POST['search_option_zip']),\n 'search_option_country' => intval($_POST['search_option_country']),\n 'search_option_phone' => intval($_POST['search_option_phone']),\n 'search_option_limit' => intval($_POST['search_option_limit']),\n );\n\n if(!$options['search_option_limit']) {$limit=0;}\n else {$limit=Aps::DISPLAY_LIMIT;}\n\n $sortOptions = array(\n 'sort_by' => $_POST['sort_type'],\n 'sort_direction' => $_POST['sort_direction'],\n );\n\n // set last search query params to session\n $_SESSION['last_w9_list_search']['query'] = $queryString;\n $_SESSION['last_w9_list_search']['options'] = $options;\n $_SESSION['last_w9_list_search']['sort_options'] = $sortOptions;\n\n // get vendors list\n $companies = new Companies();\n $vendorsList = $companies->getListByQueryString($queryString, $options, $sortOptions,$limit);\n\n $this->renderPartial('w9list', array(\n 'vendorsList' => $vendorsList,\n ));\n }\n }", "public function vendors()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventVendor', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "function search_for_users($needle)\n {\n $needle = trim($needle);\n if ($needle != '')\n {\n $user = $this->ion_auth->get_user();\n\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name, user_meta.grad_year, school_data.school\n FROM user_meta LEFT JOIN school_data ON user_meta.school_id = school_data.id\n WHERE MATCH(user_meta.first_name, user_meta.last_name) AGAINST (? IN BOOLEAN MODE)\n AND user_meta.user_id <> ?\";\n\n // Generate a string to exclude people the user is already following.\n $following_ids = $this->get_following_ids();\n if (count($following_ids) > 0)\n {\n $query_string .= \" AND user_meta.user_id <> '\" . implode(\"' AND user_meta.user_id <> '\", $following_ids) . \"'\";\n }\n $query_string .= ' LIMIT 15';\n\n $query = $this->db->query($query_string, array(str_replace(' ', '* ', $needle) . '*', $user->id));\n\n // Echo the results\n foreach ($query->result() as $row)\n {\n $this->echo_user_entry($row, 'add following', $profile_links_enabled = false);\n }\n }\n }", "public function index(){\n\t\tif(!$this->session->userdata(\"user_id\")){\n\t\t\treturn redirect(\"auth\");\n\t\t}else{\n\t\t\t$vendors = $this->vendors_model->get();\n\t\t\t$user = $this->membership_model->get_authenticated_user_by_id($this->session->userdata(\"user_id\"));\n\t\t\t$this->load->view('vendors/index',['user' => $user, 'vendors' => $vendors]);\n\t\t}\n\t}", "private function search($szuk, $options=[]){\n //$szuk=rawurldecode($szuk);\n \n $search_sm = $this::staticModel('Search');\n if($this->loggedin){\n if(in_array('users', $options)){\n $found = $search_sm::searchUsers($szuk, $options, $this->username);\n }\n elseif(in_array('dits', $options)){\n $found = $search_sm::searchDits($szuk, $options, $this->username);\n }\n else{\n $found = $search_sm::search($szuk, $options, $this->username);\n }\n }\n else{\n if(in_array('users', $options)){\n $found = $search_sm::searchUsers($szuk, $options);\n }\n elseif(in_array('dits', $options)){\n $found = $search_sm::searchDits($szuk, $options);\n }\n else{\n $found = $search_sm::search($szuk, $options);\n }\n }\n echo json_encode($found);\n }", "public function actionSearch(){\n $q = htmlentities($_GET['q']);\n if(!empty($q)){\n $result = array();\n $users = Users::find()->where('display_name LIKE \"'.$q.'%\" AND active = 1 AND authKey IS NULL')->limit(5)->all();\n $ul = '<ul class=\"search-results-ul col-md-3\">';\n foreach ($users as $key => $value) {\n $ul .= '<li><a href=\"' . Url::to(['user/profile/'.$value->display_name]) . '\"><img src=\"' . \\Yii::getAlias('@web/images/users/'.$value->profilePic) . '\" height=\"30\" class=\"img-circle\" style=\"margin-right: 10px\"> '.$value->display_name.'</a></li>';\n }\n $ul .= '</ul>';\n echo $ul;\n }\n }", "public function userSearch()\n {\n $query = $this->input->post('query');\n $data['results'] = $this->admin_m->search($query);\n $data['query'] = $query;\n $data['content'] = 'admin/searchResults';\n $this->load->view('components/template', $data);\n }", "function findcompanys() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_company->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_company->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_companys_search_result', $data);\n }", "public function getVendorData()\n {\n $ven = MasterVendor::latest()->get();\n return response([\n 'success' => true,\n 'message' => 'List All Vendor',\n 'data' => $ven\n ], 200);\n\n }", "public function getVendors()\n {\n return $this->hasMany(Vendor::className(), ['vendor_id' => 'vendor_id'])->viaTable('ven_balance', ['currency_id' => 'currency_id']);\n }", "public static function SearchOffer(){\n\n\n\n\t\t}", "public function searchUsersByQuery($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "function search_customerbuyersendusers($custID, $shiptoID = '', $query, $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$SHARED_ACCOUNTS = DplusWire::wire('config')->sharedaccounts;\n\t\t$search = QueryBuilder::generate_searchkeyword($query);\n\t\t$q = (new QueryBuilder())->table('custindex');\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep'] && DplusWire::wire('pages')->get('/config/')->restrict_allowedcustomers) {\n\t\t\t$custquery = (new QueryBuilder())->table('custperm')->where('custid', $custID);\n\t\t\tif (!empty($shiptoID)) {\n\t\t\t\t$custquery->where('shiptoid', $shiptoID);\n\t\t\t}\n\t\t\t$permquery = (new QueryBuilder())->table($custquery, 'custpermcust');\n\t\t\t$permquery->field('custid, shiptoid');\n\t\t\t$permquery->where('loginid', [$loginID, $SHARED_ACCOUNTS]);\n\t\t\t$q->where('(custid, shiptoid)','in', $permquery);\n\t\t} else {\n\t\t\t$q->where('custid', $custID);\n\t\t\tif (!empty($shiptoID)) {\n\t\t\t\t$q->where('shiptoid', $shiptoID);\n\t\t\t}\n\t\t}\n\t\t$fieldstring = implode(\", ' ', \", array_keys(Contact::generate_classarray()));\n\t\t$q->where('buyingcontact', '!=', 'N');\n\t\t$q->where('certcontact', 'Y');\n\t\t$q->where($q->expr(\"UCASE(REPLACE(CONCAT($fieldstring), '-', '')) LIKE []\", [$search]));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Contact');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "public function search($params, $env = '')\n {\n\n $tl = new TLmfApiProductInfoContact();\n $tl->setEnv($env);\n $query = $tl->find();\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 30,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'add_time' => SORT_DESC,\n 'update_time' => SORT_DESC,\n ]\n ],\n ]);\n\n// $params['UserProductBlacklistSearch']['id']=$params;\n// LogUtil::log(json_encode($params['UserProductBlacklistSearch']['id']));\n// $this->load($params);\n $productIdList = isset($params) ? $params : [];\n\n\n// if (!$this->validate()) {\n// // uncomment the following line if you do not want to return any records when validation fails\n// // $query->where('0=1');\n// return $dataProvider;\n// }\n\n $query->where(['in', 'product_id', $productIdList]);\n\n return $dataProvider;\n }", "function search()\n\t{\n\t\t$search = $this->input->post('search') != '' ? $this->input->post('search') : null;\n\t\t$limit_from = $this->input->post('limit_from');\n\t\t$lines_per_page = $this->Appconfig->get('lines_per_page');\n\n\t\t$suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from);\n\t\t$total_rows = $this->Supplier->get_found_rows($search);\n\t\t$links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows);\n\t\t$data_rows = get_supplier_manage_table_data_rows($suppliers, $this);\n\n\t\techo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));\n\t}", "public function getVendorName(): string;", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "function master_sidebar_author_quick_search( $request = array() ) {\n\n\n\tif ( ! empty( $request ) && isset( $request['q'] ) ) {\n\n\t\t// Define query args for author query \n\t\t$roles = array( 'Administrator', 'Editor', 'Author' ); \n\t\t$db_id = -9999;\n\n\t\t// Get all users that have author priviledges\n\t\tforeach ( $roles as $role ) {\n\n\t\t\t$search_query = $request['q'];\n\n\t\t\t$args = array(\n\t\t\t\t'search_columns' => array( 'ID', 'user_login', 'user_nicename', 'user_email' ),\n\t\t\t\t'role' => $role,\n\t\t\t);\n\t\n\t\t\t// The Query\n\t\t\t$user_query = new WP_User_Query( $args );\n\n\t\t\t// Output search results\n\t\t\tif ( ! empty( $user_query->results ) ) {\n\t\t\t\tforeach ( $user_query->results as $user ) {\n\t\t\t\t\tif ( false !== stripos( $user->data->display_name, $search_query ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<label class=\"menu-item-title\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value =\"1\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object-id]\" class=\"menu-item-checkbox\"> <?php echo $user->data->display_name; ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<input class=\"menu-item-db-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-db-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-object\" type=\"hidden\" value=\"<?php echo $user->data->ID; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-parent-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-parent-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-type\" type=\"hidden\" value=\"author_archive\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-type]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-title\" type=\"hidden\" value=\"<?php echo $user->data->display_name; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-title]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-url\" type=\"hidden\" value=\"<?php echo $user->data->user_url; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-url]\">\n\t\t\t\t\t\t</li>\t\t\t\t\t\t\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t$db_id++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} // endif\n}", "function wac_vendor_company($user){\n\t$company = get_user_meta($user->ID,'_vendor_company',true);\n\tif(!empty($company)){\n\t\treturn $company;\n\t}\n\t\n\treturn wac_vendor_name($user);\n}", "public function searchUsers(){\n\t\t$validator = Validator::make(Request::all(), [\n 'accessToken' => 'required',\n 'userId' => 'required',\n 'searchUser' => 'required',\n 'searchOption' => 'required'\n ]);\n if ($validator->fails()) {\n #display error if validation fails \n $this->status = 'Validation fails';\n $this->message = 'arguments missing';\n } else {\n \t$siteUrl=URL::to('/');\n\t\t\t$result=Request::all();\n\t\t\t$accesstoken = Request::get('accessToken');\n\t $user_id = Request::get('userId');\n\t\t\t$user_info = User::find($user_id);\n\t\t\tif(isset($user_info)){\n\t\t\t\t$user_id = $user_info->id;\n\t\t\t\t$location = $user_info->location;\t\n\t\t\t}else{\n\t\t\t\t$user_id = 0;\n\t\t\t\t$location = '';\n\t\t\t}\n\t\t\t$searchresult = array();\n\t\t\t$start =0; $perpage=10;\n\t\t\tif(!empty($user_info)){\n\t\t\t\tif($accesstoken == $user_info->site_token){\n\t\t\t\tif(!empty($result)) \n\t\t\t\t{\n\t\t\t\t\t$search = Request::get('searchUser');\n\t\t \t$searchOption = Request::get('searchOption');\n\t\t\t\t\tif($searchOption == 'People'){\n\t\t\t\t\t $searchqueryResult =User::where('id','!=',$user_id)->where('fname', 'LIKE', '%'.$search.'%')->orWhere('lname','LIKE', '%'.$search.'%')->orWhere('location','LIKE', '%'.$search.'%')->orWhere('summary','LIKE', '%'.$search.'%')->orWhere('headline','LIKE', '%'.$search.'%')->where('userstatus','=','approved')->orderBy('karmascore','DESC')->get();\n\t\t\t\t\t\tif(!empty($searchqueryResult)){\n\t\t\t\t\t \t\tforeach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t\t$receiver=$value->id;\n\t\t\t\t\t \t\t\t$receiverDetail = User::find($receiver);\n\t\t\t\t\t \t\t\t$meetingRequestPending = $receiverDetail->Giver()->Where('status','=','pending')->count();\n\t\t\t\t\t \t\t\t$commonConnectionData=KarmaHelper::commonConnection($user_id,$value->id);\n\t\t\t\t\t \t\t\t$getCommonConnectionData=array_unique($commonConnectionData);\n\t\t\t\t\t \t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\t\t$searchquery[$key]['meetingRequestPending']=$meetingRequestPending;\n\t\t\t\t\t \t\t\t$searchquery[$key]['noofmeetingspm']=$value->noofmeetingspm;\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t\t\t\t\t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}elseif($searchOption == 'Skills'){\n\t\t\t\t\t\t$skillTag = array(); \n\t\t \t \t$searchqueryResult = DB::table('tags')\n\t\t\t\t\t ->join('users_tags', 'tags.id', '=', 'users_tags.tag_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_tags.user_id')\n\t\t\t\t\t ->where('name', 'LIKE', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id', '!=', $user_id)\t\t\t \n\t\t\t\t\t ->groupBy('users_tags.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('tags.name', 'tags.id', 'users_tags.user_id', 'users.fname', 'users.lname','users.karmascore', 'users.email', 'users.piclink', 'users.linkedinid', 'users.linkedinurl', 'users.location', 'users.headline')\n\t\t\t\t\t //->skip($start)->take($perpage)\n\t\t\t\t\t ->get();\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t\t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t foreach ($searchquery as $key => $value) {\n\t\t\t\t\t\t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($value->user_id)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t\t\t\t\t\tforeach ($tags as $skillkey => $skillvalue) {\n\t\t\t \t \t\t\t$skillTag[$skillkey]['name'] = $skillvalue->name;\n\t\t\t \t \t\t}\n\t\t\t\t\t\t\t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $skillTag;\n\t\t\t \t \t\t//echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \t\t}\t\n\t\t \t \t\t\n\t\t \t \t\t\n\t\t \t \t}\n\t\t \t}elseif($searchOption == 'Location'){\n\t\t\t\t\t\t$searchqueryResult = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`karmascore`, `users`.`headline`, `users`.`location`, `users`.`id` As user_id from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where location LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where location LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location limit 10 offset '.$start )); \t\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Groups'){\t\t\t\t\n\t\t\t\t\t\t$searchqueryResult = DB::table('groups')\n\t\t\t\t\t ->join('users_groups', 'groups.id', '=', 'users_groups.group_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_groups.user_id')\n\t\t\t\t\t ->where('name', '=', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id','<>',$user_id)\t\n\t\t\t\t\t ->groupBy('users_groups.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('groups.name', 'groups.id', 'users_groups.user_id', 'users.fname', 'users.lname', 'users.email', 'users.piclink', 'users.linkedinid', 'users.karmascore', 'users.location', 'users.headline')\n\t\t\t\t\t ->get();\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n \t\t\t\t\t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t \t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t // echo \"<pre>\";print_r($searchquery);echo \"</pre>\";die;\n\t\t \t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Tags'){\n\t\t\t\t\t\t$searchquery = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`linkedinurl`, `users`.`headline`, `users`.`location`, `users`.`id` from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where headline LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where headline LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location = \"'.$location.'\" desc limit 10 offset'.$start )); \t\n\t\t\t\t\t //echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value->linkedinid;\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Failure';\n\t\t\t\t\t\t$this->message='There is no such category';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message\n\t\t\t\t \t\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($searchquery)){\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\t$this->message='There is no data available';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//return $searchresult;exit;\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->status = 'Failure';\n\t \t$this->message = 'You are not a login user.';\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->status = 'Failure';\n \t$this->message = 'You are not a current user.';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t \t'status'=>$this->status,\n\t\t\t \t'message'=>$this->message\n\t\t));\t\n\t\t\t\n\t}", "public function searchUser(){\n $this->validate(request(),[\n 'name' => 'required'\n ]);\n $users =User::where('name',request('name'))->orWhere('name', 'like', '%' . request('name') . '%')->get();\n return response()->json($users);\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "function listSoftware($search){\r\n\r\n $this->app->log->info(__CLASS__ . '::' . __METHOD__);\r\n $dao = new \\PNORD\\Model\\SoftwareDAO($this->app); \r\n return $dao->listSoftware($search); \r\n\r\n }", "public function usuarios()\n {\n $parametros = Input::only('term');\n\n $data = SisUsuario::with(\"SisUsuariosGrupos\", \"SisUsuariosContactos\")->where(function($query) use ($parametros) {\n $query->where('nombre','LIKE',\"%\".$parametros['term'].\"%\")\n ->orWhere('email','LIKE',\"%\".$parametros['term'].\"%\");\n });\n\n $data = $data->get();\n return $this->respuestaVerTodo($data);\n }", "function find_allusersearch_desc($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC\");\n }\n}", "function get_searchbyemailid($username,$emailaddress)\n{\n\tglobal $log;\n\tglobal $current_user;\n\trequire_once(\"modules/Users/Users.php\");\n\t$seed_user=new Users();\n\t$user_id=$seed_user->retrieve_user_id($username);\n\t$current_user=$seed_user;\n\t$current_user->retrieve_entity_info($user_id, 'Users');\n\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\trequire('user_privileges/sharing_privileges_'.$current_user->id.'.php');\n\t$log->debug(\"Entering get_searchbyemailid(\".$username.\",\".$emailaddress.\") method ...\");\n\t$query = \"select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname,\n\t\t\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.salutation,\n\t\t\t\t\tvtiger_contactdetails.email,vtiger_contactdetails.title,\n\t\t\t\t\tvtiger_contactdetails.mobile,vtiger_account.accountname,\n\t\t\t\t\tvtiger_account.accountid as accountid from vtiger_contactdetails\n\t\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\t\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\t LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\";\n\t$query .= getNonAdminAccessControlQuery('Contacts',$current_user);\n\t$query .= \"where vtiger_crmentity.deleted=0\";\n\tif(trim($emailaddress) != '') {\n\t\t$query .= \" and ((vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"') or vtiger_contactdetails.lastname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|') or vtiger_contactdetails.firstname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|')) and vtiger_contactdetails.email != ''\";\n\t} else {\n\t\t$query .= \" and (vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"' and vtiger_contactdetails.email != '')\";\n\t}\n\n\t$log->debug(\"Exiting get_searchbyemailid method ...\");\n\treturn $this->plugin_process_list_query($query);\n}", "public static function index($data) {\n\t\t$fields = ['vendorID|string'];\n\t\tself::sanitizeParametersShort($data, $fields);\n\t\t$validate = new Validators\\Map();\n\n\t\tif ($validate->vendorid($data->vendorID) === false) {\n\t\t\tself::pw('page')->js .= self::pw('config')->twig->render('purchase-orders/list.js.twig');\n\t\t\treturn self::vendorForm($data);\n\t\t}\n\t\treturn self::list($data);\n\t}", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public static function ADMIN_ARCHIVE_SEARCH_USER_TAG(){\n\t $SQL_String = \"SELECT * FROM user_tags WHERE owner=:owner AND tag_term=:tag;\";\n\t return $SQL_String;\n\t}", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}", "public function getCompanyWithUsers();", "public function getUserList(Request $request){\n $team_type=$request->input('team_type');\n $term=$request->input('term');\n $challenge_id=$request->input('challenge_id');\n\n\n if(strlen($term) > 0)\n {\n $term=\"%\". $term .\"%\";\n $users=User::availableUsers($challenge_id)\n ->select(\"id\", \"avatar_path\", \"team_name\", \"team_type\", \"city\", \"state\")\n \n // ->Where('email', 'LIKE', $term)\n \n ->where(function ($query) use ($term) {\n $query->orWhere('team_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('state', 'LIKE', $term)\n ->orWhere('city', 'LIKE', $term);\n })\n //->orWhere('last_name', 'LIKE', $term)\n // ->orWhere('username', 'LIKE', $term)\n //->orWhere('state', 'LIKE', $term)\n // ->orWhere('city', 'LIKE', $term)\n ->teamType($team_type)\n ->get();\n/*\n\npublic function availableItems()\n{\n $ids = \\DB::table('item_user')->where('user_id', '=', $this->id)->lists('user_id');\n return \\Item::whereNotIn('id', $ids)->get();\n}\n */\n \n return $users;\n }else{\n return json_encode(\"Please search change\"); \n }\n }", "function filter($value) {\n return strpos('vendors', $value) === false ? true : false;\n }", "public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }", "public function search()\n {\n if (!$this->current_user->has_permission('USER_LIST')) {\n return redirect();\n }\n\n $view_data = [\n 'menu_active' => 'li_user'\n ];\n\n $pagination = [\n 'page' => (int) $this->input->get_or_default('p', 1),\n 'limit' => (int) $this->input->get_or_default('limit', PAGINATION_DEFAULT_LIMIT)\n ];\n\n $pagination['offset'] = ($pagination['page'] - 1) * $pagination['limit'];\n\n // Get list users\n $users = $this->_api('user')->search_list(array_merge($this->input->get(), [\n 'limit' => $pagination['limit'],\n 'offset' => $pagination['offset'],\n 'sort_by' => 'id',\n 'sort_position' => 'desc'\n ]), [\n 'with_deleted' => TRUE,\n 'point_remain_admin' => TRUE\n ]);\n\n if (isset($users['result'])) {\n $view_data['users'] = $users['result']['items'];\n $pagination['total'] = $users['result']['total'];\n }\n\n $view_data['search'] = $pagination['search'] = $this->input->get();\n $view_data['pagination'] = $pagination;\n $view_data['csv_download_string'] = '/user/download_csv?' . http_build_query($this->input->get());\n\n $this->_breadcrumb = [\n [\n 'link' => '/user/search',\n 'name' => 'ユーザー検索'\n ]\n ];\n\n return $this->_render($view_data);\n }", "public function post_search(){\n\n\t\t$income_data \t\t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$data \t\t\t\t= \tarray();\n\t\t$data[\"page\"] \t\t= \t'admin.users.search';\n\t\t$data[\"listing_columns\"] = static::$listing_fields;\n\t\t$data[\"users\"] \t\t= \tarray();\n\n\t\tif($income_data[\"value\"] && $income_data[\"field\"]){\n\n\t\t\t$type = (in_array($income_data[\"type\"], array('all', 'equal', 'like', 'soundex', 'similar'))) ? $income_data[\"type\"] : 'all';\n\t\t\t$type = ($type == 'equal') ? '=' : $type;\n\n\t\t\tif($type == 'all'){\n\t\t\t\t\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], 'like', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'soundex', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'similar', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], $type, $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t}\n\n\n\t\t\tif(Admin::check() != 777 && $data[\"users\"]){\n\t\t\t\t\n\t\t\t\tforeach($data[\"users\"] as $row => $column) {\n\n\t\t\t\t\tif(isset($column->email)){\n\n\t\t\t\t\t \tlist($uemail, $domen) \t\t\t= \texplode(\"@\", $column->email);\n\t\t\t\t\t\t$data[\"users\"][$row]->email \t= \t\"******@\".$domen;\n\t\t\t\t\t\t$data[\"users\"][$row]->name \t\t= \t\"***in\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!$data[\"users\"]){\n\n\t\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_result'));\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_request'));\n\t\t}\n\n\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('admin.assets.no_ajax', $data);\n\t}", "function listBrand($search){\r\n\r\n $this->app->log->info(__CLASS__ . '::' . __METHOD__);\r\n $dao = new \\PNORD\\Model\\BrandDAO($this->app); \r\n return $dao->listBrand($search); \r\n\r\n }", "public function searchUsers($patern)\n {\n \n $response = $this->buzz->get('https://api.github.com/search/users?q='.$patern);\n\n\n\treturn json_decode($response->toDomDocument()->textContent)->items;\n }", "public function getVendors(string $userID) {\n return $this->getCustomersOrVendors(FALSE, $userID);\n }" ]
[ "0.6522265", "0.64070505", "0.63639617", "0.62607735", "0.62493575", "0.62388426", "0.6212094", "0.6181377", "0.6116254", "0.6110841", "0.6058671", "0.6051379", "0.6045634", "0.603381", "0.6016279", "0.60091215", "0.5976708", "0.5961105", "0.5955323", "0.592257", "0.589258", "0.5892466", "0.5892466", "0.58640844", "0.5850152", "0.58498055", "0.5849276", "0.58303165", "0.5822557", "0.5821266", "0.5813586", "0.57826006", "0.5748627", "0.5724842", "0.57042575", "0.5695842", "0.5694048", "0.569125", "0.56894106", "0.568178", "0.5675966", "0.5675655", "0.5669843", "0.5662386", "0.5662386", "0.5653737", "0.56526387", "0.5649236", "0.56488013", "0.56435865", "0.5643062", "0.56299096", "0.5608411", "0.5602584", "0.55963236", "0.55921155", "0.5567329", "0.55655056", "0.5562671", "0.55504036", "0.5546074", "0.5538664", "0.55325663", "0.55293053", "0.55197716", "0.55190945", "0.54991645", "0.5496081", "0.54888976", "0.5485012", "0.54835385", "0.5477562", "0.54743093", "0.54732865", "0.5469534", "0.5469392", "0.5468194", "0.54643846", "0.54512787", "0.54430366", "0.54400784", "0.543824", "0.5430352", "0.54265034", "0.54216856", "0.54191107", "0.54178214", "0.5415081", "0.5415081", "0.5414949", "0.54109657", "0.54090756", "0.5404917", "0.5398117", "0.5396744", "0.53948146", "0.5391033", "0.53873396", "0.5383629", "0.53802085" ]
0.6957608
0
Display a listing of the Uploads.
public function index() { $module = Module::get('Uploads'); if(Module::hasAccess($module->id)) { return View('la.uploads.index', [ 'show_actions' => $this->show_action, 'listing_cols' => $this->listing_cols, 'module' => $module ]); } else { return redirect(config('laraadmin.adminRoute')."/"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index() {\n $this->data['title'] = \"Uploads\";\n $viewContent = $this->load->view('uploads/index', $this->data, true);\n renderWithLayout(array('content' => $viewContent), 'admin');\n }", "public function index()\n {\n $uploads=Auth::guard('team')->user()->uploads;\n $upload_names=UploadName::all();\n \n return view('team.uploads.index',compact('upload_names','uploads'));\n }", "public function listCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\t$this->outputLine($file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine();\n\t\t$this->outputLine(sprintf('%s temporary file(s).', $counter));\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MHProductsBundle:Upload')->findAll();\n\n return $this->render('MHProductsBundle:Upload:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n $files = Upload::all();\n return view('upload', compact('files'));\n }", "public function show(Upload $upload)\n {\n //\n }", "public function show(Upload $upload)\n {\n //\n }", "public function actionIndex()\n {\n try {\n $model = new Upload();\n $info = $model->upImage();\n\n\n $info && is_array($info) ?\n exit(Json::htmlEncode($info)) :\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => 'error'\n ]));\n\n\n } catch (\\Exception $e) {\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => $e->getMessage()\n ]));\n }\n }", "public function index(Request $request)\n {\n $upload = Upload::with(['tbluploadtypes'])->get()->sortByDesc('id');\n\t\t\n\t\treturn view('admin.upload.index', compact('upload'));\n\t}", "public function index()\n {\n $images = File::all();\n return view('view-uploads')->with('images', $images);\n }", "public function index()\n {\n //\n $photos = Upload::all();\n return view('uploaded-images', compact('photos'));\n }", "public function index()\n {\n return view('lecturer::result.upload.index');\n }", "public function index()\n {\n $uploader = \\App\\Uploader::orderBy('created_at', 'desc')->paginate(5);\n return view('uploader.index')->with('uploaders',$uploader);\n }", "public function index()\n {\n return view('files.upload')->render();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $files = $em->getRepository('TikaBundle:UpFile')->findAllOrdered();\n\n return array(\n 'files' => $files,\n );\n }", "public function index()\n {\n $data = $this->searchFiles();\n $datasources = Datasource::get(['id', 'datasource_name']);\n\n return view('uploaded_file.index', ['data' => $data, 'datasources' => $datasources]);\n\n // return view('upload.index');\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function display()\n\t{\n\t\t$this->list_table->prepare_items( $this->orderby );\n\n\t\t$this->form_start_get( 'process-all-items', null, 'process-all-items' );\n\t\t\t?><button>Process All Items</button><?php\n\t\t$this->form_end();\n\t\t\n\t\t$this->form_start_get( 'clear', null, 'clear' );\n\t\t\t?><button>Clear Items</button><?php\n\t\t$this->form_end();\n\n\t\t$this->form_start( 'upload-table' );\n\t\t\t$this->list_table->display();\n\t\t$this->form_end();\n\t}", "public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "public function index()\n {\n return view('upload.index');\n }", "public function index()\n\t{\n return View::make('uploads.index');\n\t}", "public function index(){\n\t\tview('upload/index');\n\t}", "public function assetThumbnailListAction() {\n\t\t$parentFolder = $this->document->getElement ( \"parentFolder\" );\n\t\tif ($parentFolder) {\n\t\t\t$parentFolder = $parentFolder->getElement ();\n\t\t}\n\t\t\n\t\tif (! $parentFolder) {\n\t\t\t// default is the home folder\n\t\t\t$parentFolder = Asset::getById ( 1 );\n\t\t}\n\t\t\n\t\t// get all children of the parent\n\t\t$list = new \\Asset\\Listing ();\n\t\t$list->setCondition ( \"path like ?\", $parentFolder->getFullpath () . \"%\" );\n\t\t\n\t\t$this->view->list = $list;\n\t}", "public function indexAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return $this->setNoRender();\n }\n\n // Must be able to create albums\n if (!Engine_Api::_()->authorization()->isAllowed('album', $viewer, 'create')) {\n return $this->setNoRender();\n }\n\n $this->view->upload_button = $this->_getParam('upload_button', 0);\n $this->view->upload_button_title = $this->_getParam('upload_button_title', 'Add New Photos');\n }", "public function index()\n {\n $categories = Category::all();\n return view('pages.upload', compact('categories'));\n }", "public function index()\n {\n\n $this->types->trackFilter();\n\n return view('site::file.index', [\n 'repository' => $this->files,\n 'items' => $this->files->paginate(config('site.per_page.file', 10), ['files.*'])\n ]);\n }", "public function index(){\n //Load configuration\n $this->loadModel('Upload.Uploads');\n //Retrieves the last 35 logs\n $uploads = $this->Uploads->find('all', ['order' => ['created desc'], 'limit' => 35]);\n\n return $this->set(compact('uploads'));\n }", "public function index()\n {\n //\n return view('upload.index');\n }", "public function show(ImageUploads $imageUploads)\n {\n //\n }", "public function showList()\n\t{\n\t\t$images = array();\n\t\tif (Auth::user()->name == \"admin\") {\n\t\t\t$images = DB::table('images')->get();\n\t\t} else {\n\t\t\t$images = DB::table('images')\n\t\t\t\t->where('created_by', '=', Auth::user()->name)\n\t\t\t\t->get();\n\t\t}\n\n\t\treturn view('admincp.listImage', ['images' => $images]);\n\t}", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t$u->url = $upload->url;\n\t\t\t\t$u->thumbnails = $upload->thumbnails;\n\t\t\t\t$u->path = $upload->path;\n\t\t\t\t$u->type = $upload->type;\n\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function index()\n {\n $files=File::where('user_id',auth()->user()->id)->paginate(10);\n return view ('admin.files.index',compact('files'));\n }", "public function index()\n {\n $files = Files::where('uid', Auth::user()->id);\n\n return view('files.index')->with([\n 'files' => $files,\n ]);\n }", "public function showbulkupload(Request $req){\n\treturn view('bulkupload');\n }", "function upl() \n\t{\n\t$this->view->title = 'upload';\n\t$this->view->render($this->route.'/upl'); \n\t}", "public function index()\n {\n $my_tablet_id = Config::get('constants.TABLET_ID');\n $my_user_id = Config::get('constants.USER_ID');\n\n \n $my_uploads = Upload::where('tablet_users_id', '=', $my_tablet_id)->get();\n \n Log::info($my_uploads);\n \n return $my_uploads;\n }", "public function getIndex() {\n return view('upload');\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n return view('file_upload/index');\n }", "public function listAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $photo_id = (int) $this->_getParam('photo_id');\n\n // CHECK AUTHENTICATION\n // CHECK AUTHENTICATION\n if (Engine_Api::_()->core()->hasSubject('sitereview_listing')) {\n $sitereview = $subject = Engine_Api::_()->core()->getSubject('sitereview_listing');\n } else if (Engine_Api::_()->core()->hasSubject('sitereview_photo')) {\n $photo = $subject = Engine_Api::_()->core()->getSubject('sitereview_photo');\n $listing_id = $photo->listing_id;\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n }\n $bodyResponse = $tempResponse = array();\n $listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n $listingtype_id = $this->_listingType->listingtype_id;\n //AUTHORIZATION CHECK\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $photoCount = Engine_Api::_()->getItem('sitereviewpaidlisting_package', $sitereview->package_id)->photo_count;\n $paginator = $sitereview->getSingletonAlbum()->getCollectiblesPaginator();\n\n if (Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"photo\")) {\n $allowed_upload_photo = $allowed_upload_photo;\n if (empty($photoCount))\n $allowed_upload_photo = $allowed_upload_photo;\n elseif ($photoCount <= $paginator->getTotalItemCount())\n $allowed_upload_photo = 0;\n } else\n $allowed_upload_photo = 0;\n } else\n $allowed_upload_photo = $allowed_upload_photo;\n\n //GET ALBUM\n $album = $sitereview->getSingletonAlbum();\n\n\n /* RETURN THE LIST OF IMAGES, IF FOLLOWED THE FOLLOWING CASES: \n * - IF THERE ARE GET METHOD AVAILABLE.\n * - iF THERE ARE NO $_FILES AVAILABLE.\n */\n if (empty($_FILES) && $this->getRequest()->isGet()) {\n $requestLimit = $this->getRequestParam(\"limit\", 10);\n $page = $requestPage = $this->getRequestParam(\"page\", 1);\n\n //GET PAGINATOR\n $album = $sitereview->getSingletonAlbum();\n $paginator = $album->getCollectiblesPaginator();\n\n $bodyResponse[' totalPhotoCount'] = $totalItemCount = $bodyResponse['totalItemCount'] = $paginator->getTotalItemCount();\n $paginator->setItemCountPerPage($requestLimit);\n $paginator->setCurrentPageNumber($requestPage);\n // Check the Page Number for pass photo_id.\n if (!empty($photo_id)) {\n for ($page = 1; $page <= ceil($totalItemCount / $requestLimit); $page++) {\n $paginator->setCurrentPageNumber($page);\n $tmpGetPhotoIds = array();\n foreach ($paginator as $photo) {\n $tmpGetPhotoIds[] = $photo->photo_id;\n }\n if (in_array($photo_id, $tmpGetPhotoIds)) {\n $bodyResponse['page'] = $page;\n break;\n }\n }\n }\n\n if ($totalItemCount > 0) {\n foreach ($paginator as $photo) {\n $tempImages = $photo->toArray();\n\n // Add images\n $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($photo);\n $tempImages = array_merge($tempImages, $getContentImages);\n\n $tempImages['user_title'] = $photo->getOwner()->getTitle();\n $tempImages['likes_count'] = $photo->likes()->getLikeCount();\n $tempImages['is_like'] = ($photo->likes()->isLike($viewer)) ? 1 : 0;\n \n //Sitereaction Plugin work start here\n if (Engine_Api::_()->getApi('Siteapi_Feed', 'advancedactivity')->isSitereactionPluginLive()) {\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitereaction') && Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereaction.reaction.active', 1)) {\n $popularity = Engine_Api::_()->getApi('core', 'sitereaction')->getLikesReactionPopularity($photo);\n $feedReactionIcons = Engine_Api::_()->getApi('Siteapi_Core', 'sitereaction')->getLikesReactionIcons($popularity, 1);\n $tempImages['reactions']['feed_reactions'] =$tempImages['feed_reactions'] = $feedReactionIcons;\n\n if (isset($viewer_id) && !empty($viewer_id)) {\n $myReaction = $photo->likes()->getLike($viewer);\n if (isset($myReaction) && !empty($myReaction) && isset($myReaction->reaction) && !empty($myReaction->reaction)) {\n $myReactionIcon = Engine_Api::_()->getApi('Siteapi_Core', 'sitereaction')->getIcons($myReaction->reaction, 1);\n $tempImages['reactions']['my_feed_reaction'] =$tempImages['my_feed_reaction'] = $myReactionIcon;\n }\n }\n }\n }\n //Sitereaction Plugin work end here\n if (!empty($viewer) && ($tempMenu = $this->getRequestParam('menu', 1)) && !empty($tempMenu)) {\n $menu = array();\n\n if ($photo->user_id == $viewer_id) {\n $menu[] = array(\n 'label' => $this->translate('Edit'),\n 'name' => 'edit',\n 'url' => 'listings/photo/edit/' . $sitereview->getIdentity(),\n 'urlParams' => array(\n \"photo_id\" => $photo->getIdentity()\n )\n );\n\n $menu[] = array(\n 'label' => $this->translate('Delete'),\n 'name' => 'delete',\n 'url' => 'listings/photo/delete/' . $sitereview->getIdentity(),\n 'urlParams' => array(\n \"photo_id\" => $photo->getIdentity()\n )\n );\n }\n $menu[] = array(\n 'label' => $this->translate('Share'),\n 'name' => 'share',\n 'url' => 'activity/index/share',\n 'urlParams' => array(\n \"type\" => $photo->getType(),\n \"id\" => $photo->getIdentity()\n )\n );\n\n $menu[] = array(\n 'label' => $this->translate('Report'),\n 'name' => 'report',\n 'url' => 'report/create/subject/' . $photo->getGuid()\n );\n\n $menu[] = array(\n 'label' => $this->translate('Make Profile Photo'),\n 'name' => 'make_profile_photo',\n 'url' => 'members/edit/external-photo',\n 'urlParams' => array(\n \"photo\" => $photo->getGuid()\n )\n );\n\n $tempImages['menu'] = $menu;\n }\n\n if (isset($tempImages) && !empty($tempImages))\n $bodyResponse['images'][] = $tempImages;\n }\n }\n $bodyResponse['canUpload'] = $allowed_upload_photo;\n $this->respondWithSuccess($bodyResponse, true);\n } else if (isset($_FILES) && $this->getRequest()->isPost()) { // UPLOAD IMAGES TO RESPECTIVE EVENT\n if (empty($viewer_id) || empty($allowed_upload_photo))\n $this->respondWithError('unauthorized');\n $tablePhoto = Engine_Api::_()->getDbtable('photos', 'sitereview');\n $db = $tablePhoto->getAdapter();\n $db->beginTransaction();\n\n try {\n $viewer = Engine_Api::_()->user()->getViewer();\n $album = $sitereview->getSingletonAlbum();\n $rows = $tablePhoto->fetchRow($tablePhoto->select()->from($tablePhoto->info('name'), 'order')->order('order DESC')->limit(1));\n $order = 0;\n if (!empty($rows)) {\n $order = $rows->order + 1;\n }\n $params = array(\n 'collection_id' => $album->getIdentity(),\n 'album_id' => $album->getIdentity(),\n 'listing_id' => $sitereview->getIdentity(),\n 'user_id' => $viewer->getIdentity(),\n 'order' => $order\n );\n $photoCount = count($_FILES);\n if (isset($_FILES['photo']) && $photoCount == 1) {\n $photo_id = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->createPhoto($params, $_FILES['photo'])->photo_id;\n if (!$sitereview->photo_id) {\n $sitereview->photo_id = $photo_id;\n $sitereview->save();\n }\n } else if (!empty($_FILES) && $photoCount > 1) {\n foreach ($_FILES as $photo) {\n Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->createPhoto($params, $photo);\n }\n }\n\n $db->commit();\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n }\n }\n }", "public function listing()\n\t{\n # Load view\n $view = View::make('admin.files_library.listing');\n $view->with('listing_title', 'All Files');\n\n # Fetch all files\n $files = FileLibrary::select('*')->withLanguage(Input::get('lang', LANG));\n\n # Filtration\n $year_month = Input::get('yearmonth');\n if ($year_month) {\n $files->whereRaw('DATE_FORMAT(uploaded_date, \"%y%m\") = ?', [$year_month]);\n $year_month = str_split($year_month, 2);\n $view->with('listing_title', date('Y F', mktime(0, 0, 0, $year_month[1], 0, $year_month[0])));\n }\n\n # Searching\n $keywords = Input::get('search');\n if ($keywords) {\n $files->where('file_path', 'LIKE', '%'.$keywords.'%');\n $view->with('listing_title', 'Search Result: ' . $keywords);\n }\n\n # Ordering\n $files->orderBy('uploaded_date', 'desc');\n\n # Pagination\n $per_page = Input::get('show', 10);\n $records = $files->paginate($per_page);\n\n\n $view->with('records', $records);\n\n # Data Grid\n $datagrid = DataGrid::make($records, [\n 'id' => ['title' => 'File', 'width' => '150px', 'callback' => [$this, 'filePathColumn']],\n 'file_path' => ['title' => 'Details', 'callback' => [$this, 'fileDetailsColumn']],\n 'uploaded_date' => ['width' => '150px', 'sort' => true, 'callback' => 'DataGrid::dateTimeFormat'],\n ]);\n\n $datagrid->actionRegister('Edit', 'edit', URL::admin('files-library/edit'));\n $datagrid->actionRegister('Delete', 'delete', URL::admin('files-library/delete'));\n\n $datagrid->bulkActions(['delete']);\n $datagrid->singleActions(['edit','delete']);\n\n $view->with('datagrid', $datagrid);\n\n # Get files archive\n $view->with('archives', FileLibrary::archiveList());\n\n # Breadcrumbs\n Breadcrumbs::add('File Library', URL::admin('files-library'));\n\n return $view;\n\t}", "function ajaxlistfiles(){\n\n\t\t//Glob all files in uploaddir\n\t\t$files = array();\n\t\tforeach(glob($this->uploaddir.'*') as $file){\n\n\t\t\t//Strip path\n\t\t\t$filename = str_replace($this->uploaddir,'',$file);\n\n\t\t\t$files[$filename]['filename']=$filename;\n\t\t\t$files[$filename]['filesize']=filesize($file) / 1024 / 1024; //Mb\n\t\t\t$files[$filename]['modified']=filemtime($file); //Mb\n\n\t\t\t//Check torrent\n\t\t\tif( file_exists( $this->torrentdir.$filename.'.torrent' )){\n\n\t\t\t\t//Add torrent file\n\t\t\t\t$files[$filename]['torrent']=$filename.'.torrent';\n\n\t\t\t\t//Check database table phptracker_peers for torrent peers:\n\t\t\t\tif($torrent = $this->Torrent->findByName($filename)){\n\t\t\t\t\tif($peers = $this->Peer->findAllByInfoHash($torrent['Torrent']['info_hash'])){\n\t\t\t\t\t\t$files[$filename]['peers']=$peers;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->set('files',$files);\n\n\t\t$this->layout = 'ajax';\n\t}", "public function indexAction(){\n\t\t\t$this->library->load('upload');\n\n\t\t\t//Goi den phuong thuc upload\n\t\t\t$this->library->upload->upload();\n\t\t}", "public function getuseruploads(){\n $data = sofa::all();\n return view('admin.usersofa')->with('data',$data);\n }", "public function viewAllFiles()\n {\n $totalEnabledFiles = File::where('status', 1)->count();\n $enabledFiles = File::where('status', 1)->latest()->paginate(30, ['*'], 'enabledTable');\n $totaldisabledFiles = File::where('status', 1)->count();\n $disabledFiles = File::where('status', 0)->latest()->paginate(30, ['*'], 'disabledTable');\n return view('admin.file.viewAllFiles', compact('totalEnabledFiles', 'enabledFiles', 'totaldisabledFiles', 'disabledFiles'));\n }", "public function listview() {\n\n $photo_list = Doctrine::getTable('Photo')->findAll();\n $data['photo_list'] = $photo_list;\n\n $data['view_name'] = \"photo_list_view\";\n $this->load->view(\"admin/common/template\", $data);\n }", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function index()\r\n {\r\n $transfers = Transfer::paginate(10);\r\n return view('backend.transfers.transfers_list', compact('transfers'));\r\n }", "public function getAllUploads() {\n return Upload::all();\n }", "public function getUpload()\n\t{\n\t\treturn View::make('teaser.getUpload');\n\t}", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->hash = $upload->hash;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t$u->caption = $upload->caption;\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\t\n\t\t\t// $folder = storage_path('/uploads');\n\t\t\t// $files = array();\n\t\t\t// if(file_exists($folder)) {\n\t\t\t// $filesArr = File::allFiles($folder);\n\t\t\t// foreach ($filesArr as $file) {\n\t\t\t// $files[] = $file->getfilename();\n\t\t\t// }\n\t\t\t// }\n\t\t\t// return response()->json(['files' => $files]);\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function index()\n {\n $albums = PhotoManager::getAlbums(24);\n\n return view('photos.list', ['albums' => $albums]);\n }", "public function upload_files_page(){\r\n\t\t$max_filesize = $this->get_max_filesize();\r\n\t\t$max_file = $this->get_max_files();\r\n\t\tinclude($this->admin_url . 'view/market-reports-upload-files.php');\r\n\t}", "public function index()\n {\n $files = $this->files\n ->getFilesPaginated(config('core.sys.file.default_per_page'))\n ->items();\n return $this->handler\n ->apiResponse($files);\n }", "public function actionImageListing()\n {\n \t ob_start();\n \t Yii::app()->theme='back';\n \t $model=new HomeImages;\n \n $rec= HomeImages::model()->findAll(); \n \t $this->render('imagelisting',array('model'=>$model,'list'=>$rec));\n }", "public function uploadfiles()\n {\n return view ('filemanager.uploadfile'); \n }", "public function index()\n {\n $homeworks = Homework::all();\n return view('uploads.index', compact('homeworks'));\n }", "public function index()\n\t{\n\n\t\t// Deleting anything?\n\t\tif (isset($_POST['delete']))\n\t\t{\n\t\t\t$checked = $this->input->post('checked');\n\n\t\t\tif (is_array($checked) && count($checked))\n\t\t\t{\n\t\t\t\t$result = FALSE;\n\t\t\t\tforeach ($checked as $pid)\n\t\t\t\t{\n\t\t\t\t\t$result = $this->upload_model->delete($pid);\n\t\t\t\t}\n\n\t\t\t\tif ($result)\n\t\t\t\t{\n\t\t\t\t\tTemplate::set_message(count($checked) .' '. lang('upload_delete_success'), 'success');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTemplate::set_message(lang('upload_delete_failure') . $this->upload_model->error, 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$records = $this->upload_model->find_all();\n\n\t\tTemplate::set('records', $records);\n\t\tTemplate::set('toolbar_title', 'Manage Upload');\n\t\tTemplate::render();\n\t}", "function fileList(){\n\t\tchdir('./../cloud/books/'); //Move to template directory\n\t\t\n\t\tif ($handle = opendir(getcwd())) { //Open dir\n\t\t echo '<ul class=\"list-group\">';\n\t\t while (false !== ($entry = readdir($handle))) { //While directory not end - return files list\n\t\t \tif ($entry != \".\" && $entry != \".DS_Store\" && $entry != \"..\") { //Filter trash\n\t\t \t\tif(is_dir($entry)){ //IF dir then return button with folder icon \n\t\t \t\t\techo '<a href=\"#\" class=\"list-group-item cat\"><i class=\"fa fa-folder-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}else{ //else return file button\n\t\t \t\t\t$FileInfo = new SplFileInfo($entry); //Get file info\n\t\t \t\t\t$ext = $FileInfo->getExtension(); //Get file extension\n\t\t \t\t\tif($ext == \"png\" or $ext == \"jpg\" or $ext == \"bmp\") //IF file is image then return button with image icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-image-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t\telse //Else return button with file-code icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t\t echo '</ul>';\n\t\t closedir($handle); //Close dir\n\t\t}\n\t}", "public function index()\n {\n $attachments = Attachment::paginate(5);\n $data = compact('attachments');\n return view('attachments.list',$data);\n }", "public function index($id)\n {\n\n $ListPicUpload['data'] = PicProduct::where('product_id',$id)->get();\n $ListPicUpload['id'] = $id;\n return view ('admin.Product.ListPicUpload',compact ('ListPicUpload'));\n }", "public function index()\n {\n return auth()->user()\n ->wishlist()\n ->with('files')\n ->latest()\n ->paginate(request('per_page', config('fleetcart_api.per_page', 10)));\n }", "public function index() {\n $rows = AdminUser::paginate(10);\n return View::make(\"CoreCms::user.listing\")->with(\"models\", $rows);\n }", "public function upload() {\n $index = \"index-1\";\n $menu = 'working_area';\n \n return view('upload', compact('index','menu'));\n }", "public function upload()\n {\n return view('pages/uploadFiles');\n }", "public function multiUpload()\n {\n $gallery_id = Input::get('gallery_id');\n $gallery = PhotoGallery::where('id', '=', $gallery_id)->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $flags = $this->language->getAllDataNoPagination();\n\n return view('cms.modules.multicms.photos_multiUp', compact('flags', 'gallery'), $data);\n\n }", "public function listing();", "public function index()\n {\n $allData = VisaStatus::all();\n return view('visa_file_upload', compact('allData'));\n }", "public function indexAction()\n {\n $listing = $this->listing( 'Panel\\Listing\\Users');\n\n return array( 'listing' => $listing );\n }", "public function index()\n {\n return view('Files.all');\n }", "public function actionIndex()\n {\n $upload_handler = new UploadHandler();\n }", "public function upload()\n {\n return view('pages.upload');\n }", "public function browse_users()\n {\n\t\t$user_list = DB::table('users')->select('id', 'name')->get();\n\n\t\t//what else? last seen? uploads?\n\t\t\n\t\t$table = '<table class=\"table table-striped table-responsive\"><thead><tr><th>Title</th><th>Type</th><th>Word Count</th></tr></thead><tbody>';\n\t\tforeach($user_list as $doc){\n\t\t\t$table .= '<tr><td><a href=\"/document/' . $doc->id . '\">' . $doc->title . '</a></td><td>' . $doc->type . '</td><td>' . $doc->word_count . '</td></tr>';\n\t\t}\n\t\t$table .= '</tbody></table>';\n\n return view('browse', ['table' => $table]);\n }", "public function index($page = null)\n {\n $url = sprintf('buckets/%d/vaults/%d/uploads.json', $this->bucket, $this->parent);\n\n $uploads = $this->client->get($url, [\n 'query' => [\n 'page' => $page,\n ],\n ]);\n\n return $this->response($uploads, Upload::class);\n }", "function images_list($piecemakerId = 0) {\n \tglobal $wpdb;\n\n \t$this->check_dir();\n \t$this->check_db();\n\n\t\t$list = \"<form name=\\\"\\\" action=\\\"\\\" method=\\\"post\\\"><p>\";\n\t\tif($piecemakerId !== 0) \n\t\t\t$list .= \"<input name=\\\"id\\\" value=\\\"\".$piecemakerId.\"\\\" type=\\\"hidden\\\">\";\n\t\telse \n\t\t\t$list .= \"\";\n\t\t\t$list .= \"<table class=\\\"form-table\\\">\";\n\t\t\t$list .= \"<input class=\\\"button-primary\\\" name=\\\"do\\\" value=\\\"Upload New Asset\\\" type=\\\"submit\\\" >\";\n\t\t\tif($piecemakerId == 0) \n\t\t\t\t$list .= \"<input class=\\\"button-primary\\\" name=\\\"action\\\" value=\\\"Delete Selected\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Are you sure?')\\\" title=\\\"Delete\\\">\";\n\n\n\t\t\t$list.=\"\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\" ><h3>&nbsp;</h3></th>\n\t\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\" ><h3>File</h3></th>\n\t\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\" ><h3>Filename</h3></th>\n\t\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\" ><h3>Upload Date</h3></th>\n\t\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\" ><h3>Operation</h3></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody> \";\n\n \t$sql = \"select `id`, `name`, `filename`, `date` from `\".$this->table_img_name.\"` order by `id`\";\n\t $images = $wpdb->get_results($sql, ARRAY_A);\n\n if(count($images) == \"0\") \n\t\t\t\t$list .= \"\t<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\n\t\t\t\t\t\t\t\t<td colspan=\\\"5\\\" style=\\\"text-align: center;\\\"><strong>There are currently no files</strong></td>\n\t\t\t\t\t \t\t</tr>\";\n\t else foreach($images as $img) {\n\n\t \t$uploadDate = date(\"d/m/Y\", $img['date']);\n\t \t$list .= \"\t<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\n\t\t\t\t\t\t\t\t<td width=\\\"5%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\t<input name=\\\"images[]\\\" type=\\\"checkbox\\\" value=\\\"\".$img['id'].\"\\\" />\n\t\t\t\t\t\t\t\t</td>\";\n\n\t\t\t\t$list.=\"\t\t<td style=\\\"text-align: center;\\\">\".$this->printImg($img['filename'], $img['name']).\"</td>\";\n\t\t\t\t$list.=\"\t\t<td style=\\\"text-align: center;\\\">\".$img['name'].\"</td>\n\t\t\t\t\t\t\t\t<td style=\\\"text-align: center;\\\">\".$uploadDate.\"</td>\n\t\t\t\t\t\t\t\t<td style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\t<form name=\\\"operations\\\" id=\\\"operations\\\" method=\\\"post\\\" action=\\\"\\\">\n\t\t\t\t\t\t\t\t\t\t<input name=\\\"imageId\\\" value=\\\"\".$img['id'].\"\\\" type=\\\"hidden\\\">\";\n\t\t\t if($piecemakerId === 0) \n\t\t\t\t\t$list .= \"\t\t\t<input class=\\\"delete\\\" name=\\\"action\\\" value=\\\"Delete\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Are you sure?')\\\" title=\\\"Delete\\\">\";\n\t\t\t else \n\t\t\t\t\t$list .= \"\t\t\t<input class=\\\"button-primary\\\" name=\\\"action\\\" value=\\\"Assign Image to Page\\\" type=\\\"submit\\\">\n\t\t\t\t\t\t\t\t\t\t<input name=\\\"id\\\" value=\\\"\".$piecemakerId.\"\\\" type=\\\"hidden\\\">\n\t\t\t\t\t\t\t\t\t\t<input name=\\\"do\\\" value=\\\"Add Slide\\\" type=\\\"hidden\\\">\";\n\t\t\t $list .= \"\t\t\t</form>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t </tr>\";\n\t }\n\n\t\t\t$list .= \"</tbody>\n\t\t\t\t</table>\";\n\n\t\t\t$list .= \"<br />\";\n\n\t\t\t$list .= \"<input class=\\\"button-primary\\\" name=\\\"do\\\" value=\\\"Upload New Asset\\\" type=\\\"submit\\\" >\";\n\t\t\tif($piecemakerId == 0) \n\t\t\t\t$list .= \"<input class=\\\"button-primary\\\" name=\\\"action\\\" value=\\\"Delete Selected\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Are you sure?')\\\" title=\\\"Delete\\\">\";\n\n\t\t\tif($piecemakerId !== 0) \n\t\t\t\t$list .= \"<input name=\\\"id\\\" value=\\\"\".$piecemakerId.\"\\\" type=\\\"hidden\\\">\";\n\n\t\t\tif($piecemakerId == 0) \n\t\t\t\t$list .= \"\";\n\t\t\telse\n\n\t\t\t$list .= \"</form>\";\n\n echo $list;\n }", "public function index()\n {\n //\n\n $perfiles = Perfiles::select(DB::raw(\"count(id_perfil) as nuser, perfiles.id, perfiles.nombre\"))\n ->leftJoin('usuarios', 'usuarios.id_perfil', '=', 'perfiles.id')\n ->groupby('id_perfil', 'perfiles.id', 'perfiles.nombre')->get();\n return view('perfiles.admin', compact('perfiles'));\n }", "public function index() {\n $albums = Album::get();\n return view('admin.add-photos')->with(['page_name' => 'add-photos', 'albums' => $albums]);\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "public function index()\r\n {\r\n $avatar = $this->db->select(\"*\")->where('status',1)->get('avatar')->result_array();\r\n\r\n $lists = [];\r\n $this->_vd['personal_work'] = $lists;\r\n $this->_vd['avatarList'] = $avatar;\r\n $this->_view('personal/index');\r\n }", "public function index()\n {\n $image = Image::all();\n return $this->showAll($image);\n }", "public function render()\n\t{\n\t\t$name = $this->_obj->getId();\n\t\t$prefix = Core::getController('medias');\n\t\tif (! $prefix) {\n\t\t\t$prefix = '/t41/medias/';\n\t\t}\n\t\t$uri = $prefix . 'upload';\n\t\tView::addCoreLib(array('core.js','locale.js','view.js','uploader.css','view:action:upload.js'));\n\t\tView::addEvent(sprintf(\"t41.view.register('%s_ul', new t41.view.action.upload(jQuery('#%s_ul'),'%s'))\", $name, $name, $uri), 'js');\n\t\t\n\t\t$html = '';\n\t\t// @todo code media deletion JS\n\t\tif (($this->_obj->getValue()) != null) {\n\t\t\t$html .= sprintf('<span><a href=\"%s\" target=\"_blank\">%s %s</a> | <a href=\"#\" onclick=\"t41.view.get(\\'%s_ul\\').reset(this)\">%s</a></span>'\n\t\t\t\t\t, MediaElement::getDownloadUrl($this->_obj->getValue()->getUri())\n\t\t\t\t\t, 'Télécharger'\n\t\t\t\t\t, $this->_obj->getValue()->getLabel()\n\t\t\t\t\t, $name\n\t\t\t\t\t, 'Supprimer'\n\t\t\t);\n\t\t}\n\t\t$html .= sprintf('<div id=\"%s_ul\" class=\"qq-upload-list\"></div>', $this->_nametoDomId($name));\n\t\t$html .= sprintf('<input type=\"hidden\" name=\"%s\" id=\"%s\" value=\"%s\" class=\"hiddenfilename\"/>'\n\t\t\t\t, $name\n\t\t\t\t, $this->_nametoDomId($name)\n\t\t\t\t, $this->_obj->getValue() ? $this->_obj->getValue()->getIdentifier() : null\n\t\t);\n\t\t\n\t\treturn $html;\n\t\t\n\t\t$action = new UploadAction($this->_obj);\n\t\t\n\t\t$deco = View\\Decorator::factory($action);\n\t\t$deco->render();\n\t\t\n\t\treturn $html . \"\\n\";\n\t}", "function showUploadPage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->getEngine()->assign('oLicenseSet', $this->getModel()->getLicenseList($this->getController()->getRequest()->getSession()->getUser()->getID()));\n\t\t$this->getEngine()->assign('eventID', $this->getModel()->getEventID());\n\t\t//$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css'));\n\t\t$this->addCssResource(new mvcViewCss('jscss', mvcViewCss::TYPE_FILE, '/libraries/jquery-ui/themes/smoothness/jquery-ui.css'));\n\t\t$this->addCssResource(new mvcViewCss('styleWizardCss', mvcViewCss::TYPE_FILE, '/libraries/jquery-plugins/smartWizard2/styles/smart_wizard.css'));\n\t\t\n\t\t$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/uploadify-v3.1/uploadify.css'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadify', mvcViewJavascript::TYPE_FILE, '/libraries/uploadify-v3.1/jquery.uploadify-3.1.min.js'));\n\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadifv3', mvcViewJavascript::TYPE_INLINE, \"$('#FileUpload').uploadify({\n\t\theight : 30,\n\t\tfileObjName : 'Files',\t\n\t\tswf : '/libraries/uploadify-v3.1/uploadify.swf',\n\t\tuploader : '{$this->buildUriPath(uploadController::ACTION_DO_UPLOAD)}',\n\t\twidth : 120,\n\t\t'fileSizeLimit' : '500MB',\t\n\t\tfileTypeExts : '*.mp4;*.mov;*.avi;*.mpg;*.wmv;*.m4v',\n\t\t'onUploadSuccess' : function(file, data, response) {\n\t\t\t\t$('#fileNameStored').val(data);\n\t\t\t\t$('#uploadStatus').val(\\\"\\\");\n\t\t\t\t$('#msg_filename').text(\\\"Upload done : \\\"+file.name);\n },\n\t\t'onUploadError': function (file, errorCode, errorMsg, errorString) {\n\t\t\t$('#msg_filename').text(\\\"\\\");\n\t\t\talert('The file ' + file.name + ' could not be uploaded: ' + errorString);\n\t\t},\n\t\t'onSelect' : function(file) {\n\t\t\t$('#uploadStatus').val(\\\"started\\\");\n\t\t\t$('#msg_filename').text(\\\"\\\");\n\t\t},\n\t\t'buttonText' : 'Upload Video',\t\n\t\tformData : { '{$this->getRequest()->getSession()->getSessionName()}' : '{$this->getRequest()->getSession()->getSessionID()}'\n\t\t}\t\t\n\t\t});\n\t\t\"));\n\t\t\n\t\t//$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/jquery-uploadify/uploadify.css'));\n\n\t\t//$this->addJavascriptResource(new mvcViewJavascript('swfobject', mvcViewJavascript::TYPE_FILE, '/libraries/swfobject/swfobject.js'));\n\t\t//$this->addJavascriptResource(new mvcViewJavascript('uploadify', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-uploadify/jquery.uploadify.min.js'));\n\t\t/*\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadifyInit', mvcViewJavascript::TYPE_INLINE, \"$('#FileUpload').uploadify({\n\t\t\t\t'uploader' : '/libraries/jquery-uploadify/uploadify.swf',\n\t\t\t\t'script' : '{$this->buildUriPath(uploadController::ACTION_DO_UPLOAD)}',\n\t\t\t\t'cancelImg' : '/libraries/jquery-uploadify/cancel.png',\n\t\t\t\t'auto' : true,\n\t\t\t\t'fileExt' : '*.mov;*.avi;*.wmv;*.mp4;*.mpg;*.m4v',\n\t\t\t\t'fileDesc' : 'Video Files',\n\t\t\t\t'sizeLimit' : 500000000,\n\t\t\t\t'fileDataName': 'Files',\n\t\t\t\t'scriptData': {\n\t\t\t\t\t'{$this->getRequest()->getSession()->getSessionName()}': '{$this->getRequest()->getSession()->getSessionID()}',\n\t\t\t\t\t'ajax': true\n\t\t\t\t},\n\t\t\t\t'onComplete' : function(event, ID, fileObj, response, data) {\n\t\t\t\t\tif ( response != 'failed' ) {\t\t\t\t\t\n\t\t\t\t\t \t$('#fileNameStored').val(response);\n\t\t\t\t\t \t$('#uploadStatus').val(\\\"\\\");\n\t\t\t\t\t\t//alert('upload done');\t\n\t\t\t\t\t\t $('#msg_filename').text(\\\"Upload done : \\\"+fileObj.name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert('upload failed');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'onSelectOnce' : function(event,data) {\n\t\t\t\t\t$('#uploadStatus').val(\\\"started\\\");\t\n\t\t\t\t}\t\n\n\t\t\t\t});\n\t\t\"));\n\t\t * \n\t\t */\n\n\t\t/*\n\t\t$this->addJavascriptResource(new mvcViewJavascript('plupload', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadfull', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.full.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadflash', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.flash.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadhtml4', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.html4.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadhtml5', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.html5.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadjs', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('progressBar', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/jquery.progressbar.min.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('fileStyle', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/fileStyle/jquery.filestyle.mini.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('html5Uploader', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/customHTML5Uploader.js'));\n\t\t*/\n\n\t\t$this->getEngine()->assign('newGenres', utilityOutputWrapper::wrap(mofilmTag::listOfObjects(null, null, mofilmTag::TYPE_GENRE)));\n\n\t\t$this->addJavascriptResource(new mvcViewJavascript('smartwizard', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/smartWizard2/js/jquery.smartWizard-2.0.min.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('creditAutomcomplete', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/creditAutocomplete.js?'.mofilmConstants::JS_VERSION));\n\t\t$this->getEngine()->assign('eventsall', utilityOutputWrapper::wrap(mofilmEvent::listOfObjects(null, null, true)));\n\t\t$this->getEngine()->assign('oUser', $this->getController()->getRequest()->getSession()->getUser());\n\t\t$list = mofilmRole::listOfObjects();\n\t\t$tmp = array();\n\t\tforeach ( $list as $oObject ) {\n\t\t\t//$tmp[] = $oObject->getDescription();\n\t\t\t$tmp[] = array(\"label\" => $oObject->getDescription(),\"value\" => $oObject->getDescription(),\"key\" => $oObject->getID());\n\n\t\t}\n\t\t$this->getEngine()->assign('availableRoles', json_encode($tmp));\n\t\t$this->getEngine()->assign('index', 0);\n\t\t$this->addJavascriptResource(new mvcViewJavascript('jqueryautocompletehtml', mvcViewJavascript::TYPE_FILE, '/libraries/jqueryautocomplete/jquery.ui.autocomplete.html.js'));\n\t\t$this->render($this->getTpl('upload', '/account'));\n\t}", "public function actionIndex() {\n $searchModel = new FingerDownloadSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $path = Yii::getAlias('@webroot').'/fingerfile/';\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'path' => $path\n ]);\n }", "public function generate_filelist_preview() : void {\n CrawlQueue::truncate();\n DeployQueue::truncate();\n\n $initial_file_list_count =\n FilesHelper::buildInitialFileList(\n true,\n SiteInfo::getPath( 'uploads' ),\n $this->settings\n );\n\n if ( $initial_file_list_count < 1 ) {\n $err = 'Initial file list unable to be generated';\n http_response_code( 500 );\n echo $err;\n WsLog::l( $err );\n throw new WP2StaticException( $err );\n }\n\n $via_ui = filter_input( INPUT_POST, 'ajax_action' );\n\n if ( is_string( $via_ui ) ) {\n echo $initial_file_list_count;\n }\n }", "public function GetUploadMultiFiles()\n {\n return view('UploadMultiFiles');\n }", "public function getProfileListAction()\n {\n $profileList = $this->careerProfileRepository->findBy(['isArchived' => 0]);\n $this->listViewFactory->setViewFactory(ProfileViewFactory::class);\n return $this->viewHandler->handle(View::create($this->listViewFactory->create($profileList)));\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function admin_index(){\n if($this->isConnected && $this->User->isAdmin()){\n $this->layout = 'admin';\n\n //Get list of logs\n $this->loadModel('Uploads.Uploads');\n $uploads = $this->Uploads->find('all', ['order' => ['id desc']]);\n\n if ($this->request->is('post')) {\n $uploads_level = $this->request->data[\"level\"];\n $uploads_author = $this->request->data[\"author\"];\n $uploads_comment = $this->request->data[\"description\"];\n\n //Form validation\n if(!isset($uploads_level) || ($uploads_level < 0 || $uploads_level > 4)){\n $this->Session->setFlash($this->Lang->get('UPLOADS_LEVEL_ERROR'), 'default.error');\n return $this->redirect($this->referer());\n }\n\n if(!isset($uploadslog_author) || empty($uploads_author) || strlen($uploads_author) < 2 || strlen($uploads_author) > 50){\n $this->Session->setFlash($this->Lang->get('UPLOADS_AUTHOR_ERROR'), 'default.error');\n return $this->redirect($this->referer());\n }\n\n if(!isset($uploads_comment) || empty($uploads_comment) || strlen($uploads_comment) < 10){\n $this->Session->setFlash($this->Lang->get('UPLOADS_COMMENT_ERROR'), 'default.error');\n return $this->redirect($this->referer());\n }\n\n //Add a new log\n $this->Uploads->create();\n if(\n $this->Uploads->save(\n ['level' => $uploads_level, \n 'author' => $uploads_author, \n 'description' => $uploads_comment, \n 'created' => date('Y-m-d H:i:s')\n ])\n ){\n $this->Session->setFlash($this->Lang->get('UPLOADS_ADD_SUCCESS'), 'default.success');\n return $this->redirect($this->referer());\n }\n \n //error occurred\n $this->Session->setFlash($this->Lang->get('UPLOADS_ERROR_OCCURED'), 'default.error');\n return $this->redirect($this->referer());\n }\n\n return $this->set(compact('uploads'));\n }else{\n return $this->redirect('/');\n }\n }", "public function index()\n {\n $this->View->render('admin/index', array(\n 'users' => UserModel::getPublicProfilesOfAllUsers())\n );\n }", "public function printlist(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t$this->title = 'Media list';\t\t\r\n\t\treturn $this->renderWith(array('Media_printresults','Print'));\r\n\t}", "public function display(): string\n {\n // Apply any defaults for missing metadata\n $this->setDefaults();\n\n // Get the Files\n if (! isset($this->data['files'])) {\n // Apply a target user\n if ($this->data['userId']) {\n $this->model->whereUser($this->data['userId']);\n }\n\n // Apply any requested search filters\n if ($this->data['search']) {\n $this->model->like('filename', $this->data['search']);\n }\n\n // Sort and order\n $this->model->orderBy($this->data['sort'], $this->data['order']);\n\n // Paginate non-select formats\n if ($this->data['format'] !== 'select') {\n $this->setData([\n 'files' => $this->model->paginate($this->data['perPage'], 'default', $this->data['page']),\n 'pager' => $this->model->pager,\n ], true);\n } else {\n $this->setData([\n 'files' => $this->model->findAll(),\n ], true);\n }\n }\n\n // AJAX calls skip the wrapping\n if ($this->data['ajax']) {\n return view('Tatter\\Files\\Views\\Formats\\\\' . $this->data['format'], $this->data);\n }\n\n return view('Tatter\\Files\\Views\\index', $this->data);\n }", "public function index()\n {\n $productTransfers = ProductTransfer::latest()->paginate(10);\n return view('product-transfer.index', compact('productTransfers'));\n }", "public function index()\n {\n $this->user_list();\n }", "function do_index() {\n $this->vars['title'] = \"Fotos\";\n \n $sql = 'SELECT COUNT(*) FROM photos';\n $count = $this->photo->count($sql);\n \n $page = $this->paginate(PHOTO_PAGE_SIZE, $count, '/photo/index');\n \n $sql = 'SELECT p.created as p_created, p.id AS p_id, u.id AS u_id, t.title AS topic, t.*, u.*, p.* '\n . 'FROM photos p ' \n . 'LEFT JOIN users u ON p.von = u.id '\n . 'LEFT JOIN topics t ON p.topic_id = t.id '\n . 'ORDER BY p.created DESC LIMIT ' . (($page-1)*PHOTO_PAGE_SIZE) . ',' . PHOTO_PAGE_SIZE;\n\n $this->vars['photos'] = $this->photo->query($sql);\n $this->render();\n }", "public function show(Upload $upload)\n {\n return Storage::download('uploads/' . $upload->code, $upload->name);\n }", "public function index()\n {\n $tariffs = Tariff::orderby('id','desc')->get();\n return view('admin.tarif.index',compact('tariffs'));\n }" ]
[ "0.69382066", "0.6876522", "0.6749682", "0.6725907", "0.6721007", "0.6666607", "0.6666607", "0.6640795", "0.66351545", "0.66273767", "0.6605901", "0.65982366", "0.6577865", "0.65707296", "0.6520642", "0.65011615", "0.64765644", "0.63927686", "0.6379982", "0.63731706", "0.6365104", "0.63601077", "0.6326552", "0.62755495", "0.6275275", "0.62667596", "0.6256606", "0.62197876", "0.62158597", "0.62113774", "0.6193964", "0.6174617", "0.61612344", "0.61207235", "0.6107685", "0.61034536", "0.609962", "0.6096402", "0.6070881", "0.6064191", "0.60639024", "0.6053357", "0.6013962", "0.59486085", "0.5937608", "0.59077615", "0.59012544", "0.5876857", "0.5861029", "0.5850165", "0.5846213", "0.5844969", "0.5837381", "0.5836954", "0.5825678", "0.5821821", "0.58166724", "0.58132637", "0.5811774", "0.58021915", "0.58020973", "0.5802014", "0.58007514", "0.5796816", "0.57876754", "0.5786286", "0.57754517", "0.5769149", "0.57682616", "0.5762117", "0.5744818", "0.57399195", "0.57035846", "0.5698219", "0.5692571", "0.568171", "0.5680371", "0.5676948", "0.56656027", "0.5664615", "0.56450194", "0.56418777", "0.5640983", "0.5640095", "0.56386507", "0.56368744", "0.5634865", "0.56291056", "0.5628944", "0.56234753", "0.5623258", "0.5621881", "0.5618175", "0.5611627", "0.5608874", "0.5604566", "0.5604553", "0.5602947", "0.5601832" ]
0.71702826
1
Upload fiels via DropZone.js
public function upload_files() { if(Module::hasAccess("Uploads", "create")) { $input = Input::all(); if(Input::hasFile('file')) { /* $rules = array( 'file' => 'mimes:jpg,jpeg,bmp,png,pdf|max:3000', ); $validation = Validator::make($input, $rules); if ($validation->fails()) { return response()->json($validation->errors()->first(), 400); } */ $file = Input::file('file'); // print_r($file); $folder = storage_path('uploads'); $filename = $file->getClientOriginalName(); $date_append = date("Y-m-d-His-"); $upload_success = Input::file('file')->move($folder, $date_append.$filename); if( $upload_success ) { // Get public preferences // config("laraadmin.uploads.default_public") $public = Input::get('public'); if(isset($public)) { $public = true; } else { $public = false; } $upload = Upload::create([ "name" => $filename, "path" => $folder.DIRECTORY_SEPARATOR.$date_append.$filename, "extension" => pathinfo($filename, PATHINFO_EXTENSION), "caption" => "", "hash" => "", "public" => $public, "user_id" => Auth::user()->id ]); // apply unique random hash to file while(true) { $hash = strtolower(str_random(20)); if(!Upload::where("hash", $hash)->count()) { $upload->hash = $hash; break; } } $upload->save(); return response()->json([ "status" => "success", "upload" => $upload ], 200); } else { return response()->json([ "status" => "error" ], 400); } } else { return response()->json('error: upload file not found.', 400); } } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access" ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadFiles () {\n\n}", "public function upload();", "public function dz_files()\n {\n if (!empty($_FILES) && $_FILES['file']) {\n $file = $_FILES['file'];\n\n\n foreach ($file['error'] as $key=>$error) {\n $uploadfile = sys_get_temp_dir().basename($file['name']['key']);\n move_uploaded_file($file['tmp_name'],$uploadfile);\n\n }\n }\n }", "function deskDropUpload(){\r\n\r\n\t\t\tforeach($_FILES as $k => $v){\r\n\t \t\tforeach($v['tmp_name'] as $i => $file){\r\n\t\t \t\t$tmp = $file;\r\n\r\n\t\t \t\t// User Upload Directory\r\n\t\t \t\t$user = ($_SESSION['user']['id']) ? $_SESSION['user']['id'] : 0;\r\n\t\t \t\t$dir = \"/^/$_SERVER[HTTP_HOST]/\".$user.\"/\";\r\n\r\n\t\t \t\t// Make Dir!\r\n\t\t \t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$dir)){\r\n\t\t \t\t\tmkdir($_SERVER['DOCUMENT_ROOT'].$dir, 0755, true);\r\n\t\t \t\t}\r\n\r\n\t\t \t\t$src = $dir . md5_file($tmp);\r\n\t\t move_uploaded_file($tmp, $_SERVER['DOCUMENT_ROOT'].$src);\r\n\r\n\t\t $_POST['user_id'] \t= $_SESSION['user']['id'];\r\n\r\n\r\n\t\t\t\t\t$this->mFile = array(\r\n\t\t\t\t\t\t'src' => $_SERVER['DOCUMENT_ROOT'].$src,\r\n\t\t\t\t\t\t'real' => htmlentities( urlencode($v['name'][$i]) ),\r\n\t\t\t\t\t\t'name' => $v['name'][$i],\r\n\t\t\t\t\t\t'size' => $v['size'][$i]\r\n\t\t\t\t\t);\r\n\r\n\r\n\t\t\t\t\t$this->Index();\r\n\t \t\t}\r\n\t \t}\r\n\t\t}", "abstract protected function drop_zone($mform, $imagerepeats);", "public function uploadPhoto($f3){\n \n\n $latitude = $f3->get('POST.latitude');\n $longitude = $f3->get('POST.longitude');\n $salete = $f3->get('POST.salete');\n \n \n$f3->set('UPLOADS','public/images/uploaded/');\n\n \n \\Web::instance()->receive(function($file) use ($f3){\n var_dump($file);\n $monupload=$file['name'];\n $f3->set('monupload',$monupload);\n },true,true);\n \n \n $chemin = $f3->get('monupload');\n \n if ($latitude) {\n\t\t $this->model->insertScrap($chemin,$latitude, $longitude, $salete);\n }\n $this->merci($f3);\n\n }", "function ft_hook_upload($dir, $file) {}", "public function lifecycleFileUpload() {\n $this->upload();\n}", "public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}", "abstract protected function doUpload();", "public function upload()\n\t{\n\t}", "public function post($callback=null, $stage = false) {\n \n //holds file upload object\n $upload = isset($_FILES[$this->options['param_name']]) ? $_FILES[$this->options['param_name']] : null;\n \n //will hold all the file information\n $upload_info = array();\n \n if ($upload && is_array($upload['tmp_name'])) {\n \n // param_name is an array identifier like \"files[]\",\n // $_FILES is a multi-dimensional array:\n foreach ($upload['tmp_name'] as $index => $value) {\n \n //adds a new file object to the info array\n $upload_info[] = $this->handle_file_upload(\n //file\n $upload['tmp_name'][$index],\n //name\n isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index],\n //size\n isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index],\n //type\n isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index],\n //errors\n $upload['error'][$index],\n //index\n $index,\n //stage\n $stage\n );\n }\n }\n \n elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) {\n // param_name is a single object identifier like \"file\",\n // $_FILES is a one-dimensional array:\n \n //adds a new file object to the info array\n $upload_info[] = $this->handle_file_upload(\n //file\n isset($upload['tmp_name']) ? $upload['tmp_name'] : null,\n //name\n isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ? $upload['name'] : null),\n //size\n isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ? $upload['size'] : null),\n //type\n isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ? $upload['type'] : null),\n //error\n isset($upload['error']) ? $upload['error'] : null,\n null,\n //stage\n $stage\n );\n }\n \n //calls function callback if provided with one\n if(is_callable($callback)) {\n call_user_func($callback, $upload_info);\n }\n \n //for security removes sensitive attributes\n foreach($upload_info as $file) {\n unset($file->file_path);\n unset($file->id);\n }\n \n header('Vary: Accept');\n \n //encodes the output file object\n $json = json_encode($upload_info);\n \n //handles redirect request parameter\n $redirect = isset($_REQUEST['redirect']) ? stripslashes($_REQUEST['redirect']) : null;\n if ($redirect) {\n header('Location: '.sprintf($redirect, rawurlencode($json)));\n return;\n }\n \n //if supported by server, outputs application/json content type\n if (isset($_SERVER['HTTP_ACCEPT']) &&\n (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {\n header('Content-type: application/json');\n } else {\n header('Content-type: text/plain');\n }\n \n //outputs the encoded json\n echo $json;\n \n }", "public function upload()\n {\n }", "public function upload()\n {\n if (!Request::hasPost('requestToken') || !RequestToken::validate(Request::getPost('requestToken'))) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Invalid Request Token!');\n $objResponse->output();\n }\n\n if (!Request::getInstance()->files->has($this->name)) {\n return;\n }\n\n $objTmpFolder = new \\Folder(MultiFileUpload::UPLOAD_TMP);\n\n // contao 4 support, create tmp dir symlink\n if (version_compare(VERSION, '4.0', '>=')) {\n // tmp directory is not public, mandatory for preview images\n if (!file_exists(System::getContainer()->getParameter('contao.web_dir') . DIRECTORY_SEPARATOR . MultiFileUpload::UPLOAD_TMP)) {\n $objTmpFolder->unprotect();\n $command = new SymlinksCommand();\n $command->setContainer(System::getContainer());\n $input = new ArrayInput([]);\n $output = new NullOutput();\n $command->run($input, $output);\n }\n }\n\n $strField = $this->name;\n $varFile = Request::getInstance()->files->get($strField);\n // Multi-files upload at once\n if (is_array($varFile)) {\n // prevent disk flooding\n if (count($varFile) > $this->maxFiles) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Bulk file upload violation.');\n $objResponse->output();\n }\n\n /**\n * @var UploadedFile $objFile\n */\n foreach ($varFile as $strKey => $objFile) {\n $arrFile = $this->uploadFile($objFile, $objTmpFolder->path, $strField);\n $varReturn[] = $arrFile;\n\n if (\\Validator::isUuid($arrFile['uuid'])) {\n $arrUuids[] = $arrFile['uuid'];\n }\n }\n } // Single-file upload\n else {\n /**\n * @var UploadedFile $varFile\n */\n $varReturn = $this->uploadFile($varFile, $objTmpFolder->path, $strField);\n\n if (\\Validator::isUuid($varReturn['uuid'])) {\n $arrUuids[] = $varReturn['uuid'];\n }\n }\n\n if ($varReturn !== null) {\n $this->varValue = $arrUuids;\n $objResponse = new ResponseSuccess();\n $objResult = new ResponseData();\n $objResult->setData($varReturn);\n $objResponse->setResult($objResult);\n\n return $objResponse;\n }\n }", "public function gavias_sliderlayer_upload_file(){\n global $base_url;\n $allowed = array('png', 'jpg', 'gif','zip');\n $_id = gavias_sliderlayer_makeid(6);\n if(isset($_FILES['upl']) && $_FILES['upl']['error'] == 0){\n\n $extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);\n\n if(!in_array(strtolower($extension), $allowed)){\n echo '{\"status\":\"error extension\"}';\n exit;\n } \n $path_folder = \\Drupal::service('file_system')->realpath(gva_file_default_scheme(). \"://gva-sliderlayer-upload\");\n \n //$file_path = $path_folder . '/' . $_id . '-' . $_FILES['upl']['name'];\n //$file_url = str_replace($base_url, '',file_create_url(gva_file_default_scheme(). \"://gva-sliderlayer-upload\") . '/' . $_id .'-'. $_FILES['upl']['name']); \n \n $ext = end(explode('.', $_FILES['upl']['name']));\n $image_name = basename($_FILES['upl']['name'], \".{$ext}\");\n\n $file_path = $path_folder . '/' . $image_name . \"-{$_id}\" . \".{$ext}\";\n $file_url = str_replace($base_url, '',file_create_url(gva_file_default_scheme(). \"://gva-sliderlayer-upload\"). '/' . $image_name . \"-{$_id}\" . \".{$ext}\"); \n\n if (!is_dir($path_folder)) {\n @mkdir($path_folder); \n }\n if(move_uploaded_file($_FILES['upl']['tmp_name'], $file_path)){\n $result = array(\n 'file_url' => $file_url,\n 'file_url_full' => $base_url . $file_url\n );\n print json_encode($result);\n exit;\n }\n }\n\n echo '{\"status\":\"error\"}';\n exit;\n\n }", "public function upload()\n {\n App::import('Lib', 'Uploads.file_receiver/FileReceiver');\n App::import('Lib', 'Uploads.file_dispatcher/FileDispatcher');\n App::import('Lib', 'Uploads.file_binder/FileBinder');\n App::import('Lib', 'Uploads.UploadedFile');\n\n $this->cleanParams();\n $Receiver = new FileReceiver($this->params['url']['extensions'], $this->params['url']['limit']);\n $Dispatcher = new FileDispatcher(\n Configure::read('Uploads.base'),\n Configure::read('Uploads.private')\n );\n $Binder = new FileBinder($Dispatcher, $this->params['url']);\n try {\n $File = $Receiver->save(Configure::read('Uploads.tmp'));\n $Binder->bind($File);\n $this->set('response', $File->getResponse());\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').'Uploaded '.$File->getName().chr(10), FILE_APPEND);\n } catch (RuntimeException $e) {\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').$e->getMessage().chr(10), FILE_APPEND);\n $this->set('response', $this->failedResponse($e));\n }\n $this->layout = 'ajax';\n $this->RequestHandler->respondAs('js');\n }", "function uploadObject();", "public function testDiskFlooding()\n {\n $objRequest = \\Symfony\\Component\\HttpFoundation\\Request::create('http://localhost' . AjaxAction::generateUrl(MultiFileUpload::NAME, MultiFileUpload::ACTION_UPLOAD), 'post');\n $objRequest->headers->set('X-Requested-With', 'XMLHttpRequest'); // xhr request\n $objRequest->request->set('requestToken', \\RequestToken::get());\n $objRequest->request->set('files', []);\n\n @copy(UNIT_TESTING_FILES . '/file name.zip', UNIT_TESTING_FILES . '/tmp/file name.zip');\n @copy(UNIT_TESTING_FILES . '/file---name.zip', UNIT_TESTING_FILES . '/tmp/file---name.zip');\n @copy(UNIT_TESTING_FILES . '/file--.--.-.--name.zip', UNIT_TESTING_FILES . '/tmp/file--.--.-.--name.zip');\n @copy(UNIT_TESTING_FILES . '/file...name..zip', UNIT_TESTING_FILES . '/tmp/file...name..zip');\n @copy(UNIT_TESTING_FILES . '/file___name.zip', UNIT_TESTING_FILES . '/tmp/file___name.zip');\n @copy(UNIT_TESTING_FILES . '/.~file name#%&*{}:<>?+|\"\\'.zip', UNIT_TESTING_FILES . '/tmp/.~file name#%&*{}:<>?+|\"\\'.zip');\n\n // simulate upload of php file hidden in an image file\n $arrFiles = [\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/file name.zip', // Name of the sent file\n 'file name.zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/file---name.zip', // Name of the sent file\n 'file---name.zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/file--.--.-.--name.zip', // Name of the sent file\n 'file--.--.-.--name.zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/file...name..zip', // Name of the sent file\n 'file...name..zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/file___name.zip', // Name of the sent file\n 'file___name.zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n new UploadedFile(// Path to the file to send\n UNIT_TESTING_FILES . '/tmp/.~file name#%&*{}:<>?+|\"\\'.zip', // Name of the sent file\n '.~file name#%&*{}:<>?+|\"\\'.zip', // mime type\n 'application/zip', // size of the file\n 48140, null, true),\n ];\n\n $objRequest->files->add(['files' => $arrFiles]);\n\n Request::set($objRequest);\n\n $arrDca = [\n 'inputType' => 'multifileupload',\n 'eval' => [\n 'uploadFolder' => UNIT_TESTING_FILES . 'uploads/',\n 'extensions' => 'zip',\n 'maxFiles' => 2,\n 'fieldType' => 'checkbox',\n ],\n ];\n\n $arrAttributes = \\Widget::getAttributesFromDca($arrDca, 'files');\n\n try {\n $objUploader = new FormMultiFileUpload($arrAttributes);\n // unreachable code: if no exception is thrown after form was created, something went wrong\n $this->expectException(\\HeimrichHannot\\Ajax\\Exception\\AjaxExitException::class);\n } catch (AjaxExitException $e) {\n $objJson = json_decode($e->getMessage());\n\n $this->assertSame('Bulk file upload violation.', $objJson->message);\n }\n }", "function FileUpload(){\n $client = $this->getClientInfo();\n $this->previousFileDelete($client);\n $backupFiles = $this->getSqlBackupFiles();\n// $this->pr($backupFiles);die;\n if(!empty($backupFiles)){\n foreach($backupFiles as $backup){\n $info = $this->fileUploadInoGoogleDrive($client,$backup);\n print_r($info);\n print \"\\n\";\n }\n }\n die;\n }", "public function handle_upload()\n {\n }", "function acf_upload_files($ancestors = array())\n{\n}", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function postConnection()\n {\n //original Code\n //$item['preview'] = $this->config['url'].$this->config['source'].'/_thumbs'.$path.$thumb;\n\n\n //dd($_POST);\n\n // echo $path = storage_path('cccc');\n\n // Storage::disk('local')->makeDirectory('customer_files');\n if (!empty(Session::get('cust_id'))) {\n $extra = [\n \"source\" => $this->path,\n \"url\" => url('/'),\n \"doc_root\"=>'',\n 'c_folder' => $this->folder,\n \"ext\" => [\"jpg\",\"jpeg\",\"gif\",\"png\",\"svg\",\"txt\",\"pdf\",\"odp\",\"ods\",\"odt\",\"rtf\",\"doc\",\"docx\",\"xls\",\"xlsx\",\"ppt\",\"pptx\",\"csv\",\"ogv\",\"mp4\",\"webm\",\"m4v\",\"ogg\",\"mp3\",\"wav\",\"zip\",\"rar\"],\n \"upload\" => [\n \"number\" => 5,\n \"overwrite\" => false,\n \"size_max\" => 10\n ],\n \"images\" => [\n \"images_ext\" => [\"jpg\",\"jpeg\",\"gif\",\"png\"],\n \"resize\" => [\"thumbWidth\" => 120,\"thumbHeight\" => 90]\n ],\n ];\n /*$extra = array(\n \"source\" => url(URL::route('get.user_files.thumb', ['folder' => $this->folder])),\n \"url\" => url('/'),\n \"doc_root\"=>'',\n 'c_folder' => $this->folder,\n );*/\n\n if (isset($_POST['typeFile']) && $_POST['typeFile']=='images') {\n $extra['type_file'] = 'images';\n }\n $f = new FilemanagerService($extra);\n\n $f->run();\n }\n }", "public function uploads() {\n $this->Authorization->authorize($this->Settings->newEmptyEntity(), 'create');\n if ($this->request->is(\"Ajax\")) {\n $is_dest = \"img/tmp/\";\n if (!file_exists($is_dest)) {\n //mkdir($is_dest, 0777, true);\n $dir = new Folder(WWW_ROOT . 'img/tmp/', true, 0755);\n $is_dest = $dir->path;\n }\n $fileData = $this->request->getData('file');\n if (strlen($fileData->getClientFilename()) > 1) {\n $ext = pathinfo($fileData->getClientFilename(), PATHINFO_EXTENSION);\n $allowedExt = array('gif', 'jpeg', 'png', 'jpg', 'tif', 'bmp', 'ico');\n if ($this->request->getData('allow_ext')) {\n $allowedExt = explode(\",\", $this->request->getData('allow_ext'));\n }\n if (in_array(strtolower($ext), $allowedExt)) {\n $upload_img = $fileData->getClientFilename();\n $ran = time();\n $upload_img = $ran . \"_\" . $fileData->getClientFilename();\n if (strlen($upload_img) > 100) {\n $upload_img = $ran . \"_\" . rand() . \".\" . $ext;\n }\n $upload_img = str_replace(' ', '_', $upload_img);\n $fileData->moveTo($is_dest . $upload_img);\n $data['filename'] = $upload_img;\n $data['image_path'] = $this->request->getAttribute(\"webroot\") . \"img/tmp/\" . $upload_img;\n $data['success'] = true;\n $data['message'] = \"file successfully uploaded!\";\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file type!\";\n }\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file!\";\n }\n }\n $this->set($data);\n $this->viewBuilder()->setOption('serialize', ['filename', 'image_path','success', 'message']);\n }", "public function lifecycleFileUpload()\n {\n $this->upload();\n }", "public function lifecycleFileUpload()\n {\n $this->upload();\n }", "function upload_file() {\n upload_file_to_temp();\n }", "public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_tol_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_tol',\n\t\t]);\n\t}", "public function upload(array $files);", "public function lifecycleFileUpload() {\n $this->upload();\n }", "function wp_import_handle_upload()\n {\n }", "public function upload($input);", "public function lifecycleFileUpload(): void\n {\n $this->upload();\n }", "public function uploadFiles()\n {\n\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n\n $input = \\Input::all();\n\n $rules = array(\n 'file' => 'image|max:3000',\n );\n\n $validation = \\Validator::make($input, $rules);\n\n if ($validation->fails()) {\n return \\Response::make($validation->errors->first(), 400);\n }\n $image = \\Input::file('file');\n $destinationPath = 'profilepics'; // upload path\n $fileName = \\Auth::user()->idPerson . '.' . $image->getClientOriginalExtension();\n $upload_success = $image->move($destinationPath, $fileName); // uploading file to given path\n $tenant->profile_picture = $fileName;\n $tenant->save();\n\n if ($upload_success) {\n return \\Response::json('success', 200);\n } else {\n return \\Response::json('error', 400);\n }\n\n }", "public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_bendungan',\n\t\t]);\n\t}", "public function step_2_manage_upload()\n {\n }", "public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }", "public function invtZoneImgUplaod_post()\n {\n $data = $this->post();\n //print_r($data);\n //echo $data['kp_InventoryZoneID'];\n $inventoryZoneID = $data['kp_InventoryZoneID'];\n\n if(!empty($_FILES['file']['name']))\n {\n //echo \"not empty\";\n $msg = $this->inventoryzonemodel->doInvtZoneCustomUpload($inventoryZoneID);\n\n if($msg)\n {\n $this->response($msg, 200); // 200 being the HTTP response code\n }\n else\n {\n $this->response($msg, 404);\n }\n\n }\n\n\n\n }", "public function uploadfiles(){\n\t\tif($this->request->isPost()){\n\t\t\t//die(\"kkk\");\n\t\t\tif($this->processfile()){\n\t\t\t\t\n\t\t\t\t\tif($this->Upload->save($this->data,array('validate'=>true))){\n\t\t\t\t} else {\n\t\t\t\t\t// didn’t validate logic\n\t\t\t\t\t$errors = $this->Upload->validationErrors;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "protected function _FILES()\n\t{\n\t\t\n\t}", "public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }", "function acf_enqueue_uploader()\n{\n}", "function save_files($post_id = 0){\r\n if(empty($_FILES['acf']['name'])){\r\n return;\r\n }\r\n \r\n // upload files\r\n $this->upload_files();\r\n \r\n }", "public function upload_images() {\n\n $this->load->library('MY_upload_handler');\n\n $upload_handler = new MY_upload_handler($this->c_user->id);\n\n header('Pragma: no-cache');\n\n header('Cache-Control: no-store, no-cache, must-revalidate');\n\n header('Content-Disposition: inline; filename=\"files.json\"');\n\n header('X-Content-Type-Options: nosniff');\n\n header('Access-Control-Allow-Origin: *');\n\n header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');\n\n header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');\n\n\n\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'OPTIONS':\n\n break;\n\n case 'HEAD':\n\n case 'GET':\n\n if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {\n\n $upload_handler->delete();\n\n } else {\n\n $upload_handler->get();\n\n }\n\n break;\n\n case 'DELETE':\n\n if ($postId = $this->getRequest()->query->get('post_id', '')) {\n\n $post = new Social_post($postId);\n\n $post->media->delete_all();\n\n }\n\n $upload_handler->delete();\n\n break;\n\n case 'POST':\n\n if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {\n\n $upload_handler->delete();\n\n } else {\n\n $upload_handler->post();\n\n }\n\n break;\n\n\n\n default:\n\n header('HTTP/1.1 405 Method Not Allowed');\n\n }\n\n }", "function media_upload_file()\n {\n }", "public function content_for_upload();", "function Trigger_FileUpload(&$tNG) {\n $uploadObj = new tNG_FileUpload($tNG);\n $uploadObj->setFormFieldName(\"taptinquangcao\");\n $uploadObj->setDbFieldName(\"taptinquangcao\");\n $uploadObj->setFolder(\"../images/quangcao/\");\n $uploadObj->setMaxSize(5000);\n $uploadObj->setAllowedExtensions(\"jpg, gif, png, swf\");\n $uploadObj->setRename(\"auto\");\n return $uploadObj->Execute();\n}", "public function upfile()\n {\n $accepted_origins = array(\"http://localhost\", \"http://192.168.82.130\", \"\");\n\n // Images upload path\n $imageFolder = \"./upload/image/\";\n\n reset($_FILES);\n $temp = current($_FILES);\n if (is_uploaded_file($temp['tmp_name'])) {\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n // Same-origin requests won't set an origin. If the origin is set, it must be valid.\n if (in_array($_SERVER['HTTP_ORIGIN'], $accepted_origins)) {\n header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n } else {\n header(\"HTTP/1.1 403 Origin Denied\");\n return;\n }\n }\n\n $temp['name'] = str_replace(' ','',$temp['name']);\n $temp['name'] = str_replace('(','',$temp['name']);\n $temp['name'] = str_replace(')','',$temp['name']);\n\n // Sanitize input\n if (preg_match(\"/([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\).])|([\\.]{2,})/\", $temp['name'])) {\n header(\"HTTP/1.1 400 Invalid file name.\");\n return;\n }\n\n // Verify extension\n if (!in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), array(\"gif\", \"jpg\", \"png\"))) {\n header(\"HTTP/1.1 400 Invalid extension.\");\n return;\n }\n\n // Accept upload if there was no origin, or if it is an accepted origin\n $filetowrite = $imageFolder . $temp['name'];\n move_uploaded_file($temp['tmp_name'], $filetowrite);\n\n $link = base_url('upload/image/'.$temp['name']);\n // Respond to the successful upload with JSON.\n echo json_encode(array('location' => $link));\n } else {\n // Notify editor that the upload failed\n header(\"HTTP/1.1 500 Server Error\");\n }\n }", "public function uploadAction()\n\t{\n\t\t$chunkSize = $this->getSizeTempFile();\n\n\t\t$isUploadStarted = ($this->uploadedPart > 0);\n\t\tif (!$isUploadStarted)\n\t\t{\n\t\t\t$reservedSize = round($chunkSize * ceil($this->totalItems / $this->pageSize) * 1.5);\n\n\t\t\t$this->uploadPath = $this->generateUploadDir(). $this->fileName;\n\n\t\t\t$this->findInitBucket(array(\n\t\t\t\t'fileSize' => $reservedSize,\n\t\t\t\t'fileName' => $this->uploadPath,\n\t\t\t));\n\n\t\t\tif ($this->checkCloudErrors())\n\t\t\t{\n\t\t\t\t$this->saveProgressParameters();\n\n\t\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\tif(!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->addError(new Error('File exists in a cloud.'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->instanceBucket();\n\n\t\t\t$this->checkCloudErrors();\n\t\t}\n\n\n\t\tif (!file_exists($this->filePath))\n\t\t{\n\t\t\t$this->addError(new Error('Uploading file not exists.'));\n\t\t}\n\n\t\tif (count($this->getErrors()) > 0)\n\t\t{\n\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t}\n\n\n\t\t$isSuccess = false;\n\n\t\tif ($this->isExportCompleted && !$isUploadStarted)\n\t\t{\n\t\t\t// just only one file\n\t\t\t$uploadFile = array(\n\t\t\t\t'name' => $this->fileName,\n\t\t\t\t'size' => $this->fileSize,\n\t\t\t\t'type' => $this->fileType,\n\t\t\t\t'tmp_name' => $this->filePath,\n\t\t\t);\n\n\t\t\tif ($this->bucket->SaveFile($this->uploadPath, $uploadFile))\n\t\t\t{\n\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t$isSuccess = true;\n\t\t\t\t$this->isUploadFinished = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->addError(new Error('Uploading error.'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uploader = new \\CCloudStorageUpload($this->uploadPath);\n\t\t\tif (!$uploader->isStarted())\n\t\t\t{\n\t\t\t\tif (!$uploader->Start($this->bucketId, $reservedSize, $this->fileType))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Start uploading error.'));\n\n\t\t\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$part = $this->getContentTempFile();\n\n\t\t\twhile ($uploader->hasRetries())\n\t\t\t{\n\t\t\t\tif ($uploader->Next($part, $this->bucket))\n\t\t\t\t{\n\t\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t\t$isSuccess = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($part);\n\n\t\t\t// finish\n\t\t\tif ($isSuccess && $this->isExportCompleted)\n\t\t\t{\n\t\t\t\tif ($uploader->Finish())\n\t\t\t\t{\n\t\t\t\t\t$this->isUploadFinished = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('FILE_UNKNOWN_ERROR'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isSuccess)\n\t\t{\n\t\t\t$this->dropTempFile();\n\t\t}\n\n\t\t// Save progress\n\t\t$this->saveProgressParameters();\n\n\t\t// continue export into temporally file\n\t\t$result = $this->preformAnswer(self::ACTION_UPLOAD);\n\t\t$result['STATUS'] = self::STATUS_PROGRESS;\n\n\t\treturn $result;\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }", "function onlyoffice_dndupload_handle($uploadinfo) {\n // Gather the required info.\n $data = new stdClass();\n\n $data->course = $uploadinfo->course->id;\n $data->name = $uploadinfo->displayname;\n $data->intro = '';\n $data->introformat = FORMAT_HTML;\n $data->coursemodule = $uploadinfo->coursemodule;\n $data->initialfile_filemanager = $uploadinfo->draftitemid;\n $data->format = onlyoffice::FORMAT_UPLOAD;\n\n // Set the display options to the site defaults.\n $config = get_config('mod_onlyoffice');\n\n $data->display = $config->defaultdisplay;\n $data->displayname = $config->defaultdisplayname;\n $data->displaydescription = $config->defaultdisplaydescription;\n $data->width = 0;\n $data->height = 0;\n\n return onlyoffice_add_instance($data, null);\n}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'fanfan_topic');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "function acf_enqueue_uploader()\n {\n }", "public function service_dropUpload($request, $response)\n {\n\n // prüfen ob irgendwelche steuerflags übergeben wurde\n $params = $this->getFlags($request);\n\n $model = $this->loadModel('WebfrapDms');\n $model->loadAccess($params);\n\n if (!$model->access->listing) {\n throw new InvalidRequest_Exception(\n Response::FORBIDDEN_MSG,\n Response::FORBIDDEN\n );\n }\n\n // load the view object\n /* @var $view WebfrapDms_Ajax_View */\n $view = $response->loadView(\n 'webfrap-file-upload',\n 'WebfrapDms',\n 'displayDropUpload'\n );\n\n // request bearbeiten\n /* @var $model WebfrapDms_Model */\n $model = $this->loadModel('WebfrapDms');\n $view->setModel($model);\n\n $view->displayDropUpload($params);\n\n }", "public function post_file_action() {\n Utils\\verifyPostRequest();\n $this->verifyUnsafeRequest();\n\n // store uploaded files as StudIP documents\n $response = array(); // data for HTTP response\n $folder_id = Utils\\getFolderId(\n 'RichText',\n studip_utf8decode(_('Durch das RichText-Plugin hochgeladene Dateien.')));\n\n foreach (Utils\\FILES() as $file) {\n try {\n $newfile = Utils\\uploadFile($file, $folder_id);\n $response['files'][] = Array(\n 'name' => utf8_encode($newfile['filename']),\n 'type' => $file['type'],\n 'url' => GetDownloadLink($newfile->getId(), $newfile['filename']));\n } catch (AccessDeniedException $e) { // creation of Stud.IP doc failed\n $response['files'][] = Array(\n 'name' => $file['name'],\n 'type' => $file['type'],\n 'error' => $e->getMessage());\n }\n }\n Utils\\sendAsJson($response);\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'gou_brand');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public static function upload_all(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->upload_all();\n }", "public function uploadFile($object, $file, $path){\n $fileName = md5(uniqid()).'.'.$file->guessExtension();\n // Move the file to the directory where brochures are stored\n $picDir = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path;\n $file->move($picDir, $fileName);\n // Update the 'screenshot' property to store the file name instead of the file\n return $object->setPic($fileName);\n}", "function acf_upload_file($uploaded_file)\n{\n}", "public function upload(array $data);", "public function upload(array $data);", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function do_upload()\n {\n if (!class_exists('WPCP_UploadHandler')) {\n require USEYOURDRIVE_ROOTDIR.'/vendors/jquery-file-upload/server/UploadHandler.php';\n }\n\n if ('1' === $this->get_processor()->get_shortcode_option('demo')) {\n // TO DO LOG + FAIL ERROR\n exit(-1);\n }\n\n $shortcode_max_file_size = $this->get_processor()->get_shortcode_option('maxfilesize');\n $shortcode_min_file_size = $this->get_processor()->get_shortcode_option('minfilesize');\n $accept_file_types = '/.('.$this->get_processor()->get_shortcode_option('upload_ext').')$/i';\n $post_max_size_bytes = min(Helpers::return_bytes(ini_get('post_max_size')), Helpers::return_bytes(ini_get('upload_max_filesize')));\n $max_file_size = ('0' !== $shortcode_max_file_size) ? Helpers::return_bytes($shortcode_max_file_size) : $post_max_size_bytes;\n $min_file_size = (!empty($shortcode_min_file_size)) ? Helpers::return_bytes($shortcode_min_file_size) : -1;\n $use_upload_encryption = ('1' === $this->get_processor()->get_shortcode_option('upload_encryption') && (version_compare(phpversion(), '7.1.0', '<=')));\n\n $options = [\n 'access_control_allow_methods' => ['POST', 'PUT'],\n 'accept_file_types' => $accept_file_types,\n 'inline_file_types' => '/\\.____$/i',\n 'orient_image' => false,\n 'image_versions' => [],\n 'max_file_size' => $max_file_size,\n 'min_file_size' => $min_file_size,\n 'print_response' => false,\n ];\n\n $error_messages = [\n 1 => esc_html__('The uploaded file exceeds the upload_max_filesize directive in php.ini', 'wpcloudplugins'),\n 2 => esc_html__('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'wpcloudplugins'),\n 3 => esc_html__('The uploaded file was only partially uploaded', 'wpcloudplugins'),\n 4 => esc_html__('No file was uploaded', 'wpcloudplugins'),\n 6 => esc_html__('Missing a temporary folder', 'wpcloudplugins'),\n 7 => esc_html__('Failed to write file to disk', 'wpcloudplugins'),\n 8 => esc_html__('A PHP extension stopped the file upload', 'wpcloudplugins'),\n 'post_max_size' => esc_html__('The uploaded file exceeds the post_max_size directive in php.ini', 'wpcloudplugins'),\n 'max_file_size' => esc_html__('File is too big', 'wpcloudplugins'),\n 'min_file_size' => esc_html__('File is too small', 'wpcloudplugins'),\n 'accept_file_types' => esc_html__('Filetype not allowed', 'wpcloudplugins'),\n 'max_number_of_files' => esc_html__('Maximum number of files exceeded', 'wpcloudplugins'),\n 'max_width' => esc_html__('Image exceeds maximum width', 'wpcloudplugins'),\n 'min_width' => esc_html__('Image requires a minimum width', 'wpcloudplugins'),\n 'max_height' => esc_html__('Image exceeds maximum height', 'wpcloudplugins'),\n 'min_height' => esc_html__('Image requires a minimum height', 'wpcloudplugins'),\n ];\n\n $this->upload_handler = new \\WPCP_UploadHandler($options, false, $error_messages);\n $response = @$this->upload_handler->post(false);\n\n // Upload files to Google\n foreach ($response['files'] as &$file) {\n // Set return Object\n $file->listtoken = $this->get_processor()->get_listtoken();\n $file->name = Helpers::filter_filename(stripslashes(rawurldecode($file->name)), false);\n $file->hash = $_POST['hash'];\n $file->path = $_REQUEST['file_path'];\n $file->description = sanitize_textarea_field(wp_unslash($_REQUEST['file_description']));\n\n // Set Progress\n $return = ['file' => $file, 'status' => ['bytes_up_so_far' => 0, 'total_bytes_up_expected' => $file->size, 'percentage' => 0, 'progress' => 'starting']];\n self::set_upload_progress($file->hash, $return);\n\n if (isset($file->error)) {\n $file->error = esc_html__('Uploading failed', 'wpcloudplugins').': '.$file->error;\n $return['file'] = $file;\n $return['status']['progress'] = 'upload-failed';\n self::set_upload_progress($file->hash, $return);\n echo json_encode($return);\n\n error_log('[WP Cloud Plugin message]: '.sprintf('Uploading failed: %s', $file->error));\n\n exit();\n }\n\n if ($use_upload_encryption) {\n $return['status']['progress'] = 'encrypting';\n self::set_upload_progress($file->hash, $return);\n\n $result = $this->do_encryption($file);\n\n if ($result) {\n $file->name .= '.aes';\n clearstatcache();\n $file->size = filesize($file->tmp_path);\n }\n }\n\n // Create Folders if needed\n $upload_folder_id = $this->get_processor()->get_last_folder();\n if (!empty($file->path)) {\n $upload_folder_id = $this->create_folder_structure($file->path);\n }\n\n // Write file\n $chunkSizeBytes = 1 * 1024 * 1024;\n\n // Update Mime-type if needed (for IE8 and lower?)\n $fileExtension = pathinfo($file->name, PATHINFO_EXTENSION);\n $file->type = Helpers::get_mimetype($fileExtension);\n\n // Overwrite if needed\n $current_entry_id = false;\n if ('1' === $this->get_processor()->get_shortcode_option('overwrite')) {\n $parent_folder = $this->get_client()->get_folder($upload_folder_id);\n $current_entry = $this->get_client()->get_cache()->get_node_by_name($file->name, $parent_folder['folder']);\n\n if (!empty($current_entry)) {\n $current_entry_id = $current_entry->get_id();\n }\n }\n\n // Create new Google File\n $googledrive_file = new \\UYDGoogle_Service_Drive_DriveFile();\n $googledrive_file->setName($file->name);\n $googledrive_file->setMimeType($file->type);\n $googledrive_file->setDescription($file->description);\n\n if ('1' === $this->get_processor()->get_shortcode_option('upload_keep_filedate') && isset($_REQUEST['last_modified'])) {\n $last_modified = date('c', ($_REQUEST['last_modified'] / 1000)); // Javascript provides UNIX time in milliseconds, RFC 3339 required\n $googledrive_file->setModifiedTime($last_modified);\n }\n\n // Convert file if needed\n $file->convert = false;\n if ('1' === $this->get_processor()->get_shortcode_option('convert')) {\n $importformats = $this->get_processor()->get_import_formats();\n $convertformats = $this->get_processor()->get_shortcode_option('convert_formats');\n if ('all' === $convertformats[0] || in_array($file->type, $convertformats)) {\n if (isset($importformats[$file->type])) {\n $file->convert = $importformats[$file->type];\n $filename = pathinfo($file->name, PATHINFO_FILENAME);\n $googledrive_file->setName($filename);\n }\n }\n }\n\n // Call the API with the media upload, defer so it doesn't immediately return.\n $this->get_app()->get_client()->setDefer(true);\n\n try {\n if (false === $current_entry_id) {\n $googledrive_file->setParents([$upload_folder_id]);\n $request = $this->get_app()->get_drive()->files->create($googledrive_file, ['supportsAllDrives' => true, 'enforceSingleParent' => true]);\n } else {\n $request = $this->get_app()->get_drive()->files->update($current_entry_id, $googledrive_file, ['supportsAllDrives' => true, 'enforceSingleParent' => true]);\n }\n } catch (\\Exception $ex) {\n $file->error = esc_html__('Not uploaded to the cloud', 'wpcloudplugins').': '.$ex->getMessage();\n $return['status']['progress'] = 'upload-failed';\n self::set_upload_progress($file->hash, $return);\n echo json_encode($return);\n\n error_log('[WP Cloud Plugin message]: '.sprintf('Not uploaded to the cloud on line %s: %s', __LINE__, $ex->getMessage()));\n\n exit();\n }\n\n // Create a media file upload to represent our upload process.\n $media = new \\UYDGoogle_Http_MediaFileUpload(\n $this->get_app()->get_client(),\n $request,\n $file->type,\n null,\n true,\n $chunkSizeBytes\n );\n\n $filesize = filesize($file->tmp_path);\n $media->setFileSize($filesize);\n\n /* Start partialy upload\n Upload the various chunks. $status will be false until the process is\n complete. */\n try {\n $upload_status = false;\n $bytesup = 0;\n $handle = fopen($file->tmp_path, 'rb');\n while (!$upload_status && !feof($handle)) {\n @set_time_limit(60);\n $chunk = fread($handle, $chunkSizeBytes);\n $upload_status = $media->nextChunk($chunk);\n $bytesup += $chunkSizeBytes;\n\n // Update progress\n // Update the progress\n $status = [\n 'bytes_up_so_far' => $bytesup,\n 'total_bytes_up_expected' => $file->size,\n 'percentage' => (round(($bytesup / $file->size) * 100)),\n 'progress' => 'uploading-to-cloud',\n ];\n\n $current = self::get_upload_progress($file->hash);\n $current['status'] = $status;\n self::set_upload_progress($file->hash, $current);\n }\n\n fclose($handle);\n } catch (\\Exception $ex) {\n $file->error = esc_html__('Not uploaded to the cloud', 'wpcloudplugins').': '.$ex->getMessage();\n $return['file'] = $file;\n $return['status']['progress'] = 'upload-failed';\n self::set_upload_progress($file->hash, $return);\n echo json_encode($return);\n\n error_log('[WP Cloud Plugin message]: '.sprintf('Not uploaded to the cloud on line %s: %s', __LINE__, $ex->getMessage()));\n\n exit();\n }\n\n $this->get_app()->get_client()->setDefer(false);\n\n if (empty($upload_status)) {\n $file->error = esc_html__('Not uploaded to the cloud', 'wpcloudplugins');\n $return['file'] = $file;\n $return['status']['progress'] = 'upload-failed';\n self::set_upload_progress($file->hash, $return);\n echo json_encode($return);\n\n error_log('[WP Cloud Plugin message]: '.sprintf('Not uploaded to the cloud'));\n\n exit();\n }\n\n // check if uploaded file has size\n usleep(500000); // wait a 0.5 sec so Google can create a thumbnail.\n $api_entry = $this->get_app()->get_drive()->files->get($upload_status->getId(), ['fields' => $this->get_client()->apifilefields, 'supportsAllDrives' => true]);\n\n if ((0 === $api_entry->getSize()) && (false === strpos($api_entry->getMimetype(), 'google-apps'))) {\n $deletedentry = $this->get_app()->get_drive()->files->delete($api_entry->getId(), ['supportsAllDrives' => true]);\n $file->error = esc_html__('Not succesfully uploaded to the cloud', 'wpcloudplugins');\n $return['status']['progress'] = 'upload-failed';\n\n return;\n }\n\n // Add new file to our Cache\n $entry = new Entry($api_entry);\n $cachedentry = $this->get_processor()->get_cache()->add_to_cache($entry);\n $file->completepath = $cachedentry->get_path($this->get_processor()->get_root_folder());\n $file->account_id = $this->get_processor()->get_current_account()->get_id();\n $file->fileid = $cachedentry->get_id();\n $file->filesize = Helpers::bytes_to_size_1024($file->size);\n $file->link = urlencode($cachedentry->get_entry()->get_preview_link());\n $file->folderurl = false;\n\n $folderurl = $cachedentry->get_parent()->get_entry()->get_preview_link();\n $file->folderurl = urlencode($folderurl);\n }\n\n $return['file'] = $file;\n $return['status']['progress'] = 'upload-finished';\n $return['status']['percentage'] = '100';\n self::set_upload_progress($file->hash, $return);\n\n // Create response\n echo json_encode($return);\n\n exit();\n }", "function do_upload()\r\n\t{\r\n\t\tif (isset($_FILES[$this->post_name]))\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$tmp_file\t= ( !$this->isArrayPostName ) ? $post['tmp_name'] : $post['tmp_name'][$this->arrayPostName];\r\n\r\n\t\t\tif ( is_uploaded_file( $tmp_file ) )\r\n\t\t\t{\r\n\t\t\t\tif ($this->filteringExtension($post))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->checkFileSize())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file_name = $this->getFileNameUploaded();\r\n\t\t\t\t\t\t$dest = $this->folder.$file_name;\r\n\t\t\t\t\t\t$upload = move_uploaded_file($tmp_file, $dest);\r\n\t\t\t\t\t\tif ($upload)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t@chmod($dest, $this->chmod);\r\n\t\t\t\t\t\t\t$this->file_name_sukses_uploaded = $file_name;\r\n\t\t\t\t\t\t\t$cfg_resize = array('source_image'=> $dest);\r\n\t\t\t\t\t\t\tif($this->is_resize)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$cfg_resize = array(\r\n\t\t\t\t\t\t\t\t\t'source_image'=> $dest,\r\n\t\t\t\t\t\t\t\t\t'width'\t\t\t\t=> $this->rez_width,\r\n\t\t\t\t\t\t\t\t\t'height'\t\t\t=> $this->rez_height\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t// pr(json_encode($cfg_resize, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $cfg_resize)->resize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_watermark)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->watermark_param['source_image'] = $dest;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($this->watermark_param, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $this->watermark_param)->watermark();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_thumbnail)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(substr($this->thumb_prefix, -1) == '/' && !is_dir($this->folder.$this->thumb_prefix))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t@mkdir($this->folder.$this->thumb_prefix, 0777);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$config = array_merge($cfg_resize, $this->thumb_param);\r\n\t\t\t\t\t\t\t\t$config['create_thumb'] = FALSE ;\r\n\t\t\t\t\t\t\t\t$config['new_image'] = $this->folder.$this->thumb_prefix.$file_name;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($config, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $config)->resize();\r\n\t\t\t\t\t\t\t\t_class('images')->move_upload($this->folder.$this->thumb_prefix.$file_name);\r\n\t\t\t\t\t\t\t\t@chmod($this->folder.$this->thumb_prefix.$file_name, $this->chmod);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t_class('images')->move_upload($dest);\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse $this->error_code .= 'move_upload_file_failed';\r\n\t\t\t\t\t} else $this->error_code .= 'file_size_max_exceeded';\r\n\t\t\t\t} else $this->error_code .= 'file_type_unallowed';\r\n\t\t\t}// end if is_uploaded_file\r\n#\t\t\telse $this->error_code .= 'file_upload_from_post_failed';\r\n\t\t}// end if isset\r\n\t\telse {\r\n#\t\t\t$this->error_code .= 'file_post_un_uploaded';\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'ad');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function getUploadedFiles() {}", "function rlip_handle_file_upload($data, $key) {\n global $USER, $DB;\n\n $result = false;\n\n //get general file storage object\n $fs = get_file_storage();\n\n //obtain the listing of files just uploaded\n $usercontext = get_context_instance(CONTEXT_USER, $USER->id);\n $files = $fs->get_area_files($usercontext->id, 'user', 'draft', $data->$key);\n\n if ($instanceid = $DB->get_field('block_instances', 'id', array('blockname' => 'rlip'), IGNORE_MULTIPLE)) {\n //try to use the block context\n $context = get_context_instance(CONTEXT_BLOCK, $instanceid);\n } else {\n //fall back to site context\n $context = get_context_instance(CONTEXT_SYSTEM);\n }\n\n //set up file parameters\n $file_record = array('contextid' => $context->id,\n 'component' => 'block_rlip',\n 'filearea' => 'files',\n 'filepath' => '/manualupload/');\n\n //transfer files to a specific area\n foreach ($files as $draftfile) {\n\n //file API seems to always upload a directory record, so ignore that\n if (!$draftfile->is_directory()) {\n $exists = false;\n\n //maintain the same filename\n $draft_filename = $draftfile->get_filename();\n $file = $fs->get_file($context->id, 'block_rlip', 'files',\n $data->$key, '/manualupload/', $draft_filename);\n\n if ($file) {\n //file exists\n $exists = true;\n $samesize = ($file->get_filesize() == $draftfile->get_filesize());\n $sametime = ($file->get_timemodified() == $draftfile->get_timemodified());\n\n //if not the same file, delete it\n if ((!$samesize || !$sametime) && $file->delete()) {\n $exists = false;\n }\n }\n\n if (!$exists) {\n //create as new file\n $file = $fs->create_file_from_storedfile($file_record, $draftfile);\n }\n\n //delete the draft file\n $draftfile->delete();\n\n //obtain the file record id\n $result = $file->get_id();\n }\n }\n\n return $result;\n}", "function post_file()\r\n\t{\r\n\r\n\t}", "protected function afterUpload()\n {\n $this->owner->trigger(self::EVENT_AFTER_UPLOAD);\n }", "function upload() {\n $item = filter($this->uri->segment(3), 'str', 40);\n $point = $this->point->get_by_id($item);\n\n if ( ! $point || empty($point)) {\n log_write(LOG_WARNING, 'Point object not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n redirect(config_item('site_url'));\n }\n \n $photos = $this->media->get_by_point($item);\n\n if (count($photos) >= config_item('max_photo_upload')) {\n return $this->output->set_output(json_encode(array(\n 'code' => 'error',\n 'text' => 'Загружено максимальное количество фотографий для этого обращения'\n )));\n }\n\n if ($point->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the point, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $directory = FCPATH . 'uploads/' . $item;\n\n if ( ! is_dir($directory)) {\n mkdir($directory, 0777, TRUE);\n }\n\n $config['upload_path'] = $directory;\n $config['allowed_types'] = 'jpeg|jpg|png';\n $config['max_size'] = 8000;\n $config['max_width'] = 6000;\n $config['max_height'] = 6000;\n $config['encrypt_name'] = TRUE;\n\n $this->load->library('upload', $config);\n\n if ( ! $this->upload->do_upload('file')) {\n\n debug($this->upload->display_errors());\n\n } else {\n \n $upload_data = $this->upload->data();\n \n $resize['image_library'] = 'gd2';\n $resize['create_thumb'] = TRUE;\n $resize['maintain_ratio'] = TRUE;\n $resize['quality'] = '60%';\n $resize['width'] = 280;\n $resize['height'] = 280;\n $resize['source_image'] = $upload_data['full_path'];\n \n $this->load->library('image_lib', $resize);\n \n if ( ! $this->image_lib->resize()) {\n debug($this->image_lib->display_errors());\n }\n\n $image = array(\n 'item_title' => $point->item_name,\n 'item_mime' => $upload_data['file_type'],\n 'item_size' => filesize($upload_data['full_path']),\n 'item_point' => $item,\n 'item_ext' => str_replace('.', '', $upload_data['file_ext']),\n 'item_filename' => $upload_data['file_name'],\n 'item_latitude' => $point->item_latitude,\n 'item_longitude' => $point->item_longitude,\n );\n\n $image_id = $this->media->create($image);\n\n log_write(LOG_INFO, 'Image save, ID: ' . $image_id . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n\n $photo = explode('.', $upload_data['file_name']);\n\n return $this->output->set_output(json_encode(array(\n 'code' => 'luck',\n 'image' => '/uploads/' . $item . '/' . $photo[0] . '_thumb.' . $photo[1],\n 'id' => $item\n )));\n }\n\n log_write(LOG_ERR, 'Image not loaded, PointID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }", "public function uploadAction()\n {\n if ($this->request->hasFiles() == true) {\n\n // Print the real file names and sizes\n foreach ($this->request->getUploadedFiles() as $file) {\n // 获取文件的MD5\n $filesModels = new Files();\n $fileInfo = $filesModels->uploadFiles($file);\n \n $movePath = $fileInfo['movePath'];\n $fileUrl = $fileInfo['fileUrl'];\n \n if(file_exists($movePath)) { \n $jsonReturn = array(\n 'success' => 'true',\n 'msg' => '上传成功',\n 'file_path' => $fileUrl\n );\n echo json_encode($jsonReturn); \n } else {\n $jsonReturn = array(\n 'success' => 'false',\n 'msg' => '上传失败'\n );\n echo json_encode($jsonReturn); \n }\n \n }\n }\n\n $this->view->setRenderLevel(View::LEVEL_NO_RENDER);\n }", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadFileToCloud() {\n\n\t\ttry {\n\n\t\t\tif (!Request::hasFile('file')) throw new \\Exception(\"File is not present.\");\n\n\t\t\t$attachmentType = Request::input('attachment_type');\n\n\t\t\tif (empty($attachmentType)) throw new \\Exception(\"Attachment type is missing.\");\n\n\t\t\t$file = Request::file('file');\n\n\t\t\tif (!$file->isValid()) throw new \\Exception(\"Uploaded file is invalid.\");\n\n\t\t\t$fileExtension = strtolower($file->getClientOriginalExtension());\n\t\t\t$originalName = $file->getClientOriginalName();\n\n\t\t\tif ($attachmentType == 'image' || $attachmentType == 'logo') {\n\t\t\t\tif (!in_array($fileExtension, array('jpg', 'png', 'tiff', 'bmp', 'gif', 'jpeg', 'tif'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t} else if ($attachmentType == 'audio') {\n\t\t\t\tif (!in_array($fileExtension, array('mp3', 'wav'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t}\n\n\t\t\t$additionalImageInfoString = Request::input('additionalImageInfo');\n\n\t\t\t$attachmentObj = ConnectContentAttachment::createAttachmentFromFile(\\Auth::User()->station->id, $file, $attachmentType, $originalName, $fileExtension, $additionalImageInfoString);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('attachment_id' => $attachmentObj->id, 'filename' => $originalName, 'url' => $attachmentObj->saved_path)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "public function uploadfiles()\n {\n return view ('filemanager.uploadfile'); \n }", "function upload()\r\n\t{\r\n\t\t$groups = $this->_form->getGroupsHiarachy();\r\n\t\tforeach ($groups as $groupModel) {\r\n\t\t\t$elementModels = $groupModel->getPublishedElements();\r\n\t\t\tforeach ($elementModels as $elementModel) {\r\n\t\t\t\tif ($elementModel->isUpload()) {\r\n\t\t\t\t\t$elementModel->processUpload();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function upload(Request $request)\n {\n //\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function preUpload()\n{ \n if (null !== $this->file) {\n // do whatever you want to generate a unique name\n $filename =$this->getName(); //sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->file->guessExtension();\n }\n}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'bestj');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function get_test_file_uploads()\n {\n }", "public function upload_postAction() {\r\n\t\t$ret = Common::upload('img', 'ad');\r\n\t\t$imgId = $this->getPost('imgId');\r\n\t\t$this->assign('code' , $ret['data']);\r\n\t\t$this->assign('msg' , $ret['msg']);\r\n\t\t$this->assign('data', $ret['data']);\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t//create webp image\r\n\t\tif ($ret['code'] == 0) {\r\n\t\t\t$attachPath = Common::getConfig('siteConfig', 'attachPath');\r\n\t\t\t$file = realpath($attachPath.$ret['data']);\r\n\t\t\timage2webp($file, $file.'.webp');\r\n\t\t}\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function enqueue_uploader()\n {\n }", "public function uploads(): array;", "public function dropzoneAction(Request $request, Album $album = null)\n {\n $user = $this->getUser();\n if (!is_object($user) || !$user instanceof UserInterface) {\n throw new AccessDeniedException('This user does not have access to this section.');\n }\n\n $plan = $user->getPlan();\n $maxPhotography = $plan->getMaxPhotography();\n $count = $album->countPhotographies();\n\n if($request->isXmlHttpRequest()) {\n\n if($count >= $maxPhotography){\n $response = new JsonResponse(array('Se alcanzó el límite de fotografías por álbum'), 401);\n return $response;\n }\n\n $file = $this->getRequest()->files->get('photography');\n $exif = @exif_read_data($file);\n $photography = new Photography();\n $photography->setUser($user);\n $photography->setFile($file);\n if ($exif) $photography->setExif($exif);\n $photography->setAlbum($album);\n $em = $this->getDoctrine()->getManager();\n $em->persist($photography);\n $em->flush();\n $response = new JsonResponse();\n $response->setData(array(\n 'success' => 200\n ));\n return $response;\n }\n\n $dropzoneForm = $this->createForm('FotoJoin\\ControlPanelBundle\\Form\\DropzoneType', null, array('action' => $this->generateUrl('photography_dropzone', array('album' => $album->getId()))));\n $dropzoneForm->handleRequest($request);\n\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository('FotoJoinControlPanelBundle:Album')->findBy(array('user' => $user));\n\n if($count >= $maxPhotography){\n return $this->render('FotoJoinControlPanelBundle:Photography:limit.html.twig', array(\n 'dropzone_form' => $dropzoneForm->createView(),\n 'user' => $user,\n 'album' => $album,\n 'albums' => $albums,\n ));\n }\n\n return $this->render('FotoJoinControlPanelBundle:Photography:dropzone.html.twig', array(\n 'dropzone_form' => $dropzoneForm->createView(),\n 'user' => $user,\n 'album' => $album,\n 'albums' => $albums,\n ));\n }", "public function ajaxfileupload() {\n\t\t\t$this->Fileuploader->ajaxfileupload();\n\t\t}", "public function ajaxfileupload() {\n\t\t\t$this->Fileuploader->ajaxfileupload();\n\t\t}", "function ajaxupload(){\n\t\t#error_reporting(E_ALL | E_STRICT);\n\t\trequire(APP.'Plugin'.DS.'TorrentTracker'.DS.'Vendor'.DS.'jqueryfileupload'.DS.'UploadHandler.php');\n\n\t\t//Capture output, this way we do not have to touch the UploadHandler object\n\t\tob_start();\n\n\t\t//Handle upload\n\t\tif(!file_exists($this->uploaddir)){\n\t\t\tmkdir($this->uploaddir);\n\t\t}\n\n\t\t//Upload to plugin upload dir\n\t\t$options['upload_dir'] = $this->uploaddir;\t\t\n\t\t\n\t\t$upload_handler = new UploadHandler($options); \n \t\t\n \t\t//Get output\n\t\t$json_output = ob_get_contents();\n\n\t\t//Clear buffer\n\t\tob_end_clean(); \n\n\t\t//Convert output to PHP object, we need filename\n\t\t$output = json_decode($json_output);\n\n\t\t//Create torrent of file\n\t\t$this->Torrent->createtorrent($output->files[0]->name);\n\n\t\t//Append torrentlink\n\t\t$output->files[0]->torrentlink = Router::url('/torrent_tracker/files/torrents/'.$output->files[0]->name.'.torrent',true);\n\n\t\t//Encode with torrentlink for json output\n\t\t$json_output = json_encode($output);\n\t\n\t\t//Do not render view. The UploadHandler will respond\n\t\techo $json_output; //Echo the json output for the file upload plugin\n\n\t\t//Do not render view\n\t\t$this->autoRender = false;\n\t}", "function save_items_as_downloads_ajax() {\n\t\t$path = str_replace( '\\\\\\\\', '\\\\', $_POST['path'] );\n\t\t$date = $_POST['selection_date'];\n\t\tif ( isset( $_POST['selected_files'] ) ) {\n\t\t\t$files = $this->edde_selected_files_to_array( $_POST['selected_files'] );\n\t\t} else {\n\t\t\t$files = false;\n\t\t}\n\n\t\t$result = new Import_From_Uploads( $path, $files, $date);\n\t\tif ( $result ) {\n\t\t\techo 'Success!';\n\t\t} else {\n\t\t\techo 'Something went wrong =(';\n\t\t}\n\t\twp_die();\n\t}", "public function upload() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n\n if (!empty($this->request->data['Upload'])) {\n // form is niet leeg\n\n $upload = $this->stripdefaults($this->request->data['Upload'], $defaults); // strip default values\n\n $thereisfile = false;\n\n if (isset($upload['selimg']['size'])) {\n if ($upload['selimg']['size'] != 0) {\n // upload file\n if ($upload['selimg']['error'] == 0) {\n $thereisfile = true;\n }\n }\n }\n\n if ($thereisfile) {\n // sometimes filenames contain a . , get the last item\n $fnamea = explode('.', $upload['selimg']['name']);\n $thepos = count($fnamea) - 1;\n $extension = strtolower($fnamea[$thepos]);\n $this->Media->set('extensie', $extension);\n\n // remove unwanted characters\n $filename = str_replace(\" \", \"_\", $upload[\"selimg\"][\"name\"]);\n $filename = str_replace(\",\", \"_\", $filename);\n $filename = str_replace(\"*\", \"_\", $filename);\n $filename = str_replace(\"%\", \"_\", $filename);\n $filename = str_replace(\"?\", \"_\", $filename);\n $filename = str_replace(\":\", \"_\", $filename);\n $filename = str_replace(\"|\", \"_\", $filename);\n\n\n // fix extension to remove extra .\n $filename = str_replace(\".\", \"_\", $filename);\n $filename = str_replace(\"_\" . $extension, \".\" . $extension, $filename);\n\n $this->Media->set(\"originalfilename\", $filename);\n }\n\n\n\n if ($this->Auth->loggedIn()) {\n // echo('logged in');\n $this->Media->set('user_id', $this->Auth->user('id'));\n } else {\n if ($upload['email'] != \"\") {\n $user_id = $this->User->giveid($upload['email'], $upload['naam']);\n } else {\n $user_id = 0;\n }\n\n $this->Media->set('user_id', $user_id);\n }\n\n\n\n // *** datering\n if (isset($upload['datum']))\n $this->Media->set('datering', $upload['datum']);\n if (isset($upload['opmerkingen'])) {\n $opmerkingen = htmlentities($upload['opmerkingen']);\n $opmerkingen = str_replace(\"'\", \"&rsquo;\", $opmerkingen);\n $this->Media->set('opmerkingen', $opmerkingen);\n }\n if (isset($upload['exturl']))\n $this->Media->set('exturl', $upload['exturl']);\n if (isset($upload['extid']))\n $this->Media->set('extid', $upload['extid']);\n if (isset($upload['extthumb'])) {\n $this->Media->set('extthumb', $upload['extthumb']);\n // $extension \t\t= pathinfo($upload['extthumb'],PATHINFO_EXTENSION);\n //\t$this->Media->set('extensie', $extension);\n }\n // *** straat\n $this->Locationcode = $this->Components->load('Locationcode'); // load component\n $this->Locationcode->startup();\n\n if (isset($upload['latlng'])) {\n // pin put on map\n // store or get lat lon ; get the id\n $ll = explode(\",\", $upload['latlng']);\n $lat = $ll[0];\n $lng = $ll[1];\n $location_id = $this->Location->giveanid($lat, $lng);\n\n // $upload['straat']\n } else {\n // adres entry\n $huis = ($upload['huisnummer'] != \"\" ? \",\" . $upload['huisnummer'] : \"\");\n $searchfor = $upload['straat'] . $huis . ',amsterdam,netherlands';\n\n\n\n $location_id = $this->Locationcode->getlocation($searchfor);\n }\n\n\n\n $object_id = $this->Objectsatlocation->giveobjectid($location_id);\n\n if (!$object_id) {\n $this->Objects->set('naam', ' ');\n $this->Objects->set('type', ' ');\n\n $this->Objects->save();\n $object_id = $this->Objects->id;\n\n $this->Objectsatlocation->set('object_id', $object_id);\n $this->Objectsatlocation->set('location_id', $location_id);\n\n $this->Objectsatlocation->save();\n }\n\n // *** titel\n $titel = $upload['titel'];\n if ($titel && $titel != \"titel\")\n $this->Media->set('titel', $titel);\n\n\n $this->Media->set('storageloc_id', '1');\n $this->Media->set('soort_id', '1'); // 1-image,2-video\n $this->Media->set('huisnummer', $upload['huisnummer']);\n\n $this->Media->save();\n\n $media_id = $this->Media->id;\n\n\n $this->Mediaaboutobjects->set('object_id', $object_id);\n $this->Mediaaboutobjects->set('media_id', $media_id);\n $this->Mediaaboutobjects->save();\n\n\n if ($thereisfile) {\n\n // u =uploaded file\tSKIPPED\n // e= external fileSKIPPED\n // subdirs calc = dechex ( intval($filename/1000) ) .\"/\".dechex ( $filename % 1000);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $success = rename($upload['selimg']['tmp_name'], $storename);\n\n\n // determine filetype\n\n $theurl = \"http://media.bvstemmen.nl/\" . $filecalc;\n\n $info = get_headers($theurl, 1);\n $mime = split(\"/\", $info['Content-Type']);\n\n $mimekind = $mime[0]; // type: video, audio, image, text, application\n $mimetypa = $mime[1]; // subtype, e.g.: jpg, gif, html, mp3 etc\n $mimetmps = split(\";\", $mimetypa); // e.g. text/html;charset: utf-8\n $mimetype = $mimetmps[0];\n\n\n if ($mimekind == 'video') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/video.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '2'); // 1-image,2-video\n $this->Media->save();\n }\n\n\n if ($mimekind == 'audio') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/audio.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '3'); // 1-image,2-video,3-audio\n $this->Media->save();\n }\n\n\n if ($mimekind == 'text') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '4'); // 1-image,2-video,3-audio,4-text\n $this->Media->save();\n }\n\n if ($mimekind == 'application') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '5'); // 1-image,2-video,3-audio,4-text,5-application\n $this->Media->save();\n }\n }\n\n\n if (isset($upload['extthumb'])) {\n //store local, no external img linking\n $extfile = file_get_contents($upload['extthumb']);\n $extension = pathinfo($upload['extthumb'], PATHINFO_EXTENSION);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n\n $existsdir = '/sites/bvstemmen.nl/media' . \"/\";\n $subdirs = split(\"/\", pathinfo($filecalc, PATHINFO_DIRNAME));\n\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $handle = fopen($storename, \"w\");\n fwrite($handle, $extfile);\n fclose($handle);\n }\n\n // *** tags\n\n if (PROJECTSHORTNAME != \"www\") {\n // save a tag for this project\n $tagid = $this->Tagnames->giveanid(PROJECTSHORTNAME);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n\n if ($upload['tags'] != \"\") {\n $tags = split(\",\", $upload['tags']);\n\n $numtags = count($tags);\n\n for ($i = 0; $i < $numtags; ++$i) {\n $thetag = trim($tags[$i]);\n $tagid = $this->Tagnames->giveanid($thetag);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n }\n\n\n // *** maker\n if ($upload['maker'] != \"\") {\n $maker_id = $this->User->nametoid($upload['maker']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $maker_id);\n $this->Nameswithmedium->set('relatiesoort', 'maker');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n // *** wie staan er op\n if ($upload['personen'] != \"\") {\n $personen_id = $this->User->nametoid($upload['personen']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $personen_id);\n $this->Nameswithmedium->set('relatiesoort', 'staat op');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n\n\n $onderwerp = 'Nieuwe upload ' . $upload['naam'];\n $bericht = \"http:\" . HOMEURL . \"/media/detail/\" . $media_id;\n $bericht .= \"\\n\\n\\nDit is een automatisch genegeerd e-mailbericht.\";\n $to = EMAILINFO;\n $from = EMAILINFO;\n $audience = 'internal';\n $level = \"info\";\n\n $this->notify($onderwerp, $bericht, $to, $from, $audience, $level);\n\n $this->render('uploaddank');\n } else {\n\n $this->Session->setFlash('Selecteer een bestand en probeer het opnieuw.');\n }\n }", "#[Post('/upload', name: 'upload')]\n public function upload(Request $request)\n {\n if (! ($file = $request->file('file'))) {\n abort(400);\n }\n\n $path = $file->store('upload', 'files');\n\n return [\n 'location' => Storage::disk('files')->url($path),\n ];\n }", "public function uploadtoserver() {\r\n $targetDir = $_SERVER['DOCUMENT_ROOT'] . '/uploads/items/';\r\n\r\n //$cleanupTargetDir = false; // Remove old files\r\n //$maxFileAge = 60 * 60; // Temp file age in seconds\r\n // 5 minutes execution time\r\n @set_time_limit(5 * 60);\r\n\r\n // Uncomment this one to fake upload time\r\n // usleep(5000);\r\n // Get parameters\r\n $chunk = isset($_REQUEST[\"chunk\"]) ? $_REQUEST[\"chunk\"] : 0;\r\n $chunks = isset($_REQUEST[\"chunks\"]) ? $_REQUEST[\"chunks\"] : 0;\r\n $fileName = isset($_REQUEST[\"name\"]) ? $_REQUEST[\"name\"] : '';\r\n // Clean the fileName for security reasons\r\n $fileName = preg_replace('/[^\\w\\._]+/', '', $fileName);\r\n\r\n // Make sure the fileName is unique but only if chunking is disabled\r\n if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {\r\n unlink($targetDir . DIRECTORY_SEPARATOR . $fileName);\r\n /*$ext = strrpos($fileName, '.');\r\n $fileName_a = substr($fileName, 0, $ext);\r\n $fileName_b = substr($fileName, $ext);\r\n\r\n $count = 1;\r\n while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b))\r\n $count++;\r\n\r\n $fileName = $fileName_a . '_' . $count . $fileName_b;*/\r\n }\r\n\r\n // Create target dir\r\n if (!file_exists($targetDir))\r\n @mkdir($targetDir);\r\n\r\n if (isset($_SERVER[\"HTTP_CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"HTTP_CONTENT_TYPE\"];\r\n\r\n if (isset($_SERVER[\"CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"CONTENT_TYPE\"];\r\n\r\n // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5\r\n if (strpos($contentType, \"multipart\") !== false) {\r\n if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen($_FILES['file']['tmp_name'], \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n fclose($in);\r\n fclose($out);\r\n @unlink($_FILES['file']['tmp_name']);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\r\n }\r\n else {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen(\"php://input\", \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n\r\n fclose($in);\r\n fclose($out);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n // Return JSON-RPC response\r\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\"}');\r\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'Recsite');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }" ]
[ "0.67579", "0.67418575", "0.6719007", "0.6709469", "0.66359144", "0.6467819", "0.6426453", "0.6343955", "0.6312949", "0.62610024", "0.6251879", "0.62234145", "0.6213375", "0.61678827", "0.61585456", "0.6090904", "0.60703826", "0.6029251", "0.60124546", "0.5975467", "0.59603107", "0.59561235", "0.5946586", "0.58929044", "0.5866796", "0.5866796", "0.5862468", "0.5860605", "0.58605444", "0.58577406", "0.58364475", "0.5834905", "0.5827713", "0.58086836", "0.5794104", "0.57940483", "0.577311", "0.5770313", "0.5755223", "0.5752602", "0.5720396", "0.5719058", "0.57173645", "0.57117325", "0.5711593", "0.56969535", "0.56963694", "0.5679784", "0.56708163", "0.56691927", "0.5660994", "0.5658766", "0.565315", "0.565119", "0.564902", "0.5635025", "0.5628167", "0.5625068", "0.56197125", "0.5619611", "0.56173044", "0.56173044", "0.56172013", "0.5611277", "0.5610603", "0.56093526", "0.56045353", "0.56028926", "0.5602674", "0.558928", "0.5586192", "0.5583984", "0.5580473", "0.5580473", "0.5579502", "0.5575965", "0.5569632", "0.5560554", "0.5556831", "0.5556831", "0.5556831", "0.5556831", "0.5556831", "0.5556831", "0.5556111", "0.55464756", "0.55353385", "0.5525509", "0.55214256", "0.55208874", "0.55159736", "0.5510467", "0.550964", "0.550964", "0.55096203", "0.55028963", "0.5498658", "0.5498275", "0.54923576", "0.5487842", "0.54871154" ]
0.0
-1
Get all files from uploads folder
public function uploaded_files() { if(Module::hasAccess("Uploads", "view")) { $uploads = array(); // print_r(Auth::user()->roles); if(Entrust::hasRole('SUPER_ADMIN')) { $uploads = Upload::all(); } else { if(config('laraadmin.uploads.private_uploads')) { // Upload::where('user_id', 0)->first(); $uploads = Auth::user()->uploads; } else { $uploads = Upload::all(); } } $uploads2 = array(); foreach ($uploads as $upload) { $u = (object) array(); $u->id = $upload->id; $u->name = $upload->name; $u->extension = $upload->extension; $u->hash = $upload->hash; $u->public = $upload->public; $u->caption = $upload->caption; $u->user = $upload->user->name; $uploads2[] = $u; } // $folder = storage_path('/uploads'); // $files = array(); // if(file_exists($folder)) { // $filesArr = File::allFiles($folder); // foreach ($filesArr as $file) { // $files[] = $file->getfilename(); // } // } // return response()->json(['files' => $files]); return response()->json(['uploads' => $uploads2]); } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access" ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFiles()\n {\n return R::findAll('upload');\n }", "public function getUploadedFiles() {}", "public function getFiles() {}", "public function getFiles();", "public function getFiles();", "public function getFiles();", "public function getFiles ();", "public function getAllUploads() {\n return Upload::all();\n }", "public function getFiles() {\r\n\r\n $files = array();\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n $dir = FILEPATH . $userId. '/' . $trackingId;\r\n\r\n if (is_dir($dir)) {\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if($file != '.' && $file != '..') {\r\n $size = $this->Size($dir . '/' . $file);\r\n array_push($files, array('name'=>$file,\r\n 'urlfilename'=>urlencode($file),\r\n 'size'=>$size));\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n\r\n return $files;\r\n }", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t$u->url = $upload->url;\n\t\t\t\t$u->thumbnails = $upload->thumbnails;\n\t\t\t\t$u->path = $upload->path;\n\t\t\t\t$u->type = $upload->type;\n\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function getAll()\n {\n return $files;\n }", "public function getUploadedFiles()\n {\n }", "public function all()\n {\n $dir = public_path() . '/uploads/temp/' . Session::getId() . '/';\n $data = [];\n $mimetypes = new Mimetype;\n if(file_exists($dir)) {\n foreach(scandir($dir) as $file) {\n if(in_array($file, ['.', '..'])) continue;\n $filedata = [];\n $filedata['name'] = $file;\n $filedata['url'] = url('/uploads/temp/' .Session::getId() . '/' .$file);\n $filedata['size'] = File::size($dir . $file);\n $filedata['type'] = $mimetypes->detectByFileExtension(File::extension($file));\n $data[] = $filedata;\n }\n return $data;\n }\n }", "public function getAllFiles()\n {\n }", "public function getFiles() {\n return $this->getPartFiles(0);\n }", "public static function getAll_files() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, file_name, uploaded, user FROM files\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }", "public function getAllFiles(): Collection\n {\n return $this->files;\n }", "public function files()\n {\n if($this->collection->empty())\n {\n foreach($this->fileList() as $file)\n {\n if(!is_dir($file))\n {\n $this->files->push($file);\n $this->collection->push(new Reader($this->path . $file));\n }\n else\n {\n $this->directories->push($file);\n }\n }\n }\n\n return $this->collection->get();\n }", "public function files() {\n\t\t$files = $this->ApiFile->fileList($this->path);\n\t\t$this->set('files', $files);\n\t}", "private function getUploadedFiles()\n {\n $list = array();\n \n if(isset($_REQUEST['files']))\n {\n $files = explode('::', $_REQUEST['files']);\n foreach($files as $index => $item)\n {\n list($name, $src, $size) = explode(':', $item);\n \n $list[] = array(\n 'name' => $name,\n 'src' => $src,\n 'size' => $size \n );\n }\n }\n \n return $list;\n }", "public function allFiles()\n {\n if (!empty($this->convertedFiles)) {\n return $this->convertedFiles;\n }\n $files = $this->files->all();\n $this->convertedFiles = self::convertUploadedFiles($files);\n return $this->convertedFiles;\n }", "public function get_test_file_uploads()\n {\n }", "public function getFiles(): array;", "public function get_files()\n {\n }", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public static function getFiles()\n\t{\n\t\t$result = Array();\n\t\t$files = sfCore::$db->query(\"SELECT * FROM `swoosh_file_storage`\")->asObjects();\n\t\tforeach($files as $file){\n\t\t\t$sfFileStorageItem = sfCore::make('sfFileStorageItem');\n\t\t\t$sfFileStorageItem->loadFromObject($file);\n\t\t\t$result[] = $sfFileStorageItem;\n\t\t}\n\t\treturn $result;\n\t}", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "function getFiles()\r\n\t{\r\n\t\treturn $this->files;\r\n\t}", "public function getFiles()\n {\n echo json_encode($this->galery->getFiles());\n }", "public function getFiles() {\n return $this->files;\n }", "public function getFiles() {\n return $this->files;\n }", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "public function getAll()\n {\n try {\n $response = $this->getClient()->request('GET', $this->url . \"/files\", [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->token,\n ],\n ]);\n } catch (\\Exception $e) {\n $response = $e;\n }\n\n return json_decode($response->getBody()->getContents());\n }", "public function files();", "public function files();", "public function files();", "public function getFiles(){\r\n $fids = Input::get('FILES');\r\n $files = array();\r\n foreach($fids as $fid){\r\n $file = UploadedFiles::find($fid);\r\n if($file == null)\r\n return -1;\r\n $files[]=$file;\r\n }\r\n return json_encode($files);\r\n }", "public function getFiles()\n {\n $request = $this->getRequest();\n return (array)$request->getFiles();\n }", "public function getFiles()\n {\n return $this->_files;\n }", "public function getFiles() {\n\t\treturn $this->files;\n\t}", "public function getFiles(): array\n {\n return $this->files;\n }", "public function getUploadedFiles()\n {\n return $this->uploadedFiles;\n }", "public function getUploadedFiles()\n {\n return $this->uploadedFiles;\n }", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }", "public function files()\r\n {\r\n return $this->files;\r\n }", "public function getFileUploads()\n {\n return $this->file_uploads;\n }", "public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "public static function filelist()\n\t{\n\t\tglobal $g_relative_file_directory;\t// '../../UPLOADS/';\n\t\tglobal $g_relative_root_directory;\t// 'UPLOADS/';\n\n\t\t$actualdirectory = $_POST['actualdir'];\n\t\tif(!$actualdirectory)\n\t\t\t$actualdirectory='';\n\n\t\t$result = [];\n\t\t$result['directory'] = $g_relative_root_directory;\n\t\t$result['actualdir'] = $actualdirectory;\n\n\t\tif(strlen($actualdirectory)>0)\n\t\t\t$actualdirectory.=\"/\";\n\n\t\t$reldir = $g_relative_file_directory.$actualdirectory;\n\t\t$dirs=[];\n\t\tforeach(glob($reldir.'*', GLOB_ONLYDIR) as $d)\n\t\t{\n\t\t\t$fn=str_replace($reldir,'',$d);\n\t\t\t$dirs[] = $fn;\n\t\t}\n\t\t$result['dirs']=$dirs;\n\t\t//$result['reldir']=$reldir;\n\n\t\t$filenames = [];\n\t\tforeach(array_filter(glob($reldir.'*.*'), 'is_file') as $file)\n\t\t{\n\t\t\t$farray = [];\n\t\t\t$fn=str_replace($reldir,'',$file);\n\n\t\t\t$f=filesize($file);\n\t\t\t$fe=\"bytes\";\n\t\t\tif($f/1024 > 1)\n\t\t\t{\n\t\t\t\t$f/=1024;\n\t\t\t\t$fe=\"kb\";\n\t\t\t\tif($f/1024 > 1)\n\t\t\t\t{\n\t\t\t\t\t$f/=1024;\n\t\t\t\t\t$fe=\"Mb\";\n\t\t\t\t\tif($f/1024 > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$f/=1024;\n\t\t\t\t\t\t$fe=\"GB\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$farray['Filename'] = $fn;\n\t\t\t$farray['Filesize'] = number_format($f,1);\n\t\t\t$farray['FilesizeDeterminant'] = $fe;\n\n\t\t\t$filenames[] = $farray;\n\t\t}\n\t\t$result['files']=$filenames;\n\n\t\theader('Content-Type: application/json');\n\t\techo(json_encode($result));\n\t}", "function get_all_media() {\n\t\treturn $this->mediaFiles;\n\t}", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function uploads(): array;", "public function getFiles() : array\n {\n return $this->files;\n }", "private function searchFiles()\n {\n $query = File::whereNull('deleted_at');\n $data = $query->get();\n\n return $data;\n }", "public function Get(){\n\n // TODO: this is horrible - try to use glob or RecursiveIteratorIterator - no time\n $fileList = [];\n\n if (!is_dir($this->currentPath)) {\n return $fileList;\n }\n\n $files = $this->scanFolder($this->currentPath);\n\n // up one level link\n if ($this->currentPath != $this->rootPath) {\n $fileList[] = array(\n 'file_name' => \"&uarr;\",\n 'directory' => true,\n 'extension' => '',\n 'size' => \"\",\n 'link' => $this->oneLevelUp(),\n );\n }\n\n foreach ($files as $file) {\n if($file == \".\" || $file == \"..\"){\n continue;\n }\n\n if ($this->isDir($file)) {\n $fileList[] = array(\n 'file_name' => $file,\n 'directory' => true,\n 'extension' => 'folder',\n 'size' => \"\",\n 'link' => $this->currentPath . $file,\n );\n } else {\n // filter on the fly\n $ext = $this->fileExtension($file);\n if(!empty($this->extensionFilter)){\n if(!in_array($ext, $this->extensionFilter)){\n continue;\n }\n }\n $fileList[] = [\n 'file_name' => $file,\n 'directory' => false,\n 'extension' => $ext,\n 'size' => $this->fileSize($file),\n 'link' => \"\",\n ];\n\n }\n }\n\n return $fileList;\n }", "public function getAllFiles(){\n $user = auth()->user();\n $cloud = CloudFile::where('user_id', $user->id);\n $active = $cloud->where('active',true)->get();\n $trash = $cloud->where('active',true)->onlyTrashed()->get();\n\n return $this->respondWithSuccess('Files details',[\n 'active'=>$active,'trash'=>$trash]);\n }", "public function getAllFiles() {\n $files = [];\n\n foreach(scandir($this->dir) as $filename) {\n if($filename != '.' && $filename != '..') {\n $files[] = $this->getFileInfo($filename);\n }\n }\n\n return $files;\n }", "function getFiles($folder) {\n\t\tif (!file_exists($folder)) {\n\t\t\tLogger(\"ERR\", \"Folder not found\");\n\t\t}\n\t\t$src_files = $this->listFiles($folder);\n\t\treturn $src_files;\n\t}", "public function uploaded_files($caso_id)\n {\n $caso = Caso::find($caso_id);\n\n $uploads = $caso->uploads;\n\n $uploads2 = array();\n foreach ($uploads as $upload) {\n $empleado = $upload->empleado();\n $u = (object) array();\n $u->id = $upload->id;\n $u->name = $upload->name;\n $u->extension = $upload->extension;\n $u->hash = $upload->hash;\n $u->public = $upload->public;\n $u->caption = $upload->caption;\n $u->user = $empleado !== null ? $empleado->nombres : isset($upload->user) ? $upload->user->name : '';\n\n $uploads2[] = $u;\n }\n\n // $folder = storage_path('/uploads');\n // $files = array();\n // if(file_exists($folder)) {\n // $filesArr = File::allFiles($folder);\n // foreach ($filesArr as $file) {\n // $files[] = $file->getfilename();\n // }\n // }\n // return response()->json(['files' => $files]);\n return response()->json(['uploads' => $uploads2]);\n }", "public function getUploadedFiles()\n {\n if (null === $this->uploadedFiles) {\n $this->uploadedFiles = UploadedFilesFactory::createFiles();\n }\n return $this->uploadedFiles;\n }", "public function getFiles(DirectoryInterface $directory): array;", "public function getFiles()\n {\n $result = array();\n foreach ($this->_subdirectories as $directory) {\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n $directory->getFiles()\n )\n );\n }\n $result = array_merge(\n $result,\n array_map(\n array($this, '_prependDirectory'),\n array_keys($this->_files)\n )\n );\n return $result;\n }", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "function icedrive_get_files($path)\r\n {\r\n $files = array();\r\n $response = $this->icedrive->request('PROPFIND', $path);\r\n $response = $this->icedrive_response_to_array($response['body']);\r\n foreach ($response['dresponse'] as $file) {\r\n $files[] = $file['dhref'];\r\n }\r\n return $files;\r\n }", "public function filesInThis($directory)\n\t{\n\t\treturn Storage::files($directory);\n\t}", "public function index()\n {\n $files = $this->files\n ->getFilesPaginated(config('core.sys.file.default_per_page'))\n ->items();\n return $this->handler\n ->apiResponse($files);\n }", "public function getFiles()\n {\n $dir = $this->getDir();\n\n return array_filter(array_map(function ($file) use ($dir) {\n if (is_file($dir.$file) && pathinfo($file, PATHINFO_EXTENSION) == 'php') {\n return $dir.$file;\n }\n }, scandir($dir)));\n }", "public function findFiles();", "function scanDir() {\r\n $returnArray = array();\r\n \r\n if ($handle = opendir($this->uploadDirectory)) {\r\n \r\n while (false !== ($file = readdir($handle))) {\r\n if (is_file($this->uploadDirectory.\"/\".$file)) {\r\n $returnArray[] = $file;\r\n }\r\n }\r\n \r\n closedir($handle);\r\n }\r\n else {\r\n die(\"<b>ERROR: </b> No se puede leer el directorio <b>\". $this->uploadDirectory.'</b>');\r\n }\r\n return $returnArray; \r\n }", "public function getFiles(): array\n {\n return [$this->file];\n }", "public function getFiles()\n {\n return FileInfo::findBy( Condition::EQ(FileInfo::TABLE, 'module_id', $this->getId()),\n new ArrayObject(array('sort'=>$this->getSortBy(), 'ord'=>'asc')) );\n }", "public function files()\n {\n return $this->_array[\"files\"];\n }", "function retrieveAllFiles($service) { \n $result = array();\n $pageToken = NULL;\n\n do {\n try {\n $parameters = array();\n if ($pageToken) {\n $parameters['pageToken'] = $pageToken;\n }\n $files = $service->files->listFiles($parameters);\n\n $result = array_merge($result, $files['items']); \n\n $pageToken = $files['nextPageToken'];\n } catch (Exception $e) {\n print \"An error occurred: \" . $e->getMessage();\n $pageToken = NULL;\n }\n } while ($pageToken); \n return $result;\n }", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "private function get_files(): array {\n\t\t$files = [];\n\n\t\tif ( $this->directory->is_readable() ) {\n\t\t\tforeach ( $this->directory->get_files() as $file ) {\n\t\t\t\tif ( ! $file->isFile() || ! $file->isReadable() || $file->getSize() === 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->extension !== null && $this->extension !== $file->getExtension() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$files[] = $file->getFileInfo();\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}", "public function getFileStorages() {}", "public function listFiles($dir);", "public function getEmbeddedFiles() {}", "function get_file_objs() {\n return $this->file_objs;\n }", "protected function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$files = array(\n\t\t\t\t\"test.txt\" => uniqid(),\n\t\t\t\t\"test2.txt\" => uniqid(),\n\t\t\t\t\"test3.txt\" => uniqid(),\n\t\t\t);\n\t\t\tforeach($files as $file => $content) {\n\t\t\t\tfile_put_contents($this->path.\"/\".$file,$content);\n\t\t\t\t$this->assertTrue(file_exists($this->path.\"/\".$file));\n\t\t\t}\n\t\t\t$this->_files = array_keys($files);\n\t\t}\n\t\treturn $this->_files;\n\t}", "public static function upload_all(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->upload_all();\n }", "function get_list_file_uploaded($params) {\n $sql = \"SELECT * FROM fa_files WHERE data_id = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "function getAllFiles() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` FROM `file`');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function getFiles($id)\n {\n $user = $this->db->select('upload')->from('user')->where('id',$id)->get(); \n return $user->result();\n }", "private function getFileList(){\n // Using the high-level iterators returns ALL the objects in your bucket, low level returns truncated result of about 1000 files\n $objects = $this->AmazonClient->getIterator('ListObjects', array('Bucket' => $this->getDataFromBucket));\n return $objects;\n }", "function retrieveFilesArray($folderId, $apiKey){\n $request = 'https://www.googleapis.com/drive/v3/files?pageSize=999&orderBy=name&q=%27'.$folderId.'%27+in+parents&fields=files(id%2CimageMediaMetadata%2Ftime%2CimageMediaMetadata%2Flocation%2CmimeType%2Cname%2CmodifiedTime%2Cdescription)&key='.$apiKey;\n $response = get_url_content($request);\n //echo $response;\n $response = json_decode($response, $assoc = true);\n $fileArray = $response['files'];\n return $fileArray;\n}", "protected function getFiles(): array\n {\n return [];\n }", "function getFileList() {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// use the getURL function to call the URL\n\t$response = getURL($apiBaseURL);\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\n\t// return the response\n\treturn($response);\n}" ]
[ "0.8097441", "0.77835095", "0.7777596", "0.77612865", "0.77612865", "0.77612865", "0.76237845", "0.7439349", "0.7432571", "0.7399751", "0.73831296", "0.7307203", "0.7297809", "0.7290996", "0.72831875", "0.72307175", "0.7217953", "0.7200678", "0.71465343", "0.71094835", "0.7093322", "0.7080875", "0.70426106", "0.7028347", "0.70248115", "0.70224535", "0.70224416", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6941288", "0.6913868", "0.68987614", "0.6867961", "0.6867961", "0.6866456", "0.68540925", "0.684386", "0.684386", "0.684386", "0.6843414", "0.68343186", "0.6812102", "0.6800734", "0.67794913", "0.67595184", "0.67595184", "0.67224383", "0.67149025", "0.6701875", "0.66950107", "0.66847384", "0.6671494", "0.66639763", "0.66633904", "0.6660324", "0.6650632", "0.6618708", "0.66026276", "0.6599807", "0.6585527", "0.65853256", "0.65466446", "0.6531979", "0.65145326", "0.64920825", "0.64877445", "0.64827055", "0.64763415", "0.64739096", "0.6456728", "0.64524883", "0.6441351", "0.643932", "0.6435623", "0.6429944", "0.6428968", "0.6412091", "0.6406615", "0.6404349", "0.6376347", "0.6372923", "0.63492334", "0.6348624", "0.6341618", "0.63376933", "0.63368577", "0.63358736", "0.6334724", "0.6333599", "0.6330836", "0.6324028", "0.6319868", "0.6319644" ]
0.74029773
9
Update Uploads Public Visibility
public function update_public() { if(Module::hasAccess("Uploads", "edit")) { $file_id = Input::get('file_id'); $public = Input::get('public'); if(isset($public)) { $public = true; } else { $public = false; } $upload = Upload::find($file_id); if(isset($upload->id)) { if($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) { // Update Caption $upload->public = $public; $upload->save(); return response()->json([ 'status' => "success" ]); } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access 1" ]); } } else { return response()->json([ 'status' => "failure", 'message' => "Upload not found" ]); } } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access" ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_public()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"edit\")) {\n\t\t\t$file_id = Input::get('file_id');\n\t\t\t$public = Input::get('public');\n\t\t\t\n\t\t\t\n\t\t\t$upload = Upload::find($file_id);\n\t\t\tif(isset($upload->id)) {\n\t\t\t\tif($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t\tif($upload->public == 0) \n\t\t\t\t\t$public = 1;\n\t\t\t\t\telse $public = 0;\n\t\t\t\t\t// Update Caption\n\t\t\t\t\t$upload->public = $public;\n\t\t\t\t\t$upload->save();\n\t\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"success\"\n\t\t\t\t\t]);\n\t\n\t\t\t\t} else {\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t\t'message' => \"Unauthorized Access 1\"\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn response()->json([\n\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t'message' => \"Upload not found\"\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function updatePublic() {\n $this->Industry->updateSystemIndices();\n $this->Markets->updatePublic();\n $this->Usage->sendUsageStats();\n }", "protected function updateVisibility()\n {\n if($this->visibility === null) {\n return;\n }\n\n if ($this->instance->content->visibility != $this->visibility) {\n $this->instance->content->visibility = $this->visibility;\n\n $contentIds = [];\n foreach($this->instance->mediaList as $media) {\n $contentIds[] = $media->content->id;\n }\n\n Content::updateAll(['visibility' => $this->visibility], ['in', 'id', $contentIds]);\n }\n }", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 1 ){\n\t\t\t\t\tupdate_option('blog_public', 0);\n\t\t\t\t}\n\t\t\t}", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 0 ){\n\t\t\t\t\tupdate_option('blog_public', 1);\n\t\t\t\t}\n\t\t\t}", "function damopen_assets_library_post_update_change_public_files_to_private() {\n $connection = Database::getConnection();\n // Select the uri from the database.\n $query = $connection\n ->select('file_managed', 'fm')\n ->fields('fm', ['fid', 'uri']);\n $result = $query->execute();\n\n $fileStorage = Drupal::entityTypeManager()->getStorage('file');\n $fileSystem = Drupal::service('file_system');\n $priv_path = $fileSystem->realpath('private://');\n\n foreach ($result as $row) {\n $uri = str_replace('public://', '', $row->uri);\n $file_name = substr(strrchr($uri, '/'), 1);\n $folder = str_replace($file_name, '', $uri);\n // Check if the directory already exists.\n // Directory does not exist, so lets create it.\n if (\n !is_dir($priv_path . '/' . $folder)\n && !mkdir($concurrentDirectory = $priv_path . '/' . $folder, 0775, TRUE)\n && !is_dir($concurrentDirectory)\n ) {\n throw new RuntimeException(sprintf('Directory \"%s\" was not created', $concurrentDirectory));\n }\n\n // Move the file to the private folder.\n $new_uri = $fileSystem->move('public://' . $uri, 'private://' . $uri, FileSystemInterface::EXISTS_REPLACE);\n\n if ($new_uri !== NULL) {\n // Replace the uri with the new private schema's uri.\n /** @var \\Drupal\\file\\FileInterface $file */\n $file = $fileStorage->load($row->fid);\n $file->setFileUri($new_uri);\n $file->save();\n }\n }\n}", "public function updatePublications() {\n DAOFactory::getPersonDAO()->updatePublications($this);\n }", "public function setpublic() {\n $this->layout = \"\";\n $sessionstaff = $this->Session->read('staff');\n\n\n $Locations = $this->Promotion->find('first', array('conditions' => array('Promotion.id' => $_POST['promotion_id'])));\n\n\n if ($Locations['Promotion']['public'] == 1) {\n $like = 0;\n } else {\n $like = 1;\n }\n\n $this->Promotion->query('UPDATE promotions set public=\"' . $like . '\" where id=' . $Locations['Promotion']['id']);\n\n exit;\n }", "public function changeToPublic(){\n $num=0;\n $id=$this->session->get('id_rev');\n $tmp_review=new Review();\n $review=$tmp_review->find($id);\n\n $tmp_review->save([\n 'id_rev'=>$review->id_rev,\n 'title'=>$review->title,\n 'text'=>$review->text,\n 'privacy'=>$num,\n 'token_count'=>$review->token_count,\n 'id_vis'=>$review->id_vis,\n 'date_posted'=>$review->date_posted\n ]);\n\n\n }", "public function isPublic() {\n return $this->privacyState == 'public';\n }", "public function updatePublishedAt() {\n\t\tif (!$this->private && !$this->published_at) {\n\t\t\t$this->published_at = $this->updated_at;\n\t\t}\n\t}", "public function setPubliclyViewable($value)\n {\n $this->setItemValue('publicly_viewable', (bool)$value);\n }", "function subway_is_public_form() {\n\n\techo '<label for=\"subway_is_public\"><input ' . checked( 1, get_option( 'subway_is_public' ), false ) . ' value=\"1\" name=\"subway_is_public\" id=\"subway_is_public\" type=\"checkbox\" class=\"code\" /> Check to make all of your posts and pages visible to public.</label>';\n\techo '<p class=\"description\">' . esc_html__( 'Pages like user profile, members, and groups are still only available to the rightful owner of the profile.', 'subway' ) . '</p>';\n\n\treturn;\n}", "function wp_update_blog_public_option_on_site_update($site_id, $is_public)\n {\n }", "function publishExhibit(){\n\t\t$this->setVisible('1');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function isPublic()\n {\n\n if ($this->visibility == self::VISIBILITY_PUBLIC) {\n return true;\n }\n\n return false;\n }", "public function setVisibility($isPublic = 0, $isFriend = 0, $isFamily = 0)\r\n {\r\n $this->_visibility = array(\r\n 'is_public' => $isPublic,\r\n 'is_friend' => $isFriend,\r\n 'is_family' => $isFamily,\r\n );\r\n }", "public function setPublic($public)\n {\n $this->_public = $public;\n }", "public function isPublic()\n {\n return $this->_public;\n }", "public function isPublic() {\n\t\treturn $this->public;\n\t}", "public function isPublic() {}", "public function setPublic( $public = true ){\n\t\t$this->public = $public;\n\t}", "public function isPublic()\n {\n return $this->public;\n }", "public function setPublic()\n {\n $this->private = false;\n }", "public function setVisibility() {}", "function getVisibility() {\n if($this->visibility === false) {\n $this->visibility = $this->canSeePrivate() ? VISIBILITY_PRIVATE : VISIBILITY_NORMAL;\n } // if\n return $this->visibility;\n }", "public function setPublic($public) {\n $params = array(\"userid={$this->id}\",\n \"publickey={$this->publickey}\");\n switch ($public) {\n case true:\n $params[] = \"ispublic=1\";\n break;\n case false:\n $params[] = \"ispublic=0\";\n break;\n default:\n throw new validationErrorWbsException(\"Public should be set to true or false\");\n break;\n }\n $this->callWbs('user', 'update', $params);\n return true;\n }", "public function update(Request $request, Publicidad $publicidad)\n {\n $publicidad = Publicidad::find($request['id']);\n\n if($request['publi'] == 1){\n $file = $request->file('fichero1');\n $name = $file->store('noticias-img');\n $publicidad->publi1 = '/storage/' . $name;\n $publicidad->save();\n return redirect('/agregar');\n }\n\n if($request['publi'] == 2){\n $file = $request->file('fichero2');\n $name = $file->store('noticias-img');\n $publicidad->publi2 = '/storage/' . $name;\n $publicidad->save();\n return redirect('/agregar');\n }\n\n if($request['publi'] == 3){\n $file = $request->file('fichero3');\n $name = $file->store('noticias-img');\n $publicidad->publi3 = '/storage/' . $name;\n $publicidad->save();\n return redirect('/agregar');\n }\n\n if($request['publi'] == 4){\n $file = $request->file('fichero4');\n $name = $file->store('noticias-img');\n $publicidad->publi4 = '/storage/' . $name;\n $publicidad->save();\n return redirect('/agregar');\n }\n\n if($request['publi'] == 5){\n $file = $request->file('fichero5');\n $name = $file->store('noticias-img');\n $publicidad->publi5 = '/storage/' . $name;\n $publicidad->save();\n return redirect('/agregar');\n }\n }", "public function get_visibility()\n {\n }", "public function set_public($value) {\r\n $this->public = $value;\r\n data::add(\"public\", $this->public == \"\" ? 1 : $this->public, $this->table_fields);\r\n }", "public function setNotPublic($list_id, $value = TRUE) {\n DB::q('\nINSERT INTO !table\n(list_id, not_public)\nVALUES (%list_id, %not_public)\nON DUPLICATE KEY UPDATE\nnot_public = %not_public\n ', array(\n '!table' => $this->table,\n '%not_public' => $value,\n '%list_id' => $list_id,\n ));\n\n return TRUE;\n }", "public function canModifyVisibilityOfUsers();", "public static function updatePublicTime($userID, $bool)\n {\n UserModel::setPublicTimeSchedule($userID, $bool);\n }", "function publish(){\n $status = $_POST['status'];\n $id = $_POST['id'];\n $field = $_POST['field'];\n $table = $_POST['table'];\n if($status == 0){\n $pub = 1;\n }else{\n $pub = 0;\n }\n $vdata['published'] = $pub;\n $this->db->update($table, $vdata, array($field => $id));\n\n echo icon_active(\"'$table'\",\"'$field'\",$id,$pub);\n }", "public function isLabelPublic()\n {\n return ($this->label == 'public');\n }", "function image_viewing()\n {\n $query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tImage_Path = :path,\n\t\t\t\t\tCaption = :cap,\n\t\t\t\t\tDescription = :des,\n\t\t\t\t\tStatus = :status\n\t\t\t\tWHERE\n\t\t\t\t\tid = :id AND Viewer_ID = :vid\";\n\n $stmt = $this->conn->prepare($query);\n\t\t\n $stmt->bindParam(':path', $this->Image_Path);\n\t\t$stmt->bindParam(':cap', $this->Caption);\n $stmt->bindParam(':des', $this->Description);\n\t\t$stmt->bindParam(':status', $this->status);\n $stmt->bindParam(':id', $this->id);\n\t\t$stmt->bindParam(':vid', $this->Viewer_ID);\n\n // execute the query\n if ($stmt->execute()) {\n return true;\n } else {\n return false;\n }\n }", "function isPublic();", "public function isPublic($name);", "function private_attachment_field() {\n\n\t\t$is_private = $this->is_attachment_private( get_the_id() );\n\n\t\t?>\n\t\t<div class=\"misc-pub-section\">\n\t\t\t<label for=\"mphpf2\"><input type=\"checkbox\" id=\"mphpf2\" name=\"<?php echo $this->prefix; ?>_is_private\" <?php checked( $is_private, true ); ?> style=\"margin-right: 5px;\"/>\n\t\t\tMake this file private</label>\n\t\t</div>\n\t\t<?php\n\t}", "function agenda_set_item_visibility($event_id, $visibility)\n{\n $tbl = get_conf('mainTblPrefix') . 'rel_event_recipient';\n\n $sql = \"UPDATE `\" . $tbl . \"`\n SET visibility = '\" . ($visibility=='HIDE'?\"HIDE\":\"SHOW\") . \"'\n WHERE `event_id` = \" . (int) $event_id;\n return claro_sql_query($sql);\n}", "public function update(){\n\t\tparent::update(\"UPDATE Users set privacy_setting = \" . $this->privacy_setting . \" where id = \" . $this->id);\n\t}", "function jmw_customize_profile_visibility( $allowed_visibilities ) {\n\n\t$allowed_visibilities[ 'moderated' ] = array(\n\t\t'id'\t=> 'moderated',\n\t\t'label'\t=> _x( 'No-one - In Moderation', 'Visibility level setting', 'bp-extended-profile-visibility' )\n\t);\n\n\treturn $allowed_visibilities;\n}", "function update_privacy(){\n \n // query to insert record\n $query = \"UPDATE\n \" . $this->table_name . \"\n SET\n private = :private\n WHERE\n id = :id\";\n \n // prepare query\n $stmt = $this->conn->prepare($query);\n \n // new privacy attribute\n $privacy = 1 - $this->private;\n // bind values\n $stmt->bindParam(\":id\", $this->id);\n $stmt->bindParam(\":private\", $privacy);\n \n // execute query\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }", "public function publish(Request $request) {\n $slide_item = SlideShowItem::findOrFail($request['id']);\n if ($slide_item) {\n if ($request['status'] == 1) {\n $slide_item->online = 0;\n $status = 0;\n } else {\n $slide_item->online = 1;\n $status = 1;\n }\n $slide_item->save();\n return response()->json(['message' => \"Slide image item's status changed successfully!\", 'status' => $status]);\n } else {\n return response()->json(['message' => \"Something went wrong!\"]);\n }\n\n }", "public function isPublic()\n\t{\n\t\tif ($this->isNew())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isPrivate())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function havp_update_AV() {\n\tfile_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());\n\thavp_set_file_access(HVDEF_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\t// Run update in background\n\tmwexec_bg(HVDEF_AVUPD_SCRIPT);\n}", "private function publishToggle(Request $request){\n\t\t$class ='\\App\\\\'.$request->class;\n\t\t$data = $class::find($request->id);\n\t\t$data->published = !$data->published;\n\t\t$data->save();\n\t}", "public function is_public_allowed( $entry ) {\n\t\treturn false;\n\t}", "private function set_files_by_published()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*.*.*.*.NULL.*.*.*.*.*.*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}", "public function isPublic()\n {\n if ($this->getAccessType() === self::ACCESS_PUBLIC) {\n return true;\n }\n\n return false;\n }", "public function setVisibility($path, $visibility)\n {\n }", "public function setVisibility($path, $visibility)\n {\n }", "public function isAccessible()\n {\n return $this->isPublished();\n }", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "function check_permission_public_status($public_status) {\n if($this->base->operator()->is_administrator() == FALSE && ($public_status == 'before_published' || $public_status == 'expired' || $public_status == 'all')) {\n $this->set_message('check_permission_public_status', '編集者のみが発行前と失効後のニュースを閲覧できます。');\n return FALSE;\n }\n\n return TRUE;\n }", "public function is_public(): bool;", "private function mediaUpdate() {\n\t\t$this->s3->request = array(\n\t\t\t'access_key' => \\Crypt::encrypt($this->access_key),\n\t\t\t'secret' => \\Crypt::encrypt($this->secret),\n\t\t\t'region' => \\Aws\\Common\\Enum\\Region::US_EAST_1,\n\t\t\t'bucket' => $this->bucket,\n\t\t\t'prefix' => $this->prefix,\n\t\t);\n\t\t$this->s3->testConnection();\n\t\tif ($this->s3->response['connected'] === true) {\n\t\t\t//Show how many records we imported.\n\t\t\t$this->s3->listObjects();\n\t\t\t//Tell us how many media items we found.\n\t\t\t$this->info(sprintf('Found %d media items in this bucket', $this->s3->count));\n\t\t\t//Update images.\n\t\t\t$this->update();\n\t\t}\n\t}", "public function hasPublicUrl() {\n return $this->_has(4);\n }", "public function isPublic()\n {\n if (! isset($this->isPublic)) {\n $this->isPublic =(($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getIsPublicQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->isPublic;\n }", "public function publishadmin(){\n $post = Products::where('id', \\request(\"id\"))->first();\n $post->published = $post->published==\"unpublished\"?\"Publish\":\"unpublished\";\n $post->save();\n return redirect(route('voyager.h-products.index'));\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function getVisibility()\n {\n return $this->visibility;\n }", "public function setupVisibility();", "function jmw_permit_admin_to_edit_field_visibility( $retval, $capability, $blog_id, $args ) {\n\n \tif( 'bp_xprofile_change_field_visibility' != $capability ) {\n \t\treturn $retval;\n \t}\n\n \tif( current_user_can( 'manage_options' ) ) {\n \t\t$retval = true;\n \t}\n \telse {\n \t\t$retval = false;\n \t}\n\n \treturn $retval;\n }", "public function getVisibilityType() {\n\t\treturn BackendService::VISIBILITY_PERSONAL;\n\t}", "function updateStateAndVisibility() {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n $activity_logs_table = TABLE_PREFIX . 'activity_logs';\n\n try {\n DB::execute(\"ALTER TABLE $project_objects_table CHANGE state state tinyint(3) unsigned not null default '0'\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD original_state tinyint(3) unsigned null default null after state\");\n //DB::execute(\"ALTER TABLE $project_objects_table CHANGE visibility visibility tinyint(3) UNSIGNED NOT NULL DEFAULT '0'\");\n DB::execute(\"ALTER TABLE $project_objects_table CHANGE visibility visibility tinyint(3) NOT NULL DEFAULT '0'\"); // Keep the field as UNSIGNED, so confidentiality module can continue to work\n DB::execute(\"ALTER TABLE $project_objects_table ADD original_visibility tinyint UNSIGNED NULL DEFAULT NULL AFTER visibility\");\n\n DB::execute(\"UPDATE $project_objects_table SET original_state = ? WHERE state = ?\", 3, 1); // Set original state to visible for trashed objects\n //DB::execute(\"UPDATE $project_objects_table SET visibility = ? WHERE visibility IS NOT NULL AND visibility < ?\", 0, 0); // Reset all invalid visibility values\n\n DB::execute(\"UPDATE $activity_logs_table SET type = ? WHERE type = ?\", 'MovedToTrashActivityLog', 'ObjectTrashedActivityLog');\n DB::execute(\"UPDATE $activity_logs_table SET type = ? WHERE type = ?\", 'RestoredFromTrashActivityLog', 'ObjectRestoredActivityLog');\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function findAllPublic(){\n $qb = $this->getMainPublicQb();\n return $qb->getQuery()->getResult();\n }", "private function isPublic($id)\n {\n $article = Article::find($id);\n if($article->public === 0):\n return true;\n else:\n return false;\n endif;\n }", "public function togglePublished()\n {\n if ($this->isActive()) {\n $this->is_published = false;\n } else {\n $this->is_published = true;\n }\n\n return $this->save();\n }", "public function getVisibility()\n {\n if ($this->isPrivate()) {\n return 'private';\n }\n \n if ($this->isProtected()) {\n return 'protected';\n }\n \n return 'public';\n }", "public function setVisibility($path, $visibility)\n\t{\n\t\tif ($visibility != 'public' && $visibility != 'private')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$resource = $this->client->getResource($this->applyPathPrefix($path), 0);\n\n\t\tif (($visibility == 'public' && $resource->isPublish()) || ($visibility == 'private' && ! $resource->isPublish()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $resource->setPublish($visibility == 'public') instanceof Client\\Resource\\Opened;\n\t}", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function usePublicApi()\n {\n $this->level = 'pub';\n\n return $this;\n }", "public function is_ajax_public(): bool {\n\t\treturn $this->ajax_public;\n\t}", "public function setGalleryStatus() {\n $post = Input::all();\n $userData = AppSession::getLoginData();\n if (!$userData) {\n return Response()->json(array('success' => false, 'message' => 'Please, login to change gallery status.'));\n }\n $gallery = GalleryModel::where('id', $post['id'])\n ->where('ownerId', $userData->id)\n ->first();\n if ($gallery) {\n //check gallery items\n if ($post['status'] == GalleryModel::PRIVATESTATUS) {\n if ($gallery->type == GalleryModel::IMAGE) {\n $items = AttachmentModel::where('parent_id', $gallery->id)->count();\n } else {\n $items = VideoModel::where('galleryId', $gallery->id)->count();\n }\n if ($items == 0) {\n return Response()->json(['success' => false, 'message' => 'Gallery must has at least 1 item before publish']);\n }\n if ($gallery->type == GalleryModel::VIDEO) {\n $check = VideoModel::where('galleryId', $gallery->id)\n ->where('status', VideoModel::PROCESSING)\n ->count();\n if ($check > 0) {\n return Response()->json(['success' => false, 'message' => 'Videos are processing.']);\n }\n }\n }\n $gallery->status = ($post['status'] == GalleryModel::PUBLICSTATUS) ? GalleryModel::PRIVATESTATUS : GalleryModel::PUBLICSTATUS;\n $gallery->save();\n return Response()->json(array('success' => true, 'message' => 'update status successfully.', 'gallery' => $gallery));\n }\n return Response()->json(array('success' => false, 'message' => 'update fail.'));\n }", "private function dc_define_public_hooks() {\n\n\t\t$plugin_public = new Dorancafe_Public( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'dc_enqueue_styles' );\n\t\t$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'dc_enqueue_scripts' );\n\n\t}", "public function setPublic($value)\n {\n return $this->set('Public', $value);\n }", "public function setPublic($value)\n {\n return $this->set('Public', $value);\n }", "public function actionUnpublishNoImg()\n {\n $imgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR . 'web';\n\n $civ = CatalogItemVariant::find()\n ->where(['published' => 1])\n ->asArray()\n ->all();\n\n $unPublish = $foundImg = $notFound = [];\n $foundImg['ru'] = $foundImg['uk'] = $foundImg['en'] = 0;\n $notFound['ru'] = $notFound['uk'] = $notFound['en'] = 0;\n $unPublish['ru'] = $unPublish['uk'] = $unPublish['en'] = 0;\n foreach ($civ as $iv) {\n echo 'Checking id #' . $iv['id'] . '; lang: ' . $iv['lang'] . '; img: ' . $iv['img_url'] . PHP_EOL;\n $imgPathFull = $imgDir . $iv['img_url'];\n if (file_exists($imgPathFull)) {\n $foundImg[$iv['lang']] += 1;\n } else {\n $notFound[$iv['lang']] += 1;\n //\n $oCiv = CatalogItemVariant::find()\n ->where([\n 'id' => intval($iv['id']), \n 'published' => 1,\n ])\n ->one();\n if (!empty($oCiv)) {\n $oCiv->published = 0;\n if ($oCiv->save()) {\n $unPublish[$iv['lang']] += 1;\n echo 'Saved ' . print_r($oCiv, 1) . PHP_EOL;\n } else {\n echo 'Error saving ' . print_r($oCiv, 1) . PHP_EOL;\n }\n } else {\n echo 'Can`t find item by id ' . var_export(intval($iv['id']), 1) . PHP_EOL;\n continue;\n }\n }\n }\n echo 'Found images: ' . var_export($foundImg, 1) . '. Not found images: ' . var_export($notFound, 1) . '. Unpublished: ' . var_export($unPublish, 1) . PHP_EOL;\n }", "public function setShareWithPublic($value)\n {\n return $this->set('ShareWithPublic', $value);\n }", "private function updateUnPublishOnDate()\n {\n $this->owner->UnPublishOnDate = $this->owner->DesiredUnPublishDate;\n // Remove the DesiredUnPublishDate.\n $this->owner->DesiredUnPublishDate = null;\n }", "function miracle_update_visibility_fields($instance, $new_instance)\n {\n if ('advanced_text' == get_class($widget))\n return;\n\n $instance['action'] = $new_instance['action'];\n $instance['show'] = $new_instance['show'];\n $instance['slug'] = $new_instance['slug'];\n $instance['suppress_title'] = $new_instance['suppress_title'];\n\n return $instance;\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublic()\n\t{\n\t\treturn $this->property->isPublic();\n\t}", "public function iN_UpdateShowHidePostsStatus($userID, $status) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$status = mysqli_real_escape_string($this->db, $status);\n\t\tif ($this->iN_CheckUserExist($userID) == 1) {\n\t\t\tmysqli_query($this->db, \"UPDATE i_users SET show_hide_posts = '$status' WHERE iuid = '$userID'\") or die(mysqli_error($this->db));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isPublic() : bool {\n return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0\n || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;\n }" ]
[ "0.7433434", "0.697364", "0.6724741", "0.6699069", "0.6688663", "0.6155418", "0.6049058", "0.6047401", "0.60376936", "0.5982526", "0.57420754", "0.5724763", "0.57083505", "0.56794137", "0.56685036", "0.56627905", "0.56376064", "0.5635653", "0.56148225", "0.56059617", "0.5595509", "0.55890936", "0.5582023", "0.556295", "0.55586284", "0.5543791", "0.5514967", "0.5512556", "0.5506944", "0.54965883", "0.5483162", "0.54798996", "0.54607815", "0.5415707", "0.5379067", "0.53655636", "0.5359893", "0.5358188", "0.53204244", "0.5309978", "0.52991", "0.52745885", "0.5271131", "0.52641636", "0.5257107", "0.5256708", "0.5228756", "0.52165157", "0.51981103", "0.5171543", "0.515847", "0.515847", "0.5150641", "0.51443374", "0.5123837", "0.51197225", "0.51096636", "0.51048666", "0.5101611", "0.5097707", "0.5096173", "0.50883776", "0.50883776", "0.50883776", "0.50781405", "0.5076875", "0.50709856", "0.50497466", "0.50494856", "0.50437015", "0.50327384", "0.5029589", "0.5027439", "0.5021736", "0.5019067", "0.5018507", "0.5009079", "0.5005781", "0.49956056", "0.49956056", "0.49943045", "0.49926355", "0.49883184", "0.49858364", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49817148", "0.49805468", "0.4976051", "0.4975384" ]
0.7411745
1
Remove the specified upload from storage.
public function delete_file() { if(Module::hasAccess("Uploads", "delete")) { $file_id = Input::get('file_id'); $upload = Upload::find($file_id); if(isset($upload->id)) { if($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) { // Update Caption $upload->delete(); return response()->json([ 'status' => "success" ]); } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access 1" ]); } } else { return response()->json([ 'status' => "failure", 'message' => "Upload not found" ]); } } else { return response()->json([ 'status' => "failure", 'message' => "Unauthorized Access" ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeUpload()\n {\n $this->picture = null;\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function destroy(Upload $upload)\n {\n //\n }", "public function destroy(Upload $upload)\n {\n //\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function destroy(upload $upload)\n {\n $upload->delete();\n return redirect()->back()->with('message', 'You have deleted File successfully');\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function destroy(Fileupload $fileupload)\n {\n //\n }", "public function delete(User $user, Upload $upload)\n {\n //\n }", "public function clearStorage(): void\n {\n// foreach ($this->remoteFilesystems as $filesystem) {\n// $contents = $filesystem->listContents('/', true);\n// foreach ($contents as $contentItem) {\n// if ('file' !== $contentItem['type']) {\n// continue;\n// }\n// $filesystem->delete($contentItem['path']);\n// }\n// }\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function destroy(Upload $upload)\n {\n return abort(404);\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function remove_uploaded($id){\n\t\t$ci = $this->_CI;\n\t\t$ci->load->model('M_Media', 'Media');\n\n\t\t$media = $ci->Media->get($id);\n\t\tif($media){\n\t\t\tif(file_exists($media->path))\n\t\t\t\tunlink($media->path);\n\n\t\t\treturn $ci->Media->delete(array('id' => $id));\n\t\t}\n\t\treturn false;\n\t}", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $tax = $this->taxRepository->findWithoutFail($input['id']);\n try {\n if ($tax->hasMedia($input['collection'])) {\n $tax->getFirstMedia($input['collection'])->delete();\n }\n } catch (Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function delete()\n\t{\n\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_fields', array( 'field_type=?', 'Upload' ) ) AS $field )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_values', array( \"value_value<>? OR value_value IS NOT NULL\", '' ) ) as $cfield )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\File::get( 'core_FileField', $cfield[ 'value_value' ] )->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\Exception $e ){}\n\t\t}\n\t}", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($path)\n { $path = $this->_bucket . '/' . $path;\n $this->_internalService->removeObject($path);\n }", "public function destroy($id)\n\t{\n\t\tUpload::destroy($id);\n\t\treturn redirect()->route(config('quickadmin.route').'.upload.index');\n\t}", "function destroy(){\n\t\tif($this->request->post() && ($d = $this->form->validate($this->params))){\n\t\t\t$file = TemporaryFileUpload::GetInstanceByToken($d[\"token\"]);\n\t\t\tif($file){\n\t\t\t\t$file->destroy();\n\t\t\t}\n\t\t\t$this->api_data = [];\n\t\t}\n\t}", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function destroy($id)\n {\n \n $sliders = DB::table('sliders')->where('id',$id)->get();\n foreach ($sliders as $slider) {\n Storage::delete('public/upload/'.$slider->name);\n }\n Slider::where('id',$id)->delete();\n return redirect()->back();\n\n \n //dd(Storage::delete('public/upload/'.$img));\n //return redirect()->back();\n \n }", "public function destroy(File $file)\n {\n $url=str_replace('storage','public',$file->url);\n Storage::delete($url);\n\n $file->delete();\n return redirect()->route('admin.files.index');\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function getRemove()\n {\n $filename_saved_as = Session::get('filename_saved_as');\n $upload = Upload::where('filename_saved_as', '=', $filename_saved_as)->first();\n if ($upload->user_id == Auth::id()) {\n $path = public_path('uploads');\n $filename = $upload->filename_saved_as;\n File::delete($path.'/'.$filename);\n if (!File::exists($path.'/'.$filename)) {\n $upload->delete();\n return Response::json(array('success' => 200));\n } else {\n return Response::json(array('error' => 400));\n }\n } else {\n return Redirect::to('posts/index')\n ->with('message', 'You cannot delete files that do not belong to you.');\n }\n }", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public function __destruct(){\n\t\tif( !empty( $this->upload ) )\t\t\t\t\t\t\t\t\t\t// upload is set\n\t\t\tif( !empty( $this->upload->tmp_name ) )\t\t\t\t\t\t\t// file has been uploaded\n\t\t\t\tif( file_exists( $this->upload->tmp_name ) )\t\t\t\t// uploaded file is still existing\n\t\t\t\t\t@unlink( $this->upload->tmp_name );\t\t\t\t\t\t// remove originally uploaded file\n\t}", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove($path);", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy(Request $request)\n {\n $record = PhotoArticle::find($request->key);\n if($record->delete()){\n $this->storage->delete($record->path . 'original-' . $record->image);\n $this->storage->delete($record->path . '250x200-' . $record->image);\n $this->storage->delete($record->path . '1200x600-' . $record->image);\n return response()->json(['success'=>'Removido']);\n }else {\n return response()->json(['error'=>'Houve um problema para excluir a imagem! por favor, tente novamente!']);\n }\n }", "public static function deleteFile($file){\n\t\t\t//@-> PARA N MOSTRAR ALGUM TIPO DE AVISO\n\t\t\t@unlink('uploads/'.$file);\n\t\t}", "private function removeEntrada($filePath){\n \\Storage::delete($filePath);\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function destroy(ImageUploads $imageUploads)\n {\n //\n }", "public function destroy(File $file)\n {\n\n\n $fileName = $file->file_name;\n $file->delete();\n Storage::disk('public')->delete([$fileName, '/thumb/'.$fileName]);\n\n return redirect( route('files.index') );\n }", "public static function deleteFile($file)\n {\n @unlink('uploads/'.$file);\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $currency = $this->currencyRepository->findWithoutFail($input['id']);\n try {\n if ($currency->hasMedia($input['collection'])) {\n $currency->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}", "function DeleteUploadFile(){\n\n}", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $encargo = $this->EncargoRepository->findWithoutFail($input['id']);\n try {\n if ($encargo->hasMedia($input['collection'])) {\n $encargo->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $marketReview = $this->marketReviewRepository->findWithoutFail($input['id']);\n try {\n if($marketReview->hasMedia($input['collection'])){\n $marketReview->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }", "public function destroy(UploadTimelineInformation $uploadTimelineInformation)\n {\n //\n }", "public function removeFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition);", "function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function postRemove(MediaInterface $media);", "public function deleted(File $file)\n {\n media()->delete($file->filename);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function destroy($id)\n {\n $photo = Photo::findOrFail($id);\n $photo->delete();\n unlink(public_path('/uploads/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/1280x1024/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/316x255/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/118x95/'.$photo->file)); // remove photo from public folder\n return redirect()->back()->with('success', 'Photo deleted.');\n }", "public function removeFile(Request $request) {\n\n\t\tif ( request()->has('file') ) {\n\n\t\t\t$uploadDir = 'albums/' . auth()->user()->id . '/' . request('album_month') . '/';\n $file = storage_path('app/public/') . $uploadDir . str_replace(array('/', '\\\\'), '', request('file'));\n echo $file;\n\n\t\t\tif(file_exists($file))\n\t\t\t\tunlink($file);\n\t\t}\n\t\texit;\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $marketsPayout = $this->marketsPayoutRepository->findWithoutFail($input['id']);\n try {\n if ($marketsPayout->hasMedia($input['collection'])) {\n $marketsPayout->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function destroy($id)\n {\n $one = Gallery::findOrFail($id);\n $filePath = public_path().'/assets/'.$one->gallery;\n File::delete( $filePath);\n $one->delete();\n }", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp.DS.'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp.DS.'file1.txt');\n $this->assertTrue(! is_file(self::$temp.DS.'file1.txt'));\n }", "public function destroy()\n {\n // DB::table('video_uploaded')->delete();\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $shop = $this->shopRepository->findWithoutFail($input['id']);\n try {\n if ($shop->hasMedia($input['collection'])) {\n $shop->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public static function delete($filePath)\n {\n if (!is_null($filePath) && Storage::exists($filePath)) {\n Storage::delete($filePath);\n }\n }", "public function destroy(Request $request)\n {\n //\n $filename = $request->id;\n $uploaded_image = Image::where('original_name', basename($filename))->first();\n\n if (empty($uploaded_image)) {\n return Response()->json(['message' => 'Fichier Inexistant'], 400);\n }\n\n $file_path = $this->photos_path . '/' . $uploaded_image->filename;\n $resized_file = $this->photos_path . '/' . $uploaded_image->resized_name;\n\n if (file_exists($file_path)) {\n unlink($file_path);\n }\n\n if (file_exists($resized_file)) {\n unlink($resized_file);\n }\n\n if (!empty($uploaded_image)) {\n $uploaded_image->delete();\n }\n\n return Response()->json(['message' => 'Fichier Supprimé'], 200);\n\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroy($id)\n {\n $subject = $this->loadSubjectWithTrash($id);\n if($subject->img!=null){\n $img = $subject->img;\n $path = public_path('upload/' . $img);\n if(file_exists($path)){\n unlink(public_path('upload/' . $img));\n }\n }\n $this->checkDataInTransaction($subject,__FUNCTION__);\n }", "public function destroy($id)\n {\n $gallery = Video::find($id);\nunlink(public_path().\"/uploads/video/\".$gallery->file);\n\n\n\n $gallery->delete();\n return redirect()->route('video.index');\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function destroy(Request $request)\n {\n $file = $request->filename;\n Storage::delete($file);\n return response()->json(['success'], 200);\n }", "function remove_uploaded_asset(string $name) {\n\t\t$this->readychk();\n\t\tfor ($i = 0; $i < count($this->assets); $i++) {\n\t\t\tif ($this->assets[$i]->get_filename() === $name) {\n\t\t\t\t$this->assets[$i]->remove();\n\t\t\t\tunset($this->assets[$i]);\n\t\t\t\t$this->assets = array_values($this->assets);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new ArgException(\"Asset '$name' doesn't exist.\");\n\t}", "public function destroy(Request $request, UserFile $file)\n {\n $this->authorize('destroy', $file);\n $file->delete();\n\n return redirect('/files');\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }", "public function removeMedia(Request $request)\n {\n if (env('APP_DEMO', false)) {\n Flash::warning('This is only demo app you can\\'t change this section ');\n } else {\n if (auth()->user()->can('medias.delete')) {\n $input = $request->all();\n $user = $this->userRepository->findWithoutFail($input['id']);\n try {\n if ($user->hasMedia($input['collection'])) {\n $user->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }\n }\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $earning = $this->earningRepository->findWithoutFail($input['id']);\n try {\n if($earning->hasMedia($input['collection'])){\n $earning->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "public function removeMedia(Request $request)\n {\n $input = $request->all();\n $food = $this->foodRepository->findWithoutFail($input['id']);\n try {\n if ($food->hasMedia($input['collection'])) {\n $food->getFirstMedia($input['collection'])->delete();\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n }\n }", "protected function removeOldFile(): void\n {\n // delete the old file\n $oldFile = $this->getUploadRootDir() . '/' . $this->oldFileName;\n if (is_file($oldFile) && file_exists($oldFile)) {\n unlink($oldFile);\n }\n\n $this->oldFileName = null;\n }", "function remove() {\n\n\t\t$this->readychk();\n\n\t\t// Remove slide from its queue.\n\t\t$queue = $this->get_queue();\n\t\t$queue->remove_slide($this);\n\t\t$queue->write();\n\n\t\t// Remove slide data files.\n\t\tif (!empty($this->dir_path)) {\n\t\t\trmdir_recursive($this->dir_path);\n\t\t}\n\t}", "public function deleting(Instance $instance)\n {\n\n $instance->claims->each(function ($item) {\n $item->delete();\n });\n\n\n $storage = new MediaStorage;\n $storage->deleteDir('images/'.$instance->id);\n\n }", "protected function deleteOldImage(){\n if(auth()->user()->profileImage){\n Storage::delete('/public/images/'.auth()->user()->profileImage);\n }\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }" ]
[ "0.7655448", "0.76433665", "0.72342145", "0.72342145", "0.71981055", "0.67445457", "0.6612791", "0.65565807", "0.6443043", "0.64342856", "0.63688403", "0.6329244", "0.63290316", "0.63257235", "0.63138396", "0.623985", "0.6239807", "0.6173919", "0.6167067", "0.61502504", "0.6133758", "0.6029574", "0.6024876", "0.60154766", "0.59972054", "0.599584", "0.59939694", "0.59787256", "0.59777623", "0.5976893", "0.596968", "0.59568715", "0.59462005", "0.5934388", "0.592841", "0.5928266", "0.5927452", "0.59241265", "0.59206516", "0.5917178", "0.5901727", "0.5898533", "0.588643", "0.58769006", "0.5873545", "0.58728904", "0.58635926", "0.5862775", "0.5850892", "0.58381844", "0.5834516", "0.5832461", "0.5806088", "0.5805639", "0.58033705", "0.57942706", "0.57919157", "0.57838106", "0.57837474", "0.5783306", "0.5765598", "0.5760335", "0.5757694", "0.5744856", "0.57352996", "0.57271695", "0.5726657", "0.5721614", "0.57203454", "0.57144505", "0.5709493", "0.57037836", "0.57018113", "0.5701417", "0.5700807", "0.5699293", "0.5692779", "0.5687421", "0.5687421", "0.5687421", "0.56863195", "0.5675677", "0.56752414", "0.5674643", "0.5662013", "0.56582063", "0.56576926", "0.5657287", "0.5650518", "0.56488776", "0.5646653", "0.564658", "0.5646237", "0.5641319", "0.5631703", "0.56286436", "0.5625875", "0.56202644", "0.5617835" ]
0.57325214
66
function dentro de function
function foo() { function bar() { echo 'Hola ya existo'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete() ;", "function delete() ;", "function eliminar($bd);", "public function Deletar(){\n \n // Istancia a classe \"Funcionario\" do arquivo \"funcionario_class\".\n $funcionario = new Funcionario();\n \n // Pega o id do funcionário para deletá-lo.\n $funcionario->idFuncionario = $_GET['id'];\n \n // Chama o metodo para executar o delete.\n $funcionario::Delete($funcionario);\n \n }", "public function liberar() {}", "function destroy() ;", "public function del()\n {\n }", "protected function __del__() { }", "function drop() {}", "function drop() {}", "public static function delete() {\r\n\t\t\r\n\t}", "function __destruct(){\n\t\tself::$compteur--;\n\t}", "public static function delete() {\n\n\n\t\t}", "function deactivation_hook() {\n\n\t}", "public function destruct()\n {\n }", "public static function delete(){\r\n }", "public function delog()\n\t{\n\n\t}", "function delete() \n {\n \n }", "function __destruct(){}", "function __destruct() {\n echo 3434;\n }", "public function __destruct(){}", "public function __destruct(){}", "public function __destruct(){}", "function __destruct(){\n\n\t}", "public function dec(): void {}", "function detach();", "function eliminarUoFuncionario(){\r\n\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\t\r\n\t\t$this->res=$this->objFunSeguridad->eliminarUoFuncionario($this->objParam);\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\r\n\t}", "function __destruct(){\n\n }", "function delete() {\n\n }", "function __destruct()\n\t{\n\t\t\n\t\t\n\t}", "function destroy();", "function destroy();", "function deactivate() {\n\t}", "function __destruct() {\r\n\t}", "function __destruct() {\r\n\t}", "function _deactivate() {}", "function delete()\r\n {\r\n\r\n }", "function __destruct(){\n\t}", "function delete() {\n }", "public function __destruct() {\n\t\tvar_dump(\"DESTRUIR\");\n\t}", "function __destruct()\n {\n \n }", "public function Desativar(){\n \n $idFrota = $_GET['id'];\n \n $frota = new Frota();\n \n $frota->id = $idFrota ;\n \n $frota::Desativando($frota);\n \n }", "public static function es_deactivation() {\n\t}", "function __destruct() {\r\n\t\t//\r\n\t}", "abstract public function deactivate();", "public static function deactivate ()\n\t{\n\t}", "function __destruct()\r\t{\r\t}", "protected abstract function do_down();", "function delete()\n {\n }", "public function deactivate();", "function __destruct()\r\n{\r\n\r\n}", "function delete()\n {\n }", "public function __destruct(){\n }", "public function __destruct(){\n }", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "public function eliminar($objeto){\r\n\t}", "public function drop(): void;", "protected function _delete()\n\t{\n\t}", "public function __destruct(){unset($this);}", "public function __destruct() {\n\n\t}", "public function __destruct() {\n\t\t\n\t}", "public function __destruct()\n {\n // Vacio por el momento.\n }", "public function annimalDelAction()\n {\n }", "public function __destruct() {\t\n\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct(){\n }", "public static function DelOffer(){\n\n\n\n\t\t}", "Function __destruct(){\n\t\t$this->unload();\n\t}", "public function __destruct() {\r\n\t}", "function ft_hook_destroy() {}", "public function __destruct(){\n\t}", "public function __destruct(){\n\t}", "public function __destruct(){\n\t}", "public static function deactivate()\n\t{\n\n\t}", "public function __destruct()\n {\n unset($this->idDetalleOrden);\n unset($this->valorInventario);\n unset($this->valorVenta);\n unset($this->cantidad);\n unset($this->idOrden);\n unset($this->idProducto);\n unset($this->estado);\n unset($this->fechaCreacion);\n unset($this->fechaModificacion);\n unset($this->idUsuarioCreacion);\n unset($this->idUsuarioModificacion);\n unset($this->conn);\n }", "function __destruct()\t\n\t{\n\t}", "public function __destruct() {\n\n\t\t}", "function __destruct() {}", "function __destruct() {}", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct() {\t\n }", "function __destruct(){\n echo \"strawberry\"; \n \n }", "public function __destruct()\r\n\t\t{\t\t\t\r\n\t\t}", "function __destruct() \n\t{\n\t\t;\n }", "public function __destruct() \r\n {\r\n //..\r\n }", "public function __destruct() \r\n {\r\n //..\r\n }", "function __destruct(){\n\t\t\t$this->bd== null;\n\t\t}", "function __destruct() {\n\n }", "public function delete(): void;", "public function revert(){\n\t}", "private function function_die(){\n\t\tunset($this->attributes);\n\t}", "public function __destruct()\n\t{\n\t}", "function deletedrvs($val1,$val2)\t// elimina la identificacion\n\t{\n $obj_Gurpo=new Conexion();\n $query=\"delete from derivacion where id_exp=$val1 and id_drv=$val2\";\n\t\t\t$obj_Gurpo->consulta($query); // ejecuta la consulta para borrar la identificacion\n\t\t\treturn '<div id=\"mensaje\"><p/><h4>Se elimino la derivación con exito</h4></div>'; // retorna todos los registros afectados\n\n }" ]
[ "0.6814692", "0.6814692", "0.65540314", "0.6523486", "0.6497647", "0.64578086", "0.6348373", "0.6335426", "0.6308106", "0.6308106", "0.6297902", "0.6266026", "0.6237742", "0.62325025", "0.62118465", "0.62025845", "0.61728764", "0.6170539", "0.61661446", "0.6158824", "0.6150085", "0.6150085", "0.6150085", "0.6126026", "0.6109243", "0.6097915", "0.6096185", "0.60900664", "0.60867834", "0.60791963", "0.6072436", "0.6072436", "0.6070593", "0.60664684", "0.60664684", "0.6062369", "0.60512024", "0.60400784", "0.60324585", "0.601726", "0.60127395", "0.5996468", "0.5978714", "0.5975006", "0.5971607", "0.59705687", "0.59398985", "0.59395456", "0.5936535", "0.593173", "0.59250665", "0.5914347", "0.59077513", "0.59077513", "0.5903619", "0.5903619", "0.5898342", "0.5895738", "0.589368", "0.58890206", "0.58823276", "0.58823013", "0.588184", "0.5879813", "0.58782446", "0.5877732", "0.5877732", "0.5877732", "0.5872577", "0.58724076", "0.587119", "0.58592975", "0.5852909", "0.5852684", "0.5852684", "0.5852684", "0.58498937", "0.58483565", "0.5848123", "0.5847324", "0.58411276", "0.58411276", "0.5839084", "0.5839084", "0.5839084", "0.5839084", "0.5839084", "0.5839084", "0.5839084", "0.58380175", "0.58349", "0.582668", "0.58265454", "0.58265454", "0.5822112", "0.58139616", "0.5810987", "0.58106136", "0.5810043", "0.58099276", "0.5801901" ]
0.0
-1
abstract protected function depositar($valor);
public function setSaldo($saldo){ $this->saldo = $saldo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deposit($amount, $purse, $description);", "public function saldo_tarjeta();", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function salvarDepreciacao() {\n\n $oDaoBensDepreciacao = new cl_bensdepreciacao();\n $oDaoBensDepreciacao->t44_benstipoaquisicao = $this->getTipoAquisicao()->getCodigo();\n $oDaoBensDepreciacao->t44_benstipodepreciacao = $this->getTipoDepreciacao()->getCodigo();\n $oDaoBensDepreciacao->t44_valoratual = \"{$this->getValorDepreciavel()}\";\n $oDaoBensDepreciacao->t44_valorresidual = \"{$this->getValorResidual()}\";\n $oDaoBensDepreciacao->t44_vidautil = \"{$this->getVidaUtil()}\";\n\n if (!empty($this->iCodigoBemDepreciacao)) {\n\n $oDaoBensDepreciacao->t44_sequencial = $this->iCodigoBemDepreciacao;\n $oDaoBensDepreciacao->alterar($this->iCodigoBemDepreciacao);\n\n } else {\n\n $oDaoBensDepreciacao->t44_ultimaavaliacao = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n $oDaoBensDepreciacao->t44_bens = $this->iCodigoBem;\n $oDaoBensDepreciacao->incluir(null);\n $this->iCodigoBemDepreciacao = $oDaoBensDepreciacao->t44_sequencial;\n }\n\n if ($oDaoBensDepreciacao->erro_status == \"0\") {\n $sMsg = _M('patrimonial.patrimonio.Bem.erro_salvar_calculo', (object)array(\"erro_msg\" => $oDaoBensDepreciacao->erro_msg));\n throw new Exception($sMsg);\n }\n return true;\n }", "public function reducirSaldo($valor, $linea, $bandera);", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function deposit()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //initiate the wallets; going to find a better way to do it\n $deposit = PaymentModel::depositcoin();\n\n //$btcdeposit = $this->model->btcwallet($user->username,'');\n\n $this->View->Render('dashboard/deposit', ['deposit' => $deposit, 'user' => $user]);\n }", "abstract function ActualizarDatos();", "function debit($total, $creditCard)\n {\n }", "public function darCostos(){\n\t\t/*variables: int $valor, float $costo*/\n\t\t$valor = parent::darCostos();\n\t\t$costo = $valor + ($valor * $this->getPorcentajeIncremento()); //45% incremento \n\t\treturn $costo;\n\t}", "public function deposit($amount)\n {\n $this->increase($amount);\n \n return;\n }", "public function obtenerSaldo();", "static public function mdlProdEliminar($tabla, $numsalida, $valor1, $valor2){\n\t//OBTIENE EL NOMBRE DEL MES ACTUAL \t\t\n\t$nombremes_actual = strtolower(date('F'));\n\t// NOMBRE DEL KARDEX DEL ALMACEN\n\t$tablakardex=\"kardex\";\n\n\t$stmt=Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE num_salida=:num_salida AND id_producto=:id_producto\");\n\n\t$stmt->bindParam(\":num_salida\", $numsalida, PDO::PARAM_STR);\n\t$stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n\t\n\tif($stmt -> execute()){\n\t\t//GUARDA EN KARDEX DEL ALMACEN ELEGIDO\n\t\t$query = Conexion::conectar()->prepare(\"UPDATE $tablakardex SET $nombremes_actual=:$nombremes_actual+$nombremes_actual WHERE id_producto = :id_producto\");\n\t\t$query->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n\t\t$query->bindParam(\":\".$nombremes_actual, $valor2, PDO::PARAM_STR);\n\t\t$query->execute();\n\n\t\treturn true;\n\t}else{\n\t\treturn \"error\";\t\n\t}\t\t\n\t\n\n\t$stmt = null;\n\n}", "function valorDoBtcComEncargosSaque($param_valor)\n{\n\n//pega o btc e soma valor final do btc com todos encargos\n\n\t$percentual = 0.70 / 100.0; // 15%\n\t$valor_final = $param_valor - ($percentual * $param_valor);\n\t//comissoes 1,99 + 2,90\n\t$percentual2 = 2.0 / 100.0;\n\t$valorTotal = $percentual2 * $param_valor;\n\t\n\t\n\t\n\t$finalTodos = $valor_final - $valorTotal - 3;\n\n\t\treturn $finalTodos;\n}", "public function Actualiza_saldo($codigo_tar,$montoTotalCompra,$saldoTarjeta){\n require_once('../conexion_bd/conexion.php');\n $this->usuario='[email protected]';\n $conectado = new conexion();\n $con_res = $conectado->conectar();\n if (strcmp($con_res, \"ok\") == 0) {\n echo 'Conexion exitosa todo bien ';\n $saldo_reemplazar= $montoTotalCompra-$saldoTarjeta;\n \n $varActualiza = \" Update tarjetas_recibidas SET saldo=\".$saldo_reemplazar.\" where codigo_targeta \".$codigo_tar .\" registrada_sistema =TRUE\";\n \n $result = mysql_query( $varActualiza );\n if ($row = mysql_fetch_array($result)) {\n $retornar= 'Listo';\n } else {\n $retornar=''; \n }\n\n mysql_free_result($result);\n $conectado->desconectar();\n return $retornar;\n \n } else {\n echo 'Algo anda mal';\n } \n }", "function actualizarDinero($operacion, $cantidadDeposito, $cantidadRetirada){\n include (__ROOT__.'/backend/comprobaciones.php');\n global $db;\n $id = $_SESSION['loggedIn'];\n\n if($operacion === \"depositarDinero\"){\n //compruebo que las cantidades son un entero positivo\n if($cantidadDeposito >= 0){\n //comprobar que la cantidad que quiero retirar no supera la cantidad que tengo ingresada enBanco\n $miDinero = comprobarDinero();\n if($miDinero[0]['cash'] >= $cantidadDeposito){\n $sql = \"UPDATE personajes SET enBanco=enBanco + $cantidadDeposito, cash=cash-$cantidadDeposito WHERE id='$id'\";\n $stmt = $db->query($sql);\n header(\"location: ?page=zona&message=Exito\");\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n elseif ($operacion === \"retirarDinero\") {\n //compruebo que las cantidades son un entero positivo\n if($cantidadRetirada >= 0){\n //comprobar que la cantidad que quiero retirar no supera la cantidad que tengo ingresada enBanco\n $miDinero = comprobarDinero();\n if($miDinero[0]['enBanco'] >= $cantidadRetirada){\n $sql = \"UPDATE personajes SET cash=cash+$cantidadRetirada*0.95, enBanco=enBanco-$cantidadRetirada WHERE id='$id'\";\n $stmt = $db->query($sql);\n header(\"location: ?page=zona&message=Exito\");\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n \n}", "public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }", "public function setDepositAccount($value){\n return $this->setParameter('deposit_account', $value);\n }", "function alta_transferencia(){\n\t\t$u= new Cl_pedido();\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$u->cclientes_id=$GLOBALS['empresa_id'];\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t//Sincronizar con fecha de salida&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->ccl_estatus_pedido_id=2;\n\t\t$u->corigen_pedido_id=3;\n\t\t$u->ccl_tipo_pedido_id=2;\n\t\t// save with the related objects\n\t\tif($_POST['id']>0){\n\t\t\t$u->get_by_id($_POST['id']);\n\t\t\t$insert_traspaso_salida=0;\n\t\t} else {\n\t\t\t$insert_traspaso_salida=1;\n\t\t}\n\t\t$u->trans_begin();\n\t\tif($u->save()) {\n\t\t\t$cl_pedido_id=$u->id;\n\t\t\tif($insert_traspaso_salida==1) {\n\t\t\t\t//Dar de alta el traspaso\n\t\t\t\t$t= new Traspaso();\n\t\t\t\t$t->cl_pedido_id=$cl_pedido_id;\n\t\t\t\t$t->traspaso_estatus=1;\n\t\t\t\t$t->ubicacion_entrada_id=$_POST['ubicacion_entrada_id'];\n\t\t\t\t$t->ubicacion_salida_id=$_POST['ubicacion_salida_id'];\n\t\t\t\t$t->trans_begin();\n\t\t\t\t$t->save();\n\t\t\t\tif ($t->trans_status() === FALSE) {\n\t\t\t\t\t// Transaction failed, rollback\n\t\t\t\t\t$t->trans_rollback();\n\t\t\t\t\t$u->trans_rollback();\n\t\t\t\t\t// Add error message\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<button type=\"submit\" style=\"display:none;\" id=\"boton1\">Intentar de nuevo</button><br/>';\n\t\t\t\t\techo \"El alta del traspaso no pudo registrarse, intente de nuevo\";\n\t\t\t\t} else {\n\t\t\t\t\t// Transaction successful, commit\n\t\t\t\t\t$u->trans_commit();\n\t\t\t\t\t$t->trans_commit();\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Actualisar unicamente la tabla de los detalles\n\t\t\t\t$u->trans_commit();\n\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t}\n\t\t} else {\n\t\t\t$u->trans_rollback();\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function salvar($dados,$password = true){\n\n #seta o endereço, se tiver sido preenchido\n if (_v($dados,\"bairro\") != \"\"){\n $end = [\"bairro\"=>$dados[\"bairro\"], \"cidade\"=>$dados[\"cidade\"], \"uf\"=>$dados[\"uf\"]];\n $CI =& get_instance();\n $CI->load->model('Endereco_model');\n $endereco = $CI->Endereco_model->getOrCreate($end);\n $dados[\"idbairro\"] = $endereco[\"idbairro\"];\n } else {\n $dados[\"idbairro\"] = null;\n }\n \n #transforma o nome dos campos que vem do formulário para o nome no db\n $fields = [\"id\",\"nome_completo\",\"nome_social\",\"email\",\"cpf\",\"tipoInscricao\",\n \"instituicao\"=>\"idinstituicao\",\n \"curso\"=>\"idcurso\",\"pago\",\"logradouro\",\"idnivelcurso\",\n \"aprovado_certificado_avaliador\",\"aprovado_certificado_participante\",\n \"aprovado_certificado_palestrante\", \"aprovado_certificado_mesa_redonda\",\n \"titulo_palestra\", \"titulo_mesa_redonda\",\n \"nivel\",\"cep\",\"numero\",\"idbairro\",\"outra_instituicao\"];\n\n $tratados = $this->replaceNames($dados,$fields);\n if (!isset($dados[\"id\"])){\n $tratados[\"id\"] = null;\n }\n\n #nao deixa setar niveis mais altos que o proprio\n if (_v($dados,\"id\") != \"\"){\n if ($tratados[\"nivel\"] > $_SESSION[\"admin_user\"][\"nivel\"]){\n return false;\n }\n }\n\n #caso ele tenha marcado outra instituicao\n if (isset($tratados[\"idinstituicao\"])){\n if ($tratados[\"idinstituicao\"] == \"outra\"){\n $tratados[\"idinstituicao\"] = null;\n } else {\n $tratados[\"outra_instituicao\"] = null;\n }\n }\n\n if (_v($dados,\"password\") != \"\"){\n if (_v($dados,\"id\") == \"\" && !isset($dados[\"password\"])){\n $tratados[\"password\"] = sha1(\"12345678\");\n } else {\n $tratados[\"password\"] = sha1($dados[\"password\"]);\n }\n if ($password == false){\n $tratados[\"password\"] = null;\n }\n }\n\n \n return parent::salvar($tratados);\n }", "public function decreaseAmount(): void;", "public function deposit(FinancialTransactionInterface $transaction, $retry);", "public function setValor($valor)\n {\n $this->valor = $valor;\n }", "public function setDepositAmount($value){\n return $this->setParameter('deposit_amount', $value);\n }", "function suma( $resultado, $valor) {\n\t$resultado += $valor;\n\treturn $resultado;\n}", "public function establecerValor($propiedad,$valor) {\n return $this->establecerValores([$propiedad=>$valor]);\n }", "public function setValorDiaria($valorDiaria)\n {\n $this->valorDiaria = $valorDiaria;\n\n \n\n }", "function registroVentaEmpleadoDAO($salida){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $valor = $salida->getValor();\n $iva = $salida->getIva();\n $total = $salida->getTotal();\n $fecha = $salida->getFecha_sal();\n \n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO salidas(valor,iva,total,fecha_sal) VALUES (?,?,?,?)\");\n $stm->bindParam(1, $valor, PDO::PARAM_STR);\n $stm->bindParam(2, $iva, PDO::PARAM_STR);\n $stm->bindParam(3, $total, PDO::PARAM_STR);\n $stm->bindParam(4, $fecha, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en bd\");\n }\n return $exito;\n }", "public function actualizarusuario($codigo,$nombre,$precio,$cantidad){\r\n//Preparamos la conexión a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$sql=\"update usuario set nombre=?,precio=?,cantidad=? where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($nombre,$precio,$cantidad,$codigo));\r\n\tDatabase::disconnect();\r\n}", "public function calculate_deposit_callback() {\n\t\n // Do not proceed if deposit feature is disabled\n if (get_option( 'woo_payment_option' ) == 'disabled') {\n \n return false;\n }\n \n\t if ($_POST['deposit_option'] == 'full') {\n \t\t\n \t\tWC()->session->set( 'deposit_option', 'full' );\n\t\t} else {\n \t\t\n \t\tWC()->session->set( 'deposit_option', 'deposit' );\n\t\t}\n\t\t\n\t\techo $this->calculate_cart_total( WC()->cart );\n\t\t\n\t\tdie();\n\t}", "function delValoracion($id_comentario){\n try {\n $c = new Conexion();\n $c->exec(\"DELETE FROM valoracion WHERE id=$id_comentario\");\n return true;\n }\n catch (PDOException $e) {\n return false;\n }\n}", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function desativar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE EncontroComDeus SET \t ativo = 0\n WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }", "function deleteProyecto($proyecto){\n //no implementado por no requerimiento del proyecto\n }", "public function valorpasaje();", "public function testSaldoCero() {\n\t\t$valor = 14.80;\n\t\t$colectivo = new Colectivo(NULL, NULL, NULL);\n\t\t$tiempoReal = new Tiempo;\n\t\t$tarjeta = new Tarjeta($tiempoReal);\n\t\t$tarjeta->recargar(20);\n\t\t$boleto = new Boleto($colectivo, $tarjeta);\n\t\t$this->assertEquals($boleto->abono(), 0);\n }", "function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}", "public function deposit($deposit){\n\t\tif(is_numeric($deposit)){\n\t\t\t$deposit += $deposit*($this->credit/100); \n\t\t\treturn $this->balance += $deposit;\n\t\t}\n\t}", "public function deposit($deposit){\n\t\tif(is_numeric($deposit)){\n\t\t\t$deposit += $deposit*($this->credit/100); \n\t\t\treturn $this->balance += $deposit;\n\t\t}\n\t}", "public function deposit($deposit){\n\t\tif(is_numeric($deposit)){\n\t\t\t$deposit += $deposit*($this->credit/100); \n\t\t\treturn $this->balance += $deposit;\n\t\t}\n\t}", "public function crearusuario($codigo,$nombre,$precio,$cantidad){\r\n//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n//Preparamos la sentencia con parametros:\r\n\t$sql=\"insert into usuario (codigo,nombre,precio,cantidad) values(?,?,?,?)\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos y pasamos los parametros:\r\n\ttry{\r\n\t\t$consulta->execute(array($codigo,$nombre,$precio,$cantidad));\r\n\t} catch (PDOException $e){\r\n\t\tDatabase::disconnect();\r\n\t\tthrow new Exception($e->getMessage());\r\n\t}\r\n\tDatabase::disconnect();\r\n}", "function setFueEliminado($usuario_eliminador){\n\t\t\t//COMPARA CON UNO Y NO CON CERO, PORQUE YA LO PERDIO PERO TODAVIA NO SE LO SAQUE\n\t\tif($this->cantidad_paises == 1){\n\t\t\t$this->usuario_eliminador=$usuario_eliminador;\n\t\t}\n\t\t\n\t}", "function hook_confirmed_deposit($trans) { \n\n}", "function Delete_Partido($partido)\n{\n $valor = eliminar(\"DELETE FROM `tb_partidos` WHERE id_partido=$partido\");\n return $valor;\n}", "public function salvar_meu_cadastro($dados,$password = true){\n\n #seta o endereço, se tiver sido preenchido\n if (_v($dados,\"bairro\") != \"\"){\n $end = [\"bairro\"=>$dados[\"bairro\"], \"cidade\"=>$dados[\"cidade\"], \"uf\"=>$dados[\"uf\"]];\n $CI =& get_instance();\n $CI->load->model('Endereco_model');\n $endereco = $CI->Endereco_model->getOrCreate($end);\n $dados[\"idbairro\"] = $endereco[\"idbairro\"];\n } else {\n $dados[\"idbairro\"] = null;\n }\n \n #transforma o nome dos campos que vem do formulário para o nome no db\n $fields = [\"id\",\"nome_completo\",\"nome_social\",\"email\",\"cpf\",\"tipoInscricao\",\n \"curriculo\",\"lattes\",\"telefone\",\"foto\",\n \"instituicao\"=>\"idinstituicao\",\n \"curso\"=>\"idcurso\",\"pago\",\"logradouro\",\"idnivelcurso\",\n \"cep\",\"numero\",\"idbairro\",\"outra_instituicao\"];\n\n $tratados = $this->replaceNames($dados,$fields);\n if (!isset($dados[\"id\"])){\n $tratados[\"id\"] = null;\n }\n \n\n #caso ele tenha marcado outra instituicao\n if (isset($tratados[\"idinstituicao\"])){\n if ($tratados[\"idinstituicao\"] == \"outra\"){\n $tratados[\"idinstituicao\"] = null;\n } else {\n $tratados[\"outra_instituicao\"] = null;\n }\n }\n\n if (_v($dados,\"password\") != \"\"){\n if (_v($dados,\"id\") == \"\" && !isset($dados[\"password\"])){\n $tratados[\"password\"] = sha1(\"12345678\");\n } else {\n $tratados[\"password\"] = sha1($dados[\"password\"]);\n\n #se eu estiver alterando a minha propria senha na area de perfil\n if (isset($_SESSION[\"user\"]) && _v($_SESSION[\"user\"],\"id\") == $dados[\"id\"]){\n $tratados[\"email_confirmado\"] = true;\n }\n }\n if ($password == false){\n $tratados[\"password\"] = null;\n }\n }\n\n #todo mundo terá pago por padrão\n $tratados['pago'] = true;\n\n #todo mundo é participante por padrão\n if (_v($dados,\"id\") == \"\"){\n $tratados['nivel'] = NIVEL_PARTICIPANTE;\n }\n \n \n return parent::salvar($tratados);\n }", "function ActualizarCuenta($cuenta_id, $valor, $operacion) {\n\n\t$sql = \"CALL modificar_cuentas($cuenta_id, $valor, $operacion)\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n}", "function atuOrcreceitaval($codrec,$mes,$valor){\n $msg = \"0|Registro Atualizado !\";\n $clorcreceitaval = new cl_orcreceitaval;\t\t\n $clorcreceita = new cl_orcreceita;\t\t\n if ($mes == 0 || $mes =='0' || $mes === 0){\n // ajusta o saldo previsto\n\t$clorcreceita->o70_valor = $valor;\n\t$clorcreceita->o70_codrec= $codrec;\n\t$clorcreceita->o70_anousu= db_getsession(\"DB_anousu\");\n $rr= $clorcreceita->alterar(db_getsession(\"DB_anousu\"),$codrec);\n\tif ($clorcreceita->erro_status==='0'){\n\t $msg = \"1|\".$clorcreceita->erro_msg;\n\t}else {\n\t $msg = \"0|\".$clorcreceita->erro_msg; \n\t} \n return $msg;\n } \n if ($valor > 0){\n $clorcreceitaval->o71_coddoc = 100; \n }else{\n $clorcreceitaval->o71_coddoc = 101; \n }\n $clorcreceitaval->o71_anousu = db_getsession(\"DB_anousu\"); \n $clorcreceitaval->o71_mes = $mes; \n $clorcreceitaval->o71_codrec = $codrec;\n $clorcreceitaval->o71_valor = $valor; \n\n\n $rr = $clorcreceitaval->sql_record($clorcreceitaval->sql_query_file(db_getsession(\"DB_anousu\"),$codrec,$clorcreceitaval->o71_coddoc,$mes));\n if ($clorcreceitaval->numrows >0){\n $clorcreceitaval->alterar($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n\n } else { \n $clorcreceitaval->incluir($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n }\t \n \n $erro = $clorcreceitaval->erro_msg;\n if ($clorcreceitaval->erro_status===0){\n $msg= \"1|\".$erro;\n\treturn $msg;\n } else {\n $msg = \"0|\".$clorcreceitaval->erro_msg;\n return $msg;\n }\n}", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "private function sellTrasactionAddsMoney(){\n\n }", "function eliminarTipoVenta(){\n\t\t$this->procedimiento='vef.ft_tipo_venta_ime';\n\t\t$this->transaccion='VF_TIPVEN_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tipo_venta','id_tipo_venta','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function ventaClienteDAO($idUltimo, $cliente, $estado){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO cliente_salida(id_venta, id_persona, estado) VALUES (?,?,?)\");\n $stm->bindParam(1, $idUltimo, PDO::PARAM_STR);\n $stm->bindParam(2, $cliente, PDO::PARAM_STR);\n $stm->bindParam(3, $estado, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en tabla cliente_salida\");\n }\n return $exito;\n }", "function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}", "public function pagoRecurrente($valor)\n {\n \n \n $status = $this->pasarela->transaction()->sale([\n 'amount' => $valor,\n 'customerId' => $this->cliente,\n 'transactionSource' => \"recurring\", \n 'options' => [\n 'submitForSettlement' => True \n ]\n ]);\n\t\t\n\t\t\n\t\t\n return $status;\n }", "public function consultar($valor){\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\t\r\n\t\treturn $oSicasAtendimentoBD->consultar($valor);\r\n\t}", "function REMUNERACION_DIARIA($_ARGS) {\r\n\t$sueldo_normal_diario = REDONDEO(($_ARGS['ASIGNACIONES']/30), 2);\r\n\t$sql = \"SELECT SUM(tnec.Monto) AS Monto\r\n\t\t\tFROM\r\n\t\t\t\tpr_tiponominaempleadoconcepto tnec\r\n\t\t\t\tINNER JOIN pr_concepto c ON (tnec.CodConcepto = c.CodConcepto AND\r\n\t\t\t\t\t\t\t\t\t\t\t c.Tipo = 'I' AND\r\n\t\t\t\t\t\t\t\t\t\t\t c.FlagBonoRemuneracion = 'S')\r\n\t\t\tWHERE\r\n\t\t\t\ttnec.CodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\ttnec.Periodo = '\".$_ARGS['PERIODO'].\"'\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\tif (mysql_num_rows($query) != 0) $field = mysql_fetch_array($query);\r\n\t$remuneracion_diaria = REDONDEO(($field['Monto']/30), 2);\r\n\t$monto = $sueldo_normal_diario + $remuneracion_diaria;\r\n\treturn $monto;\r\n}", "function fezprova($tipousuario,$idUsuario){\nrequire_once \"modelo/DAO/ClasseQuestionarioDAO.php\";\n\n//verifica\nif ($tipousuario==ADMINISTRADOR or $tipousuario==PROFESSORES or $tipousuario==AUXILIAR){\n\t$tipo_questionario=4;\n}\nelse{\n\t$tipo_questionario=3;\t\n}\n\n$verificaQuestionarioDAO = new classeQuestionarioDAO();\n$verificacao =$verificaQuestionarioDAO->verificarFezAvaliacao($tipo_questionario,$idUsuario);\nreturn $verificacao;\n}", "function newDeposit($user, $amount, $operation_id){\r\n global $pdo;\r\n $stmt = $pdo->prepare('INSERT INTO deposits (DepositUserID, DepositDate, DepositAmount, DepositVerification, DepositType) VALUES (:DepositUserID, :DepositDate, :DepositAmount, :DepositVerification, :DepositType)');\r\n $stmt->execute(array(':DepositUserID' => $user, ':DepositDate' => time(), ':DepositAmount' => $amount, ':DepositVerification' => $operation_id, ':DepositType' => 'FreeKassa'));\r\n}", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "public function movimientoVenta($id_producto, $cantidad)\n {\n $mensaje = \" \";\n\n try {\n\n\n /* Primero hacemos una consulta SQL para sacar un array asosiativo y guardar lso datos que necesitamos */\n $conexion = conexion::conectar();\n $statement = $conexion->prepare('SELECT * FROM producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto));\n\n $resultado = $statement->fetch(PDO::FETCH_ASSOC);/* Se verifica si la consulta fue false/true, encontro algo o no */\n\n\n\n /* Aquí tomamos la cantidad del producto que hay antes de ser modificado */\n $_SESSION['cantidad'] = $resultado['cant_producto'];/* Array asociativo */\n\n\n /* Este solo es de prueba */\n $_SESSION['nom_producto'] = $resultado['nom_producto'];/* Array asociativo */\n\n\n\n\n /* -----DESCONTANDO PRODUTOS DE STOCK */\n\n /* Retamos la cantidad en stock - la que vamos a verder */\n $descuento = $_SESSION['cantidad'] - $cantidad;\n\n\n /* Y luego ya le pasamos ese resultado a una sentencia SQL para que lo modifique */\n $statement = $conexion->prepare('UPDATE producto SET cant_producto=:cant_producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto, ':cant_producto' => $descuento));\n\n\n $mensaje = \"La cantidad de \" . $_SESSION['nom_producto'] . \" es de: \" . $_SESSION['cantidad'] . \" con descuento queda en: \" . $descuento;\n } catch (PDOException $e) {\n\n echo \" el error es\" . $e->getMessage();\n }\n\n //$statement = null;\n return $mensaje;\n }", "abstract protected function realizaCalculoEspecifico(Orcamento $orcamento): float;", "public function actualizar($id, $valor){\n $credito = Credito::find($id);\n $credito->valor_cuota = $valor;\n $credito->save();\n return redirect()->back();\n }", "function descontar_reservados_mov($id_mov,$id_dep,$anular=0)\r\n{\r\nglobal $db,$_ses_user,$titulo_pagina;\r\n\r\n $db->StartTrans();\r\n //por cada producto seleccionado desde el proveedor de tipo stock\r\n //ingresamos la cantidad dada, en la parte de reservados de ese\r\n //producto, en ese stock, bajo ese deposito (todo esto contenido)\r\n //en diferentes variables\r\n $items_stock=get_items_mov($id_mov);\r\n\r\n for($i=0;$i<$items_stock['cantidad'];$i++)\r\n {\r\n $id_prod_esp=$items_stock[$i][\"id_prod_esp\"];\r\n $cantidad=$items_stock[$i][\"cantidad\"];\r\n $id_detalle_movimiento=$items_stock[$i][\"id_detalle_movimiento\"];\r\n if($anular){\r\n $comentario_stock=\"Cancelacion de reserva de productos por anulación del $titulo_pagina Nº $id_mov\";\r\n $id_tipo_movimiento=9;\r\n }\r\n else {\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_mov\";\r\n $id_tipo_movimiento=7;\r\n }\r\n\r\n cancelar_reserva($id_prod_esp,$cantidad,$id_dep,$comentario_stock,$id_tipo_movimiento,\"\",$id_detalle_movimiento);\r\n\r\n }//de for($i=0;$i<$items_rma['cantidad'];$i++)\r\n\r\n $db->CompleteTrans();\r\n}", "public function movimienCompra($id_producto, $cantidad)\n {\n $mensaje = \" \";\n \n try {\n \n \n /* Primero hacemos una consulta SQL para sacar un array asosiativo y guardar lso datos que necesitamos */\n $conexion = conexion::conectar();\n $statement = $conexion->prepare('SELECT * FROM producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto));\n \n $resultado = $statement->fetch(PDO::FETCH_ASSOC);/* Se verifica si la consulta fue false/true, encontro algo o no */\n \n \n \n /* Aquí tomamos la cantidad del producto que hay antes de ser modificado */\n $_SESSION['cantidad'] = $resultado['cant_producto'];/* Array asociativo */\n \n \n /* Este solo es de prueba */\n $_SESSION['nom_producto'] = $resultado['nom_producto'];/* Array asociativo */\n \n \n \n \n /* -----DESCONTANDO PRODUTOS DE STOCK */\n \n /* Retamos la cantidad en stock - la que vamos a verder */\n $descuento = $_SESSION['cantidad'] + $cantidad;\n \n \n /* Y luego ya le pasamos ese resultado a una sentencia SQL para que lo modifique */\n $statement = $conexion->prepare('UPDATE producto SET cant_producto=:cant_producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto, ':cant_producto' => $descuento));\n \n \n $mensaje = \"La cantidad de \" . $_SESSION['nom_producto'] . \" es de: \" . $_SESSION['cantidad'] . \" con aumento queda en: \" . $descuento;\n } catch (PDOException $e) {\n \n echo \" el error es\" . $e->getMessage();\n }\n \n //$statement = null;\n return $mensaje;\n }", "static public function addNotasCreditoModel(\n $descripcionCredito,\n $cantidadCredito,\n $importeCredito,\n $idCliente,\n $fechaCredito,\n $tabla){\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT saldoActual AS saldo FROM saldos\n WHERE idCliente = :idCliente\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->execute();\n $resu= $sql13->fetch();\n $saldo = $resu['saldo'];\n\n if($saldo <=0){\n return 'noSaldo';\n }else{\n\n\n $totalCredito = $cantidadCredito * $importeCredito;\n $sql = Conexion::conectar()->prepare(\"INSERT INTO $tabla( descripcionCredito, cantidadCredito, importeCredito, totalCredito , idCliente, fechaCredito)\n VALUES(:descripcionCredito, :cantidadCredito , :importeCredito,:totalCredito, :idCliente, :fechaCredito)\");\n $sql->bindParam(':descripcionCredito', $descripcionCredito);\n $sql->bindParam(':cantidadCredito', $cantidadCredito);\n $sql->bindParam(':importeCredito', $importeCredito);\n $sql->bindParam(':totalCredito', $totalCredito);\n $sql->bindParam(':idCliente', $idCliente);\n $sql->bindParam(':fechaCredito', $fechaCredito);\n\n if ($sql->execute()) {\n\n $sql3 = Conexion::conectar()->prepare(\"UPDATE saldos SET saldoActual= saldoActual- $totalCredito, saldoFinal= saldoFinal- $totalCredito WHERE idCliente = :idCliente\");\n $sql3->bindParam(':idCliente', $idCliente);\n $sql3->execute();\n\n\n\n\n $sql41 = Conexion::conectar()->prepare(\"INSERT INTO cuentacorriente(comprobante,\n pagos, idCliente, fecha)\n VALUES(:comprobante, :pagos , :idCliente,:fecha)\");\n $hoy = $fechaCredito;\n $comprobante = 1;\n $sql41->bindParam(':comprobante', $comprobante );\n $sql41->bindParam(':pagos', $totalCredito);\n $sql41->bindParam(':idCliente', $idCliente);\n $sql41->bindParam(':fecha', $hoy);\n $sql41->execute();\n\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT MAX(idCuentaCorriente)AS id FROM cuentacorriente\n WHERE idCliente = :idCliente\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->execute();\n $resu= $sql13->fetch();\n $id = $resu['id'];\n\n\n $sql11 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET saldo= (SELECT saldoFinal FROM saldos WHERE idCliente=$idCliente)\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\" );\n $sql11->bindParam(':idCliente', $idCliente);\n $sql11->bindParam(':id', $id);\n $sql11->execute();\n\n $sql131 = Conexion::conectar()->prepare(\"SELECT MAX(idNotaCredito)AS idNotaCredito FROM notacredito\n WHERE idCliente = :idCliente\");\n $sql131->bindParam(':idCliente', $idCliente);\n $sql131->execute();\n $resu1= $sql131->fetch();\n $idNotaCredito = 'Nota de Crédito' . ' ' . $resu1['idNotaCredito'];\n $nroNotaCredito=$resu1['idNotaCredito'];\n $sql111 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET comprobante= :idNotaCredito , nroNotaCredito=:nroNotaCredito\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\");\n $sql111->bindParam(':idCliente', $idCliente);\n $sql111->bindParam(':idNotaCredito', $idNotaCredito);\n $sql111->bindParam(':nroNotaCredito', $nroNotaCredito);\n $sql111->bindParam(':id', $id);\n $sql111->execute();\n\n return 'success';\n }else{\n return 'errorers';\n }\n $sql->close();\n\n }\n\n }", "public function setVida($valor){\n $this->vida=$valor;\n }", "public function consultaDevuelta($valorTotal, $efectivo)\n{\n $efectivo=$this->filtroNumerico($this->normalizacionDeCaracteres($efectivo));\n $valorTotal=$this->filtroNumerico($this->normalizacionDeCaracteres($valorTotal));\n\n $devolver=$efectivo-$valorTotal;\n if ($devolver>0) {\n # code...\n return $devolver;\n }\n else\n {\n return 0;\n }\n\n\n}", "public function encuentra_saldo($codigo_tar){\n require_once('../procesos/auditoria.php');\n $auditar = new auditoria();\n require_once('../conexion_bd/conexion.php');\n $this->usuario=$_SESSION['usuarios'];//'[email protected]';\n $conectado = new conexion();\n $con_res = $conectado->conectar();\n if (strcmp($con_res, \"ok\") == 0) {\n echo 'Conexion exitosa todo bien ';\n \n $var = \"select a.saldo from tarjetas_recibidas a, tarjetas_por_usuarios b\n where b.codigo_targeta=a.codigo_targeta and a.codigo_targeta=\".$codigo_tar . \"and a.registrada_sistema=TRUE\";\n \n $result = mysql_query( $var );\n $auditar->insertar_auditoria($_SESSION['usuarios'], \n \"Consulta\", \"tarjetas_por_usuarios\", \"Consultando saldo de la tarjeta\");\n if ($row = mysql_fetch_array($result)) {\n $retornasaldo= $row['saldo'];\n } else {\n $retornasaldo=''; \n }\n\n mysql_free_result($result);\n $conectado->desconectar();\n return $retornasaldo;\n \n } else {\n $auditar->insertar_auditoria($_SESSION['usuarios'], \n \"Conexion\", \"Base de datos\", \"Problemas de conexion\");\n echo 'Algo anda mal';\n } \n }", "function disponible_registro(){\t\n\t\tif (isset($_GET['valor']) && $_GET['valor']!=\"\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$valor=$_GET['valor'];\n\t\t\t//echo \"Entro: \".$_GET['valor'];\n\t\t\t$sql=\"UPDATE producto SET disponible_pro='$valor' WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\n\t\t\theader(\"location:/admin/producto/\");\n\t\t\texit();\n\t\t}\n\t}", "public static function pedidoM($code, $id, $precio, $cantidad, $total, $fechaP, $nombre, $lapPaymentMethod, $direccion)\r\n {\r\n\r\n $sql = \"INSERT INTO pedido(id_usuario,fecha_pedido,direccion_destino,nombre_usuario2) VALUES (:id_usuario,:fecha_pedido,:direccion_destino,:nombre_usuario2)\";\r\n self::getConexion();\r\n $resultado = self::$cnx->prepare($sql);\r\n $resultado->bindParam(\":id_usuario\", $id);\r\n $resultado->bindParam(\":fecha_pedido\", $fechaP);\r\n $resultado->bindParam(\":direccion_destino\", $direccion);\r\n $resultado->bindParam(\":nombre_usuario2\", $nombre);\r\n\r\n $resultado->execute();\r\n $lastId = self::$cnx->lastInsertId();\r\n\r\n // insercion\r\n $sqll = \"INSERT INTO detallepedido (id_pedido,id_producto,precio_unidad,cantidad,precio_total,descuento)\r\n VALUES(:id_pedido,:id_producto,:precio_unidad,:cantidad,:precio_total,0)\";\r\n self::getConexion();\r\n $resultados = self::$cnx->prepare($sqll);\r\n $resultados->bindParam(\":id_pedido\", $lastId);\r\n $resultados->bindParam(\":id_producto\", $code);\r\n $resultados->bindParam(\":precio_unidad\", $precio);\r\n $resultados->bindParam(\":cantidad\", $cantidad);\r\n $resultados->bindParam(\":precio_total\", $total);\r\n $resultados->execute();\r\n\r\n }", "function operdiario($mysqli,$cuenta,$tipoper,$tipom,$ref,$monto,$fecha,$sfactu,$subcta=NULL,$coment=NULL){\n\t\t//si el movimiento es debe = 0 o haber = else\n\t\t//determinacion de referencia orden de compra o pedido\n\t\tif($tipoper==0){$refe=\"oc\".$ref;}else{$refe=\"pd\".$ref;}\n\t\t//determinacion de tipo de movimiento\n\t\tif($tipom==0){\n\t\t\t$colum=\"debe\";\n\t\t}else{\n\t\t\t$colum=\"haber\";\n\t\t}\n\t\t$mysqli->query(\"INSERT INTO diario(cuenta,referencia,$colum,fecha,facturar,subcuenta,coment)\n VALUES($cuenta,'$refe',$monto,'$fecha',$sfactu,'$subcta','$coment')\")\n\t\tor die(\"Error en registro contable: \".mysqli_error($mysqli));\n}", "abstract public function test( Payment $payment );", "function eliminarPeriodoVenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_ime';\n $this->transaccion='OBING_PERVEN_ELI';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n $this->setParametro('id_periodo_venta','id_periodo_venta','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"[email protected]\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}", "function toPay()\r\n {\r\n try {\r\n $this->mKart->setPaidKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('310', 'No s`ha pogut realitzar el pagament.', $e);\r\n }\r\n }", "function valorDoBtcComEncargos($param_valor)\n{\n\n//pega o btc e soma valor final do btc com todos encargos\n\n\t$percentual = 0.70 / 100.0; // 15%\n\t$valor_final = $param_valor + ($percentual * $param_valor);\n\t//comissoes 1,99 + 2,90\n\t$percentual2 = 2.0 / 100.0;\n\t$valorTotal = $percentual2 * $param_valor;\n\t\n\t\n\t\n\t$finalTodos = $valor_final + $valorTotal + 3;\n\n\t\treturn $finalTodos;\n}", "function restar_dinero_socio($socio_id, $importe){\n\tglobal $link;\n\n\t$socio_id = (int) $socio_id;\n\t$importe = (float) $importe;\n\n\t$sql = \"SELECT saldo FROM socios\n\t\t\tWHERE socio_id = '$socio_id'\";\n\t$query = mysqli_query($link,$sql);\n\t$ahorro = mysqli_fetch_assoc($query);\n\t\n\t$ahorro_final = $ahorro['saldo'];\n\t\n\n\t$saldo_restante = $ahorro_final - $importe;\n\tif ($saldo_restante < 0) {\n\t\t$ba_query['message_code'] = 'c107';\n\t\treturn false;\n\t}\n\t\n\t$sql2 = \"UPDATE socios SET saldo = '$saldo_restante'\n\t\t\t WHERE socio_id = '$socio_id'\";\n\t$query2 = mysqli_query($link,$sql2);\n\tif(!mysqli_affected_rows($link)){\n\t\t$ba_query['message_code'] = 'c108';\n\t\treturn false;\n\t}\n\treturn true;\n}", "function elimina(&$valores)\n {\n $this->iniVar();\n if (isset($this->bvictimacolectiva->_do->id_grupoper)) {\n $this->eliminaVic($this->bvictimacolectiva->_do, true);\n $_SESSION['fvc_total']--;\n }\n }", "public function calcularValorLlamada();", "public function payment(){\n\n\t}", "public function liberarEstadoAplicanteDirecto($uid_aplicante, $tid_estado, $return = true){\n \tif(!is_numeric($uid_aplicante) || !is_numeric($tid_estado)){\n \t\t$data['success'] = false;\n\t\t\t$data['error'] = 'Alguno de los argumentos no es numérico';\n\t\t\t$data['code'] = '406';\n \t}else{\n\t \t\t$auth_data = $this->autenticacion();\n\t\t \tif($auth_data['valido']){\n\t\t\t\t$csrf_token = $auth_data['csrf_token'];\n\t\t\t\t$session_cookie = $auth_data['session_cookie'];\n\n\t\t\t\t//validar si el estado ingresado es el que corresponde\n\t\t\t\t$estados_url = base_url('/rrhh/api/filtros/filtros-taxonomias-estados-bitacora.xml');\n\t\t\t\t$estados = consumirServicio($estados_url, $session_cookie, $csrf_token);\n\t\t\t\t$estado_valido = false;\n\t\t\t\tforeach ($estados->results as $key => $value) {\n\t\t\t\t\tforeach ($value as $key2 => $value2) {\n\t\t\t\t\t\tif($tid_estado == (int)$value2->tid){\n\t\t\t\t\t\t\t$estado_valido = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($estado_valido){\n\n\t\t\t\t\t//validar el usuario si existe\n\t\t\t\t\t$user = $this->Users->load($uid_aplicante);\n\t\t\t\t\tif((int)count($user) > 0){\t\t\t\t\t\n\n\t\t\t\t \t\t$request_url = base_url().'rrhh/api/users/liberar_estado/retrieve.xml?idAplicante='. $uid_aplicante . '&idEstado='. $tid_estado;\n\t\t\t\t\t\t$result = consumirServicio($request_url, $session_cookie, $csrf_token);\n\n\t\t\t\t\t\tif($return){\n\t\t\t\t\t\t\t$data['success'] = true;\n\t\t\t\t\t\t\t$data['error'] = 'Estado general actualizado satisfactoramiente';\n\t\t\t\t\t\t\t$data['code'] = '200';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//no se pudo validar que el aplicante sea nacional\n\t\t\t\t\t\t$data['success'] = false;\n\t\t\t\t\t\t$data['error'] = 'No existe el aplicante con el codigo: '.$uid_aplicante.', por favor verifique';\n\t\t\t\t\t\t$data['code'] = '406';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//no se encontro ninguna aplicacion con el id ingresado desde el url\n\t\t\t\t\t$data['success'] = false;\n\t\t\t\t\t$data['error'] = 'Has ingresado un codigo de estado incorrecto, favor verifique';\n\t\t\t\t\t$data['code'] = '406';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['response'] = $data;\n\t\t$this->load->view('user/user-response', $data);\n \t}", "public function calculatePayment()\n {\n }", "public function actionDepositMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Set the new wallet balance with conversion\n $wallet->balance += $result['converted_amount'];\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Set the new wallet balance without conversion\n $wallet->balance += $amount;\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the deposit\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "abstract protected function handlePayment();", "public function test_validate_deposit()\n {\n $amount = 5000;\n $deposit = $this->obj->validate_deposit($amount);\n $this->assertLessThanOrEqual(40000,$amount);\n $this->assertTrue($deposit);\n }", "public function setProduto($nome,$valor,$quantidade,$comissao){\n try{\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO produto (nome,valor,quantidade) VALUES ('$nome','$valor','$quantidade')\"); \n $query->execute(); \n return 1;\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n}", "public function Registrar_Licencia_noRemunerada3(HojaVida $data) {\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n if($data->lic_id_tipo == 5) \n { // Licencia 3 meses\n $tiporegistro = \"Solicitud Licencia no Remunerada (3 Meses)\";\n }\n else\n {\n $tiporegistro = \"Solicitud Licencia no Remunerada hasta por 2 años\";\n }\n\n $accion = \"Registra una Nueva \".$tiporegistro.\" En el Sistema TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario']; // idusuario que registra la solicitud de licencia\n \n $per_DI_other = $_POST['cedula_other'];\n $per_name_other = $_POST['nombre_other'];\n if($per_DI_other != \"\" && $per_name_other != \"\")\n {\n $id_usuario_soli = $_POST['id_servidor']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_POST['cedula_other'];\n $nombre_solicitante = $_POST['nombre_other'];\n $cargo_solicitante = $_POST['cargo_servidor'];\n }\n else\n {\n $id_usuario_soli = $_SESSION['idUsuario']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_SESSION['nomusu'];\n $nombre_solicitante = $_SESSION['nombre'];\n $cargo_solicitante = $_SESSION['cargo'];\n }\n try {\n\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n \n $sql = \"INSERT INTO `th_licencias_no_remunerada`(\n `lic_no_rem_id_tipo_resolucion`, \n `lic_no_rem_fecha_solicitud`, \n `lic_no_rem_fecha_escrito`, \n `lic_no_rem_cedula_servidor`, \n `lic_no_rem_nombre_servidor`, \n `lic_no_rem_fecha_inicio`, \n `lic_no_rem_fecha_fin`, \n `lic_no_rem_motivo`, \n `lic_no_rem_id_user`, \n `lic_no_rem_estado`,\n `lic_no_rem_ruta_doc_escrito`, \n `lic_no_rem_id_user_registra`, \n `lic_no_rem_cargo_cs`) \n VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->lic_id_tipo,\n $fechalog,\n $data->fecha_escrito,\n $cedula_solicitante,\n $nombre_solicitante,\n $data->fechaInicio,\n $data->fechaFin,\n $data->comentario,\n $id_usuario_soli,\n 0,\n $data->ruta_doc_adjunto, \n $idusuario, \n $cargo_solicitante\n )\n );\n $this->pdo->exec(\"INSERT INTO log (fecha, accion, detalle, idusuario, idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "private function pantalla_edicion($modo,$datos='') {\r\n\t\t\t if($datos == ''){//para que por defecto en insertar salga el nombre del producto vacio y el precio igual a 0\r\n\t\t\t\tunset($datos);\r\n\t\t\t\t$datos['nombre'] = '';\r\n\t\t\t\t$datos['precio'] = 0;\r\n\t\t\t }\r\n\t\t\t ?>\r\n\t\t\t <!DOCTYPE html>\r\n\t\t\t\t<html>\r\n\t\t\t\t\t<head>\r\n\t\t\t\t\t\t<title>Área privada de Tienda online</title>\r\n\t\t\t\t\t\t<link href=\"/ejercicio_unidad9_hector_garcia/css/estilos.css\" rel=\"stylesheet\" type=\"text/css\">\r\n\t\t\t\t\t</head>\r\n\t\t\t\t\t<body>\r\n\t\t\t\t\t\t<div id=\"main\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t$this -> cabecera();\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t<div id=\"contenido\">\r\n\t\t\t\t\t\t\t\t<h2>Ficha de producto</h2>\r\n\t\t\t\t\t\t\t\t<form method=\"post\" action=\"http://localhost:8080/ejercicio_unidad9_hector_garcia/\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\tif ($modo == 'insertar') {\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"acc\" value=\"insertar_producto\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t} else {\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo (int)$datos['id']; ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"acc\" value=\"modificar_producto\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<label class=\"etiqueta\" for=\"nombre\">Nombre</label>\r\n\t\t\t\t\t\t\t\t<div class=\"campo\"><input type=\"text\" name=\"nombre\" id=\"nombre\" value=\"<?php echo htmlentities($datos['nombre']); ?>\"></div>\r\n\t\t\t\t\t\t\t\t<label class=\"etiqueta\" for=\"precio\">Precio</label>\r\n\t\t\t\t\t\t\t\t<div class=\"campo\"><input type=\"text\" name=\"precio\" id=\"precio\" value=\"<?php echo number_format($datos['precio'],2,',','.'); ?>\"></div>\r\n\t\t\t\t\t\t\t\t<div class=\"botonera\"><button type=\"submit\">Guardar</button></div>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</body>\r\n\t\t\t\t</html>\r\n\t\t<?php\r\n\t\t}", "function sobreMeSalvar() {\n \n $usuario = new Estado_pessoal();\n $api = new ApiUsuario();\n $usuario->codgusuario = $_SESSION['unia']->codgusario;\n $this->dados = $api->Listar_detalhe_usuario($usuario);\n if (empty($this->dados->codgusuario) && $this->dados->codgusuario == NULL) {\n \n $this->dados = array('dados'=>$api->Insert_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n } else {\n $this->dados = array('dados'=>$api->Actualizar_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n }\n \n }", "public function saldo($link, $id_usuario){\n $bd13 = new bancoDeDados();\n $retorno = $bd13->saldo($link, $id_usuario);\n return $retorno;\n }", "public function consultar($valor){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\t\r\n\t\treturn $oSicasSalarioMinimoBD->consultar($valor);\r\n\t}", "public function testCargaSaldoInvalido()\n {\n $tiempo = new Tiempo;\n $recargable = new Recargable();\n $medio = new Medio(0, $tiempo,$recargable);\n $this->assertFalse($medio->recargar(15));\n $this->assertEquals($medio->obtenerSaldo(), 0);\n }", "public function actualizar($registro) {\n \n }", "public function actualizar($registro) {\n \n }", "public function guardarFacturaUnElemento($descuento, $iva, $valorIva, $valorBruto, $totalFactura, $numeroImpresiones, $metodoPago, $observaciones, $estadoFactura, $idPropietario, $idFacturador, $idResolucion, $idUsuario, $idSucursal, $idElemento = '0', $cantidad, $tipoDetalle ){\n\t\t\n\t\t$numeroFactura = \"\";\n\t\t\n\t\t$descuento \t\t\t= parent::escaparQueryBDCliente($descuento);\n\t\t$iva \t\t\t\t= parent::escaparQueryBDCliente($iva);\n\t\t$valorIva \t\t\t= parent::escaparQueryBDCliente($valorIva);\n\t\t$valorBruto \t\t= parent::escaparQueryBDCliente($valorBruto);\n\t\t$totalFactura \t\t= parent::escaparQueryBDCliente($totalFactura);\n\t\t$numeroImpresiones \t= parent::escaparQueryBDCliente($numeroImpresiones);\n\t\t$metodoPago \t\t= parent::escaparQueryBDCliente($metodoPago);\n\t\t$observaciones \t\t= parent::escaparQueryBDCliente($observaciones);\n\t\t$estadoFactura \t\t= parent::escaparQueryBDCliente($estadoFactura);\n\t\t$idPropietario \t\t= parent::escaparQueryBDCliente($idPropietario);\n\t\t$idFacturador \t\t= parent::escaparQueryBDCliente($idFacturador);\n\t\t$idResolucion \t\t= parent::escaparQueryBDCliente($idResolucion);\n\t\t$idUsuario \t\t\t= parent::escaparQueryBDCliente($idUsuario);\n\t\t$idSucursal \t\t= parent::escaparQueryBDCliente($idSucursal);\n\t\t$idElemento \t\t= parent::escaparQueryBDCliente($idElemento);\n\t\t$cantidad \t\t = parent::escaparQueryBDCliente($cantidad);\n\t\t$tipoDetalle \t\t= parent::escaparQueryBDCliente($tipoDetalle);\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\t$query = \"SELECT proximaFactura FROM tb_resolucionDian WHERE idResolucionDian = '$idResolucion'\";\n\t\t\n\t\t\n\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t \t\n\t $numeroFactura = $filas['proximaFactura'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$query2 = \"INSERT INTO tb_facturas (numeroFactura, fecha, hora, fechaFin, horaFin, iva, valorIva, descuento, subtotal, total, numeroImpresiones, metodopago, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tobservaciones, estado, idPropietario, idFacturador, idResolucionDian, idUsuario, idSucursal)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t\t\t\t('$numeroFactura', NOW(), NOW(), NOW(), NOW(), '$iva', '$valorIva', '$descuento', '$valorBruto', '$totalFactura', '$numeroImpresiones', '$metodoPago',\n\t\t\t\t\t\t\t\t\t\t\t'$observaciones', '$estadoFactura', '$idPropietario', '$idFacturador', '$idResolucion', '$idUsuario', '$idSucursal' )\n\t\t\t\t\t\t\t\t\t\";\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$res2 = $conexion->query($query2);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$query3 = \"UPDATE tb_resolucionDian SET proximaFactura = proximaFactura+1 WHERE idResolucionDian = '$idResolucion' \";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$res3 = $conexion->query($query3);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$query4 = \"SELECT MAX(idFactura) as idFactura FROM tb_facturas\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($res4 = $conexion->query($query4)){\n\t\t\t\t\t\t\twhile ($filas4 = $res4->fetch_assoc()) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$resultadoIdFactura = $filas4['idFactura'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$query5 = \"INSERT INTO tb_pago_factura_caja (fecha, hora, tipoElemento, idTipoElemento, idUsuario)\n\t\t\t\t\t\t\t\t\t\tVALUES (NOW(), NOW(), 'Factura', '$resultadoIdFactura', '$idUsuario')\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$res5 = $conexion->query($query5);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$query6 = \"SELECT MAX(idPagoFacturaCaja) as idPagoFacturaCaja FROM tb_pago_factura_caja\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($res6 = $conexion->query($query6)){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($tipoDetalle != 'Cirugia' AND $tipoDetalle != 'Examen' AND $tipoDetalle != 'Producto' AND $tipoDetalle != 'Servicio'){\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\twhile ($filas6 = $res6->fetch_assoc()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$resultadoIdPagoFacturaCaja = $filas6['idPagoFacturaCaja'];\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$query7 = \"INSERT INTO tb_pago_factura_caja_detalle (tipoDetalle, idTipoDetalle, valorUnitario, descuento, cantidad, estado, idPagoFacturaCaja, idSucursal)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES ('$tipoDetalle', '$idElemento', '$valorBruto', '$descuento', '$cantidad', 'Activo', '$resultadoIdPagoFacturaCaja', '$idSucursal') \";\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$res7 = $conexion->query($query7);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}//fin while\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t/* liberar el conjunto de resultados */\n\t\t\t\t\t \t\t\t\t$res6->free();\n\t\t\t \t\t\t\t\n\t\t\t \t\t\t\t}//fin if si el tipo detalle no es una cirugia (Los detalles de cirugia son aparte)\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}//fin if\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}//fin while\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t /* liberar el conjunto de resultados */\n\t\t\t \t\t$res4->free();\n\t\t\t\t\t\t\n\t\t\t\t\t\t}//fin if\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n \t\t$res->free();\n\t \n\t }//fin if ejecucion primer query\n\t \n\t \n\t \n return $resultadoIdFactura;\n \t\n\t\t\n\t}" ]
[ "0.67820275", "0.65763456", "0.64504224", "0.6382421", "0.60422665", "0.58828187", "0.5851321", "0.58293575", "0.58022547", "0.57219166", "0.5676708", "0.56763005", "0.5659702", "0.563477", "0.56176186", "0.56108904", "0.5600164", "0.55915964", "0.5564366", "0.556111", "0.55546206", "0.5538068", "0.5536307", "0.5522468", "0.5492677", "0.54808486", "0.5471214", "0.54606396", "0.5447808", "0.5423969", "0.54126257", "0.5405516", "0.54043216", "0.54029155", "0.54015046", "0.5396868", "0.53909194", "0.53872484", "0.5386334", "0.5386334", "0.5386334", "0.53860205", "0.53697526", "0.5360769", "0.5358159", "0.53490555", "0.53463995", "0.53301007", "0.5312265", "0.5310477", "0.5310477", "0.5310477", "0.5310477", "0.53089404", "0.530869", "0.53076136", "0.52965754", "0.52960825", "0.5295067", "0.52933174", "0.5291718", "0.5286599", "0.5280103", "0.5273052", "0.5270132", "0.5264866", "0.5253667", "0.5252627", "0.52470523", "0.52449393", "0.5241879", "0.5240981", "0.52385694", "0.5237112", "0.52301866", "0.5227999", "0.5225525", "0.5225399", "0.5215436", "0.5213976", "0.52120453", "0.52061296", "0.5199947", "0.5195444", "0.5192785", "0.5191733", "0.5191728", "0.5182419", "0.51796275", "0.51755893", "0.517414", "0.517168", "0.51585084", "0.51576936", "0.51570493", "0.51547015", "0.5148421", "0.51426244", "0.5140856", "0.5140856", "0.5137605" ]
0.0
-1
Invoked when tick() is called for the first time.
public function call(StrandInterface $strand) { $strand->suspend(); $this->timer = $strand ->kernel() ->eventLoop() ->addTimer( $this->timeout, function () use ($strand) { $strand->resumeWithValue(null); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tick() {\n // per second, but possibly more often.\n }", "public function onTick() {\r\n\r\n }", "public function tick()\n {\n //\n }", "protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}", "public function tick();", "public function onTick($currentTick){ \n }", "function tick();", "public function tick()\n {\n $backtrace = debug_backtrace();\n if (isset($backtrace[1])) {\n $what = $backtrace[1]['function'];\n if (isset($backtrace[1]['class'])) {\n $what = $backtrace[1]['class'] . ' ' . $backtrace[1]['function'];\n }\n $message = $what .' ' . $this->memoryUsage();\n $this->log($message);\n }\n\n return;\n }", "protected function _init(){\n\t\t//Hook called at the beginning of self::run();\n\t}", "public function preUpdate()\n {\n }", "function onRun($currentTick) {\n if ($this->running) {\n $this->plugin->getLogger()->info('Skipped EverySecondTask, already running');\n return;\n }\n\n $this->running = true;\n $this->doTasks();\n $this->running = false;\n }", "function tick_handler()\n{\n echo \"called\\n\";\n}", "public function tick()\n {\n $this->poloniexWatcher->updateAssetPrices();\n\n $this->binanceWatcher->updateAssetPrices();\n\n $this->bitfinexWatcher->updateAssetPrices();\n\n $this->bittrexWatcher->updateAssetPrices();\n\n $this->coinMarketWatcher->sync();\n }", "protected function storeInitialMark()\n {\n $this->storeMark(\n 'Init',\n 'main',\n static::initialTime(),\n $this->trackMemory ? memory_get_usage(true) : 0,\n 0\n );\n }", "function start()\n\t{\n\t\tif( ! $this->is_running ){\n\t\t\t$this->is_running = TRUE;\n\t\t\t$this->running_since = self::timeMillisecondsAsFloat();\n\t\t}\n\t}", "public function dispatchLoopStartup()\n {\n //...\n }", "public function tick()\n {\n $this->sellIn -= 1;\n $this->quality -= 1;\n\n if ($this->sellIn <= 0) {\n $this->quality -= 1;\n }\n\n if ($this->quality <= 0) {\n $this->quality = 0;\n }\n }", "private function resetNow()\n {\n $this->now = time();\n }", "public function after_run() {}", "public function callNow()\n {\n $c = $this->callback;\n $c();\n }", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "function after_update() {}", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "public function after_run(){}", "public function onRun($currentTick) {\n\t\t$onlinePlayers = \\pocketmine\\Server::getInstance()->getOnlinePlayers();\n// \t\tforeach ($onlinePlayers as $player) {\n// \t\t\tif (self::needPetMessage($player)) {\n// \t\t\t\tPets::sendPetMessage($player, Pets::PET_LOBBY_RANDOM);\n// \t\t\t}\n// \t\t}\n\t}", "public static function firstRun(){\n\t\tparent::firstRun();\n\n\t}", "private function __construct()\n {\n $this->time = time();\n }", "public function run()\n {\n //$this->getBars();\n $this->getTicks();\n $this->ticksBar();\n\n $this->age =\n strtotime($this->current_time) -\n strtotime($this->last_refreshed_at);\n }", "function update_start()\n {\n }", "public function tick(){\n\t\tif($this->status !== self::NORMAL){\n\t\t\t$this->remaining_turns--;\n\t\t\tif($this->remaining_turns <= 0){\n\t\t\t\t$this->status = self::NORMAL;\n\t\t\t}\n\t\t}\n\t}", "public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }", "public function seen(): void\n {\n $this->lastSeen = new DateTime();\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function onRun()\n {\n $this->prepareWallStream();\n }", "protected function _afterInit() {\n\t}", "function start()\n\t{\n\t\t$this->score = 0;\n\t\t$this->won = false;\n\t\t$this->over = false;\n\t}", "function _on_initialize()\n {\n }", "public function __construct()\n {\n $this->_timeStart = (float)microtime(true); \n parent::__construct();\n }", "public function register()\n {\n register_tick_function([&$this, 'tick']);\n }", "public function start()\n {\n $this->_timeStartInMicroSeconds = microtime(true);\n }", "public function init()\n\t{ \n\t\t# Return if no countoff is needed\n\t\tif ($this->countoff<1) return;\n\t\t\n\t\t# initialize event array\n\t\t$this->events = array();\n\t\t\n\t\tif ($this->initRestTicks) {\n\t\t\t# Add a brief rest and then all notes off and all sound off to relevant channels here\n\t\t\tfor($ix=0; $ix<$this->track_total; $ix++) {\n\t\t\t\t$this->track_ix = $ix;\n\t\t\t\t\n\t\t\t\t# for all channels in this track\n\t\t\t\tforeach($this->channels[$this->track_ix] as $chan) {\n\t\t\t\t\t$this->addEvent(0,176+$chan,123,0);\n\t\t\t\t\t$this->addEvent(0,176+$chan,7,0);\n\t\t\t\t}\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,0);\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,$this->mVol);\n\t\t\t}\n\t\t}\n\t\t\n\t\t# Put in the initial countoff\n\t\tfor($i=0; $i<$this->timeSig; $i++) { \n\t\t\t$vol = ($i==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t\t\n\t\t# record where this track starts for looping purposes\n\t\t$this->loopStart[$this->track_ix] = count($this->events[$this->track_ix]);\n\t}", "private function init()\n {\n // get sync status object\n $this->currentStatus = $this->getObject();\n\n // if sum of last processed ids is then we can assume that we are doing \n // a new sync. So we want to clear old data files so we can make new ones.\n // if ($this->currentStatus->getLastCustomerId() == 0 \n // && $this->currentStatus->getLastOrderId() == 0\n // && $this->currentStatus->getLastSubscriptionId() == 0\n // )\n // Mage::helper('marketingsoftware/DataWriter')->clearDataFiles();\n\n // store start time for this event\n $this->startTime = microtime(true);\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "public function _on_initialize()\n {\n }", "private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function after_update() {}", "protected function afterUpdate() {\n\t}", "protected function initializeTimeTracker() {}", "public function __construct() {\n $this->time = time();\n }", "public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "protected function _after() {\n\t\t$this->startup = null;\n\t}", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "function PostInit()\n {\n }", "public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }", "public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }", "public function __construct() {\n\t\t$this->startTime = self::getMicrotime();\n\t}", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "public function onRun($tick) {\r\n\r\n switch($this->step) {\r\n\r\n case self::STEP_WAIT:\r\n\r\n if(count($this->getPlayers()) >= round($this->getMaxPlayers() * 0.75)) {\r\n\r\n $this->stepTick = $tick;\r\n\r\n $this->step = self::STEP_START;\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aGame will start in \" . $this->getWaitTime() . \" seconds.\");\r\n\r\n }\r\n\r\n }\r\n\r\n break;\r\n\r\n case self::STEP_START:\r\n\r\n $tickWaited = $tick - $this->stepTick;\r\n\r\n if($tickWaited % 20 == 0) {\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aGame will start in \" . ($this->getWaitTime() - ($tickWaited / 20)) . \" seconds.\");\r\n\r\n }\r\n\r\n }\r\n\r\n if($this->getWaitTime() - ($tickWaited / 20) <= 0) {\r\n\r\n $this->start();\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aGame started ! There is $this->seekersCount seekers and $this->hidersLeft hiders.\");\r\n\r\n if($p->HideAndSeekRole == self::ROLE_SEEK) {\r\n\r\n $p->teleport($this->getSeekersSpawn());\r\n\r\n } elseif($p->HideAndSeekRole == self::ROLE_HIDE) {\r\n\r\n $p->setNameTagAlwaysVisible(false);\r\n\r\n $p->setNameTagVisible(false);\r\n\r\n $p->teleport($this->getSpawn());\r\n\r\n $p->sendPopup(\"§lHider: You have 1 minute to hide yourself so seekers won't find you ! Don't get caught for \" . $this->getSeekTime() . \" minutes to win !\");\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n break;\r\n\r\n case self::STEP_HIDE:\r\n\r\n $tickWaited = $tick - $this->stepTick;\r\n\r\n if($tickWaited % (20*10) == 0) {\r\n\r\n $this->sendMessage(\"§aSeekers will be released in \" . (60 - ($tickWaited / 20)) . \" seconds !\");\r\n\r\n }\r\n\r\n if($tickWaited >= 20*60) { // One minute has past !\r\n\r\n $this->step = self::STEP_SEEK;\r\n\r\n $this->stepTick = $tick;\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aSeekers released !\");\r\n\r\n if($p->HideAndSeekRole == self::ROLE_SEEK) {\r\n\r\n $p->teleport($this->getSpawn());\r\n\r\n $p->sendMessage(\"§lSeeker: Seek the hiders ! Catch them all to win in \" . $this->getSeekTime() . \" minutes to win !\");\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n break;\r\n\r\n case self::STEP_SEEK:\r\n\r\n $tickWaited = $tick - $this->stepTick;\r\n\r\n if($tickWaited % (20*60) == 0) {\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aGame ends in \" . ($this->getSeekTime() - ($tickWaited / 20 / 60)) . \" minutes.\");\r\n\r\n }\r\n\r\n }\r\n\r\n if($tickWaited >= 20*60*$this->getSeekTime()) { // Seek time has past \r\n\r\n $this->win = self::WIN_HIDERS;\r\n\r\n $this->step = self::STEP_WIN;\r\n\r\n }\r\n\r\n break;\r\n\r\n case self::STEP_WIN:\r\n\r\n foreach(array_merge($this->getPlayers(), $this->getSpectators()) as $p) {\r\n\r\n if($this->win == self::WIN_SEEKERS) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aThe last hider got caught ! Seekers won !\");\r\n\r\n $p->sendTip(\"§a§lSeekers won !\");\r\n\r\n switch($p->HideAndSeekRole) {\r\n\r\n case self::ROLE_HIDE:\r\n\r\n $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), $this->getMain()->getConfig()->get(\"Losers command\"));\r\n\r\n break;\r\n\r\n case self::ROLE_NEW_SEEK:\r\n\r\n $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), $this->getMain()->getConfig()->get(\"Semi winners command\"));\r\n\r\n break;\r\n\r\n case self::ROLE_SEEK:\r\n\r\n $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), $this->getMain()->getConfig()->get(\"Winners command\"));\r\n\r\n break;\r\n\r\n }\r\n\r\n } elseif($this->win == self::WIN_HIDERS) {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aTimes up ! Hiders won !\");\r\n\r\n $p->sendTip(\"§a§lHiders won !\");\r\n\r\n switch($p->HideAndSeekRole) {\r\n\r\n case self::ROLE_SEEK:\r\n\r\n case self::ROLE_NEW_SEEK:\r\n\r\n $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), $this->getMain()->getConfig()->get(\"Losers command\"));\r\n\r\n break;\r\n\r\n case self::ROLE_HIDE:\r\n\r\n $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), $this->getMain()->getConfig()->get(\"Winners command\"));\r\n\r\n break;\r\n\r\n }\r\n\r\n } else {\r\n\r\n $p->sendMessage(Main::PREFIX . \"§aGame cancelled !\");\r\n\r\n }\r\n\r\n $p->HideAndSeekRole = self::ROLE_WAIT;\r\n\r\n $p->teleport($this->getMain()->getLobbyWorld()->getSafeSpawn());\r\n\r\n $p->setGamemode($this->getMain()->getServer()->getDefaultGamemode());\r\n\r\n }\r\n\r\n $this->players = [];\r\n\r\n $this->step = self::STEP_WAIT;\r\n\r\n break;\r\n\r\n }\r\n\r\n }", "private function startTimer()\n\t{\n\t\t// Keep statistics\n\t\tself::$totalCallCount++;\n\n\t\t// Rough execution time\n\t\t$this->startMicroStamp = microtime(true);\n\t}", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function init()\n {\n $this->_done = false;\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "public function postExecute() {\n\t\t// someone retrieves a bench value from \n\t\t// Benchmark class.\n\t}", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "protected function beforeFirstRound()\n {\n // TODO outsource this to Defender\n $this->antiAirAttack();\n $this->attacker->removeCasualties();\n $this->attacker->orderUnits();\n }", "protected function _preupdate() {\n }", "public function beforeLoop()\n {\n $this->createSavegame();\n }", "public function start()\n {\n $this->_marks = array();\n $this->mark('__start');\n }", "public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "public function run()\n\t{\n\t\t//\n\t}", "public function resetTimer()\r\n\t{\r\n\t\t$this->last = microtime(true);\r\n\t}", "function Net_FTP_Observer()\n {\n $this->_id = md5(microtime());\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function init()\n {\n // Nothing needs to be done initially, huzzah!\n }", "public function work() {\n\t\t$this->preLaunch();\n\n\t\t$this->currentTime = new Time($this->lastProcessingTime);\n\n\t\t$ticks = 0;\n\n\t\twhile(1) {\n\t\t\t$this->profileStart();\n\n\t\t\t$this->profile(\"Getting real-time sample\", __FILE__, __LINE__);\n\n\t\t\t// always get the realtime value\n\t\t\t$this->data->getAssetValueForTime(Time::now());\n\n\t\t\t$this->profile(\"Getting sample for running time\", __FILE__, __LINE__);\n\n\t\t\t// get the value we need right now\n\t\t\t$sample = $this->data->getAssetValueForTime($this->currentTime);\n\n\t\t\t$this->profileEndTask();\n\n\t\t\t$hasRun = $this->_process($this->currentTime, $sample);\n\n\t\t\t$this->profileStop();\n\n\t\t\tif ($this->currentTime->isNow() || $this->getShouldNotProcess()) {\n\t\t\t\t// Sleep for 1 second\n\t\t\t\tsleep(1);\n\n\t\t\t\t$ticks += 1;\n\t\t\t} else {\n\t\t\t\t// Sleep for 0.01 seconds\n\t\t\t\tusleep(1000000 * 0.01);\n\n\t\t\t\t$this->currentTime->add(1);\n\n\t\t\t\t$ticks += 0.5;\n\t\t\t}\n\n\t\t\tif ($ticks >= 15)\n\t\t\t{\n\t\t\t\t// This will first save our changes and then load any changed settings or state\n\t\t\t\t$this->data->saveAndReload();\n\n\t\t\t\t$ticks = 0;\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n {\n $this->local_time = time();\n }", "public function run()\n {\n /* this particular object won't run */\n }", "public function start()\n\t{\n\t\t// reset first, will start automaticly after a full reset\n\t\t$this->data->directSet(\"resetNeeded\", 1);\n\t}", "protected function _tick() \n\t{\n\t\t// Core maintenance processes, such as retrying failed messages.\n\t\tforeach ( $this->heldMessages as $key => $hm ) \n\t\t{\n\t\t\t$found = false;\n\n\t\t\tforeach ( $this->users as $currentUser ) \n\t\t\t{\n\t\t\t\tif ( $hm['user']->socket == $currentUser->socket ) \n\t\t\t\t{\n\t\t\t\t\t$found = true;\n\n\t\t\t\t\tif ( $currentUser->handshake ) \n\t\t\t\t\t{\n\t\t\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t\t\t\t$this->send($currentUser, $hm['message']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$found ) \n\t\t\t{\n\t\t\t\t// If they're no longer in the list of connected users, drop the message.\n\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t}\n\t\t}\n\t}", "function start() {\n if ($this->isLogging) {\n $this->tStart = gettimeofday();\n $this->tLast = $this->tStart;\n $this->log = \"<h1>Log: \" . $this->name . \"</h1>\\n<pre>Started: \" . gmdate(\"D, d M Y H:i:s T\", $this->tStart['sec']) . \"\\n &#916; Start ; &#916; Last ;\";\n\t\t\t$this->logLine(\"Start\");\n\t\t}\n }", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public function start()\n\t{\n\t\t$this->startTimer = microtime(TRUE);\n\t}", "public function _postSetup()\n {\n }", "public function onRun()\n {\n }", "public function onRun (int $currentTick)\n {\n if($this->isSpawn()) {\n $this->getPlayer()->teleport(new Position(0, 66, 0, $this->getPlugin()->getServer()->getDefaultLevel()), 0, 0);\n }\n $this->getPlayer()->kick($this->getMessage(), false);\n }", "function timer_float()\n {\n }", "private function init()\n\t{\n\t\treturn;\n\t}", "public function benchmarkStart()\n\t{\n\t\t$this->startTime = round(microtime(true) * 1000);\n\t}" ]
[ "0.7644413", "0.74994016", "0.7381115", "0.7328958", "0.671734", "0.6624", "0.6420672", "0.6263767", "0.607879", "0.5950114", "0.58703583", "0.58589536", "0.5776857", "0.57665145", "0.57451814", "0.5726494", "0.56353414", "0.5605798", "0.5583754", "0.5562012", "0.55467767", "0.55344266", "0.553213", "0.55313873", "0.5512618", "0.551016", "0.5478536", "0.5477163", "0.5471342", "0.546004", "0.5456176", "0.5456039", "0.5443096", "0.5443096", "0.5442748", "0.5441245", "0.54407513", "0.543604", "0.5429681", "0.54188865", "0.5417497", "0.5404921", "0.53460866", "0.53445125", "0.53445125", "0.5339734", "0.53333807", "0.5331266", "0.53306973", "0.53306973", "0.5316251", "0.52945215", "0.529432", "0.52908427", "0.52872056", "0.5273731", "0.5260824", "0.52598006", "0.52578723", "0.52515215", "0.52472115", "0.5246309", "0.5237612", "0.52359295", "0.52224797", "0.52224797", "0.5222028", "0.52169764", "0.52169764", "0.52166563", "0.52166563", "0.5212728", "0.52116364", "0.52116364", "0.52116364", "0.5208803", "0.5208278", "0.52012146", "0.5198072", "0.5196176", "0.51749814", "0.51543623", "0.51542073", "0.51526266", "0.51526266", "0.51526266", "0.51437324", "0.5139546", "0.51341474", "0.5129494", "0.51294476", "0.51283425", "0.5113369", "0.5107557", "0.51055306", "0.5103787", "0.51018155", "0.51004994", "0.5098374", "0.50950414", "0.5093516" ]
0.0
-1
Finalize the coroutine. This method is invoked after the coroutine is popped from the call stack.
public function finalize(StrandInterface $strand) { if ($this->timer) { $this->timer->cancel(); $this->timer = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function finalize() { }", "public function __finalize() {\n\t\t$this->flush_buffer();\n\t}", "protected function finalize() {\n // NOOP\n }", "protected function _finalize()\n\t{\n\t\t$this->_engine->callStage('_finalize');\n\t\t$this->setState($this->_engine->getState());\n\t}", "public function _finalize() {\n $this->calls = substr($this->calls, 1, -1);\n }", "public function finalize(): void;", "public function finalize(): void;", "public function finalize();", "abstract protected function _finalize();", "public function finalize() {\n $this->$this->getMessageBuilder()->finalize();\n }", "public function finalize()\n {\n list($usec, $sec) = explode(' ', microtime());\n $micro = sprintf(\"%06d\", (float) $usec * 1000000);\n $when = new \\DateTime(date('Y-m-d H:i:s.' . $micro));\n $when->setTimezone(new \\DateTimeZone('UTC'));\n $this->finalTime = $when->format('Y-m-d\\TH:i:s.u\\Z');\n $this->isFinalState = true;\n }", "protected function finalize(): void\n {\n $this->fire(WorkerDoneEvent::class);\n\n Log::debug(sprintf('Worker [%s] finalized.', $this->getAttribute('id')));\n }", "public function finished()\n {\n }", "public function finalize()\n {\n $this->final = TRUE;\n return $this;\n }", "private function finalize()\n {\n $this->temp_files_path[] = L_FRAME_LIST_FILE;\n $this->delete_files();\n }", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public static function destroy()\n {\n $coroutineId = self::getCoroutineId();\n if (isset(self::$context[$coroutineId])) {\n unset(self::$context[$coroutineId]);\n }\n }", "protected function complete()\n {\n parent::complete();\n }", "public function end() {}", "public function end() {}", "public function end() {}", "protected function finish() {}", "public function complete();", "public function complete();", "public function completed() {\n\t}", "public function finalize()\n {\n //Can be used for cleaning up stuff after action execution\n return true;\n }", "private function finalize() {\n $this->_log_queries[] = $this->_active_query;\n $this->_active_query = empty($this->_hold_queries) ? NULL : array_pop($this->_hold_queries);\n }", "public function finaliza()\n {\n $this -> estadoAtual -> finaliza($this);\n }", "public function finish()\n {\n if($this->img)\n {\n imagedestroy($this->img);\n $this->img = null;\n }\n }", "public function finalize()\n {\n $javaScript = $this->onDocumentReady();\n if ($javaScript) {\n WebPage::singleton()->addJavaScript($javaScript, null, true);\n }\n }", "public function finish()\n\t{\n\t\t\n\t}", "public function finish() {\r\n\t}", "public function onCompleted(ProxyEvent $event){\r\n\t\tif($this->stream){\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "protected function finalize()\n {\n if (!$this->booted) {\n $this->boot();\n }\n $this->boot($this);\n\n // Set header for OPTIONS and all other routes\n if ($this['router']->getCurrentRoute()) {\n $this['response']->setHeader(\n 'Access-Control-Allow-Methods',\n implode(\n \", \",\n $this['router']->getMethodsAvailable(\n $this['router']->getCurrentRoute()->getPattern()\n )\n )\n );\n }\n\n if (!$this->responded) {\n $this->responded = true;\n\n // Encrypt CookieJar\n if ($this['settings']['cookie::encrypt']) {\n $this['response']->encryptCookies($this['crypt']);\n }\n\n // Send response\n $this['response']->finalize($this['request'])->send();\n }\n }", "public function finish(): void\n {\n }", "public function complete()\n {\n $this->restoreWorkingDirectory();\n $this->deleteTmpDir();\n }", "public function __destruct()\n {\n if ($this->initializer === 0 || $this->initializer !== \\getmypid()) {\n return;\n }\n\n if (!$this->queue) {\n return;\n }\n\n /** @psalm-suppress InvalidArgument */\n if (!\\msg_queue_exists($this->key)) {\n return;\n }\n\n /** @psalm-suppress InvalidArgument */\n \\msg_remove_queue($this->queue);\n }", "public function shutdown() {\n\t\t$this->objectContainer->shutdown();\n\t}", "public function Finish()\r\n {\r\n $bitLength = $this->LeftRotateLong($this->byteCount , 3);\r\n //\r\n // add the pad bytes.\r\n //\r\n $this->Update(128);\r\n\r\n while ($this->xBufOff != 0) $this->Update(0);\r\n $this->ProcessLength($bitLength);\r\n $this->ProcessBlock();\r\n }", "public function clearFinished();", "protected function finalize(InputInterface $input, OutputInterface $output)\n {\n }", "public function __destruct() {\n // scope of a foreach) but it has not reached its end, we must sync\n // the client with the queued elements that have not been read from\n // the connection with the server.\n $this->sync();\n }", "public function end()\n {\n }", "public function __destruct()\n {\n if ($this->handle !== null) {\n $this->processRunner->destroy($this->handle);\n }\n }", "protected function tearDownAsync()\n {\n \\gc_collect_cycles();\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "function __destruct() {\r\n $this->Initialize();\r\n }", "public function __destruct()\n {\n $this->send();\n }", "public function __destruct() {\n\t\t$this->stopRinging();\n\t}", "public function finalize() {\n // Invoke plugin finalize.\n if (method_exists($this->tfaValidationPlugin, 'finalize')) {\n $this->tfaValidationPlugin->finalize();\n }\n // Allow login plugins to act during finalization.\n if (!empty($this->tfaLoginPlugins)) {\n foreach ($this->tfaLoginPlugins as $plugin) {\n if (method_exists($plugin, 'finalize')) {\n $plugin->finalize();\n }\n }\n }\n }", "public function visitEnd()\n {\n if (($this->cv != null)) {\n $this->cv->visitEnd();\n }\n }", "public function __destruct()\n {\n unset($this->queue);\n }", "public function __destruct() {\n $this->send();\n }", "public function completeFlow();", "public function __destruct()\n {\n $this->clear();\n }", "public function __destruct()\n {\n $this->clear();\n }", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "protected function garbageCollect()\n {\n \n }", "function __destruct() {\n if(!$this->payload_is_sent) $this->sendPayload();\n\n\n }", "public function __destruct () {\n \n }", "public function __destruct() {\n\n //echo ' was destroyed' . PHP_EOL;\n }", "public function end(): void\n {\n }", "function __destruct() {\n\t\tfputs($this->conn, 'QUIT' . $this->newline);\n\t\t$this->getServerResponse();\n\t\tfclose($this->conn);\n\t}", "protected function finalize()\n\t{\n\t\t$presenter = $this->getPresenter();\n\n\t\tif ($this->presenter->isAjax()) {\n\n\t\t\t$presenter->payload->snippets = array();\n\n\t\t\t$html = $this->__toString();\n\n\t\t\t// Remove snippet-div to emulate native snippets... No extra support on client side is needed...\n\t\t\t$snippet = 'snippet-' . $this->getUniqueId() . '-grid';\n\t\t\t$start = strlen('<div id=\"' . $snippet . '\">');\n\t\t\t$stop = -strlen('</div>');\n\t\t\t$html = trim(mb_substr($html, $start, $stop));\n\n\t\t\t// Send snippet\n\t\t\t$presenter->payload->snippets[$snippet] = $html;\n\t\t\t$presenter->sendPayload();\n\t\t\t$presenter->terminate();\n\n\t\t} else {\n\n\t\t\t$presenter->redirect('this');\n\t\t}\n\t}", "public function __destruct()\n {\n if (isset($this->__client)) {\n $this->__client->unref($this->__java);\n }\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "public function __destruct() {\n try {\n $this->release();\n }\n catch (\\Throwable $ex) { throw ErrorHandler::handleDestructorException($ex); }\n catch (\\Exception $ex) { throw ErrorHandler::handleDestructorException($ex); }\n }", "protected function _after()\n {\n unset($this->image);\n parent::_after();\n }", "public function registerFinalize(): void\n\t{\n\t\tif (!$this->isFinaliseInit)\n\t\t{\n\t\t\t$this->isFinaliseInit = true;\n\t\t\tApplication::getInstance()->addBackgroundJob([__CLASS__, 'runFinalize']);\n\t\t}\n\t}", "function completeCallback()\r\n { }", "protected function _after() {\n\t\t$this->startup = null;\n\t}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function __destruct()\n {\n unset($this->stepCount);\n parent::__destruct();\n }", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}" ]
[ "0.7027825", "0.69926697", "0.68124545", "0.67885053", "0.66749555", "0.66300815", "0.66300815", "0.65752995", "0.655043", "0.6361448", "0.6342267", "0.6305438", "0.6148988", "0.612323", "0.60401314", "0.6033174", "0.6032416", "0.6032416", "0.6032416", "0.6032416", "0.6032416", "0.60323906", "0.6032378", "0.5910535", "0.5906759", "0.5869325", "0.5869325", "0.5869325", "0.58671856", "0.5780667", "0.5780667", "0.576449", "0.57616955", "0.5680432", "0.5668768", "0.56544054", "0.56435347", "0.56093913", "0.5608922", "0.55830574", "0.5567298", "0.55628675", "0.5512901", "0.5484586", "0.54658574", "0.54607964", "0.54553884", "0.5430759", "0.54208827", "0.5394209", "0.5393527", "0.53648823", "0.53607786", "0.53607786", "0.5360744", "0.5356166", "0.5354594", "0.535402", "0.5350658", "0.5345258", "0.5344448", "0.53417563", "0.53413373", "0.53413373", "0.53387505", "0.5331033", "0.5318103", "0.5316172", "0.531227", "0.5310662", "0.53054845", "0.52948475", "0.52882546", "0.5286227", "0.5286227", "0.5286227", "0.52788204", "0.5275016", "0.5273924", "0.5268806", "0.52637917", "0.5256839", "0.5256839", "0.5256839", "0.5256839", "0.5256839", "0.5256839", "0.5256839", "0.52566195", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046", "0.52553046" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->insert([ [ '_id' => new ObjectID('60265ff45737000029000978'), 'role_id' => '6028f7713e320000f40026bd', 'school_id' => '60264978b22e00009a006436', 'ern' => '12345saple', 'phone' => '1234Phone', 'name' => 'Thom-thom', 'fname' => 'Thomas Emmanuel', 'mname_id' => 5, 'mname_id' =>1484, 'lname_id' => 235, 'suffix' => 'III', 'email_verified_at' => '2020-05-16', 'address' => json_decode('{ "country":"Philippines", "region":"REGION I (ILOCOS REGION)", "province":"ILOCOS NORTE", "municipality":"ADAMS", "brgy":"Adams (Pob.)" }'), 'email' => '[email protected]', 'password' => Hash::make('password'), 'academic' => json_decode('{"school":"NEUST", "code":"05689", "address":"Cabanatuan", "category":"Private", "religion":"Catholic", "sy":"2018-2019"}'), //Academic Information 'platforms' => [ 'aEnrollment', 'aAdmission', 'aHeadquarter', 'aSF', 'aLibrary', 'aPageant', 'aInventory', 'aAccounting', 'aAttendance', 'aTracking', 'aGAA', 'aPoll', 'aTabulation', 'aForbidden' ], 'currentApp' => 'aHeadquarter' ], [ '_id' => new ObjectID('60265ff4573700002900097a'), 'role_id' => '6028f7713e320000f40026be', 'school_id' => '60264978b22e00009a006436', 'ern' => '6789', 'name' => 'Benedict', 'fname' => 'Benedict Earle Gabriel', 'mname_id' =>1484, 'lname_id' => 1321, 'email_verified_at' => '2020-05-16', 'email' => '[email protected]', 'password' => Hash::make('password'), 'position' => 'Superadmin', 'address' => json_decode('{ "country":"Philippines", "region":"REGION I (ILOCOS REGION)", "province":"ILOCOS NORTE", "municipality":"ADAMS", "brgy":"Adams (Pob.)" }'), // Permanent Address 'platforms' => [ 'aHeadquarter', 'aEnrollment', 'aAdmission', 'aSF', 'aLibrary', 'aPageant', 'aAttendance', 'aInventory', 'aAccounting', 'aTracking', 'aGAA', 'aPoll', 'aTabulation' ], 'currentApp' => 'aHeadquarter', 'profile' =>'Benedict Earle Gabriel.png' ], [ '_id' => new ObjectID('60265ff4573700002900097b'), 'role_id' => '6028f7713e320000f40026bf', 'school_id' => '60264978b22e00009a006436', 'empNum' => 100010151, 'name' => 'Thom', 'fname' => 'Thomas', 'mname_id' =>1484, 'lname_id' => 356, 'email_verified_at' => '2020-05-16', 'email' => '[email protected]', 'password' => Hash::make('password'), 'position' => 'Admin', 'address' => json_decode('{ "country":"Philippines", "region":"REGION I (ILOCOS REGION)", "province":"ILOCOS NORTE", "municipality":"ADAMS", "brgy":"Adams (Pob.)" }'), // Permanent Address 'platforms' => [ 'aHeadquarter', 'aEnrollment', 'aAdmission', 'aSF', 'aLibrary', 'aPageant', 'aAttendance', 'aInventory', 'aAccounting', 'aTracking', 'aGAA', 'aPoll', 'aTabulation' ], 'currentApp' => 'aHeadquarter', 'profile' =>'Thomas.png' ], [ '_id' => new ObjectID('60718bbdde580000250050ce'), 'role_id' => '6028f7713e320000f40026c0', 'school_id' => '60264978b22e00009a006436', 'empNum' => 100010152, 'name' => 'Channey', 'fname' => 'Channey Y\'dreo', 'lname_id' => 1156, 'mname_id' =>181, 'email_verified_at' => '2020-05-16', 'email' => '[email protected]', 'password' => Hash::make('password'), 'position' => 'Principal II', 'address' => json_decode('{ "country":"Philippines", "region":"REGION I (ILOCOS REGION)", "province":"ILOCOS NORTE", "municipality":"ADAMS", "brgy":"Adams (Pob.)" }'), // Permanent Address 'platforms' => [ 'aHeadquarter', 'aEnrollment', 'aAdmission', 'aSF', 'aLibrary', 'aPageant', 'aAttendance', 'aInventory', 'aAccounting', 'aTracking', 'aGAA', 'aPoll', 'aTabulation' ], 'currentApp' => 'aHeadquarter', 'profile' =>'Channey Y\'dreo.jpg' ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index() { $resultados = DB::table('resultados')->get(); return view('resultado.index', compact('resultados')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('resultado.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { if($request->actualizar){ //$salidas = NotaVenta::where('fecha', '>=', $request->fechaInicial)->where('fecha', '<=', $request->fechaFinal)->get(); // return view('resultado.show', compact('salidas')); return view('resultado.show'); //return "hola"; } $salidas = NotaVenta::where('fecha', '>=', $request->fechaInicial)->where('fecha', '<=', $request->fechaFinal)->get(); // Resultado::create([ // 'nombre'=> $request->nombre, // 'fecha' => date('Y/m/d'), // 'hora' => date('H:i:s'), // ]); // $ventas = DB::table('nota_compras')->get(); // $compras = DB::table('nota_ventas')->get(); // //, compact('salidas', 'compras', 'ventas') return $salidas; // return "darwin"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Resultado $resultado) { return view('resultado.show' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Resultado $resultado) { return view('resultado.edit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Resultado $resultado) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Resultado $resultado) { $resultado->delete(); return redirect()->route('resultados.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Test that the sanitized css matches a known good version
public function test_css_was_sanitized() { $unsanitized_css = file_get_contents( __DIR__ . '/unsanitized.css' ); $known_good_sanitized_css = file_get_contents( __DIR__ . '/sanitized.css' ); $maybe_sanitized_css = sanitize_unsafe_css( $unsanitized_css ); $this->assertEquals( $maybe_sanitized_css, $known_good_sanitized_css ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function safecss_filter_attr($css, $deprecated = '')\n {\n }", "function cleanStyleInformation($string) {\r\n\t\t$string = str_replace('&nbsp;', ' ', $string);\r\n\t\t$string = str_replace('&quot;', \"'\", $string);\r\n\t\t$string = ReTidy::decode_for_DOM_character_entities($string);\r\n\t\t/* // 2011-11-28\r\n\t\tpreg_match_all('/&[\\w#x0-9]+;/is', $string, $character_entity_matches);\r\n\t\tforeach($character_entity_matches[0] as $character_entity_match) {\r\n\t\t\t//$decoded = html_entity_decode($character_entity_match);\r\n\t\t\tif(strpos($decoded, \";\") === false) {\r\n\t\t\t\t$string = str_replace($character_entity_match, $decoded, $string);\r\n\t\t\t} else { // then we still have a problem\r\n\t\t\t\tprint(\"did not properly decode HTML character entity in style attribute4892589435: <br>\\r\\n\");var_dump($decoded);print(\"<br>\\r\\n\");var_dump($string);print(\"<br>\\r\\n\");exit(0);\r\n\t\t\t}\r\n\t\t}*/\r\n\t\t$string = preg_replace('/\\/\\*.*\\*\\//s', '', $string);\r\n\t\t// the above could already be taken care of\r\n\t\t$string = preg_replace('/\\s*;\\s*/s', '; ', $string);\r\n\t\t$string = preg_replace('/\\s*:\\s*/s', ': ', $string);\r\n\t\t// pseudo-elements...\r\n\t\t$string = preg_replace('/\\s*:\\s*(\\w*)\\s*\\{([^\\{\\}]*)\\}/s', ' :$1 {$2};', $string);\r\n\t\t// we would probably like to force a format on things like media rules here also\r\n\t\t$string = preg_replace('/\\r\\n/', ' ', $string);\r\n\t\t$string = preg_replace('/\\s+/', ' ', $string);\r\n\t\t$string = trim($string);\r\n\t\t$string = ReTidy::delete_empty_styles($string);\r\n\t\t$string = ReTidy::ensureStyleInformationBeginsProperly($string);\r\n\t\t$string = ReTidy::ensureStyleInformationEndsProperly($string);\r\n\t\treturn $string;\r\n\t}", "public function testPreprocessCssFail() {\n $eval1 = <<<EOT\n\\$config = \\\\Drupal::configFactory()->getEditable('system.performance');\n\\$config->set('css.preprocess', FALSE);\n\\$config->save();\nEOT;\n $this->drush('php-eval', array($eval1), $this->options);\n $this->drush('audit-cache', array(), $this->options + array(\n 'detail' => NULL,\n 'json' => NULL,\n ));\n $output = json_decode($this->getOutput());\n $this->assertEquals(\\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL, $output->checks->SiteAuditCheckCachePreprocessCss->score);\n }", "private function proxify_css($str){\r\n\t\t\r\n\t\t// The HTML5 standard does not require quotes around attribute values.\r\n\t\t\r\n\t\t// if {1} is not there then youtube breaks for some reason\r\n\t\t$str = preg_replace_callback('@[^a-z]{1}url\\s*\\((?:\\'|\"|)(.*?)(?:\\'|\"|)\\)@im', array($this, 'css_url'), $str);\r\n\t\t\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/CSS/@import\r\n\t\t// TODO: what about @import directives that are outside <style>?\r\n\t\t$str = preg_replace_callback('/@import (\\'|\")(.*?)\\1/i', array($this, 'css_import'), $str);\r\n\t\t\r\n\t\treturn $str;\r\n\t}", "function makeSafeForCss($className) {\n $cleanName = preg_replace('/\\W+/','',strtolower($className));\n return $cleanName;\n }", "function minify_css($input) {\n if(trim($input) === \"\") return $input;\n return preg_replace(\n array(\n // Remove comment(s)\n '#(\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\')|\\/\\*(?!\\!)(?>.*?\\*\\/)|^\\s*|\\s*$#s',\n // Remove unused white-space(s)\n '#(\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\'|\\/\\*(?>.*?\\*\\/))|\\s*+;\\s*+(})\\s*+|\\s*+([*$~^|]?+=|[{};,>~+]|\\s*+-(?![0-9\\.])|!important\\b)\\s*+|([[(:])\\s++|\\s++([])])|\\s++(:)\\s*+(?!(?>[^{}\"\\']++|\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\')*+{)|^\\s++|\\s++\\z|(\\s)\\s+#si',\n // Replace `0(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)` with `0`\n '#(?<=[\\s:])(0)(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)#si',\n // Replace `:0 0 0 0` with `:0`\n '#:(0\\s+0|0\\s+0\\s+0\\s+0)(?=[;\\}]|\\!important)#i',\n // Replace `background-position:0` with `background-position:0 0`\n '#(background-position):0(?=[;\\}])#si',\n // Replace `0.6` with `.6`, but only when preceded by `:`, `,`, `-` or a white-space\n '#(?<=[\\s:,\\-])0+\\.(\\d+)#s',\n // Minify string value\n '#(\\/\\*(?>.*?\\*\\/))|(?<!content\\:)([\\'\"])([a-z_][a-z0-9\\-_]*?)\\2(?=[\\s\\{\\}\\];,])#si',\n '#(\\/\\*(?>.*?\\*\\/))|(\\burl\\()([\\'\"])([^\\s]+?)\\3(\\))#si',\n // Minify HEX color code\n '#(?<=[\\s:,\\-]\\#)([a-f0-6]+)\\1([a-f0-6]+)\\2([a-f0-6]+)\\3#i',\n // Replace `(border|outline):none` with `(border|outline):0`\n '#(?<=[\\{;])(border|outline):none(?=[;\\}\\!])#',\n // Remove empty selector(s)\n '#(\\/\\*(?>.*?\\*\\/))|(^|[\\{\\}])(?:[^\\s\\{\\}]+)\\{\\}#s'\n ),\n array(\n '$1',\n '$1$2$3$4$5$6$7',\n '$1',\n ':0',\n '$1:0 0',\n '.$1',\n '$1$3',\n '$1$2$4$5',\n '$1$2$3',\n '$1:0',\n '$1$2'\n ),\n $input);\n}", "function minify_css($input)\n {\n if (trim($input) === \"\")\n {\n return $input;\n }\n\n return preg_replace(\n array(\n // Remove comment(s)\n '#(\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\')|\\/\\*(?!\\!)(?>.*?\\*\\/)|^\\s*|\\s*$#s',\n // Remove unused white-space(s)\n '#(\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\'|\\/\\*(?>.*?\\*\\/))|\\s*+;\\s*+(})\\s*+|\\s*+([*$~^|]?+=|[{};,>~+]|\\s*+-(?![0-9\\.])|!important\\b)\\s*+|([[(:])\\s++|\\s++([])])|\\s++(:)\\s*+(?!(?>[^{}\"\\']++|\"(?:[^\"\\\\\\]++|\\\\\\.)*+\"|\\'(?:[^\\'\\\\\\\\]++|\\\\\\.)*+\\')*+{)|^\\s++|\\s++\\z|(\\s)\\s+#si',\n // Replace `0(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)` with `0`\n '#(?<=[\\s:])(0)(cm|em|ex|in|mm|pc|pt|px|vh|vw|%)#si',\n // Replace `:0 0 0 0` with `:0`\n '#:(0\\s+0|0\\s+0\\s+0\\s+0)(?=[;\\}]|\\!important)#i',\n // Replace `background-position:0` with `background-position:0 0`\n '#(background-position):0(?=[;\\}])#si',\n // Replace `0.6` with `.6`, but only when preceded by `:`, `,`, `-` or a white-space\n '#(?<=[\\s:,\\-])0+\\.(\\d+)#s',\n // Minify string value\n '#(\\/\\*(?>.*?\\*\\/))|(?<!content\\:)([\\'\"])([a-z_][a-z0-9\\-_]*?)\\2(?=[\\s\\{\\}\\];,])#si',\n '#(\\/\\*(?>.*?\\*\\/))|(\\burl\\()([\\'\"])([^\\s]+?)\\3(\\))#si',\n // Minify HEX color code\n '#(?<=[\\s:,\\-]\\#)([a-f0-6]+)\\1([a-f0-6]+)\\2([a-f0-6]+)\\3#i',\n // Replace `(border|outline):none` with `(border|outline):0`\n '#(?<=[\\{;])(border|outline):none(?=[;\\}\\!])#',\n // Remove empty selector(s)\n '#(\\/\\*(?>.*?\\*\\/))|(^|[\\{\\}])(?:[^\\s\\{\\}]+)\\{\\}#s'\n ),\n array(\n '$1',\n '$1$2$3$4$5$6$7',\n '$1',\n ':0',\n '$1:0 0',\n '.$1',\n '$1$3',\n '$1$2$4$5',\n '$1$2$3',\n '$1:0',\n '$1$2'\n ),\n $input);\n }", "public function testPreprocessCssPass() {\n $eval1 = <<<EOT\n\\$config = \\\\Drupal::configFactory()->getEditable('system.performance');\n\\$config->set('css.preprocess', TRUE);\n\\$config->save();\nEOT;\n $this->drush('php-eval', array($eval1), $this->options);\n $this->drush('audit-cache', array(), $this->options + array(\n 'detail' => NULL,\n 'json' => NULL,\n ));\n $output = json_decode($this->getOutput());\n $this->assertEquals(\\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS, $output->checks->SiteAuditCheckCachePreprocessCss->score);\n }", "public function testsanitizeStrict()\n {\n $input = 'test87';\n\t$output = sanitizeStrict($input);\n\t\n $this->assertEquals( $output , 'test87' , 'fail sanitizeStrict '.$input);\n// asserting that the regex block other characters on the two next tests\n\t$input = 'test&';\n\t$output = sanitizeStrict($input);\n\t\n $this->assertEquals( $output , 'test' , 'fail sanitizeStrict '.$input);\n\n\t\n $input = 'test#';\n\t$output = sanitizeStrict($input);\n\t\n $this->assertEquals( $output , 'test' , 'fail sanitizeStrict '.$input);\t\n\t\n\treturn false;\n }", "public static function sanitizeCSS($css)\n {\n $css = preg_replace('/(?<![a-z0-9\\-\\_\\#\\.])body(?![a-z0-9\\-\\_])/i', '.body', $css);\n\n //\n // Inspired by http://stackoverflow.com/a/5209050/1721527, dleavitt <https://stackoverflow.com/users/362110/dleavitt>\n //\n\n // Create a new configuration object\n $config = HTMLPurifier_Config::createDefault();\n $config->set('Filter.ExtractStyleBlocks', true);\n $config->set('CSS.AllowImportant', true);\n $config->set('CSS.AllowTricky', true);\n $config->set('CSS.Trusted', true);\n\n // Create a new purifier instance\n $purifier = new HTMLPurifier($config);\n\n // Wrap our CSS in style tags and pass to purifier.\n // we're not actually interested in the html response though\n $purifier->purify('<style>'.$css.'</style>');\n\n // The \"style\" blocks are stored seperately\n $css = $purifier->context->get('StyleBlocks');\n\n // Get the first style block\n return count($css) ? $css[0] : '';\n }", "function bdpp_validate_css_settings( $input ) {\n\n\t$input['custom_css'] = isset($input['custom_css']) ? sanitize_textarea_field( $input['custom_css'] ) : '';\n\n\treturn $input;\n}", "function fabric_clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "public function it_can_be_sanitized()\n {\n $this->markTestSkipped('Sanitization is not implemented yet.');\n }", "public function testAllowedValues()\n {\n $string = $this->basicSanitizer->sanitize('<a href=\"#\" title=\"four\">hey</a>');\n $this->assertEquals('<a href=\"#\">hey</a>', $string);\n }", "function clean_style_tag( $input ) {\n\t$link = \"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\";\n\tpreg_match_all( $link, $input, $matches );\n\tif ( empty( $matches[2] ) ) {\n\t\treturn $input;\n\t}\n\n\t// Only display media if it is meaningful\n\t$media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n\n\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n if (empty($matches[2])) {\n return $input;\n }\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function fs_clean_style_tag( $input ) {\r\n\tpreg_match_all( \"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches );\r\n\t// Only display media if it's print\r\n\t$media = $matches[3][0] === 'print' ? ' media=\"print\"' : '';\r\n\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\r\n}", "function clean_style_tag($input) {\n preg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n if (empty($matches[2])) {\n return $input;\n }\n // Only display media if it is meaningful\n $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n return '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n}", "function hatch_custom_css_sanitize( $setting, $object ) {\n\n\tif ( 'hatch_custom_css' == $object->id )\n\t\t$setting = wp_filter_nohtml_kses( $setting );\n\n\treturn $setting;\n}", "public function xssClean($str)\r\n\t{\r\n\t\t$str = preg_replace('/\\0+/', '', $str);\r\n\t\t$str = preg_replace('/(\\\\\\\\0)+/', '', $str);\r\n\r\n\t\t/*\r\n\t\t * Validate standard character entities\r\n\t\t *\r\n\t\t * Add a semicolon if missing. We do this to enable\r\n\t\t * the conversion of entities to ASCII later.\r\n\t\t *\r\n\t\t */\r\n\t\t$str = preg_replace('#(&\\#?[0-9a-z]+)[\\x00-\\x20]*;?#i', \"\\\\1;\", $str);\r\n\t\t\r\n\t\t/*\r\n\t\t * Validate UTF16 two byte encoding (x00) \r\n\t\t *\r\n\t\t * Just as above, adds a semicolon if missing.\r\n\t\t *\r\n\t\t */\r\n\t\t$str = preg_replace('#(&\\#x?)([0-9A-F]+);?#i',\"\\\\1\\\\2;\",$str);\r\n\r\n\t\t/*\r\n\t\t * URL Decode\r\n\t\t *\r\n\t\t * Just in case stuff like this is submitted:\r\n\t\t *\r\n\t\t * <a href=\"http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D\">Google</a>\r\n\t\t *\r\n\t\t * Note: Use rawurldecode() so it does not remove plus signs\r\n\t\t *\r\n\t\t */\t\r\n\t\t$str = rawurldecode($str);\r\n\r\n\t\t/*\r\n\t\t * Convert character entities to ASCII \r\n\t\t *\r\n\t\t * This permits our tests below to work reliably.\r\n\t\t * We only convert entities that are within tags since\r\n\t\t * these are the ones that will pose security problems.\r\n\t\t *\r\n\t\t */\r\n\t\tif (preg_match_all(\"/[a-z]+=([\\'\\\"]).*?\\\\1/si\", $str, $matches))\r\n\t\t{ \r\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++)\r\n\t\t\t{\r\n\t\t\t\tif (stristr($matches[0][$i], '>'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$str = str_replace(\t$matches['0'][$i], \r\n\t\t\t\t\t\t\t\t\t\tstr_replace('>', '&lt;', $matches[0][$i]), \r\n\t\t\t\t\t\t\t\t\t\t$str);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n if (preg_match_all(\"/<([\\w]+)[^>]*>/si\", $str, $matches))\r\n { \r\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++)\r\n\t\t\t{\r\n\t\t\t\t$str = str_replace($matches[0][$i], \r\n\t\t\t\t\t\t\t\t\t$this->_html_entity_decode($matches[0][$i]), \r\n\t\t\t\t\t\t\t\t\t$str);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Convert all tabs to spaces\r\n\t\t *\r\n\t\t * This prevents strings like this: ja\tvascript\r\n\t\t * NOTE: we deal with spaces between characters later.\r\n\t\t * NOTE: preg_replace was found to be amazingly slow here on large blocks of data,\r\n\t\t * so we use str_replace.\r\n\t\t *\r\n\t\t */\r\n\t\t \r\n\t\t$str = str_replace(\"\\t\", \" \", $str);\r\n\r\n\t\t/*\r\n\t\t * Not Allowed Under Any Conditions\r\n\t\t */\t\r\n\t\t$bad = array(\r\n\t\t\t\t\t\t'document.cookie'\t=> '[removed]',\r\n\t\t\t\t\t\t'document.write'\t=> '[removed]',\r\n\t\t\t\t\t\t'.parentNode'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'.innerHTML'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'window.location'\t=> '[removed]',\r\n\t\t\t\t\t\t'-moz-binding'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'<!--'\t\t\t\t=> '&lt;!--',\r\n\t\t\t\t\t\t'-->'\t\t\t\t=> '--&gt;',\r\n\t\t\t\t\t\t'<!CDATA['\t\t\t=> '&lt;![CDATA['\r\n\t\t\t\t\t);\r\n\r\n\t\tforeach ($bad as $key => $val)\r\n\t\t{\r\n\t\t\t$str = str_replace($key, $val, $str); \r\n\t\t}\r\n\r\n\t\t$bad = array(\r\n\t\t\t\t\t\t\"javascript\\s*:\"\t=> '[removed]',\r\n\t\t\t\t\t\t\"expression\\s*\\(\"\t=> '[removed]', // CSS and IE\r\n\t\t\t\t\t\t\"Redirect\\s+302\"\t=> '[removed]'\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\tforeach ($bad as $key => $val)\r\n\t\t{\r\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str); \r\n\t\t}\r\n\t\r\n\t\t/*\r\n\t\t * Makes PHP tags safe\r\n\t\t *\r\n\t\t * Note: XML tags are inadvertently replaced too:\r\n\t\t *\r\n\t\t *\t<?xml\r\n\t\t *\r\n\t\t * But it doesn't seem to pose a problem.\r\n\t\t *\r\n\t\t */\t\t\r\n\t\t$str = str_replace(array('<?php', '<?PHP', '<?', '?'.'>'), array('&lt;?php', '&lt;?PHP', '&lt;?', '?&gt;'), $str);\r\n\t\r\n\t\t/*\r\n\t\t * Compact any exploded words\r\n\t\t *\r\n\t\t * This corrects words like: j a v a s c r i p t\r\n\t\t * These words are compacted back to their correct state.\r\n\t\t *\r\n\t\t */\t\t\r\n\t\t$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');\r\n\t\tforeach ($words as $word)\r\n\t\t{\r\n\t\t\t$temp = '';\r\n\t\t\tfor ($i = 0; $i < strlen($word); $i++)\r\n\t\t\t{\r\n\t\t\t\t$temp .= substr($word, $i, 1).\"\\s*\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// We only want to do this when it is followed by a non-word character\r\n\t\t\t// That way valid stuff like \"dealer to\" does not become \"dealerto\"\r\n\t\t\t$str = preg_replace('#('.substr($temp, 0, -3).')(\\W)#ise', \"preg_replace('/\\s+/s', '', '\\\\1').'\\\\2'\", $str);\r\n\t\t}\r\n\t\r\n\t\t/*\r\n\t\t * Remove disallowed Javascript in links or img tags\r\n\t\t */\r\n\t\tdo\r\n\t\t{\r\n\t\t\t$original = $str;\r\n\t\t\t\r\n\t\t\tif ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && stripos($str, '</a>') !== FALSE) OR \r\n\t\t\t\t preg_match(\"/<\\/a>/i\", $str))\r\n\t\t\t{\r\n\t\t\t\t$str = preg_replace_callback(\"#<a.*?</a>#si\", array($this, '_js_link_removal'), $str);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && stripos($str, '<img') !== FALSE) OR \r\n\t\t\t\t preg_match(\"/img/i\", $str))\r\n\t\t\t{\r\n\t\t\t\t$str = preg_replace_callback(\"#<img.*?\".\">#si\", array($this, '_js_img_removal'), $str);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && (stripos($str, 'script') !== FALSE OR stripos($str, 'xss') !== FALSE)) OR\r\n\t\t\t\t preg_match(\"/(script|xss)/i\", $str))\r\n\t\t\t{\r\n\t\t\t\t$str = preg_replace(\"#</*(script|xss).*?\\>#si\", \"\", $str);\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile($original != $str);\r\n\t\t\r\n\t\tunset($original);\r\n\r\n\t\t/*\r\n\t\t * Remove JavaScript Event Handlers\r\n\t\t *\r\n\t\t * Note: This code is a little blunt. It removes\r\n\t\t * the event handler and anything up to the closing >,\r\n\t\t * but it's unlikely to be a problem.\r\n\t\t *\r\n\t\t */\t\t\r\n\t\t$event_handlers = array('onblur','onchange','onclick','onfocus','onload','onmouseover','onmouseup','onmousedown','onselect','onsubmit','onunload','onkeypress','onkeydown','onkeyup','onresize', 'xmlns');\r\n\t\t$str = preg_replace(\"#<([^>]+)(\".implode('|', $event_handlers).\")([^>]*)>#iU\", \"&lt;\\\\1\\\\2\\\\3&gt;\", $str);\r\n\t\r\n\t\t/*\r\n\t\t * Sanitize naughty HTML elements\r\n\t\t *\r\n\t\t * If a tag containing any of the words in the list\r\n\t\t * below is found, the tag gets converted to entities.\r\n\t\t *\r\n\t\t * So this: <blink>\r\n\t\t * Becomes: &lt;blink&gt;\r\n\t\t *\r\n\t\t */\t\t\r\n\t\t$str = preg_replace('#<(/*\\s*)(alert|applet|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|xml|xss)([^>]*)>#is', \"&lt;\\\\1\\\\2\\\\3&gt;\", $str);\r\n\t\t\r\n\t\t/*\r\n\t\t * Sanitize naughty scripting elements\r\n\t\t *\r\n\t\t * Similar to above, only instead of looking for\r\n\t\t * tags it looks for PHP and JavaScript commands\r\n\t\t * that are disallowed. Rather than removing the\r\n\t\t * code, it simply converts the parenthesis to entities\r\n\t\t * rendering the code un-executable.\r\n\t\t *\r\n\t\t * For example:\teval('some code')\r\n\t\t * Becomes:\t\teval&#40;'some code'&#41;\r\n\t\t *\r\n\t\t */\r\n\t\t$str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si', \"\\\\1\\\\2&#40;\\\\3&#41;\", $str);\r\n\t\t\t\t\t\t\r\n\t\t/*\r\n\t\t * Final clean up\r\n\t\t *\r\n\t\t * This adds a bit of extra precaution in case\r\n\t\t * something got through the above filters\r\n\t\t *\r\n\t\t */\t\r\n\t\t$bad = array(\r\n\t\t\t\t\t\t'document.cookie'\t=> '[removed]',\r\n\t\t\t\t\t\t'document.write'\t=> '[removed]',\r\n\t\t\t\t\t\t'.parentNode'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'.innerHTML'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'window.location'\t=> '[removed]',\r\n\t\t\t\t\t\t'-moz-binding'\t\t=> '[removed]',\r\n\t\t\t\t\t\t'<!--'\t\t\t\t=> '&lt;!--',\r\n\t\t\t\t\t\t'-->'\t\t\t\t=> '--&gt;',\r\n\t\t\t\t\t\t'<!CDATA['\t\t\t=> '&lt;![CDATA['\r\n\t\t\t\t\t);\r\n\r\n\t\tforeach ($bad as $key => $val)\r\n\t\t{\r\n\t\t\t$str = str_replace($key, $val, $str); \r\n\t\t}\r\n\r\n\t\t$bad = array(\r\n\t\t\t\t\t\t\"javascript\\s*:\"\t=> '[removed]',\r\n\t\t\t\t\t\t\"expression\\s*\\(\"\t=> '[removed]', // CSS and IE\r\n\t\t\t\t\t\t\"Redirect\\s+302\"\t=> '[removed]'\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\tforeach ($bad as $key => $val)\r\n\t\t{\r\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str); \r\n\t\t}\r\n\r\n\t\treturn $str;\r\n\t}", "function sw_clean_style_tag($input) {\r\n\tpreg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\r\n\t$media = $matches[3][0] === 'print' ? ' media=\"print\"' : '';\r\n\treturn '<link rel=\"stylesheet\" href=\"' . esc_url( $matches[2][0] ) . '\"' . $media . '>' . \"\\n\";\r\n}", "public function testCustomAttribute() : void\n {\n $string = $this->basicSanitizer->sanitize('<img src=\"1.png\" data-src=\"1.png\">');\n $this->assertEquals('<img src=\"1.png\" data-src=\"1.png\">', $string);\n }", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "function nectar_quick_minify( $css ) {\n\n\t$css = preg_replace( '/\\s+/', ' ', $css );\n\t\n\t$css = preg_replace( '/\\/\\*[^\\!](.*?)\\*\\//', '', $css );\n\t\n\t$css = preg_replace( '/(,|:|;|\\{|}) /', '$1', $css );\n\t\n\t$css = preg_replace( '/ (,|;|\\{|})/', '$1', $css );\n\t\n\t$css = preg_replace( '/(:| )0\\.([0-9]+)(%|em|ex|px|in|cm|mm|pt|pc)/i', '${1}.${2}${3}', $css );\n\t\n\t$css = preg_replace( '/(:| )(\\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/i', '${1}0', $css );\n\t\n\treturn trim( $css );\n\n}", "public function test_it_finds_settings_css() {\n $starttoken = css_processor::TOKEN_ENABLEOVERRIDES_START;\n $endtoken = css_processor::TOKEN_ENABLEOVERRIDES_END;\n $css = <<<EOF\nbody {\n background: lime;\n}\n{$starttoken}\nSETTINGS HERE 1\n{$endtoken}\n.foo .bar {\n display: inline-block;\n color: #123123;\n}\n\n{$starttoken}\nSETTINGS HERE 2\n{$endtoken}\nEOF;\n $expected = array();\n $expected[] = <<<EOF\n{$starttoken}\nSETTINGS HERE 1\n{$endtoken}\nEOF;\n $expected[] = <<<EOF\n{$starttoken}\nSETTINGS HERE 2\n{$endtoken}\nEOF;\n $actual = (new css_processor())->get_settings_css($css);\n\n $this->assertEquals($expected, $actual);\n\n // No settings.\n $expected = array();\n $actual = (new css_processor())->get_settings_css('body { background: lime; }');\n\n $this->assertEquals($expected, $actual);\n }", "private function _replace_inline_css()\n\t{\n\t\t// preg_match_all( '/url\\s*\\(\\s*(?![\"\\']?data:)(?![\\'|\\\"]?[\\#|\\%|])([^)]+)\\s*\\)([^;},\\s]*)/i', $this->content, $matches ) ;\n\n\t\t/**\n\t\t * Excludes `\\` from URL matching\n\t\t * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS\n\t\t * @see #685485\n\t\t * @since 3.0\n\t\t */\n\t\tpreg_match_all( '#url\\((?![\\'\"]?data)[\\'\"]?([^\\)\\'\"\\\\\\]+)[\\'\"]?\\)#i', $this->content, $matches ) ;\n\t\tforeach ( $matches[ 1 ] as $k => $url ) {\n\t\t\t$url = str_replace( array( ' ', '\\t', '\\n', '\\r', '\\0', '\\x0B', '\"', \"'\", '&quot;', '&#039;' ), '', $url ) ;\n\n\t\t\tif ( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "function crypton_blog_cryptocurrency_prepare_css($css='', $remove_spaces=true) {\n\t\treturn apply_filters( 'cryptocurrency_filter_prepare_css', $css, $remove_spaces );\n\t}", "function test_stylesheet() {\n\t\t\tif ($this->is_readable_and_not_empty($this->get_stylesheet())) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// so try to generate stylesheet...\n\t\t\t$this->write_stylesheet(false);\n\n\t\t\t// retest\n\t\t\tif ($this->is_readable_and_not_empty($this->get_stylesheet())) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "private static final function cleanCSSEnvironmentIfCSSFile () {\r\n if (strpos ($_SERVER['SCRIPT_FILENAME'], '.css') && isset ($_SESSION['CSS'][$_SERVER['SCRIPT_FILENAME']])) {\r\n unset ($_SESSION['CSS'][$_SERVER['SCRIPT_FILENAME']]);\r\n // Do return ...\r\n return new B (TRUE);\r\n } else {\r\n // Do return ...\r\n return new B (FALSE);\r\n }\r\n }", "function cssuni($name)\n{\n\t$cssbegin = '<link rel=\"stylesheet\" href=\"';\n\t$cssend = '\">';\n//\tif (current_user_can('administrator')) $csspath = '/css/';\n\t$csspath = '/css/'; //$csspath='/css/';\n\t$filename = get_stylesheet_directory() . $csspath . $name;\n\tif (file_exists($filename)) return $cssbegin . get_template_directory_uri() . $csspath . $name . '?v=' . filemtime($filename) . $cssend;\n\treturn $cssbegin . get_template_directory_uri() . $csspath . $name . $cssend;\n}", "function ReadCSS($html)\n{\n//! @desc CSS parser\n//! @return string\n\n/*\n* This version ONLY supports: .class {...} / #id { .... }\n* It does NOT support: body{...} / a#hover { ... } / p.right { ... } / other mixed names\n* This function must read the CSS code (internal or external) and order its value inside $this->CSS. \n*/\n\n\t$match = 0; // no match for instance\n\t$regexp = ''; // This helps debugging: showing what is the REAL string being processed\n\t\n\t//CSS inside external files\n\t$regexp = '/<link rel=\"stylesheet\".*?href=\"(.+?)\"\\\\s*?\\/?>/si'; \n\t$match = preg_match_all($regexp,$html,$CSSext);\n $ind = 0;\n\n\twhile($match){\n //Fix path value\n $path = $CSSext[1][$ind];\n $path = str_replace(\"\\\\\",\"/\",$path); //If on Windows\n //Get link info and obtain its absolute path\n $regexp = '|^./|';\n $path = preg_replace($regexp,'',$path);\n if (strpos($path,\"../\") !== false ) //It is a Relative Link\n {\n $backtrackamount = substr_count($path,\"../\");\n $maxbacktrack = substr_count($this->basepath,\"/\") - 1;\n $filepath = str_replace(\"../\",'',$path);\n $path = $this->basepath;\n //If it is an invalid relative link, then make it go to directory root\n if ($backtrackamount > $maxbacktrack) $backtrackamount = $maxbacktrack;\n //Backtrack some directories\n for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,\"/\") );\n $path = $path . \"/\" . $filepath; //Make it an absolute path\n }\n elseif( strpos($path,\":/\") === false) //It is a Local Link\n {\n $path = $this->basepath . $path; \n }\n //Do nothing if it is an Absolute Link\n //END of fix path value\n $CSSextblock = file_get_contents($path);\t\n\n //Get class/id name and its characteristics from $CSSblock[1]\n\t $regexp = '/[.# ]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n\t preg_match_all( $regexp, $CSSextblock, $extstyle);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($extstyle[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $extstyle[2][$i], $extstyleinfo);\n \t\t$extproperties = $extstyleinfo[1];\n \t\t$extvalues = $extstyleinfo[2];\n \t\tfor($j = 0; $j < count($extproperties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$extclassproperties[strtoupper($extproperties[$j])] = trim($extvalues[$j]);\n \t\t}\n \t\t$this->CSS[$extstyle[1][$i]] = $extclassproperties;\n\t \t$extproperties = array();\n \t\t$extvalues = array();\n \t\t$extclassproperties = array();\n \t}\n\t $match--;\n\t $ind++;\n\t} //end of match\n\n\t$match = 0; // reset value, if needed\n\n\t//CSS internal\n\t//Get content between tags and order it, using regexp\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$match = preg_match($regexp,$html,$CSSblock);\n\n\tif ($match) {\n \t//Get class/id name and its characteristics from $CSSblock[1]\n \t$regexp = '/[.#]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n \tpreg_match_all( $regexp, $CSSblock[1], $style);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($style[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $style[2][$i], $styleinfo);\n \t\t$properties = $styleinfo[1];\n \t\t$values = $styleinfo[2];\n \t\tfor($j = 0; $j < count($properties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$classproperties[strtoupper($properties[$j])] = trim($values[$j]);\n \t\t}\n \t\t$this->CSS[$style[1][$i]] = $classproperties;\n \t\t$properties = array();\n \t\t$values = array();\n \t\t$classproperties = array();\n \t}\n\t} // end of match\n\n\t//Remove CSS (tags and content), if any\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$html = preg_replace($regexp,'',$html);\n\n \treturn $html;\n}", "public function test_it_replaces_colour_variants() {\n\n $substitutions = array(\n 'linkcolor' => '#123123',\n );\n $linkcolor = $substitutions['linkcolor'];\n $linkcolor_lighter = totara_brightness_linear($linkcolor, 15);\n $linkcolor_darker = totara_brightness_linear($linkcolor, -15);\n $linkcolor_light = totara_brightness_linear($linkcolor, 25);\n $linkcolor_dark = totara_brightness_linear($linkcolor, -25);\n $linkcolor_lighter_perc = totara_brightness($linkcolor, 15);\n $linkcolor_darker_perc = totara_brightness($linkcolor, -15);\n $linkcolor_light_perc = totara_brightness($linkcolor, 25);\n $linkcolor_dark_perc = totara_brightness($linkcolor, -25);\n $linkcolor_readable_text = totara_readable_text($linkcolor);\n\n $css =<<<EOF\nbody {\n color: [[setting:linkcolor]];\n color: [[setting:linkcolor-lighter]];\n color: [[setting:linkcolor-darker]];\n color: [[setting:linkcolor-light]];\n color: [[setting:linkcolor-dark]];\n color: [[setting:linkcolor-lighter-perc]];\n color: [[setting:linkcolor-darker-perc]];\n color: [[setting:linkcolor-light-perc]];\n color: [[setting:linkcolor-dark-perc]];\n color: [[setting:linkcolor-readable-text]];\n}\nEOF;\n\n $expected = <<<EOF\nbody {\n color: {$linkcolor};\n color: {$linkcolor_lighter};\n color: {$linkcolor_darker};\n color: {$linkcolor_light};\n color: {$linkcolor_dark};\n color: {$linkcolor_lighter_perc};\n color: {$linkcolor_darker_perc};\n color: {$linkcolor_light_perc};\n color: {$linkcolor_dark_perc};\n color: {$linkcolor_readable_text};\n}\nEOF;\n $actual = (new css_processor())->replace_colours($substitutions, $css);\n\n $this->assertEquals($expected, $actual);\n }", "public function xssFilter($value)\n {\n $filter = new CHtmlPurifier();\n $filter->options = array(\n 'AutoFormat.RemoveEmpty'=>false,\n 'Core.NormalizeNewlines'=>false,\n 'CSS.AllowTricky'=>true, // Allow display:none; (and other)\n 'HTML.SafeObject'=>true, // To allow including youtube\n 'Output.FlashCompat'=>true,\n 'Attr.EnableID'=>true, // Allow to set id\n 'Attr.AllowedFrameTargets'=>array('_blank','_self'),\n 'URI.AllowedSchemes'=>array(\n 'http' => true,\n 'https' => true,\n 'mailto' => true,\n 'ftp' => true,\n 'nntp' => true,\n 'news' => true,\n )\n );\n // To allow script BUT purify : HTML.Trusted=true (plugin idea for admin or without XSS filtering ?)\n\n /** Start to get complete filtered value with url decode {QCODE} (bug #09300). This allow only question number in url, seems OK with XSS protection **/\n $sFiltered=preg_replace('#%7B([a-zA-Z0-9\\.]*)%7D#','{$1}',$filter->purify($value));\n Yii::import('application.helpers.expressions.em_core_helper');// Already imported in em_manager_helper.php ?\n $oExpressionManager= new ExpressionManager;\n /** We get 2 array : one filtered, other unfiltered **/\n $aValues=$oExpressionManager->asSplitStringOnExpressions($value);// Return array of array : 0=>the string,1=>string length,2=>string type (STRING or EXPRESSION)\n $aFilteredValues=$oExpressionManager->asSplitStringOnExpressions($sFiltered);// Same but for the filtered string\n $bCountIsOk=count($aValues)==count($aFilteredValues);\n /** Construction of new string with unfiltered EM and filtered HTML **/\n $sNewValue=\"\";\n foreach($aValues as $key=>$aValue){\n if($aValue[2]==\"STRING\")\n $sNewValue.=$bCountIsOk ? $aFilteredValues[$key][0]:$filter->purify($aValue[0]);// If EM is broken : can throw invalid $key\n else\n {\n $sExpression=trim($aValue[0], '{}');\n $sNewValue.=\"{\";\n $aParsedExpressions=$oExpressionManager->Tokenize($sExpression,true);\n foreach($aParsedExpressions as $aParsedExpression)\n {\n if($aParsedExpression[2]=='DQ_STRING')\n $sNewValue.=\"\\\"\".$filter->purify($aParsedExpression[0]).\"\\\"\"; // This disallow complex HTML construction with XSS\n elseif($aParsedExpression[2]=='SQ_STRING')\n $sNewValue.=\"'\".$filter->purify($aParsedExpression[0]).\"'\";\n else\n $sNewValue.=$aParsedExpression[0];\n }\n $sNewValue.=\"}\";\n }\n }\n gc_collect_cycles(); // To counter a high memory usage of HTML-Purifier\n return $sNewValue;\n }", "function validate_beer_style_id($name,$value,$attribs,$converted_value,$oak)\n{\n\t$styles=preg_split('/\\s+/',trim($value));\n\tif (count($styles)) {\n\t\tglobal $BC;\n\t\t// Get styles list\n\t\t$beerstyles=BeerCrush::api_doc($BC->oak,'style/flatlist');\n\t\tforeach ($styles as $style) {\n\t\t\tif (!isset($beerstyles->$style)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$converted_value=$styles;\n\t\n\treturn TRUE;\n}", "public function testCssTimestamping() {\n\t\tConfigure::write('debug', 2);\n\t\tConfigure::write('Asset.timestamp', true);\n\n\t\t$expected = array(\n\t\t\t'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => '')\n\t\t);\n\n\t\t$result = $this->Html->css('cake.generic');\n\t\t$expected['link']['href'] = 'preg:/.*css\\/cake\\.generic\\.css\\?[0-9]+/';\n\t\t$this->assertTags($result, $expected);\n\n\t\tConfigure::write('debug', 0);\n\n\t\t$result = $this->Html->css('cake.generic');\n\t\t$expected['link']['href'] = 'preg:/.*css\\/cake\\.generic\\.css/';\n\t\t$this->assertTags($result, $expected);\n\n\t\tConfigure::write('Asset.timestamp', 'force');\n\n\t\t$result = $this->Html->css('cake.generic');\n\t\t$expected['link']['href'] = 'preg:/.*css\\/cake\\.generic\\.css\\?[0-9]+/';\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->request->webroot = '/testing/';\n\t\t$result = $this->Html->css('cake.generic');\n\t\t$expected['link']['href'] = 'preg:/\\/testing\\/css\\/cake\\.generic\\.css\\?[0-9]+/';\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->request->webroot = '/testing/longer/';\n\t\t$result = $this->Html->css('cake.generic');\n\t\t$expected['link']['href'] = 'preg:/\\/testing\\/longer\\/css\\/cake\\.generic\\.css\\?[0-9]+/';\n\t\t$this->assertTags($result, $expected);\n\t}", "function cssName($string)\n{\n //Lower case everything\n $string = strtolower($string);\n //Make alphanumeric (removes all other characters)\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\n //Clean up multiple dashes or whitespaces\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\n //Convert whitespaces and underscore to dash\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\n return $string;\n}", "function xss_clean($str, $is_image = FALSE)\n{ \n $security =& load_class('Security','core');\n return $security->xss_clean($str, $is_image);\n}", "public function optimizeCss($originalCSS)\n {\n if (strpos($originalCSS, '/*') !== false) {\n throw new Exception ('Input CSS must not contain comments');\n }\n\n $counts = array(\n 'skipped' => 0,\n 'merged' => 0,\n 'properties' => 0,\n 'selectors' => 0,\n 'nested' => 0,\n 'unoptimized' => 0\n );\n\n $propertyBlacklist = array();\n\n $optimizedCSS = '';\n $allSelectors = array();\n $untouchedBlocks = array();\n $propertyHashes = array();\n $optimizedRules = array();\n\n $blocks = explode('}', $originalCSS);\n\n for ($blockNumber = 0; $blockNumber < count($blocks); $blockNumber++) {\n $block = trim($blocks[$blockNumber]);\n $parts = explode('{', $block);\n\n if ($block == '') {\n // Nothing to do\n continue;\n }\n\n if (count($parts) != 2) {\n $nested = $block;\n\n while ($blockNumber < count($blocks) && trim($blocks[$blockNumber]) != '') {\n $blockNumber++;\n $nested .= '}' . trim($blocks[$blockNumber]);\n }\n\n $nested .= '}';\n $untouchedBlocks[] = $nested;\n $counts['nested']++;\n continue;\n }\n\n if (strpos($block, '@') === 0) {\n $untouchedBlocks[] = $block . '}';\n $counts['unoptimized']++;\n continue;\n }\n\n $selectors = explode(',', $parts[0]);\n $properties = explode(';', $parts[1]);\n\n if (count($properties) == 0) {\n // Nothing to do\n $counts['skipped']++;\n continue;\n }\n\n $newProperties = array();\n $propertyName = '';\n $validProperty = false;\n\n foreach ($properties as $property) {\n $property = trim($property);\n $strpos = strpos($property, ':');\n $hasPropertyName = ($strpos !== false);\n\n if ($hasPropertyName) {\n $propertyName = trim(substr($property, 0, $strpos));\n $propertyValue = trim(substr($property, $strpos + 1));\n $validProperty = !isset($propertyBlacklist[$propertyName]) || $propertyBlacklist[$propertyName] != $propertyValue;\n }\n\n if ($validProperty && $propertyName) {\n if ($hasPropertyName) {\n $newProperties[$propertyName] = $propertyName . ':' . $propertyValue;\n } elseif ($property != '') {\n // Base64 image data\n $newProperties[$propertyName] .= ';' . $property;\n }\n }\n\n $counts['properties']++;\n }\n\n foreach ($selectors as $selector) {\n $selector = trim($selector);\n $counts['selectors']++;\n\n if (isset($allSelectors[$selector])) {\n $mergedProperties = array_merge($allSelectors[$selector], $newProperties);\n $counts['merged']++;\n } else {\n $mergedProperties = $newProperties;\n }\n\n ksort($mergedProperties);\n\n $allSelectors[$selector] = $mergedProperties;\n }\n }\n\n foreach ($allSelectors as $selector => $properties) {\n $hash = md5(print_r($properties, true));\n\n if (!isset($propertyHashes[$hash])) {\n $propertyHashes[$hash] = array();\n }\n\n $propertyHashes[$hash][] = $selector;\n }\n\n foreach ($propertyHashes as $selectors) {\n sort($selectors);\n $mainSelector = $selectors[0];\n $propertiesString = implode(';', $allSelectors[$mainSelector]);\n $selectorsString = implode(',', $selectors);\n $optimizedRules[$selectorsString] = $propertiesString;\n }\n\n foreach ($untouchedBlocks as $untouchedBlock) {\n $optimizedCSS .= $untouchedBlock;\n }\n\n foreach ($optimizedRules as $selectorsString => $propertiesString) {\n $optimizedCSS .= $selectorsString . '{' . $propertiesString . '}';\n }\n\n $this->counts = $counts;\n\n return $optimizedCSS;\n }", "private function style_matches_slug( $slug ) {\n\t\treturn ( $slug === $this->slplus->SmartOptions->style->value );\n\t}", "function virustotalscan_replace_style()\r\n{\r\n global $mybb, $templates, $virustotalscan_url_css, $plugins;\r\n $groups = explode(\",\", $mybb->settings['virustotalscan_setting_url_groups']);\r\n // doar in cazul in care modulul de scanare al legaturilor este activ se trece la adaugarea codului CSS in forum\r\n if ($mybb->settings['virustotalscan_setting_url_enable'] && virustotalscan_check_server_load($mybb->settings['virustotalscan_setting_url_loadlimit']) && !empty($mybb->settings['virustotalscan_setting_key']) && !in_array($mybb->user['usergroup'], $groups))\r\n {\r\n eval(\"\\$virustotalscan_url_css = \\\"\".$templates->get(\"virustotalscan_url_css\").\"\\\";\"); \r\n // in acest caz va exista scanarea URL-urilor\r\n $plugins->add_hook('parse_message_end', 'virustotalscan_scan_url');\r\n }\r\n}", "function sani($bad){\r\n\t\t\t$good = htmlentities( strip_tags( stripslashes( $bad ) ) );\r\n\t\t\treturn $good;\r\n\t\t}", "public function clean_style_tag($input) {\n\t\tpreg_match_all(\"!<link rel='stylesheet'\\s?(id='[^']+')?\\s+href='(.*)' type='text/css' media='(.*)' />!\", $input, $matches);\n\t\tif (empty($matches[2])) {\n\t\t\treturn $input;\n\t\t}\n\t\t// Only display media if it is meaningful\n\t\t$media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media=\"' . $matches[3][0] . '\"' : '';\n\t\treturn '<link rel=\"stylesheet\" href=\"' . $matches[2][0] . '\"' . $media . '>' . \"\\n\";\n\t}", "protected static function remove_insecure_styles($input)\n {\n }", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "private function css($content)\n\t{\n\t\trequire_once __DIR__ . '/thirdparty/cssmin.php';\n\t\treturn \\CssMin::minify($content);\n\t}", "public function htmlIsValid()\n {\n if (!$this->scan_attributes) {\n return false;\n }\n\n return $this->versionIsValid($this->scan_attributes->html_version);\n }", "private function isCssUpdated() {\n\n $changed = false;\n\n if ($this->compiler == 'less') {\n $generateSourceMap = $this->params->get('generate_css_sourcemap', false);\n\n // if the source map still exists but shouldn't be created, just recompile.\n if (JFile::exists($this->paths->get('css.sourcemap')) && !$generateSourceMap) {\n $changed = true;\n }\n\n // if the source map doesn't exist but should, just recompile.\n if (!JFile::exists($this->paths->get('css.sourcemap')) && $generateSourceMap) {\n $changed = true;\n }\n } else {\n if (!$changed) {\n if ($this->cache->get(self::CACHEKEY.'.scss.formatter') !== $this->formatting) {\n $changed = true;\n }\n }\n }\n\n if (!$changed) {\n if ($this->cache->get(self::CACHEKEY.'.compiler') !== $this->compiler) {\n $changed = true;\n }\n }\n\n if (!$changed) {\n $changed = $this->isCacheChanged(self::CACHEKEY.'.files.css');\n }\n\n return $changed;\n }", "protected function sanitize() {}", "function style_fixing( $match ) {\r\n $match[0] = preg_replace_callback('/url\\s*\\(\\s*[\\'\\\"]?(.*?)\\s*[\\'\\\"]?\\s*\\)/is', \"style_url_replace\", $match[0]);\r\n //echo \"<pre>\".htmlspecialchars($match[0]).\"</pre>\";\r\n return $match[0];\r\n}", "protected function isContentCorrect() {}", "function verify_content($content) // Colorize: green\n { // Colorize: green\n return isset($content) // Colorize: green\n && // Colorize: green\n is_string($content) // Colorize: green\n && // Colorize: green\n $content != \"\"; // Colorize: green\n }", "public function testXss() {\n $test = 'Test string <script>alert(\"XSS!\");</script> with attack <div onclick=\"javascript:alert(\\'XSS!\\')\">vectors</div>';\n\n // remove HTML tags and escape\n $this->assertEquals('Test string alert(&quot;XSS!&quot;); with attack vectors', Sanitize::xss($test));\n\n // remove on attributes and escape\n $this->assertEquals('Test string alert(&quot;XSS!&quot;); with attack &lt;div&gt;vectors&lt;/div&gt;', Sanitize::xss($test, array('strip' => false)));\n\n // remove xmlns and escape\n $this->assertEquals('&lt;html&gt;', Sanitize::xss('<html xmlns=\"http://www.w3.org/1999/xhtml\">', array('strip' => false)));\n\n // remove namespaced tags and escape\n $this->assertEquals('Content', Sanitize::xss('<ns:tag>Content</ns:tag>', array('strip' => false)));\n $this->assertEquals('Content', Sanitize::xss('<ns:tag attr=\"foo\">Content</ns:tag>', array('strip' => false)));\n\n // remove unwanted tags\n $this->assertEquals('A string full of unwanted tags.', Sanitize::xss('<audio>A</audio> <script type=\"text/javascript\">string</script> <iframe>full</iframe> <applet>of</applet> <object>unwanted</object> <style>tags</style>.', array('strip' => false)));\n }", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}", "public function testValidateDocumentHtmlValidation()\n {\n }", "function test_smart_dashes( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function v2_mumm_css_alter(&$css) {\n $path = drupal_get_path('theme', 'v2_mumm');\n if ($_GET['q'] === 'outdated-browser') {\n unset($css[$path . '/css/style.css']);\n }\n else {\n unset($css[$path . '/css/unsupported-browsers.css']);\n }\n}", "function ReadCSS($html)\r\n{\r\n//! @desc CSS parser\r\n//! @return string\r\n\r\n/*\r\n* This version ONLY supports: .class {...} / #id { .... }\r\n* It does NOT support: body{...} / a#hover { ... } / p.right { ... } / other mixed names\r\n* This function must read the CSS code (internal or external) and order its value inside $this->CSS. \r\n*/\r\n\r\n\t$match = 0; // no match for instance\r\n\t$regexp = ''; // This helps debugging: showing what is the REAL string being processed\r\n\t\r\n\t//CSS external\r\n\t$regexp = '/<link rel=\"stylesheet\".*?href=\"(.+?)\"\\\\s*?\\/?>/si';\r\n\t$match = preg_match_all($regexp,$html,$CSSext);\r\n $ind = 0;\r\n\r\n\twhile($match) {\r\n\t$file = fopen($CSSext[1][$ind],\"r\");\r\n\t$CSSextblock = fread($file,filesize($CSSext[1][$ind]));\r\n\tfclose($file);\r\n\r\n\t//Get class/id name and its characteristics from $CSSblock[1]\r\n\t$regexp = '/[.# ]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\r\n\tpreg_match_all( $regexp, $CSSextblock, $extstyle);\r\n\r\n\t//Make CSS[Name-of-the-class] = array(key => value)\r\n\t$regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\r\n\r\n\tfor($i=0; $i < count($extstyle[1]) ; $i++)\r\n\t{\r\n\t\tpreg_match_all( $regexp, $extstyle[2][$i], $extstyleinfo);\r\n\t\t$extproperties = $extstyleinfo[1];\r\n\t\t$extvalues = $extstyleinfo[2];\r\n\t\tfor($j = 0; $j < count($extproperties) ; $j++) \r\n\t\t{\r\n\t\t\t//Array-properties and Array-values must have the SAME SIZE!\r\n\t\t\t$extclassproperties[strtoupper($extproperties[$j])] = trim($extvalues[$j]);\r\n\t\t}\r\n\t\t$this->CSS[$extstyle[1][$i]] = $extclassproperties;\r\n\t\t$extproperties = array();\r\n\t\t$extvalues = array();\r\n\t\t$extclassproperties = array();\r\n\t}\r\n\t$match--;\r\n\t$ind++;\r\n\t} //end of match\r\n\r\n\t$match = 0; // reset value, if needed\r\n\r\n\t//CSS internal\r\n\t//Get content between tags and order it, using regexp\r\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\">\r\n\t$match = preg_match($regexp,$html,$CSSblock);\r\n\r\n\tif ($match) {\r\n\t//Get class/id name and its characteristics from $CSSblock[1]\r\n\t$regexp = '/[.#]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\r\n\tpreg_match_all( $regexp, $CSSblock[1], $style);\r\n\r\n\t//Make CSS[Name-of-the-class] = array(key => value)\r\n\t$regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\r\n\r\n\tfor($i=0; $i < count($style[1]) ; $i++)\r\n\t{\r\n\t\tpreg_match_all( $regexp, $style[2][$i], $styleinfo);\r\n\t\t$properties = $styleinfo[1];\r\n\t\t$values = $styleinfo[2];\r\n\t\tfor($j = 0; $j < count($properties) ; $j++) \r\n\t\t{\r\n\t\t\t//Array-properties and Array-values must have the SAME SIZE!\r\n\t\t\t$classproperties[strtoupper($properties[$j])] = trim($values[$j]);\r\n\t\t}\r\n\t\t$this->CSS[$style[1][$i]] = $classproperties;\r\n\t\t$properties = array();\r\n\t\t$values = array();\r\n\t\t$classproperties = array();\r\n\t}\r\n\r\n\t} // end of match\r\n\r\n //print_r($this->CSS);// Important debug-line!\r\n\r\n\t//Remove CSS (tags and content), if any\r\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\">\r\n\t$html = preg_replace($regexp,'',$html);\r\n\r\n \treturn $html;\r\n}", "public static function cssToInt($str) {\r\n $str = strtolower(preg_replace('~\\s+~', '', $str));\r\n if(preg_match('~#[0-9a-f]{6}\\z~A', $str, $m)) {\r\n return sscanf($str, '#%06x')[0];\r\n } elseif(preg_match('~#[0-9a-f]{3}\\z~A', $str, $m)) {\r\n return hexdec($str[1] . $str[1] . $str[2] . $str[2] . $str[3] . $str[3]); // RRGGBB\r\n // TODO: implement 4 and 8 digit hex notation from spec: https://drafts.csswg.org/css-color/#hex-notation\r\n // n.b. this will differ from integer notation that will need to store it as TTRRGGBB\r\n //} elseif(preg_match('~#[0-9a-f]{4}\\z~A', $str, $m)) {\r\n // return hexdec($str[1] . $str[1] . $str[2] . $str[2] . $str[3] . $str[3] . $str[4] . $str[4]); // AARRGGBB\r\n //} elseif(preg_match('~#[0-9a-f]{8}\\z~A', $str, $m)) {\r\n // return sscanf($str, '#%08x')[0];\r\n } elseif(preg_match('~rgb\\((?P<r>\\d+),(?P<g>\\d+),(?P<b>\\d+)\\)\\z~A', $str, $m)) {\r\n return (self::clampRgb($m['r']) << 16)\r\n + (self::clampRgb($m['g']) << 8)\r\n + self::clampRgb($m['b']);\r\n } elseif(preg_match('~rgba\\((?P<r>\\d+),(?P<g>\\d+),(?P<b>\\d+),(?P<a>\\d+(?:\\.\\d*)?|\\.\\d+)\\)\\z~A', $str, $m)) {\r\n return (self::clampRgb($m['r']) << 16)\r\n + (self::clampRgb($m['g']) << 8)\r\n + self::clampRgb($m['b'])\r\n + (self::floatToInt(1-$m['a']) << 24); // store transparency instead of opacity so that when the upper bits are 0, this means fully opaque which is the default when alpha is omitted\r\n } elseif(preg_match('~hsl\\((?P<h>\\d+),(?P<s>\\d+)%,(?P<l>\\d+)%\\)\\z~A', $str, $m)) {\r\n list($r,$g,$b) = self::hslToRgb(self::intToFloat($m['h'],360),self::intToFloat($m['s'],100),self::intToFloat($m['l'],100));\r\n return ($r << 16) + ($g << 8) + $b;\r\n } elseif(preg_match('~hsla\\((?P<h>\\d+),(?P<s>\\d+)%,(?P<l>\\d+)%,(?P<a>\\d+(?:\\.\\d*)?|\\.\\d+)\\)\\z~A', $str, $m)) {\r\n list($r,$g,$b) = self::hslToRgb(self::intToFloat($m['h'],360),self::intToFloat($m['s'],100),self::intToFloat($m['l'],100));\r\n return ($r << 16) + ($g << 8) + $b + (self::floatToInt(1-$m['a']) << 24);\r\n } elseif(preg_match('~[a-z]+\\z~A', $str, $m)) {\r\n if(isset(self::$cssColorNames[$str])) {\r\n return self::$cssColorNames[$str];\r\n }\r\n throw new \\Exception(\"Invalid CSS color name: $str\");\r\n } else {\r\n throw new \\Exception(\"Could not parse CSS color: $str\");\r\n }\r\n }", "static function removeXss($val) {\n\t\t// this prevents some character re-spacing such as <java\\0script>\n\t\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t\t$val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n\t\t// straight replacements, the user should never need these since they're normal characters\n\t\t// this prevents like <IMG SRC=@avascript:alert('XSS')>\n\t\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t\t$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$search .= '1234567890!@#$%^&*()';\n\t\t$search .= '~`\";:?+/={}[]-_|\\'\\\\';\n\t\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t // ;? matches the ;, which is optional\n\t\t // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t // @ @ search for the hex values\n\t\t $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t // @ @ 0{0,7} matches '0' zero to seven times\n\t\t $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t\t}\n\n\t\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t\t$ra = array_merge($ra1, $ra2);\n\n\t\t$found = true; // keep replacing as long as the previous round replaced something\n\t\twhile ($found == true) {\n\t\t $val_before = $val;\n\t\t for ($i = 0; $i < sizeof($ra); $i++) {\n\t\t $pattern = '/';\n\t\t for ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t if ($j > 0) {\n\t\t $pattern .= '(';\n\t\t $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n\t\t $pattern .= '|';\n\t\t $pattern .= '|(&#0{0,8}([9|10|13]);)';\n\t\t $pattern .= ')*';\n\t\t }\n\t\t $pattern .= $ra[$i][$j];\n\t\t }\n\t\t $pattern .= '/i';\n\t\t $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t if ($val_before == $val) {\n\t\t // no replacements were made, so exit the loop\n\t\t $found = false;\n\t\t }\n\t\t }\n\t\t}\n\t\treturn $val;\n\t}", "function tc_css_class($str) {\n\t\t$str = preg_replace('/[^a-zA-Z0-9\\s-_]/', '', $str);\n\t\t$str = strtolower(str_replace(array(' ','-'), '_', $str));\n\t\treturn $classes;\n\t}", "function minify_css_lines($css)\n{\n // from the awesome CSS JS Booster: https://github.com/Schepp/CSS-JS-Booster\n // all credits to Christian Schaefer: http://twitter.com/derSchepp\n // remove comments\n $css = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $css);\n // backup values within single or double quotes\n preg_match_all('/(\\'[^\\']*?\\'|\"[^\"]*?\")/ims', $css, $hit, PREG_PATTERN_ORDER);\n for ($i = 0, $iMax = count($hit[1]); $i < $iMax; $i++) {\n $css = str_replace($hit[1][$i], '##########' . $i . '##########', $css);\n }\n // remove traling semicolon of selector's last property\n $css = preg_replace('/;[\\s\\r\\n\\t]*?}[\\s\\r\\n\\t]*/ims', \"}\\r\\n\", $css);\n // remove any whitespace between semicolon and property-name\n $css = preg_replace('/;[\\s\\r\\n\\t]*?([\\r\\n]?[^\\s\\r\\n\\t])/ims', ';$1', $css);\n // remove any whitespace surrounding property-colon\n $css = preg_replace('/[\\s\\r\\n\\t]*:[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', ':$1', $css);\n // remove any whitespace surrounding selector-comma\n $css = preg_replace('/[\\s\\r\\n\\t]*,[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', ',$1', $css);\n // remove any whitespace surrounding opening parenthesis\n $css = preg_replace('/[\\s\\r\\n\\t]*{[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', '{$1', $css);\n // remove any whitespace between numbers and units\n $css = preg_replace('/([\\d\\.]+)[\\s\\r\\n\\t]+(px|em|pt|%)/ims', '$1$2', $css);\n // shorten zero-values\n $css = preg_replace('/([^\\d\\.]0)(px|em|pt|%)/ims', '$1', $css);\n // constrain multiple whitespaces\n $css = preg_replace('/\\p{Zs}+/ims', ' ', $css);\n // remove newlines\n $css = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '', $css);\n // Restore backupped values within single or double quotes\n for ($i = 0, $iMax = count($hit[1]); $i < $iMax; $i++) {\n $css = str_replace('##########' . $i . '##########', $hit[1][$i], $css);\n }\n\n return $css;\n}", "public function clean_galleries($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n }", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "public abstract function sanitize($string);", "function is_usefull($text) //good\r\n { \r\n $text=trim($text);\r\n $value = preg_replace('#\\s\\s#' , \" \" , $text);\r\n $value = preg_replace('#\\s+,#' , \", \" , $text);\r\n $value = preg_replace('#,\\s+#' , \",\" , $text);\r\n $value = preg_replace('#\\s+\\'#' , \"'\" , $text);\r\n $value = preg_replace('#\\'\\s+#' , \"'\" , $text);\r\n $value = preg_replace('#\\s+\\.#' , \".\" , $text);\r\n $value = preg_replace('#\\.\\s+#' , \" \" , $text);\r\n $value = preg_replace('#\\.[a-z]{1}#' , \".strtouppe[a-z]{1}\" , $text);\r\n $value = preg_replace('#\\s\\)#' , \")\" , $text);\r\n $value = preg_replace('#\\)\\s#' , \")\" , $text);\r\n $value = preg_replace('#\\(\\s#' , \"(\" , $text);\r\n $value = preg_replace('#\\s\\(#' , \"(\" , $text);\r\n $value = preg_replace('#;\\s+#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\;#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\:#' , \" :\" , $text);\r\n return $text;\r\n is_usefull(\"$text\");\r\n }", "function test_misc_static_replacements( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "public function testCssImport() {\n $this->optimizer->optimize([\n 'core/modules/system/tests/modules/common_test/common_test_css_import.css' => [\n 'type' => 'file',\n 'data' => 'core/modules/system/tests/modules/common_test/common_test_css_import.css',\n 'preprocess' => TRUE,\n ],\n 'core/modules/system/tests/modules/common_test/common_test_css_import_not_preprocessed.css' => [\n 'type' => 'file',\n 'data' => 'core/modules/system/tests/modules/common_test/common_test_css_import.css',\n 'preprocess' => TRUE,\n ],\n ]);\n self::assertEquals(file_get_contents(__DIR__ . '/css_test_files/css_input_with_import.css.optimized.aggregated.css'), $this->dumperData);\n }", "private function maybe_parse_set_from_css() {\n\n\t\t\tif ( true !== $this->settings['auto_parse'] || empty( $this->settings['icon_data']['icon_css'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\t$path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $this->settings['icon_data']['icon_css'] );\n\t\t\tif ( file_exists( $path ) ) {\n\t\t\t\tinclude $path;\n\t\t\t}\n\n\t\t\t$result = ob_get_clean();\n\n\t\t\tpreg_match_all( '/\\.([-_a-zA-Z0-9]+):before[, {]/', $result, $matches );\n\n\t\t\tif ( ! is_array( $matches ) || empty( $matches[1] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( is_array( $this->settings['icon_data']['icons'] ) ) {\n\t\t\t\t$this->settings['icon_data']['icons'] = array_merge(\n\t\t\t\t\t$this->settings['icon_data']['icons'],\n\t\t\t\t\t$matches[1]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->settings['icon_data']['icons'] = $matches[1];\n\t\t\t}\n\n\t\t}", "function sanitize($bad){\r\n\t\t\t$bad = stripslashes($bad);\r\n\t\t\t$bad = strip_tags($bad);\r\n\t\t\t$good = htmlentities($bad);\r\n\t\t\treturn $good;\r\n\t\t}", "function ct_clean_bigcommerce( $css ) {\n return '';\n}", "abstract public function sanitize();", "public function testCssLinkBC() {\n\t\tConfigure::write('Asset.filter.css', false);\n\n\t\tCakePlugin::load('TestPlugin');\n\t\t$result = $this->Html->css('TestPlugin.style', null, array('plugin' => false));\n\t\t$expected = array(\n\t\t\t'link' => array(\n\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t'type' => 'text/css',\n\t\t\t\t'href' => 'preg:/.*css\\/TestPlugin\\.style\\.css/'\n\t\t\t)\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t\tCakePlugin::unload('TestPlugin');\n\n\t\t$result = $this->Html->css('screen', 'import');\n\t\t$expected = array(\n\t\t\t'style' => array('type' => 'text/css'),\n\t\t\t'preg:/@import url\\(.*css\\/screen\\.css\\);/',\n\t\t\t'/style'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->css('css_in_head', null, array('inline' => false));\n\t\t$this->assertNull($result);\n\n\t\t$result = $this->Html->css('more_css_in_head', null, array('inline' => false));\n\t\t$this->assertNull($result);\n\t}", "function sani($bad){\r\n\t\t\t\t$bad = stripslashes($bad);\r\n\t\t\t\t$bad = strip_tags($bad);\r\n\t\t\t\t$good = htmlentities($bad);\r\n\t\t\t\treturn $good;\r\n\t\t\t}", "public function testUcwordsSanitizer()\n {\n $this->assertEquals('Fernando Zueet', Sanitize::ucwords()->clean('fernando zueet'));\n\n $this->assertEquals('', Sanitize::ucwords()->clean(10));\n }", "function xss_clean($str, $is_image = FALSE)\n\t{\n\t\t/*\n\t\t* Is the string an array?\n\t\t*\n\t\t*/\n\t\tif (is_array($str))\n\t\t{\n\t\t\twhile (list($key) = each($str))\n\t\t\t{\n\t\t\t\t$str[$key] = $this->xss_clean($str[$key]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t/*\n\t\t* Remove Invisible Characters\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Protect GET variables in URLs\n\t\t*/\n\n\t\t// 901119URL5918AMP18930PROTECT8198\n\n\t\t$str = preg_replace('|\\&([a-z\\_0-9]+)\\=([a-z\\_0-9]+)|i', $this->xss_hash().\"\\\\1=\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate standard character entities\n\t\t*\n\t\t* Add a semicolon if missing. We do this to enable\n\t\t* the conversion of entities to ASCII later.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#?[0-9a-z]{2,})([\\x00-\\x20])*;?#i', \"\\\\1;\\\\2\", $str);\n\n\t\t/*\n\t\t* Validate UTF16 two byte encoding (x00)\n\t\t*\n\t\t* Just as above, adds a semicolon if missing.\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(&\\#x?)([0-9A-F]+);?#i',\"\\\\1\\\\2;\",$str);\n\n\t\t/*\n\t\t* Un-Protect GET variables in URLs\n\t\t*/\n\t\t$str = str_replace($this->xss_hash(), '&', $str);\n\n\t\t/*\n\t\t* URL Decode\n\t\t*\n\t\t* Just in case stuff like this is submitted:\n\t\t*\n\t\t* <a href=\"http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D\">Google</a>\n\t\t*\n\t\t* Note: Use rawurldecode() so it does not remove plus signs\n\t\t*\n\t\t*/\n\t\t$str = rawurldecode($str);\n\n\t\t/*\n\t\t* Convert character entities to ASCII\n\t\t*\n\t\t* This permits our tests below to work reliably.\n\t\t* We only convert entities that are within tags since\n\t\t* these are the ones that will pose security problems.\n\t\t*\n\t\t*/\n\n\t\t$str = preg_replace_callback(\"/[a-z]+=([\\'\\\"]).*?\\\\1/si\", array($this, '_convert_attribute'), $str);\n\n\t\t$str = preg_replace_callback(\"/<\\w+.*?(?=>|<|$)/si\", array($this, '_html_entity_decode_callback'), $str);\n\n\t\t/*\n\t\t* Remove Invisible Characters Again!\n\t\t*/\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t* Convert all tabs to spaces\n\t\t*\n\t\t* This prevents strings like this: ja\tvascript\n\t\t* NOTE: we deal with spaces between characters later.\n\t\t* NOTE: preg_replace was found to be amazingly slow here on large blocks of data,\n\t\t* so we use str_replace.\n\t\t*\n\t\t*/\n\n \t\tif (strpos($str, \"\\t\") !== FALSE)\n\t\t{\n\t\t\t$str = str_replace(\"\\t\", ' ', $str);\n\t\t}\n\n\t\t/*\n\t\t* Capture converted string for later comparison\n\t\t*/\n\t\t$converted_string = $str;\n\n\t\t/*\n\t\t* Not Allowed Under Any Conditions\n\t\t*/\n\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Makes PHP tags safe\n\t\t*\n\t\t* Note: XML tags are inadvertently replaced too:\n\t\t*\n\t\t*\t<?xml\n\t\t*\n\t\t* But it doesn't seem to pose a problem.\n\t\t*\n\t\t*/\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t// Images have a tendency to have the PHP short opening and closing tags every so often\n\t\t\t// so we skip those and only do the long opening tags.\n\t\t\t$str = preg_replace('/<\\?(php)/i', \"&lt;?\\\\1\", $str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = str_replace(array('<?', '?'.'>'), array('&lt;?', '?&gt;'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Compact any exploded words\n\t\t*\n\t\t* This corrects words like: j a v a s c r i p t\n\t\t* These words are compacted back to their correct state.\n\t\t*\n\t\t*/\n\t\t$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');\n\t\tforeach ($words as $word)\n\t\t{\n\t\t\t$temp = '';\n\n\t\t\tfor ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++)\n\t\t\t{\n\t\t\t\t$temp .= substr($word, $i, 1).\"\\s*\";\n\t\t\t}\n\n\t\t\t// We only want to do this when it is followed by a non-word character\n\t\t\t// That way valid stuff like \"dealer to\" does not become \"dealerto\"\n\t\t\t$str = preg_replace_callback('#('.substr($temp, 0, -3).')(\\W)#is', array($this, '_compact_exploded_words'), $str);\n\t\t}\n\n\t\t/*\n\t\t* Remove disallowed Javascript in links or img tags\n\t\t* We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared\n\t\t* to these simplified non-capturing preg_match(), especially if the pattern exists in the string\n\t\t*/\n\t\tdo\n\t\t{\n\t\t\t$original = $str;\n\n\t\t\tif (preg_match(\"/<a/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<a\\s+([^>]*?)(>|$)#si\", array($this, '_js_link_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/<img/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace_callback(\"#<img\\s+([^>]*?)(\\s?/|$)#si\", array($this, '_js_img_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/script/i\", $str) OR preg_match(\"/xss/i\", $str))\n\t\t\t{\n\t\t\t\t$str = preg_replace(\"#<(/*)(script|xss)(.*?)\\>#si\", '[removed]', $str);\n\t\t\t}\n\t\t}\n\t\twhile($original != $str);\n\n\t\tunset($original);\n\n\t\t/*\n\t\t* Remove JavaScript Event Handlers\n\t\t*\n\t\t* Note: This code is a little blunt. It removes\n\t\t* the event handler and anything up to the closing >,\n\t\t* but it's unlikely to be a problem.\n\t\t*\n\t\t*/\n\t\t$event_handlers = array('[^a-z_\\-]on\\w*','xmlns');\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\t/*\n\t\t\t* Adobe Photoshop puts XML metadata into JFIF images, including namespacing,\n\t\t\t* so we have to allow this for images. -Paul\n\t\t\t*/\n\t\t\tunset($event_handlers[array_search('xmlns', $event_handlers)]);\n\t\t}\n\n\t\t$str = preg_replace(\"#<([^><]+?)(\".implode('|', $event_handlers).\")(\\s*=\\s*[^><]*)([><]*)#i\", \"<\\\\1\\\\4\", $str);\n\n\t\t/*\n\t\t* Sanitize naughty HTML elements\n\t\t*\n\t\t* If a tag containing any of the words in the list\n\t\t* below is found, the tag gets converted to entities.\n\t\t*\n\t\t* So this: <blink>\n\t\t* Becomes: &lt;blink&gt;\n\t\t*\n\t\t*/\n\t\t$naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';\n\t\t$str = preg_replace_callback('#<(/*\\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);\n\n\t\t/*\n\t\t* Sanitize naughty scripting elements\n\t\t*\n\t\t* Similar to above, only instead of looking for\n\t\t* tags it looks for PHP and JavaScript commands\n\t\t* that are disallowed. Rather than removing the\n\t\t* code, it simply converts the parenthesis to entities\n\t\t* rendering the code un-executable.\n\t\t*\n\t\t* For example:\teval('some code')\n\t\t* Becomes:\t\teval&#40;'some code'&#41;\n\t\t*\n\t\t*/\n\t\t$str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si', \"\\\\1\\\\2&#40;\\\\3&#41;\", $str);\n\n\t\t/*\n\t\t* Final clean up\n\t\t*\n\t\t* This adds a bit of extra precaution in case\n\t\t* something got through the above filters\n\t\t*\n\t\t*/\n\t\tforeach ($this->never_allowed_str as $key => $val)\n\t\t{\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val)\n\t\t{\n\t\t\t$str = preg_replace(\"#\".$key.\"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t* Images are Handled in a Special Way\n\t\t* - Essentially, we want to know that after all of the character conversion is done whether\n\t\t* any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean.\n\t\t* However, if the string post-conversion does not matched the string post-removal of XSS,\n\t\t* then it fails, as there was unwanted XSS code found and removed/changed during processing.\n\t\t*/\n\n\t\tif ($is_image === TRUE)\n\t\t{\n\t\t\tif ($str == $converted_string)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//log_message('debug', \"XSS Filtering completed\");\n\t\treturn $str;\n\t}", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }", "public function test_it_replaces_colours_with_defaults() {\n\n $css =<<<EOF\nbody {\n background-color: [[setting:linkcolor]];\n color: [[setting:linkvisitedcolor]];\n border-top-color: [[setting:headerbgc]];\n border-bottom-color: [[setting:buttoncolor]];\n}\nEOF;\n $substitutions = array(\n 'linkcolor' => '#123123',\n 'linkvisitedcolor' => '#777777',\n 'headerbgc' => '#FFFFFF',\n 'buttoncolor' => '#000000',\n );\n\n $expected = <<<EOF\nbody {\n background-color: #123123;\n color: #777777;\n border-top-color: #FFFFFF;\n border-bottom-color: #000000;\n}\nEOF;\n $actual = (new css_processor())->replace_colours($substitutions, $css);\n\n $this->assertEquals($expected, $actual);\n }", "function spartan_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "function do_test_test_css()\n{\n ?>\n<style type=\"text/css\">\n html, body {\n width:100%; \n height:100%; \n } \n\n</style>\n <?php\n}", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('mobiletemplate.component_controller_admincp_managestyles_clean')) ? eval($sPlugin) : false);\n\t}", "function css_preg($matches)\n{\n global $CSS_MATCHES;\n $ret = count($CSS_MATCHES);\n $CSS_MATCHES[] = $matches[0];\n\n return '<color-' . strval($ret) . '>';\n}", "function genesis_style_check($fileText, $char_list) {\n\n\t$fh = fopen(CHILD_DIR . '/' . $fileText, 'r');\n\t$theData = fread($fh, 1000);\n\tfclose($fh);\n\t\n\t$search = strpos($theData, $char_list);\n\tif($search === false){\n\t return false;\n\t }\n\t return true;\n}", "public function testValidate3()\n{\n\n // Traversed conditions\n // if (empty($name) && !is_numeric($name)) == false (line 373)\n // if (preg_match('/[\\\\x00-\\\\x20\\\\x22\\\\x28-\\\\x29\\\\x2c\\\\x2f\\\\x3a-\\\\x40\\\\x5c\\\\x7b\\\\x7d\\\\x7f]/', $name)) == true (line 378)\n\n $actual = $this->setCookie->validate();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testBooleanAttribute() : void\n {\n $string = $this->basicSanitizer->sanitize('<a href=\"#\" download=\"true\">Link</a>');\n $this->assertEquals('<a href=\"#\" download=\"\">Link</a>', $string);\n }", "public function xss_clean($str, $is_image = false) {\n\t\tif (empty ($str) || is_numeric($str)) {\n\t\t\treturn $str;\n\t\t}\n\t\t/*\n\t\t * Is the string an array?\n\t\t */\n\t\tif (is_array($str)) {\n\t\t\twhile ((list ($key) = each($str)) != false) {\n\t\t\t\t$str [ $key ] = $this->xss_clean($str [ $key ]);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\t\t/*\n\t\t * Remove Invisible Characters\n\t\t */\n\t\t$str = $this->_remove_invisible_characters($str);\n\t\tif (strpos($str, '<') === false || strpos($str, '>') === false) {\n\t\t\treturn $str;\n\t\t}\n\t\t/*\n\t\t * Protect GET variables in URLs\n\t\t */\n\t\t// 901119URL5918AMP18930PROTECT8198\n\t\t$str = preg_replace('|\\&([a-z\\_0-9]+)\\=([a-z\\_0-9]+)|i', $this->xss_hash() . \"\\\\1=\\\\2\", $str);\n\n\t\t/*\n\t\t * Validate standard character entities Add a semicolon if missing. We do this to enable the conversion of entities to ASCII later.\n\t\t */\n\t\t$str = preg_replace('#(&\\#?[0-9a-z]{2,})([\\x00-\\x20])*;?#i', \"\\\\1;\\\\2\", $str);\n\n\t\t/*\n\t\t * Validate UTF16 two byte encoding (x00) Just as above, adds a semicolon if missing.\n\t\t */\n\t\t$str = preg_replace('#(&\\#x?)([0-9A-F]+);?#i', \"\\\\1\\\\2;\", $str);\n\n\t\t/*\n\t\t * Un-Protect GET variables in URLs\n\t\t */\n\t\t$str = str_replace($this->xss_hash(), '&', $str);\n\n\t\t/*\n\t\t * URL Decode Just in case stuff like this is submitted: <a href=\"http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D\">Google</a> Note: Use rawurldecode() so it does not remove plus signs\n\t\t */\n\t\t$str = rawurldecode($str);\n\n\t\t/*\n\t\t * Convert character entities to ASCII This permits our tests below to work reliably. We only convert entities that are within tags since these are the ones that will pose security problems.\n\t\t */\n\n\t\t$str = preg_replace_callback('/[a-z]+=([\\'\\\"]).*?\\\\1/si', array($this, '_convert_attribute'), $str);\n\n\t\t$str = preg_replace_callback('/<\\w+.*?(?=>|<|$)/si', array($this, '_html_entity_decode_callback'), $str);\n\n\t\t/*\n\t\t * Remove Invisible Characters Again!\n\t\t */\n\t\t$str = $this->_remove_invisible_characters($str);\n\n\t\t/*\n\t\t * Convert all tabs to spaces This prevents strings like this: ja vascript NOTE: we deal with spaces between characters later. NOTE: preg_replace was found to be amazingly slow here on large blocks of data, so we use str_replace.\n\t\t */\n\n\t\tif (strpos($str, \"\\t\") !== false) {\n\t\t\t$str = str_replace(\"\\t\", ' ', $str);\n\t\t}\n\n\t\t/*\n\t\t * Capture converted string for later comparison\n\t\t */\n\t\t$converted_string = $str;\n\n\t\t/*\n\t\t * Not Allowed Under Any Conditions\n\t\t */\n\n\t\tforeach ($this->never_allowed_str as $key => $val) {\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val) {\n\t\t\t$str = preg_replace(\"#\" . $key . \"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t * Makes PHP tags safe Note: XML tags are inadvertently replaced too: <?xml But it doesn't seem to pose a problem.\n\t\t */\n\t\tif ($is_image === true) {\n\t\t\t// Images have a tendency to have the PHP short opening and closing tags every so often\n\t\t\t// so we skip those and only do the long opening tags.\n\t\t\t$str = preg_replace('/<\\?(php)/i', \"&lt;?\\\\1\", $str);\n\t\t}\n\n\t\t/*\n\t\t * Compact any exploded words This corrects words like: j a v a s c r i p t These words are compacted back to their correct state.\n\t\t */\n\t\t$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');\n\t\tforeach ($words as $word) {\n\t\t\t$temp = '';\n\n\t\t\tfor ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) {\n\t\t\t\t$temp .= substr($word, $i, 1) . '\\s*';\n\t\t\t}\n\n\t\t\t// We only want to do this when it is followed by a non-word character\n\t\t\t// That way valid stuff like \"dealer to\" does not become \"dealerto\"\n\t\t\t$str = preg_replace_callback('#(' . substr($temp, 0, -3) . ')(\\W)#is', array($this, '_compact_exploded_words'), $str);\n\t\t}\n\n\t\t/*\n\t\t * Remove disallowed Javascript in links or img tags We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared to these simplified non-capturing preg_match(), especially if the pattern exists in the string\n\t\t */\n\t\tdo {\n\t\t\t$original = $str;\n\n\t\t\tif (preg_match(\"/<a/i\", $str)) {\n\t\t\t\t$str = preg_replace_callback('#<a\\s+([^>]*?)(>|$)#si', array($this, '_js_link_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/<img/i\", $str)) {\n\t\t\t\t$str = preg_replace_callback('#<img\\s+([^>]*?)(\\s?/?>|$)#si', array($this, '_js_img_removal'), $str);\n\t\t\t}\n\n\t\t\tif (preg_match(\"/script/i\", $str) or preg_match(\"/xss/i\", $str)) {\n\t\t\t\t$str = preg_replace('#<(/*)(script|xss)(.*?)\\>#si', '[removed]', $str);\n\t\t\t}\n\t\t} while ($original != $str);\n\n\t\tunset ($original);\n\n\t\t/*\n\t\t * Remove JavaScript Event Handlers Note: This code is a little blunt. It removes the event handler and anything up to the closing >, but it's unlikely to be a problem.\n\t\t */\n\t\t$event_handlers = array('[^a-z_\\-]on\\w*', 'xmlns');\n\n\t\tif ($is_image === true) {\n\t\t\t/*\n\t\t\t * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, so we have to allow this for images. -Paul\n\t\t\t */\n\t\t\tunset ($event_handlers [ array_search('xmlns', $event_handlers) ]);\n\t\t}\n\n\t\t$str = preg_replace(\"#<([^><]+?)(\" . implode('|', $event_handlers) . ')(\\s*=\\s*[^><]*)([><]*)#i', \"<\\\\1\\\\4\", $str);\n\n\t\t/*\n\t\t * Sanitize naughty HTML elements If a tag containing any of the words in the list below is found, the tag gets converted to entities. So this: <blink> Becomes: &lt;blink&gt;\n\t\t */\n\t\t$naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';\n\t\t$str = preg_replace_callback('#<(/*\\s*)(' . $naughty . ')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);\n\n\t\t/*\n\t\t * Sanitize naughty scripting elements Similar to above, only instead of looking for tags it looks for PHP and JavaScript commands that are disallowed. Rather than removing the code, it simply converts the parenthesis to entities rendering the code un-executable. For example: eval('some code') Becomes: eval&#40;'some code'&#41;\n\t\t */\n\t\t$str = preg_replace('#(cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\\s*)\\((.*?)\\)#si', \"\\\\1\\\\2&#40;\\\\3&#41;\", $str);\n\n\t\t/*\n\t\t * Final clean up This adds a bit of extra precaution in case something got through the above filters\n\t\t */\n\t\tforeach ($this->never_allowed_str as $key => $val) {\n\t\t\t$str = str_replace($key, $val, $str);\n\t\t}\n\n\t\tforeach ($this->never_allowed_regex as $key => $val) {\n\t\t\t$str = preg_replace(\"#\" . $key . \"#i\", $val, $str);\n\t\t}\n\n\t\t/*\n\t\t * Images are Handled in a Special Way - Essentially, we want to know that after all of the character conversion is done whether any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. However, if the string post-conversion does not matched the string post-removal of XSS, then it fails, as there was unwanted XSS code found and removed/changed during processing.\n\t\t */\n\n\t\tif ($is_image === true) {\n\t\t\tif ($str == $converted_string) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn $str;\n\t}", "function testBug_rolfhub_2007_02_07_2() \n {\n $sText = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "function heateor_ss_validate_url($url){\r\n\treturn filter_var(trim($url), FILTER_VALIDATE_URL);\r\n}", "function wpgrade_gallery_style($css) {\r\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\r\n}", "function sanitize_html_class($classname, $fallback = '')\n {\n }", "protected function sanitize($input){ \n\t\tif ( get_magic_quotes_gpc() )\n\t\t{\n\t\t\t$input = stripslashes($input);\n\t\t}\n\n\t $search = array(\n\t\t '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t \t);\n\n\t\t$output = preg_replace($search, '', $input);\n\t\treturn $output;\n }", "public function testValidate2()\n{\n\n // Traversed conditions\n // if (empty($name) && !is_numeric($name)) == false (line 373)\n // if (preg_match('/[\\\\x00-\\\\x20\\\\x22\\\\x28-\\\\x29\\\\x2c\\\\x2f\\\\x3a-\\\\x40\\\\x5c\\\\x7b\\\\x7d\\\\x7f]/', $name)) == false (line 378)\n // if (empty($value) && !is_numeric($value)) == true (line 389)\n\n $actual = $this->setCookie->validate();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public static function cleanWysiwygValue($value)\n {\n $output = preg_replace('/(<[^>]+) style=\".*?\"/i', '$1', $value);\n return $output;\n }", "function replaceTagsCSS(&$string, $enabled = 1, $security_pass = 1)\n\t{\n\t\tif (!is_string($string) || $string == '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// quick check to see if i is necessary to do anything\n\t\tif ((strpos($string, 'style') === false) && (strpos($string, 'link') === false))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Match:\n\t\t// <script ...>...</script>\n\t\t$tag_regex =\n\t\t\t'(-start-' . '\\s*style\\s[^' . '-end-' . ']*?[^/]\\s*' . '-end-'\n\t\t\t. '(.*?)'\n\t\t\t. '-start-' . '\\s*\\/\\s*style\\s*' . '-end-)';\n\t\t$arr = $this->stringToSplitArray($string, $tag_regex, 1);\n\t\t$arr_count = count($arr);\n\n\t\t// Match:\n\t\t// <script ...>\n\t\t// single script tags are not xhtml compliant and should not occur, but just in case they do...\n\t\tif ($arr_count == 1)\n\t\t{\n\t\t\t$tag_regex = '(-start-' . '\\s*link\\s[^' . '-end-' . ']*?(rel=\"stylesheet\"|type=\"text/css\").*?' . '-end-)';\n\t\t\t$arr = $this->stringToSplitArray($string, $tag_regex, 1);\n\t\t\t$arr_count = count($arr);\n\t\t}\n\n\t\tif ($arr_count <= 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$enabled)\n\t\t{\n\t\t\t// replace source block content with HTML comment\n\t\t\t$string = '<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::sprintf('SRC_CODE_REMOVED_NOT_ALLOWED', JText::_('SRC_CSS'), JText::_('SRC_CSS')) . ' -->';\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$security_pass)\n\t\t{\n\t\t\t// replace source block content with HTML comment\n\t\t\t$string = '<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::sprintf('SRC_CODE_REMOVED_SECURITY', JText::_('SRC_CSS')) . ' -->';\n\n\t\t\treturn;\n\t\t}\n\t}", "function correctHTMLValidationErrors($txt) {\r\n\tif (Settings::get ( \"disable_html_validation\" )) {\r\n\t\treturn $txt;\r\n\t}\r\n\t\r\n\t// Ersetze & durch &amp;\r\n\t$txt = preg_replace ( '/[&](?![A-Za-z]+[;])/', \"&amp;\", $txt );\r\n\t\r\n\t// replaced deprecated HTML-Tags\r\n\t$txt = str_ireplace ( \"<center>\", \"<div style=\\\"text-align:center\\\">\", $txt );\r\n\t$txt = str_ireplace ( \"</center>\", \"</div>\", $txt );\r\n\t$txt = str_ireplace ( \"<strike>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</strike>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<s>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</s>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<tt>\", \"<code>\", $txt );\r\n\t$txt = str_ireplace ( \"</tt>\", \"</code>\", $txt );\r\n\t$txt = str_ireplace ( \"<dir>\", \"<ul>\", $txt );\r\n\t$txt = str_ireplace ( \"</dir>\", \"</ul>\", $txt );\r\n\t$txt = str_ireplace ( \"<acronym>\", \"<abbr>\", $txt );\r\n\t$txt = str_ireplace ( \"</acronym>\", \"</abbr>\", $txt );\r\n\t\r\n\treturn $txt;\r\n}", "public static function cssKeyValid(string $check): bool\n {\n $key = (new SessionController())->get('css_key');\n \n if ($key == $check) {\n return true;\n }\n\n return false;\n }", "public function validateLine(string $line): bool {\n // This regular expression checks there are not additional spaces between\n // the color numbers and the color values.\n if (preg_match('/^([a-zA-Z0-9]+\\s)*[a-zA-Z0-9]+$/', $line)) {\n return TRUE;\n }\n return FALSE;\n }", "public function assetsInlineConstructCssFilterSet(UnitTester $I)\n {\n $I->wantToTest('Assets\\Asset - __construct() - css filter set');\n\n $content = 'p {color: #000099}';\n $asset = new Inline('css', $content, false);\n $actual = $asset->getFilter();\n $I->assertFalse($actual);\n }", "function tc_css_id($str) {\n\t\t$str = preg_replace('/[^a-zA-Z0-9\\s-_]/', '', $str);\n\t\t$str = strtolower(str_replace(array(' ','_'), '-', $str));\n\t\treturn $str;\n\t}", "function oc_check_invalid_utf8( $string, $strip = false ) {\n $string = (string) $string;\n if ( 0 === strlen( $string ) ) {\n return '';\n }\n // Store the site charset as a static to avoid multiple calls to get_option()\n static $is_utf8;\n if ( !isset( $is_utf8 ) ) {\n $is_utf8 = in_array( get_bloginfo( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );\n }\n if ( !$is_utf8 ) {\n return $string;\n }\n // Check for support for utf8 in the installed PCRE library once and store the result in a static\n static $utf8_pcre;\n if ( !isset( $utf8_pcre ) ) {\n $utf8_pcre = @preg_match( '/^./u', 'a' );\n }\n // We can't demand utf8 in the PCRE installation, so just return the string in those cases\n if ( !$utf8_pcre ) {\n return $string;\n }\n // preg_match fails when it encounters invalid UTF8 in $string\n if ( 1 === @preg_match( '/^./us', $string ) ) {\n return $string;\n }\n // Attempt to strip the bad chars if requested (not recommended)\n if ( $strip && function_exists( 'iconv' ) ) {\n return iconv( 'utf-8', 'utf-8', $string );\n }\n return '';\n}", "function xss_html_clean( $html )\n\t{\n\t\t//-----------------------------------------\n\t\t// Opening script tags...\n\t\t// Check for spaces and new lines...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\" , \"&lt;script\" , $html );\n\t\t$html = preg_replace( \"#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\", \"&lt;/script\", $html );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Basics...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $html );\n\t\t$html = preg_replace( \"/alert/i\" , \"&#097;lert\" , $html );\n\t\t$html = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $html );\n\t\t$html = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $html );\n\t\t$html = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $html );\n\t\t$html = preg_replace( \"/onload/i\" , \"&#111;nload\" , $html );\n\t\t$html = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $html );\n\t\t$html = preg_replace( \"/<body/i\" , \"&lt;body\" , $html );\n\t\t$html = preg_replace( \"/<html/i\" , \"&lt;html\" , $html );\n\t\t$html = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $html );\n\t\t\n\t\treturn $html;\n\t}" ]
[ "0.62958", "0.61226946", "0.6118173", "0.6066739", "0.6029883", "0.5999646", "0.5948778", "0.59352994", "0.5889052", "0.57163066", "0.55703104", "0.5520725", "0.55170554", "0.54799986", "0.54263294", "0.53980327", "0.53788733", "0.5351177", "0.53320503", "0.5310577", "0.5297644", "0.5292352", "0.5280083", "0.526269", "0.52620506", "0.5238508", "0.5188613", "0.5180272", "0.5172164", "0.5166588", "0.5148981", "0.5146289", "0.5136216", "0.51330346", "0.51254404", "0.512521", "0.5100642", "0.5082649", "0.507921", "0.50450134", "0.50442916", "0.50210476", "0.50147885", "0.50136966", "0.49966282", "0.4990759", "0.49827367", "0.4974059", "0.4953963", "0.49451897", "0.4939145", "0.49372217", "0.49322066", "0.49248812", "0.49175307", "0.49121085", "0.49090153", "0.4905434", "0.4901895", "0.4900832", "0.48856434", "0.48815596", "0.48803294", "0.4878474", "0.48690665", "0.485921", "0.48589265", "0.4852202", "0.48512584", "0.48506314", "0.4848511", "0.4841979", "0.48382425", "0.48223478", "0.48220628", "0.48077795", "0.4807543", "0.4795008", "0.47878477", "0.4781697", "0.47789142", "0.47779393", "0.47718322", "0.47690833", "0.47674623", "0.47663432", "0.47634515", "0.47580948", "0.47488773", "0.4746857", "0.47453415", "0.47332177", "0.47303724", "0.4729731", "0.47296914", "0.47191852", "0.4714747", "0.4711046", "0.4709902", "0.47060674" ]
0.8243286
0
Run the database seeds.
public function run() { User::truncate(); DB::table('role_user')->truncate(); $adminRole = Role::where('name', 'admin')->first(); $admin = User::create([ 'name' => 'Admin', 'email' => '[email protected]', 'password' => Hash::make('secretAdmin'), 'country_code' => '0090', 'mobile' => '5510711558', 'discount_code' => 'admin01', 'status' => 'Active', 'created_at' => date('Y-m-d H:i'), 'updated_at' => date('Y-m-d H:i') ]); $admin->roles()->attach($adminRole); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
this creates the divs for the summary fields
function createSummaryDivs($numRows, $groupType) { for ($i = 1; $i <= $numRows; $i++) { $divs .= "<div id=\"$i$groupType\"></div>\n"; } return $divs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildPaneSummary();", "function show() {\n global $post;\n \t\t/**\n\t\t * Use nonce for verification.\n\t\t */\n echo '<input type=\"hidden\" name=\"weddingvendor_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n echo '<table class=\"form-table\">';\n\t\t\n foreach ($this->_meta_box['fields'] as $field) { \n\t\t\t/**\n\t\t\t * get current post meta data.\n\t\t\t */\n $meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\tif( isset( $field['desc'] ) ) {\n\t\t\t\t$meta_description = $field['desc'];\n\t\t\t}\n\t\t\t\n echo '<tr><th style=\"width:20%\"><label for=\"',esc_attr($field['id']), '\">', esc_html($field['name']), '</label></th><td>';\n\t\t\t\n switch ($field['type']) {\n\t\t\t /**\n\t\t\t\t * Meta-box Text Field.\n\t\t\t\t */\t\n case 'text':\n \t echo '<input type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n '<br /><small>', $meta_description.'</small>';\n break;\t\n\t\n\n\t\t\t /**\n\t\t\t\t * Meta-box date Field.\n\t\t\t\t */\t\n case 'date':\n \t echo '<input type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" class=\"check_date date\" />',\n '<br /><small>', $meta_description.'</small>';\n break;\t\t\t\t\t \t\t\t\t\n\t\t\t /**\n\t\t\t\t * Meta-box Color Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'color':\n\t\t\t\t echo '<input class=\"color-field\" type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" />',\n '<br /><small>', $meta_description.'</small>';\n\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Textarea Field.\n\t\t\t\t */\t\n case 'textarea':\n echo '<textarea name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n '<br /><small>', $meta_description.'</small>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Select Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'select':\t\t\t\t\t\n\t\t\t\t\t echo '<select name=\"'.esc_attr($field['id']).'\" id=\"'.esc_attr($field['id']).'\">';\n\t\t\t\t\t\t foreach ($field['options'] as $option) {\n\t\t\t\t\t\t \t echo '<option', $meta == $option['value'] ? ' selected=\"selected\"' : '', ' value=\"'.$option['value'].'\">'.$option['label'].'</option>';\n\t\t\t\t\t \t } \n\t\t\t\t\t echo '</select><br /><span class=\"description\">'.$meta_description.'</span>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Radio Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'radio':\n\t\t\t\t\t foreach ( $field['options'] as $option ) {\n\t\t\t\t\t\t echo '<input type=\"radio\" name=\"'.esc_attr($field['id']).'\" id=\"'.$option['value'].'\" \n\t\t\t\t\t\t\t value=\"'.$option['value'].'\" ',$meta == $option['value'] ? ' checked=\"checked\"' : '',' />\n\t\t\t\t\t\t\t <label for=\"'.$option['value'].'\">'.$option['name'].'</label><br />';\n\t\t\t\t\t }\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Checkbox Field.\n\t\t\t\t */\t\n\t case 'checkbox':\n \t echo '<input type=\"checkbox\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Checkbox-group Field.\n\t\t\t\t */\t\n\t\t\t case 'checkbox_group':\n\t\t\t\t\t foreach ($field['options'] as $option) {\n\t\t\t\t\t echo '<input type=\"checkbox\" value=\"',$option['value'],'\" name=\"',esc_html($field['id']),'[]\" \n\t\t\t\t\t\t id=\"',$option['value'],'\"',$meta && in_array($option['value'], $meta) ? ' checked=\"checked\"' : '',' />\n\t\t\t\t\t\t <label for=\"'.$option['value'].'\">'.$option['name'].'</label><br />';\n\t\t\t\t\t }\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n\t\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Image Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'image':\n\t\t\t\t\t echo '<span class=\"upload\">';\n\t\t\t\t\t if( $meta ) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<input type=\"hidden\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" \n\t\t\t\t\t\t\t\t class=\"regular-text form-control text-upload\" value=\"',$meta,'\" />';\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<img style=\"width:150px; display:block;\" src= \"'.$meta.'\" class=\"preview-upload\" />';\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button button-upload\" id=\"logo_upload\" value=\"'.esc_html__('Upload an image','weddingvendor').'\"/></br>';\t\t\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button-remove\" id=\"remove\" value=\"'.esc_html__('Remove','weddingvendor').'\" /> ';\n\t\t\t\t\t }else {\n\t\t\t\t\t\t echo '<input type=\"hidden\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" \n\t\t\t\t\t\t\t\t\tclass=\"regular-text form-control text-upload\" value=\"',$meta,'\" />';\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<img style=\"\" src= \"'.$meta.'\" class=\"preview-upload\" />';\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button button-upload\" id=\"logo_upload\" value=\"'.esc_html__('Upload an image','weddingvendor').'\"/></br>';\t\t\n\t\t\t\t\t\t echo '<input type=\"button\" style=\"display:none;\" id=\"remove\" class=\"button-remove\" value=\"\" /> ';\n\t\t\t\t\t } echo '</span><span class=\"description\">'.$meta_description.'</span>';\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n }\n echo '<td></tr>';\n }\n echo '</table>';\n }", "public function dashboard_summary_metabox() {\r\n\t\t$core = WP_Smush::get_instance()->core();\r\n\r\n\t\t$resize_count = $core->get_savings( 'resize', false, false, true );\r\n\r\n\t\t// Split human size to get format and size.\r\n\t\t$human = explode( ' ', $core->stats['human'] );\r\n\r\n\t\t$resize_savings = 0;\r\n\t\t// Get current resize savings.\r\n\t\tif ( ! empty( $core->stats['resize_savings'] ) && $core->stats['resize_savings'] > 0 ) {\r\n\t\t\t$resize_savings = size_format( $core->stats['resize_savings'], 1 );\r\n\t\t}\r\n\r\n\t\t$this->view(\r\n\t\t\t'summary/meta-box',\r\n\t\t\tarray(\r\n\t\t\t\t'human_format' => empty( $human[1] ) ? 'B' : $human[1],\r\n\t\t\t\t'human_size' => empty( $human[0] ) ? '0' : $human[0],\r\n\t\t\t\t'remaining' => $this->get_total_images_to_smush(),\r\n\t\t\t\t'resize_count' => ! $resize_count ? 0 : $resize_count,\r\n\t\t\t\t'resize_enabled' => (bool) $this->settings->get( 'resize' ),\r\n\t\t\t\t'resize_savings' => $resize_savings,\r\n\t\t\t\t'stats_percent' => $core->stats['percent'] > 0 ? number_format_i18n( $core->stats['percent'], 1 ) : 0,\r\n\t\t\t\t'total_optimized' => $core->stats['total_images'],\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function display() {\n\t\tif (!empty($this->config['blog_id'])) {\n\t\t\t$default_data = get_blog_option($this->config['blog_id'], $this->config['name']);\n\t\t}\n\t\telse {\n\t\t\t$default_data = get_option($this->config['name']);\n\t\t}\n\t\t$data = apply_filters('cfinput_get_settings_value',$default_data,$this->config);\n\t\tif ($data != '') {\n\t\t\t$data = maybe_unserialize($data);\n\t\t}\n\t\t// kick off the repeater block with a wrapper div to contain everything\n\t\t$html .= '<div class=\"block_wrapper\">'. \n\t\t\t\t '<h4>'.\n\t\t\t\t (isset($this->config['block_label']) && !empty($this->config['block_label']) ? $this->config['block_label'] : '&nbsp;').\n\t\t\t\t '</h4>';\n\t\t\n\t\t// this div just contains the actual items in the group and it's where new elements are inserted\n\t\t$html .= '<div id=\"'.$this->config['name'].'\" class=\"insert_container\">';\n\t\t\t\t\t\n\t\tif (is_array($this->config['items'])) {\n\t\t\t// if we have data then we need to display it first\n\t\t\tif (!empty($data)) {\n\t\t\t\tforeach ($data as $index => $each) {\n\t\t\t\t\t\n\t\t\t\t\t$html .= $this->make_block_item(array('index' => $index++, 'items' => $each));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// else we can just display an empty set \n\t\t\telse {\n\t\t\t\t$html .= $this->make_block_item(array('index' => 0));\n\t\t\t}\n\t\t}\n\t\t$html .= '</div>'; // this is the end of the .insert_container div\n\t\t\n\t\t// JS for inserting and removing new elements for repeaters\n\t\t$html .= '\n\t\t\t<script type=\"text/javascript\" charset=\"utf-8\">\n\t\t\t\tfunction addAnother'.$this->config['name'].'() {\n\t\t\t\t\tif (jQuery(\\'#'.$this->config['name'].'\\').children().length > 0) {\n\t\t\t\t\t\tlast_element_index = jQuery(\\'#'.$this->config['name'].' fieldset:last\\').attr(\\'id\\').match(/'.$this->config['name'].'_([0-9])/);\n\t\t\t\t\t\tnext_element_index = Number(last_element_index[1])+1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext_element_index = 1;\n\t\t\t\t\t}\n\t\t\t\t\tinsert_element = \\''.str_replace(PHP_EOL,'',trim($this->make_block_item())).'\\';\n\t\t\t\t\tinsert_element = insert_element.replace(/'.$this->repeater_index_placeholder.'/g, next_element_index);\n\t\t\t\t\tjQuery(insert_element).appendTo(\\'#'.$this->config['name'].'\\');\n\t\t\t\t}\n\t\t\t\tfunction delete'.$this->config['name'].'(del_el) {\n\t\t\t\t\tif(confirm(\\'Are you sure you want to delete this?\\')) {\n\t\t\t\t\t\tjQuery(del_el).parent().remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</script>';\n\n\t\t/* If we have add_another button text set, use that instead of the block_label */\n\t\tif (isset($this->config['add_another_button_text']) && !empty($this->config['add_another_button_text'])) {\n\t\t\t$add_another_text = $this->config['add_another_button_text'];\t\n\t\t}\n\t\telse {\n\t\t\t$add_another_text = 'Add Another '.$this->config['block_label'];\t\n\t\t} \n\t\t\n\t\t$html .= '<p class=\"cf_meta_actions\"><a href=\"#\" onclick=\"addAnother'.$this->config['name'].'(); return false;\" '.\n\t\t\t 'class=\"add_another button-secondary\">'.$add_another_text.'</a></p>'.\n\t\t\t\t '</div><!-- close '.$this->config['name'].' wrapper -->';\n\t\t\n\t\treturn $html;\n\t}", "function inspiry_additional_details() { ?>\n <div class=\"inspiry-details-wrapper\">\n <label><?php esc_html_e( 'Additional Details', 'framework' ); ?></label>\n <div class=\"inspiry-detail-header\">\n <p class=\"title\"><?php esc_html_e( 'Title', 'framework' ); ?></p>\n <p class=\"value\"><?php esc_html_e( 'Value', 'framework' ); ?></p>\n </div>\n <div id=\"inspiry-additional-details-container\">\n\t\t\t\t<?php\n\t\t\t\tif ( realhomes_dashboard_edit_property() || inspiry_is_edit_property() ) {\n\t\t\t\t\tglobal $target_property;\n\n\t\t\t\t\tif ( function_exists( 'ere_additional_details_migration' ) ) {\n\t\t\t\t\t\tere_additional_details_migration( $target_property->ID ); // Migrate property additional details from old metabox key to new key.\n\t\t\t\t\t}\n\n\t\t\t\t\t$additional_details = get_post_meta( $target_property->ID, 'REAL_HOMES_additional_details_list', true );\n\t\t\t\t\tif ( ! empty( $additional_details ) ) {\n\t\t\t\t\t\t$additional_details = array_filter( $additional_details ); // remove empty values.\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $additional_details ) ) {\n\t\t\t\t\t\tforeach ( $additional_details as $additional_detail ) {\n\t\t\t\t\t\t\tinspiry_render_additional_details( $additional_detail[0], $additional_detail[1] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinspiry_render_additional_details();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$default_details = apply_filters( 'inspiry_default_property_additional_details', array() );\n\t\t\t\t\tif ( ! empty( $default_details ) ) {\n\t\t\t\t\t\tforeach ( $default_details as $title => $value ) {\n\t\t\t\t\t\t\tinspiry_render_additional_details( $title, $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinspiry_render_additional_details();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n </div>\n <button class=\"add-detail btn btn-primary\"><i class=\"fas fa-plus\"></i><?php esc_attr_e( 'Add More', 'framework' ); ?></button>\n </div>\n\t\t<?php\n\t}", "public function getSummaryBox(){\n \n $TPL = new \\ELBP\\Template();\n \n $TPL->set(\"obj\", $this);\n \n $quals = $this->getStudentsQualifications();\n $courses = $this->getStudentsCoursesWithoutQualifications();\n \n if ($quals)\n {\n foreach($quals as $qual)\n {\n $qual->aspirationalGrade = $this->getAspirationalTargetGrade($qual->get_id());\n $qual->targetGrade = $this->getTargetGrade($qual->get_id());\n if (is_array($qual->aspirationalGrade)) $qual->aspirationalGrade = reset($qual->aspirationalGrade);\n if (is_array($qual->targetGrade)) $qual->targetGrade = reset($qual->targetGrade);\n }\n }\n \n if ($courses)\n {\n foreach($courses as $course)\n {\n $course->aspirationalGrade = $this->getAspirationalTargetGradeCourse($course->id);\n $course->targetGrade = $this->getTargetGradeCourse($course->id);\n if (is_array($course->aspirationalGrade)) $course->aspirationalGrade = reset($course->aspirationalGrade);\n if (is_array($course->targetGrade)) $course->targetGrade = reset($course->targetGrade);\n }\n }\n \n usort($quals, function($a, $b){\n return strcasecmp($a->get_display_name(), $b->get_display_name());\n });\n \n usort($courses, function($a, $b){\n return strcasecmp($a->fullname, $b->fullname);\n });\n \n $TPL->set(\"quals\", $quals);\n $TPL->set(\"courses\", $courses);\n \n try {\n return $TPL->load($this->CFG->dirroot . $this->path . 'tpl/elbp_target_grades/summary.html');\n }\n catch (\\ELBP\\ELBPException $e){\n return $e->getException();\n }\n \n }", "function field_details() \n { ?>\n <div class=\"field-details\">\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?><label <?php $this->for_tag(\"inferno-concrete-setting-\"); ?>><?php endif; ?>\n <?php echo $this->setting['desc']; ?>\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?></label><?php endif; ?>\n\n <?php if(isset($this->setting['more']) && $this->setting['more'] != '') : ?>\n <span class=\"more\"><?php echo $this->setting['more']; ?></span>\n <?php endif; ?>\n\n <?php if($this->setting['type'] == 'font') : ?>\n <div class=\"googlefont-desc\">\n <label <?php $this->for_tag(\"inferno-concrete-setting-\", \"-googlefont\"); ?>>\n <?php _e('Enter the Name of the Google Webfont You want to use, for example \"Droid Serif\" (without quotes). Leave blank to use a Font from the selector above.', 'inferno'); ?>\n </label>\n <span class=\"more\">\n <?php _e('You can view all Google fonts <a href=\"http://www.google.com/webfonts\">here</a>. Consider, that You have to respect case-sensitivity. If the font has been successfully recognized, the demo text will change to the entered font.', 'inferno'); ?>\n </span>\n </div>\n <?php endif; ?>\n </div>\n <?php\n }", "public function display_summary() {\n // FIXME\n }", "function createPlayerSummary() {\n $records = $this->Players->all();\n\n //Prime the table class to display player info. Wasn't sure what equity was though...\n $this->load->library('table');\n $parms = array(\n 'table_open' => '<table class=\"table-right-game\">',\n 'cell_start' => '<td class=\"player\">',\n 'cell_alt_start' => '<td class=\"player\">'\n );\n\n $this->table->set_template($parms);\n $this->table->set_heading('Player', 'Peanuts', 'Equity');\n\n foreach ($records as $row) {\n $this->table->add_row($row->Player, $row->Peanuts);\n }\n\n //Generate the table\n $this->data['wtable'] = $this->table->generate();\n }", "private function showDetailsHorizontal()\n\t{\n\t\t$style = $this->col_aggr_sum ? 'table-details-left' : 'table-details-right';\n\t\t\n\t\tforeach ($this->data_show as $key => $row)\n\t\t{\n\t\t\techo '<div id=\"row_' . $key . '\" class=\"slider ' . $style . '\">\n\t\t\t\t<table class=\"table table-striped\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>';\n\n\t\t\t\t\t\t\tforeach ($row['details'][0] as $col => $val)\n\t\t\t\t\t\t\t\techo '<th>' . $col . '</th>';\n\t\t\t\n\t\t\t\t\t\techo '</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ($row['details'] as $item)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo '<tr>';\n\n\t\t\t\t\t\t\tforeach ($item as $col => $val)\n\t\t\t\t\t\t\t\techo '<td class=\"' . $col . '\">' . $val . '</td>';\n\n\t\t\t\t\t\t\techo '</tr>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\techo '<tbody>\n\t\t\t\t</table>\n\t\t\t</div>';\n\t\t}\n\t}", "function field_tags($sum){\n\t\t$max = 12;\n\t\t$per_row = ceil($max / $sum);\n\t\t$fields = '<div class=\"col-xs-12 col-md-'.$per_row.'\">';\n\t\t// $fields = '<div class=\"row\">';\n\t\treturn $fields;\n\t}", "public function buildLightbox(){\n\n\t\t$fields = $this->getFields();\n\n\t\techo '<div class=\"main-content\">';\n\t\t\n\t\t\tforeach( $fields as $field ){\n\n\t\t\t\t$field->render();\n\n\t\t\t\tif( method_exists( $field, 'renderTemplate' ) )\n\t\t\t\t\techo $field->renderTemplate();\n\n\t\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"side-content\">';\n\t\t\t\n\t\t\t$this->saveButton();\n\n\t\techo '</div>';\n\t}", "function inspiry_render_additional_details( $title = '', $value = '' ) {\n\t\t?>\n <div class=\"inspiry-detail\">\n <div class=\"inspiry-detail-sort-handle\"><i class=\"fas fa-grip-horizontal\"></i></div>\n <div class=\"inspiry-detail-title\">\n <input type=\"text\" name=\"detail-titles[]\" value=\"<?php echo esc_attr( $title ); ?>\" placeholder=\"<?php esc_attr_e( 'Title', 'framework' ); ?>\"/>\n </div>\n <div class=\"inspiry-detail-value\">\n <input type=\"text\" name=\"detail-values[]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"<?php esc_attr_e( 'Value', 'framework' ); ?>\"/>\n </div>\n <div class=\"inspiry-detail-remove-detail\">\n <button class=\"remove-detail btn btn-primary\"><i class=\"fas fa-trash-alt\"></i></button>\n </div>\n </div>\n\t\t<?php\n\t}", "function init()\n {\n\n $elements = array(\n 'page_id' => array('hidden')\n , 'name' => array('text', array('label' => 'Name', 'options' => array('StringLength' => array(false, array(1, 50)),), 'filters' => array('StringTrim'), 'required' => true))\n , 'title' => array('text', array('label' => 'Title', 'options' => array('StringLength' => array(false, array(4, 255)),),'filters' => array('StringTrim'), 'required' => true))\n , 'meta' => array('text', array('label' => 'meta', 'options' => array('StringLength' => array(false, array(4, 255))), 'filters' => array('StringTrim'),))\n , 'description' => array('textarea',array('label' => 'description', 'attribs' => array('rows' => 2), 'filters' => array('StringTrim'), 'required' => true))\n , 'body' => array('textarea',array('label' => 'body', 'attribs' => array('rows' => 7), 'filters' => array('StringTrim'), 'required' => true))\n );\n $this->addElements($elements);\n\n // --- Groups ----------------------------------------------\n $this->addDisplayGroup(array('name','title', 'meta'), 'display-head', array('legend'=>'display-head'));\n $this->addDisplayGroup(array('description', 'body'), 'display-body', array('legend'=>'display-body'));\n parent::init();\n }", "protected function _getForm() \r\n\t{ \r\n\t\t$form = \"\";\r\n\t\t$allElementSets = $this->_getAllElementSets();\r\n\t\t$ignoreElements = array();\r\n\t\tforeach ($allElementSets as $elementSet) { //traverse each element set to create a form group for each\r\n\t\t\tif($elementSet['name'] != \"Item Type Metadata\") { // start with non item type metadata\r\n\t\t\t\t\r\n\t\t\t\t$form .= '<div id=\"' . text_to_id($elementSet['name']) . '-metadata\">';\r\n\t\t\t\t$form .= '<fieldset class=\"set\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\" id=\"';\r\n\t\t\t\t$form .= html_escape(text_to_id($elementSet['name']) . '-description') . '\">';\r\n\t\t\t\t$form .= url_to_link(__($elementSet['description'])) . '</p>';\r\n\t\t\t\t\r\n\t\t\t\t$elements = $this->_getAllElementsInSet($elementSet['id']);\r\n\t\t\t\tforeach ($elements as $element) { //traverse each element in the set to create a form input for each in the form group\r\n\t\t\t\t\t$allElementValues = $this->_allElementValues($element['id'], $elements);\r\n\t\t\t\t\tif ((!in_array($element['id'], $ignoreElements)) && (count($allElementValues) > 1)) { // if the element has a value and has multiple inputs\r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, true);\r\n\t\t\t\t\t\tarray_push($ignoreElements, $element['id']);\r\n\t\t\t\t\t} else if (!in_array($element['id'], $ignoreElements)) { \r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= \"</fieldset>\";\r\n\t\t\t\t$form .= \"</div>\";\r\n\t\t\t} else { // if item type metadata\r\n\t\t\t\t$item_types = get_records('ItemType', array('sort_field' => 'name'), 1000);\r\n\t\t\t\t$defaultItemType = $this->_helper->db->getTable('DefaultMetadataValue')->getDefaultItemType();\r\n\t\t\t\t$defaultItemTypeId = 0;\r\n\t\t\t\tif (!empty($defaultItemType)) {\r\n\t\t\t\t\t$defaultItemTypeId = intval($defaultItemType[0][\"text\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '<div id=\"item-type-metadata-metadata\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<div class=\"field\" id=\"type-select\">';\r\n\t\t\t\t$form .= '<div class=\"two columns alpha\">';\r\n\t\t\t\t$form .= '<label for=\"item-type\">Item Type</label> </div>';\r\n\t\t\t\t$form .= '<div class=\"inputs five columns omega\">';\r\n\t\t\t\t$form .= '<select name=\"item_type_id\" id=\"item-type\">';\r\n\t\t\t\t$form .= '<option value=\"\">Select Below </option>';\r\n\t\t\t\tforeach ($item_types as $item_type) {\r\n\t\t\t\t\tif($item_type[\"id\"] == $defaultItemTypeId) {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\" selected=\"selected\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '</select> </div>';\r\n\t\t\t\t$form .= '<input type=\"submit\" name=\"change_type\" id=\"change_type\" value=\"Pick this type\" style=\"display: none;\">';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '<div id=\"type-metadata-form\">';\r\n\t\t\t\t$form .= '<div class=\"five columns offset-by-two omega\">';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\">';\r\n\t\t\t\t$form .= '</p>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n return $form;\r\n }", "function meta_box_field_groups(){\n \n foreach($this->field_groups as $field_group){ ?>\n\n <div class=\"acf-field\">\n\n <div class=\"acf-label\">\n <label><a href=\"<?php echo admin_url(\"post.php?post={$field_group['ID']}&action=edit\"); ?>\"><?php echo $field_group['title']; ?></a></label>\n <p class=\"description\"><?php echo $field_group['key']; ?></p>\n </div>\n\n <div class=\"acf-input\">\n \n <?php if(acf_maybe_get($field_group, 'fields')){ ?>\n\n <table class=\"acf-table\">\n <thead>\n <th class=\"acf-th\" width=\"25%\"><strong>Label</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Name</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Key</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Type</strong></th>\n </thead>\n\n <tbody>\n <?php\n \n $array = array();\n foreach($field_group['fields'] as $field){\n \n $this->get_fields_labels_recursive($array, $field);\n \n }\n \n foreach($array as $field_key => $field_label){\n \n $field = acf_get_field($field_key);\n $type = acf_get_field_type($field['type']);\n $type_label = '-';\n if(isset($type->label))\n $type_label = $type->label;\n ?>\n\n <tr class=\"acf-row\">\n <td width=\"25%\"><?php echo $field_label; ?></td>\n <td width=\"25%\"><code style=\"font-size:12px;\"><?php echo $field['name']; ?></code></td>\n <td width=\"25%\"><code style=\"font-size:12px;\"><?php echo $field_key; ?></code></td>\n <td width=\"25%\"><?php echo $type_label; ?></td>\n </tr>\n \n <?php } ?>\n </tbody>\n </table>\n \n <?php } ?>\n </div>\n\n </div>\n \n <?php } ?>\n\n <script type=\"text/javascript\">\n if(typeof acf !== 'undefined'){\n\n acf.newPostbox(<?php echo wp_json_encode(array(\n 'id' => 'acfe-form-details',\n 'key' => '',\n 'style' => 'default',\n 'label' => 'left',\n 'edit' => false\n )); ?>);\n\n }\n </script>\n <?php\n \n }", "function cmb2_render_coupon_summary( $field, $escaped_value, $object_id, $object_type, $field_type_object ) {\r\n wpcoupon_setup_coupon( $object_id );\r\n ?>\r\n <div class=\"st-type-summary\">\r\n <span><i class=\"wifi icon\"></i> <?php printf( _n( '%s view', '%s views', wpcoupon_coupon()->get_total_used(), 'wp-coupon' ), wpcoupon_coupon()->get_total_used() ); ?></span>\r\n <span><i class=\"smile icon\"></i> <?php echo wpcoupon_coupon()->_wpc_vote_up; ?></span>\r\n <span><i class=\"frown icon\"></i> <?php echo wpcoupon_coupon()->_wpc_vote_down; ?></span>\r\n </div>\r\n <?php\r\n wp_reset_postdata();\r\n}", "public function buildFormLayout()\n {\n $this->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('title');\n })->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('cover');\n $column->withSingleField('description');\n $column->withSingleField('price');\n $column->withSingleField('tags');\n });\n }", "function show() {\n\t\tglobal $post;\n\n\t\t// Use nonce for verification\n\t\techo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\t\n\t\techo '<table class=\"form-table\">';\n\n\t\tforeach ($this->_meta_box['fields'] as $field) {\n\t\t\t// get current post meta data\n\t\t\t$meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\n\t\t\techo '<tr>',\n\t\t\t\t\t'<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n\t\t\t\t\t'<td>';\n\t\t\tswitch ($field['type']) {\n\t\t\t\tcase 'text':\n\t\t\t\t\techo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n\t\t\t\t\t\t'<br />', $field['desc'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'textarea':\n\t\t\t\t\techo '<textarea name=\"', $field['id'], '\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n\t\t\t\t\t\t'<br />', $field['desc'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'select':\n\t\t\t\t\techo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n\t\t\t\t\tforeach ($field['options'] as $option) {\n\t\t\t\t\t\techo '<option', $meta == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n\t\t\t\t\t}\n\t\t\t\t\techo '</select>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'radio':\n\t\t\t\t\tforeach ($field['options'] as $option) {\n\t\t\t\t\t\techo '<input type=\"radio\" name=\"', $field['id'], '\" value=\"', $option['value'], '\"', $meta == $option['value'] ? ' checked=\"checked\"' : '', ' />', $option['name'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\techo '<input type=\"checkbox\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'file':\n\t\t\t\t\techo $meta ? \"$meta<br />\" : '', '<input type=\"file\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" />',\n\t\t\t\t\t\t'<br />', $field['desc'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image':\n\t\t\t\t\techo $meta ? \"<img src=\\\"$meta\\\" width=\\\"150\\\" height=\\\"150\\\" /><br />$meta<br />\" : '', '<input type=\"file\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" />',\n\t\t\t\t\t\t'<br />', $field['desc'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\techo \t'<td>',\n\t\t\t\t'</tr>';\n\t\t}\n\t\n\t\techo '</table>';\n\t}", "private function addGeneralDetails(){\n $sitePowerImport = $this->createElement('text', 'sitePowerImport')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n $sitePowerCost = $this->createElement('text', 'sitePowerCost')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0));\n $operatingHours = $this->createElement('text', 'operatingHours')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 1, 'max' => 8760, 'inclusive' => true));\n $makeupWaterCost = $this->createElement('text', 'makeupWaterCost')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0));\n \n $minTemp = $this->mS->standardize(39.9999999999999,'temperature','F'); \n $maxTemp = $this->mS->standardize(160.000000000001,'temperature','F'); \n $makeupWaterTemp = $this->createElement('text', 'makeupWaterTemp')\n ->setValue( $this->mS->localize(283.15, 'temperature') )\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->localize($minTemp,'temperature'), 'max' => $this->mS->localize($maxTemp,'temperature'), 'inclusive' => true));\n\n $fuelUnitCost = $this->createElement('text', 'fuelUnitCost')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0));\n\n $this->addElements(array(\n $sitePowerImport,\n $sitePowerCost,\n $operatingHours,\n $makeupWaterCost,\n $makeupWaterTemp,\n $fuelUnitCost,\n ));\n }", "function cbGenHtml($number, $title, $englishTitle, $author, $summary,\n $summaryCount, $url, $authorName, $date) {\n echo\n '<p align=\"center\">'\n . \"<p align='center'>\"\n . cbGenSpan(\"number\", $number)\n . ' - '\n . cbGenSpan(\"german-title\", $title)\n . \"<br>\"\n . cbGenSpan(\"english-title\", $englishTitle)\n . \"<br>\"\n . cbGenSpan(\"author\", $author)\n . \"<hr width='20%'/>\"\n . \"</p>\"\n . \"<htr>\"\n . \"<table><tr><td>\"\n ;\n\n if ($summaryCount > 0) {\n echo cbGenSpan(\"text\", $summary);\n echo '</td>'\n . '<td valign=\"top\">'\n\t. cbGenCover($url, \"right\")\n . '</td></tr></table>'\n ;\n\n } else {\n global $MAIN_URL, $EDIT_SUMMARY_URL;\n echo\n '</table>'\n . '<p align=\"center\">'\n\t. cbGenCover($url, \"center\")\n . '<br>'\n . 'No summary was found for this issue.<br>\n You can <a href=\"'\n . $EDIT_SUMMARY_URL\n . '?number='\n . $number\n . '\">submit one</a> or return to the '\n\t. '<a href=\"' . $MAIN_URL . '\">main page</a></p>';\n }\n\n echo '<p align=\"right\">'\n . (is_null($authorName) ? \"\" : cbGenSpanSmall(\"author\", $authorName))\n . (is_null($date) ? \"\" : \" \" . cbGenSpanSmall(\"date\", $date))\n . '</p>'\n ;\n}", "public function render () {\n\n $defaults = array(\n 'show' => array(\n 'title' => true,\n 'description' => true,\n 'url' => true,\n ),\n 'content_title' => __ ( 'Filter', 'uplift' )\n );\n\n $this->field = wp_parse_args ( $this->field, $defaults );\n\n echo '<div class=\"redux-supersearch-accordion\" data-new-content-title=\"' . esc_attr ( sprintf ( __ ( 'New %s', 'uplift' ), $this->field[ 'content_title' ] ) ) . '\">';\n\n $x = 0;\n\n $multi = ( isset ( $this->field[ 'multi' ] ) && $this->field[ 'multi' ] ) ? ' multiple=\"multiple\"' : \"\";\n\n if ( isset ( $this->value ) && is_array ( $this->value ) && !empty ( $this->value ) ) {\n\n $slides = $this->value;\n\n foreach ( $slides as $slide ) {\n\n if ( empty ( $slide ) ) {\n continue;\n }\n\t\t\t\n\t\t\t\t\t$defaults = array(\n 'beforetext' => '',\n 'ss-filter' => '',\n 'label' => '',\n 'aftertext' => '',\n );\n $slide = wp_parse_args ( $slide, $defaults );\n\n echo '<div class=\"redux-supersearch-accordion-group\"><fieldset class=\"redux-field\" data-id=\"' . $this->field[ 'id' ] . '\"><h3><span class=\"redux-supersearch-header\">' . $slide[ 'beforetext' ] . '</span></h3><div>';\n\n echo '<div class=\"redux_slides_add_remove\">';\n\n \techo '<ul id=\"' . $this->field[ 'id' ] . '-ul\" class=\"redux-slides-list\">';\n\n //BEFORE TEXT\n\t\t\t\t\t$placeholder = ( isset ( $this->field[ 'placeholder' ][ 'beforetext' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'beforetext' ] ) : __ ( 'Before Text', 'uplift' );\n echo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-before_text_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][beforetext]' . $this->field['name_suffix'] . '\" value=\"' . esc_attr ( $slide[ 'beforetext' ] ) . '\" placeholder=\"' . $placeholder . '\" class=\"full-text slide-title\" /></li>';\n\n \t\t$filter_array = sf_get_woo_product_filters_array();\n\t\t\t\t\t\n \t\t//FILTER \n\t\t\t $placeholder = ( isset ( $this->field[ 'placeholder' ][ 'ss-filter' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'ss-filter' ] ) : __ ( 'Filter', 'uplift' );\n \t\t\t\n echo '<li><select id=\"' . $this->field[ 'id' ] . '-filter_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][ss-filter]' . $this->field['name_suffix'] .'\" value=\"' . esc_attr ( $slide[ 'ss-filter' ] ) . '\" class=\"ss-select full-text\" placeholder=\"' . $placeholder . '\" />';\n\t\t\t\t\t\n\t\t\t\t\techo '<option value=\"\">'.__ ( 'Choose an option', 'uplift' ).'</option>';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tforeach ($filter_array as $filter => $filter_text) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($filter == $slide[ 'ss-filter' ]) {\n\t\t\t\t\t\t\techo '<option value=\"'.$filter.'\" selected>'.$filter_text.'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\techo '<option value=\"'.$filter.'\" >'.$filter_text.'</option>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo '</select></li>';\n\t\t\t\t\t\n\t\t\t\t\t//LABEL\n\t\t\t $placeholder = ( isset ( $this->field[ 'placeholder' ][ 'label' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'label' ] ) : __ ( 'Label', 'uplift' );\n \t\t\t\n echo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-label_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][label]' . $this->field['name_suffix'] .'\" value=\"' . esc_attr ( $slide[ 'label' ] ) . '\" class=\"full-text\" placeholder=\"' . $placeholder . '\" /></li>';\n\t\t\t\t\t\n\t\t\t\t\t//AFTER TEXT\n\t\t\t $placeholder = ( isset ( $this->field[ 'placeholder' ][ 'aftertext' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'aftertext' ] ) : __ ( 'After Text', 'uplift' );\n \t\t\t\n echo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-after_text_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][aftertext]' . $this->field['name_suffix'] .'\" value=\"' . esc_attr ( $slide[ 'aftertext' ] ) . '\" class=\"full-text\" placeholder=\"' . $placeholder . '\" /></li>';\n\t\t\t\t\t\n echo '<li><input type=\"hidden\" class=\"slide-sort\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][sort]' . $this->field['name_suffix'] .'\" id=\"' . $this->field[ 'id' ] . '-sort_' . $x . '\" value=\"' . $slide[ 'sort' ] . '\" />';\n\n\n echo '<li><a href=\"javascript:void(0);\" class=\"button deletion redux-supersearch-remove\">' . sprintf ( __ ( 'Delete %s', 'uplift' ), $this->field[ 'content_title' ] ) . '</a></li>';\n echo '</ul></div></fieldset></div>';\n $x ++;\n }\n }\n\n if ( $x == 0 ) {\n echo '<div class=\"redux-supersearch-accordion-group\"><fieldset class=\"redux-field\" data-id=\"' . $this->field[ 'id' ] . '\"><h3><span class=\"redux-supersearch-header\">New ' . $this->field[ 'content_title' ] . '</span></h3><div>';\n\n $hide = ' hide';\n\n echo '<div class=\"screenshot' . $hide . '\">';\n echo '<a class=\"of-uploaded-image\" href=\"\">';\n echo '<img class=\"redux-supersearch-image\" id=\"image_image_id_' . $x . '\" src=\"\" alt=\"\" target=\"_blank\" rel=\"external\" />';\n echo '</a>';\n echo '</div>';\n\n echo '<ul id=\"' . $this->field[ 'id' ] . '-ul\" class=\"redux-supersearch-list\">';\n \n $placeholder = ( isset ( $this->field[ 'placeholder' ][ 'beforetext' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'beforetext' ] ) : __ ( 'Before Text', 'uplift' );\n echo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-before_text_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][beforetext]' . $this->field['name_suffix'] .'\" value=\"\" placeholder=\"' . $placeholder . '\" class=\"full-text slide-title\" /></li>';\n\n /* Filter Field\t*/\n\t\t\t\t$placeholder = ( isset ( $this->field[ 'placeholder' ][ 'ss-filter' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'ss-filter' ] ) : __ ( 'Filter', 'uplift' );\n\t\t\t\techo '<li><select id=\"' . $this->field[ 'id' ] . '-filter_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][ss-filter]' . $this->field['name_suffix'] .'\" value=\"\" class=\"ss-select full-text\" placeholder=\"' . $placeholder . '\" />';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$filter_array = sf_get_woo_product_filters_array();\n\t\t\t\t\t\n\t\t\t\techo '<option value=\"\">'.__ ( 'Choose an option', 'uplift' ).'</option>';\n\t\t\t\t\n\t\t\t\tforeach ($filter_array as $filter => $filter_text) {\n\t\t\t\t\tif ($filter == $slide[ 'ss-filter' ]) {\n\t\t\t\t\t\techo '<option value=\"'.$filter.'\" selected>'.$filter_text.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\techo '<option value=\"'.$filter.'\" >'.$filter_text.'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\techo '</select></li>';\n\t\t\t\t\n\t\t\t/* Label Field */\n\t\t\t\t$placeholder = ( isset ( $this->field[ 'placeholder' ][ 'label' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'label' ] ) : __ ( 'Label', 'uplift' );\n\t\t\t\techo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-label_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][label]' . $this->field['name_suffix'] .'\" value=\"\" class=\"full-text\" placeholder=\"' . $placeholder . '\" /></li>';\n\n\t\t\t\t\n\t\t\t\t/* After Text Field */\n\t\t\t\t$placeholder = ( isset ( $this->field[ 'placeholder' ][ 'after' ] ) ) ? esc_attr ( $this->field[ 'placeholder' ][ 'after' ] ) : __ ( 'After Text', 'uplift' );\n\t\t\t\techo '<li><input type=\"text\" id=\"' . $this->field[ 'id' ] . '-after_text_' . $x . '\" name=\"' . $this->field[ 'name' ] . '[' . $x . '][aftertext]' . $this->field['name_suffix'] .'\" value=\"\" class=\"full-text\" placeholder=\"' . $placeholder . '\" /></li>';\t\t\t\t\n echo '</ul></div></fieldset></div>';\n }\n echo '</div><a href=\"javascript:void(0);\" class=\"button redux-supersearch-add button-primary\" rel-id=\"' . $this->field[ 'id' ] . '-ul\" rel-name=\"' . $this->field[ 'name' ] . '[title][]' . $this->field['name_suffix'] .'\">' . sprintf ( __ ( 'Add %s', 'uplift' ), $this->field[ 'content_title' ] ) . '</a><br/>';\n }", "function PricerrTheme_summary_scr()\n{\n $id_icon = 'icon-options-general8';\n $ttl_of_stuff = 'PricerrTheme - ' . __('Site Summary', 'PricerrTheme');\n\n //------------------------------------------------------\n\n echo '<div class=\"wrap\">';\n echo '<div class=\"icon32\" id=\"' . $id_icon . '\"><br/></div>';\n echo '<h2 class=\"my_title_class_sitemile\">' . $ttl_of_stuff . '</h2>';\n\n ?>\n\n <div id=\"usual2\" class=\"usual\">\n <ul>\n <li><a href=\"#tabs1\" class=\"selected\"><?php _e('Main Summary', 'PricerrTheme'); ?></a></li>\n <!-- <li><a href=\"#tabs2\"><?php _e('Other Information', 'PricerrTheme'); ?></a></li> -->\n\n </ul>\n <div id=\"tabs1\">\n <table width=\"100%\" class=\"sitemile-table\">\n <tr>\n <td width=\"200\">Total number of jobs</td>\n <td><?php echo PricerrTheme_get_total_nr_of_listings(); ?></td>\n </tr>\n\n <tr>\n <td>Open jobs</td>\n <td><?php echo PricerrTheme_get_total_nr_of_open_listings(); ?></td>\n </tr>\n\n <tr>\n <td>Closed</td>\n <td><?php echo PricerrTheme_get_total_nr_of_closed_listings(); ?></td>\n </tr>\n\n <!-- \n <tr>\n <td>Disputed & Not Finished</td>\n <td>12</td>\n </tr>\n -->\n <tr>\n <td>Total Users</td>\n <td><?php\n $result = count_users();\n echo 'There are ', $result['total_users'], ' total users';\n foreach ($result['avail_roles'] as $role => $count)\n echo ', ', $count, ' are ', $role, 's';\n echo '.';\n ?></td>\n </tr>\n </table>\n </div>\n\n <div id=\"tabs2\">\n\n </div>\n\n <?php echo '</div>';\n}", "function form($instance) {\n $instance = wp_parse_args( (array) $instance, array( 'title' => 'WP-Popular Posts Tool', 'itemsQuantity' => 5, 'catId' => 0 ) );\n $title = strip_tags($instance['title']);\n $itemsQuantity = absint($instance['itemsQuantity']);\n $catId = absint($instance['catId']);\n $displayMode = absint($instance['displayMode']);\n $disableCommentCount = absint($instance['disableCommentCount']);\n $barsLocation = absint($instance['barsLocation']);\n ?>\n \n <p><label for=\"<?php echo $this->get_field_id('title'); ?>\">\n <?php echo esc_html__('Title'); ?>: \n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" \n type=\"text\" value=\"<?php echo attribute_escape($title); ?>\" />\n </label></p>\n \n <p><label for=\"<?php echo $this->get_field_id('itemsQuantity'); ?>\">\n <?php echo esc_html__('Number of items to show'); ?>: \n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('itemsQuantity'); ?>\" name=\"<?php echo $this->get_field_name('itemsQuantity'); ?>\" \n type=\"text\" value=\"<?php echo attribute_escape($itemsQuantity); ?>\" />\n </label></p> \n \n <p><label for=\"<?php echo $this->get_field_id('catId'); ?>\">\n <?php echo esc_html__('Id of the cateogory or tag (leave it blank for automatic detection)'); ?>: \n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('catId'); ?>\" name=\"<?php echo $this->get_field_name('catId'); ?>\" \n type=\"text\" value=\"<?php echo attribute_escape($catId); ?>\" />\n </label></p>\n \n <p><label for=\"<?php echo $this->get_field_id('displayMode'); ?>\">\n <?php echo esc_html__('Display mode'); ?>: \n <select class=\"widefat\" id=\"<?php echo $this->get_field_id('displayMode'); ?>\" name=\"<?php echo $this->get_field_name('displayMode'); ?>\" \n type=\"text\">\n <option value=\"0\" <?php if($displayMode == 0) echo 'selected'; ?>>Text Only</option>\n <option value=\"1\" <?php if($displayMode == 1) echo 'selected'; ?>>Graphic</option>\n </select>\n </label></p>\n \n <p><label for=\"<?php echo $this->get_field_id('barsLocation'); ?>\">\n <?php echo esc_html__('Bars Location (if mode = Graphic)'); ?>: \n <select class=\"widefat\" id=\"<?php echo $this->get_field_id('barsLocation'); ?>\" name=\"<?php echo $this->get_field_name('barsLocation'); ?>\" \n type=\"text\">\n <option value=\"0\" <?php if($barsLocation == 0) echo 'selected'; ?>>Left</option>\n <option value=\"1\" <?php if($barsLocation == 1) echo 'selected'; ?>>Right</option>\n </select>\n </label></p> \n \n <p><label for=\"<?php echo $this->get_field_id('disableCommentCount'); ?>\">\n <?php echo esc_html__('Disable comment count'); ?>: \n <select class=\"widefat\" id=\"<?php echo $this->get_field_id('disableCommentCount'); ?>\" name=\"<?php echo $this->get_field_name('disableCommentCount'); ?>\" \n type=\"text\">\n <option value=\"0\" <?php if($disableCommentCount == 0) echo 'selected'; ?>>No</option>\n <option value=\"1\" <?php if($disableCommentCount == 1) echo 'selected'; ?>>Yes</option>\n </select>\n </label></p> \n \n <?php\n }", "function cbDisplaySummary($number) {\n global $EDIT_SUMMARY_URL;\n\n cbTrace(\"DISPLAYING \" . $number);\n $heftRow = cbFindHeftRow($number) or cbTrace(mysql_error());\n $numRows = mysql_numrows($heftRow);\n\n $title = mysql_result($heftRow, 0, \"title\");\n $author = mysql_result($heftRow, 0, \"author\");\n $summaryRow = cbFindSummaryRow($number);\n $summaryCount = mysql_numrows($summaryRow);\n\n $url = sprintf(\"http://perry-kotlin.app.heroku/api/covers/%d\", $number);\n\n $date = null;\n if ($summaryCount > 0) {\n $summary = mysql_result($summaryRow, 0, \"summary\");\n $englishTitle = mysql_result($summaryRow, 0, \"english_title\");\n $date = mysql_result($summaryRow, 0, \"date\");\n $authorName = mysql_result($summaryRow, 0, \"author_name\");\n if ($date == null) $date = '';\n }\n\n cbGenHtml($number, $title, $englishTitle, $author, $summary,\n $summaryCount, $url, $authorName, $date);\n}", "public function meta_box_form_items() {\n\t\t$vfb_post = '';\n\t\t// Run Create Post add-on\n\t\tif ( class_exists( 'VFB_Pro_Create_Post' ) )\n\t\t\t$vfb_post = new VFB_Pro_Create_Post();\n\t?>\n\t\t<div class=\"taxonomydiv\">\n\t\t\t<p><strong><?php _e( 'Click or Drag' , 'visual-form-builder-pro'); ?></strong> <?php _e( 'to Add a Field' , 'visual-form-builder-pro'); ?> <img id=\"add-to-form\" alt=\"\" src=\"<?php echo admin_url( '/images/wpspin_light.gif' ); ?>\" class=\"waiting spinner\" /></p>\n\t\t\t<ul class=\"posttype-tabs add-menu-item-tabs\" id=\"vfb-field-tabs\">\n\t\t\t\t<li class=\"tabs\"><a href=\"#standard-fields\" class=\"nav-tab-link vfb-field-types\"><?php _e( 'Standard' , 'visual-form-builder-pro'); ?></a></li>\n\t\t\t\t<li><a href=\"#advanced-fields\" class=\"nav-tab-link vfb-field-types\"><?php _e( 'Advanced' , 'visual-form-builder-pro'); ?></a></li>\n\t\t\t\t<?php\n\t\t\t\t\tif ( class_exists( 'VFB_Pro_Create_Post' ) && method_exists( $vfb_post, 'form_item_tab' ) )\n\t\t\t\t\t\t$vfb_post->form_item_tab();\n\t\t\t\t?>\n\t\t\t</ul>\n\t\t\t<div id=\"standard-fields\" class=\"tabs-panel tabs-panel-active\">\n\t\t\t\t<ul class=\"vfb-fields-col-1\">\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-fieldset\">Fieldset</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-text\"><b></b>Text</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-checkbox\"><b></b>Checkbox</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-select\"><b></b>Select</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-datepicker\"><b></b>Date</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-url\"><b></b>URL</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-digits\"><b></b>Number</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-phone\"><b></b>Phone</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-file\"><b></b>File Upload</a></li>\n\t\t\t\t</ul>\n\t\t\t\t<ul class=\"vfb-fields-col-2\">\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-section\">Section</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-textarea\"><b></b>Textarea</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-radio\"><b></b>Radio</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-address\"><b></b>Address</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-email\"><b></b>Email</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-currency\"><b></b>Currency</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-time\"><b></b>Time</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-html\"><b></b>HTML</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-instructions\"><b></b>Instructions</a></li>\n\t\t\t\t</ul>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div> <!-- #standard-fields -->\n\t\t\t<div id=\"advanced-fields\"class=\"tabs-panel tabs-panel-inactive\">\n\t\t\t\t<ul class=\"vfb-fields-col-1\">\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-username\"><b></b>Username</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-hidden\"><b></b>Hidden</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-autocomplete\"><b></b>Autocomplete</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-min\"><b></b>Min</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-range\"><b></b>Range</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-name\"><b></b>Name</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-likert\"><b></b>Likert</a></li>\n\t\t\t\t</ul>\n\t\t\t\t<ul class=\"vfb-fields-col-2\">\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-password\"><b></b>Password</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-color\"><b></b>Color Picker</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-ip\"><b></b>IP Address</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-max\"><b></b>Max</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-pagebreak\"><b></b>Page Break</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"vfb-draggable-form-items\" id=\"form-element-rating\"><b></b>Rating</a></li>\n\t\t\t\t</ul>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div> <!-- #advanced-fields -->\n\t\t\t<?php\n\t\t\t\tif ( class_exists( 'VFB_Pro_Create_Post' ) && method_exists( $vfb_post, 'form_items' ) )\n\t\t\t\t\t$vfb_post->form_items();\n\t\t\t?>\n\t\t</div> <!-- .taxonomydiv -->\n\t\t<div class=\"clear\"></div>\n\t<?php\n\t}", "public function generateHtmlDivData()\n\t{\n\t\t// TODO : to be implemented\n\t}", "function get_summary_output($district_counts, $crm_dist, $name)\n{\n $label = \"$name - District $crm_dist\\n\"\n .\"Summary of contacts that are outside Senate District $crm_dist\\n\";\n\n $columns = [\n 'Senate District' => 12,\n 'Individuals' => 15,\n 'Households' => 14,\n 'Organizations' => 14,\n 'Total' => 16\n ];\n\n $output = '';\n $heading = $label . create_table_header($columns);\n\n ksort($district_counts);\n\n foreach ($district_counts as $dist => $counts) {\n $output .=\n fixed_width($dist, 12, false, 'Unknown')\n . fixed_width(get($counts, 'individual', '0'), 15, true)\n . fixed_width(get($counts, 'household', '0'), 14, true)\n . fixed_width(get($counts, 'organization', '0'), 14, true)\n . fixed_width(get($counts, 'contacts', '0'), 16, true) . \"\\n\";\n }\n\n return $heading . $output;\n}", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 1px solid\") ;\r\n\r\n $table->add_row($this->element_label(\"Organization\"),\r\n $this->element_form(\"Organization\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Name\"),\r\n $this->element_form(\"Meet Name\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Address 1\"),\r\n $this->element_form(\"Meet Address 1\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Address 2\"),\r\n $this->element_form(\"Meet Address 2\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet State\"),\r\n $this->element_form(\"Meet State\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Postal Code\"),\r\n $this->element_form(\"Meet Postal Code\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Country\"),\r\n $this->element_form(\"Meet Country\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Code\"),\r\n $this->element_form(\"Meet Code\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet Start\"),\r\n $this->element_form(\"Meet Start\")) ;\r\n\r\n $table->add_row($this->element_label(\"Meet End\"),\r\n $this->element_form(\"Meet End\")) ;\r\n\r\n $table->add_row($this->element_label(\"Pool Altitude\"),\r\n $this->element_form(\"Pool Altitude\")) ;\r\n\r\n $table->add_row($this->element_label(\"Course Code\"),\r\n $this->element_form(\"Course Code\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function workload_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Usecase Summary', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'countUsecase' => $this->M_workloadGraph->getCountUsecase(),\n\t\t\t'countMember' => $this->M_workloadGraph->getCountMember(),\n\t\t\t'graphNodes' => $this->M_workloadGraph->get_nodes(),\n\t\t\t'graphLinks' => $this->M_workloadGraph->get_links(),\n\t\t\t'judul' => 'Workload Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringWorkload',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['workloadSummary/workloadGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function _settings_field_contact_form_summary() {\n global $zendesk_support;\n $value = $zendesk_support->_is_default( 'contact_form_summary' ) ? '' : $zendesk_support->settings['contact_form_summary'];\n ?>\n <input type=\"text\" class=\"regular-text\" name=\"zendesk-settings[contact_form_summary]\" value=\"<?php echo $value; ?>\"\n placeholder=\"<?php echo $zendesk_support->default_settings['contact_form_summary']; ?>\"/>\n <?php\n }", "function showInputFields(){\n \t$HTML = '';\n\n \t//name field\n\t\t\tif ($this->shownamefield) {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"text\" size=\"'. $this->fieldsize.'\" value=\"'. addslashes(_JNEWS_NAME).'\" class=\"inputbox\" name=\"name\" onblur=\"if(this.value==\\'\\') this.value=\\''. addslashes(_JNEWS_NAME).'\\';\" onfocus=\"if(this.value==\\''. addslashes(_JNEWS_NAME).'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t} else {\n\t\t\t\t$text = '<input id=\"wz_11\" type=\"hidden\" value=\"\" name=\"name\" />';\n\t\t\t}\n\n\t\t //email field\n\t\t $text = '<input id=\"wz_12\" type=\"email\" size=\"' .$this->fieldsize .'\" value=\"\" class=\"inputbox\" name=\"email\" placeholder=\"'.addslashes(_JNEWS_YOUR_EMAIL_ADDRESS).'\"/>';\n\t\t //onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes(_JNEWS_EMAIL) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes(_JNEWS_EMAIL) .'\\') this.value=\\'\\' ; \" \n\t\t $HTML .= jnews::printLine($this->linear, $text);\n\n\t\t\t//for field columns\n\t\t\tif($GLOBALS[JNEWS.'level'] > 2){//check if the version of jnews is pro\n\n\t\t\t\tif ($this->column1){//show column1 in the subscribers module\n\t\t\t\t\t$text = '<input id=\"wz_13\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\" class=\"inputbox\" name=\"column1\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column1_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t\t}\n\n\t\t\t if ($this->column2){//show column2 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_14\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\" class=\"inputbox\" name=\"column2\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column2_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column3){//show column3 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_15\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\" class=\"inputbox\" name=\"column3\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column3_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\n\t\t\t if ($this->column4){//show column4 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_16\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\" class=\"inputbox\" name=\"column4\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column4_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t if ($this->column5){//show column5 in the subscribers module\n\t\t\t\t $text = '<input id=\"wz_17\" type=\"text\" size=\"' .$this->fieldsize .'\" value=\"' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\" class=\"inputbox\" name=\"column5\" onblur=\"if(this.value==\\'\\') this.value=\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\';\" onfocus=\"if(this.value==\\'' . addslashes($GLOBALS[JNEWS.'column5_name']) .'\\') this.value=\\'\\' ; \" />';\n\t\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t\t }\n\t\t\t}\n\n\t\t\treturn $HTML;\n }", "function show() {\n global $post;\n\n // Use nonce for verification\n echo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\n echo '<table class=\"form-table\">';\n\n foreach ($this->_meta_box['fields'] as $field) {\n // get current post meta data\n $meta = get_post_meta($post->ID, $field['id'], true);\n\n echo '<tr>',\n '<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n '<td>';\n switch ($field['type']) {\n case 'text':\n echo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n '<br />', $field['desc'];\n break;\n case 'textarea':\n echo '<textarea name=\"', $field['id'], '\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n '<br />', $field['desc'];\n break;\n case 'select':\n echo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n foreach ($field['options'] as $option) {\n echo '<option', $meta == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n }\n echo '</select>';\n break;\n case 'radio':\n foreach ($field['options'] as $option) {\n echo '<input type=\"radio\" name=\"', $field['id'], '\" value=\"', $option['value'], '\"', $meta == $option['value'] ? ' checked=\"checked\"' : '', ' />', $option['name'];\n }\n break;\n case 'checkbox':\n echo '<input type=\"checkbox\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n break;\n }\n echo '<td>',\n '</tr>';\n }\n\n echo '</table>';\n }", "function _field_grouped_fieldset ($fval) {\n\n $res = '';\n $setName = $this->name;\n\n // how many sets to show to begin w/?\n if (!empty($fval) and is_array($fval))\n $numsets = count($fval);\n\t\telse\n\t\t\t$numsets = (isset($this->attribs['numsets']))? $this->attribs['numsets'] : 1;\n\n $hiddens = '';\n $res .= \"<div id=\\\"proto_{$setName}\\\" data-numsets=\\\"{$numsets}\\\" data-setname=\\\"{$setName}\\\" class=\\\"formex_group\\\" style=\\\"display: none; margin:0; padding: 0\\\">\n <fieldset class=\\\"formex_grouped_fieldset {$this->element_class}\\\"><ul>\";\n\t\t\t\t\t\n\n foreach ($this->opts as $name => $parms) {\n\t\t\t$newelem = new formex_field($this->fex, $name, $parms);\n\n\t\t\t$res .= '<li>';\n\t\t\tif ($newelem->type != 'hidden') {\n\t\t\t\t$res .= $this->fex->field_label($newelem);\n\t\t\t\t$res .= $newelem->get_html('');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$hiddens = $newelem->get_html('');\n\t\t\t}\n\t\t\t$res .= '</li>';\n }\n\n $res .= \"</ul>$hiddens</fieldset></div>\";\n\n $labelclass = (!empty($this->attribs['enable_showhide']))? 'enable_showhide' : '';\n\n /* \"+\" and \"-\" controls for adding and removing sets */\n $res .= \"<span id=\\\"fieldsetControl$setName\\\" data-setname=\\\"$setName\\\" class=\\\"controls {$this->element_class}\\\">\";\n\t\t$res .= \"<label class=\\\"$labelclass\\\">{$this->descrip}</label>\";\n\t\t$res .= '<a href=\"#\" class=\"add\">+</a> <a href=\"#\" class=\"sub\">&ndash;</a></span>';\n\n\t\t$res .= \"<script type=\\\"text/javascript\\\">\n\t\t\t\t\t\tvar formex_groupvalues = formex_groupvalues || [];\n\t\t\t\t\t\tformex_groupvalues['{$setName}'] = \".json_encode($fval).\";\n\t\t\t\t</script>\";\n return $res;\n }", "function settingsSummary($field, $instance, $view_mode);", "function summary_query() {\r\n $this->get_query_fields();\r\n \r\n // No way to do summaries on more than one field at a time.\r\n if (count($this->query_fields) > 1) {\r\n return;\r\n }\r\n \r\n $field = $this->query_fields[0]['field'];\r\n $date_handler = $this->query_fields[0]['date_handler'];\r\n \r\n // Get the SQL format for this granularity, like Y-m,\r\n // and use that as the grouping value.\r\n $format = $date_handler->views_formats($this->options['granularity'], 'sql');\r\n $this->formula = $date_handler->sql_format($format, $date_handler->sql_field($field['fullname']));\r\n \r\n // Add the computed field.\r\n $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $this->formula, $field['query_name']);\r\n \r\n return $this->summary_basics(FALSE);\r\n }", "public function okr_summary()\n\t{\n\t\tif ($this->session->userdata('status') !== 'admin_logged_in') {\n\t\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('OKR Summary', $this->session->userdata['type']);\n\n\n\t\t$data = [\n\t\t\t'member_dsc' => $this->M_memberDsc->get_all_member(),\n\t\t\t'usecase' => $this->M_otherDataAssignments->get_usecase(),\n\t\t\t'member_selected' => '',\n\t\t\t'usecase_selected' => '',\n\t\t\t'judul' => 'OKR Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoring_okr_summaryProduct',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => []\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "function Field() {\n\t\t$fs = $this->FieldSet();\n \t$spaceZebra = isset($this->zebra) ? \" $this->zebra\" : '';\n \t$idAtt = isset($this->id) ? \" id=\\\"{$this->id}\\\"\" : '';\n\t\t$content = \"<div class=\\\"fieldgroup$spaceZebra\\\"$idAtt>\";\n\t\tforeach($fs as $subfield) {\n\t\t\t$childZebra = (!isset($childZebra) || $childZebra == \"odd\") ? \"even\" : \"odd\";\n\t\t\tif($subfield->hasMethod('setZebra')) $subfield->setZebra($childZebra);\n\t\t\t$content .= \"<div class=\\\"fieldgroupField\\\">\" . $subfield->{$this->subfieldParam}() . \"</div>\";\n\t\t}\n\t\t$content .= \"</div>\";\n\t\treturn $content;\n\t}", "public function getPanelContent()\n {\n $sqlLogs = $this->getLogs();\n\n // Add table uses summary\n // Sort table uses\n $idTables = array();\n $counts = array();\n $i = 0;\n foreach(self::$tables as $table => $nbUse)\n {\n $counts[$table] = $nbUse;\n $idTables[$table] = $i++;\n }\n \n $tableSummary = array();\n \n if(is_array($counts))\n {\n arsort($counts, SORT_NUMERIC);\n \n // Build summary of table uses\n foreach($counts as $table => $nbUse)\n {\n $tableSummary[] = sprintf('<div style=\"float: left; margin-right: 10px; line-height: 15px;\"><a href=\"#\" onclick=\"jQuery(\\'#sfWebDebugBarCancelLink\\').show(); jQuery(\\'#sfWebDebugAdvancedDatabaseLogs ol li\\').hide(); jQuery(\\'#sfWebDebugAdvancedDatabaseLogs ol li.info\\').show(); jQuery(\\'#sfWebDebugAdvancedDatabaseLogs ol li.table-'.$table.'\\').show(); return false;\" title=\"Only display queries on this table\"><span style=\"color: blue;\"> %s</span> (%s)</a></div>', $table, $nbUse);\n }\n }\n\n // Add color legend\n $legend = '<div style=\"float: left; font-weight: bold; padding: 2px; margin: 2px 2px 2px 0;\">SQL status legend :</div>';\n foreach($this->colors as $min => $content)\n {\n $legend .= '<div style=\"background-color: '.$content[0].'; color: white; float: left; margin: 2px; padding: 2px;\">&gt;= '.$min.' queries ('.$content[1].')</div>';\n }\n\n $liStyle= ' style=\"line-height: 120% !important;\n padding: 5px 0px !important;\n border-bottom: 1px solid silver !important;\n list-style-type: decimal !important;\n margin-bottom:0\"';\n\n $liInfoStyle= ' style=\"line-height: 120% !important;\n padding: 5px 0px !important;\n border-bottom: 1px solid silver !important;\n list-style-type: decimal !important;\n background: #CCC; text-indent: 10px;\n text-shadow:1px 1px 1px rgba(0, 0, 0, 0.2);\"';\n\n\n\n // Build information and query rows\n $queries = array();\n foreach($sqlLogs as $i => $log)\n {\n $table = $log['table'];\n\n $message = '';\n if(array_key_exists($i, $this->info))\n {\n foreach($this->info[$i] as $mess)\n {\n $message .= '<li'.$liInfoStyle.' class=\"info\" style=\"\"><b>'.$mess['message'].' queries:</b></li>';\n }\n }\n \n $link = '';\n if(strstr($log['log'],'SELECT') > 0)\n {\n $link = '<a href=\"#\" style=\"color: blue;\" onclick=\"jQuery(this).parent().children(\\'span.select\\').show(); jQuery(this).hide(); return false;\">(View select content)</a>';\n }\n $message .= '<li'.$liStyle.' class=\"table-'.$table.' sfWebDebugDatabaseQuery\">'.$log['log'].' '.$link.'</li>';\n $queries[] = $message;\n }\n\n return '\n <div id=\"sfWebDebugAdvancedDatabaseLogs\">\n <div style=\"overflow: auto; margin-bottom: 10px;\">'.$legend.'</div>\n <b>Table call summary (click on a table to filter queries)</b>\n <div style=\"overflow: auto; margin-bottom: 10px;\">'.implode(\"\\n\", $tableSummary).'</div>\n <b>SQL queries <span id=\"sfWebDebugBarCancelLink\" style=\"display: none;\">(<a href=\"#\" style=\"color: blue\" onclick=\"jQuery(\\'#sfWebDebugAdvancedDatabaseLogs ol li\\').show(); jQuery(this).parent().hide(); return false;\">Cancel table filters</a>)</a></span></b>\n <ol style=\"margin-left: 20px\">'.implode(\"\\n\", $queries).'</ol>\n </div>\n ';\n }", "private function createStructData()\n\t{\n\t\tforeach ($this->data as $item)\n\t\t{\n\t\t\t$row = array();\n\t\t\t\n\t\t\tforeach ($item as $key => $val)\n\t\t\t\tif( in_array($key, $this->col_show) && $key != $this->col_aggr_sum)\n\t\t\t\t\t$row[$key] = $val;\n\t\t\t\n\t\t\tif( count($row) )\n\t\t\t{\n\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t$row[$this->col_aggr_sum] = 0;\n\t\t\t\t\n\t\t\t\t$row['details'] = array();\n\t\t\t\t$this->data_show[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->data_show = array_unique($this->data_show, SORT_REGULAR);\n\t}", "function display_staff_info_meta_box( $rbm_staff ) {\n $staff_title = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_staff_title', true));\n $staff_fact = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_staff_fact', true));\n $staff_thumbnail_src = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_secondary_img', true));\n $staff_thumbnail_fun_src = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_fun_img', true));\n $staff_facebook = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_facebook', true));\n $staff_twitter = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_twitter', true));\n $staff_email = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_email', true));\n $staff_linkedin = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_linkedin', true));\n $staff_skills = esc_html(get_post_meta( $rbm_staff->ID, 'rbm_skillset', true));\n $skills_array = explode(',', $staff_skills);\n ?>\n <style>\n /* Custom Styles for table, inspired by Semantic UI */\n\n #rbm_metabox input {\n margin: 0;\n max-width: 100%;\n -webkit-box-flex: 1;\n -webkit-flex: 1 0 auto;\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n outline: 0;\n -webkit-tap-highlight-color: rgba(255,255,255,0);\n text-align: left;\n line-height: 1.2142em;\n font-family: Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;\n padding: .67861429em 1em;\n background: #FFF;\n border: 1px solid rgba(34,36,38,.15);\n color: rgba(0,0,0,.87);\n border-radius: .28571429rem;\n -webkit-transition: box-shadow .1s ease,border-color .1s ease;\n transition: box-shadow .1s ease,border-color .1s ease;\n box-shadow: none;\n }\n #rbm_metabox button {\n min-height: 1em;\n height: initial;\n vertical-align: baseline;\n padding: .78571429em 1.5em;\n line-height: 1em;\n }\n </style>\n <table id=\"rbm_metabox\" style=\"width: 100%\">\n <tbody>\n <tr>\n <td>Title: </td>\n <td><input type=\"text\" placeholder=\"Title\" value=\"<?php echo $staff_title; ?>\" name=\"rbm_staff_title\"></td>\n </tr>\n <tr>\n <td>Secondary Image: </td>\n <td>\n <div class=\"uploader\">\n \t<input id=\"rbm_staff_img\" name=\"rbm_staff_img\" type=\"text\" value=\"<?php echo $staff_thumbnail_src; ?>\" />\n \t<button id=\"rbm_staff_img_button\" class=\"button\" name=\"rbm_staff_img_button\" value=\"Upload\" >Upload</button>\n </div>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\"><hr></td>\n </tr>\n <tr>\n <td>Fun Fact: </td>\n <td><input type=\"text\" placeholder=\"Fun Fact\" value=\"<?php echo $staff_fact; ?>\" name=\"rbm_staff_fact\"></td>\n </tr>\n <tr>\n <td>Fun Photo: </td>\n <td>\n <div class=\"uploader\">\n \t<input id=\"rbm_fun_img\" name=\"rbm_fun_img\" type=\"text\" value=\"<?php echo $staff_thumbnail_fun_src; ?>\" />\n \t<button id=\"rbm_fun_img_button\" class=\"button\" name=\"rbm_fun_img_button\" value=\"Upload\">Upload</button>\n </div>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\"><hr></td>\n </tr>\n <tr>\n <td>Expertise</td>\n <td>\n <?php\n $options = get_option( 'rbm_settings' );\n foreach($options['rbm_skills'] as $key => $value) {\n ?>\n <input id=\"skill-<?php echo $value[0];?>\" type=\"checkbox\" name=\"rbm_skillset[]\" value=\"<?php echo $value[0]; ?>\" <?php if (in_array($value[0], $skills_array)) { echo \"checked\";} ?>>\n <label for=\"skill-<?php echo $value[0]; ?>\"><img src=\"<?php echo $value[1]; ?>\" width=\"16\" height=\"16\" style=\"border-radius: 50%;\"> <?php echo $value[0]; ?></label>\n <br>\n <?php } ?>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\"><hr></td>\n </tr>\n <tr>\n <td>Facebook</td>\n <td><input type=\"text\" placeholder=\"www.facebook.com\" name=\"rbm_facebook\" value=\"<?php echo $staff_facebook; ?>\"></td>\n </tr>\n <tr>\n <td>Twitter</td>\n <td><input type=\"text\" placeholder=\"www.twitter.com\" name=\"rbm_twitter\" value=\"<?php echo $staff_twitter; ?>\"></td>\n </tr>\n <tr>\n <td>Email</td>\n <td><input type=\"text\" placeholder=\"[email protected]\" name=\"rbm_email\" value=\"<?php echo $staff_email; ?>\"></td>\n </tr>\n <tr>\n <td>LinkedIn</td>\n <td><input type=\"text\" placeholder=\"www.linkedin.com\" name=\"rbm_linkedin\" value=\"<?php echo $staff_linkedin; ?>\"></td>\n </tr>\n </tbody>\n </table>\n\n <script>\n // Script to run for the media uploader\n jQuery(document).ready(function($) {\n var custom_media = true,\n orig_send_attachment = wp.media.editor.send.attachment;\n\n $('#rbm_metabox .button').click(function(e) {\n var send_attachment_bkp = wp.media.editor.send.attachment;\n var button = $(this);\n var id = button.attr('id').replace('_button', '');\n custom_media = true;\n\n wp.media.editor.send.attachment = function(props, attachment) {\n if(custom_media) {\n $(\"#\" + id).val(attachment.url);\n } else {\n return orig_send_attachment.apply( this, [props, attachment] );\n }\n }\n\n wp.media.editor.open(button);\n return false\n });\n\n $('.add_media').on('click', function() {\n custom_media = false;\n });\n });\n </script>\n<?php }", "public function display() {\n\t\t$this->prepareForDisplay();\n\n\t\techo '<div class=\"panel-heading\">';\n\t\t$this->displayHeader($this->Header, $this->getNavigation());\n\t\techo '</div>';\n\t\techo '<div class=\"panel-content statistics-container\">';\n\t\t$this->displayContent();\n\t\techo '</div>';\n\t}", "private function addHeaderDetails(){ \n $headerCount = $this->createElement('select', 'headerCount')\n ->addMultiOptions(array('1' => '1 - Header', '2' => '2 - Header', '3' => '3 - Header'))\n ->setValue('3');\n \n $highPressure = $this->createElement('text', 'highPressure')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minPressure(), 'max' => $this->mS->critPressure(), 'inclusive' => true));\n $mediumPressure = $this->createElement('text', 'mediumPressure')\n ->setAttrib('style', 'width: 60px;');\n $lowPressure = $this->createElement('text', 'lowPressure')\n ->setAttrib('style', 'width: 60px;');\n $hpSteamUsage = $this->createElement('text', 'hpSteamUsage')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n $mpSteamUsage = $this->createElement('text', 'mpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n $lpSteamUsage = $this->createElement('text', 'lpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $headerCount,\n $highPressure,\n $mediumPressure,\n $lowPressure,\n $hpSteamUsage,\n $mpSteamUsage,\n $lpSteamUsage,\n )); \n \n $condReturnTemp = $this->createElement('text', 'condReturnTemp')\n ->setValue(round($this->mS->localize(338.705556, 'temperature')))\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $condReturnFlash = $this->createElement('select', 'condReturnFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $hpCondReturnRate = $this->createElement('text', 'hpCondReturnRate')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n $mpCondReturnRate = $this->createElement('text', 'mpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $lpCondReturnRate = $this->createElement('text', 'lpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $hpCondFlash = $this->createElement('select', 'hpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $mpCondFlash = $this->createElement('select', 'mpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n\n $this->addElements(array(\n $condReturnTemp,\n $condReturnFlash,\n $hpCondReturnRate,\n $mpCondReturnRate,\n $lpCondReturnRate,\n $hpCondFlash,\n $mpCondFlash,\n ));\n \n $hpHeatLossPercent = $this->createElement('text', 'hpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $mpHeatLossPercent= $this->createElement('text', 'mpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $lpHeatLossPercent = $this->createElement('text', 'lpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $hpHeatLossPercent,\n $mpHeatLossPercent,\n $lpHeatLossPercent,\n ));\n }", "private function get_grouped_input_fields( $name, $options, $title = '' ) {\n\t\t$grouped = array();\n\t\tif (isset($this->settings[$name])) {\n\t\t\t$grouped = $this->settings[$name];\n\t\t} elseif (isset($options['addon_name']) && $options['addon_name']) {\n\t\t\t$name = $options['addon_name'];\n\t\t\tif (isset($this->settings[$name])) {\n\t\t\t\t$grouped = $this->settings[$name];\n\t\t\t}\n\t\t}\n\t\t$count = count((array) $grouped);\n\n\t\tif ($count <= 0) {\n\t\t\t$count = 1;\n\t\t}\n\t\t$output = '';\n\n\t\tif(isset($options['title']) && $options['title'] != '') {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-grouped-wrap sp-pagebuilder-parent-input-field sp-pagebuilder-has-group-title\" data-addon_title=\"'. $title . '\" data-field_name=\"'. $name .'\">';\n\t\t} else {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-grouped-wrap sp-pagebuilder-parent-input-field\" data-addon_title=\"'. $title . '\" data-field_name=\"'. $name .'\">';\n\t\t}\n\n\t\tif(isset($options['title']) && $options['title'] != '') {\n\t\t\t$output .= '<h4 class=\"sp-pagebuilder-group-title\">' . $options['title'] . '</h4>';\n\t\t}\n\n\t\t$output .= '<a href=\"#\" class=\"sp-pagebuilder-add-grouped-item sp-pagebuilder-btn sp-pagebuilder-btn-warning sp-pagebuilder-btn-sm\"><i class=\"fa fa-plus\"></i> Add New</a>';\n\t\t$output .= '<div class=\"sp-pagebuilder-grouped sp-pagebuilder-grouped-items grouped-'.$name.'\" data-field_no=\"'. ($count - 1) .'\">';\n\t\tfor($i = 0; $i < $count; $i++) {\n\n\t\t\t$output .= '<div class=\"sp-pagebuilder-grouped-item\">';\n\t\t\t$output .= '<div class=\"sp-pagebuilder-repeatable-toggler\">';\n\t\t\t$output .= '<span class=\"sp-pagebuilder-move-repeatable\"><i class=\"fa fa-ellipsis-v\"></i></span>';\n\t\t\t$output .= '<h4 class=\"sp-pagebuilder-repeatable-item-title\">Item '. ($i+1) .'</h4>';\n\t\t\t$output .= '<span class=\"sp-pagebuilder-remove-grouped-item\"><a href=\"#\"><i class=\"fa fa-times\"></i></a></span>';\n\t\t\t$output .= '<span class=\"sp-pagebuilder-clone-grouped-item\"><a href=\"#\"><i class=\"fa fa-clone\"></i></a></span>';\n\t\t\t$output .= '</div>';\n\n\t\t\t$output .= '<div class=\"sp-pagebuilder-grouped-item-collapse\" style=\"display:none;\">';\n\t\t\tforeach ( $options['attr'] as $key => $option ) {\n\t\t\t\tif ( isset( $grouped[$i][$key] ) ) {\n\t\t\t\t\t$option['std'] = $grouped[$i][$key];\n\t\t\t\t}\n\n\t\t\t\t$key = $name. '['. $i .']['. $key .']';\n\t\t\t\t$output .= '<div class=\"sp-pagebuilder-repeatable-input-field\">';\n\t\t\t\t$output .= $this->get_input_field_html( $key, $option );\n\t\t\t\t$output .= '</div>';\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\t$output .= '</div>';\n\t\t$output .= '</div>';\n\n\t\treturn $output;\n\t}", "function summary_query() {\n\n // @TODO The summary values are computed by the database. Unless the database has\n // built-in timezone handling it will use a fixed offset, which will not be\n // right for all dates. The only way I can see to make this work right is to\n // store the offset for each date in the database so it can be added to the base\n // date value before the database formats the result. Because this is a huge\n // architectural change, it won't go in until we start a new branch.\n $this->formula = $this->date_handler->sql_format($this->sql_format, $this->date_handler->sql_field(\"***table***.$this->real_field\"));\n $this->ensure_my_table();\n // Now that our table is secure, get our formula.\n $formula = $this->get_formula();\n\n // Add the field, give it an alias that does NOT match the actual field name or grouping won't work right.\n $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_summary');\n $this->query->set_count_field(NULL, $formula, $this->field);\n\n return $this->summary_basics(FALSE);\n }", "function mytheme_show_box() {\n global $post;\n\n // Use nonce for verification\n echo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n \n \n\n $i=0;\n //print_r($this->meta_box['fields']);\n\n $meta_count = get_post_meta($post->ID, 'dbt_text', true);\n for ($i=0;$i<count($meta_count);$i++) {\n echo '<table class=\"form-table elearning_fieldset\">';\n foreach ($this->meta_box['fields'] as $field) {\n // get current post meta data\n // echo $field['id'];\n $meta = get_post_meta($post->ID, $field['id'], true);\n //$count = print_r($meta);\n \n\n \n \n\n echo '<tr>',\n '<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n '<td>';\n switch ($field['type']) {\n case 'text':\n echo '<input class=\"elearning_field\" type=\"text\" name=\"', $field['id'], '[]\" id=\"', $field['id'], '\" value=\"', $meta[$i] ? $meta[$i] : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n '<br />', $field['desc'];\n break;\n case 'textarea':\n echo '<textarea class=\"elearning_field\" name=\"', $field['id'], '[]\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta[$i] ? $meta[$i] : $field['std'], '</textarea>',\n '<br />', $field['desc'];\n break;\n case 'select':\n //print_r($field['options']);\n echo '<select class=\"elearning_field\" name=\"', $field['id'], '[]\" id=\"', $field['id'], '\">';\n foreach ($field['options'] as $option) {\n echo '<option', $meta[$i] == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n }\n echo '</select>';\n break;\n case 'radio':\n foreach ($field['options'] as $option) {\n echo '<input class=\"elearning_field\" type=\"radio\" name=\"', $field['id'], '[]\" value=\"', $option['value'], '\"', $meta[$i] == $option['value'] ? ' checked=\"checked\"' : '', ' />', $option['name'];\n }\n break;\n case 'checkbox':\n echo '<input class=\"elearning_field\" type=\"checkbox\" name=\"', $field['id'], '[]\" id=\"', $field['id'], '\"', $meta[$i] ? ' checked=\"checked\"' : '', ' />';\n break;\n }\n echo \t'<td>',\n '</tr>\n';\n }\n echo '\n<tr>\n <td colspan=\"2\" align=\"right\"><a class=\"delete_elearning_item\" href=\"#\">Delete</a></td>\n</tr>\n</table>';\n }\n echo '<a href=\"#\" id=\"new_textbox\">New Textbox</a>';\n\n \n }", "public function createFinaliseRepairFields()\r\n {\r\n echo \"\r\n <fieldset>\r\n <legend> Finalise Repair </legend>\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\">\r\n <label>Repair Cost: </label>\r\n <input type=\\\"text\\\" class=\\\"input-text-fifty\\\" name=\\\"repair-cost-input\\\" id=\\\"repair-cost-input\\\"\r\n value=\\\"\".$this->checkRepairCost().\"\\\">\r\n </div>\r\n\r\n <div class=\\\"right-wrapper\\\">\r\n <label>Authorised By: </label>\r\n <input type=\\\"text\\\" class=\\\"input-text-fifty\\\" name=\\\"return-authorized-name-input\\\" id=\\\"return-authorized-name-input\\\"\r\n value=\\\"\".$this->queryResult[\"ReturnAuthorizedName\"].\"\\\">\r\n </div>\r\n </div>\r\n\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\" style=\\\"width:330px\\\">\r\n <input type=\\\"checkbox\\\" name=\\\"print-checkbox\\\" value=\\\"print-checkbox\\\"\r\n \".$this->checkPrintCondition().\">\r\n <label>Print Repair Order Form/s </label>\r\n\r\n </div>\r\n </div>\r\n\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\" style=\\\"width:100%\\\">\r\n <input type=\\\"checkbox\\\" name=\\\"ra-checkbox\\\" value=\\\"ra-checkbox\\\" id=\\\"ra-checkbox\\\" \".$this->checkRACondition().\">\r\n <label> Send request for \\\"Return Authorisation Number\\\" now (recommended) </label>\r\n </div>\r\n </div>\r\n </fieldset> \";\r\n }", "public function build_unit_details_table()\n\t{\n global $CFG;\n\t\t$retval = \"<div id='unitName$this->id' class='tooltipContentT'>\".\n \"<div><h3>$this->name</h3>\";\n \n if ($this->comments != ''){\n $retval .= \"<br><div style='background-color:#FF9;'>\".bcgt_html($this->comments, true).\"</div><br>\";\n }\n \n $retval .= \"<table><tr><th>\".get_string('criteriaName','block_bcgt').\"</th>\".\n \"<th>\".get_string('criteriaDetails','block_bcgt').\"</th></tr>\";\n\t\tif($criteriaList = $this->criterias)\n\t\t{\n require_once($CFG->dirroot.'/blocks/bcgt/plugins/bcgtbtec/classes/sorters/BTECCriteriaSorter.class.php');\n $criteriaSorter = new BTECCriteriaSorter();\n usort($criteriaList, array($criteriaSorter, \"ComparisonDelegateByNameObject\"));\n\t\t\t//Sort the criteria on P, M and then D\n\t\t\tforeach($criteriaList AS $criteria)\n\t\t\t{\n\t\t\t\t$retval .= \"<tr><td>\".$criteria->get_name().\"</td><td>\".$criteria->get_details().\"</td></tr>\";\n\t\t\t}\n\t\t}\n\t\t$retval .= \"</table></div></div>\";\n\t\treturn $retval;\n\t}", "public function display()\n {\n $output = \"\";\n\n // Ouverture\n /// ID HTML\n $openId = $this->getAttr('container_id');\n /// Classes HTML\n $openClass = [];\n $openClass[] = 'tiFyForm-FieldContainer';\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getType();\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getSlug();\n if ($this->getErrors()) :\n $openClass[] = 'tiFyForm-FieldContainer--error';\n endif;\n $openClass[] = $this->getAttr('container_class');\n if ($this->getAttr('required')) :\n $openClass[] = 'tiFyForm-FieldContainer--required';\n endif;\n $output .= $this->form()\n ->factory()\n ->fieldOpen($this, $openId, join(' ', $openClass));\n\n // Contenu du champ\n $output .= $this->type()->_display();\n\n // Fermeture\n $output .= $this->form()->factory()->fieldClose($this);\n\n return $output;\n }", "function showContent()\n {\n $this->showForm();\n\n $this->elementStart('div', array('id' => 'notices_primary'));\n\n\n $sharing = null;\n $sharing = $this->getSharings();\n $cnt = 0;\n\n if (!empty($sharing)) {\n $profileList = new SharingsList(\n $sharing,\n $this\n );\n\n $cnt = $profileList->show();\n $sharing->free();\n\n if (0 == $cnt) {\n $this->showEmptyListMessage();\n }\n }\n\n $this->elementEnd('div');\n\n }", "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "private function print_tab_budgetSummary(){\n\n $GLOBALS['b_fmt::money'] = ' SEK';\n print x('h2','Budget summary');\n $this->dbg();\n\n // Use the same header for the summary as for the visitors\n $header = $this->header();\n \n // Get the price of social events \n $word_socialEvents = '';\n $detailed_socialEvents = False;\n $total_socialEvents = 0;\n if (is_object(VM::$e)){\n VM::$e->socialEvents()->get_budget();\n if (($s = VM::$e->socialEvents()->summary)){\n\tob_start();\n\t$t = new b_table_zebra(array('what'=>' ','skoko'=>' '));\n\t$t->showLineCounter = False;\n\tforeach($s as $what=>$v){\n\t if (empty($v)) continue;\n\t $total_socialEvents += $v;\n\t $t->prt(array('what' =>$what,\n\t\t\t'skoko'=>b_fmt::money($v)));\n\t}\n\t$t->close();\n\t$socialEvents = ob_get_contents();\n\tob_end_clean();\n }\n if ($total_socialEvents > 0){\n\t$detailed_socialEvents = True;\n\t$header['name'] = 'Social events';\n\t// $this->scholar_summary['name'] = $socialEvents;\n\t$word_socialEvents = 'Social events';\n\t$header['name'] = '';\n }\n \n $this->total['name'] = $total_socialEvents;\n @$this->total['total_e'] += $total_socialEvents;\n @$this->total['total_r'] += $total_socialEvents;\n }\n\n foreach($this->total as $k=>$v){\n $this->money_bold[] = $k;\n $budget[$k] = $v;\n $budgetP[$k] = b_fmt::money($v);\n $this->set_colorCodes($k,$budgetP[$k]);\n }\n\n // \n // Add details about socialEvents\n //\n if ($detailed_socialEvents){\n $this->money_bold[] = 'name';\n $budgetP['name'] .= x(\"span font-style:italic'\",'<br><hr>&nbsp;'.$socialEvents);\n $word_socialEvents = 'Social events';\n $header['name'] = '';\n // $this->set_colorCodes($k,$budgetP[$k]);\n }\n $GLOBALS['b_fmt::money'] = '';\n\n // \n // Add details about accommodation \n //\n foreach($this->ac2h as $hut_code=>$header_element){\n if (!empty($header[$header_element])){\n\tob_start();\n\tif (is_object(VM::$e)){\n\t VM_accommodationOptions(VM::$e)->show_usage($hut_code);\n\t}else{\n\t $av_id = @$_GET['host_avid_once'];\n\t if (empty($av_id) && is_object($this->av)) $av_id = $this->av->ID;\n\t if (!empty($av_id)) VM_accommodationOptions(myOrg_ID)->show_usage($hut_code,0,0,$av_id);\n\t}\n\t$result = ob_get_contents();\n\tob_end_clean();\n\tif (!empty($result)) $budgetP[$header_element] .= '<br><hr>N. tenants'.$result;\n } \n }\n\n //\n // Add details about scholarships\n //\n foreach(array_keys($this->total) as $k){\n if (!empty($this->scholar_summary[$k])){\n\tob_start();\n\t$t = new b_table_zebra(array('n'=>' ','zone'=>' '));\n\t$t->showLineCounter = False;\n\tforeach($this->scholar_summary[$k] as $zone=>$n) $t->prt(array('n' =>$n,\n\t\t\t\t\t\t\t\t 'zone'=>$zone));\n\t\n\t$t->close();\n\t$budgetP[$k] .= '<br><hr>N.trips'.ob_get_contents();\n\tob_end_clean();\n }\n }\n\n if ($this->bs) print x('h4',(!b_posix::is_empty($b=b_fmt::money(VM::$e->budgetSource()->total))\n\t\t\t\t ? \"Available budget $b\".CONST_currency.\n\t\t\t\t ($this->something_was_paid\n\t\t\t\t ? ''\n\t\t\t\t : \", estimated cost \".b_fmt::money(@$budget['total_e']).CONST_currency) \n\t\t\t\t : 'No known budget source'));\n \n ob_start();\n $t = new b_table_zebra($header);\n foreach (array_keys($header) as $k) $t->css[$k]['align'] = 'align_right'; \n\n $this->set_colorCodesTH($header,$t->th_attr);\n\n $t->preHeaders = $this->build_budget_preHeaders($header,$word_socialEvents);\n $t->noSort = True;\n $t->showLineCounter = False;\n \n foreach($header as $k=>$v){\n $t->class[$k] = array(stripos($k,'space')===0 ? 'highlightShadow' : 'highlightWhite'); \n // if (stripos($k,'space')===False) $separator[$k] = '<hr>';\n }\n $t->prt($budgetP);\n \n if (is_object(VM::$e) && !is_object($this->av)){\n if (VM::$e->isArchived()) $t->extraTD[] = bIcons()->get('b-archive');\n elseif (VM::$e->isEventEndorsed()) $t->extraTD[] = bIcons()->get('b-approved');\n }\n $t->close();\n $table = ob_get_contents();\n ob_end_clean();\n print x(\"div class='messages status-no-image'\",$table);\n }", "function bfa_ata_old_custom_box() {\r\n\r\n echo '<div class=\"dbx-b-ox-wrapper\">' . \"\\n\";\r\n echo '<fieldset id=\"bfa_ata_fieldsetid\" class=\"dbx-box\">' . \"\\n\";\r\n echo '<div class=\"dbx-h-andle-wrapper\"><h3 class=\"dbx-handle\">' . \r\n __( 'Body copy title', 'atahualpa' ) . \"</h3></div>\"; \r\n \r\n echo '<div class=\"dbx-c-ontent-wrapper\"><div class=\"dbx-content\">';\r\n\r\n // output editing form\r\n\r\n bfa_ata_inner_custom_box();\r\n\r\n // end wrapper\r\n\r\n echo \"</div></div></fieldset></div>\\n\";\r\n}", "function mytheme_show_box() {\n global $meta_box, $post;\n\n?>\n<script type=\"text/javascript\">\njQuery(document).ready(function($){\n countField(\"#tcd-w_meta_description\");\n});\n \nfunction countField(target) {\n jQuery(target).after(\"<span class=\\\"word_counter\\\" style='display:block; margin:0 15px 0 0; font-weight:bold;'></span>\");\n jQuery(target).bind({\n keyup: function() {\n setCounter();\n },\n change: function() {\n setCounter();\n }\n });\n setCounter();\n function setCounter(){\n jQuery(\"span.word_counter\").text(\"<?php _e('word count:', 'tcd-w'); ?>\"+jQuery(target).val().length);\n };\n}\n</script>\n<?php\n // Use nonce for verification\n echo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n echo '<table class=\"form-table\">';\n\n foreach ($meta_box['fields'] as $field) {\n\n // get current post meta data\n $meta = get_post_meta($post->ID, $field['id'], true);\n\n echo '<tr>',\n '<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n '<td>';\n switch ($field['type']) {\n case 'text':\n echo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />', '<p>', $field['desc'], '</p>';\n break;\n case 'textarea':\n echo '<textarea name=\"', $field['id'], '\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>', '<p>', $field['desc'] , '</p>';\n break;\n }\n echo '</td><td>',\n '</td></tr>';\n }\n\n echo '</table>';\n\n}", "function burialInput() {\n retrieveUser();\n echo \"<input id=\\\"searchType\\\" type=\\\"hidden\\\" value=\\\"burrialList\\\"/>\n <div style=\\\"width:100%;text-align:center\\\">\n <div style=\\\"width:50%;display:inline-block\\\"> \n <section id=personInfoSection style=\\\"width:100%\\\">\";\n personBurialSection(\"Second\");\n echo\"</section>\"; \n echo\"</section><section id=otherInfoSection style=\\\"width:100%;display:none;\\\">\"; \n otherBurialSection();\n echo\"</section>\";\n echo\"<div id=\\\"submitDiv\\\" style=\\\"text-align:right;width:100%;display:none\\\"><input type=\\\"button\\\" id=\\\"SubmitBurrial\\\" value=\\\"Submit Form\\\" >\n </div></div></div>\"; \n \n }", "public function render_content() {\n\t\t$name = '_options-dimension-' . $this->id;\n\t\t$values = $this->value();\n\t\t$fields = $this->fields;\n\n\t\tif ( ! is_array( $values ) )\n\t\t\t$values = explode( ',', $this->value() );\n\n\t\t$field_index = 0;\n\t\t?>\n\t\t<div class=\"options-control-inputs\">\n\t\t\t<?php foreach ( $fields as $id => $title ): ?>\n\t\t\t\t<label for=\"<?php __esc_attr( $name . '_' . $id ) ?>\">\n\t\t\t\t\t<span><?php __esc_html( $title ) ?></span>\n\t\t\t\t\t<input type=\"text\" name=\"op-options[<?php __esc_attr( $this->id ) ?>][]\"\n\t\t\t\t\t\t value=\"<?php __esc_attr( $values[$field_index++] ) ?>\"\n\t\t\t\t\t\t id=\"<?php __esc_attr( $name . '_' . $id ) ?>\" />\n\t\t\t\t</label>\n\t\t\t<?php endforeach ?>\n\t\t</div>\n\t\t<?php\n\t}", "function inspiry_repeater_group( $fields = array(), $is_js_tmpl = false, $counter = 0 ) {\n\t\tif ( ! empty( $fields ) && is_array( $fields ) ) :\n\n\t\t\t$defaults = array(\n\t\t\t\t'class' => '',\n\t\t\t\t'name' => '',\n\t\t\t\t'value' => '',\n\t\t\t\t'placeholder' => '',\n\t\t\t);\n\n\t\t\tif ( $is_js_tmpl ) {\n\t\t\t\t$counter = '{{data}}';\n\t\t\t}\n\t\t\t?>\n <div class=\"inspiry-repeater\" data-inspiry-repeater-counter=\"<?php echo esc_attr( $counter ); ?>\">\n <div class=\"inspiry-repeater-sort-handle\"><i class=\"fas fa-grip-horizontal\"></i></div>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\t$field = wp_parse_args( $field, $defaults );\n\t\t\t\t\tprintf( '<div class=\"inspiry-repeater-field %s\"><input type=\"text\" name=\"%s\" value=\"%s\" placeholder=\"%s\"/></div>', esc_attr( $field['class'] ), esc_attr( $field['name'] ), esc_attr( $field['value'] ), esc_attr( $field['placeholder'] ) );\n\t\t\t\t}\n\t\t\t\t?>\n <div class=\"inspiry-repeater-remove-field\">\n <button class=\"inspiry-repeater-remove-field-btn btn btn-primary\"><i class=\"fas fa-trash-alt\"></i></button>\n </div>\n </div>\n\t\t<?php\n\t\tendif;\n\t}", "private function get_inputs_output_html() {\n\t\t$i = 0;\n\t\t$j = 0;\n\n\t\t$addon_title = $this->addon_raw['title'];\n\t\t$fieldsets = array();\n\t\tforeach ($this->options as $key => $option) {\n\t\t\t\t$fieldsets[$key] = $option;\n\t\t}\n\n\t\t$output = '';\n\n\t\tif(count((array) $fieldsets)) {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-fieldset\">';\n\t\t\t$output .= '<ul class=\"sp-pagebuilder-nav sp-pagebuilder-nav-tabs\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<li class=\"'. (( $i === 0 )?\"active\":\"\" ) .'\"><a href=\"#sp-pagebuilder-tab-'. $key .'\" aria-controls=\"'. $key .'\" data-toggle=\"tab\">'. ucfirst( $key ) .'</a></li>';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '<div class=\"tab-content\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<div class=\"tab-pane '. (( $j === 0 )? \"active\":\"\" ) .'\" id=\"sp-pagebuilder-tab-'. $key .'\">';\n\t\t\t\t$output .= $this->get_input_fields( $key, $addon_title );\n\t\t\t\t$output .= '</div>';\n\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "function renderUsesSummary() {\n\n reset($this->usesTypes);\n while (list($k, $type) = each($this->usesTypes)) {\n if (0 == count($this->uses[$type]))\n continue;\n\n $this->tpl->setCurrentBlock(\"usessummary_loop\");\n\n reset($this->uses[$type]);\n while (list($file, $uses) = each($this->uses[$type])) {\n\n $this->tpl->setVariable(\"FILE\", $file);\n if (isset($uses[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($uses[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (\"true\" == $uses[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"usessummary\");\n $this->tpl->setVariable(\"TYPE\", $type);\n $this->tpl->parseCurrentBlock();\n }\n\n }", "protected function getDailySummary()\n {\n $strBuffer = '\n<fieldset class=\"tl_tbox\">\n<legend style=\"cursor: default;\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_summary'] . '</legend>\n<div class=\"daily_summary\">';\n\n $arrAllowedProducts = \\Isotope\\Backend\\Product\\Permission::getAllowedIds();\n\n $objOrders = Database::getInstance()->prepare(\"\n SELECT\n c.id AS config_id,\n c.name AS config_name,\n c.currency,\n COUNT(DISTINCT o.id) AS total_orders,\n SUM(i.tax_free_price * i.quantity) AS total_sales,\n SUM(i.quantity) AS total_items\n FROM tl_iso_product_collection o\n LEFT JOIN tl_iso_product_collection_item i ON o.id=i.pid\n LEFT OUTER JOIN tl_iso_config c ON o.config_id=c.id\n WHERE o.type='order' AND o.order_status>0 AND o.locked>=?\n \" . Report::getProductProcedure('i', 'product_id') . \"\n \" . Report::getConfigProcedure('o', 'config_id') . \"\n GROUP BY config_id\n \")->execute(strtotime('-24 hours'));\n\n if (!$objOrders->numRows) {\n\n $strBuffer .= '\n<p class=\"tl_info\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_empty'] . '</p>';\n\n } else {\n\n $i = -1;\n $strBuffer .= '\n<div class=\"tl_listing_container list_view\">\n <table class=\"tl_listing\">\n <tr>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['currency'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['orders#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['products#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['sales#'] . '</th>\n </tr>';\n\n\n while ($objOrders->next())\n {\n $strBuffer .= '\n <tr class=\"row_' . ++$i . ($i%2 ? 'odd' : 'even') . '\">\n <td class=\"tl_file_list\">' . $objOrders->config_name . '</td>\n <td class=\"tl_file_list\">' . $objOrders->currency . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_orders . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_items . '</td>\n <td class=\"tl_file_list\">' . Isotope::formatPrice($objOrders->total_sales) . '</td>\n </tr>';\n }\n\n $strBuffer .= '\n </table>\n</div>';\n }\n\n\n $strBuffer .= '\n</div>\n</fieldset>';\n\n return $strBuffer;\n }", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n\n\t\t$this->add_inline_editing_attributes( 'title', 'none' );\n\t\t$this->add_inline_editing_attributes( 'description', 'basic' );\n\t\t$this->add_inline_editing_attributes( 'content', 'advanced' );\n\t\t?>\n\n\t<!-- Banner Section start here -->\n\t\t<section class=\"banner-section pb-0\">\n\t\t\t<div class=\"banner-area\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t\t<div class=\"row no-gutters align-items-center justify-content-center\">\n\t\t\t\t\t\t<div class=\"col-12\">\n\t\t\t\t\t\t\t<div class=\"content-part text-center\">\n\t\t\t\t\t\t\t\t<div class=\"section-header\">\n <h2>COVID-19 Tracker</h2>\n <h3>Total Confirmed Corona Cases</h3>\n\t\t\t\t\t\t\t\t\t<h2 class=\"count-people\">381761</h2>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-12\">\n\t\t\t\t\t\t\t<div class=\"section-wrapper\">\n\t\t\t\t\t\t\t\t<div class=\"banner-thumb\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/banner/01.png\" alt=\"lab-banner\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n <!-- Banner Section ending here -->\n\n <!-- corona count section start here -->\n <section class=\"corona-count-section bg-corona padding-tb pt-0\">\n <div class=\"container\">\n\t\t\t\t<div class=\"corona-wrap\">\n\t\t\t\t\t<div class=\"corona-count-top\">\n\t\t\t\t\t\t<div class=\"row justify-content-center align-items-center\">\n\t\t\t\t\t\t\t<div class=\"col-xl-3 col-md-6 col-12\">\n\t\t\t\t\t\t\t\t<h5>Total Corona Statistics :</h5>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-xl-3 col-md-6 col-12\">\n\t\t\t\t\t\t\t\t<div class=\"corona-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"corona-inner\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-thumb\">\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/corona/01.png\" alt=\"corona\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-content\">\n\t\t\t\t\t\t\t\t\t\t\t<h3 class=\"count-number\">262774</h3>\n\t\t\t\t\t\t\t\t\t\t\t<p>Active Cases</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-xl-3 col-md-6 col-12\">\n\t\t\t\t\t\t\t\t<div class=\"corona-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"corona-inner\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-thumb\">\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/corona/02.png\" alt=\"corona\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-content\">\n\t\t\t\t\t\t\t\t\t\t\t<h3 class=\"count-number\">125050</h3>\n\t\t\t\t\t\t\t\t\t\t\t<p>Recovered Cases</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-xl-3 col-md-6 col-12\">\n\t\t\t\t\t\t\t\t<div class=\"corona-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"corona-inner\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-thumb\">\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/corona/03.png\" alt=\"corona\">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"corona-content\">\n\t\t\t\t\t\t\t\t\t\t\t<h3 class=\"count-number\">16558</h3>\n\t\t\t\t\t\t\t\t\t\t\t<p>Deaths</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"corona-count-bottom\">\n\t\t\t\t\t\t<div class=\"row justify-content-center align-items-center flex-row-reverse\">\n\t\t\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t\t\t<div class=\"ccb-thumb\">\n\t\t\t\t\t\t\t\t\t<a href=\"https://www.youtube.com/embed/Z9fQTS_kEqw\" data-rel=\"lightcase\" class=\"ccb-video\"><i class=\"icofont-ui-play\"></i><span class=\"pluse_1\"></span><span class=\"pluse_2\"></span></a>\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/corona/01.jpg\" alt=\"corona\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t\t\t<div class=\"ccb-content\">\n\t\t\t\t\t\t\t\t\t<h2>What Is Coronavirus?</h2>\n\t\t\t\t\t\t\t\t\t<h6>Coronavirus COVID-19 Global Cases map developed by the Johns Hopkins Center for Systems Science and Engineering.</h6>\n\t\t\t\t\t\t\t\t\t<p>Coronaviruses are type of virus. There are many different kinds, & some cause disease newly identified type has caused recent outbreak of respiratory ilnessnow called COVID-19 that started in China.</p>\n\t\t\t\t\t\t\t\t\t<ul class=\"lab-ul\">\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-tick-mark\"></i>COVID-19 is the disease caused by the new coronavirus that emerged in China in December 2020.</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-tick-mark\"></i>COVID-19 symptoms include cough, fever and shortness of breath. COVID-19 can be severe, and some cases have caused death.</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-tick-mark\"></i>The new coronavirus can be spread from person to person. It is diagnosed with a laboratory test.</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"lab-btn style-2\"><span>get started Now</span></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n </div>\n </section>\n <!-- corona count section ending here -->\n \n <!-- Service Section Start Here -->\n\t\t<section class=\"service-section bg-service padding-tb\">\n <div class=\"service-shape\">\n <div class=\"shape shape-1\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/shape/01.png\" alt=\"service-shape\">\n </div>\n <div class=\"shape shape-2\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/shape/01.png\" alt=\"service-shape\">\n </div>\n </div>\n <div class=\"container\">\n <div class=\"section-header\">\n <h2>Corona Virus Symptoms</h2>\n <p> Dynamically formulate fully tested catalysts for change via focused methods of empowerment Assertively extend alternative synergy and extensive web services.</p>\n </div>\n <div class=\"section-wrapper\">\n <div class=\"row justify-content-center\">\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/01.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Coughing And Sneezing</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/02.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Hot Fever</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/03.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Strong Headacke</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/04.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Shortness Of Breath</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/05.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Confusion</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-xl-4 col-md-6 col-12\">\n <div class=\"service-item text-center\">\n <div class=\"service-inner\">\n <div class=\"service-thumb\">\n <img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/service/06.jpg\" alt=\"service\">\n </div>\n <div class=\"service-content\">\n <h4>Sore Throat</h4>\n <p>Our comprehensive Online Marketing strategy will boost your website trafic hence monthly sales.</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n\t\t<!-- Service Section Ending Here -->\n\t\t\n\n\t\t<!-- Team Member Section Start here -->\n <div class=\"team-section bg-team padding-tb\">\n <div class=\"container\">\n\t\t\t\t<div class=\"section-header\">\n\t\t\t\t\t<h2>Meet Our Best Doctors</h2>\n\t\t\t\t\t<p> Dynamically formulate fully tested catalysts for change via focused methods of empowerment Assertively extend alternative synergy and extensive web services.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"team-area\">\n\t\t\t\t\t<div class=\"row justify-content-center align-items-center\">\n\t\t\t\t\t\t<div class=\"col-xl-4 col-md-6 col-12\">\n\t\t\t\t\t\t\t<div class=\"team-item\">\n\t\t\t\t\t\t\t\t<div class=\"team-item-inner\">\n\t\t\t\t\t\t\t\t\t<div class=\"team-thumb\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/team/02.jpg\" alt=\"team-membar\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"team-content\">\n\t\t\t\t\t\t\t\t\t\t<h5 class=\"member-name\">Dorothy M. Nickell</h5>\n\t\t\t\t\t\t\t\t\t\t<span class=\"member-dagi\">Throat Specialist</span>\n\t\t\t\t\t\t\t\t\t\t<p class=\"member-details\">Proce Aran Manu Proucs Rahe Conen Cuve Manu Produ Rahe Cuvaes Mana The Conen Testin Motin Was Procedur</p>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"icon-style-list lab-ul\">\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-phone\"></i><span>+880 1234 567 890</span></li>\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-envelope\"></i><span>[email protected]</span></li>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xl-4 col-md-6 col-12\">\n\t\t\t\t\t\t\t<div class=\"team-item\">\n\t\t\t\t\t\t\t\t<div class=\"team-item-inner\">\n\t\t\t\t\t\t\t\t\t<div class=\"team-thumb\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/team/02.jpg\" alt=\"team-membar\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"team-content\">\n\t\t\t\t\t\t\t\t\t\t<h5 class=\"member-name\">Billie R. Courtney</h5>\n\t\t\t\t\t\t\t\t\t\t<span class=\"member-dagi\">Cardiologist</span>\n\t\t\t\t\t\t\t\t\t\t<p class=\"member-details\">Proce Aran Manu Proucs Rahe Conen Cuve Manu Produ Rahe Cuvaes Mana The Conen Testin Motin Was Procedur</p>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"icon-style-list lab-ul\">\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-phone\"></i><span>+880 1234 567 890</span></li>\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-envelope\"></i><span>[email protected]</span></li>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xl-4 col-md-6 col-12\">\n\t\t\t\t\t\t\t<div class=\"team-item\">\n\t\t\t\t\t\t\t\t<div class=\"team-item-inner\">\n\t\t\t\t\t\t\t\t\t<div class=\"team-thumb\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/team/03.jpg\" alt=\"team-membar\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"team-content\">\n\t\t\t\t\t\t\t\t\t\t<h5 class=\"member-name\">Courtney A. Smith</h5>\n\t\t\t\t\t\t\t\t\t\t<span class=\"member-dagi\">Rehabilitation Therapy</span>\n\t\t\t\t\t\t\t\t\t\t<p class=\"member-details\">Proce Aran Manu Proucs Rahe Conen Cuve Manu Produ Rahe Cuvaes Mana The Conen Testin Motin Was Procedur</p>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"icon-style-list lab-ul\">\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-phone\"></i><span>+880 1234 567 890</span></li>\n\t\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-envelope\"></i><span>[email protected]</span></li>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n </div>\n </div>\n\t\t<!-- Team Member Section Ending here -->\n\t\t\n\n\t\t<!-- safe actions section start here -->\n\t\t<section class=\"safe-actions padding-tb bg-action\">\n\t\t\t<div class=\"action-shape\">\n\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/01.png\" alt=\"action-shape\">\n\t\t\t</div>\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row justify-content-center align-items-center\">\n\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t<div class=\"sa-thumb-part\">\n\t\t\t\t\t\t\t<div class=\"safe-thumb\">\n\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/01.jpg\" alt=\"safe-actions\">\n\t\t\t\t\t\t\t\t<div class=\"shape-icon\">\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-green saicon-1\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/green/01.png\" alt=\"green-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-green saicon-2\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/green/02.png\" alt=\"green-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-green saicon-3\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/green/03.png\" alt=\"green-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-green saicon-4\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/green/04.png\" alt=\"green-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-green saicon-5\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/green/05.png\" alt=\"green-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-red saicon-6\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/red/01.png\" alt=\"red-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-red saicon-7\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/red/02.png\" alt=\"red-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-red saicon-8\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/red/03.png\" alt=\"red-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-red saicon-9\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/red/04.png\" alt=\"red-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"sa-icon sa-red saicon-10\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/safe/shape/red/05.png\" alt=\"red-signal\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"saicon-content\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Coronaviruses (CoV) are a large family of viruses that cause illness ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS-CoV) and Severe Acute Respiratory Syndrome (SARS-CoV).</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t<div class=\"sa-content-part\">\n\t\t\t\t\t\t\t<h2>How to stay Safe Important Percautions</h2>\n\t\t\t\t\t\t\t<p>Continuay seize magnetic oportunities via value added imperatives ompetenty plagiarize customized meta-services after interopera supply chains nthuastica embrace portals through high-payoff internal or \"organic\" sources rogressively engineer cross functional synergy with client-centric </p>\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t\t\t\t<div class=\"sa-title\">\n\t\t\t\t\t\t\t\t\t\t<h6><i class=\"icofont-checked\"></i>Things You Should Do</h6>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<ul class=\"lab-ul\">\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Stay at Home</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Wear Mask</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Wash Your Hands</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Well Done Cooking</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Seek for a Doctor</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-check-circled\"></i>Avoid Crowed Places</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-12\">\n\t\t\t\t\t\t\t\t\t<div class=\"sa-title\">\n\t\t\t\t\t\t\t\t\t\t<h6><i class=\"icofont-not-allowed\"></i>Things You Should Avoid</h6>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<ul class=\"lab-ul\">\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Stay at Home</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Wear Mask</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Wash Your Hands</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Well Done Cooking</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Seek for a Doctor</li>\n\t\t\t\t\t\t\t\t\t\t<li><i class=\"icofont-close-circled\"></i>Avoid Crowed Places</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n\t\t<!-- safe actions section ending here -->\n\n\n\t\t<!-- faq section start here -->\n <section class=\"faq-section bg-faq padding-tb\">\n\t\t\t<div class=\"faq-shape\">\n\t\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/faq/shape/01.png\" alt=\"action-shape\">\n\t\t\t</div>\n <div class=\"container\">\n <div class=\"section-header\">\n <h2>Friquently Ask Questions</h2>\n <p> Dynamically formulate fully tested catalysts for change via focused methods of empowerment Assertively extend alternative synergy and extensive web services.</p>\n </div>\n <div class=\"section-wrapper\">\n <div class=\"row justify-content-center\">\n <div class=\"col-lg-6 col-sm-8 col-12\">\n <ul class=\"accordion lab-ul\">\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>What are the objectives of this Website?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>What is the best features and services we deiver?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>Why this Prevention important to me?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>how may I take part in and purchase this?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>What kinds of security policy do you maintain?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n </ul>\n </div>\n <div class=\"col-lg-6 col-sm-8 col-12\">\n <ul class=\"accordion lab-ul\">\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>Get things done with this beautiful app?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>Starting with Aviki is easier than anything?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>20k+ Customers Love Aviki App?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>Whatever Work You Do You Can Do It In Aviki?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n <li class=\"accordion-item\">\n <div class=\"accordion-list\">\n <div class=\"left\">\n <div class=\"icon\"><i class=\"icofont-info\"></i></div>\n </div>\n <div class=\"right\">\n <h6>Download our guide manage your daily works?</h6>\n </div>\n </div>\n <div class=\"accordion-answer\">\n <p>Perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore vertatis et quasi archtecto beatae vitae dicta sunt explicab Nemo enim ipsam voluptatem quia voluptas.</p>\n </div>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </section>\n <!-- faq section ending here -->\n\n\t\t<!-- Blog Section Start Here -->\n\t\t<section class=\"blog-section bg-blog padding-tb\">\n <div class=\"container\">\n\t\t\t\t<div class=\"section-header\">\n <h2>Our Most Popular Blog</h2>\n <p> Dynamically formulate fully tested catalysts for change via focused methods of empowerment Assertively extend alternative synergy and extensive web services.</p>\n </div>\n <div class=\"section-wrapper\">\n <div class=\"row justify-content-center\">\n <div class=\"col-lg-4 col-sm-6 col-12\">\n <div class=\"post-item\">\n <div class=\"post-item-inner\">\n <div class=\"post-thumb\">\n <a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/blog/01.jpg\" alt=\"lab-blog\"></a>\n </div>\n <div class=\"post-content\">\n <h5><a href=\"#\">Conulting Reporting Qouncil Arei \n\t\t\t\t\t\t\t\t\t\t\tNot Could More...</a></h5>\n <div class=\"author-date\">\n <a href=\"#\" class=\"date\"><i class=\"icofont-calendar\"></i>July 12, 2020</a>\n <a href=\"#\" class=\"admin\"><i class=\"icofont-ui-user\"></i>Somrat Islam</a>\n </div>\n <p>Pluoresntly customize pranci an plcentered customer service anding strategic amerials Interacvely cordinate performe</p>\n <div class=\"post-footer\">\n <a href=\"#\" class=\"text-btn\">Read More<i class=\"icofont-double-right\"></i></a>\n <a href=\"#\" class=\"comments\"><i class=\"icofont-comment\"></i><span>2</span></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-lg-4 col-sm-6 col-12\">\n <div class=\"post-item\">\n <div class=\"post-item-inner\">\n <div class=\"post-thumb\">\n <a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/blog/02.jpg\" alt=\"lab-blog\"></a>\n </div>\n <div class=\"post-content\">\n <h5><a href=\"#\">Financial Reporting Qouncil What Could More...</a></h5>\n <div class=\"author-date\">\n <a href=\"#\" class=\"date\"><i class=\"icofont-calendar\"></i>July 12, 2020</a>\n <a href=\"#\" class=\"admin\"><i class=\"icofont-ui-user\"></i>Somrat Islam</a>\n </div>\n <p>Pluoresntly customize pranci an plcentered customer service anding strategic amerials Interacvely cordinate performe</p>\n <div class=\"post-footer\">\n <a href=\"#\" class=\"text-btn\">Read More<i class=\"icofont-double-right\"></i></a>\n <a href=\"#\" class=\"comments\"><i class=\"icofont-comment\"></i><span>2</span></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-lg-4 col-sm-6 col-12\">\n <div class=\"post-item\">\n <div class=\"post-item-inner\">\n <div class=\"post-thumb\">\n <a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/blog/03.jpg\" alt=\"lab-blog\"></a>\n </div>\n <div class=\"post-content\">\n <h5><a href=\"#\">Consulting Reporting Qounc Arei Could More...</a></h5>\n <div class=\"author-date\">\n <a href=\"#\" class=\"date\"><i class=\"icofont-calendar\"></i>July 12, 2020</a>\n <a href=\"#\" class=\"admin\"><i class=\"icofont-ui-user\"></i>Somrat Islam</a>\n </div>\n <p>Pluoresntly customize pranci an plcentered customer service anding strategic amerials Interacvely cordinate performe</p>\n <div class=\"post-footer\">\n <a href=\"#\" class=\"text-btn\">Read More<i class=\"icofont-double-right\"></i></a>\n <a href=\"#\" class=\"comments\"><i class=\"icofont-comment\"></i><span>2</span></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n\t\t<!-- Blog Section Ending Here -->\n\t\t\n\t\t<!-- Sponsor Section Start Here -->\n\t\t<div class=\"sponsor-section padding-tb\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"section-wrapper\">\n\t\t\t\t\t<div class=\"sponsor-slider\">\n\t\t\t\t\t\t<div class=\"swiper-wrapper\">\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/01.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/02.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/03.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/04.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/05.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"swiper-slide\">\n\t\t\t\t\t\t\t\t<div class=\"sponsor-item\">\n\t\t\t\t\t\t\t\t\t<div class=\"sponsor-thumb\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\"><img src=\"<?php echo get_template_directory_uri(); ?>/assets/images/sponsor/06.png\" alt=\"lab-sponsor\"></a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- Sponsor Section Ending Here -->\n\n\t\t<?php\n\t}", "function process(){\n if(isset($this->displayParams['collection_field_list'])){\n if($this->action_type == 'editview'){\n $this->viewtype = 'EditView';\n }else {\n if($this->action_type == 'detailview'){\n $this->viewtype = 'DetailView';\n }\n }\n $relatedObject = BeanFactory::getObjectName($this->related_module);\n vardefmanager::loadVardef($this->related_module, $relatedObject);\n foreach($this->value_name as $key_value=>$field_value){\n $this->count_values[$key_value] = $key_value;\n $this->process_form($relatedObject,$key_value,$field_value);\n }\n $this->process_label($relatedObject);\n }else{\n die(\"the array collection_field_list isn't set\");\n }\n }", "function render_meta_box_content( $post ) {\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true ) ? get_post_meta( $post->ID, 'user_analytics_info', true ) : array();\n ?>\n <table class=\"form-table wpuf-user-analytics-listing\">\n <thead>\n <tr>\n <th><?php _e( 'User info title', 'wpuf-pro' ); ?></th>\n <th><?php _e( 'Value', 'wpuf-pro' ); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach ( $user_analytics_info as $key => $value ): ?>\n <tr>\n <td><strong><?php echo ucfirst( str_replace( '_', ' ', $key ) ); ?></strong></td>\n <td><?php echo $value; ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <style>\n .wpuf-user-analytics-listing td {\n font-size: 13px;\n }\n .wpuf-user-analytics-listing td, .wpuf-user-analytics-listing th {\n padding: 5px 8px;\n }\n </style>\n <?php\n }", "public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "private function addDetailsInRows()\n\t{\n\t\tforeach ($this->data_show as &$row)\n\t\t\tforeach ($this->data as $row_original)\n\t\t\t{\n\t\t\t\t$is_group = true;\n\t\t\t\t\n\t\t\t\tforeach ($this->col_group as $key)\n\t\t\t\t\tif($row[$key] != $row_original[$key])\n\t\t\t\t\t\t$is_group = false;\n\t\t\t\t\n\t\t\t\tif($is_group)\n\t\t\t\t{\n\t\t\t\t\t// total amount\n\t\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t\t$row[$this->col_aggr_sum] += $row_original[$this->col_aggr_sum];\n\t\t\t\t\t\n\t\t\t\t\t// add details\n\t\t\t\t\t$row_tmp = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach ($this->data[0] as $col => $val)\n\t\t\t\t\t\tif(!in_array($col, $this->col_show) || $col == $this->col_aggr_sum)\n\t\t\t\t\t\t\t$row_tmp[$col] = $row_original[$col];\n\t\t\t\t\t\n\t\t\t\t\t$row['details'][] = $row_tmp;\n\t\t\t\t}\n\t\t\t}\n\t}", "function borntogive_event_tickets_output() \n{\n global $post, $line_icons;\n $tickets_type = get_post_meta( $post->ID, 'borntogive_registrant_ticket_type', true );\n?>\n<div id=\"field_group\">\n <div id=\"field_wrap\">\n <div class=\"field_row\">\n <div class=\"field_left\">\n <?php\n\t\t\t\tif(!empty($tickets_type))\n\t\t\t\t{\n\t\t\t\t\tforeach($tickets_type as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<div><label>'.esc_attr__('Ticket Type: ', 'borntogive').esc_attr($key).'</label></div>';\n\t\t\t\t\t\techo '<div><label>'.esc_attr__('Number of Tickets: ', 'borntogive').esc_attr($value).'</label></div>';\n\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n </div>\n <div class=\"clear\" /></div> \n </div>\n </div>\n </div>\n <?php\n}", "function __construct($analysis) {\n\t\t\n\t\t$this->html = '<fieldset><legend><h3>Hours worked - by week</h3></legend>' . PHP_EOL; \n\t\t$this->html.= '<span class=\"comment\">Click table head labels to sort.</span>' . PHP_EOL;\n\t\t// Table head\n\t\t$this->html.= '<table class=\"sortable\">' . PHP_EOL; // minmax = expand rows on click\n\t\t$this->html.= '<thead>' . PHP_EOL;\n\t\t$this->html.= '<tr>';\n\t\t \n\t\t$this->html.= '<th>Hours for cal week</th>'; \n\t\t$this->html.= '<th>Total</th>';\n\t\t\n\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\t$this->html.= '<th>' . sql($filtersection, 'name', $item) . '</th>';\n\t\t\t}\n\t\t}\t\t \n\t\t$this->html.= '</tr>' . PHP_EOL;\n\t\t$this->html.= '</thead>' . PHP_EOL;\n\t\t\n\t\t// Table body\n\t\t$this->html.= '<tbody>';\n\t\tforeach ( $analysis->weeklyAnalysis as $week => $data) {\n\t\t\t$this->html.= '<tr >';\n\t\t\t$this->html.= '<td style=\"background:rgb(80,80,80); color:white; font-weight:bold;\"><span >' . $week . '</span></td>';\n\t\t\t// Total per week\n\t\t\t$this->html.= '<td>' . $data['total'] . '</td>';\n\t\t\t// By filters\n\t\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t$a = 0.5 * ($data[$filtersection][$item] / $data['total']); \t\t\t\t\t\t\t\t// opacity value\n\t\t\t\t\t$this->html.= '<td style=\"background: rgba(0,88,122,' . $a . ')\">' . $data[$filtersection][$item] . '</td>';\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t$this->html.= '</tr>';\n\t\t}\n\t\t// Total\n\t\t$this->html.= '<tr>';\n\t\t$this->html.= '<th style=\"background:rgb(60,60,60); color:white;\">Total</th>';\n\t\t$this->html.= '<th style=\"background:rgb(210,210,210); \">' . $analysis->count['total'] . '</th>';\n\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t$a = 0.1 + (0.5 * ($analysis->count[$filtersection][$item] / $analysis->count['total']));\t// opacity value\n\t\t\t\t\t$this->html.= '<th style=\"background:rgba(10,40,70,' . $a . '); \">' . $analysis->count[$filtersection][$item] . '</th>';\n\t\t\t\t}\n\t\t\t}\t\n\t\t$this->html.= '</tr>';\n\t\t\n\t\t$this->html.= '</tbody>';\n\t\t$this->html.= '</table><br>';\n\t\t\t\t\n\t\t$this->html .= '</fieldset>' . PHP_EOL; \n\t\t\n\t\t\n\t\t// By month //\n\t\t$this->html.= '<fieldset><legend><h3>Hours worked - by month</h3></legend>' . PHP_EOL; \n\t\t\n\t\t// Table head\n\t\t$this->html.= '<span class=\"comment\">Click table head labels to sort.</span>' . PHP_EOL;\n\t\t$this->html.= '<table class=\"sortable\">' . PHP_EOL; // minmax = expand rows on click\n\t\t$this->html.= '<thead>' . PHP_EOL;\n\t\t$this->html.= '<tr>';\n\t\t \n\t\t$this->html.= '<th>Hours for month</th>'; \n\t\t$this->html.= '<th>Total</th>';\n\n\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\t$this->html.= '<th>' . sql($filtersection, 'name', $item) . '</th>';\n\t\t\t}\n\t\t}\t\t \n\t\t$this->html.= '</tr>' . PHP_EOL;\n\t\t$this->html.= '</thead>' . PHP_EOL;\n\t\t\n\t\t// Table body\n\t\t$this->html.= '<tbody>';\n\t\tforeach ( $analysis->monthlyAnalysis as $month => $data) {\n\t\t\t$this->html.= '<tr>';\n\t\t\t$this->html.= '<td style=\"background:rgb(80,80,80); color:white; font-weight:bold;\">' . $month . '</td>';\n\t\t\t// Total\n\t\t\t$this->html.= '<td>' . $data['total'] . '</td>';\n\t\t\t// By filters\n\t\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t$a = 0.5 * ($data[$filtersection][$item] / $data['total']); \t\t\t\t\t\t\t\t// opacity value\n\t\t\t\t\t$this->html.= '<td style=\"background: rgba(0,88,122,' . $a . ')\">' . $data[$filtersection][$item] . '</td>';\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t$this->html.= '</tr>';\n\t\t}\n\t\t\n\t\t// Total\n\t\t$this->html.= '<tr>';\n\t\t$this->html.= '<th style=\"background:rgb(60,60,60); color:white\">Total</th>';\n\t\t$this->html.= '<th style=\"background:rgb(210,210,210); \">' . $analysis->count['total'] . '</th>';\n\t\tforeach ( $analysis->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t$a = 0.1 + (0.5 * ($analysis->count[$filtersection][$item] / $analysis->count['total'])); \t// opacity value\n\t\t\t\t\t$this->html.= '<th style=\"background:rgba(10,40,70,' . $a . '); \">' . $analysis->count[$filtersection][$item] . '</th>';\n\t\t\t\t}\n\t\t\t}\t\n\t\t$this->html.= '</tr>';\n\t\t\n\t\t$this->html.= '</tbody>';\n\t\t$this->html.= '</table>';\n\t\t\t\t\n\t\t$this->html .= '</fieldset>' . PHP_EOL; \n\t}", "function build() {\n\t\t$this->order_id = new view_field(\"Order ID\");\n\t\t$this->timestamp = new view_field(\"Date\");\n\t\t$this->total_amount = new view_field(\"Amount\");\n $this->view= new view_element(\"static\");\n \n $translations = new translations(\"fields\");\n $invoice_name = $translations->translate(\"fields\",\"Invoice\",true);\n $this->view->value=\"<a href=\\\"/orders/order_details.php?order_id={$this->_order_id}\\\" target=\\\"invoice\\\">\".$invoice_name.\"</a>\";\n\n\t\tif(isset($_SESSION['wizard']['complete']['process_time']))\n\t\t{\n\t\t\t$this->process_time = new view_field(\"Seconds to process\");\n\t\t\t$this->process_time->value=$_SESSION['wizard']['complete']['process_time'];\n\t\t\t$this->server = new view_field();\n\t\t\t$address_parts = explode('.',$_SERVER['SERVER_ADDR']);\n\t\t\t$this->server->value = $address_parts[count($address_parts) - 1];\n\t\t}\n\t\tparent::build();\n\t}", "public function view_booking_summary()\n {\n // check logged in\n if ( ! $this->custLoggedIn() )\n $this->redirect(\"login.php?error=login_required\");\n \n require_once('models/Customer.class.php');\n require_once('views/BookingSummary.class.php'); \n \n $site = new SiteContainer($this->db);\n\n $customer = new Customer($_SESSION['email'], $this->get_db());\n \n $bs = new BookingSummary();\n\n $site->printHeader();\n $site->printNav(\"customer\");\n $bs->printHtml($customer);\n $site->printFooter(); \n }", "public function getHtml($fieldsPerRow = 1, $displayOrder = \"vertical\"){\n $fields = $this->form->fields;\n $fieldsHidden = array();\n $fieldsBlock = array();\n foreach($fields as $key => $field){\n if($field instanceof Form_Field_Hidden){\n $fieldsHidden[] = $field;\n unset($fields[$key]);\n }\n }\n $fieldsPerBlock = ceil(count($fields) / $fieldsPerRow);\n if($displayOrder == \"horizontal\"){\n for($i = 1 ; $i <= $fieldsPerBlock; $i++){\n for($b = 1; $b <= $fieldsPerRow; $b++){\n $field = array_shift($fields);\n if($field === null) break 2;\n $fieldsBlock[$b][$field->name] = $field;\n }\n }\n }elseif($displayOrder == \"vertical\"){\n for($b = 1; $b <= $fieldsPerRow; $b++){\n for($i = 1 ; $i <= $fieldsPerBlock; $i++){\n $field = array_shift($fields);\n if($field === null) break 2;\n $fieldsBlock[$b][$field->name] = $field;\n }\n }\n }\n\n $output = '<div id=\"'.$this->id.'\" class=\"formtable\">';\n $output .= '<form '.$this->form->attr->getHtml().'>';\n $output .= '<input type=\"hidden\" name=\"form-'.$this->form->attr->get(\"name\").'\" value=\"1\"/>';\n foreach($fieldsHidden as $field){\n $output .= $field->getHtml();\n }\n if($fieldsBlock){\n $blockWidth = round(100 / $fieldsPerRow, 2, PHP_ROUND_HALF_DOWN);\n foreach($fieldsBlock as $block => $fields){\n $output .= '<div class=\"formtable-block\" style=\"width:'.$blockWidth.'%\">';\n if($fields){\n $output .= '<table class=\"formtable-table\">';\n foreach($fields as $field){\n $output .= '<tr class=\"formtable-fieldtype-'.strtolower(slugify(get_class($field))).' formtable-field-name-'.slugify($field->name).'\">';\n $output .= '<td class=\"formtable-label\"><label for=\"'.$field->attr->get(\"id\").'\">'.$field->label.'</label></td>';\n $output .= '<td class=\"formtable-field\">'.$field->getHtml().'</td>';\n $output .= '</tr>';\n }\n $output .= '</table>';\n }\n $output .= '</div>';\n }\n }\n if($this->buttons){\n $output .= '<div class=\"formtable-buttons\">';\n if($fieldsBlock) $output .= '<table class=\"formtable-table\"><tr><td class=\"formtable-label\"></td><td class=\"formtable-field\">';\n foreach($this->buttons as $field){\n $output .= $field->getHtml();\n }\n if($fieldsBlock) $output .= '</td></tr></table>';\n $output .= '</div>';\n }\n $output .= '</form></div>';\n $output .= '<script type=\"text/javascript\">(function(){var container = $(\"#'.$this->id.'\"); if(!container.data(\"formtable\")) new FormTable(container)})();</script>';\n return $output;\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $msg = html_div(\"ft_form_msg\") ;\r\n $msg->add(html_p(html_b(\"Processing the SDIF Queue requires\r\n processing swimmers, swim meets, and/or swim teams which are\r\n not currently stored in the database. Specify how unknown\r\n data should be processed.\"), html_br())) ;\r\n\r\n $td = html_td(null, null, $msg) ;\r\n $td->set_tag_attribute(\"colspan\", \"2\") ;\r\n $table->add_row($td) ;\r\n $table->add_row($this->element_label(\"Swimmers\"), $this->element_form(\"Swimmers\")) ;\r\n $table->add_row($this->element_label(\"Swim Meets\"), $this->element_form(\"Swim Meets\")) ;\r\n $table->add_row($this->element_label(\"Swim Teams\"), $this->element_form(\"Swim Teams\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function display_add_content_block() {\n\t\t?>\n\t\t<div id=\"add-wsublock-single\" class=\"wsublock-add\">Add single section</div>\n\t\t<div id=\"add-wsublock-sidebar\" class=\"wsublock-add\">Add sidebar section</div>\n\t\t<div id=\"add-wsublock-sideleft\" class=\"wsublock-add\">Add sideleft section</div>\n\t\t<div id=\"add-wsublock-halves\" class=\"wsublock-add\">Add halves section</div>\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "private function _drawFrontSummaryPage()\n {\n $this->AddPage();\n\n $this->SetFont('', 'B', 25);\n\n $this->Ln(10);\n $this->Cell('', '', 'STUDENT GRADUATING RESULT', 0, 1, 'C');\n\n $this->SetFont('', '', 15);\n $this->Ln(10);\n\n $defaultCellPadding = $this->getCellPaddings();\n\n $this->_writeFrontSummaryHeaderCell('NAME OF STUDENT');\n $this->_writeFrontSummaryDataCell($this->studentNames);\n\n $this->_writeFrontSummaryHeaderCell('REGISTRATION NUMBER');\n $this->_writeFrontSummaryDataCell($this->regNo);\n\n $this->_writeFrontSummaryHeaderCell('DEPARTMENT');\n $this->_writeFrontSummaryDataCell($this->deptName);\n\n $numSessions = count($this->sessionsSemestersCoursesGrades);\n $yearOfStudy = 0;\n $cgpa = '0.00';\n\n foreach ($this->sessionsSemestersCoursesGrades as $session => $sessionData) {\n $this->_writeFrontSummaryHeaderCell(strtoupper($this->yearsOfStudyArray[$yearOfStudy++]) . ' YEAR');\n $cgpa = $sessionData['cgpa'];\n $this->_writeFrontSummaryDataCell($cgpa);\n }\n\n $this->_writeFrontSummaryHeaderCell('ADDITIONAL YEAR');\n $this->_writeFrontSummaryDataCell('NIL');\n\n $this->_writeFrontSummaryHeaderCell('GRADUATING CGPA');\n $this->_writeFrontSummaryDataCell($cgpa);\n\n $this->_writeFrontSummaryHeaderCell('RESULT');\n $this->_writeFrontSummaryDataCell('PASS');\n\n $this->_writeFrontSummaryHeaderCell('EFFECTIVE DATE');\n $this->_writeFrontSummaryDataCell('28TH MAY, 2015');\n\n $this->setCellPaddings(\n $defaultCellPadding['L'],\n $defaultCellPadding['T'],\n $defaultCellPadding['R'],\n $defaultCellPadding['B']\n );\n }", "public function getSummary();", "public function panel_content() {\n\n\t\t$core_templates = apply_filters( 'wpforms_form_templates_core', array() );\n\t\t$additional_templates = apply_filters( 'wpforms_form_templates', array() );\n\t\t$additional_count = count( $additional_templates );\n\t\t?>\n\t\t<div id=\"wpforms-setup-form-name\">\n\t\t\t<span><?php esc_html_e( 'Form Name', 'wpforms-lite' ); ?></span>\n\t\t\t<input type=\"text\" id=\"wpforms-setup-name\" placeholder=\"<?php esc_attr_e( 'Enter your form name here&hellip;', 'wpforms-lite' ); ?>\">\n\t\t</div>\n\n\t\t<div class=\"wpforms-setup-title core\">\n\t\t\t<?php esc_html_e( 'Select a Template', 'wpforms-lite' ); ?>\n\t\t</div>\n\n\t\t<p class=\"wpforms-setup-desc core\">\n\t\t\t<?php\n\t\t\techo wp_kses(\n\t\t\t\t__( 'To speed up the process, you can select from one of our pre-made templates or start with a <strong><a href=\"#\" class=\"wpforms-trigger-blank\">blank form.</a></strong>', 'wpforms-lite' ),\n\t\t\t\tarray(\n\t\t\t\t\t'strong' => array(),\n\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\n\t\t<?php $this->template_select_options( $core_templates, 'core' ); ?>\n\n\t\t<div class=\"wpforms-setup-title additional\">\n\t\t\t<?php esc_html_e( 'Additional Templates', 'wpforms-lite' ); ?>\n\t\t\t<?php echo ! empty( $additional_count ) ? '<span class=\"count\">(' . $additional_count . ')</span>' : ''; ?>\n\t\t</div>\n\n\t\t<?php if ( ! empty( $additional_count ) ) : ?>\n\n\t\t\t<p class=\"wpforms-setup-desc additional\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %1$s - WPForms.com URL to a template suggestion, %2$s - WPForms.com URL to a doc about custom templates. */\n\t\t\t\t\t\t__( 'Have a suggestion for a new template? <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">We\\'d love to hear it</a>. Also, you can <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">create your own templates</a>!', 'wpforms-lite' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t\t\t'target' => array(),\n\t\t\t\t\t\t\t\t'rel' => array(),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'https://wpforms.com/form-template-suggestion/',\n\t\t\t\t\t'https://wpforms.com/docs/how-to-create-a-custom-form-template/'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<div class=\"wpforms-setup-template-search-wrap\">\n\t\t\t\t<i class=\"fa fa-search\" aria-hidden=\"true\"></i>\n\t\t\t\t<input type=\"text\" id=\"wpforms-setup-template-search\" value=\"\" placeholder=\"<?php esc_attr_e( 'Search additional templates...', 'wpforms-lite' ); ?>\">\n\t\t\t</div>\n\n\t\t\t<?php $this->template_select_options( $additional_templates, 'additional' ); ?>\n\n\t\t<?php else : ?>\n\n\t\t\t<p class=\"wpforms-setup-desc additional\">\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %1$s - WPForms.com URL to an addon page, %2$s - WPForms.com URL to a docs article. */\n\t\t\t\t\t\t__( 'More are available in the <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">Form Templates Pack addon</a> or by <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">creating your own</a>.', 'wpforms-lite' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t\t\t'target' => array(),\n\t\t\t\t\t\t\t\t'rel' => array(),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'https://wpforms.com/addons/form-templates-pack-addon/',\n\t\t\t\t\t'https://wpforms.com/docs/how-to-create-a-custom-form-template/'\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t</p>\n\n\t\t<?php\n\t\tendif;\n\t\tdo_action( 'wpforms_setup_panel_after' );\n\t}", "function\n\tGalleryStandardDisplay()\n\t{\n $phyType = new Field;\n $phyType->ColName = 'PhyType_tab';\n\n $phyHeight = new Field;\n $phyHeight->ColName = 'PhyHeight_tab';\n\n $phyWidth = new Field;\n $phyWidth->ColName = 'PhyWidth_tab';\n\n $phyDepth = new Field;\n $phyDepth->ColName = 'PhyDepth_tab';\n\n $phyDiameter = new Field;\n $phyDiameter->ColName = 'PhyDiameter_tab';\n\n $phyDimUnits = new Field;\n $phyDimUnits->ColName = 'PhyUnitLength_tab';\n\n $phyWeight = new Field;\n $phyWeight->ColName = 'PhyWeight_tab';\n\n $phyDimWeight = new Field;\n $phyDimWeight->ColName = 'PhyUnitWeight_tab';\n\n $sizeTable = new Table;\n $sizeTable->Name = 'Dimensions';\n $sizeTable->Headings = array('Height', 'Width', 'Depth', 'Diam', 'Unit', 'Type');\n $sizeTable->Columns = array($phyHeight, $phyWidth, $phyDepth, $phyDiameter, $phyDimUnits, $phyType);\n\n\t\t$narratives = new BackReferenceField;\n\t\t$narratives->RefDatabase = \"eevents\";\n\t\t$narratives->RefField = \"ObjAttachedObjectsRef_tab\";\n\t\t$narratives->ColName = \"SummaryData\";\n\t\t$narratives->Label = \"Events\";\n\t\t$narratives->LinksTo = $GLOBALS['DEFAULT_EXHIBITION_PAGE'];\n\n\t\t$creRole = new Field;\n\t\t$creRole->ColName = 'CreRole_tab';\n\t\t$creRole->Italics = 1;\n\t\t\n\t\t$creCreatorRef = new Field;\n\t\t$creCreatorRef->ColName = 'CreCreatorRef_tab->eparties->SummaryData';\n\t\t$creCreatorRef->LinksTo = $GLOBALS['DEFAULT_PARTY_DISPLAY_PAGE'];\n\t\t\n\t\t$creatorTable = new Table;\n\t\t$creatorTable->Name = \"CreCreatorRef_tab\";\n\t\t$creatorTable->Columns = array($creCreatorRef, $creRole);\n\n\t\t$this->Fields = array(\n 'TitMainTitle',\n 'TitAccessionNo',\n\t\t\t\t$creatorTable,\n 'TitMainTitle',\n 'CreDateCreated',\n 'PhyMediaCategory',\n 'PhyMedium',\n\t\t\t\t$sizeTable,\n\n\t\t\t\t'CrePrimaryInscriptions',\n\t\t\t\t'CreSecondaryInscriptions',\n 'AccCreditLineLocal',\n 'LocCurrentLocationRef->elocations->SummaryData',\n\n\t\t\t\t//'TitAccessionNo',\n\t\t\t\t//'TitMainTitle',\n\t\t\t\t//'TitAccessionDate',\n\t\t\t\t//'TitCollectionTitle',\n\t\t\t\t//'CreDateCreated',\n\t\t\t\t//'TitTitleNotes',\n\t\t\t\t//'CreCountry_tab',\n\t\t\t\t//'PhyMedium',\n\t\t\t\t//'PhyTechnique',\n\t\t\t\t//'PhySupport',\n\t\t\t\t//'PhyMediaCategory',\n\t\t\t\t//'LocCurrentLocationRef->elocations->SummaryData',\n\t\t\t\t//'NotNotes',\n\t\t\t\t//'MulMultiMediaRef:1->emultimedia->MulIdentifier',\n\t\t\t\t//'AssRelatedObjectsRef_tab->ecatalogue->SummaryData',\n\t\t\t\t//$AssRef,\n\t\t\t\t);\n\t\t\n\t\t$this->BaseStandardDisplay();\n\t}", "public function print_output() {\r\n foreach($this->customFields as $customField){\r\n if(get_post_meta( get_the_ID(), $customField['name'] , true )): ?>\r\n <li class=\"details-item\">\r\n <strong><?php echo __($customField['title'] , 'ex-list'); ?></strong> <?php echo get_post_meta( get_the_ID(), $customField['name'] , true ); ?>\r\n\t\t\t\t</li>\r\n <?php\r\n endif;\r\n }\r\n }", "public function render_content() { ?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">&percnt;</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "public function box($title, $type = null, $fields = array(), $header = true, $solid = false)\n\t{\n\t\t$content = '';\n\n\t\tif ($this->getModel()) {\n\t\t\t$meta = $this->model->meta;\n\t\t}\n\n\t\tforeach ($fields as $name => $field) {\n\t\t\t$value = (isset($field['value'])) ? $field['value'] : '';\n\t\t\t$options = (isset($field['options'])) ? $field['options'] : null;\n\n\t\t\tif ($field['type'] != 'heading') {\n\t\t\t\t$name = (isset($field['name']) ? $field['name'] : $name);\n\n\t\t\t\t$label = (isset($field['label'])) ? $field['label'] : null;\n\n\t\t\t\t// If a meta value is set then use that or previous value\n\t\t\t\t$value = (isset($meta[$name])) ? $meta[$name] : $value;\n\t\t\t\t// If a column exists then set value to it's content or use previous value\n\t\t\t\t$value = (isset($this->model->$name)) ? $this->model->$name : $value;\n\n\t\t\t\tif (isset($field['addon'])) {\n\t\t\t\t\t$attr = isset($field['addon']['attr']) ? $field['addon']['attr'] : null;\n\t\t\t\t\t$content .= '<div class=\"form-group input-group\" ' . $attr . '>';\n\n\t\t\t\t\tif ($field['addon']['position'] == 'before') {\n\t\t\t\t\t\t$content .= '<span class=\"input-group-addon\">' . $field['addon']['content'] . '</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$content .= '<div class=\"form-group\">';\n\n\t\t\t\t\tif ($label) {\n\t\t\t\t\t\t$content .= $this->make('heading', $label, null, array());\n\t\t\t\t\t}\n\n\t\t\t\t\t$content .= $this->make($field['type'], $name, $value, $options);\n\t\t\t\t$content .= '</div>';\n\n\t\t\t\tif (isset($field['addon'])) {\n\t\t\t\t\tif ($field['addon']['position'] == 'after') {\n\t\t\t\t\t\t$content .= '<span class=\"input-group-addon\">' . $field['addon']['content'] . '</span>';\n\t\t\t\t\t}\n\n\t\t\t\t\t$content .= '</div><!-- /.input-group -->';\n\t\t\t\t}\n\n\t\t\t// Type: Heading\n\t\t\t} else {\n\t\t\t\t$content .= $this->make($field['type'], $field['title'], null, $options);\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this->makeMetabox($title, $content, $type, $header, $solid);\n\t}", "public function definition_inner(&$mform) {\n\n $defaults = indicator_assessment::get_defaults();\n\n $elements = array('newposts', 'readposts', 'replies', 'totalposts');\n $grouparray = array();\n $mform->addElement('text', 'assessment_overduegracedays',\n get_string('overduegracedays', 'engagementindicator_assessment'), array('size' => 4));\n\t\t$mform->addHelpButton('assessment_overduegracedays', 'overduegracedays', 'engagementindicator_assessment');\n $mform->setDefault('assessment_overduegracedays', $defaults['overduegracedays']);\n $mform->setType('assessment_overduegracedays', PARAM_FLOAT);\n $mform->addElement('text', 'assessment_overduemaximumdays',\n get_string('overduemaximumdays', 'engagementindicator_assessment'), array('size' => 4));\n\t\t$mform->addHelpButton('assessment_overduemaximumdays', 'overduemaximumdays', 'engagementindicator_assessment');\n $mform->setDefault('assessment_overduemaximumdays', $defaults['overduemaximumdays']);\n $mform->setType('assessment_overduemaximumdays', PARAM_FLOAT);\n\n // Display overduesubmittedweighting group.\n $grouparray = array();\n $grouparray[] =& $mform->createElement('text', 'assessment_overduesubmittedweighting', '', array('size' => 4));\n $grouparray[] =& $mform->createElement('static', '', '', '%');\n $mform->addGroup($grouparray, 'group_assessment_overduesubmitted',\n get_string('overduesubmittedweighting', 'engagementindicator_assessment'), '&nbsp;', false);\n\t\t$mform->addHelpButton('group_assessment_overduesubmitted', 'overduesubmittedweighting', 'engagementindicator_assessment');\n $mform->setDefault('assessment_overduesubmittedweighting', $defaults['overduesubmittedweighting']*100);\n $mform->setType('assessment_overduesubmittedweighting', PARAM_FLOAT);\n\n // Display overduenotsubmittedweighting group.\n $grouparray = array();\n $grouparray[] =& $mform->createElement('text', 'assessment_overduenotsubmittedweighting', '', array('size' => 4));\n $grouparray[] =& $mform->createElement('static', '', '', '%');\n $mform->addGroup($grouparray, 'group_assessment_overduenotsubmitted',\n get_string('overduenotsubmittedweighting', 'engagementindicator_assessment'), '&nbsp;', false);\n\t\t$mform->addHelpButton('group_assessment_overduenotsubmitted', 'overduenotsubmittedweighting', 'engagementindicator_assessment');\n $mform->setDefault('assessment_overduenotsubmittedweighting', $defaults['overduenotsubmittedweighting']*100);\n $mform->setType('assessment_overduenotsubmittedweighting', PARAM_FLOAT);\n }", "protected function addElements() \n {\n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'title',\n 'options' => [\n 'label' => 'Title',\n ],\n ]);\n \n // Add \"parent_id\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'parent_id', \n 'options' => [\n 'label' => 'Full Name',\n ],\n ]);\n \n if ($this->scenario == 'create') {\n \n\n }\n \n // Add \"status\" field\n $this->add([ \n 'type' => 'select',\n 'name' => 'status',\n 'options' => [\n 'label' => 'Status',\n 'value_options' => [\n 1 => 'Active',\n 2 => 'Retired', \n ]\n ],\n ]);\n \n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Create'\n ],\n ]);\n }", "public function create_fields() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\t\t$method = $this->determine_method( $v, 'form' );\n\t\t\t\t$name = $v['name'];\n\t\t\t\tif ( $v['type'] == 'info' ) { $name = ''; }\n\t\t\t\tadd_settings_field( $k, $name, $method, $this->token, $v['section'], array( 'key' => $k, 'data' => $v ) );\n\n\t\t\t\t// Let the API know that we have a colourpicker field.\n\t\t\t\tif ( $v['type'] == 'range' && $this->_has_range == false ) { $this->_has_range = true; }\n\t\t\t}\n\t\t}\n\t}", "private function build_form()\n {\n $ldm = LaikaDataManager :: get_instance();\n\n // The Laika Scales\n $scales = $ldm->retrieve_laika_scales(null, null, null, new ObjectTableOrder(LaikaScale :: PROPERTY_TITLE));\n $scale_options = array();\n while ($scale = $scales->next_result())\n {\n $scale_options[$scale->get_id()] = $scale->get_title();\n }\n\n // The Laika Percentile Codes\n $codes = $ldm->retrieve_percentile_codes();\n $code_options = array();\n foreach ($codes as $code)\n {\n $code_options[$code] = $code;\n }\n\n $this->addElement('category', Translation :: get('Dates'));\n $this->add_timewindow(self :: GRAPH_FILTER_START_DATE, self :: GRAPH_FILTER_END_DATE, Translation :: get('StartTimeWindow'), Translation :: get('EndTimeWindow'), false);\n $this->addElement('category');\n\n $this->addElement('category', Translation :: get('Groups', null, 'group'));\n\n $group_options = $this->get_groups();\n\n if (count($group_options) > 0)\n {\n if (count($group_options) < 10)\n {\n $count = count($group_options);\n }\n else\n {\n $count = 10;\n }\n\n $this->addElement('select', self :: GRAPH_FILTER_GROUP, Translation :: get('Group', null, Utilities::GROUP), $this->get_groups(), array('multiple', 'size' => $count));\n $this->addRule(self :: GRAPH_FILTER_GROUP, Translation :: get('ThisFieldIsRequired', null, Utilities::COMMON_LIBRARIES), 'required');\n }\n else\n {\n $this->addElement('static', 'group_text', Translation :: get('Group'), Translation :: get('NoGroupsAvailable'));\n $this->addElement('hidden', self :: GRAPH_FILTER_GROUP, null);\n }\n\n $this->addElement('category');\n\n $this->addElement('category', Translation :: get('Results'));\n $this->addElement('select', self :: GRAPH_FILTER_SCALE, Translation :: get('Scale'), $scale_options, array('multiple', 'size' => '10'));\n $this->addRule(self :: GRAPH_FILTER_SCALE, Translation :: get('ThisFieldIsRequired', null, Utilities::COMMON_LIBRARIES), 'required');\n $this->addElement('select', self :: GRAPH_FILTER_CODE, Translation :: get('Code'), $code_options, array('multiple', 'size' => '4'));\n $this->addRule(self :: GRAPH_FILTER_CODE, Translation :: get('ThisFieldIsRequired', null, Utilities::COMMON_LIBRARIES), 'required');\n $this->addElement('category');\n\n $this->addElement('category', Translation :: get('Options'));\n\n $group = array();\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_TYPE, null, Translation :: get('RenderGraphAndTable'), LaikaGraphRenderer :: RENDER_GRAPH_AND_TABLE);\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_TYPE, null, Translation :: get('RenderGraph'), LaikaGraphRenderer :: RENDER_GRAPH);\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_TYPE, null, Translation :: get('RenderTable'), LaikaGraphRenderer :: RENDER_TABLE);\n $this->addGroup($group, self :: GRAPH_FILTER_TYPE, Translation :: get('RenderType'), '<br/>', false);\n\n $allow_save = PlatformSetting :: get('allow_save', LaikaManager :: APPLICATION_NAME);\n if ($allow_save == true)\n {\n $this->addElement('checkbox', self :: GRAPH_FILTER_SAVE, Translation :: get('SaveToRepository'));\n }\n\n $maximum_attempts = PlatformSetting :: get('maximum_attempts', LaikaManager :: APPLICATION_NAME);\n if ($maximum_attempts > 1)\n {\n $group = array();\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_ATTEMPT, null, Translation :: get('OnlyIncludeFirstAttempt'), LaikaGraphRenderer :: RENDER_ATTEMPT_FIRST);\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_ATTEMPT, null, Translation :: get('OnlyIncludeMostRecentAttempt'), LaikaGraphRenderer :: RENDER_ATTEMPT_LAST);\n $group[] = $this->createElement('radio', self :: GRAPH_FILTER_ATTEMPT, null, Translation :: get('IncludeAllAttempts'), LaikaGraphRenderer :: RENDER_ATTEMPT_ALL);\n $this->addGroup($group, self :: GRAPH_FILTER_ATTEMPT, Translation :: get('AttemptsToInclude'), '<br/>', false);\n }\n else\n {\n $this->addElement('hidden', self :: GRAPH_FILTER_ATTEMPT, LaikaGraphRenderer :: RENDER_ATTEMPT_ALL);\n }\n\n $this->addElement('category');\n\n $buttons = array();\n\n $buttons[] = $this->createElement('style_submit_button', 'submit', Translation :: get('Filter', null, Utilities::COMMON_LIBRARIES), array('class' => 'normal search'));\n $buttons[] = $this->createElement('style_reset_button', 'reset', Translation :: get('Reset', null, Utilities::COMMON_LIBRARIES), array('class' => 'normal empty'));\n\n $this->addGroup($buttons, 'buttons', null, '&nbsp;', false);\n }", "function render_form_fields ( $opt_groups, $prefix, $name_attr = false ) {\n\n #$first_row = null;\n\t\t\t\t#$rowgroup_counter = false;\n $output = '';\n \n\t\t\t\tforeach ( $opt_groups as $group => $opt_fields ) {\n\n \t\t$output.= '<fieldset class=\"'.$group.'\"><legend>'. $opt_fields['label'] .'</legend><table class=\"form-table\">';\n\n\t\t foreach ( $opt_fields['fields'] as $id => $field ) {\n\n\t\t\t\t\t\t\t\t$formfield = '';\n\n\t\t\t\t\t\t\t\t// set name attribute\n\t\t\t\t\t\t\t\t$name\t=\t( $name_attr ) ? $name_attr.'['.$id.']' : $id ;\n\n\t\t\t\t\t\t\t\t// set id and css class\n\t\t\t\t\t\t\t\t$css_id = $prefix.$usage.$family.'_'.$id;\n\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t$class = $prefix.$usage.$family.' '.$prefix.$usage.$id.' '.$prefix.$family.$id;\n\t\t\t\t\t\t\t\t$class = ( isset( $field['class'] ) ) ? $class.' '.$field['class'] : $class;\n\t\t\t\t\t\t\t\t$status = ( isset( $field['status'] ) ) ? ' '.$field['status'] : '';\n\n\t\t\t\t\t\t\t\t// pre-define if to use scope=\"rowgroup\" or tr without th\n\t\t\t\t\t\t\t\t#$rowgroup_counter = ( $rowgroup_counter >= 0 ) ? $rowgroup_counter : false ;\n\n\n/*\n\t\t\t\t\t\t\t\tif ( $field['type'] == 'rowgroup' ) {\n\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t $output .= '<tr class=\"'.$css_id.' '.$prefix.$id.$status.'\"><th scope=\"rowgroup\" rowspan=\"'.$field['rows'].'\">'.$field['label'].'</th>';\n\t\t\t\t $rowgroup_counter = $field['rows'];\n\t\t\t\t $first_row = true;\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// go on and do not add another tr\n\t\t\t\t\t\t\t\t\t\tif ( isset( $first_row ) ) {\n\t\t unset( $first_row );\n\t\t //\n\t\t\t\t\t\t\t\t\t\t} elseif ( $rowgroup_counter === null || $rowgroup_counter === false ) {\n\t\t\t\t \t\t\t\t\t\t\t\t$output .= '<tr class=\"'.$css_id.' '.$prefix.$id.$status.'\"><th><label for=\"'.$css_id.'\">'.$field['label'].'</label></th>';\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t \t\t\t\t\t\t\t\t$output .= '<tr class=\"'.$css_id.' '.$prefix.$id.$status.'\">';\n\t\t\t\t\t\t\t\t }\n*/\n\t\t\t\t \t\t\t\t\t\t$output .= '<tr class=\"'.$css_id.' '.$prefix.$id.$status.'\"><th><label for=\"'.$css_id.'\">'.$field['label'].'</label></th>';\n\t\t\t\t\t\t\t\t\t\t#$output .= '<tr class=\"'.$css_id.' '.$prefix.$id.$status.'\">';\n\t\t\t\t\t\t $output .= '<td class=\"'.$field['type'].'\">';\n\n\t\t\t\t\t\t switch( $field['type'] ) {\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<input type=\"text\" name=\"'.$name.'\" id=\"'.$css_id.'\" value=\"'.$field['value'].'\" class=\"'.$class.'\"/>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<input type=\"checkbox\" name=\"'.$name.'\" id=\"'.$css_id.'\" value=\"1\" '. checked( $field['value'], 1, false ) .' class=\"'.$class.'\"/>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'select':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<select name=\"'.$name.'\" id=\"'.$css_id.'\" class=\"'.$class.'\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($field['options'] as $k => $v ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<option'. selected( $field['value'], $k, false ) .' value=\"'.$k.'\">'.$v.'</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '</select>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($field['options'] as $k => $v ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<input type=\"radio\" name=\"'.$name.'\" id=\"'.$css_id.'-'.$k.'\" value=\"'.$k.'\" '. checked( $field['value'], $k, false ) .' class=\"'.$id.'-'.$k.'\" />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<label for=\"'.$css_id.'-'.$k.'\" class=\"'.$id.' '.$id.'-'.$k.'\">'.$v.'</label>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'upload':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<input type=\"text\" name=\"'.$name.'\" id=\"'.$css_id.'\" value=\"'.$field['value'].'\" class=\"'.$class.'\"/>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<input id=\"'.$css_id.'-upload\" class=\"wp-cmm_call-wp-mediamanagement\" type=\"button\" value=\"'.__( 'Upload' ).'\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'multipleselect':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<select name=\"'.$name.'[]\" id=\"'.$css_id.'\" class=\"'.$class.'\" multiple>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($field['options'] as $value => $label ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t$selected = ( in_array( $value, $field['value'] ) ) ? ' selected' : '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<option'. $selected .' value=\"'.$value.'\">'.$label.'</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '</select>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n*/\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase 'terms_checklist':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<ul id=\"'.$css_id.'\" class=\"categorychecklist form-no-clear '.$class.'\" >';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($field['options'] as $value => $label ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$checked = ( in_array( $value, $field['value'] ) ) ? ' checked' : '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<li><label for=\"'.$css_id.'-'.$value.'\"><input'.$checked.' type=\"checkbox\" name=\"'.$name.'['.$value.']\" id=\"'.$css_id.'-'.$value.'\" value=\"1\" />'.$label.'</label></li>';\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '<li><label for=\"'.$css_id.'-'.$value.'\"><input'.$checked.' type=\"checkbox\" name=\"'.$name.'\" id=\"'.$css_id.'-'.$value.'\" value=\"'.$value.'\" />'.$label.'</label></li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$formfield .= '</ul>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t } //end switch\n\n/*\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\tif ( $rowgroup_counter !== false && $rowgroup_counter !== null && $field['label'] ) {\n\t\t\t\t \t\t\t\t\t\t\t\t$output .= '<label for=\"'.$css_id.'\">'.$formfield.$field['label'].'</label>';\n\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\t\t\t\t$output .= $formfield;\n\t\t\t\t\t\t\t\t\t\t}\n*/\n\t\t\t\t\t\t\t\t\t\t\t\t$output .= $formfield;\n\t\t\t\t \t\t\t\t\t#\t$output .= '<label for=\"'.$css_id.'\">'.$formfield.$field['label'].'</label>';\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\tif ( $field['desc'] ){\n\t\t\t\t\t\t\t\t\t\t\t\t$output .= '<span class=\"howto\">'.$field['desc'].'</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t $output .= \"</td></tr>\\n\\n\";\n\t\t\t\t #}\n\n\t\t\t\t\t\t\t\t#$rowgroup_counter--;\n\n\n\t\t } // end foreach $opt_fields\n\t\t \n\t\t $output.= '</table></fieldset>';\n\t\t \n\t\t } // end foreach $opt_groups\n\t\t \n\t\t\t\techo $output;\n\t\t}", "private function build_FNCsummary(){\n $reply = array();\n\n ob_start();\n ksort($this->collected_highlights);\n $title = x('strong','Not all the formalities are completed:');\n foreach($this->collected_highlights as $reason=>$info){\n if (!empty($title)) {\n\tprint $title; $title = '';\n\t$t = new b_table(\"class='width100'\");\n }\n $h = array_keys($info);\n $n = array_values($info);\n $a = '&nbsp;';\n if (in_array($h[0],array('highlightRose','highlightYellow')) && \n\t $this->doing =='lists' && \n\t VM::hasRightTo('endorse_event')){\n\t$a = 'Please '.(is_object(VM::$e) && VM::$e->isEventEndorsed()?'UNLOCK the budget and':'').\n\t ($h[0] == 'highlightRose' ? 'resolve the issue' : 'approve or reject the applicants');\n }\t\n $t->tro();\n $t->td($n[0],\"class='$h[0] align_right'\");\n $t->td(($message=$reason.(($n[0]>1 && strpos($reason,')')===False)?'s':'')).\"<br/>$a\",\"class='$h[0]'\");\n if (!isset($FNC_message)) $FNC_message = \"$n[0] $message\";\n $t->trc();\n }\n if (empty($title)) $t->close();\n $summary = ob_get_contents();\n ob_end_clean();\n if (isset($FNC_message)) $reply[$FNC_message] = $summary;\n\n // accommodation\n foreach($this->no_accommodation as $action_message=>$list){\n $list = array_unique($list);\n sort($list);\n $title = ($n=count($list)) . ' approved visitor'.($n>1?'s':'').' without accommodation.';\n if (VM::hasRightTo('book_ah') && VM::$e->getValue('e_end') > time()) $title .= \" The budget can't be approved unless this problem is solved.\";\n if ($n > 1){\n\t$summary = \"$action_message:\" . x('ul',b_fmt::joinMap('li',$list));\n }else{\n\t$summary = \"$action_message $list[0]\";\n }\n $reply[$title] = $summary;\n }\n return $reply;\n }", "public function render_page() {\n $form_id=str_replace(' ','',$this->form_name).'Form';\n $form_field_ids=array();\n $html='';\n $associated_upload_field=NULL;\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if($single_field['field_type']==\"upload\") {\n $associated_upload_field=$single_field;\n \n }\n }\n }\n \n //sort out the dialog first\n if($this->id_field != '') {\n \n $sql_result=$this->db->query($this->selector_query);\n $table_data=\"\";\n \n foreach($sql_result as $row) {\n $table_data.=\"<tr id='\".$row[$this->id_field].\"'>\";\n foreach($this->selector_field_list as $selector_field) {\n $table_data.=\"<td>\".$row[$selector_field].\"</td>\";\n }\n $table_data.=\"</tr>\";\n }\n \n $html.='<div id=\"'.str_replace(' ','_',$this->form_name).'_dialog\" title=\"Dialog Title\">';\n //put the html together for the selector and send it off with the JS\n $html.='<table id=\"'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector\" class=\"display\" cellspacing=\"0\"\" width=\"100%\"><thead><tr>';\n foreach($this->selector_field_list as $field) {\n $html.='<th>'.$field.'</th>';\n }\n $html.='</tr></thead></tbody>'.$table_data.\"</tbody></table>\";\n $html.='</div>';\n }\n \n \n \n \n \n //add the start of the form using a table for layout\n $upload_warning_field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$associated_upload_field['field_name'])));\n $html.='\n <form id=\"'.$form_id.'\" method=\"POST\" >';\n if (!is_null($associated_upload_field)) {\n $html.='<div id=\"'.$upload_warning_field_id.'_dialog\"></div>';\n }\n $html.='\n <table class=\"page_container\">\n <tr><td colspan=\"2\"><h1>'.$this->form_name.'</h1></td></tr>';\n \n //iterate over the fields, and groups of fields, and render the form\n foreach ($this->page_fields as $single_group) {\n $sub_heading=ucwords($single_group['sub_heading']);\n \n //add the sub heading for this group of fields\n $html.='<tr><th colspan=\"2\" class=\"sub_heading\"><h2>'.$sub_heading.'</h2></th></tr>';\n \n //add the fields, including the sub headings, for this grouping\n foreach($single_group['fields'] as $single_field) {\n \n //set the id that will be used to extract data from this field in JS and define it on the page\n $input_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$single_field['field_name'])));\n $form_field_ids[str_replace(' ','_',$single_field['field_name'])]=$input_id;\n //add each field into the HTML\n switch ($single_field['field_type']) {\n //for a text field, that is to be on a single row\n case 'text':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><input id=\"'.$input_id.'\" type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a text field, that is to be on a single row\n case 'currency':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).' $</th><td><input id=\"'.$input_id.'\" type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a text area which is supposed to be multiple rows and columns\n case 'textarea':\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><textarea id=\"'.$input_id.'\" cols=\"'.$single_field['columns'].'\" rows=\"'.$single_field['rows'].'\"></textarea></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n \n //for a label area which gets its content from another field\n case 'annotation':\n //TODO: test annotation types on something other than an upload field\n //'field_name'=>$field_name,\n //'field_type'=>'annotation',\n //'length'=>$field_length,\n //'lookup_no_match'=>$no_match_value,\n //'lookup_query'=>$lookup_query,\n //'anchor'=>$anchor\n $anchors=explode('|',$single_field['anchor']);\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><input id=\"'.$input_id.'\" disabled type=\"text\" style=\"width:'.$single_field['length'].'px;\" /></td></tr>\n <tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n $lookup_data=$this->db->query($single_field['lookup_query']);\n \n if ($anchors[2]==\"mime_type\") {\n $anchor_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$anchors[1]),'fileToUpload'));\n $annotation_js='\n var mime_type=$(\"#'.$anchor_id.'\")[0].files[0].type;\n var document_lookup={';\n foreach($lookup_data as $single_entry) {\n $annotation_js.='\"'.$single_entry['data_key'].'\":\"'.$single_entry['data_value'].'\",';\n }\n $annotation_js.='};\n var converted_type=document_lookup[mime_type];\n if (converted_type==null) {\n converted_type=\"'.$single_field['lookup_no_match'].'\";\n }\n $(\"#'.$input_id.'\").val(converted_type);';\n \n $this->annotations[]=$annotation_js;\n }\n \n \n break;\n \n //for an upload field which gets its content with a file input\n case 'upload':\n $html.='<tr><td>\n <input style=\"display:none\" type=\"file\" id=\"'.$input_id.'_fileToUpload\" />\n <label class=\"file_upload_label\" for=\"'.$input_id.'_fileToUpload\">'.$single_field['upload_button_text'].'</label>\n </td><td>\n <input id=\"'.$input_id.'_filename\" disabled type=\"text\" placeholder=\"'.$single_field['placeholder'].'\" style=\"width: '.$single_field['length'].'px;\" />\n </td></tr>';\n //need a maximum upload size hidden field somewhere\n $html.='<input type=\"hidden\" id=\"'.$input_id.'_max_filesize\" value=\"'.$single_field['max_size'].'\" />';\n \n //also need an error message container here\n $html.='<tr><td colspan=\"2\">\n <div id=\"'.$input_id.'_error_message_container\" class=\"ui-widget\">\n <div class=\"ui-state-error ui-corner-all\" style=\"padding: 0 .7em;\"> \n <p><span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span><strong>Alert:</strong><span id=\"'.$input_id.'_error_message\"></span></p>\n </div></div></td></tr>';\n \n break;\n \n //for a combo or drop down box which should have a lookup defined\n case 'combo':\n //'combodata'=>'salutation|salutation_id|description'\n $html.='<tr><th class=\"left_col\">'.ucwords($single_field['field_name']).'</th><td><select id=\"'.$input_id.'\">';\n $combo_fields=explode('|',$single_field['combodata']);\n $queryResult=$this->db->query(\"select * from \".$combo_fields[0]);\n foreach ($queryResult as $row) {\n $html.='<option value=\"'.$row[$combo_fields[1]].'\">'.ucwords($row[$combo_fields[2]]).'</option>';\n }\n $html.='</select></td></tr><tr><th></th><td><span id=\"'.$input_id.'_error\"></span></td></tr>';\n break;\n }\n }\n }\n \n //add the buttons\n $counter=1;\n foreach($this->buttons as $button) {\n \n //at the start, if the column count is odd, start a new line for the buttons\n if($counter%2!=0) {\n $html.='<tr>';\n }\n \n //right column check and set TD class\n $this_class='left_col button_row';\n if ($counter%2==0) {\n $this_class='right_col button_row';\n }\n \n //place the button\n $this_button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button')); //clientDeleteCancelButton\n if (in_array($button,$this->available_buttons)) {\n $html.='<td class=\"'.$this_class.'\"><button type=\"button\" id=\"'.$this_button_id.'\">'.ucwords($button).'</button></td>';\n }\n else {\n error_log(\"BasicForm: Unable to interpret button request from basic_form->render_page call, button requested was: \".$button);\n }\n \n //after the counter increases, if the counter is odd, we need to close this line of buttons\n $counter+=1;\n if($counter%2!=0) {\n $html.='</tr>';\n }\n }\n \n //finish off the button rows if there were an odd number of buttons, and the row ender above (inside the loop) didnt fire\n if($counter%2==0) {\n $html.='</tr>';\n }\n \n //close the table, set an identifier field if required, ie, a hidden id field for updates or removes from the DB and close the form.\n $html.='</table>';\n if($this->id_field != '') {\n $this_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field));\n $html.='<input id=\"'.$this_id.'\" type=\"hidden\" value=\"'.$this->id_field_value.'\" />';\n }\n $html.='</form>';\n \n //make the javascript part of the response\n $js='<script>\n $(document).ready(function () {\n ';\n \n //if a hidden id field has been added and a value set, then we need to render a selector window to populate the table correctly\n if($this->id_field != '') {\n $js.='\n \n //define the data table\n var table=$(\"#'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector\").DataTable({paging: true, searching: true, destroy: true});\n \n //setup the dialog box for this use case\n $( \"#'.str_replace(' ','_',$this->form_name).'_dialog\" ).dialog({autoOpen: false,width: 700,modal: true,\n buttons: [\n {\n text: \"Select\",\n click: function() {\n var rowSelected=$(\".selected\").attr(\"id\");\n if (!rowSelected) {\n alert(\"You need to select a row by clicking on it first.\");\n }\n else {\n load_data_into_form(rowSelected);\n }\n }\n },\n {\n text: \"Cancel\",\n click: function() {\n $( this ).dialog( \"destroy\" ).remove();\n close_current_tab();\n }\n }\n ]\n });\n \n //toggle selected row\n $(\"#'.str_replace(' ','_',$this->form_name).'_'.$this->id_field.'_selector tbody\").on( \"click\", \"tr\", function () {\n if ( $(this).hasClass(\"selected\") ) {\n $(this).removeClass(\"selected\");\n }\n else {\n table.$(\"tr.selected\").removeClass(\"selected\");\n $(this).addClass(\"selected\");\n }\n });\n \n //load the record into the form\n function load_data_into_form(selected_id) {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data:{\n page:\"'.$this->feature.'_Load_'.str_replace(' ','_',$this->form_name).'_Data\",\n '.$this->id_field.':selected_id,\n }\n })\n .done(function(e) {\n var data=JSON.parse(e);';\n \n \n \n \n \n $first_done=false;\n foreach($this->full_field_list as $field) {\n if($field==$this->id_field) {\n $js.='\n $(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").val(data[\"'.$field.'\"]);\n $(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").trigger(\"change\");';\n }\n else {\n $js.='$(\"#content_'.$this->feature.'_'.str_replace(' ','_',$this->form_name).'_'.$field.'\").val(data[\"'.$field.'\"]);';\n }\n $first_done=true;\n }\n $js.='$(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog( \"destroy\" ).remove();\n });\n }';\n \n $js.='\n $(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog(\"option\",\"title\",\"'.$this->selector_title.'\");\n $(\"#'.str_replace(' ','_',$this->form_name).'_dialog\").dialog(\"open\");\n ';\n }\n \n \n \n //add the validation function, if required\n $validate_page_name=implode('_',array($this->feature,'Validate',str_replace(' ','_',ucwords($this->form_name))));\n if (count($this->validators)>0) {\n $js.='\n function '.$validate_page_name.'_validate() {\n //hide all validation fields, in case they were populated last time\n ';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.='$(\"#'.$field_id.'_error\").hide();';\n }\n }\n $js.='\n var id_lookups={';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.='\"'.$field_name.'\":\"'.$field_id.'\",';\n }\n }\n $js.='};\n \n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$validate_page_name.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n if (in_array($field_name,$this->validators)) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n }\n $js.=' }\n })\n .done(function(e){\n //if e is true, then there is nothing to do, otherwise, \n var errors=JSON.parse(e);\n //if theres no errors, return true\n if (Object.keys(errors).length==0) {\n blind_submit();\n }\n //populate the error messages, and return false\n for (var error in errors) {\n if (errors.hasOwnProperty(error)) {\n var this_id=id_lookups[error];\n $(\"#\"+this_id+\"_error\").html(\"<p style=\\'color:red;\\'>\"+errors[error]+\"</p>\");\n $(\"#\"+this_id+\"_error\").show();\n }\n }\n });\n }\n ';\n }\n \n //add any button responders needed\n foreach ($this->buttons as $button) {\n if (in_array($button,$this->available_buttons)) {\n $button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button'));;\n \n //javascript response to the CANCEL button\n if ($button=='cancel') {\n $js.='\n $(\"#'.$button_id.'\").click(function() {\n close_current_tab();\n });';\n }\n //javascript response to the SAVE button\n if ($button=='save') {\n $page_string=implode('_',array($this->feature,'Submit',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the save button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n }\n \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n }';\n \n }\n \n //javascript repsponse to the DELETE button\n if ($button=='delete') {\n $page_string=implode('_',array($this->feature,'Delete',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the delete button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n } \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n $js.=$this->id_field.':$(\"#'.implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field)).'\").val(),';\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n }';\n }\n \n //javascript response to an UPLOAD button, meant to be used in conjunction with a form containing a file upload field\n if($button=='upload') {\n $associated_upload_field=NULL;\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if($single_field['field_type']==\"upload\") {\n $associated_upload_field=$single_field;\n \n }\n }\n }\n $field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name)));//,str_replace(' ','_',$associated_upload_field['field_name'])\n $upload_field_id=implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),str_replace(' ','_',$associated_upload_field['field_name'])));\n $this_button_id=implode('',array(str_replace(' ','',$this->form_name), $button, 'Button'));\n $js.='\n //hide the error container at page load\n $(\"#'.$upload_field_id.'_error_message_container\").hide();\n \n //handle any hooks in the filename update changes\n $(\"#'.$upload_field_id.'_fileToUpload\").change(function(){\n if ($(\"#'.$upload_field_id.'_fileToUpload\")[0].files.length>0) {\n $(\"#'.$upload_field_id.'_filename\").val($(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0].name);';\n \n //check for annotations\n foreach($this->annotations as $single_hook) {\n $js.=$single_hook;\n }\n \n $js.='}\n $(\"#'.$upload_field_id.'_error_message_container\").hide();\n });\n \n //handle the upload button\n $(\"#'.$button_id.'\").click(function(e) {\n e.preventDefault();\n if ($(\"#'.$upload_field_id.'_fileToUpload\")[0].files.length>0) {\n var file_size=$(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0].size;\n var allowed_filesize=parseInt($(\"#'.$upload_field_id.'_max_filesize\").val());\n if(file_size<=allowed_filesize) {\n var mydata=new FormData();\n mydata.append(\"page\",\"'.implode('_',array($this->feature,'Submit',str_replace(' ','_',ucwords($this->form_name)))).'\");\n ';\n \n //add field submission data\n foreach ($this->page_fields as $single_group) {\n foreach($single_group['fields'] as $single_field) {\n if ($single_field['field_type']=='text' or $single_field['field_type']=='currency' or $single_field['field_type']=='textarea' or $single_field['field_type']=='annotation' or $single_field['field_type']=='combo') {\n $js.='mydata.append(\"'.str_replace(' ','_',$single_field['field_name']).'\",$(\"#'.$field_id.'_'.str_replace(' ','_',$single_field['field_name']).'\").val());';\n }\n if ($single_field['field_type']=='upload') {\n $js.='mydata.append(\"datafile\",$(\"#'.$upload_field_id.'_fileToUpload\")[0].files[0]);';\n }\n \n }\n }\n \n $js.='\n $( \"#'.$upload_field_id.'_dialog\" ).dialog({\n autoOpen: true,\n closeOnEscape: false,\n title: \"File uploading in progress...\",\n width: 400,\n height: 0,\n modal: true,\n });\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n enctype: \"multipart/form-data\",\n data: mydata,\n cache: false,\n processData: false,\n contentType: false,\n })\n .done(function(e){\n //the response may start with an error string, or success string, we need to handle wither case appropriately\n $( \"#'.$upload_field_id.'_dialog\" ).dialog( \"destroy\" ).remove();\n if (e.length>=5 && e.substr(0,5)==\"error\") {\n $(\"#'.$upload_field_id.'_error_message\").html(e.substr(5));\n $(\"#'.$upload_field_id.'_error_message_container\").show();\n }\n else if (e.length>=7 && e.substr(0,7)==\"success\") {\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e.substr(7));\n }\n }\n close_current_tab();\n }\n });\n }\n else {\n var reported_file_size=file_size;\n if (file_size>1000 && file_size<=1000000) {\n reported_file_size=Math.round(file_size/1000);\n reported_file_size+=\"KB\";\n }\n else if(file_size>1000000 && file_size<=1000000000) {\n reported_file_size=(file_size/1000000).toFixed(1);\n reported_file_size+=\"MB\";\n }\n else if(file_size>1000000000 && file_size<=1000000000000) {\n reported_file_size=(file_size/1000000000).toFixed(1);\n reported_file_size+=\"GB\";\n }\n $(\"#'.$field_id.'_error_message\").html(\"Filesize of \"+reported_file_size+\" is too big\");\n $(\"#'.$field_id.'_error_message_container\").show();\n }\n }\n else {\n alert(\"Choose a file to upload first\");\n }\n });';\n }\n \n //javascript response to the UPDATE button\n if ($button=='update') {\n $page_string=implode('_',array($this->feature,'Update',str_replace(' ','_',ucwords($this->form_name))));\n $js.='//handle the update button\n $(\"#'.$button_id.'\").click(function() {\n ';\n //if there is validation on this form, use the validation function generated above, otherwise use the blind submit\n if (count($this->validators)>0) {\n $js.=$validate_page_name.'_validate();\n });';\n }\n else {\n $js.='blind_submit();\n });';\n } \n //define the blind submit function\n $js.='\n function blind_submit() {\n $.ajax({\n type: \"POST\",\n url: \"page_responder.php\",\n data: \n {\n page:\"'.$page_string.'\",';\n foreach($form_field_ids as $field_name=>$field_id) {\n $js.=$field_name.':$(\"#'.$field_id.'\").val(),';\n }\n $js.=$this->id_field.':$(\"#'.implode('_',array('content',$this->feature,str_replace(' ','_',$this->form_name),$this->id_field)).'\").val(),';\n $js.=' }\n })\n .done(function(e){\n var tabs=$(\"div#tabs ul\").children();\n for (var i=0; i<tabs.length; i++) {\n if ($(\"div#tabs ul\").children()[i].getAttribute(\"aria-controls\")==\"about\") {\n $(\"div#about\").append(e);\n }\n }\n close_current_tab();\n });\n };';\n }\n }\n else {\n error_log(\"BasicForm: Unable to interpret button request from basic_form->render_page call, button requested was: \".$button);\n }\n }\n \n //close off and finalise the JS\n $js.='});</script>';\n return $js.$html;\n }", "function normalView_main($arrayConst) {\n global $Meta;\n//print_r($Meta);\n//print_r($arrayConst);\n $utl = SINGLETON_MODEL::getInstance(\"UTILITIES\");\n $html = SINGLETON_MODEL::getInstance(\"HTML\");\n $js = SINGLETON_MODEL::getInstance(\"JAVASCRIPT\");\n $statusAction = $arrayConst['statusAction'];\n $statusActive = $arrayConst['statusActive'];\n $urlstring = $arrayConst['urlstring'];\n echo \"<div id='panelView' class='panelView'>\";\n echo \"<table id='mainTable' cellpadding='1' cellspacing='1'>\";\n echo \"<tr class='titleBottom'>\";\n $i = 1;\n//print_r ($arrayConst['Meta']['Field']);\n//exit();\n if (count($arrayConst['Meta']['Field']) > 0)\n//Heading\n foreach ($arrayConst['Meta']['Field'] as $Field => $FieldInfo) {\n if (($FieldInfo['list_show']) && ((!$arrayConst['filter_parameter'][$Field]) || ($Field == 'table_name'))) {\n if ($FieldInfo['format_id']) {\n $FieldInfo['format_code'] = $this->getValueOfQuery('SELECT code FROM sys_format WHERE id=' . $FieldInfo['format_id']);\n $arrayConst['Meta']['Field'][$Field]['format_code'] = $FieldInfo['format_code'];\n }\n $Label = $FieldInfo['Label'];\n if ($FieldInfo['list_sortable']) {\n $list_sortable_direction_display = '';\n if ($_GET['list_sortable_field'] == $Field) {\n if ($_GET['list_sortable_direction'] == 'DESC') {\n $list_sortable_direction_display = ' ▲';\n }\n else {\n $list_sortable_direction_display = ' ▼';\n }\n }\n $Label = '<a href=\"javascript:void(0)\" style=\"color:white\" onclick=\"list_sortable(\\'' . $Field . '\\')\">' . $Label . $list_sortable_direction_display . '</a>';\n }\n if ($i == 1) {\n echo \"<td class='itemCenter'><input type='checkbox' name='chkall' id='chkall' value='1' onclick='docheck(this.checked,0);'></td>\";\n if ($arrayConst['Meta']['tableInfo'][\"show_order\"])\n echo \"<td class='itemCenter'>STT</td>\";\n if ($_GET[\"table_name\"] == 'dailyservice_in' || $arrayConst['tablename'] == 'dailyservice_in') {\n echo \"<td class='itemCenter' width='80'>IN Ref. No.</td>\";\n }\n else\n if ($_GET[\"table_name\"] == 'dailyservice_out' || $arrayConst['tablename'] == 'dailyservice_out') {\n echo \"<td class='itemCenter' width='80'>OUT Ref. No.</td>\";\n }\n else {\n echo \"<td class='itemCenter'>ID</td>\";\n }\n }\n else {\n if ($FieldInfo['fk_from']) {\n $Data = $this->RSTTOARRAY($this->getDynamic($FieldInfo['fk_from'], $FieldInfo['fk_where'], $FieldInfo['fk_orderby']), \"id\", array($FieldInfo['fk_text'] => $FieldInfo['fk_text']));\n }\n $DataSource[$Field] = $Data;\n if ($FieldInfo['Type'] == \"int\")\n if (strstr(strtolower($Field), \"price_goc\") != \"\") {\n if ($_SESSION[\"user_login\"][\"role_id\"] != 12) {\n echo \"<td class='itemCenter'>$Label</td>\";\n }\n }\n else {\n echo \"<td class='itemCenter'>$Label</td>\";\n }\n elseif ($FieldInfo['Type'] == \"real\")\n echo \"<td class='itemCenter'>$Label</td>\";\n elseif (strstr(strtolower($Field), \"picture\") != \"\")\n echo \"<td class='itemCenter'>$Label</td>\";\n else\n echo \"<td class='itemText'>$Label</td>\";\n }\n ++$i;\n }\n }\n// end Label\n echo \"</tr>\";\n $i = 0;\n $TotalIncome = 0;\n $pricecollected = 0;\n $TotalPayment = 0;\n $Paid = 0;\n $totalPriceINOut = 0;\n global $totalPriceInOut_balance_in;\n global $totalPriceInOut_balance_Out;\n while ($row = $this->nextData($arrayConst['rst'])) {\n $Plugin_Parameter['row'] = $row;\n $class_css = ($i % 2 == 0) ? \"cell2\" : \"cell1\";\n echo \"<tr class='$class_css'>\";\n $j = 1;\n if ($_GET[\"table_name\"] == 'dailyservices') {\n $TotalIncome += $row[\"totalprice\"];\n $pricecollected += $row[\"pricecollected\"];\n if ($_SESSION[\"user_login\"][\"role_id\"] == 4 || $_SESSION[\"user_login\"][\"role_id\"] == 11) {\n $TotalPayment += $row[\"payment_price\"];\n $Paid += $row[\"moneypaid_price\"];\n }\n }\n if ($_GET[\"table_name\"] == 'dailyservice_out' || $_GET[\"table_name\"] == 'dailyservice_in' || $arrayConst['tablename'] == 'dailyservice_in' || $arrayConst['tablename'] == 'dailyservice_out') {\n $totalPriceINOut += $row[\"total_price\"];\n }\n foreach ($arrayConst['Meta']['Field'] as $Field => $FieldInfo) {\n if (($FieldInfo['list_show']) && ((!$arrayConst['filter_parameter'][$Field]) || ($Field == 'table_name'))) {\n if ($FieldInfo['plugin_function_id']) {\n $function_name = $this->getValueOfQuery(\"SELECT function_name FROM sys_plugin_function WHERE id= \" . $FieldInfo['plugin_function_id']);\n $Plugin_Parameter['field_value'] = stripcslashes($row[$Field]);\n $Plugin_Parameter['field_info'] = stripcslashes($FieldInfo);\n $Plugin_Parameter['parameter'] = $FieldInfo['plufin_function_parameter'];\n eval('$row[$Field] = $this->' . $function_name . '($Plugin_Parameter);');\n }\n if ($FieldInfo['list_footer_subtotal'] && is_numeric($row[$Field])) {\n $arrayConst['Meta']['Field'][$Field]['subtotal'] += $row[$Field];\n }\n if ($j == 1) {\n $id = $row[$Field];\n echo \"<td class='itemCenter'>\" . $html->checkbox(\"chk\", $id, \"\", array(\"onclick\" => \"docheckone();\")) . \"</td>\";\n if ($arrayConst['Meta']['tableInfo'][\"show_order\"])\n echo \"<td class='itemCenter' style='width:20px; color:#3F5F7F'>\" . (($arrayConst['StartRow'] + $i + 1)) . \"</td>\";\n echo \"<td class='itemCenter' style='width:20px; color:#3F5F7F'>\" . $id . \"</td>\";\n }\n else {\n if ($FieldInfo['fk_from']) {\n if (count($DataSource[$Field]) > 0) {\n foreach ($DataSource[$Field] as $key => $value) {\n if ($row[$Field] == $key) {\n $row[$Field] = $value[0];\n }\n }\n }\n }\n if ($FieldInfo['format_code']) {\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format_vlink($row[$Field], $FieldInfo['format_code']) . \" </a></td>\";\n }\n else\n if ($FieldInfo['plugin_function_id']) {\n echo \"<td class='itemRight'>\" . $row[$Field] . \"</td>\";\n }\n else\n if (strstr(strtolower($Field), \"price\") != \"\") {\n if ($Field == 'price_goc') {\n if ($_SESSION[\"user_login\"][\"role_id\"] != 12) {\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . \" </a></td>\";\n }\n }\n else {\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . \" </a></td>\";\n }\n }\n elseif (strstr(strtolower($Field), \"tien\") != \"\")\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . \" </a></td>\";\n elseif (strstr(strtolower($Field), \"quantity\") != \"\")\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . \" </a></td>\";\n elseif (strstr(strtolower($Field), \"dientich\") != \"\")\n echo \"<td class='itemRight'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . \" </a></td>\";\n elseif (strstr(strtolower($Field), \"vat\") != \"\" || strstr(strtolower($Field), \"percent\") != \"\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->format($row[$Field]) . VAT . \" </a></td>\";\n elseif (strstr(strtolower($Field), \"picture\") != \"\") {\n if (strstr(strtolower($Field), \".swf\") != \"\")\n $img = $js->flashWrite(\"../\" . $row[$Field], 50, 20, \"flashid\", \"#ffffff\", \"\", \"transparent\");\n else\n $img = \"<img onerror=\\\"$(this).hide()\\\" src='image.php/image.jpg?image=\" . $row[$Field] . \"&height=15&cropratio=3:1' border='0'>\";\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $img . \"</a></td>\";\n }\n elseif (strstr(strtolower($Field), \"date\") != \"\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . date(\"d-m-Y\", (int) $row[$Field]) . \"</a></td>\";\n elseif ($FieldInfo['Type'] == \"int\" && $FieldInfo['Length'] <= 4) {\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . strtr($row[$Field], $statusActive) . \"</a></td>\";\n }\n elseif ($FieldInfo['Type'] == \"int\" || $FieldInfo['Type'] == \"real\")\n echo \"<td class='itemCenter'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $row[$Field] . \"</a></td>\";\n else\n echo \"<td class='itemText'><a id='itemText' href='$page?edit=\" . $id . \"&$urlstring'>\" . $utl->takeShortText($row[$Field], 10) . ((strstr($Field, \"percent\") != \"\") ? \"%\" : \"\") . \"</a></td>\";\n }\n ++$j;\n }\n//echo $str_if.\"<br/>\";\n }\n echo \"</tr>\";\n ++$i;\n }\n if ($_GET[\"table_name\"] == 'dailyservice_in' || $arrayConst['tablename'] == 'dailyservice_in') {\n echo \"<tr class='cell3'>\n\n\n\n\n\n\n\n\t\t\t\t <td colspan='6' style='text-align:right'><b>Total Income:</b></td>\n\n\n\n\n\n\n\n\t\t\t\t <td colspan='9' style='text-align:left'>\" . CURRENCY . $totalPriceINOut . \"</td>\n\n\n\n\n\n\n\n\t\t\t\t \";\n $totalPriceInOut_balance_in = $totalPriceINOut;\n }\n if ($_GET[\"table_name\"] == 'dailyservice_out' || $arrayConst['tablename'] == 'dailyservice_out') {\n echo \"<tr class='cell3'>\n\n\n\n\n\n\n\n\t\t\t\t <td colspan='6' style='text-align:right'><b>Total payment:</b></td>\n\n\n\n\n\n\n\n\t\t\t\t <td colspan='9' style='text-align:left'>\" . CURRENCY . $totalPriceINOut . \"</td>\n\n\n\n\n\n\n\n\t\t\t\t \";\n $totalPriceInOut_balance_Out = $totalPriceINOut;\n }\n//Footer\n if ($arrayConst['Meta']['list_footer']) {\n echo \"<tr class='titleBottom'>\";\n if ($arrayConst['Meta']['tableInfo'][\"show_order\"])\n echo \"<td></td>\";\n foreach ($arrayConst['Meta']['Field'] as $Field => $FieldInfo) {\n if (($FieldInfo['list_show']) && ((!$arrayConst['filter_parameter'][$Field]) || ($Field == 'table_name'))) {\n $subtotal = $arrayConst['Meta']['Field'][$Field]['subtotal'];\n echo \"<td class='itemRight'>\" . $utl->format_vlink($subtotal, $FieldInfo['format_code']) . \"</td>\";\n }\n ++$i;\n }\n echo \"<td></td>\";\n echo \"</tr>\";\n//End Footer\n }\n echo \"</table>\";\n echo \"</div>\";\n }", "function flowthemes_seo_meta_boxes(){\n\t\twp_nonce_field(basename(__FILE__), 'flow_seo_noncename');\n\t\t\n\t\t$opt_name = 'flow_seo_title';\n\t\t$opt_name2 = 'flow_seo_description';\n\t\t$opt_name3 = 'flow_post_header_code';\t\n\t\t\n\t\t$post_ID = get_the_ID();\n\t\t$opt_val = get_post_meta($post_ID, $opt_name, true);\n\t\t$opt_val2 = get_post_meta($post_ID, $opt_name2, true);\n\t\t$opt_val3 = get_post_meta($post_ID, $opt_name3, true);\n\n\t?>\n\t\t<table class=\"form-table flow_seo_meta_box\">\n\t\t\t<tr>\n\t\t\t\t<th style=\"width:20%;\">\n\t\t\t\t\t<label for=\"\"><?php _e('Snippet Preview', 'flowthemes'); ?></label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<div id=\"flow_seo_snippet\">\n\t\t\t\t\t\t<a class=\"default_title\" href=\"javascript:void(null);\"><?php the_title(); ?> - <?php bloginfo('name'); ?></a>\n\t\t\t\t\t\t<a class=\"title\" href=\"javascript:void(null);\"><?php the_title(); ?></a>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<cite href=\"javascript:void(null);\" class=\"url\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$domain = parse_url(get_permalink());\n\t\t\t\t\t\t\t\tif(!empty($domain[\"host\"])){ echo $domain[\"host\"]; }\n\t\t\t\t\t\t\t\tif(!empty($domain[\"path\"])){ echo $domain[\"path\"]; }\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</cite>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"desc\">\n\t\t\t\t\t\t\t<span class=\"content\"><?php echo get_the_excerpt(); ?></span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t<tr>\n\t\t\t\t<th style=\"width:20%;\">\n\t\t\t\t\t<label for=\"<?php echo $opt_name; ?>\">SEO Title</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"<?php echo $opt_name; ?>\" id=\"<?php echo $opt_name; ?>\" value=\"<?php echo $opt_val; ?>\" size=\"30\" tabindex=\"30\" style=\"width: 97%;\" />\n\t\t\t\t\t<p>\n\t\t\t\t\t\tIf you leave this empty it's going to display standard title. Limited to max. 70 characters in most of the search engines. Number of characters: <span id=\"flow_seo_title-count\"></span>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<th style=\"width:20%;\">\n\t\t\t\t\t<label for=\"<?php echo $opt_name2; ?>\">SEO Description</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"<?php echo $opt_name2; ?>\" id=\"<?php echo $opt_name2; ?>\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\"><?php echo $opt_val2; ?></textarea>\n\t\t\t\t\t<p>Limited to 156 characters in most of the search engines. Number of characters: <span id=\"flow_seo_description-count\"></span></p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<th style=\"width:20%;\">\n\t\t\t\t\t<label for=\"flow_seo_focuskw\">Test Keyword(s)</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"flow_seo_focuskw\" id=\"flow_seo_focuskw\" value=\"\" size=\"30\" tabindex=\"30\" style=\"width: 97%;\" />\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThis field is used only as testing tool. Put here keywords that you expect that user will look for to check how well this post is using them. Please test one keyword at a time. Phrases should be tested as separate keywords (because that's the way search engine works).\n\t\t\t\t\t\t<span id=\"focuskwresults\"></span>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<th style=\"width:20%;\">\n\t\t\t\t\t<label for=\"<?php echo $opt_name3; ?>\">Custom Code</label>\n\t\t\t\t</th>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea name=\"<?php echo $opt_name3; ?>\" id=\"<?php echo $opt_name3; ?>\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\"><?php echo $opt_val3; ?></textarea>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tA code that will be placed in <code>&lt;head&gt;</code> section of your website in place of <code>wp_head();</code> function (located in header.php). What you may want to put here is probably Facebook title, description and image that it should use:\n<pre><code>&lt;meta property=\"og:title\" content=\"The Daisho Project\" /&gt;\n&lt;meta property=\"og:type\" content=\"video.movie\" /&gt;\n&lt;meta property=\"og:url\" content=\"http://example.com/link-to-portfolio-project-with-movie/\" /&gt;\n&lt;meta property=\"og:image\" content=\"http://example.com/images/facebook-should-grab-this-image-as-thumbnail.jpg\" /&gt;</code></pre>\n\t\t\t\t\t\tMore: <a href=\"http://ogp.me/\" target=\"_blank\">The Open Graph protocol</a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t...or you can put here completely different code including <code>&lt;style&gt;</code> and <code>&lt;script&gt;</code> tags! There are lots of possibilities: <a href=\"http://en.wikipedia.org/wiki/Meta_element\" target=\"_blank\">Meta Element</a>.\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t<?php }", "public static function showBaseFields1($row){\n\t\tglobal $bootstrapHelper;\n $configClass = self::loadConfig();\n if((($configClass['use_rooms'] == 1) && ($row->rooms > 0)) || (($configClass['use_bedrooms'] == 1) && ($row->bed_room > 0)) && (($configClass['use_bathrooms'] == 1) && ($row->bath_room > 0)) || ((float)$row->square_feet > 0))\n {\n ob_start();\n ?>\n <div class=\"clearfix\"></div>\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('row-fluid'); ?>\">\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('span12'); ?>\">\n <h4>\n <?php echo JText::_('OS_BASE_INFORMATION');?>\n </h4>\n </div>\n </div>\n <?php\n if(($configClass['use_rooms'] == 1) and ($row->rooms > 0))\n {\n ?>\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('row-fluid'); ?>\">\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('span12'); ?> \">\n\t\t\t\t\t\t<div class=\"fieldlabel\">\n\t\t\t\t\t\t\t<?php echo JText::_('OS_ROOMS')?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"fieldvalue\">\n\t\t\t\t\t\t\t<?php echo $row->rooms;?>\n\t\t\t\t\t\t</div>\n </div>\n </div>\n <?php\n }\n if(($configClass['use_bedrooms'] == 1) and ($row->bed_room > 0))\n {\n ?>\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('row-fluid'); ?>\">\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('span12'); ?>\">\n\t\t\t\t\t\t<div class=\"fieldlabel\">\n\t\t\t\t\t\t\t<?php echo JText::_('OS_BED')?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"fieldvalue\">\n\t\t\t\t\t\t\t<?php echo $row->bed_room;?>\n\t\t\t\t\t\t</div>\n </div>\n </div>\n <?php\n }\n if(($configClass['use_bathrooms'] == 1) and ($row->bath_room > 0))\n {\n ?>\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('row-fluid'); ?>\">\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('span12'); ?>\">\n\t\t\t\t\t\t<div class=\"fieldlabel\">\n\t\t\t\t\t\t\t<?php echo JText::_('OS_BATH')?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"fieldvalue\">\n\t\t\t\t\t\t\t<?php echo self::showBath($row->bath_room);?>\n\t\t\t\t\t\t</div>\n </div>\n </div>\n <?php\n }\n if((float)$row->square_feet > 0)\n {\n ?>\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('row-fluid'); ?>\">\n <div class=\"<?php echo $bootstrapHelper->getClassMapping('span12'); ?>\">\n\t\t\t\t\t\t<div class=\"fieldlabel\">\n\t\t\t\t\t\t\t<?php echo OSPHelper::showSquareLabels()?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"fieldvalue\">\n\t\t\t\t\t\t\t<?php echo $row->square_feet;?> <?php echo self::showSquareSymbol();?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n </div>\n <?php\n }\n ?>\n <?php\n $body = ob_get_contents();\n ob_end_clean();\n }\n return $body;\n\t}", "public function uultra_load_wdiget_addition_form()\r\n\t{\r\n\t\t$html = '';\r\n\t\t$html .= '<div class=\"uultra-adm-widget-cont-add-new\" >';\r\n \r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_add_mod_widget_title\" type=\"text\" id=\"uultra_add_mod_widget_title\" style=\"width:120px\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_widget_type\" id=\"uultra_add_mod_widget_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Editable by user:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_widget_editable\" id=\"uultra_add_mod_widget_editable\" size=\"1\">\r\n\t\t\t\t \r\n\t\t\t\t <option value=\"0\" selected=\"selected\">'.__(\"NO \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"YES\",'xoousers').'</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t\r\n\t\t\t\t<td colspan=\"2\"><textarea name=\"uultra_add_mod_widget_content\" id=\"uultra_add_mod_widget_content\" style=\"width:98%;\" rows=\"5\"></textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr> \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\t \r\n\t\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-widgets-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-widgets-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-widget-m-w\" ></span>\r\n\t\t\t\t</p> ';\r\n\t\t\t\t\r\n\t\t\t$html .= '</div>';\r\n\t\t\t\t\r\n\t\t\techo $html;\r\n\t\t\tdie();\r\n\t\r\n\t}", "function\n\tMvDetailedQueryForm()\n\t{\n\t\t//$catNumber = new QueryField;\n\t\t//$catNumber->ColName = 'CatNumber';\n\t\t//$catNumber->ColType = 'integer';\n\n\t\t$this->Fields = \n\t\t\tarray(\t\n\t\t\t'ColCategory',\n\t\t\t'ColScientificGroup',\n\t\t\t'ColDiscipline',\n\t\t\t'ColRegPrefix',\n\t\t\t'ColRegNumber',\n\t\t\t'ColRegPart',\n\t\t\t//'ColRecordCategory',\n\t\t\t'ColCollectionName_tab',\n\n\n\t\t\t//$catNumber,\n\t\t\t//'TitMainTitle',\n\t\t\t//'CreCreatorLocal_tab',\n\t\t\t//'LocCurrentLocationRef->elocations->SummaryData',\n\t\t\t//'PhyMedium',\n\t\t\t);\n\n\t\t$this->Hints = \n\t\t\tarray(\t\n\t\t\t'ColCategory'\t\t=> '[ eg. Natural Sciences ]',\n\t\t\t'ColScientificGroup'\t=> '[ eg. Zoology ]',\n\t\t\t'ColDiscipline'\t\t=> '[ eg. Anthropology ]',\n\t\t\t'ColRegPrefix' \t\t=> '[ eg. x ]',\n\t\t\t'ColRegNumber' \t\t=> '[ eg. A number ]',\n\t\t\t'ColRegPart' \t\t=> '[ eg. A number ]',\n\t\t\t//'ColRecordCategory'\t=> '[ eg. Registered ]',\n\t\t\t'ColCollectionName_tab'\t=> '[ Select from the list ]',\n\t\t\t);\n\n\t\t$this->DropDownLists = \n\t\t\tarray(\t\n\t\t\t//'PhyMedium' => '|Painting|Satin|Cardboard|Silk|Paper|Ink',\n\t\t\t//'CreCountry_tab' => 'eluts:Location',\n\t\t\t'ColCollectionName_tab'\t=> 'eluts:Collection Name',\n\t\t\t);\n\n\t\t$this->LookupLists = \n\t\t\tarray (\n\t\t\t//'TitCollectionTitle' => 'Collection Title',\n\t\t\t);\n\n\t\t$this->BaseDetailedQueryForm();\n\t}", "public function CltvoDisplayMetabox( $object ){ ?>\n <?php for ($i=0; $i < 2; $i++): ?>\n <div style=\"display: inline-block; width:48%; margin-right: 2%\">\n <p><label>Texto:</label></p>\n <textarea class=\"\" style=\"width:100%;\" name='<?php echo \"$this->meta_key[$i][texto]\";?>'><?php echo $this->meta_value[$i]['texto'];?></textarea>\n </div><div style=\"display: inline-block; width:48%; margin-right: 2%\">\n <p><label>Código de botón de PayPal:</label></p>\n <textarea class=\"\" style=\"width:100%;\" name='<?php echo \"$this->meta_key[$i][boton]\";?>'><?php echo $this->meta_value[$i]['boton'];?></textarea>\n </div>\n <?php endfor; ?>\n\n <?php\n\t}", "function style_meta_boxes() {\n ?>\n <style>\n .theme-metafield {\n width: 100%;\n padding: 5px;\n box-sizing: border-box;\n }\n .theme-metafield label {\n display: block;\n }\n .theme-metafield textarea, .theme-metafield input {\n width: 100%;\n }\n </style>\n <?\n }", "public function generate_fields( $post ) {\n\t\t$datos = get_post_meta($post->ID, $this->idMetaBox, true);\n\t\twp_nonce_field( 'repeatable_meta_box_nonce-'.$this->idMetaBox, 'repeatable_meta_box_nonce-'.$this->idMetaBox );\n\t\t?>\n\t\t<table id=\"repeatable-fieldset-one_<?=$this->idMetaBox?>\" width=\"100%\">\n\t\t<?php\n\t\t$i = 0;\n\t\t//rellenamos con los datos que tenemos guardados\n\t\tif(!empty($datos)){\n\t\t\tforeach($datos as $dato){\t\n\t\t\t\t$output = '<tr>';\n\t\t\t\t$output .= '<td>\n\t\t\t\t\t\t<span class=\"sort hndle\" style=\"float:left;\">\n\t\t\t\t\t\t\t<img src=\"'.get_template_directory_uri().'/img/move.png\" />&nbsp;&nbsp;&nbsp;</span>\n\t\t\t\t\t\t\t<a class=\"button remove-row_'.$this->idMetaBox.'\" href=\"#\">-</a>\n\t\t\t\t\t</td>';\n\t\t\t\tforeach($this->fields as $field){\t\t\t\t\n\t\t\t\t\tswitch ( $field['type'] ) {\n\t\t\t\t\t\tcase 'media':\n\t\t\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t\t<input class=\"regular-text\" id=\"%s'.$i.'\" name=\"%s[]\" type=\"text\" value=\"%s\">\n\t\t\t\t\t\t\t\t\t<input class=\"button rational-metabox-media\" id=\"%s'.$i.'_button\" name=\"%s_button\" type=\"button\" value=\"Upload\" />\n\t\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t\t$dato[$field['id']],\n\t\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t\t$field['id']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t\t<input %s id=\"%s'.$i.'\" name=\"%s[]\" type=\"%s\" value=\"%s\">\n\t\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t\t$field['type'] !== 'color' ? 'class=\"regular-text\"' : '',\n\t\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\t\t\t$dato[$field['id']]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\t$i++;\t\t\n\t\t\t\t$output .= '</tr>';\t\t\t\n\t\t\t\techo $output;\n\t\t\t}\n\t\t\t\n\t\t//si no tenemos datos mostramos los campos vacios\n\t\t}else{\n\t\t\t\n\t\t\t$input = '<tr>';\n\t\t\t$input = '<td>\n\t\t\t\t\t\t<span class=\"sort hndle\" style=\"float:left;\">\n\t\t\t\t\t\t\t<img src=\"'.get_template_directory_uri().'/img/move.png\" />&nbsp;&nbsp;&nbsp;</span>\n\t\t\t\t\t\t\t<a class=\"button remove-row_'.$this->idMetaBox.'\" href=\"#\">-</a>\n\t\t\t\t\t</td>';\n\t\t\tforeach($this->fields as $field){\t\t\t\t\n\t\t\t\tswitch ( $field['type'] ) {\n\t\t\t\t\tcase 'media':\n\t\t\t\t\t\t$input .= sprintf(\n\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t<input class=\"regular-text\" id=\"%s'.$i.'\" name=\"%s[]\" type=\"text\" value=\"\">\n\t\t\t\t\t\t\t\t<input class=\"button rational-metabox-media\" id=\"%s'.$i.'_button\" name=\"%s_button\" type=\"button\" value=\"Upload\" />\n\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id']\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$input .= sprintf(\n\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t<input %s id=\"%s'.$i.'\" name=\"%s[]\" type=\"%s\" value=\"\">\n\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t$field['type'] !== 'color' ? 'class=\"regular-text\"' : '',\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['type']\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t$input .= '</tr>';\t\t\t\n\t\t\techo $input;\t\n\t\t\t$i++;\t\n\t\t}\n\t\t?>\n\t\t<tr class=\"empty-row screen-reader-text <?=$this->idMetaBox?>\" data-id=\"<?=$i?>\">\n\t\t<?php\n\t\t\t$input = '<td>\n\t\t\t\t\t\t<span class=\"sort hndle\" style=\"float:left;\">\n\t\t\t\t\t\t\t<img src=\"'.get_template_directory_uri().'/img/move.png\" />&nbsp;&nbsp;&nbsp;</span>\n\t\t\t\t\t\t\t<a class=\"button remove-row_'.$this->idMetaBox.'\" href=\"#\">-</a>\n\t\t\t\t\t</td>';\n\t\t\tforeach($this->fields as $field){\n\t\t\t\tswitch ( $field['type'] ) {\n\t\t\t\t\tcase 'media':\n\t\t\t\t\t\t$input .= sprintf(\n\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t<input class=\"regular-text\" id=\"%s\" name=\"%s[]\" type=\"text\" value=\"\">\n\t\t\t\t\t\t\t\t<input class=\"button rational-metabox-media\" id=\"%s_button\" name=\"%s_button\" type=\"button\" value=\"Upload\" />\n\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id']\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$input .= sprintf(\n\t\t\t\t\t\t\t'<td>\n\t\t\t\t\t\t\t\t<input %s id=\"%s\" name=\"%s[]\" type=\"%s\" value=\"\">\n\t\t\t\t\t\t\t</td>',\n\t\t\t\t\t\t\t$field['type'] !== 'color' ? 'class=\"regular-text\"' : '',\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['type']\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\techo $input;\n\t\t?>\n\t\t</tr>\n\t\t</table>\n\t\t<p><a id=\"add-row_<?=$this->idMetaBox?>\" class=\"button\" href=\"#\">+</a></p>\n\t\t<?php\n\t}", "public function getSummaryData();", "public static function sdPutDesignDetails($sd){\n\t\t?>\n\t\t<ul style=\" padding-left:10px;\">\n\t\t\t<?php\n\t\t\t\t//Fit edit 01-11-11\n\t\t\t\t/*if($sd->sFit==\"3\"){\n\t\t\t\t\tself::sdPut(\"Fit: Mens Loose Fit\");\n\t\t\t\t}else if($sd->sFit==\"2\"){\n\t\t\t\t\tself::sdPut(\"Fit: Mens Slim fit\");\n\t\t\t\t}else if($sd->sFit==\"1\"){\n\t\t\t\t\tself::sdPut(\"Fit: Mens Normal fit\");\n\t\t\t\t}else if($sd->sFit==\"6\"){\n\t\t\t\t\tself::sdPut(\"Fit: Ladies Loose fit\");\n\t\t\t\t}else if($sd->sFit==\"4\"){\n\t\t\t\t\tself::sdPut(\"Fit: Ladies Normal fit\");\n\t\t\t\t}else if($sd->sFit==\"5\"){\n\t\t\t\t\tself::sdPut(\"Fit: Ladies Slim fit\");\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t//Color\n\t\t\t\tif(!empty($sd->sColor)){\n\t\t\t\t\t$sqlColor=mysql_query(\"SELECT * FROM ts_color WHERE c_id=\".$sd->sColor);\n\t\t\t\t\t$rowColor=mysql_fetch_array($sqlColor);\n\t\t\t\t\tself::sdPut(\"Color: \".$rowColor['c_name'].\" (\".$rowColor['c_code'].\")\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//White collar\n\t\t\t\t//$whiteCollar = \" collar\";\n\t\t\t\t$whiteCollar = \"\";\n\t\t\t\tif($sd->sCollarWhite==\"1\"){\n\t\t\t\t\t//$whiteCollar .= \" (White fabric)\";\n\t\t\t\t\t$whiteCollar = \" (White collar)\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Collar\n\t\t\t\tswitch ($sd->sCollar){\n\t\t\t\t\tcase 10:\n\t\t\t\t\t\tself::sdPut(\"Collar: Soft Collar\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 9:\n\t\t\t\t\t\tself::sdPut(\"Collar: Hawaiian\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 8:\n\t\t\t\t\t\tself::sdPut(\"Collar: Rounded\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tself::sdPut(\"Collar: Mandarin\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tself::sdPut(\"Collar: Button down\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t/*case 5:\n\t\t\t\t\t\tself::sdPut(\"Collar: Long\".$whiteCollar);\n\t\t\t\t\t\tbreak;*/\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tself::sdPut(\"Collar: Italian (Cut away)\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t/*case 3:\n\t\t\t\t\t\tself::sdPut(\"Collar: Full spread\".$whiteCollar);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tself::sdPut(\"Collar: Business\".$whiteCollar);\n\t\t\t\t\t\tbreak;*/\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Collar: Classic\".$whiteCollar);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Sleeves\n\t\t\t\t$sleeves = \" sleeves\";\n\t\t\t\tswitch ($sd->sSleeve){\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tself::sdPut(\"Sleeve: Roll up\".$sleeves);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tself::sdPut(\"Sleeve: Short with cuff\".$sleeves);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tself::sdPut(\"Sleeve: Short\".$sleeves);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Sleeve: Long\".$sleeves);\n\t\t\t\t}\n\n\t\t\t\t//Cuffs\n\t\t\t\tif($sd->sSleeve<2){ // Long sleeves selected, find out cuff type\n\t\t\t\t\t$placketButton = \" \";\n\t\t\t\t\tif($sd->sPlacketButton==1){\n\t\t\t\t\t\t$placketButton = \" with placket buttons\";\n\t\t\t\t\t}\n\t\t\t\t\t$whiteCuff = \"\";\n\t\t\t\t\tif($sd->sCuffWhite==1){\n\t\t\t\t\t\t$whiteCuff = \" (White cuff)\";\n\t\t\t\t\t}\n\t\t\t\t\tswitch ($sd->sCuff){\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Single Rounded\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Angled\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: French Rounded\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: French\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Single Cufflink\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Triple button\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Two button\".$placketButton.$whiteCuff);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tself::sdPut(\"Cuff Style: Single button\".$placketButton.$whiteCuff);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Fastening\n\t\t\t\tswitch ($sd->sFastening){\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tself::sdPut(\"Fastening: Fly\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tself::sdPut(\"Fastening: Plackett\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Fastening: French\");\n\t\t\t\t}\n\n\t\t\t\t//Pockets\n\t\t\t\tif($sd->sPocket>0){\n\t\t\t\t\t$flaps = \" without flap\";\n\t\t\t\t\tif($sd->sPocketFlaps==1){\n\t\t\t\t\t\t$flaps = \" with flap\";\n\t\t\t\t\t}\n\t\t\t\t\tswitch($sd->sPocket){\n\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: 2 box pleat pockets\".$flaps.\"s\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: Box pleat pocket\".$flaps.\"\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: 2 inverted pleat pockets\".$flaps.\"s\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: Inverted pleat pocket\".$flaps.\"\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: 2 v-shaped pockets\".$flaps.\"s\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: 2 classic pockets\".$flaps.\"s\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: V-shaped pocket\".$flaps);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: Classic pocket\".$flaps);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tself::sdPut(\"Pockets: No pockets\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Epaulettes\n\t\t\t\tif($sd->sEpaulettes==1){\n\t\t\t\t\tself::sdPut(\"Epaulettes\");\n\t\t\t\t}\n\n\t\t\t\t//Embroidery text\n\t\t\t\tif($sd->sEmbroideryText!=\"\"){\n\t\t\t\t\t$embroidery = $sd->sEmbroideryText.\" embroidered in \";\n\t\t\t\t\tswitch($sd->sEmbroideryColor){\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"black\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"pink\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"white\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"yellow\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"red\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"green\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"blue\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tself::sdPut(\"Embroidery: \".$embroidery.\"Same as shirt\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Back pleats\n\t\t\t\tswitch($sd->sBackPleats){\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tself::sdPut(\"Back: No pleats\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tself::sdPut(\"Back: Side pleats\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Back: Center\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*case 2:\n\t\t\t\t\t\tself::sdPut(\"Side Pleats: Side pleats on back\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tself::sdPut(\"Side Pleats: Center pleats on back\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Side Pleats: No pleats on back\");*/\t\n\t\t\t\t}\n\n\t\t\t\t//Bottom cut\n\t\t\t\tswitch($sd->sBottomCut){\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tself::sdPut(\"Hem: Straight\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t/*case 2:\n\t\t\t\t\t\tself::sdPut(\"Hem cut: Straight\");\n\t\t\t\t\t\tbreak;*/\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Hem: Fishtail\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*case 1:\n\t\t\t\t\t\tself::sdPut(\"Hem cut: Fishtail hem bottom cut\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tself::sdPut(\"Hem cut: Plain hem with side vent\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tself::sdPut(\"Hem cut: Fishtail hem with side vent\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tself::sdPut(\"Hem cut: Plain hem bottom cut\");\t*/\n\t\t\t\t}\n\t\t\t?>\n\t\t\t</ul>\n\t\t<?php\t\t\n\t}", "protected function constructGrid()\n {\n // jquery script for loading first page of grid\n $table = \"\n <script type=\\\"text/javascript\\\">\n // load first page\n WschangeModelPagination(\n '$this->_id',\n '$this->_action',\n '$this->_modelName',\n '$this->noDataText',\n $this->itemsPerPage,\n $this->showEdit,\n '$this->_order',\n '$this->_formId',\n 0,\n '$this->_id'+'_0',\n '$this->_edit_action',\n '$this->_delete_action'\n );\n </script>\n \";\n\n // container for edit dialog\n if ($this->showEdit) {\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'\"></div>';\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'_new\"></div>';\n }\n\n // title\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-1\">';\n $table .= '<h1>'.$this->_model->metaName.'</h1>';\n $table .= '</div>';\n $table .= '</div>';\n\n // add and search controls\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-2\">';\n $table .= '<form class=\"uk-form uk-form-horizontal\">';\n $table .= '<fieldset data-uk-margin>';\n // new item button\n if ($this->showEdit) {\n $table .= '<button class=\"uk-button uk-button-success\"'\n .' data-uk-modal=\"{target:\\'#'.$this->_formId\n .'_new\\', center:true}\"'\n .' id=\"btn_create_'.$this->_id.'\"'\n .' type=\"button\" onclick=\"WseditModelID('\n .'\\''.$this->_formId.'_new\\', '\n .'\\''.$this->_modelName.'\\', '\n .'0, \\''.$this->_edit_action.'\\')\">';\n $table .= '<i class=\"uk-icon-plus\"></i>';\n $table .= '</button>';\n }\n // search control\n $table .= '<input';\n $table .= ' type=\"text\" id=\"search_'.$this->_id.'\"';\n $table .= '/>';\n $table .= '<button class=\"uk-button\"'\n .' id=\"btn_search_'.$this->_id\n .'\" type=\"button\" onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .'0, \\''.$this->_id.'\\'+\\'_0\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\">';\n $table .= '<i class=\"uk-icon-search\"></i>';\n $table .= '</button>';\n\n $table .= '</fieldset>';\n $table .= '</form>';\n $table .= '</div>';\n $table .= '</div>';\n\n // Grid View table\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-1-1\">';\n $table .= '<div class=\"uk-overflow-container\">';\n $table .= '<table class=\"uk-table uk-table-hover uk-table-striped\">';\n $table .= '<thead>';\n $table .= '<tr>';\n foreach ($this->_model->columns as $column) {\n if (!in_array($column, $this->_model->hiddenColumns)) {\n if (isset($this->_model->columnHeaders[$column])) {\n $table .= '<th>'\n .$this->_model->columnHeaders[$column];\n $table .= '</th>';\n } else {\n $table .= '<th>'.$column.'</th>';\n }\n }\n }\n if ($this->showEdit) {\n $table .= '<th></th>';\n }\n $table .= '</tr>';\n $table .= '</thead>';\n\n // container of table data loaded from AJAX request\n $table .= '<tbody id=\"'.$this->_id.'\"></tbody>';\n\n // end of grid table\n $table .= '</table>';\n $table .= '</div>';\n $table .= '</div>';\n $table .= '</div>';\n\n // get number ow rows from query so that we can make pager\n $db = new WsDatabase();\n $countQuery = 'SELECT COUNT(*) AS nrows FROM '.$this->_model->tableName;\n $result = $db->query($countQuery);\n $this->nRows = intval($result[0]['nrows']);\n $db->close();\n\n // number of items in pager\n $nPages = $this->getPagination($this->nRows);\n\n // construct pager\n $table .= '<ul class=\"uk-pagination uk-pagination-left\">';\n // links to pages\n for ($i = 0; $i < $nPages; $i++) {\n $table .= '<li>';\n $table .= '\n <a id=\"'.$this->_id.'_'.$i.'\"\n href=\"javascript:void(0)\"\n onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .$i.',\\''.$this->_id.'_'.$i.'\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\"/>'\n .($i+1).'</a>';\n $table .= '</li>';\n }\n // end of pager\n $table .= '</ul>';\n\n // end of master div element\n $table .= '<br/>';\n\n $table .= '<script type=\"text/javascript\">'\n .'$(\"#search_'.$this->_id.'\").keydown(function(event) {'\n .' if(event.keyCode == 13) {'\n .' event.preventDefault();'\n .' $(\"#btn_search_'.$this->_id.'\").click();'\n .' }'\n .'});'\n .'</script>';\n\n unset($i, $nPages, $db, $result, $countQuery);\n return $table;\n }", "function renderFunctionSummary() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->functions[$access])) \n continue;\n\n $this->tpl->setCurrentBlock(\"functionsummary_loop\");\n reset($this->functions[$access]);\n while (list($name, $function) = each($this->functions[$access])) {\n\n $this->tpl->setVariable(\"NAME\", $name);\n \n if (isset($function[\"doc\"][\"parameter\"]))\n $this->tpl->setVariable(\"PARAMETER\", $this->getParameter($function[\"doc\"][\"parameter\"]));\n\n if (isset($function[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($function[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (isset($function[\"doc\"][\"return\"]))\n $this->tpl->setVariable(\"RETURNTYPE\", $function[\"doc\"][\"return\"][\"type\"]);\n else\n $this->tpl->setVariable(\"RETURNTYPE\", \"void\");\n\n if (\"true\" == $function[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"functionsummary\"); \n $this->tpl->setVariable(\"ACCESS\", ucfirst($access) );\n $this->tpl->parseCurrentBlock();\n }\n\n }", "private function register_organization_fields() {\n\n $details_children = [\n 'url' => new \\Fieldmanager_Link( esc_html__( 'URL', 'pedestal' ), [\n 'name' => 'url',\n 'required' => false,\n ] ),\n 'full_name' => new \\Fieldmanager_Textfield( esc_html__( 'Full Name', 'pedestal' ), [\n 'name' => 'full_name',\n 'description' => esc_html__( 'The full name of the organization, if it\\'s not the common name / title.', 'pedestal' ),\n ] ),\n 'num_employees' => new \\Fieldmanager_Textfield( esc_html__( 'Number of Employees', 'pedestal' ), [\n 'name' => 'num_employees',\n ] ),\n 'founding_date' => new \\Fieldmanager_Textfield( esc_html__( 'Founding Date', 'pedestal' ), [\n 'name' => 'founding_date',\n ] ),\n ];\n $details = new \\Fieldmanager_Group( false, [\n 'name' => 'org_details',\n 'children' => $details_children,\n 'serialize_data' => false,\n ] );\n $details->add_meta_box( esc_html__( 'Details', 'pedestal' ), [ 'pedestal_org' ], 'normal', 'high' );\n\n }" ]
[ "0.59962493", "0.59763706", "0.58714974", "0.5822382", "0.5802656", "0.57680917", "0.573524", "0.5723683", "0.56696504", "0.56693673", "0.5666097", "0.5644782", "0.5620018", "0.5618954", "0.55702794", "0.5554211", "0.5536003", "0.55055", "0.5488495", "0.5485995", "0.548042", "0.5475191", "0.5463356", "0.5456213", "0.5439482", "0.54367685", "0.54152924", "0.5409545", "0.5408882", "0.5404515", "0.54005134", "0.53991497", "0.53987795", "0.53949845", "0.5384836", "0.5384191", "0.53830975", "0.53799915", "0.5373294", "0.5363635", "0.5359827", "0.5339161", "0.5325763", "0.5319568", "0.5316128", "0.5311711", "0.5298867", "0.5298529", "0.5297937", "0.5284903", "0.5260838", "0.5255928", "0.5255593", "0.5254421", "0.5253491", "0.5251024", "0.5249846", "0.5246597", "0.52456665", "0.52315825", "0.5229499", "0.52228403", "0.52184963", "0.52149373", "0.521109", "0.520145", "0.5190581", "0.51850575", "0.5184571", "0.5181195", "0.5177694", "0.51752996", "0.5162558", "0.51604295", "0.5153617", "0.5151168", "0.51387227", "0.51337284", "0.51241785", "0.51197994", "0.5117056", "0.5114558", "0.5114489", "0.51119906", "0.5111478", "0.5109192", "0.51013184", "0.508924", "0.5083729", "0.5080365", "0.50786453", "0.50695705", "0.5068673", "0.5068616", "0.5067605", "0.5064599", "0.506394", "0.50637215", "0.50628704", "0.50582325" ]
0.6125534
0