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
return the flash messenger value
public static function getMessage() { return unserialize($_COOKIE[self::$_name]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFlashMessage() {\n if($message = Session::get('Site.Message')){\n Session::clear('Site.Message');\n $array = new ArrayData($message);\n return $array->renderWith('FlashMessage');\n }\n }", "public function popFlashDanger() {\n\t\treturn $this->getVariable(\"flashMessageDanger\");\n\t}", "public static function getFlash() {\n\t\tif(Yii::app()->user->hasFlash('yiiBasket')) {\n\t\t\treturn Yii::app()->user->getFlash('yiiBasket');\n\t\t}\n\t}", "public static function getMessage(){\n $flashMessages = array();\n if(isset($_SESSION['flashMessages'])){\n $flashMessages = $_SESSION['flashMessages'];\n unset($_SESSION['flashMessages']);\n }\n return $flashMessages;\n }", "function getFlash() {\n return isset($_SESSION['flash.message']) ? $_SESSION['flash.message'] : false;\n}", "public static function get_message()\n\t{\n\t\treturn Session::instance()->get('alert');\n\t}", "function flash_message()\n\t{\n\t\t$ci =& get_instance();\n\t\t$flashmsg = $ci->session->flashdata('falshmsg');\n\t\t$html = '';\n\t\tif (is_array($flashmsg)){\n\t\t\t$html = '<div id=\"flashmessage\" class=\"'.$flashmsg['type'].'\">\n\t\t\t\t\t<img style=\"float: right; cursor: pointer\" id=\"closemessage\" src=\"'.base_url().'img/close.png\" />\n\t\t\t\t\t\t\t<p>'.$flashmsg['content'].'</p>\n\t\t\t\t\t\t\t\t\t</div>';\n\t\t}\n\t\treturn $html;\n\t}", "function get_flash($type)\n{\n $ci = &get_instance();\n $message = $ci->session->flashdata($type);\n\n if ($message) {\n return htmlentities($message);\n }\n\n return '';\n}", "public function flashData() {\n if (isset($this->environment['lee.flash'])) {\n return $this->environment['lee.flash']->getMessages();\n }\n }", "function getFlash(string $key)\n {\n return $_SESSION[self::FLASH_KEY][$key]['value'] ?? false;\n }", "static function flashMessage ()\n {\n if (Session::has ('message')) {\n list ($flashType, $message, $title) = explode ('|', Session::get ('message')) + [''] + [''];\n $title = $title ? \"<h4>$title</h4>\" : '';\n return <<<HTML\n<div class=\"alert alert-$flashType\">\n $title$message\n</div>\n</script>\nHTML;\n }\n }", "public function popFlashSuccess() {\n\t\treturn $this->getVariable(\"flashMessageSuccess\");\n }", "public static function get() {\n\n if (self::hasErrors()) {\n\n return $_SESSION['message']['error'];\n }\n\n return $_SESSION['message']['success'];\n }", "private function getFlashMessageFromSession() {\n $error = \\Tools\\Session::get('error');\n \\Tools\\Session::clear('error');\n $warning = \\Tools\\Session::get('warning');\n \\Tools\\Session::clear('warning');\n $success = \\Tools\\Session::get('success');\n \\Tools\\Session::clear('success');\n\n if(isset($error))\n \\Tools\\FlashMessage::addErrorSet($error);\n if(isset($warning))\n \\Tools\\FlashMessage::addWarningSet($warning);\n if(isset($success))\n \\Tools\\FlashMessage::addSuccessSet($success);\n }", "function flashMessage() {\n\t$message = Template::getFlashMessage();\n\tif ( ! empty($message) ) {\n\t\t$messageHtml .= \"<div class='collection'>\";\n\t\t$messageHtml .= \"<a href='#' class='collection-item \" . $message[\"type\"] . \"'>\" . $message[\"body\"] . \"</a>\";\n\t\t$messageHtml .= \"</div>\";\n\n\t\techo $messageHtml;\n\t}\n\treturn NULL;\n}", "protected function getErrorFlashMessage() {}", "public function getFlashMessage($request)\n {\n $session = $request->session();\n\n $flash_message['type'] = $session->get(\"{$this->flash_name}.type\");\n $flash_message['message'] = $session->get(\"{$this->flash_name}.message\");\n return $flash_message;\n }", "function getFlash($type) {\n if(isset($_SESSION['flash'])) {\n return $_SESSION['flash'][$type];\n }\n \n return null;\n}", "function flash($k='') {\n $flash = Session::has('__flash') && !empty(Session::get('__flash')) ? Session::get('__flash') : false;\n if($flash && $k !== ''){\n return $flash[$k];\n } else {\n return $flash;\n }\n}", "private function getSavedMessage() : string {\n\n\t\tif ($this->messageWasSetAndShouldNotBeRemovedDuringThisRequest) {\n\t\t\treturn $_SESSION[self::$messageSessionIndex];\n\t\t}\n\n\t\tif (isset($_SESSION[self::$messageSessionIndex])) {\n\t\t\t$message = $_SESSION[self::$messageSessionIndex];\n\t\t\tunset($_SESSION[self::$messageSessionIndex]);\n\t\t\treturn $message;\n\t\t}\n\t\treturn \"\";\n\t}", "public static function getFlash() {\n if(self::hasFlash()) {\n $flash = $_SESSION['Flash'][0];\n self::clearBuffer();\n return $flash;\n }\n return null;\n }", "function getMessage()\r\n{\r\n $message = $_SESSION['message'];\r\n return $message;\r\n}", "public static function getFlash() {\r\n if (Yii::app()->user->hasFlash('success')) {\r\n return '<div class=\"alert alert-success alert-dismissable\"><button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button>'. Yii::app()->user->getFlash('success') .'</div>';\r\n } elseif (Yii::app()->user->hasFlash('error')) {\r\n return '<div class=\"alert alert-danger alert-dismissable\"><button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button>'. Yii::app()->user->getFlash('error') .'</div>';\r\n } else {\r\n return '';\r\n }\r\n }", "function show_flash_msg() {\n $f = get_session(\"MsgFlash\");\n if (!empty($f)) {\n echo $f;\n clear_session(\"MsgFlash\");\n }\n}", "#[Pure]\n public function getFlash(string $key) : mixed\n {\n return $_SESSION['$']['flash']['new'][$key]\n ?? $_SESSION['$']['flash']['old'][$key]\n ?? null;\n }", "public function getFlashData();", "protected function getFlashMessagesFromSession() {}", "public function getFlash($name)\n {\n return $this->getUser()->getAttribute($name, null, 'symfony/flash');\n }", "function flash_message($type, $message) {\n $_SESSION['message'] = array('type' => $type, 'message' => $message);\n if (isset($_SESSION['message'])) {\n\t\tprint_r( $_SESSION['message']);\n\t}\n}", "function get_message($default='')\n\t{\n\t\t$msg = isset($_SESSION['message']) ? $_SESSION['message'] : $default;\n\t\tunset($_SESSION['message']);\n\t\treturn $msg;\n\t}", "public function getMensaje(){\r\n\t$mensaje = \\unserialize($this->getSession()->get('mensaje'));\r\n\t//echo 'mensajession:'.$mensaje;\r\n\t$this->liberar(); // el mensaje se puede leer solo una vez. cuidado!! si se lanzan eventos del mismo tipo antes del correcto no se visualizara.\r\n\treturn $mensaje;\r\n }", "public function renderFlashMessages() {}", "protected function getErrorFlashMessage() {\n\t\treturn FALSE;\n\t}", "public function get_message($msg_type=false) \n {\n $sess_msg= Session::instance()->get(\"hana_message\", array());\n if(!empty($sess_msg)) $this->message=$sess_msg;\n \n if($msg_type)\n {\n return $this->message[$msg_type];\n }\n else\n {\n return $this->message;\n }\n }", "protected function getHeaderFlashMessagesForCurrentPid() {}", "public static function getFlash($name) {\r\n\t\tself::initFlash();\r\n\t\treturn self::hasFlash($name)? self::$flashVars[$name] : null;\r\n\t}", "function flashdata($param) {\n $nama_session = trim(rtrim(stripslashes(htmlspecialchars($param))));\n\n // cek apakah ada session dengan nama dari isi parameter variabel $param\n if (isset($_SESSION[$nama_session])) {\n\n return $_SESSION[$nama_session]['pesan'];\n }\n}", "function flashMessage()\n{\n if (isset($_SESSION['flash']))\n {\n $flash = $_SESSION['flash'];\n unset($_SESSION['flash']);\n foreach ($flash as $key => $value)\n {\n switch ($key)\n {\n case 'fail':\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n break;\n case 'success':\n echo '<p class=\"flash\" style=\"background:#b6e5af\">';\n break;\n default:\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n }\n echo $value . '</p>';\n }\n }\n}", "protected function renderMessage(){\n \t\tif (Yii::app()->session['message'] == NULL)\n \t\t\treturn \"\";\n \t\t\n \t\tswitch (Yii::app()->session['msgType']){\n \t\t\tcase 1:\n \t\t\t\t$res = \"<hr><strong>Success: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\t$res = \"<hr><strong>Error: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\t$res = \"<hr><strong>Unknown: </strong>\".Yii::app()->session['message'].\"<hr>\";\n \t\t}\n \t\t\n \t\tYii::app()->session['message'] = NULL;\n \t\t\n \t\treturn $res;\n \t}", "public function flashdata($name , $msg){\n \treturn $this->session->set_flashdata($name,$msg);\n }", "function flashdata($key)\n\t{\n\t\t$flashdata_key = $this->flashdata_key.':old:'.$key;\n\t\tif (isset($this->userdata[$flashdata_key]))\n\t\t{\n\t\t\treturn $this->userdata[$flashdata_key];\n\t\t}\n\t\treturn NULL;\n\t}", "public function showFlashMessage()\n {\n \tif (isset($_SESSION['flashMessage'])) {\n \t\techo '<div class=\"alert alert-' . $_SESSION['flashMessage']['type'] . '\" role=\"alert\">';\n \t\techo '<strong>'. $_SESSION['flashMessage']['message'] . '</strong>';\n \t\techo '</div>';\n\n \t\tunset($_SESSION['flashMessage']);\n \t}\n }", "function getMessage(){\n\t\t\treturn $this->message;\n\t\t}", "function retrieveRedirectMessage()\n{\n\tif (isset($_SESSION['redirect_message'])) {\n\t\t$message = $_SESSION['redirect_message'];\n\t\tunset($_SESSION['redirect_message']);\n\t\treturn $message;\n\t}\n}", "public function message()\n {\n return $this->mes;\n }", "public function get_message() {\t\t\t\t\t## displaying database message function starts\n\t\t\tif ( isset( $this->_update ) && $this->_update == '1' ) {\n\t\t\t\t$this->_msg = 'Settings Updated Successfully ...';\n\t\t\t} else if ( $this->_update == '0' ) {\n\t\t\t\t$this->_msg = 'Settings Not Updated Successfully ...';\n\t\t\t}\n\t\t\treturn $this->_msg;\n\t\t}", "function flash(string $key, $default = null)\n\t\t{\n\t\t\treturn session()->getFlash($key, $default);\n\t\t}", "public function getMessgae()\n {\n return $this->messgae;\n }", "public function getActionMessage() {\n\n\t\t$message = '';\n\n\t\tswitch ( $this->getLastAction() ) {\n\t\t\tcase self::ACTION_SAVE:\n\t\t\t\t$message = '<div id=\"message\" class=\"updated fade\" style=\"width:450px\"><p><strong>Settings have been saved.</strong></p></div>';\n\t\t\t\tbreak;\n\t\t\tcase self::ACTION_RESET:\n\t\t\t\t$message = '<div id=\"message\" class=\"updated fade\" style=\"width:450px\"><p><strong>Settings have been reset.</strong></p></div>';\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$message = '';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $message;\n\t}", "public function get_msg() {\r\n return $this->msg;\r\n }", "function get_message($type)\n{\n if (isset($_SESSION[$type])) {\n return $_SESSION[$type];\n }\n\n return null;\n}", "protected function renderFlashMessages() {}", "public function getMessage()\n {\n return Mage::registry('current_message');\n }", "public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"flash success\">'.$feedback.'</div>';\n }\n }\n\n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"flash error\">'.$feedback.'</div>';\n }\n }\n\n // delete these messages (as they are not needed anymore and we want to avoid to show them twice\n Session::set('feedback_positive', null);\n Session::set('feedback_negative', null);\n }", "public function show()\n {\n if (!is_null($_SESSION['flash_message']['type'])) {\n\n $type = $_SESSION['flash_message']['type'];\n\n $message = $_SESSION['flash_message']['message'];\n\n unset($_SESSION['flash_message']); // unset flash_message key\n\n return '<div id=\"flash\" class=\"alert alert-' . $type . '\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">\n <span aria-hidden=\"true\">&times;</span>\n <span class=\"sr-only\">Close</span></button>' . $message . '</div>';\n }\n }", "private function getMessage(){ \n\t\t\t//return $this->message;\n\t\t //return \"Sample Message\";\n\t\t\t//$msgArray = array(\"s_id\" => \"s_id\",\"u_id\" => \"u_id\",\"status\"=>\"status\");\n\t\t\t//return json_encode($msgArray); \n\t\t\treturn $this->message;\n\t\t\t\n\t\t}", "public function getMessage(){\n\t\treturn $this->message;\n\t}", "function FlashMessage($code) {\n\t$messages = config('flash_messages');\n\t$return = [];\n\tif (is_array($code)) {\n\t\tforeach ($code as $value) {\n\t\t\t$return[$value] = $messages[$value];\n\t\t}\n\t} else {\n\t\t$return = $messages[$code];\n\t}\n\n\treturn $return;\n}", "public static function show_message() {\n\n $message = \"\";\n if (Session::has('success_message')) {\n $message = '\n \t\t\t<div class=\"alert alert-success class_alert_message\">\n\t\t\t ' .\n Session::get(\"success_message\")\n . '\n\t\t\t \n\t\t\t\t</div>\n \t';\n }\n\n if (Session::has('error_message')) {\n $message = '\n \t\t\t<div class=\"alert alert-danger class_alert_message\">\n\t\t\t ' .\n Session::get(\"error_message\")\n . '\n\t\t\t \n\t\t\t\t</div>\n \t';\n }\n\n\n return $message;\n }", "function flashdata($key)\n {\n $flashdata_key = $this->flashdata_key.':old:'.$key;\n return $this->userdata($flashdata_key);\n }", "public function getFlash(string $session_key) {\n\n if (isset($_SESSION[$session_key]))\n {\n $flashData = $_SESSION[$session_key];\n\n // Clear Flash Message\n unset($_SESSION[$session_key]);\n\n return $flashData;\n }\n }", "public function getmessage()\n {\n return array_shift($this->storage);\n }", "public function flashdata($key = '')\n\t{\n\t\treturn isset($this->flashdata[$key]) ? $this->flashdata[$key] : FALSE;\n\t}", "public static function show_message()\n {\n\n $message = \"\";\n if (Session::has('success_message')) {\n $message = '\n \t\t\t<div class=\"alert alert-success mb-2 class_alert_message\" role=\"alert\">\n\t\t\t ' .\n Session::get(\"success_message\")\n . '\n\t\t\t \n\t\t\t\t</div>\n \t';\n }\n\n if (Session::has('error_message')) {\n $message = '\n \t\t\t<div class=\"alert alert-danger mb-2 class_alert_message\" role=\"alert\">\n\t\t\t ' .\n Session::get(\"error_message\")\n . '\n\t\t\t \n\t\t\t\t</div>\n \t';\n\n // Session()->forget('error_message');\n\n }\n\n\n return $message;\n }", "function getMessage(){\n if(isset($_SESSION['message'])){\n $message = htmlspecialchars($_SESSION['message']);\n unset($_SESSION['message']);\n return '<div class=\"alert-message\">'.$message.'</div>';\n }\n }", "public function get_message() { return $this->getMessage(); }", "public function flash($key = 'message')\n {\n return isset($_SESSION['slim.flash'][$key]) ? $_SESSION['slim.flash'][$key] : false;\n }", "public function getMessage() : mixed\n {\n return $this->message;\n \n }", "public function getMessage() {\n return self::$message;\n }", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function getMessage()\n {\n return $this->playerMessage;\n }", "public function flashdata($key) {\n\t\t$flash_key = $this->flash_key.':old:'.$key;\n\t\treturn $this->userdata($flash_key);\n\t}", "private function getFlash($type, $remove = false) {\n $flashName = 'flash_' . $type;\n if (isset($_SESSION[$flashName])) {\n $flashMessage = $_SESSION[$flashName];\n } else {\n $flashMessage = false;\n }\n if ($remove) {\n unset($_SESSION[$flashName]);\n }\n return $flashMessage;\n }", "public function mostraUltimaMensagem()\n { \n $arMsgSessao = $_SESSION['msg'];\n $stUltimaMensagem = $arMsgSessao[count($arMsgSessao)-1];\n return $stUltimaMensagem;\n }", "protected function getErrorFlashMessage(): string|bool\n {\n $key = 'error' . '.' . $this->settingsUtility->getControllerKey($this) . '.'\n . str_replace('Action', '', $this->actionMethodName);\n $message = $this->translate($key);\n if ($message == null) {\n return FALSE;\n } else {\n return $message;\n }\n }", "protected static function getFromFlash($name)\n {\n if (is_null(static::$flashdata)) {\n static::$flashdata = Flash::getInputs();\n }\n\n if (isset(static::$flashdata[$name])) {\n return static::$flashdata[$name];\n }\n\n return null;\n }", "public function getFlashBag();", "public function message()\r\n {\r\n return $this->message;\r\n }", "public function message()\r\n {\r\n return $this->message;\r\n }", "function getPersonalBatchStackMessage()\n {\n $pbsmsg = self::getSessionValue('PersonalBatchStackMessage');\n return $pbsmsg;\n }", "public function message()\n {\n return $this->msg;\n }", "public function message()\n {\n return $this->msg;\n }", "public function message()\n {\n return $this->msg;\n }", "public static function popMessage() {\n if (isset($_COOKIE[self::$_name])) {\n $message = unserialize($_COOKIE[self::$_name]);\n setcookie(self::$_name, \"\", time() - self::$_time, self::$_path);\n } else {\n $message = NULL;\n }\n return $message;\n }", "public function get_message()\n {\n return $this->_message;\n }", "function setFlash($message = null)\n{\n $flash = $message;\n if ($message === null && isset($_SESSION['flash.message'])) {\n $flash = $_SESSION['flash.message'];\n unset($_SESSION['flash.message']);\n } else {\n $_SESSION['flash.message'] = $message;\n }\n\n return $flash;\n}", "private function getMsg()\n {\n return $this->msg;\n }", "public function getFlash($name, $default = null)\n {\n if(!$this->hasFlash($name))\n {\n return $default;\n }\n\n return $this->getAttribute($name, $default, 'core/user/flash');\n }", "public function getFlashMessenger()\n {\n if (! $this->_flashMessenger) {\n $this->_flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger');\n }\n \n return $this->_flashMessenger;\n }", "public function getFlash($key = null) {\r\n\t if (isset($key)) {\r\n\t\tif ($this->_flashData->exists($key)) {\r\n\r\n\t\t if ($this->_helper->isSerialized($this->_flashData->get($key))) {\r\n\t\t\treturn unserialize($this->_flashData->get($key));\r\n\t\t }\r\n\t\t return $this->_flashData->get($key);\r\n\t\t}\r\n\t\treturn null;\r\n\t } else {\r\n\t\treturn $this->_flashData;\r\n\t }\r\n\t}", "public function flashMessage($message, $type = 'info')\n\t{\n\t\t$flash = parent::flashMessage($message, $type);\n\t\t$flash->count = NULL;\n\t\t$flash->parameters = [];\n\t\treturn $flash;\n\t}", "public function get_flashdata($key)\n {\n if(isset($_SESSION[$this->sess_name]['flashdata'][$key]))\n return $_SESSION[$this->sess_name]['flashdata'][$key];\n else\n return null;\n }", "public function handleFlashNotifications(){\n\t\tif($this->input->get('form_success') !== false){\n\t\t\t$o = \"\" ;\n\t\t\t$function_name = $this->input->get('form_success') ;\n\t\t\t\n\t\t\t$o .= \"<div id='form-success' class='flash_message pad_all'>\" ; \n\t\t\t\t$o .= \"<p>\" ;\n\t\t\t\t\t$o .= $this->getFlashFunctionSuccessMessage($function_name) ;\n\t\t\t\t$o .= \"</p>\" ;\n\t\t\t$o .= \"</div>\" ;\n\t\t\t\n\t\t\t$o .= \"<script>\" ;\n\t\t\t\t$o .= \"$('.flash_message').fadeOut(7000) ;\" ;\n\t\t\t$o .= \"</script>\" ;\n\t\t\t\n\t\t\treturn $o ;\n\t\t}\n\t\tif($this->input->get('form_error') !== false){\n\t\t\t$o = \"\" ;\n\t\t\t$function_name = $this->input->get('form_error') ;\n\t\t\t\n\t\t\t$o .= \"<div id='form-error' class='flash_message pad_all'>\" ; \n\t\t\t\t$o .= \"<p>\" ;\n\t\t\t\t\t$o .= $this->getFlashFunctionErrorMessage($function_name) ;\n\t\t\t\t$o .= \"</p>\" ;\n\t\t\t$o .= \"</div>\" ;\n\t\t\t\n\t\t\t$o .= \"<script>\" ;\n\t\t\t\t$o .= \"$('.flash_message').fadeOut(7000) ;\" ;\n\t\t\t$o .= \"</script>\" ;\n\t\t\t\n\t\t\treturn $o ;\n\t\t}\n\t}", "abstract public function get_message();", "public function getMessenger();", "public function getFlashNotifications()\n {\n $notif = Session::get('flash_notification');\n Session::forget('flash_notification');\n\n return $notif;\n }", "public function checkMessage(){\r\n \t\t// checking message\r\n \t\t$message_id = $this->_request->getParam(\"message_id\");\r\n \t\t// check id param for project\r\n \t\tif(!is_numeric($message_id)){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => 'This FloBox message is not found, are you trying to hack us? :D '));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t\t \r\n \t\ttry{\r\n \t\t\treturn $this->facadeFlobox->findOneMessage($this->_member_id,$message_id);\r\n \t\t}catch(\\Exception $e){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => $e->getMessage()));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t}", "public function benjaminButtonFlashdata()\n\t{\n\t\tforeach($this->flashdata as $key => $val)\n\t\t{\n\t\t\tif (strpos($key, ':new:') === FALSE &&\n\t\t\t\tstrpos($key, ':old:') === FALSE)\n\t\t\t{\n\t\t\t\t$this->flashdata[':new:'.$key] = $val;\n\t\t\t}\n\n\t\t\tunset($this->flashdata[$key]);\n\t\t}\n\n\t\t$this->_set_flash_cookie();\n\t}", "public function load() {\n if(isset($_SESSION[Strings::$message]))\n {\n $ret = $_SESSION[Strings::$message];\n\n }\n else\n {\n $ret = Strings::$emptyString;\n }\n\n $_SESSION[Strings::$message] = Strings::$emptyString;\n\n return $ret;\n }", "public static function getFlash(string $key)\n {\n return static::getInstance()->getFlash($key);\n }" ]
[ "0.78296506", "0.75873876", "0.74004704", "0.73475754", "0.73412824", "0.73076206", "0.71227473", "0.70910823", "0.70510453", "0.6975396", "0.6938368", "0.69135356", "0.6877875", "0.6856525", "0.6813749", "0.6764333", "0.67627245", "0.6738545", "0.6723661", "0.67195106", "0.67132527", "0.6712374", "0.6682908", "0.6656932", "0.6650286", "0.66215956", "0.6557506", "0.65095603", "0.6497453", "0.6468532", "0.64640063", "0.64244485", "0.6417099", "0.6417053", "0.6411599", "0.63869864", "0.6379712", "0.6374442", "0.63715667", "0.63480335", "0.634439", "0.63156205", "0.6306777", "0.6285962", "0.6280565", "0.62622494", "0.62429017", "0.6240778", "0.6221949", "0.6219473", "0.6214383", "0.6208054", "0.6190266", "0.6189379", "0.6186105", "0.61801726", "0.61775184", "0.6175649", "0.6165356", "0.6163018", "0.61628133", "0.61599994", "0.6151519", "0.61417234", "0.61415416", "0.6134111", "0.6111166", "0.6110131", "0.6108899", "0.61083513", "0.61083513", "0.609767", "0.60935503", "0.60812706", "0.60797215", "0.60744303", "0.6072379", "0.60691017", "0.60691017", "0.6055022", "0.60513884", "0.60513884", "0.60513884", "0.60430413", "0.60404456", "0.6038548", "0.6038138", "0.6034944", "0.6033013", "0.60235125", "0.60217446", "0.6007857", "0.6005044", "0.59960586", "0.59926575", "0.59917545", "0.5985859", "0.59836185", "0.59747624", "0.5972984" ]
0.6386127
36
return the flash messenger value and reset the variable
public static function popMessage() { if (isset($_COOKIE[self::$_name])) { $message = unserialize($_COOKIE[self::$_name]); setcookie(self::$_name, "", time() - self::$_time, self::$_path); } else { $message = NULL; } return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function popFlashDanger() {\n\t\treturn $this->getVariable(\"flashMessageDanger\");\n\t}", "function getFlash() {\n return isset($_SESSION['flash.message']) ? $_SESSION['flash.message'] : false;\n}", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public function getFlashMessage() {\n if($message = Session::get('Site.Message')){\n Session::clear('Site.Message');\n $array = new ArrayData($message);\n return $array->renderWith('FlashMessage');\n }\n }", "function show_flash_msg() {\n $f = get_session(\"MsgFlash\");\n if (!empty($f)) {\n echo $f;\n clear_session(\"MsgFlash\");\n }\n}", "public function popFlashSuccess() {\n\t\treturn $this->getVariable(\"flashMessageSuccess\");\n }", "function setFlash($message = null)\n{\n $flash = $message;\n if ($message === null && isset($_SESSION['flash.message'])) {\n $flash = $_SESSION['flash.message'];\n unset($_SESSION['flash.message']);\n } else {\n $_SESSION['flash.message'] = $message;\n }\n\n return $flash;\n}", "function get_message($default='')\n\t{\n\t\t$msg = isset($_SESSION['message']) ? $_SESSION['message'] : $default;\n\t\tunset($_SESSION['message']);\n\t\treturn $msg;\n\t}", "public static function getMessage(){\n $flashMessages = array();\n if(isset($_SESSION['flashMessages'])){\n $flashMessages = $_SESSION['flashMessages'];\n unset($_SESSION['flashMessages']);\n }\n return $flashMessages;\n }", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "function flash_message($type, $message) {\n $_SESSION['message'] = array('type' => $type, 'message' => $message);\n if (isset($_SESSION['message'])) {\n\t\tprint_r( $_SESSION['message']);\n\t}\n}", "function get_flash($type)\n{\n $ci = &get_instance();\n $message = $ci->session->flashdata($type);\n\n if ($message) {\n return htmlentities($message);\n }\n\n return '';\n}", "public function resetMessage(){\n\t\t\tif (isset($_SESSION['message']) && $_SESSION['message']!='') {\n\t\t\t\t$_SESSION['message']='';\n\t\t\t}\n\t\t}", "function getMessage()\r\n{\r\n $message = $_SESSION['message'];\r\n return $message;\r\n}", "function getFlash(string $key)\n {\n return $_SESSION[self::FLASH_KEY][$key]['value'] ?? false;\n }", "public function benjaminButtonFlashdata()\n\t{\n\t\tforeach($this->flashdata as $key => $val)\n\t\t{\n\t\t\tif (strpos($key, ':new:') === FALSE &&\n\t\t\t\tstrpos($key, ':old:') === FALSE)\n\t\t\t{\n\t\t\t\t$this->flashdata[':new:'.$key] = $val;\n\t\t\t}\n\n\t\t\tunset($this->flashdata[$key]);\n\t\t}\n\n\t\t$this->_set_flash_cookie();\n\t}", "public function _age_flashdata()\n\t{\n\t\tforeach($this->flashdata as $key => $val)\n\t\t{\n\t\t\tif (strpos($key, ':old:') !== 0)\n\t\t\t{\n\t\t\t\tif (strpos($key, ':new:') === 0)\n\t\t\t\t{\n\t\t\t\t\t$this->flashdata[substr($key, 5)] = $val;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->flashdata[':old:'.$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($this->flashdata[$key]);\n\t\t}\n\n\t\t$this->_set_flash_cookie();\n\t}", "function flashMessage()\n{\n if (isset($_SESSION['flash']))\n {\n $flash = $_SESSION['flash'];\n unset($_SESSION['flash']);\n foreach ($flash as $key => $value)\n {\n switch ($key)\n {\n case 'fail':\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n break;\n case 'success':\n echo '<p class=\"flash\" style=\"background:#b6e5af\">';\n break;\n default:\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n }\n echo $value . '</p>';\n }\n }\n}", "function flashdata($key)\n\t{\n\t\t$flashdata_key = $this->flashdata_key.':old:'.$key;\n\t\tif (isset($this->userdata[$flashdata_key]))\n\t\t{\n\t\t\treturn $this->userdata[$flashdata_key];\n\t\t}\n\t\treturn NULL;\n\t}", "public function load() {\n if(isset($_SESSION[Strings::$message]))\n {\n $ret = $_SESSION[Strings::$message];\n\n }\n else\n {\n $ret = Strings::$emptyString;\n }\n\n $_SESSION[Strings::$message] = Strings::$emptyString;\n\n return $ret;\n }", "private function getFlashMessageFromSession() {\n $error = \\Tools\\Session::get('error');\n \\Tools\\Session::clear('error');\n $warning = \\Tools\\Session::get('warning');\n \\Tools\\Session::clear('warning');\n $success = \\Tools\\Session::get('success');\n \\Tools\\Session::clear('success');\n\n if(isset($error))\n \\Tools\\FlashMessage::addErrorSet($error);\n if(isset($warning))\n \\Tools\\FlashMessage::addWarningSet($warning);\n if(isset($success))\n \\Tools\\FlashMessage::addSuccessSet($success);\n }", "function flash_message()\n\t{\n\t\t$ci =& get_instance();\n\t\t$flashmsg = $ci->session->flashdata('falshmsg');\n\t\t$html = '';\n\t\tif (is_array($flashmsg)){\n\t\t\t$html = '<div id=\"flashmessage\" class=\"'.$flashmsg['type'].'\">\n\t\t\t\t\t<img style=\"float: right; cursor: pointer\" id=\"closemessage\" src=\"'.base_url().'img/close.png\" />\n\t\t\t\t\t\t\t<p>'.$flashmsg['content'].'</p>\n\t\t\t\t\t\t\t\t\t</div>';\n\t\t}\n\t\treturn $html;\n\t}", "private function _flashdata_mark() {\n\t\tforeach ($_SESSION as $name => $value) {\n\t\t\t$parts = explode(':new:', $name);\n\t\t\tif (is_array($parts) && count($parts) == 2) {\n\t\t\t\t$new_name = $this->flash_key.':old:'.$parts[1];\n\t\t\t\t$this->set_userdata($new_name, $value);\n\t\t\t\t$this->unset_userdata($name);\n\t\t\t}\n\t\t}\n\t}", "public function flashdata($name , $msg){\n \treturn $this->session->set_flashdata($name,$msg);\n }", "public function mostraUltimaMensagem()\n { \n $arMsgSessao = $_SESSION['msg'];\n $stUltimaMensagem = $arMsgSessao[count($arMsgSessao)-1];\n return $stUltimaMensagem;\n }", "function flash($k='') {\n $flash = Session::has('__flash') && !empty(Session::get('__flash')) ? Session::get('__flash') : false;\n if($flash && $k !== ''){\n return $flash[$k];\n } else {\n return $flash;\n }\n}", "public static function getFlash() {\n\t\tif(Yii::app()->user->hasFlash('yiiBasket')) {\n\t\t\treturn Yii::app()->user->getFlash('yiiBasket');\n\t\t}\n\t}", "public static function get_message()\n\t{\n\t\treturn Session::instance()->get('alert');\n\t}", "public function flashData() {\n if (isset($this->environment['lee.flash'])) {\n return $this->environment['lee.flash']->getMessages();\n }\n }", "function get_flashdata( $index ){\n\t\t$output = null;\n\t\tif( isset ($_SESSION[$index]) ){\n\t\t\t$output = $_SESSION[$index];\n\n\t\t\tunset($_SESSION[$index]);\n\n\t\t}\n\t\treturn $output;\n\t}", "function flashdata($key)\n {\n $flashdata_key = $this->flashdata_key.':old:'.$key;\n return $this->userdata($flashdata_key);\n }", "private function setMessage()\r\n\t{\r\n\t\t$model = $this->getModel();\r\n\t\tif (!$model->isMultiPage()) {\r\n\t\t\t$this->assign('message', '');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$message = '';\r\n\t\tif ($model->sessionModel) {\r\n\t\t\t$this->message = $model->sessionModel->status;\r\n\t\t\t//see http://fabrikar.com/forums/showpost.php?p=73833&postcount=14\r\n\t\t\t//if ($model->sessionModel->statusid == _FABRIKFORMSESSION_LOADED_FROM_COOKIE) {\r\n\t\t\tif ($model->sessionModel->last_page > 0) {\r\n\t\t\t\t$message .= ' <a href=\"#\" class=\"clearSession\">'.JText::_('COM_FABRIK_CLEAR').'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->assign('message', $message);\r\n\t}", "function FlashSet($key,$value){\n\n $_SESSION['Flash'][$key]=$value;\n }", "#[Pure]\n public function getFlash(string $key) : mixed\n {\n return $_SESSION['$']['flash']['new'][$key]\n ?? $_SESSION['$']['flash']['old'][$key]\n ?? null;\n }", "function _flashdata_sweep()\n\t{\n\t\tforeach ($this->userdata as $key => $value)\n\t\t{\n\t\t\tif (strpos($key, ':old:'))\n\t\t\t{\n\t\t\t\tunset($this->userdata[$key]);\n\t\t\t}\n\t\t}\n\t\n\t}", "function ShowMsg(){\n\tif(GetVal($_SESSION,\"Msg\")!=\"\"){\n\t\techo '<span class=\"Message\">'.$_SESSION['Msg'].'</span><br/>';\n\t\t$_SESSION['Msg']=\"\";\n\t}\n}", "private function getSavedMessage() : string {\n\n\t\tif ($this->messageWasSetAndShouldNotBeRemovedDuringThisRequest) {\n\t\t\treturn $_SESSION[self::$messageSessionIndex];\n\t\t}\n\n\t\tif (isset($_SESSION[self::$messageSessionIndex])) {\n\t\t\t$message = $_SESSION[self::$messageSessionIndex];\n\t\t\tunset($_SESSION[self::$messageSessionIndex]);\n\t\t\treturn $message;\n\t\t}\n\t\treturn \"\";\n\t}", "private function _flashdata_sweep() {\n\t\tforeach ($_SESSION as $name => $value) {\n\t\t\t$parts = explode(':old:', $name);\n\t\t\tif (is_array($parts) && count($parts) == 2 && $parts[0] == $this->flash_key) {\n\t\t\t\t$this->unset_userdata($name);\n\t\t\t}\n\t\t}\n\t}", "function setFlash($type, $message)\n{\n $_SESSION['message'] = [$type, $message];\n}", "function getFlash($type) {\n if(isset($_SESSION['flash'])) {\n return $_SESSION['flash'][$type];\n }\n \n return null;\n}", "public static function getFlash() {\n if(self::hasFlash()) {\n $flash = $_SESSION['Flash'][0];\n self::clearBuffer();\n return $flash;\n }\n return null;\n }", "protected function setFlashMessage()\n {\n if ($message = $this->session()->getFlash('flash-message')) {\n if ($this->session()->getFlash('flash-error')) {\n $this->pageView()->setError($message);\n } else {\n $this->pageView()->setMessage($message);\n }\n }\n }", "public function message($msg=\"\"){// $msg its optional it may not be sent.\r\n\t\t\r\n\t\t if (!empty($msg)){\r\n\t\t\t \r\n\t\t\t // here \"set_message\"\r\n\t\t\t // make sure you understand why $this->message = $msg wouldn't work.//-> difference between global array SESSION and a object Session.\r\n\t\t\t $_SESSION['message']=$msg;\r\n\t\t\t \r\n\t\t }else{\r\n\t\t\t // here \"get_message\"\r\n\t\t\t return $this->message;\r\n\t\t }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function setMessage($message=''){\n $_SESSION['message'] = $message;\n }", "protected function getFlashMessagesFromSession() {}", "function _flashdata_sweep()\n {\n $userdata = $this->all_userdata();\n foreach ($userdata as $key => $value)\n {\n if (strpos($key, ':old:'))\n {\n $this->unset_userdata($key);\n }\n }\n\n }", "protected function getHeaderFlashMessagesForCurrentPid() {}", "static function flashMessage ()\n {\n if (Session::has ('message')) {\n list ($flashType, $message, $title) = explode ('|', Session::get ('message')) + [''] + [''];\n $title = $title ? \"<h4>$title</h4>\" : '';\n return <<<HTML\n<div class=\"alert alert-$flashType\">\n $title$message\n</div>\n</script>\nHTML;\n }\n }", "function get_and_clear_session_message()\n{\n if (isset($_SESSION['message']) && $_SESSION['message'] != '') {\n $msg = $_SESSION['message'];\n unset($_SESSION['message']);\n return $msg;\n }\n}", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "function set_flashdata( $index,$message ){\n\t\t$_SESSION[$index] = $message ;\n\t}", "function _flashdata_mark()\n {\n $userdata = $this->all_userdata();\n foreach ($userdata as $name => $value)\n {\n $parts = explode(':new:', $name);\n if (is_array($parts) && count($parts) === 2)\n {\n $new_name = $this->flashdata_key.':old:'.$parts[1];\n $this->set_userdata($new_name, $value);\n $this->unset_userdata($name);\n }\n }\n }", "function flashMessage() {\n\t$message = Template::getFlashMessage();\n\tif ( ! empty($message) ) {\n\t\t$messageHtml .= \"<div class='collection'>\";\n\t\t$messageHtml .= \"<a href='#' class='collection-item \" . $message[\"type\"] . \"'>\" . $message[\"body\"] . \"</a>\";\n\t\t$messageHtml .= \"</div>\";\n\n\t\techo $messageHtml;\n\t}\n\treturn NULL;\n}", "function mostraAvviso(){\nif(isset($_SESSION['messaggio'])){\necho $_SESSION['messaggio'];\nunset ($_SESSION['messaggio']);\n}\n}", "public static function get() {\n\n if (self::hasErrors()) {\n\n return $_SESSION['message']['error'];\n }\n\n return $_SESSION['message']['success'];\n }", "public function resetMessage() {\n self::$message = '';\n }", "function printMessages()\n {\n //check if messages buffer contain any values\n if(isset($_SESSION['msg']))\n {\n echo \"{$_SESSION['msg']}\";\n unset($_SESSION['msg']);\n }\n }", "function display_message(){\r\n if(isset($_SESSION['message'])){\r\n echo $_SESSION['message'];\r\n unset($_SESSION['message']);\r\n }\r\n}", "public function flashdata($key) {\n\t\t$flash_key = $this->flash_key.':old:'.$key;\n\t\treturn $this->userdata($flash_key);\n\t}", "function _flashdata_mark()\n\t{\n\t\tforeach ($this->userdata as $name => $value)\n\t\t{\n\t\t\t$parts = explode(':new:', $name);\n\t\t\tif (is_array($parts) && count($parts) === 2)\n\t\t\t{\n\t\t\t\t$new_name = $this->flashdata_key.':old:'.$parts[1];\n\t\t\t\t$this->userdata[$new_name] = $value;\n\t\t\t\tunset($this->userdata[$name]);\n\t\t\t}\n\t\t}\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\r\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\r\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "public function getFlashData();", "protected function _prep_flashdata()\n\t{\n\t\tif ($this->flashdata = ee('Cookie')->getSignedCookie('flash'))\n\t\t{\n\t\t\t$this->_age_flashdata();\n\t\t\treturn;\n\t\t}\n\n\t\t$this->flashdata = array();\n\t}", "function set_message($msg, $alert_type) {\n\n if(!empty($msg)) {\n $_SESSION['message'] = $msg;\n $_SESSION['alert'] = $alert_type;\n }\n else {\n $msg = \"\";\n $alert_type = \"\";\n }\n\n}", "public function flashMessage($message, $type = 'info')\n\t{\n\t\t$flash = parent::flashMessage($message, $type);\n\t\t$flash->count = NULL;\n\t\t$flash->parameters = [];\n\t\treturn $flash;\n\t}", "function set_message($message){\r\n if(!empty($message)){\r\n $_SESSION['message'] = $message;\r\n }else{\r\n $message = \"\";\r\n }\r\n}", "public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"flash success\">'.$feedback.'</div>';\n }\n }\n\n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"flash error\">'.$feedback.'</div>';\n }\n }\n\n // delete these messages (as they are not needed anymore and we want to avoid to show them twice\n Session::set('feedback_positive', null);\n Session::set('feedback_negative', null);\n }", "function flash(string $key, $default = null)\n\t\t{\n\t\t\treturn session()->getFlash($key, $default);\n\t\t}", "function set_message($msg)\n{\n if (!empty($msg)) {\n $_SESSION['message'] = $msg;\n } else {\n $msg = \"\";\n }\n}", "function flash( $name = '', $message = '', $class = 'success fadeout-message' )\n{\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name] ) )\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n \n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ) )\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div class=\"'.$class.'\" id=\"msg-flash\">'.$_SESSION[$name].'</div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n}", "function nextMessage(): string\n{\n return Session::pop('message');\n}", "public function saveToFlash(): int\n {\n return $this->set_persistentSettings(self::PERSISTENTSETTINGS_SAVED);\n }", "public function revertFromFlash(): int\n {\n return $this->set_persistentSettings(self::PERSISTENTSETTINGS_LOADED);\n }" ]
[ "0.7214022", "0.68607426", "0.66295123", "0.6535517", "0.65351653", "0.6520989", "0.6490544", "0.6440368", "0.64181453", "0.64037174", "0.6374987", "0.62689203", "0.62656724", "0.6257856", "0.6228942", "0.62199444", "0.62153685", "0.6199445", "0.61729014", "0.61697036", "0.6149606", "0.6143615", "0.6138747", "0.60993856", "0.6081228", "0.6076172", "0.60541934", "0.60274684", "0.6016739", "0.6016279", "0.60075426", "0.59977186", "0.5996385", "0.59925914", "0.59809333", "0.5980564", "0.59720945", "0.5967366", "0.5950448", "0.5945326", "0.59433365", "0.59361285", "0.59286094", "0.59262824", "0.5921204", "0.5917311", "0.5915347", "0.5892832", "0.58918786", "0.58738977", "0.5867393", "0.5866451", "0.58658797", "0.58604443", "0.5843851", "0.5843758", "0.58306676", "0.58272207", "0.5824659", "0.5823926", "0.5821438", "0.5821438", "0.5821438", "0.5821438", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58199126", "0.58094454", "0.58089423", "0.5808842", "0.5800888", "0.57918733", "0.57910883", "0.5779797", "0.57755053", "0.57616556", "0.57577634", "0.575386", "0.57507193" ]
0.6003726
31
Returns the rendered HTML template
public function __toString(): string { return container_resolve( ViewDataInterface::class, [ $this->getViewData() ] )->withTemplate($this->template); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderTemplate();", "public function getHtmlTemplate() {}", "public function render()\n\t{\n\t $templateFile = $this->template;\n\t $templateContents = $this->getTemplateContents($templateFile);\n\n\t $layout = $this->getTemplateLayout($templateContents);\n $arguments = $this->getTemplateArguments($templateContents);\n\n\t return $this->renderLayout(\n \t\t$layout, \n \t\tfunction () use ($templateFile) {\n\t\t $template = new Template($templateFile);\n\t\t return $template->render();\n\t \t},\n \t\t$arguments\n \t);\n\t}", "private function renderTemplate()\n {\n $this->html = view($this->template, [$this->contextAs => $this->viewData])->render();\n\n // We may try to minify the html before storing it in cache to save space.\n if (env('WIDGET_MINIFICATION', false)) {\n $this->minifyHtml();\n }\n\n // We add some comments to be able to easily identify the widget in browser's developer tool.\n if(env('WIDGET_IDENTIFIER',false)){\n $this->addIdentifierToHtml();\n }\n\n return $this->html;\n }", "public function render() {\n\t\tob_start();\n\n\t\t$this->resolve_template();\n\n\t\treturn ob_get_clean();\n\t}", "public function forTemplate()\n {\n return $this->renderWith($this->defaultTemplate());\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "public function render()\n {\n $html = System::template('admin/v_main.php', [\n 'title' => $this->title,\n 'content' => $this->content,\n ]);\n \n return $html;\n }", "public function render()\n\t{\n\t\t$template = $this->template\n\t\t\t? '<div class=\"wkm-template\" for=\"' .$this->id. '\">' .$this->template. '</div>'\n\t\t\t: '';\n\n\t\treturn parent::render().$template;\n\t}", "public function render()\n {\n \n $v = $this->vars;\n \n ob_start();\n foreach( $this->templates as $template )\n {\n if( Fs::exists( GAIA_PATH.'modules/'.$template.'.tpl' ) )\n include GAIA_PATH.'modules/'.$template.'.tpl';\n elseif( Fs::exists( GAIA_PATH.'wbf/'.$template.'.tpl' ) )\n include GAIA_PATH.'wbf/'.$template.'.tpl';\n else \n echo 'Missing Template '.$template.NL;\n }\n \n $maincontent = ob_get_contents();\n ob_end_clean();\n \n $this->renderedContent = $maincontent;\n\n return $this->renderedContent;\n\n }", "function getHTML() \n {\n \n // Make a new Template object\n $this->template = new Template( $this->pathModuleRoot.'templates/' );\n \n // store the link info\n $this->template->set( 'links', $this->links );\n\n \n // store the page labels\n $name = $this->dataManager->getModuleName();\n $this->labels->setLabelTag( '[Title]', '[moduleName]', $name);\n $this->template->setXML( 'pageLabels', $this->labels->getLabelXML() );\n \n // store XML List of Applicants ...\n $this->template->setXML( 'dataList', $this->dataManager->getXML() );\n \n\n /*\n * Set up any additional data transfer to the Template here...\n */\n // store XML list of State Vars\n $this->template->setXML( 'stateVarList', $this->listStateVar->getXML() );\n \n // store XML list of Data Access Objects\n $this->template->setXML( 'daObjectList', $this->listDAObjects->getXML() );\n \n // store XML list of Page Objects\n $this->template->setXML( 'pageList', $this->listPageObjects->getXML() );\n \n // store XML list of Page Transitions\n $this->template->setXML( 'transitionList', $this->listTransitions->getXML() );\n \n // now store an array of Page Names so the transitions can list \n // the names of the Pages Objects ...\n $pageNames = array();\n $this->listPageObjects->setFirst();\n while ( $page = $this->listPageObjects->getNext() ) {\n $pageNames[ $page->getID() ] = $page->getName();\n }\n $this->template->set( 'pageNames', $pageNames );\n \n\t\treturn $this->template->fetch( 'page_ViewModule.php' );\n \n }", "public function renderHTML() \n\t{\n\t\t$viewTemplate = file_get_contents('view_file.html');\n\t\techo $viewTemplate;\n\t}", "public function render() {\n\t\treturn $this->template( 'page' );\n\t}", "function getTemplate(){\n\t\treturn $this->html_result;\n\t}", "public function render() {\n return $this->getRenderer()->render($this->getLayout() . $this->getContainer()->get('config')->get('template.extension'), $this->getData());\n }", "public function forTemplate()\n {\n if (!$this->canBeCached()) {\n HTTPCacheControlMiddleware::singleton()->disableCache();\n }\n\n $context = $this;\n $this->extend('onBeforeRender', $context);\n\n $return = $context->renderWith($context->getTemplates());\n\n // Now that we're rendered, clear message\n $context->clearMessage();\n\n return $return;\n }", "protected function _render()\n {\n $renderer = $this->param('renderer');\n if ($renderer) {\n return call_user_func($renderer, $this);\n }\n\n ob_start();\n include $this->getTemplateFileName();\n return ob_get_clean();\n }", "public function generate()\n {\n # Build teh Header\n $this->buildHeader();\n\n # Switch the Views\n switch ($this->view) {\n case 'day':\n $this->buildBodyDay();\n break;\n case 'week':\n $this->buildBodyWeek();\n break;\n default:\n $this->buildBody();\n break;\n }\n # return thr string\n return $this->html;\n }", "public static function renderTemplate()\n {\n echo self::$template;\n }", "public function __toString()\n {\n $viewData = $this->variables;\n $templates = Context::getInstance()->getTemplates();\n if ($this->template != false) {\n $renderedTemplate = $templates->render($this->template, $viewData);\n $viewData['contents'] = $renderedTemplate;\n }\n if ($this->layout != false) {\n return $templates->render($this->layout, $viewData);\n }\n }", "public function getCompiledHtml();", "public function Render(){\r\n\t\treturn str_replace(\r\n\t\t\tarray(\r\n\t\t\t\t'{{OUTPUT}}',\r\n\t\t\t\t'{{JS}}',\r\n\t\t\t\t'{{CSS}}',\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t// The structure\r\n\t\t\t\t$this->root_entity->Render(),\r\n\t\t\t\t// Javascript\r\n\t\t\t\tfile_get_contents( realpath( dirname( __FILE__ ) . '/../js/explorer.js' ) ),\r\n\t\t\t\t// CSS\r\n\t\t\t\tfile_get_contents( realpath( dirname( __FILE__ ) . '/../css/explorer.css' ) )\r\n\t\t\t),\r\n\t\t\t// The HTML template\r\n\t\t\tfile_get_contents( realpath( dirname( __FILE__ ) . '/../html/template.html' ) )\r\n\t\t);\r\n\t}", "protected function RenderHTML()\n\t{\n\t $dispmode = $this->GetDisplayMode();\n\t $this->SetDisplayMode($dispmode->GetMode());\n\n $smarty = BizSystem::GetSmartyTemplate();\n $smarty->assign_by_ref(\"name\", $this->m_Name);\n $smarty->assign_by_ref(\"title\", $this->m_Title);\n $smarty->assign_by_ref(\"formstate\", $this->m_FormState);\n $smarty->assign_by_ref(\"toolbar\", $this->m_ToolBar->Render());\n\n if ($dispmode->m_DataFormat == \"array\") // if dataFormat is array, call array render function\n $smarty->assign_by_ref(\"fields\", $this->RenderArray());\n else if ($dispmode->m_DataFormat == \"table\") // if dataFormat is table, call table render function.\n {\n $smarty->assign_by_ref(\"table\", $this->RenderTable());\n $smarty->assign_by_ref(\"formobj\", $this);\n }\n else if ($dispmode->m_DataFormat == \"block\" && $dispmode->m_FormatStyle)\n $smarty->assign_by_ref(\"block\", $this->RenderFormattedTable());\n\n $smarty->assign_by_ref(\"navbar\", $this->m_NavBar->Render());\n\n\t return $smarty->fetch(BizSystem::GetTplFileWithPath($dispmode->m_TemplateFile, $this->m_Package))\n\t . \"\\n\" . $this->RenderShortcutKeys()\n\t . \"\\n\" . $this->RenderContextMenu();\n\t}", "public function render()\n {\n return $this\n ->blade_instance\n ->view()\n ->make(static::TEMPLATE_NAME, $this->entity_data)\n ->render();\n }", "public function asTemplate(): string\n {\n return $this->dom->saveHTML();\n }", "public function render()\n {\n $template = $this->extractTemplate($this->presentation);\n\n if (null === $template)\n {\n return null;\n }\n\n $html = '';\n\n if (!empty($template))\n {\n $html .= $this->templatesService->render($template, $this->arguments);\n }\n\n return $html;\n }", "public function get_content_html()\n {\n\n ob_start();\n RP_SUB_Help::include_template($this->template_html, array_merge($this->template_variables, array('plain_text' => false)));\n return ob_get_clean();\n }", "protected function template() {\n\t\treturn '';\n\t}", "private function htmlResponse() {\n\n /*\n * In case of error, return json\n */\n if (is_array($this->response) && $this->response['ErrorCode'] === 500) {\n $this->request['content-type'] = self::DEFAULT_RESPONSE_FORMAT;\n return $this->jsonResponse();\n }\n \n /*\n * No collection set => renders home page\n */\n if (!$this->request['collection']) {\n $template = new Template(realpath(dirname(__FILE__)) . '/../templates/home.php', $this);\n }\n /*\n * Identifier set => renders resource page\n */ else if ($this->request['identifier']) {\n $template = new Template(realpath(dirname(__FILE__)) . '/../templates/' . $this->responseDescription['template'] . '/' . $this->request['method'] . 'Resource' . '.php', $this, $this->response, $this->responseDescription);\n }\n /*\n * Renders collection\n */ else {\n $template = new Template(realpath(dirname(__FILE__)) . '/../templates/' . $this->responseDescription['template'] . '/' . $this->request['method'] . 'Collection' . '.php', $this, $this->response, $this->responseDescription);\n }\n\n return $template->render();\n }", "public function generateContents()\n {\n ob_start();\n include $this->getTemplateFile();\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }", "public function render()\n {\n $page = $this->twig->load($this->template);\n $this->prepareFlashMessages();\n $html = $page->render($this->vars);\n Router::sendResponse($html);\n }", "public function renderStatic()\n {\n return $this->template;\n }", "public function provideForTemplate() {\n\t\treturn $this()->renderWith($this()->ContentType);\n\t}", "function fetchHtml()\n {\n $html = '';\n\n if (!empty($this->templateFile)) {\n // vullen smarty template\n global $smarty;\n $template = $smarty->createTemplate($this->templateFile);\n $template->assign('interfaceObject', $this);\n\n $html = $smarty->fetch($template);\n }\n return $html;\n }", "protected function getHTMLTemplate()\n {\n if (is_file($tpl = $this->supportPath . '/templates/html.tpl')) {\n return file_get_contents($tpl);\n }\n\n return <<<HTMLTPL\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns =\"http://www.w3.org/1999/xhtml\">\n<head>\n <meta content=\"text/html;charset=utf-8\"/>\n <title>Behat Test Suite</title>\n <link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"/>\n <style type=\"text/css\">\n body {\n margin:0px;\n padding:0px;\n position:relative;\n }\n #behat {\n float:left;\n font-family: Georgia, serif;\n font-size:18px;\n line-height:26px;\n }\n #behat .statistics {\n float:left;\n width:100%;\n margin-bottom:15px;\n }\n #behat .statistics:before {\n content:'Behat';\n position:absolute;\n color: #1C4B20 !important;\n text-shadow: white 1px 1px 1px;\n font-size:48px !important;\n font-family: Lobster, Tahoma;\n top:22px;\n left:20px;\n }\n #behat .statistics p {\n text-align:right;\n padding:5px 15px;\n margin:0px;\n border-right:10px solid #000;\n }\n #behat .statistics.failed p {\n border-color:#C20000;\n }\n #behat .statistics.passed p {\n border-color:#3D7700;\n }\n #behat .feature {\n margin:15px;\n }\n #behat h2, #behat h3, #behat h4 {\n margin:0px 0px 5px 0px;\n padding:0px;\n font-family:Georgia;\n }\n #behat h2 .title, #behat h3 .title, #behat h4 .title {\n font-weight:normal;\n }\n #behat .path {\n font-size:10px;\n font-weight:normal;\n font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace !important;\n color:#999;\n padding:0px 5px;\n float:right;\n }\n #behat h3 .path {\n margin-right:4%;\n }\n #behat ul.tags {\n font-size:14px;\n font-weight:bold;\n color:#246AC1;\n list-style:none;\n margin:0px;\n padding:0px;\n }\n #behat ul.tags li {\n display:inline;\n }\n #behat ul.tags li:after {\n content:' ';\n }\n #behat ul.tags li:last-child:after {\n content:'';\n }\n #behat .feature > p {\n margin-top:0px;\n margin-left:20px;\n }\n #behat .scenario {\n margin-left:20px;\n margin-bottom:40px;\n }\n #behat .scenario > ol {\n margin:0px;\n list-style:none;\n margin-left:20px;\n padding:0px;\n }\n #behat .scenario > ol:after {\n content:'';\n display:block;\n clear:both;\n }\n #behat .scenario > ol li {\n float:left;\n width:95%;\n padding-left:5px;\n border-left:5px solid;\n margin-bottom:4px;\n }\n #behat .scenario > ol li .argument {\n margin:10px 20px;\n font-size:16px;\n }\n #behat .scenario > ol li table.argument {\n border:1px solid #d2d2d2;\n }\n #behat .scenario > ol li table.argument td {\n padding:5px 10px;\n background:#f3f3f3;\n }\n #behat .scenario > ol li .keyword {\n font-weight:bold;\n }\n #behat .scenario > ol li .path {\n float:right;\n }\n #behat .scenario .examples {\n margin-top:20px;\n margin-left:40px;\n }\n #behat .scenario .examples table {\n margin-left:20px;\n }\n #behat .scenario .examples table thead td {\n font-weight:bold;\n text-align:center;\n }\n #behat .scenario .examples table td {\n padding:2px 10px;\n font-size:16px;\n }\n #behat .scenario .examples table .failed.exception td {\n border-left:5px solid #000;\n border-color:#C20000 !important;\n padding-left:0px;\n }\n pre {\n font-family:monospace;\n }\n .snippet {\n font-size:14px;\n color:#000;\n margin-left:20px;\n }\n .backtrace {\n font-size:12px;\n color:#C20000;\n overflow:hidden;\n margin-left:20px;\n }\n #behat .passed {\n background:#DBFFB4;\n border-color:#65C400 !important;\n color:#3D7700;\n }\n #behat .failed {\n background:#FFFBD3;\n border-color:#C20000 !important;\n color:#C20000;\n }\n #behat .undefined, #behat .pending {\n border-color:#FAF834 !important;\n background:#FCFB98;\n color:#000;\n }\n #behat .skipped {\n background:lightCyan;\n border-color:cyan !important;\n color:#000;\n }\n </style>\n</head>\n<body>\n <div id=\"behat\">\n {{ body }}\n </div>\n</body>\n</html>\nHTMLTPL;\n }", "private function renderPage()\n {\n $content = <<<EOD\n<div id=\"layout-block\">\n{$this->searchForm->render()}\n{$this->renderLegend()}\n{$this->renderPools()}\n</div>\nEOD;\n return $this->renderBaseTemplate($content);\n }", "function build() \n {\n $this->engine->build($this->template, $this->config);\n return $this->engine->getBuildedTemplate();\n }", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "protected function content_template() {}", "protected function content_template() {}", "public function output()\n {\n\t\t$this->page = new Template(FP_ROOT . '/include/templates/structure.page.php');\n\t\t$this->page->header = $this->header();\n\t\t$this->page->content = $this->content();\n\t\t$this->page->footer = $this->footer();\n\t\treturn $this->page->render();\n }", "public function renderTemplate()\n {\n $template[] = '<div class=\"slides\"></div>';\n $template[] = '<h3 class=\"title\"></h3>';\n $template[] = '<a class=\"prev text-light\">‹</a>';\n $template[] = '<a class=\"next text-light\">›</a>';\n $template[] = '<a class=\"close text-light\"></a>';\n $template[] = '<a class=\"play-pause\"></a>';\n $template[] = '<ol class=\"indicator\"></ol>';\n return Html::tag('div', implode(\"\\n\", $template), $this->templateOptions);\n }", "protected function render()\n {\n $params = ['title' => $this->title, 'content' => $this->content];\n $html = $this->template('Views/v_main.php', $params);\n echo $html;\n }", "public function render () {\n\t\tif (!$this->template) { echo $this->data['_SF_DEBUG_OUTPUT']; return; }\n\t\t\n\t\ttry {\n\t\t\t$output = $this->template->render($this->data);\n\t\t\t\n\t\t\tif ($this->layout && $this->layout->renderable()) {\n\t\t\t\t$output = $this->layout->content($output)->render($this->data);\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\t\t}\n\t\tcatch (FileNotFoundException$e) {\n\t\t\t#Consider that a missing template file that should be rendered is an error\n\t\t\tthrow new PrivateException('Missing template file for ' . get_class($this->controller) . '::' . $this->action, 1806011508, $e); \n\t\t}\n\t}", "public function render() {\n $htmlContent = \"\";//Main Content\n\n return $htmlContent;\n}", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "function render() {\r\n $sendOutput = true;\r\n // check if plog is configured to use conditional http headers and stuff like\r\n // that... Also, use the HttpCache class to determine whether we should send the\r\n // content or not\r\n if ($this->isCached()) {\r\n // some debug information\r\n $timestamp = $this->_templateObject->getCreationTimestamp();\r\n // and now send the correct headers\r\n if (Http_Cache::httpConditional($timestamp, $this->getCacheTimeSeconds())) $sendOutput = false;\r\n $header = \"Last-Modified: \" . gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';\r\n header($header);\r\n }\r\n else {\r\n // send the results if needed\r\n $sendOutput = true;\r\n }\r\n if ($sendOutput) {\r\n // pass all the values to the template object\r\n $this->_templateObject->assign($this->_params);\r\n // and finally send them after calling the pre-processing method\r\n $content = $this->_templateObject->fetch($this->getViewId());\r\n print ($content);\r\n }\r\n }", "public function render()\n {\n $theme = Yii::app()->theme->name;\n $name = get_class($this);\n $templateName = \"themes/$theme/templates/$name.xhtml\";\n $content = $this->renderContent();\n if (!file_exists($templateName))\n {\n $templateName = \"themes/default/templates/$name.xhtml\";\n }\n if (file_exists($templateName))\n {\n $span = \"<span class=\\\"$name\\\" />\";\n $templateSource = file_get_contents($templateName);\n if (strpos($templateSource, $span))\n {\n $content = str_replace($span, $content, $templateSource);\n }\n $content = \"<!-- Start of $templateName -->$content<!-- End of $templateName -->\";\n }\n $classes = RuntimeUtil::getClassHierarchy(get_class($this), 'View');\n if ($this->isUniqueToAPage())\n {\n $id = \" id=\\\"$name\\\"\";\n unset($classes[0]);\n }\n else\n {\n $id = $this->getId();\n if ($id != null)\n {\n $id = \" id=\\\"$id\\\"\";\n }\n }\n $classes = join(' ', array_merge($this->getCssClasses(), $classes));\n if ($classes != '')\n {\n $classes = \" class=\\\"$classes\\\"\";\n }\n $calledClass = get_called_class();\n if (YII_DEBUG)\n {\n $reflection = new ReflectionClass( $calledClass );\n $classFile = $reflection->getFileName();\n return \"<!--Called in: $classFile--><div\" . $id . $classes . $this->getViewStyle() . \">$content</div>\";\n }\n else\n {\n return \"<div\" . $id . $classes . $this->getViewStyle() . \">$content</div>\";\n }\n }", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "public function getTemplate() {}", "public function render() {\n $template = $this->template;\n $template->setFile(__DIR__ . '/QuestionControl.latte');\n $this->template->question = $this->questions->getById($this->questionId);\n $template->render();\n }", "public function output(): string\n {\n $data = $this->data;\n\n // Render data\n ob_start();\n include $this->templateFile;\n $rendered = ob_get_clean();\n return $rendered;\n }", "public function html()\n {\n return $this->builder() \n ->columns($this->getColumns())\n ->addColumnBefore($this->getSrNoColumn())\n ->addColumn($this->getActionColumn())\n ->ajax([\n 'url' => url('admin/email-template'),\n 'type' => 'GET',\n 'data' => 'function(d) { d.timezone = $.laravel.datetime.getTimeZone(); }',\n ])\n ->parameters($this->getBuilderParameters());\n }", "public function getHTML() {\n\t\tglobal $tpl;\n\n $tpl->addCss(\n 'Customizing/global/plugins/Services/Repository/RepositoryObject/'\n . 'Review/templates/default/css/Review.css'\n );\n $path_to_il_tpl = ilPlugin::getPluginObject(\n IL_COMP_SERVICE,\n 'Repository',\n 'robj',\n 'Review'\n )->getDirectory();\n $custom_tpl = new ilTemplate(\n \"tpl.aspect_row.html\",\n true,\n true,\n $path_to_il_tpl\n );\n\t\tforeach ($this->si_guis as $si_gui) {\n\t\t\t$si_gui->insert($custom_tpl);\n\t\t}\n\t\treturn $custom_tpl->get();\n\t}", "public function toHtml(){\n \n ob_start();\n \n // include flight search result template\n require('../../partials/results.php');\n \n $html = ob_get_contents();\n ob_end_clean();\n \n return $html;\n \n }", "public function render()\n {\n $config = $this->config();\n $location = $config['templates'] . \"/\" . $this->template . $config['extension'];\n\n if (file_exists($location) || $config['string_template']) {\n $prior = ob_start();\n extract($this->variables, EXTR_OVERWRITE, $config['string_template']);\n if (!$config['string_template']) {\n include $location;\n } else {\n echo $string;\n }\n $template = ob_get_clean();\n } else {\n throw new ViewException('Unable to locate the required template: ' . $location);\n }\n\n return $template;\n }", "public function html() {}", "public function returnTemplate() {\n\t\treturn $this->template;\n\t}", "protected function render_result()\n\t{\n\t\tif (!array_key_exists('self', $this->vars)) {\n\t\t\t$this->vars['self'] = $this;\n\t\t}\n\n\t\t$tpl = new STemplate();\n\t\t$tpl->vars =& $this->vars;\n\t\t$tpl->controls =& $this->controls;\n\n\t\t$res = $tpl->process($this->template_name);\n\n\t\tif (array_key_exists(PAGE_FILTER_RENDER, $this->_events))\n\t\t{\n\t\t\t$filters = array_reverse($this->_events[PAGE_FILTER_RENDER]);\n\n\t\t\tforeach ($filters as $method) {\n\t\t\t\t$res = call_user_func(array($this, $method), $res);\n\t\t\t}\n\t\t}\n\n\t\tif (strlen($this->design_page_name) && @file_exists($this->design_page_name))\n\t\t{\n\t\t\t$tpl = new STemplate();\n\t\t\t$tpl->vars =& $this->vars;\n\t\t\t$tpl->controls =& $this->controls;\n\n\t\t\t$tpl->vars['__content__'] = $res;\n\t\t\t$res = $tpl->process($this->design_page_name);\n\t\t}\n\n\t\treturn $res;\n\t}", "public function indexAction(): string\n {\n return $this->getTemplateEngine()->render('/templates/cms/templates/index');\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function __toString()\n {\n $this->rendered = true;\n\n return $this->render($this->view_file, $this->view_data);\n }", "abstract public function generateHtml();", "public function template();", "public function render() {\n\t\t$this->template->setFile(__DIR__ . '/templates/' . $this->templateName);\n\n\t\t$this->template->richTexts = $this->getRichTextNames();\n\t\t$this->template->config = $this->configuration;\n\n\t\t$this->template->render();\n\t}", "final public function getTemplate() {\n\t\treturn '';\n\t}", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function render() {\n\n\t\t$context = $this->options;\n\t\t$context = $this->load($context);\n\n\t\textract($context);\n\n\t\tinclude __DIR__ . '/../views/' . $this->template();\n\t}", "public function render($template = 'index'){\n\t$template = $this->folder.\"\\\\templates\\\\$template\";\n\t$this->rendered_view = $this->view()->render($template);\n\treturn $this->rendered_view;\n }", "protected function renderOutput()\n {\n\t\t\n\t\t// $menu = $this->getMenu();\n\t\t\n\t\t//dd($menu);\n\t\t\n\t\t// $navigation = view(config('settings.theme').'.navigation')->with('menu',$menu)->render();\n\t\t// $this->vars = array_add($this->vars,'navigation',$navigation);\n\t\t\n\t\t// if($this->contentRightBar) {\n\t\t\t// $rightBar = view(config('settings.theme').'.rightBar')->with('content_rightBar',$this->contentRightBar)->render();\n\t\t\t// $this->vars = array_add($this->vars,'rightBar',$rightBar);\n\t\t// }\n\t\t\n\t\t$this->vars = array_add($this->vars,'keywords',$this->keywords);\n\t\t$this->vars = array_add($this->vars,'meta_desc',$this->meta_desc);\n\t\t$this->vars = array_add($this->vars,'title',$this->title);\n\t\t\n $header = view(config('settings.theme') . $this->header_temp)->render();\n $this->vars = array_add($this->vars, 'header', $header);\n\t\t\n\t\t$footer = view(config('settings.theme'). $this->footer_temp)->render();\n\t\t$this->vars = array_add($this->vars, 'footer', $footer);\n \n return view($this->template)->with($this->vars);\n\t\t\n\t}", "protected function generateHtml()\n\t{\n\t}", "protected static function displayHtmlBody()\n {\n $strServerUrlRequestContext = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' .\n \"{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}\";\n\n $strDateTimeContext = date('Y-m-d H:i:s');\n $strFilePathContext = self::$arrBacktrace['file'];\n $intLineContext = self::$arrBacktrace['line'];\n\n $strFileContent = file_get_contents(self::$strTemplateFile);\n $strHtmlContent = str_replace('@debugcontext', self::$prettyDebugContext, $strFileContent);\n $strHtmlContent = str_replace('@filepathcontext', $strFilePathContext, $strHtmlContent);\n $strHtmlContent = str_replace('@linecontext', $intLineContext, $strHtmlContent);\n $strHtmlContent = str_replace('@serverurlrequest', $strServerUrlRequestContext, $strHtmlContent);\n $strHtmlContent = str_replace('@datetimecontext', $strDateTimeContext, $strHtmlContent);\n\n $intExecutionTimeContext = microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n $strHtmlContent = str_replace('@executiontimecontext', $intExecutionTimeContext, $strHtmlContent);\n $intMemoryUsageContext = memory_get_peak_usage();\n $strHtmlContent = str_replace('@memoryusagecontext', $intMemoryUsageContext, $strHtmlContent);\n return $strHtmlContent;\n }", "public function getContent()\r\n {\r\n return $this->template;\r\n }", "function getRenderedTemplate($file,$data=array())\n {\n $this->compile($file);\n ob_start();\n extract($data);\n include $this->getCompiledTemplate();\n $ret = ob_get_contents();\n ob_end_clean();\n \n return $ret;\n }", "public function template($params = false){\n return $this->getTemplate($params);\n }", "public function render()\n {\n // dd( $this->createItemArray() );\n return $this->htmlFromArray($this->createItemArray());\n }", "public function html()\n {\n return Mailblade\\View::make($this->view)\n ->with($this->data)\n ->render();\n }", "public function getTwig()\n {\n return TemplateHelper::getRaw($this->_getHtml());\n }", "function get_template()\n {\n }", "public function generateHtml()\n {\n return $this->presenter->getView()->generateHtml();\n }", "public function getHtml() {\r\n\r\n // get only the `Page` objects from all the items (for the View)\r\n $applicationPages = array_filter($this->getItems(), function($item) {\r\n return ($item instanceof Page);\r\n });\r\n\r\n // set the layout to the child items\r\n if (!$this->_layoutEnabled) {\r\n $this->_currentPage->disableLayout();\r\n }\r\n\r\n // get the HTML of the current page\r\n $currentPageHtml = $this->_currentPage ? $this->_currentPage->getHtml() : '';\r\n\r\n // get the Javascript if the layout enabled\r\n $currentPageJavascript = '';\r\n if (($jsCode = $this->getJavascript()) != '' && $this->_layoutEnabled) {\r\n $currentPageJavascript.= $jsCode;\r\n }\r\n\r\n // get the current page URL (for the View)\r\n $currentPageUrl = $this->_request->getUrlParam(0);\r\n if (is_null($currentPageUrl)) {\r\n $currentPageUrl = '';\r\n }\r\n\r\n // check if the layout is enabled, if no, just return the HTML of the current page\r\n if (!$this->_layoutEnabled) {\r\n\r\n // return only the inner page HTML\r\n return $currentPageHtml;\r\n } else {\r\n\r\n // load the application template\r\n ob_start();\r\n require APP_VIEW;\r\n return ob_get_clean();\r\n }\r\n }", "public function template()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/template', [\n\t\t\t'templates_availables' => $this->templates_availables,\n\t\t]);\n\t}", "public function render()\n {\n parent::render();\n\n // is logged in ?\n $oUser = $this->getUser();\n if (!$oUser) {\n return $this->_sThisTemplate = $this->_sThisLoginTemplate;\n }\n\n return $this->_sThisTemplate;\n }", "function ffd_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\r\n\tob_start();\r\n\tffd_get_template( $template_name, $args, $template_path, $default_path );\r\n\treturn ob_get_clean();\r\n}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}" ]
[ "0.81362635", "0.799934", "0.7726359", "0.76758707", "0.75938416", "0.7592613", "0.75670445", "0.7564756", "0.7564756", "0.7564756", "0.7541586", "0.7481189", "0.7480332", "0.74650407", "0.7433974", "0.74248755", "0.73895067", "0.73657846", "0.734425", "0.73276126", "0.7314752", "0.72990096", "0.7241808", "0.7209402", "0.7202755", "0.7181029", "0.71761334", "0.71466374", "0.7112426", "0.7091984", "0.7076563", "0.7072186", "0.7055667", "0.70525455", "0.70242697", "0.7010688", "0.6966322", "0.69632095", "0.69341993", "0.69172496", "0.6915228", "0.6914801", "0.69147587", "0.68999445", "0.68999445", "0.6878965", "0.68753695", "0.6874839", "0.6871606", "0.6864893", "0.6864637", "0.6860407", "0.68513167", "0.6846765", "0.683934", "0.6817457", "0.68042743", "0.6789126", "0.6776286", "0.6766302", "0.673879", "0.67312914", "0.6729477", "0.6727357", "0.6716442", "0.670949", "0.670949", "0.670949", "0.670949", "0.670949", "0.670949", "0.67077094", "0.6699505", "0.66766226", "0.66751397", "0.6674114", "0.6670568", "0.6670009", "0.6670009", "0.6668524", "0.666491", "0.66591823", "0.6657621", "0.66472596", "0.6645126", "0.66448545", "0.66415805", "0.6640883", "0.6640671", "0.6632307", "0.6631186", "0.6630381", "0.66290194", "0.6625846", "0.66246784", "0.6622093", "0.6620178", "0.6620178", "0.6620178", "0.6620178", "0.6620178" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created Problem in storage.
public function store(Request $request) { $problems = $request->input('problems'); $topicId = $request->input('topicId'); // if requests includes Problem information, store in database // attach created Problem object to the specified Topic if (!empty($problems)){ foreach ($problems as $prob){ $problem = new Problem; $problem->problem_name = $prob['problem_name']; $problem->url = $prob['url']; $problem->save(); $problem->topics()->attach($topicId); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request, Problem $problem)\n {\n $rules = [\n 'file' => 'file'\n ];\n\n $this->validate($request, $rules);\n\n $uploadedFile = $request->file;\n $run = new Run();\n $run->file_name = $uploadedFile->getClientOriginalName();\n $run->student_id = Auth::guard('api')->user()->id;\n\n $problem->runs()->save($run);\n\n Storage::putFileAs(\"problems/$problem->id/runs/$run->id\", $request->file, $uploadedFile->getClientOriginalName());\n\n return response()->json($run);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'content' => 'required|max:255',\n ]);\n $request->user()->problems()->create([\n 'content' => $request->content,\n ]);\n return redirect('/problems');\n }", "public function storeOrUpdate(Issue $issue = null)\n {\n $data = request()->validate([\n 'name' => 'required|string|max:255',\n ]);\n\n if ($issue) {\n $issue->update($data);\n\n return redirect()->route('admin.issues.index')->with([\n 'alertType' => 'success',\n 'alertMessage' => 'Le problème a bien été édité.',\n ]);\n }\n\n Issue::create($data);\n\n return redirect()->route('admin.issues.index')->with([\n 'alertType' => 'success',\n 'alertMessage' => 'Le nouveau problème a bien été ajouté.',\n ]);\n }", "public function store(Request $request, $id)\n {\n $this->validate (\n $request,\n [\n 'question' => 'required',\n 'choices' => 'required',\n 'answer' => 'required'\n ]\n );\n\n $problem = new Problem();\n $problem->question = request('question');\n $problem->choices = json_encode(request('choices'));\n $problem->answer = request('answer');\n $problem->test_id = $id;\n\n //Save\n $problem->save();\n\n return redirect(\"/tests/$id\")->with('success', 'Problem Added');\n }", "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$step = new Step;\n\n\t\t$step->task_id = 1;\n\t\t$step->user_id = 1;\n\t\t$step->title = Input::get('step_title');\n\t\t$step->report = Input::get('step_report');\n\t\t$step->duration = Input::get('step_duration');\n\n\t\t$step->save();\n\n\t\treturn Redirect::route('step.index')->withMessage('Étapes créée avec succès !');\n\t}", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.64421576", "0.61969244", "0.5901603", "0.5874045", "0.5816447", "0.5816447", "0.5816447", "0.5792641", "0.57516456", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392", "0.5748392" ]
0.63180965
1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $response = $next($request); if (app()->runningInConsole() || $response instanceof RedirectResponse) { return $response; } $content = $response instanceof Response ? $response->getContent() : $response->router->iframe(); $this->checkDefinedConfig(); return new Response(view(config('app.crud.layout'), [ 'title' => config('app.crud.title'), 'content' => $content ])->render()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Creates or returns an instance of this class.
public static function get_instance() { static $instance = null; if( $instance === null ) { $instance = new self; } return $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "public static function create() {\n\t\treturn new self();\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create() {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function create()\n {\n return new $this->class;\n }", "public static function createInstance()\n {\n return new self();\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public static function make() {\n return new self();\n }", "public function newInstance()\n {\n return new self();\n }", "public static function instance() {\n\t\treturn new self;\n\t}", "public function Create()\n\t{\n\t\treturn new self;\n\t}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "static function create(): self;", "public static function create()\n {\n if (null === self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public static function factory()\n {\n return new self;\n }", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public static function init()\n {\n return new self();\n }", "public static function create(): self\n {\n return new static();\n }", "static public function create()\n {\n return new static();\n }", "public static function create(): self\n {\n return new static;\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function getInstance() {\n return new self();\n }", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "public static function getInstance()\n {\n return new self();\n }", "public static function instance() {\n return new static();\n }", "public static function new(){\n self::$instance = new self();\n return self::$instance;\n }", "public static function make () {\n return new static;\n }", "public static function newInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "public static function make()\n {\n return new static();\n }", "public static function make()\n {\n return new static;\n }", "public static function make()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public function newInstance();", "public function newInstance();", "public static function make()\n\t{\n\t\treturn new static;\n\t}", "public static abstract function createInstance();", "public static function factory() {\n\t\tstatic $instance;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public static function createInstance()\n {\n return new static();\n }", "public static function model()\n {\n return new self;\n }", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "public function newInstance(): object;", "public static function inst()\n {\n return new static();\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function instance();", "public static function builder() {\n return new self();\n }", "public static function new()\n {\n return new static();\n }" ]
[ "0.81545395", "0.8128206", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.80818295", "0.8058891", "0.8037697", "0.8037697", "0.8037453", "0.79758656", "0.7925205", "0.7815928", "0.78046304", "0.77302724", "0.77275556", "0.7725297", "0.7719885", "0.7719142", "0.76721686", "0.76373196", "0.76287645", "0.7627113", "0.76164216", "0.761339", "0.7515124", "0.7491693", "0.7476905", "0.74682075", "0.74682075", "0.74682075", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74561596", "0.74464875", "0.74464875", "0.74464875", "0.74464875", "0.7440467", "0.73793674", "0.73550063", "0.73550063", "0.73550063", "0.73550063", "0.73489773", "0.7341806", "0.72577184", "0.7244198", "0.7214407", "0.72124314", "0.72006965", "0.72006965", "0.71980464", "0.7115952", "0.7115952", "0.71156913", "0.71156913", "0.71153486", "0.71153486", "0.71069086", "0.71022594", "0.70833933", "0.706806", "0.7058785", "0.7024672", "0.70198315", "0.70102733", "0.70059395", "0.70051336", "0.6963275", "0.6950291" ]
0.0
-1
Add field in register form
private function __construct() { add_action( 'register_form', array( $this, 'field' ) ); // Validate values add_filter( 'registration_errors', array( $this, 'registration_errors') , 10, 3 ); //Save user meta add_action( 'user_register', array( $this, 'save_meta' ), 10, 1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}", "public function register_field()\n {\n }", "public function addField();", "function addToField(\\Foundation\\Form\\Field $field);", "function ic_add_register_field() {\n\t?>\n\t<p>\n\t\t<label for=\"invite_code\"><?php echo esc_html( 'Invite Code' ); ?></label>\n\t\t<input type=\"text\" name=\"invite_code\" id=\"invite_code\" class=\"input\" size=\"25\" />\n\t</p>\n\t<?php\n}", "function add_form_field($field, $error = \"\", $prefill = \"\"){\n\t\t$this->form_row($field, $error , $prefill );\n\t}", "public function formRegister(){\n $this->view->registerForm();\n }", "public function actionAdd()\n\t{\n\t\t$formId = $this->_input->filterSingle('form_id', XenForo_Input::UINT);\n\t\t$type = $this->_input->filterSingle('type', XenForo_Input::STRING);\n\t\t\n\t\t$fieldModel = $this->_getFieldModel();\n\t\t$fieldTypes = $fieldModel->getCountByType();\n\t\t\n\t\t$options = array();\n\t\t$options[] = array(\n\t\t 'value' => 'user',\n\t\t 'label' => new XenForo_Phrase('field'),\n\t\t 'selected' => true\n\t\t);\n\t\t\n\t\t// if global fields exist, include in the types\n\t\tif (array_key_exists('global', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'global',\n\t\t\t 'label' => new XenForo_Phrase('global_field')\n\t\t\t);\n\t\t}\n\t\t\n\t\t// if template fields exist, include in the types\n\t\tif (array_key_exists('template', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'template',\n\t\t\t 'label' => new XenForo_Phrase('template_field') \n\t\t\t);\n\t\t}\n\t\t\n\t\t// if there are no options other than user, just send them to the add field page\n\t\tif (!$type && count($options) == 1)\n\t\t{\n\t\t\t$type = 'user';\n\t\t}\n\t\t\n\t\t// association a field to a form\n\t\tif ($formId && $type)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'field_id' => null,\n\t\t\t\t'form_id' => $this->_input->filterSingle('form_id', XenForo_Input::UINT),\n\t\t\t\t'display_order' => $this->_getFieldModel()->getGreatestDisplayOrderByFormId($formId) + 10,\n\t\t\t\t'field_type' => 'textbox',\n\t\t\t\t'field_choices' => '',\n\t\t\t\t'match_type' => 'none',\n\t\t\t\t'match_regex' => '',\n\t\t\t\t'match_callback_class' => '',\n\t\t\t\t'match_callback_method' => '',\n\t\t\t\t'max_length' => 0,\n\t\t\t\t'min_length' => 0,\n\t\t\t\t'required' => 0,\n\t\t\t\t'type' => $type,\n\t\t\t\t'active' => 1,\n\t\t\t\t'pre_text' => '',\n\t\t\t\t'post_text' => ''\n\t\t\t);\n\t\t\t\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t case 'global':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-global-field');\n\t\t }\n\t\t\t case 'template':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-template-field');\n\t\t }\n\t\t\t default:\n\t\t {\n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// adding a global/template field\n\t\telse if (!$formId && $type)\n\t\t{\n\t\t $default = array(\n\t 'field_id' => null,\n\t 'field_type' => 'textbox',\n\t 'field_choices' => '',\n\t 'match_type' => 'none',\n\t 'match_regex' => '',\n\t 'match_callback_class' => '',\n\t 'match_callback_method' => '',\n\t 'max_length' => 0,\n\t\t \t'min_length' => 0,\n\t 'type' => $type,\n\t\t \t'pre_text' => '',\n\t\t \t'post_text' => ''\n\t\t );\n\t\t \n\t\t if ($type != 'global')\n\t\t {\n\t\t \t$default['display_order'] = 1;\n\t\t \t$default['required'] = 0;\n\t\t \t$default['active'] = 1;\n\t\t }\n\t\t \n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t}\n\t\t\n\t\t// association type\n\t\telse\n\t\t{\n\t\t\t$viewParams = array(\n\t\t\t\t'formId' => $formId,\n\t\t\t\t'options' => $options\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->responseView('KomuKu_SimpleForms_ViewAdmin_Field_AddType', 'kmkform__field_add_type', $viewParams);\n\t\t}\n\t}", "public function registrationForm() {\n\n }", "private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}", "function register_field(string $section, array $field)\n {\n }", "public function onAddField()\n {\n return $this->makePartial('create_field_form');\n }", "function login_form_register()\n {\n }", "public function addField(Field $field);", "public function addField(Field $field);", "public function registerForm(){\n $this->nonce=Nonce::getNonce();\n }", "public function actionRegister()\n {\n $this->view->title = DetailesForm::TITLE_REGISTER_FORM;\n $model = new UserInfo();\n $items = DetailesForm ::getItems();\n if (Yii::$app->request->post()) {\n $data = Yii::$app->request->post();\n $resultSave = UserInfo::setSave($model , $data);\n if ($resultSave->success)\n {\n Yii::$app->session->setFlash('success', 'ثبت با موفقیت انجام شد');\n $this->redirect( Url::to(['view','id'=> $resultSave->result['id']] ));\n }\n elseif (!$resultSave->success && !empty($resultSave->message))\n {\n $msg = '';\n foreach ($resultSave->message as $text)\n {\n $msg .= $text . \"<br>\";\n }\n Yii::$app->session->setFlash('danger', $msg);\n }\n else\n Yii::$app->session->setFlash('danger', 'عملیات ناموفق به پایین رسید');\n }\n\n return $this->render('_form',\n [\n 'model' => $model,\n 'items' => $items,\n ]);\n\n }", "public function listRegisterFields(){\n\t\t$this->registerFieldString('name_hld', 'Tipo');\n\t}", "public function add_field(form_item $field) {\n $this->_fields[] = $field;\n }", "function give_get_register_fields( $form_id ) {\n\n\tglobal $user_ID;\n\n\tif ( is_user_logged_in() ) {\n\t\t$user_data = get_userdata( $user_ID );\n\t}\n\n\t$show_register_form = give_show_login_register_option( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give-register-fields-<?php echo $form_id; ?>\">\n\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering user registration form, before registration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_register_fields_before', $form_id );\n\t\t?>\n\n\t\t<fieldset id=\"give-register-account-fields-<?php echo $form_id; ?>\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires while rendering user registration form, before account fields.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( 'give_register_account_fields_before', $form_id );\n\n\t\t\t$class = ( 'registration' === $show_register_form ) ? 'form-row-wide' : 'form-row-first';\n\t\t\t?>\n\t\t\t<div id=\"give-create-account-wrap-<?php echo $form_id; ?>\"\n\t\t\t class=\"form-row <?php echo esc_attr( $class ); ?> form-row-responsive\">\n\t\t\t\t<label for=\"give-create-account-<?php echo $form_id; ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\t// Add attributes to checkbox, if Guest Checkout is disabled.\n\t\t\t\t\t$is_guest_checkout = give_get_meta( $form_id, '_give_logged_in_only', true );\n\t\t\t\t\t$id = 'give-create-account-' . $form_id;\n\t\t\t\t\tif ( ! give_is_setting_enabled( $is_guest_checkout ) ) {\n\t\t\t\t\t\techo Give()->tooltips->render(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'tag_content' => sprintf(\n\t\t\t\t\t\t\t\t\t'<input type=\"checkbox\" name=\"give_create_account\" value=\"on\" id=\"%s\" class=\"give-input give-disabled\" checked />',\n\t\t\t\t\t\t\t\t\t$id\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'label' => __( 'Registration is required to donate.', 'give' ),\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?>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"give_create_account\" value=\"on\" id=\"<?php echo $id; ?>\"\n\t\t\t\t\t\t class=\"give-input\"/>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t_e( 'Create an account', 'give' );\n\t\t\t\t\techo Give()->tooltips->render_help( __( 'Create an account on the site to see and manage donation history.', 'give' ) );\n\t\t\t\t\techo str_replace(\n\t\t\t\t\t\t'/>',\n\t\t\t\t\t\t'data-time=\"' . time() . '\" data-nonce-life=\"' . give_get_nonce_life() . '\"/>',\n\t\t\t\t\t\tgive_get_nonce_field( \"give_form_create_user_nonce_{$form_id}\", 'give-form-user-register-hash', false )\n\t\t\t\t\t);\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t</div>\n\n\t\t\t<?php if ( 'both' === $show_register_form ) { ?>\n\t\t\t\t<div class=\"give-login-account-wrap form-row form-row-last form-row-responsive\">\n\t\t\t\t\t<p class=\"give-login-message\"><?php esc_html_e( 'Already have an account?', 'give' ); ?>&nbsp;\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>\" class=\"give-checkout-login\"\n\t\t\t\t\t\t data-action=\"give_checkout_login\"><?php esc_html_e( 'Login', 'give' ); ?></a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class=\"give-loading-text\">\n\t\t\t\t\t\t<span class=\"give-loading-animation\"></span>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t<?php } ?>\n\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires while rendering user registration form, after account fields.\n\t\t\t *\n\t\t\t * @param int $form_id The form ID.\n\t\t\t *\n\t\t\t * @since 1.0\n\t\t\t *\n\t\t\t */\n\t\t\tdo_action( 'give_register_account_fields_after', $form_id );\n\t\t\t?>\n\t\t</fieldset>\n\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering user registration form, after registration fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_register_fields_after', $form_id );\n\t\t?>\n\n\t\t<input type=\"hidden\" name=\"give-purchase-var\" value=\"needs-to-register\"/>\n\n\t\t<?php\n\t\t/**\n\t\t * Fire after register or login form render\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_user_info', $form_id );\n\t\t?>\n\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}", "function wooc_extra_register_fields() {\n ?>\n\n <p class=\"form-row form-row-first\">\n <label for=\"reg_billing_first_name\"><?php _e( 'First name', 'woocommerce' ); ?> <span class=\"required\">*</span></label>\n <input type=\"text\" class=\"input-text\" name=\"billing_first_name\" id=\"reg_billing_first_name\" value=\"<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>\" />\n </p>\n\n <p class=\"form-row form-row-last\">\n <label for=\"reg_billing_last_name\"><?php _e( 'Last name', 'woocommerce' ); ?> <span class=\"required\">*</span></label>\n <input type=\"text\" class=\"input-text\" name=\"billing_last_name\" id=\"reg_billing_last_name\" value=\"<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>\" />\n </p>\n\n <?php\n}", "public function registerFormCust()\n {\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n\n require_once('views/FormError.class.php');\n require_once('views/RegistrationForm.class.php');\n $site = new SiteContainer($this->db);\n $error_page = new FormError();\n $form = new RegistrationForm();\n $site->printHeader();\n $site->printNav(\"reg\");\n\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n }", "function femail_user_add($form_state, $account){\n $form['femail_email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email')\n );\n $form['femail_uid'] = array(\n '#type' => 'hidden',\n '#value' => $account->uid\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add an additional Email')\n );\n return $form;\n}", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "public function add(IField $field): IFormBuilder;", "static function value(\\models\\RegistrationForm &$form, $field);", "public function getRegistrationForm()\n\t{\n\n\t}", "public function ulogiraj_registiraj()\r\n\t{\r\n\t\tif(isset($_POST['ulogiraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Login';\r\n\t\t\t$this->registry->template->show( 'login' );\r\n\t\t}\r\n\t\tif(isset($_POST['registriraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Registriraj se';\r\n\t\t\t$this->registry->template->show( 'register' );\r\n\t\t}\r\n\r\n\t}", "public function registerForm()\n {\n return view('register', [\n 'titlePart' => '| Register',\n ]);\n }", "function addFieldToForm($field, $bAddToMap = true){\r\n\t\treturn $this->fields->addFieldToForm($field, $bAddToMap);\r\n\t}", "protected function createFormFields() {\n\t}", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function setUserfield($value);", "public function addUser(UserAddForm $form);", "public function onCreateField()\n {\n $post = post();\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::createField(\n $post['name'],\n $post['code'],\n $post['description'],\n $validation,\n $post['type'],\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "public function addCustomFields()\n {\n if (!($enabled_custom_fields = $this->getDataManager()->getOption('custom_fields'))) {\n $enabled_custom_fields = array();\n }\n if (!($enabled_profile_fields = $this->getDataManager()->getOption('custom_fields_additional'))) {\n $enabled_profile_fields = array();\n }\n ?>\n <fieldset data-rm-target=\"#custom-fields .custom-field-select option\" id=\"profile-fields\" class=\"checkbox-list rm-ctrl syncstate\"<?php echo !$this->getDataManager()->getOption('enable_sync') ? ' disabled=\"disabled\"' : '' ?>>\n <?php foreach ($this->custom_fields as $custom_field): ?>\n <div>\n <label>\n <input class=\"profile-field-checkbox\" type=\"checkbox\" name=\"<?php echo $this->getViewKey().'[custom_fields_additional][]' ?>\" value=\"<?php echo $custom_field->getId() ?>\"<?php echo in_array($custom_field->getId(), $enabled_profile_fields) ? ' checked=\"checked\"' : '' ?> />\n <?php echo $custom_field->getName() ?> (<?php _e('customfield.type.'.$custom_field->getFieldType(), 'mgrt-wordpress') ?>)\n </label>\n </div>\n <?php endforeach; ?>\n </fieldset>\n <p class=\"description\"><?php _e('form.sync.field.custom.more.help', 'mgrt-wordpress') ?></p>\n <?php\n }", "public function register()\n {\n // Invoke the base class save method to do any preparation work\n parent::save(\"\");\n \n /************ VALIDATION **************/\n $profile = new \\DataFilter\\Profile();\n \n // Set global validation checks\n $profile->addPreFilters(['Trim', 'StripHtml']);\n $profile->setAttribs($this->getValidationAttribs(true));\n \n // Perform validation checks\n if (!$profile->check($_POST)) {\n // The form is NOT valid.\n $message = \"Validation Error:\\n\";\n $res = $profile->getLastResult();\n foreach ($res->getAllErrors() as $error) {\n $message .= \"Err: $error\\n\";\n } \n \n // Send the validation errors back to the browser\n $this->result[\"message\"] = $message;\n $this->send();\n }\n \n // The form was valid. Get the validated and transformed data from the profile.\n $data = $profile->getLastResult()->getValidData();\n \n // If we're adding a new user, ensure this email address does NOT already exist\n $email = INPUT::post(\"email\");\n $users = $this->model->getList(array(\"email\" => $email));\n if(count($users) > 0) {\n $this->result[\"message\"] = \"Sorry, an account with this email address already exists\";\n $this->send(); \n }\n \n // Hash the password\n $this->model->hashPassword($data[\"password\"], $hashed_password, $salt);\n $data[\"password\"] = $hashed_password;\n $data[\"salt\"] = $salt;\n \n // Save the client record (if id = 0 then a new record will be created)\n $id = $this->model->save(0, $data);\n \n // If we're adding a new user, we also need to add the user role.\n // Tthe role is set as the DEFAULT user role which is MYNDIE_ROLE_MEMBER (id 2) as we can't allow\n // unsecure sources to add ADMIN user roles. \n\n // Load the user bean\n $user = $this->model->get($id);\n if(!$user) {\n $this->result[\"message\"] = \"Your account could not be created\";\n $this->send(); \n }\n \n // Create the default role.\n $objRole = new \\Myndie\\Model\\Role($this->app);\n $roleBean = $objRole->get(MYNDIE_DEFAULT_USER_ROLE);\n if(!$roleBean) {\n $this->result[\"message\"] = \"Default role is invalid\";\n $this->send(); \n }\n \n $user->sharedRole[] = $roleBean; // Users to Roles is a many to many relationship so we use a shared list.\n R::store($user);\n\n // Send the OK result back, along with the ID of the new user.\n $this->OK($id); \n }", "public function registerFields(){\n\t\t$this->registerFieldString('ApplicationName', 'App');\n\t\t$this->registerFieldString('type', 'Tipo');\n\t\t$this->registerFieldString('source', 'Fuente', false, false);\n\t\t$this->registerFieldInt('id_mdb_expmsg', 'ID de mensajes expresiones');\n\t\t$this->registerFieldString('desc_sol_comun', 'Descripción de la Solución Común', false, false);\n\t}", "public function register() {\n $next = $this->input->get('next');\n $data['next'] = $next;\n $data['title'] = translate('register');\n $this->load->view('front/register', $data);\n }", "function add(){\n global $wpdb;\n global $DOPBSP;\n \n $field_id = $_POST['field_id'];\n $position = $_POST['position'];\n $language = $_POST['language'];\n \n $wpdb->insert($DOPBSP->tables->forms_fields_options, array('field_id' => $field_id,\n 'position' => $position,\n 'translation' => $DOPBSP->classes->translation->encodeJSON('FORMS_FORM_FIELD_SELECT_ADD_OPTION_LABEL')));\n $id = $wpdb->insert_id;\n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $DOPBSP->views->backend_form_field_select_option->template(array('select_option' => $select_option,\n 'language' => $language));\n \n die();\n }", "public function registered()\n { \n $data = [\n 'judul_seminar' => $this->judul_seminar,\n 'nama_pembicara' => $this->nama_pembicara,\n 'tulisan_seminar' => $this->tulisan_seminar\n ];\n $this->load->view('seminar/form_registered', $data); \n }", "public static function custom_registration_fields()\n\t\t\t\t\t{\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_before_custom_registration_fields\", get_defined_vars());\n\n\t\t\t\t\t\t$_p = (!empty($_POST)) ? c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST)) : array();\n\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"ws_plugin__s2member_registration\" value=\"'.esc_attr(wp_create_nonce(\"ws-plugin--s2member-registration\")).'\" />'.\"\\n\";\n\n\t\t\t\t\t\t$tabindex = 20; // Incremented tabindex starting with 20.\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_password\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass1\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Password (please type it twice)\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass1\" id=\"ws-plugin--s2member-custom-reg-field-user-pass1\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass1\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass2\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass2\" id=\"ws-plugin--s2member-custom-reg-field-user-pass2\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass2\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<div id=\"ws-plugin--s2member-custom-reg-field-user-pass-strength\" class=\"ws-plugin--s2member-password-strength\"><em>'._x(\"password strength indicator\", \"s2member-front\", \"s2member\").'</em></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_names\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section\"></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-first-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"First Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_first_name\" id=\"ws-plugin--s2member-custom-reg-field-first-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_first_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-last-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Last Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_last_name\" id=\"ws-plugin--s2member-custom-reg-field-last-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_last_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"])\n\t\t\t\t\t\t\tif($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level(\"auto-detection\", \"registration\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tabindex = /* Start tabindex at +9 ( +1 below ). */ $tabindex + 9;\n\n\t\t\t\t\t\t\t\t\tforeach(json_decode($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"], true) as $field)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\t\t\t\tif /* Field applicable? */(in_array($field[\"id\"], $fields_applicable))\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$field_var = preg_replace(\"/[^a-z0-9]/i\", \"_\", strtolower($field[\"id\"]));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$field_id_class = preg_replace(\"/_/\", \"-\", $field_var);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(apply_filters(\"ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display\", true, get_defined_vars()))\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\tif /* Starts a new section? */(!empty($field[\"section\"]) && $field[\"section\"] === \"yes\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section'.((!empty($field[\"sectitle\"])) ? '-title' : '').'\">'.((!empty($field[\"sectitle\"])) ? $field[\"sectitle\"] : '').'</div>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-'.esc_attr($field_id_class).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<span'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? ' style=\"display:none;\"' : '').'>'.$field[\"label\"].(($field[\"required\"] === \"yes\") ? ' *' : '').'</span></label>'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? '' : '<br />').\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo c_ws_plugin__s2member_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, \"ws_plugin__s2member_custom_reg_field_\", \"ws-plugin--s2member-custom-reg-field-\", \"ws-plugin--s2member-custom-reg-field\", \"\", ($tabindex = $tabindex + 1), \"\", $_p, @$_p[\"ws_plugin__s2member_custom_reg_field_\".$field_var], \"registration\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\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\tunset($__refs, $__v);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\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\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] && c_ws_plugin__s2member_list_servers::list_servers_integrated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-opt-in\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"checkbox\" name=\"ws_plugin__s2member_custom_reg_field_opt_in\" id=\"ws-plugin--s2member-custom-reg-field-opt-in\" class=\"ws-plugin--s2member-custom-reg-field\" value=\"1\"'.(((empty($_p) && $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] == 1) || @$_p[\"ws_plugin__s2member_custom_reg_field_opt_in\"]) ? ' checked=\"checked\"' : '').' tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in_label\"].\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_after_custom_registration_fields\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t}", "public function registerAction() {\n $request = $this->getRequest();\n\n $fp = new Champs_Form_Account_Register($this->em);\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n if ($fp->process($request)) {\n $session = new Zend_Session_Namespace('registration');\n $session->user_id = $fp->user->id;\n $this->_redirect($this->getUrl('complete'));\n }\n }\n }\n\n // setup hash\n $this->initHash();\n // assign form to view\n $this->view->fp = $fp;\n }", "function vals_soc_form_user_register_form_alter_handler(&$form, &$form_state) {\n\n $q = explode(\"/\", $_GET['q']);\n $code = (isset($q[2])) ? $q[2] : '';\n\n $form['account']['fullname'] = array(\n \"#type\" => \"textfield\",\n \"#title\" => t(\"What is your full name?\"),\n //\"#options\" => $options_institutes,\n \"#description\" => t(\"(If you leave this empty, we will use your account name instead)\"),\n //\"#default_value\" => '',\n );\n $current_role = getRole();\n $no_administrator = ($current_role !== _ADMINISTRATOR_TYPE);\n\n if (!$no_administrator) {\n //If the admin adds users directly we do not want the following fields as these are already\n //provided in one or another way\n\n $form['account']['account_type'] = array(\n \"#type\" => \"select\",\n \"#title\" => t(\"What is your role\"),\n \"#options\" => array(\n _STUDENT_TYPE => t(\"Student\"),\n _SUPERVISOR_TYPE => t(\"Supervisor\"),\n _MENTOR_TYPE => t(\"Mentor\"),\n _ORGADMIN_TYPE => t('Organisation Administrator'),\n _INSTADMIN_TYPE => t('Institute Administrator'),\n _SOC_TYPE => t('Virtual Alliances Consortium member'),\n ),\n \"#description\" => t(\"Select your role in Semester of Code.\"),\n );\n\n $institutes = db_select('soc_institutes', 'i')->fields('i', array('inst_id', 'name'))->execute()->fetchAll(PDO::FETCH_ASSOC);\n $options_institutes = array(0 => t('Fill in later'));\n foreach ($institutes as $ins) {\n $options_institutes[$ins['inst_id']] = $ins['name'];\n }\n\n $form['account']['institute'] = array(\n \"#type\" => \"select\",\n \"#title\" => t(\"Select the institute you are in\"),\n \"#options\" => $options_institutes,\n \"#description\" => t(\"(for students and tutors only)\"),\n );\n\n $organisations = db_select('soc_organisations', 'o')->fields('o', array('org_id', 'name'))->execute()->fetchAll(PDO::FETCH_ASSOC);\n $options_organisation = array(0 => t('Fill in later'));\n foreach ($organisations as $org) {\n $options_organisation[$org['org_id']] = $org['name'];\n }\n\n $form['account']['organisation'] = array(\n \"#type\" => \"select\",\n \"#title\" => t(\"Select the organisation you are in\"),\n \"#options\" => $options_organisation,\n \"#description\" => t(\"(for organisation admins and mentors only)\"),\n );\n }\n $url_set_code = $code; //getRequestVar('c', '', 'get');\n if ($no_administrator) {\n //If the admin adds users directly we do not want the following fields as these are already \n //provided in one or another way\n $form['account']['account_key'] = array(\n \"#type\" => \"textfield\",\n \"#title\" => t(\"Type the key you got in the invitation\"),\n \"#size\" => 10,\n \"#description\" => t(\"This code is different per role.\"),\n \"#default_value\" => $url_set_code,\n );\n\n $default_language = language_default()->language;\n $languages = db_select('languages', 'l')->fields('l', array('language', 'native'))->execute()->fetchAll(PDO::FETCH_ASSOC);\n $options_lang = array();\n foreach ($languages as $lang) {\n $options_lang[$lang['language']] = $lang['native'];\n }\n\n $form['account']['language'] = array(\n \"#type\" => \"select\",\n \"#title\" => t(\"Select the language you want for Semester of Code\"),\n \"#options\" => $options_lang,\n \"#description\" => t(\"This will be the default language\"),\n \"#default_value\" => $default_language,\n );\n }\n\n $form['#submit'][] = 'vals_soc_form_user_register_form_submit_handler';\n $form['#validate'][] = 'vals_soc_form_user_register_form_validate_handler';\n return $form;\n}", "public function createfield(){\n \treturn view('field.create');\n }", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "public function register(){\n $user = Container::getModel('User');\n $user->__set('name',$_POST['name']);\n $user->__set('email',$_POST['email']);\n if(isset($_POST['password']) && $_POST['password'] != ''){\n $user->__set('password',md5($_POST['password'])); \n }\n\n //if the fields are correct\n if($user->validateRegister()){\n //if user doesn't alredy exist\n if(count($user->getUserByEmail()) == 0){\n //success\n $user->save();\n $this->render('register');\n }else{\n //user does alredy exist\n $this->render('email_alredy_exists');\n }\n\n }else{\n //error if any of the fields are incorrect\n //this array will be use to auto-fill the fields\n $this->view->user = array(\n 'name' => $_POST['name'],\n 'email' => $_POST['email'],\n 'password' => $_POST['password']\n\n );\n $this->view->erroRegister = true;\n $this->render('inscreverse');\n }\n }", "private function AddNameField()\n {\n $name = 'Name';\n $this->AddField(Input::Text($name, $this->user->GetName()));\n $this->SetRequired($name);\n $this->AddValidator($name, DatabaseCount::UniqueField($this->user, 'Name'));\n }", "public function registerForm(): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n return $this->render('register.html.twig');\n }", "public function register_fields() {\n\t\t\tregister_setting( 'reading', 'maksimer_logged_in_front_page', 'esc_attr' );\n\t\t\tadd_settings_field(\n\t\t\t\t'maksimer_logged_in_front_page',\n\t\t\t\t'<label for=\"maksimer_logged_in_front_page\">' . __( 'Logged in front page' , 'maksimer_logged_in_front_page' ) . '</label>',\n\t\t\t\tarray( $this, 'field_output' ),\n\t\t\t\t'reading'\n\t\t\t);\n\t\t}", "public function mtii_utilities_admin_reg_form($operation) {\n if ('add-new-user' !== $operation) {\n return;\n }\n\n $gender = (!empty($_POST['gender'])) ? trim($_POST['gender']) : '';\n $phone_number = (!empty($_POST['phone_number'])) ? trim(intval($_POST['phone_number'])) : '';\n $state_city = (!empty($_POST['state_city'])) ? trim($_POST['state_city']) : '';\n ?>\n <h3><?php esc_html_e('Personal Information', 'mtii-utilities-josbiz'); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"gender\"><?php _e( 'Gender', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <select name=\"gender\" id=\"gender\" class=\"input\">\n <option value=\"<?php _e('', 'mtii-utilities-josbiz'); ?>\">Pick a Gender</option>\n <option value=\"<?php _e('Male', 'mtii-utilities-josbiz'); ?>\">Male</option>\n <option value=\"<?php _e('Female', 'mtii-utilities-josbiz'); ?>\">Female</option>\n </select>\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"phone_number\"><?php _e( 'Phone Number', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"number\" name=\"phone_number\" id=\"phone_number\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($phone_number)); ?>\" size=\"25\" />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"state_city\"><?php _e( 'State/City', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"text\" name=\"state_city\" id=\"state_city\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($state_city)); ?>\" size=\"25\" />\n </td>\n </tr>\n </table>\n <?php\n }", "function add_field($field, $value) \n {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "private function AddPasswordField()\n {\n $name = 'Password';\n \n $this->AddField(Input::Password($name));\n //Password needs contain lower case letter, upper case letter, and a digit\n //$validator = new RegExp('/((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]))/');\n //$this->AddValidator($name, $validator);\n $this->AddValidator($name, new StringLength(6, 20));\n if (Request::PostData('PasswordRepeat') || !$this->user->Exists())\n {\n $this->SetRequired($name);\n }\n }", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the\n // array, it will be overwritten.\n\n $this->fields[\"$field\"] = $value;\n }", "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 getAddForm();", "public function registerAction() {\n $form = $this->getForm();\n $request = $this->getRequest();\n if ($request->isPost()) {\n $post = $request->getPost();\n $form->setData($post);\n if($form->isValid()){\n $user = $post['user'];\n $property = $post['property'];\n \n $this->save($user, $property);\n }\n }\n $model = new ViewModel(array('form' => $form, 'type' => $regType));\n $model->setTemplate('eportal-user\\register\\\\' . $regType);\n return $model;\n }", "function display_add_field($recordid = 0, $formdata = NULL) {\n return $this->display_browse_field($recordid, 'addtemplate');\n }", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "function register_options_field($args) {\r\n\t\tadd_settings_field($args['id'], $args['title'], array(&$this, $args['type']), $this->page , $args['section'],$args\t);\r\n\t}", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function register(){\n\n\t\t$this->Login_model->register();\t\n\n\t}", "function bbloomer_add_name_woo_account_registration() {\r\n ?>\r\n \r\n <p class=\"form-row form-row-first\">\r\n <label for=\"reg_billing_first_name\"><?php _e( 'First name', 'woocommerce' ); ?> <span class=\"required\">*</span></label>\r\n <input type=\"text\" class=\"input-text\" name=\"billing_first_name\" id=\"reg_billing_first_name\" value=\"<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>\" />\r\n </p>\r\n \r\n <p class=\"form-row form-row-last\">\r\n <label for=\"reg_billing_last_name\"><?php _e( 'Last name', 'woocommerce' ); ?> <span class=\"required\">*</span></label>\r\n <input type=\"text\" class=\"input-text\" name=\"billing_last_name\" id=\"reg_billing_last_name\" value=\"<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>\" />\r\n </p>\r\n \r\n <div class=\"clear\"></div>\r\n \r\n <?php\r\n}", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n\n UserModel::register();\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "function addLevel()\n\t{\n\t\tglobal $tpl;\n\n\t\t$this->initLevelForm(\"create\");\n\t\t$tpl->setContent($this->form->getHTML());\n\t}", "public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}", "public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}", "public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}", "public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}", "public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}", "public function register_field($name)\n {\n $this->$name();\n }", "function ft_wp_user_register($user_id)\r\n{\r\n $role = ft_wp_get_wpuser_role($user_id);\r\n\r\n $formtools_account_id = \"\";\r\n if (!empty($role))\r\n {\r\n // now get the Form Tools account ID associated with this role type\r\n $access_level = \"formtoolsaccess__{$role}\";\r\n $formtools_account_id = get_option($access_level);\r\n }\r\n\r\n update_usermeta($user_id, 'form_tools_access', $formtools_account_id);\r\n}", "function add_additional_field($details) {\r\n\t\t$sql = \"INSERT INTO sys_man_additional_fields (field_name, field_type, field_placement, group_id) VALUES (?, ?, ?, ?)\";\r\n\t\t$data=array(\"$details->field_name\", \"$details->field_type\", \"$details->field_placement\", \"$details->group_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\treturn;\r\n\t}", "public function create_field() {\n\n return sprintf(\n '<input type=\"hidden\" id=\"%s\" name=\"%s\" value=\"%s\" />',\n esc_attr( $this->action ),\n esc_attr( $this->action ),\n esc_attr( (string) wp_create_nonce( $this->action ) )\n );\n\n }", "public static function register()\n\t{\n\t\tForm::extensionMethod('addTag', callback(__CLASS__, 'addTag'));\n\t}", "public function register() \n\t{\n $referer = isset($_GET['referer']) ? htmlentities($_GET['referer'], ENT_QUOTES) : '';\n\t\t\n\t\t$this->View->RenderMulti(['_templates/header','user/register']);\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['tarifForm']['save']->caption = 'Přidat';\r\n\t}", "public function registerAction() {\n $request = $this->getRequest();\n $plan = $request->get('plan', '25139');\n $entity = new CoolwayFestivales\\SafetyBundle\\Entity\\User();\n $form = $this->createForm(new CoolwayFestivales\\SafetyBundle\\Form\\UserType(), $entity);\n\n return $this->render('AppBundle:Backend:register.html.twig', array(\n 'form' => $form->createView(),\n 'error' => false,\n 'plan' => $plan\n ));\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function add_field( $name, $field ) {\n\n\t\t$this->custom_fields[ $name ] = $field;\n\n\t}", "public function xadmin_createfield() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$field_title = $args [1];\n\t\t$field_type = $args [2];\n\t\t\n\t\t/* Load Model */\n\t\t$field = $this->getModel ( 'field' );\n\t\t$this->session->returnto ( 'fields' );\n\t\t\n\t\t/* create the form */\n\t\t$field->createNewField ( $field_title, $field_type );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t$plug = Plugins_Fields::getInstance ();\n\t\t\n\t\t/* allow changes to be made by plugin */\n\t\t$plug->trigger ( 'onAfterCreateField', $field );\n\t\t\n\t\t/* allow changes to be made by plugin - extend schema of data table */\n\t\t$plug->trigger ( 'onAfterCreateField_ExtendDataTable', $field );\n\t\t\n\t\t$plug->trigger ( 'onAfterSaveNewField', $field );\n\t\t\n\t\t$this->setArguments ( array ($field->id ) );\n\t\t\n\t\t$this->_registry->setValue ( 'usedTabs', 1 );\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( '_editField' );\n\t}", "public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}", "function add(){\n\t\tredirect('auth/register');\t\t\n\t}", "protected function addElements() \n {\n \n // Add \"usuario\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nombre',\n 'options' => [\n 'label' => 'Usuario Adicional',\n ],\n ]);\n \n \n // Add \"telefono\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telefono',\n 'options' => [\n 'label' => 'Teléfono',\n ],\n ]);\n \n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email',\n 'options' => [\n 'label' => 'Mail',\n ],\n ]);\n \n // Add \"usuario\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'skype',\n 'options' => [\n 'label' => 'Skype',\n ],\n ]);\n \n // Add \"id\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'id',\n 'options' => [\n 'label' => 'id',\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\n }", "function RegistrationWithOpenIDForm() {\n\t\t$form = new Form($this, 'RegistrationWithOpenIDForm',\n \tnew FieldList(new TextField(\"OpenIDURL\", \"OpenID URL\", \"\", null)),\n\t\t\tnew FieldList(new FormAction(\"doregisterwithopenid\", _t('ForumMemberProfile.REGISTER','Register'))),\n\t\t\tnew RequiredFields(\"OpenIDURL\")\n\t\t);\n\n\t\treturn $form;\n\t}", "function junto_fb_register_fields_js() {\n\t?>\n\t$('#email').val('2');\n\tFB.getLoginStatus(function(response) {\n\t\tif (response.status === 'unknown')\n\t\t\treturn;\n\t\t//if (response.status === 'connected')\n\t\tFB.api('/me', function(response) {\n\t\t\t$('input[name=\"email\"]').val(response.email);\n\t\t\t$('input[name=\"email\"]').disabled=true;\n\t\t\t$('input[name=\"first-name\"]').val(response.first_name);\n\t\t\t$('input[name=\"last-name\"]').val(response.last_name);\n\t\t\t$('input[name=\"website\"]').val(response.user_website);\n\t\t});\n\t});\n\t<?php\n}", "function display_add() {\n $this->_addform->display();\n }", "function newRegister(){\n $this->view->render('alumno/newRegister');\n }", "protected function addFormFieldNamesToViewHelperVariableContainer() {}", "public function register()\n {\n add_meta_box($this->id, $this->title, array( $this, 'render' ), $this->screens );\n }", "function gtags_add_tags_form() {\n\tglobal $show_group_add_form;\n\tif ($show_group_add_form) return;\n\t$show_group_add_form = true;\n\t?>\n\t<p class=\"editfield\">\n\t\t<label for=\"group-tags\">Mots-clés</label>\n\t\t<input type=\"text\" name=\"group-tags\" id=\"group-tags\" value=\"<?php gtags_group_tags() ?>\" />\n\t\tSéparez les mots-clés par des virgules\n\t\t<?php gtags_show_tags_chooser(); ?>\n\t\t\n\t</p>\n\t<?php\n}", "public function AddField()\n {\n echo 'Создалась VirtualCategory - метод Field <hr>';\n }", "public function formLogin() {\n $this->view->addForm();\n }", "function external_url_taxonomy_add_new_meta_field() {\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[custom_term_meta]\"><?php _e( 'External URL:', 'external_url' ); ?></label>\n <input type=\"text\" name=\"term_meta[custom_term_meta]\" id=\"term_meta[custom_term_meta]\" value=\"\">\n <p class=\"description\"><?php _e( 'Enter a value for this field','external_url' ); ?></p>\n </div>\n<?php\n}", "private\n\t\tfunction add_field(\n\t\t\t$key, $title, $description, $type, $section, $required = true\n\t\t) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key,\n\t\t\t\t$title,\n\t\t\t\tarray( $this, 'render_' . $type ),\n\t\t\t\tself::LINKID_SETTINGS_PAGE_ID,\n\t\t\t\t$section,\n\t\t\t\tarray(\n\t\t\t\t\t'key' => $key,\n\t\t\t\t\t'description' => $description,\n\t\t\t\t\t'required' => $required\n\t\t\t\t)\n\t\t\t);\n\n\t\t}", "public function register()\n\t{\n\t \t$this->load->library('form_validation');\n\t \t$this->load->helper('security');\n\t \t$this->form_validation->set_rules('siape', 'Siape', \n\t \t\t'trim|required|xss_clean|max_length[8]|is_unique[tb_professor.siape]',\n\t \t\tarray('is_unique' => 'Siape já cadastrado'));\n\t \t$this->form_validation->set_rules('nome', 'Nome', 'trim|required|xss_clean');//call_back_checar repetição\n\t \t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|is_unique[tb_professor.email]',\n\t \t\tarray('is_unique' => 'E-mail já cadastrado'));\n\t \t$this->form_validation->set_rules('senha', 'Password', 'trim|required|xss_clean|matches[confirmasenha]',\n\t \t\tarray('matches' => 'Confirmação de senha inválida' ));\n\t \t$this->form_validation->set_rules('confirmasenha', 'CPassword', 'trim|required|xss_clean');\n\n\t \tif($this->form_validation->run() == FALSE)\n\t \t{ \n\t \t\t$data['register_tab'] = 'active';\n\t \t\t$data['login_tab'] = 'inactive';\n\t \t$this->load->view('login/login.php', $data);\n\t \t}\n\t \telse\n\t \t{ \n\t \t$this->insert_professor();\n\t \tredirect('login', 'refresh');\n\t \t}\n\t}", "public function register() {\r\n $data['divisions'] = $this->cms_model->get_data('divisions');\r\n $data['role'] = $this->cms_model->get_data('role');\r\n\r\n $this->load->view('font_end/includes/header', $this->data);\r\n $this->load->view('font_end/register', $data);\r\n $this->load->view('font_end/includes/footer');\r\n }" ]
[ "0.75753456", "0.74725765", "0.728612", "0.72533625", "0.7076673", "0.69894", "0.69659483", "0.68555033", "0.6801537", "0.6768168", "0.6503087", "0.6460507", "0.6444193", "0.6399711", "0.6399711", "0.6390212", "0.6364882", "0.63470316", "0.6338419", "0.6320897", "0.632048", "0.63021386", "0.62701935", "0.62688696", "0.6219534", "0.6218152", "0.62027067", "0.62025666", "0.6198277", "0.61791015", "0.61669815", "0.6160722", "0.61606693", "0.61602604", "0.6156095", "0.61534137", "0.613668", "0.61321187", "0.6118032", "0.61166734", "0.61160314", "0.61142015", "0.60915756", "0.60824496", "0.60821456", "0.60717684", "0.6065893", "0.60615414", "0.60554385", "0.6055433", "0.60283655", "0.6023971", "0.60232455", "0.601954", "0.6003932", "0.6002186", "0.5991407", "0.59870493", "0.5979112", "0.5972357", "0.5969396", "0.59669775", "0.5966527", "0.5964303", "0.5964227", "0.5964227", "0.59520227", "0.59503984", "0.5949264", "0.5947688", "0.5947688", "0.5947688", "0.5947688", "0.5947688", "0.5938138", "0.59371305", "0.5936887", "0.59333163", "0.5931205", "0.59301656", "0.59270525", "0.5926801", "0.59235775", "0.5923426", "0.5920492", "0.5918788", "0.59067845", "0.5886839", "0.58855677", "0.58853614", "0.5870333", "0.5870315", "0.58637744", "0.58611745", "0.5860899", "0.5850221", "0.5840917", "0.5840312", "0.5839319", "0.58377665", "0.5834264" ]
0.0
-1
here we process request and decide if it should just goto botapi
public function processChat(Request $request) { $userInput = strtolower($request->input('say')); //if it's direction request if (strchr(strtoupper($userInput),'FROM') && strchr(strtoupper($userInput),'TO')) { $response['key'] = 'direction'; $data = BotModel::getDirections($userInput); } //if it's a dictionary request elseif(strpos($userInput, 'define') !== false) { $response['key'] = 'definition'; $data = BotModel::getDefinitions($userInput); } //if it's a job request elseif(strpos($userInput, 'job') !== false) { $response['key'] = 'job'; $pieces = explode(" ", $userInput); $location = false; if(strpos($userInput, 'in') !== false) { $location = $pieces[array_search('in', $pieces) + 1]; } $keyword = false; if(strpos($userInput, 'need') !== false) { $keyword = $pieces[array_search('need', $pieces) + 1]; if(strpos($keyword, 'job') !== false) { $keyword = false; } } $number = preg_replace('/\D/', '', $userInput); $limit = is_numeric($number) ? $number : 5; $url = $this->jobURL."?keyword=$keyword&location=$location&limit=5"; $res = UtilitiesModel::getWebPage($url); $res = json_decode($res); $jobs = false; foreach($res as $datum) { $jobs .= '<p><b>'.$datum->title.' ('.$datum->location.')</b><br>'.implode(' ', array_slice(explode(' ', $datum->summary), 0, 10)).' <a target="_blank" href="'.$datum->url.'">view</a></p><br>'; } if(!$jobs) { $data = "I didn't find any jobs."; if($keyword) { Log::info("Found keyword $keyword and $location"); $data .= " Kindly provide your email address so I can alert you when I find $keyword jobs " . (($location) ? 'in ' . $location.' ' : false) . "for you."; $this->cache['location'] = $location; $this->cache['keyword'] = $keyword; $this->cache['awaiting_email_response'] = true; Cache::put($this->convoId, $this->cache, 2); } } else { $data = $jobs; } } elseif($this->cache['awaiting_email_response'] && $email = UtilitiesModel::getEmail($userInput)) { $this->cache['awaiting_email_response'] = false; $this->cache['awaiting_email_validation'] = true; $this->cache['email'] = $email; Cache::put($this->convoId, $this->cache, 2); $data = "Should I save your email as $email?"; } elseif($this->cache['awaiting_email_validation']) { if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) { $data = "I will send emails to ".$this->cache['email']." when I find ".$this->cache['keyword']." jobs"; $data .= $this->cache['location'] ? " in ".$this->cache['location'] : ""; $this->cache['awaiting_email_validation'] = false; $this->cache['awaiting_whatsapp_response'] = true; $data .= ". Kindly provide your whatsapp number so I can alert you when I find {$this->cache['keyword']} jobs"; $data .= $this->cache['location'] ? " in ".$this->cache['location'] : ''; Cache::put($this->convoId, $this->cache, 2); UtilitiesModel::getWebPage($this->subscribeUrl, $this->cache); } else { Cache::forget($this->convoId); $data = $this->botResponse($userInput); } } elseif($this->cache['awaiting_whatsapp_response'] && $whatsapp = UtilitiesModel::validatePhone($userInput)) { $this->cache['awaiting_whatsapp_response'] = false; $this->cache['awaiting_whatsapp_validation'] = true; $this->cache['whatsapp'] = $whatsapp; Cache::put($this->convoId, $this->cache, 2); $data = "Should I save your whatsapp number as $whatsapp?"; } elseif($this->cache['awaiting_whatsapp_validation']) { if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) { $data = "I will send messages to ".$this->cache['whatsapp']." when I find ".$this->cache['keyword']." jobs"; $data .= $this->cache['location'] ? " in ".$this->cache['location'] : ""; $this->cache['awaiting_whatsapp_validation'] = false; $this->cache['awaiting_telegram_response'] = true; // $data .= ". Kindly provide your telegram number so I can alert you when I find {$this->cache['keyword']} jobs"; // $data .= $this->cache['location'] ? " in ".$this->cache['location'] : ''; UtilitiesModel::getWebPage($this->subscribeUrl, $this->cache); } else { Cache::forget($this->convoId); $data = $this->botResponse($userInput); } } elseif($this->cache['awaiting_telegram_response'] && $telegram = UtilitiesModel::validatePhone($userInput)) { $this->cache['awaiting_telegram_response'] = false; $this->cache['awaiting_telegram_validation'] = true; $this->cache['telegram'] = $telegram; Cache::put($this->convoId, $this->cache, 2); $data = "Should I save your telegram number as $telegram?"; } elseif($this->cache['awaiting_telegram_validation']) { if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) { $data = "I will send messages to ".$this->cache['telegram']." when I find ".$this->cache['keyword']." jobs"; $data .= $this->cache['location'] ? " in ".$this->cache['location'] : ""; Cache::put($this->convoId, $this->cache, 2); } else { Cache::forget($this->convoId); $data = $this->botResponse($userInput); } } //if it's none elseif($userInput == 'clear') { DB::table('conversation_log')->where('convo_id', request('convo_id'))->delete(); $data = "Now we can have a fresh start!"; } else { $data = $this->botResponse($userInput); } $response['status'] = true; $response['message'] = $data; return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function do_api_request();", "public function sniff_requests() {\r\n global $wp;\r\n\r\n if(isset($wp->query_vars['__api'])){\r\n $this->handle_request();\r\n exit;\r\n }\r\n }", "abstract public function handle_request();", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "function zg_ai_web_request($bot, string $screen, $arg1 = '') {\n global $game, $base_url;\n\n $uri = $base_url . \"/$game/$screen/{$bot->phone_id}\";\n if (strlen($arg1)) {\n $uri .= \"/$arg1\";\n }\n\n// if (($screen != 'home') &&\n// ($screen != 'debates_challenge') &&\n// ($screen != 'land')) {\n $ai_out = \"web-req: $screen/{$bot->phone_id}/$arg1\";\n// }\n\n $response = file_get_contents($uri);\n $ai_response_start = strpos($response, \"\\n<ai \") + 5;\n\n if ($ai_response_start > 5) {\n $ai_response_end = strpos($response, \"/>\\n\", $ai_response_start);\n $ai_response = trim(substr($response, $ai_response_start,\n $ai_response_end - $ai_response_start));\n }\n else {\n $ai_response = $response;\n }\n\n if (($screen != 'home')) {\n// ($screen != 'land-o')) {\n zg_ai_out($ai_out . \", response: $ai_response\");\n }\n\n return zg_ai_data_type([\n trim(str_replace('\"', '', $ai_response))\n ]);\n}", "function handleRequest() ;", "function canHandleRequest() ;", "function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function handleRequest() {}", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['request'])));\n if ((int) method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('', 404); // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi() {\n $request = $this->_request['request'];\n $values = $this->_request;\n\n // WARNING: This method needs to add some ways to authenticate the user\n // and should also filter out any dangerous or magic methods before it\n // would be safe. This code is for demonstration purposes only!\n\n if (method_exists($this->database, $request)) {\n if (!empty($_REQUEST['request'])) {\n unset($values['request']);\n $result = $this->database->processRequest($request, $values);\n if (!empty($result)) {\n $this->response($this->json($result), 200);\n }\n else {\n // If no records \"No Content\" status\n $this->response('',204);\n }\n }\n else {\n // If the method not exist with in this class, response would be \"Page not found\".\n $this->response('',404);\n }\n }\n }", "public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}", "abstract public function request();", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }", "protected abstract function handleRequest();", "public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }", "public function runRequest() {\n }", "public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }", "public static function process_http_request()\n {\n }", "abstract public function processRequest();", "public function processApi()\n {\n $data = array('404'=>'requested method not available');\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response($this->json($data),'404');\n // If the method not exist with in this class, response would be \"Page not found\".\n }", "protected function isBotRequest() {\n return (\n isset($_SERVER['HTTP_USER_AGENT'])\n && preg_match('/bot|crawl|slurp|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT'])\n );\n }", "function zg_ai_quest($bot, $quest) {\n return zg_ai_goals_type([\n ['web request', 'quests_do', $quest],\n ]);\n\n $ai_response = zg_ai_web_request($ai_id, 'quests_do', $quest);\n\n if ($ai_response == 'quest-succeeded') {\n return TRUE;\n }\n\n zg_ai_out('FIXME: Quest failed!!! What to do?');\n $response_array = explode(' ', $ai_response);\n\n foreach ($response_array as $response) {\n\n if ($response == 'quest-failed') {\n continue;\n }\n elseif (strpos($response, 'need-staff-') === 0) {\n\n $staff_to_get = substr($response, 11);\n zg_ai_out(\"Trying to get Staff #$staff_to_get\");\n\n // See if there is a quest that will loot that staff.\n $sql = 'select id, name from quests\n where fkey_loot_staff_id = %d\n order by rand() limit 1;';\n $result = db_query($sql, $staff_to_get);\n $item = db_fetch_object($result);\n\n if (!empty($item->id)) {\n\n zg_ai_out(\"Quest #$item->id, $item->name has Staff #$staff_to_get; \" .\n 'doing it!');\n $worked = zg_ai_do('do quest', $ai_id, $item->id);\n // yes, call recursively.\n if ($worked) {\n return FALSE;\n }\n }\n\n // next, check to see if we can purchase item.\n zg_ai_out(\"Ok, seeing if we can purchase Staff #$staff_to_get\");\n zg_ai_do('purchase staff', $ai_id, $staff_to_get);\n return FALSE;\n }\n elseif (strpos($response, 'need-equipment-') === 0) {\n\n $eq_to_get = substr($response, 15);\n zg_ai_out(\"Trying to get Equipment #$eq_to_get\");\n\n // See if there is a quest that will loot that eq.\n $sql = 'select id, name from quests\n where fkey_loot_equipment_id = %d\n order by rand() limit 1;';\n $result = db_query($sql, $eq_to_get);\n $item = db_fetch_object($result);\n\n if (!empty($item->id)) {\n\n zg_ai_out(\"Quest #$item->id, $item->name has Equipment #$eq_to_get; \" .\n 'doing it!');\n $worked = zg_ai_do('do quest', $ai_id, $item->id);\n\n // Yes, call recursively.\n if ($worked) {\n return FALSE;\n }\n\n // This quest may have succeeded, but goal failed.\n }\n\n // Next, check to see if we can purchase item.\n zg_ai_out(\"Ok, seeing if we can purchase Equipment #$eq_to_get\");\n zg_ai_do('purchase equipment', $ai_id, $eq_to_get);\n return FALSE;\n }\n }\n\n zg_ai_out('FIXME: Not doing anything -- giving up!!!');\n return FALSE;\n}", "public function processApi(){\n\t\t\t$func = explode('/', trim($_SERVER['PATH_INFO'],'/'))[0];\n\n\t\t\t$good = false;\n\t\t\tforeach ($this->AUTHORIZED_FUNCTION as $authorizedFunc){\n\t\t\t\tif($authorizedFunc == $func){\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! $good) $this->response('', 404);\n\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->sendMessage('', 404);\n\t\t}", "public function run_request() {\r\n\t\t// Do nothing if we don't\r\n\t\tif ( empty( $_GET['wpmudev-hub'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\t$this->register_internal_actions();\r\n\t\t$this->register_plugin_actions();\r\n\r\n\t\t//get the json\r\n\t\t$raw_json = file_get_contents( 'php://input' );\r\n\r\n\t\t$this->validate_hash( $_GET['wpmudev-hub'], $raw_json );\r\n\r\n\t\t$body = json_decode( $raw_json );\r\n\t\tif ( ! isset( $body->action ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"action\" parameter is missing' ) );\r\n\t\t}\r\n\t\tif ( ! isset( $body->params ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"params\" object is missing' ) );\r\n\t\t}\r\n\r\n\t\tif ( isset( $this->actions[ $body->action ] ) ) {\r\n\t\t\t$this->current_action = $body->action;\r\n\r\n\t\t\t//log it if turned on\r\n\t\t\tif ( WPMUDEV_API_DEBUG ) {\r\n\t\t\t\t$this->timer = microtime( true ); //start the timer\r\n\t\t\t\t$log = '[Hub API call] %s %s';\r\n\t\t\t\t$log .= \"\\n Request params: %s\\n\";\r\n\r\n\t\t\t\t$msg = sprintf(\r\n\t\t\t\t\t$log,\r\n\t\t\t\t\t$_GET['wpmudev-hub'],\r\n\t\t\t\t\t$body->action,\r\n\t\t\t\t\tjson_encode( $body->params, JSON_PRETTY_PRINT )\r\n\t\t\t\t);\r\n\t\t\t\terror_log( $msg );\r\n\t\t\t}\r\n\r\n\t\t\tcall_user_func( $this->actions[ $body->action ], $body->params, $body->action, $this );\r\n\r\n\t\t\t$this->send_json_success(); //send success in case the callback didn't respond\r\n\t\t}\r\n\r\n\t\t// When the callback function did not send a response assume error.\r\n\t\twp_send_json_error( array(\r\n\t\t\t'code' => 'unregistered_action', 'message' => 'This action is not registered. The required plugin is not installed, updated, or configured properly.'\r\n\t\t) );\r\n\t}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function handleHttpRequest() {\r\n\t\t\r\n\t\t// starttime\r\n\t\t$time_start = microtime(true);\r\n\t\t\r\n\t\t// create new Session if the client doesn't have one\r\n\t\tif( session_id() == null ) session_start();\r\n\r\n\t\t$result = array();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// get version on empty request \r\n\t\t\tif( ( $_GET == null && $_POST == null ) /* || ( $_POST == null && $_POST == null ) */ ) {\r\n\r\n\t\t\t\t// no parameters given, just return the version number\r\n $initial = 'BiotoPi API ' . 'v1 '; // Helper::getVersion();\r\n\t\t\t\t$result['data'] = $initial;\r\n\t\t\t\t$result['state'] = true;\r\n\r\n\t\t\t\t// TODO, $_REQUEST is never empty, use $_POST & $_GET instead!!\r\n\t\t\t} else if( isset( $_GET ) || isset( $_POST ) /* && $_REQUEST != \"\" */ ) {\r\n\r\n\t\t\t\tif( ENV == 'prod' && isset( $_REQUEST['tk'] ) && $_REQUEST['tk'] !== null ) {\r\n\r\n\t\t\t\t\t// only allowed requests in productive enviroments with right token\r\n\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t$sitetk = Config::get( 'token' );\r\n\t\t\t\t\t$unpack = unpack( 'H*', $sitetk );\r\n\t\t\t\t\tif( $tk != strtotime( date( 'd.m.Y H:i:00' ) ) . array_shift( $unpack ) ) throw new Exception( \"Wrong token! \" );\r\n\t\t\t\t\t//\t\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t//\t\t\t\t\t\tif( $tk != Config::get( 'token' ) ) throw new Exception( \"Wrong token!\" ); // , $_SESSION['site'] \r\n\r\n\t\t\t\t} else if( ENV == 'prod' && ( ! isset( $_SESSION['eingeloggt'] ) || $_SESSION['eingeloggt'] != 1 ) ) {\r\n\r\n // we need a Users Backend and Frontend\r\n // Login, Register (contains send E-Mail with tokenized Link)\r\n // Overview for Admins (we need also Groups for this: Admin and User should be enough) \r\n\r\n\t\t\t\t\t// unauthorized requests redirect or notify?\r\n // if( Config::get( 'apiredirect' ) ) {\r\n // // Redirect to loginpage\r\n // header ( \"Location: ./mgmt\" );\r\n // } else {\r\n\t\t\t\t\t\t// Returns a Message\r\n throw new Exception( 'Please login to use this service!' );\r\n // }\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// get our controller and action names \r\n\t\t\t\t$controllerName = isset( $_REQUEST['controller'] ) ? $_REQUEST['controller'] : null;\r\n\t\t\t\t$actionName = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;\r\n\r\n\t\t\t\tif( $controllerName === null ) throw new Exception( 'No Controller given, aborted!' );\r\n\t\t\t\tif( $actionName === null ) throw new Exception( 'No Action given, aborted!' );\r\n\r\n\t\t\t\t// Controller allways are lowercase only the first Character is Uppercase\r\n\t\t\t\t// $controllerName = ucfirst( strtolower( $controllerName ) );\r\n $controllerName = ucfirst( $controllerName );\r\n\r\n\t\t\t\t// use PHP reflectionAPI to get result\r\n\t\t\t\t$controller = self::createController( $controllerName );\r\n\t\t\t\t$response = self::callMethod( $controller, $actionName );\r\n\r\n\t\t\t\t// return result into data and set succes true\r\n\t\t\t\t$result['state'] = true;\r\n\t\t\t\t$result['data'] = $response;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch( Exception $e ) {\r\n\t\t\t// catch any exceptions, set success false and report the problem\r\n\t\t\t$result['state'] = false;\r\n\t\t\t$result['errormsg'] = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif( isset($_GET['debug']) && $_GET['debug'] === \"1\" ) {\r\n\t\t\t$result['time'] = round( ( microtime(true) - $time_start ), 3 );\r\n\t\t\techo \"<pre>\";\r\n\t\t\tprint_r( $result );\r\n\t\t\t//var_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t} else if ( $result ) {\r\n // if( $result['data'] === $initial ) {\r\n // // we are on an initial request\r\n // }\r\n // return our json encoded result to the requester\r\n header( 'Cache-Control: no-cache, must-revalidate' );\r\n\t\t\theader( \"Access-Control-Allow-Origin: *\" );\r\n\t\t\theader( \"Content-Type: application/json charset=UTF-8\" );\r\n\t\t\tprint_r( json_encode( $result ) );\r\n\t\t} else {\r\n\t\t\techo \"<pre>\";\r\n\t\t\tvar_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t}\r\n\r\n\t\tsession_write_close();\r\n\r\n\t\t// // redirect to last destination as form fallback on no js.\r\n\t\t// if( isset( $_REQUEST['redirect'] ) ) {\r\n\t\t// \theader ( \"Location: \" . $_REQUEST['redirect'] );\r\n\t\t// }\r\n\r\n\t}", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function check_response() {\n\n\t\t// To test in live mode ($_post)\n\t\t$post = ( file_get_contents( 'php://input' ) );\n\n\t\tif ( ! empty( $post ) ) {\n\t\t\tdo_action( 'valid-oyst-one-click-request', $post );\n\t\t\texit;\n\t\t}\n\t\tWC_Oyst_One_Click::log( 'Retour One Click vide', 'error' );\n\t\twp_die( 'Erreur de requête One Click', '1-Click', array( 'response' => 500 ) );\n\n\t}", "public function processApi() {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n $this->response('Method not Found', 404); // If the method not exist with in this class, response would be \"Page not found\".*/\n\t}\n\n }", "public function processApi(){\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t$this->$func();\n\t\telse\n\t\t\t$this->response('',404);\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "function endpoint_trigger_check() {\n\t\tif ( intval( get_query_var( 'pt_endpoint' ) ) == 1 ) {\n\t\t\t//do our plugin endpoint code\n\t\t\tob_start();\n\t\t\t$this->process_request();\n\t\t\texit();\n\t\t}\n\t}", "public function proccess(){\n\t\t#Get endpoint params\n\t\t$endpointParams = $this->getEndpointParams();\n\t\t#Check if endpoint was read\n\t\tif($endpointParams == []) return [\"success\" => 0, \"msg\" => \"The requested endpoint ({$this->endpointURL}) didn't match any expected command. Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t#Get current command (the first part of endpoint) and also removes it from the arguments array\n\t\t$currentCommand = array_shift($endpointParams);\n\t\t#Execute command and return output\n\t\tswitch ($currentCommand) {\n\t\t\t#List upcoming movies\n\t\t\tcase 'upcoming': return $this->retrieveUpcomingMovies($endpointParams);\n\t\t\t#Get movie info\n\t\t\tcase 'movie': return $this->retrieveMovie($endpointParams);\n\t\t\t#Search for movies using terms\n\t\t\tcase 'search': return $this->retrieveSearch($endpointParams);\n\t\t\t#Fallback\n\t\t\tdefault: return [\"success\" => 0, \"msg\" => \"The command '{$currentCommand}' is unknown! Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t}\n\t}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "function mks_handle_request() {\n if (isset($_POST['mks_action'])) {\n switch ($_POST['mks_action']) {\n case 'api_settings';\n verify_api();\n break;\n }\n }\n}", "private function _checkRequestType()\n\t{\n\t\tif ($this->_checkedRequestType)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's a token in the query string, then that should take precedence over everything else\n\t\tif (!$this->getQuery(craft()->config->get('tokenParam')))\n\t\t{\n\t\t\t$firstSegment = $this->getSegment(1);\n\n\t\t\t// Is this a resource request?\n\t\t\tif ($firstSegment == craft()->config->getResourceTrigger())\n\t\t\t{\n\t\t\t\t$this->_isResourceRequest = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Is this an action request?\n\t\t\t\tif ($this->_isCpRequest)\n\t\t\t\t{\n\t\t\t\t\t$loginPath = craft()->config->getCpLoginPath();\n\t\t\t\t\t$logoutPath = craft()->config->getCpLogoutPath();\n\t\t\t\t\t$setPasswordPath = craft()->config->getCpSetPasswordPath();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loginPath = trim(craft()->config->getLocalized('loginPath'), '/');\n\t\t\t\t\t$logoutPath = trim(craft()->config->getLocalized('logoutPath'), '/');\n\t\t\t\t\t$setPasswordPath = trim(craft()->config->getLocalized('setPasswordPath'), '/');\n\t\t\t\t}\n\n\t\t\t\t$verifyEmailPath = 'verifyemail';\n\n\t\t\t\tif (\n\t\t\t\t\t($triggerMatch = ($firstSegment == craft()->config->get('actionTrigger') && count($this->_segments) > 1)) ||\n\t\t\t\t\t($actionParam = $this->getParam('action')) !== null ||\n\t\t\t\t\t($specialPath = in_array($this->_path, array($loginPath, $logoutPath, $setPasswordPath, $verifyEmailPath)))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$this->_isActionRequest = true;\n\n\t\t\t\t\tif ($triggerMatch)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_actionSegments = array_slice($this->_segments, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse if ($actionParam)\n\t\t\t\t\t{\n\t\t\t\t\t\t$actionParam = $this->decodePathInfo($actionParam);\n\t\t\t\t\t\t$this->_actionSegments = array_filter(explode('/', $actionParam));\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 ($this->_path == $loginPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'login');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($this->_path == $logoutPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'logout');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($this->_path == $verifyEmailPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'verifyemail');\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$this->_actionSegments = array('users', 'setpassword');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->_checkedRequestType = true;\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "function _do_api_call($verb, $url, $data, &$result) { \n $api_key = elgg_get_plugin_setting('api_key', 'babelroom');\n $api_server = elgg_get_plugin_setting('api_server', 'babelroom');\n $server_url = $api_server.$url;\n $rc = false;\n\n if (!extension_loaded('curl'))\n return false;\n\n if (\n !(stripos(ini_get('disable_functions'), 'curl_init') !== FALSE) and\n ($ch = @curl_init($server_url)) !== false) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $verb); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n# curl_setopt($ch, CURLOPT_HEADER, false); -- for later reference\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, $api_key.':');\n if ($data) {\n $data_string = json_encode($data);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string)));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); \n }\n $tmp_result = curl_exec($ch);\n if (!curl_errno($ch)) {\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n if ($code>=200 and $code<=299) {\n $result = json_decode($tmp_result);\n $rc = true;\n }\n else {\n elgg_log(\"BRAPI error response code $code, [$server_url]\",'ERROR');\n }\n }\n else {\n elgg_log(\"BRAPI connect error [$server_url]\",'ERROR');\n }\n curl_close($ch);\n }\n else {\n elgg_log(\"BRAPI curl initialization error [$server_url]\",'ERROR');\n }\n\n return $rc;\n}", "public function processRequest();", "public abstract function processRequest();", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "public function processApi() {\r\n\tif($this->securedRest){\r\n\t if(!isset($this->requestSecure) || !isset($this->requestPublicKey)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t if(!$this->verifyKeys($this->requestPublicKey, $this->requestSecure)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t}\r\n\t\r\n\t$func = $this->_method;\r\n\tif ((int) method_exists($this, $func) > 0){\r\n\t $this->$func();\r\n\t}else{\r\n\t $this->response('', 404);\r\n\t}\r\n\t\r\n }", "function api_call(){\n\n\t\t$p = App::$cmd;\n\t\t$type = null;\n\n\t\tif(strrpos($p,'.')) {\n\t\t\t$type = substr($p,strrpos($p,'.')+1);\n\t\t\tif(strpos($type,'/') === false) {\n\t\t\t\t$p = substr($p,0,strrpos($p,'.'));\n\t\t\t\t// recalculate App argc,argv since we just extracted the type from it\n\t\t\t\tApp::$argv = explode('/',$p);\n\t\t\t\tApp::$argc = count(App::$argv);\n\t\t\t}\n\t\t}\n\n\t\tif((! $type) || (! in_array($type, [ 'json', 'xml', 'rss', 'as', 'atom' ])))\n\t\t\t$type = 'json';\n\n\t\t$info = \\Zotlabs\\Lib\\Api_router::find($p);\n\n\t\tif(in_array($type, [ 'rss', 'atom', 'as' ])) {\n\t\t\t// These types no longer supported.\n\t\t\t$info = false;\n\t\t}\n\n\t\tlogger('API info: ' . $p . ' type: ' . $type . ' ' . print_r($info,true), LOGGER_DEBUG,LOG_INFO);\n\n\t\tif($info) {\n\n\t\t\tif ($info['auth'] === true && api_user() === false) {\n\t\t\t\t\tapi_login($a);\n\t\t\t}\n\n\t\t\tload_contact_links(api_user());\n\n\t\t\t$channel = App::get_channel();\n\n\t\t\tlogger('API call for ' . $channel['channel_name'] . ': ' . App::$query_string);\n\t\t\tlogger('API parameters: ' . print_r($_REQUEST,true));\n\n\t\t\t$r = call_user_func($info['func'],$type);\n\n\t\t\tif($r === false) \n\t\t\t\treturn;\n\n\t\t\tswitch($type) {\n\t\t\t\tcase 'xml':\n\t\t\t\t\theader ('Content-Type: text/xml');\n\t\t\t\t\treturn $r; \n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\theader ('Content-Type: application/json');\n\t\t\t\t\t// Lookup JSONP to understand these lines. They provide cross-domain AJAX ability.\n\t\t\t\t\tif ($_GET['callback'])\n\t\t\t\t\t\t$r = $_GET['callback'] . '(' . $r . ')' ;\n\t\t\t\t\treturn $r; \n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\n\t\t$x = [ 'path' => App::$query_string ];\t\n\t\tcall_hooks('api_not_found',$x);\n\n\t\theader('HTTP/1.1 404 Not Found');\n\t\tlogger('API call not implemented: ' . App::$query_string . ' - ' . print_r($_REQUEST,true));\n\t\t$r = '<status><error>not implemented</error></status>';\n\t\tswitch($type){\n\t\t\tcase 'xml':\n\t\t\t\theader ('Content-Type: text/xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t\tcase \"json\":\n\t\t\t\theader ('Content-Type: application/json');\n\t\t\t return json_encode(array('error' => 'not implemented'));\n\t\t\t\tbreak;\n\t\t\tcase \"rss\":\n\t\t\t\theader ('Content-Type: application/rss+xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t\tcase \"atom\":\n\t\t\t\theader ('Content-Type: application/atom+xml');\n\t\t\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" . $r;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function match(Zend_Controller_Request_Http $request)\r\n {\r\n \tif (Mage::app()->getStore()->isAdmin()) {\r\n return false;\r\n }\r\n \r\n \t$pathInfo = $request->getPathInfo();\r\n // remove suffix if any\r\n $suffix = Mage::helper('amlanding/url')->getSuffix();\r\n if ($suffix && '/' != $suffix){\r\n $pathInfo = str_replace($suffix, '', $pathInfo);\r\n }\r\n \r\n $pathInfo = explode('/', trim($pathInfo, '/ '), 2);\r\n $identifier = $pathInfo[0];\r\n $params = (isset($pathInfo[1]) ? $pathInfo[1] : '');\r\n \r\n \r\n\t\t/* @var $page Amasty_Xlanding_Model_Page */\r\n $page = Mage::getModel('amlanding/page');\r\n $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());\r\n if (!$pageId) {\r\n return false;\r\n }\r\n \r\n\r\n $params = trim($params, '/ ');\r\n if ($params){\r\n $params = explode('/', $params);\r\n Mage::register('amshopby_current_params', $params);\r\n if ('true' == (string)Mage::getConfig()->getNode('modules/Amasty_Shopby/active')){\r\n $parsed = Mage::helper('amshopby/url')->saveParams($request);\r\n if (!$parsed && !Mage::registry('amshopby_short_parsed')) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n $request->setModuleName('amlanding')\r\n ->setControllerName('page')\r\n ->setActionName('view')\r\n ->setParam('page_id', $pageId)\r\n ->setParam('am_landing', $identifier)\r\n ;\r\n \r\n return true;\r\n }", "function awaiting_trigger_check() {\n\t\tif(intval(get_query_var('lepress-student-awaiting')) == 1) {\n\t\t\t//WP default header is 404, have to override it\n\t\t\theader(\"HTTP/1.0 200 OK\");\n\t\t\tif(isSet($_GET['w'])) {\n\t\t\t\techo $this->getAwaitingBubble($_GET['w']);\n\t\t\t}\n\t\t\texit;\n\t\t}\n \t}", "public function canHandleRequest();", "public function canHandleRequest();", "function checkAPICall()\r\n{\r\n $request = [];\r\n $request['method'] = $_SERVER['REQUEST_METHOD'];\r\n $request['url'] = rtrim($_SERVER['REQUEST_URI'], '/');\r\n \r\n $trimmed_url = ltrim($_SERVER['REQUEST_URI'], '/');\r\n $url_parts = explode('/', $trimmed_url);\r\n\r\n $request['url_parts'] = $url_parts;\r\n\r\n if (in_array($_SERVER['REQUEST_METHOD'], ['POST', 'PUT'])) {\r\n $request['body'] = json_decode(file_get_contents('php://input'), true);\r\n }\r\n \r\n if ($url_parts[0] === 'api') {\r\n array_shift($url_parts);\r\n if (count($url_parts) >= 1) {\r\n $api_function_name = array_shift($url_parts);\r\n $params = $url_parts;\r\n $request['params'] = $params;\r\n array_unshift($params, $request);\r\n\r\n $request_uri = $request['method'] . ' /' . $api_function_name;\r\n if (array_key_exists($request_uri, API_FN)) {\r\n call_user_func_array(API_FN[$request_uri], $params);\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n die();\r\n }\r\n}", "public function waitForRequest()\n\t{\n\t\t$tools=&$GLOBALS['tools'];\n\t\t$result=null;\n\t\t$data=array(\"GET\"=>$tools->getEnvVars(\"GET\",true),\"POST\"=>$tools->getEnvVars(\"POST\",true),\"FILES\"=>$tools->getEnvVars(\"FILES\",false));\n\t\t$mod=(isset($data['module']))?$data['module']:$this->_default_module;\n\t\tif(false!==($protocol=(isset($data['GET']['protocol'])?$data['GET']['protocol']:(isset($data['POST']['protocol'])?$data['POST']['protocol']:$this->_default_protocol))) && is_numeric($protocol))\n\t\t{\n\t\t\t$env=($this->engines[$mod][$protocol]['environment'])?$this->engines[$mod][$protocol]['environment']:$this->_default_env;\n\t\t\tif($this->_registered($mod,$protocol))\n\t\t\t{\n\t\t\t\tif(false!==($env=$this->checkQSArguments($env,$mod,$protocol)))\n\t\t\t\t{\n\t\t\t\t\t$t=@include_once($this->getPath().'/'.$mod.'/init.php');\n\t\t\t\t\tif($t)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->checkAccessMode($mod,$protocol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$args=$this->getProtocolArgsNames($this->engines[$mod][$protocol]['keys'],$env);\n\t\t\t\t\t\t\t$result=$this->genResponse($this->callProtocol($mod,$protocol,$args),$this->registerQuery($mod,$protocol));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t\t\t\t\t$this->setError(\"Autostop inited; invalide protocol\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->setError(\"Autostop inited; undefined protocol was called\");\n\t\t\t$result=API_INVALIDE_PROTOCOL;\n\t\t}\n\t\treturn $result;\n\t}", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "protected function runLogic()\n {\n Logic::run($this->request); /* The logic to attempt to parse the request */\n }", "function awaiting_trigger_check() {\n\t\tif(intval(get_query_var('lepress-teacher-awaiting')) == 1) {\n\t\t\t//WP default header is 404, have to override it\n\t\t\theader(\"HTTP/1.0 200 OK\");\n\t\t\tif(isSet($_GET['w'])) {\n\t\t\t\techo $this->getAwaitingBubble($_GET['w']);\n\t\t\t}\n\t\t\texit;\n\t\t}\n \t}", "function tryURLForAPICall() {\n\tglobal $db;\n\t\n\t// pull the URL\n\t$url = $_SERVER['REQUEST_URI'];\n\t\n\t// pull it apart\n\t$urlParts = explode(\"/\",$url);\n\tarray_shift($urlParts); // shift off the empty space before the \"/\"\n\t\n\t// if there's something there\n\tif(count($urlParts)>1) {\n\t\t// check for URL processors, right now just the API URL processor that we're in right now\n\t\t// HACK: really this check & the code above should happen at a higher level. if we're inside this function we should only be handling API calls\n\t\t$foundProcessor = false;\n\t\t// loop through until a processor is found or we run out of URL parts\n\t\twhile(!$foundProcessor && count($urlParts)) {\n\t\t\t$processor = array_shift($urlParts);\n\t\t\t// is it a recognized processor?\n\t\t\tswitch($processor) {\n\t\t\t\tcase 'api':\n\t\t\t\t\t$foundProcessor=true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// if we found a processor & it's the API processor\n\t\tif($foundProcessor && $processor==\"api\") {\n\t\t\t// the next URL piece would be an API top-level category, eg \"user\"\n\t\t\t$apiCategory = array_shift($urlParts);\n\t\t\t$returnData = null;\n\t\t\t\n\t\t\t// switch on the API category\n\t\t\tswitch($apiCategory) {\n\t\t\t\t// all API calls pertaining to dailytests\n\t\t\t\tcase 'dailytests':\n\t\t\t\t\t// the base in this category, eg \"/dailytests\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// don't let them get a full list of all tests\n\t\t\t\t\t\t//$returnData = $db->doQueryArray(\"SELECT id FROM dailytests\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing as there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(count($urlParts)==1) {\n\t\t\t\t\t\t\t// if there's a 2nd piece we assume it's a dailytest ID\n\t\t\t\t\t\t\t$dailytestID = array_shift($urlParts); // shift off ID & save\n\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM dailytests WHERE id = %s\", $dailytestID);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// return this dailytest's data. there's currently no way to set ie change a dailytest (no POST handler)\n\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dailytests_status':\n\t\t\t\t\t// the base in this category, eg \"/dailytests_status\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// don't let them get a full list of all tests\n\t\t\t\t\t\t//$returnData = $db->doQueryArray(\"SELECT id FROM dailytests\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing as there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\t// there must be exactly 3 more pieces, as there are 3 keys to define a dailytest_status\n\t\t\t\t\t\tif(count($urlParts)==3) {\n\t\t\t\t\t\t\t$dailytestID = array_shift($urlParts); // shift off & save\n\t\t\t\t\t\t\t$userID = array_shift($urlParts); // shift off & save\n\t\t\t\t\t\t\t$day = array_shift($urlParts); // shift off & save\n\t\t\t\t\t\t\t// is this a GET (to read data) or a POST (to update data)\n\t\t\t\t\t\t\tswitch($_SERVER['REDIRECT_REQUEST_METHOD']) {\n\t\t\t\t\t\t\t\tcase \"GET\":\n\t\t\t\t\t\t\t\t\t// we are reading, so return this dailytest_status's data\n\t\t\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM dailytests_status WHERE dailytest_id = %s AND user_id=%s AND entered_at_day=%s\", $dailytestID, $userID, $day);\n\t\t\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase \"POST\":\n\t\t\t\t\t\t\t\t\t// this would set the dailytest_status's data\n\t\t\t\t\t\t\t\t\t// HACK: not finished yet\n\t\t\t\t\t\t\t\t\t//$rs = $db->doQuery(\"SELECT * FROM dailytests_status WHERE dailytest_id = %s AND user_id=%s AND entered_at_day=%s\", $dailytestID, $userID, $day);\n\t\t\t\t\t\t\t\t\t$returnData = serialize($_SERVER);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'goals':\n\t\t\t\t\t// the base in this category, eg \"/goals\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// allow them to grab a full list of goals\n\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM goals\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing if there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\t// grab the goal's ID & proceed\n\t\t\t\t\t\t$goalID = array_shift($urlParts);\n\t\t\t\t\t\t// if this is it, return everything about this goal\n\t\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM goals WHERE id = %s\", $goalID);\n\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// if the request is for an attribute of this goal, process that\n\t\t\t\t\t\t\t$attribute = array_shift($urlParts); // shift off attribute & save\n\t\t\t\t\t\t\tswitch($attribute) {\n\t\t\t\t\t\t\t\tcase 'stories':\n\t\t\t\t\t\t\t\t\t// return all stories associated with this goal\n\t\t\t\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM stories WHERE goal_id=%s\", $goalID);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'dailytests':\n\t\t\t\t\t\t\t\t\t// return all dailytests associated with this goal\n\t\t\t\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM dailytests WHERE goal_id=%s\", $goalID);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'goals_status':\n\t\t\t\t\t// the base in this category, eg \"goals_status\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// don't let them get a full list of all goals_status\n\t\t\t\t\t\t//$returnData = $db->doQueryArray(\"SELECT id FROM dailytests\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing if there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\t// there must be 2 more pieces to specify which goals_status to grab\n\t\t\t\t\t\tif(count($urlParts)==2) {\n\t\t\t\t\t\t\t$goalID = array_shift($urlParts); // shift off & save\n\t\t\t\t\t\t\t$userID = array_shift($urlParts); // shift off & save\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// pull the goal_status & return\n\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM goals_status WHERE goal_id = %s AND user_id=%s\", $goalID, $userID);\n\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'stories':\n\t\t\t\t\t// the base in this category, eg \"/stories\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// return a list of all recent stories\n\t\t\t\t\t\t// HACK: should ORDER BY for recency\n\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM stories LIMIT 100\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing if there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\t// grab the story ID\n\t\t\t\t\t\tif(count($urlParts)==1) {\n\t\t\t\t\t\t\t$storyID = array_shift($urlParts);\n\t\t\t\t\t\t\t// return story data\n\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM stories WHERE id = %s\", $storyID);\n\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'users':\n\t\t\t\t\t// base in this category, eg \"/users\"\n\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t// return a list of all users (eventually this should be turned off when big enough)\n\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM users\");\n\t\t\t\t\t}\n\t\t\t\t\t// do further processing if there are more pieces\n\t\t\t\t\telse {\n\t\t\t\t\t\t$userID = array_shift($urlParts); // shift off ID & save\n\t\t\t\t\t\t// if we just have a user ID, return the user data\n\t\t\t\t\t\tif(!count($urlParts)) {\n\t\t\t\t\t\t\t$rs = $db->doQuery(\"SELECT * FROM users WHERE id = %s\", $userID);\n\t\t\t\t\t\t\t$returnData = mysql_fetch_assoc($rs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if we have more, check for the attribute\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$attribute = array_shift($urlParts); // shift off attribute & save\n\t\t\t\t\t\t\tswitch($attribute) {\n\t\t\t\t\t\t\t\tcase 'stories':\n\t\t\t\t\t\t\t\t\t// return all stories associated with this user\n\t\t\t\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT id FROM stories WHERE user_id=%s\", $userID);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'goals':\n\t\t\t\t\t\t\t\t\t// return all goals associated with this user\n\t\t\t\t\t\t\t\t\t$returnData = $db->doQueryArray(\"SELECT goal_id FROM goals_status WHERE user_id=%s AND is_active = 1\", $userID);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// end script & return the data in JSON format\n\t\t\tdie(json_encode($returnData));\n\t\t}\n\t}\n\t\n\t// if we get here & didn't return JSON, the API call was invalid. exiting this handler will fall through to the 404 error on 404 page.\n}", "public function processRequest()\n {\n $params = json_decode(file_get_contents('php://input'),true);\n\n if ( $_POST [ 'action' ] == 'setScreenVars' )\n {\n $this->setScreenVars();\n\n } \n elseif ( $_POST [ 'action' ] == 'loadHero' )\n\n {\n $this->loadHero();\n\n } \n elseif ( $_POST [ 'action' ] == 'loadThumb' )\n\n {\n $this->loadThumb();\n\n } \n elseif ( $_POST [ 'action' ] == 'setScreenVars' )\n\n {\n $this->setScreenVars();\n }\n //this one sent from angular, use $params\n elseif ( $params [ 'action' ] == 'getSiteData' )\n {\n $this->getSiteData();\n }\n elseif ( $_POST [ 'action' ] == 'contactFormSubmit' )\n {\n $this->contactFormSubmit();\n }\n else \n {\n\n if ( $_SESSION['user']['access'] == '2' ) {\n if ( $_POST [ 'action' ] == 'sortUpdate' )\n {\n $this->sortUpdate();\n }\n elseif ( $_POST [ 'action' ] == 'imgStatusUpdate' )\n {\n $this->imgStatusUpdate();\n }\n elseif ( $_POST [ 'action' ] == 'deleteImage' )\n {\n $this->deleteImage();\n }\n elseif ( $_POST [ 'action' ] == 'saveCaption' )\n {\n $this->saveCaption();\n }\n }\n else \n {\n //no action requested, just notifify this file being accessed\n echo ( 'ajax file' );\n } \n }\n\n }", "public function processApi(){\n\t\t\t$piece = explode(\"/\", $_SERVER['REQUEST_URI']); \n\t\t\t$func = end($piece);\n\t\t\tif((int)method_exists($this,$func) > 0){\n\t\t\t\t$con = mysqli_connect(\"localhost\",\"root\",\"\",\"playlist\"); \n\t\t\t\t// Check connection\n\t\t\t\tif (mysqli_connect_errno()){\n\t\t\t\t echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t$this->$func($con); \n\t\t\t}else\n\t\t\t\t$this->response('',404);// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "private function firstStepRequests()\n\t{\n\t\t$fpwd_data = $this->timber->validator->clear(array(\n\t\t\t'fpwd_email' => array(\n \t\t\t\t'req' => 'post',\n \t'sanit' => 'semail',\n \t'valid' => 'vnotempty&vemail',\n \t'default' => '',\n \t'errors' => array(\n \t\t'vnotempty' => $this->timber->translator->trans('The email is invalid.'),\n \t\t'vemail' => $this->timber->translator->trans('The email is invalid.'),\n \t),\n\t\t\t),\n\t\t));\n\n\t\tif(true === $fpwd_data['error_status']){\n\t\t\t$this->response['data'] = $fpwd_data['error_text'];\n\t\t\treturn false;\n\t\t}\n\t\t$email = ($fpwd_data['fpwd_email']['status']) ? $fpwd_data['fpwd_email']['value'] : '';\n\n\t\t$user_data = $this->timber->user_model->getUserByMultiple( array('email' => $email, 'auth_by' => '1') );\n\n\t\tif( (false === $user_data) || !(is_object($user_data)) ){\n\t\t\t$this->response['data'] = $this->timber->translator->trans('The email is invalid.');\n\t\t\treturn false;\n\t\t}\n\n\t\t$user_data = $user_data->as_array();\n\n\t\t//delete old metas\n\t\t$this->timber->user_meta_model->dumpUserMeta( $user_data['us_id'], '_user_fpwd_hash' );\n\n\t\t//insert new one\n\t\t$hash = $this->timber->faker->randHash(20) . time();\n\t\t$meta_status = $this->timber->user_meta_model->addMeta(array(\n\t\t\t'us_id' => $user_data['us_id'],\n\t\t\t'me_key' => '_user_fpwd_hash',\n\t\t\t'me_value' => $hash,\n\t\t));\n\n\t\t# Run Now and don't run as a cron\n\t\t$message_status = $this->timber->notify->execMailerCron(array(\n\t\t\t'method_name' => 'fpwdEmailNotifier',\n\t\t\t'user_id' => $user_data['us_id'],\n\t\t\t'hash' => $hash,\n\t\t));\n\n\t\tif( $meta_status && $message_status ){\n\t\t\t$this->response['status'] = 'success';\n\t\t\t$this->response['data'] = $this->timber->translator->trans('Reset message sent successfully.');\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->response['data'] = $this->timber->translator->trans('Something goes wrong! We apologize. try again later.');\n\t\treturn false;\n\t}", "abstract protected function checkExistingResponse();", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public function processApi();", "public static function run() {\n\t\t// Validate user against spam blacklists\n\t\tif (PHP_SAPI!='cli' &&\n\t\t\tisset(self::$global['DNSBL']) && self::spam(self::realIP())) {\n\t\t\tif (isset($_global['SPAM']))\n\t\t\t\t// Spammer detected; Send to blackhole\n\t\t\t\tself::reroute($_global['SPAM']);\n\t\t\telse\n\t\t\t\t// HTTP 404 message\n\t\t\t\tself::http404();\n\t\t}\n\t\t// Process routes\n\t\tif (isset(self::$global['ROUTES'])) {\n\t\t\t$_found=FALSE;\n\t\t\tkrsort(self::$global['ROUTES']);\n\t\t\tforeach (self::$global['ROUTES'] as $_regex=>$_route) {\n\t\t\t\tif (!preg_match($_regex,$_SERVER['REQUEST_URI'],$_args))\n\t\t\t\t\tcontinue;\n\t\t\t\t$_found=TRUE;\n\t\t\t\t// Inspect each defined route\n\t\t\t\tforeach ($_route as $_method=>$_proc) {\n\t\t\t\t\tif ($_SERVER['REQUEST_METHOD']!=$_method)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t// Save named regex captures\n\t\t\t\t\tforeach ($_args as $_key=>$_arg)\n\t\t\t\t\t\tif (is_numeric($_key) && $_key)\n\t\t\t\t\t\t\tunset($_args[$_key]);\n\t\t\t\t\tself::$global['PARAMS']=$_args;\n\t\t\t\t\t// Default: Do not cache\n\t\t\t\t\tself::httpCache(0);\n\t\t\t\t\t// Save the current time\n\t\t\t\t\t$_time=time();\n\t\t\t\t\tif ($_method=='GET' && $_proc[1]) {\n\t\t\t\t\t\t$_SERVER['REQUEST_TTL']=$_proc[1];\n\t\t\t\t\t\t// Save to/retrieve from cache\n\t\t\t\t\t\tself::urlCache($_proc);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Capture output\n\t\t\t\t\t\tob_start();\n\t\t\t\t\t\tself::call($_proc[0]);\n\t\t\t\t\t\tself::$global['RESPONSE']=ob_get_contents();\n\t\t\t\t\t\tob_end_clean();\n\t\t\t\t\t}\n\t\t\t\t\t$_elapsed=microtime(TRUE)-$_time;\n\t\t\t\t\tif ((self::$global['THROTTLE']/1e3)>$_elapsed)\n\t\t\t\t\t\tusleep(\n\t\t\t\t\t\t\t1e6*(self::$global['THROTTLE']/\n\t\t\t\t\t\t\t1e3-$_elapsed)\n\t\t\t\t\t\t);\n\t\t\t\t\tif (self::$global['RESPONSE'] && \n\t\t\t\t\t\t!self::$global['QUIET'])\n\t\t\t\t\t\t// Display response\n\t\t\t\t\t\techo self::$global['RESPONSE'];\n\t\t\t\t\t// Hail the conquering hero\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// No such Web page\n\t\tself::http404();\n\t}", "public function processApi(){\n\n\t\t$params = array();\n\t\t$parts = $this->getRequestPartsFrom(\"API\");\n\t\t$this->parseIncomingParams();\n\t\t\n\t\tif($parts[1]=='Clients')\n\t\t{\n\t\t\tif(($parts[2]=='Client')&&(is_numeric($parts[3])))\n\t\t\t{\n\t\t\t\t$this->ID = $parts[3];\n\n\t\t\t\tswitch($this->getRequestMethod()) {\n\t\t\t\t\tcase \"PUT\":\n\t\t\t\t\t\t$this->updateClient();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"GET\":\n\t\t\t\t\t\t$this->getClient();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"DELETE\":\n\t\t\t\t\t\t$this->deleteClient();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->response('',404);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($parts[2]=='Client')\n\t\t\t{\n\t\t\t\tswitch($this->getRequestMethod()) {\n\t\t\t\t\tcase \"POST\":\n\t\t\t\t\t\t$this->newClient();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->response('',404);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->getClients();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response('',404);\n\t\t}\n\t\t\t\n\t}", "public function processApi() {\n if (isset($_REQUEST['x']) && $_REQUEST['x'] != \"\") {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int)method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n echo 'method not exist';\n exit;\n }\n } else {\n echo 'method not exist';\n exit;\n }\n }", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function parseRequest(): bool;", "public function parseRequest() {\n\t\t# Actually doesn't return anything but a redirect if either post or get is set..\n\n\t\tif(isset($_POST['mifySubmit'])) {\n\t\t\t$this->postURL();\n\t\t\treturn true;\n\t\t}\n\t\telseif(isset($_GET['u'])) {\n\t\t\t$this->parseURLRequest();\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function _request() {}", "public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function run()\n {\n $requested_url = explode('/', $this->requestUrl);\n\n if (!empty($this->definedRoutes[$this->requestMethod])) {\n foreach ($this->definedRoutes[$this->requestMethod] as $route => $action) {\n $route = explode('/', $route);\n $route_depth = count($route);\n\n // Check for defined route parameters\n for( $i = 0; $i < $route_depth; $i++) {\n if (preg_match('/\\{([\\w?]+?)\\}/',$route[$i])) {\n if (isset($requested_url[$i])) {\n array_push($this->requestParameters, $requested_url[$i]);\n // replace defined route parameters with peer request url parameter for final comparison\n $route[$i] = $requested_url[$i];\n }\n }\n }\n\n // Check for unreplaced route parameters and delete them if are optional parameters (for final comparison)\n for ($j = 0; $j < $route_depth; $j++) {\n if (preg_match('/\\{([\\w]+?)\\?}/', $route[$j])) {\n unset($route[$j]);\n }\n }\n\n $route = implode('/', $route);\n\n // Final comparision. Check requested url is equal to current checking route\n if ($route == $this->requestUrl) {\n $this->matched = true;\n\n if ($action instanceof Closure) {\n return call_user_func_array($action, $this->requestParameters);\n } else if($this->isController($action)) {\n return $this->loadController($action);\n } else {\n throw new Exception('Invalid action for route');\n }\n break; // Route found, stop the operations\n } else {\n $this->reset();\n }\n }\n }\n\n if ($this->matched === false) {\n return $this->exception->notFound();\n }\n }", "public function apiHandling() {\r\n $data = empty($_POST) ? $_GET : $_POST;\r\n $controllerName = empty($data['control_type']) ? \"\" : $data['control_type'];\r\n $apiRequest = empty($data['api_name']) ? \"\" : $data['api_name'];\r\n $controllerName = ucwords($controllerName).\"_Controller\";\r\n Common::loadClass(CONTROLLERS_PATH);\r\n if ($_SERVER['SERVER_NAME'] == Constants::MAIN_SERVER_URL && !empty($controllerName) && !empty($apiRequest) && file_exists(CONTROLLERS_PATH.$controllerName.\".php\") ) {\r\n $classobj = new $controllerName();\r\n if(method_exists($classobj, $apiRequest)){\r\n call_user_func([$classobj, $apiRequest]);\r\n } else {\r\n $this->wrongAPiHit();\r\n }\r\n } else {\r\n $this->wrongAPiHit();\r\n }\r\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n $this->$func();\n }\n\t\t\telse {\n $this->response('',404); // If the method not exist with in this class \"Page not found\". \n }\n\t\t\t\t\n\t\t}", "public function doRequests();", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "function dx_process($conn, $bot, $input){\n //set a name for user\n if (mb_substr($input, 0, 1, 'utf-8') == '!')\n $bot -> setName($input);\n\n //get the time for user\n else if(strpos($input, 'time') || $input == 'time')\n $bot -> getTime($input);\n\n //train the bot\n else if (substr($input, 0, 6) == 'train:') {\n $bot -> trainBot($conn, $input);\n }\n\n //display bot data\n else if($input == 'aboutbot')\n $bot -> getBotData();\n\n else if( strpos($input, 'date') || $input == 'date'){\n echo 'Today is '.date('D.').' the '.date('jS M, ').date('Y');\n exit();\n }\n\n //respond to input such as hello, hi etc\n else if(str_word_count($input) == 1 && $input != 'time' && $input != 'date' && $input != 'aboutbot' && $input != 'help')\n $bot -> response($input);\n\n //show help\n else if($input == 'help')\n $bot -> showHelp();\n\n else\n $bot -> respondToQuestion($conn, $input);\n\n\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "function do_robots()\n {\n }", "public function is_api_request($is_api_request)\n {\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['user'] !== NULL)\n return true;\n return false;\n }", "public function apiAction()\n {\n\n $this->init();\n if(isset($_REQUEST['function']) && $_REQUEST['function'] == self::FUNCTION_TEST) {\n $this->handleTest();\n }\n $this->fetchDataFromRequest();\n\n\n // If we use Secret Field for API calls, is this the Check\n $secretFieldName = $this->McpServiceModel->getConfigData('secret_field_name');\n $secretFieldValue = $this->getParameter($secretFieldName,self::REGEX_SIMPLE_TEXT);\n\n if ($secretFieldValue != $this->McpServiceModel->getConfigData('secret_field_value')) {\n $this->returnMessage = self::MESSAGE_SECRET_FIELD_INVALID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n return false;\n }\n\n if (!$this->getParameter('orderid',self::REGEX_INTEGER)) {\n $this->returnMessage = self::MESSAGE_INVALID_ORDER_ID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n return false;\n }\n // little Check\n if ($this->getParameter('function',$this->api_functions)) {\n $this->api();\n } else {\n $this->returnMessage = sprintf(\n self::MESSAGE_INVALID_FUNCTION,\n $this->getParameter(\n 'function',\n self::REGEX_SIMPLE_TEXT\n )\n );\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n return false;\n }\n return true;\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n//echo $func;\t\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}", "public function handlerNeedsRequest()\n {\n }", "private function invoke() {\n global $user;\n $req =& $this->request;\n try {\n\n if ($req) {\n if (isset($req->uri) && preg_match(\"/^([^\\?]*)(\\?(.*))?$/\", $req->uri, $match)) {\n $this->q = $match[1];\n parse_str($match[3], $_GET);\n }\n }\n \n if (isset($req) && !is_object($req))\n throw new Exception(\"Invalid Request.\", -32600);\n \n \n if (!preg_match(\"/^(?:(\\D\\w*)[\\.\\/])?(\\D\\w*)\\/?(.*)$/\", $this->q, $match))\n throw new Exception(\"Invalid Request.\", -32600);\n \n list(, $c, $m, $a) = $match;\n \n\t\t\n\t\t//if (!$c)\n\t\t//\t$c = jsonrpc_load_class_by_method($m, TRUE);\n \n\n\t\t\n \n if (!($c && class_exists($c, FALSE))) {\n $c = jsonrpc_load_class($c, $m, TRUE);\n }\n \n if (isset($a) && is_string($a) && FALSE !== strpos($a, ','))\n $a = explode(',', $a);\n if (isset($_GET['id']))\n $req->id = $_GET['id'];\n $is_super = $user->uid == 1;\n if ($user->uid == 0 && $_SERVER['REMOTE_ADDR'] == '127.0.0.1' && !isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $is_super = TRUE;\n $user->uid = 1;\n }\n \n //echo $c;\n \n if (!method_exists($c, $m))\n throw new Exception('Method does not exists.', -32601);\n if (variable_get('site_offline', 0) && !$is_super)\n throw new Exception('Site if offline');\n $refl = new ReflectionMethod($c, $m);\n \n\t//$args = array();\n \n if (!isset($req->params)) {\n if ($a)\n $args = $a;\n elseif (isset($_GET['params']))\n $args = explode(',', $_GET['params']);\n elseif (isset($_GET['param']))\n $args = explode(',', $_GET['param']);\n }\n else\n $args = $req->params;\n \n //if(!is_array($args))\n \t\n\n\t//var_dump(count($args) <= $refl->getNumberOfParameters());\n\n //if ($refl->getNumberOfRequiredParameters() <= 1 && is_array($args) && count($args) > $refl->getNumberOfParameters() )\n \n //if($refl->getNumberOfRequiredParameters\n \n $np = $refl->getNumberOfParameters();\n $nr = $refl->getNumberOfRequiredParameters();\n\n\t\t//if ($np == 1 && count($args)\n//var_dump($args);\n//die;\n \n \n \n if ($nr <= 1 && !(is_array($args) && count($args) == $np && $np > 1 ) && isset($req->params))\n $args = array($args);\n\n\n//var_dump($args);\n\n switch (TRUE) {\n case $refl->isStatic():\n $req->result = call_user_func_array(array($c, $m), $args);\n break;\n case $refl->isPublic():\n $inst = $this->instance($c);\n $req->result = call_user_func_array(array($inst, $m), $args);\n break;\n case $refl->isProtected() && $is_super:\n $refl->setAccessible(TRUE);\n $req->result = $refl->invokeArgs(new $c, $args);\n break;\n default:\n throw new Exception(\"Method not found or permission denied on launching $c::$m.\");\n }\n } catch (Exception $e) {\n if (!is_object($req))\n $req = $this->request = (object)NULL;\n $data = isset($e->data) ? $e->data : get_class($e);\n $req->error = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'data' => $data);\n }\n }", "public function request();", "protected function handleRequest() {\n\t\t$delegate = $this->extractDelegate();\n\t\t$command = $this->extractCommand();\n\t\t$params = $this->getRequest()->parameters;\n\t\tif( !$params || !is_array( $params ) )\n\t\t\t$params = array();\n\n\t\tif( $this->_verbose ) {\n\t\t\t$this->set( '_command', $command );\n\t\t\t$this->set( '_delegate', $delegate );\n\t\t\t$this->set( '_parameters', $params );\n\t\t}\n\n\t\t$params = array( $params );\n\t\ttry {\n\t\t\tif( $delegate ) {\n\t\t\t\t$Framework = $this->getFramework( $delegate, false );\n\t\t\t\tif( $Framework ) {\n\t\t\t\t\t$result = $Framework->callHooks( $command, $params );\n\t\t\t\t\tif( is_array( $result ) && count( $result ) == 1 )\n\t\t\t\t\t\treturn current( $result );\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn call_user_func_array( array($this, $this->getCommand()), $params );\n\t\t}\n\t\tcatch( NotAuthorizedException $Exception ) {\n\t\t\t$this->set( 'error', $Exception->getMessage() );\n\t\t\t$this->set( 'trace', $Exception->getTraceAsString() );\n\t\t\treturn false;\n\t\t}\n\t\tcatch( NotPrivilegedException $Exception ) {\n\t\t\t$this->set( 'error', $Exception->getMessage() );\n\t\t\t$this->set( 'trace', $Exception->getTraceAsString() );\n\t\t\treturn false;\n\t\t}\n\t}", "public function parse_call() {\r\n\t\t$this->spoof_check();\r\n\t\tif (count($this->request) == $this->max_requests\r\n\t\t\r\n\t\t)\r\n\t\t\texit();\r\n\t\tif (!$this->match_server($this->request['host'])) {\r\n\t\t\techo \"Fatal Error: Your address is unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse if (!$this->match_server($this->request['server'])) {\r\n\t\t\techo \"Fatal Error: Target address unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$host = $this->request['host'];\r\n\t\t$this->disassemble_IP($host);\r\n\t\t$this->get_user_queue();\r\n\t\t$this->users[] = $this->request['session'];\r\n\t\t$this->patch_connection();\r\n\t}", "function _execTwApiBot($bot_consumer, $api, $data, $method = 'post') {\n if(is_null($this->oauth)) $this->oauth = new OauthConsumerComponent(new ComponentCollection());\n if($method == 'post') $json_data = $this->oauth->post2($bot_consumer, $api, $data);\n else $json_data = $this->oauth->get2($bot_consumer, $api, $data);\n $result = json_decode($json_data, true);\n if(!is_array($result)) $result = array('request' => 'Network problem', 'error' => 'Fatal error');\n return $result;\n }", "function attempt_request($http_request_method, $url, $data = null)\n\t{\n\t\tif ($this->oauth_token)\n\t\t{\n\t\t\tif ($url)\n\t\t\t{\n\t\t\t\treturn ($this->__oauth_access_token && $this->execute_request($http_request_method, $url, $data)) ? true\n\t\t\t\t\t\t\t: ($this->get_access_token() && $this->execute_request($http_request_method, $url, $data));\n\t\t\t}\n\n\t\t\treturn false; //!< nothing to return really, unknown condition\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->get_request_token();\n\t\t}\n\t}", "private static function runRequest(Bot $bot, $method, $params)\n {\n $defaultParams = [\n 'format' => 'array'\n ];\n\n $params = array_merge($params, $defaultParams);\n\n // Let's try some random\n if (\\App::environment('live')) {\n sleep(rand(0, 40));\n }\n\n try {\n if ($return = \\Twitter::$method($params)) {\n Bot::isFine($bot);\n return $return;\n }\n } catch (\\Exception $e) {\n \\Log::error('[' . $bot->screen_name . '] Method ' . $method . ' : ' . $e->getMessage());\n Bot::addError($bot);\n return false;\n }\n }", "public function sendRequest() {\n $response = file_get_contents($this->url);\n\n if ($response) {\n\n $this->response = $response;\n return true;\n } else {\n\n return false;\n }\n }" ]
[ "0.65299445", "0.6244234", "0.61338896", "0.61302006", "0.6109292", "0.6070739", "0.6042608", "0.59987915", "0.597294", "0.59036523", "0.59036523", "0.5893917", "0.5889598", "0.58877915", "0.5874798", "0.5869739", "0.5859666", "0.5858569", "0.58562094", "0.5828508", "0.5825662", "0.58249664", "0.58180237", "0.58067554", "0.58026844", "0.5798719", "0.579153", "0.57849365", "0.577486", "0.5766709", "0.5766709", "0.5766709", "0.5766709", "0.5760009", "0.57467926", "0.57467926", "0.57467926", "0.5732541", "0.5719048", "0.57095265", "0.57091993", "0.5700554", "0.56994593", "0.5690247", "0.56786454", "0.56706953", "0.56683975", "0.5649958", "0.56426543", "0.56412023", "0.56329495", "0.560043", "0.55960715", "0.5567806", "0.5554017", "0.55452126", "0.55390394", "0.55390394", "0.5529243", "0.5527923", "0.55238223", "0.552267", "0.55179435", "0.55092883", "0.55087554", "0.5505013", "0.54854673", "0.5476175", "0.5474442", "0.54649764", "0.54617894", "0.5458837", "0.54571", "0.5456804", "0.5456359", "0.54538196", "0.5453046", "0.54525733", "0.5438338", "0.54366004", "0.5428889", "0.5426077", "0.54252845", "0.5419963", "0.54159606", "0.54155207", "0.5412323", "0.54008234", "0.53960085", "0.53953713", "0.5385724", "0.5383047", "0.538227", "0.53795755", "0.534433", "0.5343332", "0.53429836", "0.5340912", "0.53353226", "0.5327007" ]
0.5695775
43
Show the application dashboard.
public function index() { $matchThese = ['status' => 1, 'sents' => 0]; $neworders=Order::where($matchThese)->count(); $unpaidorders=Order::where('status',0)->count(); $from = new Carbon('last week'); $to=Carbon::today(); $newusers=User::whereBetween('created_at',[$from, $to])->count(); return view('admin.main.index',compact(['unpaidorders','neworders','newusers'])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
TODO: Implement setDefaultOptions() method.
public function setDefaultOptions(OptionsResolverInterface $resolver) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getDefaultOptions()\n {\n }", "protected function setDefaultOptions()\n {\n $this->unsigned = false;\n }", "public function setDefaultOptions(array $options);", "protected function initOptions()\n {\n }", "public function getDefaultOptions();", "public function getDefaultOptions();", "protected function loadDefaultOptions()\r\n {\r\n $this->options = [\r\n 'offsettop' => 0,\r\n 'offsetleft' => 0,\r\n 'merge' => false,\r\n 'backcolor' => 0xffffff,\r\n ];\r\n }", "public function configureOptions();", "function resetOptions()\n {\n $this->options = $this->_defaultOptions;\n }", "public function setDefaultOptions()\n {\n // Set event data\n foreach ($this->events as $event => $handler) {\n $this->options['data']['widget-action-' . $event] = $handler;\n }\n\n if($this->jsWidget) {\n $this->options['data']['ui-widget'] = $this->jsWidget;\n }\n\n if($this->fadeIn) {\n $fadeIn = $this->fadeIn === true ? 'fast' : $this->fadeIn;\n $this->options['data']['widget-fade-in'] = $fadeIn;\n $this->visible = false;\n }\n\n if (!empty($this->init)) {\n $this->options['data']['ui-init'] = $this->init;\n }\n }", "abstract public function setOptions($options = array());", "protected function get_options()\n\t{}", "function initDefaultOptions(){\n\n\t\t\t$defaults = $this->defaultOptions();\n\t\t\treturn update_option( $this->optionsKey, $defaults );\n\t\t}", "public function options() {}", "public function __construct()\n {\n $this->options = [];\n }", "function _addDefaultOptions($options)\r\n {\r\n $this->_options = array_merge($this->_options, $options);\r\n }", "public function register_options() {\n\t\tparent::register_options();\n\n\t}", "protected function configureOptions(): void\n {\n }", "private function initOptions()\n {\n $this->optionsResolver->setDefaults([\n 'collection' => [],\n ]);\n\n $this->optionsResolver->setAllowedTypes('collection', 'array');\n }", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "public static function setDefaultOptions()\n {\n Pronamic_Google_Maps_Settings::set_default_options();\n }", "public function set_options()\n {\n // Attempt to retrieve our feature default settings so that we can compare against our post types query\n $defaults = get_option(self::FEATURE_DEFAULTS);\n\n // Retrieve all post types for the given instance and filter down to only publicly accessible types\n $types = get_post_types([\n 'public' => true,\n 'show_in_menu' => true,\n 'exclude_from_search' => false\n ]);\n\n // Remove all post types that we don't want to support duplication for\n $post_types = array_keys(\n array_filter(\n $types,\n function ($key) {\n return !in_array($key, ['attachment']);\n },\n ARRAY_FILTER_USE_KEY\n )\n );\n\n $this->defaults = [\n 'post_types' => $post_types\n ];\n\n // We don't want to ALWAYS update our feature defaults option unless\n // we know that new post types have been added/deleted\n if (isset($defaults) && $post_types === $defaults['post_types']) {\n return;\n }\n\n update_option(self::FEATURE_DEFAULTS, $this->defaults);\n }", "protected function defineOptions() {\n return parent::defineOptions();\n }", "public static function set_options() {\r\n\t\tself::add_option(\"my_option\", \"foo\");\r\n\t}", "public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}", "public function setOptions(array $options = array());", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "function initialize_options()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\t$defaults = array(\n\t\t\t\t'minimum_age' => 4,\n\t\t\t\t'maximum_age' => 0,\n\t\t\t);\n\t\t\tforeach ($defaults as $option => $default)\n\t\t\t{\n\t\t\t\tif (!isset($config[$option]))\n\t\t\t\t{\n\t\t\t\t\tset_config($option, $default);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function __construct($options = array()) {\n $this->options = $options + $this->defaults;\n }", "function setDefaultOverrideOptions() {\n\tglobal $fm_module_options;\n\t\n\t$config = null;\n\t$server_os_distro = isDebianSystem($_POST['server_os_distro']) ? 'debian' : strtolower($_POST['server_os_distro']);\n\t\n\tswitch ($server_os_distro) {\n\t\tcase 'debian':\n\t\t\t$config = array(\n\t\t\t\t\t\t\tarray('cfg_type' => 'global', 'server_serial_no' => $_POST['SERIALNO'], 'cfg_name' => 'pid-file', 'cfg_data' => '/var/run/named/named.pid')\n\t\t\t\t\t\t);\n\t}\n\t\n\tif (is_array($config)) {\n\t\tif (!isset($fm_module_options)) include(ABSPATH . 'fm-modules/' . $_SESSION['module'] . '/classes/class_options.php');\n\t\t\n\t\tforeach ($config as $config_data) {\n\t\t\t$fm_module_options->add($config_data);\n\t\t}\n\t}\n}", "public function setOptions($options){\n\n\t}", "abstract public function setOptions($options);", "public function setOptions($options = []);", "public function options_load();", "protected function _initDefaultOptions()\n {\n $this->_options[self::OPT_DETECT_FAX_TONE] = self::DETECT_FAX_TONE_DEFAULT;\n }", "protected function useDefaultValuesForNotConfiguredOptions() {}", "public function setDefaults (array $options = []);", "function __construct(array $options=array()) {\n $this->options = $options + static::getDefaults();\n }", "protected function setDefaultOptions(OptionsResolver $resolver)\n {\n }", "public function __construct($options = array()){ \r\n $this->setOptions($options);\r\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "public function resetOptions()\n {\n $this->options = array();\n }", "protected function _initDefaultOptions()\n {\n $this->_options[self::OPT_STOP_PROMPTING_ON_DTMF] = self::STOP_PROMPTING_ON_DTMF_DEFAULT;\n $this->_options[self::OPT_NO_INPUT_PROMPT_PLAYLIST] = array();\n $this->_options[self::OPT_END_READING_KEY] = Streamwide_Engine_Dtmf_Handler::KEY_POUND;\n $this->_options[self::OPT_RETURN_ALL_INPUT] = self::RETURN_ALL_INPUT_DEFAULT;\n $this->_options[self::OPT_TRIES] = self::DEFAULT_NUMBER_OF_TRIES;\n }", "function setOptions( $options , $force=false )\n {\n// i think we should better set the option for each object and the lastUsed !!!\n return $this->_objectPool['defaultObject']->setOptions( $options , $force );\n }", "protected function setDefaultOptions(OptionsResolverInterface $resolver)\n {\n }", "protected\n function getOptions() {\n return array();\n }", "abstract function options();", "function setOptions (array $options);", "public function setOptions($options = array())\r\n { \r\n $this->options = $options;\r\n }", "protected function get_registered_options()\n {\n }", "public function resetOptions()\n {\n $this->options = [];\n $this->configure();\n }", "public function options_init() {\n\t\t\tglobal $allowedtags;\n\t\t\t$allowedtags['p'] = array();\n\t\t\t$this->allowedtags = $allowedtags;\n\n\t\t // set options equal to defaults\n\t\t $this->_options = get_option( $this->options_group[0]['options_name'] );\n\t\t if ( false === $this->_options ) {\n\t\t\t\t$this->_options = $this->get_defaults();\n\t\t }\n\t\t if ( isset( $_GET['undo'] ) && !isset( $_GET['settings-updated'] ) && is_array( $this->get_option('previous') ) ) {\n\t\t \t$this->_options = $this->get_option('previous');\n\t\t }\n\t\t update_option( $this->options_group[0]['options_name'], $this->_options );\t\t\n\t\t \n\t\t}", "protected function getDefaultOptions()\n {\n $this->barcodeLength = 2;\n }", "protected function getOptions()\r\n {\r\n return [\r\n\r\n ];\r\n }", "public function init_group_options() {\r\n\t\tif ( ! empty( $this->settings['options'] ) ) {\r\n\r\n\t\t\tif ( is_array( $this->settings['options'] ) ) {\r\n\r\n\t\t\t\tforeach ( $this->settings['options'] as $settings ) {\r\n\r\n\t\t\t\t\tif ( ! apply_filters( 'tf_create_option_continue_' . $this->getOptionNamespace(), true, $settings ) ) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$obj = TitanFrameworkOption::factory( $settings, $this->owner );\r\n\t\t\t\t\t$this->options[] = $obj;\r\n\r\n\t\t\t\t\tdo_action( 'tf_create_option_' . $this->getOptionNamespace(), $obj );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function initOptions()\n {\n if ($this->kcfinder) {\n $this->registerKCFinder();\n }\n\n $options = [];\n switch ($this->preset) {\n case 'custom':\n $preset = null;\n break;\n case 'basic':\n case 'full':\n case 'standard':\n $preset = 'presets/' . $this->preset . '.php';\n break;\n default:\n $preset = 'presets/standard.php';\n }\n if ($preset !== null) {\n $options = require($preset);\n }\n $this->clientOptions = ArrayHelper::merge($options, $this->clientOptions);\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function get_options()\n {\n }", "abstract public function getOptions();", "public function initialOptions(): array\n {\n return [];\n }", "public function defaultOptions() {\n return $this->default_options;\n }", "function setOptions($options = array()) \n { \n $default = array( \n \"RemoveStyles\" => true, \n \"IsWord\" => true, \n \"UseTidy\" => true, \n \"TidyBefore\" => false, \n \"CleaningMethod\" => array( \n \"tags\" => \"whitelist\", \n \"attributes\" => \"blacklist\" \n ), \n \"OutputXHTML\" => true, \n \"FillEmptyTableCells\" => true, \n \"DropEmptyParas\" => true, \n \"Optimize\" => true, \n \"Compress\" => false, \n \"Encoding\" => \"UTF8\" \n ); \n $new = array_merge_recursive($default, (array)$options); \n\n $this->_options = $new; \n $this->__setTidyConfig(); \n }", "public function setOptions(?array $options = null) {}", "public function initOptions()\n {\n $this->setOption('className', '%CLASS%' . $this->getRelationName());\n }", "protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}", "public function testConfigureOptions()\n {\n $multiLanguagesManager = $this->multiLanguagesManager;\n $resolverMock = Phake::mock('Symfony\\Component\\OptionsResolver\\OptionsResolver');\n\n $this->form->configureOptions($resolverMock);\n\n Phake::verify($resolverMock)->setDefaults(array(\n 'embedded' => true,\n 'class' => $this->statusClass,\n 'choice_label' => function ($choice) use ($multiLanguagesManager) {\n return $multiLanguagesManager->choose($choice->getLabels());\n },\n ));\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "public function setOptions($options) {\n\n $this->options = $options;\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t];\n\t}", "function init() {\n $this->options['selected'] = isset($this->options['value']) ?\n true : @(bool)$this->options['default'];\n }", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function setOptions(array $options);", "public function load_options( $options = array() ) {}", "abstract protected function options(): array;", "protected static function get_default_options($multirequest = false)\n {\n }", "protected function getDefaultOptions()\n {\n return array();\n }", "public function setOptions($options)\n {\n $this->options = $options;\n }", "function __construct(){\n\t\t$this->options();\n\t}", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "public function set_options(Array $options);" ]
[ "0.8102202", "0.7918558", "0.77495813", "0.76479733", "0.760753", "0.760753", "0.7574474", "0.7408657", "0.7266818", "0.7255919", "0.72536474", "0.72451895", "0.72020394", "0.7186434", "0.71628743", "0.7154129", "0.70959044", "0.70820093", "0.70533353", "0.7041575", "0.7041575", "0.7041575", "0.7041575", "0.7041575", "0.70158184", "0.7007976", "0.70036936", "0.7002441", "0.6995476", "0.6965144", "0.69524544", "0.6951608", "0.6951608", "0.6945798", "0.69347715", "0.6921732", "0.6921546", "0.69208956", "0.69094944", "0.6906129", "0.69003016", "0.68882036", "0.6870935", "0.6868048", "0.6859437", "0.68565285", "0.6836025", "0.6824879", "0.6814206", "0.6812661", "0.67949075", "0.67757946", "0.6762641", "0.6756131", "0.6753809", "0.674936", "0.6730707", "0.67099714", "0.67045534", "0.6682941", "0.668215", "0.6667902", "0.66634864", "0.6656215", "0.6655893", "0.66467094", "0.6642988", "0.6633351", "0.66300756", "0.6629327", "0.6614573", "0.6610464", "0.660466", "0.660466", "0.660466", "0.660466", "0.6603292", "0.6601551", "0.6600255", "0.659174", "0.659174", "0.659174", "0.659174", "0.659174", "0.659174", "0.659174", "0.659174", "0.65894735", "0.658349", "0.65717775", "0.6570759", "0.6555533", "0.65534866", "0.6548657", "0.6548657", "0.6548657", "0.6548657", "0.6548657", "0.65383685" ]
0.6717513
58
performs extra validation for number input types adds message(s) to object's errors if validation errors are found
public function validateExtra(bool $change = true) { $label = new \GZMP\HTMLTag('span', array('class' => 'label'), $this->getIdentifyingText()); // check to make sure in range, numeric if (!is_numeric($this->value)) return "{$label->getHTML()} must be numeric."; // check this before minimum and maximum so that if value is changed, we make sure it's not outside the proper range $step = $this->getAttribute('step'); if (! is_null($step) && is_numeric($step) && ($remainder = fmod($this->value, $step)) != 0) { if ($change) { // set value to closest matching increment step $this->value = $this->value - $remainder + ($remainder > ($step / 2) ? $step : 0); } else { return $this->addError("{$label->getHTML()} isn't in a correct increment of {$step}."); } } $min = $this->getAttribute('min'); if (! is_null($min) && is_numeric($min) && $this->value < $min) { if ($change) { $this->value = $min; } else { return $this->addError("{$label->getHTML()} is below minimum allowed value of {$min}."); } } $max = $this->getAttribute('max'); if (! is_null($max) && is_numeric($max) && $this->value > $max) { if ($change) { $this->value = $max; } else { return $this->addError("{$label->getHTML()} is above maximum allowed value of {$max}."); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_is_number($field_input, array &$field): bool\n{\n if (!is_numeric($field_input)) {\n $field['error'] = 'Type in integer';\n return false;\n }\n return true;\n}", "public function testNumber()\r\n {\r\n\r\n $testData = array(\r\n 'number' => '',\r\n 'number2' => '1337',\r\n 'number3' => 0x539,\r\n 'number4' => 02471,\r\n 'number5' => 0b10100111001,\r\n 'number6' => 1337e0,\r\n 'number7' => \"not numeric\",\r\n 'number8' => array(),\r\n 'number9' => 9.1\r\n );\r\n\r\n $validator = new Validator($testData);\r\n $validator->addRule('number', 'number', ['number']);\r\n $validator->addRule('number2', 'number2', ['required', 'number']);\r\n $validator->addRule('number3', 'number3', ['required', 'number']);\r\n $validator->addRule('number4', 'number4', ['required', 'number']);\r\n $validator->addRule('number5', 'number5', ['required', 'number']);\r\n $validator->addRule('number6', 'number6', ['required', 'number']);\r\n $validator->addRule('number7', 'number7', ['required', 'number']);\r\n $validator->addRule('number8', 'number8', ['required', 'number']);\r\n $validator->addRule('number9', 'number9', ['required', 'number']);\r\n\r\n $this->assertFalse($validator->validate());\r\n $this->assertFalse($validator->isValid());\r\n\r\n\r\n /** The field is not required, so it can be empty and contains no valid number */\r\n $this->assertFalse($validator->hasErrors('number'), $validator->getFieldError('number'));\r\n $this->assertFalse($validator->hasErrors('number2'), $validator->getFieldError('number2'));\r\n $this->assertFalse($validator->hasErrors('number3'), $validator->getFieldError('number3'));\r\n $this->assertFalse($validator->hasErrors('number4'), $validator->getFieldError('number4'));\r\n $this->assertFalse($validator->hasErrors('number5'), $validator->getFieldError('number5'));\r\n $this->assertFalse($validator->hasErrors('number6'), $validator->getFieldError('number6'));\r\n $this->assertTrue($validator->hasErrors('number7'), $validator->getFieldError('number7'));\r\n $this->assertTrue($validator->hasErrors('number8'), $validator->getFieldError('number8'));\r\n $this->assertFalse($validator->hasErrors('number9'), $validator->getFieldError('number9'));\r\n }", "function isNumber($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif(!is_numeric($value)){\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "private function validate()\n {\n if (! is_numeric($this->number)) {\n throw new \\InvalidArgumentException(\"Invalid numeric value provided ($this->number).\");\n }\n }", "public static function validateNum()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 50),\n\t\t);\n\t}", "function validate_quantity($input_value) {\n $error = array();\n // if the $input_value (buyer input) is not numeric, $error['notNumeric']which contain the message \"Please input numeric value\" will be adding to the $error = array().\n if (!is_numeric($input_value))\n $error['notNumeric'] = \"Please input numeric value\";\n // if the $input_value (buyer input) is less than zero (negative), $error[\"cannotBeNegative\"] which contain the message \"Please input a positive value\" will be adding to the $error = array().\n if ($input_value < 0)\n $error[\"cannotBeNegative\"] = \"Please input a positive value\";\n // if the $input_value (buyer input)contain decimal, $error[\"float\"] which contain the message \"Please enter a whole integer\" will be adding to the $error = array().\n if (strpos($input_value, '.') != FALSE)\n $error[\"float\"] = \"Please enter a whole integer\";\n return $error;\n}", "abstract public function validateNumber(): bool;", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "public function validate(){\n\t\t\n\t\tparent::validate();\n\t\t\n\t\tif (isset($this->amount_limit)){\n\t\t\t\n\t\t\tif (!is_numeric($this->amount_limit))\n\t\t\t\t$this->errorAmountLimit = \"Podaj prawidłową kwotę.\";\n\t\t\t\n\t\t\tif ($this->amount_limit < 0)\n\t\t\t\t$this->errorAmountLimit = \"Kwota limitu nie może być ujemna.\";\n\t\t}\n\t\t\n\t\tif ($this->errorName != null || $this->errorAmountLimit != null){\n\t\t\t$this->success = false;\n\t\t}\n\n\t}", "function testInvalidNumericFieldExpectsDataRemoved() {\n\n\t\t// arrange\n\t\t$TestNumberField = new TestNumberField();\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field_one' => 'Two',\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestNumberField->validate($_POST['post_ID'], $TestNumberField->fields['field_one'], $validated['field_one'], array());\n\t\t// assert\n\t\t$expected = null;\n\t\t$this->assertEquals(\n\t\t\t$expected,\n\t\t\t$validated['field_one'],\n\t\t\t'Non-numeric strings should not be accepted for a number input type.'\n\t\t);\n\t}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "function validateNumericFields($integerFields, $errorMsg=NULL)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($numberFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!is_numeric($_REQUEST[$fieldName])) \n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" & \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first \n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg, 0);\n\t\t\t\n\t\t\tforeach($errorArray as $error)\n\t\t\t{\n\t\t\t\t$errorOut .= $error.'<br/>';\n\t\t\t}\n\t \n\t\t\t\n\t\t }\n\t\n\treturn $errorOut;\n}", "public function validate()\n {\n\t# checking default value\n\tif ( $this->default &&\n\t !$this->isValidValue($this->default))\n\t{\n\t $this->_addError(\"invalid datatype of default value '$this->default'\");\n\t}\n\telseif ($this->default)\n\t{\n\t $this->default= $this->retype($this->default);\n\t}\n\n\tforeach($this->errors as $key => $error)\n\t{\n\t $this->errors[$key] = str_replace('%s', $this->getModel()->getName(). '::'.$this->name, $error);\n\t}\n\treturn $this->errors;\n }", "public function rules()\n {\n return [\n 'max_num' => 'required',\n 'subtotal' => 'required|array',\n// 'subtotal.*.numeric'=> 'required|numeric'\n ];\n }", "function validate_int() {\n # Check if the value is an integer\n if (is_int($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for integer ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Integer Value\n return intval($this->cur_val);\n }\n }", "public function rules() {\n return array(\n array('out_summ, in_curr', 'required'),\n array('out_summ', 'numerical', 'min' => 1, 'tooSmall' => Yii::t('payment', 'The summ can not be less than $ 1'), 'message' => Yii::t('payment', 'Summ must be a number')),\n );\n }", "public function rules()\n {\n return [\n 'new_number' => [ 'required', 'integer' ],\n 'new_number_title' => 'required',\n ];\n }", "public function number($content) {\r\n if (! is_numeric ( $content ) && strlen ( $content ) > 0) {\r\n throw new ValidationException ( self::ERROR_NOT_NUMBER );\r\n }\r\n }", "function validateNumber ( $validatedValue, $stringName ) {\n\tif ( !is_numeric ( $validatedValue ) ) {\n\t\techo \"<script>alert('$stringName should be a number!!!!')</script>\";\n\t\texit ();\n\t} else if ( $validatedValue < 0 ) {\n\t\techo \"<script>alert('$stringName should be greater or equal 0!!!!')</script>\";\n\t\texit ();\n\t}\n}", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "public function isValid($value)\r\n {\r\n $response = parent::isValid($value);\r\n if (!$response)\r\n {\r\n $this->_messages =\r\n array(self::INVALID => \"El valor debe ser un número entero\");\r\n }\r\n return $response;\r\n }", "public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }", "public function rules()\n {\n return [\n 'number_member' => 'required | integer',\n ];\n }", "function validate_input ($input_array) {\n\t$errors = array();\n\n\t$integer_fields = array('model', 'ram', 'hd', 'price');\n\tforeach ($integer_fields as $key) {\n\t\tif (!is_numeric($input_array[$key]) || preg_match('/\\./', $input_array[$key])) {\n\t\t\t$errors[] = \"The value of $key must be an integer.\";\n\t\t}\n\t}\n\n\tif (!is_numeric($input_array['speed'])) {\n\t\t$errors[] = \"The value of speed must be a number.\";\n\t}\n\n\treturn $errors;\n}", "function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "function validator_number($min = NULL, $max = NULL, $integer = NULL, $optional = NULL)\n{\n\tif (is_null($min))\n\t\t$min = -INF;\n\tif (is_null($max))\n\t\t$max = INF;\n\tif (is_null($integer))\n\t\t$integer = false;\n\tif (is_null($optional))\n\t\t$optional = false;\n\n\treturn array('optional' => $optional, 'validator' =>\n\t\tfunction($value) use ($min, $max, $integer)\n\t\t{\n\t\t\tif (!is_numeric($value)) {\n\t\t\t\tthrow new Exception('Could not validate number');\n\t\t\t}\n\n\t\t\tif ($integer) {\n\t\t\t\t$value = intval($value, 10);\n\t\t\t} else {\n\t\t\t\t$value = floatval($value);\n\t\t\t}\n\n\t\t\tif (is_numeric($value) && $value >= $min && $value <= $max) {\n\t\t\t\treturn $value;\n\t\t\t}\n\n\t\t\tthrow new Exception('Could not validate number');\n\t\t}\n\t);\n}", "private function numeric($field, $value) {\n if(!is_numeric($value)) {\n $this->errors[$field][] = self::ERROR_NUMERIC;\n }\n }", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "function validateFieldsNumeric($fields)\n {\n foreach($fields as $tempField) {\n if(!is_numeric($tempField)) {\n throw new \\Exception(\"An exception thrown. The variable: <strong>\" . array_search($tempField, $fields) . \"</strong> must be declared in number.\" . \" Found: <strong>\" . $tempField . \"</strong>\");\n }\n }\n }", "public function validIntegers() {}", "function valid_phone($phone_number)\n\t{\n\t\tif(!is_numeric($phone_number)) {\n\t\t\t$this->form_validation->set_message('phone_number', 'Invalid Phone Number');\n\t\t}\n\t}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function requireNumbers($num = 1) {\n // Makes sure that the passed argument is a number and is greater than 0.\n\tif (is_numeric($num) && $num > 0) {\n // If so, it is assigned to the respective property of the current instance.\n\t $this->_minimumNumbers = (int) $num; \n\t}\n }", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "public function checkNumberFormat($data) {\n // KienNH 2016/04/20: Alway check language_type, page and limit\n $_number_format = array_merge($this->_number_format, array('language_type', 'page', 'limit'));\n\n foreach ($_number_format as $field) {\n\n if (!empty($data[$field]) && !is_numeric($data[$field])) {\n $this->_addError(self::ERROR_CODE_FIELD_FORMAT_NUMBER, $field, $data[$field]);\n $this->_invalid_parameter = $field;\n return false;\n }\n }\n\n return true;\n }", "public function validate(){\n\t\t// Loop through model's rules array.\n\t\tforeach($this->rules() as $field => $rules){\n\t\t\t// Take the value of field this rule is for.\n\t\t\t$value = $this->{$field};\n\t\t\t// Loop through all rules for this field.\n\t\t\tforeach($rules as $rule){\n\t\t\t\t$ruleType = $rule;\n\t\t\t\t// If the rule is an array, not string, read its type from first index.\n\t\t\t\tif(is_array($ruleType)){\n\t\t\t\t\t$ruleType = $ruleType[0];\n\t\t\t\t}\n\n\t\t\t\t// Rule: field is required.\n\t\t\t\tif($ruleType === 'required' && !$value){\n\t\t\t\t\t$this->addError($field, 'required', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: field value must validate as email.\n\t\t\t\telse if($ruleType === 'email' && !filter_var($value, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t$this->addError($field, 'email', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: string length comparisons.\n\t\t\t\telse if($ruleType === 'length'){\n\t\t\t\t\t// String has rule for minimum length.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'min', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for maximum length.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'max', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for exact length.\n\t\t\t\t\tif(array_key_exists('equal', $rule) && $rule['equal'] != strlen ($value)){\n\t\t\t\t\t\t$this->addError($field, 'equal', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: field value must match comparison field's value.\n\t\t\t\telse if($ruleType === 'compare' && $value != $this->{$rule['field']}){\n\t\t\t\t\t$this->addError($field, 'compare', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: number comparisons.\n\t\t\t\telse if($ruleType === 'numeric'){\n\t\t\t\t\t// Value must validate to an integer number.\n\t\t\t\t\tif(array_key_exists('integer', $rule) && $rule['integer'] && filter_var($value, FILTER_VALIDATE_INT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'integer', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must validate to float number.\n\t\t\t\t\telse if((!array_key_exists('integer', $rule) || (array_key_exists('integer', $rule) && !$rule['integer'])) && filter_var($value, FILTER_VALIDATE_FLOAT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'numeric', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must be at least a minimum number.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmin', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value cannot be larger than a maximum number.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmax', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: unique database entry.\n\t\t\t\telse if($ruleType === 'unique'){\n\t\t\t\t\t// Check for match in database.\n\t\t\t\t\t$found = $this->findOne([\"$field\" => \"$value\"]);\n\t\t\t\t\tif($found){\n\t\t\t\t\t\t$this->addError($field, 'unique', $rule);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// Rule: on action only.\n\t\t\t\telse if($ruleType === 'on'){\n\t\t\t\t\t// If field is used on create only and request is not for create, field is not used.\n\t\t\t\t\tif($rule['action'] === 'create' && !$this->isCreate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t\t// IF field is used on update only and request is not for update, field is not used.\n\t\t\t\t\telse if($rule['action'] === 'update' && !$this->isUpdate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn empty($this->errors);\n\t}", "function validate_input($input_data, $input_type) {\n $output_data = trim($input_data);\n $output_data = stripslashes($output_data);\n $output_data = htmlspecialchars($output_data);\n if($input_type == 'text') {\n // not sure what to do here; \n }\n if($input_type == 'number') {\n if(!is_numeric($output_data)) {\n return false;\n }\n }\n return $output_data;\n}", "function testValidNumberFieldExpectsDataReturned() {\n\t\t$TestNumberField = new TestNumberField();\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field_one' => 2,\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestNumberField->validate($_POST['post_ID'], $TestNumberField->fields['field_one'], $validated['field_one'], array());\n\n\t\t// assert\n\t\t$expected = 2;\n\t\t$this->assertEquals(\n\t\t\t$expected,\n\t\t\t$validated['field_one'],\n\t\t\t'Numeric strings should be accepted and converted to a number.');\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\n\t\t\t// phone_no and message are required\n\t\t\tarray('phone_no, message', 'required','message'=>''),\n\t\t\tarray('phone_no','numerical', 'integerOnly'=>true ,'message'=>''),\n\t\t\tarray('phone_no', 'length', 'max'=>12),\n\n\t\t\n\t\t\n\t\t);\n\t}", "protected function validateNumber($value){\n\t\treturn is_numeric($value);\n\t}", "function isInteger($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif(!is_integer($value)){\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "public abstract function validation();", "public function rules()\n {\n return [\n 'or_number' => 'required|min:1'\n ];\n }", "function testTextFieldGivenNumberExpectsNumericStringValueReturned() {\n\n\t\t// arrange\n\t\tglobal $post;\n\t\t$TestValidTextField = new TestValidTextField();\n\t\t$TestValidTextField->fields['field']['type'] = 'text';\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field' => 1,\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestValidTextField->validate($_POST['post_ID'], $TestValidTextField->fields['field'], $validated['field'], array());\n\n\t\t// assert\n\t\t$this->assertEquals('1', $validated['field']);\n\t}", "public function validate_method($var){\r\n if(is_numeric($var)){\r\n return null;\r\n }else{\r\n return $this->fail_message;\r\n }\r\n }", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "function ding_voxb_admin_validate($form, &$form_state) {\n $input = $form_state['input'];\n\n if (!is_numeric($input['voxb_institution_id'])) {\n form_set_error('voxb_institution_id', t('This field requires a numeric value.'));\n }\n}", "public function testGetDefaultErrorMessages()\n {\n $validator = new Integer();\n $this->assertEquals([], $validator->errors());\n }", "function validateInput($type, &$error, $options_arr) {\n if (!filter_var($_POST[$type], FILTER_VALIDATE_INT, $options_arr)) {\n $error = \"* Invalid ${type}\";\n return false;\n } else {\n return true;\n }\n }", "public function numeric(): static\r\n {\r\n if (!is_numeric($this->field) && !preg_match(\"/^[0-9]*$/\", $this->field)) $this->message(\"should be only numbers\");\r\n return $this;\r\n }", "function cleanInput($infoUser, $type)\r\n {\r\n switch($type)\r\n {\r\n case 0:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\r\n $error = filter_var($error, FILTER_DEFAULT);\r\n break;\r\n\r\n case 1:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_EMAIL);\r\n $error = filter_var($error, FILTER_VALIDATE_EMAIL);\r\n break;\r\n\r\n case 2:\r\n\r\n\r\n //$error = filter_var($infoUser, FILTER_SANITIZE_NUMBER_INT);\r\n if (filter_var($infoUser, FILTER_VALIDATE_INT) === 0 || !filter_var($infoUser, FILTER_VALIDATE_INT) === false) {\r\n $error = filter_var($infoUser, FILTER_VALIDATE_INT);\r\n } else {\r\n echo(\"Integer is not valid\");\r\n }\r\n break;\r\n\r\n case 3:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\r\n $error = filter_var($error, FILTER_DEFAULT);\r\n break;\r\n\r\n\r\n }\r\n return $error;\r\n\r\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function check()\n {\n return ctype_digit($this->value);\n }", "function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "function _geneshop_qty_element_validate($element, &$form_state, $form) {\n if (!filter_var($element['#value'], FILTER_VALIDATE_INT) || $element['#value'] <= 0) {\n form_error($element, t('Incorrect value of qty'));\n }\n}", "protected function validateNumber($value) {\n if (preg_match(\"/^\\-?[0-9\\ ]+[\\.|\\,]?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid number\"));\n return false;\n }", "function validateAll(){\n foreach($this->fields as $field){\n $val = $_POST[$field['id']];\n if($field['validate']){\n switch($field['type']){\n case \"email\":\n if(!filter_var($val, FILTER_VALIDATE_EMAIL)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n break;\n case \"number\":\n if(!is_numeric($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n if($this->fields[$field['id']]['min'] > $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n if($this->fields[$field['id']]['max'] < $val){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"password\":\n if($this->fields[$field['id']]['compare']){\n $compareWith = $this->fields[$field['id']]['compare'];\n if($val != $_POST[$compareWith]){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }else if(!$this->validatePassword($val) || !$this->validatePassword($_POST[$compareWith])){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->fields[$compareWith]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }else{\n if(!$this->validatePassword($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n break;\n case \"date\":\n if(!$this->validateDate($val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }else{\n if(isset($this->fields[$field['id']]['min'])){\n $min = $this->fields[$field['id']]['min'];\n if($this->compareDates($min, $val)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n if(isset($this->fields[$field['id']]['max'])){\n $max = $this->fields[$field['id']]['max'];\n if($this->compareDates($val, $max)){\n $this->fields[$field['id']]['class'] .= \" error\";\n $this->has_errors = true;\n }\n }\n }\n break;\n case \"radio\":\n if(!$val){\n $this->fields[$field['id']]['error'] .= \" error\";\n }\n break;\n default:\n if(!$val){\n $this->fields[$field['id']]['class'] .= \" error\";\n }\n }\n }\n }\n return ($this->has_errors ? false : true);\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "protected function validateRecipients(): void\n {\n if (count($this->recipients) == 0) {\n throw new IncorrectPhoneNumberFormatException();\n }\n foreach ($this->recipients as $recipient) {\n if (strstr($recipient, ' ') || strlen($recipient) < 10) {\n throw new IncorrectPhoneNumberFormatException();\n }\n }\n }", "function validateIntegerFields($integerFields, $errorMsg=NULL)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($integerFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!filter_var($_REQUEST[$fieldName], FILTER_VALIDATE_INT)) \n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" & \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first \n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg, 0);\n\t\t\t\n\t\t\tforeach($errorArray as $error)\n\t\t\t{\n\t\t\t\t$errorOut .= $error.'<br/>';\n\t\t\t}\n\t \n\t\t\t\n\t\t }\n\t\n\treturn $errorOut;\n}", "private function addValidationError()\n {\n $validationError = new ValidationError();\n $validationError->setValidationCode($this->validation->getValidationCode());\n if ($this->eachFieldName && $this->eachIndex) {\n $eachField = $this->formDataHandler->getFormValue($this->eachFieldName);\n $eachFieldValue = $eachField[$this->eachIndex][$this->formFieldName];\n $validationError->setFormValue($eachFieldValue);\n $validationError->setFormField($this->eachFieldName);\n $validationError->setEachFieldName($this->formFieldName);\n $validationError->setEachIndex($this->eachIndex);\n } else {\n $validationError->setFormValue($this->formDataHandler->getFormValue($this->formFieldName));\n $validationError->setFormField($this->formFieldName);\n }\n if ($this->errorText) {\n $validationError->setCustomErrorText($this->errorText);\n }\n $this->validationErrorHandler->addValidationError($validationError);\n }", "public function __construct() {\n\t\n\t\t\t//Call the parent constructor\n\t\t\tparent::__construct();\n\t\t\t\n\t\t\t$this->validate = array_merge( \n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => [\n\t\t\t\t\t\t\t\t'rule' \t=> 'alphaNumeric',\n\t\t\t\t\t\t\t\t'required' \t=>\ttrue,\n\t\t\t\t\t\t\t\t'message' \t=> \tparent::$alphaNumericMessage\n\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t$this->validate\n\t\t\t\t\t);\n\n\t\t}", "public function rules() {\n\t\t\t$this->rules['number'] = 'required|integer|unique:employees,number,'.$this->id;\n\t\t\treturn $this->rules;\n\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "public function rules()\n {\n return [\n 'quantity'=>'required|min:1|max:99999999999|integer',\n ];\n }", "public function numbers_only($value)\n{\n //return preg_match('/^([0-9]+)$/', $value);\n return ctype_digit(strval($value));\n}", "public function invalidIntegers() {}", "public function rules()\n {\n return [\n 'cell' => 'bail|required|digits:11',\n 'type' => 'bail|required|integer',\n ];\n }", "public function testGetErrorMessagesAfterFailure()\n {\n $validator = new Integer();\n $validator->isValid(\"23\");\n $this->assertCount(1, $validator->errors());\n }", "public function rules()\n {\n return ['quantity' => 'required|min:1|integer|max:9999'];\n }", "function get_input_number($id_campo, $lbl_campo, $value, $arr_err, $class='campo', $min=1, $max=9999, $decimal=false, $placeholder='') {\n $aux_aplicar_decimal = ($decimal == true) ? ' step=\".01\" ' : '';\n \n $o = '<div class=\"'.$class.'\">'; //output\n $o .= $lbl_campo;\n $o .= (isset($arr_err[$id_campo])) ? $arr_err[$id_campo] : '';\n $o .= '<input type=\"number\" max=\"'.$max.'\" min=\"'.$min.'\" id=\"'.$id_campo.'\" name=\"'.$id_campo.'\" '.$aux_aplicar_decimal.' placeholder=\"'.$placeholder.'\" value=\"'.htmlspecialchars(stripslashes($value)).'\" />';\n $o .= '</div>';\n return $o;\n }", "public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}", "public function rules()\n { \n \n return [\n 'edit_cena'=>'required|numeric|gt:0'\n ];\n \n }", "public function getInputErrors();", "public function rules()\n {\n return [\n 'user_tel' => 'required|digits:11|numeric|unique:shop_user',\n 'user_pwd' => 'required'\n ];\n }", "public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }", "public function validation() {\r\n return array(\r\n array(\r\n 'jenis_pelanggaran,sanksi_pelanggaran,poin_pelanggaran', 'required',\r\n \r\n ),\r\n \r\n \r\n array(\r\n 'poin_pelanggaran','numeric',\r\n ),\r\n );\r\n }", "public static function validate_numeric_integer_or_decimal_values($val) { // {{{SYNC-DETECT-PURE-NUMERIC-INT-OR-DECIMAL-VALUES}}}\n\t//--\n\t$val = (string) $val; // do not use TRIM as it may strip out null or weird characters that may inject security issues if not trimmed outside (MUST VALIDATE THE REAL STRING !!!)\n\t//--\n\t$regex_decimal = (string) self::regex_stringvalidation_expression('number-decimal', 'full');\n\t//--\n\tif(((string)$val != '') AND (is_numeric($val)) AND (preg_match((string)$regex_decimal, (string)$val))) { // detect numbers: 0..9 - .\n\t\treturn true; // VALID\n\t} else {\n\t\treturn false; // NOT VALID\n\t} //end if else\n\t//--\n}", "protected function validateAttribute($object,$attribute) {\n\t\tparent::validateAttribute($object, $attribute);\n\n\t\t$value = $object->$attribute;\n\t\tif(!preg_match($this->ausTelPattern, $value)) {\n\t\t\t// Not a valid Australian Telephone Number\n\t\t\t$message=$this->message!==null?$this->message:\\Yii::t('yii','{attribute} is not a valid Australian telephone number.');\n\t\t\t$this->addError($object,$attribute,$message);\n\t\t} else {\n\t\t\t// Passed valid number test, now make it look right\n\t\t\t// If it has 61 - replace with 0\n\t\t\t$value = preg_replace('/61/', '0', $value);\n\t\t\t// If there are not space add spaces as follows:\n\t\t\t// 04xx xxx xxx\n\t\t\t// 08 xxxx xxxx\n\t\t\tif(preg_match('/^04/', $value)) {\n\t\t\t\t$value = substr($value, 0, 4).' '.substr($value, 4, 3).' '.substr($value, 7);\n\t\t\t}\n\t\t\tif(preg_match('/^0[^4]/', $value)) {\n\t\t\t\t$value = substr($value, 0, 2).' '.substr($value, 2, 4).' '.substr($value, 6);\n\t\t\t}\n\t\t\t$object->value = $value;\n\t\t}\n\t}", "public function validation();", "public function rules()\n {\n return [\n 'amount' => 'required|numeric|between:1,99999999.99'\n ];\n }", "function validar(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n\n if (empty($_POST[\"noEmpleado\"])) {\n $this->numEmpErr = \"El numero de empleado es requerido\";\n } else {\n $this->noEmpleado = $this->test_input($_POST[\"noEmpleado\"]);\n if (is_numeric($this->noEmpleado)) {\n $this->numEmpErr = \"Solo se permiten numeros\";\n }\n }\n\n if (empty($_POST[\"nombre\"])) {\n $this->nameErr = \"El nombre es requerido\";\n } else {\n $this->nombre = $this->test_input($_POST[\"nombre\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->nombre)) {\n $this->nameErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"carrera\"])) {\n $this->carreraErr = \"La carrera es requerida\";\n } else {\n $this->carrera = $this->test_input($_POST[\"carrera\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->carrera)) {\n $this->carreraErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"telefono\"])) {\n $this->telErr = \"El telefono es requerido\";\n } else {\n $this->telefono = $this->test_input($_POST[\"telefono\"]);\n if (is_numeric($this->telefono)) {\n $this->telErr = \"Solo se permiten numeros\";\n }\n }\n\n }\n }", "function validarNullInt($valor,&$error, $campo) {\n\n $CI = & get_instance();\n \n if(trim($valor) == \"\"):\n \n return true;\n \n else:\n \n if(filter_var($valor, FILTER_VALIDATE_INT) === FALSE):\n \n $error = mensajeCampo($campo);\n return false;\n\n else:\n \n return true;\n\n endif;\n\n endif;\n\n}", "public function rules()\n {\n return [\n 'model' => 'required',\n 'quantity' => 'numeric|required'\n ];\n }", "public function validate(): bool\n {\n return is_int($this->value);\n }", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function validateInput($arr)\n {\n $element = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER);\n $key = 'el' . $element->getId();\n $arr[$key] = preg_replace('#[^0-9]#', '', $arr[$key]);\n $arr[$key] = ltrim($arr[$key], '0');\n\n return parent::validateInput($arr);\n }", "function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}", "public function rules()\n {\n return [\n 'id' => 'required|numeric'\n ];\n }", "function check($a, $b) {\n if (is_numeric($a) && is_numeric($b)) {\n return true;\n } else {\n return \"please enter numbers only.\";\n }\n}", "protected function type_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('type_name', translate('name'), 'trim|required|callback_unique_type');\n }", "public function validate($field, $value) {\n if (! empty($value) && ($value != '')) {\n if ((! is_numeric($value)) || (is_numeric($value) && (floatval($value) != intval($value)))) {\n throw new \\fwk\\exceptions\\InvalidInput(sprintf(_('%s should be a valid int'), $field));\n }\n }\n return true;\n }", "public function rules() //date / email /integer / numeric\n {\n return [\n 'matricula'=> 'required|string|nullable|min:1|max:8',\n 'marca'=> 'required|string|max:40',\n 'modelo'=> 'required|max:40',\n 'num_lugares'=> 'required|integer|min:1|max:11',\n 'conta_horas'=> 'required|digits_between:1,11',\n 'preco_hora' => 'required|numeric|between:0,9999999999999.99'\n ];\n }", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "public function numeric()\n {\n return $this->rule('numeric');\n }", "public function validate()\n\t{\n\t\t$props = array('to', 'content', 'countryCode');\n\n\t\tforeach ($props as $p) {\n\t\t\tif (empty($this->$p)){\n\t\t\t\tthrow new ValidationException(\"Message property '$p' is required\", ValidationException::CODE_REQUIRED, $p);\n\t\t\t}\n\t\t}\n\n\t\tif ( ! preg_match('/^(\\d{3}|\\d{5})$/', $this->countryCode)) {\n\t\t\tthrow new ValidationException(\"Country code must be exactly 3 or 5 digits long\", ValidationException::CODE_UNEXP_FORMAT, $p);\n\t\t}\n\t}", "protected static function validate_numeric($field, $input, $param = NULL)\n\t{\n\t\tif(!isset($input[$field]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!is_numeric($input[$field]))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'field' => $field,\n\t\t\t\t'value' => $input[$field],\n\t\t\t\t'rule'\t=> __FUNCTION__\n\t\t\t);\n\t\t}\n\t}" ]
[ "0.69244134", "0.6674316", "0.6653331", "0.6607713", "0.65993696", "0.643232", "0.639", "0.6237006", "0.6194095", "0.6114547", "0.60940814", "0.60489476", "0.6038087", "0.6010902", "0.6005032", "0.60026234", "0.5994022", "0.5946864", "0.5941952", "0.5940506", "0.5923564", "0.5901221", "0.5898344", "0.5885035", "0.58787274", "0.5872149", "0.58573365", "0.5842898", "0.5816152", "0.5806934", "0.5787542", "0.57804525", "0.57626516", "0.57453626", "0.57358724", "0.57306033", "0.57113177", "0.57084185", "0.5699555", "0.56959766", "0.56798", "0.56566566", "0.56429857", "0.5642079", "0.56202054", "0.56154466", "0.55835617", "0.557682", "0.55734384", "0.5568912", "0.55632067", "0.5562056", "0.55587393", "0.55379707", "0.5536636", "0.552481", "0.55184895", "0.55173403", "0.5511256", "0.54984593", "0.54984593", "0.54857844", "0.54741204", "0.5467092", "0.54664016", "0.54650545", "0.54615337", "0.5444117", "0.54266274", "0.54216784", "0.5410835", "0.54011714", "0.539271", "0.5391244", "0.53863376", "0.5385125", "0.5384236", "0.53787965", "0.5377164", "0.53768396", "0.5375796", "0.5371081", "0.53698784", "0.5369704", "0.53693974", "0.53681403", "0.5363505", "0.53632396", "0.53612083", "0.53600633", "0.5357837", "0.5353094", "0.53498894", "0.53492737", "0.5347516", "0.5346156", "0.53443205", "0.5340319", "0.5338921", "0.5338897", "0.5336904" ]
0.0
-1
Gets all scheduled tasks executed by this plugin.
public function getScheduledTasks(&$tasks) { $tasks[] = new ScheduledTask( 'Piwik\Plugins\CorePluginsAdmin\MarketplaceApiClient', 'clearAllCacheEntries', null, new Daily(), ScheduledTask::LOWEST_PRIORITY ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getCronTasks()\n {\n return array(\n // Cron task to check for incoming email tickets\n array(\n 'key' => 'tss_order_sync',\n 'plugin_dir' => 'thesslstore',\n 'name' => Language::_(\n 'TheSSLStorePlugin.getCronTasks.tss_order_sync_name',\n true\n ),\n 'description' => Language::_(\n 'TheSSLStorePlugin.getCronTasks.tss_order_sync_desc',\n true\n ),\n 'type' => 'time',\n 'type_value' =>'00:00:00' ,\n 'enabled' => 1\n ),\n array(\n 'key' => 'tss_expiration_reminder',\n 'plugin_dir' => 'thesslstore',\n 'name' => Language::_(\n 'TheSSLStorePlugin.getCronTasks.tss_expiration_reminder_name',\n true\n ),\n 'description' => Language::_(\n 'TheSSLStorePlugin.getCronTasks.tss_expiration_reminder_desc',\n true\n ),\n 'type' => 'time',\n 'type_value' => '00:00:00',\n 'enabled' => 1\n )\n );\n }", "public function getRegisteredTasks()\n {\n return $this->_registeredTask;\n }", "public function getTasks()\n {\n return $this->tasks;\n }", "public function getTasks()\n {\n return $this->_tasks;\n }", "public function getTasks() {\n\t\treturn $this->tasks;\n\t}", "public function getTasks() {\n\t\treturn $this->tasks;\n\t}", "public function list()\n\t\t{\n\t return Task::all();\n\t\t}", "public static function getTasksList()\n {\n return array('savewebsite', 'exec', 'execquery', 'clearcache', 'cleart3temp');\n }", "public function getTasks();", "public function getTasks();", "public function getCronTasks(){\n $list = [];\n\n foreach($this->config[\"imports\"] as $key => $task) {\n if(!isset($task[\"interval\"]) || !$task[\"interval\"])\n continue;\n\n $list[$key] = $task[\"interval\"];\n }\n\n return $list;\n }", "public static function runScheduledTasks()\n {\n // Ignore script execution time limit.\n set_time_limit(0);\n // Clean up any failed tasks and check that\n // all available tasks are scheduled.\n self::cleanDatabase();\n self::updateUnscheduledTasks();\n $tasks = self::search()\n ->sortByField(self::FIELD_SCHEDULED)\n ->filterByField(self::FIELD_STARTED, null)\n ->filterByField(self::FIELD_SCHEDULED, time(), DFieldSearch::OPERATOR_LESS_THAN_OR_EQUAL)\n ->getFields();\n foreach ($tasks as $task) {\n self::runScheduledTask($task);\n }\n }", "public function getTasks()\n {\n if ($this->tasks === null) {\n $this->tasks = $this->discoverTaskTypes();\n }\n\n return $this->tasks;\n }", "public function getTasks() {\n if (is_null($this->_tasks)) {\n $this->_tasks = new \\PhpTaskDaemon\\Daemon\\Tasks();\n }\n\n return $this->_tasks;\n }", "public function getScheduled()\n {\n $jobs = array();\n \n $scheduled = $this\n ->_em\n ->getRepository($this->_entityClass)\n ->createQueryBuilder('s')\n ->andWhere('s.schedule is not NULL')\n ->andWhere('s.active = :active')\n ->setParameters(array('active' => 0))\n ->getQuery()\n ->getResult(); \n \n foreach ($scheduled as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n return $jobs;\n \n }", "function getScheduledTasks ( $notification )\n\t{\n\t\t$maxHourOffset = 0;\n\t\t$sites = Piwik_SitesManager_API::getInstance()->getSitesWithAtLeastViewAccess();\n\t\t$baseDate = Piwik_Date::factory(\"1971-01-01\");\n\t\tforeach($sites as &$site)\n\t\t{\n\t\t\t$offsetDate = Piwik_Date::factory($baseDate, $site['timezone']);\n\n\t\t\t// Earlier means a negative timezone\n\t\t\tif ( $offsetDate->isEarlier($baseDate) )\n\t\t\t{\n\t\t\t\t// Gets the timezone offset\n\t\t\t\t$hourOffset = (24 - date ('H', $offsetDate->getTimestamp()));\n\n\t\t\t\tif ( $hourOffset > $maxHourOffset )\n\t\t\t\t{\n\t\t\t\t\t$maxHourOffset = $hourOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tasks = &$notification->getNotificationObject();\n\n\t\t$dailySchedule = new Piwik_ScheduledTime_Daily();\n\t\t$dailySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'dailySchedule', $dailySchedule );\n\n\t\t$weeklySchedule = new Piwik_ScheduledTime_Weekly();\n\t\t$weeklySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'weeklySchedule', $weeklySchedule );\n\n\t\t$monthlySchedule = new Piwik_ScheduledTime_Monthly();\n\t\t$monthlySchedule->setHour($maxHourOffset);\n\t\t$tasks[] = new Piwik_ScheduledTask ( $this, 'monthlySchedule', $monthlySchedule );\n\t}", "public function getAllTasks()\n\t{\n\t\treturn $this->task->orderBy('is_completed', 'ASC')->get();\t\n\t}", "public function getTasks()\n {\n \tif ($this->tasks == null) {\n \t\t$this->tasks = $this->itemLinkService->getLinkedItemsOfType($this->me(), 'from', 'Task');\n \t}\n \treturn $this->tasks;\n }", "public function getLoadedTasks()\n {\n return $this->createOldStyleTaskList($this->getRegisteredTasks());\n }", "public function get()\n {\n return $this->tasks;\n }", "function GetTasks()\n\t{\n\t\t$result = $this->sendRequest(\"GetTasks\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getAvailableTasks();", "public function getPendingSchedules()\n {\n return $this->db->where('status', self::STATUS_PENDING)\n ->get($this->cron_schedule_table_name)\n ->result_array();\n }", "public function all($options = [])\n {\n list($code, $tasks) = $this->httpClient->get(\"/tasks\", $options);\n return $tasks; \n }", "public static function tasks ()\r\n {\r\n $acl = Session::get('acl');\r\n return $acl['tasks'];\r\n }", "public function getAll($accountId = null) {\n global $registry;\n\n $taskIds = [];\n $tasks = [];\n\n // Take all IDs of Tasks\n $taskIds = $registry->call('tasks/listUids');\n\n // Iterate through all IDs and export for each ID an iCal task\n foreach ($taskIds as $id) {\n $iCalTask = $registry->call('tasks/export', array($id, 'text/calendar'));\n array_push($tasks, $iCalTask);\n }\n\n return $tasks;\n }", "public final function getScheduledDeletes()\n {\n if ($this->_scheduledDeletes === null)\n return array();\n \n return $this->_scheduledDeletes;\n }", "public function listTasks()\n {\n $arr_tasks = [];\n $obj_request = new TaskQueueQueryTasksRequest();\n $obj_response = new TaskQueueQueryTasksResponse();\n $obj_request->setQueueName($this->str_name);\n $obj_request->setMaxRows(self::MAX_LIST_ROWS);\n $this->makeCall('QueryTasks', $obj_request, $obj_response);\n if ($obj_response->getTaskSize() > 0) {\n foreach ($obj_response->getTaskList() as $obj_source_task) {\n /** @var \\google\\appengine\\TaskQueueQueryTasksResponse\\Task $obj_source_task */\n $arr_tasks[] = (new Task())\n ->setName($obj_source_task->getTaskName())\n ->setPayload($obj_source_task->getBody())\n ->setEta($obj_source_task->getEtaUsec() / 1e6);\n }\n }\n return $arr_tasks;\n }", "public function getListInstallerTasks() {\n\t\treturn $this->_getConfigValueArray('installTasks');\n\t}", "public function ReloadTasks()\n\t{\n\t\t$this->_tasks = array();\n\t\n\t\t$sql = \"SELECT `ps`.*, ISNULL(`a`.`id_task`) AS `active`\n\t\t\t\tFROM `{poker_scheduler}` AS `ps`\n\t\t\t\tLEFT JOIN (SELECT `id_task` FROM `{poker_scheduler}` WHERE `uid`= %d AND `moment` > NOW()) AS `a` USING(`id_task`)\n\t\t\t\tWHERE `uid`= %d AND (`moment` <= NOW() OR `visible` = 1) ORDER BY `moment` DESC\";\n\t\t\n\t\t$res = db_query($sql, $this->_user->uid, $this->_user->uid);\n\t\t\n\t\tif ($res)\n\t\t{\n\t\t\twhile (($task = db_fetch_object($res)))\n\t\t\t{\n\t\t\t\t$triggers = json_decode($task->trigger);\n\t\t\t\t\n\t\t\t\tif (is_array($triggers))\n\t\t\t\t{\n\t\t\t\t\t$task->trigger = $triggers;\n\t\t\t\t\t\n\t\t\t\t\tforeach($triggers as $trigger)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_tasks[$trigger][$task->id_task] = $task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->ClearNewTask();\n\t\t}\n\t}", "private static function get_tasks()\n\t{\n\t\tif( !is_object(self::$_tasks) )\n\t\t\t{\n\t\t\t\tself::$_tasks = new ArrayObject();\n\t\t\t}\n\n\t\t// 1. Get task objects from files.\n\t\tglobal $gCms;\n\t\t$dir = $gCms->config['root_path'].'/lib/tasks';\n\n\t\t$tmp = new DirectoryIterator($dir);\n\t\t$iterator = new RegexIterator($tmp,'/class\\..+task\\.php$/');\n\t\tforeach( $iterator as $match )\n\t\t\t{\n\t\t\t\t$tmp = explode('.',basename($match->current()));\n\t\t\t\tif( is_array($tmp) && count($tmp) == 4 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$classname = $tmp[1].'Task';\n\t\t\t\t\t\trequire_once($dir.'/'.$match->current());\n\t\t\t\t\t\t$obj = new $classname;\n\t\t\t\t\t\tif( $obj instanceof CmsRegularTask )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tself::$_tasks->append($obj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\n\t\t// 2. Get task objects from modules.\n\t\tglobal $gCms;\n\t\t$opts = $gCms->GetModuleOperations();\n\t\t$modules = $opts->get_modules_with_capability('tasks');\n\t\tif (!$modules) return;\n\t\tforeach( $modules as $one )\n\t\t\t{\n\t\t\t\tif( !method_exists($one,'get_tasks') ) continue;\n\n\t\t\t\t$tasks = $one->get_tasks();\n\t\t\t\tif( $tasks )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( !is_array($tasks) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tmp = array($tasks);\n\t\t\t\t\t\t\t\t$tasks = $tmp;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach( $tasks as $onetask )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( is_object($onetask) && $onetask instanceof CmsRegularTask )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tself::$_tasks->append($onetask);\n\t\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}\n\t}", "public function getCommandsToExecute()\n {\n return $this->commands()\n ->whereNull('sended_at')\n ->orderBy('created_at', 'ASC')\n ->get();\n }", "public function getAll()\n {\n return $this->taskResourceModel->getAll();\n }", "public function getWorkflow_tasks()\n {\n return $this->workflow_tasks;\n }", "public function getTasks()\n {\n if (array_key_exists(\"tasks\", $this->_propDict)) {\n return $this->_propDict[\"tasks\"];\n } else {\n return null;\n }\n }", "public function getForCron() {\n $request_time = \\Drupal::time()->getCurrentTime();\n $plugins = [];\n foreach ($this->getActiveDefinitions() as $definition) {\n if (empty($definition['cron'])) {\n continue;\n }\n $cron_time = $this->getNextCronTime($definition);\n // Cron time returns the next available time, which may be tomorrow. We\n // only want to run times that are on the same day.\n if ($cron_time <= $request_time && date('ymd', $cron_time) == date('ymd', $request_time)) {\n $plugins[$definition['id']] = $this->createInstance($definition['id']);\n }\n }\n return $plugins;\n }", "public static function get_jobs()\n\t{\n\t\t$output = shell_exec('crontab -l');\n\t\treturn self::string_to_array($output);\n\t}", "public static function init_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::init_sync_cron_jobs();\n\t}", "function run_all_tasks() {\n\n foreach ($this->task_records as $record) {\n //if the task cache has not been updated since we began, execute\n if (!\\core\\task\\manager::static_caches_cleared_since($this->timestart)) {\n $task = $this->fetch_task_from_record($record);\n if ($task) {\n $this->run_task($task);\n }//end of if task\n }//end of if static caches\n }//end of foreach\n }", "public function getTasks0()\n {\n return $this->hasMany(Task::className(), ['executor_id' => 'id']);\n }", "public function fetch_all_tasks()\n {\n //\n }", "public function Get() {\n\t\treturn $this->CronJobs;\n\t}", "public static function clear_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::clear_sync_cron_jobs();\n\t}", "public function get_payout_schedule() {\n $crons = _get_cron_array();\n\n $schedule = array();\n\n foreach ( $crons as $timestamp => $cron ) {\n if ( isset( $cron[ 'edd_commissions_payout' ] ) ) {\n $schedule[] = $timestamp;\n }\n }\n\n sort( $schedule, SORT_NUMERIC );\n\n return $schedule;\n }", "function get_all_scheduled_tests()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('scheduled_tests')->result_array();\n }", "public function gettask()\n {\n return $this->db->get(\"tm_task\")->result_array();\n }", "function get_scheduled_days() {\n\t\treturn Clean::ids( $this->get_option( 'scheduled_day' ) );\n\t}", "protected function tasks()\n\t{\n\t\t$rollback = $this->getRollbackRelease();\n\n\t\treturn array(\n\t\t\t$this->updateSymlink($rollback),\n\t\t);\n\t}", "public function getTasks()\n {\n $sql = \"SELECT workflow.form_steps_id FROM fs_workflow workflow\n LEFT JOIN fs_workstpes task \n ON task.work_id = workflow.form_steps_id\n WHERE workflow.form_name = '$this->wf_name'\n ORDER BY workflow.form_sequence ASC\";\n\n $query = $this->conn->query($sql);\n\n $collection = new ArrayCollection();\n\n while($row = $query->fetch_assoc()) {\n $task = new task($row['form_steps_id']);\n $collection->add($task);\n }\n \n return $collection;\n }", "static function task_methods() {\n global $LANG;\n\n $a_tasks = array();\n $a_tasks[] = array('module' => 'fusioninventory',\n 'method' => 'wakeonlan',\n 'name' => $LANG['plugin_fusioninventory']['profile'][5]);\n\n return $a_tasks;\n }", "protected function getTasks($container)\n {\n $tasks = [$task = $this->argument('task')];\n\n if ($macro = $container->getMacro($task)) {\n $tasks = $macro;\n }\n\n return $tasks;\n }", "public function index()\n {\n return $this->task->all();\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_task';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function actionRunAll()\n {\n $tasks = $this->getScheduler()->getTasks();\n\n echo 'Running Tasks:'.PHP_EOL;\n $event = new SchedulerEvent([\n 'tasks' => $tasks,\n 'success' => true,\n ]);\n $this->trigger(SchedulerEvent::EVENT_BEFORE_RUN, $event);\n foreach ($tasks as $task) {\n $this->runTask($task);\n if ($task->exception) {\n $event->success = false;\n $event->exceptions[] = $task->exception;\n }\n }\n $this->trigger(SchedulerEvent::EVENT_AFTER_RUN, $event);\n echo PHP_EOL;\n }", "public function getTasks()\n {\n return $this->hasMany(Task::className(), ['author_id' => 'id']);\n }", "public function getJobs()\n {\n $this->refreshConfig();\n return $this->get();\n }", "public static function getTaskList()\n {\n $db = Db::getConnection();\n\n $result = $db->query('SELECT id, name, email, message, date FROM tasks ORDER BY id DESC');\n $tasksList = array();\n $i = 0;\n while ($row = $result->fetch()) {\n $tasksList[$i]['id'] = $row['id'];\n $tasksList[$i]['name'] = $row['name'];\n $tasksList[$i]['email'] = $row['email'];\n $tasksList[$i]['message'] = $row['message'];\n $tasksList[$i]['date'] = $row['date'];\n $i++;\n }\n return $tasksList;\n }", "private function getPendingEvents ()\n {\n return EventQueue::pending()->with('event_detail')\n ->orderBy('scheduled_start_time', 'asc')\n ->limit(100)\n ->get();\n }", "public static function GetUserTasks($uid) \n\t{\n\t\t$utasks = array();\n\t\t\n\t\tif (!is_numeric($uid))\n\t\t\tthrow new Exception(t('Error : bad parameter to CScheduler::GetUsertasks (wait only for numerics)'));\t\n\t\t\n\t\t$sql = \"SELECT `ps`.*, ISNULL(`a`.`id_task`) AS `active`\n\t\t\t\tFROM `{poker_scheduler}` AS `ps`\n\t\t\t\tLEFT JOIN (SELECT `id_task` FROM `{poker_scheduler}` WHERE `uid`= %d AND `moment` > NOW()) AS `a` USING(`id_task`)\n\t\t\t\tWHERE `uid`= %d AND (`moment` <= NOW() OR `visible` = 1) ORDER BY `moment` DESC\";\n\t\t\n\t\t$res = db_query($sql, $uid, $uid);\n\t\t\n\t\tif ($res)\n\t\t{\n\t\t\twhile (($task = db_fetch_object($res)))\n\t\t\t{\n\t\t\t\t$triggers = json_decode($task->trigger);\n\t\t\t\t\n\t\t\t\tif (is_array($triggers))\n\t\t\t\t{\n\t\t\t\t\t$task->trigger = $triggers;\n\t\t\t\t\t\n\t\t\t\t\tforeach($triggers as $trigger)\n\t\t\t\t\t{\n\t\t\t\t\t\t$utasks[$trigger][$task->id_task] = $task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $utasks;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "function GetAllSchedules() {\n\tglobal $server;\n\tglobal $user;\n\t$url = \"http://\".$server.\"/api/\".$user.\"/schedules\";\n\t$array = LaunchCurl($url);\n\treturn $array;\n}", "public function getSchedules()\n {\n return $this->hasMany(Schedule::className(), ['lesson_plan_id' => 'lesson_plan_id']);\n }", "public function getTasks()\n {\n return $this->hasMany(Task::className(), ['space_room_id' => 'id']);\n }", "static function fetchJobSchedules() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \" SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n ORDER BY job_id\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $schedule = array();\n foreach( $resultset as $record ) {\n if( false === empty( $record->repeat_time_minutes ) ) {\n $schedule[] = new ScheduledJobRepeat(\n $record->job_id, \n $record->classname, \n $record->repeat_time_minutes, \n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n else if( false === empty( $record->repeat_daily_at ) ) {\n $schedule[] = new ScheduledJobDaily(\n $record->job_id, \n $record->classname, \n $record->repeat_daily_at,\n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n }\n return $schedule;\n }", "static function get_queued_scripts() {\n\t\tglobal $wp_scripts;\n\n\t\t$loading_scripts = array();\n\t\tforeach ( $wp_scripts->queue as $key => $handle ) {\n\t\t\t$loading_scripts[ $handle ] = $wp_scripts->registered[ $handle ]->src;\n\t\t}\n\t\treturn $loading_scripts;\n\t}", "public function getTasks()\n {\n return $this->hasMany(Task::className(), ['contractor_id' => 'id']);\n }", "function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = NewsletterSchedulePeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }", "protected function getCronCommands()\n\t{\n\t\t// Identify the commands configured with a cron line\n $cronCommands = array();\n foreach (Artisan::all() as $command) {\n if ($command instanceOf CronCommandInterface) {\n $cronCommands[] = $command;\n }\n }\n\n return $cronCommands;\n\t}", "public function getTasks()\r\n\t{\r\n\t\t$tasks = array();\r\n\t\t$sql = sprintf('\r\n\t\t\tSELECT\r\n\t\t\t\tid, title\r\n\t\t\tFROM\r\n\t\t\t\ttask\r\n\t\t');\t\t\r\n\r\n\t\t$result = mysqli_query($this->db, $sql);\r\n\r\n\t\twhile ($row = $result->fetch_object())\r\n\t\t{\r\n\t\t\t$task = new Task();\r\n\t\t\t$task->id = $row->id;\r\n\t\t\t$task->title = $row->title;\r\n\r\n\t\t\t$tasks[] = json_decode((string)$task);\r\n\t\t}\r\n\r\n\t\t$result->close();\r\n\r\n\t\treturn json_encode($tasks);\r\n\t}", "public function listTasks()\n\t{\n\t\t$this->import('BackendUser', 'User');\n\n\t\t$tasksReg = 0;\n\t\t$tasksNew = 0;\n\t\t$tasksDue = 0;\n\t\t$arrReturn = array();\n\n\t\t$objTask = $this->Database->prepare(\"SELECT t.deadline, s.status, s.assignedTo FROM tl_task t LEFT JOIN tl_task_status s ON t.id=s.pid AND s.tstamp=(SELECT MAX(tstamp) FROM tl_task_status ts WHERE ts.pid=t.id)\" . (!$this->User->isAdmin ? \" WHERE (t.createdBy=? OR s.assignedTo=?)\" : \"\"))\n\t\t\t\t\t\t\t\t ->execute($this->User->id, $this->User->id);\n\n\t\tif ($objTask->numRows) \n\t\t{\n\t\t\t$time = time();\n\n\t\t\twhile ($objTask->next())\n\t\t\t{\n\t\t\t\tif ($objTask->status == 'completed')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($objTask->deadline <= $time)\n\t\t\t\t{\n\t\t\t\t\t++$tasksDue;\n\t\t\t\t}\n\t\t\t\telseif ($objTask->status == 'created' && $objTask->assignedTo == $this->User->id)\n\t\t\t\t{\n\t\t\t\t\t++$tasksNew;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t++$tasksReg;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($tasksReg > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_info\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksCur'], $tasksReg) . '</p>';\n\t\t\t}\n\n\t\t\tif ($tasksNew > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_new\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksNew'], $tasksNew) . '</p>';\n\t\t\t}\n\n\t\t\tif ($tasksDue > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_error\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksDue'], $tasksDue) . '</p>';\n\t\t\t}\n\t\t}\n\n\t\treturn implode(\"\\n\", $arrReturn);\n\t}", "function getTaskList()\n\t{\n\t\t//Update Task List\n\t\t$this->Task_List = null;\n\t\t$assigned_tasks_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Task');\n\t\tforeach($assigned_tasks_rows as $assigned_task)\n\t\t\t$this->Task_List[] = new Tasks( $assigned_task['ClientProjectTask'] );\n\t\treturn $this->Task_List;\n\t}", "public function getSchedari()\n {\n return Schedario::all();\n }", "public function getListCronJobsCreation() {\n\t\treturn $this->_getConfigValueArray('cronJobs');\n\t}", "public function getCronogramas()\n {\n return $this->cronogramas;\n }", "public function getScheduleList($params, $context) {\n\t\treturn \\OMV\\Rpc\\Rpc::call(\"cron\", \"getList\", $params, $context);\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 function getSchedules() {\n $result = DB::select(\"SELECT * FROM schedular,unnest(string_to_array(user_id, ',')) AS s_user_id WHERE s_user_id = ANY ( string_to_array('\".session('user-id').\"', ',') ) AND is_active = true order by created_date desc\" );\n if (count($result) > 0) {\n return $result;\n }\n return array();\n }", "public function getArray() {\n return $tasks = \\App\\Task::with('goal')->get();\n }", "public function actionTasks(){\n\t\t$userIdtmp = XenForo_Visitor::getUserId();\n\t\t$conditions = array('userId' => $userIdtmp);\n\t\t$order_items = $this->_getOrderItemModel()->getAllOrderItem($conditions);\n\t\t\n\t\t$viewParams = array(\n\t\t\t'tasks' => $order_items\n\t\t);\n\t\t\n\t\treturn $this -> responseView('DTUI_ViewPublic_EntryPoint_Tasks','dtui_task_list',$viewParams);\n\t}", "public function tasks()\n {\n return $this->morphMany('App\\Models\\Task', 'tasktable');\n }", "public static function updateUnscheduledTasks()\n {\n // Schedule unscheduled tasks.\n $scheduledTasks = self::search()\n ->getField(self::FIELD_TASK);\n // Load a list of all available tasks.\n $availableTasks = array_merge(\n DClassManager::getClasses(DRegularTask::class),\n DClassManager::getClasses(DNightlyTask::class)\n );\n // Schedule any unscheduled tasks.\n $unscheduledTasks = array_diff($availableTasks, $scheduledTasks);\n foreach ($unscheduledTasks as $qualifiedName) {\n /* @var $task DScheduledTask */\n $task = new $qualifiedName();\n $task->finalise();\n }\n }", "public function index()\n {\n return task::all();\n }", "public function getTasks($where = null)\n {\n $result = [];\n $byParent = [];\n $values = [];\n\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n\n $stmt = $this->db->prepare(\"select * from tasks $cond order by parentIndex\");\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get tasks list.'), E_APP_GET_TASKS);\n }\n\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $e['id'] = intval($e['id']);\n if ($e['parentId']) {\n $e['parentId'] = intval($e['parentId']);\n }\n $e['duration'] = $e['duration'] !== null ? floatval($e['duration']) : null;\n $e['percentDone'] = floatval($e['percentDone']);\n $e['parentIndex'] = intval($e['parentIndex']);\n $e['expanded'] = $e['expanded'] == 1;\n $e['effort'] = $e['effort'] !== null ? floatval($e['effort']) : null;\n $e['effortDriven'] = $e['effortDriven'] == 1;\n $e['manuallyScheduled'] = $e['manuallyScheduled'] == 1;\n\n // Force datetime fields to include server timezone info\n if (@$e['startDate']) {\n $e['startDate'] = self::applyTimeZoneToDate($e['startDate']);\n }\n if (@$e['endDate']) {\n $e['endDate'] = self::applyTimeZoneToDate($e['endDate']);\n }\n if (@$e['constraintDate']) {\n $e['constraintDate'] = self::applyTimeZoneToDate($e['constraintDate']);\n }\n if (@$e['deadline']) {\n $e['deadline'] = self::applyTimeZoneToDate($e['deadline']);\n }\n\n if (!$where) {\n $parentId = $e['parentId'] ? $e['parentId'] : '';\n if (!isset($byParent[$parentId])) {\n $byParent[$parentId] = [];\n }\n\n $byParent[$parentId][] = $e;\n } else {\n $result[] = $e;\n }\n\n unset($e['parentId']);\n }\n\n return $where ? $result : self::buildTree($byParent, '');\n }", "public function index($id)\n {\n return $this->taskListRepository->tasks($id);\n }", "function tasks()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['tasks'] == 1 ) ? 'Task' : 'Tasks';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t$taskkeys = array();\n\t\t\n\t\tforeach ( $this->xml_array['tasks_group']['task'] as $k => $v )\n\t\t{\n\t\t\t$taskkeys[] = \"'{$v['task_key']['VALUE']}'\";\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_delete( 'task_manager', \"task_key IN (\".implode( \",\", $taskkeys ).\")\" );\n\t\t\n\t\tif ( !$this->ipsclass->input['un'] )\n\t\t{\n\t\t\tforeach ( $this->xml_array['tasks_group']['task'] as $k => $v )\n\t\t\t{\n\t\t\t\t$this->_add_task( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['tasks']} {$object} {$operation}....\" );\n\t}", "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}", "public function getTasks()\n {\n return $this->hasMany(Task::className(), ['address_id' => 'id']);\n }", "function _get_cron_array()\n {\n }", "public function getTimers()\n {\n return $this->timers;\n }", "private function find_all_jobs() {\n $jobs = array();\n foreach( glob( $this->crony_job_root . '/*.php') as $job_file ) {\n $job_class = basename( $job_file, '.php' );\n\n // Before we include this job in the job list, we need to make sure it implements \\Crony\\TaskInterface\n $implementations = class_implements( $this->crony_job_namespace . '\\\\' . $job_class );\n if ( in_array( 'Crony\\TaskInterface', $implementations ) ) {\n array_push( $jobs, $job_class );\n }\n }\n\n return $jobs;\n }", "public function showAllTasks() {\n $result = $this->getTask();\n return response()->json($result);\n // return response()->json(Task::all());\n }", "function GetDocumentTemplatesTasks()\n\t{\n\t\t$result = $this->sendRequest(\"GetDocumentTemplatesTasks\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function getRegisteredTaskGroups() {}", "public function All() {\n return $this->get_all_events( 'start_date', 'DESC', false );\n }", "public function getCronCommandSections() {}", "function wp_get_ready_cron_jobs()\n {\n }", "public function tasks() {\n\n return $this->hasMany(Task::class);\n }", "public function getTimerServiceExecutor()\n {\n return $this->timerServiceExecutor;\n }", "public function getTaskTriggers()\n {\n if (array_key_exists(\"taskTriggers\", $this->_propDict)) {\n return $this->_propDict[\"taskTriggers\"];\n } else {\n return null;\n }\n }", "public function all()\n {\n return $this->commands;\n }", "protected function executeTasks() {}" ]
[ "0.71102124", "0.691206", "0.684818", "0.68444353", "0.6807654", "0.6807654", "0.673303", "0.67153317", "0.67036265", "0.67036265", "0.667695", "0.66410553", "0.65761906", "0.6525065", "0.6453267", "0.6378285", "0.6368776", "0.63155526", "0.62465566", "0.6177588", "0.6144941", "0.6136219", "0.61260027", "0.6121764", "0.6112344", "0.6085033", "0.60779226", "0.60640156", "0.60153484", "0.59969145", "0.592224", "0.5890187", "0.5882959", "0.58645076", "0.5844898", "0.5768471", "0.57549864", "0.57373375", "0.5725876", "0.57222307", "0.5721998", "0.57008606", "0.56990147", "0.5692009", "0.56860024", "0.5679511", "0.56499964", "0.5645723", "0.56449383", "0.5622614", "0.56192535", "0.55954415", "0.5548252", "0.55388373", "0.5525603", "0.5516323", "0.5497679", "0.5489279", "0.54822767", "0.54703134", "0.54616755", "0.5442556", "0.54420334", "0.54272753", "0.5415077", "0.54143137", "0.54095644", "0.5377541", "0.5374555", "0.5371797", "0.5370633", "0.53628236", "0.53496367", "0.5334092", "0.5320672", "0.53149587", "0.5283393", "0.52646", "0.52608854", "0.5258005", "0.52331585", "0.522449", "0.52244127", "0.5222922", "0.5206859", "0.5206428", "0.51912695", "0.5187394", "0.51756585", "0.5171799", "0.5168041", "0.5164398", "0.5162073", "0.516067", "0.5158182", "0.5153983", "0.514491", "0.512705", "0.5122568", "0.51213455" ]
0.6454117
14
__get Enables the use of CI superglobal without having to define an extra variable. I can't remember where I first saw this, so thank you if you are the original author. Militis
public function __get($var) { return get_instance()->$var; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ci()\n{\n\tstatic $CI;\n\tif (!$CI) $CI = get_instance();\n\treturn $CI;\n}", "function CI_Base()\n\t{\n\t\tparent::CI_Loader();\n\t\t$this->load =& $this;\n\t\t\n\t\t// This allows resources used within controller constructors to work\n\t\tglobal $OBJ;\n\t\t$OBJ = $this->load; // Do NOT use a reference.\n\t}", "function __construct()\n {\n $this->CI = &get_instance();\n }", "public function __invoke()\n {\n return static::defines('__default', true);\n }", "function __construct()\n {\n // $this->_ci =& get_instance();\n //load config \n // $this->load->library('user_agent'); \n }", "function &get_instance()\n{\n return FakeCI::get_instance();\n}", "public function __construct()\n {\n $this->CI = &get_instance();\n }", "public function __construct()\n {\n $this->CI = &get_instance();\n }", "public function __construct()\n {\n parent::__construct();\n $this->CI = &get_instance();\n }", "function runkit_superglobals()\n{\n}", "function __construct()\n\t{\n\t\t$this->_CI = &get_instance();\n\t}", "public function __construct()\n {\n $this->CI =& get_instance();\n }", "public function __construct()\n\t{\n\t\t\n\t\t// Set the super object to a local variable for use throughout the class\n\t\t$this->CI =& get_instance();\n\t}", "public function __construct()\n\t{\n\t \t$this->CI =& get_instance();\n\t}", "public function __construct() {\n $this->CI =& get_instance();\n }", "function ci_e_setting($setting)\n{\n\techo ci_setting($setting);\n}", "function Authentication()\r\n\r\n {\r\n $this->CI = &get_instance();\r\n\r\n }", "public function __construct( $get )\n\t{\n\t\t$this->m_common = new Common();\n\t\t$this->m_active_controller_name = ucfirst( strtolower( $get['v'] ) );\n\t\t\n\t}", "public function __construct()\n {\n $this->CI =& get_instance();\n }", "public function getGlobals()\n {\n }", "public function __construct()\n {\n $this->ci =& get_instance();\n }", "public function __construct()\n {\n $this->CI =& get_instance();\n \n }", "public function __construct()\n {\n // Assign the CodeIgniter super-object\n $this->CI =& get_instance();\n $this->CI->load->library('user_agent');\n $this->CI->load->library('notification');\n $this->CI->load->helper('cookie');\n $this->CI->load->helper('date');\n }", "public function __construct()\n\t{\n\t\t\t// Assign the CodeIgniter super-object\n\t\t\t$this->CI =& get_instance();\n\t}", "public function __construct()\n {\n $this->ci =& get_instance();\n }", "public function __construct()\n {\n // Assign the CodeIgniter super-object\n $this->CI =& get_instance();\n }", "public function __construct()\n {\n // Assign the CodeIgniter super-object\n $this->CI =& get_instance();\n }", "public function __construct()\n {\n // Assign the CodeIgniter super-object\n $this->CI =& get_instance();\n }", "public static function setUpBeforeClass()\n {\n self::$overrideToken = [];\n self::$overrideToken['loadAndEvaluate'] = override_method('\\Gustavus\\Utility\\File', 'loadAndEvaluate', function() {\n // just return the contents of the file and don't evaluate it.\n return file_get_contents($this->value);\n }\n );\n self::$overrideToken['renderPageNotFound'] = override_method('\\Gustavus\\Utility\\PageUtil', 'renderPageNotFound', function() {\n // just return the contents of the file and don't evaluate it.\n return 'renderPageNotFound';\n }\n );\n parent::setUpBeforeClass();\n }", "function __construct(){\n\t\t$this->_ci =& get_instance();\n\t}", "public static function Get() {\r\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// $this->load->helper('utility_helper');\n\t}", "function __get($name)\n {\n }", "public function __construct()\n {\n $config = new \\Yaf_Config_Ini(APP_INI, 'CI');\n \n $this->_allow_get_array = (bool) $config->get('allow_get_array');\n $this->_enable_xss = (bool) $config->get('global_xss_filtering');\n $this->_enable_csrf = (bool) $config->get('csrf_protection');\n $this->_standardize_newlines = (bool) $config->get('standardize_newlines');\n\n $this->security = new Security();\n\n // Do we need the UTF-8 class?\n $this->uni = new Utf8();\n\n // Sanitize global arrays\n $this->_sanitize_globals();\n }", "public function __construct()\n\t{\n\t\t$this->_ci =& get_instance();\n\t}", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "public function helper()\n\t{\n\t\n\t}", "public function __construct()\r\n\t{\r\n\t\t$this->ci =& get_instance();\r\n\t\t\r\n\t\t$this->ci->load->config('config');\r\n\t\t$this->alias_config = $this->ci->config->item('alias_config');\r\n\t\t$this->upload_config = $this->ci->config->item('upload_config');\r\n\t}", "public function __construct() {\n\n //Initialize the instance of the Codeigniter framework.\n //No Direct access from library folder\n $this->ci = & get_instance();\n $this->ci->load->library('email');\n $this->ci->config->load('email',true);\n }", "public static function provideOnResourceLoaderGetConfigVars() {\n\t}", "public function init()\n {\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\n }", "public function init()\n {\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\n }", "function get()\n {\n }", "function Cgn_SystemRequest() {\n\t\t/*\n\t\t$this->vars = Cgn_ObjectStore::getObject('request://request');\n\t\t$this->getvars = Cgn_ObjectStore::getObject('request://get');\n\t\t$this->postvars = Cgn_ObjectStore::getObject('request://post');\n\t\t$this->cookies = Cgn_ObjectStore::getObject('request://cookie');\n\t\t */\n\n\t\tif (defined ('CGN_PRODUCTION_ENVIRONMENT')) \n\t\t$this->prodEnv = CGN_PRODUCTION_ENVIRONMENT;\n\t}", "public function core();", "function &get_instance()\n{\n return KISS_Controller::get_instance();\n}", "function &ci(){\n $ci =&get_instance();\n return $ci;\n}", "public function Setup(){\r\n return $this->setup;\r\n }", "public function getGlobals();", "public function getGlobals();", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "public function __get($name)\n\t{\n\t\treturn $this->_ci->_module_get($name);\n\t}", "public function __get($key)\n {\n if (!$this->key_exists($key) && IS_DEV_MODE) {\n return \"$key property is not exists!\";\n } \n return $this->$key = $this->param($key);\n }", "function __construct()\n {\n parent::__construct();\n $this->_ci_view_paths = [];\n \n //$this->config->set_item(\"base_url\",BASE_URL);\n //$this->config->set_item(\"index_page\",\"\");\n if(!$this->components) $this->components = new Components;\n if(!$this->parser) $this->parser = new Parser;\n if(!$this->access) $this->access = new Securityaccess;\n\n }", "function get_api_key()\n{\n return get_global_value('api-key');\n}", "function get_tema(){\n $CI =& get_instance();\n $CI->load->library('sistema');\n return $CI->sistema->tema;\n\n}", "private function core()\n\t{\n\t\treturn $this->core;\n\t}", "function __construct () {\r\r\n\t\tparent::__construct();\r\r\n\t\t\r\r\n\t\t$this->CI->load->library(SYSPATH . \"tools/web_opener\");\r\r\n\t}", "public function setCi($_ci)\n {\n $this->ci = $_ci;\n }", "public function useToBuild()\n {\n }", "abstract protected function define_my_settings();", "function __construct() {\n $this-> CI =& get_instance();\n $this -> CI -> load -> model('Admin_model');\n // Nos comemos la libreria que la virgen solo corre si sale corriendo\n }", "public static function setUpBeforeClass()\n {\n self::$overrideToken = [];\n self::$overrideToken['addDocRootToPath'] = $token = override_method('\\Gustavus\\Concert\\Utility', 'addDocRootToPath', function($filePath) use (&$token) {\n if (strpos($filePath, '/cis/lib/') === 0) {\n return $filePath;\n }\n return call_overridden_func($token, null, $filePath);\n }\n );\n parent::setUpBeforeClass();\n }", "function magillDev() {\n\tglobal $magillDev;\n\treturn $magillDev;\n}", "public function __get($param);", "function setting_item($slug)\r\n{\r\n $CI =& get_instance();\r\n\r\n return $CI->setting->item($slug);\r\n}", "function base_url()\n{\n return APP::getBaseUrl();\n}", "function __construct()\n\t{\n\t\t$this->load->helper('security');\n\t}", "function ci_setting($setting)\n{\n\tglobal $ci;\n\tif (isset($ci[$setting]) and (!empty($ci[$setting])))\n\t\treturn $ci[$setting];\n\telse\n\t\treturn FALSE;\n}", "function __construct($rules = array()) {\n parent::__construct($rules);\n //$this->ci =& get_instance();\n $this->CI =& get_instance();\n }", "public function __construct()\n\t {\n\t $this->CI =& get_instance();\n $this->CI->load->helper(array('file','common'));\n $this->config=$this->CI->config->item('wechat_config');\n }", "public function __construct($config = array()) {\n $this->ci = & get_instance();\n }", "protected static function setUpBeforeClassBase()\n {\n\n }", "function MB_System() {\r\n\treturn MB_System::getInstance();\r\n}", "public function __construct()\n {\n include_once(__DIR__.\"/Define.php\");\n }", "public function __construct() {\n\n parent::__construct();\n load_class('Service', 'core');\n $this->_ci_service_paths = array(APPPATH);\n }", "public function __construct()\r\n {\r\n // Assign the CodeIgniter super-object\r\n \r\n $this->CI =& get_instance();\r\n $this->CI->load->helper('url');\r\n $this->CI->load->library('session');\r\n $this->CI->load->database();\r\n\r\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->helper('url');\n\t\t$this->load->helper('curl_helper');\n\t\t$this->load->library('form_validation');\n\t\t$this->load->library('language', array('controller' => $this->router->class));\n\t\t$this->load->config('custom');\n\t}", "function __construct()\n {\n $this->core = Core::getInstance();\n }", "function __construct() {\n parent::__construct();\n $this->load->helper('url');\n $this->load->helper('api');\n }", "public static function setup()\n {\n static $run;\n\n // This function can only be run once\n if ($run === true) {\n return;\n }\n\n // Start the environment setup benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_environment_setup');\n\n // Define Kohana error constant\n define('E_KOHANA', 42);\n\n // Define 404 error constant\n define('E_PAGE_NOT_FOUND', 43);\n\n // Define database error constant\n define('E_DATABASE_ERROR', 44);\n\n if (self::$cache_lifetime = self::config('core.internal_cache')) {\n // Are we using encryption for caches?\n self::$internal_cache_encrypt = self::config('core.internal_cache_encrypt');\n\n if (self::$internal_cache_encrypt===true) {\n self::$internal_cache_key = self::config('core.internal_cache_key');\n\n // Be sure the key is of acceptable length for the mcrypt algorithm used\n self::$internal_cache_key = substr(self::$internal_cache_key, 0, 24);\n }\n\n // Set the directory to be used for the internal cache\n if (! self::$internal_cache_path = self::config('core.internal_cache_path')) {\n self::$internal_cache_path = APPPATH.'cache/';\n }\n\n // Load cached configuration and language files\n self::$internal_cache['configuration'] = self::cache('configuration', self::$cache_lifetime);\n self::$internal_cache['language'] = self::cache('language', self::$cache_lifetime);\n\n // Load cached file paths\n self::$internal_cache['find_file_paths'] = self::cache('find_file_paths', self::$cache_lifetime);\n\n // Enable cache saving\n Event::add('system.shutdown', array(__CLASS__, 'internal_cache_save'));\n }\n\n // Disable notices and \"strict\" errors\n $ER = error_reporting(~E_NOTICE & ~E_STRICT);\n\n // Set the user agent\n self::$user_agent = (! empty($_SERVER['HTTP_USER_AGENT']) ? trim($_SERVER['HTTP_USER_AGENT']) : '');\n\n if (function_exists('date_default_timezone_set')) {\n $timezone = self::config('locale.timezone');\n\n // Set default timezone, due to increased validation of date settings\n // which cause massive amounts of E_NOTICEs to be generated in PHP 5.2+\n date_default_timezone_set(empty($timezone) ? date_default_timezone_get() : $timezone);\n }\n\n // Restore error reporting\n error_reporting($ER);\n\n // Start output buffering\n ob_start(array(__CLASS__, 'output_buffer'));\n\n // Save buffering level\n self::$buffer_level = ob_get_level();\n\n // Set autoloader\n spl_autoload_register(array('Kohana', 'auto_load'));\n\n // Set error handler\n set_error_handler(array('Kohana', 'exception_handler'));\n\n // Set exception handler\n set_exception_handler(array('Kohana', 'exception_handler'));\n\n // Send default text/html UTF-8 header\n header('Content-Type: text/html; charset=UTF-8');\n\n // Load locales\n $locales = self::config('locale.language');\n\n // Make first locale UTF-8\n $locales[0] .= '.UTF-8';\n\n // Set locale information\n self::$locale = setlocale(LC_ALL, $locales);\n\n if (self::$configuration['core']['log_threshold'] > 0) {\n // Set the log directory\n self::log_directory(self::$configuration['core']['log_directory']);\n\n // Enable log writing at shutdown\n register_shutdown_function(array(__CLASS__, 'log_save'));\n }\n\n // Enable Kohana routing\n Event::add('system.routing', array('Router', 'find_uri'));\n Event::add('system.routing', array('Router', 'setup'));\n\n // Enable Kohana controller initialization\n Event::add('system.execute', array('Kohana', 'instance'));\n\n // Enable Kohana 404 pages\n Event::add('system.404', array('Kohana', 'show_404'));\n\n // Enable Kohana output handling\n Event::add('system.shutdown', array('Kohana', 'shutdown'));\n\n if (self::config('core.enable_hooks') === true) {\n // Find all the hook files\n $hooks = self::list_files('hooks', true);\n\n foreach ($hooks as $file) {\n // Load the hook\n include $file;\n }\n }\n\n // Setup is complete, prevent it from being run again\n $run = true;\n\n // Stop the environment setup routine\n Benchmark::stop(SYSTEM_BENCHMARK.'_environment_setup');\n }", "function runkit_superglobals() : array {\n}", "protected static function initializeGlobalVariables() {}", "public function _before_init(){}", "function __construct()\n {\n // Construct our parent class\n parent::__construct();\n $this->load->helper('call_helper');\n\n }", "function shiftr() {\n global $shiftr;\n\n if ( ! isset( $shiftr ) ) {\n $shiftr = new Shiftr_Settings();\n }\n\n return $shiftr;\n}", "private function __construct() {\n \n \n $objCore = Engine_Core_Core::getInstance();\n $this->_appSetting = $objCore->getAppSetting();\n \n\n }", "public function setUp()\n {\n putenv(\"{$this->name}={$this->value}\");\n \n return;\n }", "public function __construct () {\n $this->loadEnvironment();\n }", "public function __construct()\n\t{\n\t\t$this->ci &= get_instance();\n\t\t\n\t\treturn $this;\n\t}", "function _assign_libraries()\r\n\t{\r\n\t\tif ($CI =& get_instance())\r\n\t\t{\r\n\t\t\t// Load CodeIgniters form validation if not already loaded\r\n\t\t\tif ( ! isset($CI->form_validation))\r\n\t\t\t{\r\n\t\t\t\t$CI->load->library('form_validation');\r\n\t\t\t}\r\n\r\n\t\t\t$this->form_validation = $CI->form_validation;\r\n\t\t\t$this->lang = $CI->lang;\r\n\t\t\t$this->load = $CI->load;\r\n\t\t\t$this->db = $CI->db;\r\n\t\t\t$this->config = $CI->config;\r\n\t\t}\r\n\t}", "function __construct() {\n parent::__construct();\n\t\t$this->load->database();\n\t\t$ci = get_instance();\n\t\t$ci->load->helper('string');\n }", "function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}", "public function __construct()\n\t{\n\t\t$this->ci =& get_instance();\n\t\t\n\t\t$this->ci->config->load('assets');\n\t\t$this->ci->config->load('assets_js');\n\t\t$this->ci->config->load('assets_css');\n\n $this->styles_default = $this->ci->config->item('assets_css_default');\n $this->external_scripts_default = $this->ci->config->item('assets_js_default');\n\n $this->assets_css_group = $this->ci->config->item('assets_css_group');\n $this->assets_js_group = $this->ci->config->item('assets_js_group');\n\n\t\t// Setup our host\n\t\t$this->host = $this->ci->config->item('asset_host');\n\t\t$this->host = empty($this->host) ? base_url() : $this->host;\n $this->combine = $this->ci->config->item('combine_on_'.devmode());\n\t}", "public function __get($key) {\n\t\treturn $this->config->{$key};\n\t}", "public function __construct() {\n $this->CI = & get_instance();\n $this->CI->load->helper('directory');\n log_message('info', 'Imagelib Class Initialized');\n }", "function getConfig($key)\n{\n return $GLOBALS['config'][$key];\n}", "public function core() {\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-utility.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-settings.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-sanitize.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-dynamic-css.php';\n\t\t}", "function Dosage_Controller()\n {\n parent::__construct();\n $this -> view_data['base_url'] = base_url();\n }", "public function getCore()\n {\n return Controllers\\CoreController::getInstance();\n }", "protected function getPreserveGetVars() {}" ]
[ "0.6347764", "0.6234206", "0.6067399", "0.5960223", "0.5923772", "0.5918367", "0.591714", "0.591714", "0.59123373", "0.5859731", "0.5858657", "0.5794372", "0.5780791", "0.57749873", "0.5764158", "0.5743179", "0.57177943", "0.5705867", "0.5649874", "0.5644415", "0.5644067", "0.56052786", "0.55993575", "0.55885136", "0.5582182", "0.55797356", "0.55797356", "0.55773276", "0.552786", "0.55250496", "0.550109", "0.54836625", "0.5478074", "0.5466379", "0.54375404", "0.54235256", "0.5422532", "0.54198146", "0.5414316", "0.54083276", "0.53889686", "0.53889686", "0.5386225", "0.5366557", "0.536277", "0.53577244", "0.5353913", "0.5352305", "0.53336674", "0.53336674", "0.53310704", "0.53297514", "0.53291243", "0.53210634", "0.5314694", "0.531136", "0.53089577", "0.53052753", "0.53036577", "0.52956545", "0.529554", "0.5281783", "0.52732164", "0.52729493", "0.5270469", "0.5270303", "0.5269323", "0.5264214", "0.5261726", "0.52559835", "0.5254683", "0.52506876", "0.5250547", "0.52397263", "0.5239441", "0.523687", "0.52351004", "0.5227067", "0.521573", "0.521221", "0.5209752", "0.52054006", "0.52051306", "0.5201909", "0.52006674", "0.5199057", "0.5198063", "0.5191513", "0.5190361", "0.51837814", "0.5182441", "0.5181114", "0.517507", "0.5173105", "0.51695657", "0.5167644", "0.5167052", "0.5166998", "0.51590323", "0.5153194", "0.5145154" ]
0.0
-1
check Checks users online, and add users to online list
public function check() { if(!empty($this->user)) { // If you need to check users online list in every page load, check this TRUE in config file if($this->config->item('check_users_on_page_load', 'online')) { $this->checkOnlineList(); } $this->addUser(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkOnlineList()\n {\n $this->online->checkOnlineList($this->loginTime);\n }", "public static function updateWhoIsOnline()\n {\n $users = User::all();\n foreach($users as $u)\n {\n $lastPing = $u->last_ping;\n $twoMinAgo = Carbon::now()->subMinutes(2);\n $result = Carbon::createFromFormat('Y-m-d H:i:s', $lastPing);\n\n if($twoMinAgo->lt($result))\n {\n $u->is_online = 1;\n $u->save();\n }\n else\n {\n $u->is_online = 0;\n $u->save();\n }\n }\n }", "function onlineUsers() {\n\n\tif (isset($_GET['onlineusers'])) {\n\n\t\tglobal $connection;\n\n\t\tif (!$connection) {\n\t\t\tsession_start();\n\t\t\tinclude '../include/db.php';\n\n\t\t\t$session = session_id();\n\t\t\t$time = time();\n\t\t\t$time_out_secs = 10;\n\t\t\t$time_out = $time - $time_out_secs;\n\n\t\t\t$query = \"SELECT * FROM users_online WHERE session = '$session'\";\n\t\t\t$send_query = mysqli_query($connection, $query);\n\t\t\t$count = mysqli_num_rows($send_query);\n\n\t\t\tif ($count == NULL) {\n\t\t\t\tmysqli_query($connection, \"INSERT INTO users_online(session, time) VALUES('$session', '$time')\");\n\t\t\t} else {\n\t\t\t\tmysqli_query($connection, \"UPDATE users_online SET time = '$time' WHERE session = '$session'\");\n\t\t\t}\n\n\t\t\t$users_online = mysqli_query($connection, \"SELECT * FROM users_online WHERE time > '$time_out'\");\n\t\t\techo $count_users = mysqli_num_rows($users_online);\n\t\t}\n\t}\n}", "public function get_users_online()\n {\n $logged_in_users = get_transient('agents_online'); //Get the active users from the transient.\n $count = 0;\n\n if($logged_in_users) {\n foreach ($logged_in_users as $logged_in_user) {\n if (isset($logged_in_user['last']) && ($logged_in_user['last'] > (time()-60) )) {\n $count++;\n }\n }\n } \n \n echo $count;\n die();\n }", "function addonline($uid,$place,$plclink)\n{\n $hidden=mysql_fetch_array(mysql_query(\"SELECT hidden FROM ibwf_users WHERE id='\".$uid.\"'\"));\n if($hidden[0]==0)\n {\n /////delete inactive users\n $tm = time();\n $timeout = $tm - 420; //time out = 5 minutes\n $deloff = mysql_query(\"DELETE FROM ibwf_online WHERE actvtime <'\".$timeout.\"'\");\n ///now try to add user to online list\n $res = mysql_query(\"UPDATE ibwf_users SET lastact='\".time().\"' WHERE id='\".$uid.\"'\");\n $res = mysql_query(\"INSERT INTO ibwf_online SET userid='\".$uid.\"', actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"'\");\n if(!$res)\n {\n //most probably userid already in the online list\n //so just update the place and time\n $res = mysql_query(\"UPDATE ibwf_online SET actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"' WHERE userid='\".$uid.\"'\");\n \n \n }\n }\n $maxmem=mysql_fetch_array(mysql_query(\"SELECT value FROM ibwf_settings WHERE id='2'\"));\n \n $result = mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM ibwf_online\"));\n\n if($result[0]>=$maxmem[0])\n {\n $tnow = date(\"D d M Y - H:i\");\n mysql_query(\"UPDATE ibwf_settings set name='\".$tnow.\"', value='\".$result[0].\"' WHERE id='2'\");\n }\n $maxtoday = mysql_fetch_array(mysql_query(\"SELECT ppl FROM ibwf_mpot WHERE ddt='\".date(\"d m y\").\"'\"));\n if($maxtoday[0]==0||$maxtoday==\"\")\n {\n mysql_query(\"INSERT INTO ibwf_mpot SET ddt='\".date(\"d m y\").\"', ppl='1', dtm='\".date(\"H:i:s\").\"'\");\n $maxtoday[0]=1;\n }\n if($result[0]>=$maxtoday[0])\n {\n mysql_query(\"UPDATE ibwf_mpot SET ppl='\".$result[0].\"', dtm='\".date(\"H:i:s\").\"' WHERE ddt='\".date(\"d m y\").\"'\");\n }\n}", "public function getUsersOnline()\r\n {\r\n $result = $this->getBitrixApi(array(\r\n 'FILTER' => array('IS_ONLINE' => 'Y',),\r\n ), 'user.get');\r\n\r\n if ($result) {\r\n if (isset($result['total']) && $result['total'] > 0) {\r\n return $result['result'];\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "function d4os_io_db_070_os_users_online_users_count() {\n d4os_io_db_070_set_active('os_robust');\n $now_online = db_result(db_query(\"SELECT COUNT(*) FROM {GridUser}\"\n . \" WHERE Online = 'true'\"\n . \" AND Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"));\n d4os_io_db_070_set_active('default');\n return $now_online;\n}", "public function isOnline($me, $isOnline){\r\n $poll = $this->pdo->query(\"UPDATE users SET user_isOnline = '$isOnline' WHERE user_id = '$me'\");\r\n }", "public function updateUserOnline()\n {\n $this->is_online = 1;\n $this->save();\n }", "function getUsersOnline() {\n\t//session_start();\n\t$session=session_id();\n\t$time=time();\n\t$time_check=$time-600; //SET TIME 10 Minute\n\t\n\t$tbl_name=\"useronline\"; // Table name\n\t$sql=\"SELECT * FROM $tbl_name WHERE session='$session'\";\n\t$result=mysql_query($sql);\n\t\n\t$count=mysql_num_rows($result);\n\tif($count==\"0\"){\n\t\t$sql1=\"INSERT INTO $tbl_name(session, time) VALUES ('$session', '$time')\";\n\t\t$result1=mysql_query($sql1);\n\t}\n\telse {\n\t\t$sql2=\"UPDATE $tbl_name SET time='$time' WHERE session = '$session'\";\n\t\t$result2=mysql_query($sql2);\n\t}\n\t\n\t$sql3=\"SELECT * FROM $tbl_name\";\n\t$result3=mysql_query($sql3);\n\t$count_user_online=mysql_num_rows($result3);\n\t\n\t//echo \"User online : $count_user_online \";\n\t\n\t// if over 10 minute, delete session \n\t$sql4=\"DELETE FROM $tbl_name WHERE time<$time_check\";\n\t$result4=mysql_query($sql4);\n\t\n\tmysql_free_result($result);\n\t//mysql_free_result($result1);\n\t//mysql_free_result($result2);\n\tmysql_free_result($result3);\n\t//mysql_free_result($result4);\n return $count_user_online;\n}", "function update_whosonline_users($user){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t$ci->db->select('id')->from('ebb_online')->where('Username', $user);\r\n\t\r\n\t//see if we add or update online status.\r\n\tif ($ci->db->count_all_results() == 0){\r\n\t\t#setup values.\r\n\t\t$data = array(\r\n\t\t 'Username' => $user,\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\r\n\t\t#add new preference.\r\n\t\t$ci->db->insert('ebb_online', $data);\r\n\t}else{\r\n\t\t//user is still here so lets up their time to let the script know the user is still around.\r\n\t\t$data = array(\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\t\t\r\n\t\t$ci->db->where('Username', $user);\r\n\t\t$ci->db->update('ebb_online', $data);\r\n\t}\r\n}", "function check_users_online() {\n global $DOCUMENT_ROOT;\n global $config;\n global $shop;\n \n // odczytaj pliki z sesji i sprawdz ich ostatni czas dostepu\n $i=0;\n if ($shop->home!=1) {\n $dir_sess=\"$DOCUMENT_ROOT/../sessions/$config->salt/\";\n } else {\n $dir_sess=\"/base/sessions/$config->salt/\";\n }\n if ($handle = opendir($dir_sess)) {\n \n while (false != ($file = readdir($handle))) {\n if (ereg(\"^sess\",$file)) {\n $test=$this->check_file($file);\n if ($test>0) {\n $i++;\n }\n }\n } // end while\n closedir($handle);\n } // end if\n \n return $i;\n }", "function users_online(){\n \n if(isset($_GET['onlineusers'])){\n \n global $connection;\n \n if(!$connection){\n session_start();\n \n include(\"../includes/db.php\");\n \n $session = session_id();\n $time = time();\n $time_out_in_secs = 05;\n $time_out = $time - $time_out_in_secs;\n\n $query = \"SELECT * FROM users_online WHERE session = '$session'\";\n $send_query = mysqli_query($connection, $query);\n $count = mysqli_num_rows($send_query);\n\n if($count == NULL){\n mysqli_query($connection, \"INSERT INTO users_online(session, time) VALUES('$session','$time')\");\n }else{\n mysqli_query($connection, \"UPDATE users_online SET time = '$time' WHERE session = '$session'\");\n }\n //display other online users who is not logged out\n $users_online_query = mysqli_query($connection, \"SELECT * FROM users_online WHERE time > '$time_out'\");\n echo $count_user = mysqli_num_rows($users_online_query); \n }\n }//get request isset()\n}", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }", "public static function listOnlineUsers() \n\t{\n\t\t$array = array(); \n\n\t\t$rst = \\Main\\DB::select(\"accounts_online\", \"user\");\n\t\twhile($row = $rst->fetch_object())\n\t\t{\n\t\t\t$accId = $row->user; \n\t\t\t$array[$accId] = self::getUserData($accId); \n\t\t}\n\t\t\n\t\treturn $array; \n\t}", "public function updateOnline() : void\n {\n $this->lastOnline = time();\n $this->lastIp = Net::ip();\n\n DB::table('users')\n ->where('user_id', $this->id)\n ->update([\n 'user_last_online' => $this->lastOnline,\n 'last_ip' => Net::pton($this->lastIp),\n ]);\n }", "function users_online()\n {\n if(isset($_GET['onlineusers']))\n { \n global $connection;\n if(!$connection)\n {\n session_start();\n include \"../includes/db.php\";\n }\n $session = session_id();\n $time = time();\n $timeout_in_seconds = 5;\n $timeout = $time - $timeout_in_seconds;\n $query = \"select * from users_online where session = '$session'\";\n $session_query = mysqli_query($connection, $query);\n $count = mysqli_num_rows($session_query);\n if($count == NULL)\n {\n mysqli_query($connection, \"insert into users_online (session, time) values ('$session', '$time')\");\n }\n else\n {\n mysqli_query($connection, \"update users_online set time = '$time' where session = '$session'\");\n }\n $users_online_query = mysqli_query($connection, \"select * from users_online where time > '$timeout'\");\n $user_count = mysqli_num_rows($users_online_query);\n echo $user_count;\n }\n }", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "public function getOnlineList()\n {\n $online = [];\n if ( $this->online )\n {\n $id = 0;\n $pack = pack( 'N*', -1, 1, $id ) . $this->gamed->packString( '1' );\n $pack = $this->gamed->createHeader( 352, $pack );\n $send = $this->gamed->SendToDelivery( $pack );\n $data = $this->gamed->deleteHeader($send);\n $data = $this->gamed->unmarshal( $data, $this->data['RoleList'] );\n\n if ( isset( $data['users'] ) )\n {\n foreach ( $data['users'] as $user )\n {\n $online[] = $user;\n //$id = $this->gamed->MaxOnlineUserID( $data['users'] );\n }\n }\n }\n return $online;\n }", "function getOnlineUserCount()\n\t{\n\t\treturn $this->DB->database_count('users', array('online' => '1'));\n\t}", "public function online() {\n\n\t\t// Skip when signing in/out to avoid strange Fatal error\n\t\tif (strpos(URI::instance()->string(), 'sign') === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Visitor::instance()->get_user();\n\t\t$online = new Online_User_Model($_SESSION['session_id']);\n\t\tif (!$online->loaded()) {\n\t\t\t$online->session_id = $_SESSION['session_id'];\n\t\t}\n\t\t$online->last_activity = $_SESSION['last_activity'];\n\t\t$online->user_id = $user ? $user->id : null;\n\t\ttry {\n\t\t\t$online->save();\n\t\t} catch (ORM_Validation_Exception $e) {}\n\t}", "public function getOnlineUsers()\n {\n return $this->onlineUsers->getOnlineUsers();\n }", "public function updateWhoIsOnline() {\n\t\t$this->oWebsite->updateWhoIsOnline();\n\t}", "public function check_online_members(){\n \t$this->load->model(\"portalmodel\");\n \t\n \t$project_id = $this->input->post('project_id');\n \t\n \t$final_names = \"\";\n \t\n \t// get list of current online members\n \t$tmp_online_member_ids = $this->portalmodel->list_select1(\"onlinemembers\");\n \t$online_member_ids = array();\n \tforeach ($tmp_online_member_ids as $eachid){\n \t\t$online_member_ids[]=$eachid->user_id;\n \t}\n \t\n \t$associated_members_ids = $this->portalmodel->list_select(\"project\",\"id\",$project_id);\n \t$tmp_members_ids = implode(\",\", array($associated_members_ids[0]['accountmanager'],$associated_members_ids[0]['projectmanager'],$associated_members_ids[0]['developer']));\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$tmp_members_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$final_names = implode(\", \", $associated_member_names);\n \t\n \t// now get the customer member list\n \t$already_member_ids = $this->portalmodel->list_select(\"chat_project_members\",\"fk_project_id\",$project_id);\n \t$arr_already_member_ids = array();\n \tforeach ($already_member_ids as $eachrecord){\n \t\t$arr_already_member_ids[]=$eachrecord['fk_user_id'];\n \t}\n \t$arr_already_member_ids[]=1001; // here we are adding 1001 for the admin, because he doesn't need to be selected\n \t$in_already_member_ids = implode(\",\", $arr_already_member_ids);\n \t\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$in_already_member_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$associated_member_names = implode(\", \", $associated_member_names);\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \t// online customers\n \t$associated_customer_id = $this->portalmodel->select_name('project', 'customerid', \"id='\".$project_id.\"'\");\n \tif(!empty($associated_customer_id)){\n \t\t$associated_customer_name = $this->portalmodel->select_name('customer', 'companyname', \"customerid='\".$associated_customer_id.\"'\");\n \t\t\n \t\t// also get list of onlinecustomers to highlight\n\t \t$tmp_online_user_ids = $this->portalmodel->list_select1(\"onlinecustomers\");\n\t \t$online_customer_ids = array();\n\t \tforeach ($tmp_online_user_ids as $eachid){\n\t \t\t$online_customer_ids[]=$eachid->customer_id;\n\t \t}\n\t \t\n\t \tif (in_array($associated_customer_id, $online_customer_ids)){\n\t \t\t$associated_customer_name = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$associated_customer_name;\n\t \t}\n\t \t\n\t \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_customer_name:$associated_customer_name;\n \t}\n \t\n \t// online customer users\n \t$tmp_online_customer_user_ids = $this->portalmodel->list_select1(\"online_customer_users\");\n \t$online_customer_user_ids = array();\n \tforeach ($tmp_online_customer_user_ids as $eachid){\n \t\t$online_customer_user_ids[]=$eachid->customer_user_id;\n \t}\n \t\n \t$associated_users = $this->portalmodel->select_where('', '', 'customer_user_project_chat', \"FIND_IN_SET( $project_id, project_ids )\");\n \t$arr_associated_users = array();\n \tforeach ($associated_users as $each_associated_user){\n \t\tif(in_array($each_associated_user->id, $online_customer_user_ids)){\n \t\t\t$arr_associated_users[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$each_associated_user->first_name;\n \t\t}else{\n \t\t\t$arr_associated_users[] = $each_associated_user->first_name;\n \t\t}\n \t}\n \t\n \t$associated_member_names = implode(\",\", $arr_associated_users);\n \t\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \techo $final_names;\n }", "function um_online_show_user_status( $args ) {\n\t\tif ( $this->is_hidden_status( um_profile_id() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$args['is_online'] = UM()->Online()->is_online( um_profile_id() );\n\n\t\tob_start();\n\n\t\tUM()->get_template( 'online-marker.php', um_online_plugin, $args, true );\n\n\t\tob_end_flush();\n\t}", "public function getUsersOnline()\n {\n $users = array_map( \"trim\", file('online.log', FILE_SKIP_EMPTY_LINES));\n return $users;\n }", "public function all_user_connected() {\n try\n {\n $max_last_ping = time() - 31;\n $stmt = $this->db->prepare(\"SELECT * FROM connected_user WHERE last_ping > :last_ping\");\n $stmt->execute(array(\n 'last_ping' => $max_last_ping\n ));\n\n while($result = $stmt->fetch()) {\n $listid[] = $result['id_user'];\n }\n \n return $listid;\n }\n catch(PDOException $e) {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "public function obtenerUsuariosOnline(){\n return $this->obtenerUsuarios(\" uid_usuario IN ( SELECT uid_usuario FROM \". TABLE_USUARIO .\" u WHERE u.uid_usuario = uid_usuario AND conexion = 1 ) \");\n }", "function active_users()\n\t{\n\t\t$active = array( 'TOTAL' => 0 ,\n\t\t\t\t\t\t 'NAMES' => \"\",\n\t\t\t\t\t\t 'GUESTS' => 0 ,\n\t\t\t\t\t\t 'MEMBERS' => 0 ,\n\t\t\t\t\t\t 'ANON' => 0 ,\n\t\t\t\t\t );\n\t\t\t\t\t \n\t\t$stats_html = \"\";\n\t\t\n\t\tif ( $this->ipsclass->vars['show_active'] )\n\t\t{\n\t\t\tif ($this->ipsclass->vars['au_cutoff'] == \"\")\n\t\t\t{\n\t\t\t\t$this->ipsclass->vars['au_cutoff'] = 15;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get the users from the DB\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$cut_off = $this->ipsclass->vars['au_cutoff'] * 60;\n\t\t\t$time = time() - $cut_off;\n\t\t\t$rows = array();\n\t\t\t$ar_time = time();\n\t\t\t\n\t\t\tif ( $this->ipsclass->member['id'] )\n\t\t\t{\n\t\t\t\t$rows = array( $ar_time.'.'.md5(microtime()) => array( 'id'\t\t\t => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t 'login_type' => substr($this->ipsclass->member['login_anonymous'],0, 1),\n\t\t\t\t\t\t\t\t\t\t\t\t 'running_time' => $ar_time,\n\t\t\t\t\t\t\t\t\t\t\t\t 'member_id' => $this->ipsclass->member['id'],\n\t\t\t\t\t\t\t\t\t\t\t\t 'member_name' => $this->ipsclass->member['members_display_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t 'member_group' => $this->ipsclass->member['mgroup'] ) );\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, member_id, member_name, login_type, running_time, member_group',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'sessions',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"running_time > $time\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t //'order' => \"running_time DESC\" // Sort in PHP to avoid filesort in SQL\n\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\n\t\t\t\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// FETCH...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$rows[ $r['running_time'].'.'.$r['id'] ] = $r;\n\t\t\t}\n\t\t\t\n\t\t\tkrsort( $rows );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Is this a root admin in disguise?\n\t\t\t// Is that kinda like a diamond in the rough?\n\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\n\t\t\t$our_mgroups = array();\n\t\t\t\n\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t{\n\t\t\t\t$our_mgroups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );\n\t\t\t}\n\t\t\t\n\t\t\t$our_mgroups[] = $this->ipsclass->member['mgroup'];\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// cache all printed members so we\n\t\t\t// don't double print them\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$cached = array();\n\t\t\t\n\t\t\tforeach ( $rows as $result )\n\t\t\t{\n\t\t\t\t$last_date = $this->ipsclass->get_time( $result['running_time'] );\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Bot?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tif ( strstr( $result['id'], '_session' ) )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Seen bot of this type yet?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\t$botname = preg_replace( '/^(.+?)=/', \"\\\\1\", $result['id'] );\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $cached[ $result['member_name'] ] )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $this->ipsclass->vars['spider_anon'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( in_array( $this->ipsclass->vars['admin_group'], $our_mgroups ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$active['NAMES'] .= \"{$result['member_name']}*{$this->sep_char} \\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active['NAMES'] .= \"{$result['member_name']}{$this->sep_char} \\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cached[ $result['member_name'] ] = 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//-----------------------------------------\n\t\t\t\t\t\t// Yup, count others as guest\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\n\t\t\t\t\t\t$active['GUESTS']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Guest?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\telse if ( ! $result['member_id'] )\n\t\t\t\t{\n\t\t\t\t\t$active['GUESTS']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Member?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( empty( $cached[ $result['member_id'] ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cached[ $result['member_id'] ] = 1;\n\n\t\t\t\t\t\t$result['member_name'] = $this->ipsclass->make_name_formatted( $result['member_name'], $result['member_group'] );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($result['login_type'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$active['NAMES'] .= \"<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['member_name']}</a>*{$this->sep_char} \\n\";\n\t\t\t\t\t\t\t\t$active['ANON']++;\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$active['ANON']++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active['MEMBERS']++;\n\t\t\t\t\t\t\t$active['NAMES'] .= \"<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['member_name']}</a>{$this->sep_char} \\n\";\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\n\t\t\t$active['NAMES'] = preg_replace( \"/\".preg_quote($this->sep_char).\"$/\", \"\", trim($active['NAMES']) );\n\t\t\t\n\t\t\t$active['TOTAL'] = $active['MEMBERS'] + $active['GUESTS'] + $active['ANON'];\n\t\t\t\n\t\t\t$this->users_online = $active['TOTAL'];\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Show a link?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ($this->ipsclass->vars['allow_online_list'])\n\t\t\t{\n\t\t\t\t$active['links'] = $this->ipsclass->compiled_templates['skin_boards']->active_user_links();\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['active_users'] = sprintf( $this->ipsclass->lang['active_users'], $this->ipsclass->vars['au_cutoff'] );\n\t\t\t\n\t\t\treturn $this->ipsclass->compiled_templates['skin_boards']->ActiveUsers($active, $this->ipsclass->vars['au_cutoff']);\n\t\t}\n\t\t\n\t}", "function updateAllUser(){\n\t$conn = DbTools::getDBConnect('dota');\n\t$time = get11LastUpdateTime();\n\tdo{\n\t\t$res = $conn->query(\"SELECT uname FROM dota.user_info WHERE update_time < $time \".\n\t\t\t\"LIMIT 100\");\n\t\tif (false === $res){\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($res)){\n\t\t\tbreak;\n\t\t}\n\t\tforeach ($res as $user){\n\t\t\t$user_info = getUserInfoFrom11($user['uname']);\n\t\t\t$ret = updateUserInfo($user_info);\n\t\t}\n\t\t//break;\n\t}while(1);\n\t\n\treturn true;\n}", "public function isOnline($uname,$pass){\n\t\t$user = $this->find('first',array('user_name'=>$uname,'password'=>$pass));\n\t\tif(!empty($user)){\n\t\t\treturn $user['User']['online_flag']== 1;\n\t\t}\t\t\n\t}", "public function resetOnline()\n {\n User::where([['type', User::TYPE_MAN], ['online', '!=', 0]])->update(['online' => 0]);\n }", "function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}", "protected function fetchOnlineUsersFromFile()\n\t{\n\t\t$file_content = @file_get_contents($this -> online_users_file);\n\t\tif ($file_content === false)\n\t\t{\n\t\t\t$this -> online_users = [];\n\t\t}else{\n\t\t\t$this -> online_users = json_decode($file_content, true);\t\n\t\t}\n\t}", "public function findOnline() {}", "public function ChangeUserOnlineStatus()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->ChangeUserOnlineStatus('online');\n exit(json_encode($output));\n }", "public function actionAutoAddInvites(){\n $users = User::model()->findAll(\"status = :status AND invitations < :invite\",array(\":status\"=>1,\":invite\"=>2));\n $userStats = UserStat::model()->findAll();\n $stat = array();\n foreach ($userStats as $userStat){\n $stat[$userStat->user_id] = $userStat;\n }\n \n // check all users\n foreach ($users as $user){\n if (!isset($stat[$user->id])){\n // not yet calculated %\n $c = new Completeness();\n $c->setPercentage($user->id);\n }else{\n //percentage in now add invitations\n if ($stat[$user->id]->completeness >= PROFILE_COMPLETENESS_MIN){\n if ($stat[$user->id]->invites_send == 0) $user->invitations +=4; // initial 4+1 invites after profile completed\n $user->invitations++;\n }\n if ($stat[$user->id]->invites_send > 5) $user->invitations+=2;\n if ($stat[$user->id]->invites_registered > 5) $user->invitations++;\n $user->save(); \n }\n }\n }", "public function adminShowUserOnlineStatus($id)\n\t{\n\t\t$sql = \"SELECT id,online FROM users WHERE id = '\".$id.\"'\";\n\t\t$row = $this->fetchOne($sql);\n if($row['online'] == \"ON\"){$online = \"<span style='color:#008040;'>Online</span>\";}\n\t\tif($row['online'] == \"OFF\" || $row['online'] == \"0\"){$online = \"<span style='color:#B2BEB5;'>Offline</span>\";}\n return $online;\n\n\t}", "public function stale_users() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\ttry {\n\t\t\t$results = $http->get($this->settings['hostname.mbd'].'/panelists/stale?X-ApiKey='.$this->settings['mbd.api_key'], array(), $this->options);\n\t\t} catch (Exception $e) {\n\t\t\t$this->out('Stale Api endpoint failed.');\n\t\t\treturn;\n\t\t}\n\n\t\t$results = json_decode($results['body'], true);\n\t\tCakeLog::write('mbd.stale', print_r($results, true));\n\t\tprint_r($results);\n\t}", "public function loadOnlinePlayers() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"All Online Players\");\n\t\t$players = $this -> database -> query(\"SELECT * FROM \" . GLOBAL_DB . \".members WHERE online=1 AND lastWorld !=-1\");\n\t\t$table = \"\";\n\t\twhile ($playerData = $players -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$user = User::getUser($playerData['UID']);\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $user -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">World \" . $user -> getLastWorld() . \"</td>\n\t\t\t</tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t\t$table = \"There are currently no online players.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"globe\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "public function frontpage_online_box($users) {\n $online_box = \"<h4>Users online</h4>\n <div class='success' style='margin: 8px;'>\".$users.\"</div>\";\n return $online_box;\n }", "public function getOnlineMemberWithStatus($usersIds) {\n\t\t$user_id = $this->Auth->user('id');\n\n\t\t$usersDetails = $this->User->checkOnlineUsers($usersIds, $user_id);\t\t\n\n\t\treturn $usersDetails;\n\t}", "public function isOnline() {\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($this->_username, 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$accountData = $this->getAccountData();\n\t\tif(is_array($accountData)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($accountData[_CLMN_USERNM_], 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "function userslist($req,$active_room)\n{\n\twhile( $data = mysql_fetch_assoc($req) )\n\t{\t\n\t\t$status = \"\";\n\t\n\t\t// Auth ? // Admin ?\n\t\t$sql2 = \"SELECT * FROM users_registered WHERE user='\".$data['user'].\"'\";\n\t\t$req2 = query($sql2);\n\t\t$count = num_rows($sql2);\n\t\tif($count > 0 and isset($_SESSION['auth']) and $_SESSION['auth'] == 1) $status .= \"+i\"; else $status .= \"-i\";\n\t\n\t\t// Voiced ?\n\t\tif($data['voice']) $status .= \"+v\"; else $status .= \"-v\";\n\t\n\t\t// API key ?\n\t\tif(isset($data['apikey']) and !empty($data['apikey'])) $status .= \"+k\"; else $status .= \"-k\";\n\t\n\t\t// Admin ?\n\t\tif($count > 0)\n\t\t{\n\t\t\t$data2 = mysql_fetch_assoc($req2);\n\t\t\tif($data2['admin']) $status = \"@\";\n\t\t}\n\t\t\n\t\t// User\n\t\t$user = $data['user'];\n\t\t\n\t\tif($data['afk'])\n\t\t{\n\t\t\t$user = \"<span class=\\\"user-afk\\\">$user</span>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Focus\n\t\t\tif($data['focus'])\n\t\t\t\t$user = \"<span class=\\\"user-online\\\">$user</span>\";\n\t\t\telse\n\t\t\t\t$user = \"<span class=\\\"user-background\\\">$user</span>\";\n\t\t}\n\t\t\n\t\t// Dans la même salle que moi ?\n\t\tif($active_room == 0)\n\t\t\t$room = \"&bull;\";\n\t\telse\n\t\t{\n\t\t\t$rooms = new Rooms();\n\t\t\t$sameroom = $rooms->isUserInRoom($active_room,$data['user']);\n\t\t\tif($sameroom)\n\t\t\t\t$room = \"<span style=\\\"font-size:1em;\\\">&bull;</span>\";\n\t\t\telse\n\t\t\t{\n\t\t\t\t$room = \"\";\n\t\t\t\t$user = \"<s>$user</s>\";\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// Afficher\n\t\techo \"<tr>\";\n\t\techo \"<td>$room</td>\";\n\t\techo \"<td style=\\\"font-size:0.8em;font-style:normal;font-weight:normal;text-align:right;\\\">\";\n\t\techo \"$status\";\n\t\techo \"</td>\";\n\t\techo \"<td style=\\\"text-align:left;\\\">\";\n\t\techo \"\\n<span class=\\\"user\\\" name=\\\"normal\\\" id=\\\"user_\".$data['id'].\"\\\" onclick=\\\"mp('\".$data['user'].\"')\\\" onmouseover=\\\"enlight('\".$data['user'].\"',true)\\\" onmouseout=\\\"enlight('\".$data['user'].\"',false)\\\">\";\n\t\techo \"&nbsp;\".$user;\n\t\techo \"</span>\";\n\t\techo \"</td></tr>\";\n\t}\n}", "public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public function updateOnlineCheckAt( User $user )\n {\n return $this->update( $user, ['online_check_at' => date(DB_DATE_FORMAT)]);\n }", "public function check() {\n\t\t$where = array(\n\t\t\t[\"recipient\", \"==\", $this->activeUser],\n\t\t);\n\n\t\t$results = $this->db->select($where);\n\t\t$senders = array();\n\n\t\tif (empty($results)) Common::send(\"notice\", \"No new messages\");\n\n\t\tforeach ($results as $message) {\n\t\t\t$sender = $message[\"sender\"];\n\t\t\t$unread = $message[\"unread\"];\n\t\t\t$senders[$sender] = isset($senders[$sender]) ? $senders[$sender] + $unread : 0;\n\t\t}\n\n\t\t//Prepare the return data.\n\t\tCommon::send(\"success\", $senders);\n\t}", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-'.$this->id);\n }", "function whosonline() {\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t$online = '';\r\n\t\r\n\t$ci->db->select('u.id, u.Username')\r\n\t ->from('ebb_online o')\r\n\t ->join('ebb_users u', 'o.Username=u.id', 'LEFT')\r\n\t ->where('o.ip IS NULL');\r\n\t$onlineLogged = $ci->db->get();\r\n\tforeach ($onlineLogged->result() as $row) {\r\n\t #gain status of users.\r\n\t\t$ci->load->model('Groupmodel', 'groupsonline');\r\n\t\t$ci->load->model('Usermodel', 'usersonline');\r\n\t\t$ci->usersonline->getUser($row->id);\r\n\t\t$ci->groupsonline->GetGroupData($ci->usersonline->getGid());\r\n\r\n\t\tif ($ci->groupsonline->getLevel() == 1){\r\n\t\t\t$online .= '<strong>'.anchor('viewprofile/'.$row->id, $row->Username).'</strong>&nbsp;';\r\n\t\t}elseif ($ci->groupsonline->getLevel() == 2){\r\n\t\t\t$online .= '<em>'.anchor('viewprofile/'.$row->id, $row->Username).'</em>&nbsp;';\r\n\t\t}elseif($ci->groupsonline->getLevel() == 3){\r\n\t\t\t$online .= anchor('viewprofile/'.$row->id, $row->Username).'&nbsp;';\r\n\t\t}else{\r\n\t\t\t$online .= '&nbsp;';\r\n\t\t}\r\n\t}\r\n\treturn ($online);\r\n}", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public function getOnlineUserList(){\n $query = \"select * from $this->onlineUser_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0 ){\n return $result->fetchAll();\n }\n return null;\n }", "function ultimatemember_online( $args = array() ) {\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$defaults = array(\n\t\t\t'max' => 11,\n\t\t\t'roles' => 'all'\n\t\t);\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t$args['online'] = UM()->Online()->get_users();\n\t\t$template = ( $args['online'] && count( $args['online'] ) > 0 ) ? 'online' : 'nobody';\n\n\t\tob_start();\n\n\t\tUM()->get_template( \"{$template}.php\", um_online_plugin, $args, true );\n\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "public function getOnlineAccountList() {\n\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._TBL_MS_.\" WHERE \"._CLMN_CONNSTAT_.\" = ?\", array(1));\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}", "public function addMultipleUsers() {\n $this->addUser();\n\n while ( true ) {\n echo \"\\033[32m\".\"Želite li unjeti novog zaposlenika? da/ne \".\"\\033[0m\";\n if ( readline() !== 'da' ) {\n break;\n } else {\n $this->addUser();\n\n }\n\n }\n }", "public function isOnline() {}", "public function get_active_users() {\n /** check for invalid users, users that have not been active since 1 hour ago **/\n $datetime = strtotime('-5 minutes',strtotime(date('Y-m-d H:i:s')));\n $params_d = array(\n 'stream' => 'active_users',\n 'namespace' => $this->namespace,\n 'where' => \"last_activity_u_a < '\" .$datetime.\"'\"\n );\n $entries_d = $this->streams->entries->get_entries($params_d);\n foreach($entries_d['entries'] as $e_d){\n $this->streams->entries->delete_entry($e_d['id'], 'active_users', $this->namespace);\n }\n $params = array(\n 'stream' => 'active_users',\n 'namespace' => $this->namespace\n );\n $entries = $this->streams->entries->get_entries($params);\n $users = array();\n foreach ($entries['entries'] as $e) {\n $users[] = array(\n 'user_id' => $e['created_by']['user_id'],\n 'user' => $e['created_by']['display_name'],\n 'gest_name' => (!empty($e['user_nick_c'])) ? $e['user_nick_c'] : false,\n 'isUser' => (!empty($e['created_by']['user_id'])) ? true : false,\n 'last_activity' => date('Y-m-d H:i:s', $e['last_activity_u_a']),\n 'user_ip' => $e['user_b_ip']\n );\n }\n echo json_encode($users);\n }", "function search_connected_users() {\n global $DB;\n $sql = \"SELECT CURRENT_TIMESTAMP() AS fecha, COUNT(*) AS usuarios_conectados FROM {user}\n WHERE lastaccess > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MINUTE));\";\n $connecteduser = $DB->get_records_sql($sql);\n foreach ($connecteduser as $connection) {\n $actualdate = new DateTime($connection->fecha);\n $timestamp = $actualdate->getTimestamp();\n $connection->fecha = $timestamp;\n }\n return $connecteduser;\n}", "public static function setUserOnline($uId) \n\t{\n\t\t$rst = \\Main\\DB::select(\"accounts_online\", \"id\", \"user='\".\\Main\\DB::escape($uId).\"'\");\n\t\tif($rst->num_rows > 0) \n\t\t{\n\t\t\t$row = $rst->fetch_object(); \n\t\t\t$oid = $row->id; \n\t\t\t\\Main\\DB::update(\"accounts_online\", $oid, array(\"lastCheck\" => time()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\Main\\DB::insert(\"accounts_online\", array(\"user\" => $uId, \"lastCheck\" => time()));\n\t\t}\n\t}", "public function getNumberOfOnlineUser(){\n if(($result = $this->getOnlineUserList())!= null){\n return count($result);\n }\n return 0;\n }", "private function alertUsers()\n {\n User::query()->update(['is_sales_unread' => 1]);\n return true;\n }", "function online_offline_status ($user_id, $forum_mod)\n{\n \tglobal $lang, $board_config, $userdata, $images, $phpbb_theme, $phpEx;\n\t$status['color'] = '';\n\tif ( $user_id['user_id'] != ANONYMOUS )\n\t{\n\t\tif ( $user_id['user_allow_viewonline'] && !$board_config['pnphpbb2_members_online'] )\n\t\t{\n\t\t\tif ( $user_id['user_session_time'] >= (time()-60) )\n\t \t \t{\n\t\t\t\t// Check admin/mod status\n\t\t\t\tif ( $user_id['user_level'] == ADMIN )\n\t\t\t\t{\n\t\t\t\t\t$status['image'] = ( $images['user_admin'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_admin'] . '\" alt=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" title=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor3'] . '\"';\n\t\t\t\t}\n\t\t\t\telse if ( $forum_mod )\n\t\t\t\t{\n\t\t\t \t\t$status['image'] = ( $images['user_mod'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_mod'] . '\" alt=\"' . $lang['Moderator'] . '\" title=\"' . $lang['Moderator'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor2'] . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t$status['image'] = ( $images['user_online'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_online'] . '\" alt=\"' . $lang['Online'] . '\" title=\"' . $lang['Online'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t}\t\n\t\t\t\t$status['text'] = $lang['Status'] . '<b><a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"' . $status['color'] . '>' . $lang['Online'] . '</a></b>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t\t\t\t$status['text'] = $lang['Status'] . $lang['Offline'];\n\t\t\t\t$status['image'] = ( $images['user_offline'] ) ? '<img src=\"' . $images['user_offline'] . '\" alt=\"' . $lang['Offline'] . '\" title=\"' . $lang['Offline'] . '\" hspace=\"3\" align=\"top\" />' : '';\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$status['text'] = \"\";\n\t\t$status['image'] = \"\";\n\t}\n\t\n\treturn $status;\n}", "private function isOnline()\n {\n return $this->online;\n }", "public function is_user_online($id)\n {\n $logged_in_users = get_transient('agents_online'); //Get the active users from the transient.\n return isset($logged_in_users[$id]['last']) && $logged_in_users[$id]['last'] > time()-60; //Return boolean if the user has been online in the last 60 seconds (1 minutes).\n }", "function online() {\n\t$pdo=new PDO('mysql:host=gtogame.db.9808275.hostedresource.com;dbname=gtogame', 'gtogame', 'D7Awthkp2946!');\n\t// Check login\n\tif (isset($_COOKIE['id'])) {\n\t\t$stmt=$pdo->prepare('SELECT `appearo` FROM Players WHERE id = :id LIMIT 1');\n\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\tif (isset($_COOKIE['id']) AND $row['appearo'] != 1) {\n\t\t\t$stmt=$pdo->prepare('UPDATE Players SET online = :time WHERE id = :id LIMIT 1');\n\t\t\t$stmt->bindValue(':time', time(), PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t} else {\n\t\theader(\"Location: index.php\");\n\t\texit();\n\t}\n}", "private function collectCurrentTestUsers()\n {\n $usersDb = new Users();\n $testUsersCollection = $usersDb->findTestUsers();\n $this->testUserCollection = [];\n foreach ($testUsersCollection as $testUser) {\n $this->testUserCollection[] = $testUser;\n }\n }", "public function updateUserOffline()\n {\n $this->is_online = 0;\n $this->save();\n }", "public function isOnline() {\n\t\tif ($this->lastActivityTime && $this->lastActivityTime > (TIME_NOW - USER_ONLINE_TIMEOUT) && (WCF::getUser()->userID == $this->userID || !$this->invisible || WCF::getUser()->getPermission('admin.general.canViewInvisible') || ($this->invisible == 2 && UserProfile::isBuddy($this->userID)))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isOnline(): bool\n {\n return app(UserActivityService::class)->isOnline($this);\n }", "private function setOnline($online)\n {\n $this->online = $online;\n }", "function userOn($user) {\n global $db;\n\n if (is_scalar($user)) {\n $user = getUser($user);\n }\n\n if ($user['bill'] > 0) {\n if ($user['block']) {\n $db->sql(\"UPDATE users SET `block` = '0' WHERE id = {$user['id']}\")->execute()\n || exit('User unblock error');\n }\n if (!$user['fw_on']) {\n\n\n $arrContextOptions=array(\n \"ssl\"=>array(\n \"verify_peer\"=>false,\n \"verify_peer_name\"=>false,\n ),\n );\n\n $db->sql(\"UPDATE users SET `fw_on` = '1' WHERE id = {$user['id']}\")->execute() || exit('User update internet status error');\n\n $response = file_get_contents(\"https://ss.sohonet.ua/scripts/fwon.php?id={$user['id']}&ip=NA\",false, stream_context_create($arrContextOptions));\n $user['fw_on_response'] = var_export($response, true);\n if ($response == 'ok') {\n $db->sql(\"UPDATE users SET `fw_on` = '1' WHERE id = {$user['id']}\")->execute()\n || exit('User update internet status error');\n }\n }\n\n return true;\n }\n\n return false;\n}", "public function addLoginState(){\r\n\t\t$userId = $this->session->userdata('userId');\r\n\t\t$res = $this->curd_m->get_search(\"SELECT login_validate FROM users WHERE id=\".$userId,'object');\r\n\t\tif($res!==NULL && sizeof($res)==1){\r\n\t\t\tif( (time()-$res[0]->login_validate) > $this->config->item('sess_time_to_update')){\r\n\t\t\t\treturn $this->curd_m->get_update(\"users\",array('id'=>$userId,'login_validate'=>time()));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "function d4os_io_db_070_os_users_online_users_list_paged($page = 0, $limit = 5, $headers) {\n if (!isset($_GET['page'])) {\n $_GET['page'] = $page;\n }\n if (!isset($_GET['order'])) {\n $_GET['order'] = 'loginTime';\n }\n if (!isset($_GET['sort'])) {\n $_GET['sort'] = 'DESC';\n }\n /*\n * uuid\n * agentIP\n * agentPort\n * loginTime\n * logoutTime\n * currentRegion\n * currentRegionName\n * currentHandle\n * currentPos\n * currentLookAt\n */\n d4os_io_db_070_set_active('os_robust');\n $result = pager_query(\"SELECT * FROM {Presence} AS p\"\n . \" LEFT JOIN {UserAccounts} AS ua ON ua.PrincipalID=p.UserID\"\n . \" LEFT JOIN {Regions} AS r ON r.uuid=p.RegionID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=p.UserID\"\n . \" WHERE gu.Online = 'true'\"\n . \" AND gu.Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND gu.Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" %s\", $limit, 0, NULL, array(tablesort_sql($headers)));\n while ($user = db_fetch_object($result)) {\n $items[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $items;\n}", "public function checkUsersSession(){\n\t}", "public function onlineMember(){\n\t\t$result=$this->model->memberOnline();\n\t\techo $result;\n\t}", "public static function check_all_user_accounts($conn) \n {\n Ossim_db::check_connection($conn); \n \n $query = \"SELECT login FROM users WHERE login != 'admin'\";\n \n $rs = $conn->Execute($query); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return FALSE;\n } \n \n while (!$rs->EOF) \n {\n $clogin = $conn->GetOne(\"SELECT login FROM users WHERE login = '\".$rs->fields['login'].\"' AND expires > '\".gmdate('Y-m-d H:i:s').\"'\");\n \n if ($clogin == '') \n {\n $conn->Execute(\"UPDATE users SET enabled=0 WHERE login= '\".$rs->fields['login'].\"'\");\n }\n \n $rs->MoveNext();\n }\n \n return TRUE;\n }", "public function getAllOnline()\n {\n return $this->query()->online()->get();\n }", "public function getOnlineStatus (Request $request) {\n\n \t$status = $this->profileRepo->getUserOnlineStatus($request->user_id);\n \t\n \tif($status) \n \t\treturn response()->json(['user_id' => $request->user_id, 'online' => '1']);\n \telse\n \treturn response()->json(['user_id' => $request->user_id, 'online' => '0']);\n }", "public static function limparUsuariosOnline(){\n\t\t\t$date = date('Y-m-d H:i:s');//PEGAR A DATA E HORA ATUAL DO SISTEMA\n\t\t\t//DELETAR DA tb_admin.online ONDE ultima_acao FOR MENOR QUE '$date' - INTERVAL 1 MINUTE\n\t\t\t$sql = MySql::conectar()->exec(\"DELETE FROM `tb_admin.online` WHERE ultima_acao < '$date' - INTERVAL 1 MINUTE\");\n\t\t}", "public function isOnline() {\n }", "public function getOnlineUsers($debug_to_pass = '') {\n\n $this->db->select('slog.log_id,slog.user_id,slog.last_login,slog.last_activity,slog.last_logout,u.user_name,u.profile_picture');\n $this->db->from('p784_user_sign_in_log as slog');\n $this->db->join('p784_mst_users as u', 'slog.user_id=u.user_id', 'inner');\n $this->db->where('slog.last_logout', '0000-00-00 00:00:00');\n $this->db->group_by('slog.user_id');\n $this->db->order_by('slog.last_logout desc');\n $query = $this->db->get();\n if ($debug_to_pass)\n echo $this->db->last_query();\n return $query->result_array();\n }", "public function isOnline()\n\t{\n\t\t$server = new Application_Model_Server();\n\t\t$players = $server->getOnlinePlayers();\n\t\t\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\tif ($player == $this->getUsername()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function isOnline()\n {\n if ( !isset( $this->_isOnline ) ) {\n $onlinehandler = &zarilia_gethandler( 'online' );\n $this->_isOnline = ( $onlinehandler->getCount( new Criteria( 'online_uid', $this->getVar( 'uid' ) ) ) > 0 ) ? true : false;\n }\n return $this->_isOnline;\n }", "function search_connected_usersfive() {\n global $DB;\n $sql = \"SELECT COUNT(*) AS usuarios_conectados\n FROM {user}\n WHERE lastaccess > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 5 MINUTE));\";\n $connecteduser = $DB->get_record_sql($sql);\n return $connecteduser->usuarios_conectados;\n}", "function update_whosonline_guest(){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t$ip = detectProxy();\r\n\r\n\t$ci->db->select('ip')->from('ebb_online')->where('ip', $ip);\r\n\r\n\t//see if we add or update online status.\r\n\tif ($ci->db->count_all_results() == 0){\r\n\t\t#setup values.\r\n\t\t$data = array(\r\n\t\t 'ip' => $ip,\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\r\n\t\t#add new preference.\r\n\t\t$ci->db->insert('ebb_online', $data);\r\n\t}else{\r\n\t\t//user is still here so lets up their time to let the script know the user is still around.\r\n\t\t$data = array(\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\t\t\r\n\t\t$ci->db->where('ip', $ip);\r\n\t\t$ci->db->update('ebb_online', $data);\r\n\t}\r\n}", "function thrive_bp_check_is_user_online( $user_id )\n\t{\n\t\tif ( function_exists( 'bp_has_members' ) ) {\n\t\t\tif ( bp_has_members( 'type=online&include='. absint( $user_id ) ) ) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function update_failed_logins(){\n\n\t}", "function get_connected_users() {\n global $DB;\n $users = $DB->get_records('report_user_statistics');\n return $users;\n}", "function all_users($rolecheck){\n\t\t$session_data = $this->session->userdata();\n\t\tif( array_key_exists('role', $session_data ) && isset($session_data['role'])):\n\t\t\tif( $session_data['role'] != 'super_admin' && $rolecheck =='admin' ):\n\t\t\t\tredirect( base_url() );\n\t\t\t\t//echo $rolecheck;\n\t\t\telse:\n\t\t\t\t$user__list = $this->InteractModal->all__users( $rolecheck );\n\t\t\t\t//print_r( $user__list );\n\t\t\t\t$pagedata['user_list'] = $user__list; \n\t\t\t\t$pagedata['role'] = $rolecheck;\n\t\t\t\t$this->load->view('dashboard/header');\n\t\t\t\t \n\t\t\t\tif($rolecheck == 'client'){\n\t\t\t\t\t$active_listings = $this->InteractModal->get_active_listings_count();\n\t\t\t\t\t$pagedata['active_listings'] = $active_listings;\n\t\t\t\t\t$this->load->view('dashboard/users-new', $pagedata); \n\t\t\t\t\t \n\t\t\t\t}else{\n\t\t\t\t\t$this->load->view('dashboard/users', $pagedata);\n\t\t\t\t}\t\n\t\t\t\t\t$this->load->view('dashboard/footer');\n\t\t\tendif;\n\t\telse:\n\t\t\tredirect( base_url( 'Interact/login' ));\n\t\tendif;\n\t}", "public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }", "public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }", "function b_onlinehistory_update($guest_online = 300, $user_online = 8640000) {\n global $xoopsUser, $xoopsModule;\n \n $history_handler = xoops_getModuleHandler('history', 'onlinehistory');\n $history_handler->getUpdate($guest_online, $user_online);\n \n $ip = $_SERVER['REMOTE_ADDR']; \n $agent = $_SERVER['HTTP_USER_AGENT'];\n \n if ($xoopsUser) {\n $uid = $xoopsUser->getVar('uid');\n $uname = $xoopsUser->getVar('uname');\n } else {\n $uid = 0;\n $uname = _MA_ONLINEHISTORY_GUEST;\n }\n \n $sumaagent = _getAgent($agent);\n if ($agent == $sumaagent[0] && $uid < 1) \n {\n $uname = 'Bot: ' . $sumaagent[1];\n $uid = -1;\n }\n \n if ($agent == '') {\n $agent = 'Unknown';\n }\n \n $module_handler = xoops_getHandler('module');\n $config_handler = xoops_getHandler('config');\n $olModule = $module_handler->getByDirname('onlinehistory');\n $olConfig = $config_handler->getConfigsByCat(0, $olModule->getVar('mid')); \n unset($olModule);\n\t\n $moduleid = (is_object($xoopsModule)) ? $xoopsModule->getVar('mid') : 0;\n $suma = (int)$olConfig['viewsumaonline'];\n \n if ($suma == 1 || $uid > -1) {\n $history_handler->getUpdateUser($uid, $uname, $ip, $agent, $moduleid, $suma);\n } \n \n if ($olConfig['viewmaxonline'] == true) {\n $criteria = new CriteriaCompo();\n $criteria->add(new criteria('online', '0', '>'));\n if ($olConfig['viewsumaonline'] == 1) {\n $criteria->add(new criteria('uid', '-1', '>'));\n }\n $user = $history_handler->getCount($criteria);\n $history_handler->makemax($user);\n } \n}", "public function markInActiveServers()\n {\n $aServersData = $this->_getServersData();\n\n foreach ($aServersData as $sServerId => $aServerData) {\n if ($aServerData['timestamp'] < oxRegistry::get(\"oxUtilsDate\")->getTime() - self::NODE_AVAILABILITY_CHECK_PERIOD) {\n $oServer = $this->getServer($sServerId);\n $oServer->setIsValid(false);\n $this->saveServer($oServer);\n }\n }\n }", "function monitor_list_wi_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"workitems`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "function sync_list_users( $list_id ) {\n\t\tif( !( $users = get_transient( '_um_mailchimp_sync_users' ) ) ) {\n\t\t\t//get all users with selected role and status\n\t\t\t$query_users = new \\WP_User_Query( array(\n\t\t\t\t'fields' => array( 'user_email', 'ID' )\n\t\t\t) );\n\t\t\t$users = $query_users->get_results();\n\t\t\t//set users list cache\n\t\t\tset_transient( '_um_mailchimp_sync_users', $users, 24 * 3600 );\n\t\t}\n\n\t\tif( count( $users ) > 0 ) {\n\t\t\t//get subscribers from mailchimp list\n\t\t\t$mailchimp_members = $this->get_external_list_users( $list_id );\n\n\t\t\t$subscribe = get_transient('_um_mailchimp_subscribe_users');\n\t\t\tforeach ( $users as $key => $user ) {\n\t\t\t\t$internal_user_lists = isset( $user->internal_lists ) ? $user->internal_lists : get_user_meta( $user->ID, \"_mylists\", true );\n\t\t\t\tif( is_array( $internal_user_lists ) && count( $internal_user_lists ) ) {\n\n\t\t\t\t\t//check if user isn't mailchimp subscriber for list with id $list_id but subscribed on current site\n\t\t\t\t\tif( !in_array( $user->user_email, $mailchimp_members ) && isset( $internal_user_lists[ $list_id ] ) ) {\n\t\t\t\t\t\t/*$this->mailchimp_subscribe()*/\n\n\t\t\t\t\t//check if user is mailchimp subscriber for list with id $list_id but didn't subscribed on current site\n\t\t\t\t\t} else if( in_array( $user->user_email, $mailchimp_members ) && !isset( $internal_user_lists[ $list_id ] ) ) {\n\t\t\t\t\t\tif( !is_array( $subscribe[ $list_id ] ) ) $subscribe[ $list_id ] = array();\n\t\t\t\t\t\t$subscribe[ $list_id ][] = $user;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif( !is_array( $subscribe[ $list_id ] ) ) $subscribe[ $list_id ] = array();\n\t\t\t\t\t$subscribe[ $list_id ][] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\tset_transient( '_um_mailchimp_subscribe_users', $subscribe, 24 * 3600 );\n\t\t}\n\t}", "public function setStatusOnline()\r\n {\r\n return $this->exec('status_online');\r\n }", "protected function _users_online_url()\n {\n return get_forum_base_url() . '/online.php';\n }", "public function get_online_users( $online_user_ids = array() ) {\n\t\t$online = UM()->Online()->get_users();\n\t\tif ( is_array( $online ) ) {\n\t\t\t$online_user_ids = array_keys( $online );\n\t\t}\n\n\t\treturn $online_user_ids;\n\t}", "private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }" ]
[ "0.7829768", "0.71915525", "0.7086502", "0.7036963", "0.7030495", "0.67450607", "0.671252", "0.6583092", "0.65375644", "0.6520061", "0.63896847", "0.63812935", "0.63379115", "0.6322503", "0.63222915", "0.6319637", "0.6293487", "0.62560666", "0.62289673", "0.6208892", "0.62083775", "0.6163363", "0.61595905", "0.6133125", "0.6129243", "0.6125496", "0.61020803", "0.610109", "0.6094856", "0.5966878", "0.596438", "0.59607524", "0.5958657", "0.59573925", "0.5948539", "0.5938206", "0.5921711", "0.59149027", "0.5908419", "0.59034264", "0.5894024", "0.58859634", "0.5882579", "0.58770275", "0.5876781", "0.5862856", "0.5862856", "0.5855577", "0.5851428", "0.5843694", "0.58323216", "0.5826921", "0.58265895", "0.5818511", "0.58097726", "0.5801421", "0.57809496", "0.57809347", "0.57766104", "0.5763984", "0.575455", "0.5751469", "0.57407707", "0.5737041", "0.57330066", "0.5724686", "0.57241404", "0.5724083", "0.57210094", "0.5706728", "0.56924915", "0.5687673", "0.5687054", "0.567942", "0.5677929", "0.5650969", "0.56391186", "0.5637945", "0.5630392", "0.562603", "0.562322", "0.56122726", "0.55931234", "0.5587879", "0.5587261", "0.5585085", "0.5549776", "0.55356675", "0.55310005", "0.55230206", "0.5507847", "0.5507847", "0.54991513", "0.5492482", "0.54766405", "0.54674757", "0.54674387", "0.5465505", "0.5459855", "0.5458129" ]
0.7113368
2
checkOnlineList Checks users online
private function checkOnlineList() { $this->online->checkOnlineList($this->loginTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsersOnline()\r\n {\r\n $result = $this->getBitrixApi(array(\r\n 'FILTER' => array('IS_ONLINE' => 'Y',),\r\n ), 'user.get');\r\n\r\n if ($result) {\r\n if (isset($result['total']) && $result['total'] > 0) {\r\n return $result['result'];\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public function get_users_online()\n {\n $logged_in_users = get_transient('agents_online'); //Get the active users from the transient.\n $count = 0;\n\n if($logged_in_users) {\n foreach ($logged_in_users as $logged_in_user) {\n if (isset($logged_in_user['last']) && ($logged_in_user['last'] > (time()-60) )) {\n $count++;\n }\n }\n } \n \n echo $count;\n die();\n }", "function onlineUsers() {\n\n\tif (isset($_GET['onlineusers'])) {\n\n\t\tglobal $connection;\n\n\t\tif (!$connection) {\n\t\t\tsession_start();\n\t\t\tinclude '../include/db.php';\n\n\t\t\t$session = session_id();\n\t\t\t$time = time();\n\t\t\t$time_out_secs = 10;\n\t\t\t$time_out = $time - $time_out_secs;\n\n\t\t\t$query = \"SELECT * FROM users_online WHERE session = '$session'\";\n\t\t\t$send_query = mysqli_query($connection, $query);\n\t\t\t$count = mysqli_num_rows($send_query);\n\n\t\t\tif ($count == NULL) {\n\t\t\t\tmysqli_query($connection, \"INSERT INTO users_online(session, time) VALUES('$session', '$time')\");\n\t\t\t} else {\n\t\t\t\tmysqli_query($connection, \"UPDATE users_online SET time = '$time' WHERE session = '$session'\");\n\t\t\t}\n\n\t\t\t$users_online = mysqli_query($connection, \"SELECT * FROM users_online WHERE time > '$time_out'\");\n\t\t\techo $count_users = mysqli_num_rows($users_online);\n\t\t}\n\t}\n}", "public function isOnline($me, $isOnline){\r\n $poll = $this->pdo->query(\"UPDATE users SET user_isOnline = '$isOnline' WHERE user_id = '$me'\");\r\n }", "function d4os_io_db_070_os_users_online_users_count() {\n d4os_io_db_070_set_active('os_robust');\n $now_online = db_result(db_query(\"SELECT COUNT(*) FROM {GridUser}\"\n . \" WHERE Online = 'true'\"\n . \" AND Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"));\n d4os_io_db_070_set_active('default');\n return $now_online;\n}", "public function isOnline() {}", "function check_users_online() {\n global $DOCUMENT_ROOT;\n global $config;\n global $shop;\n \n // odczytaj pliki z sesji i sprawdz ich ostatni czas dostepu\n $i=0;\n if ($shop->home!=1) {\n $dir_sess=\"$DOCUMENT_ROOT/../sessions/$config->salt/\";\n } else {\n $dir_sess=\"/base/sessions/$config->salt/\";\n }\n if ($handle = opendir($dir_sess)) {\n \n while (false != ($file = readdir($handle))) {\n if (ereg(\"^sess\",$file)) {\n $test=$this->check_file($file);\n if ($test>0) {\n $i++;\n }\n }\n } // end while\n closedir($handle);\n } // end if\n \n return $i;\n }", "public static function listOnlineUsers() \n\t{\n\t\t$array = array(); \n\n\t\t$rst = \\Main\\DB::select(\"accounts_online\", \"user\");\n\t\twhile($row = $rst->fetch_object())\n\t\t{\n\t\t\t$accId = $row->user; \n\t\t\t$array[$accId] = self::getUserData($accId); \n\t\t}\n\t\t\n\t\treturn $array; \n\t}", "public function getOnlineList()\n {\n $online = [];\n if ( $this->online )\n {\n $id = 0;\n $pack = pack( 'N*', -1, 1, $id ) . $this->gamed->packString( '1' );\n $pack = $this->gamed->createHeader( 352, $pack );\n $send = $this->gamed->SendToDelivery( $pack );\n $data = $this->gamed->deleteHeader($send);\n $data = $this->gamed->unmarshal( $data, $this->data['RoleList'] );\n\n if ( isset( $data['users'] ) )\n {\n foreach ( $data['users'] as $user )\n {\n $online[] = $user;\n //$id = $this->gamed->MaxOnlineUserID( $data['users'] );\n }\n }\n }\n return $online;\n }", "public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public static function updateWhoIsOnline()\n {\n $users = User::all();\n foreach($users as $u)\n {\n $lastPing = $u->last_ping;\n $twoMinAgo = Carbon::now()->subMinutes(2);\n $result = Carbon::createFromFormat('Y-m-d H:i:s', $lastPing);\n\n if($twoMinAgo->lt($result))\n {\n $u->is_online = 1;\n $u->save();\n }\n else\n {\n $u->is_online = 0;\n $u->save();\n }\n }\n }", "public function isOnline() {\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($this->_username, 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$accountData = $this->getAccountData();\n\t\tif(is_array($accountData)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($accountData[_CLMN_USERNM_], 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "function getUsersOnline() {\n\t//session_start();\n\t$session=session_id();\n\t$time=time();\n\t$time_check=$time-600; //SET TIME 10 Minute\n\t\n\t$tbl_name=\"useronline\"; // Table name\n\t$sql=\"SELECT * FROM $tbl_name WHERE session='$session'\";\n\t$result=mysql_query($sql);\n\t\n\t$count=mysql_num_rows($result);\n\tif($count==\"0\"){\n\t\t$sql1=\"INSERT INTO $tbl_name(session, time) VALUES ('$session', '$time')\";\n\t\t$result1=mysql_query($sql1);\n\t}\n\telse {\n\t\t$sql2=\"UPDATE $tbl_name SET time='$time' WHERE session = '$session'\";\n\t\t$result2=mysql_query($sql2);\n\t}\n\t\n\t$sql3=\"SELECT * FROM $tbl_name\";\n\t$result3=mysql_query($sql3);\n\t$count_user_online=mysql_num_rows($result3);\n\t\n\t//echo \"User online : $count_user_online \";\n\t\n\t// if over 10 minute, delete session \n\t$sql4=\"DELETE FROM $tbl_name WHERE time<$time_check\";\n\t$result4=mysql_query($sql4);\n\t\n\tmysql_free_result($result);\n\t//mysql_free_result($result1);\n\t//mysql_free_result($result2);\n\tmysql_free_result($result3);\n\t//mysql_free_result($result4);\n return $count_user_online;\n}", "public function getOnlineUserList(){\n $query = \"select * from $this->onlineUser_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0 ){\n return $result->fetchAll();\n }\n return null;\n }", "public function isOnline() {\n }", "public function check()\n {\n if(!empty($this->user)) {\n // If you need to check users online list in every page load, check this TRUE in config file\n if($this->config->item('check_users_on_page_load', 'online')) {\n $this->checkOnlineList();\n }\n\n $this->addUser();\n }\n }", "function getOnlineUserCount()\n\t{\n\t\treturn $this->DB->database_count('users', array('online' => '1'));\n\t}", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "private function isOnline()\n {\n return $this->online;\n }", "public function getOnlineAccountList() {\n\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._TBL_MS_.\" WHERE \"._CLMN_CONNSTAT_.\" = ?\", array(1));\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}", "public function getNumberOfOnlineUser(){\n if(($result = $this->getOnlineUserList())!= null){\n return count($result);\n }\n return 0;\n }", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-'.$this->id);\n }", "public function isOnline($uname,$pass){\n\t\t$user = $this->find('first',array('user_name'=>$uname,'password'=>$pass));\n\t\tif(!empty($user)){\n\t\t\treturn $user['User']['online_flag']== 1;\n\t\t}\t\t\n\t}", "function isOnline()\n {\n if ( !isset( $this->_isOnline ) ) {\n $onlinehandler = &zarilia_gethandler( 'online' );\n $this->_isOnline = ( $onlinehandler->getCount( new Criteria( 'online_uid', $this->getVar( 'uid' ) ) ) > 0 ) ? true : false;\n }\n return $this->_isOnline;\n }", "public function isOnline(): bool\n {\n return app(UserActivityService::class)->isOnline($this);\n }", "public function obtenerUsuariosOnline(){\n return $this->obtenerUsuarios(\" uid_usuario IN ( SELECT uid_usuario FROM \". TABLE_USUARIO .\" u WHERE u.uid_usuario = uid_usuario AND conexion = 1 ) \");\n }", "function addonline($uid,$place,$plclink)\n{\n $hidden=mysql_fetch_array(mysql_query(\"SELECT hidden FROM ibwf_users WHERE id='\".$uid.\"'\"));\n if($hidden[0]==0)\n {\n /////delete inactive users\n $tm = time();\n $timeout = $tm - 420; //time out = 5 minutes\n $deloff = mysql_query(\"DELETE FROM ibwf_online WHERE actvtime <'\".$timeout.\"'\");\n ///now try to add user to online list\n $res = mysql_query(\"UPDATE ibwf_users SET lastact='\".time().\"' WHERE id='\".$uid.\"'\");\n $res = mysql_query(\"INSERT INTO ibwf_online SET userid='\".$uid.\"', actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"'\");\n if(!$res)\n {\n //most probably userid already in the online list\n //so just update the place and time\n $res = mysql_query(\"UPDATE ibwf_online SET actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"' WHERE userid='\".$uid.\"'\");\n \n \n }\n }\n $maxmem=mysql_fetch_array(mysql_query(\"SELECT value FROM ibwf_settings WHERE id='2'\"));\n \n $result = mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM ibwf_online\"));\n\n if($result[0]>=$maxmem[0])\n {\n $tnow = date(\"D d M Y - H:i\");\n mysql_query(\"UPDATE ibwf_settings set name='\".$tnow.\"', value='\".$result[0].\"' WHERE id='2'\");\n }\n $maxtoday = mysql_fetch_array(mysql_query(\"SELECT ppl FROM ibwf_mpot WHERE ddt='\".date(\"d m y\").\"'\"));\n if($maxtoday[0]==0||$maxtoday==\"\")\n {\n mysql_query(\"INSERT INTO ibwf_mpot SET ddt='\".date(\"d m y\").\"', ppl='1', dtm='\".date(\"H:i:s\").\"'\");\n $maxtoday[0]=1;\n }\n if($result[0]>=$maxtoday[0])\n {\n mysql_query(\"UPDATE ibwf_mpot SET ppl='\".$result[0].\"', dtm='\".date(\"H:i:s\").\"' WHERE ddt='\".date(\"d m y\").\"'\");\n }\n}", "public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }", "public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }", "public function check_online_members(){\n \t$this->load->model(\"portalmodel\");\n \t\n \t$project_id = $this->input->post('project_id');\n \t\n \t$final_names = \"\";\n \t\n \t// get list of current online members\n \t$tmp_online_member_ids = $this->portalmodel->list_select1(\"onlinemembers\");\n \t$online_member_ids = array();\n \tforeach ($tmp_online_member_ids as $eachid){\n \t\t$online_member_ids[]=$eachid->user_id;\n \t}\n \t\n \t$associated_members_ids = $this->portalmodel->list_select(\"project\",\"id\",$project_id);\n \t$tmp_members_ids = implode(\",\", array($associated_members_ids[0]['accountmanager'],$associated_members_ids[0]['projectmanager'],$associated_members_ids[0]['developer']));\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$tmp_members_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$final_names = implode(\", \", $associated_member_names);\n \t\n \t// now get the customer member list\n \t$already_member_ids = $this->portalmodel->list_select(\"chat_project_members\",\"fk_project_id\",$project_id);\n \t$arr_already_member_ids = array();\n \tforeach ($already_member_ids as $eachrecord){\n \t\t$arr_already_member_ids[]=$eachrecord['fk_user_id'];\n \t}\n \t$arr_already_member_ids[]=1001; // here we are adding 1001 for the admin, because he doesn't need to be selected\n \t$in_already_member_ids = implode(\",\", $arr_already_member_ids);\n \t\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$in_already_member_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$associated_member_names = implode(\", \", $associated_member_names);\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \t// online customers\n \t$associated_customer_id = $this->portalmodel->select_name('project', 'customerid', \"id='\".$project_id.\"'\");\n \tif(!empty($associated_customer_id)){\n \t\t$associated_customer_name = $this->portalmodel->select_name('customer', 'companyname', \"customerid='\".$associated_customer_id.\"'\");\n \t\t\n \t\t// also get list of onlinecustomers to highlight\n\t \t$tmp_online_user_ids = $this->portalmodel->list_select1(\"onlinecustomers\");\n\t \t$online_customer_ids = array();\n\t \tforeach ($tmp_online_user_ids as $eachid){\n\t \t\t$online_customer_ids[]=$eachid->customer_id;\n\t \t}\n\t \t\n\t \tif (in_array($associated_customer_id, $online_customer_ids)){\n\t \t\t$associated_customer_name = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$associated_customer_name;\n\t \t}\n\t \t\n\t \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_customer_name:$associated_customer_name;\n \t}\n \t\n \t// online customer users\n \t$tmp_online_customer_user_ids = $this->portalmodel->list_select1(\"online_customer_users\");\n \t$online_customer_user_ids = array();\n \tforeach ($tmp_online_customer_user_ids as $eachid){\n \t\t$online_customer_user_ids[]=$eachid->customer_user_id;\n \t}\n \t\n \t$associated_users = $this->portalmodel->select_where('', '', 'customer_user_project_chat', \"FIND_IN_SET( $project_id, project_ids )\");\n \t$arr_associated_users = array();\n \tforeach ($associated_users as $each_associated_user){\n \t\tif(in_array($each_associated_user->id, $online_customer_user_ids)){\n \t\t\t$arr_associated_users[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$each_associated_user->first_name;\n \t\t}else{\n \t\t\t$arr_associated_users[] = $each_associated_user->first_name;\n \t\t}\n \t}\n \t\n \t$associated_member_names = implode(\",\", $arr_associated_users);\n \t\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \techo $final_names;\n }", "public function isOnline() {\n\t\tif ($this->lastActivityTime && $this->lastActivityTime > (TIME_NOW - USER_ONLINE_TIMEOUT) && (WCF::getUser()->userID == $this->userID || !$this->invisible || WCF::getUser()->getPermission('admin.general.canViewInvisible') || ($this->invisible == 2 && UserProfile::isBuddy($this->userID)))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getOnlineUserCount($onlineFriends){\n \t$count = 0;\n \tforeach ($onlineFriends as $friend){\n \t\tif($friend['is_online']){\n \t\t\t$count ++;\n \t\t}\n \t}\n \treturn $count;\n }", "function users_online()\n {\n if(isset($_GET['onlineusers']))\n { \n global $connection;\n if(!$connection)\n {\n session_start();\n include \"../includes/db.php\";\n }\n $session = session_id();\n $time = time();\n $timeout_in_seconds = 5;\n $timeout = $time - $timeout_in_seconds;\n $query = \"select * from users_online where session = '$session'\";\n $session_query = mysqli_query($connection, $query);\n $count = mysqli_num_rows($session_query);\n if($count == NULL)\n {\n mysqli_query($connection, \"insert into users_online (session, time) values ('$session', '$time')\");\n }\n else\n {\n mysqli_query($connection, \"update users_online set time = '$time' where session = '$session'\");\n }\n $users_online_query = mysqli_query($connection, \"select * from users_online where time > '$timeout'\");\n $user_count = mysqli_num_rows($users_online_query);\n echo $user_count;\n }\n }", "function isOnline() \n\t{\n\t\treturn ($this->status == self::STATUS_ONLINE) ? true : false;\n\t}", "public function getOnlineUsers()\n {\n return $this->onlineUsers->getOnlineUsers();\n }", "function users_online(){\n \n if(isset($_GET['onlineusers'])){\n \n global $connection;\n \n if(!$connection){\n session_start();\n \n include(\"../includes/db.php\");\n \n $session = session_id();\n $time = time();\n $time_out_in_secs = 05;\n $time_out = $time - $time_out_in_secs;\n\n $query = \"SELECT * FROM users_online WHERE session = '$session'\";\n $send_query = mysqli_query($connection, $query);\n $count = mysqli_num_rows($send_query);\n\n if($count == NULL){\n mysqli_query($connection, \"INSERT INTO users_online(session, time) VALUES('$session','$time')\");\n }else{\n mysqli_query($connection, \"UPDATE users_online SET time = '$time' WHERE session = '$session'\");\n }\n //display other online users who is not logged out\n $users_online_query = mysqli_query($connection, \"SELECT * FROM users_online WHERE time > '$time_out'\");\n echo $count_user = mysqli_num_rows($users_online_query); \n }\n }//get request isset()\n}", "public function updateWhoIsOnline() {\n\t\t$this->oWebsite->updateWhoIsOnline();\n\t}", "function whosonline() {\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t$online = '';\r\n\t\r\n\t$ci->db->select('u.id, u.Username')\r\n\t ->from('ebb_online o')\r\n\t ->join('ebb_users u', 'o.Username=u.id', 'LEFT')\r\n\t ->where('o.ip IS NULL');\r\n\t$onlineLogged = $ci->db->get();\r\n\tforeach ($onlineLogged->result() as $row) {\r\n\t #gain status of users.\r\n\t\t$ci->load->model('Groupmodel', 'groupsonline');\r\n\t\t$ci->load->model('Usermodel', 'usersonline');\r\n\t\t$ci->usersonline->getUser($row->id);\r\n\t\t$ci->groupsonline->GetGroupData($ci->usersonline->getGid());\r\n\r\n\t\tif ($ci->groupsonline->getLevel() == 1){\r\n\t\t\t$online .= '<strong>'.anchor('viewprofile/'.$row->id, $row->Username).'</strong>&nbsp;';\r\n\t\t}elseif ($ci->groupsonline->getLevel() == 2){\r\n\t\t\t$online .= '<em>'.anchor('viewprofile/'.$row->id, $row->Username).'</em>&nbsp;';\r\n\t\t}elseif($ci->groupsonline->getLevel() == 3){\r\n\t\t\t$online .= anchor('viewprofile/'.$row->id, $row->Username).'&nbsp;';\r\n\t\t}else{\r\n\t\t\t$online .= '&nbsp;';\r\n\t\t}\r\n\t}\r\n\treturn ($online);\r\n}", "public function findOnline() {}", "public function isOnline() {\n return ($this->onlineState == 'online') || ($this->onlineState == 'in-game');\n }", "public function getUsersOnline()\n {\n $users = array_map( \"trim\", file('online.log', FILE_SKIP_EMPTY_LINES));\n return $users;\n }", "public function isOnline()\n\t{\n\t\t$server = new Application_Model_Server();\n\t\t$players = $server->getOnlinePlayers();\n\t\t\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\tif ($player == $this->getUsername()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function isOnline()\n\t {\t\tdate_default_timezone_set('Pacific/Auckland');\n\t\t\t$to_time = strtotime(date('Y-m-d H:i:s'));\n\t\t\t$from_time = strtotime($this->last_online);\n\t\t\tif( round(abs($to_time - $from_time) / 60,2) < 10){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t }", "public function all_user_connected() {\n try\n {\n $max_last_ping = time() - 31;\n $stmt = $this->db->prepare(\"SELECT * FROM connected_user WHERE last_ping > :last_ping\");\n $stmt->execute(array(\n 'last_ping' => $max_last_ping\n ));\n\n while($result = $stmt->fetch()) {\n $listid[] = $result['id_user'];\n }\n \n return $listid;\n }\n catch(PDOException $e) {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "private function _isOnline($input) {\n\t\tif(!$this->_identifier) throw new Exception(lang('error_145'));\n\t\t\n\t\t$Account = new Account();\n\t\t\n\t\tswitch($input) {\n\t\t\tcase 'userid':\n\t\t\t\t$Account->setUserid($this->_identifier);\n\t\t\t\treturn $Account->isOnline();\n\t\t\t\tbreak;\n\t\t\tcase 'username':\n\t\t\t\t$Account->setUsername($this->_identifier);\n\t\t\t\treturn $Account->isOnline();\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t$Account->setEmail($this->_identifier);\n\t\t\t\treturn $Account->isOnline();\n\t\t\t\tbreak;\n\t\t\tcase 'character':\n\t\t\t\t// get account username from character data\n\t\t\t\t$this->character->setPlayer($this->_identifier);\n\t\t\t\t$characterData = $this->character->getPlayerInformation();\n\t\t\t\tif(!$characterData) throw new Exception(lang('error_146'));\n\t\t\t\t\n\t\t\t\t// check online status\n\t\t\t\t$Account->setUsername($characterData[_CLMN_CHR_ACCID_]);\n\t\t\t\treturn $Account->isOnline();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(lang('error_145'));\n\t\t}\n\t}", "public function setStatusOnline()\r\n {\r\n return $this->exec('status_online');\r\n }", "public function isOnline()\n {\n $query = 'SELECT courses.course_id FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups AS c2t '\n .'LEFT JOIN '. rex::getTablePrefix() .'d2u_courses_courses AS courses ON c2t.course_id = courses.course_id'\n .'WHERE c2t.target_group_id = '. $this->target_group_id .' '\n .\"AND online_status = 'online' \"\n .'AND ('. d2u_courses_frontend_helper::getShowTimeWhere() .') ';\n $result = rex_sql::factory();\n $result->setQuery($query);\n\n return $result->getRows() > 0 ? true : false;\n }", "public function getOnlineStatus (Request $request) {\n\n \t$status = $this->profileRepo->getUserOnlineStatus($request->user_id);\n \t\n \tif($status) \n \t\treturn response()->json(['user_id' => $request->user_id, 'online' => '1']);\n \telse\n \treturn response()->json(['user_id' => $request->user_id, 'online' => '0']);\n }", "public function adminShowUserOnlineStatus($id)\n\t{\n\t\t$sql = \"SELECT id,online FROM users WHERE id = '\".$id.\"'\";\n\t\t$row = $this->fetchOne($sql);\n if($row['online'] == \"ON\"){$online = \"<span style='color:#008040;'>Online</span>\";}\n\t\tif($row['online'] == \"OFF\" || $row['online'] == \"0\"){$online = \"<span style='color:#B2BEB5;'>Offline</span>\";}\n return $online;\n\n\t}", "public function onlineMember(){\n\t\t$result=$this->model->memberOnline();\n\t\techo $result;\n\t}", "public function getAllOnline()\n {\n return $this->query()->online()->get();\n }", "public function is_user_online($id)\n {\n $logged_in_users = get_transient('agents_online'); //Get the active users from the transient.\n return isset($logged_in_users[$id]['last']) && $logged_in_users[$id]['last'] > time()-60; //Return boolean if the user has been online in the last 60 seconds (1 minutes).\n }", "public function updateUserOnline()\n {\n $this->is_online = 1;\n $this->save();\n }", "final function isOnline($Return = false){\n if(empty($this->usuario)){\n if($Return){\n return false;\n }else{\n $wlist = $this->config->item('wlist');\n $CI =& get_instance();\n\n $controller = strtolower(get_class($CI));\n if(!in_array($controller,$wlist)){\n redirect(base_url('login'));\n } \n }\n }\n\n if($Return){return true;}\n }", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "public function ChangeUserOnlineStatus()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->ChangeUserOnlineStatus('online');\n exit(json_encode($output));\n }", "public function getOnlineMemberWithStatus($usersIds) {\n\t\t$user_id = $this->Auth->user('id');\n\n\t\t$usersDetails = $this->User->checkOnlineUsers($usersIds, $user_id);\t\t\n\n\t\treturn $usersDetails;\n\t}", "public function get_online_users( $online_user_ids = array() ) {\n\t\t$online = UM()->Online()->get_users();\n\t\tif ( is_array( $online ) ) {\n\t\t\t$online_user_ids = array_keys( $online );\n\t\t}\n\n\t\treturn $online_user_ids;\n\t}", "public function OnlineStatus(){\n\t\t\t$result = $this->makeCallToAPI('OnlineStatus', true, null, array(\n\t\t\t\t'Online' => array('boolean'=>array()),\n\t\t\t\t'LoginEnabled' => array('boolean'=>array())\n\t\t\t));\n\t\t\treturn new WebUI\\OnlineStatus($result->Online, $result->LoginEnabled);\n\t\t}", "function update_whosonline_users($user){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t$ci->db->select('id')->from('ebb_online')->where('Username', $user);\r\n\t\r\n\t//see if we add or update online status.\r\n\tif ($ci->db->count_all_results() == 0){\r\n\t\t#setup values.\r\n\t\t$data = array(\r\n\t\t 'Username' => $user,\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\r\n\t\t#add new preference.\r\n\t\t$ci->db->insert('ebb_online', $data);\r\n\t}else{\r\n\t\t//user is still here so lets up their time to let the script know the user is still around.\r\n\t\t$data = array(\r\n\t\t 'time' => time(),\r\n\t\t 'location' => $_SERVER['PHP_SELF']);\r\n\t\t\r\n\t\t$ci->db->where('Username', $user);\r\n\t\t$ci->db->update('ebb_online', $data);\r\n\t}\r\n}", "public function loadOnlinePlayers() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"All Online Players\");\n\t\t$players = $this -> database -> query(\"SELECT * FROM \" . GLOBAL_DB . \".members WHERE online=1 AND lastWorld !=-1\");\n\t\t$table = \"\";\n\t\twhile ($playerData = $players -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$user = User::getUser($playerData['UID']);\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $user -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">World \" . $user -> getLastWorld() . \"</td>\n\t\t\t</tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t\t$table = \"There are currently no online players.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"globe\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "public function isOnline($identifier)\n {\n return $this->onlineUsers->isOnline($identifier);\n }", "public function isOnline(): bool\n {\n if ($this->getLastlogin() !== null && method_exists($this->getLastlogin(), 'getTimestamp')\n && $this->getLastlogin()->getTimestamp() > (time() - 2 * 60 * 60)\n && UserUtility::checkFrontendSessionToUser($this)\n ) {\n return true;\n }\n return $this->isOnline;\n }", "public function isOnline() \n {\n // pings example.com and google.com\n $is_conn = null;\n $connected1 = @fsockopen(\"www.example.com\", 80); //website, port (try 80 or 443)\n $connected2 = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n // if either is successful\n if ($connected1 || $connected2){\n $is_conn = true; //action when connected\n fclose($connected1);\n fclose($connected2);\n }else{\n $is_conn = false; //action in connection failure\n }\n return $is_conn;\n }", "static function countWhoIsOnline($user, $minutes = 15) {\n $visible_user_ids = Users::findVisibleUserIds($user);\n if(is_foreachable($visible_user_ids)) {\n $users_table = TABLE_PREFIX . 'users';\n $reference = new DateTimeValue(\"-$minutes minutes\");\n \n return (integer) DB::executeFirstCell(\"SELECT COUNT(id) AS 'row_count' FROM $users_table WHERE id IN (?) AND last_activity_on > ?\", $visible_user_ids, $reference);\n } // if\n return 0;\n }", "public function testLoginIsOnlineTrue() : void\n {\n $res = self::$dataService->login( \"change_status\", $this->userA[\"id\"], \"\", \"\", [] );\n\n $this->assertIsArray( $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('status', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('msg', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('uid', $res, 'testLoginIsOnlineTrue' );\n $this->assertArrayHasKey('name', $res, 'testLoginIsOnlineTrue' );\n $this->assertCount(4, $res, 'testLoginIsOnlineTrue' );\n $this->assertEquals( [ \"status\" => true, \"msg\" => \"Welcome back test5\", \"uid\" => \"112387623\", \"name\" => \"test5\" ], $res, 'testLoginIsOnlineTrue' );\n }", "public function frontpage_online_box($users) {\n $online_box = \"<h4>Users online</h4>\n <div class='success' style='margin: 8px;'>\".$users.\"</div>\";\n return $online_box;\n }", "function thrive_bp_check_is_user_online( $user_id )\n\t{\n\t\tif ( function_exists( 'bp_has_members' ) ) {\n\t\t\tif ( bp_has_members( 'type=online&include='. absint( $user_id ) ) ) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function checkOnlineStudentsInClass(Request $request)\n {\n $classid = $request->get('classid');\n $teachers = new Teachers();\n $students = $teachers->getAssignStudentsInClass($classid);\n $totalStudent = 0;\n $onlineStudent = 0;\n foreach ($students as $student) {\n $check = \"vdeskusers:\" . $student->id;\n $status = Redis::keys($check);\n if (!empty ($status)) {\n $student['is_active'] = '1';\n $onlineStudent++;\n } else {\n $student['is_active'] = '0';\n }\n $totalStudent++;\n }\n $status = $onlineStudent . '/' . $totalStudent;\n return response()->json([\n 'status' => true,\n 'online' => $status\n ]);\n }", "public function updateOnline() : void\n {\n $this->lastOnline = time();\n $this->lastIp = Net::ip();\n\n DB::table('users')\n ->where('user_id', $this->id)\n ->update([\n 'user_last_online' => $this->lastOnline,\n 'last_ip' => Net::pton($this->lastIp),\n ]);\n }", "function TurnoffORon(){\r\n $conn= databaseConnection();\r\n $sql = \"SELECT Status\r\n FROM tblOnlineForStaff\r\n WHERE OnlineID=1 ;\";\r\n $result = mysqli_query($conn, $sql);\r\n if (mysqli_num_rows($result) > 0) {\r\n // output data of each row\r\n while($row = mysqli_fetch_assoc($result)) {\r\n if ($row [\"Status\"]==\"Online\")\r\n echo \"checked\";\r\n }\r\n } \r\n mysqli_close($conn);\r\n }", "public function get_user_list($list){\n if(get_instance()->ecl('Instance')->mod('lists', 'if_user_has_list', [get_instance()->ecl('Instance')->user(),$list,'email'])){\n return true;\n } else {\n return false;\n }\n }", "function list_users() {\n $status = session_status();\n if($status == PHP_SESSION_NONE){\n session_start(); /// initialize session\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n return $d[\"users\"];\n }", "public function getOnline()\n {\n return $this->online;\n }", "public function getOnline()\n {\n return $this->online;\n }", "function Members_List_user_viewcurrentonline($args)\n{\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Members_List');\n\n\t// set the cache id\n\t$pnRender->cache_id = pnUserLoggedIn();\n\n\t// check out if the contents are cached.\n\t// If this is the case, we do not need to make DB queries.\n\t// Note that we print out \"cached:\" in front of a chached output --\n\t// of course, this is here to illustrate caching and needs to be removed!\n\tif ($pnRender->is_cached('memberslist_user_currentonline.htm')) {\n\t return $pnRender->fetch('memberslist_user_currentonline.htm');\n\t}\n\n // Load API. All of the actual work for obtaining information on the items\n // get last 10 user id's\n $users = pnModAPIFunc('Members_List', 'user', 'whosonline');\n\n // Current user status\n\t$pnRender->assign('loggedin', pnUserLoggedIn());\n\n $pagedusers = array();\n foreach($users as $userid) {\n $user = pnUserGetVars($userid['uid']);\n $pagedusers[] = $user; \n }\n $pnRender->assign('users', $pagedusers);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('memberslist_user_currentonline.htm');\n\n}", "function online() {\n\t$pdo=new PDO('mysql:host=gtogame.db.9808275.hostedresource.com;dbname=gtogame', 'gtogame', 'D7Awthkp2946!');\n\t// Check login\n\tif (isset($_COOKIE['id'])) {\n\t\t$stmt=$pdo->prepare('SELECT `appearo` FROM Players WHERE id = :id LIMIT 1');\n\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\tif (isset($_COOKIE['id']) AND $row['appearo'] != 1) {\n\t\t\t$stmt=$pdo->prepare('UPDATE Players SET online = :time WHERE id = :id LIMIT 1');\n\t\t\t$stmt->bindValue(':time', time(), PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t} else {\n\t\theader(\"Location: index.php\");\n\t\texit();\n\t}\n}", "private function setOnline($online)\n {\n $this->online = $online;\n }", "public function changeonlinestatus()\r\n {\r\n \tif ($this->isPost()) {\r\n \t\t$userloginid = session('userloginid');\r\n \t\tif (empty($userloginid)) {\r\n \t\t\t$this->ajaxReturn(0,\"没有登录呢\",'wrong');\r\n \t\t} else {\r\n \t\t\t$onlineValue = (int)$_POST['val_online'];\r\n \t\t\t$IUserLogin = D(\"IUserLogin\");\r\n \t\t\tif ($onlineValue == 2) {\r\n \t\t\t\t$newOnlineData = array(\r\n\t\t \t\t\t'uid' => $userloginid,\r\n\t\t \t\t\t'online' => 1,\r\n \t\t\t\t);\r\n \t\t\t\t$IUserLogin->save($newOnlineData);\r\n \t\t\t\t$this->ajaxReturn(1,\"已经切换为正常在线状态\",'yes');\r\n \t\t\t} else {\r\n \t\t\t\t$newOnlineData = array(\r\n\t\t \t\t\t'uid' => $userloginid,\r\n\t\t \t\t\t'online' => 2,\r\n \t\t\t\t);\r\n \t\t\t\t$IUserLogin->save($newOnlineData);\r\n \t\t\t\t$this->ajaxReturn(2,\"已经切换为潜水状态\",'yes');\r\n \t\t\t}\r\n \t\t\t$this->ajaxReturn(0,\"处理错误\",'wrong');\r\n \t\t}\r\n \t}\r\n }", "public function setConfigCheckOnline($input) {\n\t\t$this->_configCheckOnline = ($input ? 1 : 0);\n\t}", "function d4os_io_db_070_os_users_online_users_list_paged($page = 0, $limit = 5, $headers) {\n if (!isset($_GET['page'])) {\n $_GET['page'] = $page;\n }\n if (!isset($_GET['order'])) {\n $_GET['order'] = 'loginTime';\n }\n if (!isset($_GET['sort'])) {\n $_GET['sort'] = 'DESC';\n }\n /*\n * uuid\n * agentIP\n * agentPort\n * loginTime\n * logoutTime\n * currentRegion\n * currentRegionName\n * currentHandle\n * currentPos\n * currentLookAt\n */\n d4os_io_db_070_set_active('os_robust');\n $result = pager_query(\"SELECT * FROM {Presence} AS p\"\n . \" LEFT JOIN {UserAccounts} AS ua ON ua.PrincipalID=p.UserID\"\n . \" LEFT JOIN {Regions} AS r ON r.uuid=p.RegionID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=p.UserID\"\n . \" WHERE gu.Online = 'true'\"\n . \" AND gu.Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND gu.Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" %s\", $limit, 0, NULL, array(tablesort_sql($headers)));\n while ($user = db_fetch_object($result)) {\n $items[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $items;\n}", "public function checkInServerList()\n {\n $serverList = preg_split('/\\r\\n|[\\r\\n]/', ConfPPM::getConf('server_list'));\n $myIP = array();\n $myIP[] = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['GEOIP_ADDR']) ? $_SERVER['GEOIP_ADDR'] : '127.0.0.1';\n if (empty(array_intersect($serverList, $myIP))) {\n return false;\n } else {\n return true;\n }\n }", "public function check_ifOnline($identifier)\n {\n return $this->call_method(\"check/ifOnline\",\n array('identifier' => $identifier,\n )\n );\n }", "function um_online_show_user_status( $args ) {\n\t\tif ( $this->is_hidden_status( um_profile_id() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$args['is_online'] = UM()->Online()->is_online( um_profile_id() );\n\n\t\tob_start();\n\n\t\tUM()->get_template( 'online-marker.php', um_online_plugin, $args, true );\n\n\t\tob_end_flush();\n\t}", "public function getListUser()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"select * from m_user where username<>'admin' order by username desc\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function check_all_ist_busy(){\n return $this->login_model->check_all_busy();\n \n }", "function isOnline()\n{\n $connected = checkdnsrr(\"google.com\");\n\n if ($connected) {\n return true;\n }\n\n return false;\n}", "protected function fetchOnlineUsersFromFile()\n\t{\n\t\t$file_content = @file_get_contents($this -> online_users_file);\n\t\tif ($file_content === false)\n\t\t{\n\t\t\t$this -> online_users = [];\n\t\t}else{\n\t\t\t$this -> online_users = json_decode($file_content, true);\t\n\t\t}\n\t}", "function ultimatemember_online( $args = array() ) {\n\t\tUM()->Online()->enqueue_scripts();\n\n\t\t$defaults = array(\n\t\t\t'max' => 11,\n\t\t\t'roles' => 'all'\n\t\t);\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t$args['online'] = UM()->Online()->get_users();\n\t\t$template = ( $args['online'] && count( $args['online'] ) > 0 ) ? 'online' : 'nobody';\n\n\t\tob_start();\n\n\t\tUM()->get_template( \"{$template}.php\", um_online_plugin, $args, true );\n\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "public static function check_all_user_accounts($conn) \n {\n Ossim_db::check_connection($conn); \n \n $query = \"SELECT login FROM users WHERE login != 'admin'\";\n \n $rs = $conn->Execute($query); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return FALSE;\n } \n \n while (!$rs->EOF) \n {\n $clogin = $conn->GetOne(\"SELECT login FROM users WHERE login = '\".$rs->fields['login'].\"' AND expires > '\".gmdate('Y-m-d H:i:s').\"'\");\n \n if ($clogin == '') \n {\n $conn->Execute(\"UPDATE users SET enabled=0 WHERE login= '\".$rs->fields['login'].\"'\");\n }\n \n $rs->MoveNext();\n }\n \n return TRUE;\n }", "function online_offline_status ($user_id, $forum_mod)\n{\n \tglobal $lang, $board_config, $userdata, $images, $phpbb_theme, $phpEx;\n\t$status['color'] = '';\n\tif ( $user_id['user_id'] != ANONYMOUS )\n\t{\n\t\tif ( $user_id['user_allow_viewonline'] && !$board_config['pnphpbb2_members_online'] )\n\t\t{\n\t\t\tif ( $user_id['user_session_time'] >= (time()-60) )\n\t \t \t{\n\t\t\t\t// Check admin/mod status\n\t\t\t\tif ( $user_id['user_level'] == ADMIN )\n\t\t\t\t{\n\t\t\t\t\t$status['image'] = ( $images['user_admin'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_admin'] . '\" alt=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" title=\"' . sprintf($lang['Admin_online_color'], '', '') . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor3'] . '\"';\n\t\t\t\t}\n\t\t\t\telse if ( $forum_mod )\n\t\t\t\t{\n\t\t\t \t\t$status['image'] = ( $images['user_mod'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_mod'] . '\" alt=\"' . $lang['Moderator'] . '\" title=\"' . $lang['Moderator'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t\t$status['color'] = 'style=\"color:#' . $phpbb_theme['fontcolor2'] . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t$status['image'] = ( $images['user_online'] ) ? '<a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"><img src=\"' . $images['user_online'] . '\" alt=\"' . $lang['Online'] . '\" title=\"' . $lang['Online'] . '\" border=\"0\" hspace=\"3\" align=\"top\" /></a>' : '';\n\t\t\t\t}\t\n\t\t\t\t$status['text'] = $lang['Status'] . '<b><a href=\"' . append_sid(\"viewonline.$phpEx\") . '\"' . $status['color'] . '>' . $lang['Online'] . '</a></b>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t\t\t\t$status['text'] = $lang['Status'] . $lang['Offline'];\n\t\t\t\t$status['image'] = ( $images['user_offline'] ) ? '<img src=\"' . $images['user_offline'] . '\" alt=\"' . $lang['Offline'] . '\" title=\"' . $lang['Offline'] . '\" hspace=\"3\" align=\"top\" />' : '';\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$status['text'] = \"\";\n\t\t$status['image'] = \"\";\n\t}\n\t\n\treturn $status;\n}", "function get_connected_users() {\n global $DB;\n $users = $DB->get_records('report_user_statistics');\n return $users;\n}", "public function count()\n {\n return $this->onlineUsers->count();\n }", "function is_in_admin_list() {\n global $_admin_alias;\n $username = $_SESSION['username'];\n $my_emails = get_col(\"SELECT address FROM people WHERE disa_username = '$username'\");\n $admin_emails = get_col(\"SELECT forward_addr FROM mail_alias WHERE alias = '$_admin_alias'\");\n foreach($my_emails as $my_email) {\n if(in_array($my_email, $admin_emails))\n return true;\n }\n return false;\n}", "public function resetOnline()\n {\n User::where([['type', User::TYPE_MAN], ['online', '!=', 0]])->update(['online' => 0]);\n }", "public function online() {\n\n\t\t// Skip when signing in/out to avoid strange Fatal error\n\t\tif (strpos(URI::instance()->string(), 'sign') === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Visitor::instance()->get_user();\n\t\t$online = new Online_User_Model($_SESSION['session_id']);\n\t\tif (!$online->loaded()) {\n\t\t\t$online->session_id = $_SESSION['session_id'];\n\t\t}\n\t\t$online->last_activity = $_SESSION['last_activity'];\n\t\t$online->user_id = $user ? $user->id : null;\n\t\ttry {\n\t\t\t$online->save();\n\t\t} catch (ORM_Validation_Exception $e) {}\n\t}", "public function serverOnline()\n {\n return @fsockopen( setting('server.ip', '127.0.0.1'), config( 'pw-api.ports.client' ), $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }", "function search_connected_usersfive() {\n global $DB;\n $sql = \"SELECT COUNT(*) AS usuarios_conectados\n FROM {user}\n WHERE lastaccess > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 5 MINUTE));\";\n $connecteduser = $DB->get_record_sql($sql);\n return $connecteduser->usuarios_conectados;\n}", "function count_online(){\n\n\tglobal $d;\n\t$time = 600; // 10 phut\n\t$ssid = session_id();\n\n\t// xoa het han\n\t$sql = \"delete from #_online where time<\".(time()-$time);\n\t$d->query($sql);\n\t//\n\t$sql = \"select id,session_id from #_online order by id desc\";\n\t$d->query($sql);\n\t$result['dangxem'] = $d->num_rows();\n\t$rows = $d->result_array();\n\t$i = 0;\n\twhile(($rows[$i]['session_id'] != $ssid) && $i++<$result['dangxem']);\n\t\n\tif($i<$result['dangxem']){\n\t\t$sql = \"update #_online set time='\".time().\"' where session_id='\".$ssid.\"'\";\n\t\t$d->query($sql);\n\t\t$result['daxem'] = $rows[0]['id'];\n\t}\n\telse{\n\t\t$sql = \"insert into #_online (session_id, time) values ('\".$ssid.\"', '\".time().\"')\";\n\t\t$d->query($sql);\n\t\t$result['daxem'] = mysql_insert_id();\n\t\t$result['dangxem']++;\n\t}\n\t\n\treturn $result; // array('dangxem'=>'', 'daxem'=>'')\n}" ]
[ "0.7345724", "0.7073978", "0.70617306", "0.68892986", "0.6867892", "0.6864916", "0.6840707", "0.6835407", "0.67512155", "0.6697396", "0.6697396", "0.6685548", "0.66441566", "0.6642902", "0.66096693", "0.6605822", "0.6593062", "0.65782773", "0.65550184", "0.65521514", "0.65440756", "0.6534214", "0.65188164", "0.64561266", "0.6446673", "0.644129", "0.64333695", "0.6428233", "0.64148635", "0.64148635", "0.6401296", "0.63961476", "0.638585", "0.6337807", "0.6323257", "0.6322174", "0.6319579", "0.63192034", "0.63025355", "0.62905306", "0.6267469", "0.62515086", "0.62372047", "0.6200471", "0.618929", "0.6178435", "0.61764646", "0.613239", "0.6130765", "0.6112203", "0.6099812", "0.60978585", "0.6073368", "0.6051695", "0.6035524", "0.6030899", "0.60153025", "0.59834635", "0.5954703", "0.59105074", "0.58839655", "0.58788425", "0.5859242", "0.5827403", "0.5816797", "0.58114994", "0.58105683", "0.58052135", "0.5786996", "0.5784541", "0.5780017", "0.5757411", "0.5751463", "0.5743205", "0.57301944", "0.57301944", "0.572236", "0.57213175", "0.57177335", "0.5713168", "0.57118964", "0.5711687", "0.5710738", "0.57101935", "0.5703644", "0.5697938", "0.56954724", "0.56938946", "0.56811535", "0.56730366", "0.5662302", "0.56604373", "0.5652319", "0.5625138", "0.5605019", "0.55995005", "0.55989635", "0.55779743", "0.55512655", "0.5536415" ]
0.88326967
0
addUser Add user to online list
private function addUser() { $this->online->addUser($this->user, $this->place, $this->loginTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addUser(){}", "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 }", "public function addUser(){\n\t}", "public function addUser($user){\n\t\t\tif(!in_array($user, $this->lobby)){\n\t\t\t\tarray_push($this->lobby, $user);\n\t\t\t}\n\t\t}", "function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}", "public function on_user_add(&$user) {\r\n\t\t$this->socket_array[(int)$user->socket] = $user;\r\n\t}", "function addUser($data){\n\t$username = secure($data['username']);\n\t$password = secure($data['password']);\n\t$level = secure($data['level']);\n\t$users = getJSON(USERS);\n\t$id = getId($users);\n\t$callback = \"LOGIN_CHECKCHAR_FAILED\";\n\tif(!checkChar($username)){\n\t\n\t\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t\t//password encryption\t\t\n\t\t$password= md5($password.$salt);\n\t\t$newUser= array(\n\t\t\t\"id\" => $id,\n\t\t\t\"username\" => $username,\n\t\t\t\"password\" => $password,\n\t\t\t\"level\" => $level\n\t\t);\n\t\tarray_push($users,$newUser);\n\t\texport($users, USERS);\n\t\t$callback=\"\";\n\t}\n\treturn $callback; \n}", "public function addMultipleUsers() {\n $this->addUser();\n\n while ( true ) {\n echo \"\\033[32m\".\"Želite li unjeti novog zaposlenika? da/ne \".\"\\033[0m\";\n if ( readline() !== 'da' ) {\n break;\n } else {\n $this->addUser();\n\n }\n\n }\n }", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}", "protected function addUsers(){\n\t\t\n\t\t$users = $this->getOption('users');\n\t\tif (!$users) $this->setError('noUsers');\n\t\tforeach ($users as $userid)\n\t\t\tif (!is_numeric($userid) || !$this->doesUserExists($userid,$this->isDebug())) throw new ForumMException('user id ('.$userid.') is invalid');\t\t\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$name = $this->getName();\n\t\tif (!$name){\n\t\t\t$this->retrieveForumInfo($this->getId(),$this->isDebug());\n\t\t\t$name = $this->getName();\n\t\t} \n\t\t\n\t\t$this->retrieveForumPermissions($name,$this->isDebug());\n\t\t\n\t\t$this->setUsers($users,$this->isDebug());\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}", "function user_add($data, $data1) {\n $id = $data['uid'];\n $name = $data['first_name'].' '.$data['last_name'];\n $email = $data['email'];\n $phone = $data['mobile_phone'].' '.$data['home_phone'];\n\n //add id and name of user to sesstion\n $this->add_session($id, $name);\n\n if (!$this->user_is($id)) {\n $query =\"INSERT INTO users VALUES('$id', '$name', '$email', '$phone');\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n //add friends of current user\n for ($j = 0 ; $j < count($data1) ; ++$j) {\n $this->addFriend($data1[$j], $id);\n }\n }\n }", "public function addUser(User $user)\n\t{\n\t\t$this->_users[$user->getNick()] = $user;\n\t\t$this->_usersCount++;\n\t}", "public function addUser($name, UserConfig $user);", "function addUser($userid) {\n $users = $this->getUsers();\n if (!is_array($users)) {\n $users = array();\n }\n array_push($users, $userid);\n $this->setUsers($users);\n }", "public function addUser(\\Models\\User $user) {\n $this->users[] = $user;\n }", "private function addUser($conn){\t\n\t\t\t$postdata = file_get_contents(\"php://input\");\n\t\t\t$request = json_decode($postdata);\n\t\t\t@$user_email = $request->email;\n\t\t\t@$user_name = $request->username;\n\t\t\t\n\t\t\t$query = 'INSERT INTO `users`(`user_name`, `user_email`, `user_status`) VALUES (\"'.$user_name.'\", \"'.$user_email.'\",0)';\n\t\t\t$sql = $conn->query($query); \n\t\t\n\t\t\t$query2 = \"SELECT MAX(user_id) as user_id FROM users\";\n\t\t\t$sql2 = $conn->query($query2);\n\t\t\tif($sql2->num_rows > 0){\n\t\t\t\t$result = $sql2->fetch_assoc();\n\t\t\t\t$query3 = 'INSERT INTO `playlist`(`user_id`, `playlist_status`) VALUES ('.$result['user_id'].', 0)';\n\t\t\t\t$sql3 = $conn->query($query3);\n\t\t\t\t\n\t\t\t\t$query4 = 'SELECT playlist_id FROM playlist where user_id = '.$result['user_id'];\n\t\t\t\t$sql4 = $conn->query($query4);\n\t\t\t\tif($sql4->num_rows > 0){\n\t\t\t\t\t$this->response('',200);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->response('',204);\n\t\t}", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}", "public function addusers() {\r\n \tif (isset($_SESSION['userid'])) {\n \t\t$notusers=$this->model->getnotusersprojects($_GET['p']);\n \t\t$this->view->set('users',$notusers);\n \t\t$project=$this->model->getproject($_GET['p']);\n $this->view->set('project',$project[0]);\n \t\t$this->view->addusers();\r\n \t} else {\r\n \t\t$this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function addUser($data) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t\n\t\tforeach ($data as $key=>$val) {\n\t\t\tif ($key != 'password') {\n\t\t\t\t$values[$key] = $db->sqlify($val);\n\t\t\t} else {\n\t\t\t\t$values[$key] = $db->sqlify(crypt($val)); \n\t\t\t}\n\t\t}\n\t\t$values['date_created'] = $db->sqlify(date('Y-m-d H:i:s')); \n\t\t\n\t\t$check = false;\n\t\tif (!empty($data['email'])) {\n\t\t\t$check = $this->getUserByEmail($data['email']);\n\t\t} elseif (!empty($data['twitter_id'])) {\n\t\t\t$check = $this->getUserByTwitterId($data['twitter_id']);\n\t\t}\n\t\t\n\t\tif (!$check) {\n\t\t\t$db->insert('users', $values);\n\t\t\t$db->doCommit();\n\t\t}\n\t}", "private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }", "public function addUser($userdata) { // $email, $nick, $new_passwd\n\t\t$username = LDAP_ADMIN_USER;\n\t\t$password = LDAP_ADMIN_PASS;\n\n\t\t$ldap_handle = $this->connect();\n\n\t\tldap_bind($ldap_handle, 'cn='.$username.',dc=chalmers,dc=it', $password);\n\n\t\t$base_dn = \"ou=people,\" . $this->dn;\n\n\t\t$sr = ldap_search($ldap_handle, $base_dn, \"uidnumber=*\", array(\"uidnumber\"));\n\n\t\t$users = ldap_get_entries($ldap_handle, $sr);\n\n\t\t# FIXME: RACE CONDITIONS!\n\t\t$max = 0;\n\t\tforeach($users as $user) {\n\t\t\tif ($user[\"uidnumber\"][0] > $max)\n\t\t\t\t$max = $user[\"uidnumber\"][0];\n\t\t}\n\n\t\t$ldap_data = $this->userArray($userdata, $max+1);\n\t\t$dn = \"uid=$this->user,$base_dn\";\n\n\t\tldap_add($ldap_handle, $dn, $ldap_data);\n\n\t\t$error = ldap_error($ldap_handle);\n\t\tldap_unbind($ldap_handle);\n\t\treturn $error === 0;\n\t}", "function __addUser()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //flow control\n $next = true;\n\n if (!isset($_POST['submit'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('add-user', 'view', $this_url);\n redirect($redirect);\n }\n\n //validate form & display any errors\n $validation = $this->__flmFormValidation('add_user');\n if (!$validation) {\n //show error\n $this->notices('error', $this->form_processor->error_message, 'html');\n //halt\n $next = false;\n }\n\n //add to database\n if ($next) {\n $new_users_id = $this->users_model->addUser($this->client_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n\n //was adding successful\n if (!$new_users_id) {\n //show error\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n //halt\n $next = false;\n }\n }\n\n //update primary contact if selected\n if ($next) {\n if ($this->input->post('client_users_main_contact') == 'on') {\n $this->users_model->updatePrimaryContact($this->client_id, $new_users_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n }\n }\n\n //all is ok\n if ($next) {\n //success\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty');\n\n /*EMAIL - send user an email*/\n $this->__emailer('new_user');\n\n /*EMAIL - send admin notifications*/\n $this->__emailer('admin_notification_new_user');\n\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n }\n\n //load user page\n $this->__clientUsers();\n }", "public function add(array $user);", "public function _friendadd() {\n\t\t$this->history = false;\n\n\t\t// for authenticated only\n\t\tif ($this->user && csrf::valid()) {\n\n\t\t\t// require valid user\n\t\t\t$this->member = new User_Model($username);\n\t\t\tif ($this->member->id) {\n\t\t\t\t$this->user->add_friend($this->member);\n\n\t\t\t\t// News feed event\n\t\t\t\tnewsfeeditem_user::friend($this->user, $this->member);\n\n\t\t\t}\n\t\t}\n\n\t\turl::back('members');\n\t}", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }", "public static function addUser()\n {\n if(empty($_POST))\n {\n require_once(__DIR__.'/../views/form.php');\n exit;\n }\n\n // add user to database\n $user = UserModel::addUser();\n\n if (!$user)\n {\n session_start();\n $_SESSION['message'] = 'Error occurred while saving user. Please try again later.';\n header('Location: /form');\n exit;\n }\n\n // update text file\n if (!self::updateTextFile($_SERVER['DOCUMENT_ROOT'] . $user['about'], $user['euro2016']))\n {\n header('Location: /form');\n exit;\n }\n\n session_start();\n $_SESSION['message'] = 'Successfully saved user';\n\n require_once(__DIR__.'/../views/form.php');\n }", "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 }", "function addonline($uid,$place,$plclink)\n{\n $hidden=mysql_fetch_array(mysql_query(\"SELECT hidden FROM ibwf_users WHERE id='\".$uid.\"'\"));\n if($hidden[0]==0)\n {\n /////delete inactive users\n $tm = time();\n $timeout = $tm - 420; //time out = 5 minutes\n $deloff = mysql_query(\"DELETE FROM ibwf_online WHERE actvtime <'\".$timeout.\"'\");\n ///now try to add user to online list\n $res = mysql_query(\"UPDATE ibwf_users SET lastact='\".time().\"' WHERE id='\".$uid.\"'\");\n $res = mysql_query(\"INSERT INTO ibwf_online SET userid='\".$uid.\"', actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"'\");\n if(!$res)\n {\n //most probably userid already in the online list\n //so just update the place and time\n $res = mysql_query(\"UPDATE ibwf_online SET actvtime='\".$tm.\"', place='\".$place.\"', placedet='\".$plclink.\"' WHERE userid='\".$uid.\"'\");\n \n \n }\n }\n $maxmem=mysql_fetch_array(mysql_query(\"SELECT value FROM ibwf_settings WHERE id='2'\"));\n \n $result = mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM ibwf_online\"));\n\n if($result[0]>=$maxmem[0])\n {\n $tnow = date(\"D d M Y - H:i\");\n mysql_query(\"UPDATE ibwf_settings set name='\".$tnow.\"', value='\".$result[0].\"' WHERE id='2'\");\n }\n $maxtoday = mysql_fetch_array(mysql_query(\"SELECT ppl FROM ibwf_mpot WHERE ddt='\".date(\"d m y\").\"'\"));\n if($maxtoday[0]==0||$maxtoday==\"\")\n {\n mysql_query(\"INSERT INTO ibwf_mpot SET ddt='\".date(\"d m y\").\"', ppl='1', dtm='\".date(\"H:i:s\").\"'\");\n $maxtoday[0]=1;\n }\n if($result[0]>=$maxtoday[0])\n {\n mysql_query(\"UPDATE ibwf_mpot SET ppl='\".$result[0].\"', dtm='\".date(\"H:i:s\").\"' WHERE ddt='\".date(\"d m y\").\"'\");\n }\n}", "public function post_add_users() {\n\t}", "public function add() {\r\n\t\t// init view variables\r\n\t\t// ---\r\n\t\t\r\n\t\t// receive userright token\r\n\t\t$urtoken\t= $this->MediawikiAPI->mw_getUserrightToken()->query->tokens->userrightstoken;\r\n\t\t$this->set( 'urtoken', $urtoken );\r\n\t\t\r\n\t\t// receive usergrouplist\r\n\t\t$ugroups\t\t= $this->Users->Groups->find( 'all' )->all()->toArray();\r\n\t\t$this->set( 'ugroups', $ugroups );\r\n\t\t\r\n\t\tif( $this->request->is( 'post' ) ) {\r\n\t\t\t// required fields empty?\r\n\t\t\tif( empty( $this->request->data[\"username\"] ) || empty( $this->request->data[\"email\"] ) ) {\r\n\t\t\t\t$this->set( 'notice', 'Es wurden nicht alle Pflichtfelder ausgefüllt. Pflichtfelder sind all jene Felder die kein (optional) Vermerk tragen.' );\r\n\t\t\t\t$this->set( 'cssInfobox', 'danger' );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// usergroups\r\n\t\t\t$addGroups\t\t= '';\r\n\t\t\t\t\t\t\r\n\t\t\tforeach( $this->request->data[\"group\"] as $grpname => $grpvalue ) {\r\n\t\t\t\tif( $grpvalue == true ) {\r\n\t\t\t\t\t$addGroups\t.= $grpname . '|';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$addGroups\t\t= substr( $addGroups, 0, -1 );\r\n\t\t\t\r\n\t\t\t// create new mediawiki user\t\t\t\r\n\t\t\t$result\t\t= $this->create(\r\n\t\t\t\t$this->request->data[\"username\"],\r\n\t\t\t\t$this->request->data[\"email\"],\r\n\t\t\t\t$this->request->data[\"realname\"],\r\n\t\t\t\t$addGroups,\r\n\t\t\t\t'',\r\n\t\t\t\t$this->request->data[\"urtoken\"],\r\n\t\t\t\t$this->request->data[\"mailsender\"],\r\n\t\t\t\t$this->request->data[\"mailsubject\"],\r\n\t\t\t\t$this->request->data[\"mailtext\"]\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( $result != 'Success' ) {\r\n\t\t\t\t$this->set( 'notice', 'Beim Anlegen des Benutzer_inaccounts ist ein Fehler aufgetreten.</p><p>' . $result );\r\n\t\t\t\t$this->set( 'cssInfobox', 'danger' );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->set( 'notice', 'Der / Die Benutzer_in wurde erfolgreich angelegt. Er / Sie wurde via E-Mail informiert.' );\r\n\t\t\t$this->set( 'cssInfobox', 'success' );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// set view variables\r\n\t\t$this->set( 'notice', '' );\r\n\t\t$this->set( 'cssInfobox', '' );\r\n\t}", "public function addUser($user_data) {\n\n Yii::$app->db->createCommand()->insert('users', [\n 'username' => $user_data['username'],\n 'password' => $user_data['password'],\n 'authKey' => $user_data['authKey'],\n 'accessToken' => $user_data['accessToken'],\n ])->execute();\n }", "function add_user_list($post_data) {\n $this->db->insert('users_list', $post_data);\n }", "public function addUser(UserInterface $user);", "public function addUser(UserInterface $user);", "function add() {\n RR_Session::start();\n $get = RR_Session::get('loggedin');\n if ($get == true) {\n // blijf op de pagina\n // en laad de admin view\n $this->validateUser(true, 'newuser');\n } else {\n // anders redirect trug naar de login pagina\n $this->validateUser(false);\n }\n }", "function addUser($link,$user)\n\t\t{\n\t\t\t$account_id = mysqli_escape_string($link,$user['account_id']);\n\t\t\t$fname = mysqli_escape_string($link,$user['first_name']);\n\t\t\t$lname = mysqli_escape_string($link,$user['last_name']);\n\t\t\t$birthday = mysqli_escape_string($link,$user['birthday']);\n\t\t\t$sex = mysqli_escape_string($link,$user['sex']);\n\t\t\t$photo = mysqli_escape_string($link,$user['photo']);\n\t\t\t$phone = mysqli_escape_string($link,$user['phone']);\n\t\t\t$sql = 'INSERT INTO profile (account_id,first_name,last_name,birthday,sex,photo,phone_number,num_follower,num_review,num_invited) VALUES ('.$account_id.',\"'.$fname.'\",\"'.$lname.'\",'.$birthday.','.$sex.',\"'.$photo.'\",\"'.$phone.'\",0,0,0)';\n\t\t\tif (mysqli_query($link, $sql)) {\n\t\t\t\t//success\n\t\t\t\treturn \"success\";\n\t\t\t}else{\n\t\t\t\t//error\n\t\t\t\treturn '{\"status\":\"error\",\"message\":\"user not inserted\"}';\n\t\t\t}\n\t\t}", "function admin_add_user()\n{\n global $app;\n\n $user_data = $app->request()->post();\n $app->getLog()->debug('admin_add_user: ' . var_export($user_data, true));\n try {\n $user = $app->bbs->addUser($user_data['username'], $user_data['password']);\n } catch (Exception $e) {\n $app->getLog()->error('admin_add_user: error for adding user ' . var_export($user_data, true));\n $app->getLog()->error('admin_add_user: exception ' . $e->getMessage());\n $user = null;\n }\n $resp = $app->response();\n if (isset($user) && !is_null($user)) {\n $resp->status(200);\n $msg = getMessageString('admin_modified');\n $answer = json_encode(['user' => $user->getProperties(), 'msg' => $msg]);\n $resp->header('Content-type', 'application/json');\n } else {\n $resp->status(500);\n $resp->header('Content-type', 'text/plain');\n $answer = getMessageString('admin_modify_error');\n }\n $resp->header('Content-Length', strlen($answer));\n $resp->body($answer);\n}", "public static function append_into_contact_list(){\n\n\n $id_added_user = $_SESSION[\"user_id_added\"]; // usuario que acabamos de agregar\n\t$current_user_id = $_SESSION[\"id_user\"]; // este soy yo osea el que agrega\n\n\t$QUERY = \"INSERT INTO contact values(NULL,$current_user_id ,$id_added_user) \";\n\n\n\t mysql_query( $QUERY , Conectar::con());\n\n\n\n\t}", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "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 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($data)\r\n {\r\n // Adds a user into the database.\r\n global $db;\r\n // Get what we need.\r\n $stamp = time();\r\n if (isset($_SERVER['REMOTE_ADDR'])) {\r\n $user_ip = $_SERVER['REMOTE_ADDR'];\r\n } else {\r\n $user_ip = false;\r\n }\r\n if (!isset($data['admin'])) {\r\n $admin = false;\r\n } else {\r\n $admin = $data['admin'];\r\n }\r\n $name = $data['name'];\r\n $username = $data['username'];\r\n $email = $data['email'];\r\n $password = $data['password'];\r\n $key = md5($email . $stamp . rand(0, 999));\r\n\r\n // Play with our food.\r\n $salted = $this->salt($password);\r\n // We only want letters and numbers.\r\n $username = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $username);\r\n\r\n // Scrub up and clean up.\r\n $sql = array();\r\n $sql['name'] = $name;\r\n $sql['username'] = $username;\r\n $sql['email'] = $email;\r\n $sql['password'] = $salted;\r\n $sql['regstamp'] = $stamp;\r\n $sql['regip'] = $user_ip;\r\n $sql['verified'] = false;\r\n $sql['verifykey'] = $key;\r\n\r\n $users_uname = db::get_array(\"users\", array(\"username\" => $username));\r\n $users_email = db::get_array(\"users\", array(\"email\" => $email));\r\n $users = (count($users_uname) + count($users_email));\r\n\r\n if ($users > 0) {\r\n if (count($users_uname) > 0) {\r\n return array(\"res\" => false, \"msg\" => \"A user with that Username already exists!\");\r\n } else {\r\n return array(\"res\" => false, \"msg\" => \"A user with that E-Mail already exists!\");\r\n }\r\n } else {\r\n // Insert the data.\r\n db::insert(\"users\", $sql);\r\n do_email($email, $username, \"Email Validation\", \"To begin using your SmallURL account, you need your email verifying. <br /> Please visit <a href='http://account.smallurl.in/verify/{$key}'> http://account.smallurl.in/verify/{$key} </a> to validate your account.\");\r\n\t\t\treturn array(\"res\" => true, \"msg\" => \"Registered!\");\r\n }\r\n }", "public function addUser($data)\n{\n\t$this->insert($data);\n}", "public function add() {\n $user = $this->Users->newEntity();\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->data);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('The user has been saved.'));\n \n return $this->redirect(['action' => 'login']);\n } else {\n $this->Flash->error(__('The user could not be saved. Please, try again.'));\n }\n }\n \n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }", "private function preAddUser(){\n $LMS = new LMS();\n $api = $LMS->getDataXUserPass($this->_user, $this->_pass, 'https://www.sistemauno.com/source/ws/uno_wsj_login.php');\n $this->_person = \"\";\n if ($this->isObjectAPI($api)) {\n //validar Permisos\n $FilterAPI = new FilterAPI($api);\n $this->_datPerson = $FilterAPI->runFilter($this->_user, $this->_pass);\n if (is_array($this->_datPerson)) {\n //si el usuario cuenta con un perfil apropiado se le pide que valide sus coreo\n $this->validateEmailUser();\n if($this->validUniqueMail()){\n $this->sendMail();\n $this->_response = \"1|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }else{\n $this->_response = \"2|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }\n } else {\n $this->_response = $this->_datPerson;\n }\n } else {\n $this->_response = $api;\n }\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "function addUser( $user, $password, $email = '', $realname = '' ) {\n return false;\n }", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', '[email protected]', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "function addActiveUser($username, $time){\r\n $q = \"UPDATE \".TBL_USERS.\" SET timestamp = '$time' WHERE username = '$username'\";\r\n mysql_query($q, $this->connection);\r\n \r\n if(!TRACK_VISITORS) return;\r\n $q = \"REPLACE INTO \".TBL_ACTIVE_USERS.\" VALUES ('$username', '$time')\";\r\n mysql_query($q, $this->connection);\r\n $this->calcNumActiveUsers();\r\n }", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function add() {\n\t\t$data = array (\n\t\t\t'be_users_uid' => $this['beUserUid'],\n\t\t\t'group_uid' => $this['groupUid'],\n\t\t\t'rights' => $this['rights']\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group_be_users_mm',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addMembership', 'Added user '.$data['be_users_uid'].' to group '.$data['group_uid']);\n\t\t} else {\n\t\t\tthrow new Exception ('Error adding user. user / group: ' . $data['be_users_uid'] . ' ' . $data['group_uid']);\n\t\t}\n\t}", "function addUser($user,$password) {\r\n\t\twp_create_user($user->mName,$password,$user->mEmail);\r\n\t\treturn true;\r\n\t}", "function addUser ($user) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"INSERT INTO user (_user_FirstName, _user_Email, _user_Password) VALUES (?, ?, ?)\";\n $query = $conn->prepare($sql);\n $query->execute(array($user->_user_FirstName, $user->_user_Email, $user->_user_Password));\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n }", "function addUser(){\n\t$conn = db_connect();\n\n\tif(isset($_GET['id']) && (int)$_GET['id'] > 0){#proper data must be on querystring\n\t\t$myID = (int)$_GET['id']; #Convert to integer, will equate to zero if fails\n\t}\n \n\tif(isset($_POST['firstname'])){$firstName=$_POST['firstname'];}else{$firstName = '';}\n if(isset($_POST['lastName'])){$lastName=$_POST['lastName'];}else{$lastName = '';}\n if(isset($_POST['userPhone'])){$userPhone=$_POST['userPhone'];}else{$firstName = '';}\n if(isset($_POST['userEmail'])){$userEmail=$_POST['userEmail'];}else{$lastName = '';}\n if(isset($_POST['type'])){$type=$_POST['type'];}else{$type = '';}\n \n if(strlen($firstName) >=3)#check if users last name is smaller than 3 characters\n { \n $userName = substr($firstName,0,3) . substr($lastName,0,2);\n }else{#if first name is shorter use as is for username\n $userName = $firstName . substr($lastName,0,2);\n }\n $userName = strtolower($userName); #format users name to site standards\n $userPW = $userName; #default pw is userName\n \n\t$sql = \"INSERT INTO users(FirstName,LastName,PhoneNumber,EmailAddress,TypeId,UserName,UserPassword) VALUES('%s','%s','%s','%s',%d,'%s','%s')\";\n\t$sql = sprintf($sql,$firstName,$lastName,$userPhone,$userEmail,$type,$userName,$userPW);\n\t$result = mysqli_query($conn,$sql); \n\n\tif ($result)\n\t{#successful update!\n\t\t$newURL = 'list.php';\n\t}else{\n\t\t$newURL = 'add.php';\n\t}\n\theader('Location: '.$newURL);\n\tdie();\n}", "function add_user_list($post_data)\n\t{\t\t\n\t\t$this->db->insert('users_list', $post_data); \n\t}", "function addActiveUser($username, $time){\n\t\t$q = \"UPDATE \".TBL_USERS.\" SET timestamp = '$time' WHERE username = '$username'\";\n\t\tmysql_query($q, $this->connection);\n\t\t\n\t\tif(!TRACK_VISITORS) return;\n\t\t$q = \"REPLACE INTO \".TBL_ACTIVE_USERS.\" VALUES ('$username', '$time')\";\n\t\tmysql_query($q, $this->connection);\n\t\t$this->calcNumActiveUsers();\n\t}", "public function addUser(){\n\n\t\ttry {\n\n\t\t\t$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\n\t\t\t$password = $_POST['password'];\n\n\t\t\t$password = hash('sha256', $password);\n\n\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\n\t\t\t$result = $db->query('SELECT * FROM users WHERE username=\"'.$username.'\"');\n\n\t\t\tif ($username && $password) {\n\n\t\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif($row == 0){\n\t\t\t\t\t$statement = $db->query(\"INSERT INTO users (username,password) VALUES ('$username', '$password')\" );\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"Username already taken, pick something else! <br><a href='/userlist'> Go back to user list\");\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "public function add($obj) {\n\t\t\tif (!isset($obj[\"pop_user\"]) || empty($obj[\"pop_user\"])) {\n\t\t\t\t$this->output->add(\"status\", \"No username is set\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$auth = Auth::getInstance($this->db, $this->output);\n\n\t\t\tif (!$auth->hasDelegatedUser($obj[\"pop_user\"]) && ($auth->getUser() !== $obj[\"pop_user\"])) {\n\t\t\t\t$this->output->add(\"status\", \"Not allowed.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$sql = \"INSERT INTO popd (pop_user) VALUES (:pop_user)\";\n\t\t\t$params = array(\n\t\t\t\t\":pop_user\" => $obj[\"pop_user\"]\n\t\t\t);\n\n\t\t\t$status = $this->db->insert($sql, [$params]);\n\n\t\t\tif (isset($status)) {\n\t\t\t\t$this->output->add(\"status\", \"ok\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "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 add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "public function add_users($userdata) {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n $this->db->insert('users', $userdata);\n $id = $this->db->insert_id();\n if ($id) {\n if ($userdata['is_owner']) {\n $data = array('owner_name' => $userdata['firstname'] . ' ' . $userdata['lastname'],\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'active' => 1,\n 'is_user' => $id);\n $this->db->insert('owner', $data);\n }\n return $id;\n } else {\n return FALSE;\n }\n }", "static function add_list_usage($user_id, $word_list_id) {\n global $con;\n $sql = \"INSERT INTO `list_usage` (`user`, `list`, `time`)\n VALUES (\".$user_id.\", \".$word_list_id.\", \".time().\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n }", "function target_add_user($user)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $user['login'] . (empty($user['email']) ? '' : ' ('.$user['email'].')'));\n\n\t// Ensure login and email is unique.\n\t$i = 1;\n\twhile (q_singleval('SELECT id FROM '. $GLOBALS['DBHOST_TBL_PREFIX'] .'users WHERE login='. _esc($user['login']))) {\n\t\t$user['login'] = $user['login'] .'['. $i++ .']';\n\t}\n\twhile (q_singleval('SELECT id FROM '. $GLOBALS['DBHOST_TBL_PREFIX'] .'users WHERE email='. _esc($user['email']))) {\n\t\t$user['email'] = $user['email'] .'['. $i++ .']';\n\t}\n\n\tif (!isset($GLOBALS['theme'])) {\n\t\t$GLOBALS['theme'] = q_singleval(q_limit('SELECT id FROM '. $GLOBALS['DBHOST_TBL_PREFIX'] .'themes WHERE '. q_bitand('theme_opt', 3) .' >= 3', 1));\n\t}\n\n\tif ($user['id'] == 1) {\n\t\tseterr('Cannot add user with id 1 since it is reserved for the anon user in FUDforum.');\n\t}\n\n\tif (!$user['last_visit']) $user['last_visit'] = max($user['last_read'], $user['join_date']);\n\tif (!$user['last_read'] ) $user['last_read'] = max($user['last_visit'], $user['join_date']);\n\tif (!$user['join_date'] ) $user['join_date'] = max($user['last_read'], $user['last_visit']);\n\n\t// Load avatar.\n\t$avatar = 0; $avatar_loc = '';\n\tif (empty($user['avatar'])) {\n\t\t$user['users_opt'] = 4357012;\t// avatar_approved (No Avatar).\n\t} else {\n\t\t$user['users_opt'] = 8551316;\t// avatar_approved YES.\n\t\t$avatar_file = $user['avatar'];\t// Remove URL params.\n\n\t\tif (strpos($avatar_file, '://') ) {\n\t\t\t// External avatar.\n\t\t\tif (!($im = @getimagesize($avatar_file))) {\n\t\t\t\t\tpf('WARNING: external avatar ['. $avatar_file .'] is an invalid image.');\n\t\t\t\t\t// return;\n\t\t\t}\n\t\t\t$avatar_loc = '<img src=\"'. $avatar_file .'\" alt=\"\" '. $im[3] .' />';\n\t\t} else {\n\t\t\t// Check if avatar is in library.\n\t\t\t$avatar = q_singleval('SELECT id FROM '. $GLOBALS['DBHOST_TBL_PREFIX'] .'avatar WHERE img='. _esc(basename($avatar_file)));\n\n\t\t\tif (!$avatar) {\n\t\t\t\t// Custom uploaded avatar.\n\t\t\t\tif (!file_exists($avatar_file)) {\n\t\t\t\t\t$avatar_file = $GLOBALS['CONVERT_FROM_DIR'] .'/'. $avatar_file;\n\t\t\t\t}\n\t\t\t\tif (!($im = @getimagesize($avatar_file))) {\n\t\t\t\t\tpf('WARNING: Cannot find custom uploaded avatar ['. $avatar_file .']');\n\t\t\t\t\t// return;\n\t\t\t\t}\n\t\t\t\t$new_avatar_file = $GLOBALS['WWW_ROOT_DISK'] .'/images/custom_avatars/'. basename($avatar_file);\n\t\t\t\t$new_avatar_url = $GLOBALS['WWW_ROOT'] .'/images/custom_avatars/'. basename($avatar_file);\n\t\t\t\tif (!copy($avatar_file, $new_avatar_file)) {\n\t\t\t\t\tpf('WARNING: Cannot copy custom uploaded avatar ['. $avatar_file .'] to ['. $new_avatar_file .']!');\n\t\t\t\t\t// return;\n\t\t\t\t}\n\t\t\t\t$avatar_loc = '<img src=\"'. $new_avatar_url .'\" alt=\"\" '. $im[3] .' />';\n\t\t\t}\n\t\t}\n\t}\n\n\t// Default user options:\n\t// 2=notify; 4=notify_method EMAIL; 16=email_messages; 32=pm_messages; 128=default_topic_view (MSG);\n\t// 512=gender (UNSPECIFIED); 4096=show_sigs; 8192=show_avatars; 16384=show_im; 131072=email_conf;\n\t//$user['users_opt'] |= 2 | 4 | 16 | 32 | 128 | 256 | 512 | 4096 | 8192 | 16384 | 131072;\n\n\t// Birthday calculations.\n\tif (!empty($user['birthday'])) {\n\t\t$birthday = strftime('%m%d%Y', $user['birthday']);\n\t} else {\n\t\t$birthday = '';\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'users \n\t\t(id, login, alias, name, passwd, salt, last_visit, last_read, join_date, \n\t\temail, home_page, location, interests, occupation, birthday,\n\t\ttime_zone, sig, avatar, avatar_loc,\n\t\ticq, aim, yahoo, msnm, users_opt, theme, custom_fields)\n\t\tVALUES (\n\t\t\t'. (int)$user['id'] .',\n\t\t\t'. _esc($user['login']) .',\n\t\t\t'. _esc(htmlspecialchars($user['login'])) .',\n\t\t\t'. _esc($user['name']) .',\n\t\t\t\\''. $user['passwd'] .'\\',\n\t\t\t'. _esc($user['salt']) .',\n\t\t\t'. (int)$user['last_visit'] .',\n\t\t\t'. (int)$user['last_read'] .',\n\t\t\t'. (int)$user['join_date'] .',\n\t\t\t'. _esc($user['email']) .',\n\t\t\t'. _esc($user['home_page']) .',\n\t\t\t'. _esc($user['location']) .',\n\t\t\t'. _esc($user['interests']) .',\n\t\t\t'. _esc($user['occupation']) .',\n\t\t\t'. _esc($birthday) .',\n\t\t\t'. _esc($user['time_zone']) .',\n\t\t\t'. _esc(bbcode2fudcode($user['sig'])) .',\n\t\t\t'. (int)$avatar .',\n\t\t\t'. _esc($avatar_loc) .',\n\t\t\t'. (int)$user['icq'] .',\n\t\t\t'. _esc($user['aim']) .',\n\t\t\t'. _esc($user['yahoo']) .',\n\t\t\t'. _esc($user['msn']) .',\n\t\t\t'. (int)$user['users_opt'] .',\n\t\t\t'. (int)$GLOBALS['theme'] .',\n\t\t\t'. _esc($user['custom_fields']) .'\n\t\t\t)');\n/*\nfud_use('users_reg.inc');\npf($u->title);\n$nu = new fud_user_reg;\n$nu->login = $u->username;\n$nu->passwd = $u->password;\n$nu->salt = $u->salt;\n$nu->email = $u->email;\n$nu->name = $u->username;\n$nu->reg_ip = $u->regip;\n$nu->add_user();\n*/\n}", "function addUser($user, $password) {\n return true;\n }", "public function AddNewUser()\r\n {\r\n $aUser = array(\r\n 'sFunction' => 'AddNewUser',\r\n 'result' => 'false'\r\n );\r\n \r\n if(isset($_GET['Email']))\r\n {\r\n $mail = $_GET['Email'];\r\n \r\n //Check if user is allready created with that username\r\n $sQuery = $this->conPDO->prepare(\"SELECT sUsername FROM users WHERE sUsername = :email LIMIT 1\");\r\n $sQuery->bindValue(\":email\", $mail);\r\n $sQuery->execute();\r\n \r\n if($sQuery->rowCount() == 0)\r\n {\r\n \r\n //Create the user token\r\n $number = uniqid();\r\n $sUserToken = $this->oBcrypt->genHash($number);\r\n\r\n //Opret en bruger med email som brugernavn, med med en token som skal sendes med email, og det er den token som identifisere hvem brugeren er \r\n //Insert the user into the database, prepare statement runs the security\r\n $sQuery = $this->conPDO->prepare(\"INSERT INTO users (sUsername,iUserRole,sUserCreateToken) VALUES (:sUsername, :iUserRole, :sUserToken)\");\r\n\r\n $sQuery->bindValue(':sUsername', $mail);\r\n $sQuery->bindValue(':iUserRole', '1');\r\n $sQuery->bindValue(':sUserToken', $sUserToken);\r\n\r\n\r\n try\r\n {\r\n $sQuery->execute();\r\n $iUserId = $this->conPDO->lastInsertId();\r\n //Get last inserted id and generate a hash of that to save in the database (the hash is generate with a random string and the iUserId)\r\n //The generated hash is the id to be passed with ajax\r\n $iUserIdHashed = $this->oBcrypt->genHash($iUserId);\r\n\r\n //Update the user\r\n $sQuery = $this->conPDO->prepare(\"UPDATE users SET iUserIdHashed = ? WHERE iUserId = ?\");\r\n\r\n $sQuery->bindValue(1, $iUserIdHashed);\r\n $sQuery->bindValue(2, $iUserId);\r\n\r\n $sQuery->execute(); \r\n }\r\n catch(PDOException $e)\r\n {\r\n die($e->getMessage());\r\n }\r\n\r\n $sMessage = \"Ny bruger til My Local Café, Tryk på dette <a href='http://mylocalcafe.dk/register?sUserToken=$sUserToken'>link</a> for at oprette din profil\";\r\n $sTo = $mail;\r\n $sFrom = '[email protected]';\r\n $sSubject = 'Ny konto hos MyLocal';\r\n\r\n $this->oEmail->SendEmail($sTo, $sFrom, $sSubject, $sMessage);\r\n\r\n $aUser['result'] = 'true';\r\n }\r\n \r\n return $aUser;\r\n }\r\n }", "function addUser(){\n\t$request = Slim::getInstance()->request();\n\t$evaluation = $request->getBody();\n\t$user = array(\"user_id\"=>\"\", \"user_name\"=>\"\", \"user_image\"=>\"\", \"user_twitterhandle\"=>\"\", \"user_facebookid\"=>\"\", \"user_active\"=>\"\");\n\t\n\t// construct data object\n\tforeach (explode('&', $evaluation) as $chunk) {\n\t $param = explode(\"=\", $chunk);\n\n\t if ($param) {\n\t \t$user[$param[0]] = $param[1];\n\t }\n\t}\n\n\t// check if the user exists\n\t$sql = \"SELECT * FROM mercury_users WHERE user_name = :user_name\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"user_name\", $user[\"user_name\"]);\n\t\t$stmt->execute();\n\t\t$matchingEvaluation = $stmt->fetchObject(); \n\n\t\tif($matchingEvaluation){\n\n\t\t}else{\n\t\t\t$sql = \"INSERT INTO mercury_users (user_name, user_image, user_twitterhandle, user_facebookid) VALUES (:user_name, :user_image, :user_twitterhandle, :user_facebookid)\";\n\t\t\ttry {\n\t\t\t\t$db = getConnection();\n\t\t\t\t$stmt = $db->prepare($sql); \n\t\t\t\t$stmt->bindParam(\"user_name\", $user[\"user_name\"]);\n\t\t\t\t$stmt->bindParam(\"user_image\", $user[\"user_image\"]);\n\t\t\t\t$stmt->bindParam(\"user_twitterhandle\", $user[\"user_twitterhandle\"]);\n\t\t\t\t$stmt->bindParam(\"user_facebookid\", $user[\"user_facebookid\"]);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$user[\"user_id\"] = $db->lastInsertId();\n\t\t\t\t$db = null;\n\t\t\t\techo json_encode($user); \n\t\t\t} catch(PDOException $e) {\n\t\t\t\terror_log($e->getMessage(), 3, '/var/tmp/php.log');\n\t\t\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t\t\t}\n\t\t}\n\t}catch(PDOException $e) {\n\t\terror_log($e->getMessage(), 3, '/var/tmp/php.log');\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}", "public function add(UserVO $userVO){\r\n }", "public function updateUserLinked\t(){\n\t\t\n\t\t}", "function addUser($userRecord) {\n\t\t//get the user data array\n\t\t$users = getUsers();\n\t\t//open file for writing\n\t\t$writeFile = fopen('data/users.json', \"w\");\n\t\t//add the new user to the users files\n\t\tarray_push($users, $userRecord);\n\t\t//convert userRecord to JSON\n\t\t$usersJson = json_encode($users,JSON_PRETTY_PRINT);\n\t\t//write JSON string to file\n\t\tfwrite($writeFile, $usersJson);\n\t\t//close file\n\t\tfclose($writeFile);\n\t}", "public function doaddusers() {\r\n \tif (isset($_SESSION['userid'])) {\r\n \t\tif (isset($_POST['userid']) && isset($_POST['projectid'])){\n \t\t\tforeach ($_POST['userid'] as $userid) {\n \t\t\t\t$this->model->putuserproject($userid, $_POST['projectid']);\n \t\t\t}\n \t\t}\n \t\t$this->redirect('?v=userproject&a=show&p='.$_POST['projectid']);\r\n \t} else {\r\n \t\t$this->redirect('?v=index&a=show');\r\n \t}\r\n }", "function addActiveUser($username, $time){ \r\n $query = \"UPDATE \".TBL_USERS.\" SET timestamp = :time WHERE username = :username\";\r\n\t $stmt = $this->connection->prepare($query);\r\n\t $stmt->execute(array(':username' => $username, ':time' => $time));\r\n \r\n if(!TRACK_VISITORS) return;\r\n $query = \"REPLACE INTO \".TBL_ACTIVE_USERS.\" VALUES (:username, :time)\";\r\n\t $stmt = $this->connection->prepare($query);\r\n\t $stmt->execute(array(':username' => $username, ':time' => $time));\r\n $this->calcNumActiveUsers();\r\n }", "public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function user_add()\n\t{\n\t\t$data = array( 'isi' \t=> 'admin/user/v_user_add',\n\t\t\t\t\t\t'nav'\t=>\t'admin/nav',\n\t\t\t\t\t\t'title' => 'Tampil Dashboard Admin');\n\t\t$this->load->view('layout/wrapper',$data);\n\t}", "public function addOrUpdateUser($username, $hash)\n\t{\n\t\t$this -> fetchOnlineUsersFromFile();\n\n\t\t$this -> online_users[$hash] = array(\"USERNAME\" => $username, \"LAST_UPDATE\" => $this -> getCurrentDate() ->format($this -> date_format));\n\n\t\t$this -> updateOnlineUsersFile();\n\t}", "public function addUserLink($link = array()) {\n foreach( $link as $name => $href ) {\n $this->user_links[$name] = $href;\n }\n }", "public static function setUserOnline($uId) \n\t{\n\t\t$rst = \\Main\\DB::select(\"accounts_online\", \"id\", \"user='\".\\Main\\DB::escape($uId).\"'\");\n\t\tif($rst->num_rows > 0) \n\t\t{\n\t\t\t$row = $rst->fetch_object(); \n\t\t\t$oid = $row->id; \n\t\t\t\\Main\\DB::update(\"accounts_online\", $oid, array(\"lastCheck\" => time()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\Main\\DB::insert(\"accounts_online\", array(\"user\" => $uId, \"lastCheck\" => time()));\n\t\t}\n\t}", "public function add() {\n if ($this->User->isLoggedIn() && $this->User->isAdmin()) {\n $flash = null;\n if (isset($_POST['email'])&&isset($_POST['password'])) {\n if ($this->User->insert(\n $_POST['email'],\n $_POST['password']\n )) {\n $flash = \"User {$_POST['email']} added.\";\n }\n }\n return array(\n 'flash' => $flash,\n 'title' => 'Add user'\n );\n } else {\n header(\"Location: \".app::site_url(array('users','login')));\n exit(0);\n }\n }", "public function addMember($userId, $listname)\r\n {\r\n $this->_init();\r\n \r\n if (!$this->_isListAssociatedWithUser($listname)) {\r\n $exceptionMessage = 'List %s is not associate with user %s ';\r\n $exceptionMessage = sprintf($exceptionMessage, \r\n $listname, \r\n $this->getUsername()\r\n );\r\n throw new Zend_Service_Twitter_Exception($exceptionMessage);\r\n }\r\n \r\n $_options['id'] = $this->_validInteger($userId); \r\n $path = '/1/%s/%s/members.xml';\r\n $path = sprintf($path, \r\n $this->getUsername(), \r\n $this->_validListname($listname)\r\n );\r\n \r\n if ($this->_isListMemberLimitReached($listname)) {\r\n $exceptionMessage = 'List can contain no more than %d members';\r\n $exceptionMessage = sprintf($exceptionMessage, \r\n self::LIST_MEMBER_LIMIT\r\n );\r\n throw new Zend_Service_Twitter_Exception($exceptionMessage);\r\n }\r\n \r\n $response = $this->_post($path, $_options);\r\n return new Zend_Rest_Client_Result($response->getBody());\r\n }", "public function add_members() {\n // check if a user + group id exists in membership\n // update that if exists\n // else, add\n // redirect to group id\n\n if (!($this->input->post() || $this->session->has_userdata('curr_group_id'))) {\n $this->_redirect('dashboard/groups');\n exit();\n }\n\n $curr_group_id = $this->session->userdata('curr_group_id');\n \n if ($users = $this->input->post('users')) {\n $this->_add_users($users);\n }\n\n $this->_redirect('dashboard/groups/' . $curr_group_id);\n }", "protected function _addUser($data = null){\n $this->tempData['User'] = $data['User'];\n unset($this->tempData['User']['id']);\n if($this->tempData['User']) {\n return array('success' => true);\n } else {\n return array('success' => false);\n }\n }", "protected function addAdmins(){\n\t\t\n\t\t$users = $this->getOption('users');\n\t\tif (!$users) $this->setError('noUsers');\n\t\tforeach ($users as $userid)\n\t\t\tif (!is_numeric($userid) || !$this->doesUserExists($userid,$this->isDebug())) throw new ForumMException('user id ('.$userid.') is invalid');\t\t\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$name = $this->getName();\n\t\tif (!$name){\n\t\t\t$this->retrieveForumInfo($this->getId(),$this->isDebug());\n\t\t\t$name = $this->getName();\n\t\t} \n\t\t\n\t\t$this->retrieveForumPermissions($name,$this->isDebug());\n\t\t\n\t\t$this->setAdmins($users,$this->isDebug());\t\t\n\t}", "public function userAdd($userModel) {\n // Validating the input on back-end\n $validateEmail = $this->validate->validateEmail($userModel->getEmail());\n $validateUsername = $this->validate->validateInput($userModel->getUsername(), \"/^[a-zA-Z0-9_.-]*$/\", 1, 25);\n $validatePassword = $this->validate->validateInput($userModel->getPassword(), \"/^[a-zA-Z0-9@+_.!?|]*$/\", 8, 20);\n\n // Checking if they all return true\n if ($validateEmail && $validateUsername && $validatePassword) {\n // Checking if email or username is already used\n $emailExist = $this->userDB->checkUserEmailUsed($userModel->getEmail());\n $usernameExist = $this->userDB->checkUsernameUsed($userModel->getUsername());\n\n if ($emailExist != 1) {\n // Returning error if one or more failes\n header(\"Location: create-account?error=3\");\n } else if ($usernameExist != 1) {\n // Returning error if one or more failes\n header(\"Location: create-account?error=4\");\n } else {\n // Sending the model to the database layer create the account\n if ($this->userDB->userAdd($userModel)) {\n // Getting the user info by username and filling the userModel with it\n $userModel = $this->userDB->getUserByUsername($userModel);\n\n // Achievements ophalen\n $achievementList = $this->achievementDB->getAchievements();\n\n // Checking if achievements are connected\n if($this->userDB->connectAchievementsToUser($userModel, $achievementList)) {\n // Logging the user in with session\n session_start();\n $_SESSION['userID'] = $userModel->getID();\n\n // Sending user to home page\n header(\"Location: index\");\n } else {\n // Returning with error\n header(\"Location: create-account?error=5\");\n }\n } else {\n // Returning error if user account is not added\n header(\"Location: create-account?error=5\");\n }\n }\n } else {\n // Returning error if one or more failes\n header(\"Location: create-account?error=5\");\n } \n }", "public function add($user){\n\n $this->builder->insert($user);\n\n }", "private function addUser($user)\n {\n if (!$this->validUsername($user['username'])) {\n throw new Exception('Invalid username');\n } // if\n\n // Convert the password to an passhash\n $user['passhash'] = Services_User_Util::passToHash($this->_settings->get('pass_salt'), $user['newpassword1']);\n\n // Create an API key\n $user['apikey'] = md5(Services_User_Util::generateUniqueId());\n\n // and actually add the user to the database\n $tmpUser = $this->_userDao->addUser($user);\n $this->_userDao->setUserRsaKeys($tmpUser['userid'], $user['publickey'], $user['privatekey']);\n\n /*\n * Now copy the preferences from the anonymous user to this\n * new user\n */\n $anonUser = $this->_userDao->getUser($this->_settings->get('nonauthenticated_userid'));\n $tmpUser = array_merge($anonUser, $tmpUser);\n $tmpUser['prefs']['newspotdefault_tag'] = $user['username'];\n $this->_userDao->setUser($tmpUser);\n\n // and add the user to the default set of groups as configured\n $this->_userDao->setUserGroupList($tmpUser['userid'], $this->_settings->get('newuser_grouplist'));\n\n // now copy the users' filters to the new user\n $this->_daoFactory->getUserFilterDao()->copyFilterList($this->_settings->get('nonauthenticated_userid'), $tmpUser['userid']);\n\n return $tmpUser['userid'];\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function master_add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password, $user_picture){\n //encrypt email\n $user_email = encrypt_user_email($user_email);\n //encrypt password\n $user_password = encrypt_user_password($user_password);\n\n if($this->user->add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password,\n upload_user_profile_picture()) == true){\n // alert user not added\n //add user details to session\n }\n else{\n //alert user not added\n //allow user to try or ask if pass is forgotten\n }\n }", "function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }", "function add_user(array $user){\n $json = file_get_contents(FILE_USERS);\n $user['id']= uniqid();\n // 2 convertir contenu en tableau\n $arrayuser = json_decode($json, true);\n // 3 ajouter new user\n $arrayuser[] = $user;\n // convertir le tableau en json\n $json =json_encode($arrayuser);\n file_put_contents(FILE_USERS, $json); \n}", "public function adduseraccount() {\n\n $usr = new UserAccount();\n\n if(!$usr->access()) {\n\n return \"connection failure!\";\n\n }\n\n if($this->ruseript('name', 'username')) {\n\n return \"username already exists\";\n\n }\n\n else if($this->ruseript('mail', 'email')) {\n\n return \"email already exists\";\n\n }\n\n else {\n\n $usr->insertuserinfo($_POST);\n\n return;\n\n }\n\n }" ]
[ "0.7489906", "0.7341624", "0.7284498", "0.721324", "0.71765566", "0.6925692", "0.6894491", "0.68279076", "0.6794994", "0.675266", "0.6662102", "0.66595215", "0.6651458", "0.6646068", "0.6542056", "0.65294284", "0.6526403", "0.6525425", "0.6522657", "0.6520463", "0.65165466", "0.6515511", "0.6502704", "0.64811325", "0.6476621", "0.64743733", "0.6444887", "0.64432025", "0.64271873", "0.642669", "0.6409817", "0.63950616", "0.63948244", "0.6386336", "0.6381606", "0.6368394", "0.6363721", "0.63592035", "0.63314515", "0.63171095", "0.6313561", "0.6313561", "0.6299226", "0.6299195", "0.6298954", "0.6291744", "0.62827075", "0.62802726", "0.6275165", "0.6273314", "0.6271125", "0.6270407", "0.62540567", "0.62493974", "0.62462395", "0.62434876", "0.62434137", "0.623907", "0.62230587", "0.6217801", "0.6217524", "0.6208188", "0.6205097", "0.6195717", "0.6176486", "0.61702985", "0.6155787", "0.6142061", "0.61284924", "0.61276984", "0.61241543", "0.6108872", "0.6099941", "0.6091317", "0.60901916", "0.60854614", "0.60778606", "0.60752624", "0.6074521", "0.60726565", "0.60680836", "0.606633", "0.606402", "0.6059869", "0.6052727", "0.60468084", "0.60379136", "0.6032847", "0.603096", "0.60276437", "0.6026552", "0.6021037", "0.6019056", "0.6014937", "0.6012278", "0.60033375", "0.59937364", "0.59919405", "0.5990489", "0.5989061" ]
0.8508977
0
method loadVars when called should returnArrayWithProperData
public function test_loadVars_called_returnArrayWithProperData() { $expected = $this->getArrayContentTemplate(); $emailTemplate = new EmailTemplate(); $this->lotteryService->getNextJackpot('EuroMillions')->willReturn(new Money(10000,new Currency('EUR'))); $this->lotteryService->getNextDateDrawByLottery('EuroMillions')->willReturn(new \DateTime()); $next_draw_day = new \DateTime(); $emailTemplateDataStrategy_double = $this->getInterfaceWebDouble('IEmailTemplateDataStrategy'); $emailTemplateDataStrategy_double->getData(Argument::type('EuroMillions\web\interfaces\IEmailTemplateDataStrategy'))->willReturn([]); $data = [ 'jackpot_amount' => 100, 'draw_day_format_one' => $next_draw_day->format('l'), 'draw_day_format_two' => $next_draw_day->format('j F Y') ]; $emailTemplateDataStrategy_double->getData($emailTemplateDataStrategy_double->reveal())->willReturn($data); $sut = new LowBalanceEmailTemplate($emailTemplate, $emailTemplateDataStrategy_double->reveal()); $actual = $sut->loadVars($emailTemplateDataStrategy_double->reveal()); $this->assertEquals($expected,$actual); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "public function test_loadVars_called_returnArrayWithProperData()\n {\n $expected = $this->getArrayContentTemplateJackpot();\n $emailTemplate = new EmailTemplate();\n $this->lotteryService->getNextDateDrawByLottery('EuroMillions')->willReturn(new \\DateTime());\n $this->lotteryService->getNextJackpot('EuroMillions')->willReturn(new Money((int) 10000, new Currency('EUR')));\n $sut = new JackpotRolloverEmailTemplate($emailTemplate, new JackpotDataEmailTemplateStrategy($this->lotteryService->reveal()) );\n $sut->setUser($this->getUser());\n $sut->setThresholdAmount(1000000);\n $actual = $sut->loadVars();\n $this->assertEquals($expected,$actual);\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "function load_other_vars(){\r\n //$boardHeight, $boardWidth, $changePowerups, $level, $player_name, $score\r\n require(\"pdo_save.php\");\r\n\r\n $other_vars = array(\"boardHeight\"=>0, \"boardWidth\"=>0, \"changePowerups\"=>0, \"level\"=>0, \"player_name\"=>0, \"score\"=>0);\r\n\r\n $stmt2 = $pdo_save->query(\"SELECT * FROM other_vars\");\r\n $row = $stmt2->fetch(PDO::FETCH_ASSOC );\r\n $other_vars[\"boardHeight\"] = (int)$row[\"boardHeight\"];\r\n $other_vars[\"boardWidth\"] = (int)$row[\"boardWidth\"];\r\n $other_vars[\"changePowerups\"] = (int)$row[\"changePowerups\"];\r\n $other_vars[\"level\"] = (int)$row[\"level\"];\r\n $other_vars[\"player_name\"] = (string)$row[\"player_name\"];\r\n $other_vars[\"score\"] = (int)$row[\"score\"];\r\n\r\n return $other_vars;\r\n}", "abstract protected function prepareVars(array $data);", "protected function _load()\n {\n return array();\n }", "abstract public function loadData();", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function load() : array;", "abstract protected function load(): array;", "public function variables(): array;", "public function variables(): array;", "function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "protected function initVars() {\n\n\t\t}", "public function get_vb_data ($vars = array());", "protected function prepareVars(): array\n {\n return [];\n\n // $this->p_model = $model = $this->option('model');\n }", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "public function getVars() {\n return array();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "public function getGetVariables();", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "private function lazy_get_vars(): Storage\n\t{\n\t\treturn $this->create_storage($this->config[AppConfig::STORAGE_FOR_VARS]);\n\t}", "public function getGetVariables() {}", "public function getVars() {\r\n return $this->VARS;\r\n }", "protected function getPreserveGetVars() {}", "public function load(array $data);", "private function loadArray(){\n if(file_exists($this->fullPath.$this->arrayFile)){\n include_once($this->fullPath.$this->arrayFile);\n if(!empty($arCfg)){\n $this->loadConfigs($arCfg);\n }\n }\n }", "function load_data(&$preferences, $userid){\n return null;\n }", "abstract protected function loadFields();", "public function prepareData() {\r\n $sections = GearSection::getAll($this->id_shop);\r\n $this->smarty->assign('sections', $sections);\r\n $data = array();\r\n foreach($sections as $section) {\r\n $opts = GearOption::getBySection($section->id, $this->id_shop);\r\n $std = new stdClass();\r\n $std->id = $section->id;\r\n $std->name = $section->name;\r\n $std->label = $section->label;\r\n $std->options = $opts;\r\n array_push($data, $std);\r\n }\r\n \r\n if ($this->imported) { // generate css after import\r\n require_once 'classes/FrontStyle.php';\r\n FrontStyle::generateGearCss($data);\r\n }\r\n \r\n return $data;\r\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "function metadataReadUserVars($hookName, $params) {\n\t\t$userVars =& $params[1];\t\t\n\t\t$userVars[] = 'projectID';\t\t\n\t\treturn false;\n\t}", "protected abstract function loadSessionData();", "public function prepareData(): array\n {\n return [];\n }", "public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }", "private static function getInputVars() {\n\t\tif (static::$vars === null) {\n\t\t\t// take those vars only once\n\t\t\tparse_str(static::getRawData(), $vars);\n\t\t\tstatic::$vars = (array) $vars;\n\t\t}\n\t\t\n\t\treturn static::$vars;\n\t}", "public function load( $arr )\r\n\t{\r\n\t $this->vars = $arr; // keep for use later\r\n\t $this->subject_id = $this->vars['id'];\r\n\t $this->name = $this->vars['name'];\r\n\t $this->url = $this->vars['url'];\r\n\t $this->position = $this->vars['position'];\r\n\t parent::load($arr);\r\n\t}", "public function getDatas()\n\t{\n\t\t$this->skeleton = $this->data[\"skeleton\"];\n\t\t$this->javascript = $this->data[\"javascript\"];\n\t\t$this->css = $this->data[\"css\"];\n\t\t$this->module = $this->data[\"module\"];\n\t\t$this->site = $this->data[\"site\"];\n\t}", "public function load()\n {\n $data = array(\n 'get' => (isset($_GET)) ? $_GET : null, \n 'post' => (isset($_POST)) ? $_POST : null,\n 'request' => (isset($_REQUEST)) ? $_REQUEST : null,\n 'files' => (isset($_FILES)) ? $_FILES : null,\n 'server' => (isset($_SERVER)) ? $_SERVER : null,\n 'session' => (isset($_SESSION)) ? $_SESSION : null\n );\n\n foreach ($data as $name => $value) {\n if ($value !== null) {\n $this->$name = $value;\n $global = strtoupper($name);\n unset($$global);\n }\n }\n }", "protected function process_load($data)\n\t{\n\t\t$parsed_data = array();\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (strpos($key, ':'))\n\t\t\t{\n\t\t\t\tlist($table, $field) = explode(':', $key);\n\t\t\t\tif ($table == $this->_table_name)\n\t\t\t\t{\n\t\t\t\t\t$parsed_data[$field] = $value;\n\t\t\t\t}\n\t\t\t\telseif ($field)\n\t\t\t\t{\n\t\t\t\t\t$this->_lazy[inflector::singular($table)][$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$parsed_data[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$this->_data = $parsed_data;\n\t}", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "public function getAvailableVariables() :array\n {\n return [];\n }", "public function getVariables(): Mailcode_Variables_Collection_Regular;", "private function get_vars2export() {\n\t\treturn array(\n\t\t\t'var_id' => !empty($this->var_id) ? $this->var_id : FALSE\n\t\t);\n\t}", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "public function prepareVars()\n {\n if ($this->formField->disabled) {\n $this->previewMode = true;\n }\n\n $permissionsData = $this->formField->getValueFromData($this->model);\n if (!is_array($permissionsData)) {\n $permissionsData = [];\n }\n\n $this->vars['checkboxMode'] = $this->getControlMode() === 'checkbox';\n $this->vars['permissions'] = $this->getFilteredPermissions();\n $this->vars['baseFieldName'] = $this->getFieldName();\n $this->vars['permissionsData'] = $permissionsData;\n $this->vars['field'] = $this->formField;\n }", "function &getVariables($question_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result_array = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_variable.*, svy_category.title FROM svy_variable LEFT JOIN \".\n\t\t\t\"svy_category ON svy_variable.category_fi = svy_category.category_id WHERE svy_variable.question_fi = %s \".\n\t\t\t\"ORDER BY svy_variable.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\twhile ($row = $ilDB->fetchObject($result))\n\t\t{\n\t\t\t$result_array[$row->sequence] = $row;\n\t\t}\n\t\treturn $result_array;\n\t}", "public function prepareVars()\n {\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['columns'] = $this->getVisibleColumns();\n $this->vars['columnTotal'] = $this->getTotalColumns();\n $this->vars['records'] = $this->getRecords();\n $this->vars['noRecordsMessage'] = trans($this->noRecordsMessage);\n $this->vars['showCheckboxes'] = $this->showCheckboxes;\n $this->vars['showSetup'] = $this->showSetup;\n $this->vars['showPagination'] = $this->showPagination;\n $this->vars['showPageNumbers'] = $this->showPageNumbers;\n $this->vars['showSorting'] = $this->showSorting;\n $this->vars['sortColumn'] = $this->getSortColumn();\n $this->vars['sortDirection'] = $this->sortDirection;\n $this->vars['showTree'] = $this->showTree;\n $this->vars['treeLevel'] = 0;\n\n if ($this->showPagination) {\n $this->vars['pageCurrent'] = $this->records->currentPage();\n // Store the currently visited page number in the session so the same\n // data can be displayed when the user returns to this list.\n $this->putSession('lastVisitedPage', $this->vars['pageCurrent']);\n if ($this->showPageNumbers) {\n $this->vars['recordTotal'] = $this->records->total();\n $this->vars['pageLast'] = $this->records->lastPage();\n $this->vars['pageFrom'] = $this->records->firstItem();\n $this->vars['pageTo'] = $this->records->lastItem();\n }\n else {\n $this->vars['hasMorePages'] = $this->records->hasMorePages();\n }\n }\n else {\n $this->vars['recordTotal'] = $this->records->count();\n $this->vars['pageCurrent'] = 1;\n }\n }", "public function getData(): array\n {\n return $this->variables;\n }", "protected function preprocessData() {}", "public function provider_load() {\n return array(\n array(\n 'text',// Field.\n array(// Post.\n 'text' => 'test',\n ),\n 'test', // Expected.\n ),\n );\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "public function _loadData()\n\t{\n\t\t$this->username = $this->_admin->username;\n\t\t$this->oldPassword = '';\n\t\t$this->last_name = $this->_admin->last_name;\n\t\t$this->first_name = $this->_admin->first_name;\n\t}", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "public function getVars(){\n return $this->getClassVars()->getValues();\n }", "function load_input_file_into_php_array() {\n#This shows the file the directory of the data info\n$file_string = file_get_contents(\"data/input.json\");\n#Adding true will ensure objects are changed to associative arrays\n$file_array = json_decode($file_string, true);\n #Prints out a message to the command line when function is excecuted\nprint \"Loading...\\n\";\n#Returning the variable will prevent a value of \"null\" showing up\n return $file_array;\n}", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "function loadToVar($rname, &$name, &$address, &$phone, &$position, &$begArray, &$endArray, &$jobArray){\n\ttry{\n\t\t$DBH = openDBConnection();\n\t\t$DBH->beginTransaction();\n\n\t\t// Get data associated with this resume from the resume table. Will do history portion later\n\t\t$stmt = $DBH->prepare(\"select * from Resume where RName = ? and Login = ?\");\n\t\t$stmt->bindValue(1, $rname);\n\t\t$stmt->bindValue(2, $_SESSION['login']);\n\t\t$stmt->execute();\n\t\t$row = $stmt->fetch();\n\n\t\t// Save database values to referenced variables\n\t\t$name = $row['Name'];\n\t\t$address = $row['Address'];\n\t\t$phone = $row['Phone'];\n\t\t$position = $row['Position'];\n\n\t\t// Get history data from database\n\t\t$stmt2 = $DBH->prepare(\"select * from History where RName = ? and Login = ?\");\n\t\t$stmt2->bindValue(1, $rname);\n\t\t$stmt2->bindValue(2, $_SESSION['login']);\n\t\t$stmt2->execute();\n\n\t\t// Setup temporary arrays to hold values\n\t\t$beg = array();\n\t\t$end = array();\n\t\t$job = array();\n\n\t\t// Loop through database response to get job history, add to temporary arrays\n\t\twhile($row2 = $stmt2->fetch()){\n\t\t\t$beg[] = $row2['Start'];\n\t\t\t$end[] = $row2['End'];\n\t\t\t$job[] = $row2['Description'];\n\t\t}\n\n\t\t// Save arrays to referenced variables\n\t\t$begArray = $beg;\n\t\t$endArray = $end;\n\t\t$jobArray = $job;\n\n\t\t$DBH->commit();\n\n\t\treturn \"Resume was saved to variables successfully.\";\n\t}\n\tcatch (PDOException $e){\n\t\t$DBH->rollBack();\n\t\treturn \"An error occured while trying to load the resume. Please try again.\";\n\t}\n}", "function load_values($data = false) {\n\t\tif ($data === false) {\n\t\t\tfix_POST_slashes();\n\t\t\t$data = $_POST;\n\t\t}\n\t\tforeach ($this->fields as $field) {\n\t\t\tif ($field->get_multiple_values()) {\n\t\t\t\t$field_name = $field->get_var_name();\n\t\t\t\tif (isset($data[$field_name])) {\n\t\t\t\t\t$field->set_value($data[$field_name]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($data[$field->get_name()])) {\n\t\t\t\t\t$field->set_value($data[$field->get_name()]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function readInputData() {\n\t\t$this->readUserVars(array('seriesId', 'title', 'division', 'affiliation'));\n\t\t$this->readUserVars(array('gridId', 'rowId'));\n\t}", "public function getVars()\n {\n return [\n 'get' => $this->get,\n 'session' => $this->session,\n ];\n }", "public function get_data(): array;", "public function get_data(): array;", "public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}", "protected function _getVarsItem($arr)\n\t{\n\t\tglobal $varsPluginAccountingAccount;\n\n\t\t$varsEntityNation = $this->_getVarsEntityNation(array(\n\t\t\t'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t));\n\n\t\t$arrSectionAccountTitle = $this->_getSectionAccountTitle(array(\n\t\t\t'arrSubAccountTitle' => array(),\n\t\t\t'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t));\n\n\t\t$data = array(\n\t\t\t'varsEntityNation' => $varsEntityNation,\n\t\t\t'arrSectionAccountTitle' => $arrSectionAccountTitle,\n\t\t);\n\n\t\treturn $data;\n\n\t}", "function getVars() {\n return $this->vars;\n }", "function getPublicVarArray($dbConnect, $group, $name){\r\n $ret = array();\r\n\r\n $sql = \"select * from public_vars where gruppe = '\" .$group .\"' and name = '\" .$name .\"' ORDER BY sortnr\";\r\n $res = $dbConnect->executeQuery($sql);\r\n \r\n while ($row = mysql_fetch_array($res)){\r\n $ret[$row['titel']] = $row['text'];\r\n }\r\n\r\n return $ret; \r\n }", "function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}", "function loadFormData() \n\t{\n\t\t$data = JFactory::getApplication()->getUserState(\"$this->option.edit.\".$this->getName().\".data\", array());\n\t\tif (empty($data)) \n\t\t{\n\t\t\t$data = $this->getItem();\n\t\t}\n\t\t\n\t\t$this->preprocessData('com_<#= StrConv(Value(\"Extension.name\"), VbStrConv.Lowercase) #>.<#= StrConv(Value(\"Task.nameObject\"), VbStrConv.Lowercase) #>', $data);\n\t\treturn $data;\n\t}", "protected function loadUserData()\n {\n $this->userData = ($this->session->userData?:[]) + $this->userDataTemplate;\n }", "public function loadModuleData() {}", "public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }", "public function variables($var_ids_str, Request $request) {\n\t\tset_time_limit(10);\n\t\tini_set('memory_limit', '256M');\n\n\t\t$var_ids = array_map(\"floatval\", explode(\"+\", $var_ids_str));\n\t\t$meta = [];\n\t\t$meta['variables'] = [];\n\t\t$meta['license'] = License::find(1)->first();\n\n\t\t// First we make a query to get the general variable info\n\t\t// name, sources, etc. Mainly used by the sources tab\n\t\t$variableQuery = DB::table('variables')\n\t\t\t->whereIn('variables.id', $var_ids)\n\t\t\t->join('datasets', 'variables.fk_dst_id', '=', 'datasets.id')\n\t\t\t->leftJoin('sources', 'variables.sourceId', '=', 'sources.id')\n\t\t\t->select('variables.id as var_id', 'variables.name as var_name',\n\t\t\t\t\t 'variables.description as var_desc', 'variables.unit as var_unit',\n\t\t\t\t\t 'variables.created_at',\n\t\t\t\t\t 'sources.name as source_name', 'sources.description as source_desc',\n\t\t\t\t\t 'datasets.name as dataset_name');\n\n\t\tforeach ($variableQuery->get() as $result) {\n\t\t\t$source = [];\n\t\t\t$source['name'] = $result->source_name;\n\t\t\t$source['description'] = $result->source_desc;\n\n\t\t\t$var = [];\n\t\t\t$var['id'] = $result->var_id;\n\t\t\t$var['name'] = $result->var_name;\n\t\t\t$var['dataset_name'] = $result->dataset_name;\n\t\t\t$var['created_at'] = $result->created_at;\n\t\t\t$var['description'] = $result->var_desc;\n\t\t\t$var['unit'] = $result->var_unit;\n\t\t\t$var['source'] = $source;\n\t\t\t$var['entities'] = [];\n\t\t\t$var['years'] = [];\n\t\t\t$var['values'] = [];\n\t\t\t$meta['variables'][$result->var_id] = $var;\n\t\t}\n\n\t\t// Now we pull out all the actual data\n\t\t$dataQuery = DB::table('data_values')\n\t\t\t->whereIn('data_values.fk_var_id', $var_ids)\n\t\t\t->select('value', 'year',\n\t\t\t\t\t 'data_values.fk_var_id as var_id', \n\t\t\t\t\t 'entities.id as entity_id', 'entities.name as entity_name',\n\t\t\t\t\t 'entities.code as entity_code')\n\t\t\t->join('entities', 'data_values.fk_ent_id', '=', 'entities.id')\n\t\t\t->orderBy('var_id', 'ASC')\n\t\t\t->orderBy('year', 'ASC');\n\n\t\t$response = new StreamedResponse(function() use ($dataQuery, $meta) {\n\t\t\t$out = fopen('php://output', 'w');\n\t\t\tfwrite($out, json_encode($meta));\n\n\t\t\t$entityKey = [];\n\t\t\t$var_id = null;\n\t\t\tforeach ($dataQuery->get() as $result) {\n\t\t\t\tif ($result->var_id != $var_id) {\n\t\t\t\t\t$var_id = $result->var_id;\n\t\t\t\t\tfwrite($out, \"\\r\\n\" . $var_id);\n\t\t\t\t}\n\n\t\t\t\tfwrite($out, \";\");\n\t\t\t\tfwrite($out, $result->year);\n\t\t\t\tfwrite($out, \",\");\n\t\t\t\tfwrite($out, $result->entity_id);\n\t\t\t\tfwrite($out, \",\");\n\t\t\t\tfwrite($out, $result->value);\n\n\t\t\t\tif (!isset($entityKey[floatval($result->entity_id)]))\n\t\t\t\t\t$entityKey[floatval($result->entity_id)] = [ 'name' => $result->entity_name, 'code' => $result->entity_code ];\n\t\t\t}\n\n\t\t\tfwrite($out, \"\\r\\n\");\n\t\t\tfwrite($out, json_encode($entityKey));\n\t\t}, 200, [\n\t\t\t\"Content-Type\" => \"text/plain\",\n\t\t\t\"Cache-Control\" => Chart::getQueryString() ? \"max-age=31536000 public\" : \"no-cache\"\n\t\t]);\n\n\t\treturn $response;\n\t}", "abstract protected function loadDefaults();", "public function load($data);", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "private function loadArray()\n {\n return collect(config('health.resources'))->mapWithKeys(function ($value, $key) {\n return [studly_case($key) => $value];\n });\n }", "function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "protected function GetDescriptionVariables()\n {\n return array();\n }", "public function load($_file, $_name, $_array = FALSE) \n {\n // Lowercase the $name\n $_name = strtolower($_name);\n \n // Include file and add it to the $files array\n if(!file_exists($_file)) return FALSE;\n include( $_file );\n $this->files[$_name]['file_path'] = $_file;\n $this->files[$_name]['config_key'] = $_array;\n \n // Get defined variables\n $vars = get_defined_vars();\n if($_array != FALSE) $vars = $vars[$_array];\n \n // Unset the passes vars\n unset($vars['_file'], $vars['_name'], $vars['_array']);\n \n // Add the variables to the $data[$name] array\n if(count($vars) > 0)\n {\n foreach( $vars as $key => $val ) \n {\n if($key != 'this' && $key != 'data') \n {\n $this->data[$_name][$key] = $val;\n }\n }\n }\n return;\n }", "public function loadDynamicVariables(CommandData &$commandData)\n {\n $dynamicVars = [\n '$NAMESPACE_APP$' => $this->namespaces['app'],\n '$NAMESPACE_REPOSITORY$' => $this->namespaces['repository'],\n '$NAMESPACE_SERVICE$' => $this->namespaces['service'],\n '$NAMESPACE_TRAIT$' => $this->namespaces['trait'],\n '$NAMESPACE_MODEL$' => $this->namespaces['model'],\n '$NAMESPACE_MODEL_EXTEND$' => $this->namespaces['model_extend_class'],\n '$NAMESPACE_CONTROLLER$' => $this->namespaces['controller'],\n '$NAMESPACE_REQUEST$' => $this->namespaces['request'],\n '$NAMESPACE_API_TESTS$' => $this->namespaces['api_tests'],\n '$NAMESPACE_REPOSITORIES_TESTS$' => $this->namespaces['repository_tests'],\n '$NAMESPACE_TESTS$' => $this->namespaces['tests'],\n '$TABLE_NAME$' => $this->tableName,\n '$TABLE_NAME_TITLE$' => Str::studly($this->tableName),\n '$PRIMARY_KEY_NAME$' => $this->primaryKeyName,\n '$MODEL_NAME$' => $this->modelName,\n '$MODEL_NAME_CAMEL$' => $this->modelNames['camel'],\n '$MODEL_NAME_PASCAL$' => ucfirst($this->modelNames['camel']),\n '$MODEL_NAME_PLURAL$' => $this->modelNames['plural'],\n '$MODEL_NAME_PLURAL_CAMEL$' => $this->modelNames['camel_plural'],\n '$MODEL_NAME_PLURAL_PASCAL$' => ucfirst($this->modelNames['camel_plural']),\n '$MODEL_NAME_SNAKE$' => $this->modelNames['snake'],\n '$MODEL_NAME_PLURAL_SNAKE$' => $this->modelNames['snake_plural'],\n '$MODEL_NAME_DASHED$' => $this->modelNames['dashed'],\n '$MODEL_NAME_PLURAL_DASHED$' => $this->modelNames['dashed_plural'],\n '$MODEL_NAME_SLASH$' => $this->modelNames['slash'],\n '$MODEL_NAME_PLURAL_SLASH$' => $this->modelNames['slash_plural'],\n '$MODEL_NAME_HUMAN$' => $this->modelNames['human'],\n '$MODEL_NAME_PLURAL_HUMAN$' => $this->modelNames['human_plural'],\n '$PATH_PREFIX$' => !empty($this->prefixes['namespace']) ? $this->prefixes['namespace'] . '\\\\' : '',\n '$API_PREFIX$' => config('app-generator.api_prefix', 'api'),\n '$API_VERSION$' => config('app-generator.api_version', 'v1'),\n '$FILES$' => '',\n '$ROUTE_NAMED_PREFIX$' => '',\n '$ROUTE_PREFIX$' => '',\n '$RAW_ROUTE_PREFIX$' => '',\n ];\n\n if (!empty($this->prefixes['route'])) {\n $dynamicVars['$ROUTE_NAMED_PREFIX$'] = $this->prefixes['route'] . '.';\n $dynamicVars['$ROUTE_PREFIX$'] = str_replace('.', '/', $this->prefixes['route']) . '/';\n $dynamicVars['$RAW_ROUTE_PREFIX$'] = $this->prefixes['route'];\n }\n\n $commandData->addDynamicVariable($dynamicVars);\n\n return $commandData;\n }", "public function load_data($id=null){\r\n \t//$this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \t//$data=$this->Apimodel->getSub($id);//submiss,soal\r\n\t \t// $data['problem']=$this->Apimodel->getProblem();\r\n\t \t$ids = $this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \techo('<pre>');\r\n\t\tprint_r($ids);\r\n\t\techo('</pre>');\r\n\r\n\r\n\t}", "public function load(){\n // Return null/error text\n\n $this->_data=[\n 'id'=>$this->id,\n 'photo'=>'test'.$this->id.'.png',\n 'descr'=>'The description of '.$this->id.' post.'\n ];\n return null;\n// return 'Data loading error';\n }", "protected function loadFormData()\n\t{\n\t}", "function load_option()\n {\n $op = array();\n \t// $query = $this->db->get('option');\n $query = $this->db->query('SELECT `var`,`value` FROM `option`');\n foreach ( $query->result_array() as $o )\n {\n \t$op[$o['var']] = $o['value'];\n }\n \n return $op;\n \n }", "protected function _updateVars($arr)\n\t{\n\t\tglobal $classHtml;\n\n\t\tglobal $varsAccount;\n\n\t\tif ($arr['varsFlag']['flagFS'] == 'BS' && $arr['varsFlag']['flagFiscalPeriod'] == 'f1') {\n\t\t\t$arr['vars']['portal']['varsList']['tableTree']['varsDetail']['varsColumn']\n\t\t\t = $arr['vars']['portal']['varsList']['tableTree']['varsDetail']['varsColumnBS'];\n\t\t}\n\n\t\t$varsFS = $arr['varsItem']['varsFS']['jsonJgaapFS' . $arr['varsFlag']['flagFS']];\n\n\t\tif ($arr['varsFlag']['flagFS'] == 'BS' && $arr['varsFlag']['idDepartment'] != 'none') {\n\t\t\t$varsDepartmentTreeItem = $this->_getVarsDepartmentTreeItem();\n\t\t\t$arrayNew = array();\n\t\t\t$array = $varsFS;\n\t\t\tforeach ($array as $key => $value) {\n\t\t\t\t$arrayNew[] = $value;\n//unique start\n\t\t\t\tif ($value['vars']['idTarget'] == 'liabilities') {\n//unique end\n\t\t\t\t\t$arrayNew[] = $varsDepartmentTreeItem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$varsFS = $arrayNew;\n\t\t}\n\n\t\t$arr['vars']['portal']['varsList']['varsDetail'] = $this->_getAccountTitleValueColumn(array(\n\t\t\t'vars' => $arr['vars'],\n\t\t\t'varsFS' => $varsFS,\n\t\t\t'varsFSValue' => $arr['varsItem']['varsFSValue']['jsonJgaapFS' . $arr['varsFlag']['flagFS']],\n\t\t\t'varsFlag' => $arr['varsFlag'],\n\t\t));\n\n\t\tif (!$arr['varsFlag']['flagZero']) {\n\t\t\t$arr['vars']['portal']['varsList']['varsDetail'] = $this->_getAccountTitleValueZero(array(\n\t\t\t\t'varsFS' => $arr['vars']['portal']['varsList']['varsDetail'],\n\t\t\t));\n\t\t}\n\n\t\t$varsDetail = $this->_setTreeId(array(\n\t\t\t'idParent' => '-',\n\t\t\t'vars' => $arr['vars']['portal']['varsList']['varsDetail'],\n\t\t));\n\t\t$arr['vars']['portal']['varsList']['varsDetail'] = $varsDetail;\n\n\t\t$varsTemp = $classHtml->allot(array(\n\t\t\t'strClass' => 'TableTree',\n\t\t\t'flagStatus' => 'Html',\n\t\t\t'numTimeZone' => $varsAccount['numTimeZone'],\n\t\t\t'varsDetail' => $varsDetail,\n\t\t\t'varsColumn' => $arr['vars']['portal']['varsList']['tableTree']['varsDetail']['varsColumn'],\n\t\t\t'varsStatus' => $arr['vars']['portal']['varsList']['tableTree']['varsDetail']['varsStatus'],\n\t\t));\n\t\t$arr['vars']['portal']['varsList']['varsHtml'] = $varsTemp['strHtml'];\n\n\t\t$varsAuthority = $this->_getVarsAuthority(array());\n\t\tif (!($varsAuthority == 'admin' || $varsAuthority['flagAllOutput'])) {\n\t\t\t$arr['vars']['portal']['varsList']['varsStart']['varsEdit']['flagOutputUse'] = 0;\n\t\t\t$arr['vars']['portal']['varsList']['varsStart']['varsEdit']['flagPrintUse'] = 0;\n\t\t}\n\n\t\treturn $arr['vars'];\n\t}", "protected function _getVarsItem($arr)\n\t{\n\t\tglobal $varsPluginAccountingAccount;\n\n\t\t$varsPreference = $this->_getVarsPreference(array(\n\t\t\t'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t));\n\n\t\t$data = array(\n\t\t\t'varsPreference' => $varsPreference,\n\t\t);\n\n\t\treturn $data;\n\t}", "protected abstract function getData(): array;", "public function getDataArr(){\n\t\treturn $this->data_arr;\n\t}", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "abstract public function load();", "abstract public function load();", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}" ]
[ "0.66900533", "0.6678735", "0.64030147", "0.6383934", "0.63757026", "0.6333383", "0.62956923", "0.62934405", "0.6254016", "0.6196336", "0.61656684", "0.61656684", "0.6151887", "0.61497647", "0.61261046", "0.61143816", "0.60597646", "0.59771204", "0.59659237", "0.5941745", "0.59192455", "0.58450365", "0.58271295", "0.58128554", "0.57653534", "0.57260036", "0.5712131", "0.56764734", "0.5667729", "0.56504565", "0.5646963", "0.56405354", "0.56260455", "0.5625346", "0.5624022", "0.56219584", "0.56122106", "0.5606927", "0.5592023", "0.55866843", "0.5579515", "0.5564674", "0.55562866", "0.55384636", "0.5523914", "0.5523914", "0.5523914", "0.5523914", "0.5517883", "0.5509879", "0.55094165", "0.55055714", "0.54925394", "0.5487051", "0.5485767", "0.5481848", "0.54443175", "0.5441667", "0.544101", "0.5439482", "0.5437652", "0.5434883", "0.542901", "0.5417916", "0.5417826", "0.5417627", "0.54118633", "0.5408171", "0.5404269", "0.5404269", "0.5401929", "0.54017377", "0.5394182", "0.53706765", "0.5365754", "0.53649086", "0.53631765", "0.5363088", "0.53481376", "0.5347837", "0.53446776", "0.53384525", "0.5337231", "0.5331558", "0.5331546", "0.5330909", "0.53240716", "0.5323424", "0.53229386", "0.5310697", "0.53086805", "0.53041553", "0.5299733", "0.5294612", "0.5294211", "0.52892554", "0.52883565", "0.5286547", "0.5286547", "0.52854997" ]
0.65602946
2
Show the application registration form.
public function getRegister() { return view('auth.register'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "public function showRegistrationForm() {\n //parent::showRegistrationForm();\n $data = array();\n\n $data = $this->example_of_user();\n $data['title'] = 'RegisterForm';\n\n return view('frontend.auth.register', $data);\n }", "public function showRegistrationForm()\n {\n $askForAccount = false;\n return view('client.auth.register',compact(\"askForAccount\"));\n }", "public function showRegisterForm()\n {\n return view('ui.pages.register');\n }", "public function showRegistrationForm()\n {\n return view('adminlte::auth.register');\n }", "public function showRegistrationForm()\n {\n return view('laboratorio.auth.register');\n \n }", "public function showRegistrationForm()\n {\n return view('privato.auth.register');\n }", "public function showRegistrationForm()\n\t{\n\t\t$data = [];\n\t\t\n\t\t// References\n\t\t$data['countries'] = CountryLocalizationHelper::transAll(CountryLocalization::getCountries());\n\t\t$data['genders'] = Gender::trans()->get();\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'register'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'register')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'register'));\n\t\t\n\t\t// return view('auth.register.indexFirst', $data);\n\t\treturn view('auth.register.index', $data);\n\n\t}", "public function showRegistrationForm()\n {\n return view('admin.auth.register');\n }", "public function showRegisterForm()\n {\n return view('estagiarios.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }", "public function showRegistrationForm()\n {\n return view('auth.register');\n }", "public function showRegistrationForm()\n {\n $navList = Nav::getMenuTree(Nav::orderBy('sort', 'asc')->get()->toArray());\n $categories = Category::getMenuTree(Category::orderBy('sort', 'asc')->select('id', 'name', 'pid')->get()->toArray());\n View::share([\n 'nav_list' => $navList,\n 'category_list' => $categories,\n ]);\n return view('auth.register');\n }", "public function showForm()\n {\n return view('auth.register-step2');\n }", "public function showRegistrationForm()\n {\n return view('frontend.user_registration');\n }", "public function showRegisterForm()\n {\n return view('dashboard.user.registerForm');\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public function showRegisterForm(){\n return view('frontend.register');\n }", "public function showRegistrationForm()\n {\n return view('Registration View');\n }", "public function registerForm()\n {\n return view('register', [\n 'titlePart' => '| Register',\n ]);\n }", "public function ShowRegistrationForm(){\n return view('Auth.register');\n }", "public function showRegisterForm(){\n return view('auth.entreprise-register');\n }", "public function showRegistrationForm()\n {\n //Custom code here\n return view('auth.register')->with('packages', Package::all()->where('status', 1));\n }", "public function showRegistrationForm()\n {\n if (property_exists($this, 'registerView')) {\n return view($this->registerView);\n }\n\n $roles = Role::assignable()->orderBy('id')->get();\n return view('auth.register', compact('roles'));\n }", "function showform(){\n return view('registration');\n }", "public function showRegistrationForm()\n {\n return view('auth.officer-register');\n }", "public function showRegistrationForm()\n {\n $countries = Country::all();\n $counties = County::all();\n $nationalities = Nationality::all();\n\n return view('auth.register', compact('countries', 'counties', 'nationalities'));\n }", "public function showRegistrationForm()\n {\n // get all roles expet root.\n $roles = Role::where('name', '!=', 'root')->get();\n $specialties = Specialty::all();\n\n return view('auth.register')->with([\n 'roles' => $roles, \n 'specialties' => $specialties\n ]);\n }", "public function showRegistrationForm()\n {\n $countries = Country::getCountries();\n\n return view('auth.register', compact('countries'));\n }", "public function showRegistrationForm()\n {\n return view('user.auth.login');\n }", "public function showAdminRegisterForm()\n {\n return view('admin.register');\n }", "public function showRegistrationForm()\n {\n return view('signup');\n }", "public function showregistrationform(){\n return view('register');\n }", "public function showRegistrationForm()\n {\n return redirect()->route('frontend.account.register');\n //return theme_view('account.register');\n }", "public function showRegistrationForm()\n {\n $groups = Group::all();\n return view('auth.register', compact('groups'));\n }", "private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}", "public function showRegistrationForm()\n {\n $jurusan = \\App\\Models\\Jurusan::where('active', 1)->get();\n return view('auth.register', ['jurusan' => $jurusan]);\n }", "public function showRegisterForm() {\n return view('seller.registerSeller');\n }", "public function formRegister(){\n $this->view->registerForm();\n }", "public function showReg()\n {\n //show the form\n if (Auth::check())\n {\n return Redirect::route('account');\n }\n\n // Show the page\n return View::make('account.reg');\n }", "public function showRegistration()\n\t{\n\t\t# if the user is already authenticated then they can't register and they can't log in\n\t\t# so get them out of here.\n\t\tif( userIsAuthenticated() ) {\n\t\t\treturn Redirect::to('profile');\n\t\t}\n\n\t\t# if we get here then forget the redirect value as the user has used the global sign in link\n\t\t# and we won't need to take them anywhere specific after authentication\n\t\tSession::forget('previousPage');\n\n\t\t# error vars, something went wrong!\n\t\tif(Session::has('registration-errors')) {\n\t\t\t$errors = reformatErrors(Session::get('registration-errors')['errors']);\n\t\t\t$message = Session::get('registration-errors')['public'];\n\t\t\t$messageClass = \"danger\";\n\n\t\t\t# grab the old form data\n\t\t\t$input = Input::old();\n\t\t}\n\n\t\t# indicate what we're on to the view. This is used to prevent the auth/register pop up\n\t\t# when viewing these pages\n\t\t$page = \"register\";\n\n\t\t$pageTitle = \"Register\";\n\n\t\treturn View::make('register.index', compact('errors', 'message', 'messageClass', 'input', 'form', 'page', 'pageTitle'));\n\t}", "public function showRegistrationForm()\n {\n $tiposDocumento = TipoDocumento::orderBy('nombre')->get();\n $perfiles = Perfil::orderBy('nombre')->get();\n $bodegas = Bodega::orderBy('nombre')->get();\n return view('auth.register') -> with( compact('tiposDocumento','perfiles','bodegas') );\n }", "public function showRegister()\n {\n return view('my_register');\n }", "public function showRegistrationForm()\n {\n if(Role::first()){\n $role = Role::pluck('name', 'id')->toArray();\n return view('Admin::auth.register', compact('role'));\n }else{\n return redirect()->route('admin.createRole');\n }\n }", "public function registrationForm() {\n\n }", "public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }", "public function index()\n {\n return view('registration_form');\n }", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function showSignupForm()\n {\n return view('auth.signup');\n }", "public function showRegistrationForm()\n {\n $roles = Role::orderBy('name','asc')->whereNotIn('name',array('Administrator'))->get();\n return view('auth.register',compact('roles'));\n }", "public function getRegistrationForm()\n {\n \treturn view('auth.institute_register'); \n }", "public function showRegistrationForm()\n { \n $rooms = DB::table('rooms')->get();\n return view('auth.register', compact('rooms'));\n }", "public function registerForm(): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n return $this->render('register.html.twig');\n }", "public function signupForm()\n {\n \t# code...\n \treturn view(\"external-pages.sign-up\");\n }", "public function getRegistrationForm()\n\t{\n\n\t}", "public function registration() {\n return view('auth.registration');\n }", "public function showSalesRegistrationForm()\n {\n return view('auth.sales-register');\n }", "public function registration()\n {\n return view('auth.registration');\n }", "public function showSignupForm()\n {\n return view('signup');\n }", "public function showRegistrationForm()\n {\n $country = DB::table('countries')->get();\n return view('auth.register',['country' => $country]);\n }", "public function showUserCreationForm()\n {\n return view('admin.user_create');\n }", "public function registration()\n {\n return view('register');\n }", "public function register()\n\t{\n\t\treturn View::make('user.register');\n\t}", "function viewSignUpForm() {\n\t$view = new viewModel();\n\t$view->showSignUpForm();\t\n}", "public function register()\n {\n return view('admin.auth.register');\n }", "public function register()\n {\n return view('main.auth.register');\n }", "public function register()\n\t{\n\t\treturn View::make('auth.register');\n\t}", "public function showRegistrationForm()\n {\n $roles=Roles::orderBy('id','asc')->paginate(10);\n return view('auth.register',compact('roles'));\n }", "public function register()\n {\n return view('Admin.login.register');\n }", "public function viewRegistration()\n {\n $config = $this->config;\n\n if (Auth::check()) {\n return redirect()->route('admin.dashboard');\n }\n\n return view('auth.registration', compact('config'));\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "public function getRegisterView() {\n\t\t$header = $this->loginView->getHTMLForm();\n\t\t$body = $this->registerView->getHTMLForm();\n\t\t$footer = \"\";\n\t\treturn new \\common\\view\\Page(\"Bildblogg - registrera användare\", $header, $body, $footer);\n\t}", "private static function printRegForm() {\n\t\t\tinclude 'engine/values/site.values.php';\n\t\t\tif($site_reg_open){\n\t\t\techo \"<form action=\\\"?module=handler&action=registration\\\" method=\\\"post\\\">\n\t\t\t\t <div class=\\\"form_settings\\\">\n\t\t\t\t \t<center><h2>\".strip_tags($site_title).\" - Registration</h2></center>\n\t\t\t\t \t<br>\n\t\t\t\t <p><span>Email</span><input type=\\\"text\\\" name=\\\"email1\\\" tabindex=\\\"1\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm email</span><input type=\\\"text\\\" name=\\\"email2\\\" tabindex=\\\"2\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Name</span><input type=\\\"text\\\" name=\\\"name\\\" tabindex=\\\"3\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Password</span><input type=\\\"password\\\" name=\\\"password1\\\" tabindex=\\\"4\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm password</span><input type=\\\"password\\\" name=\\\"password2\\\" tabindex=\\\"5\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>User agreement</span><textarea class=\\\"contact textarea\\\" name=\\\"useragreement\\\" readonly=\\\"readonly\\\">\".file_get_contents('engine/values/user.agreement.txt').\"</textarea></p>\n\t\t\t\t <p>By pressing submit you agree to the user agreement above.</p>\n\t\t\t\t <p style=\\\"padding-top: 15px\\\"><span>&nbsp;</span><input class=\\\"submit\\\" type=\\\"submit\\\" tabindex=\\\"6\\\" name=\\\"contact_submitted\\\" value=\\\"Submit\\\" /></p>\n\t\t\t\t </div>\n\t\t\t\t</form>\";\n\t\t\t} else {\n\t\t\t\techo \"Registration is currently closed. For more information contact the administrators.\";\n\t\t\t}\n\t\t}", "public function registerFamilyAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authRegisterParent' );\n }", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function showRegistrationForm()\n {\n return redirect('login');\n }", "public function index()\n {\n return view('partials.registrationForm');\n }", "public function registration()\n\t{\n\t\t$this->load->view('register');\n }", "public function form_register()\n {\n $roles = Role::all(); \n return view('auth.register', compact('roles'));\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function register()\n {\n return View::make('users.register');\n }", "public function register()\n {\n return view('form');\n }", "public function create()\n {\n return view('admin.auth.register');\n }", "public function create()\n {\n return view('admin.auth.register');\n }", "public function showSignup()\n\t{\n\t\treturn View::make('signup');\n\t}", "function register()\n {\n // Create our Application instance (necessary to request Facebook data)\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $redirect_url_after_facebook_auth = URL . 'login/registerwithfacebook';\n // hard to explain, read the Facebook PHP SDK for more\n // basically, when the user clicks the Facebook register button, the following arguments will be passed\n // to Facebook: In this case a request for getting the email (not shown by default btw) and the URL\n // when facebook will send the user after he/she has authenticated\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'scope' => 'email',\n 'redirect_uri' => $redirect_url_after_facebook_auth\n ));\n\n $this->view->render('login/register');\n }", "public function index()\n\t{\n\t\t$title = \"Register\";\n\n\t\treturn view('auth.register', compact('title'));\n\t}", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "public function create()\n {\n return view('register.form');\n }", "function register(){\n\t\treturn view(\"pages.index.register\");\n\t}", "public function register()\n {\n return view('frontend.register');\n }", "public function showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "public function index()\n {\n return view('auth.register');\n }", "public function getRegister()\n\t{\n\t\treturn \\View::make('company.auth.register');\n\t}", "public function getRegister()\n {\n return view(\"Home::auth.register\");\n }", "function register(){\n\n return view('auth.register');\n }", "public function actionView()\n {\n \t$model=new RegisterForm();\n \treturn $this->renderPartial('/registration/register',array('model'=>$model));\n }", "function RegistrationForm() {\n\t\t$data = Session::get(\"FormInfo.Form_RegistrationForm.data\");\n\n\t\t$use_openid =\n\t\t\t($this->getForumHolder()->OpenIDAvailable() == true) &&\n\t\t\t(isset($data['IdentityURL']) && !empty($data['IdentityURL'])) ||\n\t\t\t(isset($_POST['IdentityURL']) && !empty($_POST['IdentityURL']));\n\n\t\t$fields = singleton('Member')->getForumFields($use_openid, true);\n\n\t\t// If a BackURL is provided, make it hidden so the post-registration\n\t\t// can direct to it.\n\t\tif (isset($_REQUEST['BackURL'])) $fields->push(new HiddenField('BackURL', 'BackURL', $_REQUEST['BackURL']));\n\n\t\t$validator = singleton('Member')->getForumValidator(!$use_openid);\n\t\t$form = new Form($this, 'RegistrationForm', $fields,\n\t\t\tnew FieldList(new FormAction(\"doregister\", _t('ForumMemberProfile.REGISTER','Register'))),\n\t\t\t$validator\n\t\t);\n\n\t\t// Guard against automated spam registrations by optionally adding a field\n\t\t// that is supposed to stay blank (and is hidden from most humans).\n\t\t// The label and field name are intentionally common (\"username\"),\n\t\t// as most spam bots won't resist filling it out. The actual username field\n\t\t// on the forum is called \"Nickname\".\n\t\tif(ForumHolder::$use_honeypot_on_register) {\n\t\t\t$form->Fields()->push(\n\t\t\t\tnew LiteralField(\n\t\t\t\t\t'HoneyPot',\n\t\t\t\t\t'<div style=\"position: absolute; left: -9999px;\">' .\n\t\t\t\t\t// We're super paranoid and don't mention \"ignore\" or \"blank\" in the label either\n\t\t\t\t\t'<label for=\"RegistrationForm_username\">' . _t('ForumMemberProfile.LeaveBlank', 'Don\\'t enter anything here'). '</label>' .\n\t\t\t\t\t'<input type=\"text\" name=\"username\" id=\"RegistrationForm_username\" value=\"\" />' .\n\t\t\t\t\t'</div>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$member = new Member();\n\n\t\t// we should also load the data stored in the session. if failed\n\t\tif(is_array($data)) {\n\t\t\t$form->loadDataFrom($data);\n\t\t}\n\n\t\t// Optional spam protection\n\t\t$form->enableSpamProtection();\n\n\t\treturn $form;\n\t}" ]
[ "0.8297065", "0.8129581", "0.80603653", "0.80266684", "0.799944", "0.7991334", "0.79490364", "0.7943822", "0.7927548", "0.7884847", "0.7865486", "0.78399515", "0.7831668", "0.7810182", "0.7768593", "0.7721173", "0.77126104", "0.7705905", "0.7700533", "0.7687983", "0.7687317", "0.7664321", "0.76229894", "0.7612647", "0.760388", "0.7570235", "0.75617176", "0.7538868", "0.75342345", "0.75296795", "0.75271606", "0.7505018", "0.7429727", "0.74159354", "0.7415824", "0.7403257", "0.7397781", "0.7393836", "0.73242694", "0.7277446", "0.7268252", "0.72621596", "0.7207488", "0.7172451", "0.7166539", "0.71533144", "0.7146139", "0.7132442", "0.7081848", "0.7069249", "0.7069249", "0.70675105", "0.70569783", "0.70526695", "0.70346606", "0.70136553", "0.7000505", "0.69868505", "0.6979945", "0.69669676", "0.6959301", "0.695743", "0.69277936", "0.6917276", "0.6916973", "0.6887431", "0.6882441", "0.68824387", "0.6880349", "0.6867516", "0.6836969", "0.6835146", "0.6819448", "0.6819448", "0.68158126", "0.68061495", "0.6802297", "0.67885154", "0.6783061", "0.6779848", "0.6773178", "0.6767527", "0.67665184", "0.6761487", "0.6756428", "0.6751873", "0.6751873", "0.6738009", "0.6735529", "0.6726485", "0.6725998", "0.6720303", "0.6708419", "0.67053854", "0.67035246", "0.6697786", "0.6695409", "0.668315", "0.6682737", "0.6682413", "0.667716" ]
0.0
-1
Handle a registration request to the application.
public function postRegister(RegistrationRequest $request) { $credentials = $request->only(['name', 'email', 'password']); $user = $this->users->create($credentials); if (!$user) { return redirect()->route('auth.register'); } event(new UserHasRegistered($user)); flash()->info(trans('authentication.account_activation')); return redirect()->home(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registration()\n {\n \n }", "public function onRegister();", "public function register(){}", "public function register() {}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "protected function registered(Request $request, $user)\n {\n // \n }", "public function handleRegistration()\n {\n $user = $this->repository->signup(\\Input::all());\n\n if ($user->id) {\n if (\\Config::get('confide::signup_email')) {\n \\Mail::queueOn(\n \\Config::get('confide::email_queue'),\n \\Config::get('confide::email_account_confirmation'),\n compact('user'),\n function ($message) use ($user) {\n $message\n ->to($user->email, $user->username)\n ->subject(\\Lang::get('confide::confide.email.account_confirmation.subject'));\n }\n );\n }\n \\Notification::success(\n \\Notification::message(\\Lang::get('users::app.user.registered'))->flash()\n );\n\n return \\Redirect::route('app.session.login');\n\n } else {\n $errors = $user->errors()->all(':message');\n\n if (is_array($errors) && $errors) {\n foreach ($errors as $error) {\n \\Notification::error(\n \\Notification::message(\\Lang::get($error))->flash()\n );\n }\n } else {\n \\Notification::error(\n \\Notification::message(\\Lang::get('users::app.registration.failed'))->flash()\n );\n }\n\n\n return \\Redirect::route('app.session.register');\n }\n }", "public function registration(){\n\n // ejecuta la funcion del modelo verificando que sea post \n \tif ($_SERVER['REQUEST_METHOD'] == 'POST') \n \t{\n \t\t$this->model->registration($_POST['contratista']);\n \t}\n \telse\n \t{\n \t\tshow_404();\n \t}\n }", "public function registrationAction(Request $request)\n {\n try {\n $this->validator->validate($request, 'user_registration');\n } catch (\\Exception $e) {\n $errors = json_decode($e->getMessage(), true);\n $errorMessage = [];\n foreach ($errors as $field => $_errors) {\n foreach ($_errors as $error) {\n $errorMessage[] = $error;\n }\n }\n $ret = new JsonResponse(['message' => implode(', ', $errorMessage)]);\n $ret->setStatus(JsonResponse::STATUS_ERROR);\n return $ret;\n }\n\n $username = $request->get('username');\n $password = $request->get('password');\n\n try {\n $user = $this->security->createUser($username, $password, $request->get('data',array()));\n $this->security->loginByCredentials($username, $password);\n\n $dispatcher = $this->app['dispatcher'];\n $dispatcher->dispatch(SecurityInterface::REGISTRATION_EVENT, new RegistrationEvent($user));\n\n } catch (Exception $e) {\n if ($request->isXmlHttpRequest()) {\n $ret = new JsonResponse(['message' => $e->getMessage()]);\n $ret->setStatus(JsonResponse::STATUS_SYSTEM_ERROR);\n return $ret;\n }\n }\n\n if (!$request->isXmlHttpRequest()) {\n return $this->app->redirect('/?event=welcome');\n } else {\n $user['password'] = $password;\n return new JsonResponse($user);\n }\n\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user) {\n \n }", "abstract public function register();", "abstract public function register();", "abstract public function register();", "public function processRegistration(RegisterRequest $request)\n { \n if (Request::ajax()) {\n return response()->json( array(\n 'status' => 'ok',\n ));\n } \n \n $user = Sentinel::register($request->all()); \n \n if ($user) {\n \n $role = Sentinel::findRoleBySlug($request->get('role'));\n \n $role->users()->attach($user);\n \n $activation = Activation::createIfNotExists($user); \n \n $sent = Mail::send('sentinel.emails.activate', compact('user', 'activation'), function($m) use ($user)\n {\n $m->to($user->email)->subject(trans('sentinel.emails.activate'));\n });\n \n if ( ! $sent) {\n \n return redirect()->back()\n ->withInput()\n ->withErrors(trans('sentinel.errors.send'));\n }\n \n return redirect()->route('auth.login')\n ->with('message', trans('sentinel.messages.account-created'))\n ->with('userId', $user->getUserId());\n }\n \n return redirect()->back()\n ->withInput()\n ->withErrors(trans('sentinel.errors.register'));\n }", "public function register(): void;", "protected static function register() {}", "public function register(Request $request)\n {\n //\n }", "protected function registered()\n {\n //\n }", "public function register()\n {\n // maybe something, one day\n }", "private function overrideRegistration()\n {\n $this->app->instance(\n Spark\\Contracts\\Http\\Requests\\Auth\\RegisterRequest::class,\n RegisterRequest::class\n );\n }", "abstract public function onRegister(): void;", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register($request, $response)\n {\n// $app = new \\Slim\\Slim();\n// $app->post('/register', function ($request, $response){ //How it is supposed to be\n $first_name = $request->getParam('txtFirstName');\n $last_name \t= $request->getParam('txtLastName');\n $email \t= $request->getParam('txtEmail');\n $password \t= md5($request->getParam('txtPassword'));\n $created_at = date(\"Y/m/d\");\n $updated_at = date(\"Y/m/d\");\n\n User::create([ //STORE IN DB\n 'name' => $first_name,\n 'email' => $email,\n 'password' => $password,\n 'created_at' => $created_at,\n 'updated_at' => $updated_at,\n 'verified' => 0\n ]);\n\n $this->send_verification_email($email);\n// });\n }", "public function register()\n {\n $this->registration->execute([],$this);\n }", "public function registerAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Registration request sent to LB\", true);\n $txtName = $_POST['txtName'];\n $txtEmail = $_POST['txtEmail'];\n $txtPhoneNumber = $_POST['txtPhoneNumber'];\n $result = Lb_Points_Helper_Data::registerUser($txtName,$txtEmail,$txtPhoneNumber);\n echo json_encode($result);\n }", "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\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}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "public function register(): void\n {\n\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "abstract public function register ( );", "public function register()\n\t{\n //\n\t}", "public function register(){\n $this->registration->execute([], $this);\n }", "public function registerAction()\n {\n if (!isset($this->post['name'])) {\n return new ResponseModel(ResponseModel::ERRORMSG, \"No name was supplied\");\n }\n $name = $this->post['name'];\n if (strlen($name) < 3) {\n return new ResponseModel( ResponseModel::ERRORMSG, \"Name is too short\");\n }\n\n $session = QuizSessionService::getSession();\n $user = $this->quizService->registerUser($name);\n $session->userId = $user->id;\n return new ResponseModel(ResponseModel::USER, $user);\n }", "public function _register()\n {\n }", "public function register() {\n\t\tif($this->isPost()) {\n\t\t\treturn $this->registerUser();\n\t\t}\n\t\techo json_encode(['success' => false, 'message' => 'Check method type!']);\n\t}", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\n\t{\n\t\t\n\t}", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function register()\r\n {\r\n //\r\n\t}", "public function register() {\n\n $dg = strtoupper( $this->app->request->input('dg') );\n if($dg) {\n // multi-tenant\n $path = config_path('churches/'. $dg .'.php');\n }\n else {\n // single tenant\n $path = config_path('mp.php');\n }\n $this->app['config']->set('mp', require $path);\n\n $this->_registerMinistryPlatform();\n\n }", "public function registerDetails(Request $request)\n {\n DB::beginTransaction();\n\n try {\n validateInput($request->all(), User::updateRulesOnRegister());\n\n $user = $this->jobChoiceService->user()->verifyUser($request);\n Auth::loginUsingId($user->id);\n $this->jobChoiceService->user()->saveClientType($request, $user);\n\n $this->data['results']['token'] = $user->createToken('JobChoice')->accessToken;\n $this->jobChoiceService->slug()->store($user);\n $user = $this->jobChoiceService->user()->updateUserOnRegister($request, $user->id);\n $this->data['results']['message'] = \"Successfully registered\";\n $this->data['results']['user'] = $user;\n $this->data['status'] = 200;\n\n // Validate User ID\n if($user->type == 'job_seeker') {\n // Set Data\n $data = [\n 'user_id' => $user->id,\n 'contact_no' => $request->contact_no,\n 'action' => 'send',\n 'lang' => $request->lang\n ];\n // Send Verification Code\n $twilio = $this->jobChoiceService->twilio()->store($data);\n }\n\n Auth::logout();\n\n } catch (\\Exception $e) {\n DB::rollBack();\n $this->data['error'] = $e->getMessage();\n }\n\n // return 'let me know';\n DB::commit();\n return response()->json($this->data, $this->data['status']);\n }", "public function onRegistration(): void\n { exit;\n }", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\n {\n // ...\n }", "public function register()\n {\n // ...\n }", "public function register(){\r\n\r\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function actionRegister() {\n $this->writeMessage('Start registrate Microservice');\n\n $url = $this->module->gatewayUrl.'/api/gateway/apps/register';\n\n $this->writeMessage('Convert file static file content to base64');\n $this->setFileContents();\n\n $this->writeMessage('create Microservice security ApiKey');\n $this->module->registrationConfig['unixTimeStamp'] = time();\n $this->module->registrationConfig['apiKey'] = $this->getSecurityApiKey();\n\n $data = $this->module->registrationConfig;\n\n $options = array(\n 'http' => array(\n 'header' => \"Content-Type: application/json\\r\\n\",\n 'method' => 'POST',\n 'content' => Json::encode($data)\n )\n );\n\n $this->writeMessage('POST microservice registration: '.$url);\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n if ($result === FALSE) {\n $this->writeMessage('Microservice registration failed. Please check you application configuration');\n return false;\n }\n\n $this->writeMessage('Microservice successfully registrated: '.$this->module->registrationConfig['h2OApp']['host']);\n }", "abstract public function Register();", "public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}", "public function register(): void\n {\n $response = $this->signedPostRequest('acme/new-acct', [\n 'termsOfServiceAgreed' => true,\n ], true);\n $this->kid = $response->getHeader('Location')[0];\n }", "public function register()\n {\n //\n }", "public function registerAction(Request $request)\n {\n if ($request->isMethod('GET')) {\n $authenticated = $this->_isUserAuthenticated($request);\n if ($authenticated) {\n $url = $this->container->get('router')->generate('connection_homepage');\n return new RedirectResponse($url);\n }\n }\n /** @var $formFactory \\FOS\\UserBundle\\Form\\Factory\\FactoryInterface */\n $formFactory = $this->container->get('fos_user.registration.form.factory');\n /** @var $userManager \\FOS\\UserBundle\\Model\\UserManagerInterface */\n $userManager = $this->container->get('fos_user.user_manager');\n /** @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface */\n $dispatcher = $this->container->get('event_dispatcher');\n\n $user = $userManager->createUser();\n $user->setEnabled(true);\n\n $event = new GetResponseUserEvent($user, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n $form = $formFactory->createForm();\n $form->setData($user);\n\n if ('POST' === $request->getMethod()) {\n $form->bind($request);\n\n if ($form->isValid()) {\n $event = new FormEvent($form, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);\n\n $userManager->updateUser($user);\n\n if (null === $response = $event->getResponse()) {\n $url = $this->container->get('router')->generate('edit_user_profile');\n $response = new RedirectResponse($url);\n }\n\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));\n\n return $response;\n }\n }\n\n $registrationType = $form->get('registrationType')->getData();\n if (empty($registrationType) || $registrationType == 'quick') {\n return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:register.html.twig', array(\n 'form' => $form->createView(),\n ));\n } else {\n return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:extended_register.html.twig', array(\n 'form' => $form->createView(),\n ));\n }\n }", "public function registrar(){\n if ($this->input->is_ajax_request()){\n echo $this->compra->registrar();\n }else{\n show_404();\n }\n }", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register(Request $request)\n\t{\n $this->validator($request->all())->validate();\n\n event(new Registered($user = $this->create($request->all())));\n\n return $this->registered($request, $user)\n ?: redirect($this->redirectPath());\n }", "public function register() \n {\n \n\n }", "public function register()\n {\n //\n\t\t\n }", "public function register() {\n //\n }", "public function register() {\n \n $this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('dataprotection', 'Datenschutz', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n if (strtolower($this->input->post('dataprotection')) == 'true') {\n \t// TODO: save acceptance or acceptance date to db, i.e. hand over to model\n } else {\n \t$this->error(404, 'Dataprotection error');\n } \n \n $this->user_model->setValue('email', $this->input->post('email'));\n $this->user_model->setValue(\n \t'hashed_password', \n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n\n if (! $this->user_model->newUser()) {\n\t\t\t$this->error(409, 'Duplicate');\n }\n\n\t\t$this->sendConfirmationMail($this->input->post('email'));\n\t\t$data['msg'] = $this->input->post('email') . ' registered.';\n\t\t$this->responseWithCode(201, $data);\n }", "public function register(Request $request)\n {\n $this->registerValidator();\n //极验验证\n $request->offsetSet('geetest_challenge', $request->input('verify'));\n $this->validator($request->all())->validate();\n //最后验证短信码\n if ($request->get('model') != 'email') {\n Validator::make($request->all(), [\n 'mobile_phone_code' => 'required|sms_code:mobile_phone' //短信验证码\n ], [\n 'mobile_phone_code.sms_code' => '短信验证码验证失败'\n ], [\n 'mobile_phone_code' => '短信验证码'\n ])->validate();\n }\n event(new Registered($user = $this->create($request->all())));\n if ($request->get('model') != 'email') {\n $this->guard()->login($user);\n //用户数据记录\n app('user.logic')->loginCacheInfo();\n }\n return $this->registered($request, $user)\n ?: orRedirect($this->redirectPath());\n }", "public function register()\n {\n echo 'User Registered';\n }", "public function register():void\n {\n //returning a concrete Client request interface depending on the config. Mainly for testing\n $this->app->singleton(ClientRequestInterface::class, function($app){\n if(\\config('app')['env'] === 'live') {\n return new LiveClientRequest();\n }\n return new TestClientRequest();\n });\n }", "public function register() { \n }", "public function registerHandler()\n {\n $this->load->database();\n\t\tdate_default_timezone_set('America/New_York');\n $endpoint = $this->input->get_post('endpoint');\n\t\t$ip = $this->input->get_post('ip');\n\t\t$port = $this->input->get_post('port');\n\t\t$last_seen = Date(\"Y-m-d H:i:s\");\n\t\t\n $data = array('endpoint' => $endpoint, 'ip' => $ip, 'port' => $port, 'last_seen' => $last_seen);\n $this->db->where('endpoint', $endpoint);\n if ($this->db->update('backends', $data)) {\n\t\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode(array('status'=>'success')));\n } else {\n\t\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode(array('status'=>'failed')));\n }\n }", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}" ]
[ "0.6979403", "0.6888007", "0.68419355", "0.6785757", "0.6777993", "0.67499214", "0.67499214", "0.67499214", "0.67499214", "0.67499214", "0.67499214", "0.67499214", "0.67499214", "0.6715186", "0.6710594", "0.6687877", "0.66852635", "0.6617978", "0.6617978", "0.6617978", "0.6617978", "0.6617978", "0.6617978", "0.6617978", "0.66163445", "0.658106", "0.658106", "0.658106", "0.6573888", "0.65690506", "0.65562797", "0.6503338", "0.64842254", "0.6478698", "0.6461387", "0.6458363", "0.645496", "0.645496", "0.645496", "0.645496", "0.645496", "0.64549273", "0.6448443", "0.6446004", "0.6415169", "0.63873917", "0.63822633", "0.63822633", "0.63822633", "0.63822633", "0.63822633", "0.6371268", "0.63569564", "0.6348356", "0.63462466", "0.63428426", "0.63226104", "0.6314942", "0.6309491", "0.6309491", "0.6309491", "0.6309491", "0.6305387", "0.63017035", "0.62734413", "0.6271377", "0.6268406", "0.62663376", "0.625962", "0.625962", "0.625962", "0.62573165", "0.62573165", "0.6250131", "0.62454784", "0.62454784", "0.62351066", "0.6234691", "0.6230754", "0.6202226", "0.6194057", "0.6191694", "0.61916536", "0.6187422", "0.6187422", "0.6187422", "0.6187422", "0.61807936", "0.6178197", "0.6167451", "0.6156721", "0.6149781", "0.6149678", "0.61415994", "0.61396635", "0.61338186", "0.61301416", "0.61290336", "0.61290336", "0.61290336", "0.61290336" ]
0.0
-1
Show the application login form.
public function getLogin() { return view('auth.login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function showLogin()\n\t{\n\t\t// show the form\n\t \treturn View::make('login');\n\t}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function showLoginForm()\n\t{\n\t\treturn view('auth.login');\n\t}", "public function showLoginForm()\n\t{\n\t\t// Remembering Login\n\t\tif (auth()->viaRemember()) {\n\t\t\treturn redirect()->intended($this->redirectTo);\n\t\t}\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'login'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'login')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'login'));\n\t\t\n\t\treturn appView('auth.login');\n\t}", "public function showLoginForm()\n {\n $this->data['title'] = trans('backpack::base.login'); // set the page title\n\n return view('backpack::auth.login', $this->data);\n }", "public function showLoginForm()\n {\n\n /** set session refferrer */\n $this->setPreviousUrl();\n\n /** @var String $title */\n $this->title = __(\"admin.pages_login_title\");\n /** @var String $content */\n $this->template = 'Admin::Auth.login';\n\n /**render output*/\n return $this->renderOutput();\n }", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "public function showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "public function showLoginForm()\n {\n return view('hub::auth.login');\n }", "public function showLoginForm()\n {\n return view('ui.pages.login');\n }", "public function showLoginForm()\n {\n $this->data['title'] = trans('back-project::base.login'); // set the page title\n return view('back-project::auth.login', $this->data);\n }", "public function showLoginForm()\n {\n return view('adminlte::auth.login');\n }", "public function getShowLoginPage()\n {\n echo $this->blade->render(\"login\", [\n 'signer' => $this->signer,\n ]);\n }", "public function showLoginForm()\n {\n return view('auth::login');\n }", "public function showLoginForm()\n {\n $form = \\FormBuilder::create(LoginUserForm::class);\n\n return view('account::auth.login', compact('form'));\n }", "public function showLoginForm()\n {\n return view('blog::admin.pages.auth.login');\n }", "public function showLoginForm()\n {\n return view('shopper::pages.auth.login');\n }", "public function showLoginForm()\n {\n if(Agent::isTable() || Agent::isMobile()){\n return view('errors.desktop-only');\n }\n else{\n return view('auth.login');\n }\n }", "public function showLoginForm()\n {\n return view('admin.auth.login');\n }", "public function showLoginForm()\n {\n return view('admin.auth.login');\n }", "public function showLoginForm()\n {\n return view('admin.auth.login');\n }", "public function showLoginForm()\n {\n $view = 'cscms::frontend.default.auth.login';\n if (View::exists(config('cscms.coderstudios.theme').'.auth.login')) {\n $view = config('cscms.coderstudios.theme').'.auth.login';\n }\n\n return view($view);\n }", "public function showLoginForm()\n {\n return view('auth.magic-login');\n }", "public function showLoginForm()\n {\n return view('auth.login',[\n 'title' => 'Connexion à l\\'espace d\\'administration',\n 'loginRoute' => 'backend.login',\n 'forgotPasswordRoute' => 'backend.password.request',\n ]);\n }", "public function showLoginForm()\n {\n return view('operator.login');\n }", "public function showLoginForm()\n {\n \n if (\\Auth::check()) {\n return redirect()->route('eventmie.welcome');\n }\n return Eventmie::view('eventmie::auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLoginForm()\n {\n\n return view('auth.login');\n }", "public function showLoginForm()\n\t{\n\t\treturn view('auth.organizer.login');\n\t}", "public function showLogin() {\n if (isAuth()) {\n Flash::set(\"You're already logged in!\", 'info');\n $this->redirect($this->url('LoginHome'));\n }\n $active = 'login';\n $this\n ->setTitle('Login')\n ->add('active', $active)\n ->show('login/login');\n }", "public function showLoginForm()\n {\n return view('user.login');\n }", "public function showLoginForm()\n {\n return view('pages.superAdmin.login');\n }", "public function showLoginForm()\n {\n return view('estagiarios.auth.login');\n }", "public function showLoginForm()\n {\n return view('guestAuth.login');\n }", "function Login()\n {\n $this->view->ShowLogin();\n }", "public function showLoginForm()\n {\n return view('admin.login');\n }", "public function showLoginForm()\n {\n return view('admin.login');\n }", "public function showLoginForm()\n {\n return view('admin.login');\n }", "public function showLoginForm()\n {\n return view('admin.login');\n }", "public function showLoginForm()\n {\n return view('admin::auth.login',[\n 'title' => 'Admin Login',\n 'loginRoute' => route('dashboard.login'),\n 'forgotPasswordRoute' => 'dashboard.password.request',\n ]);\n }", "public function showAdminLoginForm()\n {\n $title = Lang::get('admin.ca_login');\n return view('admin.login', compact('title'));\n }", "public function showLoginForm()\n {\n return view('auth.login');\n }", "public function showLogin()\n\t{\n\t\treturn View::make('login');\n\t}", "public function login()\n {\n $this->renderView('login');\n }", "public function index()\r\n\t{\r\n\t\t$this->viewloader(\"auth/loginform\");\r\n\t\t\r\n\t}", "public function formLogin() {\n $this->view->addForm();\n }", "public function showLoginForm()\n {\n if (Auth::viaRemember()) {\n return redirect()->intended('dashboard');\n }\n return view(\"auth.login\");\n }", "public function showLogin(){\n $this->data['pagetitle'] = \"Login\";\n $this->data['page'] = 'login';\n // $this->data['pagecontent'] = 'login';\n $this->data['pagebody'] = 'login';\n \n $this->render();\n }", "public function loginAction()\n {\n // Instantiate the form that asks the user to log in.\n $form = new Application_Form_LoginForm();\n\n // Initialize the error message to be empty.\n $this->view->formResponse = '';\n\n // For security purposes, only proceed if this is a POST request.\n if ($this->getRequest()->isPost())\n {\n // Process the filled-out form that has been posted:\n // if the input values are valid, attempt to authenticate.\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n if ( $this->_authenticate($formData) )\n {\n $this->_helper->redirector('index', 'index');\n }\n }\n }\n\n // Render the view.\n $this->view->form = $form;\n }", "public function showloginform()\n {\n return view('tsadmin.adminloginform');\n }", "public function showLoginForm()\n { \n return view('auth.showLoginForm');\n }", "public function showLoginForm()\n {\n return view('index');\n }", "public function showLogin() {\n return View::make('user.login');\n }", "function showLoginForm() {\n}", "public function login()\n {\n $this->set('title', 'Login');\n $this->render('login');\n }", "public function showLogin()\n {\n return View::make('auth.login');\n }", "function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\t\t\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_default.tpl');\n\t}", "public function showTutorLoginForm()\n {\n $title = Lang::get('admin.ca_login');\n return view('tutor.login', compact('title'));\n }", "public function actionLogin()\n {\n $this->layout = '/login';\n $manager = new Manager(['userId' => UsniAdaptor::app()->user->getId()]);\n $userFormDTO = new UserFormDTO();\n $model = new LoginForm();\n $postData = UsniAdaptor::app()->request->post();\n $userFormDTO->setPostData($postData);\n $userFormDTO->setModel($model);\n if (UsniAdaptor::app()->user->isGuest)\n {\n $manager->processLogin($userFormDTO);\n if($userFormDTO->getIsTransactionSuccess())\n {\n return $this->goBack();\n }\n }\n else\n {\n return $this->redirect($this->resolveDefaultAfterLoginUrl());\n }\n return $this->render($this->loginView,['userFormDTO' => $userFormDTO]);\n }", "public function getLoginForm()\n {\n $incorrect = \\Session::pull('login.incorrect');\n\n $this->nav('navbar.logged.out.login');\n $this->title('navbar.logged.out.login');\n\n return $this->view('auth.login', compact('incorrect'));\n }", "public function showLogin()\n\t{\n $authCheck = $this->authCheckOnEmployeeAccess();\n if(FALSE != $authCheck){return Redirect::route($authCheck['name']);}\n\n $FormMessages = '';\n\n $viewData = array\n (\n 'FormMessages' => $FormMessages,\n );\n return $this->makeResponseView('admin/auth/login', $viewData);\n\t}", "public function showLoginForm()\n {\n return redirect()->route('show.app.login');\n }", "public function actionLogin()\n\t{\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n $signup_model = new SignupForm();\n $login_model = new LoginForm();\n \n return $this->render('login', [\n 'login_model' => $login_model,\n 'signup_model' => $signup_model, 'modal' => true\n ]);\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 showLoginForm()\n { \n if (Auth::user()) {\n return redirect('/admin/dashboard');\n }\n \n return view('index.login');\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->redirect([ 'site/index' ]);\n }\n $referer = \\Yii::$app->request->get('referer', \\Yii::$app->request->referrer);\n if (empty( $referer )) {\n $referer = Url::to([ 'cabinet/main' ], true);\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return Yii::$app->getResponse()\n ->redirect($referer);\n } else {\n return $this->render(\n 'login',\n [\n 'model' => $model,\n ]\n );\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login.twig', [\n 'model' => $model,\n ]);\n }\n }", "public function login()\n\t{\n\t\treturn view(\"auth/login\", [\n\t\t\t'title' => \"Login\"\n\t\t]);\n\t}", "public function showLogin()\n\t{\n return View::make('login');\n\t}", "public function loginForm()\n {\n // If already logged in, redirect appropriately\n if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n }\n \n // prepare errors to display if there are any\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n \n // here the login form view class is loaded and method printHtml() is called \n require_once('views/FormError.class.php');\n require_once('views/LoginForm.class.php');\n $site = new SiteContainer($this->db);\n $form = new LoginForm();\n $error_page = new FormError();\n $site->printHeader();\n $site->printNav();\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n \n }", "public function actionLogin()\n\t{\n\t\t$form=new LoginForm;\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$form->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to previous page if valid\n\t\t\tif($form->validate())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login',array('form'=>$form));\n\t}", "public function showLogin()\n\t{\n if (\\Auth::check())\n {\n // Redirect to homepage\n return \\Redirect::route('dashboard');\n }\n\n // Show the login page\n\t\treturn \\View::make('front.login');\n\t}", "public function showLoginForm(): Response\n {\n return $this->render('login.html');\n }", "public function showLoginForm() {\n $url = url('../') . '/portal/login';\n return Redirect::to($url);\n }", "public function showLogin(){\n\t\t\t\n\t\t\t//Verificamos si ya esta autenticado\n\t\t\tif(Auth::check()){\n\n\t\t\t\t//Si esta autenticado lo mandamos a la raiz, el inicio\n\t\t\t\treturn Redirect::to('/');\n\t\t\t} else {\n\n\t\t\t\t//Si no lo mandamos al formulario de login\n\t\t\t\treturn View::make('login');\n\n\t\t\t}\n\t\t}", "public function showLoginPage()\n {\n return view('auth.login');\n }", "public function login(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Login\";\n \n $this->view(\"accounts/login\",$this->data);\n }", "public function showLogin()\n {\n if (Auth::check())\n {\n // Show Index\n return Redirect::to('/');\n }\n // Show Login\n return View::make('login');\n }", "public function Login()\n\t{\n\t\t$form = new CForm(array('name'=>'loginForm', 'action'=>$this->request->CreateUrl('user/login')), array(\n\t\t\t'acronym' \t\t=> new CFormElementText('acronym', array(\n\t\t\t\t'label'\t\t=> 'Acronym or email:',\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'password'\t\t=> new CFormElementPassword('password', array(\n\t\t\t\t'label'\t\t=> 'Password:',\n\t\t\t\t'type'\t\t=> 'password',\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doLogin', array(\n\t\t\t\t'value'\t\t=> 'Login',\n\t\t\t\t'type'\t\t=> 'submit',\n\t\t\t\t'callback'\t=> array($this, 'DoLogin')\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$form->SetValidation('acronym',array('not_empty'));\n\t\t$form->SetValidation('password',array('not_empty'));\n\t\t\n\t\t$form->Check();\n\n\t\t$this->views->SetTitle('Login');\n\t\t$this->views->AddView('user/login.tpl.php', array(\n\t\t\t'login_form'\t\t=> $form->GetHTML(),\n\t\t\t'allow_create_user'\t=> $this->config['create_new_users'],\n\t\t\t),\n\t\t'primary'\n\t\t);\n\t}", "public function showLogin() {\n\t\treturn View::make('login/login')->with('error', '');\n\t}", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n //return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n //return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\n\t\t// TODO: pull this from a config area\n\t\t$server = 'localhost';\n\t\t$port = '10389';\n\t\t$default_dn = 'cn=William Bush,ou=people,o=sevenSeas';\n\t\t$tpl->assign('server', $server);\n\t\t$tpl->assign('port', $port);\n\t\t$tpl->assign('default_dn', $default_dn);\n\t\t\n\t\t// display login form\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_ldap.tpl');\n\t}", "public function showLoginForm() {\n if (Auth::guard('web')->check()) {\n return redirect()->route('user.dashboard');\n }\n\n if (Auth::guard('division')->check()) {\n return redirect()->route('division.dashboard');\n }\n return view('division.division_login');\n }", "public function actionLogin() {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login() && $model->validate()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->redirect(['site/account']);\n }\n\n $model = new LoginForm();\n\n if (Yii::$app->request->isPost) {\n $postData = Yii::$app->request->post();\n\n if ($model->load($postData) && $model->login()) {\n return $this->redirect(['site/account']);\n }\n }\n\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }", "public function logInPage() {\n $view = new View('login');\n $view->generate();\n }", "public function login()\n\t{\n\t\t$this->load->view('layout/layout_open');\n\t\t$this->load->view('login');\n\t\t$this->load->view('layout/layout_close');\n\t}", "public function showLoginForm()\n {\n return view('auth.login', ['social_types' => $this->socialTypeService->getAll()]);\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin() {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.82363474", "0.8112341", "0.8098614", "0.8065458", "0.8030373", "0.80252075", "0.7991413", "0.79617375", "0.7882064", "0.7876691", "0.78711575", "0.78463435", "0.78413707", "0.7834962", "0.77784806", "0.77511746", "0.7738174", "0.772751", "0.7711599", "0.7710985", "0.7710985", "0.7710985", "0.7708898", "0.76953644", "0.7685564", "0.7682276", "0.76679575", "0.76656747", "0.76656747", "0.76656747", "0.76656747", "0.76656747", "0.76656747", "0.76656747", "0.76656747", "0.7639689", "0.7632681", "0.7618697", "0.7609346", "0.76066875", "0.7600452", "0.75900966", "0.75849575", "0.75798535", "0.75798535", "0.75798535", "0.75798535", "0.7525043", "0.75050956", "0.74997926", "0.7453684", "0.74495924", "0.7449353", "0.74441105", "0.7428237", "0.7422782", "0.7373431", "0.7364053", "0.7363749", "0.73559064", "0.7345116", "0.7344654", "0.7337443", "0.73248446", "0.73135316", "0.73069704", "0.7305353", "0.7301584", "0.7282945", "0.72823244", "0.72668415", "0.7262132", "0.7261479", "0.72498554", "0.7245356", "0.724295", "0.72426116", "0.72398216", "0.723822", "0.7234642", "0.7231916", "0.7219518", "0.7217283", "0.7210593", "0.7206307", "0.7203123", "0.72012687", "0.7199837", "0.71991855", "0.7188314", "0.71871406", "0.7186428", "0.7178407", "0.7177272", "0.7174369", "0.7171335", "0.7170333", "0.7170333", "0.71689934", "0.7160997", "0.7159545" ]
0.0
-1
Handle a login request to the application.
public function postLogin(SignInRequest $request) { if ($this->throttles->hasTooManyLoginAttempts($request)) { return $this->throttles->sendLockoutResponse($request); } $credentials = array_merge( $request->only(['email', 'password']), ['active' => 1] ); if ($this->auth->attempt($credentials, $request->has('remember'))) { session()->flash('app_status', 'login_success'); $this->throttles->clearLoginAttempts($request); return redirect()->intended('/'); } session()->flash( 'login_error', trans('authentication.login_error') ); $this->throttles->incrementLoginAttempts($request); return redirect()->route('auth.login') ->withInput($request->only('email', 'remember')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleLogin( ){\n\t\t// Filter allowed data\n\t\t$data = Request::only([ 'uid', 'password' ]);\n\n\t\t// Validate user input\n\t\t$validator = Validator::make(\n\t\t\t$data,\n\t\t\t[\n\t\t\t\t'uid' => 'required',\n\t\t\t\t'password' => 'required',\n\t\t\t]\n\t\t);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$data[$key] = $this->sanitizeLDAP( $value );\n\t\t}\n\n\t\tif($validator->fails()){\n\t\t\t// If validation fails, send back with errors\n\t\t\treturn Redirect::route('login')->withErrors( $validator )->withInput( );\n\t\t}\n\n\t\tif( Auth::attempt( [ 'uid' => $data['uid'], 'password' => $data['password']], true ) ){\n\t\t\t// If login is successful, send them to home\n\t\t\treturn Redirect::route( 'home' );\n\t\t} else {\n\t\t\t// Otherwise, tell them they're wrong\n\t\t\treturn Redirect::route( 'login' )\n\t\t\t\t\t\t ->withErrors([ \n\t\t\t\t\t\t\t\t'message' => 'I\\'m sorry, that username and password aren\\'t correct.' \n\t\t\t\t\t\t\t]);\n\t\t}\n\n\t\treturn Redirect::route( 'login' )->withInput( );\n\t}", "public static function handle_login() {\n $params = $_POST;\n $player = Player::authenticate($params['username'], $params['password']);\n if(!$player) {\n View::make('player/login.html', array('error' => 'Väärä käyttäjätunnus tai salasana.', 'username' => $params['username']));\n } else {\n $_SESSION['user'] = $player->id;\n\n Redirect::to('/', array('message' => 'Kirjautunut käyttäjänä ' . $player->username));\n }\n }", "public function onLogin(Request $request)\n {\n $username = $request->input('username');\n $password = $request->input('password');\n \n // save posted data in user data object model\n $user = new UserModel(-1, $username, $password);\n \n // call security buesiness service\n $service = new SecurityService(); \n $status = $service->login($user);\n \n // render a failed or passed response view and pass the user model in passed view\n if($status)\n {\n $data = ['model' => $user];\n return view('loginPassed')->with($data);\n }\n else \n {\n return view('loginFailed');\n }\n }", "protected function loginIfRequested() {}", "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 processLogin()\n {\n $user = $this->post['user'];\n\n // Run the form validation\n $errors = $this->validateLogin($user);\n\n // If the form is valid, check the login credentials and\n // if valid log the user in otherwise display the form again.\n if (empty($errors)) {\n if ($this->authentication->login($user['email'], $user['password'])) {\n header('location: /admin/');\n return http_response_code();\n } else {\n $errors[] = 'Invalid login credentials';\n return $this->loginForm($errors);\n }\n } else {\n return $this->loginForm($errors);\n }\n }", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "public function loginAction() {\n $auth = $this->app->container[\"settings\"][\"auth\"];\n\n // Note: There is no point to check whether the user is authenticated, as there is no authentication\n // check for this route as defined in the config.yml file under the auth.passthrough parameter.\n\n $request = $this->app->request;\n $max_exptime = strtotime($auth[\"maxlifetime\"]);\n $default_exptime = strtotime($auth[\"lifetime\"]);\n $exptime = $default_exptime;\n\n if ( $request->isFormData() )\n {\n $username = $request->post(\"username\");\n $password = $request->post(\"password\");\n $exptime = self::getExpirationTime($request->post(\"expiration\"), $default_exptime, $max_exptime);\n }\n\n if ( preg_match(\"/^application\\\\/json/i\", $request->getContentType()) )\n {\n $json = json_decode($request->getBody(), true);\n if ( $json !== NULL )\n {\n $username = $json[\"username\"];\n $password = $json[\"password\"];\n $exptime = self::getExpirationTime(isset($json[\"expiration\"])?$json[\"expiration\"]:null, $default_exptime, $max_exptime);\n }\n }\n\n if ( empty($username) || empty($password) ) {\n $this->renderUnauthorized();\n return;\n }\n\n /**\n * @var \\PDO\n */\n $pdo = $this->app->getPDOConnection();\n $user = $pdo->select()\n ->from(\"tbl_user\")\n ->where(\"username\", \"=\", $username)\n ->where(\"password\", \"=\", sha1($password))\n ->where(\"status\", \">\", 0)\n ->execute()\n ->fetch();\n\n if ( empty($user) )\n {\n $this->renderUnauthorized();\n return;\n }\n\n $pdo->update(array(\"lastlogin_time\"=>gmdate(\"Y-m-d H:i:s\")))\n ->table(\"tbl_user\")\n ->where(\"id\", \"=\", $user[\"id\"])\n ->execute();\n\n $this->app->setAuthData(Factory::createAuthData($user, $exptime));\n\n $this->render(200);\n }", "public function postLoginAction()\n {\n //get input\n $inputs = $this->getPostInput();\n\n //define default\n $default = [\n 'status' => 'active'\n ];\n\n // Validate input\n $params = $this->myValidate->validateApi($this->userLogin, $default, $inputs);\n\n if (isset($params['validate_error']))\n {\n //Validate error\n return $this->responseError($params['validate_error'], '/users');\n }\n\n //process user login\n $result = $this->userService->checkLogin($params);\n\n //Check response error\n if (!$result['success'])\n {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n return $this->response($encoder, $result['data']);\n }", "public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "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 processLogin(): void;", "public function login(Request $request);", "public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\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 }", "public function handleLogin(){\n $username = htmlentities(trim($_POST['username']));\n $password = htmlentities(trim($_POST['password']));\n $loginSebagai = htmlentities(trim($_POST['login_sebagai']));\n\n $loginResult = WebDb::handleLogin($username,$password, $loginSebagai);\n\n if(!$loginResult) {\n Session::set(\"login_gagal\",\"Username atau password salah\");\n header(\"Location: /it-a\");\n die();\n }\n Session::set(\"user_id\",$username);\n Session::set(\"login_sebagai\",$loginSebagai);\n header(\"Location: /it-a/dashboard\");\n }", "public function postLogin()\n\t{\n\n\t\t$input = array(\n\t\t 'email' => \\Input::get( 'email' ),\n\t\t 'password' => \\Input::get( 'password' ),\n\t\t 'remember' => \\Input::get( 'remember' ),\n\t\t);\n\n\t\t// If you wish to only allow login from confirmed users, call logAttempt\n\t\t// with the second parameter as true.\n\t\t// logAttempt will check if the 'email' perhaps is the username.\n\t\tif ( \\Confide::logAttempt( $input, true ) ) \n\t\t{\n\t\t return \\Redirect::intended('/company'); \n\t\t}\n\t\telse\n\t\t{\n\t\t $user = new \\User;\n\n\t\t // Check if there was too many login attempts\n\t\t if( \\Confide::isThrottled( $input ) )\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.too_many_attempts');\n\t\t }\n\t\t elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.not_confirmed');\n\t\t }\n\t\t else\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.wrong_credentials');\n\t\t }\n\n\t\t return \\Redirect::action('controllers\\company\\AuthController@getLogin')\n\t\t ->withInput(\\Input::except('password'))\n\t\t ->with( 'error', $err_msg );\n\t\t}\n\n\t}", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "public function login()\n {\n /* validation requirement */\n $validator = $this->validation('login', request());\n\n if ($validator->fails()) {\n\n return $this->core->setResponse('error', $validator->messages()->first(), NULL, false , 400 );\n }\n\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n\n return $this->core->setResponse('error', 'Please check your email or password !', NULL, false , 400 );\n }\n\n return $this->respondWithToken($token, 'login');\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 {\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 }", "private function login(){\n \n }", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "abstract protected function doLogin();", "public function postLogin()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n // Check validate login of input data\n $validate = $this->Client->newEntity($input, ['validate' => 'login']);\n\n // Check this validate had error or not\n if ($validate->errors()) {\n $this->set($validate->errors());\n // Check login by account of Shop and redirect to Index page if success\n } else if ($shop = $this->Shop->checkLoginForShop($input) != null) {\n // Change to Model Shop to check authenticate.\n $this->Auth->config('authenticate', [\n 'Form' => ['userModel' => 'Shop']\n ]);\n\n $shop = $this->Auth->identify();\n $this->Auth->setUser($shop);\n\n return $this->redirect(['controller' => 'Pages', 'action' => 'index']);\n // Check login by account of Client and redirect to Index page if success\n } else if ($client = $this->Auth->identify()) {\n $this->Auth->setUser($client);\n return $this->redirect(['controller' => 'Pages', 'action' => 'home']);\n } else {\n $this->Flash->error('Username or password are not correct..');\n }\n $this->login();\n }\n }", "public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function access() {\n \tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n \t\t$user = Auth::login($_POST['email'], $_POST['pw']);\n \t\tif($user) {\n \t\t\tApp::redirect('dashboard');\n \t\t}\n\t\t\tSession::set('_old_input', $_POST);\n\t\t\tSession::set('_errors', ['login' => \"Email y/o password incorrectos.\"]);\n\t\t\tApp::redirect('login');\n\n \t}\n\n }", "public function postLogin() {\n\n\t\t// get input parameters\n\t\t//\n\t\t$username = Input::get('username');\n\t\t$password = Input::get('password');\n\n\t\t// validate user\n\t\t//\n\t\t$user = User::getByUsername($username);\n\t\tif ($user) {\n\t\t\tif (User::isValidPassword($password, $user->password)) {\n\t\t\t\tif ($user->hasBeenVerified()) {\n\t\t\t\t\tif ($user->isEnabled()) {\n\t\t\t\t\t\t$userAccount = $user->getUserAccount();\n\t\t\t\t\t\t$userAccount->penultimate_login_date = $userAccount->ultimate_login_date;\n\t\t\t\t\t\t$userAccount->ultimate_login_date = gmdate('Y-m-d H:i:s');\n\t\t\t\t\t\t$userAccount->save();\n\t\t\t\t\t\t$res = Response::json(array('user_uid' => $user->user_uid));\n\t\t\t\t\t\tSession::set('timestamp', time());\n\t\t\t\t\t\tSession::set('user_uid', $user->user_uid);\n\t\t\t\t\t\treturn $res;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn Response::make('User has not been approved.', 401);\n\t\t\t\t} else\n\t\t\t\t\treturn Response::make('User email has not been verified.', 401);\n\t\t\t} else\n\t\t\t\treturn Response::make('Incorrect username or password.', 401);\n\t\t} else\n\t\t\treturn Response::make('Incorrect username or password.', 401);\n\n\t\t/*\n\t\t$credentials = array(\n\t\t\t'username' => $username,\n\t\t\t'password' => $password\n\t\t);\n\n\t\tif (Auth::attempt($credentials)) {\n\t\t\treturn Response::json(array(\n\t\t\t\t'user_uid' => $user->uid\n\t\t\t));\n\t\t} else\n\t\t\treturn Response::error('500');\n\t\t*/\n\t}", "public function loginAction()\n {\n // Instantiate the form that asks the user to log in.\n $form = new Application_Form_LoginForm();\n\n // Initialize the error message to be empty.\n $this->view->formResponse = '';\n\n // For security purposes, only proceed if this is a POST request.\n if ($this->getRequest()->isPost())\n {\n // Process the filled-out form that has been posted:\n // if the input values are valid, attempt to authenticate.\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n if ( $this->_authenticate($formData) )\n {\n $this->_helper->redirector('index', 'index');\n }\n }\n }\n\n // Render the view.\n $this->view->form = $form;\n }", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\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 function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "public function processLogin(LoginRequest $request)\n {\n try {\n \n $remember = (bool) $request->get('remember', false);\n \n if (Sentinel::authenticate($request->all(), $remember)) {\n \n return redirect()->intended();\n }\n \n $errors = trans('sentinel.errors.credentials');\n \n }\n catch (NotActivatedException $e) {\n \n $errors = trans('sentinel.errors.activation'); \n }\n catch (ThrottlingException $e) {\n \n $errors = trans('sentinel.errors.throttle', ['delay' => $e->getDelay()]);\n }\n \n return redirect()->back()\n ->withInput()\n ->withErrors($errors);\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\tif ($this->request->is('post')) {\n\n\t\t\t// If no parameter passed to login(), CakePHP automatically give the request params as parameters.\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirectUrl());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->set('signInFail', true); // view vars\n\t\t\t}\n\t\t}\n\t}", "public function login($request)\n\t\t{\n\t\t\tif (isset($request->username) && isset($request->passphrase))\n\t\t\t\treturn $this->authenticate($request);\n\t\t}", "public function doLogin()\n {\n $rules = array(\n 'email' => 'required|email',\n 'password' => 'required|alphaNum|min:3'\n );\n \n // validate inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n \n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n return Redirect::to('/')\n ->withErrors($validator)\n ->withInput(Input::except('password'));\n } else {\n // create our user data for the authentication\n $userdata = array(\n 'email' => Input::get('email'),\n 'password' => Input::get('password')\n );\n \n // attempt to do the login\n $response = $this->requestLoginApi($userdata);\n\n if ($response->status == true) {\n // validation successful, save cookie!\n return Redirect::to('showsearch')\n ->withCookie(Cookie::make('accessToken', $response->data->accessToken, 60))\n ->with('message', 'Auth OK! (Token created)');\n \n } else {\n // validation fail, send back to login form\n return Redirect::to('/')\n ->withErrors(\"Invalid credentials\")\n ->withInput(Input::except('password'));\n }\n }\n }", "public function loginAction(Request $request){\n //for the view\n $params = array(\"title\" => _(\"Sign in\"));\n\n $params['loginUsername'] = \"\";\n\n //handle login form\n if (!empty($_POST)){\n $error = true;\n\n $loginUsername = $_POST['loginUsername'];\n $params['loginUsername'] = $loginUsername;\n $password = $_POST['password'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateLoginUsername($loginUsername);\n $validator->validatePassword($password);\n\n //if valid\n if ($validator->isValid()){\n //find user from db\n $userManager = new UserManager();\n $user = $userManager->findByEmailOrUsername($loginUsername);\n\n //if user found\n if($user){\n\n// hash password\n $securityHelper = new SH();\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt());\n// $hashedPassword = bcrypt($password);\n\n //compare hashed passwords\n if ($hashedPassword === $user->getPassword()){\n //login\n $error = false;\n $this->logUser($request, $user);\n $json = new JsonResponse();\n $json->setData(array(\"redirectTo\" => '/skills'));\n $json->send();\n }\n }\n }\n if($error){\n $params['error']['global'] = _(\"You username/email and password do not match\");\n }\n }\n return view('auth.login',['params'=>$params]);\n// $view = new View(\"login.php\", $params);\n// $view->setLayout(\"../View/layouts/modal.php\");\n// $view->send(true);\n }", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n if ($auth->hasIdentity()) {\n $this->_redirect($this->getUrl());\n }\n\n $request = $this->getRequest();\n\n $redirect = $request->getPost('redirect');\n if (strlen($redirect) == 0)\n $redirect = $request->getServer('REQUEST_URI');\n if (strlen($redirect) == 0)\n $redirect = $this->getUrl();\n\n $errors = array();\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n $username = $request->getPost('username');\n $password = $request->getPost('password');\n\n if (strlen($username) == 0 || strlen($password) == 0)\n $errors['username'] = 'Required field must not be blank';\n\n if (count($errors) == 0) {\n $adapter = new Champs_Auth_Doctrine($username, $password);\n\n $result = $auth->authenticate($adapter);\n\n if ($result->isValid()) {\n $this->_redirect($this->getUrl());\n }\n\n $errors['username'] = 'Your login details were invalid';\n }\n }\n }\n\n // setup hash\n $this->initHash();\n\n $this->view->errors = $errors;\n $this->view->redirect = $redirect;\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function login_action() \n\t{\n $rules = array(\n 'mail' => 'valid_email|required',\n 'pass' => 'required'\n );\n \n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n // they've passed the filter login try and log 'em in\n\t\tUserModel::login(); \n }", "private function handleJustLoggedIn() {\n $this->authenticatedView->setViewMessage(\"Welcome\");\n\n $keepLoggedIn = $this->userRequest->wantsToStayLoggedIn();\n \n if ($keepLoggedIn) {\n $userCredentials = $this->getUserCredentials();\n $cookieHandler = new CookieHandler();\n $cookieHandler->serveCookie($userCredentials);\n }\n }", "protected function handleLogin(Request $request)\n {\n $domain = $this->builder->auth()->adminDomain();\n\n /** @var PasswordProvider $passwordProvider */\n $passwordProvider = $domain->provider('password');\n\n $data = $request->data();\n $user = $passwordProvider->login(\n $data->getRequired('username'),\n $data->getRequired('password')\n );\n\n if($user === null) {\n return $this->getTemplate(array(\n 'loginFailed' => true\n ));\n }\n\n return $this->loggedInRedirect();\n }", "function doLoginAction() {\n if ($this->request->isPost() && $this->request->isAjax()) {\n try {\n $user = new User(\n $this->request->getPost('username')\n , $this->request->getPost('password')\n );\n\n if ($user->isRegisted()) {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_200]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_200\n , HttpStatus::SC_DESC[HttpStatus::SC_200]\n , HttpStatus::CT_TEXT_PLAIN\n );\n } else {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_401]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_401\n , HttpStatus::SC_DESC[HttpStatus::SC_401]\n , HttpStatus::CT_TEXT_PLAIN\n );\n }\n } catch (Exception $e) {\n return parent::httpResponse($e->getMessage());\n }\n }\n }", "public function doLogin(LoginRequest $request)\n { \n try {\n $data = $request->all();\n\n if (AuthSam::login($data, $request->remember_me)) {\n AuthSam::getSubsidychecklist();\n $user_id = AuthSam::getUser()->id;\n $users = DB::table('user_login_info')->where('user_id', $user_id)->get()->count();\n if ($users >= 2)\n DB::table('user_login_info')->where('user_id', $user_id)->take(1)->delete();\n $dataLog = [\n 'user_id' => $user_id,\n 'ipaddress' => $request->ip(),\n 'login_day' => date(\"Y-m-d\"),\n ];\n DB::table('user_login_info')->insert($dataLog);\n Cache::flush();\n if(AuthSam::permission_lock()==1) {\n if (AuthSam::permission()) {\n return redirect('/agency/home');\n } else {\n return redirect('/client/F0');\n }\n }else{\n if (AuthSam::permission()) {\n $url = '/agency/home_lock';\n } else {\n $url = '/client/F0_lock';\n }\n session()->forget(['is_login', 'user_id', 'permission', 'subsidy_check_list', 'follow_list']);\n return redirect($url);\n }\n \n } else {\n return redirect('/login')->with('error', 'ユーザー名とパスワードが違います。');\n }\n } catch(Exception $e) {\n return redirect('/login')->with('error', 'ユーザー名とパスワードが違います。');\n }\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 loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "private function _signInRequested()\n {\n if ($this->model->signIn($_POST['username'], $_POST['password'])) {\n $this->utility->redirect('write');\n } else {\n $this->view->display($this->model);\n }\n }", "public function login($request)\n {\n return $this->start()->uri(\"/api/login\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function postLogin()\n {\n $this->validate($this->request, [\n 'username' => 'required',\n 'password' => 'required',\n ]);\n\n if ($this->hasTooManyLoginAttempts($this->request)) {\n return $this->sendLockoutResponse($this->request);\n }\n\n $credentials = $this->request->only('username', 'password');\n\n if ($this->auth->attempt($credentials, $this->request->has('remember'))) {\n return ($this->request->ajax())\n ? response()->json(['success' => true])\n : redirect()->intended($this->redirectPath());\n }\n\n $this->incrementLoginAttempts($this->request);\n\n $errors = ['username' => t('invalid_creds')];\n\n if ($this->request->ajax()) {\n return response()->json(['username' => [t('invalid_creds')]], 422);\n }\n\n return redirect($this->loginPath())\n ->withInput($this->request->only('username', 'remember'))\n ->withErrors([\n 'username' => t('invalid_creds'),\n ]);\n }", "public static function doLogin($request, $response, $args) {\n $username = strtolower($request->getParsedBody()['username']);\n $password = $request->getParsedBody()['password'];\n\n //Check login isn't empty\n if(empty($username) || empty($password)) {\n return self::renderAlert($response, 'login', 'danger', 'Username or password incorrect');\n }\n\n //Check user exist\n $user = DB::getInstance()->get('users', '*', [ 'username' => $username ]);\n if(empty($user)) {\n return self::renderAlert($response, 'login', 'danger', 'Username or password incorrect');\n }\n\n //Check password\n if(!password_verify($password, $user['password'])) {\n return self::renderAlert($response, 'login', 'danger', 'Username or password incorrect');\n }\n\n $_SESSION['MEMBER']['username'] = $username;\n return $response->withHeader('Location', '/')->withStatus(302);\n }", "public function post_signin()\n\t{\n\t\tif(Service\\Validation\\Login::passes(Input::all()))\n\t\t{\n\t\t\tif(Service\\Security::authorize(array('username' => Input::get('username'), 'password' => Input::get('password'))))\n\t\t\t{\n\t\t\t\treturn Redirect::home();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('login')->with_input()->with_errors(new Messages(array(\n\t\t\t\t\t__('login.failed')->get()\n\t\t\t\t)));\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::to_route('login')->with_input()->with_errors(Service\\Validation::errors());\n\t}", "public function postLogin(Request $request)\n {\n return $this->login($request);\n }", "public function postLogin(Request $request)\n {\n return $this->login($request);\n }", "public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }", "public static function handleLogin()\n\t\t{\n\t\t\t@session_start();\n\t\t\t$logged=$_SESSION['loggedIn'];\n\t\t\t$redirectPage=$_SERVER['REQUEST_URI'];\n\t\t\tif($logged==false){\n\t\t\t\tsession_destroy();\n\t\t\t\tsession_start();\n\t\t\t\tSession::set('redirectPage',$redirectPage);\n\t\t\t\t echo '<script type=\"text/javascript\">';\n\t\t echo 'window.location.href=\"'.$URL.'/login\";';\n\t\t echo '</script>';\n\t\t echo '<noscript>';\n\t\t echo '<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\" />';\n\t\t echo '</noscript>'; \n\t\t\t\texit;\t\n\t\t\t}\t\t\n\t\t\tif (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 3600)) {\n\t\t\t // last request was more than 60 minutes ago\n\t\t\t session_destroy();\n\t\t\t\tsession_start();\n\t\t\t Session::set('redirectPage',$redirectPage);\n\t\t\t echo '<script type=\"text/javascript\">';\n\t\t echo 'window.location.href=\"'.$URL.'/login\";';\n\t\t echo '</script>';\n\t\t echo '<noscript>';\n\t\t echo '<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\" />';\n\t\t echo '</noscript>'; \n\t\t\t\texit;\t\n\t\t\t}\n\t\t\t$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp\n\t\t\t\n\t\t}", "public function login ($request)\n {\n if ($request->getMethod() === 'POST') {\n\n $datas = $this->getParams($request);\n $users = $this->container->get('users.login');\n $user = $this->getNewEntity($datas);\n\n $found_username = array_search($user->username, array_column($users,'username'));\n $found_email = array_search($user->username, array_column($users,'email'));\n\n // Match -> (Username or Email) and Password Ok\n if (\n (strlen($found_username) > 0) &&\n (password_verify($user->password,$users[$found_username]['password'])) ||\n (strlen($found_email) > 0) && \n (password_verify($user->password,$users[$found_email]['password'])) \n ) {\n return $this->openGate($user); \n }\n\n }\n\n // fuction for encrypt new password\n // $this->encrypt('password');die();\n\n $header = $this->getHeaderEntity('login');\n $username = '';\n return $this->renderer->render($this->viewPath . '/login', compact('header', 'username'));\n }", "public function login() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Invalid username or password, try again'));\n\t\t\t}\n\t\t}\n\t}", "public function loginUri(Request $request);", "public function login(Request $request)\n {\n //\n }", "public function login();", "public function login();", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "private function doLogin()\n {\n if (!isset($this->token)) {\n $this->createToken();\n $this->redis->set('cookie_'.$this->token, '[]');\n }\n\n $loginResponse = $this->httpRequest(\n 'POST',\n 'https://sceneaccess.eu/login',\n [\n 'form_params' => [\n 'username' => $this->username,\n 'password' => $this->password,\n 'submit' => 'come on in',\n ],\n ],\n $this->token\n );\n\n $this->getTorrentsFromHTML($loginResponse);\n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function __handleAuthentication() {\n $allowActions = array('adminLogin');\n\n if(strpos($this->action, 'admin') !== false && !in_array($this->action, $allowActions)) {\n $params = $this->getParams();\n\n if(empty($params['token']) || !$this->Session->check($params['token'])) {\n $this->sendError(API_MSG_INCORRECT_INPUT, API_CODE_NG, API_HTTP_CODE_200);\n }\n }\n }", "public function processLoginAction(Request $request, Application $app)\n {\n // Set the 'user logged in' session to false (default value)\n $_SESSION['isUserLoggedIn'] = false;\n\n // Retrieve user details from the text input (username and password)\n $usernameFromInput = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\n $passwordFromInput = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n\n // Retrieve details from Database\n $user = Login::getOneByUsername($usernameFromInput);\n\n // If username from input field is not empty and password is verified\n if ($user) {\n\n // Retrieve details from Database\n $usernameFromDb = $user->getUsername();\n //$passwordFromDb = $user->getPassword();\n\n $isPresent = LoginController::matchUserWithPassword($usernameFromInput, $passwordFromInput);\n $isRole = Login::matchUserWithRole($usernameFromDb);\n\n if ($usernameFromInput != $usernameFromDb) {\n return $app->redirect('/index');\n }\n\n // If username exists, and password matches\n if ($isPresent != null) {\n\n // Store username in 'user' in 'session'\n $app['session']->set('user', array('username' => $usernameFromDb));\n\n // Set the 'user logged in' session to true\n $_SESSION['isUserLoggedIn'] = true;\n\n // If role is assigned to the user, redirect the user to the specific page\n if ($isRole) {\n if ($user->getRole() == 'admin') {\n return $app->redirect('/adminIndex');\n } elseif ($user->getRole() == 'student') {\n return $app->redirect('/studentIndex');\n } elseif ($user->getRole() == 'member') {\n return $app->redirect('/memberIndex');\n }\n }\n }\n }\n\n $argsArray = [\n 'loginError' => 'Wrong Username or Password! Try again!'\n ];\n\n $templateName = 'index';\n return $app['twig']->render($templateName . '.html.twig', $argsArray);\n }", "public function login(Request $request)\n {\n Auth::attempt($request->input());\n echo json_encode(['status' => Auth::check()]);\n }", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\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 doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function postLogin()\n\t{\n\t\tif (Auth::attempt(Input::only('email', 'password')))\n\t\t{\n\t\t\treturn Redirect::to('/')->withErrors('You have successfully logged in!');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('/')->withErrors('Invalid Credentials')->withInput();\n\t\t}\n\n\t}", "function handle_logins()\n{\n if (get_param_integer('httpauth', 0) == 1) {\n require_code('users_inactive_occasionals');\n force_httpauth();\n }\n $username = trim(post_param_string('login_username', ''));\n if (($username != '') && ($username != do_lang('GUEST'))) {\n require_code('users_active_actions');\n handle_active_login($username);\n }\n\n // If it was a log out\n $page = get_param_string('page', ''); // Not get_page_name for bootstrap order reasons\n if (($page == 'login') && (get_param_string('type', '', true) == 'logout')) {\n require_code('users_active_actions');\n handle_active_logout();\n }\n}", "function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}", "public function login()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $email = SCMUtility::stripTags( (isset($_POST['email'])) ? $_POST['email'] : '' );\n $password = SCMUtility::stripTags( (isset($_POST['password'])) ? $_POST['password'] : '' );\n\n if( ! Session::Auth($email,$password) )\n {\n SCMUtility::setFlashMessage('Invalid email/password.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\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 }", "public function login(Request $request) {\n $result = array('status' => false, 'data' => $request->all(), 'messages' => array('success' => '', 'errors' => ''));\n\n return ($request->isMethod('POST')) ? $this->mainController->doLogin($request->all()) : $result;\n }", "public function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db fpr this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token\n FROM users\n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the db, it means login failed\n if(!$token) {\n\n Router::redirect(\"/users/login/error\");\n \n\n # But if we did, login succeeded!\n } else {\n\n \n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n \n\n # Send them to the main page - or wherevr you want them to go\n Router::redirect(\"/\");\n # Send them back to the login page\n }\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 }", "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 executeLogin(sfWebRequest $request) {\n $this->getUser()->login();\n $this->forward($request->getParameter('module'), $request->getParameter('action'));\n }", "public function login()\n\t{\n\n\t\tif ( ( $this->get_access_key() === null || $this->get_access_secret() === null ) )\n\t\t{\n echo 'case 1';\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token_info = $oauth->getRequestToken( $this->request_token_url, $this->get_callback() );\n\n if ($request_token_info)\n {\n\n $this->set_request_tokens( $request_token_info );\n }\n\n // Now we have the temp credentials, let's get the real ones.\n\n // Now let's get the OAuth token\n\t\t\t\\Response::redirect( $this->get_auth_url() );\n return;\n\t\t}\n\n\t\treturn $this->check_login();\n\t}", "public function doAuthentication();", "function loginHandler($inputs = []) {\n $username = $inputs['username'];\n $password = $inputs['password'];\n $sql = 'SELECT * FROM `admin` WHERE `name` = ? AND password = ?';\n $res = getOne($sql, [$username, $password]);\n if (!$res) {\n formatOutput(false, 'username or password error');\n }\n else{\n $buildingRes = getOne(\"SELECT * FROM `admin_building` WHERE admin_id =?\", [$res['id']]);\n $bid = isset($buildingRes['building_id']) ? $buildingRes['building_id'] : '0';\n setLogin($res['id'],$bid);\n formatOutput(true, 'login success', $res);\n }\n}", "public function onSignin()\n {\n try {\n /*\n * Validate input\n */\n $data = post();\n $rules = [];\n\n $rules['login'] = 'required|email|between:6,255';\n\n $rules['password'] = 'required|between:6,255';\n\n if (!array_key_exists('login', $data)) {\n $data['login'] = post('username', post('email'));\n }\n\n $validation = Validator::make($data, $rules);\n if ($validation->fails()) {\n throw new ValidationException($validation);\n }\n\n /*\n * Authenticate user\n */\n $credentials = [\n 'login' => array_get($data, 'login'),\n 'password' => array_get($data, 'password')\n ];\n\n Event::fire('rainlab.user.beforeAuthenticate', [$this, $credentials]);\n\n $user = Auth::authenticate($credentials, true);\n if ($user->isBanned()) {\n Auth::logout();\n throw new AuthException(/*Sorry, this user is currently not activated. Please contact us for further assistance.*/'rainlab.user::lang.account.banned');\n }\n\n /*\n * Redirect\n */\n if ($redirect = $this->makeRedirection(true)) {\n return $redirect;\n }\n }\n catch (Exception $ex) {\n if (Request::ajax()) throw $ex;\n else Flash::error($ex->getMessage());\n }\n }", "public function executeLogin(sfWebRequest $request)\n {\n //set the referrer used when loggin in.\n $this->getUser()->setReferer($this->getContext()->getActionStack()->getSize() > 1 ? $request->getUri() : $request->getReferer());\n \n $this->form = new sfAuthSigninForm();\n \n if ($request->isMethod('post')) {\n $this->form->bind($request->getParameter('sf_auth_signin'));\n \n if ($this->form->isValid()) {\n $this->getUser()->setFlash('success', $this->getContext()->getI18N()->__('Welcome back :)'));\n \n $referer = $this->getUser()->getReferer($request->getReferer());\n $this->redirectUnless(empty($referer), $referer);\n $this->redirect('@homepage'); \n }\n }\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 $login = new Login();\n\n $path = '/inloggen';\n if (CSRF::validate() && $login->check()) {\n // try to send the user to the reservation form or sign up for meet the expert page\n $path = Session::get('path');\n unset($_SESSION['path']);\n\n if (empty($path)) {\n $path = '/';\n }\n }\n\n return new RedirectResponse($path);\n }", "public function authenticate()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('login', Input::only('email', 'password'));\n\n\t\t# if the user was authenticated\n\t\tif(isset($response['success']))\n\t\t{\t\n\t\t\t# save the returned user object to the session for later use\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# we got here from a redirect. if they came via a new account registration then reflash the \n\t\t\t# session so we can use the data on the next page load\n\t\t\tif(Session::has('success')) {\n\t\t\t\tSession::reflash();\n\t\t\t}\t\t\t\n\n\t\t\tif(Input::get('redirect') && ! Session::has('ignoreRedirect')) {\n\t\t\t\treturn Redirect::to(Input::get('redirect'));\n\t\t\t}\n\n\t\t\t# and show the profile page\n\t\t\treturn Redirect::to('profile');\t\n\t\t}\n\t\t# auth failed. return to the log in screen and display an error\n\t\telse \n\t\t{ \n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('login-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the log in page again\n\t\t\treturn Redirect::to('login');\n\t\t}\n\t}", "public function login(Request $request)\n {\n $this->validateLogin($request);\n\n $user = Sentinel::authenticateAndRemember($request->only($this->username(), 'password'));\n\n if ($request->ajax()) {\n if (! $user) {\n $response = [\n 'status' => 'error',\n 'message' => __('These credentials do not match our records.')\n ];\n\n return response()->json($response);\n }\n\n $response = [\n 'status' => 'success',\n 'message' => __('Successfull Login'),\n 'user' => $user\n ];\n\n return response()->json($response);\n }\n\n if (! $user) {\n return back()->with('error', __('These credentials do not match our records.'));\n }\n\n AccessLog::add($user);\n\n return redirect(route('shopper.dashboard.home'))->with('success', __('Successfull Login'));\n }", "public function actionLogin()\n {\n \\Yii::$app->response->format = Response::FORMAT_JSON;\n\n if(Yii::$app->request->isPost) {\n\n $model = new LoginForm();\n\n\n if ($model->load(Yii::$app->getRequest()->getBodyParams(), '') && $model->login()) {\n\n return ['status'=> 'success', 'access_token' => Yii::$app->user->identity->getAuthKey()];\n } else {\n\n return ['status' => 'error', 'message' => 'Wrong username or password'];;\n }\n\n }\n\n\n return ['status' => 'wrong', 'message' => 'Wrong HTTP method, POST needed'];\n }", "function memberLoginHandler() {\n global $inputs;\n\n $username = $inputs['username'];\n $password = $inputs['password'];\n $sql = 'select * from `member` where name = ? and password = ?';\n $res = getOne($sql, [$username, $password]);\n\n if (!$res) {\n formatOutput(false, 'username or password error');\n } else {\n setMemberLogin($res['id']);\n formatOutput(true, 'login success', $res);\n }\n}", "public function login(Request $request)\n {\n $this->validateLogin($request); \n\n if ($user = $this->attemptLogin($request)) {\n return $this->sendLoginResponse($request, $user);\n } \n\n return $this->sendFailedLoginResponse($request);\n }", "public function postLogin(Request $request)\n {\n $this->validate($request, [\n 'email' => 'required|email',\n 'password' => 'required',\n ]);\n\n $credentials = $request->all();\n $remember = false;\n\n if(array_key_exists('remember', $credentials)){\n $remember = true;\n }\n\n try {\n if($user = Sentinel::authenticate($credentials, $remember)){\n Sentinel::login($user);\n return redirect()->route('admin.dashboard');\n }\n Session::flash('message', \"Your email/password combination do not match!\");\n return redirect()->back();\n\n } catch(NotActivatedException $e) {\n Session::flash('message', \"Your account has not been activated yet.\");\n return redirect()->back();\n } catch(ThrottlingException $e) {\n $min = intval($e->getDelay() / 60);\n $timeToGo = $min . ':' . str_pad(($e->getDelay() % 60), 2, '0', STR_PAD_LEFT);\n Session::flash('message', \"Your IP is blocked, You will have to wait \". $timeToGo . \" minutes\");\n return redirect()->back();\n }\n\n }", "public function LoginCheck()\n {\n $protocol = Yii::app()->params['protocol'];\n $servername = Yii::app()->request->getServerName();\n $user = Yii::app()->session['username'];\n if (empty($user)) {\n $returnUrl = $protocol . $servername . Yii::app()->homeUrl;\n $this->redirect($returnUrl);\n }\n }", "public function loginProcess(UserLoginRequest $request)\n {\n $processReaction = $this->userEngine->processLogin($request->all());\n\n return __processResponse($processReaction, [\n 1 => __('Welcome, you are logged in successfully.'),\n 2 => __('Authentication failed. Please check your \n email/password & try again.'),\n ], [], true);\n }", "abstract public function loginAction(Celsus_Parameters $parameters, Celsus_Response_Model $responseModel);", "public function postLogin(Request $request)\n {\n $backToLogin = redirect()->route('admin-login')->withInput();\n $findUser = Sentinel::findByCredentials(['login' => $request->input('email')]);\n\n\n // If we can not find user based on email...\n if (! $findUser) {\n flash()->error('Wrong email or username!');\n\n return $backToLogin;\n }\n\n try {\n $remember = (bool) $request->input('remember_me');\n // If password is incorrect...\n if (! Sentinel::authenticate($request->all(), $remember)) {\n flash()->error('Wrong email or username!');\n\n return $backToLogin;\n }\n\n if (strtolower(Sentinel::check()->roles[0]->slug) == 'cro') {\n flash()->error('You Have No Access!');\n Sentinel::logout();\n return $backToLogin;\n }\n\n $log['description'] = 'A user log in';\n $insertLog = new LogActivity();\n $insertLog->insertNewLogActivity($log);\n\n flash()->success('Login success!');\n //return redirect()->route('admin-dashboard');\n return redirect()->route('admin-index-event');\n } catch (ThrottlingException $e) {\n\n $log['description'] = 'A user login failed because too many attempts';\n $insertLog = new LogActivity();\n $insertLog->insertNewLogActivity($log);\n\n flash()->error('Too many attempts!');\n } catch (NotActivatedException $e) {\n flash()->error('Please activate your account before trying to log in.');\n } catch (\\Exception $e) {\n\n $log['description'] = $e->getMessage().' '.$e->getFile().' on line:'.$e->getLine();\n $insertLog = new LogActivity();\n $insertLog->insertNewLogActivity($log);\n \n }\n\n return $backToLogin;\n }", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }" ]
[ "0.7669814", "0.74851155", "0.7442612", "0.72329086", "0.7112905", "0.7103887", "0.70698494", "0.7055757", "0.7029516", "0.6985367", "0.6953118", "0.69134593", "0.6885101", "0.687445", "0.6863917", "0.6856037", "0.6848747", "0.684784", "0.68152297", "0.680864", "0.68045515", "0.67792654", "0.6771233", "0.67666423", "0.67659724", "0.67419285", "0.67255026", "0.66824514", "0.66804695", "0.6661723", "0.66615164", "0.66599214", "0.6653103", "0.6650553", "0.664819", "0.66480184", "0.66423595", "0.66292566", "0.6616117", "0.66158235", "0.6614166", "0.66131216", "0.66108733", "0.66001797", "0.6598898", "0.65979165", "0.65857095", "0.6582395", "0.65822494", "0.65788734", "0.657026", "0.65687394", "0.65674514", "0.6563829", "0.6560272", "0.6560272", "0.65553254", "0.6548969", "0.6548335", "0.65271837", "0.6519302", "0.65027267", "0.64946365", "0.64946365", "0.64943993", "0.64915204", "0.64838105", "0.6480556", "0.6471744", "0.6466453", "0.64642614", "0.64604133", "0.6456966", "0.64559203", "0.6455759", "0.64528894", "0.64402467", "0.6433877", "0.6431453", "0.64256763", "0.6411047", "0.6408026", "0.6405608", "0.64052635", "0.64042723", "0.64006245", "0.63940746", "0.6390829", "0.6385385", "0.63831717", "0.63792276", "0.63753724", "0.6374533", "0.6369184", "0.6369093", "0.63690686", "0.6366873", "0.6366771", "0.6365373", "0.6362475", "0.635908" ]
0.0
-1
Log the user out of the application.
public function getLogout() { $this->auth->logout(); session()->flash('app_status', 'logged_out'); return redirect()->home(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logOut()\n {\n $auth = new AuthenticationService();\n\n if ($auth->hasIdentity()) {\n Session::getDefaultManager()->forgetMe();\n $auth->clearIdentity();\n }\n }", "public function logout(){\n $this->_user->logout();\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()\n {\n $user = $this->user();\n\n // If we have an event dispatcher instance, we can fire off the logout event\n // so any further processing can be done. This allows the developer to be\n // listening for anytime a user signs out of this application manually.\n $this->clearUserDataFromStorage();\n\n if (isset($this->events)) {\n $this->events->dispatch(new LogoutEvent($this->name, $user));\n }\n\n // Once we have fired the logout event we will clear the users out of memory\n // so they are no longer available as the user is no longer considered as\n // being signed into this application and should not be available here.\n $this->user = null;\n\n $this->loggedOut = true;\n }", "public function logoutUser()\n\t{\n\t\t\\JFactory::getApplication()->logout();\n\t}", "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\t{\n\t\t$this->user->Logout();\n\t\t$this->RedirectToController();\n\t}", "function logout()\n {\n $user = $this->getAuthenticatedUser();\n if (!$user) return;\n\n unset($_SESSION['MFW_authenticated_user']);\n }", "public function logout()\n {\n $this->Auth->logout();\n $this->login();\n }", "public function logout() {\n $this->run('logout', array());\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 () : void {\n $this->destroySession();\n }", "public function logOutUser() {\r\n\t\tif (isset($_SESSION)) {\r\n\t\t\tunset($_SESSION);\r\n\t\t\tsession_unset();\r\n\t\t\tsession_destroy();\r\n\t\t}\r\n\t\theader('Location: /');\r\n\t}", "function logout() {\r\n $this->auth->logout();\r\n }", "public static function logOut()\r\n {\r\n (new Session())->remove(static::$userIdField);\r\n }", "public function log_out() {\n $this->store_token(null);\n }", "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()\n {\n $this->session->remove('user');\n }", "public function logUserOut()\n\t{\n\t\t# destroy the session\n\t\tSession::flush();\n\n\t\t# generate a new session ID\n\t\tSession::regenerate();\n\n\t\t# ... and show the homepage\n\t\treturn Redirect::home();\n\t}", "public function userLogout() {\n session_destroy();\n header('Location: index.php');\n }", "public function logout ()\n {\n User::logout(\"home\");\n }", "function LogOut() {\n\t\tunset($user);\n\t\t$loggedIn=false;\n\t}", "public function logoutUser() {\r\n\t\t$this->coreAuthenticationFactory->logoutUser ();\r\n\t}", "public function logoff(){\n\t\tsession_destroy();\n\t\theader('location: ../view/login.php');\n\t\texit;\n\t}", "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//Log this connection into the users_activity table\n\t\t\\DB::table('users_activity')->insert(array(\n\t\t\t'user_id'=>$this->user->attributes[\"id\"],\n\t\t\t'type_id'=>15,\n\t\t\t'data'=>'Log out',\n\t\t\t'created_at'=>date(\"Y-m-d H:i:s\")\n\t\t));\n\t\t$this->user = null;\n\t\t$this->cookie($this->recaller(), null, -2000);\n\t\tSession::forget($this->token());\n\t\t$this->token = null;\n\t}", "public function logout() {\n\t\tAuth::clear('userLogin');\n\t\t$this->redirect(array('action'=>'login'));\n\t}", "public function logout()\n {\n $this->webUser = false;\n $this->refresh();\n \\Bdr\\Vendor\\Database::logout();\n }", "public function actionLogout() {\r\n\t\tYii::$app->user->logout ();\r\n\t}", "public function logout()\n {\n $this->user_provider->destroyAuthIdentifierSession();\n\n \\session()->flush();\n \n $this->user = null;\n\n $this->loggedOut = true;\n }", "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 {\n if ( !$this->isAuthenticated() )\n {\n return;\n }\n\n $event = new OW_Event(OW_EventManager::ON_USER_LOGOUT, array('userId' => $this->getUserId()));\n OW::getEventManager()->trigger($event);\n\n $this->authenticator->logout();\n }", "public static function logOut()\n {\n self::startSession();\n session_destroy();\n }", "public function actionLogout() {\n Yii::app()->user->logout(false);\n Yii::app()->user->setFlash('info', 'You are no longer logged in!');\n $this->redirect(Yii::app()->homeUrl);\n }", "public function logout() {\n\t\tSentry::logout();\n\t\tredirect(website_url('auth'));\n\t}", "function logout() {\n User::destroyLoginSession();\n header( \"Location: \" . APP_URL );\n}", "Public Function Logout()\n\t{\n\t\tunset($_SESSION['User']);\n\t}", "public function logoff(){\n\t ServiceSession::destroy();\n\t Redirect::to(\"/login\")->do();\n\t }", "public function logout() {\n\t\t# Generate and save a new token for next login\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string() );\n\n\t\t# Create the data array we'll use with the update method\n\t\t# In this case, we're only updating one field, so our array only has one entry\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t# Send them back to the main index.\n\t\tRouter::redirect(\"/\");\n\t}", "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}", "public function logout() {\n $db = Db::getInstance();\n $user = new User($db);\n $user->logout();\n }", "public function logout()\n {\n $this->Session->delete('User');\n\n $this->redirect($this->Auth->logout());\n }", "public function logout(){\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\t\n\t\t# Create the data array we'll use with the update method\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\t\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t#send back to main index\n\t\tRouter::redirect(\"/\");\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 actionLogout() {\n\t\tYii::app()->user->logout();\n\t\t$this->redirect(Yii::app()->getModule('user')->returnLogoutUrl);\n\t}", "public static function logout() {\n Session::forget('user');\n redirect('/login');\n }", "public function logout()\n\t{\n\t\t$this->session->unset_userdata(array(\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LOGGED_IN',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_ID',\n\t\t\t\t\t\t\t\t\t\t\t'VB_FULL_NAME',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_EMAIL',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_MOBILE',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_CURRENT_PATH',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LAST_LOGIN'));\n\t\t\t\t\t\t\n\t\tredirect(base_url());\n\t}", "public function logout(){\n session_unset($_SESSION[\"user\"]);\n }", "function logout()\n\t\t{\n\t\t\t// log the user out\n\t\t\t$logout = $this->ion_auth->logout();\n\t\t\tredirect('login');\n\t\t}", "public function logout()\r\n {\r\n unset($_SESSION['logged_user']);\r\n session_destroy();\r\n directTo(transRootConfig('app_config', 'app_login_index'));\r\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n Yii::app()->session->destroy();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function logout() {\n $logout = $this->ion_auth->logout();\n\n // redirect them back to the login page\n redirect('login');\n }", "public static function actionLogout() {\n unset($_SESSION['user']);\n header(\"Location: /\");\n }", "public function logout()\n {\n $this->_delAuthId();\n }", "public function logout() {\n\t\t$user = $this->Auth->user();\n\t\t$this->Session->destroy();\n\t\t$this->Cookie->destroy();\n\t\t$this->Session->setFlash(sprintf(__('%s you have successfully logged out'), $user[$this->{$this->modelClass}->displayField]));\n\t\t$this->redirect($this->Auth->logout());\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 actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->params['loginUrl']);\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}", "public static function logout(): void\n {\n // Remove from the session (user object)\n unset($_SESSION['user']);\n }", "public static function logout() {\n\t\tif (self::logged_in()) {\n\t\t\tSession::delete('user');\n\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\tSession::setFlash(\"alert-success\", \"Logged out successfully.\");\n\t\t\theader(\"Location: index.php\");\n\t\t} else {\n\t\t\tSession::setFlash(\"alert-danger\", \"Already logged out.\");\n\t\t\theader(\"Location: index.php\");\n\t\t}\n\t}", "public function logout()\r\n {\r\n if($this->twitter->check_login() != False)\r\n {\r\n // Revoke the session - this means logging out\r\n // Note that it also removes the Oauth access keys from Twitter NOT jsut removing the cookie\r\n $this->twitter->revokeSession(True);\r\n \r\n }\r\n //url::redirect('ktwitter/demo');\r\n url::redirect($this->docroot.'users');\r\n }", "public function logout()\n {\n if (isset($_SESSION['user_id']))\n {\n unset($_SESSION['user_id']);\n }\n redirect('', 'location');\n }", "public function Logout() {\n $this->session->UnsetAuthenticatedUser();\n $this->profile = array();\n $this->AddMessage('success', \"You have logged out.\");\n }", "public function logout()\n {\n unset( $_SESSION['login'] );\n ( new Events() )->trigger( 3, true );\n }", "public function logOut()\n {\n $this->getElement('Toolbar')->logOut();\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(Yii::app()->homeUrl);\n }", "public function LogOut()\n {\n session_destroy();\n }", "public function actionLogout() {\n Yii::app()->user->logout();\n $this->redirect(\"login\");\n }", "public function Logoff();", "public function logout()\n\t{\n\t\t$this->user = null;\n\n\t\t$this->session->forget(static::$key);\n\t}", "public function logout()\n {\n $this->user = null;\n $this->synchronize();\n unset($_SESSION);\n }", "public function logout() {\r\n \r\n // signal any observers that the user has logged out\r\n $this->setState(\"logout\");\r\n }", "public function logoff() {}", "public function logoff() {}", "public function actionLogout()\n {\n\tApp::user()->logout();\n\t$this->redirect(App::homeUrl());\n }", "public function logoff() {}", "public function logout() {\n # Generate and save a new token for next login\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past, logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n }", "private function logout() {\n }", "public static function logout()\n\t{\n\t\t//app应该为登录页面URL\n\t\theader('Location:'.self::$ssoURL.'?app='.sf\\encrypt_url(self::$clientHost).'&action=logout');\n\t\texit;\n\t}", "public function logout() {\n\t\t$this->setLoginStatus(0);\n\t}", "public function logoff();", "public function actionLogout()\n\t{\n\t\tYii::app()->user->logout(true);\n\t\t$this->redirect(Yii::app()->params['baseUrl']);\n\t}", "public function logoff()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect(base_url());\n\t}", "public function logout(): void\n {\n unset($_SESSION['name']);\n NotificationService::sendInfo('see you..');\n $this->redirect(APP_URL);\n }", "public function executeLogout() {\n $this->logMessage(\"Logout\", 'debug');\n $this->getUser()->clearCredentials();\n $this->getUser()->setAuthenticated(false);\n $this->redirect('default/index');\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 UserModel::logout();\n\n // redirect the user back home\n Redirect::to('home');\n }", "public function logout() {\n\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\n\t# Create the data array we'll use with the update method\n\t# In this case, we're only updating one field, so our array only has one entry\n\t$data = Array(\"token\" => $new_token);\n\t\n\t# Do the update\n\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\n\t# Delete their token cookie - effectively logging them out\n\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\t\n\tRouter::redirect(\"/users/login\");\n }", "public static function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();", "public function logout();" ]
[ "0.8105121", "0.8074796", "0.8000976", "0.79922146", "0.7947992", "0.7944206", "0.7927852", "0.7915717", "0.7901902", "0.79006684", "0.7895875", "0.78850526", "0.78815913", "0.7878597", "0.7876985", "0.78708506", "0.7865771", "0.7865345", "0.7860615", "0.78551507", "0.7824059", "0.78093696", "0.7808812", "0.7805167", "0.7803493", "0.7778011", "0.776695", "0.7757649", "0.773368", "0.77334744", "0.7731585", "0.7714957", "0.7710216", "0.7709282", "0.770112", "0.7691767", "0.76905364", "0.7687163", "0.7687059", "0.76827264", "0.76794887", "0.7678044", "0.7661214", "0.76571345", "0.7655916", "0.7650711", "0.765016", "0.7645921", "0.7640967", "0.76398057", "0.76270586", "0.7625983", "0.76244783", "0.7623126", "0.7621461", "0.76211095", "0.7620636", "0.7620425", "0.7614266", "0.7614217", "0.76133007", "0.76085156", "0.76083887", "0.76036847", "0.7601879", "0.76018476", "0.76018476", "0.76018476", "0.76018476", "0.76018476", "0.76018476", "0.76018476", "0.7599469", "0.7599439", "0.7599414", "0.75970864", "0.7596897", "0.7594844", "0.7590625", "0.7589838", "0.7589479", "0.758872", "0.75875777", "0.75869054", "0.7584877", "0.75726396", "0.75702536", "0.75702333", "0.7567248", "0.7567165", "0.75638586", "0.75566864", "0.755303", "0.7545426", "0.7541606", "0.75406647", "0.75406647", "0.75406647", "0.75406647", "0.75406647", "0.75406647" ]
0.0
-1
Check if user account can be activated or not.
protected function canBeActivated($user) { return $user->update(['activation_code' => '', 'active' => true]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_activate(): bool;", "function activate()\n {\n if (empty($this->userID)) $this->error('No user is loaded', __LINE__);\n if ( $this->is_active()) $this->error('Allready active account', __LINE__);\n $res = $this->db->query(\"UPDATE \".$this->usertable.\" SET \".$this->user_active.\" = 1 \n\tWHERE \".$this->user_id.\" = '\".$this->escape($this->userID).\"' LIMIT 1\");\n if (@count($res) == 1)\n\t{\n\t\t$this->userData[$this->user_active] = true;\n\t\treturn true;\n\t}\n\treturn false;\n }", "public static function checkAccount () {\n $user_id = session::getUserId();\n if ($user_id) {\n $a = q::select('account')->filter('id =', $user_id)->fetchSingle();\n \n // user may have been deleted\n if (empty($a)) {\n self::killSessionAll($user_id);\n return false;\n } \n \n if ($a['locked'] == 1) {\n self::killSessionAll($user_id);\n return false;\n }\n }\n return true;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public static function isActivated ()\r\n {\r\n return Session::exists('acl');\r\n }", "public function hasActiveUser()\n {\n return $this->user && $this->user->active;\n }", "protected function Authorized(){\n // usuario\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return true;\n }\n \n // Autorizar la solicitud atendiendo a la activacion del usuario\n\t\t$uType = $this->getUserType();\n\t\t\n\t\tif ($uType >= USER_CLIENT){ // Ok user is active\n\t\t\t$res = DBHelper::Select('users', '*', \"email='{$this->user}'\");\n\t\t\t//if ((!$res[0]['name'] || !$res[0]['phone']) && $res[0]['expiration'] - time() >= 7 * 24 * 3600){\n\t\t\t//\t$this->url = Url::Parse(\n // \t\t\"http://\".HTTP_HOST.\"/__www/set-user-info.php?user={$this->user}&success_url=\" . urlencode((string)$this->data->url)\n \t//\t);\n\t\t\t//}\n\t\t}elseif(DBHelper::is_user_registered($this->user) > 0){ \n // La activacion del usuario ha expirado. Redirigir a\n // la pagina de recarga\n\t\t\t\n /** @var Url url */\n $url = $this->getUrlFromData();\n if (stripos($url->host, HTTP_HOST) === FALSE){\n\t\t\t $this->url = Url::Parse(ACCOUNT_EXPIRED_URL . \"&user={$this->user}&mobile={$this->data->mobile}&success_url=\". urlencode((string)$this->data->url));\n }\n\t\t}else {\n // Se permite acceso solamente al servidor de Aurora\n return FALSE;\n }\n \n return true;\n\t}", "static public function tryToActivateAccount() {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Account = DB::getInstance()->query('SELECT id FROM `'.PREFIX.'account` WHERE `activation_hash`='.DB::getInstance()->escape($_GET['activate']).' LIMIT 1')->fetch();\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\tif ($Account) {\r\n\t\t\tDB::getInstance()->update('account', $Account['id'], 'activation_hash', '');\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function canBeActivated()\n {\n return !$this->getIsActive();\n }", "public function isActive()\n\t{\n\t\treturn $this->isActivated() && !$this->isBanned();\n\t}", "public function allowAccountAccess()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->checkAccountAccess();\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\t//return User::where('id', Auth::user()->id)->where('active', 1)->exists();\n\t\treturn true;\n\t}", "public function canAccept()\n {\n $user = $this->getUser();\n\n if (\n $this->getData('status') == Service\\BalanceWithdrawals::STATUS_PENDING &&\n $user->getData('role') == 'Admin'\n ) {\n return true;\n }\n\n return false;\n }", "public function isAccountant()\n {\n return (\\Auth::user()->role == 'accountant');\n }", "public function testCanActivateUser()\n {\n $user = factory(User::class)->create();\n $activation = $user->create_activation();\n $this->get('/api/v1/activate/'.$activation->token, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $user->email,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $user->email,\n 'activated' => true\n ]);\n $this->assertDatabaseMissing('user_activations', [\n 'email' => $user->email,\n ]);\n $this->assertTrue(Auth::user()->id == $user->id);\n }", "public function validateIsActive() : bool\n {\n return $this->user_active ? true : false;\n }", "protected function checkActiveUser($request)\n {\n $user = User::where('email', $request->get($this->loginUsername()))->first();\n if (empty($user)) return false;\n\n $isMatch = Hash::check($request->get('password'), $user->password, []);\n if (!$isMatch) return false;\n\n if ($isMatch && !$user->isActive) {\n return UNACTIVE;\n } else {\n return ACTIVED;\n }\n }", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function admin_func_check_user($params, $vars) {\n if ( ! empty($vars['username']) || ! empty($vars['email']) ) {\n $is_available = 1;\n $user_id = empty($vars['user_id']) ? false : $vars['user_id'];\n if ( ! empty($vars['username']) ) {\n $username = $vars['username'];\n if ( $this->model->is_user($username, $user_id) || $this->model->is_super($username) ) {\n $is_available = 0;\n }\n } else {\n $email = trim( strtolower($vars['email']) );\n if ( $this->model->email_exists($email, $user_id) ) {\n $is_available = 0;\n }\n }\n return $is_available;\n }\n }", "function admin_user_activated($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\t\t$activated = 1;\n\t\t$query = \"SELECT `admin_Idn` FROM `administrator` WHERE `email` = '$email' AND `active` = '$activated'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 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\n\t}", "private function _check_unconfirmed_account() {\n \n if ( get_user_option('nonpaid') ) {\n \n redirect('/upgrade');\n \n }\n \n if ( $this->user_status == 0 ) {\n \n redirect('/user/unconfirmed-account');\n \n }\n \n }", "function user_activated($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\t\t$activated = 1;\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email' AND `active` = '$activated'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 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\n\t}", "public function action_activateaccount()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tisAllowedTo('moderate_forum');\n\n\t\tif (isset($this->_req->query->save, $this->_profile['is_activated'])\n\t\t\t&& $this->_profile['is_activated'] != 1)\n\t\t{\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\n\t\t\t// If we are approving the deletion of an account, we do something special ;)\n\t\t\tif ($this->_profile['is_activated'] == 4)\n\t\t\t{\n\t\t\t\tdeleteMembers($context['id_member']);\n\t\t\t\tredirectexit();\n\t\t\t}\n\n\t\t\t// Actually update this member now, as it guarantees the unapproved count can't get corrupted.\n\t\t\tapproveMembers(array('members' => array($context['id_member']), 'activated_status' => $this->_profile['is_activated']));\n\n\t\t\t// Log what we did?\n\t\t\tlogAction('approve_member', array('member' => $this->_memID), 'admin');\n\n\t\t\t// If we are doing approval, update the stats for the member just in case.\n\t\t\tif (in_array($this->_profile['is_activated'], array(3, 4, 13, 14)))\n\t\t\t{\n\t\t\t\tupdateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 1 ? $modSettings['unapprovedMembers'] - 1 : 0)));\n\t\t\t}\n\n\t\t\t// Make sure we update the stats too.\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\tupdateMemberStats();\n\t\t}\n\n\t\t// Leave it be...\n\t\tredirectexit('action=profile;u=' . $this->_memID . ';area=summary');\n\t}", "public function check()\n {\n if ($this->checkSuspended()) {\n throw new AuthException(sprintf(\n 'Пользователь [%s] был заморожен. Попробуйте позже.', $this->user->getLogin()\n ));\n }\n\n return true;\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function isActive() {\n\n\t\treturn ($this->getConfigValue('account_status') == \"active\");\n\t}", "function is_active()\n {\n return $this->userData[$this->user_active];\n }", "function is_active() {\n\t\treturn isset( $this->username ) && !empty( $this->username );\n\t}", "public function authorize()\n {\n return Auth::user()->data_confirmacao != null;\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function is_active(): bool;", "public function isActivated() {}", "public function is_active();", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function isAccountEligibleForChargeGeneration()\n\t{\n\t\t$objAccount = Account::getForId($this->account);\n\t\tif ($objAccount == null)\n\t\t{\n\t\t\tthrow new Exception(\"Associated Account (Id: {$this->account}) could not be found\");\n\t\t}\n\t\t\n\t\t// RecurringCharges only get generated if their associated account is active\n\t\tif ($objAccount->archived == ACCOUNT_STATUS_ACTIVE)\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 userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}", "function activateUser() {\n if (isset($_GET['account'])) {\n $account = htmlspecialchars($_GET['account'], ENT_QUOTES);\n \n connectDatabase();\n \n $result = queryDatabase(\"SELECT email\n FROM user\n WHERE active = 0\");\n\n if (mysql_num_rows($result) > 0){\n while ($row = mysql_fetch_object($result)) {\n if ($account == crypt($row->email, SALT)) {\n queryDatabase(\"UPDATE user SET active = 1\n WHERE email = '$row->email'\");\n \n echo '<div class=\"good\">Activation successful - Login using EMAIL/USER ID and PASSWORD</div>';\n \n break;\n }\n }\n }\n }\n}", "public function activateAccount($token)\n {\n $logger = $this->getLogger();\n\n try {\n $result = $this->apiClient->httpPost('/v2/users', [\n 'activationToken' => $token,\n ]);\n\n $logger->info('Account activation attempt with token was successful');\n\n return true;\n } catch (ApiException $ex) {\n $logger->err($ex->getMessage());\n }\n\n $logger->info('Account activation attempt with token failed, or was already activated');\n\n return false;\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function authorize(): bool\n {\n return config('fenerum.webhook_auth_username') === $this->getUser() &&\n config('fenerum.webhook_auth_password') === $this->getPassword();\n }", "public function hasUserConnected() {\n $accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n\n return !empty($accessToken);\n }", "public static function isAutoActivationEnabled()\n {\n $c = new Criteria();\n $c->add(SbSettingPeer::NAME, 'accountAutoActivation');\n $accountAutoActivation = SbSettingPeer::doSelectOne($c);\n\n if (is_object($accountAutoActivation) && ($accountAutoActivation->getValue() === '1'))\n {\n return true;\n }\n\n return false;\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "public function actionActive() {\n if (!Yii::$app->request->get('hash') && !Yii::$app->request->get('hash') != \"\") {\n throw new NotFoundHttpException(Yii::t('site', 'not user'));\n }\n $id = Yii::$app->request->get('hash');\n $query = User::find()->where(['auth_key' => $id])->one();\n if (!$query) {\n throw new NotFoundHttpException(Yii::t('site', 'not user data'));\n }\n if ($query->status == User::STATUS_BLOCKED) {\n $query->status = User::STATUS_ACTIVE;\n }\n if ($query->active == User::STATUS_BLOCKED) {\n $query->active = User::STATUS_ACTIVE;\n }\n if ($query->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('site', 'user activated'));\n return $this->goHome();\n } elseif($query->firstErrors) {\n $errors = $query->firstErrors;\n throw new UserException(reset($errors));\n }\n }", "public function isActivated()\n\t{\n\t\treturn !is_null($this->activated_at);\n\t}", "public function checkAccountAccess()\n\t{\n\t\tif (!$this->isActive())\n\t\t\tthrow new Exception(Yii::t('user', 'account_no_longer_active'));\n\n\t\tif ($this->tooManyFailedLogins())\n\t\t\tthrow new Exception(Yii::t('user', 'account_locked_failed_logins'));\n\t}", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function isActive()\n {\n if (empty($this->authProvider)) {\n return false;\n }\n if ($this->authProvider->getId() == AuthProvider::MAIN_PROVIDER_ID && empty($this->password)) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function activate() {\r\n \r\n $statement = ConnectionModel::getConnection()->query('Select * From user where id = :id and confirmToken = :confirmToken',\r\n ['id' => $this->_id,\r\n 'confirmToken' => $this->_confirmToken]);\r\n \r\n if($statement) {\r\n \r\n $activate = ConnectionModel::getConnection()->query('Update user set isConfirmed = 1 where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n if($activate) {\r\n \r\n $user = ConnectionModel::getConnection()->query('Select * From user where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n $result = new UserModel('','');\r\n $result->hydrate($user[0]);\r\n \r\n return $result;\r\n \r\n }\r\n \r\n }\r\n \r\n return false;\r\n \r\n}", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "protected function isActivated($user)\n {\n return empty($user[$this->keys[self::ACTIVATION_TOKEN_KEY]]) ? true : false;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n\n $uuidTenant = isset($user) ? $user->tenant->uuid : $this->segment(4);\n\n if(!app(TenantRepository::class)->getTenantByUuid($uuidTenant)) {\n return false; // 404\n }\n\n return true;\n }", "public function check_activation_status () {\n $licenses_link = get_option( $this->token . '-url', '' );\n //echo \"<pre>\"; print_r( $this ); echo \"</pre>\"; die();\n $products = $this->get_detected_products();\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $messages = array();\n if ( 0 < count( $products ) ) {\n foreach ( $products as $k => $v ) {\n if ( isset( $v['product_status'] ) && 'inactive' == $v['product_status'] ) {\n if( !empty( $licenses_link ) ) {\n $message = sprintf( __( '%s License is not active. To get started, activate it <a href=\"%s\">here</a>.', $this->domain ), $v['product_name'], $licenses_link );\n } else {\n $message = sprintf( __( '%s License is not active.', $this->domain ), $v['product_name'] );\n }\n if( !empty( $v[ 'errors_callback' ] ) && is_callable( $v[ 'errors_callback' ] ) ) {\n call_user_func_array( $v[ 'errors_callback' ], array( $message, 'warning' ) );\n } else {\n $messages[] = $message;\n }\n }\n }\n }\n if( !empty( $messages ) ) {\n $this->messages = $messages;\n }\n\n /**\n * We also ping UD server once per 24h\n * for getting any specific information.\n */\n $this->maybe_ping_ud();\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n\n $user = auth()->user();\n return ($user->hasRole(1)&&$user->hasStatus(3));\n }", "public function is_user_active($username) {\r\n\t\t\t$query = 'SELECT `userid` FROM `users` WHERE `active` = 1 AND `username`=:username';\r\n\t\t\t$statement = $this->con->prepare($query);\r\n\t\t\t$statement->bindValue(':username', $username);\r\n\t\t\t$statement->execute();\r\n\t\t\t$valid = ($statement->rowCount() == 1);\r\n\t\t\t$statement->closeCursor();\r\n\t\t\treturn $valid;\r\n\t\t}", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "protected function isUserAllowedToLogin() {}", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "function setUserActive($token) {\n // Check that token exists\n if (!valueExists('users', 'activation_token', $token)){\n addAlert(\"danger\", \"Invalid token specified.\");\n return false;\n }\n\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"UPDATE \".$db_table_prefix.\"users\n SET active = 1\n WHERE\n activation_token = :token\n LIMIT 1\";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':token'] = $token;\n\n if (!$stmt->execute($sqlVars)){\n // Error: column does not exist\n return false;\n }\n\n return true;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n } catch (RuntimeException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n }\n}", "function verify()\n {\n $activation = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $activation = $param[0];\n }\n $resultActive = $this->model->khachhang->activeAccount($activation);\n switch ($resultActive) {\n case 1 :\n redirect('user/active_expire');\n break;\n case 2:\n redirect('user/active_success');\n break;\n case 3:\n redirect('user/active_fail');\n break;\n }\n }", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n if(TeamMember::where('team_id', $this->get('team_id'))->count() < 8) {\n return TRUE;\n }\n } else {\n return FALSE;\n }\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }", "function wp_authenticate_user($userdata)\n{\n $isActivated = get_user_meta($userdata->ID, 'is_active', true) || user_can($userdata->ID, 'manage_options');\n\n if (!$isActivated) {\n $userdata = new WP_Error(\n 'confirmation_error',\n __('<strong>ERROR:</strong> We have not yet activated your account. If you have any questions please use the form at the bottom of the page.')\n );\n }\n return $userdata;\n}", "public function hasUnactivatedAccounts()\n {\n foreach ($this->serial_numbers as $serial) {\n if (!$serial->isActive()) {\n return true;\n }\n }\n\n return false;\n }", "public function _checkAndGetUserActive()\n {\n return $this->find('id_user,name,lastname,email,salt,password', [\n 'username' => $this->username,\n 'sw_active' => 1\n ]);\n }", "public function checkCustomerIsActive() {\r\n\t\t// activate by customer group\r\n\t\t/* @var $oCustomerSession Mage_Customer_Model_Session */\r\n\t\t$oCustomerSession = Mage::getModel('customer/session');\r\n\t\t$iCurrentCustomerGroupId = $oCustomerSession->getCustomerGroupId();\r\n\t\t$aActiveCustomerGroupIds = explode(',', Mage::getStoreConfig('b2bprofessional/activatebycustomersettings/activecustomers'));\r\n\r\n\t\t/*\r\n\t\t * Always add the guest user when activated by customer group\r\n\t\t * Note: the the group code for the guest user can not be changed via the admin section \r\n\t\t */\r\n\t\t$iGuestGroupId = Mage::getModel('customer/group')->load('NOT LOGGED IN', 'customer_group_code')->getId();\r\n\t\t$aActiveCustomerGroupIds[] = $iGuestGroupId;\r\n\r\n\t\tif (in_array($iCurrentCustomerGroupId, $aActiveCustomerGroupIds)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function hasUser();", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateUser($user_id)\n\t{\n\t\tif($this->getUserStatusId($user_id) === 3)\n\t\t{\n\t\t\t$this->where('id', '=', $user_id)->update(['user_status' => 1]);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function checkIfAvailable(){\n $user_check_query = self::$connection->db->prepare(\"SELECT * FROM users WHERE name = ? OR email = ?\");\n $user_check_query->bind_param(\"ss\", self::$signUpName, self::$signUpEmail);\n $user_check_query->execute();\n $users = $user_check_query->get_result()->fetch_assoc();\n $user_check_query->close();\n $nameError = false;\n $emailError = false;\n $_POST = array();\n if (isset($users)) {\n foreach($users as $key=>$value) {\n if (strtolower($users['name']) === strtolower(self::$signUpName) && !$nameError) {\n self::addError(\"signUp\", \"Name already exists.\");\n $nameError = true;\n Auth::CreateView('Auth');\n };\n if ($users['email'] === self::$signUpEmail && !$emailError) {\n self::addError(\"signUp\", \"Email already exists.\");\n $emailError = true;\n Auth::CreateView('Auth');\n };\n }\n } else if(count(self::$signUpErrors) === 0){\n $this->registering();\n return true;\n }\n }", "public function activate(){\r\n\t\t$uid = $_GET[\"uid\"];\r\n\t\t$hash = $_GET[\"hash\"];\r\n\r\n\t\tif(User::activateUser($uid, $hash)){\r\n\t\t\techo \"active\";\r\n\t\t\tUser::loginSystem(User::fromUid($uid));\r\n\t\t}\r\n\t\tPage::redirect(\"/index\");\r\n\t}", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n $user = $this->user();\n if(!$user){\n return false;\n }\n\n return $user->can('create',Coupon::class);\n }", "public function isActivatable()\n {\n return true ;\n }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public static function isAuthorized()\n {\n $conn = new MySqlConnect();\n $isValid = FALSE;\n\n if (isset($_SESSION['email']))\n {\n $email = $_SESSION['email'];\n // query the db for the value comparison\n $result = $conn -> executeQueryResult(\"SELECT isValidated FROM users WHERE emailAddress = '{$email}'\");\n // get a row count to verify only 1 row is returned\n $count = mysql_num_rows($result);\n if ($count == 1)\n {\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result\n // object\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // check the boolean value\n if (trim($row['isValidated']) == 'YES')\n {\n $isValid = TRUE;\n }\n }\n }\n $conn -> freeConnection();\n }\n return $isValid;\n }", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function activateUser()\n {\n // Sets the value of activated to yes\n $int = 1;\n\n $mysqli = $this->conn;\n\n /* Prepared statement, stage 1: prepare */\n if (!($stmt = $mysqli->prepare(\"UPDATE User SET \n \t\tactiveUser = ?\n \t\t\tWHERE ID = ?\"))\n ) {\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n }\n\n /* Prepared statement, stage 2: bind and execute */\n\n if (!($stmt->bind_param(\"ii\",\n $int,\n $this->id))\n ) {\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n if (!$stmt->execute()) {\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n }", "protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function checkActiveUserProfile($username) {\n //get user manager\n $um = $this->getUserManager();\n\n //get user detail\n $user = $um->findUserByUsername($username);\n $user_check_enable = $user->isEnabled();\n return $user_check_enable;\n }", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "function hc_gf_maybe_activate_user() {\n\n $template_path = STYLESHEETPATH . '/gf-activate-template/activate.php';\n $is_activate_page = isset( $_GET['page'] ) && $_GET['page'] == 'gf_activation';\n \n if( ! file_exists( $template_path ) || ! $is_activate_page )\n return;\n \n require_once( $template_path );\n \n exit();\n}", "public function isAllowed() {\n\t\tif (!$this->session->has('auth')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = User::findFirst(array('username' => $this->session->get('auth')));\n\n\t\treturn $user->getSuperUser() ? true : false;\n\t}", "public function isActive() : bool\n {\n return $this->id !== 0 && $this->activated;\n }", "public function hasPostAuthentication()\n {\n return isset($this->sessionStorage->user['twofactor_activated']) && $this->sessionStorage->user['twofactor_activated'] === true;\n }", "public function user_unactive() {\n if ($this->input->post('submitRegistration')) {\n $userData = array(\n 'email' => $this->input->post('email'),\n 'token' => md5($this->input->post('email'))\n );\n\n $this->Common_Model->insert($userData, 'wh_user_activations');\n\n $userData['message'] = 'Click the below link to activate your account. <br /><a href=\"' . base_url() . 'Site_Login/activate_account/' . $userData['token'] . '\">Activate</a>';\n $userData['subject'] = 'Account activation';\n\n $result = $this->sendMail($userData);\n if ($result) {\n return true;\n } else {\n return false;\n }\n }\n }", "function user_active($username) {\n $username = sanitize($username);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `active` = 1\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}" ]
[ "0.7429018", "0.72740954", "0.70621485", "0.70303094", "0.70240635", "0.7016996", "0.69933975", "0.69851756", "0.6940561", "0.6907332", "0.6810327", "0.6799433", "0.67153347", "0.66843295", "0.6672949", "0.6658936", "0.6632243", "0.6608393", "0.65561837", "0.65556574", "0.6546768", "0.6536746", "0.6510349", "0.6509687", "0.64899004", "0.644747", "0.64446753", "0.6441964", "0.6438687", "0.6423654", "0.6421099", "0.6418277", "0.6387639", "0.63767785", "0.63764423", "0.63619894", "0.6361879", "0.63607794", "0.63579476", "0.6356823", "0.63541156", "0.63456166", "0.63359356", "0.63355374", "0.6333478", "0.6307646", "0.6294123", "0.62843716", "0.6278603", "0.6276464", "0.6260515", "0.6255858", "0.6251198", "0.62510026", "0.62501276", "0.62475806", "0.6246858", "0.62387455", "0.6234319", "0.6234319", "0.62306386", "0.622461", "0.62200224", "0.62164474", "0.62147206", "0.62033916", "0.6199214", "0.6192235", "0.6191346", "0.6187018", "0.6177468", "0.617711", "0.6173521", "0.6168752", "0.6168362", "0.6166936", "0.61651605", "0.61628354", "0.6161836", "0.6154041", "0.6146291", "0.61457884", "0.6142086", "0.6131607", "0.61310184", "0.6129121", "0.61280435", "0.61270183", "0.6123345", "0.6120068", "0.611686", "0.61141515", "0.6107179", "0.6105399", "0.6104518", "0.610124", "0.6098581", "0.6092953", "0.6091735", "0.60841626" ]
0.6597038
18
Build a navigation bar using the $classifications array
function dynamicMenu($classifications){ $navList = '<ul>'; $navList .= "<li><a href='/phpmotors/' title='View the PHP Motors home page'>Home</a></li>"; foreach ($classifications as $classification) { $navList .= "<li><a href='/phpmotors/vehicles/?action=classification&classificationName=".urlencode($classification['classificationName'])."' title='View our $classification[classificationName] lineup of vehicles'>$classification[classificationName]</a></li>"; } $navList .= '</ul>'; return $navList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildNav($navArray)\n{\n // Build a dropdown list $classifications array\n $navList = '';\n $navList .= \"<div><a href='/phpmotors/index.php' title='View the PHP Motors home page'>Home</a></div>\";\n foreach ($navArray as $classification) {\n $navList .= \"<div><a href='/phpmotors/vehicles/index.php?action=viewClassification&classificationName=\" . urlencode($classification['classificationName']) . \"' title='View our $classification[classificationName] product line'>$classification[classificationName]</a></div>\";\n }\n $navList .= '';\n\n return $navList;\n}", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "protected function build_nav()\r\n {\r\n //$this->view = false;\r\n $this->load->model('privilege_model','nav');\r\n\r\n $roles = $this->user->get_roles($this->user_id);\r\n $nav_links = $this->nav->get($roles); \r\n\r\n $this->load->config('nav_icons');\r\n $nav_icons = $this->config->item('icons');\r\n $result = '<ul id=\"nav\">'; \r\n \r\n //loop over returned top level navs\r\n foreach($nav_links as $nav_link):\r\n\r\n if($nav_link->name == \"school-logo\"):\r\n\r\n if(!$this->user_details->is_parent): //parent can belong to multiple schools\r\n\r\n $result .= '<li class=\"'.$nav_link->name.'\">'.\r\n anchor('schools/profile/1', img(base_url('assets/imgs/xlogo.jpg')))\r\n .'</li>'; \r\n\r\n endif;// only add school logo if not a regular user\r\n else:\r\n \r\n //Preferential nav load\r\n $result .= '<li class=\"'.$nav_link->name.'\">'.\r\n anchor($nav_link->controller.'/'.$nav_link->method, ' ', array('class' => $nav_icons[$nav_link->name]))\r\n .''.\r\n anchor($nav_link->controller.'/'.$nav_link->method, ucfirst($nav_link->name))\r\n .'</li>'; \r\n //End preferential nav load \r\n\r\n endif;\r\n endforeach;\r\n\r\n $result .= '</ul>';\r\n return $result;\r\n }", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "function nav($anchor, $link, $navClass, $ulClass){\n \n $size = count($anchor);\n $i = 0;\n \n echo '<nav class=\"' . $navClass . '\"><ul class=\"' . $ulClass .'\">';\n \n for($i; $i<$size; $i++)\n {\n $navigation = '<li class=\"navigation\"><a href=\"';\n $navigation .= $link[$i];\n $navigation .= '\">';\n $navigation .= $anchor[$i];\n $navigation .= '</a></li>';\n \n echo $navigation;\n }\n \n echo '</ul></nav>'; \n}", "private function _getNavigation()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVar( 'task' );\r\n\t\t$uri->delVar( 'submit' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action ) {\r\n\t\t\t\tif ( array_key_exists( 'task', $whmcs->input ) ) {\r\n\t\t\t\t\tif ( $whmcs->input['task'] != 'edittheme' ) {\r\n\t\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "function renderNavigation(array $array)\n {\n $html = '';\n\n foreach ( $array as $item=>$attributes){\n\n // Set the title of the navigation point\n $title = (isset($attributes['title']) ? $attributes['title'] : $item );\n\n // if a icon is passed to the array a icon tag will be created\n $icon = (isset($attributes['icon']) ? sprintf('<i class=\"%s\"></i>',$attributes['icon']) : null );\n // pass together the whole anchor tag\n $anchor = sprintf('<a href=\"%s\">%s%s</a>',$attributes['url'],$icon,$title);\n\n // Check if there is a submenu. If Yes, run that itself through this macro\n $submenu = (isset($attributes['sub-menu']) ? sprintf('<ul class=\"sub-menu\">%s</ul>',renderNavigation($attributes['sub-menu'])) : null );\n\n // Check for the current URL if it matches any Anchors\n $class = '';\n if(strstr(Request::fullUrl(),$attributes['url']))\n $class = 'class=\"on\"';\n\n // and wrap it into the listitem\n $html .= sprintf('<li %s>%s%s</li>',$class,$anchor,$submenu);\n\n }\n\n // Pass back the entire navigation list\n return $html;\n }", "private function _getNavigation()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'themer' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action && $task != 'edittheme' ) {\r\n\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "function makeNavigation($nameCat, $tocs, $type) {\r\n\t\r\n\t$nameCat = fileNameTrans($nameCat);\r\n\t\r\n\t$result = '<ul class=\"nav navbar-nav\">';\r\n\tforeach($tocs as $field => $toc) {\r\n\t\t$classLiTop = 'download';\r\n\t\tif($field == $type) {\r\n\t\t\t$classLiTop = 'active';\r\n\t\t}\r\n\t\t$listItems = makeULContent($toc, $nameCat, $field);\r\n\t\t$fieldGer = translateFieldNames($field);\r\n\t\t$result .= '\r\n\t\t\t\t\t<li class=\"'.$classLiTop.'\">\r\n\t\t\t\t\t\t<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"'.$nameCat.'-'.$field.'.html\">nach '.$fieldGer.'<span class=\"caret\"></span></a>\r\n\t\t\t\t\t\t<ul class=\"dropdown-menu\">\r\n\t\t\t\t\t\t\t<li><a href=\"'.$nameCat.'-'.$field.'.html\">Seitenanfang</a></li>\r\n\t\t\t\t\t\t\t'.$listItems.'\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</li>';\r\n\t}\r\n\t$result .= '</ul>';\r\n\treturn($result);\r\n}", "function _navigation_markup($links, $css_class = 'posts-navigation', $screen_reader_text = '', $aria_label = '')\n {\n }", "public static function GenerateMenu($menu, $class) \n\t\t{\n\t\t\t$func = null; \n\n\t\t if (isset($menu['callback'])) {\n\t\t $func = $menu['callback']; \n\t\t }\n\n\t\t $html = \"<nav class='$class'>\\n\";\n\n\t\t foreach($menu['items'] as $item) {\n\t\t \tif (isset($menu['callback']) && call_user_func($menu['callback'], $item['url'])) { \n\t\t \t\t$item['class'] .= ' selected'; \n\t\t \t}\n\t\t\t\t$html .= \"<a href='{$item['url']}' class='{$item['class']}' title='{$item['title']}'>{$item['text']}</a>\\n\";\n\t\t }\n\t\t $html .= \"</nav>\\n\";\n\t\t return $html;\n\t\t}", "public function renderMenu($config = array()){\n $this->_setOptions($config);\n \n $translator = Zend_Registry::get('Zend_Translate');\n $trans = $translator->getAdapter();\n \n $navigation = App_Navigation::getInstance()->getNavigation($this->_navigationParams);\n \n $menu = array();\n foreach( $navigation as $tab ){\n if( isset($tab['controller']) ){\n $urlParams = array(\n 'controller' => $tab['controller']\n );\n if( isset($tab['action']) ){\n $urlParams['action'] = $tab['action'];\n }\n $url = $this->_assembleUrl($urlParams);\n if( isset($tab['active']) && $tab['active'] ){\n $tabLink = sprintf($this->_currentLinkTemplate, $url, \n $trans->translate($tab['label']));\n }else{\n $tabLink = sprintf($this->_linkTemplate, $url, \n $trans->translate($tab['label']));\n }\n }else{\n $tabLink = sprintf($this->_tabLinkTemplate, $trans->translate($tab['label']));\n }\n $links = array();\n if( isset($tab['pages']) ){\n foreach( $tab['pages'] as $page ){\n $urlParams = array(\n 'controller' => $page['controller']\n );\n if( isset($page['action']) ){\n $urlParams['action'] = $page['action'];\n }\n $url = $this->_assembleUrl($urlParams);\n if( isset($page['active']) && $page['active'] ){\n $links[] = sprintf($this->_currentLinkTemplate, $url, \n $trans->translate($page['label']));\n }else{\n $links[] = sprintf($this->_linkTemplate, $url, \n $trans->translate($page['label']));\n }\n }\n }\n if( isset($tab['active']) && $tab['active'] ){\n $li = '<li class=\"current\">' . PHP_EOL . $tabLink . PHP_EOL;\n $li .= ! empty($links) ? '<ul>' . PHP_EOL . '<li>' .\n implode('</li>' . PHP_EOL . '<li>', $links) . '</li>' . PHP_EOL .\n '</ul>' : '';\n $li .= '</li>';\n }else{\n $li = '<li>' . PHP_EOL . $tabLink . PHP_EOL;\n $li .= ! empty($links) ? '<ul>' . PHP_EOL . '<li>' .\n implode('</li>' . PHP_EOL . '<li>', $links) . '</li>' . PHP_EOL .\n '</ul>' : '';\n $li .= '</li>';\n }\n $menu[] = $li;\n }\n \n $xhtml = '<ul id=\"'.$this->_menuId.'\" class=\"'.$this->_menuClass.'\">' . PHP_EOL .\n implode(PHP_EOL, $menu) . PHP_EOL . '</ul>';\n return $xhtml;\n }", "public function main_navigation(){\r\n\r\n echo \"<ul>\";\r\n\r\n if(isset($this->navigationSettings)){\r\n\r\n foreach((array) $this->navigationSettings as $key => $value){\r\n echo \"<li>\";\r\n echo \"<a href='$value'>$key</a>\";\r\n echo \"</li>\";\r\n }\r\n\r\n }\r\n\r\n echo \"</ul>\";\r\n\r\n }", "function create_nav_bar()\n{\n $menus = array\n (\n 'Project' => array\n (\n array('label' => 'Create Project', 'url' => 'create_project.php'),\n array('label' => 'Search Projects', 'url' => 'search_projects.php')\n ),\n 'Experiment' => array\n (\n array('label' => 'Create Experiment', 'url' => 'create_experiment.php'),\n array('label' => 'Search Experiments', 'url' => 'search_experiments.php')\n ),\n 'Help' => array\n (\n array('label' => 'Report Issue', 'url' => '#'),\n array('label' => 'Request Feature', 'url' => '#')\n )\n );\n\n $selfExplode = explode('/', $_SERVER['PHP_SELF']);\n\n\n\n // nav bar and left-aligned content\n\n echo '<nav class=\"navbar navbar-default navbar-static-top\" role=\"navigation\">\n <div class=\"container-fluid\">\n <!-- Brand and toggle get grouped for better mobile display -->\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"index.php\" title=\"PHP Gateway with Airavata\">PGA</a>\n </div>\n\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n <ul class=\"nav navbar-nav\">';\n\n\n foreach ($menus as $label => $options)\n {\n isset($_SESSION['loggedin']) && $_SESSION['loggedin']? $disabled = '' : $disabled = ' class=\"disabled\"';\n\n echo '<li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">' . $label . '<span class=\"caret\"></span></a>\n <ul class=\"dropdown-menu\" role=\"menu\">';\n\n foreach ($options as $option)\n {\n $id = strtolower(str_replace(' ', '-', $option['label']));\n\n $option['url'] == $selfExplode[2]? $active = ' class=\"active\"' : $active = '';\n\n echo '<li' . $active . $disabled . '><a href=\"' . $option['url'] . '\" id=' . $id . '>' . $option['label'] . '</a></li>';\n }\n\n echo '</ul>\n </li>';\n }\n\n\n echo '</ul>\n\n <ul class=\"nav navbar-nav navbar-right\">';\n\n\n\n\n\n // right-aligned content\n\n if (isset($_SESSION['username']))\n {\n (USER_STORE === \"USER_API\" && !isset($_SESSION['excede_login'])) ? $link = \"user_profile.php\" : $link = \"index.php\";\n echo '<li><a href=\"' . $link . '\"><span class=\"glyphicon glyphicon-user\"></span> ' . $_SESSION['username'] . '</a></li>';\n }\n\n if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'])\n {\n echo '<li><a href=\"logout.php\"><span class=\"glyphicon glyphicon-log-out\"></span> Log out</a></li>';\n }\n elseif ($selfExplode[2] == 'login.php')\n {\n echo '<li><a href=\"create_account.php\"><span class=\"glyphicon glyphicon-user\"></span> Create account</a></li>';\n }\n elseif ($selfExplode[2] == 'create_account.php')\n {\n echo '<li><a href=\"login.php\"><span class=\"glyphicon glyphicon-log-in\"></span> Log in</a></li>';\n }\n elseif ($selfExplode[2] == 'index.php')\n {\n echo '<li><a href=\"create_account.php\"><span class=\"glyphicon glyphicon-user\"></span> Create account</a></li>';\n echo '<li><a href=\"login.php\"><span class=\"glyphicon glyphicon-log-in\"></span> Log in</a></li>';\n }\n\n\n echo '</ul>\n </div><!-- /.navbar-collapse -->\n </div><!-- /.container-fluid -->\n </nav>';\n}", "public function exampleNavigation()\n {\n /*\n $config = array(\n array(\n 'label' => 'Home',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'index',\n ),\n\n array(\n 'label' => 'Coding Guidelines',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'guideslines',\n ),\n\n array(\n 'label' => 'Libraries',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'index',\n 'pages' => array(\n array(\n 'label' => 'Blueprint',\n 'module' => 'example',\n 'controller' => 'library',\n 'action' => 'blueprint',\n ),\n ),\n ),\n );\n\n $container = new Zend_Navigation($config);\n\t\t$this->setContainer($container);\n\n return $this;\n\n */\n $menus = array(\n\n '' => array(\n '/example' => 'Home',\n '/example/index/guideslines' => 'Coding Guidelines',\n ),\n\n 'Libraries' => array(\n //'/example/library/zend' => 'Zend Framework',\n '/example/library/blueprint' => 'Blueprint',\n '/example/library/mootools' => 'Mootools',\n ),\n\n 'Tools' => array(\n '/example/tools/debug' => 'Debug',\n '/example/tools/makefile' => 'MakeFile',\n ),\n\n 'CSS Elements' => array(\n '/example/css/menus' => 'Menus',\n '/example/css/buttons' => 'Fancy Buttons',\n '/example/css/box' => 'Round Box',\n ),\n\n 'JS Elements' => array(\n '/example/javascript/ajaxlink' => 'Ajax Link',\n '/example/javascript/ajaxform' => 'Ajax Form',\n '/example/javascript/lightbox' => 'LightBox',\n '/example/javascript/uwa' => 'UWA Widget',\n ),\n\n 'Form Elements' => array(\n '/example/form/index' => 'Showcases',\n '/example/form/fancyselect' => 'Fancy Select',\n '/example/form/dateselect' => 'Date Select',\n '/example/form/autocompleter' => 'Auto Completer',\n //'/example/form/rangeselect' => 'Range Select Element',\n //'/example/form/contactselect' => 'Contact List Element',\n ),\n\n 'View Helpers' => array(\n '/example/helper/geshi' => 'GeShi',\n '/example/helper/googleanalytics' => 'Google Analytics',\n ),\n\n 'Services' => array(\n '/example/service/xmlrpc' => 'Simple XMLRPC',\n ),\n\n 'Core Classes' => array(\n '/example/core/error' => 'Error Handler',\n '/example/core/controller' => 'Controller Abstract',\n '/example/core/archive' => 'Archive',\n '/example/core/template' => 'Template',\n '/example/core/notify' => 'Notify',\n '/example/core/stitem' => 'StItem/StCollection',\n '/example/core/dbitem' => 'DbItem/DbCollection',\n '/example/core/dbsearch' => 'DbSearch',\n ),\n );\n\n $xhtml = array();\n foreach ($menus as $menu => $links) {\n\n if (strlen($menu) > 0) {\n $xhtml[] = '<h4>' . $this->view->escape($menu) . '</h4>';\n }\n\n $xhtml[] = '<ul>';\n foreach ($links as $link => $label) {\n $xhtml[] = '<li><a href=\"' . $link . '\">' . $this->view->escape($label) . '</a></li>';\n }\n $xhtml[] = '</ul>';\n }\n\n return implode(\"\\n\", $xhtml);\n }", "function launchpad_modify_nav_class($classes, $item) {\n\t$slug = sanitize_title($item->title);\n\t$classes = preg_replace('/^((menu|page)[-_\\w+]+)+/', '', $classes);\n\t\n\t$classes[] = 'menu-' . $slug;\n\t\n\t$link_url = preg_replace('|^https?://' . $_SERVER['HTTP_HOST'] . '/|', '/', $item->url);\n\t$current_url = $_SERVER['REQUEST_URI'];\n\t\n\tif($link_url != '/' && $current_url !== $link_url && stristr($current_url, $link_url) !== false) {\n\t\t$classes[] = 'current-hierarchy-ancestor';\n\t} else if($current_url === $link_url) {\n\t\t$classes[] = 'current-hierarchy-page';\t\t\n\t}\n\t\n\t$classes = array_unique($classes);\n\t\n\t// Apply filters to allow the developer to change it.\n\t$classes = apply_filters('launchpad_nav_class', $classes);\n\t\n\treturn array_filter(\n\t\t$classes, \n\t\tfunction($el) {\n\t\t\t$el = trim($el);\n\t\t\treturn empty($el) ? false : true;\n\t\t}\n\t);\n}", "private function displayNav()\n {\n\n $links = array(\n 'home',\n 'browse',\n 'about',\n 'contact',\n );\n\n //Navbar\n $html = '<div id=\"navbar\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n\n // Loop through the links\n foreach ($links as $link) {\n\n $html .= '<li><a href=\"index.php?page=' . $link . '\"';\n\n if ($link == $_GET['page']) {\n $html .= ' class=\"active\"';\n }\n\n $html .= '>';\n\n if ($this->model->userLoggedIn && $link == 'home') {\n $html .= 'My Profile';\n } else {\n $html .= ucfirst($link);\n }\n\n $html .= '</a></li>' . \"\\n\";\n\n }\n\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n return $html;\n }", "function makeLinks($nav)\r\n{\r\n$myReturn='';\r\n foreach($nav as $key => $value){\r\n if(THIS_PAGE == $key){//current page add active class\r\n \r\n $myReturn .='\r\n <li class=\"nav-item \">\r\n <a class=\"nav-link active\" href=\"' . $key . ' \">' . $value . ' </a>\r\n </li>'; \r\n \r\n \r\n }else{//add no formatting\r\n \r\n\r\n \r\n $myReturn .='\r\n <li class=\"nav-item\">\r\n <a class=\"nav-link\" href=\"' . $key . ' \">' . $value . ' </a>\r\n </li>'; }\r\n \r\n \r\n \r\n }\r\n \r\n \r\n return $myReturn;\r\n\r\n\r\n\r\n}", "function barony_base_process_page(&$variables) {\n $variables['navbar_classes'] = implode(' ', $variables['navbar_classes_array']);\n}", "function makeLinks($nav){\n \n $myReturn = '';\n foreach($nav as $key => $value){\n \n if(THIS_PAGE == $key)\n {//current page add active class \n $myReturn .= '\n <li class=\"nav-item\">\n <a class=\"nav-link active\" href=\"' . $key . '\">' . $value . '</a>\n </li>';\n \n \n }else{//add formatting\n $myReturn .= '\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"' . $key . '\">' . $value . '</a>\n </li>';\n \n }\n \n }\n \n return $myReturn;\n \n}", "function makeNav($active,$AdminEdit,$userObj)\r\n{\r\n $navArray = array(\r\n \"Resume Archive\" => \"ResumeArchive.php\",\r\n \"Address\" => \"AddressEdit.php\",\r\n \"Phone\" => \"PhoneEdit.php\",\r\n \"Job\" => \"JobEdit.php\",\r\n \"Help/Info\" => \"help.html\",\r\n \"Admin\" => \"Admin.php\"\r\n \r\n );\r\n \r\n \r\n //if they are not an admin delete the admin link\r\n if(!$userObj->isAdmin)\r\n {\r\n unset( $navArray[\"Admin\"]);\r\n }\r\n \r\n //if they are a guest then remove the multiple resume capability and admin link\r\n if($userObj->isGuest)\r\n {\r\n unset($navArray[\"Admin\"]);\r\n unset($navArray[\"Resume Archive\"]);\r\n $navArray = array(\"Create Resume\" => \"ResumeEdit.php\") + $navArray;\r\n \r\n }\r\n \r\n //BUILDS THE MENU\r\n //sets the begining of the menu\r\n $result = \"\r\n <!--Menu-->\r\n <div id='cssmenu'>\r\n <ul>\";\r\n \r\n \r\n //iterates through the array and adds additional items\r\n foreach ($navArray as $key => $value) \r\n { \r\n \r\n $selection = ($active == $value) ? \" class='active'\" : \"\";\r\n $result = $result . \"<li $selection><a href='$value'><span>$key</span></a></li>\";\r\n }\r\n //add closing brace\r\n $result = $result . \" \r\n </ul>\r\n </div>\";\r\n \r\n return $result;//return the nave menu\r\n}", "public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\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\t$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "private function build_navigation() {\n\t\t$content = \"<nav id='formlift-header' class='formlift-nav'>\";\n\t\tforeach ( $this->sections as $section ) {\n\t\t\t$content .= $section->get_header();\n\t\t}\n\n\t\treturn $content . \"<button type='submit' style='margin: 45px' class='button button-large'>SAVE CHANGES</button></nav>\";\n\t}", "function printNavbar($calling_page) {\n session_start();\n $pages['crategame'] = \"Play\";\n $pages['puzzlelist'] = \"Puzzle List\";\n\n require_once \"authenticate.php\";\n if (challengeAuth()) {\n $pages['logout'] = \"Welcome, {$_SESSION['tag']}! (Logout)\";\n } else {\n $pages['signup'] = \"Sign Up\";\n $pages['login'] = \"Login\";\n }\n\n $nav = \"\";\n foreach ($pages as $key => $page) {\n $selected = strpos($calling_page, $key);\n $nav .= \"<li class='\" . ($selected ? \"selected\" : \"\") . \"'><a class='\" . ($selected ? \"selected\" : \"\");\n // Set tab link. If crategame, choose random int for id.\n $nav .= \"' href='$key.php\" . ($key === \"crategame\" ? (\"?id=\" . rand()) : \"\") . \"'>$page</a></li>\";\n }\n return $nav;\n}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "public function makeMenu(){\n\n //Label & class definition\n $idDiv = \"sub-menu\";\n $classUl = \"menu\";\n $classLi = \"stdanimation1_2\";\n $classSpan = \"stdanimation1_2\";\n $classA = \"stdanimation1_4\";\n\n //array mit link, icon, label\n // mit i übersetzen\n $naviArray[] = array(\"link\" => \"index.php?view=home\", \"icon\" => \"icon_house_alt\", \"label\" => \"Home\" );\n $naviArray[] = array(\"link\" => \"index.php?view=profile\", \"icon\" => \"icon_profile\", \"label\" => \"Profile\" );\n $naviArray[] = array(\"link\" => \"index.php?view=categories\", \"icon\" => \"icon_tag\", \"label\" => \"Categories\" );\n $naviArray[] = array(\"link\" => \"index.php?view=shoppingcart\", \"icon\" => \"icon_cart\", \"label\" => \"Shopping Cart\" );\n $naviArray[] = array(\"link\" => \"index.php?view=wishlist\", \"icon\" => \"icon_gift\", \"label\" => \"Wishlist\" );\n $naviArray[] = array(\"link\" => \"index.php?view=hotlist\", \"icon\" => \"icon_grid-2x2\", \"label\" => \"Hotlist\" );\n\n\n $linkList = \"\";\n\n //create a list item for every array found\n foreach($naviArray as $navipoint){\n //do translation\n $navipoint[\"label\"] = i($navipoint[\"label\"]);\n\n $linkList .= '\n <li class=\"'.$classLi.'\">\n <span class=\"'.$classSpan.' '.$navipoint[\"icon\"].'\"></span>\n <a class=\"'.$classSpan.'\" href=\"'.$navipoint[\"link\"].'\">'.$navipoint[\"label\"].'</a>\n </li>\n ';\n }\n\n $html = \"\";\n $html = '<div id=\"'.$idDiv.'\">\n <ul class=\"'.$classUl.'\">\n '.$linkList.'\n </ul>\n </div>';\n\n return $html;\n\n\n\n /*\n return '<div id=\"sub-menu\">\n <ul class=\"menu\">\n <li class=\"stdanimation\">\n <span class=\"stdanimation1_2 icon_house_alt\"></span>\n <a class=\"stdanimation1_4\" href=\"index.php?view=home\">Home</a>\n </li>\n <li class=\"stdanimation\">\n <span class=\"stdanimation1_2 icon_profile\"></span>\n <a class=\"stdanimation1_4\" href=\"index.php?view=profile\">Profil</a>\n </li>\n <li class=\"stdanimation1_4\">\n <span class=\"stdanimation1_4 icon_tag\"></span>\n <a class=\"stdanimation1_4\" href=\"index.php?view=categorie\">Kategorien</a>\n </li>\n <li class=\"stdanimation\">\n <span class=\"stdanimation1_2 icon_cart\"></span>\n <a class=\"stdanimation1_4\" href=\"index.php?view=shoppingcart\" >Shopping Cart</a>\n </li>\n <li class=\"stdanimation1_4\">\n <span class=\"stdanimation1_4 icon_gift\"></span>\n <a class=\"stdanimation1_4\" href=\"index.php?view=shop\">Ipsum</a>\n </li>\n <li class=\"stdanimation1_4\">\n <span class=\"stdanimation1_4 icon_grid-2x2\"></span>\n <a class=\"stdanimation1_4\">Doloret</a>\n </li>\n </ul>\n </div>';\n*/\n}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "public function createNavigation() {\n\t \n\t // 1. Gruppen auslesen\n\t\t$groups = array();\n\t\t$items = array();\n\t\n\t $items = $this->applicationHandler->getApplications(array(\n\t \t'groups' => true,\n\t \t'isVisible' => 1\n\t ));\n\n\t // 2. Elemente auslesen und parsen\n\t foreach ($items as $g) {\n\t \t\n\t \t$groupIsEmpty = true;\n\t \t$groupSelected = false;\n\n\t \tforeach ($g['cmtApplications'] as $r) {\n\t\n\t \t\t// Zugriffsrechte prüfen\n\t\t \tif (!$this->user->checkUserAccessRight($r['id'])) {\n\t\t \t\tcontinue;\t\n\t\t \t}\n\t\t \t\n\t\t\t\t// Da ist was drin in der Gruppe!\n\t\t\t\t$groupIsEmpty = false;\n\t\t\t\t$itemSelected = false;\n\t\t\t\t\t\t\n\t\t\t\t// Default-Einstellungen holen, sofern es welche gibt.\n\t\t\t\tif ($r['cmt_type'] == 'table') {\n\t\t\t\t\t$settingsPath = 'app_showtable/';\n\t\t\t\t} else {\n\t\t\t\t\t$a = explode('.', $r['cmt_include']);\n\t\t\t\t\t$settingsPath = $a[0].'/';\n\t\t\t\t\tunset ($a);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$itemSettings = $r['cmt_tablesettings'];\n\t\t\t\t\n\t\t\t\tif (!isset($itemSettings['icon'])) {\n\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch ($itemSettings['icon']) {\n\t\t\t\t\tcase 'otherIcon':\n\t\t\t\t \t$itemIcon = CMT_TEMPLATE.$itemSettings['iconPath'];\n\t\t\t\t \tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'none':\n\t\t\t\t\t\t$itemIcon = '';\n\t\t\t\t\t\tunset ($itemSettings['iconPath']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (isset($itemSettings['iconPath']) && is_file(CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'])) {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Das 16px große Icon anzeigen\n\t\t\t\tif (!strstr($itemIcon, 'cmt_default')) {\n\t\t\t\t\t$iconParts = explode('.', (basename($itemIcon)));\n\t\t\t\t\t$itemIcon = dirname($itemIcon).'/'.array_shift($iconParts).'_16px.'.implode('.', $iconParts);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_file($itemIcon)) {\n\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($r['id'] == $this->selectedApplicationID) {\n\t\t\t\t\t$itemSelected = true;\n\t\t\t\t\t$groupSelected = true;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$itemSelected = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// generate query variables\n\t\t\t\t$queryVars = '';\n\t\t\t\tif ($r['cmt_queryvars']) {\n\t\t\t\t\t$queryVars = str_replace(array(\"\\n\", \"\\r\"), array('&amp;', ''), $r['cmt_queryvars']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$parserVars = array(\n\t\t\t\t\t'itemIcon' => $itemIcon,\n\t\t\t\t\t'itemName' => $r['cmt_showname'],\n\t\t\t\t\t'itemId' => $r['id'],\n\t\t\t\t\t'itemSelected' => $itemSelected,\n\t\t\t\t\t'groupSelected' => $groupSelected,\n\t\t\t\t\t'queryVars' => $queryVars\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->parser->setMultipleParserVars($parserVars);\n\t\t\t\t$groupHtml .= $this->parser->parse($this->itemTemplate);\n\t \t}\n\t \t\n\t \t// Falls was in der Gruppe drin ist, dann anzeigen\n\t \tif (!$groupIsEmpty) {\n\t \t\t\n\t \t\t$groupSettings = $g['cmt_groupsettings'];\n\t \t\t\n\t \t\tif (!is_array($groupSettings)) {\n\t \t\t\t$groupSettings = array();\n\t \t\t}\n\t \t\t\n\t\t\t\t// Icon suchen\n\t\t\t switch ($groupSettings['icon']) {\n\t\t\t \tcase 'otherIcon':\n\t\t\t \t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tcase 'none':\n\t\t\t \t\t$groupIcon = '';\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tdefault:\n\t\t\t \t\tif ($groupSettings['iconPath']) {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\t} else {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t \t\t}\n\t\t\t \t\t$groupSettings['icon'] = 'default';\n\t\t\t \t\tbreak;\n\t\t\t }\n\t\t\t \n\t\t\t // Das 32px große Icon auswählen\n\t\t\t if (!strstr($groupIcon, 'cmt_defaultgroupicon_32px.png') && $groupIcon != '') {\n\t\t\t \t$iconParts = explode('.', (basename($groupIcon)));\n\t\t\t \t$groupIcon = dirname($groupIcon).'/'.array_shift($iconParts).'_32px.'.implode('.', $iconParts);\n\t\t\t }\n\t\t\t \n\t\t\t if ($groupIcon != '' && !is_file($groupIcon)) {\n\t\t\t \t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t }\n\t\t\t \n\t\t\t // Gruppentemplate parsen\n\t\t\t $this->parserVars = array(\n\t\t \t\t'groupIcon' => $groupIcon,\n\t\t\t\t\t'groupName' => $g['cmt_groupname'],\n\t\t\t\t\t'groupId' => $g['id'],\n\t\t\t\t\t'groupHtml' => $groupHtml,\n\t\t \t\t'groupSelected' => $groupSelected\n\t\t\t \t);\n\t\t\t\t\t\t\n\t\t\t $this->parser->SetMultipleParserVars($this->parserVars);\n\t\t\t $navigation .= $this->parser->parse($this->groupTemplate);\n\t\t\t \n\t\t\t unset($groupHtml);\n\t \t}\n\t }\n\t $this->parser->setParserVar('cmtNavigationGroups', $navigation);\t \n\t return $this->parser->parseTemplate('administration/cmt_navigation.tpl');\n\t}", "public function __buildNavigation(){\n\t\t\t$nav = array();\n\t\t\t$xml = simplexml_load_file(ASSETS . '/navigation.xml');\n\n\t\t\t// Loop over the default Symphony navigation file, converting\n\t\t\t// it into an associative array representation\n\t\t\tforeach($xml->xpath('/navigation/group') as $n){\n\n\t\t\t\t$index = (string)$n->attributes()->index;\n\t\t\t\t$children = $n->xpath('children/item');\n\t\t\t\t$content = $n->attributes();\n\n\t\t\t\t// If the index is already set, increment the index and check again.\n\t\t\t\t// Rinse and repeat until the index is not set.\n\t\t\t\tif(isset($nav[$index])){\n\t\t\t\t\tdo{\n\t\t\t\t\t\t$index++;\n\t\t\t\t\t}while(isset($nav[$index]));\n\t\t\t\t}\n\n\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t'name' => __(strval($content->name)),\n\t\t\t\t\t'index' => $index,\n\t\t\t\t\t'children' => array()\n\t\t\t\t);\n\n\t\t\t\tif(strlen(trim((string)$content->limit)) > 0){\n\t\t\t\t\t$nav[$index]['limit'] = (string)$content->limit;\n\t\t\t\t}\n\n\t\t\t\tif(count($children) > 0){\n\t\t\t\t\tforeach($children as $child){\n\t\t\t\t\t\t$item = array(\n\t\t\t\t\t\t\t'link' => (string)$child->attributes()->link,\n\t\t\t\t\t\t\t'name' => __(strval($child->attributes()->name)),\n\t\t\t\t\t\t\t'visible' => ((string)$child->attributes()->visible == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$limit = (string)$child->attributes()->limit;\n\t\t\t\t\t\tif(strlen(trim($limit)) > 0) $item['limit'] = $limit;\n\n\t\t\t\t\t\t$nav[$index]['children'][] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Build the section navigation, grouped by their navigation groups\n\t\t\t$sections = Symphony::Database()->fetch(\"SELECT * FROM `tbl_sections` ORDER BY `sortorder` ASC\");\n\t\t\tif(is_array($sections) && !empty($sections)){\n\t\t\t\tforeach($sections as $s){\n\n\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $s['navigation_group']);\n\n\t\t\t\t\tif($group_index === false){\n\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\n\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t'name' => $s['navigation_group'],\n\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t'children' => array()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$nav[$group_index]['children'][] = array(\n\t\t\t\t\t\t'link' => '/publish/' . $s['handle'] . '/',\n\t\t\t\t\t\t'name' => $s['name'],\n\t\t\t\t\t\t'type' => 'section',\n\t\t\t\t\t\t'section' => array('id' => $s['id'], 'handle' => $s['handle']),\n\t\t\t\t\t\t'visible' => ($s['hidden'] == 'no' ? 'yes' : 'no')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Loop over all the installed extensions to add in other navigation items\n\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\t\t\tforeach($extensions as $e){\n\t\t\t\t$info = Symphony::ExtensionManager()->about($e);\n\n\t\t\t\tif(isset($info['navigation']) && is_array($info['navigation']) && !empty($info['navigation'])){\n\t\t\t\t\tforeach($info['navigation'] as $item){\n\n\t\t\t\t\t\t$type = (isset($item['children']) ? Extension::NAV_GROUP : Extension::NAV_CHILD);\n\n\t\t\t\t\t\tswitch($type){\n\t\t\t\t\t\t\tcase Extension::NAV_GROUP:\n\n\t\t\t\t\t\t\t\t$index = General::array_find_available_index($nav, $item['location']);\n\n\t\t\t\t\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'index' => $index,\n\t\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tforeach($item['children'] as $child){\n\t\t\t\t\t\t\t\t\tif(!isset($child['relative']) || $child['relative'] == true){\n\t\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$link = '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$nav[$index]['children'][] = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t\t'name' => $child['name'],\n\t\t\t\t\t\t\t\t\t\t'visible' => ($child['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($child['limit']) ? $child['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase Extension::NAV_CHILD:\n\n\t\t\t\t\t\t\t\tif(!isset($item['relative']) || $item['relative'] == true){\n\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($item['link'], '/');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$link = '/' . ltrim($item['link'], '/');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(!is_numeric($item['location'])){\n\t\t\t\t\t\t\t\t\t// is a navigation group\n\t\t\t\t\t\t\t\t\t$group_name = $item['location'];\n\t\t\t\t\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $item['location']);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// is a legacy numeric index\n\t\t\t\t\t\t\t\t\t$group_index = $item['location'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$child = array(\n\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'visible' => ($item['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ($group_index === false) {\n\t\t\t\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\t\t\t\t\t\t\t\t\t// add new navigation group\n\t\t\t\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t\t\t\t'name' => $group_name,\n\t\t\t\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t\t\t\t'children' => array($child),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// add new location by index\n\t\t\t\t\t\t\t\t\t$nav[$group_index]['children'][] = $child;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * After building the Navigation properties array. This is specifically\n\t\t\t * for extensions to add their groups to the navigation or items to groups,\n\t\t\t * already in the navigation. Note: THIS IS FOR ADDING ONLY! If you need\n\t\t\t * to edit existing navigation elements, use the `NavigationPreRender` delegate.\n\t\t\t *\n\t\t\t * @deprecated This delegate is deprecated and will be removed in the next\n\t\t\t * major release of Symphony. Extensions are encouraged to use provide the\n\t\t\t * `fetchNavigation` method instead.\n\t\t\t * @delegate ExtensionsAddToNavigation\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $navigation\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers(\n\t\t\t\t'ExtensionsAddToNavigation', '/backend/', array('navigation' => &$nav)\n\t\t\t);\n\n\t\t\t$pageCallback = Administration::instance()->getPageCallback();\n\n\t\t\t$pageRoot = $pageCallback['pageroot'] . (isset($pageCallback['context'][0]) ? $pageCallback['context'][0] . '/' : '');\n\t\t\t$found = self::__findActiveNavigationGroup($nav, $pageRoot);\n\n\t\t\t// Normal searches failed. Use a regular expression using the page root. This is less\n\t\t\t// efficient and should never really get invoked unless something weird is going on\n\t\t\tif(!$found) self::__findActiveNavigationGroup($nav, '/^' . str_replace('/', '\\/', $pageCallback['pageroot']) . '/i', true);\n\n\t\t\tksort($nav);\n\t\t\t$this->_navigation = $nav;\n\t\t}", "public static function navbar($paramsMap)\n {\n $page = NULL;\n // http://www.zomeoff.com/php-fast-way-to-determine-a-key-elements-existance-in-an-array/\n if (isset($paramsMap['page']) || array_key_exists('page', $paramsMap)) // Si no me lo pasan, tengo que poner el actual.\n $page = $paramsMap['page'];\n else\n throw new Exception(\"El parametro 'page' es obligatorio y no esta presente. \" . __FILE__ . \" \" . __LINE__);\n \n \n $out = '<div class=\"navbar\">';\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName(), 'attrs'=>array('class'=>'active')));\n \n while (($page = $page->getParent()) != NULL)\n {\n // Link no amigable\n //$ps = h('link', array('controller'=>'cms', 'action'=>'displayPage', 'pageId'=>$page->getId(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n \n // Link amigable\n $ps = h('link', array('controller'=>'display', 'action'=>$page->getNormalizedName(), 'body'=>$page->getName())) .' &gt; ' . $ps;\n }\n \n $out .= $ps . '</div>';\n return $out;\n }", "function render_menus($menu, $class) {\n\n\t\tif ( has_nav_menu($menu) ) {\n\t\t?>\n\t\t\t<nav class=\"nav <?= $class; ?>\" role=\"navigation\">\n\t\t\t\t<?php wp_nav_menu(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'theme_location' => $menu ,\n\t\t\t\t\t\t'container' => '' ,\n\t\t\t\t\t\t'link_before' => '<span>' ,\n\t\t\t\t\t\t'link_after' => '</span>' ,\n\t\t\t\t\t)\n\t\t\t\t); ?>\n\t\t\t</nav>\n\t\t\t<!-- /nav -->\n\t\t<?php\n\t\t}\n\t}", "public function buildHeaderNavigation()\n\t{\n\t\t//Reset the current object\n\t\t$this->resetNavigation();\n\n\t\t//Get all pages and child pages\n\t\t$navigation = $this->buildNavHierachy(new UnorderedList());\n\n\t\t//Convert and return\n\t\treturn $navigation->toHtml();\n\t}", "public function renderNav() {\n if($this->renderNav['onoff']) {\n \n if(isset($this->renderNav['html']) && $this->renderNav['html']) {\n $content = $this->renderNav['html'];\n unset($this->renderNav['html']);\n } else {\n $ct['btnAddNav'] = $this->btnAddNav;\n $ct['btnAddMultiNav'] = $this->btnAddMultiNav;\n $ct['btnDeleteNav'] = $this->btnDeleteNav;\n $ct['btnCopyNav'] = $this->btnCopyNav;\n $result = '';\n $get = r()->get();\n foreach($ct as $key => $item) {\n if($item && isset($item['onoff']) && $item['onoff']) {\n unset($item['onoff']);\n if(isset($item['href'])) {\n $href = $item['href'];\n unset($item['href']);\n } else {\n $params = isset($get['SettingsGridSearch']['table_id']) ? $get : [];\n $params['menu_admin_id'] = $this->menu_admin_id;\n $href = UtilityUrl::createUrl($item['link_children'],$params);\n }\n $html = $item['icon'].$item['html'];unset($item['html']);unset($item['icon']);unset($item['link_children']);\n $result .= Html::a($html, $href, $item).' ';\n }\n }\n $content = '<div class=\"fr\">'.$result.'</div>';\n }\n unset($this->renderNav['onoff']);\n $html = Html::tag('div',$content.$this->renderNavLeft, $this->renderNav);\n return $html;\n } else {\n return '';\n }\n }", "public static function navigation_class( $class = '' ) {\n $classes = array( 'navigation page-navigation' );\n\n if ( ! empty( $class ) ) {\n if ( ! is_array( $class ) ) {\n $class = preg_split( '#\\s+#', $class );\n }\n $classes = array_merge( $classes, $class );\n } else {\n // Ensure that we always coerce class to being an array.\n $class = array();\n }\n $classes = apply_filters( 'insight_navigation_class', $classes, $class );\n\n echo 'class=\"' . esc_attr( join( ' ', $classes ) ) . '\"';\n }", "function atg_menu_classes($classes, $item, $args) {\n if($args->theme_location == 'header') {\n $classes[] = 'nav-item';\n }\n return $classes;\n}", "function flatsome_nav_classes($position) {\n $classes[] = null;\n\n if($position == 'main'){\n if(get_theme_mod('nav_style')) $classes[] = 'nav-'.get_theme_mod('nav_style');\n if(get_theme_mod('nav_size')) $classes[] = 'nav-size-'.get_theme_mod('nav_size');\n if(get_theme_mod('nav_spacing')) $classes[] = 'nav-spacing-'.get_theme_mod('nav_spacing');\n if(get_theme_mod('nav_uppercase', 1)){\n $classes[] = 'nav-uppercase';\n }\n }\n\n if($position == 'bottom'){\n if(get_theme_mod('nav_style_bottom')) $classes[] = 'nav-'.get_theme_mod('nav_style_bottom');\n if(get_theme_mod('nav_size_bottom')) $classes[] = 'nav-size-'.get_theme_mod('nav_size_bottom');\n if(get_theme_mod('nav_spacing_bottom')) $classes[] = 'nav-spacing-'.get_theme_mod('nav_spacing_bottom');\n\n if(get_theme_mod('nav_uppercase_bottom', 1)){\n $classes[] = 'nav-uppercase';\n }\n }\n\n if($position == 'top'){\n $classes[] = 'nav-'.get_theme_mod('nav_style_top','divided');\n }\n\n echo implode(\" \", $classes);\n}", "function createNavBar($data, $displayGreeting = false, $helpLink = ''){\n\nglobal $base_url;\n\nprint \"<table width=100% class=\\\"yellowBorder\\\">\";\nprint \"<tr class=\\\"lightYellow\\\"><td width=10%>\"; //<b>NavBar : </b>\";\n\n$items = explode(\"|\", $data);\n\n$array_count = count($items);\n\nfor($i = 0; $i < $array_count; $i++){\n $piece = explode(\":\", $items[$i]);\n\n if($i == $array_count - 1){\n print \"<b>$piece[1]</b>\";\n }\n else{\n print \"<a class=\\\"menuLink\\\" href=\\\"$piece[0]\\\">$piece[1]</a>\";\n print \" > \";\n }\n}\nprint \"</td>\";\n\nif($displayGreeting){\n print \"<td align=center width=80%>\";\n print \"<b>Welcome \" . $_SESSION[\"fullname\"] . \"</b>\";\n print \"</td>\";\n}\n\nprint \"<td width=10% align=\\\"right\\\"><a class=menuLink target=\\\"_blank\\\" href=\\\"$base_url/help.php#$helpLink\\\">Help</a> :: <a class=\\\"menuLink\\\" href=\\\"$base_url/logout.php\\\">logout</a>\";\nprint \"</td></tr></table>\";\n}", "function printItemNavbar( $text, $link, $actual, $index ) {\n\n // seta a classe\n $cl = $index == $actual ? 'active' : '';\n\n // imprime o item\n echo \"<a href='\".site_url( $link ).\"' class='nav-link $cl'>$text</a>\"; \n}", "Public function Anavbar(){\n\t\n\t}", "function internal_generate_navigation() {\n $nav = 'internal_navigation_item';\n\n // Output\n $output = <<<HEREDOC\n<header class=\"global-header\">\n\t<nav>\n\t\t<ul>\n {$nav(\"Home\", \"index.php\")}\n {$nav(\"Cheese Map\", \"map.php\")}\n {$nav(\"Recipes\", \"recipes.php\")}\n {$nav(\"About\", \"about.php\")}\n {$nav(\"Shop\", \"shop.php\")}\n\t\t</ul>\n\t</nav>\n</header>\nHEREDOC;\n\n // Return Output\n echo $output;\n}", "public static function GenerateNavbar($menu)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'id' => null,\n\t\t\t\t'class' => null,\n\t\t\t\t'wrapper' => 'nav',\n\t\t\t\t'create_url' => function ($url) {\n\t\t\t\t\treturn $url;\n\t\t\t\t},\n\t\t\t);\n\t\t\t\n\t\t\t$menu = array_replace_recursive($default, $menu);\n\t\t\t\n\t\t\t// Function to create urls\n\t\t\t$createUrl = $menu['create_url'];\n\t\t\t\n\t\t\t// Create the ul li menu from the array, use an anonomous recursive function that returns an array of values.\n\t\t\t$createMenu = function ($items, $callback) use (&$createMenu, $createUrl) \n\t\t\t{\n\t\t\t\t$html = null;\n\t\t\t\t$hasItemIsSelected = false;\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) \n\t\t\t\t{\n\t\t\t\t\t// has submenu, call recursivly and keep track on if the submenu has a selected item in it.\n\t\t\t\t\t$submenu = null;\n\t\t\t\t\t$selectedParent = null;\n\t\t\t\t\t$hasSubmenu \t= null; \n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['submenu'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$hasSubmenu = \" &#9662;\";\n\t\t\t\t\t\tlist($submenu, $selectedParent) = $createMenu($item['submenu']['items'], $callback);\n\t\t\t\t\t\t$selectedParent = $selectedParent ? \"selected-parent \" : null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['url']))\n\t\t\t\t\t\t// Check if the current menuitem is selected\n\t\t\t\t\t\t$selected = $callback($item['url']) ? \"selected \" : null;\n\t\t\t\t\telse\n\t\t\t\t\t\t$selected = NULL; \n\t\t\t\t\t\n\t\t\t\t\t// Is there a class set for this item, then use it\n\t\t\t\t\t$class = isset($item['class']) && ! is_null($item['class']) ? $item['class'] : null;\n\t\t\t\t\t\n\t\t\t\t\t// Prepare the class-attribute, if used\n\t\t\t\t\t$class = ($selected || $selectedParent || $class) ? \" class='{$selected}{$selectedParent}{$class}' \" : null;\n\t\t\t\t\t\n\t\t\t\t\t// Add the menu item\n\t\t\t\t\t$url = isset($item['url']) ? $createUrl($item['url']) : NULL;\n\t\t\t\t\tif (!isset($item['show']) || $item['show'] == TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($url)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active = (basename($_SERVER['REQUEST_URI']) == $url || (strtok($url,'?') == basename($_SERVER['PHP_SELF']) && $hasSubmenu) ? '' : '');\n\t\t\t\t\t\t\tif ($active == '▸ ') \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($hasSubmenu)\n\t\t\t\t\t\t\t\t\tself::$parent = $item; \n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tself::$child = $item; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>$active<a href='{$url}' title='{$item['title']}'>{$item['text']}{$hasSubmenu}</a>{$submenu}</li>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>{$item['text']}{$hasSubmenu}{$submenu}</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// To remember there is selected children when going up the menu hierarchy\n\t\t\t\t\tif ($selected) {\n\t\t\t\t\t\t$hasItemIsSelected = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return the menu\n\t\t\t\treturn array(\"\\n<ul>$html</ul>\\n\", $hasItemIsSelected);\n\t\t\t};\n\t\t\t\n\t\t\t// Call the anonomous function to create the menu, and submenues if any.\n\t\t\tlist($html, $ignore) = $createMenu($menu['items'], $menu['callback']);\n\t\t\t\n\t\t\t\n\t\t\t// Set the id & class element, only if it exists in the menu-array\n\t\t\t$id = isset($menu['id']) ? \" id='{$menu['id']}'\" : null;\n\t\t\t$class = isset($menu['class']) ? \" class='{$menu['class']}'\" : null;\n\t\t\t$wrapper = $menu['wrapper'];\n\t\t\t\n\t\t\treturn \"\\n<{$wrapper}{$id}{$class}>{$html}</{$wrapper}>\\n\";\n\t\t}", "private function stepNav() {\n $course = $this->step->course;\n\t\t$root = $course->root;\n\t\t$stepUrl = $this->step->url;\n\n\t\t$prev = $this->stepSection->prev;\n\t\t$prevUrl = $prev !== null ? $prev->url : $stepUrl;\n\n\t\t$next = $this->stepSection->next;\n\t\t$nextUrl = $next !== null ? $next->url : $stepUrl;\n\t\t\n\t\t$html = <<<END1\n<div class=\"cl-stepnav-div\"><nav class=\"cl-stepnav cl-nav\"><div><ul>\n<li><a href=\"$stepUrl\"><span>Return to Step Page</span>\n<img alt=\"Return to Step\" width=\"28\" height=\"25\" src=\"$root/vendor/cl/step/img/returnstep.png\" /></a></li>\nEND1;\n\n\t\t// Extra menu items here\n\t\tforeach($this->step->menuExtra as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\n\t\t$html .= <<<HTML\n<li><a href=\"$prevUrl\"><span>Previous Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/previcon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\"><span>Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/nexticon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\" class=\"cl-step-completed-next\"><span>Mark Completed and Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/checknext.png\" width=\"40\" /></a></li>\n<li class=\"cl-step-progress\"></li>\nHTML;\n\n\t\t// Appended menu items here\n\t\tforeach($this->step->menuAppend as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\t\t\n\t\t/*\n\t\t * End of menu bar \n\t\t */\n\t\t$html .= <<<HTML\n</ul></div>\n</nav></div>\nHTML;\n\t\n\t\treturn $html;\n\t}", "function generate_ul_navigation($menu_structure, $current_css_class = \"current\", &$current_tokens = array(), &$parent_output = null) {\n $has_match = false;\n $first_url = null;\n $has_userx_module = \\melt\\core\\module_loaded(\"userx\");\n if ($parent_output === null)\n $output = '<ul class=\"nav\">';\n else\n $output = \"<ul>\";\n foreach ($menu_structure as $label => $path_match) {\n $label = escape($label);\n $match_here = false;\n $child_tree = \"\";\n if (\\is_array($path_match)) {\n list($match_here, $url_here) = generate_ul_navigation($path_match, $current_css_class, $current_tokens, $child_tree);\n } else {\n $match_regex_start = strpos($path_match, \",\");\n $match_regex = substr($path_match, $match_regex_start + 1);\n $match_here = preg_match(\"#$match_regex#\", REQ_URL) == 1;\n $url_here = substr($path_match, 0, $match_regex_start);\n if ($match_here)\n array_merge(array($label), $current_tokens);\n }\n $has_match = $has_match || $match_here;\n if ($has_userx_module && !\\melt\\userx\\RestrictedController::canAccess($url_here, \\melt\\userx\\get_user()))\n continue;\n if ($first_url === null)\n $first_url = $url_here;\n $url_here = url($url_here);\n $current = $match_here? 'class=\"' . $current_css_class . '\"': '';\n $output .= \"<li $current><a href=\\\"$url_here\\\">$label</a>$child_tree</li>\";\n }\n $output .= \"</ul>\";\n if ($parent_output === null)\n return $output;\n $parent_output = $output;\n return array($has_match, $first_url);\n}", "function topbar($menuItem, $navItems)\n{\n\n // Contains the nav bar items\n $navItems = array(\n 'Group Target Setter' => '/blocks/group_targets/view2.php',\n 'Change Target Status' => '/blocks/group_targets/set2.php',\n 'Group Profile' => '/blocks/group_targets/group2.php',\n 'Unit Tracker' => '/blocks/group_targets/tracker2.php',\n// 'Import Feeds' => $siteUrl . '/jobshop/feeds/process_feeds.php',\n// 'View Applications' => $siteUrl . '/jobshop/processing/index.php',\n// 'Featured Jobs' => $siteUrl . '/jobshop/slider/index.php',\n );\n\n echo '<div class=\"noprint\">';\n echo '<div class=\"topbar\">';\n echo '<div class=\"topbar-inner\">';\n echo '<div class=\"container-fluid\">';\n echo '<a class=\"brand\" href=\"#\">Group Target Setter v2.0</a>';\n echo '<ul class=\"nav\">';\n //print_r($navItems);\n foreach ($navItems as $key => $item) {\n\n // echo $key . ' ' . $item;\n\n if ($menuItem != $key) {\n $active = '';\n } elseif ($menuItem == $key) {\n $active = ' class=\"active\"';\n }\n\n echo '<li ', $active, '><a href=\"', $item, '\">', $key, '</a></li>';\n }\n\n echo '</ul>';\n // echo '<p class=\"pull-right\">Logged in as <a href=\"#\">username</a></p>';';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n echo '</div>';\n\n}", "public function create_nav($option) {\n\t\t// <li><a href=\"index.php?navButton=stats\">All Stats</a></li>\n\t\t// will also add class=current to highlight current page on nav bar\n\t\t\n\t\t$array = array(\n\t\t\t\t\"All Stats\" => array(\"index.php?navButton=stats\",\"\"),\n\t\t\t\t\"Guess Game\" => array(\"index.php?navButton=guessgame\",\"\"),\n\t\t\t\t\"Rock Paper Scissors\" => array(\"index.php?navButton=rps\",\"\"),\n\t\t\t\t\"Frogs\" => array(\"index.php?navButton=frogs\",\"\"),\n\t\t\t\t\"Profile\" => array(\"index.php?navButton=profile\",\"\"),\n\t\t\t\t\"Logout\" => array(\"index.php?navButton=logout\",\"\"),\n\t\t);\n\t\tif ($option != \"\") {$array[$option][1] = 'class=\"current\"';}\n\t\t$nav=\"\";\n\t\t$nav .= '<nav>';\n\t\t$nav .= '<ul>';\n\t\tforeach ($array as $key=>$value) {\n\t\t\t\tif ($key == $option) {\n\t\t\t\t\t$nav .= '<li> <a ' . $value[1] . 'href=\"' . $value[0] . '\" style=\"color:gray;\">' . $key . '</a> </li>';\n\t\t\t\t} else {\n\t\t\t\t\t$nav .= '<li> <a ' . $value[1] . 'href=\"' . $value[0] . '\">' . $key . '</a> </li>';\n\t\t\t\t}\n\t\t}\n\n\t\t$nav .= '</ul>';\n\t\t$nav .= '</nav>';\n\t \n\t\techo $nav;\n\t}", "function get_loginbar($menu)\n{\n\t$html = \"<nav class='loginbar'>\";\n\tforeach($menu['items'] as $item)\n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t\n\t\tif(!isset($_SESSION['user']) && $item['url'] == 'logout.php')\n\t\t{\n\t\t}\n\t\telse if(isset($item['url']))\n\t\t{\n\t\t\t$html .= \"<a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\";\n\t\t}\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "protected function renderNavigation( $elements ) {\n\t\tglobal $SearchBar;\n\n\t\t// If only one element was given, wrap it in an array, allowing more\n\t\t// flexible arguments\n\t\tif ( !is_array( $elements ) ) {\n\t\t\t$elements = array( $elements );\n\t\t\t// If there's a series of elements, reverse them when in RTL mode\n\t\t} elseif ( $this->data['rtl'] ) {\n\t\t\t$elements = array_reverse( $elements );\n\t\t}\n\t\t// Render elements\n\t\tforeach ( $elements as $name => $element ) {\n\t\t\tswitch ( $element ) {\n\t\t\t\tcase 'NAMESPACES':\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"p-namespaces\" role=\"navigation\" class=\"vectorTabs<?php\n\t\t\t\t\tif ( count( $this->data['namespace_urls'] ) == 0 ) {\n\t\t\t\t\t\techo ' emptyPortlet';\n\t\t\t\t\t}\n\t\t\t\t\t?>\" aria-labelledby=\"p-namespaces-label\">\n\t\t\t\t\t\t<h5 id=\"p-namespaces-label\"><?php $this->msg( 'namespaces' ) ?></h5>\n\t\t\t\t\t\t<ul<?php $this->html( 'userlangattributes' ) ?>>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $this->data['namespace_urls'] as $link ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li <?php\n\t\t\t\t\t\t\t\techo $link['attributes']\n\t\t\t\t\t\t\t\t?>><span><a href=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['href'] )\n\t\t\t\t\t\t\t\t\t\t?>\" <?php\n\t\t\t\t\t\t\t\t\t\techo $link['key']\n\t\t\t\t\t\t\t\t\t\t?>><?php\n\t\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['text'] )\n\t\t\t\t\t\t\t\t\t\t\t?></a></span></li>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'VARIANTS':\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"p-variants\" role=\"navigation\" class=\"vectorMenu<?php\n\t\t\t\t\tif ( count( $this->data['variant_urls'] ) == 0 ) {\n\t\t\t\t\t\techo ' emptyPortlet';\n\t\t\t\t\t}\n\t\t\t\t\t?>\" aria-labelledby=\"p-variants-label\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t// Replace the label with the name of currently chosen variant, if any\n\t\t\t\t\t\t$variantLabel = $this->getMsg( 'variants' )->text();\n\t\t\t\t\t\tforeach ( $this->data['variant_urls'] as $link ) {\n\t\t\t\t\t\t\tif ( stripos( $link['attributes'], 'selected' ) !== false ) {\n\t\t\t\t\t\t\t\t$variantLabel = $link['text'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<h5 id=\"p-variants-label\"><span><?php echo htmlspecialchars( $variantLabel ) ?></span><a href=\"#\"></a></h5>\n\n\t\t\t\t\t\t<div class=\"menu\">\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $this->data['variant_urls'] as $link ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<li<?php\n\t\t\t\t\t\t\t\t\techo $link['attributes']\n\t\t\t\t\t\t\t\t\t?>><a href=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['href'] )\n\t\t\t\t\t\t\t\t\t\t?>\" lang=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['lang'] )\n\t\t\t\t\t\t\t\t\t\t?>\" hreflang=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['hreflang'] )\n\t\t\t\t\t\t\t\t\t\t?>\" <?php\n\t\t\t\t\t\t\t\t\t\techo $link['key']\n\t\t\t\t\t\t\t\t\t\t?>><?php\n\t\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['text'] )\n\t\t\t\t\t\t\t\t\t\t\t?></a></li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'VIEWS':\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"p-views\" role=\"navigation\" class=\"vectorTabs<?php\n\t\t\t\t\tif ( count( $this->data['view_urls'] ) == 0 ) {\n\t\t\t\t\t\techo ' emptyPortlet';\n\t\t\t\t\t}\n\t\t\t\t\t?>\" aria-labelledby=\"p-views-label\">\n\t\t\t\t\t\t<h5 id=\"p-views-label\"><?php $this->msg( 'views' ) ?></h5>\n\t\t\t\t\t\t<ul<?php\n\t\t\t\t\t\t$this->html( 'userlangattributes' )\n\t\t\t\t\t\t?>>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $this->data['view_urls'] as $link ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<li<?php\n\t\t\t\t\t\t\t\techo $link['attributes']\n\t\t\t\t\t\t\t\t?>><span><a href=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['href'] )\n\t\t\t\t\t\t\t\t\t\t?>\" <?php\n\t\t\t\t\t\t\t\t\t\techo $link['key']\n\t\t\t\t\t\t\t\t\t\t?>><?php\n\t\t\t\t\t\t\t\t\t\t\t// $link['text'] can be undefined - bug 27764\n\t\t\t\t\t\t\t\t\t\t\tif ( array_key_exists( 'text', $link ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo array_key_exists( 'img', $link )\n\t\t\t\t\t\t\t\t\t\t\t\t\t? '<img src=\"' . $link['img'] . '\" alt=\"' . $link['text'] . '\" />'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: htmlspecialchars( $link['text'] );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?></a></span></li>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ACTIONS':\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"p-cactions\" role=\"navigation\" class=\"vectorMenu<?php\n\t\t\t\t\tif ( count( $this->data['action_urls'] ) == 0 ) {\n\t\t\t\t\t\techo ' emptyPortlet';\n\t\t\t\t\t}\n\t\t\t\t\t?>\" aria-labelledby=\"p-cactions-label\">\n\t\t\t\t\t\t<h5 id=\"p-cactions-label\"><span><?php\n\t\t\t\t\t\t\t$this->msg( 'actions' )\n\t\t\t\t\t\t?></span><a href=\"#\"></a></h5>\n\n\t\t\t\t\t\t<div class=\"menu\">\n\t\t\t\t\t\t\t<ul<?php $this->html( 'userlangattributes' ) ?>>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $this->data['action_urls'] as $link ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<li<?php\n\t\t\t\t\t\t\t\t\techo $link['attributes']\n\t\t\t\t\t\t\t\t\t?>>\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php\n\t\t\t\t\t\t\t\t\t\techo htmlspecialchars( $link['href'] )\n\t\t\t\t\t\t\t\t\t\t?>\" <?php\n\t\t\t\t\t\t\t\t\t\techo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] )\n\t\t\t\t\t\t\t\t\t\t\t?></a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'PERSONAL':\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"p-personal\" role=\"navigation\" class=\"<?php\n\t\t\t\t\tif ( count( $this->data['personal_urls'] ) == 0 ) {\n\t\t\t\t\t\techo ' emptyPortlet';\n\t\t\t\t\t}\n\t\t\t\t\t?>\" aria-labelledby=\"p-personal-label\">\n\t\t\t\t\t\t<h5 id=\"p-personal-label\"><?php $this->msg( 'personaltools' ) ?></h5>\n\t\t\t\t\t\t<ul<?php $this->html( 'userlangattributes' ) ?>>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $this->mPersonalTools;\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'SEARCH':\n\t\t\t\t\t?>\n\t\t\t\t\t<?php if ( $SearchBar ): ?>\n\t\t\t\t\t<div id=\"p-search\" role=\"search\">\n\t\t\t\t\t\t<h5<?php $this->html( 'userlangattributes' ) ?>>\n\t\t\t\t\t\t\t<label for=\"searchInput\"><?php $this->msg( 'search' ) ?></label>\n\t\t\t\t\t\t</h5>\n\n\t\t\t\t\t\t<form action=\"<?php $this->text( 'wgScript' ) ?>\" id=\"searchform\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $this->config->get( 'VectorUseSimpleSearch' ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div id=\"simpleSearch\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $this->makeSearchInput( array( 'id' => 'searchInput' ) );\n\t\t\t\t\t\t\techo Html::hidden( 'title', $this->get( 'searchtitle' ) );\n\t\t\t\t\t\t\t// We construct two buttons (for 'go' and 'fulltext' search modes),\n\t\t\t\t\t\t\t// but only one will be visible and actionable at a time (they are\n\t\t\t\t\t\t\t// overlaid on top of each other in CSS).\n\t\t\t\t\t\t\t// * Browsers will use the 'fulltext' one by default (as it's the\n\t\t\t\t\t\t\t// first in tree-order), which is desirable when they are unable\n\t\t\t\t\t\t\t// to show search suggestions (either due to being broken or\n\t\t\t\t\t\t\t// having JavaScript turned off).\n\t\t\t\t\t\t\t// * The mediawiki.searchSuggest module, after doing tests for the\n\t\t\t\t\t\t\t// broken browsers, removes the 'fulltext' button and handles\n\t\t\t\t\t\t\t// 'fulltext' search itself; this will reveal the 'go' button and\n\t\t\t\t\t\t\t// cause it to be used.\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'fulltext',\n\t\t\t\t\t\t\t\tarray( 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'go',\n\t\t\t\t\t\t\t\tarray( 'id' => 'searchButton', 'class' => 'searchButton' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t<div id=\"p-searchSearch\" role=\"search\">\n\t\t\t\t\t\t<h5<?php $this->html( 'userlangattributes' ) ?>>\n\t\t\t\t\t\t\t<label for=\"searchInput\"><?php $this->msg( 'search' ) ?></label>\n\t\t\t\t\t\t</h5>\n\n\t\t\t\t\t\t<form action=\"<?php $this->text( 'wgScript' ) ?>\" id=\"searchform\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( $this->config->get( 'VectorUseSimpleSearch' ) ) {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div id=\"simpleSearchSearch\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $this->makeSearchInput( array( 'id' => 'searchInput' ) );\n\t\t\t\t\t\t\techo Html::hidden( 'title', $this->get( 'searchtitle' ) );\n\t\t\t\t\t\t\t// We construct two buttons (for 'go' and 'fulltext' search modes),\n\t\t\t\t\t\t\t// but only one will be visible and actionable at a time (they are\n\t\t\t\t\t\t\t// overlaid on top of each other in CSS).\n\t\t\t\t\t\t\t// * Browsers will use the 'fulltext' one by default (as it's the\n\t\t\t\t\t\t\t// first in tree-order), which is desirable when they are unable\n\t\t\t\t\t\t\t// to show search suggestions (either due to being broken or\n\t\t\t\t\t\t\t// having JavaScript turned off).\n\t\t\t\t\t\t\t// * The mediawiki.searchSuggest module, after doing tests for the\n\t\t\t\t\t\t\t// broken browsers, removes the 'fulltext' button and handles\n\t\t\t\t\t\t\t// 'fulltext' search itself; this will reveal the 'go' button and\n\t\t\t\t\t\t\t// cause it to be used.\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'fulltext',\n\t\t\t\t\t\t\t\tarray( 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'go',\n\t\t\t\t\t\t\t\tarray( 'id' => 'searchButton', 'class' => 'searchButton' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?> \n\t\t\t\t\t<?php\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private function menuAssemble($links_dependency, $links_data, $index=0)\n {\n $html=\"\";\n foreach ($links_dependency[$index] as $element) {\n $index == 0 ? $class = \"top\" : $class = \"item\";\n\n // check $link[0][0] has any children\n if(array_key_exists($element, $links_dependency))\n {\n $index == 0 ? $class = \"top\" : $class = \"with-item\";\n $html .= '<li class=\"dropdown '.$class.' \">';\n $html .= '<span class=\"triangle\"></span><a href=\"\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">'.$links_data[$element][\"title\"].'</a>';\n $html .= '<ul class=\"dropdown-menu\" role=\"menu\">';\n $html .= menuAssemble($links_dependency, $links_data, $element);\n }else{\n $html .= '<li class=\"'.$class.'\"><span class=\"triangle\"></span><a href=\"'.route($links_data[$element]['url']).'\">'.$links_data[$element][\"title\"].'</a>';\n }\n $html .= \"</li>\";\n }\n $html .= '</ul>';\n\n return $html;\n }", "function _navSetup()\n\t{\n\t\t// get the path to the current page\n\t\t$this->path = $this->getPath($this->area, $this->page);\n\t\t\n\t\t// reset the navigational elements\n\t\t$this->nav = array();\n\t\t\n\t\t// we use the view URL a lot\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'wikilink', 'view_url');\n\t\t\n\t\t// is there a path? (if not, the page is not on the map)\n\t\tif (count($this->path) > 0) {\n\t\t\t\n\t\t\t// get nav elements leading to this page...\n\t\t\tforeach ($this->path as $key => $val) {\n\t\t\t\t\t\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\n\t\t\t\t\t// get the map tops\n\t\t\t\t\t$this->nav[$key] = $this->_tops($val, $view_url);\n\t\t\t\t\t\n\t\t\t\t} elseif (isset($this->path[$key-1])) {\n\t\t\t\t\n\t\t\t\t\t// get children\n\t\t\t\t\t$prev_page = $this->path[$key-1];\n\t\t\t\t\t$this->nav[$key] = $this->_kids($prev_page, $val, $view_url);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// and get the first nav element below this page.\n\t\t\t$prev_page = $val;\n\t\t\t$this->nav[$key+1] = $this->_kids($prev_page, $this->page,\n\t\t\t\t$view_url, true);\n\t\t\t\n\t\t} else {\n\n\t\t\t// Set the nav element to the top level page list for the area, so\n\t\t\t// that the list of top level pages is shown even if we move outside\n\t\t\t// the area map.\n\t\t\t$this->nav[0] = $this->_tops(\"\", $view_url);\n\t\t}\n\t\t\t\n\t\t\n\t\t// nav to AreaMap, edit, history, and links\n\t\t$this->nav['map'] =\tsprintf($view_url, 'AreaMap');\n\t\t$this->nav['history'] = sprintf($view_url, $this->page) . '&view=history';\n\t\t$this->nav['links'] = sprintf($view_url, $this->page) . '&view=links';\n\t\t$this->nav['source'] = sprintf($view_url, $this->page) . '&view=source';\n\t\t$this->nav['rss'] = sprintf($this->conf['absolute_url'].\"rss.php?area=%s&page=%s\", $this->area, $this->page);\n\t\t$this->nav['edit'] = sprintf($this->conf['absolute_url'].\"edit.php?area=%s&page=%s\", $this->area, $this->page);\n\t}", "function bread_crumps($css_class)\n { \n if(isset($_SERVER['PATH_INFO'])){\n $breadCrumps = explode(\"/\",$_SERVER['PATH_INFO']);\n \n $breadcrumpUI = \"<ol class='\".$css_class.\"'>\";\n \n for($i = 0; $i < count($breadCrumps); $i++){\n if($breadCrumps[$i] != ''){\n $url = get_merge_string_array($breadCrumps,0,$i,'/');\n $isLast = ($i == (count($breadCrumps)-1)) ? 'class=\"active\"' : '';\n $text = str_replace('_',' ', $breadCrumps[$i]);\n $isLastUrl = ($i == (count($breadCrumps)-1)) ? ucfirst($text) : \"<a href='\".base_url($url).\"'>\".ucfirst($text). \"</a>\";\n $breadcrumpUI .= \"<li \".$isLast.\" >\".$isLastUrl.\"</li>\";\n } /*else {\n $breadcrumpUI .= \"<li><a href='\". base_url() .\"'>Home</a></li>\";\n }*/\n }\n \n $breadcrumpUI .= \"</ol>\";\n \n echo $breadcrumpUI;\n }\n }", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "protected function bootstrapNavs(array $items, ?string $class, ?bool $stacked): string {\n\n $attributes = [\n \"class\" => [\n \"nav\",\n $class,\n true === $stacked ? \"nav-stacked\" : null,\n ],\n ];\n\n $innerHTML = [];\n foreach ($items as $current) {\n $innerHTML[] = $this->bootstrapNav($current);\n }\n\n return static::coreHtmlElement(\"ul\", \"\\n\" . implode(\"\\n\", $innerHTML) . \"\\n\", $attributes);\n }", "public function getMenu()\n{\n $lang=$this->translation;\n foreach($this->_headerMenu as $hmenukey => $hmenu){\n foreach($hmenu as $hkey=>$hval){\n $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey);\n }\n }\n $auth = $this->session->get('auth');\n if ($auth) {\n $this->_headerMenu['navbar-right']['oturum'] = array(\n 'caption' => $lang->_('logout'),\n 'action' => 'bitir'\n );\n\n } else {\n unset($this->_headerMenu['navbar-left']['islemler']);\n unset($this->_headerMenu['navbar-left']['r4t']);\n unset($this->_headerMenu['navbar-left']['hesap']);\n }\n\n $controllerName = $this->view->getControllerName();\n foreach ($this->_headerMenu as $position => $menu) {\n echo '<div class=\"nav-collapse\">';\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\n foreach ($menu as $controller => $option) {\n if ($controllerName == $controller) {\n echo '<li class=\"active\">';\n } else {\n echo '<li>';\n }\n if ($controller=='admin'){\n if(($auth) and ($auth['auth']==0)){\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }}else{\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }\n echo '</li>';\n }\n\n echo '</ul>';\n echo '</div>';\n }\n\n }", "function ppNavbar ($menuitems, $selected='', $parms='') {\n global $_CONF;\n\n $navbar = new Template($_CONF['path_layout'] . 'navbar');\n $navbar->set_file (array (\n 'navbar' => 'navbar.thtml',\n 'menuitem' => 'menuitem.thtml',\n ));\n $navbar->set_var ('xhtml', XHTML);\n for ($i=1; $i <= count($menuitems); $i++) {\n $parms = explode( \"=\",current($menuitems) );\n $navbar->set_var( 'link', current($menuitems));\n if (key($menuitems) == $selected) {\n $navbar->set_var( 'cssactive', 'id=\"active\"');\n $navbar->set_var( 'csscurrent','id=\"current\"');\n } else {\n $navbar->set_var( 'cssactive', '');\n $navbar->set_var( 'csscurrent','');\n }\n $navbar->set_var( 'label', key($menuitems));\n $navbar->parse( 'menuitems', 'menuitem', true );\n next($menuitems);\n }\n $navbar->parse ('output', 'navbar');\n $retval = $navbar->finish($navbar->get_var('output'));\n return $retval;\n}", "public static function navigation(array $navigation = NULL, $user = NULL, $current_controller = NULL)\n\t{\n\t\t$navigation = $navigation ?: Kohana::$config->load('jam-tart.navigation');\n\t\t$user = $user ?: Auth::instance()->get_user();\n\n\t\tif ( ! $current_controller AND Request::initial())\n\t\t{\n\t\t\t$current_controller = Request::initial()->controller();\n\t\t}\n\n\t\treturn Tart::html(NULL, function($h) use ($navigation, $user, $current_controller) {\n\t\t\t$h('div.navbar.navbar-inverse.navbar-fixed-top', function($h) use ($navigation, $user, $current_controller) {\n\t\t\t\t$h('div.navbar-inner', function($h) use ($navigation, $user, $current_controller) {\n\t\t\t\t\t$h('div.container-fluid', function($h) use ($navigation, $user, $current_controller) {\n\t\t\t\t\t\t$h('button', array('class' => 'btn btn-navbar collapsed', 'data-toggle' => 'collapse', 'data-target' => '.nav-collapse'), function($h){\n\t\t\t\t\t\t\t$h('span.icon-bar', ' ');\n\t\t\t\t\t\t\t$h('span.icon-bar', ' ');\n\t\t\t\t\t\t\t$h('span.icon-bar', ' ');\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$h('a', array('class' => 'brand', 'href' => Tart::uri()), 'Admin');\n\t\t\t\t\t\t$h('div.nav-collapse.collapse', function($h) use ($navigation, $user, $current_controller) {\n\t\t\t\t\t\t\t$h('ul.nav', function($h) use ($navigation, $user, $current_controller) {\n\t\t\t\t\t\t\t\tforeach ($navigation as $controller => $name)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (is_array($name))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_filter(array_map(function($controller) use ($user) { return Tart::user_allowed(Tart::uri($controller), $user);}, array_keys($name))))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$h('li', array('class' => 'dropdown '.(array_key_exists($current_controller, $name) ? 'active' : '')), function($h) use ($controller, $current_controller, $user, $name) {\n\t\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => '#', 'class' => 'dropdown-toggle', 'data-toggle' => 'dropdown'), $controller.' <b class=\"caret\"></b>');\n\n\t\t\t\t\t\t\t\t\t\t\t\t$h('ul.dropdown-menu', function($h) use ($controller, $name, $user, $current_controller) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($name as $controller => $name)\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\tif (Tart::user_allowed(Tart::uri($controller), $user))\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$h('li', array('class' => ($current_controller === $controller) ? 'active' : NULL), function($h) use ($controller, $name) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => Tart::uri($controller)), $name);\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}\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telseif (Tart::user_allowed(Tart::uri($controller), $user))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$h('li', array('class' => ($current_controller === $controller) ? 'active' : NULL), function($h) use ($controller, $name) {\n\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => Tart::uri($controller)), $name);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif ($user)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$h('div.pull-right', function($h) use ($user) {\n\t\t\t\t\t\t\t\t\t$h('ul.nav.pull-right', function($h) use ($user) {\n\t\t\t\t\t\t\t\t\t\t$h('li.dropdown', function($h) use ($user) {\n\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => '#', 'class' => 'dropdown-toggle', 'data-toggle' => 'dropdown'), $user->name().' <b class=\"caret\"></b>');\n\n\t\t\t\t\t\t\t\t\t\t\t$h('ul.dropdown-menu', function($h) use ($user) {\n\t\t\t\t\t\t\t\t\t\t\t\t$h('li', function($h) use ($user) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => Tart::uri($user)), '<i class=\"icon-cog\"></i> Preferences');\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$h('li.divider');\n\t\t\t\t\t\t\t\t\t\t\t\t$h('li', function($h) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$h('a', array('href' => Tart::uri('session', 'destroy')), '<i class=\"icon-off\"></i> Logout');\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t})->render();\n\t}", "public function formNavBar(){\n $lang = 'en'; //<--- Assessment 1: 2 - Basic variable type, scope (only accessible in this method)\n if($this->locale === 'hi'){\n $lang = 'hi';\n }\n echo \"<div class='ui inverted menu'>\n <a class='\".$this->home.\" item'\n href='../../pages/landingPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"Home\"].\n \"</a>\n <a class='\".$this->viewPosts.\" item' \n href='../../pages/viewAllPosts/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"View-Posts\"].\n \"</a>\n <a class='\".$this->myPosts.\" item' \n href='../../pages/viewUserPosts/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"User-Posts\"].\n \"</a>\n <a class='\".$this->newPost.\" item' \n href='../../pages/newPost/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"New-Post\"].\n \"</a>\n <div class='right menu'>\";\n\n\n if($this->session==='Login')\n {\n echo \"<a class='\".$this->login.\" item'\n href='../../pages/loginPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][$this->session].\n \"</a>\";\n }\n else {\n echo \"<a class='\".$this->login.\" item'\n href='?logout=1'>\".\n $this->ini_array[$this->locale][$this->session].\n \"</a>\";\n }\n\n\n if(!(isset($_SESSION['loggedIn'])&&($_SESSION['loggedIn']))){\n echo \"<a class='\".$this->register.\" item' \n href='../../pages/registrationPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"Register\"].\n \"</a>\";\n }\n echo \"</div>\n </div>\";\n }", "function displayNav() {\n\t\t\n\t\t$menu = getList(0);\n\t\t$count = 1;\n\t\t$nav = preg_replace('/xx/', 'nav', $menu, $count);\n\t\treturn $nav;\n\t\t\n\t\t\n\t}", "public function nav()\n\t{\n\t\t$nav['dashboard'] = array('name' => Blocks::t('Dashboard'));\n\t\t$nav['content'] = array('name' => Blocks::t('Content'));\n\t\t$nav['assets'] = array('name' => Blocks::t('Assets'));\n\n\t\tif (Blocks::hasPackage(BlocksPackage::Users) && blx()->userSession->checkPermission('editUsers'))\n\t\t{\n\t\t\t$nav['users'] = array('name' => Blocks::t('Users'));\n\t\t}\n\n\t\t// Add any Plugin nav items\n\t\t$plugins = blx()->plugins->getPlugins();\n\n\t\tforeach ($plugins as $plugin)\n\t\t{\n\t\t\tif ($plugin->hasCpSection())\n\t\t\t{\n\t\t\t\t$lcHandle = strtolower($plugin->getClassHandle());\n\t\t\t\t$nav[$lcHandle] = array('name' => $plugin->getName());\n\n\t\t\t\t// Does the plugin have an icon?\n\t\t\t\t$resourcesPath = blx()->path->getPluginsPath().$lcHandle.'/resources/';\n\n\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-16x16.png'))\n\t\t\t\t{\n\t\t\t\t\t$nav[$lcHandle]['hasIcon'] = true;\n\n\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-16x16.png');\n\t\t\t\t\tblx()->templates->includeCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\n\t\t\t\t\t// Does it even have a hi-res version?\n\t\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-32x32.png'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-32x32.png');\n\t\t\t\t\t\tblx()->templates->includeHiResCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->checkPermission('autoUpdateBlocks'))\n\t\t{\n\t\t\t$numberOfUpdates = blx()->updates->getTotalNumberOfAvailableUpdates();\n\n\t\t\tif ($numberOfUpdates > 0)\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'), 'badge' => $numberOfUpdates);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'));\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->isAdmin())\n\t\t{\n\t\t\t$nav['settings'] = array('name' => Blocks::t('Settings'));\n\t\t}\n\n\t\treturn $nav;\n\t}", "function ve_get_header_navigation() {\n?>\n<ul class=\"nav navbar-nav\">\n\t<li><a href=\"<?php echo home_url() ?>\">Front page <span class=\"sr-only\">(current)</span></a></li>\n\t<li class=\"dropdown\">\n\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Companies <span class=\"caret\"></span></a>\n\t\t<ul class=\"dropdown-menu purple\">\n\t\t\t<?php ve_get_company_navigation() ?>\n\t\t</ul>\n\t<li class=\"dropdown\">\n\t <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Partnership <span class=\"caret\"></span></a>\n\t <ul class=\"dropdown-menu turquoise\">\n\t\t<?php ve_get_group_of_companies_navigation() ?>\n\t </ul>\n\t</li>\n</ul>\n<?php\n}", "function create_archive_nav_menu($arr) {\n // start the html\n $html = '<nav id=\"archmenuWP\">';\n $html .= '<ul class=\"archlev1 archmenu_list_years\" id=\"archmenu\">';\n $years = array_keys($arr);\n\t \n foreach($years as $y) {\n\t \n $html .= '<li id=\"archmenu_li_y_' . $y . '\">';\n $html .= make_link($y . ' (' . $arr[$y]['count'] . ')', make_url($y.'/'));\n $html .= '<span class=\"archmenu_ty archToggleButton\" id=\"archmenu_ty_' . $y . '\">+</span>'; // handle clicks with JS\n $html .= '</li>';\n unset($arr[$y]['count']);\n\t \n $months = array_keys($arr[$y]);\n $html .= '<ul class=\"archlev2 archmenu_list_months hidden\" id=\"archmenu_y_' . $y . '\">';\n\t \n foreach($months as $m) {\n\t$html .= '<li id=\"archmenu_li_y_' . $y . '_m_' . $m . '\">';\n\t$html .= make_link(monthname($m) . ' (' . $arr[$y][$m]['count'] . ')', make_url($y.'/'.$m.'/'));\n\t$html .= '<span class=\"archmenu_tm archToggleButton\" id=\"archmenu_ty_' . $y . '_tm_' . $m . '\">+</span>'; // handle clicks with JS\n\t$html .= '</li>';\n\tunset($arr[$y][$m]['count']);\n\t \n\t$entries = $arr[$y][$m];\n\t$html .= '<ul class=\"archlev3 archmenu_list_titles hidden\" id=\"archmenu_y_' . $y . '_m_' . $m . '\">';\n\tforeach($entries as $id => $entry) {\n\t\t\n\t $html .= '<li id=\"archmenu_li_id_' . str_replace('/','-',$id) . '\">'; # replace slashes with hyphens for id\n\t $html .= make_link($entry['title'], make_url($id));\n\t $html .= '</li>';\n\t}\n\t$html .= '</ul>';\n }\n $html .= '</ul>';\n }\n $html .= '</ul></nav>';\n return $html;\n }", "function makeNav($conn, $loggedIn, $thisPagename){\n $sql = \"SELECT pagename, pagetitle FROM test.navigation\";\n $result = $conn->query($sql);\n\n if($loggedIn == \"logged in\"){\n $loggedInClass = \"loggedin\";\n } else {\n $loggedInClass = \"notloggedin\";\n }\n\n echo \"<ul class='\" . $loggedInClass . \"'>\";\n\n // outputs the rows of results from the navigation,\n // setting the active variable for the page that is active\n while ( $row = $result->fetch_assoc() ) {\n if ( $thisPagename == $row['pagename']){\n $active = \"active\";\n } else {\n $active = \"\";\n }\n\n echo \"<li class='\" . $active . \"''><a href='\" . $row['pagename'] . \"'>\" .$row['pagetitle']. \"</a></li>\";\n }\n\n // Outputs the login links\n if ($loggedIn == \"not logged in\"){\n echo \"<li><a href='login.php'>Log In</a></li>\";\n } else {\n echo \"<li><a href='logout.php'>Log Out \" . $_SESSION[\"realname\"] . \"</a></li>\";\n }\n echo \"</ul>\";\n }", "function get_custom_menu($name, $classes = array()) {\n $menu = new CustomMenuDisplay($name, $classes);\n $menu->displayMenu();\n}", "public function execute() {\n\t\tglobal $Logoshow;\n\t\tglobal $SearchBar;\n\n\t\t// Build additional attributes for navigation urls\n\t\t$nav = $this->data['content_navigation'];\n\n\t\tif ( $this->config->get( 'VectorUseIconWatch' ) ) {\n\t\t\t$mode = $this->getSkin()->getUser()->isWatched( $this->getSkin()->getRelevantTitle() )\n\t\t\t\t? 'unwatch'\n\t\t\t\t: 'watch';\n\n\t\t\tif ( isset( $nav['actions'][$mode] ) ) {\n\t\t\t\t$nav['views'][$mode] = $nav['actions'][$mode];\n\t\t\t\t$nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' );\n\t\t\t\t$nav['views'][$mode]['primary'] = true;\n\t\t\t\tunset( $nav['actions'][$mode] );\n\t\t\t}\n\t\t}\n\n\t\t$xmlID = '';\n\t\tforeach ( $nav as $section => $links ) {\n\t\t\tforeach ( $links as $key => $link ) {\n\t\t\t\tif ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) {\n\t\t\t\t\t$link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' );\n\t\t\t\t}\n\n\t\t\t\t$xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID;\n\t\t\t\t$nav[$section][$key]['attributes'] =\n\t\t\t\t\t' id=\"' . Sanitizer::escapeId( $xmlID ) . '\"';\n\t\t\t\tif ( $link['class'] ) {\n\t\t\t\t\t$nav[$section][$key]['attributes'] .=\n\t\t\t\t\t\t' class=\"' . htmlspecialchars( $link['class'] ) . '\"';\n\t\t\t\t\tunset( $nav[$section][$key]['class'] );\n\t\t\t\t}\n\t\t\t\tif ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tLinker::tooltip( $xmlID );\n\t\t\t\t} else {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tXml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->data['namespace_urls'] = $nav['namespaces'];\n\t\t$this->data['view_urls'] = $nav['views'];\n\t\t$this->data['action_urls'] = $nav['actions'];\n\t\t$this->data['variant_urls'] = $nav['variants'];\n\n\t\t// Reverse horizontally rendered navigation elements\n\t\tif ( $this->data['rtl'] ) { \n\t\t\t$this->data['view_urls'] =\n\t\t\t\tarray_reverse( $this->data['view_urls'] );\n\t\t\t$this->data['namespace_urls'] =\n\t\t\t\tarray_reverse( $this->data['namespace_urls'] );\n\t\t\t$this->data['personal_urls'] =\n\t\t\t\tarray_reverse( $this->data['personal_urls'] );\n\t\t}\n\t\t$personalTools = $this->getPersonalTools();\n\t\tforeach ( $personalTools as $key => $item ) {\n\t\t\tif ( $key !== 'notifications' ) {\n\t\t\t\t$this->mPersonalTools .= $this->makeListItem( $key, $item );\n\t\t\t} else {\n\t\t\t\t$this->mPersonalToolsEcho .= $this->makeListItem( $key, $item );\n\t\t\t}\n\t\t}\n\t\t// Output HTML Page\n\t\t$this->html( 'headelement' );\n?>\n <style>\n body {\nheight:100%;\n }\n html {\nheight:100%;\n }\n\t\thtml,\n\t\tbody {\n\t\t\tmargin: 0px 0px 0px 0px ;\n\t\t\tpadding: 0px 0px 0px 0px ;\nheight:100%;\n\t\t\t}\n\t\t#top-tile-bar {\n\t\t\tbackground:transparent ;\n\t\t\tleft: 0px ;\n\t\t\theight: 200px;\n\t\t\tposition: fixed ;\n\t\t\tz-index:100 ;\n\t\t\t}\n.tilebar {\nposition: fixed;\nleft: 0px;\ntop: 0px;\nright: 0px;\nbottom: 0px;\nalign:right;\ncolor:#fff;background:#1D1D1D;width:100%;height:400px;\ndisplay:block;\nz-index:102;\n}\n.tile:hover {\n outline: 3px #4A4A4A solid;\n}\n.onhoverbg:hover {\n background: #9F6F40;\n}\n.topleft {\n display: inline;\n position: relative;\n }\n .topright .hover {\n display: none;\n position: absolute;\n left:0;\n z-index: 2000;\n\theight:200px;\n }\n </style>\n\n <script>\nvar openDiv;\nfunction toggleDiv(divID) {\n $(\"#\" + divID).fadeToggle(150, function() {\n openDiv = $(this).is(':visible') ? divID : null;\n });\n}\n$(document).click(function(e) {\n if (!$(e.target).closest('#'+openDiv).length) {\n toggleDiv(openDiv);\n }\n});\n$(function () {\n $('.usermenu > div').toggleClass('no-js js');\n $('.usermenu .js div').hide();\n $('.usermenu .js').click(function(e) {\n $('.usermenu .js div').fadeToggle(150);\n $('.usermenu').toggleClass('active');\n e.stopPropagation();\n });\n $(document).click(function() {\n if ($('.usermenu .js div').is(':visible')) {\n $('.usermenu .js div', this).fadeOut(150);\n $('.usermenu').removeClass('active');\n }\n });\n});\n\n$(function () {\n $('.actionmenu > div').toggleClass('no-js js');\n $('.actionmenu .js div').hide();\n $('.actionmenu .js').click(function(e) {\n $('.actionmenu .js div').fadeToggle(150);\n $('.clicker').toggleClass('active');\n e.stopPropagation();\n });\n $(document).click(function() {\n if ($('.actionmenu .js div').is(':visible')) {\n $('.actionmenu .js div', this).fadeOut(150);\n $('.clicker').removeClass('active');\n }\n });\n});\n </script>\n<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:700' defer=\"defer\" rel='stylesheet' type='text/css'>\n<meta name=\"msapplication-TileImage\" content=\"http://www.pidgi.net/new/public/images/pidgiwiki.png\"/>\n<meta name=\"msapplication-TileColor\" content=\"#BE0027\"/>\n<script src=\"http://files.pidgi.net/overthrow.js\"></script>\n\t\t<div id=\"mw-page-base\" class=\"noprint\"></div>\n\t\t<div id=\"mw-head-base\" class=\"noprint\"></div>\n\t\t<div id=\"content\" class=\"mw-body\" class=\"overthrow\" role=\"main\">\n\t\t\t<a id=\"top\"></a>\n\n\t\t\t<?php\n\t\t\tif ( $this->data['sitenotice'] ) {\n\t\t\t\t?>\n\t\t\t\t<div id=\"siteNotice\"><?php $this->html( 'sitenotice' ) ?></div>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<h1 id=\"firstHeading\" class=\"firstHeading\" lang=\"<?php\n\t\t\t$this->data['pageLanguage'] =\n\t\t\t\t$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();\n\t\t\t$this->text( 'pageLanguage' );\n\t\t\t?>\"><span dir=\"auto\"><?php $this->html( 'title' ) ?></span></h1>\n\t\t\t<?php $this->html( 'prebodyhtml' ) ?>\n\t\t\t<div id=\"bodyContent\" class=\"mw-body-content\">\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['isarticle'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"siteSub\"><?php $this->msg( 'tagline' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div id=\"contentSub\"<?php\n\t\t\t\t$this->html( 'userlangattributes' )\n\t\t\t\t?>><?php $this->html( 'subtitle' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['undelete'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"contentSub2\"><?php $this->html( 'undelete' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['newtalk'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"usermessage\"><?php $this->html( 'newtalk' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div id=\"jump-to-nav\" class=\"mw-jump\">\n\t\t\t\t\t<?php $this->msg( 'jumpto' ) ?>\n\t\t\t\t\t<a href=\"#mw-navigation\"><?php\n\t\t\t\t\t\t$this->msg( 'jumptonavigation' )\n\t\t\t\t\t\t?></a><?php\n\t\t\t\t\t$this->msg( 'comma-separator' )\n\t\t\t\t\t?>\n\t\t\t\t\t<a href=\"#p-search\"><?php $this->msg( 'jumptosearch' ) ?></a>\n\t\t\t\t</div>\n\t\t\t\t<?php $this->html( 'bodycontent' ) ?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['printfooter'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"printfooter\">\n\t\t\t\t\t\t<?php $this->html( 'printfooter' ); ?>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['catlinks'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->html( 'catlinks' );\n\t\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n<br clear=\"all\" />\n\t\t<div id=\"footer\" role=\"contentinfo\"<?php $this->html( 'userlangattributes' ) ?>>\n<hr />\n\t\t\t<?php\n\t\t\tforeach ( $this->getFooterLinks() as $category => $links ) {\n\t\t\t\t?>\n\t\t\t\t<ul id=\"footer-<?php\n\t\t\t\techo $category\n\t\t\t\t?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $links as $link ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li id=\"footer-<?php\n\t\t\t\t\t\techo $category\n\t\t\t\t\t\t?>-<?php\n\t\t\t\t\t\techo $link\n\t\t\t\t\t\t?>\"><?php\n\t\t\t\t\t\t\t$this->html( $link )\n\t\t\t\t\t\t\t?></li>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php $footericons = $this->getFooterIcons( \"icononly\" );\n\t\t\tif ( count( $footericons ) > 0 ) {\n\t\t\t\t?>\n\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $footericons as $blockName => $footerIcons ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li id=\"footer-<?php\n\t\t\t\t\t\techo htmlspecialchars( $blockName ); ?>ico\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $footerIcons as $icon ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo $this->getSkin()->makeFooterIcon( $icon );\n\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<div style=\"clear:both\"></div>\n\t\t</div>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['dataAfterContent'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->html( 'dataAfterContent' );\n\t\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div class=\"visualClear\"></div>\n\t\t\t\t<?php $this->html( 'debughtml' ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"mw-navigation\">\n\t\t\t<h2><?php $this->msg( 'navigation-heading' ) ?></h2>\n\n\t\t<div id=\"mw-head\">\n\t\t\t<div class=\"vectorMenu\" style=\"float:right;background-image:none;vertical-align:middle;height:40px;padding-left:10px;padding-right:10px;position:relative;top:0px;right:10px;width:auto;text-align:right;\">\n<a href=\"#\" style=\"text-decoration:none;\"><span id=\"username-top\"><?php\nif ($_SERVER[\"REMOTE_ADDR\"] == htmlspecialchars($this->getSkin()->getUser()->getName())) {\necho \"Guest\";\n}\nelse {\necho htmlspecialchars( $this->getSkin()->getUser()->getName() );\n}\n ?><span style=\"word-spacing:4px;\"> </span><img style=\"position:relative;top:-1px;\" src=\"<?php\n$default = 'http://www.pidgi.net/wiki/skins/metrolook/images/user-icon.png';\n$grav_url = 'http://www.gravatar.com/avatar/' . md5( strtolower( trim( $this->getSkin()->getUser()->getEmail() ) ) ) . '?d=' . urlencode ( $default ) . '&s=' . 20;\necho $grav_url;\n?>\" /></span></a>\n<div class=\"menu\" style=\"position:absolute;top:40px;right:0px;margin:0;width:200px;\">\n<?php $this->renderNavigation( 'PERSONAL' ); ?>\n</div>\n</div>\n<div id=\"echoNotifications\">\n\t<ul>\n\t<?php\n\t\techo $this->mPersonalToolsEcho;\n\t?>\n\t</ul>\n</div>\n<div style=\"padding-left:10px;\"><div class=\"lighthover\" style=\"height:40px;float:left;\"><div class=\"onhoverbg\" style=\"height:40px;float:left;\"><h4 class=\"title-name\"><a href=\"<?php echo $this->data['nav_urls']['mainpage']['href']; ?>\"><div class=\"title-name\" style=\"font-size: 0.9em; padding-left:0.4em;padding-right:0.4em;color:white;max-width: auto;height:auto; max-height:700px; display: inline-block; vertical-align:middle;\"><?php echo $GLOBALS['wgSitename'] ?></div></a></h4></div><img src=\"http://images.pidgi.net/line.png\" style=\"float:left;\" /><div class=\"onhoverbg\" style=\"height:40px;float:left;\"><img src=\"http://images.pidgi.net/downarrow.png\" style=\"cursor:pointer;\" onclick=\"toggleDiv('bartile');\"></div></div></div>\n\t<div id=\"top-tile-bar\" class=\"fixed-position\">\n\n<div style=\"vertical-align:top;align:left;\">\n<div class=\"topleft\">\n<div style=\"align:left;margin-left:auto;margin-right:auto;display:none;height:200px;\" class=\"tilebar\" id=\"bartile\"><div style=\"height:200px;display:table;\"><div style=\"vertical-align:middle;display:table-cell;padding-left:36px;\">\n<div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/wiki/\"><img src=\"http://images.pidgi.net/pidgiwikitiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/press/\"><img src=\"http://images.pidgi.net/pidgipresstiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/jcc/\"><img src=\"http://images.pidgi.net/jcctiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.petalburgwoods.com/\"><img src=\"http://images.pidgi.net/pwntiletop.png\" /></a></span></div>\n\n</div></div></div>\n</div>\n\n</div></div>\n\t\t\t<div id=\"left-navigation\">\n\t\t\t\t<a href=\"<?php echo $this->data['nav_urls']['upload']['href']; ?>\"><div class=\"onhoverbg\" style=\"padding-left:0.8em;padding-right:0.8em;float:left;height:40px;font-size:10pt;\"><img src=\"http://images.pidgi.net/uploadlogo.png\" /> <span style=\"color:#fff;position:relative;top:1px;\"><?php $this->msg('uploadbtn') ?></span></div></a><?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS', 'VIEWS', 'ACTIONS' ) ); ?>\n\t\t\t</div>\n\t\t\t<div id=\"right-navigation\">\n\t\t\t\t<?php if ( $SearchBar ): ?>\n\t\t\t\t<?php $this->renderNavigation( array( 'SEARCH' ) ); ?>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php endif; ?>\t\n\t\t\t</div>\n\t\t</div>\n\t\t <?php if ( $SearchBar ): ?>\n\t\t\t<div id=\"mw-panel\">\n\t\t\t<?php else: ?>\n\t\t\t<div id=\"mw-panel-custom\">\n\t\t\t<?php endif; ?>\t\n\t\t\t\t<?php if ( $Logoshow ): ?>\n\t\t\t\t<div id=\"p-logo\" role=\"banner\"><a style=\"background-image: url(<?php\n\t\t\t\t\t$this->text( 'logopath' )\n\t\t\t\t\t?>);\" href=\"<?php\n\t\t\t\t\techo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] )\n\t\t\t\t\t?>\" <?php\n\t\t\t\t\techo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) )\n\t\t\t\t\t?>></a></div>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( $SearchBar ): ?>\n\t\t\t\t<?php $this->renderPortals( $this->data['sidebar'] ); ?>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php $this->renderNavigation( array( 'SEARCH' ) ); ?>\n\t\t\t\t<?php $this->renderPortals( $this->data['sidebar'] ); ?>\n\t\t\t\t<?php endif; ?>\t\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php $this->printTrail(); ?>\n\n\t</body>\n</html>\n\n <?php\n }", "function caNavLink($po_request, $ps_content, $ps_classname, $ps_module_path, $ps_controller, $ps_action, $pa_other_params=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caNavUrl($po_request, $ps_module_path, $ps_controller, $ps_action, $pa_other_params, $pa_options))) {\n\t\t\t//return \"<strong>Error: no url for navigation</strong>\";\n\t\t\t$vs_url = '/';\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='{$vs_url}' \";\n\t\t\n\t\tif ($ps_classname) { $pa_attributes['class'] = $ps_classname; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\t$vs_tag .= _caHTMLMakeAttributeString($pa_attributes);\n\t\t}\n\t\t\n\t\t$vs_tag .= \">{$ps_content}</a>\";\n\t\t\n\t\treturn $vs_tag;\n\t}", "function minorite_nav($variables){\n return '<nav'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</nav>';\n}", "function modify_nav_arguments($arguments){\n\n $arguments['walker'] \t\t\t\t= new accesspress_mag_walker();\n //$arguments['container_class'] \t\t= $arguments['container_class'] .= 'mega-menu-wrapper';\n $arguments['menu_class']\t\t\t= 'menu accesspress_mag_mega_menu';\n\n return $arguments;\n }", "protected function buildMenuArray() {}", "function makeLinks($nav1)\r\n{\r\n $myReturn = '';\r\n foreach($nav1 as $url => $text){\r\n \r\n if($url == THIS_PAGE){\r\n $myReturn .= \"<li><a class=\\\"selected\\\" href=\\\"$url\\\">$text</a></li>\";\r\n }else{\r\n $myReturn .= \"<li><a href=\\\"$url\\\">$text</a></li>\";\r\n }\r\n }\r\n \r\n return $myReturn;\r\n\r\n \r\n}", "function makeLinks($nav1)\n{\n $myReturn = '';\n foreach($nav1 as $url => $text){\n \n if($url == THIS_PAGE){\n $myReturn .= \"<li><a class=\\\"selected\\\" href=\\\"$url\\\">$text</a></li>\";\n }else{\n $myReturn .= \"<li><a href=\\\"$url\\\">$text</a></li>\";\n }\n }\n \n return $myReturn;\n}", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "function add_menu_classes($menu)\n {\n }", "function app_template_navigation() {\n global $Auth, $App;\n $user = $Auth->get_user_data();\n $navigation = NULL;\n\n if ( ! empty($user) ) {\n $user_id = $user['is_super'] ? false : $user['user_id'];\n $Menu = new AdminMenu($user_id, $user['is_super']);\n $nav = $Menu->generate();\n $navigation = array(\n 'selector' \t=> $App->config('page_content_id'),\n 'pos_func' \t=> 'insertAfter',\n 'html'\t\t=> $nav['navigation'].$nav['search']\n );\n }\n return $navigation;\n}", "public function actionbar_navigation() {\n $currentpage = format_flexpage_cache()->get_current_page();\n $options = array();\n foreach (format_flexpage_cache()->get_pages() as $page) {\n $options[$page->get_id()] = $this->pad_page_name($page, true);\n }\n\n if ($prevpage = format_flexpage_cache()->get_previous_page($currentpage)) {\n $previcon = new pix_icon('t/moveleft', get_string('gotoa', 'format_flexpage', format_string($prevpage->get_name())));\n $prevpage = $this->output->action_icon($prevpage->get_url(), $previcon);\n $prevpage = html_writer::tag('span', $prevpage, array('id' => 'format_flexpage_prevpage'));\n } else {\n $prevpage = '';\n }\n if ($nextpage = format_flexpage_cache()->get_next_page($currentpage)) {\n $nexticon = new pix_icon('t/removeright', get_string('gotoa', 'format_flexpage', format_string($nextpage->get_name())));\n $nextpage = $this->output->action_icon($nextpage->get_url(), $nexticon);\n $nextpage = html_writer::tag('span', $nextpage, array('id' => 'format_flexpage_nextpage'));\n } else {\n $nextpage = '';\n }\n $jumpselect = new single_select($this->page->url, 'pageid', $options, $currentpage->get_id(), array(), 'jumptopageid');\n $jumpselect->set_label(get_string('jumptoflexpage', 'format_flexpage'), array('class' => 'accesshide'));\n\n $jumptopage = html_writer::tag('span', $this->output->render($jumpselect), array('id' => 'format_flexpage_jumptopage'));\n $helpicon = $this->pix_icon('help', get_string('help'), 'moodle', array('id' => 'format_flexpage_actionbar_help'));\n $helpicon = html_writer::tag('span', $helpicon);\n\n return html_writer::tag('div', $prevpage.$jumptopage.$nextpage.$helpicon, array('id' => 'format_flexpage_actionbar_nav'));\n }", "protected function renderNavigation( $elements ) {\n\t\t$nav = $this->data['content_navigation'];\n\t\t$xmlID = '';\n\t\tforeach ( $nav as $section => $links ) {\n\t\t\tforeach ( $links as $key => $link ) {\n\t\t\t\tif ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) {\n\t\t\t\t\t$link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' );\n\t\t\t\t}\n\n\t\t\t\t$xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID;\n\t\t\t\t$nav[$section][$key]['attributes'] =\n\t\t\t\t\t' id=\"' . Sanitizer::escapeId( $xmlID ) . '\"';\n\t\t\t\tif ( $link['class'] ) {\n\t\t\t\t\t$nav[$section][$key]['attributes'] .=\n\t\t\t\t\t\t' class=\"' . htmlspecialchars( $link['class'] ) . '\"';\n\t\t\t\t\tunset( $nav[$section][$key]['class'] );\n\t\t\t\t}\n\t\t\t\tif ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tLinker::tooltip( $xmlID );\n\t\t\t\t} else {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tXml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->data['namespace_urls'] = $nav['namespaces'];\n\t\t$this->data['view_urls'] = $nav['views'];\n\t\t$this->data['action_urls'] = $nav['actions'];\n\t\t$this->data['variant_urls'] = $nav['variants'];\n\t\t\n\t\tglobal $wgVectorUseSimpleSearch;\n\n\t\t// If only one element was given, wrap it in an array, allowing more\n\t\t// flexible arguments\n\t\tif ( !is_array( $elements ) ) {\n\t\t\t$elements = array( $elements );\n\t\t// If there's a series of elements, reverse them when in RTL mode\n\t\t} elseif ( $this->data['rtl'] ) {\n\t\t\t$elements = array_reverse( $elements );\n\t\t}\n\t\t// Render elements\n\t\tforeach ( $elements as $name => $element ) {\n\t\t\tswitch ( $element ) {\n\t\t\t\tcase 'NAMESPACES':\n?>\n\t\t<?php foreach ( $this->data['namespace_urls'] as $link ): ?>\n\t\t\t<li <?php echo $link['attributes'] ?>><a href=\"<?php echo htmlspecialchars( $link['href'] ) ?>\" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>\n\t\t<?php endforeach; ?>\n<?php\n\t\t\t\tbreak;\n\t\t\t\tcase 'VARIANTS':\n?>\n\t\t\t<?php foreach ( $this->data['variant_urls'] as $link ): ?>\n\t\t\t\t<li<?php echo $link['attributes'] ?>><a href=\"<?php echo htmlspecialchars( $link['href'] ) ?>\" lang=\"<?php echo htmlspecialchars( $link['lang'] ) ?>\" hreflang=\"<?php echo htmlspecialchars( $link['hreflang'] ) ?>\" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>\n\t\t\t<?php endforeach; ?>\n<?php\n\t\t\t\tbreak;\n\t\t\t\tcase 'VIEWS':\n?>\n\t\t<?php foreach ( $this->data['view_urls'] as $link ): \n\t\t\tif($link['id'] == 'ca-view') { continue; } // XXX: hackery ?>\n\t\t\t<li<?php echo $link['attributes'] ?>><a href=\"<?php echo htmlspecialchars( $link['href'] ) ?>\" <?php echo $link['key'] ?>><?php\n\t\t\t\t// $link['text'] can be undefined - bug 27764\n\t\t\t\tif ( array_key_exists( 'text', $link ) ) {\n\t\t\t\t\techo array_key_exists( 'img', $link ) ? '<img src=\"' . $link['img'] . '\" alt=\"' . $link['text'] . '\" />' : htmlspecialchars( $link['text'] );\n\t\t\t\t}\n\t\t\t\t?></a></li>\n\t\t<?php endforeach; ?>\n<?php\n\t\t\t\tbreak;\n\t\t\t\tcase 'ACTIONS': \n\t\t\t\tif( count( $this->data['action_urls'] ) == 0 ) { break; } // XXX has to be better way of doing this ?>\n\t\t\t<li class=\"dropdown\">\n\t\t\t\t\t<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">More<span class=\"caret\"></span></a>\n\t\t\t\t\t<ul class=\"dropdown-menu\">\n\t\t\t<?php foreach ( $this->data['action_urls'] as $link ): ?>\n\t\t\t\t\t\n\t\t\t\t\t<li<?php echo $link['attributes'] ?>><a href=\"<?php echo htmlspecialchars( $link['href'] ) ?>\" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>\n\t\t\t<?php endforeach; ?>\n\t\t\t</ul></li>\n<?php\n\t\t\t\tbreak;\n\t\t\t\tcase 'PERSONAL':\n?>\n\t<li class=\"nav-header\" id=\"p-personal\" <?php $this->html( 'userlangattributes' )?>> <?echo $this->icons['personal'] ?>User</li><?php // TODO use msg $this->msg( 'personaltools' ) ?>\n\t\n<?php\t\t\tforeach( $this->getPersonalTools() as $key => $item ) { ?>\n\t\t<?php echo $this->makeListItem( $key, $item ); ?>\n\n<?php\t\t\t} ?>\n\n<?php\n\t\t\t\tbreak;\n\t\t\t\tcase 'SEARCH':\n?>\n\t<form action=\"<?php $this->text( 'wgScript' ) ?>\" id=\"searchform\">\n\t\t<?php if ( $wgVectorUseSimpleSearch && $this->getSkin()->getUser()->getOption( 'vector-simplesearch' ) ): ?>\n\t\t<div id=\"simpleSearch\">\n\t\t\t<?php if ( $this->data['rtl'] ): ?>\n\t\t\t<?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->getSkin()->getSkinStylePath( 'images/search-rtl.png' ), 'width' => '12', 'height' => '13' ) ); ?>\n\t\t\t<?php endif; ?>\n\t\t\t<?php echo $this->makeSearchInput( array( 'id' => 'searchInput', 'type' => 'text' ) ); ?>\n\t\t\t<?php if ( !$this->data['rtl'] ): ?>\n\t\t\t<?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->getSkin()->getSkinStylePath( 'images/search-ltr.png' ), 'width' => '12', 'height' => '13' ) ); ?>\n\t\t\t<?php endif; ?>\n\t\t<?php else: ?>\n\t\t<div>\n\t\t\t<?php echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ); ?>\n\t\t\t<?php echo $this->makeSearchButton( 'go', array( 'id' => 'searchGoButton', 'class' => 'searchButton' ) ); ?>\n\t\t\t<?php echo $this->makeSearchButton( 'fulltext', array( 'id' => 'mw-searchButton', 'class' => 'searchButton' ) ); ?>\n\t\t<?php endif; ?>\n\t\t\t<input type='hidden' name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\"/>\n\t\t</div>\n\t</form>\n<?php\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function render_navbar($items, $active = NULL) {\n $this->config['type_class'] = 'navbar-nav';\n return $this->render($items, $active); \n }", "function makeNavigation($activeTab) //function to make the navigation \n{\n\t$hpactive='none';\n\t$intraactive='none';\n\t$adminactive='none';\n\t$loginactive='none';\n\t\n\tif($activeTab=='Homepage')\n\t{\n\t\t$hpactive='active';\n\t}\n\telseif($activeTab=='Intranet')\n\t{\n\t\t$intraactive='active';\n\t}\n\telseif($activeTab=='Admin')\n\t{\n\t\t$adminactive='active';\n\t}\n\telseif($activeTab=='login')\n\t{\n\t\t$loginactive='active';\n\t}\n\t\n\t\n\t\n\techo \t\"<nav>\n\t\t\t\t<ul class='left'>\n\t\t\t\t\t<li><a href='index.php?\". SID .\"' class=$hpactive>Homepage</a></li> <!-- Echoing SID to ensure session id is maintained --> \n\t\t\t\t\t<li><a href='intranet.php?\". SID .\"' class=$intraactive>Intranet</a></li> \n\t\t\t\t\t<li><a href='admin.php?\". SID .\"' class=$adminactive>Admin</a></li>\n\t\t\t\t</ul>\n\t\t\t\t\n\t\t\t\t<ul class='right'>\";\n\t\t\t\t\tif(isset($_SESSION['uname'])) //if session exists \n\t\t\t\t\t{\n\t\t\t\t\t\techo \"\n\t\t\t\t\t\t\t <li><a href='logout.php?\". SID .\"' >Log Out</a></li>\n\t\t\t\t\t\t\t <li><a href='login.php\". SID .\"' >\".htmlentities($_SESSION['uname'],ENT_QUOTES,'UTF-8').\" | </a></li>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<li><a href='login.php?\". SID .\"' class=$loginactive>Login for Staff</a></li>\";\n\t\t\t\t\t}\n\techo\t\t\"</ul>\n\t\t\t</nav>\";\n}", "public function registerNavigation()\n {\n $nexus = NexusSettings::instance();\n $iconSvg = '';\n\n if ($nexus->menu_icon_uploaded) {\n $iconSvg = $nexus->menu_icon_uploaded->getPath();\n } elseif (NexusSettings::get('menu_icon_text', '') == '') {\n $iconSvg = 'plugins/xitara/nexus/assets/images/icon-nexus.svg';\n }\n\n if (($label = NexusSettings::get('menu_text')) == '') {\n $label = 'xitara.nexus::lang.submenu.label';\n }\n\n return [\n 'nexus' => [\n 'label' => $label,\n 'url' => Backend::url('xitara/nexus/dashboard'),\n 'icon' => NexusSettings::get('menu_icon_text', 'icon-leaf'),\n 'iconSvg' => $iconSvg,\n 'permissions' => ['xitara.nexus.*'],\n 'order' => 50,\n ],\n ];\n }", "function build_navBar()\n\t{\n\t\t$activeUser = $_SESSION['active_user'];\n\t\techo '<nav class=\"navbar navbar-inverse navbar-fixed-top\">';\n\t\techo '<div class=\"container-fluid\">';\n\t\techo '<div class=\"navbar-header\">';\n\t\techo '<button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">';\n\t\techo '<span class=\"sr-only\">Toggle navigation</span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '<span class=\"icon-bar\"></span>';\n\t\techo '</button>';\n\t\techo '<a class=\"navbar-brand\" href=\"#\" style=\"font-family: titleFont;\">INFINITY</a>';\n\t\techo '</div>';\n\t\techo '<div id=\"navbar\" class=\"navbar-collapse collapse\">';\n\t\techo '<ul class=\"nav navbar-nav navbar-right\">';\n\t\techo '<li><a href=\"home.php\">Dashboard</a></li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"workouts.php\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Workouts <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"workouts.php\">My Workouts</a></li>';\n\t\techo '<li><a href=\"workoutLog.php\">My Log</a></li>';\n\t\techo '<li class=\"divider\"></li>';\n\t\techo '<li><a href=\"#\">Create Workout</a></li>';\n\t\techo '<li><a href=\"#\">Record Workout</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"groups.php\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Groups <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"groups.php\">My Groups</a></li>';\n\t\techo '<li><a href=\"createGroup.php\">Create Group</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Messages &nbsp;<span class=\"badge\">'.check_for_messages($activeUser).'</span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\tbuild_mini_inbox();\n\t\techo '<li><a href=\"messages.php\">Go to Inbox</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '<li class=\"dropdown\">';\n\t\techo '<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-expanded=\"false\">Settings <span class=\"caret\"></span></a>';\n\t\techo '<ul class=\"dropdown-menu\" role=\"menu\">';\n\t\techo '<li><a href=\"settings.php\">Update Profile</a></li>';\n\t\techo '<li><a href=\"#\">Privacy</a></li>';\n\t\techo '<li><a href=\"#\">Help</a></li>';\n\t\techo '<li class=\"divider\"></li>';\n\t\techo '<li><a href=\"#\">Logout</a></li>';\n\t\techo '</ul>';\n\t\techo '</li>';\n\t\techo '</ul>';\n\t\techo '</div>';\n\t\techo '</div>';\n\t\techo '</nav>';\t\n\t}", "function content_nav() {\n\t\t$current_individual_nav_items = 0;\n\t\t$max_individual_nav_items = 4;\n\t\t\n\t\tforeach($this->data['content_actions'] as $key => $item) :\n\t\t\tif ( $current_individual_nav_items == $max_individual_nav_items ) { ?>\n\t\t\t\t<?\n\t\t\t}\n\t\t\t\n\t\t\techo $this->makeListItem( $key, $item );\n\t\t\t$current_individual_nav_items++;\n\t\tendforeach;\n\t\t\n\t\t?></ul></li><?\n\t}", "public function home_nav_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\t\t<nav>\n\t\t\t<ul>\n\t\t\t\t<li class=\"metroTitle\"> <ul class=\"label\">\n\t\t\t\t\t\t<h2>Design + production</h2>\n\t\t\t\t\t</ul></li>\n\t\t\t\t<li class=\"web\"><a href=\"/web/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Web + social media</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">University Marketing and Communications creates compelling websites that deliver the messages you want and the information readers seek.</li> </ul></a></li>\n\t\t\t\t<li class=\"email\"><a href=\"/email/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Email</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Email is the #1 activity on smartphones and tablets, according to Pew Research. University Marketing and Communications writes and designs emails that captivate readers on the full range of devices.</li> </ul></a></li>\n\t\t\t\t<li class=\"printed\"><a href=\"/print/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Printed materials</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Want your print publications to get noticed, read, and remembered? We’ll work with you to strategically plan print pieces that build awareness of your initiatives and shape audience attitudes.</li> </ul></a></li>\n\t\t\t\t<li class=\"presentations\"><a href=\"/presentations/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Presentations</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Deliver your message with clarity and impact, while leveraging the strength of the WSU brand.</li> </ul></a></li>\n\t\t\t\t<li class=\"photo\"><a href=\"/photos-video/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Photography + video</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">The work of University Marketing and Communications photographers and videographers entertains and educates while advancing the WSU brand.</li> </ul></a></li>\n\t\t\t</ul>\n\t\t</nav>\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "public function displayMenu ( $class = '' )\n\t{\n\t\t$html = '';\n\n\t\tif ($class != '') {\n\t\t\t$class = \" class=\\\"$class\\\"\";\n\t\t}\n\n\t\tif ($this->path == '') {\n\t\t\t$sep = '?';\n\t\t} else {\n\t\t\t$sep = '&amp;';\n\t\t}\n\n\t\tif (!isset($_GET[$this->url_key])) {\n\t\t\t$take_first = true;\n\t\t\t$get_url_key = NULL;\n\t\t} else {\n\t\t\t$take_first = false;\n\t\t\t$get_url_key = $_GET[$this->url_key];\n\t\t}\n\n\t\t$html .= \"\\n<ul$class>\";\n\t\tfor ($i=0; $i<count($this->menu); $i++)\n\t\t{\n\t\t\t$title\t= $this->menu[$i]['link_name'];\n\t\t\t$query\t= $this->url_key.'='.$this->menu[$i]['url_value'];\n\t\t\t$link\t= $_SERVER['PHP_SELF'].$this->path.$sep.$query;\n\n\t\t\t// Menu\n\t\t\tif (($take_first == true) || ($get_url_key == $this->menu[$i]['url_value']))\n\t\t\t{\n\t\t\t\t// Alternative 1 : current link not clickable !\n\t\t\t\t#$html .= \"<li class=\\\"focus\\\"><span><span>&nbsp;</span>$title</span>\";\n\n\t\t\t\t// Alternative 2 : current link also clickable !\n\t\t\t\t$html .= \"<li class=\\\"current\\\"><a href=\\\"$link\\\"><span>&nbsp;</span>$title</a>\";\n\t\t\t} else {\n\t\t\t\t$html .= \"<li><a href=\\\"$link\\\"><span>&nbsp;</span>$title</a>\";\n\t\t\t}\n\n\t\t\t// Submenu\n\t\t\tif ( ($submenu = $this->submenus[$i]) && (count($submenu) > 1) )\n\t\t\t{\n\t\t\t\t$html .= \"<ul>\";\n\t\t\t\tfor ($j=0; $j<count($submenu); $j++)\n\t\t\t\t{\n\t\t\t\t\t$query = admin_getUrl_key(1).'='.$submenu[$j]['url_value'];\n\t\t\t\t\t$html .= \"<li><a href=\\\"$link&amp;$query\\\">{$submenu[$j]['link_name']}</a></li>\"; # Known limitation : this $submenu can not have the focus !\n\t\t\t\t}\n\t\t\t\t$html .= \"</ul>\";\n\t\t\t}\n\n\t\t\t$html .= '</li>';\n\n\t\t\t$take_first = false;\n\t\t}\n\t\t$html .= \"</ul>\\n\";\n\n\t\techo $html;\n\t}", "function make_navigation_bar($user_entity, $page_name = NULL)\n{\n global $options;\n echo \"<div id='navigation'>\\n\";\n\n if (isset($options['captureui_addrs'])) {\n make_app_addrs_list();\n }\n\n // User is already logged in, so\n // - access user information and display welcome message\n // - display 'home', 'editprofile', and 'logout' links.\n\n if (isset($user_entity)) {\n if (isset($user_entity['stat']) && $user_entity['stat'] == 'ok') {\n if (isset($_COOKIE['app'])) {\n echo \"<span id='app_name'>\" . $_COOKIE['app'] . \"</span>&nbsp;\";\n }\n $user_entity = $user_entity['result'];\n\n if ($page_name != \"home\")\n echo \"<a href='.' id='home'>Home</a>\";\n\n echo \"Hello, \" . $user_entity['displayName'] . \"\";\n\n print '&nbsp;|&nbsp;';\n\n if ($options['edit_profile_with_fancybox']) {\n echo '<a href=\"profile_with_token_refresh.php\" id=\"profile_link\" class=\"iframe\">Edit Profile</a>';\n }\n else {\n if ($page_name != \"editprofile\") {\n echo \"<a href='editprofile.php' id='edit_profile'>Edit Your Profile</a>\";\n } else {\n echo \"Edit Your Profile\";\n }\n }\n\n // if ($page_name != \"rawprofile\") {\n // echo \"&nbsp;|&nbsp; <a href='rawprofile.php' id='raw_profile'>View Capture Profile</a>\";\n // } else {\n // echo \"&nbsp;|&nbsp; View Capture Profile\";\n // }\n\n if ($page_name != \"public_profile\") {\n echo \"&nbsp;|&nbsp; <a href='public_profile.php' id='public_profile'>View Public Profile</a>\";\n } else {\n echo \"&nbsp;|&nbsp; View Public Profile\";\n }\n } else {\n debug_out(\"*** Bad entity!<br>\\n\");\n debug_raw_data($user_entity);\n }\n\n if (isset($options['sso_server'])) {\n echo \"&nbsp;|&nbsp; <a href='#' id='logout' onClick='sso_logout()'>Sign Out</a>\";\n } else {\n echo \"&nbsp;|&nbsp; <a href='logout.php' id='logout'>Sign Out</a>\";\n }\n }\n\n // User is not logged in, so display signin link\n else {\n make_signin_link();\n }\n echo \"</div>\\n\";\n}", "function renderMenuToHTML($currentPageId,$currentlang) {\n $mymenu = array(\n // idPage titre\n 'accueil' => array( 'Accueil' ),\n 'cv' => array( 'Cv' ),\n 'projets' => array('Mes Projets'),\n 'contact' => array('Contact')\n );\n \n // ...\n echo \"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\";\n if($currentlang=='en'){\n echo \"<div class=\\\"boutonlangue\\\">\";\n echo \"<a class=\\\"btn selected\\\" href=\\\"index.php?page=\".$currentPageId.\"&lang=en\\\"> EN </a>\";\n echo \"<a class=\\\"btn \\\" href=\\\"index.php?page=\".$currentPageId.\"&lang=fr\\\"> FR </a>\";\n echo \"</div>\";\n }\n elseif($currentlang=='fr'){\n echo \"<div class=\\\"boutonlangue\\\">\";\n echo \"<a class=\\\"btn \\\" href=\\\"index.php?page=\".$currentPageId.\"&lang=en\\\"> EN</a>\";\n echo \"<a class=\\\" btn selected\\\" href=\\\"index.php?page=\".$currentPageId.\"&lang=fr\\\"> FR </a>\";\n echo \"</div>\";\n }\n echo \"<div class=\\\"container\\\">\";\n echo \"<a class=\\\"navbar-brand js-scroll-trigger\\\" href=\\\"index.php\\\">Mon Site</a>\";\n echo \"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\";\n echo \"Menu\";\n echo \"<i class=\\\"fas fa-bars\\\"></i>\";\n echo \"</button>\";\n echo \"<div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\";\n echo \"<ul class=\\\"navbar-nav ml-auto\\\">\";\n foreach($mymenu as $pageId => $pageParameters) {\n echo \"<li class=\\\"nav-item mx-0 mx-lg-1\\\">\";\n echo \"<a\";\n echo \" class=\\\"\";\n if($pageId === $currentPageId)\n echo \"selected \" ;\n echo \"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\"\";\n echo \"href=\\\"index.php?page=\".$pageId.\"&lang=\".$currentlang.\"\\\"'>$pageParameters[0]</a>\";\n echo \"</li>\";\n }\n echo \"</ul></div></div></nav>\";\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function renderNavigation()\n {\n return view('nova-blog-tool::navigation');\n }", "function makeLinks($linkArray)\n{\n $myReturn = '';\n\n foreach($linkArray as $url => $text)\n {\n if($url == THIS_PAGE)\n {//selected page - add class reference\n $myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n }else{\n $myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n } \n }\n \n return $myReturn; \n}", "function getNavigation()\n\t{\n\n\n\t\treturn;\n\n\t\tglobal $gMysql;\n\t\tglobal $member_id;\n\t\t# grab these items\n\t\t$num_views\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_views where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_winks\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_winks where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_favs\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_fav where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_messages\t\t=\t$gMysql->queryItem(\"select count(*) from sm_messages where member_id='$member_id'\",__FILE__,__LINE__);\n\n\n\n\t\t$menuArray\t=\tarray(\n\t\tarray(\n\t\t\"title\"\t\t\t=>\t\"Profile\",\n\t\t\"bShowNumber\"\t=>\tfalse,\n\t\t\"number\"\t\t=>\t0,\n\t\t\"bHeader\"\t\t=>\ttrue,\n\t\t\"className\"\t\t=>\t\"icon-user\",\n\t\t\"link\" \t\t\t=>\t\"http://bbc.co.uk\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Search\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-search\",\n\t\t\"link\" \t\t\t =>\t\"search\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Messages\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_messages,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-mail\",\n\t\t\"link\" \t\t\t =>\t\"inbox\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Views\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_views,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-binoculars\",\n\t\t\"link\" \t\t\t =>\t\"views\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Winks\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_winks,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-eye\",\n\t\t\"link\" \t\t\t =>\t\"winks\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Favourites\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_favs,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-bookmarks\",\n\t\t\"link\" \t\t\t =>\t\"favourites\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Matches\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-heart\",\n\t\t\"link\" \t\t\t =>\t\"matches\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Membership\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-unlocked\",\n\t\t\"link\" \t\t\t =>\t\"membership\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Profile\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-user\",\n\t\t\"link\" \t\t\t =>\t\"profile\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t\t=>\t\"Logout\",\n\t\t\"bShowNumber\"\t\t=>\tfalse,\n\t\t\"number\"\t\t\t=>\t0,\n\t\t\"bHeader\"\t\t\t=>\ttrue,\n\t\t\"className\"\t\t\t=>\t\"icon-switch\",\n\t\t\"link\"\t\t\t\t=>\t\"javacript:confirm('app/m/login/logout');\",\n\t\t),\n\t\t);\n\n\t\t$selectedItem\t=\t3;\n\t\t$index\t\t\t=\t0;\n\n\n\t\t$menuString\t=\t' <ul> ';\n\n\n\t\tforeach ($menuArray as $menuItem)\n\t\t{\n\t\t\t# build html of menu\n\t\t\tif\t($selectedItem == $index)\n\t\t\t{\n\t\t\t\t$menu_line\t=\t'<li class=\"selected\">';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$menu_line\t=\t'<li>';\n\t\t\t}\n\n\n\t\t\t$menu_line\t.=\t'<a href=\"' . $menuItem['link'] . '\" class=\"' . $menuItem['className'] . '\" >' . $menuItem['title'];\n\t\t\t# numerics?\n\t\t\tif\t($menuItem['bShowNumber'] == true)\n\t\t\t{\n\t\t\t\t$menu_line\t.=\t\t' <span class=\"pip\">' . $menuItem['number'] . '</span>';\n\t\t\t}\n\t\t\t$menu_line .= \"</a></li>\\r\\n\";\n\n\t\t\t$menuString\t.=\t$menu_line;\n\n\t\t\t$index++;\n\t\t}\n\t\t$menuString\t.=\t\"</ul>\";\n\n\t\treturn\t$menuString;\n\t}", "public function renderNavigation()\n {\n return view('nova::dashboard.navigation');\n }", "public function setMenu() {\n $loged_in = false;\n if (isset($_COOKIE['query_key']) && isset($_COOKIE['rememberme'])) {\n $loged_in = explode(\"@\", Token::verifyToken());\n }\n $menu = \"\n <nav class='navbar navbar-inverse navbar-fixed-top' role='navigation'>\n <div class='container'>\n <div class='navbar-header'>\n <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='#menu_bar' >\n <span class='sr-only'>Toggle navigation</span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n <span class='icon-bar' style='background-color: black;'></span>\n </button>\n <a class='navbar-brand' ><img src='assets/images/logo.png' height='30px'></a>\n </div>\n\n <div class='collapse navbar-collapse' id='menu_bar' >\n <ul class='nav navbar-nav navbar-right' >\";\n if ($loged_in == false) {\n $menu .=\" <li>\n <a href='./login' >Login</a>\n </li>\n <li>\n <a href='./signup' >Signup</a>\n </li>\";\n } else {\n $menu .= \" \n <li>\n <a>Welcome \" . $loged_in[0] . \"</a>\" .\n \"</li>\n <li>\n <a href='./posts' >Posts</a>\n </li>\n <li>\n <a href='./change' >Change Password</a>\n </li>\n <li>\n <a href='./user-logout' >logout</a>\n </li>\";\n }\n\n $menu .=\"</ul>\n </div>\n </div>\n</nav>\n<div style='height:100px;width:100%;position:relative;'></div>\n\";\n return $menu;\n }", "function honeycomb_primary_navigation_wrapper() {\n\t\techo '<div class=\"honeycomb-primary-navigation\">';\n\t}", "private function gen_nav_links()\n\t{\n\t\t$this->template->assign_block_vars('navlinks', array(\n\t\t\t'S_IS_CAT'\t\t=> true,\n\t\t\t'S_IS_LINK'\t\t=> false,\n\t\t\t'S_IS_POST'\t\t=> false,\n\t\t\t'FORUM_NAME'\t=> $this->user->lang('BLOG_MAIN'),\n\t\t\t'FORUM_ID'\t\t=> -1,\n\t\t\t'U_VIEW_FORUM'\t=> append_sid('blog'),\n\t\t));\n\t}", "function build_menubar() {\n // get the menu bar data from config\n $i = $this->config->item('menu_choices');\n $t = $i['menudata'];\n $this->data['menudata'] = $t;\n\n // check if anyone is logged in\n if ($this->session->userdata('username')) {\n // if so, display logout button\n $this->data['welcome_txt'] = 'Welcome, ' . $this->session->userdata('username');\n $this->data['login_submit_txt'] = 'Logout';\n $this->data['login_btn_appear'] = 'none';\n $this->data['login_action'] = 'logout';\n } else {\n // if no one is logged in, display the login box\n $this->data['welcome_text'] = '';\n $this->data['login_submit_txt'] = 'Login';\n $this->data['login_btn_appear'] = 'initial';\n $this->data['login_action'] = 'login';\n }\n\n // parse the menu bar\n $this->data['menubar'] = $this->parser->parse('_menubar', $this->data, true); //$this->config->item('menu_choices')\n }", "function nav ($arguments = \"\") {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tnav');\n return $rc->newInstanceArgs( $arguments ); \n}", "function ninja_forms_add_class($classes) {\n\t$classes .= ' nav-menus-php';\n\t// return the $classes array\n\treturn $classes;\n}" ]
[ "0.71500725", "0.6944747", "0.6782555", "0.67732614", "0.66652083", "0.64630353", "0.64618427", "0.63763696", "0.63430667", "0.63146335", "0.62852085", "0.62432545", "0.6232835", "0.6172886", "0.61571664", "0.61344826", "0.61207503", "0.6117479", "0.6116228", "0.6037143", "0.60157394", "0.6004105", "0.5994959", "0.59779775", "0.5969578", "0.59550834", "0.5954394", "0.5952319", "0.5942465", "0.59240437", "0.5911269", "0.58997965", "0.5880804", "0.58780146", "0.58716166", "0.58636683", "0.5854994", "0.5853064", "0.5846619", "0.58385664", "0.5836612", "0.58281595", "0.5817772", "0.5812878", "0.5807938", "0.5805793", "0.57926005", "0.57874626", "0.5777293", "0.5774762", "0.574294", "0.57368094", "0.5730513", "0.5729043", "0.5715119", "0.5712868", "0.57071286", "0.57053316", "0.56827676", "0.5672237", "0.5671376", "0.56519145", "0.564688", "0.56386554", "0.5617225", "0.561472", "0.56145203", "0.56128633", "0.56091976", "0.56046665", "0.55980426", "0.5595132", "0.55934083", "0.55849844", "0.5579894", "0.5569315", "0.5567525", "0.55645293", "0.5555231", "0.55460733", "0.5545468", "0.5541086", "0.55393916", "0.55269283", "0.5526278", "0.5526278", "0.5526278", "0.5526278", "0.5526278", "0.5526278", "0.5526095", "0.5519301", "0.55191505", "0.5518271", "0.55165446", "0.5511429", "0.5509188", "0.5505886", "0.55002993", "0.5496756" ]
0.6684448
4
Check the password for a minimum of 8 characters, at least one 1 capital letter, at least 1 number and at least 1 special character
function checkPassword($clientPassword){ $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\s]){8,}$/'; return preg_match($pattern, $clientPassword); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "function isValidPassword($password){\n $hasLower = false;\n $hasDigit = false;\n $hasUpper = false;\n\n if(strlen($password) >= 8 && strlen($password) <= 20){\n $splitStringArray = str_split($password);\n\n for($i = 0; $i < count($splitStringArray); $i++){\n if(ctype_lower($splitStringArray[$i])){\n $hasLower = true;\n }\n else if(ctype_digit($splitStringArray[$i])){\n $hasDigit = true;\n }\n else if(ctype_upper($splitStringArray[$i])){\n $hasUpper = true;\n }\n if($hasLower && $hasDigit && $hasUpper){\n return true;\n }\n }\n }\n return false;\n }", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public static function validatePassword($password) {\n if (\n (strlen($password) > 8 || strlen($password) < 4) || // Check Length\n (!preg_match(\"#[0-9]+#\", $password)) || // Contains a number.\n (!preg_match(\"#[a-zA-Z]+#\", $password)) || // Contains a letter.\n (!preg_match(\"/^[a-z0-9]+$/i\",$password))) // No special characters.\n {\n // Password did not meet one of the requirements.\n return false; \n } else {\n // Password meets all requirements.\n return true;\n }\n }", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "public function validate_password($password){\nif(!preg_match('%\\A(?=[-_a-zA-Z0-9]*?[A-Z)(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\\S{6,}\\z%', $password)){\n\treturn false;\n\t}else{\n\t\treturn true;\n\t\t}\n}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "static function valid_password($input) {\n return strlen($input) > 5 && trim($input) === $input;\n }", "function is_valid_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n\n return (preg_match($pattern, $password) == 1);\n}", "function valid_password($pwd) {\n\t\tif (!$pwd)\n\t\t\treturn FALSE;\n\t\tif (strlen($pwd) < 6)\n\t\t\treturn FALSE;\n\t\tif (!preg_match('/[a-zA-Z]+/', $pwd) || !preg_match('/[0-9]+/', $pwd))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public static function validPassword ($length = 6)\r\n\t{\r\n\t\t# Check that the URL contains an activation key string of exactly 6 lowercase letters/numbers\r\n\t\treturn (preg_match ('/^[a-z0-9]{' . $length . '}$/D', (trim ($_SERVER['QUERY_STRING']))));\r\n\t}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "function password_check($str)\n\t\t\t{\n\t\t\t\tif(preg_match('/[0-9]/', $str) && preg_match('/[a-zA-Z]/', $str))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t}", "public function test($password) {\n $error = array();\n if($password == trim($password) && strpos($password, ' ') !== false) {\n $error[] = \"Password can not contain spaces!\";\n }\n \n if(($this->password_lenghtMin!=null) && (strlen($password) < $this->password_lenghtMin)) {\n $error[] = \"Password too short! Minimum \".$this->password_lenghtMin.\" characters.\";\n }\n if(($this->password_lenghtMax!=null) && (strlen($password) > $this->password_lenghtMax)) {\n $error[] = \"Password too long! Maximum \".$this->password_lenghtMax.\" characters.\";\n }\n \n if(($this->password_number!=null) && (!preg_match(\"#[0-9]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n } elseif($this->password_number>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_number) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n }\n }\n\n if(($this->password_letter!=null) && (!preg_match(\"#[a-z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n } elseif($this->password_letter>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_letter) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n }\n }\n\n if(($this->password_capital!=null) && (!preg_match(\"#[A-Z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n } elseif($this->password_capital>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_capital) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n }\n }\n \n \n if(($this->password_symbol!=null) && (!preg_match(\"/\\W+/\", $password))) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n } elseif($this->password_symbol>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_symbol) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n }\n }\n \n if(($this->password_strength!=null) && (($this->strength($password)!==false) && ($this->strength($password)['score']<$this->password_strength))) {\n $error[] = \"Password too weak! \".$this->strength($password)['score'].'/4 minimum '.$this->password_strength;\n }\n\n if(!empty($error)){\n return $error;\n } else {\n return true;\n }\n }", "static function isValidPass($pass) {\n $pattern = \"/^[a-zA-Z0-9]{8,32}$/\";\n if(preg_match($pattern, $pass)) {\n return true;\n } else {\n return false;\n }\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function validate($firstpw, $secondpw) {\n\tif(strcmp($firstpw, $secondpw) == 0) {\n\t\t// Booleans to check password complexity - if true, then firstpw is ok\n\t\t$uppercase = preg_match('@[A-Z]@', $firstpw);\n\t\t$lowercase = preg_match('@[a-z]@', $firstpw);\n\t\t$number = preg_match('@[0-9]@', $firstpw);\n\t\tif($uppercase && $lowercase && $number && strlen($firstpw) > 8) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function validatePassword($value){\n if (is_int($value)) throw new Exception (\"Password must consist of letters and, if needed, numbers\"); #PASS (Check the string to int if all are numbers)\n $passwordMinLength=7;\n $passwordMaxLength=18;\n if (strlen($value)<=$passwordMinLength || strlen($value)>=$passwordMaxLength){\n throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n //return;\n } else{\n //throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n }\n //return;\n}", "function PWValidation($x){\n\t$x = str_split($x, 1);\n\t$faultyCheck = TRUE;\n\twhile($faultyCheck) {\n\t\tforeach($x as $eachOne) {\n\t\t\tif((ctype_alpha($eachOne) OR (is_numeric($eachOne)))) {\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errorMessage = 'Your password must contain only alphanumeric characters';\n\t\t\t\treturn $errorMessage;\n\t\t\t}\n\t\t}\n\t\t$faultyCheck = FALSE;\n\t}\n}", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "function passwordValid($password) {\n\treturn true;\n}", "function error_password($pass, $pass_bis)\n{\n $error = array();\n if (strlen($pass) < 8 || strlen($pass) >= 255)\n array_push($error, \"error password must be longer than 8 and shorter than 255 \");\n if ($pass !== $pass_bis)\n array_push($error, \"password do not match\");\n if (!preg_match(\"/.*[0-9].*/\", $pass))\n array_push($error, \"password must have at least a number in it\");\n return ($error);\n}", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "function validatePass($password){ \n\t\tif (!preg_match(\"/[a-z]/\", $password)){\n\t\t\t$_SESSION['error'] = \"must contain lowercase\";\n\t\t\theader(\"location:../views/register.php\");\n\t\t}\n\n\t\tif (!preg_match(\"/[A-Z]/\", $password)){\n\t\t\t$_SESSION['error'] = \"must contain uppercase\";\n\t\t\theader(\"location:../views/register.php\");\n\t\t}\n\n\t\tif (!preg_match(\"/[0-9]/\", $password)){\n\t\t\t$_SESSION['error'] = \"must contain lowercase\";\n\t\t\theader(\"location:../views/register.php\");\n\t\t}\n\n\t\tif (strlen($password)< 8){\n\t\t\t$_SESSION['error'] = \"Password too short\";\n\t\t\theader(\"location:../views/register.php\");\n\t\t}\n\t\treturn (true);\n\t}", "public function testManySpecialCharacter ()\n {\n // Function parameters\n $length = 10;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 6,\n 'digit' => 1,\n 'upper' => 1,\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){6})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "private function checkSymbolLength(): bool\n {\n $passwordLength = strlen($this->password);\n if ($passwordLength > 6) {\n return true;\n }\n array_push($this->errorMessages, \"Please add atleast \" . 7 - $passwordLength . \" characters to your password\");\n return false;\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "protected function validatePassword($password) \n {\n if (!empty($password)) {\n if (strlen($password) < '8') {\n $this->errors[] = PASSWORD_TOO_SHORT;\n }\n if (!preg_match(\"#[0-9]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_NUMBER;\n }\n if (!preg_match(\"#[A-Z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_UPPERCASE;\n }\n if (!preg_match(\"#[a-z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_LOWERCASE;\n }\n } else {\n $this->errors[] = PASSWORD_MISSING;\n }\n }", "function validate_password($password)\r\n\t{\r\n\t\tif($this->dont_allow_3_in_a_row($password) === FALSE)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif(preg_match(REGEX_PASSWORD, $password) !== 1)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public function isPasswordValid(string $encoded, string $raw);", "public function checkPass($password) {\r\n\t\tif(!empty($password)) {\r\n\t\t if (strlen($password) <= '8') {\r\n\t\t return \"Your Password Must Contain At Least 8 Characters!\";\r\n\t\t }\r\n\t\t elseif(!preg_match(\"#[0-9]+#\", $password)) {\r\n\t\t return \"Your Password Must Contain At Least 1 Number!\";\r\n\t\t }\r\n\t\t elseif(!preg_match(\"#[A-Z]+#\", $password)) {\r\n\t\t return \"Your Password Must Contain At Least 1 Capital Letter!\";\r\n\t\t }\r\n\t\t elseif(!preg_match(\"#[a-z]+#\", $password)) {\r\n\t\t return \"Your Password Must Contain At Least 1 Lowercase Letter!\";\r\n\t\t } else {\r\n\t\t \treturn null;\r\n\t\t }\r\n\t\t}\r\n\r\n\t\telseif(empty($password)) {\r\n\t\t return \"Password was left empty\";\r\n\t\t}\r\n\r\n\t}", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function ValidPassword($check) {\n\t // have to extract the value to make the function generic\n\t $value = array_values($check);\n\t $value = $value[0];\n\n\t //$uppercase = preg_match('@[A-Z]@', $value);\n\t $lowercase = preg_match('@[a-z]@', $value);\n\t $number = preg_match('@[0-9]@', $value);\n\t //$specialchars = preg_match('/[!@#$%^&*()\\-_=+{};:,<.>]/', $value);\n\t \t// var_dump($value);\n\t // exit();\n\t if(!$lowercase || !$number || strlen($value) < 6 ) {\n\t \t \treturn false; \n\t } else {\n\t return true;\n\t\t\t}\n\t\t}", "public function checkPassword($value);", "function isPassCorrect($psw, $psw_repeat){\r\n\t$regex = '/(?:[^`!@#$%^&*\\-_=+\\'\\/.,]*[`!@#$%^&*\\-_=+\\'\\/.,]){2}/';\r\n\tif (strlen($psw) >= 2 && strlen($psw_repeat) <= 255 && $psw == $psw_repeat) {\r\n\t\tif (preg_match($regex, $psw)) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "public function passwordIsValid($password)\n {\n $config = $this->getPasswordConfig();\n\n /**\n * Count lowercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countLowercase = function ($string) {\n $stringUppercase = mb_strtoupper($string);\n $similar = similar_text($string, $stringUppercase);\n return strlen($string) - $similar;\n };\n /**\n * Count uppercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countUppercase = function ($string) {\n $stringLowercase = mb_strtolower($string);\n $similar = similar_text($string, $stringLowercase);\n return strlen($string) - $similar;\n };\n\n // Validate minimum password length.\n if (isset($config['min_length']) && is_numeric($config['min_length'])) {\n if (strlen($password) < $config['min_length']) {\n return false;\n }\n }\n // Validate minimum lowercase character count.\n if (isset($config['min_lowercase']) && is_numeric($config['min_lowercase'])) {\n if ($countLowercase($password) < $config['min_lowercase']) {\n return false;\n }\n }\n // Validate minimum uppercase character count.\n if (isset($config['min_uppercase']) && is_numeric($config['min_uppercase'])) {\n if ($countUppercase($password) < $config['min_uppercase']) {\n return false;\n }\n }\n // Validate minimum number character count.\n if (isset($config['min_number']) && is_numeric($config['min_number'])) {\n if (preg_match_all('/[0-9]/', $password) < $config['min_number']) {\n return false;\n }\n }\n // Validate minimum symbol character count.\n if (isset($config['min_symbol']) && is_numeric($config['min_symbol'])\n && isset($config['symbol_list']) && is_string($config['symbol_list'])\n && strlen($config['symbol_list'])\n ) {\n $symbolCount = 0;\n foreach (str_split($config['symbol_list']) as $symbol) {\n $symbolCount += substr_count($password, $symbol);\n }\n if ($symbolCount < $config['min_symbol']) {\n return false;\n }\n }\n\n // The password is valid.\n return true;\n }", "public function testPasswordIsNotValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n \n\n $this->assertDoesNotMatchRegularExpression($pattern,$data);\n\n }", "function CheckPassword($pw) {\n //if the length of a password is less than 8, an error is show to the user\n if (strlen($pw) < 8) {\n $regError = \"Your password must contain at least 8 characters!\";\n $_SESSION['regError'] = $regError;\n header('location:UserregisterView.php');\n return false;\n }\n //if the password doesnt contain a number, an error is shown to the user\n elseif (!preg_match(\"#[0-9]+#\", $pw)) {\n $regError = \"Your password must contain at least 1 number!\";\n $_SESSION['regError'] = $regError;\n header('location:UserregisterView.php');\n return false;\n }\n //if the password doesnt contain a capital letter, an error is shown to the user\n elseif (!preg_match(\"#[A-Z]+#\", $pw)) {\n $regError = \"Your password must contain at least 1 capital letter!\";\n $_SESSION['regError'] = $regError;\n header('location:UserregisterView.php');\n return false;\n }\n //if the password doesnt contain a lowercase letter, an error is shown to the user\n elseif (!preg_match(\"#[a-z]+#\", $pw)) {\n $regError = \"Your password must contain at least 1 lowercase letter!\";\n $_SESSION['regError'] = $regError;\n header('location:UserregisterView.php');\n return false;\n }\n //if these 4 requirements are met, the function returns true (which means that the password is good)\n else {\n return true;\n }\n}", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "public function validatePassword($passPassword) \n {\n\n if(preg_match('/^[a-zA-Z0-9\\s]+$/',$passPassword)) \n {\n\n return true;\n }\n else \n {\n return false;\n }\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function testGeneratePassword() {\r\n $this->User = new User();\r\n \t\t$pass = $this->User->generatePassword(); \t\r\n \t$this->assertNotNull($pass);\r\n \t$this->assertPattern('#[a-zA-Z0-9]{6,15}#', $pass, 'Password is not between 6 and 15 chars long');\r\n }", "protected function validateValidPassword( $attribute, $value ) {\n\n return (bool) preg_match( \"/S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S/\", $value );\n }", "public function isPassword($password);", "public function testRegisterShortPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMinStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 6, 'password_confirmation');\n }", "function is_secured_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n $pattern1 = \"/[A-Z]/\";\n $pattern2 = \"/[a-z]/\";\n $pattern3 = \"/[0-9]/\";\n $pattern4 = \"/[~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]/\";\n\n return (preg_match($pattern, $password) == 1) && (preg_match($pattern1, $password) == 1) && (preg_match($pattern2, $password) == 1) && (preg_match($pattern3, $password) == 1) && (preg_match($pattern4, $password) == 1);\n}", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public static function password_valid($password) {\n if (strlen($password) < 10) {\n /* password too short, rejected */\n return false;\n }\n\n if (preg_match(\"/^[a-z]*$/i\", $password) != 0) {\n /* only alphabetical characters, rejected */\n return false;\n }\n\n return true;\n }", "public static function validatePassword($password){\r\n\t\tif(strlen($password) >= self::$minPassLength){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function checkPasswordMinLength($password)\n {\n if (strlen($password) < 5) {\n return false;\n } else return true;\n }", "public function testRegistrationPasswordLessChars()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'a1')\n ->type('password_confirmation', 'a1')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password must be at least 6 characters.')\n ->assertSee('The password must be at least 6 characters.');\n });\n }", "private function isValidPassword($password){\n $isValid = false;\n if(isset($password) && trim($password) != \"\" && strlen($password) >= 6){\n $isValid = true;\n }\n return $isValid;\n }", "function checkpw($pw){\r\n\t\t\t\t\tfor($i = 0; $i <= 9; $i++)\r\n\t\t\t\t\t\tif(strchr($pw, (string)$i ))\r\n\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}", "function valid_password($password1,$password2)\n{\n\t// if the comparison of the 2 strings (the passwords)\n\t// results in 0 difference\n\tif(strcmp($password1,$password2)==0)\n\t{\n\t\t// if the password has a length of at least 6 characters\n\t\tif(strlen($password1)>=6)\n\t\t{\n\t\t\t// then return true\n\t\t\treturn true;\n\t\t}\n\t\t// if length lower than 6\n\t\telse\n\t\t{\n\t\t\t// return false\n\t\t\treturn false;\n\t\t}\n\t}\n\t// if 2 passwords are different\n\telse\n\t{\n\t\t// return false\n\t\treturn false;\n\t}\n}", "function sloodle_validate_prim_password($password)\n {\n // Check that it's a string\n if (!is_string($password)) return false;\n // Check the length\n $len = strlen($password);\n if ($len < 5 || $len > 9) return false;\n // Check that it's all numbers\n if (!ctype_digit($password)) return false;\n // Check that it doesn't start with a 0\n if ($password[0] == '0') return false;\n \n // It all seems fine\n return true;\n }", "function checkChar($ch){\n\t//error code\n\t$res= \"LOGIN_CHECKCHAR_FAILED\";\n\tif(strlen($ch) <= 16 && preg_match ( \"$^[a-zA-Z0-9_]{3,16}$\" , $ch )){\n\t\t$res= NULL;\n\t}\n\treturn $res;\n}", "function generatePassword($l = 8, $c = 0, $n = 0, $s = 0) {\n $count = $c + $n + $s;\n\n // sanitize inputs; should be self-explanatory\n if (!is_int($l) || !is_int($c) || !is_int($n) || !is_int($s)) {\n trigger_error('Argument(s) not an integer', E_USER_WARNING);\n return false;\n } elseif ($l < 0 || $l > 20 || $c < 0 || $n < 0 || $s < 0) {\n trigger_error('Argument(s) out of range', E_USER_WARNING);\n return false;\n } elseif ($c > $l) {\n trigger_error('Number of password capitals required exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($n > $l) {\n trigger_error('Number of password numerals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($s > $l) {\n trigger_error('Number of password capitals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($count > $l) {\n trigger_error('Number of password special characters exceeds specified password length', E_USER_WARNING);\n return false;\n }\n\n // all inputs clean, proceed to build password\n // change these strings if you want to include or exclude possible password characters\n $chars = \"abcdefghijklmnopqrstuvwxyz\";\n $caps = strtoupper($chars);\n $nums = \"0123456789\";\n $syms = \"!@#$%^&*()-+?\";\n\n // build the base password of all lower-case letters\n for ($i = 0; $i < $l; $i++) {\n $out .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);\n }\n\n // create arrays if special character(s) required\n if ($count) {\n // split base password to array; create special chars array\n $tmp1 = str_split($out);\n $tmp2 = array();\n\n // add required special character(s) to second array\n for ($i = 0; $i < $c; $i++) {\n array_push($tmp2, substr($caps, mt_rand(0, strlen($caps) - 1), 1));\n }\n for ($i = 0; $i < $n; $i++) {\n array_push($tmp2, substr($nums, mt_rand(0, strlen($nums) - 1), 1));\n }\n for ($i = 0; $i < $s; $i++) {\n array_push($tmp2, substr($syms, mt_rand(0, strlen($syms) - 1), 1));\n }\n\n // hack off a chunk of the base password array that's as big as the special chars array\n $tmp1 = array_slice($tmp1, 0, $l - $count);\n // merge special character(s) array with base password array\n $tmp1 = array_merge($tmp1, $tmp2);\n // mix the characters up\n shuffle($tmp1);\n // convert to string for output\n $out = implode('', $tmp1);\n }\n\n return $out;\n}" ]
[ "0.8070311", "0.8020083", "0.7886989", "0.7879418", "0.7818022", "0.7809847", "0.7809847", "0.78092045", "0.7797603", "0.77616775", "0.7728333", "0.76601297", "0.7637825", "0.7576043", "0.7526579", "0.7526579", "0.7526579", "0.75181526", "0.74897426", "0.7455564", "0.7449323", "0.74490225", "0.742977", "0.74019146", "0.7395105", "0.7384167", "0.7384167", "0.7384167", "0.7356272", "0.73461974", "0.73319966", "0.7323354", "0.73153114", "0.72910434", "0.72885394", "0.72711873", "0.72619635", "0.72329813", "0.7232812", "0.72248346", "0.72248346", "0.72248346", "0.72207826", "0.72207826", "0.72207826", "0.7215096", "0.720508", "0.7201081", "0.71540403", "0.71488994", "0.71488994", "0.71488994", "0.7125502", "0.71001494", "0.7081221", "0.7058916", "0.7046984", "0.7028792", "0.70187503", "0.701539", "0.70079106", "0.69939953", "0.69702876", "0.69612557", "0.6943554", "0.6942584", "0.6938869", "0.6922414", "0.6921026", "0.6901", "0.6892641", "0.6888854", "0.6861648", "0.68316317", "0.6829183", "0.682576", "0.6802722", "0.6799242", "0.6797616", "0.67816883", "0.6780208", "0.6768698", "0.676278", "0.67535293", "0.67295736", "0.6722324", "0.6709176", "0.67039835", "0.6696219", "0.6667726", "0.6644585", "0.6640869", "0.6639087", "0.65913385", "0.6567725", "0.6562705", "0.65568703", "0.6532689", "0.65219206", "0.6515032" ]
0.7845265
4
Build the classifications select list
function buildClassificationList($classifications){ $classificationList = '<select name="classificationId" id="classificationList">'; $classificationList .= "<option>Choose a Classification</option>"; foreach ($classifications as $classification) { $classificationList .= "<option value='$classification[classificationId]'>$classification[classificationName]</option>"; } $classificationList .= '</select>'; return $classificationList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildClassificationList($classifications)\n{\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">';\n $classificationList .= \"<option>Choose a Classification</option>\";\n foreach ($classifications as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n $classificationList .= '</select>';\n return $classificationList;\n}", "protected function generateProfList() {\n $classData = getClassData(Main::getSemester(), Main::isTraditional());\n\t\t\tMain::$CAMPUS_MASK = array_pop($classData);\n\t\t\t$this->setCampusMask();\n\t\t\t//generate select option values for display later\n $data = array_filter($classData, create_function('Course $class', 'return $class->getCampus() & \"'.$this->campusMask.'\";'));\n foreach($data as $class) {\n $list = $class->getProfClassList();\n foreach($list as $prof=>$class2) {\n $this->profClassList[$prof][] = $class2;\n }\n }\n ksort($this->profClassList);\n }", "protected function buildOptionsList() {\n }", "public function showClassNames() {\n\t\ttry {\n\t\t\t$resultShow = new ResultShow();\n\t\t\t/*all constant are declared here **/\n\n\t\t\t$categories = $resultShow->showCategories();\n\t\t\tforeach ($categories as $category) {\n\t\t\t\tif ($category->{'categoryId'} < CLASS_START_ID) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ($category->{'categoryId'} > CLASS_END_ID) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tprintf(\" <option value =\" . $category->{'categoryId'} . \">\" . $category->{'categoryName'} . \"</option>\");\n\t\t\t}\n\n\t\t} catch (\\Exception $ex) {\n\t\t\tprint_r($ex->getMessage());\n\n\t\t}\n\t}", "function buildClassificationDropdown($navArray, $optionalMessage = 'None', $currentValue = NULL)\n{\n $classificationList = \"\";\n $classificationList .= \"<select id='classificationId' name='classificationId'>\";\n $selected = \" selected \";\n $notSelected = \"\";\n if ($optionalMessage !== 'None')\n $classificationList .= \"<option value=''>$optionalMessage</option>\";\n if ($currentValue != NULL) {\n foreach ($navArray as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'\";\n $classificationList .= $currentValue == $classification['classificationId'] ? $selected : $notSelected;\n $classificationList .= \">$classification[classificationName]</option>\";\n }\n } else {\n foreach ($navArray as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n }\n $classificationList .= \"</select>\";\n return $classificationList;\n}", "public function classification()\n {\n\t\t$output = '<option selected=\"true\" disabled=\"disabled\">Select Classification</option>';\n\t\tif($this->request->id!=''){\n\t\t\t$classification = DB::table('embaseindex_classifications')->where('section_id', $this->request->id)->get();\n\t\t\tforeach($classification as $classval){\n\t\t\t\t$output .=\t'<option value=\"'.$classval->id.'\">'.$classval->classvalue.'</option>';\n\t\t\t}\n\t\t}\n\t\t\n /*$indexing = $this->indexing->findOrFail($id);\n $comments = new CommentsResource($indexing->comments()->orderBy('id', 'desc')->paginate(50));\n return response($comments, Response::HTTP_OK);*/\n\t\treturn response($output, Response::HTTP_OK);\n }", "protected function createUserAndGroupListForSelectOptions() {}", "public function build_products_type_selector($_class, $_active = \"\") {\r\n \t$ptypes = wcff()->dao->load_product_types();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \t$html .= '<option value=\"-1\">'. __(\"All Types\", \"wc-fields-factory\") .'</option>';\r\n \tif (count($ptypes) > 0) {\r\n \t\tforeach ($ptypes as $ptype) {\r\n \t\t\t$selected = ($ptype[\"id\"] == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($ptype[\"id\"]) . '\" ' . $selected . '>' . esc_html($ptype[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "function build_selection_dropdown() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'wo_journal_main.id', 'text' => 'Record ID');\n\t$output[] = array('id' => 'wo_journal_main.wo_id', 'text' => 'Work Order Num');\n\t$output[] = array('id' => 'wo_journal_main.wo_title', 'text' => 'Work Order Title');\n\t$output[] = array('id' => 'wo_journal_main.priority', 'text' => 'Priority');\n\t$output[] = array('id' => 'wo_journal_main.sku', 'text' => 'SKU');\n\t$output[] = array('id' => 'wo_journal_main.qty', 'text' => 'Quantity');\n\t$output[] = array('id' => 'wo_journal_main.post_date', 'text' => 'Post Date');\n\t$output[] = array('id' => 'wo_journal_main.closed', 'text' => 'Closed');\n\t$output[] = array('id' => 'wo_journal_main.closed_date', 'text' => 'Closed Date');\n\t$output[] = array('id' => 'wo_journal_main.notes', 'text' => 'Notes');\n\t$output[] = array('id' => 'wo_journal_main.bom_list', 'text' => 'BOM List');\n\t$output[] = array('id' => 'wo_journal_main.ref_specs', 'text' => 'Reference Specs');\n\t$output[] = array('id' => 'wo_journal_main.ref_docs', 'text' => 'Reference Docs');\n\t$output[] = array('id' => 'bar_code', 'text' => 'SKU Bar Code');\n\t$output[] = array('id' => 'image_with_path', 'text' => 'SKU Image');\n\treturn $output;\n }", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "public function build_products_selector($_class, $_active = \"\") {\r\n \t$products = wcff()->dao->load_all_products();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \t$html .= '<option value=\"-1\">'. __( \"All Products\", \"wc-fields-factory\" ) .'</option>';\r\n \tif (count($products) > 0) {\r\n \t\tforeach ($products as $product) {\r\n \t\t\t$selected = ($product[\"id\"] == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($product[\"id\"]) . '\" ' . $selected . '>' . esc_html($product[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "public function build_products_category_selector($_class, $_active = \"\") {\r\n \t$pcats = wcff()->dao->load_product_categories();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \t$html .= '<option value=\"-1\">'. __(\"All Categories\", \"wc-fields-factory\") .'</option>';\r\n \tif (count($pcats) > 0) {\r\n \t\tforeach ($pcats as $pcat) {\r\n \t\t\t$selected = ($pcat[\"id\"] == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($pcat[\"id\"]) . '\" ' . $selected . '>' . esc_html($pcat[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "function get_classes($class_id)\n\t\t{\n\t\t\t$get_student_list = $this->db->get_where('student' , array('class_id' => $class_id))->result_array();\n\t\t\techo '<option value=\"\">Select student</option>';\n\t\t\tforeach ($get_student_list as $row_value){\n\t\t\t\techo '<option value=\"'.$row_value['student_id'].'\">'.$row_value['name'].'</option>';\n\t\t\t}\n\t\t}", "public function build_forms()\n {\n // Get list of categories to populate the category selector\n $em = EntityManagerSingleton::getInstance();\n\n $category_options = [];\n $category_listings = $em->getRepository('Library\\Model\\Category\\Category')->findAllWithHierarchy();\n\n // Get list of categories that are theme categories so that they are are not included\n $criteria = new Criteria();\n $criteria->where($criteria->expr()->eq('id', Category::THEME_CATEGORY_ID))->orWhere($criteria->expr()->eq('parent_category', $em->getReference('Library\\Model\\Category\\Category', Category::THEME_CATEGORY_ID)));\n $theme_categories = $em->getRepository('Library\\Model\\Category\\Category')->matching($criteria);\n $all_theme_category_ids = [];\n if ($theme_categories->count() > 0)\n {\n /** @var Category $theme_category */\n foreach ($theme_categories as $theme_category)\n $all_theme_category_ids[] = $theme_category->getId();\n }\n\n if (!empty($category_listings))\n {\n foreach($category_listings as $listing)\n {\n // Don't include theme categories in the list\n if (in_array($listing['id'], $all_theme_category_ids))\n continue;\n\n // Construct listing name\n $listing_name = \"\";\n if (count($listing['ancestors']) > 0)\n {\n foreach ($listing['ancestors'] as $ancestor)\n {\n $listing_name .= $ancestor['name'] . \" >> \";\n }\n }\n\n $listing_name .= $listing['name'];\n $category_options[$listing['id']] = $listing_name;\n }\n }\n\n // Get list of statuses to list for products\n $this->status_options = [];\n $status_listings = $em->getRepository('Library\\Model\\Product\\Status')->findAll();\n $this->status_options[0] = \"None\";\n\n if (count($status_listings) > 0)\n {\n foreach ($status_listings as $staus_listing)\n {\n $this->status_options[$staus_listing->getId()] = $staus_listing->getName();\n }\n }\n\n // Get list of options for skus form\n $option_list = [];\n $options = $em->getRepository('Library\\Model\\Product\\Option')->findAll();\n if (!empty($options))\n {\n foreach ($options as $option)\n {\n $option_list[$option->getId()] = $option->getName();\n }\n }\n\n // Add content to forms\n $this->create_update_form->get('category')->setAttribute('options', $category_options);\n $this->create_update_form->get('status_override')->setAttribute('options', $this->status_options);\n $this->create_update_form->get('status')->setAttribute('options', $this->status_options);\n $this->add_skus_form->get('options')->setAttribute('options', $option_list);\n }", "function osa_webform_options_class_list($component, $flat, $arguments) {\r\n // Only include classes whos type is equal to the name (form_key) of the dropdown\r\n $cid = $_GET['cid'];\r\n $nodes = &_osa_get_class_nodes($cid, $component['form_key']);\r\n \r\n civicrm_initialize();\r\n $options = array();\r\n foreach ($nodes as $class) {\r\n $event_id = $class->field_event_master['und'][0]['civicrm_reference_id'];\r\n $results = civicrm_api('event', 'get', array('id' => $event_id, 'version' => 3));\r\n $event = $results['values'][$event_id];\r\n $options[$event_id] = $event['title'];\r\n }\r\n\r\n asort($options);\r\n return $options;\r\n}", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "public function build_metabox_priority_selector($_class, $_active = \"\") {\r\n \t$mpriorities = wcff()->dao->load_metabox_priorities();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \tif (count($mpriorities) > 0) {\r\n \t\tforeach ($mpriorities as $mpkey => $mpvalue) {\r\n \t\t\t$selected = ($mpkey == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($mpkey) . '\" ' . $selected . '>' . esc_html($mpvalue) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "public function renderCategoriesSelectHTML()\n {\n static $categories;\n\n if (! is_array($categories)) {\n $categories = Category::all();\n }\n\n $list_items = [];\n\n foreach ($categories as $category) {\n // always start only from the top parent categories in the tree\n if (0 === $category->category_parent_id) {\n $list_items[] = $this->renderCategorySelectHTML($category);\n }\n }\n\n $list_items = implode('', $list_items);\n\n if ('' === trim($list_items)) {\n return '';\n }\n\n return '<select id=\"select21\" class=\"form-control\" name=\"parent_category\">' . $list_items . '</select>';\n }", "public static function selectOptions()\n {\n $options = (new static())->withQuery(function ($model){\n return $model->where('channel', self::$channel);\n })->buildSelectOptions();\n\n return collect($options)->prepend('请选择分类', 0)->all();\n }", "function build_category_html($selected)\n\t{\n\t\tglobal $template, $db;\n\n\t $html = '<select name=\"category_id\" class=\"forminput\">';\n\t\n\t $sql = \"SELECT * FROM \" . GARAGE_CATEGORIES_TABLE . \" ORDER BY title ASC\";\n\t\n\t \tif ( !($result = $db->sql_query($sql)) )\n\t \t{\n\t \tmessage_die(GENERAL_ERROR, 'Could not category of mods for vehicle', '', __LINE__, __FILE__, $sql);\n\t \t}\n\t\n\t while ( $row = $db->sql_fetchrow($result) ) \n\t\t{\n\t\t\t$select = ( $selected == $row['id'] ) ? ' selected=\"selected\"' : '';\n\t\t\t$html .= '<option value=\"' . $row['id'] . '\"' . $select . '>' . $row['title'] . '</option>';\n\t }\n\t\n\t $html .= '</select>';\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'CATEGORY_LIST' => $html)\n\t\t);\n\t\n\t\treturn ;\n\t}", "function mfcs_get_reviewer_classification_list_options($option = NULL, $hidden = FALSE, $disabled = FALSE) {\n if (!is_bool($hidden)) {\n $hidden = FALSE;\n }\n\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_REVIEWER_CLASSIFICATION_NONE] = 'None';\n }\n\n $options_all[MFCS_REVIEWER_CLASSIFICATION_SYSTEM_ADMINISTRATOR] = 'System Administrator';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_MANAGER] = 'Manager';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_REQUESTER] = 'Requester';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_SYSTEM] = 'System';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_VENUE_COORDINATOR] = 'Venue Coordinator';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_VENUE_COORDINATOR_PROXY] = 'Venue Coordinator Proxy';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_ADMINISTRATIVE_ACCOUNTING] = 'Administrative Accounting';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_CUSTODIAL] = 'Custodial';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_UNIVERSITY_EVENTS] = 'University Events';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_FACILITIES_CUSTODIAL] = 'Facilities / Custodial Services';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_FACILITIES] = 'Facilities';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_FACULTY_ADVISER] = 'Faculty Adviser';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_FOOD_SERVICES] = 'Food Services';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_HOUSING] = 'Housing';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_MAINTENANCE] = 'Maintenance';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_PURCHASING] = 'Purchasing / Insurance';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_SECURITY] = 'Security / University Police';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_STUDENT_ACTIVITIES_ADMINISTRATION] = 'Student Activities Administration';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_UNIVERSITY_SERVICES] = 'University Services';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_GROUNDS] = 'Grounds';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_FINANCIAL] = 'Financial';\n $options_all[MFCS_REVIEWER_CLASSIFICATION_INSURANCE] = 'Insurance';\n\n\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n\n if (!$hidden) {\n unset($options[MFCS_REVIEWER_CLASSIFICATION_VENUE_COORDINATOR]);\n unset($options[MFCS_REVIEWER_CLASSIFICATION_VENUE_COORDINATOR_PROXY]);\n unset($options[MFCS_REVIEWER_CLASSIFICATION_SYSTEM_ADMINISTRATOR]);\n unset($options[MFCS_REVIEWER_CLASSIFICATION_MANAGER]);\n unset($options[MFCS_REVIEWER_CLASSIFICATION_REQUESTER]);\n unset($options[MFCS_REVIEWER_CLASSIFICATION_SYSTEM]);\n }\n\n if (!$disabled) {\n unset($options[MFCS_REVIEWER_CLASSIFICATION_FACILITIES_CUSTODIAL]);\n }\n\n asort($options);\n\n return $options;\n}", "private function buildselectforwatches() {\n $this->isirdb->join('spis2users_watches', 'users_watches.id = spis2users_watches.watched_id', 'left');\n $this->isirdb->join('spis', 'spis2users_watches.spis_id = spis.id', 'left');\n\n $this->isirdb->select('\n users_watches.id AS id, \n users_watches.name AS name, \n users_watches.ic AS ic, \n users_watches.rc AS rc, \n users_watches.birthdate AS birthdate, \n users_watches.firstname AS firstname, \n users_watches.note AS note,\n users_watches.clientname AS clientname,\n has_likvidace AS likvidace,\n has_vat_debtor AS vatdebtor,\n has_account_change AS account_change,\n GROUP_CONCAT(spis.id, \"|\", spis.status_id SEPARATOR \",\") AS spises,\n users_watches.official_name AS official_name'\n , false);\t\t\t\t\t\t\n }", "function BBClassesList($type = 'text')\n {\n $lists = Classes::where('type', $type)->lists('name', 'id');\n $lists->prepend('Select Class', '');\n\n return $lists;\n }", "private function renderSelection() {\n\t\t$selection = $this->getSelection();\n\t\tif ($selection === false) {\n\t\t\treturn '';\n\t\t}\n\t\t$itemList = '';\n\t\tforeach ($selection as $item) {\n\t\t\t$itemList .= '\n\t\t\t\t<div class=\"catelem\" id=\"y_'.$item['SKU'].'\">\n\t\t\t\t\t<span class=\"toggle leaf\" id=\"y_toggle_'.$item['SKU'].'\">&nbsp;</span>\n\t\t\t\t\t<div class=\"catname\" id=\"y_select_'.$item['SKU'].'\">\n\t\t\t\t\t\t<span class=\"catname\">'.fixHTMLUTF8Entities($item['products_name'].' ('.$item['SKU'].')').'</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\t}\n\t\treturn $itemList;\n\n\t}", "function generateHTMLcboCompanies($selected=\"\", $class=\"\"){\n\t\t\t\treturn arraySelect($this->Companies(), \"idcompany_todo\", \"class=\\\"$class\\\" tabindex=\\\"8\\\" onchange=\\\"javascript:changeProject_todo();\\\" \", $selected, true, false);\n\t\t\t\t\n\t\t\t}", "public function getNewChildSelectOptions()\n {\n $productCondition = Mage::getModel('smile_virtualcategories/rule_condition_product');\n $productAttributes = $productCondition->loadAttributeOptions()->getAttributeOption();\n $attributes = array();\n\n foreach ($productAttributes as $code=>$label) {\n $attributes[] = array('value' => 'smile_virtualcategories/rule_condition_product|'.$code, 'label' => $label);\n }\n\n $conditions = array(\n array(\n 'value' => '',\n 'label' => Mage::helper('rule')->__('Please choose a condition to add...')\n ),\n array(\n 'value' => 'smile_virtualcategories/rule_condition_combine',\n 'label' => Mage::helper('catalogrule')->__('Conditions Combination')\n ),\n array(\n 'value' => $attributes,\n 'label' => Mage::helper('catalogrule')->__('Product Attribute')\n )\n );\n\n return $conditions;\n }", "private function getSelectOptions() {\n $result = \"\";\n if($this->pleaseSelectEnabled) {\n $result .= '<option value=\"null\"> -- Please Select --</option>';\n }\n foreach($this->itemList as $key => $val) {\n $selectedText = \"\";\n if(in_array($key, $this->selectedItems)) {\n $selectedText = 'selected=\"selected\"';\n }\n $result .= '<option value=\"'.$key.'\" '.$selectedText.'>'.$val.'</option>'.\"\\n \\t\";\n }\n return $result;\n }", "public function getNewChildSelectOptions()\n {\n $hlr = Mage::helper('amsegments');\n \n $conditions = array(\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Subscriber::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_subscriber',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Visit::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_visit',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Registration::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_registration',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Birthday::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_birthday',\n )\n );\n \n \n $prefix = 'amsegments/segment_condition_customer_';\n $conditions = array_merge_recursive($conditions, Mage::getModel($prefix.'attributes')->getNewChildSelectOptions());\n\n return array(\n 'value' => $conditions,\n 'label'=>Mage::helper('amsegments')->__('Registered Customers')\n );\n }", "public function build()\n\t{\n\t\tparent::build();\n\n\t\t$options = $this->suppliedOptions;\n\n\t\t$dataOptions = $options['options'];\n\n\t\t// Check if function\n\t\tif(\\is_callable($dataOptions)){\n\t\t\t$dataOptions = \\call_user_func($dataOptions);\n\t\t}\n\n\t\t$options['options'] = array();\n\n\t\t//iterate over the options to create the options assoc array\n\t\tforeach ($dataOptions as $val => $text)\n\t\t{\n\t\t\t$options['options'][] = array(\n\t\t\t\t'id' => is_numeric($val) && (!array_key_exists('enum_numeric_keys', $options) || $options['enum_numeric_keys'] == false) ? $text : $val,\n\t\t\t\t'text' => $text,\n\t\t\t);\n\t\t}\n\n\t\t$this->suppliedOptions = $options;\n\t}", "public function initOptions() {\n\t\t$this->loadModel( 'RiskClassificationType' );\n\n\t\t$bcps = $this->BusinessContinuity->BusinessContinuityPlan->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'BusinessContinuityPlan.security_service_type_id !=' => SECURITY_SERVICE_DESIGN\n\t\t\t),\n\t\t\t'order' => array('BusinessContinuityPlan.title' => 'ASC'),\n\t\t\t'recursive' => -1\n\t\t));\n\n\t\t$mitigate_id = RISK_MITIGATION_MITIGATE;\n\n\t\t$accept_id = RISK_MITIGATION_ACCEPT;\n\n\t\t$transfer_id = RISK_MITIGATION_TRANSFER;\n\n\t\t$this->set('classifications', $this->BusinessContinuity->getFormClassifications());\n\t\t$this->set('bcps', $bcps);\n\t\t$this->set('mitigate_id', $mitigate_id);\n\t\t$this->set('accept_id', $accept_id);\n\t\t$this->set('transfer_id', $transfer_id);\n\t\t$this->set('calculationMethod', $this->BusinessContinuity->getMethod());\n\t}", "private function buildControls(){\n\n\t\t//create key - label pairs for this dropdown:\n\n\t\t$name = '_column_type_'.$this->fullId;\n\t\t$types = $this->getTypes();\n\n\t\tif( $this->referenceMode )\n\t\t\t$name = 'reference_'.$this->fullId;\n\n\n\t\tif( sizeof( $types ) > 1 ){\n\t\t\t\n\t\t\t$typeSelector = Field::select(\n\t\t\t\t$name,\n\t\t\t\t'',\n\t\t\t\t$types,\n\t\t\t\tarray(\n\t\t\t\t\t'defaultValue' => $this->type\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$class = 'column-controls column-choices-available';\n\n\t\t}else{\n\t\t\t$class = 'column-controls';\n\t\t\t$key = array_keys( $types );\n\t\t\t$typeSelector = Field::hidden( \n\t\t\t\t$name, \n\t\t\t\t[ \n\t\t\t\t\t'defaultValue' => $this->type, \n\t\t\t\t\t'class' => 'type-select'\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\techo '<div class=\"'.$class.'\">';\n\n\t\t\t//render the dropdown:\n\t\t\t$typeSelector->render();\n\t\t\techo '<h3 class=\"column-type\">'.$types[ $this->type ].'</h3>';\n\n\t\t\t//sorter\n\t\t\techo '<span class=\"sort dashicons dashicons-leftright\"></span>';\n\n\t\techo '</div>';\n\n\t}", "public function getNewChildSelectOptions()\n {\n $addressCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_address'\n );\n $addressAttributes = $addressCondition->loadAttributeOptions()\n ->getAttributeOption();\n $attributes = array();\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_subtotal',\n 'label' => Mage::helper('giftpromo')->__('Sub Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_grandtotal',\n 'label' => Mage::helper('giftpromo')->__('Grand Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_discounttotal',\n 'label' => Mage::helper('giftpromo')->__(\n 'Sub Total After Discounts'\n ));\n\n foreach ($addressAttributes as $code => $label) {\n $attributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_address|'\n . $code, 'label' => $label);\n }\n\n\n $checkoutCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_checkout'\n );\n $checkoutAttributes = $checkoutCondition->loadAttributeOptions()\n ->getAttributeOption();\n $chAttributes = array();\n\n foreach ($checkoutAttributes as $code => $label) {\n $chAttributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_checkout|'\n . $code, 'label' => $label);\n }\n\n $customerRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_customer_conditions',\n 'label' => Mage::helper('giftpromo')->__(\n 'Customer conditions combination'\n ))\n );\n $productRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_found',\n 'label' => Mage::helper('giftpromo')->__(\n 'Product attribute combination'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect',\n 'label' => Mage::helper('giftpromo')->__(\n 'Products Sub Selection'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect_free',\n 'label' => Mage::helper('giftpromo')->__('Cheapest Free')\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_upgrade',\n 'label' => Mage::helper('giftpromo')->__('Product Upgrades')\n )\n );\n\n $conditions = parent::getNewChildSelectOptions();\n $conditions = array_merge_recursive(\n $conditions,\n array(\n array('label' => Mage::helper('giftpromo')->__(\n 'Cart Attributes'\n ), 'value' => $attributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Checkout Attributes'\n ), 'value' => $chAttributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Customer Related Rules'\n ), 'value' => $customerRules),\n array('label' => Mage::helper('giftpromo')->__(\n 'Product Related Rules'\n ), 'value' => $productRules),\n // array('value' => 'giftpromo/promo_rule_condition_twitter_conditions', 'label' => Mage::helper('giftpromo')->__('Twitter conditions combination')),\n )\n );\n\n return $conditions;\n }", "public function list_for_select(){\n\n\n $categories = new OsServiceCategoryModel();\n $categories = $categories->get_results();\n $response_html = '<option value=\"0\">'.__('Uncategorized', 'latepoint').'</option>';\n foreach($categories as $category){\n $response_html.= '<option>'.$category->name.'</option>';\n }\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n }", "public static function dropDownListCategories()\n {\n $array=CategoriesLevelOne::find()->with('relationParentCategory')->all();\n foreach($array as $key=>$value)\n {\n $array_temp[$key][\"id\"]=$value->id;\n $array_temp[$key][\"name\"]=Yii::t('app', $value->name);\n $array_temp[$key][\"class\"]=Yii::t('app', $value->relationParentCategory->name);\n }\n return ArrayHelper::map($array_temp, 'id', 'name', 'class');\n }", "public function uc_required_class_list($optlist = '', $just_ids = FALSE)\n\t{\n\t\t$ret = array();\n\t\tif (!$optlist) $optlist = 'public,guest,nobody,member,classes';\t\t// Set defaults to simplify ongoing processing\n\n\t\tif ($optlist == 'editable')\n\t\t{\n\t\t\t$temp = array_flip(explode(',',$this->get_editable_classes()));\n\t\t\tif ($just_ids) return $temp;\n\t\t\tforeach ($temp as $c => $t)\n\t\t\t{\n\t\t\t\t$temp[$c] = $this->class_tree[$c]['userclass_name'];\n\t\t\t}\n\t\t\treturn $temp;\n\t\t}\n\n\t\t//TODO - $optlist == all\n\t\t$opt_arr = explode(',',$optlist);\n\t\tforeach ($opt_arr as $k => $v)\n\t\t{\n\t\t\t$opt_arr[$k] = trim($v);\n\t\t}\n\n\t\t$opt_arr = array_flip($opt_arr);\t\t// This also eliminates duplicates which could arise from applying the other options, although shouldn't matter\n\n\t\tif (isset($opt_arr['force'])) unset($opt_arr['filter']);\n\n\t\tif (isset($opt_arr['blank']))\n\t\t{\n\t\t\t$ret[e_UC_BLANK] = 1;\n\t\t}\n\n\t\t// Do the 'fixed' classes next\n\t\tforeach ($this->text_class_link as $k => $v)\n\t\t{\n\t\t\t//\t\tif (isset($opt_arr[$k]) || isset($opt_arr['force']))\n\t\t\tif (isset($opt_arr[$k]))\n\t\t\t{\n\t\t\t\t$ret[$v] = $just_ids ? '1' : $this->fixed_classes[$v];\n\t\t\t}\n\t\t}\n\n\t\t// Now do the user-defined classes\n\t\tif (isset($opt_arr['classes']) || isset($opt_arr['force']))\n\t\t{\t// Display those classes the user is allowed to:\n\t\t\t//\tMain admin always sees the lot\n\t\t\t//\ta) Mask the 'fixed' user classes which have already been processed\n\t\t\t// b) Apply the visibility option field ('userclass_visibility')\n\t\t\t// c) Apply the matchclass option if appropriate\n\t\t\tforeach($this->class_tree as $uc_id => $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($uc_id,$this->fixed_classes)\n\t\t\t\t&& ( getperms('0')\n\t\t\t\t\t|| (\n\t\t\t\t\t\t(!isset($optlist['matchclass']) || check_class($uc_id))\n\t\t\t\t\t\t&& (!isset($optlist['filter']) || check_class($row['userclass_visibility']))\n\t\t\t\t\t )\n\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t $ret[$uc_id] = $just_ids ? '1' : $this->class_tree[$uc_id]['userclass_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Above loop slightly changes the display order of earlier code versions.\n\t\t\tIf readonly must be last, delete it from the $text_class_link array, and uncomment the following code\n\n\t\t\tif (isset($opt_arr['readonly']))\n\t\t\t{\n\t\t\t $ret[e_UC_READONLY] = $this->class_tree[e_UC_READONLY]['userclass_description'];\n\t\t\t}\n\t\t*/\n\t\t\t\n\t\treturn $ret;\n\t}", "static function get_dropdown_options()\n {\n $rows = ORM::factory('actor')->where('parent_id=0')->orderby('actor')->find_all();\n \n foreach ($rows as $row){\n $hijos = array();\n $_t = ORM::factory('actor')->where('parent_id',$row->id)->orderby('actor')->select_list('id','actor');\n\n foreach($_t as $_id => $_n) {\n\n $_hijos = ORM::factory('actor')->where('parent_id',$_id)->orderby('actor')->select_list('id','actor');\n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_hijos);\n \n /* \n foreach($_hijos as $_idn => $_nn) {\n $_h[] = array('id' => $_idn, 'n' => $_nn, 'h' => ORM::factory('actor')->where('parent_id',$_idn)->select_list('id','actor'));\n }\n \n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_h);\n */\n }\n \n $opts[] = array('id' => $row->id, 'n' => $row->actor, 'h' => $hijos);\n }\n return $opts;\n }", "function get_faculty_selections($con) {\n\t$facs = get_faculties($con);\n\t$sel = '<option value=\"\"></option>';\n\tforeach ($facs as $id => $name) {\n\t\t$sel .= '<option value=\"'.$id.'\">'.$name.'</option>';\n\t}\n\treturn $sel;\n}", "public function getNewChildSelectOptions()\n {\n return array('value' => $this->getType(),\n 'label' => Mage::helper('bronto_reminder')->__('SKU'));\n }", "public function initializeSelectors() {\n $this->addToHead(\"<link rel=\\\"stylesheet\\\" href=\\\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css\\\">\",\n Page::BOTTOM);\n $this->addToHead(\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js\\\"></script>\",\n Page::BOTTOM);\n }", "function getNationalityDropdownList($name, $initVal=\"\", $js=\"\") {\n $dList = \"<SELECT id=\\\"$name\\\" name=\\\"$name\\\" $js class=\\\"select\\\"><option value=\\\"\\\">Select from List</option>\";\n $dList.=\"<option value=\\\"British\\\">British</option>\";\n $nationalities = $this->getDBRecords(\"select label as name,value as id from nationality order by label\");\n for ($i = 0; $i < count($nationalities); $i++) {\n\n if (rtrim($initVal) == rtrim($nationalities[$i][\"id\"])) {\n $sel = \"selected\";\n }\n else\n $sel=null;\n $dList.= \"<option $sel value=\\\"\" . rtrim($nationalities[$i][\"id\"]) . \"\\\">\" . $nationalities[$i][\"name\"] . \"</option>\";\n }\n $dList.= \"</SELECT>\";\n\n return $dList;\n }", "public function build_products_tag_selector($_class, $_active = \"\") {\r\n \t$ptags = wcff()->dao->load_product_tags();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \t$html .= '<option value=\"-1\">'. __(\"All Tags\", \"wc-fields-factory\") .'</option>';\r\n \tif (count($ptags) > 0) {\r\n \t\tforeach ($ptags as $ptag) {\r\n \t\t\t$selected = ($ptag[\"id\"] == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($ptag[\"id\"]) . '\" ' . $selected . '>' . esc_html($ptag[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "public function getNewChildSelectOptions()\n {\n $prefix = 'enterprise_customersegment/segment_condition_customer_address_';\n $result = array_merge_recursive(parent::getNewChildSelectOptions(), array(\n array(\n 'value' => $this->getType(),\n 'label' => Mage::helper('enterprise_customersegment')->__('Conditions Combination')\n ),\n Mage::getModel($prefix.'default')->getNewChildSelectOptions(),\n Mage::getModel($prefix.'attributes')->getNewChildSelectOptions(),\n ));\n return $result;\n }", "function getSelectionOptions($filter) {\r\n global $parentCategory;\r\n if ($filter->isConditional()) {\r\n //displays the filter if the parent category is in the children category list\r\n if (!in_array($parentCategory, $filter->getCategory())) {\r\n //if its not found the function is returned\r\n return;\r\n }\r\n }\r\n //subvalues is a list of the items to add to the selection drop down of the filter\r\n $subvalues = array();\r\n if ($filter->isEnum()) {\r\n $subvalues = explode(\"','\", getEnumValues($filter->getTable(), $filter->getColumn()));\r\n } else {\r\n $subvalues = getColumList($filter->getTable(), $filter->getColumn(), $filter->getJoinTable(), $filter->getJoinColumn(), $filter->getComparator());\r\n }\r\n //if the dropdown is not empty, it'll create a select drop down box and add the values as options\r\n if (!empty($subvalues)) {\r\n $filterName = $filter->getName();\r\n echo $filterName . \": \";\r\n echo '<select name=\"' . $filterName . '\">' . $filterName;\r\n echo '<option></option>';\r\n foreach($subvalues as $sub) {\r\n $option = clean($sub);\r\n echo '<option value=\"' . $option . '\"' . (($_GET[\"$filterName\"] == $option) ? \" selected\" : \"\") . '>' . $option . \"</option>\";\r\n }\r\n echo \"</select> \";\r\n }\r\n }", "public function get_select() {\r\n\t\t$html = '';\r\n\t\tforeach ( $this->taxonomies as $tax ) {\r\n\t\t\t$options = sprintf( '<option value=\"\">%s %s</option>', __('View All', 'themify-portfolio-posts'),\r\n\t\t\tget_taxonomy($tax)->label );\r\n\t\t\t$class = is_taxonomy_hierarchical( $tax ) ? ' class=\"level-0\"' : '';\r\n\t\t\tforeach ( get_terms( $tax ) as $taxon ) {\r\n\t\t\t\t$options .= sprintf( '<option %s%s value=\"%s\">%s%s</option>', isset( $_GET[$tax] ) ? selected( $taxon->slug, $_GET[$tax], false ) : '', '0' !== $taxon->parent ? ' class=\"level-1\"' : $class, $taxon->slug, '0' !== $taxon->parent ? str_repeat( '&nbsp;', 3 ) : '', \"{$taxon->name} ({$taxon->count})\" );\r\n\t\t\t}\r\n\t\t\t$html .= sprintf( '<select name=\"%s\" id=\"%s\" class=\"postform\">%s</select>', esc_attr( $tax ), esc_attr( $tax ), $options );\r\n\t\t}\r\n\t\techo $html;\r\n\t}", "function mfcs_get_request_classification_list_options($option = NULL, $user = NULL, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n $options_to_roles = array();\n\n if ($hidden) {\n $options_all[MFCS_REQUEST_CLASSIFICATION_NONE] = 'None';\n }\n\n $options_all[MFCS_REQUEST_CLASSIFICATION_STUDENT] = 'Student Organization';\n $options_all[MFCS_REQUEST_CLASSIFICATION_CAMPS] = 'Camps';\n $options_all[MFCS_REQUEST_CLASSIFICATION_FACULTY] = 'Faculty, Staff, Athletics';\n $options_all[MFCS_REQUEST_CLASSIFICATION_EXTERNAL] = 'Externals';\n\n $role = user_role_load_by_name('student role');\n if (is_object($role)) {\n $options_to_roles[$role->rid] = MFCS_REQUEST_CLASSIFICATION_STUDENT;\n }\n unset($role);\n\n $role = user_role_load_by_name('camp role');\n if (is_object($role)) {\n $options_to_roles[$role->rid] = MFCS_REQUEST_CLASSIFICATION_CAMPS;\n }\n unset($role);\n\n $role = user_role_load_by_name('employee role');\n if (is_object($role)) {\n $options_to_roles[$role->rid] = MFCS_REQUEST_CLASSIFICATION_FACULTY;\n }\n unset($role);\n\n $role = user_role_load_by_name('external role');\n if (is_object($role)) {\n $options_to_roles[$role->rid] = MFCS_REQUEST_CLASSIFICATION_EXTERNAL;\n }\n unset($role);\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n if (is_object($user)) {\n $is_manager = user_access('mfcs manager', $user);\n $is_administer = user_access('mfcs administer', $user);\n\n if ($is_manager || $is_administer) {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n }\n\n foreach ($options_to_roles as $role_id => $classification_id) {\n if (array_key_exists($role_id, $user->roles) && array_key_exists($classification_id, $options_all)) {\n $options[$classification_id] = $options_all[$classification_id];\n }\n }\n }\n else {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n }\n\n asort($options);\n\n return $options;\n}", "function initialize () {\n $this->set_openingtag(\"<SELECT[attributes]>\");\n\t$this->set_closingtag(\"</SELECT>\");\n\t$this->set_type (\"list\");\n }", "function categoria($productos) {\r\n $opciones = array(); \r\n foreach($productos->producto as $producto) {\r\n $opciones[] = $producto->categoria;\r\n }\r\n //eliminar los duplicados para mostrar el select con las opciones\r\n $opciones = array_unique($opciones);\r\n\r\n //crear las opciones del select sin repetidos\r\n for ($i=0; $i < count($opciones); $i++) { \r\n echo \"<option value='\" . $opciones[$i] . \"'>\" . ucwords($opciones[$i]) . \"</option>\";\r\n }\r\n }", "public function build_product_variations_selector($_class, $_active = \"\", $_prod_id = 0) { error_log(\"Active : \". $_active); \t\r\n \t$html = \"\";\r\n \t// for variation product list\r\n \t$ptypes = wcff()->dao->load_variable_products();\r\n \t\r\n \tif ($_prod_id == 0 && $_active != \"\") {\r\n \t /* Find out the parent product id */\r\n \t $variable_product = wc_get_product(absint($_active));\r\n \t $_prod_id = $variable_product->get_parent_id();\r\n \t}\r\n \t\r\n \t$html .= '<select class=\"variation_product_list\">';\r\n \t$html .= '<option value=\"0\">'. __(\"All Products\", \"wc-fields-factory\") .'</option>';\r\n \tif (count($ptypes) > 0) {\r\n \t\tforeach ($ptypes as $ptype) {\r\n \t\t\t$selected = ($ptype[\"id\"] == $_prod_id) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($ptype[\"id\"]) . '\" ' . $selected . '>' . esc_html($ptype[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \t// for variation list\r\n \t$ptypes = wcff()->dao->load_product_variations($_prod_id);\r\n \t$html .= '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \t$html .= '<option value=\"-1\">'. __(\"All Variations\", \"wc-fields-factory\") .'</option>';\r\n \tif (count($ptypes) > 0) {\r\n \t\tforeach ($ptypes as $ptype) {\r\n \t\t\t$selected = ($ptype[\"id\"] == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($ptype[\"id\"]) . '\" ' . $selected . '>' . esc_html($ptype[\"title\"]) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "public function setupOptions() {\n $this->data = array('' => '') + $this->data;\n\n if (!isset($this->htmlOptions['class'])) {\n $this->htmlOptions['class'] = '';\n }\n\n // Include the base css if required\n if ($this->includeBaseCss) {\n\n if (stripos($this->htmlOptions['class'], 'yii-selectize') === false) {\n $this->htmlOptions['class'] .= ' yii-selectize';\n }\n\n // Add the full width class if fullWidth option is set to true\n if ($this->fullWidth && stripos($this->htmlOptions['class'], 'full-width') === false) {\n $this->htmlOptions['class'] .= ' full-width';\n }\n } else if ($this->fullWidth) { // if full with is required but the base css is not included\n if (!isset($this->htmlOptions['style'])) {\n $this->htmlOptions['style'] = '';\n }\n\n // we add the style attribute\n if (stripos($this->htmlOptions['style'], 'width:') === false) {\n $this->htmlOptions['style'] .= ' width: 100%;';\n }\n }\n\n // If the placeholder property is set we'll overwrite the htmlOptions attribute\n if (!empty($this->placeholder)) {\n $this->htmlOptions['placeholder'] = $this->placeholder;\n }\n\n // If the multiple property is set we'll overwrite the htmlOptions attribute\n if (!empty($this->multiple)) {\n $this->htmlOptions['multiple'] = $this->multiple;\n }\n\n // Set the selected attributed to the given options\n if (!empty($this->selectedValues)) {\n foreach ($this->selectedValues as $valueId) {\n $this->htmlOptions['options'][$valueId]['selected'] = true;\n }\n }\n\n }", "public function centerlist()\n {\n if ($this->input->post()) {\n $type_id = $this->input->post(\"type_id\");\n $select=array('DISTINCT(other_processing_center_id)');\n $whereArray = array('processing_center' => $type_id);\n $table=Tbl_processing_center;\n //$products = $this->Lead->get_all_products($whereArray);\n $list = $this->master->view($select,$whereArray,$table,$join = array(),$order_by = array());\n//pe($list);\n $center_extra = 'class=\"form-control\" id=\"center_id\"';\n if (!empty($list)) {\n $options[''] = 'select';\n foreach ($list as $key => $value) {\n $procc_name = branchname($value['other_processing_center_id']);\n $options[$value['other_processing_center_id']] = ucwords(strtolower($procc_name[0]['name']));\n }\n $html = '<label>Processing Center:<span style=\"color:red;\">*</span></label>';\n $html .= form_dropdown('center_id', $options, '', $center_extra);\n } else {\n $options[''] = 'select';\n $html = '<label>Processing Center:<span style=\"color:red;\">*</span></label>';\n $html .= form_dropdown('center_id', $options, '', $center_extra);\n }\n echo $html;\n }\n }", "function SelectValuesUnidad($db_conx) {\r\n $sql = \"SELECT uni_codigo, uni_descrip FROM tunidad ORDER BY uni_descrip ASC\";\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select class=\"unidadmedico\" multiple=\"multiple\" id=\"cmbunidad\">';\r\n $c = 0;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "protected function getClassNameOptions()\n {\n $hidden = [];\n $classes = [];\n \n foreach ($this->dbObject('ClassName')->enumValues() as $class) {\n \n if ($class == self::class || !in_array($class, ClassInfo::subclassesFor($this))) {\n continue;\n }\n \n if ($hide = Config::inst()->get($class, 'hide_ancestor')) {\n $hidden[$hide] = true;\n }\n \n if (!$class::singleton()->canCreate()) {\n continue;\n }\n \n $classes[$class] = $class::singleton()->i18n_singular_name();\n \n }\n \n foreach ($hidden as $class => $hide) {\n unset($classes[$class]);\n }\n \n return $classes;\n }", "protected function getRecursiveSelectOptions() {}", "public function getTypes(){\r\n \r\n $options[\"\"] = \"--Select--\";\r\n //Query all users(Lecturers) not assigned to other departments\r\n $types = $this->em->getRepository(\"\\Application\\Entity\\Assessmenttype\")->findBy(array(\"systemGenerated\"=>0));\r\n \r\n foreach($types as $type ){\r\n $options[$type->getPkAtid()] = $type->getTypeName();\r\n }\r\n \r\n return $options;\r\n }", "public function AddCategorieToSelect($data){\n \n for ($i = 0; $i < sizeof($data); $i++) {\n $this->categorie_select->addMultiOption($data[$i]['Nome'], $data[$i]['Nome']);\n }\n\n }", "function build_html_filter($clase, $filtro, $nombre, $valor = SIN_FILTRO){\n $f = '';\n $f .= \"<label for='filters[$filtro]'>\n $nombre</label>&nbsp;\n <select name='filters[$filtro]' onchange='this.parentNode.submit()'>\";\n\n $f.= \"<option value='\".SIN_FILTRO.\"'>--</option>\\n\";\n// <option value='0'>-- Sin $nombre --</option>\\n\";\n\n $instancias = $clase::find('all'); // TODO sustituir por index($filtros)\n // usort TODO\n usort($instancias, function($a, $b){\n return $a->_name > $b->_name;\n });\n foreach ($instancias as $i){\n $selected = '';\n\n if ($valor == $i->id){\n $selected = ' selected=\"selected\"';\n }\n\n $f.= \"<option value='\".$i->id.\"' $selected>\". $i->_name.'</option>';\n }\n $f.= \"</select>\\n\";\n return $f;\n}", "public function milestonOptions(){\n $options= \"\";\n\n foreach($this->all_milestones as $am) {\n $options .= \"<option value='$am->Id'>$am->Name</option>\";\n }\n return $options;\n\n }", "static public function SelectList($values, $name = 'SelectList', $class = 'SelectList', $first = '', $selected = NULL, $disabled = false, $required = false) {\n\n\t\t$html = '<select name=\"' . $name . '\" class=\"' . $class . '\"';\n\t\tif ($disabled) $html .= ' disabled';\n\t\tif ($required) $html .= ' required';\n\t\t$html .='>';\n\n\t\tif (!empty($first)) {\n\n\t\t\t$html .= '<option value=\"\"> - ' . $first . ' - </option>';\n\n\t\t}\n\n\t\tforeach ($values as $key => $value) {\n\n\t\t\tif ($key == $selected) {\n\t\t\t\t$sel = ' selected';\n\t\t\t} else {\n\t\t\t\t$sel = '';\n\t\t\t}\n\n\t\t\t$html .= '<option value=\"' . $key . '\"' . $sel . '>' . $value . '</option>';\n\n\t\t}\n\n\t\t$html .= '</select>';\n\n\t\treturn $html;\n\n\t}", "function get_form_list_select($instance) {\n\t\t$forms = get_option('cc_form_design');\n\n\t\t$output = '';\n\t\t$output .= '<select name=\"'.$this->get_field_name('formid').'\" id=\"'.$this->get_field_id('formid').'\">';\n\t\t$output .= '<option value=\"\">'.__('Select a Form Design', 'consatnt-contact-api').'</option>';\n\n\t\tif(!empty($forms)) {\n\t\t\t$previous_names = array();\n\t\t\tforeach($forms as $form) {\n\n\t\t\t\t$name = isset($form['form-name']) ? $form['form-name'] : 'Form '+$key;\n\n\t\t\t\t$form['truncated_name'] = stripcslashes(trim( wp_html_excerpt( $name, 50 ) ));\n\t\t\t\tif ( isset($form['form-name']) && $form['truncated_name'] != $form['form-name'])\n\t\t\t\t\t$form['truncated_name'] .= '&hellip;';\n\n\t\t\t\tif(!in_array(sanitize_key( $name ), $previous_names)) {\n\t\t\t\t\t$previous_names[] = sanitize_key( $name );\n\t\t\t\t} else {\n\t\t\t\t\t$namekey = sanitize_key( $name );\n\t\t\t\t\t$previous_names[$namekey] = isset($previous_names[$namekey]) ? ($previous_names[$namekey] + 1) : 1;\n\t\t\t\t\t$form['truncated_name'] .= ' ('.$previous_names[$namekey].')';\n\t\t\t\t}\n\n\t\t\t\tif(!empty($form)) {\n\t\t\t\t\t$output .= \"<option value=\\\"{$form['cc-form-id']}\\\"\".selected($this->get_value('formid', $instance), $form['cc-form-id'], false).\">{$form['truncated_name']}</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$output .= '</select>';\n\n\t\treturn $output;\n\t}", "public function build_metabox_context_selector($_class, $_active = \"\") {\r\n \t$mcontexts = wcff()->dao->load_metabox_contexts();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \tif (count($mcontexts) > 0) {\r\n \t\tforeach ($mcontexts as $mckey => $mcvalue) {\r\n \t\t\t$selected = ($mckey == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($mckey) . '\" ' . $selected . '>' . esc_html($mcvalue) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "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 }", "public function getNewChildSelectOptions()\n {\n /** @var CustomGento_ProductBadges_Model_Rule_Condition_Product_BaseCondition $productCondition */\n $productCondition = Mage::getModel('customgento_productbadges/rule_condition_product_baseCondition');\n $productAttributes = $productCondition->loadAttributeOptions()->getAttributeOption();\n\n $attributes = array();\n foreach ($productAttributes as $code => $label) {\n $class = 'customgento_productbadges/rule_condition_product_baseCondition';\n\n $attributes[] = array(\n 'value' => $class . '|' . $code,\n 'label' => $label\n );\n }\n\n // Adding day interval attributes\n /** @var CustomGento_ProductBadges_Model_Rule_Condition_Product_DayInterval $dayIntervalCondition */\n $dayIntervalCondition = Mage::getModel('customgento_productbadges/rule_condition_product_dayInterval');\n $dayIntervalAttribute = $dayIntervalCondition->loadAttributeOptions()->getAttributeOption();\n foreach ($dayIntervalAttribute as $code => $label) {\n $class = 'customgento_productbadges/rule_condition_product_dayInterval';\n\n $attributes[] = array(\n 'value' => $class . '|' . $code,\n 'label' => $label\n );\n }\n\n /** @var CustomGento_ProductBadges_Helper_Config $configHelper */\n $configHelper = Mage::helper('customgento_productbadges/config');\n\n $rulesConfigs = $configHelper->getRulesConfigurations();\n\n /** @var CustomGento_ProductBadges_Model_Rule_Config $configModel */\n foreach ($rulesConfigs as $configModel) {\n $attributes[] = array(\n 'value' => $configModel->getConditionClass() . '|' . $configModel->getInternalCode(),\n 'label' => $configModel->getLabel()\n );\n }\n\n // Sort again alphabetically\n usort($attributes, function ($a, $b) {\n return strcmp($a['label'], $b['label']);\n });\n\n $conditions = array(\n array(\n 'value' => '',\n 'label' => Mage::helper('rule')->__('Please choose a condition to add...')\n ),\n array(\n 'value' => 'catalogrule/rule_condition_combine',\n 'label' => Mage::helper('catalogrule')->__('Conditions Combination')\n ),\n array(\n 'label' => Mage::helper('catalogrule')->__('Product Attribute'),\n 'value' => $attributes\n ),\n );\n\n return $conditions;\n }", "function classificationAction() {\n\n $conn = $this->dbConnection();\n\n // Add data to the site ..\n $em = Zend_Registry::get('em');\n\n $query = $em->createQueryBuilder()\n ->select('COUNT(r.ResponseId) as totOpt,\n SUM(IF(r.Points = q.Points, 1, 0) ) correctOpt,\n SUM(IF(r.Points <> q.Points, 1, 0) ) wrongOpt,\n ')\n ->from('Testcreator_Model_Tests', 't')->setMaxResults(10)->getQuery();\n\n // Single text answers ..\n $sql = \" SELECT\n COUNT(R.ResponseId) as totOpt,\n SUM(IF(R.RES_Points = Q.QUE_Points, 1, 0) ) correctOpt,\n SUM(IF(R.RES_Points <> Q.QUE_Points, 1, 0) ) wrongOpt,\n C.ClassificationId,\n C.CLA_Name,\n RT.FK_UserId\n FROM\n t2_sa_results.T_Response R,\n t2_sa_results.T_ResponseTest RT,\n t2_sa_results.T_ResponseText RTE,\n t2_sa_repositories.T_Questions Q,\n t2_sa_repositories.QuestionClassifications QC,\n t2_sa_classifications .T_Classifications C\n WHERE\n RT.ResponseTestId = R.FK_ResponseTestId\n AND\n Q.QuestionId =R.FK_QuestionId\n AND\n R.ResponseId = RTE.FK_ResponseId\n AND\n Q.QuestionId = QC.FK_QuestionId\n AND\n C.ClassificationId = QC.FK_ClassificationId\n GROUP BY\n C.ClassificationId,RT.FK_UserId \";\n\n $result3 = $conn->query($sql) or die(mysqli_error($conn));\n\n if(isset($result3) && $result3->num_rows > 0) {\n\n while($clsObj = $result3->fetch_array(MYSQLI_ASSOC)) {\n // Get the Classification of User ..\n // $this->saveClassifications($clsObj,$conn);\n }\n }\n\n // Multi choice Answers\n $sql1 = \" SELECT COUNT(R.ResponseId) as totOpt,\n SUM(IF(R.RES_Points = Q.QUE_Points, 1, 0) ) correctOpt,\n SUM(IF(R.RES_Points <> Q.QUE_Points, 1, 0) ) wrongOpt,\n C.ClassificationId,\n C.CLA_Name,\n RT.FK_UserId\n FROM\n t2_sa_repositories.T_QuestionsChoiceOptions QC,\n t2_sa_repositories.T_Questions Q,\n t2_sa_results.T_ResponseChoice RC,\n t2_sa_results.T_Response R,\n t2_sa_results.T_ResponseTest RT,\n t2_sa_repositories.QuestionClassifications QCA,\n t2_sa_classifications .T_Classifications C\n\n WHERE\n Q.QuestionId = QC.FK_QuestionId\n AND\n QC.QuestionChoiceOptionId = RC.FK_QuestionChoiceOptionId\n AND\n R.ResponseId = RC.FK_ResponseId\n AND\n RT.ResponseTestId = R.FK_ResponseTestId\n AND\n Q.QuestionId = QCA.FK_QuestionId\n AND\n C.ClassificationId = QCA.FK_ClassificationId\n GROUP BY R.FK_QuestionId,RT.FK_TestId \";\n\n $result4 = $conn->query($sql1) or die(mysqli_error($conn));\n if(isset($result4) && $result4->num_rows > 0) {\n while($clsObj = $result4->fetch_array(MYSQLI_ASSOC)) {\n // Get the Classification of User ..\n $this->saveClassifications($clsObj,$conn);\n }\n }\n exit;\n }", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "public function getNewChildSelectOptions()\n {\n $productAttributes = $this->_ruleConditionProd->loadAttributeOptions()->getAttributeOption();\n $pAttributes = [];\n $iAttributes = [];\n foreach ($productAttributes as $code => $label) {\n if (strpos($code, 'quote_item_') === 0) {\n $iAttributes[] = [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product::class . '|' . $code,\n 'label' => $label,\n ];\n } else {\n $pAttributes[] = [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product::class . '|' . $code,\n 'label' => $label,\n ];\n }\n }\n\n $conditions = parent::getNewChildSelectOptions();\n $conditions = array_merge_recursive(\n $conditions,\n [\n [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine::class,\n 'label' => __('Conditions Combination'),\n ],\n ['label' => __('Cart Item Attribute'), 'value' => $iAttributes],\n ['label' => __('Product Attribute'), 'value' => $pAttributes]\n ]\n );\n return $conditions;\n }", "public function getClassifications()\n {\n $taxes = Tax::where('archived', '=', 0);\n\n return Datatables::of($taxes)\n ->editColumn('id', function ($tax) {\n return '<a href=\"' . url('admin/classification/' . $tax->id . '/edit') . '\">' . $tax->id . '</a>';\n })\n ->editColumn('duty', function ($tax) {\n return number_format($tax->duty, 2) . '%';\n })\n ->editColumn('enabled', function ($tax) {\n return $tax->enabled ? '<span style=\"color: green;\">Enabled</span>' : '<span class=\"txt-archived\">Disabled</span>';\n })\n ->make(true);\n }", "function abl_droploader_get_image_cat_select() {\n\t\t$image_categories = getTree('root', 'image');\n\t\t//$image_categories_select = str_ireplace(\"\\n\", '', tag('<label for=\"image-category\">' . gTxt('image_category') . '</label>' . br .\n\t\t//\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id=\"abl-droploader-image-cat-sel\" class=\"category\"'));\n\t\t//$alt_caption =\ttag('<label for=\"alt-text\">'.gTxt('alt_text').'</label>'.br.\n\t\t//\t\tfInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class=\"alt text\"').\n\t\t//\ttag('<label for=\"caption\">'.gTxt('caption').'</label>'.br.\n\t\t//\t\t'<textarea id=\"caption\" name=\"caption\"></textarea>'\n\t\t//\t\t, 'div', ' class=\"caption description text\"');\n\t\t$image_categories_select = str_ireplace(\"\\n\", '', tag(tag('<label for=\"image-category\">'.gTxt('image_category').'</label>'.br.\n\t\t\t\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class=\"category\"'), 'div', ' id=\"abl-droploader-image-cat-sel\"'));\n\t\treturn $image_categories_select;\n\t}", "function osa_webform_options_class_types($component, $flat, $arguments) {\r\n\r\n // get the list of group classes and make a list of types\r\n $cid = $_GET['cid'];\r\n $nodes = &_osa_get_class_nodes($cid);\r\n \r\n $options = array();\r\n $option_labels = osa_options_class_types();\r\n foreach ($nodes as $class) {\r\n $options[$class->field_class_type['und'][0]['value']] = $option_labels[$class->field_class_type['und'][0]['value']];\r\n }\r\n\r\n asort($options);\r\n return $options;\r\n}", "public function prepare_pagination_select_options () {\n if ( ! $this->total_pages ) {\n return NULL;\n }\n\n $out = '';\n for( $x = 1; $x <= $this->total_pages; $x++ ){\n if( $x === $this->page ){\n $selected = 'selected=\"selected\"';\n } else {\n $selected = '';\n }\n $out .= '<option value=\"'.$x.'\" '.$selected.'>'.$x.'</option>';\n }\n\n return $out;\n }", "function getNameOptions(){\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n \n // Select some fields\n //$query->select('DISTINCT name');\n $query->select('name');\n // From the hello table\n $query->from('#__helloworld_message');\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList();\n\t\t\t\n\t\t\tforeach($result as $item){\n\t\t\t\t$name = $item->name;\n\t\t\t\t$filter_name_options[] = JHTML::_('select.option', $name , $name);\n\t\t\t\t}\n\t\t\treturn $filter_name_options;\n\t\t\t\n\t\t\t}", "function classgraphAction() {\n\n // get entity manager from registry\n $em = Zend_Registry::get('em');\n\n $form = new Zend_Form();\n // Translate Object ..\n $translate = Zend_Registry::get('Zend_Translate');\n\n $res = $em->createQueryBuilder()->select('DISTINCT(cla.CLA_Name),cla.ClassificationId')\n ->from('Application_Model_QuestionClassifications', 'qc')\n ->from('Response', 'r')\n ->innerJoin('qc.FK_ClassificationId','cla')\n ->innerJoin('qc.FK_QuestionId','q')\n ->where('r.QuestionId = q.QuestionId')->getQuery();\n\n $ClsResultArr = $res->getResult();\n\n $parentClsArr = array();\n $classificationArr= array();\n\n if(is_array($ClsResultArr) && count($ClsResultArr) > 0) {\n foreach($ClsResultArr as $val) {\n $parentClassificationId = $this->getParentClassificationId($val['ClassificationId']);\n\n // get Classification Name\n $qry =$em->createQueryBuilder()->select('cla.CLA_Name')\n ->from('Application_Model_Classifications','cla')\n ->where('cla.ClassificationId='.$this->classParentId)\n ->getQuery();\n $classArr = $qry->getResult();\n $parentClsArr[$this->classParentId] = $classArr[0]['CLA_Name'];\n $classificationArr[] = array(\"className\"=>$val['CLA_Name'], \"classificationId\"=>$val['ClassificationId'],\"parentId\"=>$this->classParentId);\n }\n }\n\n $selClassifications = new Zend_Form_Element_Select('parentClassId', array(\n \"label\" => $translate->_(\"Select Classification\"),\n \"required\" => true,\n ));\n\n $selClassifications->addMultiOptions($parentClsArr);\n\n $form->addElements(array($selClassifications));\n\n $form->addElement(new Zend_Form_Element_Submit(\"Search\"));\n\n $form->setDecorators(array(\n 'FormElements',\n array('HtmlTag', array('tag' => 'dt', 'class' => 'mapping_form')),\n array('Description', array('placement' => 'prepend')),\n 'Form'\n ));\n\n $qry =$em->createQueryBuilder()->select(\n 'COUNT(q.QuestionId) as totOpt,\n SUM(CASE\n WHEN (r.Points = q.QUE_Points) THEN 1\n ELSE 0\n END) as correctPoints,\n SUM(CASE\n WHEN (r.Points <> q.QUE_Points) THEN 1\n ELSE 0\n END) as wrongPoints,\n q.QUE_Points as QuePoints,\n cla.ClassificationId,\n cla.CLA_Name\n '\n )\n ->from('Application_Model_QuestionClassifications','qc')\n ->from('Response','r')\n ->innerJoin('qc.FK_ClassificationId','cla')\n ->innerJoin('qc.FK_QuestionId','q')\n ->where( 'r.QuestionId = q.QuestionId ')\n ->groupBy('cla.ClassificationId')\n ->orderBy('cla.ClassificationId', 'ASC')\n ->getQuery();\n\n $classPointsArr = $qry->getResult();\n\n $classArr = array();\n $resArr1 = array();\n\n $parentClsId = 1;\n\n // Prepare Json data for classification Array.\n foreach($classPointsArr as $val) {\n\n $avgCnt = ($val['correctPoints']/$val['totOpt']*100);\n\n if(!in_array($val['ClassificationId'],$classArr)) {\n $classArr[$val['ClassificationId']]=$val['CLA_Name'];\n $resArr1[$val['ClassificationId']]['me']= round($avgCnt,2);\n $resArr1[$val['ClassificationId']]['mi']= 0;\n $resArr1[$val['ClassificationId']]['ma']= 100;\n } else {\n $resArr1[$val['ClassificationId']]['me']= round($avgCnt,2);\n $resArr1[$val['ClassificationId']]['mi']= 0;\n $resArr1[$val['ClassificationId']]['ma']= 100;\n // $resArr1[$val['ClassificationId']][$val['QuestionId']]= $val['correctPoints'];\n }\n\n // Check if classification already exists in database or not\n $qry = $em->createQueryBuilder()->select('gcl.GraphClassificationId')\n ->from('GraphClassifications','gcl')\n ->innerJoin('gcl.ClassificationId','c')\n ->where('c.ClassificationId='.$val['ClassificationId'])\n ->getQuery();\n\n $graphClassArr = $qry->getResult();\n\n if(is_array($graphClassArr) && count($graphClassArr) > 0) {\n\n } else {\n $graphClassObj = new GraphClassifications();\n $graphClassObj->setClassificationId($em->find('Application_Model_Classifications', $val['ClassificationId']));\n\n $graphClassObj->setTotalQuestions($val['totOpt']);\n $graphClassObj->setCorrectAnswers($val['correctPoints']);\n $graphClassObj->setWrongAnswers($val['wrongPoints']);\n $graphClassObj->setParentClassificationId($parentClsId);\n $graphClassObj->setScore(round($avgCnt,2));\n $graphClassObj->setCreatedDate();\n $graphClassObj->setModifiedDate();\n\n $em->persist($graphClassObj);\n $em->flush();\n }\n }\n\n $qry = $em->createQueryBuilder()\n ->select('c.ClassificationId, c.CLA_Name, gcl.TotalQuestions,gcl.CorrectAnswers')\n ->from('GraphClassifications','gcl')\n ->innerJoin('gcl.ClassificationId','c')\n ->where('gcl.ParentClassificationId='.$parentClsId)\n ->getQuery();\n\n $graphRes = $qry->getResult();\n\n $measureStr = \"\";\n $labelStr = \"\";\n if(is_array($graphRes) && count($graphRes) >0) {\n $cnt= 0;\n foreach($graphRes as $val) {\n if($cnt == (count($classArr)-1)) {\n $measureStr.= \"'\".$val['ClassificationId'].\"'\";\n $labelStr.= \"'\".$val['CLA_Name'].\"'\";\n } else {\n $measureStr.= \"'\".$val['ClassificationId'].\"'\".\",\";\n $labelStr.= \"'\".$val['CLA_Name'].\"'\".\",\";\n }\n $cnt++;\n }\n }\n\n $this->view->labelStr =$labelStr;\n $this->view->measureStr =$measureStr;\n\n $jsonStr = '[[\"2006/1\",'.$this->array2json($resArr1).']]';\n\n $fp = fopen($_SERVER['DOCUMENT_ROOT'].'/js/classification.json','w+');\n @fwrite($fp,$jsonStr,strlen($jsonStr));\n @fclose($fp);\n\n $this->view->form = $form;\n $this->view->clsArr = $classificationArr;\n }", "public function getNewChildSelectOptions()\n {\n $addressAttributes = $this->_conditionAddress->loadAttributeOptions()->getAttributeOption();\n $attributes = [];\n foreach ($addressAttributes as $code => $label) {\n $attributes[] = [\n 'value' => 'MageWorx\\ShippingRules\\Model\\Rule\\Condition\\Address|' . $code,\n 'label' => $label,\n ];\n }\n\n $conditions = [\n [\n 'value' => '',\n 'label' => __('Please choose a condition to add.'),\n ],\n [\n 'value' => 'MageWorx\\ShippingRules\\Model\\Rule\\Condition\\Product\\Found',\n 'label' => __('Product attribute combination'),\n ],\n [\n 'value' => 'MageWorx\\ShippingRules\\Model\\Rule\\Condition\\Product\\Subselect',\n 'label' => __('Products subselection'),\n ],\n [\n 'value' => 'MageWorx\\ShippingRules\\Model\\Rule\\Condition\\Combine',\n 'label' => __('Conditions combination'),\n ],\n [\n 'value' => $attributes,\n 'label' => __('Cart Attribute'),\n ],\n ];\n\n $additional = new \\Magento\\Framework\\DataObject();\n\n $this->_eventManager->dispatch(\n 'shipping_rule_condition_combine',\n ['additional' => $additional]\n );\n\n $additionalConditions = $additional->getConditions();\n if ($additionalConditions) {\n $conditions = array_merge_recursive(\n $conditions,\n $additionalConditions\n );\n }\n\n return $conditions;\n }", "public function dd_selreqcategory() {\n $reqtypeid = $this->input->post('sRequestID');\n $ddSelReqcategory = $this->Requestproc_mdl->selreqcategory($reqtypeid);\n //KONDISI JIKA REQUEST TYPENYA SAMA DENGAN 2/PROJECT MAKA ONCHANGE Tidak BELAKU-------------------/\n if ($reqtypeid == 2 || $reqtypeid == 5) {\n echo \"<select class='form-control' name='ReqCategoryID' id='ReqCategoryID' onchange='loadGridItemList()'>\";\n } else {\n echo \"<select class='form-control' name='ReqCategoryID' id='ReqCategoryID' onchange='loadGridItemList()'>\";\n }\n echo \"<option value='' disabled='' selected=''>--Select--</option>\";\n foreach ($ddSelReqcategory as $row) {\n if ($row->BudgetUsed != 0) {\n $RestofBudget = $row->BudgetValue - $row->BudgetUsed;\n } else {\n $RestofBudget = $row->BudgetValue - $row->BudgetUsed;\n }\n echo \"<option value='$RestofBudget>$row->BudgetCOA--$row->ReqCategoryID'>$row->BudgetCOA - $row->ReqCategoryName</option>\";\n// $options .= \"<option value='\" . $k->DivisionID . \"'>\" . $k->DivisionName . \"</option>\";\n }\n echo \"</select>\";\n// $this->load->view('procurement/popupitem_list.js.php');\n }", "function get_college_programs() {\n $list = \"\";\n $list.=\"<select id='programs' style='width:155px;' required>\";\n $list.=\"<option value='0' selected>Program</option>\";\n $query = \"select * from mdl_course where category=5 and cost>0 and visible=1\";\n $result = $this->db->query($query);\n foreach ($result->result() as $row) {\n $list.=\"<option value='$row->id'>$row->fullname</option>\";\n }\n $list.=\"</select>\";\n\n return $list;\n }", "public function classesList(){\n\t\t$data['fl_classes']=array();\n\t\t// get the flight from db\n\t\t$tbl=$this->session->userdata('prefix').'flightclass';\n\t\t// get the db tables list\n\t\t$tableList=getTables(); // define in custom helper\n\t\t// check if the tbl exist in db \n\t\tif(in_array($tbl, $tableList)){\n\t\t\t$data['fl_classes']=$this->Common_model->select($tbl);\n\t\t} \n\t\t$this->show_front('flight/flight_class', $data);\n\t}", "public function getNewChildSelectOptions()\n {\n $conditions = [\n ['value' => $this->getType(), 'label' => __('Conditions Combination')],\n $this->_attributeFactory->create()->getNewChildSelectOptions(),\n ];\n\n $conditions = array_merge_recursive(parent::getNewChildSelectOptions(), $conditions);\n return $conditions;\n }", "function getModelSelectBox($current_mark_id)\n {\n //echo '$current_category_id = '.$current_category_id;\n $category_structure = $this->loadCategoryStructure();\n $mark_structure = $this->load_mark_structure();\n $model_structure = $this->load_model_structure();\n //echo '<pre>';\n //print_r($model_structure);\n $level = 1;\n $rs = '';\n $rs .= '<div id=\"model_id_div\">';\n $rs .= '<select name=\"model_id\">';\n $rs .= '<option value=\"0\">..</option>';\n foreach ($category_structure['childs'][0] as $item_id => $categoryID) {\n //echo $categoryID.'<br>';\n //echo 'items = '.$items.'<br>';\n if ($current_category_id == $categoryID) {\n $selected = \" selected \";\n } else {\n $selected = \"\";\n }\n\n $rs .= '<option disabled>' . str_repeat(' . ', $level) . $category_structure['catalog'][$categoryID]['name'] . '</option>';\n $rs .= $this->get_mark_and_model_option_items($categoryID, $mark_structure, $level, $current_mark_id, $model_structure);\n $rs .= $this->getChildNodes($categoryID, $category_structure, $level + 1, $current_category_id);\n }\n $rs .= '</select>';\n $rs .= '</div>';\n return $rs;\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "protected function getOptions() {\n\n\n\t\t$catId = $this->element['catid'] ? (string) $this->element['catid'] : -1;\n\t\t$db = JFactory::getDBO();\n\n //build the list of categories\n\t\t$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'\n\t\t. ' FROM #__phocagallery_categories AS a'\n\t\t. ' WHERE a.published = 1'\n\t\t. ' ORDER BY a.ordering';\n\t\t$db->setQuery( $query );\n\t\t$phocagallerys = $db->loadObjectList();\n\n\t\t$tree = array();\n\t\t$text = '';\n\t\t$tree = self::CategoryTreeOption($phocagallerys, $tree, 0, $text, $catId);\n\t\tforeach ($tree as $k=>$v) {\n\t\t\t$tree[$k]->text = substr($v->text, 3); // strip - for root category level\n\t\t}\n\t\tarray_unshift($tree, (object)array('value' => 'all', 'text'=>'- '.JText::_('JALL').' -'));\n\t\treturn $tree;\n\n\t}", "protected function buildSelect($row) {\n\t\t//echo $row['values'].'<br>';\n\t\t$elem = \"<select name='\".$row['Field'].\"'\".$row['Attributes'].\">\\n\";\n\t\t$vals = explode (',',$row['values']);\n\t\tif (!$this->filled) $$row['Default'] = \" selected='selected'\";\n\t\t\n\t\tforeach ($vals as $value) {\n\t\t\tif ($this->filled) {\n\t\t\t\tif ($pos = strpos($value,\"=ON\")) {\n\t\t\t\t\t$value = substr ($value,0,$pos);\n\t\t\t\t\t$$value = \" selected='selected'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isset($$value)) $$value = '';\n\t\t\t$elem .= sprintf(\"<option value='%s'%s>%s</option>\\n\",$value,$$value,$value);\n\t\t}\n\t\t$elem .= \"</select>\\n\";\n\t\treturn $elem;\n\t}", "function _field_select_multiple($fval) \n {\n // if need be, copy the current vals for safety + reset()\n $postedvals = (is_array($fval))? $fval : array();\n\n $res = sprintf(\"<select size=\\\"%d\\\"id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" multiple %s >\",\n $this->_get_field_size(),\n $this->fname,\n $this->fname . '[]', // add magic brakets\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n\n $opts = $this->opts; # $this->_array_stringify($this->opts);\n foreach ($opts as $optkey => $optval) { \n $res .= sprintf(\"<option value=\\\"%s\\\"%s>%s</option>\",\n $this->_htmlentities($optkey),\n (in_array($optkey, $postedvals) || $optkey == $fval)? \" selected\" : \"\",\n $this->_htmlentities($optval));\n }\n $res .= \"</select>\";\n $res .= sprintf('<br /><span class=\"%s\">%s</span>', \n $this->element_class,\n (isset($this->attribs['help_text']))? $this->attribs['help_text'] : 'Hold down [Ctrl] or [Cmd] to select multiple');\n return $res;\n }", "private function build_select_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_as_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_has_pricing_rules = \"no\") {\r\n $html = ''; \r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n if ($_show_as_value == \"no\") {\r\n $html = '<select data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_has_pricing_rules.'\" data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_cloneable . ' ' . $_readonly . ' >';\r\n \r\n $choices = explode(\";\", ((isset($_meta[\"choices\"]) && ! empty($_meta[\"choices\"])) ? $_meta[\"choices\"] : \"\"));\r\n $_meta[\"default_value\"] = (isset($_meta[\"default_value\"]) && ! empty($_meta[\"default_value\"])) ? trim($_meta[\"default_value\"]) : \"\";\r\n \r\n /* Placeholder option */\r\n if (isset($_meta[\"placeholder\"]) && !empty($_meta[\"placeholder\"])) {\r\n $html .= '<option value=\"wccpf_none\">' . esc_html($_meta[\"placeholder\"]) . '</option>';\r\n }\r\n $choices = apply_filters( \"wcff_select_option_before_rendering\", $choices, $_meta[\"key\"] );\r\n foreach ($choices as $choice) {\r\n $attr = '';\r\n $key_val = explode(\"|\", $choice);\r\n /* It has to be two items ( Value => Label ), otherwise don't proceed */\r\n if (count($key_val) == 2) {\r\n if ($_ptype != \"wccaf\") {\r\n /* Since version 2.0.0 - Default value will be absolute value, not as key|val pair */\r\n if (strpos($_meta[\"default_value\"], \"|\") !== false) {\r\n /* Compatibility for <= V 1.4.0 */\r\n if ($choice == $_meta[\"default_value\"]) {\r\n $attr = 'selected';\r\n }\r\n } else {\r\n /*\r\n * For product fields from V 2.0.0\r\n * For admin fields, which will be displyed as Product Fields\r\n */\r\n if (trim($key_val[0]) == $_meta[\"default_value\"]) {\r\n $attr = 'selected';\r\n }\r\n }\r\n } else {\r\n if ($key_val[0] == $_meta[\"value\"]) {\r\n $attr = 'selected';\r\n }\r\n }\r\n $html .= '<option value=\"' . esc_attr(trim($key_val[0])) . '\" ' . $attr . '>' . esc_html(trim($key_val[1])) . '</option>';\r\n }\r\n }\r\n $html .= '</select>';\r\n } else {\r\n /*\r\n * Show the raw value instead of as a field\r\n * Used for the Admin Field showing on product page\r\n */\r\n $html = '<p class=\"wcff-wccaf-value-para-tag\">' . $_meta[\"default_value\"] . '</p>';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "function __construct() {\r\n\t\t$this->Class = 'form-control';\r\n\t\t$this->SelectedClass = 'active';\r\n\t\t$this->HTML = '';\r\n\t\t$this->ListType = 0;\r\n\t\t$this->ListBoxHeight = 10;\r\n\t\t$this->MultipleSeparator = ', ';\r\n\t\t$this->RadiosPerLine = 1;\r\n\t\t$this->AllowNull = true;\r\n\t\t$this->ApplySelect2 = true;\r\n\t}", "function bls_sf_selectForTypes() {\n\tbls_ut_backTrace(\"bls_sf_selectForTypes\");\n\tglobal $bls_sf_location;\n\n\techo \"<select name=\\\"s_pkg_srctype\\\">\";\n\tforeach ($bls_sf_location as $key => $val) {\n\t\techo \"<option value=\\\"$key\\\">$val</option>\";\n\t}\n\techo \"</select>\";\n}", "public function build_products_tabs_selector($_class, $_active = \"\") {\r\n \t$ptabs = wcff()->dao->load_product_tabs();\r\n \t$html = '<select class=\"' . esc_attr($_class) . ' select\">';\r\n \tif (count($ptabs) > 0) {\r\n \t\tforeach ($ptabs as $pttitle => $ptvalue) {\r\n \t\t\t$selected = ($ptvalue == $_active) ? 'selected=\"selected\"' : '';\r\n \t\t\t$html .= '<option value=\"' . esc_attr($ptvalue) . '\" ' . $selected . '>' . esc_html($pttitle) . '</option>';\r\n \t\t}\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "function build_dropdown ($name = false, $class=\"\", $default=0)\n {\n // Start building the tree from the top branch\n\n $options = $this->_dropdown_branch($default);\n\n // Return output\n if ($name)\n {\n \t$return = '<select name=\"'.$name . '\"';\n \t$return .= ( empty( $class ) ) ? '>' : ' class=\"' . $class . '\">';\n \t$return .= $options.'</select>';\n return $return;\n }\n else\n {\n return $options;\n } \n }", "function skillList($fieldname=\"skills\", $classes=\"form-control\", &$alreadySkills, $important=false, $skills)\n\t{\n\t\t\n\t\t$formatted = implode(\",\", $alreadySkills);\n\t\t\n\t\tif($important)\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Skills' id='chkskill' required multiple='multiple'>\";\n\t\telse\n\t\techo \"<select name='$fieldname' class='$classes' placeholder='Skills'>\";\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobPortal\");\n\t\tif($con)\n\t\t{\n\t\t\t$rsSkill = mysqli_query($con, \"SELECT * FROM skills WHERE skillId NOT IN ($formatted)\");\n\t\t\tif($rsSkill)\n\t\t\t{\n\t\t\t\twhile($row = mysqli_fetch_array($rsSkill))\n\t\t\t\t{\n\t\t\t\t\tif(in_array($row[\"skillName\"], $skills, true))\n\t\t\t\t\techo \"<option value='\".$row['skillId'].\"' selected>\".$row['skillName'].\"</option>\";\n\t\t\t\t\telse\n\t\t\t\t\techo \"<option value='\".$row['skillId'].\"'>\".$row['skillName'].\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<option value='0'>Unable To Fetch.</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t\tif(isset($_POST[\"skill\"]))\n\t\t$alreadySkills[] = $_POST['skill'];\n\t}", "function buildVehiclesSelect($vehicles) {\r\n $prodList = '<select name=\"invId\" id=\"invId\">';\r\n $prodList .= \"<option>Choose a Vehicle</option>\";\r\n foreach ($vehicles as $vehicle) {\r\n $prodList .= \"<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>\";\r\n }\r\n $prodList .= '</select>';\r\n return $prodList;\r\n }", "protected function _buildListSelect($options)\n\t{\n\t\t$select = array();\n\n\t\t// get the layout option from params\n\t\t$layout = $this->_getOption('layout', $options);\n\t\t$getMetaData = $this->_getOption('getMetaData', $options, false);\n\t\t$getPageId = $this->_getOption('getPageId', $options, false);\n\n\t\t// in some case, we only need a simple list of urls, with no\n\t\t// counting of additionnal date, pageids, aliases, etc\n\t\t$simpleUrlList = $this->_getOption('simpleUrlList', $options, false);\n\t\tif ($simpleUrlList)\n\t\t{\n\t\t\t$s = ' select distinct u1.*';\n\t\t\t$s .= $getMetaData ? ', m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t$s .= $getPageId ? ', p.newurl as nonsefurl, p.pageid as pageid, p.id as pageidid, p.type as pageidtype, p.hits as pageidhits' : '';\n\t\t\t$select[] = $s;\n\t\t\t// add from clause\n\t\t\tif ($getPageId)\n\t\t\t{\n\t\t\t\t$select[] = 'from ' . $this->_db->quoteName('#__sh404sef_pageids') . ' as p';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select[] = 'from ' . $this->_db->quoteName('#__sh404sef_urls') . ' as u1';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// regular query, with all bells and whistles\n\t\t\tswitch ($layout)\n\t\t\t{\n\t\t\t\tcase 'export' :\n\t\t\t\t\t$s = ' select distinct u1.*';\n\t\t\t\t\t$s .= $getMetaData ? ',m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t\t\t$select[] = $s;\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as d, ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'view404':\n\t\t\t\t\t$select[] = ' select distinct u1.*';\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$s = ' select distinct u1.*, count(d.`id`)-1 as duplicates, count(m.`id`) as metas';\n\t\t\t\t\t$s .= $getMetaData ? ', m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t\t\t$select[] = $s;\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as d, ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// aggregate clauses\n\t\t$select = (count($select) ? implode(' ', $select) : '');\n\n\t\treturn $select;\n\t}", "public function degreelist(){\n\t\t\t$pgcatname = $this->input->post('stu_prgcate');\n\t\t\t$list = $this->commodel->get_listspfic2('program','','prg_name,prg_id,prg_branch','prg_category',$pgcatname,'prg_name,prg_branch');\n\t\techo \"<select>\";\n\t\techo \"<option disabled selcted>Select Programe</option>\";\n\t\tforeach($list as $datas): \n \t\t \techo \"<option id='degree' value='$datas->prg_id'> \" .\"$datas->prg_name\".'('.$datas->prg_branch.')'.\"</option>\";\n \t\tendforeach;\n\t\techo \"</select>\";\n\t }", "function select_list_from_array($name, $data_array, $default_value = \"\", $allow_empty = FALSE, $class = \"\", $id = \"\", $select_message = 'Select an option') {\n $select_object = new html_classes\\select($name);\n $select_object->set_attrib(\"class\", $class, TRUE);\n $select_object->set_attrib(\"id\", $id);\n\n if ($allow_empty) {\n $select_object->append_option(\"\", $select_message);\n }\n\n foreach ($data_array as $value => $label) {\n $select_object->append_option($value, $label, (($value === $default_value) ? TRUE : FALSE));\n }\n return $select_object;\n}", "function osa_field_widget_options_select_form_alter(&$element, &$form_state, $context) {\r\n\r\n // This code, while it works to populate the selection boxes when built, fails on validation\r\n // So we have hard coded the values into the form for now.\r\n /* populate the drop down with the class types\r\n if ($element['#field_name'] == 'field_class_type') {\r\n $element['#options'] = array('_none' => '- Select a value -') + osa_options_class_types();\r\n }\r\n */\r\n \r\n // populate the drop down with the list of events\r\n // only include events of type 'Group Class (Master)'\r\n if ($element['#field_name'] == 'field_event_master') {\r\n civicrm_initialize();\r\n $results = civicrm_api('event', 'get', array('event_type_id' => OSA_EVENT_GROUP_CLASS_MASTER, 'is_active' => TRUE, 'rowCount' => PHP_INT_MAX, 'version' => 3));\r\n $options = array();\r\n foreach ($results['values'] as $class) {\r\n $options[$class['id']] = $class['event_title'];\r\n }\r\n asort($options);\r\n $element['#options'] = array('_none' => '- Select a value -') + $options;\r\n }\r\n}", "function build_insurance_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$insurance_list = '<select name=\"business_id\" class=\"forminput\">';\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$selected.'\" selected=\"selected\">'.$selected_name.'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"\">'.$lang['Select_A_Business'].'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE insurance = 1 ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $insurance = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$insurance['id'].'\">'.$insurance['title'].'</option>';\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$insurance_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'INSURANCE_LIST' => $insurance_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "protected function get_qual_options()\n {\n $qualSearch = optional_param('qualsearch', '', PARAM_TEXT);\n $out = '<div>';\n $out .= '<h3>'.get_string('qualification','block_bcgt').'</h3>';\n $out .= '<select class=\"qual\" multiple name=\"qualID[]\">';\n $out .= '<option value=\"-1\"></option>';\n $quals = search_qualification(-1, -1, -1, $qualSearch, -1, null, -1, null, true); \n if($quals)\n {\n foreach($quals AS $qual)\n {\n $out .= '<option value=\"'.$qual->id.'\">'. bcgt_get_qualification_display_name($qual).'</option>';\n }\n } \n $out .= '</select>';\n $out .= '<input type=\"text\" name=\"qualsearch\" value=\"'.$qualSearch.'\"/>';\n $out.= '</div>';\n \n return $out;\n }", "public function build_category_tree($output, $preselected, $parent=0, $indent=''){\t\n $this->db->select('category_id,category_name,parentid');\n $this->db->where('parentid',$parent); \n $sql = $this->db->get('category'); \n \n foreach ($sql->result_array() as $c)\n {\n $selected = ($c[\"category_id\"] == $preselected) ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= \"<option value=\\\"\" . $c[\"category_id\"] . \"\\\" \" . $selected . \">\" . $indent . $c[\"category_name\"] . \"</option>\";\n if($c[\"category_id\"] != $parent){\n $this->crud_model->build_category_tree($output, $preselected, $c[\"category_id\"], $indent . \"&nbsp;&nbsp;\");\n } \n }\n return $sql->result_array();\n}", "public function run() {\n $this->htmlOptions['multiple'] = true;\n if($this->model) {\n $name_id = $this->resolveNameID();\n $input_id = $name_id[1];\n $select_html = CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);\n } else {\n $input_id = $this->attribute;\n $select_html = CHtml::dropDownList($this->attribute, $this->value, $this->data, $this->htmlOptions);\n }\n \n $options=CJavaScript::encode($this->options);\n Yii::app()->clientScript->registerScript('kendoui-multiselect-'.$input_id,\n 'var '.$input_id.' = jQuery(\"#'.$input_id.'\").kendoMultiSelect('.$options.').data(\"kendoMultiSelect\");'\n );\n \n echo $select_html;\n }", "public function getActiveChoices()\n {\n $choices = $this->find()->where(['category_id'=> $this->category_id, 'status' => 1])->orderBy('name')->all();\n\n $html = '';\n foreach($choices as $choice){\n\n $html .= ' <label><input type=\"checkbox\" value=\"'.$choice->id.'\" name=\"StartupForm[technology][]\"> '.$choice->name.'</label>';\n }\n return $html;\n }", "function htmlSelect($nombre,$selected,$class=\"\") \n { \n $cad='';\n $cad.='<select name=\"'.$nombre.'\" ';\n if(strlen($class)>0)\n $cad.='class=\"'.$class.'\"';\n $cad.=' >';\n //single\n $cad.=' <option value=\"'.$this->single().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n //married\n $cad.=' <option value=\"'.$this->married().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n //divorced\n $cad.=' <option value=\"'.$this->divorced().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n $cad.='</select>';\n return($cad);\n }", "function setupPreselectedTags() {\n\t\t$model_class = $this->modelClass;\n\t\t$tag_object = $this->$model_class->Tag;\n\t\t$selected_tags = array();\n\t\tif (isset($this->data['Tag'])) {\n\t\t\t$tags = $this->data['Tag'];\n\t\t\tforeach ($tags as $key => $tag) {\n\t\t\t\t$tag_id = (is_array($tag)) ? $tag['id'] : $tag;\n\t\t\t\t$tag_object->id = $tag_id;\n\t\t\t\tif (is_array($tag) && isset($tag['name'])) {\n\t\t\t\t\t$tag_name = $tag['name'];\n\t\t\t\t} else {\n\t\t\t\t\t$tag_name = $tag_object->field('name');\n\t\t\t\t}\n\t\t\t\t$selected_tags[] = array(\n\t\t\t\t\t'id' => $tag_id,\n\t\t\t\t\t'name' => $tag_name\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$this->set('selected_tags', $selected_tags);\n\t}", "function getHomeCategoriesSelect()\n {\n return $this->getCategoryDropDown('frmDoSearch_Keyword_Category', 0, true);\n }" ]
[ "0.78847694", "0.6640465", "0.62988997", "0.62259257", "0.616417", "0.60691726", "0.6025562", "0.5884363", "0.58370405", "0.5767028", "0.5751865", "0.5743982", "0.57101256", "0.5708095", "0.56958336", "0.5680058", "0.56152344", "0.5586126", "0.55670166", "0.55496097", "0.5511127", "0.5497985", "0.5497837", "0.5497603", "0.5487764", "0.54773563", "0.54669976", "0.5463859", "0.54573834", "0.54527855", "0.5441722", "0.53950787", "0.5388369", "0.5386638", "0.53781635", "0.537532", "0.53662354", "0.53527796", "0.5350852", "0.53341043", "0.5332966", "0.5328445", "0.5317916", "0.5303194", "0.5300293", "0.52985156", "0.52975744", "0.52939117", "0.5276439", "0.52702653", "0.52684176", "0.52506685", "0.52390903", "0.5231044", "0.52280766", "0.52276367", "0.5227251", "0.52209944", "0.52207816", "0.5213936", "0.5211848", "0.520962", "0.5195134", "0.5185424", "0.5178713", "0.5162199", "0.51512754", "0.51413375", "0.5135268", "0.5130147", "0.51300323", "0.51237327", "0.5119859", "0.5116817", "0.51100147", "0.5107926", "0.51045066", "0.5102785", "0.50958604", "0.50901634", "0.5089549", "0.5086198", "0.5073379", "0.50705576", "0.50580007", "0.50559545", "0.5043881", "0.5043858", "0.5037146", "0.5036861", "0.5035209", "0.5028446", "0.5025504", "0.50114846", "0.50098604", "0.5009652", "0.50057065", "0.5004378", "0.50043404", "0.5003102" ]
0.80517733
0
Build table of vehicles by classification
function buildVehiclesDisplay($vehicles){ $dv = '<ul id="inv-display">'; foreach ($vehicles as $vehicle) { $dv .= '<li>'; $dv .= "<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=".urlencode($vehicle['invId'])."'><img src='$vehicle[imgPath]' alt='Image of $vehicle[invMake] $vehicle[invModel] on phpmotors.com'></a>"; $dv .= '<hr>'; $dv .= "<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=".urlencode($vehicle['invId'])."'><h2>$vehicle[invMake] $vehicle[invModel]</h2></a>"; $dv .= "<span>$vehicle[invPrice]</span>"; $dv .= '</li>'; } $dv .= '</ul>'; return $dv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategorizedTables() {}", "public function classify($tableName);", "function build_table($new,$array_cat){\n\t\t//de categorias de serviceo.\n\t\t//Hacemos las iniciaciones pertinentes para intentar\n\t\t//aclarar un poco el codigo\n\t\t$ini_fila=\"<tr>\";\n\t\t$fin_fila=\"</tr>\";\n\t\t$ini_col='<td valign=\"top\" nowrap>';\n\t\t$fin_col=\"</td>\";\n\t\t$NUM_MAX_COLS=1;\n\t\t//Por cada columna un padre y sus hijos.\n\t\t$cadena='<table border=\"0\">';\n\t\t$num_current_col=$NUM_MAX_COLS+1;\t\t\n\t\tfor ($i=0;$i<count($array_cat);$i++){\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$num_current_col=1;\n\t\t\t\t$cadena=$cadena.$ini_fila;\n\t\t\t}\n\t\t\t$cadena=$cadena.$ini_col;\n\t\t\t//Damos el padre para que empiece la recursividad\t\t\t\n\t\t\t\n\t\t\t$cadena=$cadena.$this->build_col($new,$array_cat[$i],0,\"services\");\t\t\n\t\t\t//0 es el numero de tabulaciones inicial.\n\t\t\t//\"services\" es el nombre que tendran los checkbox.\n\t\t\t$cadena=$cadena.$fin_col;\n\t\t\t$num_current_col++;\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$cadena=$cadena.$fin_fila;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si el numero de la columna actual es menor\n\t\t//que el numero maximo de columnas +1 \n\t\t//restamos al maximo la actual para saber cuantas faltan. \n\t\tif ($num_current_col<$NUM_MAX_COLS+1){\t\t\t\n\t\t\t$cadena=$cadena.'<td colspan=\"'.($NUM_MAX_COLS+1-$num_current_col).'\">&nbsp;'.$fin_col.$fin_fila;\n\t\t}\n\t\t$cadena=$cadena.'</table>';\n\t\treturn $cadena;\n\t}", "function table_voltooid($conn)\n\t{\n\t\t$data=prepare_data_volt($conn);\n\t\t\n\t\tfor ($i=0;$i<count($data);$i++)\n\t\t{\n\t\t\techo \"<tr>\";\n\t\t\tforeach($data[$i] as $best)\n\t\t\t{\n\t\t\t\techo \"<td>$best</td>\";\n\t\t\t}\n\t\t\techo \"</tr>\";\n\t\t}\n\t}", "public function tableize($className);", "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 }", "protected function tableclass(){\n\n\t\tforeach($this->mapChild($this) as $key => $table ){\n\n\t\t\t$myadrs = $this->address;\n\n\t\t\tif(!in_array($table,$myadrs)){\n\n\t\t\t\tarray_push($myadrs,$table);\n\n\t\t\t\teval('$this->'.$table.' = new $this::$tclass($myadrs);');\n\n\t\t\t}\n\n\t\t\t//print($key . ':' .$table. p);\n\n\t\t}\n\n\t}", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "protected function vehicles()\n {\n // All weights are in kg\n\n // Audi\n $this->generateVehicle(\n 'Audi A1 Sportback',\n 'Compact 5-door Sportback with LED headlights, Audi Smartphone interface and Audi Pre-sense front',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A1/new_a1sb_sport_side.png',\n 21562.1800,\n 3.5,\n 4.4,\n 3.8,\n 137,\n 7.5,\n 147,\n 1409,\n 1740,\n 4029,\n 1260,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/A1_1.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/A1_2.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/Hero_desktop.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Audi S3 Cabriolet',\n '-door performance cabriolet with automatic acoustic hood, distinctive ‘S’ styling, and Fine Nappa leather seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/A3-Cabriolet-Side.png',\n 52206.3700,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1409,\n 1793,\n 4423,\n 1635,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_1.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_2.jpg',\n ]\n );\n $this->generateVehicle(\n 'Audi RS 3 Saloon',\n '4-door performance saloon with quattro all-wheel drive and 2.5-litre turbocharged five-cylinder engine.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/a3_rs3_saloon_side_19.png',\n 57489.0100,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1397,\n 1802,\n 4479,\n 1535,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_Hero_desktop.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_2.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_3.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 3 Sportback',\n '5-door performance hatchback with quattro all-wheel drive and 2.5-litre turbocharged five-cylinder engine.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/rs3_sportback_side_19.png',\n 56273.21,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1411,\n 1800,\n 4335,\n 1530,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A3/Seats/RS3_Sportback_seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_1.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Audi S4 Saloon',\n '4-door performance Saloon with unique S4 exterior styling, enhanced brakes and suspension.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon-side-d1.png',\n 58358.30,\n 4.4,\n 4.6,\n 4.2,\n 155,\n 5.7,\n 347,\n 1369,\n 1854,\n 4640,\n 1750,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_headlights.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_seats.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_auditech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 4 Avant',\n '5-door high-performance sports estate with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/RS4/rs_4_avant--side.png',\n 82169.71,\n 4.4,\n 4.6,\n 4.2,\n 155,\n 5.7,\n 347,\n 1434,\n 1842,\n 4725,\n 1620,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_headlights.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_seats.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_auditech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi A5 Cabriolet',\n '2-door Cabriolet with fully automatic acoustic hood and Parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A5/a5-cab-sline-19-side.png',\n 47075.70,\n 4.2,\n 3.5,\n 4.3,\n 155,\n 5.1,\n 354,\n 1383,\n 1846,\n 4673,\n 1760,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A5/Headlights/a5-coupe-sport-headlights-19.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A5/Seats/Front-Sport-seats.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 5 Coupe',\n '2-door high-performance sports Coupé with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A5/RS5-Coupe/RS5-Coupe-Side.png',\n 83871.83,\n 4.4,\n 5.0,\n 3.5,\n 174,\n 3.9,\n 354,\n 1360,\n 1861,\n 4723,\n 1685\n );\n $this->generateVehicle(\n 'Audi RS 5 Sportback',\n '5-door high-performance sports car with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A5/RS5-Sportback/RS5-Sportback-Side.png',\n 83871.83,\n 4.4,\n 5.0,\n 3.5,\n 174,\n 3.9,\n 354,\n 1386,\n 1843,\n 4733,\n 1720\n );\n $this->generateVehicle(\n 'Audi S6 Saloon',\n '4-door performance Saloon with a 4.0-litre V8 TFSI engine, quattro and S Super Sport front seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A6/S6-Saloon/s6_saloon--side.png',\n 73215.36,\n 4.4,\n 4.4,\n 4.6,\n 255,\n 5.0,\n 349,\n 1435,\n 1803,\n 4892,\n 1730\n );\n $this->generateVehicle(\n 'Audi S7 Sportback',\n '5-door performance Sportback with Matrix LED headlights, Virtual Cockpit and heated Super Sport seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A7/S7-Sportback/s7_sportback--side.png',\n 83501.01,\n 4.4,\n 4.4,\n 4.6,\n 255,\n 5.0,\n 349,\n 1422,\n 1908,\n 4969,\n 2010\n );\n $this->generateVehicle(\n 'Audi SQ5',\n '5-door performance SUV with distinctive \\'S\\' styling, Audi Virtual Cockpit and Fine Nappa leather seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q5/SQ5/sq5--side.png',\n 66911.44,\n 4.0,\n 4.5,\n 3.5,\n 155,\n 5.1,\n 313,\n 1635,\n 1893,\n 4671,\n 2055\n );\n $this->generateVehicle(\n 'Audi Q8',\n 'Luxury SUV with Matrix LED headlights, MMI Navigation and Parking System Plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8_sline_side.png',\n 81470.62,\n 3.7,\n 4.5,\n 4.4,\n 144,\n 6.3,\n 286,\n 1708,\n 1995,\n 4986,\n 2365,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/Q8/Headlights/Q8-Sline-Headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8-sline-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8-sline-auditech.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi TT RS Coupé',\n '2 door high-performance sports coupé with a 2.5-litre TFSI 5-cylinder engine, ‘RS’ styling and Audi virtual cockpit with a RS specific screen.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/TT/TTRS-Coupe/TTRS/ttrs_coupe_ttrs-coupe_side.png',\n 66741.23,\n 4.5,\n 4.0,\n 4.0,\n 174,\n 3.7,\n 395,\n 1343,\n 1832,\n 4201,\n 1450\n );\n $this->generateVehicle(\n 'Audi TT RS Roadster',\n '2 door high-performance sports coupé with a 2.5-litre TFSI 5-cylinder engine, ‘RS’ styling and Audi Virtual Cockpit with a RS specific screen',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/TT/TTRS-Roadster/TTRS/ttrs_roadster_side_new.png',\n 68868.88,\n 4.5,\n 4.0,\n 4.0,\n 155,\n 3.9,\n 395,\n 1343,\n 1832,\n 4201,\n 1510\n );\n\n $this->generateVehicle(\n 'Audi R8 Coupé',\n '2-door high-performance Audi Sport coupé with a 5.2 litre V10 engine, Audi Virtual Cockpit, dual-branch oval tailpipes and parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/R8/r8_coupev10-quattro_side_19.png',\n 155865.3000,\n 4.7,\n 4.3,\n 4.7,\n 205,\n 3.2,\n 610,\n 1240,\n 1940,\n 4426,\n 1555,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Headlights/r8_v10_quattro-headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Seats/r8_v10_quattro-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Suspension/r8_v10_quattro-performance.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi R8 Spyder',\n '2-door high-performance Audi Sport convertible with a 5.2 litre V10 engine, Audi Virtual Cockpit, dual-branch oval tailpipes and parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/R8/r8_spyder10-quattro_side_19.png',\n 166430.59,\n 4.9,\n 3.5,\n 4.7,\n 200,\n 3.2,\n 620,\n 1240,\n 1940,\n 4426,\n 1695,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Headlights/r8_v10_quattro-headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Seats/r8_v10_quattro-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/AudioCommunication/r8_v10_quattro-audiotech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi E-Tron',\n 'Fully electric, 5-door SUV with virtual door mirrors, Pre-sense Front and Basic, and a rear-view camera as standard.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/e-tron/e-tron-launch-edition-side.png',\n 166430.59,\n 4.0,\n 4.8,\n 4.3,\n 124,\n 5.7,\n 402,\n 1629,\n 1935,\n 4901,\n 2560,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-headlight.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-suspension.jpg'\n ]\n );\n\n // Lambo\n $this->generateVehicle(\n 'Lamborghini Huracan Evo Spyder',\n 'Driving a Spyder is a thrill in itself, but the Huracán Evo Spyder was created to amplify your driving experience to the max. Color, scent, and sound become one with the car’s compelling design and ultra-lightweight materials.\nThe power of the 640 CV V10 engine vibrates into a roar, and the supersport exhaust sound fills your ears. The car’s perfectly sleek, aerodynamic body slices through the air, and you race along with it; the thrill of your desire, lifting you higher',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/NEW/huracan-evo-spyder.png',\n 265210.53,\n 4.9,\n 4.8,\n 4.7,\n 202,\n 2.9,\n 629,\n 1180,\n 1933,\n 4520,\n 1542,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/int_right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/design-left.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/RP---Huracan-Evo-20.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Evo',\n 'The Huracán EVO represents the natural evolution of the most successful V10 in Lamborghini history. It is the result of fine-tuning and consolidation which involves the already existing features and performance of Huracán, combined with the development of new solutions in terms of efficiency and design. But overall this vehicle stands out for its ability to anticipate the moves and satisfy the desires of the driver, in harmony with the Lamborghini DNA.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/huracan/car/huracan-evo.png',\n 250454.39,\n 4.9,\n 4.8,\n 4.7,\n 202,\n 2.9,\n 629,\n 1180,\n 1933,\n 4520,\n 1542,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/upgrade/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/upgrade/design-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/RP---Huracan-Evo-3.jpg',\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Performante Spyder',\n 'The Huracán Performante has decided to lower its roof and transform itself into the Spyder with the highest performance that the Huracán family has ever seen. Its lines are designed to thrill at first sight and its state-of-the-art technology has been developed to provide a one-of-a-kind driving experience. Weighing in at 35 kg less than the Huracán 4WD Spyder and with 30 HP more, this newest addition to the House of the Raging Bull vaunts the best power-to-weight ratio in the Huracán Spyder range. It uses Forged Composites® material and the new ALA (Lamborghini Active Aerodynamics) technology. The Huracán Performante Spyder: power has become breathtakingly beautiful.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/huracan/car/hps-carousel-family.png',\n 289359.92,\n 4.9,\n 4.8,\n 4.7,\n 201,\n 3.1,\n 629,\n 1180,\n 1924,\n 4506,\n 1507,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/intern2.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/design-left.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Performante',\n 'The Huracán Performante has reworked the concept of super sports cars and taken the notion of performance to levels never seen before. The vehicle has been re-engineered in its entirety, as regards its weight, engine power, chassis and above all by introducing an innovative system of active aerodynamics: ALA. The use of the awarded Forged Composites®, a shapable forged carbon fiber material patented by Automobili Lamborghini, is a real nice touch and it contributes to make the vehicle even lighter in weight. Besides its extraordinary technological properties, it also conveys a new idea of beauty.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/car-slider/huracan-performante/performante-carousel-family.png',\n 261396.57,\n 4.9,\n 4.8,\n 4.7,\n 201,\n 2.9,\n 629,\n 1165,\n 1924,\n 4506,\n 1382,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante/intern2-huracan-performante.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/configuratore%20nuovo/huracan-performante-configuratore.jpg',\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador SVJ Roadster',\n 'There’s only one adjective to describe SVJ Roadster: unrivaled.\nProduced in just 800 units, it is the most iconic model of the Aventador family, thanks to its aerodynamic lines that slice through the air, and its breathtaking design, the expression of the most refined Italian taste and craftsmanship.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/car/SVJ_Roadster_gateway%20Aventador.png',\n 467043.94,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/header.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/PAGINA%20MODELLO_DEF/compressed/freni-avendator-svj-3.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/intern2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador SVJ',\n 'The future is unknown. It is a journey, an adventure. And above all, it is a challenge.\nLamborghini has never shied away from challenges, which is precisely why it created the new Aventador SVJ. To combine cutting-edge technology with extraordinary design, without ever coming to compromises.\nIn a future driven by technology, it’s easy to lose track of emotions. But in the future we are shaping, real emotions won’t be left behind. Because at the wheel, there will always be a person.\nAventador SVJ. Real emotions shape the future.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/aventador%20svj/aventador-svj-coup%C3%A8/car.png',\n 425529.30,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/Lamborghini_Aventador_SVJ_Green_Track_09.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/design-left.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/white_interior_final.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador S Roadster',\n 'The icon that inherited the legacy of the historic S models of the Miura, Islero, Countach, and Urraco returns to outdo itself in its most exciting version: the Aventador S Roadster.\nThe new V12 engine with a whopping 740 HP and the exclusiveness of Lamborghini design, unparalleled in this open top version, are joined in the Aventador S Roadster by the most sophisticated technology of the range, including the new LDVA (Lamborghini Dinamica Veicolo Attiva), which provides an incomparable driving experience, all of this able to feed the ego even of those who constantly seek the most powerful and adrenaline-pumping sensations.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/cars/aventador-s-roadster-car.png',\n 460247,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/header.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/intern2.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/design-right.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador S',\n 'An icon cannot be reinvented, it can only be challenged. And only Aventador could surpass itself. Following Miura, Islero, Countach, and Urraco, Lamborghini’s most iconic model now reaps the inheritance of the historic S models and evolves into the new Aventador S. Exclusive Lamborghini design and the new V12 engine with a whopping 740 HP now join the most sophisticated technology of the range, featuring the new LDVA (Lamborghini Dinamica Veicolo Attiva/Lamborghini Active Vehicle Dynamics), which offers an unparalleled driving experience to all those who honour their egos by challenging themselves every day.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/cars/aventador-s/aventador-s-auto-carousel-family.png',\n 417826,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/design-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/intern2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Centenario',\n 'The new Lamborghini Centenario represents a new, extremely precious piece in Lamborghini\\'s one-off strategy. It is a perfect example of the innovative design and the engineering skills of the bull-branded manufacturer.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/one-off/cars/centenario.png',\n 1900000,\n 5.0,\n 5.0,\n 5.0,\n 217,\n 2.7,\n 758,\n 1143,\n 2062,\n 4924,\n 1520,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/one-off/centenario/bg-huracan-right-skew.jpg'\n ]\n\n );\n\n\n // Porsche\n $this->generateVehicle(\n 'Porsche 718 Cayman S',\n 'The 718 models were made for the sport of it. They are mid-engined roadsters that unite the sporting spirit of the legendary Porsche 718 with the sports car of tomorrow – and transfer it to the roads of today’s world. With one goal: to take the everyday out of every day.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718-c7s-modelimage-sideshot/model/c976d857-d7eb-11e6-a122-0019999cd470;;twebp/porsche-model.webp',\n 65344.28,\n 4.8,\n 4.6,\n 4.9,\n 177,\n 4.9,\n 345,\n 1295,\n 1801,\n 4379,\n 1355,\n [\n 'https://files1.porsche.com/filestore/image/multimedia/none/jdp-2016-982-718-c7s-editorial-xl/normal/0d934731-4ddc-11e8-bbc5-0019999cd470;sF;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/image/multimedia/none/jdp-2016-982-718-c7s-editorial-l/normal/28f2e623-6d97-11e9-80c4-005056bbdc38;sJ;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/jdp-2016-982-718-c7-gallery-exterior-25/zoom2/72226e2f-96d6-11e6-9f1b-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 718 Boxster GTS',\n 'The 718 GTS models are never satisfied. They always crave more. More heart pounding from the start. More corners per kilometre. And more adrenaline with every metre. With an uprated midmounted engine and a chassis unfazed by any hairpin turn. Their power follows an upward path, their design looks forwards: with sharpened forms, honed lines, exquisite materials.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718-bo-gts-modelimage-sideshot/model/e61bf85e-ae78-11e7-b591-0019999cd470;;twebp/porsche-model.webp',\n 76758.19,\n 4.0,\n 4.0,\n 4.5,\n 180,\n 4.9,\n 359,\n 1272,\n 1801,\n 4379,\n 1450,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-04/zoom2/38e33008-6da1-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-01/zoom2/7d4a5027-f782-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-15/zoom2/69585a05-f782-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 718 Cayman GT4',\n '718 Cayman GT4 is the perfect sports car for those who like to push the limits. For those who would rather ask ‘why not?’ than ‘why?’. For those who take fun seriously and who would rather sit in a sports seat than a leather armchair.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718gt4-modelimage-sideshot/model/5b3fd684-85f2-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 91607.95,\n 4.0,\n 4.0,\n 4.5,\n 188,\n 4.4,\n 414,\n 1269,\n 1994,\n 4456,\n 1495,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-interior-01/zoom2/cc9d4c28-878d-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-indoor-01/zoom2/9ea29246-879a-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-interior-04/zoom2/15c39fee-8795-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Carrera 4S',\n 'The new 911 is the sum of its predecessors - a reflection of the past and a vision of the future. The silhouette: iconic. The design: timeless. The technology: inspired by great racing victories and always one step ahead. With the eighth generation of the 911, we’re driving into the future.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/992-c4s-modelimage-sideshot/model/c02b5f4d-e826-11e8-bec8-0019999cd470;;twebp/porsche-model.webp',\n 119656.41,\n 5.0,\n 5.0,\n 5.0,\n 190,\n 3.6,\n 443,\n 1298,\n 1852,\n 4499,\n 1490,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/en/modelseries-911carrera992-interieur-12/zoom2/68d27c9a-a6fc-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-911carrera992-indoor-10/zoom2/eea87d8f-a6f8-11e9-80c4-005056bbdc38;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-details-01/zoom2/68c55f32-e75a-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Carrera 4S Cabriolet',\n 'The new 911 is the sum of its predecessors - a reflection of the past and a vision of the future. The silhouette: iconic. The design: timeless. The technology: inspired by great racing victories and always one step ahead. With the eighth generation of the 911, we’re driving into the future.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/992-c4scab-modelimage-sideshot/model/c6ec382b-fc69-11e8-8373-0019999cd470;;twebp/porsche-model.webp',\n 131382.78,\n 5.0,\n 5.0,\n 5.0,\n 188,\n 3.8,\n 443,\n 1299,\n 1852,\n 4519,\n 1710,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-indoor-08/zoom2/a748dda6-e75c-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-interior-02/zoom2/e1346331-e75c-11e8-bec8-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-interior-06/zoom2/fba63fea-e75c-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Speedster',\n 'A single word encompasses everything the brand stands for: Speedster. The concept embodies the original Porsche virtues of purism, lightweight construction, efficiency and unadulterated driving pleasure. Limited to 1,948 units, the new 911 Speedster pays tribute to an idea that runs through the history of Porsche like a long winding road.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/991-2nd-speedster-modelimage-sideshot/model/39752d78-35e8-11e9-80c4-005056bbdc38;;twebp/porsche-model.webp',\n 257261.64,\n 5.0,\n 5.0,\n 5.0,\n 188,\n 3.8,\n 443,\n 1250,\n 1852,\n 4562,\n 1615,\n [\n 'https://files1.porsche.com/filestore/wallpaper/multimedia/none/modelseries-911speedster-wallpaper-02/wallpaper/ba012bac-36a7-11e9-80c4-005056bbdc38;sO;twebp;l63692803798;w1920;h1080/porsche-wallpaper.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911speedster-interior-01/zoom2/c7115f91-39cc-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911speedster-interior-04/zoom2/2d1c72e8-39cd-11e9-80c4-005056bbdc38;sQ;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 GT3 RS',\n 'Drivers. Fans. Lovers of the true motorsport. Brace yourselves. And get ready. The race track is calling. More loudly than ever before. And with an intensity not felt for quite some time. Defensive? Routine? As if. Better to go on the attack. A challenge awaits, one that will push you beyond your comfort zone for a change. Where unfiltered fascination feels at home: in the chicane, in the banked turn, on the long straights.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/991-2nd-gt3-rs-modelimage-sideshot/model/d446a760-17dc-11e8-bbc5-0019999cd470;;twebp/porsche-model.webp',\n 253240,\n 5.0,\n 5.0,\n 5.0,\n 193,\n 3.2,\n 512,\n 1297,\n 1880,\n 2453,\n 1445,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-outdoor-01/zoom2/9e03218a-fc65-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-interior-04/zoom2/5a70c0a5-fc65-11e7-bbc5-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-outdoor-02/zoom2/c165f4fc-1584-11e8-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera 4S Executive',\n 'A few years ago, everything to do with the saloon suddenly changed. Large, cumbersome and thickly padded instantly seemed outmoded qualities. On the road, something happened – something rather fast and dynamic: a sports car came along. A sports car with four seats, an unmistakable silhouette and performance figures normally associated only with a Porsche.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-4s-e-modelimage-sideshot/model/96643f1f-d7e2-11e6-a122-0019999cd470;;twebp/porsche-model.webp',\n 124515.95,\n 4.5,\n 4.0,\n 4.0,\n 179,\n 4.5,\n 433,\n 1428,\n 1937,\n 5199,\n 2055,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4s-st-gallery-outdoor-01/zoom2/0c98b233-562c-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-tu-gallery-interior-02/zoom2/86a25c0e-fd4a-11e8-8373-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/g2-4s-gallery-exterior-18/zoom2/7958fbc4-562b-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera GTS Sport Turismo',\n 'If you set yourself ambitious goals in life, you have to approach them with courage and passion. The Panamera does just that, blazing a trail with no compromises, uniting apparent opposites: performance and comfort, dynamism and efficiency, work and family.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-gts-st-modelimage-sideshot/model/8436fd3a-cad0-11e8-81d2-0019999cd470;;twebp/porsche-model.webp',\n 132918.33,\n 4.5,\n 4.0,\n 4.0,\n 179,\n 4.1,\n 453,\n 1422,\n 1937,\n 5053,\n 2100,\n [\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-gts-st-editorial-xl/normal/03cf722e-b1ce-11e8-8f14-0019999cd470;sF;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-panamera-gts-st-gallery-exterior-10/zoom2/13b5e363-bb46-11e8-8f14-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-panamera-gts-st-gallery-exterior-04/zoom2/b5ce5dcd-bb45-11e8-8f14-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera Turbo S E-Hybrid Executive',\n 'Porsche E-Performance is everything that you expect from a Porsche. And more. It is goose bumps. G-forces. Adrenalin. Because we are not satisfied with merely boosting efficiency when we can take performance and driving pleasure to the limits at the same time. There is a good reason why all of our experience and successes in motor sports have a major influence on development.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-tus-e-hy-e-modelimage-sideshot/model/82d9a7c2-6046-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 181806.79,\n 4.5,\n 4.0,\n 4.0,\n 192,\n 3.5,\n 670,\n 1432,\n 1937,\n 5199,\n 2485,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-tus-e-hy-st-gallery-exterior-03/zoom2/d3a7fec2-17cc-11e9-ae19-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4hy-gallery-interior-01/zoom2/7123fcf3-24de-11e7-9f74-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4hy-gallery-exterior-36/zoom2/336bd990-198f-11e9-ae19-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Macan Turbo',\n 'We have proven that we do not follow trends. Instead, we design our own adventures. A compact SUV that inextricably combines sportiness, design and everyday practicality: the Macan.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/pa-tu-modelimage-sideshot/model/0d290e38-c3da-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 57036.73,\n 4.6,\n 4.0,\n 4.7,\n 167,\n 4.3,\n 433,\n 1624,\n 2098,\n 4684,\n 1925,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-modelseries-gallery-outdoor-02/zoom2/2013fd91-f7c7-11e8-8373-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-model-series-gallery-image-05/zoom2/0f5846de-867d-11e8-8d30-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-model-series-gallery-image-09/zoom2/e2c1167e-867d-11e8-8d30-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Cayenne Turbo S E-Hybrid Coupé',\n 'This shape, it has been around for many years. Our iconic flyline, has been lengthened, heightened and lowered, but has remained the same. It is a shape that has won races. Everyone recognises it - at night, in the fog and even blindfolded. A shape that can only be achieved with training; sprints, physical exertion and stamina, just like building muscle. This shape stands for all that we are.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/9yb-e3c-tu-s-e-hy-modelimage-sideshot/model/7089f674-aedd-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 152577.79,\n 4.5,\n 4.0,\n 4.0,\n 183,\n 3.8,\n 670,\n 1573,\n 1983,\n 4926,\n 2565,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-turbo-s-e-hybrid-gallery-image-01/zoom2/01236b4f-b84f-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-gallery-image-23/zoom2/5fe6936f-35e6-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-gallery-image-36/zoom2/0d5f1dcd-4a32-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n /*\n $this->generateVehicle(\n 'Porsche 918 Spyder',\n '/var/www/dev.gve.world/resources/graphics/cars/porsche-918.png',\n 'https://png2.cleanpng.com/sh/980941764631322deed36c1bce087230/L0KzQYm3WMA0N5lrjpH0aYP2gLBuTcIxOWkyiNH7c3PrdX6CUcEueJD3i9VxZT28QYm0kCB6bJZ3ReJ4coPmeLa0WcMxNZRmRd94ZHXvf373jCJ0a5lqRas6OD32gMrrhgIueJD3i9VxZT3mdbB7hgIueKZqiuZ4LUXlRoW8WfZlaWk7TNM9LkG8R4qCUsE3OWY4S6U5M0K8Q4eBWcgveJ9s/kisspng-2018-porsche-911-porsche-918-spyder-porsche-930-ca-modelo-porsche-918-spyder-porsche-center-puerto-5b6459fda864a4.1979921615333032936898.png',\n 1276587.90,\n 5.0,\n 5.0,\n 5.0,\n 214,\n 2.6,\n 874,\n [\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dsc-6340-1540488225.jpg',\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dsc-6479-1540486710.jpg',\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/800-7411-1540489318.jpg'\n ]\n );\n */\n // Ferrari\n\n // Volkswagen\n $this->generateVehicle(\n 'Volkswagen up!',\n 'THe smallest Volkswagen is more colourful and sharper with newly designed body panels, new colours, new wheels, a completely redesigned interior and a new infotainment system.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30101/hero/480/0.png',\n 12163.63,\n 4.3,\n 4.5,\n 4.3,\n 101,\n 14.4,\n 60,\n 1504,\n 1645,\n 3600,\n 940,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize8.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize2.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize5.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Polo GTI',\n 'The Polo with an exterior designed to turn heads which is matched by an interior that\\'s totally at home in the digital age.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30200/30200-2974/480/0.png',\n 26137.32,\n 3.0,\n 5.0,\n 3.0,\n 148,\n 6.7,\n 197,\n 1461,\n 1751,\n 4067,\n 1355\n );\n $this->generateVehicle(\n 'Volkswagen T-Roc R-Line',\n 'Born confident',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30361/30361-3040/480/0.png',\n 41884.87,\n 4.3,\n 4.6,\n 4.7,\n 134,\n 7.2,\n 187,\n 1573,\n 1819,\n 4234,\n 1505\n );\n $this->generateVehicle(\n 'Volkswagen Golf GTI TCR',\n 'The iconic GTI, but with the DNA of a race car. The GTI TCR with its uniquely shaped front and rear bumpers and rear spoiler, as well as unique GTI TCR badging, this car is not one for blending in.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30316/30316-10436/480/0.png',\n 45450.69,\n 4.5,\n 5.0,\n 4.5,\n 155,\n 5.6,\n 286,\n 1492,\n 1790,\n 4258,\n 1430\n );\n $this->generateVehicle(\n 'Volkswagen Tiguan R-Line Tech',\n 'Turn heads with the ultimate Tiguan that includes the ultimate in luxury and refinement with a dynamic sporty look.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31105/31105-10422/480/0.png',\n 50144.79,\n 4.0,\n 4.4,\n 4.0,\n 143,\n 6.2,\n 237,\n 1673,\n 1859,\n 4490,\n 2360\n );\n $this->generateVehicle(\n 'Volkswagen Passat Saloon R-Line',\n 'Turn heads with the ultimate Passat that includes the ultimate in luxury and refinement with a dynamic sporty look.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31300/31300-3040/480/0.png',\n 49197.53,\n 4.0,\n 5.0,\n 4.0,\n 153,\n 6.4,\n 237,\n 1456,\n 1832,\n 4767,\n 1367,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-1.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-4.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-6.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Touran R-Line',\n 'Our top of the range R-Line is the ultimate in style and quality, with a bespoke R-Line body kit, tinted glass and 18\" Marseille alloy wheels. Attractive R-Line design cues are continued inside with bespoke R-Line upholstery and steering wheel.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31005/hero/480/0.png',\n 36508.98,\n 4.4,\n 4.8,\n 4.0,\n 130,\n 9.3,\n 148,\n 1659,\n 1829,\n 4527,\n 1454,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/1d.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/2c.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/1b.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Arteon R-Line',\n 'The Arteon is a newly developed premium Volkswagen model. A fastback saloon with cutting-edge design and predictive driver assistance systems, the Arteon is a true driver of innovation.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31505/31505-3040/480/0.png',\n 49662.11,\n 4.1,\n 4.5,\n 3.8,\n 155,\n 5.6,\n 268,\n 1450,\n 1871,\n 4862,\n 1565,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_1.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_7.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_2_v2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Touareg V6 R-Line',\n 'For a sportier style, the R-Line has unique front & rear bumpers, side skirts, 20\" \\'Braga\\' diamond turned alloy wheels and keyless start',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31705/31705-4664/480/0.png',\n 67786.88,\n 4.2,\n 4.5,\n 3.9,\n 155,\n 5.9,\n 335,\n 1709,\n 2208,\n 4801,\n 2110,\n [\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-gallery-recrop.jpg',\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-imageneww.jpg',\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-new-img.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Challenger',\n '',\n 'https://dev.gve.world/images/vehicles/Challenger-2.png',\n 5180394.74,\n 2,\n 5.0,\n 3.8,\n 37,\n 0,\n 1200,\n 25000,\n 35000,\n 115000,\n 62500,\n [\n 'https://dev.gve.world/images/vehicles/45158851.jpg',\n 'https://dev.gve.world/images/vehicles/_AJW4020-2.jpg'\n ],\n 100,\n 100,\n true\n );\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}", "function __createBoostTable() {\n\t\tforeach ($this->settings[$this->model->alias]['fields'] as $fieldname => $value) {\n\t\t\tif (is_array($value) && isset($value['boost'])) {\n\t\t\t\t$this->__boostTable[$fieldname] = $value['boost'];\n\t\t\t}\n\t\t}\n\t}", "function createTable($result) {\n $table = \"<table class='table table-bordered'>\";\n $row = $result->fetch_assoc();\n $table .= \"<tr>\";\n foreach(array_keys($row) as $field) {\n $table .= \"<th class='text-center'>$field</th>\";\n }\n $table .= \"</tr>\";\n while($row) {\n $table .= \"<tr>\";\n foreach($row as $key => $value) {\n $table .= \"<td class='text-center'>\";\n if(strcmp($key, \"Price\") == 0 or strcmp($key, \"Revenue\") == 0) {\n $table.=\"\\$\" . number_format($value, 2, \".\", \"\");\n }\n else {\n $table .= $value;\n }\n $table.=\"</td>\";\n }\n $table .= \"</tr>\";\n $row = $result->fetch_assoc();\n }\n $table .= \"</table>\";\n return $table;\n }", "protected function createVehicles($vehicle)\n {\n $vehicleCount = 0;\n if (isset($vehicle['attributes']['validate'])) {\n foreach ($vehicle['attributes']['validate'] as &$validator) {\n if ($validator['type'] === 'php') {\n if (strpos($validator['source'], ':/') === false && strpos($validator['source'], '/') !== 0) {\n $validator['source'] = $this->tplBase . '/' . $validator['source'];\n }\n }\n }\n }\n if (isset($vehicle['attributes']['resolve'])) {\n foreach ($vehicle['attributes']['resolve'] as &$resolver) {\n if ($resolver['type'] === 'php') {\n if (strpos($resolver['source'], ':/') === false && strpos($resolver['source'], '/') !== 0) {\n $resolver['source'] = $this->tplBase . '/' . $resolver['source'];\n }\n }\n }\n }\n switch ($vehicle['vehicle_class']) {\n case '\\\\Teleport\\\\Transport\\\\xPDOObjectVehicle':\n case 'xPDOObjectVehicle':\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n if ($realClass === false) {\n $this->request->log(\"Invalid class {$vehicle['object']['class']} specified; skipping vehicle\");\n break;\n }\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $iterator = $this->modx->getIterator($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n foreach ($iterator as $object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n } elseif (isset($vehicle['object']['data'])) {\n /** @var \\xPDOObject $object */\n $object = $this->modx->newObject($vehicle['object']['class']);\n if ($object instanceof $realClass) {\n $object->fromArray($vehicle['object']['data'], '', true, true);\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOObjectVehicles for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\xPDOCollectionVehicle':\n $objCnt = 0;\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $limit = isset($vehicle['object']['limit']) ? (integer)$vehicle['object']['limit'] : 0;\n if ($limit < 1) {\n $limit = 500;\n }\n $offset = 0;\n $criteria = $this->modx->newQuery($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n if (!isset($vehicle['object']['orderBy']) || !is_array($vehicle['object']['orderBy'])) {\n $pk = (array)$this->modx->getPK($realClass);\n foreach ($pk as &$primaryKey) {\n $primaryKey = $this->modx->escape($primaryKey);\n }\n $orderBy = array_fill_keys($pk, 'ASC');\n } else {\n $orderBy = $vehicle['object']['orderBy'];\n }\n foreach ($orderBy as $by => $direction) {\n $criteria->sortby($by, $direction);\n }\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n while (!empty($set)) {\n foreach ($set as &$object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n }\n if (!empty($set) && $this->package->put($set, $vehicle['attributes'])) {\n $vehicleCount++;\n $objCnt = $objCnt + count($set);\n }\n $offset += $limit;\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOCollectionVehicles with {$objCnt} total objects for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\MySQLVehicle':\n /* collect table names from classes and grab any additional tables/data not listed */\n $modxDatabase = $this->modx->getOption('dbname', null, $this->modx->getOption('database'));\n $modxTablePrefix = $this->modx->getOption('table_prefix', null, '');\n\n $coreTables = array();\n foreach ($vehicle['object']['classes'] as $class) {\n $coreTables[$class] = $this->modx->quote($this->modx->literal($this->modx->getTableName($class)));\n }\n\n $stmt = $this->modx->query(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (\" . implode(',', $coreTables) . \")\");\n $extraTables = $stmt->fetchAll(\\PDO::FETCH_COLUMN);\n\n if (is_array($extraTables) && !empty($extraTables)) {\n $excludeExtraTablePrefix = isset($vehicle['object']['excludeExtraTablePrefix']) && is_array($vehicle['object']['excludeExtraTablePrefix'])\n ? $vehicle['object']['excludeExtraTablePrefix'] : array();\n $excludeExtraTables = isset($vehicle['object']['excludeExtraTables']) && is_array($vehicle['object']['excludeExtraTables'])\n ? $vehicle['object']['excludeExtraTables'] : array();\n foreach ($extraTables as $extraTable) {\n if (in_array($extraTable, $excludeExtraTables)) continue;\n\n $instances = 0;\n $object = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n $attributes = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n\n /* remove modx table_prefix if table starts with it */\n $extraTableName = $extraTable;\n if (!empty($modxTablePrefix) && strpos($extraTableName, $modxTablePrefix) === 0) {\n $extraTableName = substr($extraTableName, strlen($modxTablePrefix));\n $addTablePrefix = true;\n } elseif (!empty($modxTablePrefix) || in_array($extraTableName, $excludeExtraTablePrefix)) {\n $addTablePrefix = false;\n } else {\n $addTablePrefix = true;\n }\n $object['tableName'] = $extraTableName;\n $this->request->log(\"Extracting non-core table {$extraTableName}\");\n\n /* generate the CREATE TABLE statement */\n $stmt = $this->modx->query(\"SHOW CREATE TABLE {$this->modx->escape($extraTable)}\");\n $resultSet = $stmt->fetch(\\PDO::FETCH_NUM);\n $stmt->closeCursor();\n if (isset($resultSet[1])) {\n if ($addTablePrefix) {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\";\n $object['table'] = str_replace(\"CREATE TABLE {$this->modx->escape($extraTable)}\", \"CREATE TABLE {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\", $resultSet[1]);\n } else {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape($extraTableName)}\";\n $object['table'] = $resultSet[1];\n }\n\n /* collect the rows and generate INSERT statements */\n $object['data'] = array();\n $stmt = $this->modx->query(\"SELECT * FROM {$this->modx->escape($extraTable)}\");\n if (!$stmt) {\n $this->request->log(\"Skipping table {$extraTable} as SELECT query failed\");\n break;\n }\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n if ($instances === 0) {\n $fields = implode(', ', array_map(array($this->modx, 'escape'), array_keys($row)));\n }\n $values = array();\n foreach ($row as $key => $value) {\n switch (gettype($value)) {\n case 'string':\n $values[] = $this->modx->quote($value);\n break;\n case 'NULL':\n case 'array':\n case 'object':\n case 'resource':\n case 'unknown type':\n $values[] = 'NULL';\n break;\n default:\n $values[] = (string)$value;\n break;\n }\n }\n $values = implode(', ', $values);\n if ($addTablePrefix) {\n $object['data'][] = \"INSERT INTO {$this->modx->escape('[[++table_prefix]]' . $extraTableName)} ({$fields}) VALUES ({$values})\";\n } else {\n $object['data'][] = \"INSERT INTO {$this->modx->escape($extraTable)} ({$fields}) VALUES ({$values})\";\n }\n $instances++;\n }\n }\n\n if (!$this->package->put($object, $attributes)) {\n $this->request->log(\"Could not package rows for table {$extraTable}\");\n } else {\n $this->request->log(\"Packaged {$instances} rows for non-core table {$extraTable}\");\n $vehicleCount++;\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} {$vehicle['vehicle_class']} vehicles for non-core tables\");\n } else {\n $this->request->log(\"No non-core tables found for packaging\");\n }\n break;\n case 'xPDOScriptVehicle':\n if (isset($vehicle['object']['source'])) {\n if (strpos($vehicle['object']['source'], ':/') === false && strpos($vehicle['object']['source'], '/') !== 0) {\n $vehicle['object']['source'] = $this->tplBase . '/' . $vehicle['object']['source'];\n }\n }\n case 'xPDOFileVehicle':\n case 'xPDOTransportVehicle':\n default:\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } else {\n if ($this->package->put($vehicle['object'], $vehicle['attributes'])) {\n $this->request->log(\"Packaged 1 {$vehicle['vehicle_class']}\" . (isset($vehicle['object']['source'])\n ? \" from {$vehicle['object']['source']}\" : \"\"));\n $vehicleCount++;\n }\n }\n break;\n }\n return $vehicleCount;\n }", "public function toTabular() {\n\t\tsetlocale(LC_MONETARY, 'en_GB');\n\n\t\t$totalCount = 0; // Count get the total journey price\n\t\techo '<table width=\"50%\" cellpadding=\"5\" cellspacing=\"5\">';\n\t\t\techo '<tr><th align=\"left\">Station From</th><th align=\"left\">Station To</th><th align=\"left\">Prices</th></tr>';\n\n\t\t\tforeach ( $this->prices as $hop ) {\n\t\t\t\techo '<tr><td>'.$hop['station.from'].'</td>';\n\t\t\t\techo '<td>'.$hop['station.to'].'</td><td>';\n\n\t\t\t\t$prices = array();\n\t\t\t\tforeach ( $hop['station.prices'] as $price ) {\n\t\t\t\t\t$prices[] = $price->nodeValue;\n\t\t\t\t}\n\n\t\t\t\tasort($prices);\n\t\t\t\t$fmt = '<strong>Selected Price:</strong>&pound;%i ';\n\t\t\t\techo money_format($fmt, floatval(str_replace('£', '', $prices[0]))) . \"\\n\";\n\t\t\t\t$totalCount += str_replace('£', '', $prices[0]);\n\t\t\t\techo '</td></tr>';\n\n\t\t\t}\n\t\techo '</table>';\n\n\t\t$fmt = '<strong>Total Cost is </strong> &pound;%i ';\n\t\techo money_format($fmt, $totalCount) . \"\\n\";\n\n\t\techo ' for ' . $this->getPostField('numberOfAdults') . ' adult(s) ';\n\t\techo ' and ' . $this->getPostField('numberOfChildren') . ' child(s).';\n\t}", "public function getClassifications()\n {\n $taxes = Tax::where('archived', '=', 0);\n\n return Datatables::of($taxes)\n ->editColumn('id', function ($tax) {\n return '<a href=\"' . url('admin/classification/' . $tax->id . '/edit') . '\">' . $tax->id . '</a>';\n })\n ->editColumn('duty', function ($tax) {\n return number_format($tax->duty, 2) . '%';\n })\n ->editColumn('enabled', function ($tax) {\n return $tax->enabled ? '<span style=\"color: green;\">Enabled</span>' : '<span class=\"txt-archived\">Disabled</span>';\n })\n ->make(true);\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "function categoryToTable($category) {\n switch ($category) {\n case \"cartaCredito\": return \"carta_credito\";\n case \"contoBancario\": return \"conto_bancario\";\n case \"codiceFiscale\": return \"codice_fiscale\";\n case \"credenzialeAccesso\": return \"credenziale_accesso\";\n default: return \"\";\n }\n}", "function makeTable($netid, $pass) {\r\n $dataJSON = getOwlspaceData($netid,$pass, 1);\r\n\r\n $returnString = \"\";\r\n\r\n $data = json_decode($dataJSON, true);\r\n\r\n $keys = array_keys($data);\r\n\r\n echo '<table class=\"table\">';\r\n // go through and make table\r\n foreach (array_keys($data) as $index => $classKey) {\r\n foreach (array_keys($data[$classKey]) as $index => $assignmentKey) {\r\n echo '<tr>';\r\n echo '<td>', $classKey, '</td>';\r\n echo '<td>', $assignmentKey, '</td>';\r\n echo '<td>', $data[$classKey][$assignmentKey], '</td>';\r\n echo '</tr>';\r\n }\r\n }\r\n echo '</table>';\r\n\r\n \r\n }", "public function run()\n {\n VehicleType::create([\n 'nom' => 'BRP',\n 'descripcio' => 'Bomba Rural Pesant',\n 'codi' => '30-33'\n ]);\n VehicleType::create([\n 'nom' => 'BFP',\n 'descripcio' => 'Bomba Forestal Pesant',\n 'codi' => '34-37'\n ]);\n VehicleType::create([\n 'nom' => 'BFL / BRL',\n 'descripcio' => 'Bomba Forestal-Rural Lleugera',\n 'codi' => '38-39'\n ]);\n VehicleType::create([\n 'nom' => 'BUP',\n 'descripcio' => 'Bomba Urbana Pesant',\n 'codi' => '40-43'\n ]);\n VehicleType::create([\n 'nom' => 'BNP',\n 'descripcio' => 'Bomba Nodrissa Pesant',\n 'codi' => '44-47'\n ]);\n VehicleType::create([\n 'nom' => 'BUL',\n 'descripcio' => 'Bomba Urbana Lleugera',\n 'codi' => '48-49'\n ]);\n VehicleType::create([\n 'nom' => 'FSV',\n 'descripcio' => 'Salvaments Varis',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRQ',\n 'descripcio' => 'Risc Químic',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FER',\n 'descripcio' => 'Equips Respiratoris',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRM',\n 'descripcio' => 'Rescats de Muntanya',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRA',\n 'descripcio' => 'Rescats Aquàtics',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FSA',\n 'descripcio' => 'Salvaments Apícoles',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'BSAL',\n 'descripcio' => 'Barques de Salvaments',\n 'codi' => '56-59'\n ]);\n VehicleType::create([\n 'nom' => 'AEA / AES / ABA',\n 'descripcio' => 'Autoescales',\n 'codi' => '60-61'\n ]);\n VehicleType::create([\n 'nom' => 'AMB',\n 'descripcio' => 'Ambulàncies',\n 'codi' => '62-69'\n ]);\n VehicleType::create([\n 'nom' => 'CCA / UPT',\n 'descripcio' => 'Unitat de Suport al Comandament',\n 'codi' => '70-71'\n ]);\n VehicleType::create([\n 'nom' => 'UTP',\n 'descripcio' => 'Vehicle de Transport de Personal',\n 'codi' => '72-73'\n ]);\n VehicleType::create([\n 'nom' => 'UCA',\n 'descripcio' => 'Vehicle de Càrrega',\n 'codi' => '74-77'\n ]);\n VehicleType::create([\n 'nom' => 'UE',\n 'descripcio' => 'Vehicles Especials',\n 'codi' => '78-79'\n ]);\n VehicleType::create([\n 'nom' => 'UPCL',\n 'descripcio' => 'Unitats de Personal i Càrrega Lleugeres',\n 'codi' => '80-89'\n ]);\n VehicleType::create([\n 'nom' => 'USL',\n 'descripcio' => 'Unitat de Suport Logístic',\n 'codi' => '80-89'\n ]);\n VehicleType::create([\n 'nom' => 'UPC',\n 'descripcio' => 'Unitats de Personal i Càrrega',\n 'codi' => '90-99'\n ]);\n }", "private function createDummyTable() {}", "function make_tsv($survival_data) {\n $final = \"exon_id\\tcancer\\tpatient_id\\tevent\\ttime\\texpression\\n\";\n foreach ($survival_data as $data) {\n for ($i = 0; $i < count($data['data']['patient_id']); $i++) {\n $final .= $data['info']['exon_id'] .\"\\t\"\n . $data['info']['cancer'] .\"\\t\"\n . $data['data']['patient_id'][$i] .\"\\t\"\n . $data['data']['event'][$i] .\"\\t\"\n . $data['data']['time'][$i] .\"\\t\"\n . $data['data']['expression'][$i] .\"\\n\";\n }\n }\n return $final;\n }", "private function _createLabels ()\n {\n $content = '';\n\n foreach ($this->dayLabels as $label)\n {\n $content .= Html::tag('td', $label);\n }\n\n return Html::tag('tr', $content).\"\\n\";\n }", "private function write_standings_table_rows() {\n $name_style = read_name_style();\n $show_car_name = show_car_name_in_standings();\n $time_format = get_finishtime_formatting_string();\n\n $i = 0;\n foreach ($this->result_summary as &$row) {\n ++$i;\n\n $roundid = $row['roundid'];\n\n // js/standings-kiosk.js looks for data-first attribute for scrolling.\n echo \"<tr data-roundid='\".$roundid.\"' data-rankid='\".$row['rankid'].\"'\"\n .\" data-for-supergroup='\".isset($p['supergroup']).\"'\"\n .($i == 1 ? \" data-first='1'\" : \"\");\n echo ' class=\"';\n foreach ($row['outcome'] as $key => $p) {\n echo $key.' ';\n }\n echo '\"';\n echo \">\";\n\n $p = &$row['outcome'];\n\n // First column:\n echo \"<td class='col0'>\";\n {\n // echo json_encode($p); // DEBUG\n\n echo \"<div class='inround'>\";\n {\n echo $p[stkey_round($roundid)];\n }\n echo \"</div>\";\n\n if (isset($p[stkey_full_field()])) {\n echo \"<div class='insuper'>\";\n echo $p[stkey_full_field()];\n echo \"</div>\";\n }\n\n foreach ($p as $key => $place) {\n if (is_stkey_qual($key)) {\n echo \"<div class=\\\"$key\\\">$place</div>\";\n }\n }\n }\n echo \"</td>\";\n\n echo \"<td>\".$row['carnumber'].\"</td>\";\n echo \"<td>\".htmlspecialchars(mangled_name($row, $name_style), ENT_QUOTES, 'UTF-8').\"</td>\";\n if ($show_car_name) {\n echo \"<td>\".$row['carname'].\"</td>\";\n }\n\n // Racer's (native) class and place in class/group. These columns only get shown\n // for non-aggregate racing rounds, so round_classid == classid\n if ($this->use_groups) {\n $key = stkey_round($row['roundid']); // Racer's classid\n\n echo \"<td class='col-group'>\".htmlspecialchars($row['class'], ENT_QUOTES, 'UTF-8').\"</td>\";\n echo \"<td class='col-ingroup'>\";\n if (isset($p[$key])) {\n echo $p[$key];\n }\n echo \"</td>\";\n }\n\n // Rank/subgroup and place in rank/subgroup\n if ($this->use_subgroups) {\n echo \"<td class='col-subgroup'>\".htmlspecialchars($row['rank'], ENT_QUOTES, 'UTF-8').\"</td>\";\n $key = stkey_round_subgroup($row['roundid'], $row['rankid']);\n echo \"<td class='col-insubgroup'>\";\n if (isset($p[$key])) {\n echo $p[$key];\n }\n echo \"</td>\";\n }\n\n // Place in pack\n if ($this->has_full_field_standings()) {\n echo \"<td class='col-insuper'>\";\n if (isset($p[stkey_full_field()])) {\n echo $p[stkey_full_field()];\n }\n echo \"</td>\";\n }\n echo \"<td class='col-inround'>\".$p[stkey_round($roundid)].\"</td>\";\n\n echo \"<td>\".$row['base'].\"</td>\";\n\n if ($this->use_points) {\n echo \"<td>\".$row['avg'].\"</td>\";\n echo \"<td>\".ordinal($row['best']).\"</td>\";\n echo \"<td>\".ordinal($row['worst']).\"</td>\";\n } else {\n echo \"<td>\".sprintf($time_format, $row['avg']).\"</td>\";\n echo \"<td>\".sprintf($time_format, $row['best']).\"</td>\";\n echo \"<td>\".sprintf($time_format, $row['worst']).\"</td>\";\n }\n echo \"</tr>\\n\";\n }\n }", "function generateHorizontalTableFromQuery($tableid, $title, $description, $sql){\n\t\t global $database;\n\n $rec = $database->query($sql);\n \n if (!$rec || !$rec->num_rows){\n\t\t\t return $database->error;\n\t\t }\n\t\t \n\t\t $field_names = array();\n\t\t $fields = \"\";\n\t\t $body = \"\";\n\t\t\t\n\t\t\t// first field\n\t\t\t$field_names[] = \"<th>Category</th>\";\n\t\t\twhile ($row = $rec->fetch_array()){\n\t\t\t\t$col = $row[0];\n\t\t\t\t$field_names[] = \"<th>$col</th>\";\n\t\t\t}\n\n\t\t\t$fields = implode(\"\", $field_names);\n\t\t\t\n\t\t\tmysqli_data_seek($rec, 0);\n\n\t\t\t$keys = array();\t\t\t\n\t\t\t$row = $rec->fetch_array();\n\t\t\t$keys_ = array_keys($row);\n\t\t\t$idx = 0;\n\n\t\t\tforeach($keys_ as $key){\n\t\t\t\tif (! is_numeric($key) && $idx > 1){\n\t\t\t\t\t$keys[] = $key;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$idx++;\n\t\t\t}\n\n\t\t\tmysqli_data_seek($rec, 0);\n\t\t\t$data = \"\";\n\t\t\t$body = \"\";\n\t\t\t\n\t\t\t$total_fields = sizeof($field_names); // account for category\n\t\t\t$datasets = [];\n\t\t\t$idx = 1;\n\t\t\t\n\t\t\twhile ($row = $rec->fetch_array()){\t\t\n\t\t\t\tforeach($keys as $category) {\n\t\t\t\t\t\t $data = $row[$category];\n\t\t\t\t\t\t if (!$data) $data = 0;\n\t\t\t\t\t\t $datasets[$category][] = \"<td>$data</td>\"; \n\t\t\t\t}\n\t\t\t}\t\t\t\n\n\t\t\tforeach ($datasets as $key=>$arr){\n\t\t\t\t$data = implode(\"\", $arr);\n\t\t\t\t$body .= \"<tr><td>$key</td>$data</tr>\";\n\t\t\t\t$idx++;\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5>\n\t\t\t\t\t <div class='table-responsive' style='overflow-x:scroll;'>\n\t\t\t\t\t\t <table class='table table-hover table-bordered' id='$tableid'>\n\t\t\t\t\t <thead>\n\t\t\t\t\t\t <tr>$fields</tr>\n\t\t\t\t\t\t </thead>\n\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t\t$body\n\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t </table>\n\t\t\t\t\t\t</div>\";\n }", "function build_result_tables($results) {\n $headers = fgetcsv($results);\n echo '<table class=\"results\"><thead><tr>';\n foreach( $headers as $header) {\n echo \"<th>\".$header.\"</th>\";\n }\n echo '</tr></thead><tbody>';\n\n while(($result = fgetcsv($results)) !== false) {\n echo '<tr>';\n foreach($result as $value) {\n echo \" <td>$result</td>\";\n }\n echo '</tr>\\n';\n }\n\n echo '</tbody></table>'\n}", "function get_faculties_manage_table($faculties, $controller) {\n $CI = &get_instance();\n $controller_name = strtolower(get_class($CI));\n\n $table = '<table class=\"tablesorter table table-bordered table-hover\" id=\"sortable_table\">';\n $headers = array(\n '<input type=\"checkbox\" id=\"select_all\" />',\n lang('university_no'),\n lang('university_name'),\n lang('university_name_kh'),\n lang('university_faculty_dean'),\n lang('faculty_code'),\n lang('common_action')\n );\n \n $table.='<thead><tr>';\n $count = 0;\n foreach ($headers as $header) {\n $count++;\n\n if ($count == 1) {\n $table.=\"<th class='leftmost'>$header</th>\";\n } elseif ($count == count($headers)) {\n $table.=\"<th class='rightmost'>$header</th>\";\n } else {\n $table.=\"<th>$header</th>\";\n }\n }\n \n $table.='</tr></thead><tbody>';\n $table.=get_faculties_manage_table_data_rows($faculties, $controller);\n $table.='</tbody></table>';\n return $table;\n}", "function make_table($matches,$teams,$last_schedule){\n\t\t\n\t\t$table=array();\n\n\t\tforeach($teams as $row){\n\t\t\t$table[$row->id]=array('id'=>$row->id,'name'=>$row->name,'section'=>$row->section);\n\t\t\t$table[$row->id]['points']=0;\n \t\t$table[$row->id]['pj']=0;\n \t\t$table[$row->id]['pg']=0;\n \t\t$table[$row->id]['pe']=0;\n \t\t$table[$row->id]['pp']=0;\n \t\t$table[$row->id]['gf']=0;\n \t\t$table[$row->id]['gc']=0;\n \t\t$table[$row->id]['gd']=0;\n \t\t$table[$row->id]['change']=1;\n \t\t$table[$row->id]['updown']=0;\n\t\t}\n\t\t$table_ant=$table;\n\t\n\t\tforeach($matches as $row){\n\t\t\t$home=false;\n\t\t\t$away=false;\n\t\t\t$result=trim($row->result);\n \t\t$h=(int)trim(substr($result,0,1));\n \t\t$a=(int)trim(substr($result,3));\n\t\t\t\n \t\tif(isset($table[$row->home])){\n \t\t\t$table[$row->home]['pj']+=1;\n\t\t\t\t$home=true;\n\t\t\t\tif($row->schedule_id!=$last_schedule)\n\t\t\t\t\t$table_ant[$row->home]['pj']+=1;\n\t\t\t}\n \t\tif(isset($table[$row->away])){\n \t\t\t$table[$row->away]['pj']+=1;\n \t\t\t$away=true;\n \t\t\tif($row->schedule_id!=$last_schedule)\n\t\t\t\t\t$table_ant[$row->away]['pj']+=1;\n \t\t}\n \t\t\n \t\t//Si el equipo local gana\n \t\tif($h>$a){\n \t\t\tif($home){\n\t\t\t\t\t$table[$row->home]['points']+=3;\n\t\t\t\t\t$table[$row->home]['pg']+=1;\n\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t$table[$row->home]['gd']+=$h-$a;\n\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t$table_ant[$row->home]['points']+=3;\n\t\t\t\t\t\t$table_ant[$row->home]['pg']+=1;\n\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t$table_ant[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\tif($away){\n\t\t\t\t\t$table[$row->away]['pp']+=1;\n\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t\t\t\t\t$table[$row->away]['gd']+=$a-$h;\n \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t$table_ant[$row->away]['pp']+=1;\n\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t$table_ant[$row->away]['gd']+=$a-$h;\n\t\t\t\t\t}\n \t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Si Empatan\n\t\t\t\tif($h==$a){\n\t\t\t\t\tif($home){\n\t\t\t\t\t\t$table[$row->home]['points']+=1;\n\t\t\t\t\t\t$table[$row->home]['pe']+=1;\n\t\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t\t$table_ant[$row->home]['points']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['pe']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif($away){\n\t \t\t\t\t$table[$row->away]['points']+=1;\n\t\t\t\t\t\t$table[$row->away]['pe']+=1;\n\t\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t \t\t\t\t\t$table_ant[$row->away]['points']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['pe']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t\t\t\t}\n\t\t\t\t//Si el Equipo visitante gana\n\t\t\t\telse{\n\t\t\t\t\tif($home){\n\t\t\t\t\t\t$table[$row->home]['pp']+=1;\n\t\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t\t$table[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t\t$table_ant[$row->home]['pp']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif($away){\n\t \t\t\t\t$table[$row->away]['points']+=3;\n\t\t\t\t\t\t$table[$row->away]['pg']+=1;\n\t\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t\t\t\t\t\t$table[$row->away]['gd']+=$a-$h;\n\t \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t \t\t\t\t\t$table_ant[$row->away]['points']+=3;\n\t\t\t\t\t\t\t$table_ant[$row->away]['pg']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gd']+=$a-$h;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Ordeno las dos tablas generadas\n\t\tforeach ($table as $key=>$arr):\n\t\t\t$pun[$key] = $arr['points'];\n\t\t\t$g1[$key] = $arr['gd'];\n\t\t\t$g2[$key] = $arr['gf'];\n\t\t\t$g3[$key] = $arr['gc'];\t\n\t\tendforeach;\n\t\t\t\n\t\tarray_multisort($pun,SORT_DESC,$g1,SORT_DESC,$g2,SORT_DESC,$g3,SORT_ASC,$table);\n\t\t\n\t\t$pun=$g1=$g2=$g3=array();\n\t\tforeach ($table_ant as $key=>$arr):\n\t\t\t$pun[$key] = $arr['points'];\n\t\t\t$g1[$key] = $arr['gd'];\n\t\t\t$g2[$key] = $arr['gf'];\n\t\t\t$g3[$key] = $arr['gc'];\t\n\t\tendforeach;\n\t\t\t\t\n\t\tarray_multisort($pun,SORT_DESC,$g1,SORT_DESC,$g2,SORT_DESC,$g3,SORT_ASC,$table_ant);\n\t\t\n\t\t//Reviso posiciones con la ultima fecha y cuanto se han movido\n\t\tforeach($table as $key=>$row){\n\t\t\tforeach($table_ant as $key2=>$row2){\n\t\t\t\tif($row['id']==$row2['id']){\n\t\t\t\t\tif($key>$key2){\n\t\t\t\t\t\t$table[$key]['change']=2;\n\t\t\t\t\t\t$table[$key]['updown']=abs($key-$key2);\n\t\t\t\t\t}\n\t\t\t\t\tif($key<$key2){\n\t\t\t\t\t\t$table[$key]['change']=0;\n\t\t\t\t\t\t$table[$key]['updown']=abs($key-$key2);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $table;\n\t}", "function printResultPerCat($result) {\n echo \"<center><table></center>\";\n echo \"<h3>The number of vehicles rented out per category</h3>\";\n $list = array();\n while ($r = OCI_Fetch_Array($result, OCI_BOTH)) {\n array_push($list, $r);\n }\n if (sizeof($list) != 0) {\n echo \"<tr><th>Number Of Vehicles per Category</th><th>Car Type</th></tr>\";\n foreach ($list AS $row) {\n echo \"<tr><td>\" . $row[\"0\"] . \"</td><td>\" . $row[\"1\"] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n } else {\n echo \"There is no car rented today!!!\";\n }\n echo \"</table>\";\n }", "protected function registerDefaultCategorizedTables() {}", "public function run()\n {\n $data = [\n [\n 'title' => 'Легковые',\n 'esbd_id' => 4\n ],\n [\n 'title' => 'Автобусы до 16 п.м.',\n 'esbd_id' => 5\n ],\n [\n 'title' => 'Грузовые',\n 'esbd_id' => 6\n ],\n [\n 'title' => 'Троллейбусы, трамваи',\n 'esbd_id' => 7\n ],\n [\n 'title' => 'Мототранспорт',\n 'esbd_id' => 8\n ],\n [\n 'title' => 'Прицепы(полуприцепы)',\n 'esbd_id' => 10\n ],\n [\n 'title' => 'Автобусы > 16 п.м.',\n 'esbd_id' => 11\n ],\n [\n 'title' => 'Воздушный',\n 'esbd_id' => 12\n ],\n [\n 'title' => 'Морской',\n 'esbd_id' => 13\n ],\n [\n 'title' => 'Железнодорожный',\n 'esbd_id' => 14\n ],\n [\n 'title' => 'Спец.техника',\n 'esbd_id' => 15\n ],\n ];\n\n foreach ($data as $item) {\n VehicleType::create([\n 'title' => $item['title'],\n 'esbd_id' => $item['esbd_id']\n ]);\n }\n }", "public function return_table()\n {\n $table = \"sub_classes\";\n return $table;\n }", "private function populateDummyTable() {}", "function prepareLabels() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n $labels_table = TABLE_PREFIX . 'labels';\n\n DB::execute(\"CREATE TABLE $labels_table (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'Label',\n name varchar(10) DEFAULT NULL,\n is_default tinyint(1) unsigned not null default '0' NOT NULL DEFAULT '0',\n raw_additional_properties longtext,\n PRIMARY KEY (id),\n INDEX type (type),\n UNIQUE name (name, type)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n $white = '#FFFFFF';\n $black = '#000000';\n $red = '#FF0000';\n $green = '#00A651';\n $blue = '#0000FF';\n $yellow = '#FFFF00';\n $orange = '#F26522';\n $grey = '#ACACAC';\n\n $labels_by_type = array(\n 'AssignmentLabel' => array(\n array('NEW', $black, $yellow),\n array('CONFIRMED', $white, $orange),\n array('WORKS4ME', $white, $green),\n array('DUPLICATE', $white, $green),\n array('WONTFIX', $white, $green),\n array('ASSIGNED', $white, $red),\n array('BLOCKED', $black, $grey),\n array('INPROGRESS', $black, $yellow),\n array('FIXED', $white, $blue),\n array('REOPENED', $white, $red),\n array('VERIFIED', $white, $green),\n ),\n 'ProjectLabel' => array(\n array('NEW', $black, $yellow),\n array('INPROGRESS', $white, $green),\n array('CANCELED', $white, $red),\n array('PAUSED', $white, $blue),\n )\n );\n\n foreach($labels_by_type as $type => $labels) {\n foreach($labels as $label) {\n list($label_name, $fg_color, $bg_color) = $label;\n\n DB::execute(\"INSERT INTO $labels_table (type, name, raw_additional_properties) VALUES (?, ?, ?)\", $type, $label_name, serialize(array('fg_color' => $fg_color, 'bg_color' => $bg_color)));\n } // foreach\n } // foreach\n\n DB::execute(\"UPDATE $labels_table SET is_default = ? WHERE type = ? AND name = ?\", true, 'AssignmentLabel', 'NEW');\n DB::execute(\"UPDATE $labels_table SET is_default = ? WHERE type = ? AND name = ?\", true, 'ProjectLabel', 'NEW');\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function table()\n\t{\n\t\t$this->datatables->select('testcat.test_id AS test_id, testcat_id, gender, age, score, percentile, percentile.id AS id');\n\t\t$this->datatables->from('percentile');\n\t\t$this->datatables->join('testcat', 'testcat.id = percentile.testcat_id');\n\n\t\t$this->datatables->edit_column('test_id', '$1', 'test_get_link_by_id(test_id)');\n\t\t$this->datatables->edit_column('testcat_id', '$1', 'testcat_get_link_by_id(testcat_id)');\n\t\t$this->datatables->edit_column('gender', '$1', 'gender(gender)');\n\t\t$this->datatables->edit_column('id', '$1', 'percentile_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "function buildHTMLTable($dataSet){\n\n $tblHTML = \"<table class='cleanTbl'>\";\n\n foreach ($dataSet as $row) {\n\n $tblHTML = $tblHTML.\"<tr class='cleanTbl'>\";\n\n foreach($row as $col){\n\n $tblHTML = $tblHTML.\"<td class='cleanTbl'>$col</td>\";\n\n }\n $tblHTML = $tblHTML.\"</tr>\";\n\n }\n $tblHTML = $tblHTML.\"</table>\";\n\n return $tblHTML;\n}", "public function vehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 1)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "function extract_tables($criteria = array())\n{\n\t$tables = array();\n\n\tforeach ($criteria as $table => $info)\n\t{\n\t\t$tables[$table] = $info['desc'];\n\t}\n\n\treturn $tables;\n}", "public function run()\n {\n Hospital::unguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // CSVからインポートする為、コメントアウト\n \n // factory(HospitalMajorClassification::class, 1)->create()->each(function ($major) {\n // for ($i = 1; $i <= 14; $i++) {\n // if ($i === 1) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => 'アクセスについて'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '駐車場あり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '送迎サービスあり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '駅近',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 2) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => 'クレジットカード対応'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 3) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '外国語対応'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '英語',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '中国語',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '韓国語',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 4) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '認定施設について'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '日本人間ドック学会 機能評価認定施設',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 5) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '女性対応'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'レディースデーあり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '女性専用施設あり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'パウダールームあり',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 6) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => 'お子様対応'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'キッズスペース',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '託児所',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '子連れ対応可能',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 7) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '施設について'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '検診専用施設',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '検診専用エリアあり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'バリアフリー対応',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 8) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '食事について'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '院内食堂・レストランあり(予約なしで利用可)',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 9) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '併用施設について'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 10) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '周辺施設について'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 11) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => 'プライバシー配慮'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '更衣室専有あり(一人着替えスペース)',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '個室採血室あり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '個室回復室あり',\n // 'is_fregist' => '1',\n\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '呼び出し配慮あり',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 12) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '検査結果'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => '検査結果即日発行対応',\n // 'is_fregist' => '1',\n\n // ]);\n // } elseif ($i === 13) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => 'フリーエリア'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // } elseif ($i === 14) {\n // $middle = factory(HospitalMiddleClassification::class)->create([\n // 'major_classification_id' => $major->id,\n // 'name' => '検索ワード'\n // ]);\n // factory(HospitalMinorClassification::class)->create([\n // 'middle_classification_id' => $middle->id,\n // 'name' => 'その他',\n // 'is_fregist' => '0',\n\n // ]);\n // }\n // };\n // });\n\n $minors = HospitalMinorClassification::all()->toArray();\n\n factory(Hospital::class, 50)->create()->each(function ($hospital) use ($minors) {\n factory(HospitalEmailSetting::class)->create(['hospital_id' => $hospital->id]);\n factory(MedicalTreatmentTime::class)->create(['hospital_id' => $hospital->id]);\n foreach ($minors as $minor) {\n factory(HospitalDetail::class)->create([\n 'hospital_id' => $hospital->id,\n 'minor_classification_id' => $minor['id'],\n ]);\n }\n });\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n Hospital::reguard();\n }", "public function buildDefaultCostTables() {\n\t\t// Get services table data\n\t\t$service_list = new ServicesInfo;\n\t\t$service_list = $service_list->getServicesTableData($id_list = NULL); // Note that the sizeof($service_data) == 8\n\t\t$cost_table_array = array();\n\t\tforeach ($service_list as $value) {\n\t\t\t$cost_table_array[$value['svc_name']][] = array('svc_id' => $value['svc_id'], 'svc_name' => '', 'cost_desc' => '', 'cost_code' => '', 'cost_ro_count' => '', 'cost_parts_sale' => '', 'cost_parts_cost' => '', 'cost_labor_sale' => '');\n\t\t}\n\t\treturn $cost_table_array;\n\t}", "private function __construct() { \n $this->movieData = $this->generateTable();\n\n }", "public function vehicle_type_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_types->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $type) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$type->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\"><strong>'.$type->name.'</strong> </div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<div class=\"checkbox checkbox-primary\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$type->id.'\"></div>';\n\n\t\t\t\t//$row[] = $type->name;\n\t\t\t\t\n\t\t\t\t//$row[] = $type->name;\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_type_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleType('.$type->id.',\\''.$url.'\\')\" id=\"'.$type->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_types->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_types->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "function getSkillTable($val, $typ) {\n $content = '';\n $content .= '<div class=\"' . $typ . ' selectable\">';\n foreach ($val as $atk) {\n if ($atk -> getTyp() == 'p') {\n $atkTyp = 'Physical';\n } elseif ($atk -> getTyp() == 'm') {\n $atkTyp = 'Magical';\n } elseif ($atk -> getTyp() == 'a') {\n $atkTyp = 'Special';\n }\n $content .= '\n <div class=\"skillcontainer\">\n <a href=\"#\" rel=\"' . $atk -> getId() . '\" class=\"skill\" title=\"' . $atk -> getName() . '\"><img src=\"' . getAtkImag($atk -> getId()) . '\" /></a>\n <span class=\"skilltext\"><b>' . $atk -> getName() . '</b><br />Damage ' . $atk -> getDmgPt() . '<br />Typ ' . $atkTyp . '</span>\n </div>';\n }\n $content .= '</div>';\n echo $content;\n}", "public function run()\n {\n DB::table('vehicle_type')->insert([\n 'name' => 'Deluxe',\n 'layout' => '2-2',\n 'row' => '5',\n 'column' => '4',\n 'facility_id' => '1',\n ]);\n DB::table('vehicle_type')->insert([\n 'name' => 'AC Deluxe',\n 'layout' => '2-2',\n 'row' => '5',\n 'column' => '4',\n 'facility_id' => '2',\n ]);\n\n }", "protected function get_table_classes()\n {\n }", "public function definition()\n {\n return [\n 'vehicle_id' => $this->faker->randomNumber(),\n 'OilType' => $this->faker->word,\n 'OilMeter' => $this->faker->numberBetween(-10000, 10000),\n 'OilfilterGuaged' => $this->faker->boolean,\n 'BatteryUsed' => $this->faker->word,\n 'ACCondition' => $this->faker->boolean,\n ];\n }", "function makeDetailedTable(){\r\n\t$motorhomeid = $_GET['motorID'];\r\n\t// start the db connection\r\n\tinclude 'db_conn.php';\r\n\t// do the sql statment\r\n\t$sql = \"SELECT * FROM motorhomes WHERE motorID='$motorhomeid'\";\r\n\t$queryresult = mysql_query($sql)\r\n\t\tor die(mysql_error());\r\n\r\n\t// start the table\r\n\techo \"<div id = \\\"maincontent\\\">\";\r\n\techo \"<table class=\\\"motor\\\">\";\r\n\r\n\t// fill the table\r\nwhile ($row = mysql_fetch_assoc($queryresult)) {\r\n\t$id = $row['motorID'];\r\n\t$manufacturer = $row['manufacturer'];\r\n\t$model = $row['model'];\r\n\t$year = $row['year'];\r\n\t$engine = $row['engine'];\r\n\t$berths = $row['berths'];\r\n\t$mileage = $row['mileage'];\r\n\t$price = $row['price'];\r\n\t$layout = $row['layout'];\r\n\t$ownership = $row['ownership'];\r\n\t$description = $row['description'];\r\n\r\n\techo \"\t<tr class=\\\"motor\\\">\";\r\n\techo \"\t<td colspan=\\\"4\\\">$year $manufacturer </td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Motor ID</td>\";\r\n\techo \"\t<td><strong>$id</strong></td>\";\r\n\techo \"\t<td>Manufactrurer</td>\";\r\n\techo \"\t<td><strong>$manufacturer</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Model</td>\";\r\n\techo \"\t<td><strong>$model</strong></td>\";\r\n\techo \"\t<td>Year</td>\";\r\n\techo \"\t<td><strong>$year</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Engine</td>\";\r\n\techo \"\t<td><strong>$engine</strong></td>\";\r\n\techo \"\t<td>Berths</td>\";\r\n\techo \"\t<td><strong>$berths</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Milage</td>\";\r\n\techo \"\t<td><strong>$mileage</strong></td>\";\r\n\techo \"\t<td>Price</td>\";\r\n\techo \"\t<td><strong>£$price</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Layout</td>\";\r\n\techo \"\t<td><strong>$layout</strong></td>\";\r\n\techo \"\t<td>Ownership</td>\";\r\n\techo \"\t<td><strong>$ownership</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Description</td>\";\r\n\t// valdate the input with showing it without the special characters and with the breaks\r\n\techo \"\t<td colspan=\\\"3\\\"><strong>\".nl2br(htmlspecialchars_decode($description,ENT_QUOTES)).\"</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\r\n}\r\n\techo \"</table>\";\r\n\techo \"</div>\";\r\n\t// close the table\r\n\r\n\t// close the db connection\r\n\tmysql_free_result($queryresult);\r\n\tmysql_close($conn);\r\n\r\n}", "public function vehicle_model_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_models->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $model) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$make_name = '';\n\t\t\t\t$make_array = $this->Vehicle_makes->get_make_by_id($model->make_id);\n\t\t\t\tif($make_array){\n\t\t\t\t\tforeach($make_array as $make){\n\t\t\t\t\t\t$make_name = $make->title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$model->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\"><strong>'.$make_name.'</strong> ('.$model->make_id.')</div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<div class=\"checkbox checkbox-primary\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$model->id.'\"></div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<h4><a data-toggle=\"modal\" data-target=\"#editVehicleModelModal\" href=\"!#\" class=\"link\" onclick=\"editVehicleModel('.$model->id.')\" id=\"'.$model->id.'\" title=\"Click to Edit\"><strong>'.$make_name .'</strong> ('.$model->make_id.')</a></h4>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<strong>'.$make_name .'</strong> ('.$model->make_id.')';\n\t\t\t\t\n\t\t\t\t$row[] = $model->code;\n\t\t\t\t$row[] = $model->title;\n\t\t\t\t//$row[] = 'ok';\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_model_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleModel('.$model->id.',\\''.$url.'\\')\" id=\"'.$model->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_models->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_models->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function run()\n {\n DB::table('vehicle')->insert([\n 'model' => 'KA 1.0 Ti-Vct Flex Se Manual',\n 'yearmodel' => 2018 ,\n 'yearmanufacture' => 2019,\n 'type' => 'used',\n 'brand_id'=> 3,\n 'color_id' => 1,\n 'price' => 46890.00,\n 'photo' => 'fordka.jpg',\n 'user_id' => 1,\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 54.286, Travas elétricas, Ar condicionado, Volante com regulagem de altura'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Tracker 1.0 Turbo Flex Lt Automático',\n 'yearmodel' => 2020 ,\n 'yearmanufacture' => 2021,\n 'type' => 'used',\n 'brand_id'=> 2,\n 'color_id' => 3,\n 'price' => 106290.00,\n 'user_id' => 2,\n 'photo' => 'chevrolet.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 6.781, Ar condicionado, Alarme, Controle de tração, DVD Player'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Argo 1.0 Firefly Flex Drive Manual',\n 'yearmodel' => 2020 ,\n 'yearmanufacture' => 2020,\n 'brand_id'=> 11,\n 'type' => 'used',\n 'color_id' => 5,\n 'price' => 46890.00,\n 'user_id' => 3,\n 'photo' => 'fiat.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 46.555, Alarme, Desembaçador traseiro, Ar quente, Vidros elétricos'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Sentra 2.0 Sv 16v Flex 4p Automático',\n 'yearmodel' => 2013,\n 'yearmanufacture' => 2013,\n 'brand_id'=> 6,\n 'type' => 'used',\n 'color_id' => 6,\n 'price' => 46390.00,\n 'user_id' => 3,\n 'photo' => 'nissan-sentra.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 96.836, Alarme, Retrovisores elétricos, Ar quente, Vidros elétricos, Sensor de estacionamento'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'QQ 1.0 Look Flex 5p',\n 'yearmodel' => 2018,\n 'yearmanufacture' => 2018,\n 'brand_id'=> 12,\n 'type' => 'new',\n 'color_id' => 6,\n 'price' => 29990.00,\n 'user_id' => 1,\n 'photo' => 'Cherry.png',\n 'optionals' => 'Combustível : Gasolina e Álcool, Licenciado, Km rodados : 42.000 , Alarme, 5 portas, Transmissão Manual'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'HB20 1.0 Comfort Plus 12v Flex 4p Manual',\n 'yearmodel' => 2019,\n 'yearmanufacture' => 2018,\n 'brand_id'=> 5,\n 'type' => 'used',\n 'color_id' => 4,\n 'price' => 53390.00,\n 'user_id' => 1,\n 'photo' => 'hb20.jpg',\n 'optionals' => 'Combustível: Flex, Licenciado, Km rodados: 41.490, Encosto de Cabeça Traseiro, Computador a bordo, Câmbio Manual'\n ]);\n }", "function MysqlResultsTable ($mysql_results, $table_id='') {\n while ($myrow = mysql_fetch_assoc($mysql_results)) {\n if (! ($headers))\n $headers = array_keys($myrow);\n $rows .= \" <tr>\\n\";\n foreach ($headers as $k)\n $rows .= \" <td class=$k>$myrow[$k]</td>\\n\";\n $rows .= \" </tr>\\n\";\n } // end while myrow\n $header = join(\"</th><th>\",$headers);\n $header = \"<tr><th>$header</th></tr>\\n\";\n if ($table_id != '') { $id = ' id=\"'.$table_id.'\"'; }\n $rows = \"<table$id>$header$rows</table>\\n\";\n return ($rows);\n}", "public function fetch_classification(){\n\t\t$edit_classification=$this->session->userdata('edit_classification');\n\t\t$delete_classification=$this->session->userdata('delete_classification');\n\t\t$system_defined_icons = $this->general_model->system_defined_icons();\n\t\t/*\n\t\t-----------------------------------\n\t\tend : user role restriction access checking.\n\t\t-----------------------------------\n\t\t*/\n\n\t\t$company_id = $this->uri->segment(\"4\");\n\t\t$classificationList = $this->file_maintenance_model->fetch_classification($company_id);\n\n\t\t$tmpl = array('table_open' => '<table class=\"table table-hover table-striped\">');\n $this->table->set_template($tmpl);\n\t\t$this->table->set_empty(\"&nbsp;\");\n\t\t$this->table->set_heading('ID','Classification','Description','Ranking','Option');\n\n\t\tforeach($classificationList as $classification){\n\n\n\n\t\t\t\t$edit = '<i class=\"'.$edit_classification.' fa fa-'.$system_defined_icons->icon_edit.' fa-'.$system_defined_icons->icon_size.'x\" style=\"color:'.$system_defined_icons->icon_edit_color.';\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Edit\" onclick=\"editClassification('.$classification->classification_id.')\"></i>';\n\n\t\t\t\t$delete = anchor('app/file_maintenance/delete_classification/'.$classification->classification_id,'<i class=\"'.$delete_classification.' fa fa-'.$system_defined_icons->icon_delete.' fa-'.$system_defined_icons->icon_size.'x\" style=\"color:'.$system_defined_icons->icon_delete_color.';\"></i>',array('data-toggle'=>'tooltip','data-placement'=>'left','title'=>'Delete','onclick'=>\"return confirm('Are you sure you want to delete\".$classification->classification.\"?')\"));\n\n\t\t\t\t$this->table->add_row(\n\t\t\t\t\t$classification->classification_id,\n\t\t\t\t\t$classification->classification,\n\t\t\t\t\t$classification->description,\n\t\t\t\t\t$classification->ranking,\n\t\t\t\t\t$edit.' '.$delete\n\t\t\t\t\t);\n\t\t}\n\n\t\t$this->data['table_classification'] = $this->table->generate();\n\n\t\t$this->load->view('app/administrator/file_maintenance/fetch_classification',$this->data);\n\t}", "protected abstract function createTestTable();", "private function makeRelationBetweenCategoryAndDummyTable() {}", "public function makeTableView($headings, $content, $idFieldName, $viewURL);", "function printResultPerBranch($result) {\n echo \"<center><table></center>\";\n echo \"<h3>The number of vehicles rented out per branch</h3>\";\n $list = array();\n while ($r = OCI_Fetch_Array($result, OCI_BOTH)) {\n array_push($list, $r);\n }\n if (sizeof($list) != 0) {\n echo \"<tr><th>Number Of Vehicles per Branch</th><th>City</th><th>Location</th></tr>\";\n foreach ($list AS $row) {\n echo \"<tr><td>\" . $row[\"0\"] . \"</td><td>\" . $row[\"1\"] . \"</td><td>\" . $row[\"2\"] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n } else {\n echo \"There is no car rented today!!!\";\n }\n echo \"</table>\";\n }", "function make_table($query) {\r\n\t\techo \"<table><tr>\";\r\n\t\t$row = mysqli_fetch_assoc($query);\r\n\t\tforeach ($row as $attr => $value) {\r\n\t\t\techo \"<th>$attr</th>\";\r\n\t\t}\r\n\t\techo \"</tr>\";\r\n\t\twhile ($row = mysqli_fetch_assoc($query)) { \r\n\t\t\techo \"<tr>\";\r\n\t\t\tforeach($row as $value) {\r\n\t\t\t\techo \"<td>$value</td>\";\r\n\t\t\t}\r\n\t\t\techo \"</tr>\";\r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "public function run()\n {\n\n // characteristics for electronics (1,15)\n DB::table('characteristics')->insert([\n 'name' => 'Processor', //value will be a (number.number) GHz\n 'values' => '2.1 Ghz, 2.6 Ghz, 3.1 Ghz',\n 'category_id' => '1'\n\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Processor', //value will be a (number.number) GHz\n 'values' => '2.3 Ghz, 2.9 Ghz',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'RAM Memory', //value will be a number RAM\n 'values' => '8GB',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'RAM Memory', //value will be a number RAM\n 'values' => '16GB, 32GB',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Dual core', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Dual core', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Resolution', //value will be a number x number\n 'values' => '1440x960',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Resolution', //value will be a number x number\n 'values' => '1900x1440',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contrast', //value will be a number:number\n 'values' => '5000:1',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contrast', //value will be a number:number\n 'values' => '10000:1',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'HD front camera', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'HD front camera', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Surface', //value will be platic,alluminium,metal etc...\n 'values' => 'plastic',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Surface', //value will be platic,alluminium,metal etc...\n 'values' => 'alluminium',\n 'category_id' => '1'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Surface', //value will be platic,alluminium,metal etc...\n 'values' => 'metal',\n 'category_id' => '1'\n ]);\n\n // for($i=0;$i<=20;$i++){\n // DB::table('characteristics')->insert([\n // 'name' => 'Char'.$i, //value will be platic,alluminium,metal etc...\n //\n // ]);\n // }\n\n\n // characteristics for clothes and footwear (16,39)\n DB::table('characteristics')->insert([\n 'name' => 'Material', //value will be cotton, silk, leather etc...\n 'values' => 'cotton',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Material', //value will be cotton, silk, leather etc...\n 'values' => 'silk',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Material', //value will be cotton, silk, leather etc...\n 'values' => 'leather',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Texture', //value will be soft, harsh, grumpy etc...\n 'values' => 'soft',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Texture', //value will be soft, harsh, grumpy etc...\n 'values' => 'harsh',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Texture', //value will be soft, harsh, grumpy etc...\n 'values' => 'grumpy',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Washing temperature', //value will be a number\n 'values' => '90 Celsius degrees',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Washing temperature', //value will be a number\n 'values' => '30 Celsius degrees',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Ironing temperature', //value will be a number\n 'values' => '30 Celsius degrees',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Ironing temperature', //value will be a number\n 'values' => '70 Celsius degrees',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can use the washing machine', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can use the washing machine', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Slowly dry', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Slowly dry', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can combine with other clothes/footwear when washing', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can combine with other clothes/footwear when washing', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Size', //value will be a number\n 'values' => '36',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Size', //value will be a number\n 'values' => '38',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Size', //value will be a number\n 'values' => 'all',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recommanded wearing season', //value will be winter/spring/summer/autumn\n 'values' => 'autumn',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recommanded wearing season', //value will be winter/spring/summer/autumn\n 'values' => 'winter',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recommanded wearing season', //value will be winter/spring/summer/autumn\n 'values' => 'spring',\n 'category_id' => '2'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recommanded wearing season', //value will be winter/spring/summer/autumn\n 'values' => 'summer',\n 'category_id' => '2'\n ]);\n\n // characteristics for food (40,53)\n DB::table('characteristics')->insert([\n 'name' => 'Taste', //value will be sour,sweet,chilli etc\n 'values' => 'sour, sweet',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Taste', //value will be sour,sweet,chilli etc\n 'values' => 'sweet',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Taste', //value will be sour,sweet,chilli etc\n 'values' => 'sour',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Taste', //value will be sour,sweet,chilli etc\n 'values' => 'chilli, sweet',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Smell', //value will be inodour,powerfull,sweet,good,bad etc\n 'values' => 'odourless',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Smell', //value will be inodour,powerfull,sweet,good,bad etc\n 'values' => 'powerfull',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Smell', //value will be inodour,powerfull,sweet,good,bad etc\n 'values' => 'sweet',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Smell', //value will be inodour,powerfull,sweet,good,bad etc\n 'values' => 'bad',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Serving temperature', //value will be a number\n 'values' => '30 Celsius degrees',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Serving temperature', //value will be a number\n 'values' => '0 Celsius degrees',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Found in my region', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Found in my region', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can easily buy from supermarket', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Can easily buy from supermarket', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Is exotic food', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Is exotic food', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recipe is known', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Recipe is known', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contains', //value will be nuts,gluten,lactose etc...(possbile allergens) and the rest of the ingredients\n 'values' => 'nuts',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contains', //value will be nuts,gluten,lactose etc...(possbile allergens) and the rest of the ingredients\n 'values' => 'gluten',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contains', //value will be nuts,gluten,lactose etc...(possbile allergens) and the rest of the ingredients\n 'values' => 'cocoa',\n 'category_id' => '4'\n\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contains', //value will be nuts,gluten,lactose etc...(possbile allergens) and the rest of the ingredients\n 'values' => 'lactose',\n 'category_id' => '4'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Contains', //value will be nuts,gluten,lactose etc...(possbile allergens) and the rest of the ingredients\n 'values' => 'salt',\n 'category_id' => '4'\n ]);\n\n // characteristics for games (54,67)\n DB::table('characteristics')->insert([\n 'name' => 'Genre', //value will be sport,arcade,racing,fight etc...\n 'values' => 'sport',\n 'category_id' => '5'\n\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Genre', //value will be sport,arcade,racing,fight etc...\n 'values' => 'racing',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Genre', //value will be sport,arcade,racing,fight etc...\n 'values' => 'fight',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Co-player', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Co-player', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Single player', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Single player', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Played in network', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Played in network', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs previous versions', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs previous versions', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs Internet connection', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '5'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs Internet connection', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '5'\n ]);\n\n\n // characteristics for services (68,75)\n DB::table('characteristics')->insert([\n 'name' => 'Room service', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Room service', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Close to town center', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Close to town center', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Has direct connection', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Has direct connection', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Close to the beach', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '6'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Close to the beach', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '6'\n ]);\n\n\n // characteristics for education (76,86)\n DB::table('characteristics')->insert([\n 'name' => 'Needs founding', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs founding', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs paying back method', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Needs paying back method', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Abroad studying possibility', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Abroad studying possibility', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Scholarships offered', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Scholarships offered', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Won Grammy Prize', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '7'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Won Grammy Prize', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '7'\n ]);\n\n // characteristics for entertainment (87,98)\n DB::table('characteristics')->insert([\n 'name' => 'Playing tonight', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Playing tonight', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Qualified to semi-finals', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Qualified to semi-finals', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Live match', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Live match', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Tickets on sale', //value will be yes or no\n 'values' => 'yes',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Tickets on sale', //value will be yes or no\n 'values' => 'no',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Ticket price', //value will be a number\n 'values' => '100e',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Ticket price', //value will be a number\n 'values' => '80e',\n 'category_id' => '8'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Ticket price', //value will be a number\n 'values' => 'from 20e',\n 'category_id' => '8'\n ]);\n\n // characteristics for every item (99,109)\n DB::table('characteristics')->insert([\n 'name' => 'Price', //value will be a number\n 'values' => '30e',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Price', //value will be a number\n 'values' => '70e',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Price', //value will be a number\n 'values' => '80e',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Price', //value will be a number\n 'values' => '180e',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Quality', //value will be good,best etc\n 'values' => 'good',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Quality', //value will be good,best etc\n 'values' => 'best',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Shipping time', //value will be a number (of days)\n 'values' => '6-7 days',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Shipping time', //value will be a number (of days)\n 'values' => '2-5 days',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Shipping costs', //value will be a number\n 'values' => '10e',\n 'category_id' => '9'\n ]);\n DB::table('characteristics')->insert([\n 'name' => 'Shipping costs', //value will be a number\n 'values' => '5e',\n 'category_id' => '9'\n ]);\n\n\n // etc.... mai adaugati voi....\n\n }", "function trainClassifier($dbconnection) {\n\t//once all the words are written to the feature vector, now add a word to featureListSentiment table for each group of the same sentiment and \n\t//assign a probability to that word and sentiment using the naive bayes formula. \n\t$sql=\"DELETE FROM featureListSentiment\" ;\n\t$result=$dbconnection->query($sql) ;\n\n\t$sql=\"INSERT INTO featureListSentiment( tweetWord, tweetPolarityInt, tweetProbability ) \n\t SELECT fv.tweetWord, fv.tweetPolarity, (\n COUNT( fv.tweetWord ) / ( \n SELECT COUNT( fv1.tweetWord ) \n FROM featureVector fv1\n WHERE fv1.tweetWord = fv.tweetWord )\n ) AS probability\n FROM featureVector fv\n GROUP BY fv.tweetWord, fv.tweetPolarity\" ;\t\n \t$result=$dbconnection->query($sql) ;\n\t echo \"Machine has been trained<br><br>\" ;\n}", "public function makeTable($headings, $content);", "public function run() {\n \\DB::table('vehicle_types')->insert(array(\n [\n 'name' => 'Taxi',\n 'group' => NULL,\n 'description' => 'Does not belong to any group'\n ],\n [\n 'name' => 'Matatu',\n 'group' => 'Matatu Sacco',\n 'description' => ''\n ],\n [\n 'name' => 'Bus',\n 'group' => 'Bus Company',\n 'description' => ''\n ],\n [\n 'name' => 'Taxi',\n 'group' => 'Taxi Company',\n 'description' => ''\n ],\n [\n 'name' => 'Company vehicle',\n 'group' => 'Company vehicle',\n 'description' => ''\n ],\n [\n 'name' => 'Tour van',\n 'group' => 'Tour Company',\n 'description' => ''\n ]\n ));\n }", "function build_vehicle_javascript()\n\t{\n\t\tglobal $db;\n\n\t\t$make_q_id = \"SELECT id, make FROM \" . GARAGE_MAKES_TABLE . \" ORDER BY make ASC\";\n\t\n\t\tif( !($make_result = $db->sql_query($make_q_id)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\twhile ( $make_row = $db->sql_fetchrow($make_result) )\n\t\t{\n\t\t\t// Start this makes row in the output, this is where it gets confusing!\n\t\t\t$return .= 'cars[\"'.$make_row['make'].'\"] = new Array(\"'.$make_row['id'].'\", new Array(';\n\n\t\t\t$make_row_id = $make_row['id'];\n \t\t$model_q_id = \"SELECT id, model FROM \" . GARAGE_MODELS_TABLE . \" \n \t\t WHERE make_id = $make_row_id ORDER BY model ASC\";\n\n\t\t\tif( !($model_result = $db->sql_query($model_q_id)) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t\t} \n\n\t \t$model_string = '';\n\t\t\t$model_id_string = '';\n\n\t\t\t// Loop through all the models of this make\n\t\t\twhile ( $model_row = $db->sql_fetchrow($model_result) )\n\t\t\t{\n\t\t\t\t// Create the arrays that we will use in the output\n\t\t\t\t$model_string .= '\"'.$model_row['model'].'\",';\n\t\t\t\t$model_id_string .= '\"'.$model_row['id'] .'\",';\n\t\t\t}\n\t\t\t$db->sql_freeresult($model_result);\n\n\t\t\t// Strip off the last comma\n\t\t\t$model_string = substr($model_string, 0, -1);\n\t\t\t$model_id_string = substr($model_id_string, 0, -1);\n\n\t\t\t// Finish off this makes' row in the output\n\t\t\t$return .= $model_string .\"), new Array(\". $model_id_string .\"));\\n\";\n\t }\n\t\t$db->sql_freeresult($make_result);\n\n\t return $return;\n\t}", "function titulopersonal(){\n print (\"\\n<tr>\");\n if($this->titulo !=\"\")\n foreach ($this->titulo as $titulo){\n print (\"\\n<th>$titulo</th>\");\n }\n print (\"\\n<tr>\"); \n }", "function tabla02($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"1\\\">\";\n\tforeach( $array01 as $key => $value){\n\t\tif ( $key == 'id' or $key == 'ID' or $key == 'Id'){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td> - </td></tr>\\n\";\n\t\t} else{\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n}", "function buildClassificationList($classifications){ \r\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">'; \r\n $classificationList .= \"<option>Choose a Classification</option>\"; \r\n foreach ($classifications as $classification) { \r\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\"; \r\n } \r\n $classificationList .= '</select>'; \r\n return $classificationList; \r\n }", "function toTable($data)\n{\n//print_r($data);\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = \"<table>\\n\\t<tr>\";\n\tforeach($keys as $key)\n\t{\n\t\t$result .= '<th>' . $key . '</th>';\n\t}\n\t$result .= \"</tr>\\n\";\n\t$counter = 0;\n\tforeach($data as $item)\n\t{\n\t\t$counter++;\n\t\tif ($counter % 2 == 1)\n\t\t{\n\t\t\t$result .= \"\\t<tr>\";\n\t\t} else\n\t\t{\n\t\t\t$result .= \"\\t<tr class=\\\"odd\\\">\";\n\t\t}\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= '<td>' . $value . '</td>';\n\t\t}\n\t\t$result .= \"</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\treturn $result;\n}", "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "protected\n function makeTableRows($modelVars, $useLang)\n {\n $models = $modelVars['models'];\n $dash_models = $modelVars['dash-models'];\n $camelModel = $modelVars['camelModel'];\n $CamelModel = $modelVars['CamelModel'];\n\n $relationModelList = GeneratorsServiceProvider::getRelationsModelVarsList(GeneratorsServiceProvider::splitFields($this->cache->getFields(), true));\n $fields = GeneratorsServiceProvider::splitFields($this->cache->getFields(), SCOPED_EXPLODE_WANT_ID_RECORD | SCOPED_EXPLODE_WANT_TEXT);\n $fields = GeneratorsServiceProvider::filterFieldHavingOption($fields, 'hidden');\n\n // First, we build the table headings\n if ($useLang) {\n $headings = array_map(function ($field) use ($dash_models, $fields, $models, $CamelModel) {\n $type = $fields[$field];\n if (preg_match('/\\bbitset\\b/', $type)) {\n return <<<PHP\n@foreach({{app_namespace}}\\\\$CamelModel::\\${$field}_bitset as \\$type => \\$flag)\n <th>@lang('$models.'.\\$type)</th>\n @endforeach\nPHP;\n } else {\n return '<th>@lang(\\'' . $dash_models . '.' . $field . '\\')</th>';\n }\n }, array_keys($fields));\n } else {\n $headings = array_map(function ($field) use ($CamelModel, $fields) {\n $type = $fields[$field];\n if (preg_match('/\\bbitset\\b/', $type)) {\n $Type = ucwords($type);\n return <<<PHP\n@foreach({{app_namespace}}\\\\$CamelModel::\\${$field}_bitset as \\$type => \\$flag)\n <th>{{ucwords(str_replace('_', ' ', \\$type))}}</th>\n @endforeach\nPHP;\n } else {\n return '<th>' . ucwords($field) . '</th>';\n }\n }, array_keys($fields));\n }\n\n // And then the rows, themselves\n $nextIndent = '';\n $fields = array_map(function ($field) use ($camelModel, $fields, $relationModelList, $CamelModel, &$nextIndent) {\n list($type, $options) = GeneratorsServiceProvider::fieldTypeOptions($fields[$field]);\n $nullable = (strpos($options, 'nullable') !== false);\n $indent = $nextIndent;\n $nextIndent = \"\\t\";\n\n if (strpos($options, 'hidden') !== false) {\n unset($fields[$field]);\n return null;\n }\n\n if (preg_match('/\\bbitset\\b/', $options)) {\n $params = preg_match('/bitset\\((.*)\\)/', $options, $matches) ? $matches[1] : '';\n if ($params === '') $params = $field;\n $params = explode(',', $params);\n return <<<PHP\n @foreach({{app_namespace}}\\\\$CamelModel::\\${$field}_bitset as \\$type => \\$flag)\n <td>{{ \\$$camelModel->\\$type }}</td>;\n @endforeach\nPHP;\n } elseif ($type === 'integer' || $type === 'bigInteger') {\n if (array_key_exists($field, $relationModelList)) {\n $relFuncName = trim_suffix($field, '_id');\n $nameCol = $relationModelList[$field]['name'];\n if ($nullable) {\n return \"$indent<td>{{ is_null(\\$$camelModel->$field) ? '' : \\$$camelModel->$field . ':' . \\$$camelModel->{$relFuncName}->$nameCol }}</td>\";\n } else {\n return \"$indent<td>{{ \\$$camelModel->$field . ':' . \\$$camelModel->{$relFuncName}->$nameCol }}</td>\";\n }\n }\n }\n\n return \"$indent<td>{{ \\$$camelModel->$field }}</td>\";\n }, array_keys($fields));\n\n // Now, we'll add the edit and delete buttons.\n $editAndDelete = <<<EOT\n <td>\n {!! Form::open(['style' => 'display: inline-block;', 'method' => 'DELETE', 'route' => ['{$models}.destroy', \\${$camelModel}->id, ], ]) !!}\n {!! formSubmit('Delete', ['class' => 'btn btn-danger', ]) !!}\n {!! Form::close() !!}\n {!! link_to_route('{$models}.edit', 'Edit', array(\\${$camelModel}->id), ['class' => 'btn btn-info',]) !!}\n </td>\nEOT;\n\n return [$headings, $fields, $editAndDelete];\n }", "public function run()\n {\n DB::table('vehicletypes')->insert([\n 'vehicleId' => '1',\n 'title' => 'Bolan',\n 'price' => '11',\n 'image' => '60c3360d8d8b1.jpg',\n 'description' => 'With upgraded features and advanced Euro-II technology, now your Suzuki Bolan is more environment friendly. Now drive the extra mile, with high standard engine performance in low fuel consumption and inexpensive maintenance that let your savings augment in an economical way!',\n 'engine_cap' => '796 cc',\n 'seat_cap' => '5',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual',\n 'version' => 'VX',\n 'colours' => 'Pearl Red, Silky Silver, White',\n\n ]);\n\n DB::table('vehicletypes')->insert([\n 'vehicleId' => '1',\n 'title' => 'Bolan',\n 'price' => '11',\n 'image' => '60c336aa4efe4.jpg',\n 'description' => 'With upgraded features and advanced Euro-II technology, now your Suzuki Bolan is more environment friendly. Now drive the extra mile, with high standard engine performance in low fuel consumption and inexpensive maintenance that let your savings augment in an economical way!',\n 'engine_cap' => '796 cc',\n 'seat_cap' => '5',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual',\n 'version' => 'VX',\n 'colours' => 'Pearl Red, Silky Silver, White',\n\n ]);\n\n DB::table('vehicletypes')->insert([\n 'vehicleId' => '1',\n 'title' => 'Bolan',\n 'price' => '11',\n 'image' => '60c336f05437d.jpg',\n 'description' => 'With upgraded features and advanced Euro-II technology, now your Suzuki Bolan is more environment friendly. Now drive the extra mile, with high standard engine performance in low fuel consumption and inexpensive maintenance that let your savings augment in an economical way!',\n 'engine_cap' => '796 cc',\n 'seat_cap' => '5',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual',\n 'version' => 'VX',\n 'colours' => 'Pearl Red, Silky Silver, White',\n\n ]);\n\n\nDB::table('vehicletypes')->insert([\n 'vehicleId' => '2',\n 'title' => 'Alto',\n 'price' => '12',\n 'image' => '60c3377f423ea.jpg',\n 'description' => 'The Car for New Generation Fuel Efficient – Spacious – Modern Design',\n 'engine_cap' => '660 cc',\n 'seat_cap' => '4',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual/ Auto Gear Shift',\n 'version' => 'VX, VXR, AGS',\n 'colours' => 'Cerulean Blue, Pearl Red, Graphite Gray, Silky Silver, White, Pearl Black, Sand Beige',\n]);\n\nDB::table('vehicletypes')->insert([\n 'vehicleId' => '2',\n 'title' => 'Alto',\n 'price' => '12',\n 'image' => '60c337d4ea816.png',\n 'description' => 'The Car for New Generation Fuel Efficient – Spacious – Modern Design',\n 'engine_cap' => '660 cc',\n 'seat_cap' => '4',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual/ Auto Gear Shift',\n 'version' => 'VX, VXR, AGS',\n 'colours' => 'Cerulean Blue, Pearl Red, Graphite Gray, Silky Silver, White, Pearl Black, Sand Beige',\n]);\n\nDB::table('vehicletypes')->insert([\n 'vehicleId' => '3',\n 'title' => 'Swift',\n 'price' => '12',\n 'image' => '60c33830777ca.jpg',\n 'description' => 'An eye–catching and dynamic sense of style has always set Swift apart from other compact cars. Swift gives you more of everything without compromising on style or performance. Swift is a young, fun and dynamic car for fun-loving people. With Swift you’ll be loving the drive and loving your life more than you ever thought possible.',\n 'engine_cap' => '1328 cc',\n 'seat_cap' => '5',\n 'doors' => '5',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual/Automatic',\n 'version' => 'DLX Navigation, Automatic Navigation',\n 'colours' => 'Pearl Red, Graphite Gray, Silky Silver, White, Pearl Black, Sand Beige',\n]);\n\nDB::table('vehicletypes')->insert([\n 'vehicleId' => '4',\n 'title' => 'Jimmy',\n 'price' => '54',\n 'image' => '60c338bd11e47.jpg',\n 'description' => 'Nothing but daring',\n 'engine_cap' => '1500 cc',\n 'seat_cap' => '4',\n 'doors' => '3',\n 'fuel_type' => 'Petrol',\n 'transm_type' => 'Manual ()4WD',\n 'version' => 'GA',\n 'colours' => 'White, Metallic Silky Silver, Kinetic Yellow, Jungle Green, Pearl Bluish Black',\n]);\n\n}", "public function test()\n {\n foreach ($this->testData->vectors as $vector) {\n $vector->setClass($this->getNearestCluster($vector));\n }\n }", "public function createCouriersTable(SchemaSetupInterface $setup)\n {\n $table = $setup->getConnection()->newTable($setup->getTable('zitec_emkp_couriers'))\n ->addColumn(\n 'id',\n Table::TYPE_INTEGER,\n null,\n ['identity' => true, 'nullable' => false, 'primary' => true, 'unsigned' => true,],\n 'Courier ID'\n )->addColumn(\n 'emag_id',\n Table::TYPE_INTEGER,\n null,\n ['nullable' => false,],\n 'Emag ID'\n )->addColumn(\n 'name',\n Table::TYPE_TEXT,\n 60,\n ['nullable' => false,],\n 'Courier Name'\n )->addColumn(\n 'display_name',\n Table::TYPE_TEXT,\n 60,\n ['nullable' => false,],\n 'Courier Display Name'\n )->addColumn(\n 'created_at',\n Table::TYPE_DATETIME,\n null,\n ['nullable' => false],\n 'Created At'\n )->addColumn(\n 'updated_at',\n Table::TYPE_TIMESTAMP,\n null,\n ['nullable' => false, 'default' => Table::TIMESTAMP_INIT_UPDATE],\n 'Updated At'\n )->addIndex(\n $setup->getIdxName('zitec_emkp_couriers_emag_id', ['emag_id']),\n ['emag_id']\n );\n\n $setup->getConnection()->createTable($table);\n }", "public function vehicles_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicles->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t$last_login = '';\n\t\t\tforeach ($list as $vehicle) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$thumbnail = '';\n\t\t\t\t$filename = FCPATH.'uploads/vehicles/'.$vehicle->id.'/'.$vehicle->vehicle_image;\n\n\t\t\t\t$url = 'admin/vehicle_details';\n\t\t\t\t\n\t\t\t\tif($vehicle->vehicle_image == '' || $vehicle->vehicle_image == null || !file_exists($filename)){\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->db->select('*, MIN(id) as min_id', false)->from('vehicle_images')->where('vehicle_id', $vehicle->id)->get()->row();\n\t\t\t\t\n\t\t\t\t\tif(!empty($result)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'uploads/vehicles/'.$result->vehicle_id.'/'.$result->image_name.'\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'assets/images/img/no-default-thumbnail.png\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\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\t$thumbnail = '<img src=\"'.base_url().'uploads/vehicles/'.$vehicle->id.'/'.$vehicle->vehicle_image.'\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\" style=\"margin:5% auto;\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$vehicle->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:35%; margin-right:35%;\">'.$thumbnail.'</div>';\n\t\t\t\t\n\t\t\t\t$row[] = '<a href=\"!#\" data-toggle=\"modal\" data-target=\"#viewModal\" class=\"link\" onclick=\"viewVehicle('.$vehicle->id.',\\''.$url.'\\');\" id=\"'.$vehicle->id.'\" title=\"View '.$vehicle->vehicle_make .' '.$vehicle->vehicle_model.'\">'.$vehicle->vehicle_make .' '.$vehicle->vehicle_model.'</a>';\n\t\t\t\t\n\t\t\t\t$row[] = $vehicle->vehicle_type;\n\t\t\t\t\n\t\t\t\t$row[] = $vehicle->vehicle_make;\n\t\t\t\t$row[] = $vehicle->vehicle_model;\n\t\t\t\t$row[] = $vehicle->year_of_manufacture;\n\t\t\t\t\n\t\t\t\t$last_updated = $vehicle->last_updated;\n\t\t\t\tif($last_updated == '0000-00-00 00:00:00' || $last_updated == ''){\n\t\t\t\t\t$last_updated = 'Never'; \n\t\t\t\t}else{\n\t\t\t\t\t$last_updated = date(\"F j, Y, g:i a\", strtotime($last_updated )); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$row[] = $last_updated;\n\t\t\t\t\n\t\t\t\t//prepare buttons\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#addVehicleModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicle('.$vehicle->id.',\\''.$url.'\\')\" title=\"Click to Edit \"><i class=\"fa fa-edit\"></i> Edit</a>\n\t\t\t\t<a data-toggle=\"modal\" data-target=\"#addImagesModal\" class=\"btn btn-info btn-xs\" title=\"Add / Remove Images\" onclick=\"editVehicleImages('.$vehicle->id.',\\''.$url.'\\')\"><i class=\"fa fa-upload\"></i> Add / Remove Images</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicles->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicles->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "function train(){\n\t\t$sql = \"SELECT bow.idWord,COUNT(bow.idWord) as total from bow,sample WHERE bow.idTuit = sample.idTuit and sample.trainingSet = 1 and sample.class = 0 GROUP BY idWord\";\n\t\t$result = mysql_query($sql) or die(\"Classifier->train: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t\n\t\twhile ($row = mysql_fetch_array($result, MYSQL_NUM)) {\n \t\t$idWord = $row[0]; \n\t\t\t$count = $row[1]; \n\t\t\t$sql = \"UPDATE dictionary SET n_nondoc = $count WHERE idWord = $idWord\";\n\t\t\tmysql_query($sql) or die(\"Classifier->train_2: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t}\n\t\t\n\t\t//luego los no documentales\n\t\t$sql = \"SELECT bow.idWord,COUNT(bow.idWord) as total from bow,sample WHERE bow.idTuit = sample.idTuit and sample.trainingSet = 1 and sample.class = 1 GROUP BY idWord\";\n\t\t$result = mysql_query($sql) or die(\"Classifier->train_3: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t\n\t\twhile ($row = mysql_fetch_array($result, MYSQL_NUM)) {\n \t\t$idWord = $row[0]; \n\t\t\t$count = $row[1]; \n\t\t\t$sql = \"UPDATE dictionary SET n_doc = $count WHERE idWord = $idWord\";\n\t\t\tmysql_query($sql) or die(\"Classifier->train_4: error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t}\n\t\n\t}", "public function generateTable($type, $data){\n\t\t$db = new Database();\n\t\t$conn_result = $db->connect();\n\t\tif($conn_result[\"error\"] == TRUE){ \n\t\t\t\t\treturn $conn_result; \n\t\t\t\t}\n\t\t//fetch array\n\t\twhile($row = mysqli_fetch_array($data)){\n\t\t\t//FETCH DATA TO DISPLAY\n\t\t\t$array = $this->setTableData($row, $db);\n\t\t\t//grab first td entry depending on type\n\t\t\t$this->printTableData($array, $type);\n\t\t}//end while\n\t}", "function ucsc_getListFeatures($orgv,&$predictions){\n checkConfig(); global $features_file; $lines=file($features_file);\n foreach($lines as $line){\n list($orgg,$org,$version,$data)=explode(\",\",$line);\n if(strtoupper($orgv)==strtoupper($version)){\n $annots=split(\":\",$data);\n foreach($annots as $annot)\n $predictions[]=array('prediction'=>array('name'=>$annot,'id'=>$annot));\n break;\n }\n }\n}", "public static function table_top_label () \n {\n $html = null;\n\n $html .= '<thead>\n <tr>\n <td id=\"cb\" class=\"manage-column column-cb check-column\">\n <label class=\"screen-reader-text\" for=\"cb-select-all-1\">\n Select All\n </label>\n <input id=\"cb-select-all-1\" type=\"checkbox\">\n </td>\n <th scope=\"col\" id=\"title\" class=\"manage-column column-title\">\n Name\n </th>\n <th scope=\"col\" id=\"tags\" class=\"manage-column column-tags column-primary\">\n Excerpt\n </th>\n <th scope=\"col\" id=\"author\" class=\"manage-column column-author\">\n Author\n </th>\n <th scope=\"col\" id=\"comments\" class=\"manage-column column-comments\">\n <span class=\"vers comment-grey-bubble\" title=\"Comments\">\n <span class=\"screen-reader-text\">\n Comments\n </span>\n </span>\n </th>\n <th scope=\"col\" id=\"date\" class=\"manage-column column-date\">\n Date\n </th> \n </tr>\n </thead>';\n\n return $html; \n }", "public function make()\n {\n return $this->newTable()\n ->editColumn('product', function ($review) {\n return $review->product->name;\n })\n ->editColumn('status', function ($review) {\n return $review->is_approved\n ? '<span class=\"dot green\"></span>'\n : '<span class=\"dot red\"></span>';\n });\n }", "public function queryGetCaracteristicas($content){\n // th = description\n // td = value\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $atributoValue = \"data-table\";\n $tag = \"table\";\n $consulta = \"//\".$tag.\"[@class='\".$atributoValue.\"']\";\n $elements = $xpath->query($consulta);\n $caracValue = array();\n $caracTitle = array();\n $caracString = \"\";\n if ($elements->length > 0){\n foreach($elements as $element){\n $tds = $element->getElementsByTagName(\"td\");\n $ths = $element->getElementsByTagName(\"th\");\n foreach($tds as $td){\n //var_dump($tr);\n //echo ($td->nodeValue);\n //echo \"<br><br>\";\n $value = ltrim(rtrim($td->nodeValue));\n $value = str_replace(\":\",\" \",$value);\n $value = str_replace(\";\",\" \",$value);\n array_push($caracValue,$value);\n }\n foreach($ths as $th){\n //var_dump($td);\n $encontrado = FALSE;\n $valor = ltrim(rtrim($th->nodeValue));\n foreach($this->vectorCaracteristicasDefault as $default){\n if ($default == $valor){\n $encontrado = TRUE;\n }\n }\n if ($encontrado == FALSE){\n array_push($this->vectorCaracteristicasDefault,$valor);\n }\n array_push($caracTitle,ltrim(rtrim($th->nodeValue)) );\n //echo ($th->nodeValue);\n //echo \"<br><br>\";\n }\n }\n }\n $contador = 0;\n foreach($caracValue as $valor){\n if ($caracTitle[$contador] != \"Descripción\" && $caracTitle[$contador] != \"Marca\" ){\n $valorTruncado = substr($valor, 0, 254);\n $caracString.= $caracTitle[$contador].\":\".$valorTruncado.\",\";\n }else if ($caracTitle[$contador] == \"Descripción\"){\n $descripcion = rtrim(ltrim($valor));\n }\n $contador++;\n }\n $caracString = substr($caracString,0,strlen($caracString)-1);\n $vector = array(\n \"carac\" => $caracString,\n \"desc\" => $descripcion\n );\n //echo $caracString.\"<br>\";\n return $vector;\n }", "public function populateRegionTables() {\n\t\t$scrapeLog = $this->addLog(COUNTY_TABLE);\n\t\t\n\t\t$counties = $this->countyRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . COUNTY_PATH);\n\t\tforeach($counties as $county) {\n\t\t\t$this->countyRepository->add($county);\n\t\t\t\n\t\t\t$municipalities = $this->municipalityRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . MUNICIPALITY_PATH . $county->getCountyId(), $county->getCountyId());\n\t\t\t\n\t\t\tforeach($municipalities as $municipality) {\n\t\t\t\t$this->municipalityRepository->add($municipality);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}", "function generaTabla($idciudad, $tnegocio, $cantidad, $criterio, $pagina, $registro)\n {\n $array = tbOrganizacionData::getpaginartmp($idciudad, $tnegocio, (($pagina - 1) * $registro), $registro);\n $str = '';\n $imgs= \"\";\n $sihotel = 0;\n $i =0;\n foreach ($array as $rs) {\n $i++;\n $sihotel = 0;\n $dimgs = \"images/imgHoteles/dir\".$rs['idorg'].\"/imgHotel\";\n if (is_dir($dimgs)) {\n //Escaneamos el directorio\n $carpeta = @scandir($dimgs);\n $sihotel = count($carpeta);\n }\n $imgs = \"images/imgHoteles/\";\n $imgs .= ($sihotel > 2) ? \"dir\" . $rs['idorg'] . \"/imgHotel\" : \"imgdefault/hotel\" ;\n $str .= '\n <div class=\"row stylerow\">\n <div class=\"col-sm-3 col-md-3 col-lg-3 quitar\"> \n <img class=\"img-fluid img-thumbnail\" src=\"'.\n $imgs.'/img1.jpg\" alt=\"\" style=\"height: 100% !important;\"/>\n </div>\n <div class=\"col-sm-2 col-md-2 col-lg-2 quitar\"> \n <div class=\"dos\">\n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img2.jpg\" alt=\"\"/> \n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img3.jpg\" alt=\"\"/> \n </div>\n </div>\n <!-- <div class=\"clearfix\"></div> -->\n <div class=\"col-sm-7 col-md-7 col-lg-7 quitar\"> \n <div class=\"row\"> \n <div class=\"col-sm-12 col-md-12 col-lg-12 quitar\"> \n <a href=\"index.php?view=datosHotel.php&idh='. $rs['idorg'].'\" ><span class=\"namehotel\">'.$rs['nomborg']. '</span></a>\n </div>\n <div class=\"col-sm-12 col-md-12 col-lg-12 styledato\"> \n ' . $rs['desgeneral1'] . '<br> ' . $rs['desgeneral2']. '\n </div>\n </div> \n </div>\n </div>'; \n }\n $funcion = \"buscaRecord\";\n $str .= pagination($cantidad, $pagina, $funcion, $criterio, $registro, 6);\n // pagination($cantidad, $pagina, $funcion, $criterio, $registro, 5); \n return $str;\n }", "public function return_table()\n {\n $table = \"classes\";\n return $table;\n }", "function createTable(array $results = array())\n{\n if (empty($results)) {\n return '<table><tr><td>Empty Result Set</td></tr></table>';\n }\n\n // dynamically create the header information from the keys\n // of the result array from mysql\n $table = '<table>';\n $keys = array_keys(reset($results));\n $table.='<thead><tr>';\n foreach ($keys as $key) {\n $table.='<th><mark>&nbsp;'.$key.'&nbsp;</mark></th>';\n }\n $table.='</tr></thead>';\n\n // populate the main table body\n $table.='<tbody>';\n foreach ($results as $result) {\n $table.='<tr>';\n foreach ($result as $val) {\n $table.='<td><mark>&nbsp;'.$val.'&nbsp;</mark></td>';\n }\n $table.='</tr>';\n }\n $table.='</tbody></table>';\n return $table;\n}", "function buildClassificationList($classifications)\n{\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">';\n $classificationList .= \"<option>Choose a Classification</option>\";\n foreach ($classifications as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n $classificationList .= '</select>';\n return $classificationList;\n}", "function get_fees_manage_table($fees, $controller) {\n $CI = &get_instance();\n $controller_name = strtolower(get_class($CI));\n\n $table = '<table class=\"tablesorter table table-bordered table-hover\" id=\"sortable_table\">';\n $headers = array(\n '<input type=\"checkbox\" id=\"select_all\" />',\n lang('fees_name'),\n lang('common_major'),\n lang('degree_code'),\n lang('degree_name'),\n lang('fees_year_fee'),\n lang('common_action')\n );\n\n $table.='<thead><tr>';\n $count = 0;\n foreach ($headers as $header) {\n $count++;\n\n if ($count == 1) {\n $table.=\"<th class='leftmost'>$header</th>\";\n } elseif ($count == count($headers)) {\n $table.=\"<th class='rightmost'>$header</th>\";\n } else {\n $table.=\"<th>$header</th>\";\n }\n }\n\n $table.='</tr></thead><tbody>';\n $table.=get_fees_manage_table_data_rows($fees, $controller);\n $table.='</tbody></table>';\n return $table;\n}", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "function Escenario($lista){\r\necho \"<table class='tg' border='1' style='margin:auto;'>\";\r\n echo \"<tr>\";\r\n echo \"<th colspan='6'>ESCENARIO</th>\";\r\n echo \"<tr>\";\r\n echo \"<th></th>\r\n <th>1</th>\r\n <th>2</th>\r\n <th>3</th>\r\n <th>4</th> \r\n <th>5</th>\r\n </tr>\";\r\n \r\n$i=1;\r\n// Imprimimos el contenido de la tabla\r\nforeach ($lista as $fila) {\r\n echo \"<tr>\";\r\n echo \"<th>\";\r\n echo $i;\r\n echo \"</th>\";\r\n foreach ($fila as $silla) {\r\n echo \"<td>\";\r\n echo $silla;\r\n echo \"</td>\";\r\n }\r\n echo \"</tr>\";\r\n $i++;\r\n }\r\necho \"</table>\";\r\n}", "public function run()\n {\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 1,\n 'name' => 'Economic',\n 'price' => 15000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 1,\n 'name' => 'Business',\n 'price' => 20000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 2,\n 'name' => 'Economic',\n 'price' => 30000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 2,\n 'name' => 'Business',\n 'price' => 35000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 3,\n 'name' => 'Economic',\n 'price' => 40000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 3,\n 'name' => 'Business',\n 'price' => 45000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 4,\n 'name' => 'Economic',\n 'price' => 25000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 4,\n 'name' => 'Business',\n 'price' => 30000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 5,\n 'name' => 'Economic',\n 'price' => 35000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 5,\n 'name' => 'Business',\n 'price' => 40000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 6,\n 'name' => 'Economic',\n 'price' => 45000\n ]);\n\n DB::table('ticket_classes')->insert([\n 'ticket_category_id' => 6,\n 'name' => 'Business',\n 'price' => 50000\n ]);\n }", "public function getLabelData()\n {\n $query = '\nSELECT\n d.id, CONCAT(d.fornavn, \" \",\n d.efternavn),\n w.navn AS wear,\n dwp.antal,\n dwp.size\nFROM\n deltagere AS d\n JOIN deltagere_wear AS dwp ON dwp.deltager_id = d.id\n JOIN wearpriser AS wp ON wp.id = dwp.wearpris_id\n JOIN wear AS w on w.id = wp.wear_id\nWHERE\n w.id IN (7, 18, 21, 22, 28, 29, 31)\nORDER BY\n d.id, w.navn';\n\n $labels = [];\n\n foreach ($this->db->query($query) as $row) {\n if (!isset($labels[$row['id']])) {\n $labels[$row['id']] = [\n 'name' => e('ID: ' . $row['id']),\n 'wear' => [],\n ];\n }\n\n $labels[$row['id']]['wear'][] = e(sprintf('%u %s - %s', $row['antal'], $row['size'], $row['wear']));\n\n }\n\n $groups = [];\n\n while (count($labels) > 0) {\n $groups[] = array_splice($labels, 0, 8);\n }\n\n return $groups;\n }", "private function prepareTables() {}", "public function vehicle_make_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_makes->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $make) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$make->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\">'.$make->title.'</div>';\n\n\t\t\t\t//$row[] = '<h4><a data-toggle=\"modal\" data-target=\"#editVehicleMakeModal\" class=\"link\" onclick=\"editVehicleMake('.$make->id.')\" id=\"'.$make->id.'\" title=\"Click to Edit\">'.$make->title.'</a></h4>';\n\t\t\t\t\n\t\t\t\t$row[] = $make->code;\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_make_details';\n\t\t\t\t\n\t\t\t\t//$row[] = $make->title;\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" href=\"!#\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleMake('.$make->id.',\\''.$url.'\\')\" id=\"'.$make->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_makes->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_makes->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function getCategorizedTables()\n {\n return array_keys($this->registry);\n }", "public function run()\n {\n DB::table('vehicle_types')->insert([\n \n ['name' => 'Estate_car'],\n ['name' => 'Saloon'],\n ['name' => 'Small_car'],\n ['name' => 'Cabrio'],\n ['name' => 'Coupe'],\n ['name' => 'Suv']\n \n ]);\n }", "function BeginIncidentTable() {\n $headings = array(\"Year\", \"Section\", \"Description\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"Count\");\n echo \"<table class='sortable' align='center' cellpadding='5' border=1>\";\n echo \"<tr>\";\n foreach ($headings as $heading) {\n echo \"<th>$heading</th>\";\n }\n echo \"</tr>\";\n}", "public function run()\n {\n DB::table('trainings')->insert(['id' => 1,'label' => 'Aquecimento','description' => 'Prepare os seus músculos antes de treinar. Esta é a chave para evitar lesões e para tirar o máximo proveito do seu treino.','time' => '04:48','ishomesafe' => false,'iswarming' => true,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 2,'label' => 'Alongamento','description' => 'Relaxe os seus músculos com esta rotina de alongamento. A chave para a recuperação e para conseguir melhores resultados.','time' => '08:24','ishomesafe' => true,'iswarming' => false,'isstretching' => true]);\n DB::table('trainings')->insert(['id' => 3,'label' => 'Alpha','description' => 'Eleve a sua frequência cardíaca enquanto treina peito, braços, coxas e nádegas.','time' => '2-5','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 4,'label' => 'Bravo','description' => 'Treine o seu corpo da cabeça aos pés com exercícios específicos para peito, braços, coxas e nádegas.','time' => '3-6','ishomesafe' => true,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 5,'label' => 'Charlie','description' => 'Ideal para queima de gordura com muitos exercícios de cardio e torso. E ainda exercite peito, braços, coxas e rabo.','time' => '4-7','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 6,'label' => 'Delta','description' => 'Este treino é puro cardio. Aumente seu ritmo cardíaco e queime muitas calorias e gordura.','time' => '4-11','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 7,'label' => 'Echo','description' => 'Este treino define pernas e abdômen. Sobe seu ritmo cardíaco e trabalha a parte superior do seu corpo.','time' => '9-10','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 8,'label' => 'Foxtrot','description' => 'O foco principal deste treino é o núcleo e o abdômen com alguns exercícios extras para seus braços, nádegas e coxas.','time' => '9-17','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 9,'label' => 'Golf','description' => 'Uma mistura de cardio, força e exercícios isométricos faz você queimar gordura do corpo todo.','time' => '9-15','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 10,'label' => 'Hotel','description' => 'Tudo para o seu peito e abdômen. Além disso, cardio adicional para queimar gordura e secar seu abs.','time' => '10-16','ishomesafe' => true,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 11,'label' => 'India','description' => 'Trabalhe seu abdômen inferior, tríceps e peito enquanto melhora o seu equilíbrio, controle e estabilidade do núcleo','time' => '13-18','ishomesafe' => true,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 12,'label' => 'Juliet','description' => 'Foque nos braços e abdômen, suba o ritmo cardíaco e queime calorias. E prepare-se para um novo exercício de flexão.','time' => '15-30','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 13,'label' => 'Kilo','description' => 'Prepare suas pernas e ombros para um exercício incrível, enquanto ativa o seu núcleo eleva seu ritmo cardíaco.','time' => '15-20','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 14,'label' => 'Lima','description' => 'Trabalhe seus braços, pernas e abdômen com esta combinação perfeita de movimentos para queimar gordura.','time' => '15-25','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 15,'label' => 'Mike','description' => 'O foco deste exercício são os braços que executam movimentos de prancha para aumentar a força e o controle do núcleo.','time' => '15-26','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 16,'label' => 'November','description' => 'Seu abdômen e pernas serão testados com este exercício intensivo de cardio para queimar gordura.','time' => '19-33','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 17,'label' => 'Oscar','description' => 'Este óptimo treino volta ao básico com exercícios para as partes superior e inferior, com uma pitada de núcleo e abdómen.','time' => '21-35','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 18,'label' => 'Papa','description' => 'Este exercício se concentra nos ombros, mas você também vai notar que a prancha clássica é um treino para todo o corpo','time' => '27-45','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 19,'label' => 'Quebec','description' => 'Queime pernas e abdomen com este treino. E ainda, conheça seu mais novo amigo - o burpee!','time' => '33-39','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 20,'label' => 'Romeo','description' => 'Quer fortalecer seu abs, braços e cardio? Este é o exercício perfeito para peito, tríceps e abdómen inferior.','time' => '33-45','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 21,'label' => 'Sierra','description' => 'Treine seu corpo todo com um extra de cardio para queimar gordura. Seu abdomen, pernas e braços vão agradecer!','time' => '35-42','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 22,'label' => 'Tango','description' => 'Burpees, flexões e agachamentos! Trabalhe suas pernas, rabo, peito, bíceps e costas. Vai conseguir!','time' => '37-50','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 23,'label' => 'Uniform','description' => 'Quer braços fortes e sedutores? Além disso, temos alguns exercícios pliométricos de perna para adicionar cardio.','time' => '39-60','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 24,'label' => 'Victor','description' => 'Eleve seu ritmo cardíaco durante o treino e diminua sua cintura. Sinta o abdômen e os braços queimarem.','time' => '40-60','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 25,'label' => 'Whiskey','description' => 'Coloque todo o seu corpo a trabalhar. Variações de burpees, agachamentos e flexões para conquistar um corpo definido e sexy.','time' => '50-60','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n DB::table('trainings')->insert(['id' => 26,'label' => 'X-ray','description' => 'Hora de queimar calorias! Deixe seu corpo em forma com exercícios combinados para vários grupos musculares.','time' => '50-65','ishomesafe' => false,'iswarming' => false,'isstretching' => false]);\n }", "function createTable($array,$summary,$caption,$id='',$class='') {\n\tif(!is_array($array) || empty($summary) || empty($caption)) return false;\n\t\n\t$thead_text = '';\n\t$tbody_text = '';\n\n\t$header_total = count($array['header']);\n\tforeach($array['header'] as $key => $header) {\n\t\tif(!is_array($header)) $header = array('text' => $header);\n\t\t$thead_text .= '<th scope=\"col\"'.addAttributes(@$header['title'],$header['id'],@$header['class']).'>'.formatText($header['text']).'</th>'.\"\\n\";\n\t}\n\n\t$i=0;\n\tforeach($array['rows'] as $key => $row_array) {\n\t\t$tbody_row = '';\n\t\tif(empty($row_array['class'])) $row_array['class'] = array();\n\t\telseif(!is_array($row_array['class'])) $row_array['class'] = array($row_array['class']);\n\t\tif(!isEven($i)) $row_array['class'][] = 'odd';\n\n\t\tif(count($row_array['value'])!=$header_total) continue; // if the number of rows don't match header rows...\n\t\tforeach($row_array['value'] as $key => $row) {\n\t\t\tif(!is_array($row)) $row = array('text' => $row);\n\t\t\t$tbody_row .= '<td headers=\"'.$array['header'][$key]['id'].'\"'.addAttributes('',@$row['id'],@$row['class']).'>'.$row['text'].'</td>'.\"\\n\";\n\t\t}\n\t\t$tbody_text .= '<tr'.addAttributes('',@$row_array['id'],@$row_array['class']).'>'.\"\\n\".$tbody_row.'</tr>'.\"\\n\";\n\t\t$i++;\n\t}\n\tif(empty($tbody_text)) return false;\n\t\n\t$table = '<table summary=\"'.formatText($summary).'\"'.addAttributes('',$id,$class).'>\n\t\t<caption>'.formatText($caption).'</caption>\n\t\t<thead>'.\"\\n\".'<tr>'.\"\\n\".$thead_text.'</tr>'.\"\\n\".'</thead>\n\t\t<tbody>'.\"\\n\".$tbody_text.'</tbody>\n\t</table>'.\"\\n\";\n\t\n\treturn $table;\n}", "function fillPartiesTable()\n{\n global $chairsCount, $db, $period;\n $parts = explode(\" - \", $period);\n\n $query = \"SELECT distinct\n strany.nazov, strany.skratka, vysledky.kresla, vysledky.koalicia, vlady.id_volby\n FROM strany\n INNER JOIN vysledky ON vysledky.id_strany = strany.id\n INNER JOIN volby ON vysledky.id_volby = volby.id\n INNER JOIN vlady ON vlady.id_volby = volby.id \n WHERE volby.den1 like '{$parts[0]}%'\n \";\n\n $stmt = $db->query($query);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($results as $result) {\n\n $rowColor = \"white\";\n\n if ($result['koalicia']) {\n $chairsCount += $result['kresla'];\n $rowColor = \"grey\";\n }\n\n echo \"<tr class='table-item {$rowColor}'>\";\n echo \"<td>{$result['nazov']}</td>\";\n echo \"<td>{$result['skratka']}</td>\";\n echo \"<td>{$result['kresla']}</td>\";\n echo \"</tr>\";\n }\n}", "public function getTestResultsData()\n {\n $out = [];\n\n // Case #0, sorted in default acceding\n $out[] = [\n [\n 'green',\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc'\n ];\n\n // Case #1, sorted in descending order by term, blue is prioritized.\n $out[] = [\n [\n 'acme',\n 'bar',\n 'foo',\n ],\n 'sc_zero_choices'\n ];\n\n // Case #2, all items prioritized, so sorting shouldn't matter.\n $out[] = [\n [\n 'blue',\n 'green',\n ],\n 'sc_sort_term_a'\n ];\n\n // Case #3, sort items by count, red prioritized.\n $out[] = [\n [\n 'yellow',\n ],\n 'sc_sort_term_d'\n ];\n\n // Case #4\n $out[] = [\n [\n 'blue',\n 'red',\n 'green',\n 'yellow'\n ],\n 'sc_sort_count'\n ];\n\n // Case #5 with selected man\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n ],\n 'sc',\n ['manufacturer' => 'a']\n ];\n\n // Case #6 with selected man with zero choices\n $out[] = [\n [\n 'acme',\n 'foo',\n 'bar',\n ],\n 'sc_zero_choices',\n ['manufacturer' => 'a']\n ];\n\n // Case #7 with selected man with zero choices\n $out[] = [\n [\n 'yellow',\n 'red',\n 'blue',\n 'green',\n ],\n 'sc_zero_choices_color',\n ['manufacturer' => 'a']\n ];\n\n return $out;\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()\n {\n $p = $this->getPermission('vehicle');\n $data = Vehicle::with(['Brand','Dependency'])->get();\n if(isset($p))\n foreach($data as $d)\n $d['p'] = array('a'=>false && $p->u,'e'=>$p->u,'d'=>$p->d);\n return datatables()->of($data)->toJson();\n }", "function make_table($table) {\n return print_table($table, true);\n}", "public function getTableWiths() {\n return [\n 'competency' => function($query) {\n $query->select(IdpCompetency::MINIMAL_COLUMNS);\n },\n 'approver' => function($query) {\n $query->select(User::MINIMAL_COLUMNS);\n }, \n 'employee' => function($query) {\n $query->select(User::MINIMAL_COLUMNS);\n },\n 'employee.supervisor' => function($query) {\n $query->select(User::MINIMAL_COLUMNS);\n }, \n 'employee.department' => function($query) {\n $query->select(DepartmentEmployee::MINIMAL_COLUMNS);\n },\n 'employee.department.team' => function($query) {\n $query->select(Team::MINIMAL_COLUMNS);\n }, \n 'employee.department.position' => function($query) {\n $query->select(Position::MINIMAL_COLUMNS);\n }, \n ];\n }" ]
[ "0.5685896", "0.56152964", "0.5585336", "0.541483", "0.5381089", "0.5367708", "0.5274978", "0.52230334", "0.5207936", "0.51745886", "0.51711804", "0.5141213", "0.5089362", "0.5071022", "0.50492764", "0.5045722", "0.5029012", "0.49953613", "0.498474", "0.4953292", "0.4921502", "0.49183947", "0.49061972", "0.48970744", "0.48937896", "0.48676357", "0.4867305", "0.48512286", "0.4846033", "0.4835871", "0.48221606", "0.481041", "0.47917587", "0.47906202", "0.47895724", "0.478653", "0.47840595", "0.47831598", "0.47827232", "0.4772699", "0.47682592", "0.47584867", "0.47557297", "0.47556537", "0.4749344", "0.4735302", "0.47331005", "0.4729183", "0.47218484", "0.4713751", "0.47109398", "0.470499", "0.4704923", "0.47031438", "0.4702608", "0.46974507", "0.46907735", "0.46767998", "0.4675994", "0.46544054", "0.46211433", "0.46168253", "0.4615455", "0.46132421", "0.4603859", "0.46033624", "0.46005255", "0.45833993", "0.45802635", "0.4578122", "0.45771024", "0.4571118", "0.45655233", "0.45590928", "0.45589867", "0.45533007", "0.45525065", "0.45485157", "0.4545204", "0.45393068", "0.4537202", "0.45371124", "0.45353627", "0.45291466", "0.45272005", "0.4523764", "0.452225", "0.45204443", "0.45135114", "0.45126277", "0.4508548", "0.45081782", "0.4504253", "0.44999894", "0.44978735", "0.4495175", "0.44931662", "0.44906753", "0.44887727", "0.4488368", "0.4482443" ]
0.0
-1
Build table of vehicles by ID
function vehiclesDisplayInfo($vehicleInfo,){ //store the arrayinfo in variables $invMake = $vehicleInfo['0']['invMake']; $invModel = $vehicleInfo['0']['invModel']; $invDescription = $vehicleInfo['0']['invDescription']; $invPrice = $vehicleInfo['0']['invPrice']; $invStock = $vehicleInfo['0']['invStock']; $invColor = $vehicleInfo['0']['invColor']; $imgPath = $vehicleInfo['0']['imgPath']; $detail = "<div id='imageDetail'>"; $detail = "<div id='imageDetail'>"; $detail .= "<img src='$imgPath' alt='Image of $invMake $invModel'>"; $detail .= '</div>'; $detail .= '<div>'; $detail .= "<h2>$invMake $invModel</h2>"; $detail .="<p><span>Model</span>: $invModel</p>"; $detail .="<p><span>Make</span>: $invMake</p>"; $detail .="<hr>"; $detail .="<h3>Description</h3>"; $detail .="<p>$invDescription</p>"; $detail .="<p><span>Color</span>: $invColor</p>"; $detail .="<p><span>Stock:</span>: $invStock</p>"; $price= number_format($invPrice, 2,',','.'); $detail .="<p id='price'><span>Price</span>: $$price</p>"; $detail .= '</div>'; return $detail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function table_voltooid($conn)\n\t{\n\t\t$data=prepare_data_volt($conn);\n\t\t\n\t\tfor ($i=0;$i<count($data);$i++)\n\t\t{\n\t\t\techo \"<tr>\";\n\t\t\tforeach($data[$i] as $best)\n\t\t\t{\n\t\t\t\techo \"<td>$best</td>\";\n\t\t\t}\n\t\t\techo \"</tr>\";\n\t\t}\n\t}", "function create_table($id, $data, $headers=[], $caption = \"\") {\n $table = \"<table id=\\\"$id\\\"><caption>$caption</caption>\";\n\n if (sizeof($headers) > 0) {\n $table .= add_row(create_headers($headers));\n }\n\n foreach($data as $vals) {\n $table .= add_row(create_row($vals));\n }\n\n $table .= \"</table>\";\n return $table;\n }", "function makeDetailedTable(){\r\n\t$motorhomeid = $_GET['motorID'];\r\n\t// start the db connection\r\n\tinclude 'db_conn.php';\r\n\t// do the sql statment\r\n\t$sql = \"SELECT * FROM motorhomes WHERE motorID='$motorhomeid'\";\r\n\t$queryresult = mysql_query($sql)\r\n\t\tor die(mysql_error());\r\n\r\n\t// start the table\r\n\techo \"<div id = \\\"maincontent\\\">\";\r\n\techo \"<table class=\\\"motor\\\">\";\r\n\r\n\t// fill the table\r\nwhile ($row = mysql_fetch_assoc($queryresult)) {\r\n\t$id = $row['motorID'];\r\n\t$manufacturer = $row['manufacturer'];\r\n\t$model = $row['model'];\r\n\t$year = $row['year'];\r\n\t$engine = $row['engine'];\r\n\t$berths = $row['berths'];\r\n\t$mileage = $row['mileage'];\r\n\t$price = $row['price'];\r\n\t$layout = $row['layout'];\r\n\t$ownership = $row['ownership'];\r\n\t$description = $row['description'];\r\n\r\n\techo \"\t<tr class=\\\"motor\\\">\";\r\n\techo \"\t<td colspan=\\\"4\\\">$year $manufacturer </td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Motor ID</td>\";\r\n\techo \"\t<td><strong>$id</strong></td>\";\r\n\techo \"\t<td>Manufactrurer</td>\";\r\n\techo \"\t<td><strong>$manufacturer</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Model</td>\";\r\n\techo \"\t<td><strong>$model</strong></td>\";\r\n\techo \"\t<td>Year</td>\";\r\n\techo \"\t<td><strong>$year</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Engine</td>\";\r\n\techo \"\t<td><strong>$engine</strong></td>\";\r\n\techo \"\t<td>Berths</td>\";\r\n\techo \"\t<td><strong>$berths</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Milage</td>\";\r\n\techo \"\t<td><strong>$mileage</strong></td>\";\r\n\techo \"\t<td>Price</td>\";\r\n\techo \"\t<td><strong>£$price</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Layout</td>\";\r\n\techo \"\t<td><strong>$layout</strong></td>\";\r\n\techo \"\t<td>Ownership</td>\";\r\n\techo \"\t<td><strong>$ownership</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\techo \"\t<tr>\";\r\n\techo \"\t<td>Description</td>\";\r\n\t// valdate the input with showing it without the special characters and with the breaks\r\n\techo \"\t<td colspan=\\\"3\\\"><strong>\".nl2br(htmlspecialchars_decode($description,ENT_QUOTES)).\"</strong></td>\";\r\n\techo \"\t</tr>\";\r\n\r\n}\r\n\techo \"</table>\";\r\n\techo \"</div>\";\r\n\t// close the table\r\n\r\n\t// close the db connection\r\n\tmysql_free_result($queryresult);\r\n\tmysql_close($conn);\r\n\r\n}", "public function getVehicleById(int $id)\n {\n $vehicule;\n $takeBdd = $this->_bdd->prepare('SELECT * FROM vehicles WHERE id = :id');\n $takeBdd->bindValue(':id', $id, PDO::PARAM_INT);\n $takeBdd->execute();\n $takeAllBdd = $takeBdd->fetchAll();\n foreach ($takeAllBdd as $oneVehicule) {\n if ($oneVehicule['type'] == 'Camion') {\n $vehicule = new Truck($oneVehicule);\n } elseif ($oneVehicule['type'] == 'Voiture') {\n $vehicule = new Car($oneVehicule);\n } elseif ($oneVehicule['type'] == 'Moto') {\n $vehicule = new Motorbike($oneVehicule);\n }\n }\n return $vehicule;\n }", "private function createHTML(string $id): void {\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $buttons = $this->buttons[$id];\n $settings = $this->settings[$id];\n\n // Tilføj HTML klasse til tabellen hvis sortering er aktiveret\n $hasSorting = '';\n if(!empty($settings['ajaxsort']) && $settings['ajaxsort']) {\n $hasSorting = ' has-sorting';\n }\n\n // Start udskrivning af tabel og udskriv søgefelt hvis det er aktiveret\n echo \"<table id='$id' class='RCMSTable $hasSorting' style='width: 100%'>\";\n if(!empty($settings['searchbar']) && $settings['searchbar']) {\n echo '<tr>';\n echo '<td class=\"searchtd\" colspan=\"' . (count($columns) + count($buttons)) . '\"><input type=\"text\" class=\"searchbar\" placeholder=\"Søgefelt...\" /></td>';\n echo '</tr>';\n }\n\n // Udskriv tabel hovedet\n echo '<tr>';\n foreach ($columns as $column) {\n $sortKey = $column['column'] ?? '';\n $initialSortDir = $column['initial_sort_dir'] ?? '';\n $initialSortDir = $initialSortDir ? \"data-initial-sort-dir='$initialSortDir'\" : '';\n\n // Tjek om sortering er aktiveret og udskriv derefter\n if(!empty($settings['ajaxsort']) && $settings['ajaxsort']) {\n if (!empty($column['enable_ajax_sort']) && $column['enable_ajax_sort']) {\n echo \"<th class='th-can-sort' $initialSortDir data-sort-key=\\\"$sortKey\\\">\" . $column['label'] . \"</th>\";\n } else {\n echo '<th>' . $column['label'] . '</th>';\n }\n } else {\n echo '<th>' . $column['label'] . '</th>';\n }\n }\n foreach ($buttons as $button) {\n echo \"<th></th>\";\n }\n\n echo '</tr>';\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n // Udskriv alle rækkerne\n $this->buildRows($id, $rows);\n\n echo '</table>';\n }", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public static function getFromTableVehicule($id=-1) {\n\t\t//Generated by FactoryGenerator::generateGetAllFromTable()\n\t\t$listeObjet = array();\n\t\t// Lancement de la requete\n\t\tif (empty(self::$_requete)) {\n\t\t\t$requete = 'SELECT * FROM `vehicule`';\n\t\t} else {\n\t\t\t$requete = self::$_requete;\n\t\t}\n\t\tif (!is_array($id)) {\n\t\t\tif ($id > -1) {\n\t\t\t\t$requete .= ' WHERE id = :id';\n\t\t\t\t//Il faut que le parametre soit dans un array pour le BIND\n\t\t\t\t$id = array(':id' => $id);\n\t\t\t} else {\n\t\t\t\t/* Tous les objets ==> il faut les ordonner */\n\t\t\t\t$requete .= ' ORDER BY id ASC';\n\t\t\t}\n\t\t} else {\n\t\t\t$requete .= ' WHERE id IN ('.implode(\",\",$id).') ORDER BY id ASC';\n\t\t}\n\t\tdatabase::getInstance() -> prepareRequete($requete);\n\t\tif (is_array($id) || $id > -1) {\n\t\t\tdatabase::getInstance() -> bind($id);\n\t\t}\n\t\tif (! database::getInstance() -> executeRequete()) {\n\t\t\tthrow new Exception(__CLASS__.'::'.__FUNCTION__.'(): Impossible de lire la table vehicule');\n\t\t}\n\t\t// Recuperation des donnees\n\t\t$datas = database::getInstance() -> getTableauResultat();\n\t\t\n\t/*\n\t * Entre ces deux balises vous pourrez mettre votre code specifique a la classe.\n\t * Il sera preserve lors de la reconstruction automatique.\n\t */\n\t/*[TAG-Vehicule2]*/\t/*[/TAG-Vehicule2]*/\n\n\t\t/* Traitement des donnees */\n\t\tforeach ($datas AS $data) {\n\t\t\t/* objet par defaut */\n\t\t\t$listeObjet[] = new Vehicule($data['vehiculeId'],$data['vehiculeNom'],$data['vehiculeDesc'],$data['vehiculeType'],$data['vehiculeVie'],$data['vehiculeAttaque'],$data['vehiculeDefense'],$data['vehiculeDeplacement']);\n\t\t\n\t/*\n\t * Entre ces deux balises vous pourrez mettre votre code specifique a la classe.\n\t * Il sera preserve lors de la reconstruction automatique.\n\t */\n\t/*[TAG-getFromTableVehicule1]*/\t/*[/TAG-getFromTableVehicule1]*/\n\n\t\t}\n\t\tif (!empty($listeObjet) && sizeof($listeObjet) == 1) {\n\t\t\t$listeObjet = $listeObjet[0];\n\t\t}\n\t\treturn $listeObjet;\n\t}", "function makeTableName($id)\n{\n $array= str_split($id);\n $name='';\n for($count=0; $count<sizeof($array); $count++)\n {\n switch ($array[$count])\n {\n case 0:\n $name=$name.'zero';\n break;\n case 1:\n $name=$name.'one';\n break;\n case 2:\n $name=$name.'two';\n break;\n case 3:\n $name=$name.'three';\n break;\n case 4:\n $name=$name.'four';\n break;\n case 5:\n $name=$name.'five';\n break;\n case 6:\n $name=$name.'six';\n break;\n case 7:\n $name=$name.'seven';\n break;\n case 8:\n $name=$name.'eight';\n break;\n case 9:\n $name=$name.'nine';\n break;\n default :\n $name=$name.'NON';\n }\n }\n return $name; \n}", "function generateVerticalTableFromQuery($tableid, $title, $description, $sql){\n\t\t global $database;\n\n $rec = $database->query($sql);\n \n if (!$rec || !$rec->num_rows){\n\t\t\t return $database->error;\n\t\t }\n\t\t \n\t\t $field_names = array();\n\t\t $fields = \"\";\n\t\t $body = \"\";\n\t\t\t\n\t\t\twhile ($fieldinfo=mysqli_fetch_field($rec)){\t\n\t\t\t\t$fieldname = $fieldinfo->name;\n\t\t\t\t$field_names[] = $fieldname;\n\t\t\t\t$fields .= \"<th>$fieldname</th>\";\n\t\t\t}\n\n\t\t\t$datatable = \"$('#$tableid').dataTable();\";\n\t\t\tif (!$tableid) $datatable = \"\";\n\t\t\t$data = \"\";\n\t\t\t\n\t\t\twhile ($row = $rec->fetch_array()){\n\t\t\t\t$data = \"\";\n\t\t\t\tforeach ($field_names as $fld){\n\t\t\t\t\t$val = $row[$fld];\n\t\t\t\t\tif (!$val) $val = 0;\n\t\t\t\t\t$data .= \"<td>$val</td>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t $body .= \"<tr>$data</tr>\";\t\t\n\t\t\t}\n\n\t\t\treturn \"<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5>\n\t\t\t <div class='table-responsive' style='overflow-x:scroll;'>\n\t\t\t\t <table class='table table-hover table-bordered' id='$tableid'>\n\t\t\t <thead>\n\t\t\t\t <tr>$fields</tr>\n\t\t\t\t </thead>\n\t\t\t\t <tbody>\n\t\t\t\t\t\t$body\n\t\t\t\t </tbody>\n\t\t\t\t </table>\n\t\t\t\t </div>\n\t\t\t\t <script>\n\t\t\t\t \t$('document').ready(function(){\n\t\t\t\t \t\t$datatable\n\t\t\t\t \t});\n\t\t\t\t </script>\";\n }", "public function getVehicles($id)\n {\n $sql = \"SELECT `vehicle_info`.`idvendorprofile`, `vehicle_info`.`driver_id`, `vehicle_info`.`vehicle_no`, `vehicle_info`.`make`,`vehicle_info`.`capacity`, `vehicle_info`.`basetype`, `vehicle_info`.`kmreading`, `vehicle_info`.`vendor_userid`, `vehicle_info`.`price_time`, `vehicle_info`.`price_km`, `vehicle_info`.`lattitude`, `vehicle_info`.`longitude`, `vehicle_info`.`status`, `vehicle_info`.`model`, `vehicle_info`.`make`, `vehicle_info`.`photo`,`vehicle_info`.`basefare`,`vehicle_info`.`km_multiplier`,`vehicle_info`.`time_multiplier`,`vehicle_info`.`min_hrs`,`vehicle_info`.`country`,`vehicle_basetype`.`basetype` AS `basetype_name` ,`vehicle_basetype`.`isdeleted`,`vehicle_info`.`revenue` FROM `vehicle_info` LEFT JOIN `vehicle_basetype` ON `vehicle_info`.`basetype` = `vehicle_basetype`.`base_type_id` WHERE 1 AND `vehicle_info`.`idvendorprofile`='\" . $id . \"'\";\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $rowRes = $query->row();\n $vehicles = array(\"idvendorprofile\" => $rowRes->idvendorprofile, \"driver_id\" => $rowRes->driver_id, \"vehicle_no\" => $rowRes->vehicle_no, \"capacity\" => $rowRes->capacity, \"basetype\" => $rowRes->basetype, \"kmreading\" => $rowRes->kmreading, \"vendor_userid\" => $rowRes->vendor_userid, \"price_time\" => $rowRes->revenue, \"price_km\" => $rowRes->revenue, \"model\" => $rowRes->model, \"photo\" => $rowRes->photo, \"basetype_name\" => $rowRes->basetype_name, \"make\" => $rowRes->make, \"isdeleted\" => $rowRes->isdeleted,\"basefare\"=>$rowRes->basefare,\"km_multiplier\"=>$rowRes->km_multiplier,\"time_multiplier\"=>$rowRes->time_multiplier,\"min_hrs\"=>$rowRes->min_hrs,\"country\"=>$rowRes->country);\n return $vehicles;\n } else {\n return 0;\n }\n }", "public function vehicle_model_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_models->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $model) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$make_name = '';\n\t\t\t\t$make_array = $this->Vehicle_makes->get_make_by_id($model->make_id);\n\t\t\t\tif($make_array){\n\t\t\t\t\tforeach($make_array as $make){\n\t\t\t\t\t\t$make_name = $make->title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$model->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\"><strong>'.$make_name.'</strong> ('.$model->make_id.')</div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<div class=\"checkbox checkbox-primary\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$model->id.'\"></div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<h4><a data-toggle=\"modal\" data-target=\"#editVehicleModelModal\" href=\"!#\" class=\"link\" onclick=\"editVehicleModel('.$model->id.')\" id=\"'.$model->id.'\" title=\"Click to Edit\"><strong>'.$make_name .'</strong> ('.$model->make_id.')</a></h4>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<strong>'.$make_name .'</strong> ('.$model->make_id.')';\n\t\t\t\t\n\t\t\t\t$row[] = $model->code;\n\t\t\t\t$row[] = $model->title;\n\t\t\t\t//$row[] = 'ok';\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_model_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleModel('.$model->id.',\\''.$url.'\\')\" id=\"'.$model->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_models->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_models->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function vehicle_make_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_makes->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $make) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$make->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\">'.$make->title.'</div>';\n\n\t\t\t\t//$row[] = '<h4><a data-toggle=\"modal\" data-target=\"#editVehicleMakeModal\" class=\"link\" onclick=\"editVehicleMake('.$make->id.')\" id=\"'.$make->id.'\" title=\"Click to Edit\">'.$make->title.'</a></h4>';\n\t\t\t\t\n\t\t\t\t$row[] = $make->code;\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_make_details';\n\t\t\t\t\n\t\t\t\t//$row[] = $make->title;\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" href=\"!#\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleMake('.$make->id.',\\''.$url.'\\')\" id=\"'.$make->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_makes->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_makes->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public static function buscarForId($id)\n {\n }", "public function verEncargadosProyectoTabla($id){\n\n $lista = IngresosEncargadoB3::where('id_ingresos_b3', $id)->get();\n\n foreach ($lista as $l){\n $cargo = CargosB3::where('id', $l->id_cargos_b3)->pluck('nombre')->first();\n $persona = EncargadosB3::where('id', $l->id_encargados_b3)->pluck('nombre')->first();\n\n $l->cargo = $cargo;\n $l->persona = $persona;\n }\n\n return view('backend.bodega3.verificacion.encargados.tabla.tablaencargados', compact('lista'));\n }", "protected static function buscarForId($id)\n {\n }", "protected static function buscarForId($id)\n {\n }", "function generateHorizontalTableFromQuery($tableid, $title, $description, $sql){\n\t\t global $database;\n\n $rec = $database->query($sql);\n \n if (!$rec || !$rec->num_rows){\n\t\t\t return $database->error;\n\t\t }\n\t\t \n\t\t $field_names = array();\n\t\t $fields = \"\";\n\t\t $body = \"\";\n\t\t\t\n\t\t\t// first field\n\t\t\t$field_names[] = \"<th>Category</th>\";\n\t\t\twhile ($row = $rec->fetch_array()){\n\t\t\t\t$col = $row[0];\n\t\t\t\t$field_names[] = \"<th>$col</th>\";\n\t\t\t}\n\n\t\t\t$fields = implode(\"\", $field_names);\n\t\t\t\n\t\t\tmysqli_data_seek($rec, 0);\n\n\t\t\t$keys = array();\t\t\t\n\t\t\t$row = $rec->fetch_array();\n\t\t\t$keys_ = array_keys($row);\n\t\t\t$idx = 0;\n\n\t\t\tforeach($keys_ as $key){\n\t\t\t\tif (! is_numeric($key) && $idx > 1){\n\t\t\t\t\t$keys[] = $key;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$idx++;\n\t\t\t}\n\n\t\t\tmysqli_data_seek($rec, 0);\n\t\t\t$data = \"\";\n\t\t\t$body = \"\";\n\t\t\t\n\t\t\t$total_fields = sizeof($field_names); // account for category\n\t\t\t$datasets = [];\n\t\t\t$idx = 1;\n\t\t\t\n\t\t\twhile ($row = $rec->fetch_array()){\t\t\n\t\t\t\tforeach($keys as $category) {\n\t\t\t\t\t\t $data = $row[$category];\n\t\t\t\t\t\t if (!$data) $data = 0;\n\t\t\t\t\t\t $datasets[$category][] = \"<td>$data</td>\"; \n\t\t\t\t}\n\t\t\t}\t\t\t\n\n\t\t\tforeach ($datasets as $key=>$arr){\n\t\t\t\t$data = implode(\"\", $arr);\n\t\t\t\t$body .= \"<tr><td>$key</td>$data</tr>\";\n\t\t\t\t$idx++;\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5>\n\t\t\t\t\t <div class='table-responsive' style='overflow-x:scroll;'>\n\t\t\t\t\t\t <table class='table table-hover table-bordered' id='$tableid'>\n\t\t\t\t\t <thead>\n\t\t\t\t\t\t <tr>$fields</tr>\n\t\t\t\t\t\t </thead>\n\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t\t$body\n\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t </table>\n\t\t\t\t\t\t</div>\";\n }", "public function run()\n {\n $data = [\n [\n 'title' => 'Легковые',\n 'esbd_id' => 4\n ],\n [\n 'title' => 'Автобусы до 16 п.м.',\n 'esbd_id' => 5\n ],\n [\n 'title' => 'Грузовые',\n 'esbd_id' => 6\n ],\n [\n 'title' => 'Троллейбусы, трамваи',\n 'esbd_id' => 7\n ],\n [\n 'title' => 'Мототранспорт',\n 'esbd_id' => 8\n ],\n [\n 'title' => 'Прицепы(полуприцепы)',\n 'esbd_id' => 10\n ],\n [\n 'title' => 'Автобусы > 16 п.м.',\n 'esbd_id' => 11\n ],\n [\n 'title' => 'Воздушный',\n 'esbd_id' => 12\n ],\n [\n 'title' => 'Морской',\n 'esbd_id' => 13\n ],\n [\n 'title' => 'Железнодорожный',\n 'esbd_id' => 14\n ],\n [\n 'title' => 'Спец.техника',\n 'esbd_id' => 15\n ],\n ];\n\n foreach ($data as $item) {\n VehicleType::create([\n 'title' => $item['title'],\n 'esbd_id' => $item['esbd_id']\n ]);\n }\n }", "public function run()\n {\n \n\n \\DB::table('vehicles')->delete();\n \n \\DB::table('vehicles')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 1 => \n array (\n 'id' => 2,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 2 => \n array (\n 'id' => 3,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 3 => \n array (\n 'id' => 4,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 4 => \n array (\n 'id' => 5,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 5 => \n array (\n 'id' => 6,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 6 => \n array (\n 'id' => 7,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 7 => \n array (\n 'id' => 8,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 8 => \n array (\n 'id' => 9,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 9 => \n array (\n 'id' => 10,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 10 => \n array (\n 'id' => 11,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 11 => \n array (\n 'id' => 12,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 12 => \n array (\n 'id' => 13,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 13 => \n array (\n 'id' => 14,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 14 => \n array (\n 'id' => 15,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 15 => \n array (\n 'id' => 16,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 16 => \n array (\n 'id' => 17,\n 'propietario' => 'Tren',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 17 => \n array (\n 'id' => 18,\n 'propietario' => 'Bus',\n 'modelo' => 0,\n 'precio' => 0,\n 'x' => 0.0,\n 'y' => 0.0,\n 'z' => 0.0,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 18 => \n array (\n 'id' => 19,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1604.21,\n 'y' => -1607.02,\n 'z' => 13.1746,\n 'a' => 87.4326,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 19 => \n array (\n 'id' => 20,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1603.85,\n 'y' => -1617.49,\n 'z' => 13.129,\n 'a' => 85.9502,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 20 => \n array (\n 'id' => 21,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1603.49,\n 'y' => -1623.18,\n 'z' => 13.129,\n 'a' => 87.0255,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 21 => \n array (\n 'id' => 22,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1603.43,\n 'y' => -1628.43,\n 'z' => 13.2271,\n 'a' => 87.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 22 => \n array (\n 'id' => 23,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1570.0,\n 'y' => -1606.25,\n 'z' => 13.028,\n 'a' => 179.513,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 23 => \n array (\n 'id' => 24,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1582.3,\n 'y' => -1606.19,\n 'z' => 13.028,\n 'a' => 179.513,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 24 => \n array (\n 'id' => 25,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1563.95,\n 'y' => -1606.42,\n 'z' => 13.028,\n 'a' => 179.513,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 25 => \n array (\n 'id' => 26,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1576.23,\n 'y' => -1606.29,\n 'z' => 13.028,\n 'a' => 179.513,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 26 => \n array (\n 'id' => 27,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1603.99,\n 'y' => -1612.1,\n 'z' => 13.1746,\n 'a' => 87.4326,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 27 => \n array (\n 'id' => 28,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1535.83,\n 'y' => -1668.24,\n 'z' => 13.0436,\n 'a' => 359.555,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 28 => \n array (\n 'id' => 29,\n 'propietario' => 'Gobierno',\n 'modelo' => 596,\n 'precio' => 0,\n 'x' => 1535.75,\n 'y' => -1678.29,\n 'z' => 13.0437,\n 'a' => 359.551,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 29 => \n array (\n 'id' => 30,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1616.56,\n 'y' => 1830.91,\n 'z' => 10.9195,\n 'a' => 178.945,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 30 => \n array (\n 'id' => 31,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1178.3,\n 'y' => -1338.5,\n 'z' => 14.2,\n 'a' => 270.0,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 31 => \n array (\n 'id' => 32,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1179.65,\n 'y' => -1308.65,\n 'z' => 13.897,\n 'a' => 268.682,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 32 => \n array (\n 'id' => 33,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1192.11,\n 'y' => -1347.71,\n 'z' => 13.4992,\n 'a' => 180.55,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 33 => \n array (\n 'id' => 34,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1209.44,\n 'y' => -1348.43,\n 'z' => 13.5497,\n 'a' => 0.476262,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 34 => \n array (\n 'id' => 35,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1209.24,\n 'y' => -1318.81,\n 'z' => 13.548,\n 'a' => 0.4484,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 35 => \n array (\n 'id' => 36,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 2032.72,\n 'y' => -1447.62,\n 'z' => 17.2888,\n 'a' => 88.6918,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 36 => \n array (\n 'id' => 37,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 2000.81,\n 'y' => -1409.93,\n 'z' => 17.1158,\n 'a' => 179.339,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 37 => \n array (\n 'id' => 38,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1601.15,\n 'y' => 1849.37,\n 'z' => 10.9196,\n 'a' => 178.724,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 38 => \n array (\n 'id' => 39,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1611.12,\n 'y' => 1839.96,\n 'z' => 10.9192,\n 'a' => 359.882,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 39 => \n array (\n 'id' => 40,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => 1594.38,\n 'y' => 1839.87,\n 'z' => 10.9694,\n 'a' => 359.98,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 40 => \n array (\n 'id' => 41,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => -2693.72,\n 'y' => 624.903,\n 'z' => 14.5523,\n 'a' => 124.597,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 41 => \n array (\n 'id' => 42,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => -2701.97,\n 'y' => 611.621,\n 'z' => 14.5533,\n 'a' => 163.926,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 42 => \n array (\n 'id' => 43,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => -2698.83,\n 'y' => 592.078,\n 'z' => 14.5525,\n 'a' => 211.119,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 43 => \n array (\n 'id' => 44,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => -2676.72,\n 'y' => 630.13,\n 'z' => 14.6021,\n 'a' => 87.9904,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 44 => \n array (\n 'id' => 45,\n 'propietario' => 'Gobierno',\n 'modelo' => 416,\n 'precio' => 0,\n 'x' => -2648.34,\n 'y' => 583.903,\n 'z' => 14.6026,\n 'a' => 270.434,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 45 => \n array (\n 'id' => 46,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -373.803,\n 'y' => -1534.98,\n 'z' => 22.4199,\n 'a' => 287.827,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 46 => \n array (\n 'id' => 47,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -372.074,\n 'y' => -1546.07,\n 'z' => 22.3238,\n 'a' => 277.034,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 47 => \n array (\n 'id' => 48,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -387.014,\n 'y' => -1496.41,\n 'z' => 25.9259,\n 'a' => 275.834,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 48 => \n array (\n 'id' => 49,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -383.597,\n 'y' => -1508.68,\n 'z' => 24.7948,\n 'a' => 292.234,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 49 => \n array (\n 'id' => 50,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -378.054,\n 'y' => -1522.55,\n 'z' => 23.2702,\n 'a' => 291.41,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 50 => \n array (\n 'id' => 51,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2277.83,\n 'y' => 2442.71,\n 'z' => 10.5653,\n 'a' => 0.539601,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 51 => \n array (\n 'id' => 52,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2269.05,\n 'y' => 2442.94,\n 'z' => 10.5658,\n 'a' => 0.734632,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 52 => \n array (\n 'id' => 53,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2256.36,\n 'y' => 2442.86,\n 'z' => 10.5666,\n 'a' => 359.091,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 53 => \n array (\n 'id' => 54,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2260.61,\n 'y' => 2478.26,\n 'z' => 10.5673,\n 'a' => 177.463,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 54 => \n array (\n 'id' => 55,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2273.19,\n 'y' => 2478.21,\n 'z' => 10.565,\n 'a' => 180.937,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 55 => \n array (\n 'id' => 56,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2282.35,\n 'y' => 2478.35,\n 'z' => 10.5645,\n 'a' => 179.952,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 56 => \n array (\n 'id' => 57,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 2273.54,\n 'y' => 2460.66,\n 'z' => 10.5684,\n 'a' => 181.299,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 57 => \n array (\n 'id' => 58,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1634.72,\n 'y' => 650.963,\n 'z' => 6.95528,\n 'a' => 2.03608,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 58 => \n array (\n 'id' => 59,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1628.61,\n 'y' => 651.29,\n 'z' => 6.96142,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 59 => \n array (\n 'id' => 60,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1622.04,\n 'y' => 651.358,\n 'z' => 6.97341,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 60 => \n array (\n 'id' => 61,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1615.67,\n 'y' => 651.832,\n 'z' => 6.91138,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 61 => \n array (\n 'id' => 62,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1609.34,\n 'y' => 650.495,\n 'z' => 6.97994,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 62 => \n array (\n 'id' => 63,\n 'propietario' => 'Gobierno',\n 'modelo' => 597,\n 'precio' => 0,\n 'x' => -1604.17,\n 'y' => 651.536,\n 'z' => 6.98966,\n 'a' => 0.0,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 1,\n 'trabajo' => 0,\n ),\n 63 => \n array (\n 'id' => 64,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1803.73,\n 'y' => -1904.79,\n 'z' => 13.1791,\n 'a' => 91.2167,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 64 => \n array (\n 'id' => 65,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1804.0,\n 'y' => -1912.51,\n 'z' => 13.176,\n 'a' => 92.5541,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 65 => \n array (\n 'id' => 66,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1804.4,\n 'y' => -1921.97,\n 'z' => 13.1708,\n 'a' => 94.8712,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 66 => \n array (\n 'id' => 67,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1794.89,\n 'y' => -1932.77,\n 'z' => 13.1659,\n 'a' => 0.0,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 67 => \n array (\n 'id' => 68,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1787.06,\n 'y' => -1932.7,\n 'z' => 13.1649,\n 'a' => 1.4882,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 68 => \n array (\n 'id' => 69,\n 'propietario' => 'Gobierno',\n 'modelo' => 420,\n 'precio' => 0,\n 'x' => 1775.58,\n 'y' => -1913.91,\n 'z' => 13.1637,\n 'a' => 180.1,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 69 => \n array (\n 'id' => 70,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1703.04,\n 'y' => -1876.09,\n 'z' => 13.0807,\n 'a' => 270.348,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 70 => \n array (\n 'id' => 71,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1703.31,\n 'y' => -1879.1,\n 'z' => 13.0807,\n 'a' => 269.464,\n 'color1' => '2',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 71 => \n array (\n 'id' => 72,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1703.09,\n 'y' => -1881.77,\n 'z' => 13.0807,\n 'a' => 269.007,\n 'color1' => '3',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 72 => \n array (\n 'id' => 73,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1703.16,\n 'y' => -1884.97,\n 'z' => 13.0807,\n 'a' => 271.961,\n 'color1' => '4',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 73 => \n array (\n 'id' => 74,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1710.91,\n 'y' => -1875.39,\n 'z' => 13.0807,\n 'a' => 178.176,\n 'color1' => '5',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 74 => \n array (\n 'id' => 75,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1718.93,\n 'y' => -1875.06,\n 'z' => 13.0807,\n 'a' => 176.381,\n 'color1' => '6',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 75 => \n array (\n 'id' => 76,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1727.03,\n 'y' => -1875.78,\n 'z' => 13.0807,\n 'a' => 89.5347,\n 'color1' => '7',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 76 => \n array (\n 'id' => 77,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1727.05,\n 'y' => -1878.48,\n 'z' => 13.0807,\n 'a' => 88.3724,\n 'color1' => '8',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 77 => \n array (\n 'id' => 78,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1727.32,\n 'y' => -1881.84,\n 'z' => 13.0807,\n 'a' => 87.3723,\n 'color1' => '9',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 78 => \n array (\n 'id' => 79,\n 'propietario' => 'Gobierno',\n 'modelo' => 509,\n 'precio' => 0,\n 'x' => 1726.99,\n 'y' => -1884.81,\n 'z' => 13.0807,\n 'a' => 90.4685,\n 'color1' => '10',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 79 => \n array (\n 'id' => 80,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1610.98,\n 'y' => 92.0841,\n 'z' => 3.76232,\n 'a' => 224.869,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 80 => \n array (\n 'id' => 81,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1596.6,\n 'y' => 106.977,\n 'z' => 3.75996,\n 'a' => 227.321,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 81 => \n array (\n 'id' => 82,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1569.15,\n 'y' => 134.842,\n 'z' => 3.76286,\n 'a' => 222.82,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 82 => \n array (\n 'id' => 83,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1589.2,\n 'y' => 114.527,\n 'z' => 3.75991,\n 'a' => 225.743,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 83 => \n array (\n 'id' => 84,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1575.13,\n 'y' => 128.513,\n 'z' => 3.76237,\n 'a' => 224.698,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 84 => \n array (\n 'id' => 85,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1756.0,\n 'y' => -168.843,\n 'z' => 3.7296,\n 'a' => 23.5515,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 85 => \n array (\n 'id' => 86,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1624.5,\n 'y' => 78.0176,\n 'z' => 3.72969,\n 'a' => 226.847,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 86 => \n array (\n 'id' => 87,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1738.25,\n 'y' => -160.199,\n 'z' => 3.72397,\n 'a' => 27.7106,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 87 => \n array (\n 'id' => 88,\n 'propietario' => 'Gobierno',\n 'modelo' => 456,\n 'precio' => 0,\n 'x' => -1722.04,\n 'y' => -150.78,\n 'z' => 3.72947,\n 'a' => 27.9671,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 88 => \n array (\n 'id' => 89,\n 'propietario' => 'Gobierno',\n 'modelo' => 498,\n 'precio' => 0,\n 'x' => -1604.97,\n 'y' => 100.193,\n 'z' => 3.52903,\n 'a' => 223.577,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 89 => \n array (\n 'id' => 90,\n 'propietario' => 'Gobierno',\n 'modelo' => 498,\n 'precio' => 0,\n 'x' => -1747.31,\n 'y' => -167.437,\n 'z' => 3.62394,\n 'a' => 26.2029,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 90 => \n array (\n 'id' => 91,\n 'propietario' => 'Gobierno',\n 'modelo' => 498,\n 'precio' => 0,\n 'x' => -1619.41,\n 'y' => 85.3535,\n 'z' => 3.64475,\n 'a' => 227.137,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 91 => \n array (\n 'id' => 92,\n 'propietario' => 'Gobierno',\n 'modelo' => 498,\n 'precio' => 0,\n 'x' => -1583.27,\n 'y' => 122.162,\n 'z' => 3.5391,\n 'a' => 223.746,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 92 => \n array (\n 'id' => 93,\n 'propietario' => 'Gobierno',\n 'modelo' => 498,\n 'precio' => 0,\n 'x' => -1728.35,\n 'y' => -157.114,\n 'z' => 3.62526,\n 'a' => 27.4225,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 93 => \n array (\n 'id' => 94,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1657.92,\n 'y' => 41.6746,\n 'z' => 3.62129,\n 'a' => 223.094,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 94 => \n array (\n 'id' => 95,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1650.75,\n 'y' => 48.5277,\n 'z' => 3.62627,\n 'a' => 224.525,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 95 => \n array (\n 'id' => 96,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1636.34,\n 'y' => 63.6219,\n 'z' => 3.62438,\n 'a' => 226.384,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 96 => \n array (\n 'id' => 97,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1642.93,\n 'y' => 56.4085,\n 'z' => 3.62169,\n 'a' => 224.717,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 97 => \n array (\n 'id' => 98,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1616.34,\n 'y' => 43.767,\n 'z' => 3.62439,\n 'a' => 45.3192,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 98 => \n array (\n 'id' => 99,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1623.14,\n 'y' => 36.8284,\n 'z' => 3.62389,\n 'a' => 44.374,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 99 => \n array (\n 'id' => 100,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1631.32,\n 'y' => 28.6976,\n 'z' => 3.62297,\n 'a' => 45.1211,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 100 => \n array (\n 'id' => 101,\n 'propietario' => 'Gobierno',\n 'modelo' => 609,\n 'precio' => 0,\n 'x' => -1638.38,\n 'y' => 21.5687,\n 'z' => 3.62106,\n 'a' => 45.3911,\n 'color1' => '0',\n 'color2' => '0',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 101 => \n array (\n 'id' => 102,\n 'propietario' => 'Gobierno',\n 'modelo' => 523,\n 'precio' => 0,\n 'x' => 1570.59,\n 'y' => -1709.75,\n 'z' => 5.4615,\n 'a' => 2.0359,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 102 => \n array (\n 'id' => 103,\n 'propietario' => 'Gobierno',\n 'modelo' => 523,\n 'precio' => 0,\n 'x' => 1574.34,\n 'y' => -1709.23,\n 'z' => 5.4581,\n 'a' => 358.051,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 103 => \n array (\n 'id' => 104,\n 'propietario' => 'Gobierno',\n 'modelo' => 523,\n 'precio' => 0,\n 'x' => 1578.79,\n 'y' => -1709.33,\n 'z' => 5.4587,\n 'a' => 2.4554,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 104 => \n array (\n 'id' => 105,\n 'propietario' => 'Gobierno',\n 'modelo' => 523,\n 'precio' => 0,\n 'x' => 1583.58,\n 'y' => -1709.6,\n 'z' => 5.4615,\n 'a' => 0.1382,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 105 => \n array (\n 'id' => 106,\n 'propietario' => 'Gobierno',\n 'modelo' => 523,\n 'precio' => 0,\n 'x' => 1587.66,\n 'y' => -1709.85,\n 'z' => 5.4616,\n 'a' => 358.432,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 106 => \n array (\n 'id' => 107,\n 'propietario' => 'Gobierno',\n 'modelo' => 601,\n 'precio' => 0,\n 'x' => 1530.55,\n 'y' => -1646.76,\n 'z' => 5.6494,\n 'a' => 181.887,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 107 => \n array (\n 'id' => 108,\n 'propietario' => 'Gobierno',\n 'modelo' => 601,\n 'precio' => 0,\n 'x' => 1538.79,\n 'y' => -1646.99,\n 'z' => 5.6493,\n 'a' => 181.301,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 108 => \n array (\n 'id' => 109,\n 'propietario' => 'Gobierno',\n 'modelo' => 528,\n 'precio' => 0,\n 'x' => 1544.64,\n 'y' => -1612.51,\n 'z' => 13.3795,\n 'a' => 268.785,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 109 => \n array (\n 'id' => 110,\n 'propietario' => 'Gobierno',\n 'modelo' => 528,\n 'precio' => 0,\n 'x' => 1545.13,\n 'y' => -1605.26,\n 'z' => 13.4281,\n 'a' => 269.528,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 110 => \n array (\n 'id' => 111,\n 'propietario' => 'Gobierno',\n 'modelo' => 497,\n 'precio' => 0,\n 'x' => -1679.61,\n 'y' => 705.844,\n 'z' => 30.779,\n 'a' => 89.5481,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 111 => \n array (\n 'id' => 112,\n 'propietario' => 'Gobierno',\n 'modelo' => 411,\n 'precio' => 20,\n 'x' => -1959.73,\n 'y' => 269.813,\n 'z' => 35.2072,\n 'a' => 42.6121,\n 'color1' => '64',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 1,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 112 => \n array (\n 'id' => 113,\n 'propietario' => 'Gobierno',\n 'modelo' => 415,\n 'precio' => 15,\n 'x' => 1471.98,\n 'y' => -1773.74,\n 'z' => 13.6562,\n 'a' => 322.616,\n 'color1' => '40',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 1,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 113 => \n array (\n 'id' => 114,\n 'propietario' => 'Gobierno',\n 'modelo' => 451,\n 'precio' => 15,\n 'x' => 1458.65,\n 'y' => -1774.39,\n 'z' => 13.5936,\n 'a' => 13.7521,\n 'color1' => '125',\n 'color2' => '125',\n 'comprable' => '1',\n 'moneda' => 1,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 114 => \n array (\n 'id' => 115,\n 'propietario' => 'Gobierno',\n 'modelo' => 604,\n 'precio' => 3000,\n 'x' => 1670.37,\n 'y' => -1886.22,\n 'z' => 13.2884,\n 'a' => 57.7363,\n 'color1' => '18',\n 'color2' => '25',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 115 => \n array (\n 'id' => 116,\n 'propietario' => 'Gobierno',\n 'modelo' => 542,\n 'precio' => 4000,\n 'x' => 1631.92,\n 'y' => -1900.45,\n 'z' => 13.2968,\n 'a' => 270.792,\n 'color1' => '123',\n 'color2' => '49',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 116 => \n array (\n 'id' => 117,\n 'propietario' => 'Gobierno',\n 'modelo' => 404,\n 'precio' => 5000,\n 'x' => 1668.06,\n 'y' => -1899.14,\n 'z' => 13.2818,\n 'a' => 41.4088,\n 'color1' => '115',\n 'color2' => '117',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 117 => \n array (\n 'id' => 118,\n 'propietario' => 'Gobierno',\n 'modelo' => 561,\n 'precio' => 70000,\n 'x' => 1501.68,\n 'y' => -1772.28,\n 'z' => 13.9387,\n 'a' => 43.3255,\n 'color1' => '8',\n 'color2' => '17',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 118 => \n array (\n 'id' => 119,\n 'propietario' => 'Gobierno',\n 'modelo' => 479,\n 'precio' => 3300,\n 'x' => 1669.17,\n 'y' => -1892.31,\n 'z' => 13.342,\n 'a' => 51.0409,\n 'color1' => '101',\n 'color2' => '78',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 119 => \n array (\n 'id' => 120,\n 'propietario' => 'Gobierno',\n 'modelo' => 500,\n 'precio' => 45000,\n 'x' => 1503.09,\n 'y' => -1747.13,\n 'z' => 13.6621,\n 'a' => 359.295,\n 'color1' => '3',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 120 => \n array (\n 'id' => 121,\n 'propietario' => 'Gobierno',\n 'modelo' => 589,\n 'precio' => 42000,\n 'x' => 1426.44,\n 'y' => -1802.21,\n 'z' => 13.5956,\n 'a' => 224.17,\n 'color1' => '31',\n 'color2' => '31',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 121 => \n array (\n 'id' => 122,\n 'propietario' => 'Gobierno',\n 'modelo' => 602,\n 'precio' => 38000,\n 'x' => 1501.29,\n 'y' => -1774.12,\n 'z' => 19.3229,\n 'a' => 75.3057,\n 'color1' => '70',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 122 => \n array (\n 'id' => 123,\n 'propietario' => 'Gobierno',\n 'modelo' => 603,\n 'precio' => 45000,\n 'x' => 1456.81,\n 'y' => -1794.69,\n 'z' => 13.7812,\n 'a' => 220.783,\n 'color1' => '58',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 123 => \n array (\n 'id' => 124,\n 'propietario' => 'Gobierno',\n 'modelo' => 506,\n 'precio' => 185000,\n 'x' => 1457.95,\n 'y' => -1779.3,\n 'z' => 19.1696,\n 'a' => 1.76125,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 124 => \n array (\n 'id' => 125,\n 'propietario' => 'Gobierno',\n 'modelo' => 565,\n 'precio' => 60000,\n 'x' => 1425.27,\n 'y' => -1808.91,\n 'z' => 13.5666,\n 'a' => 240.479,\n 'color1' => '42',\n 'color2' => '42',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 125 => \n array (\n 'id' => 126,\n 'propietario' => 'Gobierno',\n 'modelo' => 445,\n 'precio' => 7000,\n 'x' => 1631.71,\n 'y' => -1909.92,\n 'z' => 13.426,\n 'a' => 272.908,\n 'color1' => '66',\n 'color2' => '97',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 126 => \n array (\n 'id' => 127,\n 'propietario' => 'Gobierno',\n 'modelo' => 478,\n 'precio' => 8000,\n 'x' => -1992.02,\n 'y' => 250.674,\n 'z' => 35.1672,\n 'a' => 83.9691,\n 'color1' => '66',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 127 => \n array (\n 'id' => 128,\n 'propietario' => 'Gobierno',\n 'modelo' => 489,\n 'precio' => 70000,\n 'x' => -1991.0,\n 'y' => 256.413,\n 'z' => 35.3156,\n 'a' => 85.6616,\n 'color1' => '112',\n 'color2' => '120',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 128 => \n array (\n 'id' => 129,\n 'propietario' => 'Gobierno',\n 'modelo' => 579,\n 'precio' => 75000,\n 'x' => 1483.47,\n 'y' => -1746.47,\n 'z' => 13.4818,\n 'a' => 359.088,\n 'color1' => '53',\n 'color2' => '53',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 129 => \n array (\n 'id' => 130,\n 'propietario' => 'Gobierno',\n 'modelo' => 560,\n 'precio' => 75000,\n 'x' => 523.629,\n 'y' => -1290.79,\n 'z' => 16.9475,\n 'a' => 1.31224,\n 'color1' => '125',\n 'color2' => '125',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 130 => \n array (\n 'id' => 131,\n 'propietario' => 'Gobierno',\n 'modelo' => 551,\n 'precio' => 10000,\n 'x' => 519.455,\n 'y' => -1290.61,\n 'z' => 17.0424,\n 'a' => 358.732,\n 'color1' => '120',\n 'color2' => '120',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 131 => \n array (\n 'id' => 132,\n 'propietario' => 'Gobierno',\n 'modelo' => 587,\n 'precio' => 80000,\n 'x' => 527.897,\n 'y' => -1290.87,\n 'z' => 16.97,\n 'a' => 359.291,\n 'color1' => '3',\n 'color2' => '3',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 132 => \n array (\n 'id' => 133,\n 'propietario' => 'Gobierno',\n 'modelo' => 566,\n 'precio' => 25000,\n 'x' => 532.166,\n 'y' => -1290.74,\n 'z' => 17.0228,\n 'a' => 0.0,\n 'color1' => '60',\n 'color2' => '60',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 133 => \n array (\n 'id' => 134,\n 'propietario' => 'Gobierno',\n 'modelo' => 533,\n 'precio' => 20000,\n 'x' => 538.966,\n 'y' => -1290.96,\n 'z' => 16.9513,\n 'a' => 2.1154,\n 'color1' => '62',\n 'color2' => '62',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 134 => \n array (\n 'id' => 135,\n 'propietario' => 'Gobierno',\n 'modelo' => 496,\n 'precio' => 22500,\n 'x' => 548.238,\n 'y' => -1291.49,\n 'z' => 16.9644,\n 'a' => 4.19405,\n 'color1' => '25',\n 'color2' => '25',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 135 => \n array (\n 'id' => 136,\n 'propietario' => 'Gobierno',\n 'modelo' => 412,\n 'precio' => 19000,\n 'x' => 555.341,\n 'y' => -1290.13,\n 'z' => 17.0833,\n 'a' => 0.074019,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 136 => \n array (\n 'id' => 137,\n 'propietario' => 'Gobierno',\n 'modelo' => 463,\n 'precio' => 55000,\n 'x' => 2137.76,\n 'y' => -1139.8,\n 'z' => 24.9366,\n 'a' => 119.298,\n 'color1' => '125',\n 'color2' => '125',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 137 => \n array (\n 'id' => 138,\n 'propietario' => 'Gobierno',\n 'modelo' => 475,\n 'precio' => 42000,\n 'x' => 2135.88,\n 'y' => -1125.79,\n 'z' => 25.2924,\n 'a' => 83.1302,\n 'color1' => '30',\n 'color2' => '96',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 138 => \n array (\n 'id' => 139,\n 'propietario' => 'Gobierno',\n 'modelo' => 545,\n 'precio' => 33000,\n 'x' => 2136.5,\n 'y' => -1131.19,\n 'z' => 25.4853,\n 'a' => 108.837,\n 'color1' => '66',\n 'color2' => '66',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 139 => \n array (\n 'id' => 140,\n 'propietario' => 'Gobierno',\n 'modelo' => 491,\n 'precio' => 32000,\n 'x' => 2135.85,\n 'y' => -1135.86,\n 'z' => 25.4412,\n 'a' => 106.868,\n 'color1' => '25',\n 'color2' => '25',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 140 => \n array (\n 'id' => 141,\n 'propietario' => 'Gobierno',\n 'modelo' => 567,\n 'precio' => 70000,\n 'x' => 2119.63,\n 'y' => -1124.74,\n 'z' => 25.2432,\n 'a' => 303.711,\n 'color1' => '93',\n 'color2' => '64',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 141 => \n array (\n 'id' => 142,\n 'propietario' => 'Gobierno',\n 'modelo' => 534,\n 'precio' => 60000,\n 'x' => 2119.74,\n 'y' => -1131.79,\n 'z' => 25.0424,\n 'a' => 302.697,\n 'color1' => '37',\n 'color2' => '37',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 142 => \n array (\n 'id' => 143,\n 'propietario' => 'Gobierno',\n 'modelo' => 535,\n 'precio' => 35000,\n 'x' => 2119.04,\n 'y' => -1139.21,\n 'z' => 24.7991,\n 'a' => 306.113,\n 'color1' => '3',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 143 => \n array (\n 'id' => 144,\n 'propietario' => 'Gobierno',\n 'modelo' => 554,\n 'precio' => 42000,\n 'x' => 1477.53,\n 'y' => -1746.75,\n 'z' => 13.6335,\n 'a' => 1.2896,\n 'color1' => '15',\n 'color2' => '32',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 144 => \n array (\n 'id' => 145,\n 'propietario' => 'Gobierno',\n 'modelo' => 400,\n 'precio' => 70000,\n 'x' => 1472.29,\n 'y' => -1746.28,\n 'z' => 13.6392,\n 'a' => 359.982,\n 'color1' => '123',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 145 => \n array (\n 'id' => 146,\n 'propietario' => 'Gobierno',\n 'modelo' => 414,\n 'precio' => 90000,\n 'x' => 1460.06,\n 'y' => -1746.98,\n 'z' => 13.6406,\n 'a' => 359.183,\n 'color1' => '28',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 146 => \n array (\n 'id' => 147,\n 'propietario' => 'Gobierno',\n 'modelo' => 482,\n 'precio' => 120000,\n 'x' => 1508.46,\n 'y' => -1747.09,\n 'z' => 13.6681,\n 'a' => 359.023,\n 'color1' => '37',\n 'color2' => '37',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 147 => \n array (\n 'id' => 148,\n 'propietario' => 'Gobierno',\n 'modelo' => 480,\n 'precio' => 225000,\n 'x' => -1957.33,\n 'y' => 303.683,\n 'z' => 35.2432,\n 'a' => 133.499,\n 'color1' => '12',\n 'color2' => '12',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 148 => \n array (\n 'id' => 149,\n 'propietario' => 'Gobierno',\n 'modelo' => 578,\n 'precio' => 230000,\n 'x' => -1990.71,\n 'y' => 243.865,\n 'z' => 35.7954,\n 'a' => 84.9635,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 149 => \n array (\n 'id' => 150,\n 'propietario' => 'Gobierno',\n 'modelo' => 477,\n 'precio' => 250000,\n 'x' => -1960.17,\n 'y' => 257.467,\n 'z' => 35.2273,\n 'a' => 43.2015,\n 'color1' => '121',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 150 => \n array (\n 'id' => 151,\n 'propietario' => 'Gobierno',\n 'modelo' => 409,\n 'precio' => 1000000,\n 'x' => 1467.11,\n 'y' => -1747.87,\n 'z' => 13.3492,\n 'a' => 0.3858,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 151 => \n array (\n 'id' => 152,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -126.498,\n 'y' => -1501.46,\n 'z' => 4.21421,\n 'a' => 136.448,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 152 => \n array (\n 'id' => 153,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -120.156,\n 'y' => -1508.04,\n 'z' => 4.13295,\n 'a' => 136.905,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 153 => \n array (\n 'id' => 154,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -111.604,\n 'y' => -1587.82,\n 'z' => 3.18897,\n 'a' => 122.793,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 154 => \n array (\n 'id' => 155,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -109.125,\n 'y' => -1592.32,\n 'z' => 3.10105,\n 'a' => 121.934,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 155 => \n array (\n 'id' => 156,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -105.97,\n 'y' => -1597.38,\n 'z' => 3.09272,\n 'a' => 123.696,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 156 => \n array (\n 'id' => 157,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -102.576,\n 'y' => -1601.98,\n 'z' => 3.09469,\n 'a' => 122.508,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 157 => \n array (\n 'id' => 158,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -114.73,\n 'y' => -1613.18,\n 'z' => 3.19812,\n 'a' => 16.9179,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 158 => \n array (\n 'id' => 159,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -120.712,\n 'y' => -1613.97,\n 'z' => 3.84595,\n 'a' => 13.2772,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 159 => \n array (\n 'id' => 160,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -186.688,\n 'y' => -1555.44,\n 'z' => 7.297,\n 'a' => 229.635,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 160 => \n array (\n 'id' => 161,\n 'propietario' => 'Gobierno',\n 'modelo' => 408,\n 'precio' => 0,\n 'x' => -189.85,\n 'y' => -1560.93,\n 'z' => 7.2426,\n 'a' => 227.564,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 6,\n ),\n 161 => \n array (\n 'id' => 162,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2822.07,\n 'y' => -2624.44,\n 'z' => -0.0876,\n 'a' => 89.6143,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 162 => \n array (\n 'id' => 163,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2821.58,\n 'y' => -2618.06,\n 'z' => -0.2381,\n 'a' => 82.3052,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 163 => \n array (\n 'id' => 164,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2822.26,\n 'y' => -2611.5,\n 'z' => -0.7854,\n 'a' => 91.6937,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 164 => \n array (\n 'id' => 165,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2821.52,\n 'y' => -2604.74,\n 'z' => -0.1236,\n 'a' => 87.5986,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 165 => \n array (\n 'id' => 166,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2821.52,\n 'y' => -2596.74,\n 'z' => -0.3082,\n 'a' => 90.4083,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 166 => \n array (\n 'id' => 167,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2822.91,\n 'y' => -2584.06,\n 'z' => -0.3235,\n 'a' => 87.4044,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 167 => \n array (\n 'id' => 168,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2839.35,\n 'y' => -2625.99,\n 'z' => 0.2129,\n 'a' => 272.277,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 168 => \n array (\n 'id' => 169,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2839.33,\n 'y' => -2617.7,\n 'z' => -0.6352,\n 'a' => 273.978,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 169 => \n array (\n 'id' => 170,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2839.43,\n 'y' => -2608.04,\n 'z' => 0.1093,\n 'a' => 265.808,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 170 => \n array (\n 'id' => 171,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2840.28,\n 'y' => -2598.57,\n 'z' => 0.1278,\n 'a' => 270.083,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 171 => \n array (\n 'id' => 172,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2838.01,\n 'y' => -2586.62,\n 'z' => -0.7477,\n 'a' => 273.957,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 172 => \n array (\n 'id' => 173,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2838.26,\n 'y' => -2576.27,\n 'z' => -0.7139,\n 'a' => 274.884,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 173 => \n array (\n 'id' => 174,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2822.48,\n 'y' => -2590.11,\n 'z' => 0.068,\n 'a' => 88.2848,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 174 => \n array (\n 'id' => 175,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2839.15,\n 'y' => -2592.76,\n 'z' => -0.0994,\n 'a' => 264.828,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 175 => \n array (\n 'id' => 176,\n 'propietario' => 'Gobierno',\n 'modelo' => 453,\n 'precio' => 0,\n 'x' => 2801.81,\n 'y' => -2583.29,\n 'z' => -0.7696,\n 'a' => 181.831,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 10,\n ),\n 176 => \n array (\n 'id' => 177,\n 'propietario' => 'Gobierno',\n 'modelo' => 466,\n 'precio' => 5000,\n 'x' => 1659.95,\n 'y' => -1901.61,\n 'z' => 13.2939,\n 'a' => 359.81,\n 'color1' => '18',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 177 => \n array (\n 'id' => 178,\n 'propietario' => 'Gobierno',\n 'modelo' => 429,\n 'precio' => 15,\n 'x' => -1953.59,\n 'y' => 298.972,\n 'z' => 35.1484,\n 'a' => 142.652,\n 'color1' => '7',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 1,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 178 => \n array (\n 'id' => 179,\n 'propietario' => 'Gobierno',\n 'modelo' => 517,\n 'precio' => 6500,\n 'x' => 1632.2,\n 'y' => -1904.55,\n 'z' => 13.4067,\n 'a' => 269.611,\n 'color1' => '1',\n 'color2' => '3',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 179 => \n array (\n 'id' => 180,\n 'propietario' => 'Gobierno',\n 'modelo' => 536,\n 'precio' => 40000,\n 'x' => 2119.9,\n 'y' => -1144.58,\n 'z' => 24.3798,\n 'a' => 299.297,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 180 => \n array (\n 'id' => 181,\n 'propietario' => 'Gobierno',\n 'modelo' => 580,\n 'precio' => 32000,\n 'x' => 2136.3,\n 'y' => -1144.72,\n 'z' => 24.637,\n 'a' => 95.8218,\n 'color1' => '6',\n 'color2' => '6',\n 'comprable' => '1',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 181 => \n array (\n 'id' => 182,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 283.61,\n 'y' => 1429.48,\n 'z' => 10.3312,\n 'a' => 88.203,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 182 => \n array (\n 'id' => 183,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 283.509,\n 'y' => 1433.61,\n 'z' => 10.3331,\n 'a' => 89.0617,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 183 => \n array (\n 'id' => 184,\n 'propietario' => 'Gobierno',\n 'modelo' => 598,\n 'precio' => 0,\n 'x' => 283.678,\n 'y' => 1437.77,\n 'z' => 10.3325,\n 'a' => 89.1797,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 184 => \n array (\n 'id' => 185,\n 'propietario' => 'Gobierno',\n 'modelo' => 497,\n 'precio' => 0,\n 'x' => 256.253,\n 'y' => 1472.07,\n 'z' => 12.8248,\n 'a' => 90.0708,\n 'color1' => '0',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 185 => \n array (\n 'id' => 186,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -31.229,\n 'y' => 61.6207,\n 'z' => 4.116,\n 'a' => 67.7852,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 186 => \n array (\n 'id' => 187,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -25.6985,\n 'y' => 75.0524,\n 'z' => 4.0985,\n 'a' => 73.7121,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 187 => \n array (\n 'id' => 188,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -21.0595,\n 'y' => 88.5285,\n 'z' => 4.1118,\n 'a' => 66.7985,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 188 => \n array (\n 'id' => 189,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -54.3132,\n 'y' => 92.1332,\n 'z' => 4.1124,\n 'a' => 249.363,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n 189 => \n array (\n 'id' => 190,\n 'propietario' => 'Gobierno',\n 'modelo' => 532,\n 'precio' => 0,\n 'x' => -57.875,\n 'y' => 80.2766,\n 'z' => 4.0246,\n 'a' => 251.74,\n 'color1' => '1',\n 'color2' => '1',\n 'comprable' => '0',\n 'moneda' => 0,\n 'faccion' => 0,\n 'trabajo' => 0,\n ),\n ));\n \n \n }", "protected function CartTable($id=NULL) {\n\treturn $this->GetConnection()->MakeTableWrapper($this->CartsClass(),$id);\n }", "function createTr($v){\r\n echo \"<tr>\";\r\n foreach($v as $cheie=>$valaore){\r\n $id = array_search($v[$cheie],$v);\r\n $poza = $v[$cheie][\"Poza\"];\r\n $titlu = $v[$cheie][\"Titlu\"];\r\n $descriere = $v[$cheie][\"Descriere\"];\r\n createTd($id,$poza,$titlu,$descriere);\r\n }\r\n //print_r($poza);\r\n echo \"</tr>\";\r\n\r\n}", "function build_vehicle_javascript()\n\t{\n\t\tglobal $db;\n\n\t\t$make_q_id = \"SELECT id, make FROM \" . GARAGE_MAKES_TABLE . \" ORDER BY make ASC\";\n\t\n\t\tif( !($make_result = $db->sql_query($make_q_id)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\twhile ( $make_row = $db->sql_fetchrow($make_result) )\n\t\t{\n\t\t\t// Start this makes row in the output, this is where it gets confusing!\n\t\t\t$return .= 'cars[\"'.$make_row['make'].'\"] = new Array(\"'.$make_row['id'].'\", new Array(';\n\n\t\t\t$make_row_id = $make_row['id'];\n \t\t$model_q_id = \"SELECT id, model FROM \" . GARAGE_MODELS_TABLE . \" \n \t\t WHERE make_id = $make_row_id ORDER BY model ASC\";\n\n\t\t\tif( !($model_result = $db->sql_query($model_q_id)) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t\t} \n\n\t \t$model_string = '';\n\t\t\t$model_id_string = '';\n\n\t\t\t// Loop through all the models of this make\n\t\t\twhile ( $model_row = $db->sql_fetchrow($model_result) )\n\t\t\t{\n\t\t\t\t// Create the arrays that we will use in the output\n\t\t\t\t$model_string .= '\"'.$model_row['model'].'\",';\n\t\t\t\t$model_id_string .= '\"'.$model_row['id'] .'\",';\n\t\t\t}\n\t\t\t$db->sql_freeresult($model_result);\n\n\t\t\t// Strip off the last comma\n\t\t\t$model_string = substr($model_string, 0, -1);\n\t\t\t$model_id_string = substr($model_id_string, 0, -1);\n\n\t\t\t// Finish off this makes' row in the output\n\t\t\t$return .= $model_string .\"), new Array(\". $model_id_string .\"));\\n\";\n\t }\n\t\t$db->sql_freeresult($make_result);\n\n\t return $return;\n\t}", "public function vehiculo($id)\n {\n $this->data[\"conductor\"] = Userl::where(\"roles_id\", 2)->where(\"id\", $id)->with(\"driver\", \"driver.carro\", \"driver.carro.modelo\", \"driver.carro.marca\")->first();\n $this->data[\"vehiculo\"] = $this->data[\"conductor\"]->driver->carro;\n return view(\"admin.vehiculos.create\")->with($this->data);\n }", "public function vehicles_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicles->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t$last_login = '';\n\t\t\tforeach ($list as $vehicle) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$thumbnail = '';\n\t\t\t\t$filename = FCPATH.'uploads/vehicles/'.$vehicle->id.'/'.$vehicle->vehicle_image;\n\n\t\t\t\t$url = 'admin/vehicle_details';\n\t\t\t\t\n\t\t\t\tif($vehicle->vehicle_image == '' || $vehicle->vehicle_image == null || !file_exists($filename)){\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->db->select('*, MIN(id) as min_id', false)->from('vehicle_images')->where('vehicle_id', $vehicle->id)->get()->row();\n\t\t\t\t\n\t\t\t\t\tif(!empty($result)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'uploads/vehicles/'.$result->vehicle_id.'/'.$result->image_name.'\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'assets/images/img/no-default-thumbnail.png\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\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\t$thumbnail = '<img src=\"'.base_url().'uploads/vehicles/'.$vehicle->id.'/'.$vehicle->vehicle_image.'\" class=\"img-responsive img-rounded\" width=\"80\" height=\"80\" />';\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\" style=\"margin:5% auto;\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$vehicle->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:35%; margin-right:35%;\">'.$thumbnail.'</div>';\n\t\t\t\t\n\t\t\t\t$row[] = '<a href=\"!#\" data-toggle=\"modal\" data-target=\"#viewModal\" class=\"link\" onclick=\"viewVehicle('.$vehicle->id.',\\''.$url.'\\');\" id=\"'.$vehicle->id.'\" title=\"View '.$vehicle->vehicle_make .' '.$vehicle->vehicle_model.'\">'.$vehicle->vehicle_make .' '.$vehicle->vehicle_model.'</a>';\n\t\t\t\t\n\t\t\t\t$row[] = $vehicle->vehicle_type;\n\t\t\t\t\n\t\t\t\t$row[] = $vehicle->vehicle_make;\n\t\t\t\t$row[] = $vehicle->vehicle_model;\n\t\t\t\t$row[] = $vehicle->year_of_manufacture;\n\t\t\t\t\n\t\t\t\t$last_updated = $vehicle->last_updated;\n\t\t\t\tif($last_updated == '0000-00-00 00:00:00' || $last_updated == ''){\n\t\t\t\t\t$last_updated = 'Never'; \n\t\t\t\t}else{\n\t\t\t\t\t$last_updated = date(\"F j, Y, g:i a\", strtotime($last_updated )); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$row[] = $last_updated;\n\t\t\t\t\n\t\t\t\t//prepare buttons\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#addVehicleModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicle('.$vehicle->id.',\\''.$url.'\\')\" title=\"Click to Edit \"><i class=\"fa fa-edit\"></i> Edit</a>\n\t\t\t\t<a data-toggle=\"modal\" data-target=\"#addImagesModal\" class=\"btn btn-info btn-xs\" title=\"Add / Remove Images\" onclick=\"editVehicleImages('.$vehicle->id.',\\''.$url.'\\')\"><i class=\"fa fa-upload\"></i> Add / Remove Images</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicles->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicles->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function definition()\n {\n $keyId = 5;\n $vehicle = Vehicle::inRandomOrder()->first();\n $keys = $vehicle->keys;\n $numKeys = count($keys);\n $keyNum = rand(0, $numKeys);\n $selectedKey = $keys[$keyNum] ?? null;\n if ($selectedKey) {\n $keyId = $selectedKey->id;\n }\n return [\n 'vehicle_id'=> $vehicle->id,\n 'key_id' => $keyId,\n 'technician_id'=> Technician::inRandomOrder()->first()->id\n ];\n }", "public function getTableServicios($id)\n\t{\n\t\tif(! intval( $id )){\n\t\t\treturn false;\n\t\t}\n\t\t$id=$this->db->real_escape_string($id);\n\t\t$sql= \"\n\t\t\tSELECT ss.id,ss.codigo,ss.nombre,s.nombre paquete, s.descripcion\n\t\t\tFROM servicio_paquete sp \n\t\t\tINNER JOIN servicio s on s.id=sp.id_serviciopaquete \n\t\t\tINNER JOIN servicio ss on ss.id=sp.id_servicio\n\t\t\tWHERE sp.id_serviciopaquete=$id;\";\n\t\t$res=$this->db->query($sql);\n\t\t$set = array();\n\t\tif(!$res){ die(\"Error getting result getAllArr\".$sql); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t{ $set[] = $row; }\n\t\t}\n\t\treturn $set;\n\n\t}", "public function traerPorVehiculo($id)\n {\n }", "function buildVehiclesDisplay($vehicles){\r\n $dv = '<ul id=\"inv-display\">';\r\n foreach ($vehicles as $vehicle) {\r\n $dv .= '<li>';\r\n $dv .= \"<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=\".urlencode($vehicle['invId']).\"'><img src='$vehicle[imgPath]' alt='Image of $vehicle[invMake] $vehicle[invModel] on phpmotors.com'></a>\";\r\n $dv .= '<hr>';\r\n $dv .= \"<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=\".urlencode($vehicle['invId']).\"'><h2>$vehicle[invMake] $vehicle[invModel]</h2></a>\";\r\n $dv .= \"<span>$vehicle[invPrice]</span>\";\r\n $dv .= '</li>';\r\n }\r\n $dv .= '</ul>';\r\n return $dv;\r\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "protected function createVehicles($vehicle)\n {\n $vehicleCount = 0;\n if (isset($vehicle['attributes']['validate'])) {\n foreach ($vehicle['attributes']['validate'] as &$validator) {\n if ($validator['type'] === 'php') {\n if (strpos($validator['source'], ':/') === false && strpos($validator['source'], '/') !== 0) {\n $validator['source'] = $this->tplBase . '/' . $validator['source'];\n }\n }\n }\n }\n if (isset($vehicle['attributes']['resolve'])) {\n foreach ($vehicle['attributes']['resolve'] as &$resolver) {\n if ($resolver['type'] === 'php') {\n if (strpos($resolver['source'], ':/') === false && strpos($resolver['source'], '/') !== 0) {\n $resolver['source'] = $this->tplBase . '/' . $resolver['source'];\n }\n }\n }\n }\n switch ($vehicle['vehicle_class']) {\n case '\\\\Teleport\\\\Transport\\\\xPDOObjectVehicle':\n case 'xPDOObjectVehicle':\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n if ($realClass === false) {\n $this->request->log(\"Invalid class {$vehicle['object']['class']} specified; skipping vehicle\");\n break;\n }\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $iterator = $this->modx->getIterator($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n foreach ($iterator as $object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n } elseif (isset($vehicle['object']['data'])) {\n /** @var \\xPDOObject $object */\n $object = $this->modx->newObject($vehicle['object']['class']);\n if ($object instanceof $realClass) {\n $object->fromArray($vehicle['object']['data'], '', true, true);\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOObjectVehicles for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\xPDOCollectionVehicle':\n $objCnt = 0;\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $limit = isset($vehicle['object']['limit']) ? (integer)$vehicle['object']['limit'] : 0;\n if ($limit < 1) {\n $limit = 500;\n }\n $offset = 0;\n $criteria = $this->modx->newQuery($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n if (!isset($vehicle['object']['orderBy']) || !is_array($vehicle['object']['orderBy'])) {\n $pk = (array)$this->modx->getPK($realClass);\n foreach ($pk as &$primaryKey) {\n $primaryKey = $this->modx->escape($primaryKey);\n }\n $orderBy = array_fill_keys($pk, 'ASC');\n } else {\n $orderBy = $vehicle['object']['orderBy'];\n }\n foreach ($orderBy as $by => $direction) {\n $criteria->sortby($by, $direction);\n }\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n while (!empty($set)) {\n foreach ($set as &$object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n }\n if (!empty($set) && $this->package->put($set, $vehicle['attributes'])) {\n $vehicleCount++;\n $objCnt = $objCnt + count($set);\n }\n $offset += $limit;\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOCollectionVehicles with {$objCnt} total objects for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\MySQLVehicle':\n /* collect table names from classes and grab any additional tables/data not listed */\n $modxDatabase = $this->modx->getOption('dbname', null, $this->modx->getOption('database'));\n $modxTablePrefix = $this->modx->getOption('table_prefix', null, '');\n\n $coreTables = array();\n foreach ($vehicle['object']['classes'] as $class) {\n $coreTables[$class] = $this->modx->quote($this->modx->literal($this->modx->getTableName($class)));\n }\n\n $stmt = $this->modx->query(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (\" . implode(',', $coreTables) . \")\");\n $extraTables = $stmt->fetchAll(\\PDO::FETCH_COLUMN);\n\n if (is_array($extraTables) && !empty($extraTables)) {\n $excludeExtraTablePrefix = isset($vehicle['object']['excludeExtraTablePrefix']) && is_array($vehicle['object']['excludeExtraTablePrefix'])\n ? $vehicle['object']['excludeExtraTablePrefix'] : array();\n $excludeExtraTables = isset($vehicle['object']['excludeExtraTables']) && is_array($vehicle['object']['excludeExtraTables'])\n ? $vehicle['object']['excludeExtraTables'] : array();\n foreach ($extraTables as $extraTable) {\n if (in_array($extraTable, $excludeExtraTables)) continue;\n\n $instances = 0;\n $object = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n $attributes = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n\n /* remove modx table_prefix if table starts with it */\n $extraTableName = $extraTable;\n if (!empty($modxTablePrefix) && strpos($extraTableName, $modxTablePrefix) === 0) {\n $extraTableName = substr($extraTableName, strlen($modxTablePrefix));\n $addTablePrefix = true;\n } elseif (!empty($modxTablePrefix) || in_array($extraTableName, $excludeExtraTablePrefix)) {\n $addTablePrefix = false;\n } else {\n $addTablePrefix = true;\n }\n $object['tableName'] = $extraTableName;\n $this->request->log(\"Extracting non-core table {$extraTableName}\");\n\n /* generate the CREATE TABLE statement */\n $stmt = $this->modx->query(\"SHOW CREATE TABLE {$this->modx->escape($extraTable)}\");\n $resultSet = $stmt->fetch(\\PDO::FETCH_NUM);\n $stmt->closeCursor();\n if (isset($resultSet[1])) {\n if ($addTablePrefix) {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\";\n $object['table'] = str_replace(\"CREATE TABLE {$this->modx->escape($extraTable)}\", \"CREATE TABLE {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\", $resultSet[1]);\n } else {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape($extraTableName)}\";\n $object['table'] = $resultSet[1];\n }\n\n /* collect the rows and generate INSERT statements */\n $object['data'] = array();\n $stmt = $this->modx->query(\"SELECT * FROM {$this->modx->escape($extraTable)}\");\n if (!$stmt) {\n $this->request->log(\"Skipping table {$extraTable} as SELECT query failed\");\n break;\n }\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n if ($instances === 0) {\n $fields = implode(', ', array_map(array($this->modx, 'escape'), array_keys($row)));\n }\n $values = array();\n foreach ($row as $key => $value) {\n switch (gettype($value)) {\n case 'string':\n $values[] = $this->modx->quote($value);\n break;\n case 'NULL':\n case 'array':\n case 'object':\n case 'resource':\n case 'unknown type':\n $values[] = 'NULL';\n break;\n default:\n $values[] = (string)$value;\n break;\n }\n }\n $values = implode(', ', $values);\n if ($addTablePrefix) {\n $object['data'][] = \"INSERT INTO {$this->modx->escape('[[++table_prefix]]' . $extraTableName)} ({$fields}) VALUES ({$values})\";\n } else {\n $object['data'][] = \"INSERT INTO {$this->modx->escape($extraTable)} ({$fields}) VALUES ({$values})\";\n }\n $instances++;\n }\n }\n\n if (!$this->package->put($object, $attributes)) {\n $this->request->log(\"Could not package rows for table {$extraTable}\");\n } else {\n $this->request->log(\"Packaged {$instances} rows for non-core table {$extraTable}\");\n $vehicleCount++;\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} {$vehicle['vehicle_class']} vehicles for non-core tables\");\n } else {\n $this->request->log(\"No non-core tables found for packaging\");\n }\n break;\n case 'xPDOScriptVehicle':\n if (isset($vehicle['object']['source'])) {\n if (strpos($vehicle['object']['source'], ':/') === false && strpos($vehicle['object']['source'], '/') !== 0) {\n $vehicle['object']['source'] = $this->tplBase . '/' . $vehicle['object']['source'];\n }\n }\n case 'xPDOFileVehicle':\n case 'xPDOTransportVehicle':\n default:\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } else {\n if ($this->package->put($vehicle['object'], $vehicle['attributes'])) {\n $this->request->log(\"Packaged 1 {$vehicle['vehicle_class']}\" . (isset($vehicle['object']['source'])\n ? \" from {$vehicle['object']['source']}\" : \"\"));\n $vehicleCount++;\n }\n }\n break;\n }\n return $vehicleCount;\n }", "public function datatable()\n {\n $p = $this->getPermission('vehicle');\n $data = Vehicle::with(['Brand','Dependency'])->get();\n if(isset($p))\n foreach($data as $d)\n $d['p'] = array('a'=>false && $p->u,'e'=>$p->u,'d'=>$p->d);\n return datatables()->of($data)->toJson();\n }", "protected function vehicles()\n {\n // All weights are in kg\n\n // Audi\n $this->generateVehicle(\n 'Audi A1 Sportback',\n 'Compact 5-door Sportback with LED headlights, Audi Smartphone interface and Audi Pre-sense front',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A1/new_a1sb_sport_side.png',\n 21562.1800,\n 3.5,\n 4.4,\n 3.8,\n 137,\n 7.5,\n 147,\n 1409,\n 1740,\n 4029,\n 1260,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/A1_1.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/A1_2.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a1/Hero_desktop.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Audi S3 Cabriolet',\n '-door performance cabriolet with automatic acoustic hood, distinctive ‘S’ styling, and Fine Nappa leather seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/A3-Cabriolet-Side.png',\n 52206.3700,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1409,\n 1793,\n 4423,\n 1635,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_1.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_2.jpg',\n ]\n );\n $this->generateVehicle(\n 'Audi RS 3 Saloon',\n '4-door performance saloon with quattro all-wheel drive and 2.5-litre turbocharged five-cylinder engine.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/a3_rs3_saloon_side_19.png',\n 57489.0100,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1397,\n 1802,\n 4479,\n 1535,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_Hero_desktop.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_2.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_3.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 3 Sportback',\n '5-door performance hatchback with quattro all-wheel drive and 2.5-litre turbocharged five-cylinder engine.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A3/rs3_sportback_side_19.png',\n 56273.21,\n 4.3,\n 4.2,\n 4.1,\n 155,\n 4.6,\n 300,\n 1411,\n 1800,\n 4335,\n 1530,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A3/Seats/RS3_Sportback_seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/Campaign-Pages/sbs/eos/a3/A3_1.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Audi S4 Saloon',\n '4-door performance Saloon with unique S4 exterior styling, enhanced brakes and suspension.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon-side-d1.png',\n 58358.30,\n 4.4,\n 4.6,\n 4.2,\n 155,\n 5.7,\n 347,\n 1369,\n 1854,\n 4640,\n 1750,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_headlights.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_seats.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_auditech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 4 Avant',\n '5-door high-performance sports estate with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/RS4/rs_4_avant--side.png',\n 82169.71,\n 4.4,\n 4.6,\n 4.2,\n 155,\n 5.7,\n 347,\n 1434,\n 1842,\n 4725,\n 1620,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_headlights.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_seats.jpg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A4/S4-Saloon/S4-Saloon/s4saloon_auditech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi A5 Cabriolet',\n '2-door Cabriolet with fully automatic acoustic hood and Parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/A5/a5-cab-sline-19-side.png',\n 47075.70,\n 4.2,\n 3.5,\n 4.3,\n 155,\n 5.1,\n 354,\n 1383,\n 1846,\n 4673,\n 1760,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A5/Headlights/a5-coupe-sport-headlights-19.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/A5/Seats/Front-Sport-seats.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi RS 5 Coupe',\n '2-door high-performance sports Coupé with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A5/RS5-Coupe/RS5-Coupe-Side.png',\n 83871.83,\n 4.4,\n 5.0,\n 3.5,\n 174,\n 3.9,\n 354,\n 1360,\n 1861,\n 4723,\n 1685\n );\n $this->generateVehicle(\n 'Audi RS 5 Sportback',\n '5-door high-performance sports car with a 2.9 TFSI engine with quattro all-wheel drive, RS styling, RS Sport exhaust and and Audi Virtual Cockpit.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A5/RS5-Sportback/RS5-Sportback-Side.png',\n 83871.83,\n 4.4,\n 5.0,\n 3.5,\n 174,\n 3.9,\n 354,\n 1386,\n 1843,\n 4733,\n 1720\n );\n $this->generateVehicle(\n 'Audi S6 Saloon',\n '4-door performance Saloon with a 4.0-litre V8 TFSI engine, quattro and S Super Sport front seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A6/S6-Saloon/s6_saloon--side.png',\n 73215.36,\n 4.4,\n 4.4,\n 4.6,\n 255,\n 5.0,\n 349,\n 1435,\n 1803,\n 4892,\n 1730\n );\n $this->generateVehicle(\n 'Audi S7 Sportback',\n '5-door performance Sportback with Matrix LED headlights, Virtual Cockpit and heated Super Sport seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/A7/S7-Sportback/s7_sportback--side.png',\n 83501.01,\n 4.4,\n 4.4,\n 4.6,\n 255,\n 5.0,\n 349,\n 1422,\n 1908,\n 4969,\n 2010\n );\n $this->generateVehicle(\n 'Audi SQ5',\n '5-door performance SUV with distinctive \\'S\\' styling, Audi Virtual Cockpit and Fine Nappa leather seats.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q5/SQ5/sq5--side.png',\n 66911.44,\n 4.0,\n 4.5,\n 3.5,\n 155,\n 5.1,\n 313,\n 1635,\n 1893,\n 4671,\n 2055\n );\n $this->generateVehicle(\n 'Audi Q8',\n 'Luxury SUV with Matrix LED headlights, MMI Navigation and Parking System Plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8_sline_side.png',\n 81470.62,\n 3.7,\n 4.5,\n 4.4,\n 144,\n 6.3,\n 286,\n 1708,\n 1995,\n 4986,\n 2365,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/Q8/Headlights/Q8-Sline-Headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8-sline-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/Q8/s-line/q8-sline-auditech.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi TT RS Coupé',\n '2 door high-performance sports coupé with a 2.5-litre TFSI 5-cylinder engine, ‘RS’ styling and Audi virtual cockpit with a RS specific screen.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/TT/TTRS-Coupe/TTRS/ttrs_coupe_ttrs-coupe_side.png',\n 66741.23,\n 4.5,\n 4.0,\n 4.0,\n 174,\n 3.7,\n 395,\n 1343,\n 1832,\n 4201,\n 1450\n );\n $this->generateVehicle(\n 'Audi TT RS Roadster',\n '2 door high-performance sports coupé with a 2.5-litre TFSI 5-cylinder engine, ‘RS’ styling and Audi Virtual Cockpit with a RS specific screen',\n 'https://www.audi.co.uk/content/dam/audiadaptive/MY20/TT/TTRS-Roadster/TTRS/ttrs_roadster_side_new.png',\n 68868.88,\n 4.5,\n 4.0,\n 4.0,\n 155,\n 3.9,\n 395,\n 1343,\n 1832,\n 4201,\n 1510\n );\n\n $this->generateVehicle(\n 'Audi R8 Coupé',\n '2-door high-performance Audi Sport coupé with a 5.2 litre V10 engine, Audi Virtual Cockpit, dual-branch oval tailpipes and parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/R8/r8_coupev10-quattro_side_19.png',\n 155865.3000,\n 4.7,\n 4.3,\n 4.7,\n 205,\n 3.2,\n 610,\n 1240,\n 1940,\n 4426,\n 1555,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Headlights/r8_v10_quattro-headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Seats/r8_v10_quattro-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Suspension/r8_v10_quattro-performance.jpeg'\n ]\n );\n $this->generateVehicle(\n 'Audi R8 Spyder',\n '2-door high-performance Audi Sport convertible with a 5.2 litre V10 engine, Audi Virtual Cockpit, dual-branch oval tailpipes and parking system plus.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/R8/r8_spyder10-quattro_side_19.png',\n 166430.59,\n 4.9,\n 3.5,\n 4.7,\n 200,\n 3.2,\n 620,\n 1240,\n 1940,\n 4426,\n 1695,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Headlights/r8_v10_quattro-headlights.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/Seats/r8_v10_quattro-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/Web-Tablet/R8/AudioCommunication/r8_v10_quattro-audiotech.jpg'\n ]\n );\n $this->generateVehicle(\n 'Audi E-Tron',\n 'Fully electric, 5-door SUV with virtual door mirrors, Pre-sense Front and Basic, and a rear-view camera as standard.',\n 'https://www.audi.co.uk/content/dam/audiadaptive/car-images/Web-Tablet/Side-Images/e-tron/e-tron-launch-edition-side.png',\n 166430.59,\n 4.0,\n 4.8,\n 4.3,\n 124,\n 5.7,\n 402,\n 1629,\n 1935,\n 4901,\n 2560,\n [\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-headlight.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-seats.jpeg',\n 'https://www.audi.co.uk/content/dam/audiadaptive/trim-features/e-tron/Desktop/e-tron-suspension.jpg'\n ]\n );\n\n // Lambo\n $this->generateVehicle(\n 'Lamborghini Huracan Evo Spyder',\n 'Driving a Spyder is a thrill in itself, but the Huracán Evo Spyder was created to amplify your driving experience to the max. Color, scent, and sound become one with the car’s compelling design and ultra-lightweight materials.\nThe power of the 640 CV V10 engine vibrates into a roar, and the supersport exhaust sound fills your ears. The car’s perfectly sleek, aerodynamic body slices through the air, and you race along with it; the thrill of your desire, lifting you higher',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/NEW/huracan-evo-spyder.png',\n 265210.53,\n 4.9,\n 4.8,\n 4.7,\n 202,\n 2.9,\n 629,\n 1180,\n 1933,\n 4520,\n 1542,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/int_right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/design-left.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/evo-slider/RP---Huracan-Evo-20.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Evo',\n 'The Huracán EVO represents the natural evolution of the most successful V10 in Lamborghini history. It is the result of fine-tuning and consolidation which involves the already existing features and performance of Huracán, combined with the development of new solutions in terms of efficiency and design. But overall this vehicle stands out for its ability to anticipate the moves and satisfy the desires of the driver, in harmony with the Lamborghini DNA.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/huracan/car/huracan-evo.png',\n 250454.39,\n 4.9,\n 4.8,\n 4.7,\n 202,\n 2.9,\n 629,\n 1180,\n 1933,\n 4520,\n 1542,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/upgrade/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/upgrade/design-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/Evo/restyle/RP---Huracan-Evo-3.jpg',\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Performante Spyder',\n 'The Huracán Performante has decided to lower its roof and transform itself into the Spyder with the highest performance that the Huracán family has ever seen. Its lines are designed to thrill at first sight and its state-of-the-art technology has been developed to provide a one-of-a-kind driving experience. Weighing in at 35 kg less than the Huracán 4WD Spyder and with 30 HP more, this newest addition to the House of the Raging Bull vaunts the best power-to-weight ratio in the Huracán Spyder range. It uses Forged Composites® material and the new ALA (Lamborghini Active Aerodynamics) technology. The Huracán Performante Spyder: power has become breathtakingly beautiful.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/huracan/car/hps-carousel-family.png',\n 289359.92,\n 4.9,\n 4.8,\n 4.7,\n 201,\n 3.1,\n 629,\n 1180,\n 1924,\n 4506,\n 1507,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/intern2.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante-spyder/design-left.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Huracan Performante',\n 'The Huracán Performante has reworked the concept of super sports cars and taken the notion of performance to levels never seen before. The vehicle has been re-engineered in its entirety, as regards its weight, engine power, chassis and above all by introducing an innovative system of active aerodynamics: ALA. The use of the awarded Forged Composites®, a shapable forged carbon fiber material patented by Automobili Lamborghini, is a real nice touch and it contributes to make the vehicle even lighter in weight. Besides its extraordinary technological properties, it also conveys a new idea of beauty.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/car-slider/huracan-performante/performante-carousel-family.png',\n 261396.57,\n 4.9,\n 4.8,\n 4.7,\n 201,\n 2.9,\n 629,\n 1165,\n 1924,\n 4506,\n 1382,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/huracan/huracan-performante/intern2-huracan-performante.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/configuratore%20nuovo/huracan-performante-configuratore.jpg',\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador SVJ Roadster',\n 'There’s only one adjective to describe SVJ Roadster: unrivaled.\nProduced in just 800 units, it is the most iconic model of the Aventador family, thanks to its aerodynamic lines that slice through the air, and its breathtaking design, the expression of the most refined Italian taste and craftsmanship.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/car/SVJ_Roadster_gateway%20Aventador.png',\n 467043.94,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/header.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/PAGINA%20MODELLO_DEF/compressed/freni-avendator-svj-3.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj-roadster/intern2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador SVJ',\n 'The future is unknown. It is a journey, an adventure. And above all, it is a challenge.\nLamborghini has never shied away from challenges, which is precisely why it created the new Aventador SVJ. To combine cutting-edge technology with extraordinary design, without ever coming to compromises.\nIn a future driven by technology, it’s easy to lose track of emotions. But in the future we are shaping, real emotions won’t be left behind. Because at the wheel, there will always be a person.\nAventador SVJ. Real emotions shape the future.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/aventador%20svj/aventador-svj-coup%C3%A8/car.png',\n 425529.30,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/Lamborghini_Aventador_SVJ_Green_Track_09.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/design-left.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-svj/Restyling/white_interior_final.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador S Roadster',\n 'The icon that inherited the legacy of the historic S models of the Miura, Islero, Countach, and Urraco returns to outdo itself in its most exciting version: the Aventador S Roadster.\nThe new V12 engine with a whopping 740 HP and the exclusiveness of Lamborghini design, unparalleled in this open top version, are joined in the Aventador S Roadster by the most sophisticated technology of the range, including the new LDVA (Lamborghini Dinamica Veicolo Attiva), which provides an incomparable driving experience, all of this able to feed the ego even of those who constantly seek the most powerful and adrenaline-pumping sensations.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/cars/aventador-s-roadster-car.png',\n 460247,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/header.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/intern2.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s-roadster/04_12_Restyling/design-right.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Aventador S',\n 'An icon cannot be reinvented, it can only be challenged. And only Aventador could surpass itself. Following Miura, Islero, Countach, and Urraco, Lamborghini’s most iconic model now reaps the inheritance of the historic S models and evolves into the new Aventador S. Exclusive Lamborghini design and the new V12 engine with a whopping 740 HP now join the most sophisticated technology of the range, featuring the new LDVA (Lamborghini Dinamica Veicolo Attiva/Lamborghini Active Vehicle Dynamics), which offers an unparalleled driving experience to all those who honour their egos by challenging themselves every day.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/aventador/cars/aventador-s/aventador-s-auto-carousel-family.png',\n 417826,\n 4.9,\n 4.7,\n 4.6,\n 217,\n 2.9,\n 758,\n 1136,\n 2098,\n 4943,\n 1575,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/overview-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/design-right.jpg',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/aventador/aventador-s/Restyling/intern2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Lamborghini Centenario',\n 'The new Lamborghini Centenario represents a new, extremely precious piece in Lamborghini\\'s one-off strategy. It is a perfect example of the innovative design and the engineering skills of the bull-branded manufacturer.',\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/gateway-family/one-off/cars/centenario.png',\n 1900000,\n 5.0,\n 5.0,\n 5.0,\n 217,\n 2.7,\n 758,\n 1143,\n 2062,\n 4924,\n 1520,\n [\n 'https://www.lamborghini.com/sites/it-en/files/DAM/lamborghini/model/one-off/centenario/bg-huracan-right-skew.jpg'\n ]\n\n );\n\n\n // Porsche\n $this->generateVehicle(\n 'Porsche 718 Cayman S',\n 'The 718 models were made for the sport of it. They are mid-engined roadsters that unite the sporting spirit of the legendary Porsche 718 with the sports car of tomorrow – and transfer it to the roads of today’s world. With one goal: to take the everyday out of every day.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718-c7s-modelimage-sideshot/model/c976d857-d7eb-11e6-a122-0019999cd470;;twebp/porsche-model.webp',\n 65344.28,\n 4.8,\n 4.6,\n 4.9,\n 177,\n 4.9,\n 345,\n 1295,\n 1801,\n 4379,\n 1355,\n [\n 'https://files1.porsche.com/filestore/image/multimedia/none/jdp-2016-982-718-c7s-editorial-xl/normal/0d934731-4ddc-11e8-bbc5-0019999cd470;sF;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/image/multimedia/none/jdp-2016-982-718-c7s-editorial-l/normal/28f2e623-6d97-11e9-80c4-005056bbdc38;sJ;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/jdp-2016-982-718-c7-gallery-exterior-25/zoom2/72226e2f-96d6-11e6-9f1b-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 718 Boxster GTS',\n 'The 718 GTS models are never satisfied. They always crave more. More heart pounding from the start. More corners per kilometre. And more adrenaline with every metre. With an uprated midmounted engine and a chassis unfazed by any hairpin turn. Their power follows an upward path, their design looks forwards: with sharpened forms, honed lines, exquisite materials.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718-bo-gts-modelimage-sideshot/model/e61bf85e-ae78-11e7-b591-0019999cd470;;twebp/porsche-model.webp',\n 76758.19,\n 4.0,\n 4.0,\n 4.5,\n 180,\n 4.9,\n 359,\n 1272,\n 1801,\n 4379,\n 1450,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-04/zoom2/38e33008-6da1-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-01/zoom2/7d4a5027-f782-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/982-718-gts-gallery-15/zoom2/69585a05-f782-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 718 Cayman GT4',\n '718 Cayman GT4 is the perfect sports car for those who like to push the limits. For those who would rather ask ‘why not?’ than ‘why?’. For those who take fun seriously and who would rather sit in a sports seat than a leather armchair.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/982-718gt4-modelimage-sideshot/model/5b3fd684-85f2-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 91607.95,\n 4.0,\n 4.0,\n 4.5,\n 188,\n 4.4,\n 414,\n 1269,\n 1994,\n 4456,\n 1495,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-interior-01/zoom2/cc9d4c28-878d-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-indoor-01/zoom2/9ea29246-879a-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-718gt4-interior-04/zoom2/15c39fee-8795-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Carrera 4S',\n 'The new 911 is the sum of its predecessors - a reflection of the past and a vision of the future. The silhouette: iconic. The design: timeless. The technology: inspired by great racing victories and always one step ahead. With the eighth generation of the 911, we’re driving into the future.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/992-c4s-modelimage-sideshot/model/c02b5f4d-e826-11e8-bec8-0019999cd470;;twebp/porsche-model.webp',\n 119656.41,\n 5.0,\n 5.0,\n 5.0,\n 190,\n 3.6,\n 443,\n 1298,\n 1852,\n 4499,\n 1490,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/en/modelseries-911carrera992-interieur-12/zoom2/68d27c9a-a6fc-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-911carrera992-indoor-10/zoom2/eea87d8f-a6f8-11e9-80c4-005056bbdc38;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-details-01/zoom2/68c55f32-e75a-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Carrera 4S Cabriolet',\n 'The new 911 is the sum of its predecessors - a reflection of the past and a vision of the future. The silhouette: iconic. The design: timeless. The technology: inspired by great racing victories and always one step ahead. With the eighth generation of the 911, we’re driving into the future.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/992-c4scab-modelimage-sideshot/model/c6ec382b-fc69-11e8-8373-0019999cd470;;twebp/porsche-model.webp',\n 131382.78,\n 5.0,\n 5.0,\n 5.0,\n 188,\n 3.8,\n 443,\n 1299,\n 1852,\n 4519,\n 1710,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-indoor-08/zoom2/a748dda6-e75c-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-interior-02/zoom2/e1346331-e75c-11e8-bec8-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911carrera992-interior-06/zoom2/fba63fea-e75c-11e8-bec8-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 Speedster',\n 'A single word encompasses everything the brand stands for: Speedster. The concept embodies the original Porsche virtues of purism, lightweight construction, efficiency and unadulterated driving pleasure. Limited to 1,948 units, the new 911 Speedster pays tribute to an idea that runs through the history of Porsche like a long winding road.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/991-2nd-speedster-modelimage-sideshot/model/39752d78-35e8-11e9-80c4-005056bbdc38;;twebp/porsche-model.webp',\n 257261.64,\n 5.0,\n 5.0,\n 5.0,\n 188,\n 3.8,\n 443,\n 1250,\n 1852,\n 4562,\n 1615,\n [\n 'https://files1.porsche.com/filestore/wallpaper/multimedia/none/modelseries-911speedster-wallpaper-02/wallpaper/ba012bac-36a7-11e9-80c4-005056bbdc38;sO;twebp;l63692803798;w1920;h1080/porsche-wallpaper.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911speedster-interior-01/zoom2/c7115f91-39cc-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-911speedster-interior-04/zoom2/2d1c72e8-39cd-11e9-80c4-005056bbdc38;sQ;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche 911 GT3 RS',\n 'Drivers. Fans. Lovers of the true motorsport. Brace yourselves. And get ready. The race track is calling. More loudly than ever before. And with an intensity not felt for quite some time. Defensive? Routine? As if. Better to go on the attack. A challenge awaits, one that will push you beyond your comfort zone for a change. Where unfiltered fascination feels at home: in the chicane, in the banked turn, on the long straights.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/991-2nd-gt3-rs-modelimage-sideshot/model/d446a760-17dc-11e8-bbc5-0019999cd470;;twebp/porsche-model.webp',\n 253240,\n 5.0,\n 5.0,\n 5.0,\n 193,\n 3.2,\n 512,\n 1297,\n 1880,\n 2453,\n 1445,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-outdoor-01/zoom2/9e03218a-fc65-11e7-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-interior-04/zoom2/5a70c0a5-fc65-11e7-bbc5-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/991-2nd-gt3rs-gallery-outdoor-02/zoom2/c165f4fc-1584-11e8-bbc5-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera 4S Executive',\n 'A few years ago, everything to do with the saloon suddenly changed. Large, cumbersome and thickly padded instantly seemed outmoded qualities. On the road, something happened – something rather fast and dynamic: a sports car came along. A sports car with four seats, an unmistakable silhouette and performance figures normally associated only with a Porsche.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-4s-e-modelimage-sideshot/model/96643f1f-d7e2-11e6-a122-0019999cd470;;twebp/porsche-model.webp',\n 124515.95,\n 4.5,\n 4.0,\n 4.0,\n 179,\n 4.5,\n 433,\n 1428,\n 1937,\n 5199,\n 2055,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4s-st-gallery-outdoor-01/zoom2/0c98b233-562c-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-tu-gallery-interior-02/zoom2/86a25c0e-fd4a-11e8-8373-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/g2-4s-gallery-exterior-18/zoom2/7958fbc4-562b-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera GTS Sport Turismo',\n 'If you set yourself ambitious goals in life, you have to approach them with courage and passion. The Panamera does just that, blazing a trail with no compromises, uniting apparent opposites: performance and comfort, dynamism and efficiency, work and family.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-gts-st-modelimage-sideshot/model/8436fd3a-cad0-11e8-81d2-0019999cd470;;twebp/porsche-model.webp',\n 132918.33,\n 4.5,\n 4.0,\n 4.0,\n 179,\n 4.1,\n 453,\n 1422,\n 1937,\n 5053,\n 2100,\n [\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-gts-st-editorial-xl/normal/03cf722e-b1ce-11e8-8f14-0019999cd470;sF;twebp/porsche-normal.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-panamera-gts-st-gallery-exterior-10/zoom2/13b5e363-bb46-11e8-8f14-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/modelseries-panamera-gts-st-gallery-exterior-04/zoom2/b5ce5dcd-bb45-11e8-8f14-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Panamera Turbo S E-Hybrid Executive',\n 'Porsche E-Performance is everything that you expect from a Porsche. And more. It is goose bumps. G-forces. Adrenalin. Because we are not satisfied with merely boosting efficiency when we can take performance and driving pleasure to the limits at the same time. There is a good reason why all of our experience and successes in motor sports have a major influence on development.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/970-g2-tus-e-hy-e-modelimage-sideshot/model/82d9a7c2-6046-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 181806.79,\n 4.5,\n 4.0,\n 4.0,\n 192,\n 3.5,\n 670,\n 1432,\n 1937,\n 5199,\n 2485,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-tus-e-hy-st-gallery-exterior-03/zoom2/d3a7fec2-17cc-11e9-ae19-0019999cd470;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4hy-gallery-interior-01/zoom2/7123fcf3-24de-11e7-9f74-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/970-g2-4hy-gallery-exterior-36/zoom2/336bd990-198f-11e9-ae19-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Macan Turbo',\n 'We have proven that we do not follow trends. Instead, we design our own adventures. A compact SUV that inextricably combines sportiness, design and everyday practicality: the Macan.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/pa-tu-modelimage-sideshot/model/0d290e38-c3da-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 57036.73,\n 4.6,\n 4.0,\n 4.7,\n 167,\n 4.3,\n 433,\n 1624,\n 2098,\n 4684,\n 1925,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-modelseries-gallery-outdoor-02/zoom2/2013fd91-f7c7-11e8-8373-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-model-series-gallery-image-05/zoom2/0f5846de-867d-11e8-8d30-0019999cd470;sQ;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/pa-r4-model-series-gallery-image-09/zoom2/e2c1167e-867d-11e8-8d30-0019999cd470;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Porsche Cayenne Turbo S E-Hybrid Coupé',\n 'This shape, it has been around for many years. Our iconic flyline, has been lengthened, heightened and lowered, but has remained the same. It is a shape that has won races. Everyone recognises it - at night, in the fog and even blindfolded. A shape that can only be achieved with training; sprints, physical exertion and stamina, just like building muscle. This shape stands for all that we are.',\n 'https://files1.porsche.com/filestore/image/multimedia/none/9yb-e3c-tu-s-e-hy-modelimage-sideshot/model/7089f674-aedd-11e9-80c4-005056bbdc38;sL;twebp/porsche-model.webp',\n 152577.79,\n 4.5,\n 4.0,\n 4.0,\n 183,\n 3.8,\n 670,\n 1573,\n 1983,\n 4926,\n 2565,\n [\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-turbo-s-e-hybrid-gallery-image-01/zoom2/01236b4f-b84f-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-gallery-image-23/zoom2/5fe6936f-35e6-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg',\n 'https://files1.porsche.com/filestore/galleryimagerwd/multimedia/none/model-series-e3-cayenne-coupe-gallery-image-36/zoom2/0d5f1dcd-4a32-11e9-80c4-005056bbdc38;sN;twebp/porsche-zoom2.jpg'\n ]\n );\n /*\n $this->generateVehicle(\n 'Porsche 918 Spyder',\n '/var/www/dev.gve.world/resources/graphics/cars/porsche-918.png',\n 'https://png2.cleanpng.com/sh/980941764631322deed36c1bce087230/L0KzQYm3WMA0N5lrjpH0aYP2gLBuTcIxOWkyiNH7c3PrdX6CUcEueJD3i9VxZT28QYm0kCB6bJZ3ReJ4coPmeLa0WcMxNZRmRd94ZHXvf373jCJ0a5lqRas6OD32gMrrhgIueJD3i9VxZT3mdbB7hgIueKZqiuZ4LUXlRoW8WfZlaWk7TNM9LkG8R4qCUsE3OWY4S6U5M0K8Q4eBWcgveJ9s/kisspng-2018-porsche-911-porsche-918-spyder-porsche-930-ca-modelo-porsche-918-spyder-porsche-center-puerto-5b6459fda864a4.1979921615333032936898.png',\n 1276587.90,\n 5.0,\n 5.0,\n 5.0,\n 214,\n 2.6,\n 874,\n [\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dsc-6340-1540488225.jpg',\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dsc-6479-1540486710.jpg',\n 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/800-7411-1540489318.jpg'\n ]\n );\n */\n // Ferrari\n\n // Volkswagen\n $this->generateVehicle(\n 'Volkswagen up!',\n 'THe smallest Volkswagen is more colourful and sharper with newly designed body panels, new colours, new wheels, a completely redesigned interior and a new infotainment system.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30101/hero/480/0.png',\n 12163.63,\n 4.3,\n 4.5,\n 4.3,\n 101,\n 14.4,\n 60,\n 1504,\n 1645,\n 3600,\n 940,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize8.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize2.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/up-pa/gallery/Upfullsize5.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Polo GTI',\n 'The Polo with an exterior designed to turn heads which is matched by an interior that\\'s totally at home in the digital age.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30200/30200-2974/480/0.png',\n 26137.32,\n 3.0,\n 5.0,\n 3.0,\n 148,\n 6.7,\n 197,\n 1461,\n 1751,\n 4067,\n 1355\n );\n $this->generateVehicle(\n 'Volkswagen T-Roc R-Line',\n 'Born confident',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30361/30361-3040/480/0.png',\n 41884.87,\n 4.3,\n 4.6,\n 4.7,\n 134,\n 7.2,\n 187,\n 1573,\n 1819,\n 4234,\n 1505\n );\n $this->generateVehicle(\n 'Volkswagen Golf GTI TCR',\n 'The iconic GTI, but with the DNA of a race car. The GTI TCR with its uniquely shaped front and rear bumpers and rear spoiler, as well as unique GTI TCR badging, this car is not one for blending in.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/30316/30316-10436/480/0.png',\n 45450.69,\n 4.5,\n 5.0,\n 4.5,\n 155,\n 5.6,\n 286,\n 1492,\n 1790,\n 4258,\n 1430\n );\n $this->generateVehicle(\n 'Volkswagen Tiguan R-Line Tech',\n 'Turn heads with the ultimate Tiguan that includes the ultimate in luxury and refinement with a dynamic sporty look.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31105/31105-10422/480/0.png',\n 50144.79,\n 4.0,\n 4.4,\n 4.0,\n 143,\n 6.2,\n 237,\n 1673,\n 1859,\n 4490,\n 2360\n );\n $this->generateVehicle(\n 'Volkswagen Passat Saloon R-Line',\n 'Turn heads with the ultimate Passat that includes the ultimate in luxury and refinement with a dynamic sporty look.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31300/31300-3040/480/0.png',\n 49197.53,\n 4.0,\n 5.0,\n 4.0,\n 153,\n 6.4,\n 237,\n 1456,\n 1832,\n 4767,\n 1367,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-1.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-4.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/passat-saloon/passat-saloon-gallery-6.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Touran R-Line',\n 'Our top of the range R-Line is the ultimate in style and quality, with a bespoke R-Line body kit, tinted glass and 18\" Marseille alloy wheels. Attractive R-Line design cues are continued inside with bespoke R-Line upholstery and steering wheel.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31005/hero/480/0.png',\n 36508.98,\n 4.4,\n 4.8,\n 4.0,\n 130,\n 9.3,\n 148,\n 1659,\n 1829,\n 4527,\n 1454,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/1d.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/2c.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/touran-nf/gallery/1b.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Arteon R-Line',\n 'The Arteon is a newly developed premium Volkswagen model. A fastback saloon with cutting-edge design and predictive driver assistance systems, the Arteon is a true driver of innovation.',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31505/31505-3040/480/0.png',\n 49662.11,\n 4.1,\n 4.5,\n 3.8,\n 155,\n 5.6,\n 268,\n 1450,\n 1871,\n 4862,\n 1565,\n [\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_1.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_7.jpg',\n 'https://www.volkswagen.co.uk/assets/common/content/mlp/arteon/gallery_full_2_v2.jpg'\n ]\n );\n $this->generateVehicle(\n 'Volkswagen Touareg V6 R-Line',\n 'For a sportier style, the R-Line has unique front & rear bumpers, side skirts, 20\" \\'Braga\\' diamond turned alloy wheels and keyless start',\n 'https://imagecom.volkswagen.co.uk/api/image/2.1/360s/car/vw/31705/31705-4664/480/0.png',\n 67786.88,\n 4.2,\n 4.5,\n 3.9,\n 155,\n 5.9,\n 335,\n 1709,\n 2208,\n 4801,\n 2110,\n [\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-gallery-recrop.jpg',\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-imageneww.jpg',\n 'https://www.volkswagen.co.uk/assets/content/new-cars/touareg-new-img.jpg'\n ]\n );\n\n $this->generateVehicle(\n 'Challenger',\n '',\n 'https://dev.gve.world/images/vehicles/Challenger-2.png',\n 5180394.74,\n 2,\n 5.0,\n 3.8,\n 37,\n 0,\n 1200,\n 25000,\n 35000,\n 115000,\n 62500,\n [\n 'https://dev.gve.world/images/vehicles/45158851.jpg',\n 'https://dev.gve.world/images/vehicles/_AJW4020-2.jpg'\n ],\n 100,\n 100,\n true\n );\n }", "public function gen_dd_array()\n {\n $vec = array();\n if($result = $this->get($this->_table) )\n {\n foreach($result as $reg)\n { \n $vec[$reg->id] = $reg->name;\n }\n }\n return $vec;\n }", "protected function OrderTable($id=NULL) {\n\treturn $this->Engine()->Make(KS_CLASS_ORDERS,$id);\n }", "public function vehicle_details(){\n\t\t// $vehicle_id = $this->input->post('id');\n\t\t$vehicle_id = $this->input->post('id');\n\t\t// echo \"<pre>\";\n\t\t// print_r($vehicle_id);\n\t\t// exit;\n\t\t$data_array = array();\n\t\t//\n\t\t$parameters['join'] = array(\n\t\t\t'company' => 'company.company_id = vehicles.company'\n\t\t);\n\t\t$parameters['where'] = array('id' => $vehicle_id);\n\t\t$parameters['select'] = '*';\n\n\t\t$data = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t$company_id = explode(',',$data->company);\n\n\t\t$company_parameters['where_in'] = array('col' => 'company_id', 'value' => $company_id);\n\t\t$data_company = $this->MY_Model->getRows('company',$company_parameters);\n\n\t\t$data_array['vehicles'] = $data;\n\t\t$data_array['company'] = $data_company;\n\t\tjson($data_array);\n\n\t\t// $parameters['where'] = array('id' => $vehicle_id);\n\t\t// $data['view_edit'] = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t// // echo $this->db->last_query();\n\t\t// echo json_encode($data);\n\t}", "public function vehicle_type_datatable()\n\t\t{\n\t\t\t$list = $this->Vehicle_types->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $type) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$type->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:30%; margin-right:30%;\"><strong>'.$type->name.'</strong> </div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<div class=\"checkbox checkbox-primary\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$type->id.'\"></div>';\n\n\t\t\t\t//$row[] = $type->name;\n\t\t\t\t\n\t\t\t\t//$row[] = $type->name;\n\t\t\t\t\n\t\t\t\t$url = 'admin/vehicle_type_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" onclick=\"editVehicleType('.$type->id.',\\''.$url.'\\')\" id=\"'.$type->id.'\" title=\"Click to Edit\"><i class=\"fa fa-edit\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Vehicle_types->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Vehicle_types->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "function getDetailAllVehicleVG($account_id,$DbConnection)\n{\n\t$query=\"SELECT vehicle.vehicle_id,vehicle.vehicle_name FROM vehicle INNER JOIN \".\n \" vehicle_grouping USE INDEX(vg_accountid_status) ON vehicle_grouping.vehicle_id = vehicle.vehicle_id\".\n \" AND vehicle_grouping.account_id='$account_id' AND vehicle.status='1' \";\n \t$result=mysql_query($query,$DbConnection);\t\n\twhile($row=mysql_fetch_object($result))\n\t{\t\t\n\t\t/*$vehicle_id=$row->vehicle_id;\t\n\t\t$vehicle_name=$row->vehicle_name;*/\n\t\t$data[]=array('vehicle_id'=>$row->vehicle_id,'vehicle_name'=>$row->vehicle_name);\t\n\t}\n\treturn $data;\t\n\t\n}", "abstract protected function construct_assigned_table($uniqid = null);", "function tabla02($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"1\\\">\";\n\tforeach( $array01 as $key => $value){\n\t\tif ( $key == 'id' or $key == 'ID' or $key == 'Id'){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td> - </td></tr>\\n\";\n\t\t} else{\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n}", "function buildVehiclesSelect($vehicles) {\r\n $prodList = '<select name=\"invId\" id=\"invId\">';\r\n $prodList .= \"<option>Choose a Vehicle</option>\";\r\n foreach ($vehicles as $vehicle) {\r\n $prodList .= \"<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>\";\r\n }\r\n $prodList .= '</select>';\r\n return $prodList;\r\n }", "private function createDummyTable() {}", "function buildVehiclesSelect($vehicles)\n{\n $prodList = '<select name=\"invId\" id=\"invId\">';\n $prodList .= \"<option>Choose a Vehicle</option>\";\n foreach ($vehicles as $vehicle) {\n $prodList .= \"<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>\";\n }\n $prodList .= '</select>';\n return $prodList;\n}", "public function createSequencerTable();", "public function getTABLENAMEById($id)\n {\n \t$id = (int) $id;\n \t$query = $this->getBdd()->prepare('SELECT * FROM TABLENAME WHERE id = :id');\n \t$query->bindValue('id', $id, PDO::PARAM_INT);\n \t$query->execute();\n }", "public function vehicles()\n {\n return $this->belongsToMany('App\\Vehicle');\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 }", "public function getTable($_idCicloContable){\n\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t$result = $this->_db->query(\"SELECT cc.idCicloContable, cc.gestion_ccontable, cc.obs_ccontable, cc.Empresa_idEmpresa, lb.idLibroDiario, lb.Comprobante_idComprobante, ing.idIngreso, ing.Comprobante_idComprobante, lv.idLventas, lv.fecha_factv, lv.nro_factv, lv.nro_autorizacionv, lv.cod_controlv, lv.importe_factv, lv.importe_ICEv, lv.importe_excentov, lv.importe_netov, lv.df, lv.Ingreso_idIngreso, lv.Cliente_idCliente, lv.Ingreso_idIngreso FROM ciclocontable cc, librodiario lb, ingreso ing, lventas lv WHERE cc.idCicloContable = lb.CicloContable_idCicloContable and ing.Comprobante_idComprobante = lb.Comprobante_idComprobante and lv.Ingreso_idIngreso = ing.idIngreso and cc.idCicloContable = '\".$_idCicloContable.\"' and lv.show_by = '1'\");\n\n\t\t\t$retorna = $result->fetch_all(MYSQL_ASSOC);\n\n\n\t\t\t//recorremos el array $retorna\n\t\t\tforeach ($retorna as $key => $value) {\n\n\t\t\t\t//buesqueda del proveedor\n\t\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t\t$result = $this->_db->query(\"SELECT * FROM cliente WHERE show_by= '1' and \tidCliente = '\".$value['Cliente_idCliente'].\"'\");\n\t\t\t\t$retorna_proveedor = $result->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t//creamos fecha con vector $fecha_lcompras\n\t\t\t\t$fecha_lcompras = explode(\"-\", $value['fecha_factv']);\n\n\t\t\t\t//formar el arrray delibro compras para la interfaz\n\t\t\t\t$outp[] = array('id'=> $value['idLventas'],\n\t\t\t\t\t\t\t\t'd'=> $fecha_lcompras[2],\n\t\t\t\t\t\t\t\t'm'=>$fecha_lcompras[1],\n\t\t\t\t\t\t\t\t'a'=>$fecha_lcompras[0],\n\t\t\t\t\t\t\t\t'cod_fuente'=>$retorna_proveedor[0]['cod_cliente'],\n\t\t\t\t\t\t\t\t'nom_fuente'=>$retorna_proveedor[0]['nom_cliente'],\n\t\t\t\t\t\t\t\t'nro_factura'=>$value['nro_factv'],\n\t\t\t\t\t\t\t\t'nro_autorizacion'=>$value['nro_autorizacionv'],\n\t\t\t\t\t\t\t\t'cod_control'=>$value['cod_controlv'],\n\t\t\t\t\t\t\t\t'total_factura'=>$value['importe_factv'],\n\t\t\t\t\t\t\t\t'total_ice'=>$value['importe_ICEv'],\n\t\t\t\t\t\t\t\t'total_exento'=>$value['importe_excentov'],\n\t\t\t\t\t\t\t\t'importe_neto'=>$value['importe_netov'],\n\t\t\t\t\t\t\t\t'fiscal'=> $value['df']);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t$result->close();\n\t\t}", "function __construct($id)\n\t{\n\t\t$this->sql= new Sql;\n\t\t\n\t\t$this->recht_ID = $id;\n\t\t$call = \"Select * From tb_recht Where Recht_ID = '$id'\";\n\t\t$call = $this->sql->call($call);\n\t\t\n\t\t$this->recht_ID = $call['Recht_ID'];\n\t\t$this->rechtName = $call['RechtName'];\n\t\t$this->anzahlStunden = $call['AnzahlStunden'];\n\t\t$this->anzahlPlaetze = $call['AnzahlPlaetze'];\n\t\t$this->anzahlReservierungen = $call['AnzahlReservierungen'];\n\t\t$this->tageVoraus = $call['TageVoraus'];\n\t\t$this->reservierungLoeschen = $call['ReservierungLoeschen'];\n\t\t$this->reservierungVerschieben = $call['ReservierungVerschieben'];\n\t\t$this->benutzerVerwalten = $call['BenutzerVerwalten'];\n\t\t$this->rechteVerteilen = $call['RechteVerteilen'];\n\t\t$this->platzVerwalten = $call['PlatzVerwalten'];\n\t\t$this->saisonFestlegen = $call['SaisonFestlegen'];\n\t\t$this->serienReservieren = $call['SerienReservieren'];\n\t\t$this->farbeFestlegen = $call['FarbeFestlegen'];\n\t\t\n\t}", "public function run()\n {\n VehicleType::create([\n 'nom' => 'BRP',\n 'descripcio' => 'Bomba Rural Pesant',\n 'codi' => '30-33'\n ]);\n VehicleType::create([\n 'nom' => 'BFP',\n 'descripcio' => 'Bomba Forestal Pesant',\n 'codi' => '34-37'\n ]);\n VehicleType::create([\n 'nom' => 'BFL / BRL',\n 'descripcio' => 'Bomba Forestal-Rural Lleugera',\n 'codi' => '38-39'\n ]);\n VehicleType::create([\n 'nom' => 'BUP',\n 'descripcio' => 'Bomba Urbana Pesant',\n 'codi' => '40-43'\n ]);\n VehicleType::create([\n 'nom' => 'BNP',\n 'descripcio' => 'Bomba Nodrissa Pesant',\n 'codi' => '44-47'\n ]);\n VehicleType::create([\n 'nom' => 'BUL',\n 'descripcio' => 'Bomba Urbana Lleugera',\n 'codi' => '48-49'\n ]);\n VehicleType::create([\n 'nom' => 'FSV',\n 'descripcio' => 'Salvaments Varis',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRQ',\n 'descripcio' => 'Risc Químic',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FER',\n 'descripcio' => 'Equips Respiratoris',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRM',\n 'descripcio' => 'Rescats de Muntanya',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FRA',\n 'descripcio' => 'Rescats Aquàtics',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'FSA',\n 'descripcio' => 'Salvaments Apícoles',\n 'codi' => '50-55'\n ]);\n VehicleType::create([\n 'nom' => 'BSAL',\n 'descripcio' => 'Barques de Salvaments',\n 'codi' => '56-59'\n ]);\n VehicleType::create([\n 'nom' => 'AEA / AES / ABA',\n 'descripcio' => 'Autoescales',\n 'codi' => '60-61'\n ]);\n VehicleType::create([\n 'nom' => 'AMB',\n 'descripcio' => 'Ambulàncies',\n 'codi' => '62-69'\n ]);\n VehicleType::create([\n 'nom' => 'CCA / UPT',\n 'descripcio' => 'Unitat de Suport al Comandament',\n 'codi' => '70-71'\n ]);\n VehicleType::create([\n 'nom' => 'UTP',\n 'descripcio' => 'Vehicle de Transport de Personal',\n 'codi' => '72-73'\n ]);\n VehicleType::create([\n 'nom' => 'UCA',\n 'descripcio' => 'Vehicle de Càrrega',\n 'codi' => '74-77'\n ]);\n VehicleType::create([\n 'nom' => 'UE',\n 'descripcio' => 'Vehicles Especials',\n 'codi' => '78-79'\n ]);\n VehicleType::create([\n 'nom' => 'UPCL',\n 'descripcio' => 'Unitats de Personal i Càrrega Lleugeres',\n 'codi' => '80-89'\n ]);\n VehicleType::create([\n 'nom' => 'USL',\n 'descripcio' => 'Unitat de Suport Logístic',\n 'codi' => '80-89'\n ]);\n VehicleType::create([\n 'nom' => 'UPC',\n 'descripcio' => 'Unitats de Personal i Càrrega',\n 'codi' => '90-99'\n ]);\n }", "function createTimetable(mysqli $mysqli, string $id, $table) {\n\n // Bereite SQL-Query vor.\n $sqlCreate = '\n CREATE TABLE Stundenplan_' . $mysqli->real_escape_string($id) . ' (\n Tag VARCHAR(10) NOT NULL,\n Stunde INT NOT NULL,\n Fach_Id INT NOT NULL,\n Lehrer_Id INT NOT NULL,\n Raum_Id INT NOT NULL,\n PRIMARY KEY (Tag, Stunde),\n FOREIGN KEY (Fach_Id) REFERENCES Fach(Id),\n FOREIGN KEY (Lehrer_Id) REFERENCES Lehrer(Id),\n FOREIGN KEY (Raum_Id) REFERENCES Raum(Id)\n );';\n \n $stmt = $mysqli->prepare($sqlCreate);\n\n // Query ausführen.\n if($stmt === FALSE || $stmt->execute() === FALSE) {\n\n // Stundenplan konnte nicht erstellt werden. Leite auf Übersichtsseite weiter.\n $_SESSION['process_status'] = 'Der Stundenplan der Klasse ' . $id . \n ' konnte nicht erstellt werden! (Fehler: SQL-CREATE)';\n header('Location: /timetables/');\n exit();\n }\n\n // Tabelle ausfüllen.\n foreach($table as $row) {\n $sql = 'INSERT INTO Stundenplan_' . $mysqli->real_escape_string($id) .\n ' (Tag, Stunde, Fach_Id, Lehrer_Id, Raum_Id) VALUES (\n \"' . $mysqli->real_escape_string($row['Tag']) . '\", \n \"' . $mysqli->real_escape_string($row['Stunde']) . '\", \n \"' . $mysqli->real_escape_string($row['Fach_Id']) . '\", \n \"' . $mysqli->real_escape_string($row['Lehrer_Id']) . '\", \n \"' . $mysqli->real_escape_string($row['Raum_Id']) . '\"\n );';\n\n $stmt = $mysqli->prepare($sql);\n\n // Query ausführen.\n if($stmt === FALSE || $stmt->execute() === FALSE) {\n\n // Stundenplan konnte nicht erstellt werden. Leite auf Übersichtsseite weiter.\n $_SESSION['process_status'] = 'Der Stundenplan der Klasse ' . $id . \n ' konnte nicht erstellt werden! (Fehler: SQL-INSERT)';\n header('Location: /timetables/');\n exit();\n }\n }\n\n // Stundenplan konnte erfolgreich gespeichert werden.\n $_SESSION['process_status'] = 'Der Stundenplan der Klasse ' . $id . ' \n wurde erfolgreich angelegt!';\n header('Location: /timetables/');\n exit();\n }", "public function ajax_vehicle_data() {\n $user_id = Session::get('user_id');\n $rows = DB::table('vehicles')\n ->select(DB::raw('id, plate_number, registration_number, owner_name, owner_email, owner_phone, created_at'))\n ->where('client_id', '=', $user_id)\n ->whereNull('deleted_at');\n \n\n return Datatables::of($rows)\n ->add_column('action', '<a href=\"'.url('vehicle/renewal_request').'/{{ $id }}\">Request a Renewal</a>')\n ->make(true);\n }", "function tableVolby($conn ,$selected_val){\n $sql = \"SELECT strany.nazov as nazov, strany.skratka as skratka, vysledky.kresla as kresla, \n vysledky.koalicia as koalicia\n FROM strany, vysledky, volby WHERE ((strany.id = vysledky.id_strany) \n AND (vysledky.id_volby = volby.id))\n AND(volby.den1 = '$selected_val')\";\n $result = $conn->query($sql);\n\n if ($result->num_rows > 0) {\n echo \"<table id='myTable'>\";\n echo \" \n <tr class=\\\"header\\\">\n <th onclick>Nazov</th> \n <th onclick>Skratka</th> \n <th onclick>Kresla</th>\n <th onclick>Koalicia</th>\n </tr>\";\n // output data of each row\n while($row = $result->fetch_assoc()) {\n writeTableLine2($row);\n }\n echo \"</table><br>\";\n }\n// else {\n// echo \"0 results\";\n// }\n $result->free();\n}", "public function vehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 1)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "function makeEndPeriodTable()\n{\n global $db;\n\n //id poslednych volieb\n $id_volbyMax = $db->query(\"SELECT MAX(id_volby) as maxID FROM vlady;\")->fetch(PDO::FETCH_ASSOC)[maxID];\n\n //posledne 2 datumy volieb => volebne obdobie od-do\n $lastDates = getLastDates();\n\n //posledne volebne obdobie\n $lastPeriod = getPeriod($lastDates);\n $newPeriod = explode(' - ',$lastPeriod)[1] . \" +\";\n\n //vyber vlad v poslednom volebnom obdobi\n $query = \"SELECT\n vlady.datumOD, vlady.datumDO,vlady.id_volby\n FROM vlady \n INNER JOIN volby ON vlady.id_volby = volby.id\n WHERE vlady.id_volby in ({$id_volbyMax},{$id_volbyMax}-1)\";\n\n $stmt = $db->query($query);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n echo \"<h2>Vlády v posledných volebných obdobiach: </h2>\n <table id='table_id' class='display' style='width:60%'>\n <thead>\n <tr>\n <th>Obdobie</th>\n <th>Od</th>\n <th>Do</th>\n </tr>\n <tr id='filters'>\n <th>Obdobie</th>\n <th>Od</th>\n <th>Do</th>\n </tr>\n </thead>\n <tbody>\";\n\n foreach ($results as $result) {\n\n echo \"<tr class='table-item'>\";\n if ($result['id_volby'] == $id_volbyMax){\n echo \"<td>{$newPeriod}</td>\";\n }\n else {\n echo \"<td>{$lastPeriod}</td>\";\n }\n echo \"<td>{$result['datumOD']}</td>\";\n echo \"<td>{$result['datumDO']}</td>\";\n echo \"</tr>\";\n }\n\n echo \"</tbody></table>\";\n}", "function make_table($matches,$teams,$last_schedule){\n\t\t\n\t\t$table=array();\n\n\t\tforeach($teams as $row){\n\t\t\t$table[$row->id]=array('id'=>$row->id,'name'=>$row->name,'section'=>$row->section);\n\t\t\t$table[$row->id]['points']=0;\n \t\t$table[$row->id]['pj']=0;\n \t\t$table[$row->id]['pg']=0;\n \t\t$table[$row->id]['pe']=0;\n \t\t$table[$row->id]['pp']=0;\n \t\t$table[$row->id]['gf']=0;\n \t\t$table[$row->id]['gc']=0;\n \t\t$table[$row->id]['gd']=0;\n \t\t$table[$row->id]['change']=1;\n \t\t$table[$row->id]['updown']=0;\n\t\t}\n\t\t$table_ant=$table;\n\t\n\t\tforeach($matches as $row){\n\t\t\t$home=false;\n\t\t\t$away=false;\n\t\t\t$result=trim($row->result);\n \t\t$h=(int)trim(substr($result,0,1));\n \t\t$a=(int)trim(substr($result,3));\n\t\t\t\n \t\tif(isset($table[$row->home])){\n \t\t\t$table[$row->home]['pj']+=1;\n\t\t\t\t$home=true;\n\t\t\t\tif($row->schedule_id!=$last_schedule)\n\t\t\t\t\t$table_ant[$row->home]['pj']+=1;\n\t\t\t}\n \t\tif(isset($table[$row->away])){\n \t\t\t$table[$row->away]['pj']+=1;\n \t\t\t$away=true;\n \t\t\tif($row->schedule_id!=$last_schedule)\n\t\t\t\t\t$table_ant[$row->away]['pj']+=1;\n \t\t}\n \t\t\n \t\t//Si el equipo local gana\n \t\tif($h>$a){\n \t\t\tif($home){\n\t\t\t\t\t$table[$row->home]['points']+=3;\n\t\t\t\t\t$table[$row->home]['pg']+=1;\n\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t$table[$row->home]['gd']+=$h-$a;\n\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t$table_ant[$row->home]['points']+=3;\n\t\t\t\t\t\t$table_ant[$row->home]['pg']+=1;\n\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t$table_ant[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\tif($away){\n\t\t\t\t\t$table[$row->away]['pp']+=1;\n\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t\t\t\t\t$table[$row->away]['gd']+=$a-$h;\n \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t$table_ant[$row->away]['pp']+=1;\n\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t$table_ant[$row->away]['gd']+=$a-$h;\n\t\t\t\t\t}\n \t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Si Empatan\n\t\t\t\tif($h==$a){\n\t\t\t\t\tif($home){\n\t\t\t\t\t\t$table[$row->home]['points']+=1;\n\t\t\t\t\t\t$table[$row->home]['pe']+=1;\n\t\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t\t$table_ant[$row->home]['points']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['pe']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif($away){\n\t \t\t\t\t$table[$row->away]['points']+=1;\n\t\t\t\t\t\t$table[$row->away]['pe']+=1;\n\t\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t \t\t\t\t\t$table_ant[$row->away]['points']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['pe']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t\t\t\t}\n\t\t\t\t//Si el Equipo visitante gana\n\t\t\t\telse{\n\t\t\t\t\tif($home){\n\t\t\t\t\t\t$table[$row->home]['pp']+=1;\n\t\t\t\t\t\t$table[$row->home]['gf']+=$h;\n\t\t\t\t\t\t$table[$row->home]['gc']+=$a;\n\t\t\t\t\t\t$table[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t\tif($row->schedule_id!=$last_schedule){\n\t\t\t\t\t\t\t$table_ant[$row->home]['pp']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gf']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gc']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->home]['gd']+=$h-$a;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif($away){\n\t \t\t\t\t$table[$row->away]['points']+=3;\n\t\t\t\t\t\t$table[$row->away]['pg']+=1;\n\t\t\t\t\t\t$table[$row->away]['gf']+=$a;\n\t\t\t\t\t\t$table[$row->away]['gc']+=$h;\n\t\t\t\t\t\t$table[$row->away]['gd']+=$a-$h;\n\t \t\t\t\tif($row->schedule_id!=$last_schedule){\n\t \t\t\t\t\t$table_ant[$row->away]['points']+=3;\n\t\t\t\t\t\t\t$table_ant[$row->away]['pg']+=1;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gf']+=$a;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gc']+=$h;\n\t\t\t\t\t\t\t$table_ant[$row->away]['gd']+=$a-$h;\n\t\t\t\t\t\t}\n\t \t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Ordeno las dos tablas generadas\n\t\tforeach ($table as $key=>$arr):\n\t\t\t$pun[$key] = $arr['points'];\n\t\t\t$g1[$key] = $arr['gd'];\n\t\t\t$g2[$key] = $arr['gf'];\n\t\t\t$g3[$key] = $arr['gc'];\t\n\t\tendforeach;\n\t\t\t\n\t\tarray_multisort($pun,SORT_DESC,$g1,SORT_DESC,$g2,SORT_DESC,$g3,SORT_ASC,$table);\n\t\t\n\t\t$pun=$g1=$g2=$g3=array();\n\t\tforeach ($table_ant as $key=>$arr):\n\t\t\t$pun[$key] = $arr['points'];\n\t\t\t$g1[$key] = $arr['gd'];\n\t\t\t$g2[$key] = $arr['gf'];\n\t\t\t$g3[$key] = $arr['gc'];\t\n\t\tendforeach;\n\t\t\t\t\n\t\tarray_multisort($pun,SORT_DESC,$g1,SORT_DESC,$g2,SORT_DESC,$g3,SORT_ASC,$table_ant);\n\t\t\n\t\t//Reviso posiciones con la ultima fecha y cuanto se han movido\n\t\tforeach($table as $key=>$row){\n\t\t\tforeach($table_ant as $key2=>$row2){\n\t\t\t\tif($row['id']==$row2['id']){\n\t\t\t\t\tif($key>$key2){\n\t\t\t\t\t\t$table[$key]['change']=2;\n\t\t\t\t\t\t$table[$key]['updown']=abs($key-$key2);\n\t\t\t\t\t}\n\t\t\t\t\tif($key<$key2){\n\t\t\t\t\t\t$table[$key]['change']=0;\n\t\t\t\t\t\t$table[$key]['updown']=abs($key-$key2);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $table;\n\t}", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "public function getDatatable($id)\n {\n //DB::raw('CONCAT(u2.last_name,\", \",u2.first_name,\" / \",grade_desc) as teacher_name_grade'),\n /*\n select los_orders.id as DT_RowId,CONCAT(u1.last_name,\", \",u1.first_name) as name, short_desc,total_price,grade_desc,\n u1.teacher_id as teacher_id,status_code,notes,status_code as status_code_int,los_orders.user_id\n from los_orders\n inner join los_users as u1 on u1.id = los_orders.user_id\n inner join los_gradelevels as gl on gl.id = u1.grade_id\n where lunchdate_id = 48\n */\n return $this->query()\n ->select('los_orders.id', 'last_name', 'first_name', 'short_desc',\n 'total_price', 'grade_desc', 'status_code', 'los_orders.user_id', 'u.grade_id')\n ->join('los_users as u', 'u.id', '=', 'los_orders.user_id')\n ->join('los_gradelevels as gl', 'gl.id', '=', 'u.grade_id')\n ->where('lunchdate_id', $id)\n ->orderBy('last_name')\n ->orderBy('first_name');\n }", "public function obtenerVideojuegosID($id)\n {\n $rows = DAOVideojuegos::getInstance()->obtenerVideojuego($id);\n foreach ($rows as $document) {\n $videojuego = json_decode(json_encode($document), true);\n $this->id = $id;\n $this->nombre = $videojuego[\"nombre\"];\n $this->plataforma = $videojuego[\"plataforma\"];\n $this->genero = $videojuego[\"genero\"];\n $this->fecha = $videojuego[\"fecha\"];\n if ($videojuego[\"imagen\"] != \"\")\n $this->imagen = $this->carpeta . $videojuego[\"imagen\"];\n else\n $this->imagen = $this->carpeta .\"default.jpg\";\n $this->valoracion = $videojuego[\"valoracion\"];\n $this->comentario = $videojuego[\"comentario\"];\n }\n }", "function select_vehicle_data($cid)\n\t{\n\t\tglobal $db;\n\t\t//Select All Vehicle Information\n\t \t$sql = \"SELECT g.*, images.*, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle, count(mods.id) AS total_mods, ( SUM(mods.price) + SUM(mods.install_price) ) AS total_spent, user.username, user.user_avatar_type, user.user_allowavatar, user.user_avatar, user.user_id\n \tFROM \" . GARAGE_TABLE . \" AS g \n\t\t\t\tLEFT JOIN \" . USERS_TABLE .\" AS user ON g.member_id = user.user_id\n\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \t LEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n\t\t\t\tLEFT JOIN \" . GARAGE_MODS_TABLE . \" AS mods ON g.id = mods.garage_id\n\t\t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = g.image_id\n \tWHERE g.id = $cid\n\t GROUP BY g.id\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Get Vehicle Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "protected function getSubTable(){\n return $this->buildArrayData( Company::orderBy('id', 'asc')->get());\n }", "public function run()\n {\n DB::table('vehicle')->insert([\n 'model' => 'KA 1.0 Ti-Vct Flex Se Manual',\n 'yearmodel' => 2018 ,\n 'yearmanufacture' => 2019,\n 'type' => 'used',\n 'brand_id'=> 3,\n 'color_id' => 1,\n 'price' => 46890.00,\n 'photo' => 'fordka.jpg',\n 'user_id' => 1,\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 54.286, Travas elétricas, Ar condicionado, Volante com regulagem de altura'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Tracker 1.0 Turbo Flex Lt Automático',\n 'yearmodel' => 2020 ,\n 'yearmanufacture' => 2021,\n 'type' => 'used',\n 'brand_id'=> 2,\n 'color_id' => 3,\n 'price' => 106290.00,\n 'user_id' => 2,\n 'photo' => 'chevrolet.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 6.781, Ar condicionado, Alarme, Controle de tração, DVD Player'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Argo 1.0 Firefly Flex Drive Manual',\n 'yearmodel' => 2020 ,\n 'yearmanufacture' => 2020,\n 'brand_id'=> 11,\n 'type' => 'used',\n 'color_id' => 5,\n 'price' => 46890.00,\n 'user_id' => 3,\n 'photo' => 'fiat.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 46.555, Alarme, Desembaçador traseiro, Ar quente, Vidros elétricos'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'Sentra 2.0 Sv 16v Flex 4p Automático',\n 'yearmodel' => 2013,\n 'yearmanufacture' => 2013,\n 'brand_id'=> 6,\n 'type' => 'used',\n 'color_id' => 6,\n 'price' => 46390.00,\n 'user_id' => 3,\n 'photo' => 'nissan-sentra.jpg',\n 'optionals' => 'Combustível : flex, Licenciado, Km rodados : 96.836, Alarme, Retrovisores elétricos, Ar quente, Vidros elétricos, Sensor de estacionamento'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'QQ 1.0 Look Flex 5p',\n 'yearmodel' => 2018,\n 'yearmanufacture' => 2018,\n 'brand_id'=> 12,\n 'type' => 'new',\n 'color_id' => 6,\n 'price' => 29990.00,\n 'user_id' => 1,\n 'photo' => 'Cherry.png',\n 'optionals' => 'Combustível : Gasolina e Álcool, Licenciado, Km rodados : 42.000 , Alarme, 5 portas, Transmissão Manual'\n ]);\n DB::table('vehicle')->insert([\n 'model' => 'HB20 1.0 Comfort Plus 12v Flex 4p Manual',\n 'yearmodel' => 2019,\n 'yearmanufacture' => 2018,\n 'brand_id'=> 5,\n 'type' => 'used',\n 'color_id' => 4,\n 'price' => 53390.00,\n 'user_id' => 1,\n 'photo' => 'hb20.jpg',\n 'optionals' => 'Combustível: Flex, Licenciado, Km rodados: 41.490, Encosto de Cabeça Traseiro, Computador a bordo, Câmbio Manual'\n ]);\n }", "public function getVehicle($vehicle_id) {\n $stmt = $this->conn->prepare(\"SELECT vehicle_id, driver_id, type, license_plate,\n license_plate_img, vehicle_img, status, created_at\n FROM vehicle WHERE vehicle_id = ?\");\n\n $stmt->bind_param(\"i\", $vehicle_id);\n\n if ($stmt->execute()) {\n // $user = $stmt->get_result()->fetch_assoc();\n $stmt->bind_result($vehicle_id, $driver_id, $type, $license_plate, $license_plate_img, $vehicle_img, $status, $created_at);\n $stmt->fetch();\n $vehicle = array();\n $vehicle[\"vehicle_id\"] = $vehicle_id;\n $vehicle[\"driver_id\"] = $driver_id;\n $vehicle[\"type\"] = $type;\n $vehicle[\"license_plate\"] = $license_plate;\n $vehicle[\"license_plate_img\"] = $license_plate_img;\n $vehicle[\"vehicle_img\"] = $vehicle_img;\n $vehicle[\"status\"] = $status;\n $vehicle[\"created_at\"] = $created_at;\n $stmt->close();\n return $vehicle;\n } else {\n return NULL;\n }\n }", "public function show($id)\n {\n $vehicle = $this->swapi->getVehicles($id);\n return response($vehicle);\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "function getVehicles(){\n\t$db = phpmotorsConnect();\n\t$sql = 'SELECT invId, invMake, invModel FROM inventory';\n\t$stmt = $db->prepare($sql);\n\t$stmt->execute();\n\t$invInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t$stmt->closeCursor();\n\treturn $invInfo;\n}", "public function createAjaxCostTable($svc_id) {\n\t\tif(isset($_SESSION['profit_dlr_id']) && isset($_SESSION['profit_date'])) {\n\t\t\t// Run query of cost_avg_data table for ajax response\n\t\t\t$sql = \"SELECT a.svc_id, c.svc_name, a.cost_id, a.cost_desc, a.cost_code, a.cost_ro_count, a.cost_parts_sale, a.cost_parts_cost, a.cost_labor_sale\n\t\t\t\t FROM cost_avg_data a\n\t\t\t\t LEFT JOIN dealers b ON (b.dealer_record_id = a.dealer_record_id)\n\t\t\t\t LEFT JOIN services c ON (c.svc_id = a.svc_id)\n\t\t\t\t WHERE a.dealer_record_id = :dealer_record_id\n\t\t\t\t AND a.record_date = :record_date\n\t\t\t\t\tAND a.svc_id = :svc_id\n\t\t\t\t\tORDER BY a.cost_id\";\n\t\t\ttry {\n\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t$stmt->bindParam(\":dealer_record_id\", $_SESSION['profit_dlr_id'], PDO::PARAM_INT);\n\t\t\t\t$stmt->bindParam(\":record_date\", $_SESSION['profit_date'], PDO::PARAM_STR);\n\t\t\t\t$stmt->bindParam(\":svc_id\", $svc_id, PDO::PARAM_INT);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$cost_ajax_table = $stmt->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\t$stmt->closeCursor();\n\t\t\t} catch (Exception $e) {\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\t\t\t\n\t\t\t// Build table from results\n\t\t\t$cost_table_array = array();\n\t\t\tforeach ($cost_ajax_table as $table) {\n\t\t\t\t$cost_table_array[$table['svc_name']][] = $table;\n\t\t\t}\n\t\t}\n\t\treturn $cost_table_array;\n\t}", "function makeTable($netid, $pass) {\r\n $dataJSON = getOwlspaceData($netid,$pass, 1);\r\n\r\n $returnString = \"\";\r\n\r\n $data = json_decode($dataJSON, true);\r\n\r\n $keys = array_keys($data);\r\n\r\n echo '<table class=\"table\">';\r\n // go through and make table\r\n foreach (array_keys($data) as $index => $classKey) {\r\n foreach (array_keys($data[$classKey]) as $index => $assignmentKey) {\r\n echo '<tr>';\r\n echo '<td>', $classKey, '</td>';\r\n echo '<td>', $assignmentKey, '</td>';\r\n echo '<td>', $data[$classKey][$assignmentKey], '</td>';\r\n echo '</tr>';\r\n }\r\n }\r\n echo '</table>';\r\n\r\n \r\n }", "function trip_list_tbl() {\n\n global $wpdb;\n\n\n\n $table_name = $wpdb->prefix.'tb_trips_tbl';\n\n\n\n $charset_collate = $wpdb->get_charset_collate();\n\n\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n\n id int(11) NOT NULL AUTO_INCREMENT,\n\n crm_id text DEFAULT NULL,\n\n \n\n Trip_Name text DEFAULT NULL,\n\n Trip_Location text DEFAULT NULL,\n\n Trip_Detail_Url text DEFAULT NULL,\n\n Trip_Image_Url text DEFAULT NULL,\n\n Trip_Description text DEFAULT NULL,\n\n\n\n Trip_Start_Date date DEFAULT NULL,\n\n Trip_End_Date date DEFAULT NULL,\n\n Total_Number_of_Seat text DEFAULT NULL,\n\n Trip_Total_Price text DEFAULT NULL,\n\n Trip_Single_Room_Price text DEFAULT NULL,\n\n Trip_Single_Room_Total_Price text DEFAULT NULL,\n\n Tier_2_Date text DEFAULT NULL,\n\n Tier_2_Increase_Amount text DEFAULT NULL,\n\n Tier_3_Date text DEFAULT NULL,\n\n Tier_3_Increase_Amount text DEFAULT NULL,\n\n Trip_Deposit_Amount text DEFAULT NULL,\n\n Payment_Due_Date date DEFAULT NULL,\n\n Seat_Booked text DEFAULT NULL,\n\n Trip_Included text DEFAULT NULL,\n Show_Trip_Included text DEFAULT NULL,\n\n Trip_Promo_Code text DEFAULT NULL,\n\n\n\n Trip_2_Start_Date date DEFAULT NULL,\n\n Trip_2_End_Date date DEFAULT NULL,\n\n Trip_2_Total_Number_of_Seat text DEFAULT NULL,\n\n Trip_2_Total_Price text DEFAULT NULL,\n\n Trip_2_Single_Room_Price text DEFAULT NULL,\n\n Trip_2_Single_Room_Total_Price text DEFAULT NULL,\n\n Trip_2_Tier_2_Date text DEFAULT NULL,\n\n Trip_2_Tier_2_Increase_Amount text DEFAULT NULL,\n\n Trip_2_Tier_3_Date text DEFAULT NULL,\n\n Trip_2_Tier_3_Increase_Amount text DEFAULT NULL,\n\n Trip_2_Deposit_Amount text DEFAULT NULL,\n\n Trip_2_Payment_Due_Date date DEFAULT NULL,\n\n Trip_2_Seat_Booked text DEFAULT NULL,\n\n Trip_2_Included text DEFAULT NULL,\n\n\n\n zoho_data mediumtext DEFAULT NULL,\n\n created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\n updated_at timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\n PRIMARY KEY (id)\n\n ) $charset_collate;\";\n\n\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n dbDelta( $sql );\n\n\n\n }", "public function vehicles()\n {\n return $this->belongsToMany('ScreenTec\\Models\\Vehicle')->withTimestamps();\n }", "function showGerenciaTable($id = null)\r\n\t{\r\n\t\t$dataManagements = $this->Management->find('all',array('conditions' => array('Management.id' => $id)));\r\n\t\t\r\n\t\t$table;\r\n\t\t\r\n\t\tforeach ($dataManagements as $dataManagement)\r\n\t\t{\r\n\t\t\t$table = \"<table>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Gerencia :</th>\r\n\t\t\t\t\t\t<td>\".$dataManagement['Management']['management_name'].\"</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Gerente :</th>\r\n\t\t\t\t\t\t<td>\".$dataManagement['User']['name'].\" \".$dataManagement['User']['first_lastname'].\"</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Tipo autorización :</th>\r\n\t\t\t\t\t\t<td>\".$dataManagement['Authorization']['name'].\"</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\";\r\n\t\t\t\tif($this->Auth->user('admin') == 1)\r\n\t\t\t\t\t$table .=\"<a href='/michilevision/managements/view/\".$dataManagement['Management']['id'].\"' class='link_admin tip_tip link_zoom'>Ver ficha gerencia</a>\";\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\treturn $table;\r\n\t}", "function print_Vehicles(){\n $result = $this->query(\"SELECT * FROM VEHICLES\");\n while($row = mysqli_fetch_array($result)) {\n echo $row['TAG'] . \" \" . $row['MODEL'] . \" \" . $row['EMPLOYEE'];\n echo \"<br>\";\n }\n \n $result->close();\n }", "function build_table_db() {\n\t\n\t// Connect to Define\n\tglobal $sql_user, $sql_pass, $sql_db, $sql_year;\n\t$link = @mysql_connect('localhost', $sql_user, $sql_pass)\n\t\tor die('Could not connect: ' . mysql_error());\n\tmysql_select_db($sql_db)\n\t\tor die('Could not select database');\n\t\t\n\t// Query DB for team information\t\n\t$query_teams = sprintf(\"SELECT year.team_name, year.tourn_id, year.opp_id, year.team_seed, year.team_region, info.team_logo, info.team_color \n\t\t\t\t\t\t\tFROM team_%s year \n\t\t\t\t\t\t\tINNER JOIN team_info info \n\t\t\t\t\t\t\tON info.team_id = year.team_id\",\n\t\t\t\t\t\t\t$sql_year);\n\t$result = mysql_query($query_teams);\n\t\n\t// Check result\n\tif (!$result) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message = 'Whole query: ' . $query_teams;\n\t\tdie($message); \n\t}\n\t\n\t// Use result\n\twhile($row = mysql_fetch_assoc($result)) {\n\t\t$team = $row['team_name'];\n\t\t$key = $row['tourn_id'];\n\t\t$o_id = $row['opp_id'];\n\t\t$seed = $row['team_seed'];\n\t\t$region = $row['team_region'];\n\t\t$image = $row['team_logo'];\n\t\t$color = $row['team_color'];\n\t\t\n\t\t// Form arrays\n\t\t$team_array[$key] = $team;\n\t\t$o_id_array[$key] = $o_id;\n\t\t$seed_array[$key] = $seed;\n\t\t$region_array[$key] = $region;\n\t\t$image_array[$key] = $image;\n\t\t$color_array[$key] = $color;\n\t}\n\t// Free result\t\n\tmysql_free_result($result);\n\t\n\t// Fill initial bids based on seed\n\tforeach ($seed_array as $key => $value) {\n\t\tif ($value == 1 || $value == 2) {\n\t\t\t$ibid_array[$key] = \"20\";\n\t\t} elseif ($value == 3 || $value == 4) {\n\t\t\t$ibid_array[$key] = \"10\";\n\t\t} elseif ($value >= 5 && $value <= 8) {\n\t\t\t$ibid_array[$key] = \"5\";\n\t\t} elseif ($value >= 9 && $value <= 12) {\n\t\t\t$ibid_array[$key] = \"3\";\n\t\t} else {\n\t\t\t$ibid_array[$key] = \"1\";\n\t\t} // end if-else\n\t} // end foreach\n\n\t// Assemble teamInfo array\n\t$teamInfo = array(\"team\" => $team_array,\n\t\t\t\t\t \"region\" => $region_array,\n\t\t\t\t\t \"seed\" => $seed_array,\n\t\t\t\t\t \"image\" => $image_array,\n\t\t\t\t\t \"color\" => $color_array,\n\t\t\t\t\t \"initBid\" => $ibid_array,\n\t\t\t\t\t \"opp_key\" => $o_id_array);\n\t\t\t\t\t \n\t\n\t// Close connect\n\tmysql_query(\"unlock tables\");\n\tmysql_close();\n\t\n\treturn $teamInfo;\n}", "public function getTable($_idCicloContable){\n\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t$result = $this->_db->query(\"SELECT cc.idCicloContable, cc.gestion_ccontable, cc.obs_ccontable, cc.Empresa_idEmpresa, lb.idLibroDiario, lb.Comprobante_idComprobante, eg.idEgreso, eg.Comprobante_idComprobante, lc.idLcompras, lc.fecha_factc, lc.nro_factc, lc.nro_autorizacionc, lc.cod_controlc, lc.importe_factc, lc.importe_ICEc, lc.importe_excentoc, lc.importe_netoc, lc.cf, lc.Egreso_idEgreso, lc.Proveedor_idProveedor, lc.Egreso_idEgreso FROM ciclocontable cc, librodiario lb, egreso eg, lcompras lc WHERE cc.idCicloContable = lb.CicloContable_idCicloContable and eg.Comprobante_idComprobante = lb.Comprobante_idComprobante and lc.Egreso_idEgreso = eg.idEgreso and cc.idCicloContable = '\".$_idCicloContable.\"' and lc.show_by = '1'\");\n\t\t\t$retorna = $result->fetch_all(MYSQL_ASSOC);\n\n\n\t\t\t//recorremos el array $retorna\n\t\t\tforeach ($retorna as $key => $value) {\n\n\t\t\t\t//buesqueda del proveedor\n\t\t\t\t// creamos el array $retorna con los datos de la tabla lcompras\n\t\t\t\t$result = $this->_db->query(\"SELECT * FROM cliente WHERE show_by= '1' and \tidCliente = '\".$value['Proveedor_idProveedor'].\"'\");\n\t\t\t\t$retorna_proveedor = $result->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t//creamos fecha con vector $fecha_lcompras\n\t\t\t\t$fecha_lcompras = explode(\"-\", $value['fecha_factc']);\n\n\t\t\t\t//formar el arrray delibro compras para la interfaz\n\t\t\t\t$outp[] = array('id'=> $value['idLcompras'],\n\t\t\t\t\t\t\t\t'd'=> $fecha_lcompras[2],\n\t\t\t\t\t\t\t\t'm'=>$fecha_lcompras[1],\n\t\t\t\t\t\t\t\t'a'=>$fecha_lcompras[0],\n\t\t\t\t\t\t\t\t'cod_fuente'=>$retorna_proveedor[0]['cod_cliente'],\n\t\t\t\t\t\t\t\t'nom_fuente'=>$retorna_proveedor[0]['nom_cliente'],\n\t\t\t\t\t\t\t\t'nro_factura'=>$value['nro_factc'],\n\t\t\t\t\t\t\t\t'nro_autorizacion'=>$value['nro_autorizacionc'],\n\t\t\t\t\t\t\t\t'cod_control'=>$value['cod_controlc'],\n\t\t\t\t\t\t\t\t'total_factura'=>$value['importe_factc'],\n\t\t\t\t\t\t\t\t'total_ice'=>$value['importe_ICEc'],\n\t\t\t\t\t\t\t\t'total_exento'=>$value['importe_excentoc'],\n\t\t\t\t\t\t\t\t'importe_neto'=>$value['importe_netoc'],\n\t\t\t\t\t\t\t\t'fiscal'=> $value['cf']);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t$result->close();\n\t\t}", "private function __construct() { \n $this->movieData = $this->generateTable();\n\n }", "public function datatable()\n {\n $p = $this->getPermission('vehicleIn');\n $data = VehicleIn::with(['Vehicle', 'Department'])->get();\n if(isset($p))\n foreach($data as $d)\n $d['p'] = array('a'=>false && $p->u,'e'=>$p->u,'d'=>$p->d);\n return datatables()->of($data)->toJson();\n }", "function renderTripManagement()\r\n{\r\n $date = date(\"Y-m-d\");\r\n $table = \" <table border='0' class='table table-striped table-hover' id='TripTable'> <thead> <tr> <th scope='col'> Trip ID </th> <th scope='col'> Departure Date </th> <th scope='col'> Fee(RM) </th> <th scope='col'> Airline </th> <th scope='col'> Tour Code</th> <th scope='col'> Tour Name</th> <th scope='col'> Update </th> <th scope='col'> Delete </th> </tr> </thead><tbody> \";\r\n switch ($GLOBALS['position']) {\r\n case 'Manager':\r\n $whereClause = \"WHERE Tr.Departure_date>='$date'\";\r\n break;\r\n\r\n case 'Tour Manager of Europe':\r\n $whereClause = \"WHERE (Category ='Europe') AND (Tr.Departure_date >='$date')\";\r\n break;\r\n\r\n case 'Tour Manager of Asia':\r\n $whereClause = \"WHERE (Category ='Asia') AND (Tr.Departure_date >='$date')\";\r\n break;\r\n\r\n case 'Tour Manager of Exotic':\r\n $whereClause = \"WHERE (Category ='Exotic') AND (Tr.Departure_date >='$date')\";\r\n break;\r\n\r\n default:\r\n $login_session = $GLOBALS['login_session'];\r\n $whereClause = \"WHERE (FK_E_username='$login_session') AND (Tr.Departure_date >='$date')\";\r\n break;\r\n }\r\n\r\n $sql = \"SELECT Tr.Trip_ID , Tr.Departure_date, Tr.Fee, Tr.Airline, Tr.FK_TourCode, T.Name from Trip Tr inner JOIN Tour T on Tr.FK_TourCode=T.TourCode $whereClause ORDER BY Tr.Trip_ID ASC \";\r\n $sql_query = mysqli_query($GLOBALS['db'], $sql);\r\n echo $table;\r\n\r\n while ($row = mysqli_fetch_assoc($sql_query)) {\r\n $ran = rand();\r\n echo \" <tr id='tr_$ran'> <td id='TripID_$ran'>{$row['Trip_ID']}</td> <td id='DeptTime_$ran'>{$row['Departure_date']}</td> <td id='Fee_$ran'>{$row['Fee']}</td> <td id='Airline_$ran'>{$row['Airline']}</td> <td>{$row['FK_TourCode']}</td> <td>{$row['Name']}</td> <td> <a class='btn btn-primary text-white' role='button' onclick='makeTripUpdate(\\\"$ran\\\")' id='btn_TripUpdate$ran'>Update</a> </td> <td> <a class='btn btn-danger text-white' role='button' onclick='sendTripDelete(\\\"{$row['Trip_ID']}\\\",\\\"$ran\\\")'id='btn_TripDelete$ran'>Delete</a> </td> </tr>\r\n \";\r\n }\r\n echo \"</tbody></table>\";\r\n}", "public function getAllMaintenanceForSpecificVehicle($id_company = null, $id_vehicle = null) {\n\t\ttry {\n\t\t\tglobal $con;\t\t\t\n\t\t\t/* Statement declaration */\n\t\t\t$sql = \t\"SELECT * \".\n\t\t\t\t\t\"FROM vehicles v, kinds k, brands b, states s, categories c, energies en, models m, sites si, currencies cu, maintenance ma, typemaintenance tm \".\n\t\t\t\t\t\"WHERE v.id_energy = en.id_energy \".\n\t\t\t\t\t\t\"AND v.id_model = m.id_model \".\n\t\t\t\t\t\t\"AND v.id_kind = k.id_kind \".\n\t\t\t\t\t\t\"AND v.id_category = c.id_category \".\n\t\t\t\t\t\t\"AND v.id_state = s.id_state \".\n\t\t\t\t\t\t\"AND v.id_currency = cu.id_currency \".\n\t\t\t\t\t\t\"AND v.id_site = si.id_site \".\n\t\t\t\t\t\t\"AND si.id_company = :id_company \".\n\t\t\t\t\t\t\"AND m.id_brand = b.id_brand \".\n\t\t\t\t\t\t\"AND v.id_vehicle = ma.id_vehicle \".\n\t\t\t\t\t\t\"AND ma.id_typemaintenance = tm.id_typemaintenance \".\n\t\t\t\t\t\t\"AND v.id_vehicle = :id_vehicle \";\n\t\t\t\t\t\n\t\t\t/* Statement values & execution */\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindParam(':id_company', $id_company);\n\t\t\t$stmt->bindParam(':id_vehicle', $id_vehicle);\n\t\t\t\n\t\t\t/* Statement execution */\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t/* Handle errors */\n\t\t\tif ($stmt->errno)\n\t\t\t throw new PDOException($stmt->error);\n\t\t\telse\n\t\t\t return $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t\t\n\t\t\t/* Close statement */\n\t\t\t$stmt->close();\n\t\t} catch(PDOException $e) {\n\t\t\treturn array(\"error\" => $e->getMessage());\n\t\t}\n }", "public function index($vehicleId = '')\n {\n $vehicles = Vehicle::select('*');\n if (auth()->user()->user_type === 2 && $vehicleId == '') {\n $vehicles = $vehicles->where('vendor_id', auth()->id());\n }\n if($vehicleId != '') {\n $vehicles = $vehicles->where('id', base64_decode($vehicleId)) ;\n }\n $vehicles = $vehicles->with('vehicleType')->get();\n // dd($vehicles);\n $activeVehicles = $vehicles->where('status',1)->count();\n $inActiveVehicles = $vehicles->where('status',0)->count();\n return view('modules.vehicle.vehicles.list', compact('vehicles', 'activeVehicles', 'inActiveVehicles'));\n }", "function addTripVehicles($vehicleData,$trip_id)\n\t{\n\t\t$itineraries = $this->getItineraries($trip_id);\n\t\tif(!$itineraries || count($vehicleData) == 0)\n\t\t\treturn false;\n\n\t\t$vehicleData['user_id'] = $this->session->userdata('id');\n\t\t$vehicleData['organisation_id'] = $this->session->userdata('organisation_id');\n\n\t\t$insertData = array();$i = 0;\n\t\tforeach($itineraries as $itinerary){\n\t\t\t$insertData[$i] = $vehicleData;\n\t\t\t$insertData[$i]['itinerary_id'] = $itinerary['id'];\n\t\t\t$i++;\n\t\t}\n\n\t\tif($insertData){\n\t\t\t$this->db->insert_batch('trip_vehicles', $insertData);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function renderTourManagement()\r\n{\r\n $dom = \"<table border='0' class='table table-striped table-hover' id='TourTable'> <thead> <tr> <th scope='col'> Tour Code </th> <th scope='col'> Tour Name </th> <th scope='col'> Destination </th> <th scope='col'> Itinerary </th> <th scope='col'> Update </th> <th scope='col'> Delete </th> </tr> </thead> <tbody>\";\r\n\r\n switch ($GLOBALS['position']) {\r\n case 'Manager':\r\n $whereClause = \"\";\r\n break;\r\n\r\n case 'Tour Manager of Europe':\r\n $whereClause = \"WHERE Category ='Europe'\";\r\n break;\r\n\r\n case 'Tour Manager of Asia':\r\n $whereClause = \"WHERE Category ='Asia'\";\r\n break;\r\n\r\n case 'Tour Manager of Exotic':\r\n $whereClause = \"WHERE Category ='Exotic'\";\r\n break;\r\n }\r\n $sql = \"SELECT * FROM Tour $whereClause\";\r\n $query = mysqli_query($GLOBALS['db'], $sql);\r\n\r\n while ($row = mysqli_fetch_assoc($query)) {\r\n $ran = rand();\r\n $dom .= \" <tr id='tr_$ran'> <td id='TourCode_$ran'> {$row['TourCode']}</td> <td id='TourName_$ran'> {$row['Name']}</td> <td>{$row['Destination']}</td> <td> <a href='{$row['itinerary_url']}'> <img src='img/itenerary-dark.png'/> </a> </td> <td> <a class='btn btn-primary text-white' role='button' onclick='makeTourUpdate(\\\"$ran\\\")'id='btn_TourUpdate$ran'>Update </a> </td> <td> <a class='btn btn-danger text-white' role='button' onclick='deleteTour(\\\"$ran\\\")'id='btn_DeleteTour$ran'>Delete </a> </td> </tr>\";\r\n }\r\n $dom .= \"</tbody></table>\";\r\n echo $dom;\r\n}", "protected static function set_table($id){\n\t\treturn (boolean)(self::$table = (self::where_is($id) ?: (self::$non_volatile ? self::DISK_TBL : self::MEM_TBL)));\n\t}", "function createTable($result) {\n $table = \"<table class='table table-bordered'>\";\n $row = $result->fetch_assoc();\n $table .= \"<tr>\";\n foreach(array_keys($row) as $field) {\n $table .= \"<th class='text-center'>$field</th>\";\n }\n $table .= \"</tr>\";\n while($row) {\n $table .= \"<tr>\";\n foreach($row as $key => $value) {\n $table .= \"<td class='text-center'>\";\n if(strcmp($key, \"Price\") == 0 or strcmp($key, \"Revenue\") == 0) {\n $table.=\"\\$\" . number_format($value, 2, \".\", \"\");\n }\n else {\n $table .= $value;\n }\n $table.=\"</td>\";\n }\n $table .= \"</tr>\";\n $row = $result->fetch_assoc();\n }\n $table .= \"</table>\";\n return $table;\n }", "public function toTabular() {\n\t\tsetlocale(LC_MONETARY, 'en_GB');\n\n\t\t$totalCount = 0; // Count get the total journey price\n\t\techo '<table width=\"50%\" cellpadding=\"5\" cellspacing=\"5\">';\n\t\t\techo '<tr><th align=\"left\">Station From</th><th align=\"left\">Station To</th><th align=\"left\">Prices</th></tr>';\n\n\t\t\tforeach ( $this->prices as $hop ) {\n\t\t\t\techo '<tr><td>'.$hop['station.from'].'</td>';\n\t\t\t\techo '<td>'.$hop['station.to'].'</td><td>';\n\n\t\t\t\t$prices = array();\n\t\t\t\tforeach ( $hop['station.prices'] as $price ) {\n\t\t\t\t\t$prices[] = $price->nodeValue;\n\t\t\t\t}\n\n\t\t\t\tasort($prices);\n\t\t\t\t$fmt = '<strong>Selected Price:</strong>&pound;%i ';\n\t\t\t\techo money_format($fmt, floatval(str_replace('£', '', $prices[0]))) . \"\\n\";\n\t\t\t\t$totalCount += str_replace('£', '', $prices[0]);\n\t\t\t\techo '</td></tr>';\n\n\t\t\t}\n\t\techo '</table>';\n\n\t\t$fmt = '<strong>Total Cost is </strong> &pound;%i ';\n\t\techo money_format($fmt, $totalCount) . \"\\n\";\n\n\t\techo ' for ' . $this->getPostField('numberOfAdults') . ' adult(s) ';\n\t\techo ' and ' . $this->getPostField('numberOfChildren') . ' child(s).';\n\t}", "function entable($all){\n \n $table = new Table();\n $table->setClass(\"table table-striped table-bordered\");\n $header = new Tr();\n \n $th = new Th(\"Orden\");\n $header->add($th);\n \n $th = new Th(\"Proveedor\");\n $header->add($th);\n \n $th = new Th(\"Total Pzas\");\n $header->add($th);\n \n $th = new Th(\"Recibidas\");\n $header->add($th);\n \n \n $th = new Th(\"Restantes\");\n $header->add($th);\n \n $th = new Th(\"Status\");\n $header->add($th);\n \n \n $th = new Th(\"Recibos\");\n $header->add($th);\n \n $th = new Th(\"Comprobante\");\n $header->add($th);\n \n $th = new Th(\"\");\n $header->add($th);\n \n $table->add($header);\n foreach ($all as $key=> $element){\n $tr = new Tr();\n \n $td = new Td($element->id);\n $tr->add($td);\n \n $td = new Td($element->getProvider());\n $tr->add($td);\n \n \n $pedidas = $element->getPiezas();\n $td = new Td($pedidas);\n $tr->add($td);\n \n $recibidas = $element->getReceived();\n $td = new Td($recibidas);\n $tr->add($td);\n \n \n $restantes = $pedidas - $recibidas;\n $td = new Td($restantes);\n $tr->add($td);\n if (empty($element->status))\n $element->status = \"Abierta\";\n $td = new Td($element->status);\n $tr->add($td);\n \n \n $recibos = $element->getRecibosTable();\n $td = new Td($recibos);\n $tr->add($td);\n \n \n \n \n $receipt = site_url2(\"orders/receipt/{$element->unique}\");\n $receive_anchor = new Anchor(\"Agregar Recibo\",\"$receipt\");\n if ($restantes==0){\n $receive_anchor = new Anchor(\"Agregar Recibo\",\"#\");\n $receive_anchor->setAttr(\"disabled\",\"disabled\");\n $receive_anchor->setAttr(\"onclick\",\"return false\");\n // mark order as closed\n \n \n }\n $receive_anchor->setClass(\"btn btn-default\");\n $td = new Td($receive_anchor);\n $td->setStyle(\"text-align:center\");\n $tr->add($td);\n \n \n \n \n $table->add($tr);\n \n }\n \n \n return $table;\n }", "function retrieveMileageForVehicle(int $id):Collection;", "private function populateDummyTable() {}", "public function dvehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 0)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "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}", "private function createListDataTable(Datastore $db)\n {\n $stmt = $db->prepare('CREATE TABLE ' . $this->dataTableName(). ' ('\n . Utils::primaryKeyColumnDeclaration($db->driver(), 'col_id') . ', '\n . 'col_sample_id INTEGER REFERENCES ' . $this->product()->dataTableName() . '(col_id) ON DELETE CASCADE)'\n );\n $db->execute($stmt);\n }", "public function __construct($id) {\n $statement = Configuration::openConnection()->prepare(\"SELECT * FROM businesses AS b JOIN states AS s ON b.state=s.stateId WHERE b.id=:id\");\n \n $statement->bindParam(\":id\", $id);\n\n $statement->execute();\n\n $results = $statement->fetch(PDO::FETCH_ASSOC);\n\n $this->setBusinessId($results['id']);\n $this->setName($results['name']);\n $this->setStation($results['station']);\n $this->setStreetAddress($results['streetAddress']);\n $this->setCity($results['city']);\n $this->setState(array('id' =>$results['stateId'], 'abbreviation' => $results['stateAbbreviation'], 'name' => $results['stateName']));\n $this->setZipcode($results['zipcode']);\n $this->setPhone($results['phone']);\n $this->setUrl($results['url']);\n $this->setServices($results['services']);\n //$this->setType(array('id' => $results['typeId'], 'type' => $results['typeName']));\n\n Configuration::closeConnection();\n }", "function Render()\n\t{\n\t\t$strTableName = $this->_strName;\n\t\t$strVixenTable = \"Vixen.table.{$strTableName}\";\n\n\t\techo \"\n<script type='text/javascript'>\n\t{$strVixenTable} = Object();\n\t{$strVixenTable}.collapseAll = TRUE;\n\t{$strVixenTable}.linked = TRUE;\n\t{$strVixenTable}.totalRows = 0;\n\t{$strVixenTable}.row = Array();\n</script>\";\n\t\t\t\n\t\t\n\t\t$strPageSize = $this->_intPageSize > 0 ? \" page_size='{$this->_intPageSize}' \" : \"\";\n\n\t\techo \"<table border='0' cellpadding='3' cellspacing='0' class='Listing' width='100%' id='$strTableName'$strPageSize>\\n\";\n\t\t\n\t\t// Build headers\n\t\techo \"<tr class='First'>\\n\";\n\t\t$intHeaderCount = 0;\n\t\t$intSortLimit = ($this->_bolSortable && is_array($this->_arrSortFields)) ? count ($this->_arrSortFields) : -1;\n\t\tforeach ($this->_arrHeader AS $objField)\n\t\t{\n\t\t\t$strAlign = $this->_arrAlignments[$intHeaderCount];\n\t\t\t$strSortLabel = \"\";\n\t\t\tif ($intHeaderCount <= $intSortLimit)\n\t\t\t{\n\t\t\t\tif ($this->_arrSortFields[$intHeaderCount] !== NULL)\n\t\t\t\t{\n\t\t\t\t\t$strSortLabel = \" TABLE_SORT='\" . $this->_arrSortFields[$intHeaderCount] . \"' \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$strSortLabel = \" NO_TABLE_SORT='1' \";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \" <th width='{$this->_arrWidths[$intHeaderCount]}' align='$strAlign'$strSortLabel>\". $objField .\"</th>\\n\";\n\t\t\t$intHeaderCount++;\n\t\t}\n\t\techo \"</tr>\\n\";\n\t\t\n\t\t// Build rows\n\t\t$intRow = -1;\n\t\tforeach ($this->_arrRows AS $objRow)\n\t\t{\n\t\t\t$intRow++;\n\t\t\t$strClass = ($intRow % 2) ? 'Odd' : 'Even';\n\t\t\t$strStyle = \"\";\n\t\t\t\n\t\t\tif (isset($objRow['OnClick']))\n\t\t\t{\n\t\t\t\t// Escape special chars\n\t\t\t\t$strOnClick = \"onclick='\". htmlspecialchars($objRow['OnClick'], ENT_QUOTES) .\"'\";\n\t\t\t\t$strStyle .= \"cursor:pointer;\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strOnClick = \"\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<tr id='\" . $strTableName . \"_\" . $intRow . \"' class='$strClass' $strOnClick style='$strStyle'>\\n\";\n\t\t\t\n\t\t\t$intColCount = 0;\n\t\t\t// Build fields\n\t\t\tforeach ($objRow['Columns'] as $objField)\n\t\t\t{\n\t\t\t\t$strWidth = '';\n\t\t\t\t// Work out which width to use\n\t\t\t\t//TODO! After setting the widths once in the header, you shouldn't have to set them again, but we are anyway.\n\t\t\t\t//This could cut down the size of the html file generated\n\t\t\t\t/*if (isset($objRow['Widths']))\n\t\t\t\t{\n\t\t\t\t\t// Use the width specific to this row and column\n\t\t\t\t\t$strWidth = \"width='\". $objRow['Widths'][$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Use the general width of this column\n\t\t\t\t\t$strWidth = \"width='\". $this->_arrWidths[$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// Work out which alignment to use\n\t\t\t\tif (isset($objRow['Alignments']))\n\t\t\t\t{\n\t\t\t\t\t// Use the alignment specific to this row and column\n\t\t\t\t\t$strAlignment = \"align='\". $objRow['Alignments'][$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Use the general alignment of this column\n\t\t\t\t\t$strAlignment = \"align='\". $this->_arrAlignments[$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Work out how many columns, this column spans\n\t\t\t\t$strColSpan = \"\";\n\t\t\t\tif (isset($objRow['ColSpans']))\n\t\t\t\t{\n\t\t\t\t\t// colspan values have been declared for this row\n\t\t\t\t\t$strColSpan = \"colspan='\". $objRow['ColSpans'][$intColCount] .\"'\";\n\t\t\t\t\t\n\t\t\t\t\t// If using ColSpans do not use row widths\n\t\t\t\t\t$strWidth = \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"<td $strWidth $strAlignment $strColSpan>\";\n\t\t\t\techo \"$objField\";\n\t\t\t\techo \"</td>\\n\";\n\t\t\t\t$intColCount++;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Build detail\n\t\t\tif ($this->_bolDetails)\n\t\t\t{\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td colspan=\". count($this->_arrHeader) .\" style='padding: 0px 1px 1px 1px;'>\";\n\t\t\t\techo \"<div id='\" . $strTableName . \"_\" . $intRow . \"DIV-DETAIL' style='display: block; overflow:hidden;'>\";\n\t\t\t\techo $objRow['Detail'];\n\t\t\t\techo \"</div>\";\n\t\t\t\techo \"</td>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t// Build tooltip\n\t\t\tif ($this->_bolToolTips)\n\t\t\t{\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td colspan=4 style='padding-top: 0px; padding-bottom: 0px'>\";\n\t\t\t\techo \"<div id='\" . $strTableName . \"_\" . $intRow . \"DIV-TOOLTIP' style='display: none;'>\";\n\t\t\t\techo $objRow['ToolTip'];\n\t\t\t\techo \"</div>\\n\";\n\t\t\t\techo \"</td>\";\n\t\t\t}\n\t\t\n\t\t\techo \"\\n<script type='text/javascript'>\";\n\t\t\techo \"objRow = Object();\\n\";\n\t\t\t\n\t\t\techo \"objRow.selected = false;\\n\";\n\t\t\techo \"objRow.up = true;\\n\";\n\n\t\t\tif ($this->_bolLinked)\n\t\t\t{\n\t\t\t\tif (is_array($objRow['Index']))\n\t\t\t\t{\n\t\t\t\t\t// add Indexes to objRow\n\t\t\t\t\techo \"objIndex = Object();\";\n\t\t\t\t\t\n\t\t\t\t\tforeach ($objRow['Index'] as $strIndexName=>$arrValues)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"objIndex.{$strIndexName} = Array();\";\n\t\t\t\t\t\tforeach ($arrValues as $strValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"objIndex.{$strIndexName}.push('$strValue');\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\techo \"objRow.index = objIndex;\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\techo \"{$strVixenTable}.row.push(objRow);\\n\";\n\t\t\techo \"</script>\\n\";\n\t\t\techo \"</tr>\\n\";\n\t\t}\n\t\t$intRowCount = $intRow + 1;\n\t\techo \"</table>\\n\";\n\t\t\n\t\techo \"<script type='text/javascript'>{$strVixenTable}.totalRows = $intRowCount;</script>\\n\";\t\n\t\t\n\t\tif ($this->_bolRowHighlighting)\n\t\t{\n\t\t\t// The following \"Vixen.AddCommand\" method breaks down when you try dynamicly inserting a VixenTable into\n\t\t\t// the DOM, because AddCommand only triggers the command when the body.onload event is triggered\n\t\t\t//echo \"<script type='text/javascript'>Vixen.AddCommand('Vixen.Highlight.Attach','\\'$strTableName\\'', $intRowCount);</script>\";\n\t\t\techo \"<script type='text/javascript'>Vixen.Highlight.Attach('$strTableName');</script>\";\n\t\t}\n\t\t\n\t\tif ($this->_bolToolTips)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.Tooltip.Attach('$strTableName');</script>\";\n\t\t}\n\t\t\n\t\tif ($this->_bolDetails)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.Slide.Attach('$strTableName', TRUE);</script>\\n\";\n\t\t}\n\t\t\n\t\tif ($this->_bolLinked)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"{$strVixenTable}.linked = TRUE;\";\n\t\t\t\n\t\t\techo \"objLink = Object();\\n\";\n\t\t\t\n\t\t\tforeach ($this->_arrLinkedTables AS $strTableName=>$arrIndexes)\n\t\t\t{\n\t\t\t\techo \"objLink.{$strTableName} = Array();\\n\";\n\t\t\t\tforeach ($arrIndexes AS $strIndex)\n\t\t\t\t{\n\t\t\t\t\techo \"objLink.{$strTableName}.push('$strIndex');\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"{$strVixenTable}.link = objLink;\\n\";\n\t\t\t\n\t\t\techo \"</script>\\n\";\n\t\t\t\t/*'link':\n\t\t\t{\n\t\t\t\t'AccountInvoices' :\n\t\t\t\t[\n\t\t\t\t\t'Invoice'\n\t\t\t\t]\n\t\t\t},*/\n\t\t}\n\t\t\n\t\tif ($this->_bolSortable)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.TableSort.prepare('$strTableName');</script>\\n\";\n\t\t}\n\t}", "function createIngrTable() {\r\n\t$conn = mysql_connect(\"localhost\", \"earthcr1_DYLMG\", \"Plastichorse22@\");\r\n\tmysql_select_db(\"earthcr1_DYLMG\");\r\n\t\r\n\t$sql = \t\"SELECT Ingredients.IngredientID, Ingredients.IngredientName, Ingredients.IngredientMW, \"\r\n\t\t\t. \"Oxides.OxideID, Oxides.OxideFormula, IngredientOxides.OxideAmt \\n\"\r\n\t\t\t. \"FROM (IngredientOxides RIGHT JOIN Ingredients ON IngredientOxides.IngredientID = Ingredients.IngredientID) \"\r\n\t\t\t. \"LEFT JOIN Oxides ON IngredientOxides.OxideID = Oxides.OxideID \\n\";\r\n\t//echo quickQueryTable($sql);\r\n\t$rs = mysql_query($sql,$conn) or die(\"Could not execute query:\" . mysql_error());\r\n\t\r\n\t\r\n\t$ingrTable = \"<table>\\n\";\r\n\twhile ($row = mysql_fetch_assoc($rs)) {\r\n\t\tif ($row[IngredientID] != $priorIngr) {\t\t\t\t\t\t\t\t\t\t// We are on a new ingredient - Print Ingr Name, info\r\n\t\t\t$ingrTable .= \"</tbody>\"\r\n\t\t\t\t\t\t. \"<thead>\\n\"\r\n\t\t\t\t\t\t. \"\t<tr>\\n\"\r\n\t\t\t\t\t\t. \"\t\t<th onclick=\\\"showHide('$row[IngredientID]')\\\">$row[IngredientName]</a></td>\\n\"\r\n\t\t\t\t\t\t. \"\t</tr>\\n\"\r\n\t\t\t\t\t\t. \"</thead>\\n\"\r\n\t\t\t\t\t\t. \"<tbody id='$row[IngredientID]' style=\\\"display:none\\\">\\n\"\r\n\t\t\t\t\t\t. \"\t<tr>\\n\"\r\n\t\t\t\t\t\t. \"\t\t<td>Molecular Mass</td>\\n\"\r\n\t\t\t\t\t\t. \"\t\t<td>$row[IngredientMW]</td>\\n\"\r\n\t\t\t\t\t\t. \"\t</tr>\\n\";\r\n\t\t}\r\n\t\t$ingrTable .= \"\t<tr>\\n\"\r\n\t\t\t\t\t. \"\t\t<td>$row[OxideFormula]</td>\\n\"\r\n\t\t\t\t\t. \"\t\t<td>$row[OxideAmt]</td>\\n\"\r\n\t\t\t\t\t. \"\t</tr>\\n\";\r\n\t\t$priorIngr = \"$row[IngredientID]\";\t\t\t\t\t\t\t\t\t\t\t// Sets priorIngr just before restarting loop.\t\r\n\t}\r\n\treturn $ingrTable;\r\n}", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "public function showTable() {\n\t\t$tableName = $this->request->getVariable('id');\n\t\t$this->smarty->assign('dbTableObject',new $tableName());\n\t\t$this->pageDisplay('tools');\n\t}", "function MysqlResultsTable ($mysql_results, $table_id='') {\n while ($myrow = mysql_fetch_assoc($mysql_results)) {\n if (! ($headers))\n $headers = array_keys($myrow);\n $rows .= \" <tr>\\n\";\n foreach ($headers as $k)\n $rows .= \" <td class=$k>$myrow[$k]</td>\\n\";\n $rows .= \" </tr>\\n\";\n } // end while myrow\n $header = join(\"</th><th>\",$headers);\n $header = \"<tr><th>$header</th></tr>\\n\";\n if ($table_id != '') { $id = ' id=\"'.$table_id.'\"'; }\n $rows = \"<table$id>$header$rows</table>\\n\";\n return ($rows);\n}", "public function makeTableView($headings, $content, $idFieldName, $viewURL);", "public function vehicle()\n {\n return $this->belongsToMany(Vehicle::class, 'nodeVehicle', 'relNodeId', 'relVehicleId')\n ->using(new class extends Pivot {\n use UuidModelTrait;\n });\n }" ]
[ "0.60493976", "0.59130245", "0.5860502", "0.5813905", "0.5765854", "0.5750921", "0.5750503", "0.5698211", "0.5671879", "0.5650434", "0.5645319", "0.56325865", "0.55617666", "0.54598206", "0.5360614", "0.5355763", "0.5355763", "0.53297055", "0.5311116", "0.52919203", "0.52893287", "0.52872026", "0.52580166", "0.52475715", "0.52174526", "0.5207012", "0.5206663", "0.51975524", "0.51734143", "0.51724404", "0.5147382", "0.5145483", "0.5139689", "0.51272404", "0.51215744", "0.51077366", "0.5083405", "0.50833154", "0.5046262", "0.50450134", "0.5043584", "0.5037814", "0.5020941", "0.50177", "0.5011045", "0.50068694", "0.5002165", "0.4991871", "0.49908647", "0.49894488", "0.49857572", "0.49851388", "0.4972404", "0.49674702", "0.49645534", "0.49627644", "0.4959152", "0.49556723", "0.49547306", "0.4951994", "0.4939641", "0.49386457", "0.49314818", "0.4929514", "0.4926602", "0.492659", "0.492659", "0.492659", "0.49208993", "0.49194163", "0.49193734", "0.49155575", "0.4914111", "0.4902344", "0.4896741", "0.48869944", "0.48827133", "0.48751953", "0.48711166", "0.48637584", "0.4857038", "0.48472375", "0.4842946", "0.48424542", "0.4840592", "0.48296732", "0.48284763", "0.48260587", "0.4824307", "0.48232445", "0.48228726", "0.48213866", "0.48211437", "0.48184252", "0.48124462", "0.48122668", "0.48106688", "0.48106274", "0.4804652", "0.4803856", "0.4803558" ]
0.0
-1
/ Functions for working with images Adds "tn" designation to file name
function makeThumbnailName($image) { $i = strrpos($image, '.'); $image_name = substr($image, 0, $i); $ext = substr($image, $i); $image = $image_name . '-tn' . $ext; return $image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeThumbnailName($image)\n{\n $i = strrpos($image, '.');\n $image_name = substr($image, 0, $i);\n $ext = substr($image, $i);\n $image = $image_name . '-tn' . $ext;\n return $image;\n}", "protected function imageName() {}", "public function getImageName();", "private function createImageName($imageInfo, $shopName, $imageTypeName)\n {\t\n \t$folderName = $this->createFolderName($shopName);\n \t//get Image Mine Type\n $logoType =$imageInfo->getClientMimeType();\n $ext = substr($logoType, strrpos($logoType, '/') +1);\n //get Current Date time String\n $date = $this->currentTime();\n //concrite a new logo Name\n $newName = $date.'_'.$folderName.$imageTypeName.'.'.$ext;\n\n //return logo name\n return $newName;\n }", "private function getPlainFileName(){\r\n return str_replace(\"https://images.pond5.com/\",\"\",$this->fileName); \r\n }", "function thumbnail($image , $type)\n{\n $ext = pathinfo($image, PATHINFO_EXTENSION);\n // We remove extension from file name so we can append thumbnail type\n $num = strlen($ext)*(-1)-1;\n $name = substr($image, 0, $num);\n // We merge original name + type + extension\n return $name . '-' . $type . '.' . $ext;\n}", "private function getThumbFilename() {\n\t\t$info = pathInfo( $this->filename );\n\n\t\t// add dirname as postfix (if exists)\n\t\t$postfix = '';\n\n\t\t$dirname = UniteFunctionsRev::getVal( $info, 'dirname' );\n\t\tif ( ! empty( $dirname ) ) {\n\t\t\t$postfix = str_replace( '/', '-', $dirname );\n\t\t}\n\n\t\t$ext = $info['extension'];\n\t\t$name = $info['filename'];\n\t\t$width = ceil( $this->maxWidth );\n\t\t$height = ceil( $this->maxHeight );\n\t\t$thumbFilename = $name . '_' . $width . 'x' . $height;\n\n\t\tif ( ! empty( $this->type ) ) {\n\t\t\t$thumbFilename .= '_' . $this->type; }\n\n\t\tif ( ! empty( $this->effect ) ) {\n\t\t\t$thumbFilename .= '_e' . $this->effect;\n\t\t\tif ( ! empty( $this->effect_arg1 ) ) {\n\t\t\t\t$thumbFilename .= 'x' . $this->effect_arg1;\n\t\t\t}\n\t\t}\n\n\t\t// add postfix\n\t\tif ( ! empty( $postfix ) ) {\n\t\t\t$thumbFilename .= '_' . $postfix; }\n\n\t\t$thumbFilename .= '.' . $ext;\n\n\t\treturn($thumbFilename);\n\t}", "function getName() \t\t { return 'NP_ImageCreateThumbnail'; }", "protected function buildFileName()\n\t{\n\t\t$upscale = $this->upscale ? 'upscale' : 'noupscale';\n\t\treturn $this->namePrefix . '-' . $this->width . 'x' . $this->height . '-' . $upscale . '-' . $this->quality . '-' . $this->imageName;\n\t}", "protected function imageName() {\n\n\t\treturn NULL;\n\t}", "function imagecustom($im, $text) {\n}", "public function genFilename()\n {\n $filename = $this->getAssetableType().$this->assetable_id.'_';\n $filename .= uniqid();\n if(!empty($this->getThumbnailType())) $filename .= '_'.$this->getThumbnailType();\n $filename .= '.'.$this->uploadedFile->extension;\n $this->filename = $filename;\n }", "private function getImageName(SplFileInfo $dir, $imageSetName)\n {\n return $imageSetName.'-'.$dir->getFileName().':latest';\n }", "function display_file($file) {\n\n return \"images\" . DS . $file;\n\n}", "public function get_thumb_name(){\n\t\treturn \"{$this->id}_thumb.png\";\n\t}", "function getThumbnailName($file){\n $parts = explode('.',$file);\n $ext = array_pop($parts);\n //return implode('.',$parts).'_thumb.'.$ext;\n return 'thumb_'.$file;\n }", "function _showname($img,$data){\n global $ID;\n\n if(!$data['showname'] ) { return ''; }\n\n //prepare link\n $lnk = ml($img['id'],array('id'=>$ID),false);\n\n // prepare output\n $ret = '';\n $ret .= '<br /><a href=\"'.$lnk.'\">';\n $ret .= hsc($img['file']);\n $ret .= '</a>';\n return $ret;\n }", "function createImage($idName) { //TODO: Add parameter for passing image files to use instead \n echo '<img src=\"/php/cms-img/file2.png\" id=\"' . $idName . '\" class=\"nested\"/>';\n }", "public function setFileName() {\n\t\t$name = 'color_' . $this->width . 'x' . $this->height;\n\t\tforeach ($this->colors as $color) {\n\t\t\t$name .= '_' . strtolower(preg_replace('/^#/', '', $color));\n\t\t}\n\t\t$name .= '.png';\n\t\t$this->fileName = $this->tempDir . $name;\n\t}", "static function getImageExtension(string $image): string {\n return (\\strpos($image, 'a_') === 0 ? 'gif' : 'png');\n }", "public function getNameFile($image): string\n {\n \t$image_name = uniqid(time()) . '.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n \treturn $image_name;\n }", "public function thumbnailPath() {\n return $this->baseDir() . '/tn-' . $this->fileName();\n }", "static function thumbnail($filename , $disk='local'){\n return pathinfo( $filename , PATHINFO_FILENAME ) . '.jpg';\n\n }", "private function getFileName($raw = false){\n $raw_string = $this->surah . '|' . $this->verses . '|' . $this->translation;\n return $raw ? $raw_string : md5($raw_string).'.png';\n }", "private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }", "protected function getImageName() {\n\n\t\treturn NULL;\n\t}", "function logo($tp) {\n\tglobal $LANG;\n\tswitch ($tp) {\n\t\tcase '1' :\n\t\t\t$file = 'document/proethos_logo_1.jpg';\n\t\t\tif (file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn($file);\n\t\t\t\t} else {\n\t\t\t\t\t$file = 'img/logo_dictamen.jpg';\n\t\t\t\t\treturn($file);\n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase '2' :\n\t\t\t$file = 'document/proethos_logo_1.png';\t\t\t\t\t\n\t\t\tif (file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn($file);\n\t\t\t\t} else {\n\t\t\t\t\t$file = 'img/proethos_logo_1.png';\n\t\t\t\t\t$file = 'img/logo_inst_mini_'.$LANG.'.png';\n\t\t\t\t\treturn($file);\n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase '3' :\n\t\t\t$file = 'document/proethos_logo_2.png';\t\t\t\n\t\t\tif (file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn($file);\n\t\t\t\t} else {\n\t\t\t\t\t$file = 'img/proethos_logo_2.png';\n\t\t\t\t\treturn($file);\n\t\t\t\t}\n\t\t\tbreak;\t\t\n\t}\n}", "private function formatFilename() {\n return $this->prefix . $this->name . \".\" . $this->extension;\n }", "function image($file_name,$title,$class='',$id) {\n \tif ($id) $id = \"id = '\".$id.\"'\"; \n \t$data = '<img src=\"'.BASE_PATH.'/img/'.$file_name.'\" title = \"'.$title.'\" border=\"0\" align=\"absmiddle\" '.$id.' class=\"'.$class.'\" />';\n return $data;\n }", "function minorite_image($variables) {\n $attributes = $variables['attributes'];\n $attributes['src'] = file_create_url($variables['path']);\n\n foreach (array('alt', 'title') as $key) {\n\n if (isset($variables[$key])) {\n $attributes[$key] = $variables[$key];\n }\n }\n\n return '<img' . drupal_attributes($attributes) . ' />';\n}", "public static function ext_name($file){\n\t\treturn 'png';\n\t}", "function ext_to_jpeg($x){\n $bedword = array(\".gif\", \".png\");\n\n\n$goodword = str_replace($bedword, \".jpeg\", $x);\n\nreturn $goodword;\n}", "function get_thumb_name($fichier) {\n\t\t$name = explode('.',$fichier);\n\t\treturn $name[0].'_th.'.$name[1];\n\t}", "function imageHandler($parametre){\r\n $type = end(explode(\".\", $parametre['name']));\r\n $name = explode(\".\", $parametre['name'])[0];\r\n $path = $parametre['tmp_name'];\r\n $newPath = \"C:\\\\xampp\\htdocs\\Kit-up\\assets\\books\\sales\";\r\n // echo $newPath;\r\n $allow = ['jpg', 'jpeg', 'png'];\r\n $newName = \"\";\r\n if(in_array($type,$allow)){\r\n $newName = md5(uniqid(mt_rand(), true)) . \".\" . $type;\r\n move_uploaded_file($path, $newPath.'\\\\'.$newName);\r\n return $newPath.'\\\\'.$newName ;\r\n }else{\r\n echo \"Sorry. Not supported type!\";\r\n }\r\n }", "function getDiscFileLinkText($hos_num, $original_filename) {\n return\n // first part - actual file image location\n \"<a href=\\\"\" . self::IMAGE_GALLERY\n . md5($hos_num)\n . \"/\" . md5($original_filename) . self::STEREO_IMAGE_EXT\n . \"\\\">\"\n // 2nd part - thumbnail image location:\n . \"<img src=\\\"\" . self::IMAGE_GALLERY\n . md5($hos_num) . \"/thumbs/\"\n . md5($original_filename) . self::STEREO_IMAGE_EXT . \"\\\"\"\n . \"/></a>\";\n }", "function __tmpfile() {\r\r\n\t\treturn tempnam(-1, null) . '.PNG';\r\r\n\t\t}", "function view_logo_project($img,$w,$h,$alt)\n{\n if(file_exists(\"logo/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"include/phpThumb.php?src=../logo/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='floatL mar12R' />\";\n else\n $temp =\"<img src=\\\"include/phpThumb.php?src=../logo/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\n \n\treturn $temp;\t\t\t}", "private function generateFilename($overwrite = false)\n\t{\n\n\t\tif(strpos( $this->relative_source_path, DIRECTORY_SEPARATOR) === false)\n\t\t{\n\t\t\t$this->full_target_path = $this->target_dir . \"/\" . time() .\"_\". md5( $this->relative_source_path ) . \".jpg\";\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tif($overwrite)\n {\n $this->full_target_path = self::getFullPath($this->relative_source_path);\n }\n else\n {\n $filename = pathinfo($this->relative_source_path, PATHINFO_BASENAME); //PATHINFO_FILENAME ---> must add extension below!!!!\n $this->full_target_path = $this->target_dir . \"/\" . time() . \"_\" . $filename;\n }\n\t\n\t}", "public static function cryptFileName($file)\n{ \n $img = $file;\n\n $ext = substr($img['name'], strrpos($img['name'], '.') + 1);\n //$allow_ext = array(\"jpg\", \"JPG\", \"png\", \"PNG\", \"JPEG\", \"jpeg\", \"GIF\", \"gif\");\n \n //if(in_array($ext, $allow_ext)){\n //définit l'image en cours\n $file_name = 'file_'.substr(md5($img['name']), 0, 5).'_'.time().'.'.$ext;\n return $file_name;\n}", "private function getThumbnailFileName($image)\n {\n return sprintf(\n \"%s_thumb.png\",\n basename($image, '.png')\n );\n }", "function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}", "private function createImageName() {\n $nameFree = true;\n\n // loop thru until a name is free (probably instantly)\n // caveat: i was lazy and decided to go thru entire images table.\n // could be a problem in the future if db got huge...\n do {\n // create a slug\n $name = parent::createSlug(self::BASE_IMG_NAME_START);\n\n // see if the slug is already in the db\n $count = Images::where('slug', $name)->count();\n\n if ($count > 0) break;\n } while(!$nameFree);\n\n return $name;\n }", "private function generateThumbnailImagick(){\n\t}", "public function get_full_name(){\n\t\treturn \"{$this->id}_full.png\";\n\t}", "public function actionFixImageNames()\n {\n $prodImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'product' . DIRECTORY_SEPARATOR;\n // $prImgs = glob($prodImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $prImgs = glob($prodImgDir . '*.{jpg}', GLOB_BRACE);\n $c = count($prImgs);\n $y = $x = $r = $n = 0;\n if ($c > 0) {\n foreach ($prImgs as $img) {\n $bN = basename($img);\n $art = substr($bN, 0, -4);\n if (strlen($art) > 16) {\n $art = substr($art, 0, 16);\n }\n if ($n <= 16 || $n == 19 || $n == 85 || $n == 159) {\n echo 'Skipped image ' . $n . '...' . PHP_EOL;\n $n ++;\n continue;\n }\n echo 'Checking image (' . $n . '): ' . $bN . ' check articul: ' . $art . PHP_EOL;\n\n $civQuery = CatalogItemVariant::find()\n ->where(['published' => 1]);\n $civ = $civQuery->andFilterWhere(['like', 'img_url', $art])\n ->asArray()\n ->one();\n if (!empty($civ['img_url'])) {\n // echo 'Found CIV: ' . var_export($civ, 1) . PHP_EOL;\n $bNok = basename($civ['img_url']);\n if ($bNok != $bN) {\n echo 'Base name OK: ' . $bNok . ' != ' . $bN . PHP_EOL;\n\n $oldName = $prodImgDir . $bN;\n $newName = $prodImgDir . $bNok;\n if (file_exists($newName)) {\n echo 'Destination file exists: ' . $newName . PHP_EOL;\n $x ++;\n } else {\n try {\n $oldName = escapeshellarg($oldName);\n $newName = escapeshellarg($newName);\n if (rename($oldName, $newName)) {\n echo 'Renamed image from: ' . $bN . ' to: ' . $bNok . PHP_EOL;\n $r ++;\n }\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), PHP_EOL;\n continue;\n }\n }\n \n } else {\n $y ++;\n }\n }\n $n ++;\n }\n echo 'Renamed ' . $r . ' images. Good names: ' . $y . '. Images exists: ' . $x . '.' . PHP_EOL;\n }\n }", "protected function getOutputFileName(string $filename)\n {\n $extension_pos = strrpos($filename, '.'); // find position of the last dot, so where the extension starts\n $thumb = substr($filename, 0, $extension_pos) . '_thumb' . substr($filename, $extension_pos);\n // let the service add a custom extension\n return $thumb . $this->generator->getOutputExtension();\n }", "function insertUrlImages($image_name){\r\n\t\t\r\n\t}", "function generateFilename($name)\n {\n // Catch every Unicode character from beggining on, because replacer might not get it\n $name = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $name);\n // Delete all signs etc. to properly display the filename\n $newname = str_replace(array(' ', '+', '*', '!', '?', \"'\", '\"', '.', ',', 'ä', 'ö', 'ü', '?', '-', ':', '&'), '', $name);\n $newname = mb_strtolower($newname);\n $newname .= '.png';\n\n return $newname;\n }", "function createthumbs ($origImagePath,$tnImagePath,$fname,$thumbWidth){\n // 1. open the originals directory\n $dir = opendir($origImagePath);\n \n // 2. Find the original imaeg file\n //$fname = \"1397841364-KamalProfPic1.jpg\";\n \n echo \"Creating thumbnail for {$origImagePath}{$fname} <br />\";\n \n // 3. load image and get image size\n $img = imagecreatefromjpeg( \"{$origImagePath}{$fname}\" );\n $width = imagesx( $img );\n $height = imagesy( $img );\n\n // 4. calculate thumbnail size\n $new_width = $thumbWidth;\n $new_height = floor( $height * ( $thumbWidth / $width ) );\n\n // 5. create a new temporary image\n $tmp_img = imagecreatetruecolor( $new_width, $new_height );\n\n // 6. copy and resize old image into new image \n imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\n // 7. save thumbnail into a file\n imagejpeg( $tmp_img, \"{$tnImagePath}{$fname}\" );\n \n // 8. close the directory\n closedir( $dir ); \n}", "function image($filename='',$attrs='')\n{\n $img_path = get_stylesheet_directory_uri() . \"/images\" . \"/${filename}\";\n $attrs = $attrs == '' ? \"src='${img_path}'\" : (\"src='${img_path}' \" . $attrs);\n output_single_tag('img',$attrs);\n}", "function pngCreateFromTab($T,$filename)\n{\n\t$Ires = convertTab2Image($T);\n\timagePng($Ires,$filename);\t\t\n}", "function view_project_logo($img,$w,$h,$alt)\n{\n if(file_exists(\"../logo/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"../include/phpThumb.php?src=../logo/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='floatL mar12R' />\";\n else\n $temp =\"<img src=\\\"../include/phpThumb.php?src=../logo/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\n \n\treturn $temp;\n}", "public function get_preview_name(){\n\t\treturn \"{$this->id}_preview.png\";\n\t}", "function kdw_row_tiles_txt_img (){ \r\n \r\n}", "private function generateThumbnailGD(){\n\t\t\n\t}", "public function img_thumb($image_name)\n {\n //The Way It work Is only for thumb make\n return substr_replace($image_name, \"_thumb\", stripos($image_name, '.'), 0);\n }", "function tep_get_dest_image($small_image_source,$folder = 'xxs',$suffix=''){\n\treturn str_replace('-s',$suffix,str_replace('small',$folder,$small_image_source));\n}", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function acd_add_img_title( $attr, $attachment = null ) {\n\t$img_title = trim( strip_tags( $attachment->post_title ) );\n\t$img_title = str_replace(\"-\", \" \", $img_title); //remove hyphens\n\t$img_title = str_replace(\"_\", \" \", $img_title); //remove underscores\n\t$img_title = preg_replace('/[0-9]+/', '', $img_title); //remove numbers\n\t$img_title = ucwords($img_title); //capitalize first letter of each word\n\n\t$attr['title'] = $img_title; //add image title attribute\n\t// or get the title instead of image title $attr['title'] = the_title_attribute( 'echo=0' );\n\t$attr['alt'] = $img_title; //add alt attribute\n\treturn $attr;\n}", "function get_icon($ending)\n{\n\tswitch($ending)\n\t{\n\t\tcase '.avi':\n\t\tcase 'mpeg':\n\t\tcase '.mpg':\n\t\tcase 'divx':\n\t\tcase '.mkv':\n\t\tcase '.ogm':\n\t\tcase '.mp4':\n\t\tcase '.wmv':\n\t\tcase '.vob':\n\t\tcase '.flv':\n\t\t\t$img = 'movie.png';\n\t\t\tbreak;\n\t\tcase '.pdf':\n\t\tcase '.dvi':\n\t\t\t$img = 'acroread.png';\n\t\t\tbreak;\n\t\tcase '.doc':\n\t\tcase 'docx':\n\t\tcase '.xls':\n\t\tcase 'xlsx':\n\t\tcase '.pps':\n\t\tcase 'ppsx':\n\t\tcase '.odt':\n\t\tcase '.odp':\n\t\tcase '.odx':\n\t\t\t$img = 'office.png';\n\t\t\tbreak;\n\t\tcase '.mp3':\n\t\tcase '.wma':\n\t\tcase '.aac':\n\t\tcase '.ogg':\n\t\tcase 'flac':\n\t\t\t$img = 'audio.png';\n\t\t\tbreak;\n\t\tcase '.mov':\n\t\tcase '.3gp':\n\t\t\t$img = 'quicktime.png';\n\t\t\tbreak;\n\t\tcase 'html':\n\t\tcase '.htm':\n\t\tcase '.php':\n\t\tcase '.cgi':\n\t\t\t$img = 'html.png';\n\t\t\tbreak;\n\t\tcase '.jpg':\n\t\tcase 'jpeg':\n\t\tcase '.png':\n\t\tcase '.bmp':\n\t\tcase 'tiff':\n\t\tcase '.xpm':\n\t\tcase '.gif':\n\t\tcase '.ico':\n\t\t\t$img = 'image.png';\n\t\t\tbreak;\n\t\tcase '.nfo':\n\t\tcase '.sfv':\n\t\t\t$img = 'info.png';\n\t\tbreak;\n\t\tcase '.tar':\n\t\t\t$img ='tar.png';\n\t\t\tbreak;\n\t\tcase '.tgz':\n\t\tcase 'r.gz':\n\t\tcase '.bz2':\n\t\tcase '.rar':\n\t\tcase '.zip':\n\t\t\t$img = 'tgz.png';\n\t\t\tbreak;\n\t\tcase '.iso':\n\t\tcase '.mdf':\n\t\tcase '.mds':\n\t\tcase '.ccd':\n\t\tcase '.bin':\n\t\tcase '.cue':\n\t\tcase '.nrg':\n\t\tcase '.vcd':\n\t\t\t$img = 'cdrom.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$img = 'file.png';\n\t\t\tbreak;\n\t}\n\treturn($img);\n}", "private function set_img_path()\n {\n $file_name = sprintf('%03d',$this->img_count);\n $this->img_path = L_TEMP_IMAGE_PATH.$file_name.\".png\";\n $this->img_count++;\n }", "function view_builder_logo_inside_project($img,$w,$h,$alt)\n{\n if(file_exists(\"../builder/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"../include/phpThumb.php?src=../builder/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='floatL mar12R' />\";\n else\n $temp =\"<img src=\\\"../include/phpThumb.php?src=../builder/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\n \n\treturn $temp;}", "function AddPrefixToFileName() {\n\t\t\t$this->NewFileName = time().'_'.$this->GetFileName();\n\t\t\t//echo $this->NewFileName; exit();\n\t\t\treturn $this->NewFileName;\n\t\t}", "private function getThumbName() {\n $thumbName = $this->randomize();\n while (file_exists($this->thumbPath.$thumbName)) {\n $thumbName = $this->randomize($thumbName);\n }\n return $thumbName;\n }", "function makeImg($img, $prefix = '', $relative = false)\n{\n\treturn ($img ? '<img alt=\"\" src=\"' . ($relative ? '' : ARC_WWW_PATH) . $prefix . $img . '\" />' : '');\n}", "private static function setFilename($srcImages) {\r\n return basename($srcImages);\r\n }", "function concatenarPath($nombre, $seccion) {\n\t$path = \"img_\" . $seccion . \"/\" . $nombre;\n\treturn $path;\n}", "function _imageTitle($img) {\n global $ID;\n\n // some fixes on $img['src']\n // see internalmedia() and externalmedia()\n list($img['src']) = explode('#', $img['src'], 2);\n if($img['type'] == 'internalmedia') {\n resolve_mediaid(getNS($ID), $img['src'], $exists ,$this->date_at, true);\n }\n\n return $this->_media(\n $img['src'],\n $img['title'],\n $img['align'],\n $img['width'],\n $img['height'],\n $img['cache']\n );\n }", "public function getTargetFileName()\n {\n return 'preview_' . parent::getTargetFilename();\n }", "public function getImageFileNameAttribute()\n {\n return $this->id . '-image.' . $this->image_extension;\n }", "function setFilenameExtension()\n\t{\n\t\t$sOldFilenameExtension = substr($this->filename, strlen($this->filename) - 4, 4);\n\t\tif (($sOldFilenameExtension != '.gif') &&\n\t\t\t\t($sOldFilenameExtension != '.jpg') &&\n\t\t\t\t($sOldFilenameExtension != '.png')) {\n\t\t\t$this->printError('invalid filename extension');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.gif';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "protected function imageIcon(): string\n {\n $types = [\n 'image' => 'file-image',\n 'video' => 'file-video',\n 'document' => 'file-document',\n 'audio' => 'file-audio',\n 'code' => 'file-code',\n 'archive' => 'file-zip'\n ];\n\n $extensions = [\n 'xls' => 'file-spreadsheet',\n 'xlsx' => 'file-spreadsheet',\n 'csv' => 'file-spreadsheet',\n 'docx' => 'file-word',\n 'doc' => 'file-word',\n 'rtf' => 'file-word',\n 'mdown' => 'file-text',\n 'md' => 'file-text'\n ];\n\n return $extensions[$this->model->extension()] ??\n $types[$this->model->type()] ??\n parent::imageDefaults()['color'];\n }", "public static function buildPhotoName($person): string\n {\n return strtoupper($person->first_name . ' ' . $person->last_name) . '_rangers.jpg';\n }", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "public function getPictureName()\n {\n $pictureName = \"nopicture.png\";\n $articleModel = new ArticleModel();\n $articles = $articleModel->where(\"id_products\", $this->id_products)->findAll();\n\n if (count($articles) > 0) {\n\n if ($articles[0]->getPicture() != null) {\n $pictureName = $articles[0]->getPicture()->name . \".\" . $articles[0]->getPicture()->extension;\n }\n }\n return $pictureName;\n }", "function pretty_filetype($ext)\n{\n\tswitch ($ext)\n\t{\n\t\tcase \"png\": $extn=\"PNG Image\"; break;\n\t\tcase \"jpg\": $extn=\"JPEG Image\"; break;\n\t\tcase \"jpeg\": $extn=\"JPEG Image\"; break;\n\t\tcase \"svg\": $extn=\"SVG Image\"; break;\n\t\tcase \"gif\": $extn=\"GIF Image\"; break;\n\t\tcase \"ico\": $extn=\"Windows Icon\"; break;\n\n\t\tcase \"txt\": $extn=\"Text File\"; break;\n\t\tcase \"log\": $extn=\"Log File\"; break;\n\t\tcase \"htm\": $extn=\"HTML File\"; break;\n\t\tcase \"html\": $extn=\"HTML File\"; break;\n\t\tcase \"xhtml\": $extn=\"HTML File\"; break;\n\t\tcase \"shtml\": $extn=\"HTML File\"; break;\n\t\tcase \"php\": $extn=\"PHP Script\"; break;\n\t\tcase \"js\": $extn=\"Javascript File\"; break;\n\t\tcase \"css\": $extn=\"Stylesheet\"; break;\n\n\t\tcase \"pdf\": $extn=\"PDF Document\"; break;\n\t\tcase \"xls\": $extn=\"Spreadsheet\"; break;\n\t\tcase \"xlsx\": $extn=\"Spreadsheet\"; break;\n\t\tcase \"doc\": $extn=\"Microsoft Word Document\"; break;\n\t\tcase \"docx\": $extn=\"Microsoft Word Document\"; break;\n\n\t\tcase \"zip\": $extn=\"ZIP Archive\"; break;\n\t\tcase \"htaccess\": $extn=\"Apache Config File\"; break;\n\t\tcase \"exe\": $extn=\"Windows Executable\"; break;\n\n\t\tdefault:\n\t\tif($ext!=\"\")\n\t\t{\n\t\t\t$extn=strtoupper($ext).\" File\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$extn=\"Unknown\";\n\t\t}\n\t}\n\n\treturn $extn;\n}", "function metadata_image($metadata_conf) \r\n {\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n include_once 'metadata/Toolkit_Version.php';\r\n error_reporting(0);\r\n include_once 'metadata/JPEG.php';\r\n include_once 'metadata/XMP.php';\r\n include_once 'metadata/Photoshop_IRB.php';\r\n include_once 'metadata/EXIF.php';\r\n include_once 'metadata/Photoshop_File_Info.php';\r\n \r\n \r\n // Copy all of the HTML Posted variables into an array\r\n //$new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS'];\r\n $new_ps_file_info_array = $metadata_conf;\r\n \r\n $filename = $new_ps_file_info_array['filename'];\r\n //echo $filename;\r\n // Protect against hackers editing other files\r\n \r\n $path_parts = pathinfo($filename);\r\n $array_extention = array('png', 'jpg');\r\n if (strcasecmp($path_parts[\"extension\"], \"jpg\") != 0) {\r\n //if (!in_array($path_parts[\"extension\"], $array_extention)) \r\n #echo \"Incorrect File Type - JPEG Only\\n\";\r\n return array('status' => 'failed', 'message' => 'Incorrect File Type - JPEG Only');\r\n exit();\r\n }\r\n // Change: removed limitation on file being in current directory - as of version 1.11\r\n // Retrieve the header information\r\n $jpeg_header_data = get_jpeg_header_data($filename);\r\n \r\n // Retreive the EXIF, XMP and Photoshop IRB information from\r\n // the existing file, so that it can be updated\r\n $Exif_array = get_EXIF_JPEG($filename);\r\n $XMP_array = read_XMP_array_from_text(get_XMP_text($jpeg_header_data));\r\n $IRB_array = get_Photoshop_IRB($jpeg_header_data);\r\n \r\n // Update the JPEG header information with the new Photoshop File Info\r\n $jpeg_header_data = put_photoshop_file_info($jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array);\r\n \r\n // Check if the Update worked\r\n if ($jpeg_header_data == FALSE) {\r\n //echo '$jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure update Photoshop File Info : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n \r\n // Attempt to write the new JPEG file\r\n if (FALSE == put_jpeg_header_data($filename, $filename, $jpeg_header_data)) {\r\n //echo 'put_jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure to write new JPEG : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n return array('status' => 'succes', 'message' => $filename . ' updated');\r\n }\r\n }", "public function getThumbFileNameAttribute()\n {\n return $this->id . '-th.'. $this->thumb_extension;\n }", "public function actionFixImageNamesRegister()\n {\n $prodImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'product' . DIRECTORY_SEPARATOR;\n $prImgs = glob($prodImgDir . '*.{JPG}', GLOB_BRACE);\n $c = count($prImgs);\n $r = $n = 0;\n if ($c > 0) {\n echo 'Found ' . $c . ' with wrong extenstion in uppercase...' . PHP_EOL;\n foreach ($prImgs as $img) {\n $bN = basename($img);\n $art = substr($bN, 0, 16);\n echo 'Checking image (' . $n . '): ' . $bN . ' check articul: ' . $art . PHP_EOL;\n $civQuery = CatalogItemVariant::find()\n ->where(['published' => 1]);\n $civ = $civQuery->andFilterWhere(['like', 'img_url', $art])\n ->asArray()\n ->one();\n if (!empty($civ)) {\n $fixedImgUrl = '/images/product/' . $art . '.jpg';\n echo 'Fixed img_url: ' . $fixedImgUrl .' Found by articul pattern: ' . $art . ' :' . print_r($civ, 1) . PHP_EOL;\n $oCv = CatalogItemVariant::findOne([\n 'id' => $civ['id'],\n 'published' => 1,\n ]);\n if (!empty($oCv)) {\n $oCv->img_url = $fixedImgUrl;\n $oCv->save();\n //\n $bNok = basename($fixedImgUrl);\n //\n $oldName = escapeshellarg($prodImgDir . DIRECTORY_SEPARATOR . $bN);\n $newName = escapeshellarg($prodImgDir . DIRECTORY_SEPARATOR . $bNok);\n try {\n if (rename($oldName, $newName)) {\n echo 'Renamed image from: ' . $bN . ' to: ' . $bNok . PHP_EOL;\n $r ++;\n }\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), PHP_EOL;\n continue;\n }\n }\n }\n $n ++;\n }\n echo 'Renamed ' . $r . ' images.' . PHP_EOL;\n }\n }", "protected function filename()\n {\n return 'photos_datatable_' . time();\n }", "function imageify($text){\n\t$text = str_replace('$', '\\$', $text);\n\t$text = str_replace('\"', '\\\"', $text);\n\n\t//select background image (31 to choose from)\n\t$background = \"images/\" . rand(1,31) . \".jpg\";\n\n\t//turn background image upside down\n\texec(\"convert $background -fill black -colorize 70% -rotate \\\"180\\\" background.jpg\");\n\n\t//create text with alpha background\n\t//(current size creates automatic 50px padding on all sides)\n\texec(\"convert -size 924x412 -background none -fill rgba\\(255,255,255,0.9\\) -font Helvetica-Bold -gravity West -interline-spacing 10 caption:\\\"$text\\\" -rotate \\\"180\\\" text.png\");\n\n\t//add them together\n\texec(\"composite -gravity center text.png background.jpg final.jpg\");\n\n\t//add the bug (Twitter handle) on top\n\texec(\"composite bug.png final.jpg final.jpg\");\n}", "function image_name(){\n\t$date = date(\"H:i:s\");;\n\t$date = strtotime($date);\n\n\treturn $date;\n}", "function loadIcon16($name) {\n echo \"<img src=\\\"icos/16-$name.png\\\" alt=\\\"\\\" width=\\\"16\\\" height=\\\"16\\\">\";\n }", "private function get_file_name( $entry_id ) {\n\t\treturn 'signature-' . $this->field->id . '-' . $entry_id . '.png';\n\t}", "public function preUpload()\n {\n $this->name = str_replace(' ', '-', $this->alt) . uniqid() . \".\" . $this->fichier->guessExtension();\n }", "public function get_image_title()\n {\n }", "function get_file_thumb($file){\n\t $fileArray=explode('.', $file);\n\t return $fileArray[0].THUMB_SURFIX.\".\".$fileArray[1];\n\n}", "public function getIcon() {\r\n\t\r\n\t$fileType = $this->getType();\r\n\t\r\n\t$image = array(\r\n\t 'image/gif',\r\n\t 'image/png',\r\n\t 'image/jpg',\r\n\t 'image/jpeg'\r\n\t);\r\n\t\r\n\t$rarZip = array(\r\n\t 'application/zip',\r\n 'application/x-rar-compressed'\r\n\t);\r\n\t\r\n\t$audio = array(\r\n\t 'audio/mpeg'\r\n\t);\r\n\t\r\n\t$video = array(\r\n\t 'video/quicktime',\r\n\t 'video/mp4'\r\n\t);\r\n\t\r\n\t$pdf = array(\r\n\t 'application/pdf'\r\n\t);\r\n\t\r\n\t$wordExcelPptx = array(\r\n\t 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n\t 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n\t 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n\t 'application/msword',\r\n\t 'application/vnd.ms-excel',\r\n\t 'application/vnd.ms-powerpoint'\r\n\t);\r\n\t\r\n\tif (in_array($fileType, $image)) {\r\n\t return \"image.png\";\r\n\t} elseif (in_array($fileType, $audio)) {\r\n\t return \"audio.png\";\r\n\t} elseif (in_array($fileType, $video)) {\r\n\t return \"video.png\";\r\n\t} elseif (in_array($fileType, $rarZip)) {\r\n\t return \"rarZip.png\";\r\n\t} elseif (in_array($fileType, $pdf)) {\r\n\t return \"pdf.png\";\r\n\t} elseif (in_array($fileType, $wordExcelPptx)) {\r\n\t return \"wordExcelPptx.png\";\r\n\t} else {\r\n\t return \"default.png\";\r\n\t}\r\n\t\r\n }", "function pangea_image($url, $custom = \"\") {\r\n\r\n $i = pathinfo($url);\r\n\r\n // need at least the extension to work with\r\n if(\r\n !isset($i[\"filename\"]) ||\r\n !isset($i[\"extension\"])\r\n ) {\r\n return( $url );\r\n }\r\n\r\n // two main parts\r\n $filename = $i[\"filename\"];\r\n $extension = $i[\"extension\"];\r\n\r\n // see if the image has already been size-modified\r\n // and if so, replace the $filename with the original version\r\n $p1 = explode(\"_tv\", $filename);\r\n $p2 = explode(\"_\", $filename);\r\n\r\n if( count($p1) !== 1 ) {\r\n // automated framegrab\r\n $filename = $p1[0] . \"_tv\";\r\n } elseif( count($p2) !== 1 ) {\r\n // other\r\n $filename = $p2[0];\r\n }\r\n\r\n // return reconstructed image url with optional $custom\r\n return(sprintf(\r\n \"%s/%s%s.%s\",\r\n $i[\"dirname\"],\r\n $filename,\r\n $custom,\r\n $extension\r\n ));\r\n}", "protected function createFilename()\n {\n $extension = \\File::extension(\\Input::file('photo')->getClientOriginalName());\n $filename = $this->applicant->slug . '_' . date('U') . '.' . $extension;\n\n return \\Str::lower($filename);\n }", "function getImageVariaton( $img_src, $variation ){\n $ext = pathinfo( $img_src, PATHINFO_EXTENSION );\n $filename = str_replace( '.'.$ext, '', $img_src ).$variation.'.'.$ext;\n return ( $filename );\n}", "public function getCategoryImageFileNameAttribute()\n {\n return $this->id . '-image.png';\n }", "public function getImageTmpName()\n {\n return $this->ImageTmpName;\n }", "public function get_name() {\n\t\treturn 'happyden-feature-image';\n\t}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->met_image_name = @iconv(\"utf-8\",\"GBK\",$this->met_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->met_image_name){\n $this->met_image_name = strtolower(trim($this->met_image_name));\n $met_image_type = $this->get_type($this->met_image_name);\n $met_image = $this->createImage($met_image_type,$this->met_image_name);\n $met_image_w=ImageSX($met_image);\n $met_image_h=ImageSY($met_image);\n $temp_met_image = $this->getPos($src_image_w,$src_image_h,$this->met_image_pos,$met_image);\n $met_image_x = $temp_met_image[\"dest_x\"];\n $met_image_y = $temp_met_image[\"dest_y\"];\n\t if($this->get_type($this->met_image_name)=='png'){imagecopy($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h);}\n\t else{imagecopymerge($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h,$this->met_image_transition);}\n}\nif ($this->met_text){\n $temp_met_text = $this->getPos($src_image_w,$src_image_h,$this->met_text_pos);\n $met_text_x = $temp_met_text[\"dest_x\"];\n $met_text_y = $temp_met_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->met_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $met_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $met_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->met_text_size, $this->met_text_angle, $met_text_x, $met_text_y, $met_text_color,$this->met_text_font, $this->met_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "function view_builder_logo($img,$w,$h,$alt)\n{\n if(file_exists(\"builder/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"include/phpThumb.php?src=../builder/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='mar7L' />\";\n else\n $temp =\"<img src=\\\"include/phpThumb.php?src=../builder/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='mar7L'/>\";\n \n\treturn $temp;\t\t\t}", "function imagemIcone($nomeArquivo, $width = 17)\r\n\t{\r\n\t\t$imagem = \"<img src='/revoc/sistemas/pdv_premium/requires/img/icons/$nomeArquivo' width='\".$width.\"px'>\";\r\n\t\treturn $imagem;\r\n\t}", "public static function newImageName($imageFile)\n {\n //Get file name with extension\n $cover_image_name_ext = $imageFile->getClientOriginalName();\n \n //Get just Filename\n $filename = pathinfo($cover_image_name_ext, PATHINFO_FILENAME);\n \n //Get extension\n $extension = $imageFile->getClientOriginalExtension();\n \n //Create new filename to store\n $filename_to_store = $filename.'_'.time().'.'.$extension;\n\n return $filename_to_store;\n }", "private function createTabImage()\n {\n $filePath = _PS_MODULE_LENGOW_DIR_ . 'views/img/AdminLengow.gif';\n $fileDest = _PS_MODULE_LENGOW_DIR_ . 'AdminLengow.gif';\n if (!file_exists($fileDest) && LengowMain::compareVersion('1.5') == 0) {\n copy($filePath, $fileDest);\n }\n }", "public function getBannerImageNameAttribute(){\n $photo_details = pathinfo($this->attributes['name']); \n $name = @$photo_details['filename'].'_1349x402.'.@$photo_details['extension'];\n return $name;\n }" ]
[ "0.76361454", "0.74944025", "0.68055826", "0.66019374", "0.6599242", "0.6576761", "0.65444136", "0.6507727", "0.6493835", "0.64035404", "0.64034975", "0.6264035", "0.6226564", "0.621767", "0.62126434", "0.61867845", "0.615337", "0.61518663", "0.6137972", "0.613783", "0.61376846", "0.6107577", "0.60900956", "0.6054957", "0.6028583", "0.60219336", "0.60181934", "0.60165644", "0.60154635", "0.6001129", "0.599675", "0.5978495", "0.5970294", "0.5935501", "0.589909", "0.58940095", "0.5879388", "0.58748174", "0.5868077", "0.58515704", "0.58471966", "0.5844293", "0.5840469", "0.58376944", "0.5821617", "0.58164054", "0.5813182", "0.58127785", "0.58102673", "0.5808959", "0.5798725", "0.5796624", "0.5791836", "0.57915777", "0.57871896", "0.5786299", "0.5777815", "0.5773272", "0.57721347", "0.57661337", "0.5761765", "0.5747415", "0.57443047", "0.5736979", "0.57368594", "0.5723918", "0.5709243", "0.57021445", "0.5694726", "0.56892073", "0.56890845", "0.568567", "0.56827796", "0.5681421", "0.5678384", "0.567828", "0.5677238", "0.56697625", "0.5668129", "0.5667696", "0.56570005", "0.56564796", "0.56553173", "0.5654448", "0.5649015", "0.5647289", "0.56418556", "0.5640156", "0.56355166", "0.56205773", "0.5616448", "0.5612985", "0.56095827", "0.5605878", "0.56056684", "0.5604197", "0.5603973", "0.5602975", "0.56001633", "0.5600118" ]
0.764747
0
Build images display for image management view
function buildImageDisplay($imageArray) { $id = '<ul id="image-display">'; foreach ($imageArray as $image) { $id .= '<li>'; $id .= "<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>"; $id .= "<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>"; $id .= '</li>'; } $id .= '</ul>'; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function combineImages() {}", "function buildImageDisplay($imageArray)\n{\n $id = '<ul id=\"image-display\">';\n foreach ($imageArray as $image) {\n $id .= '<li>';\n $id .= \"<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>\";\n $id .= \"<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>\";\n $id .= '</li>';\n }\n $id .= '</ul>';\n return $id;\n}", "public static function theme_images() {\r\n add_image_size('slideshow-980', 980, 420, true);\r\n add_image_size('slideshow-1200', 1180, 550, true);\r\n add_image_size('slideshow-1560', 1540, 550, true);\r\n add_image_size('slideshow-720', 600, 550, true);\r\n add_image_size('grid-thumbnail', 370, 270, true);\r\n add_image_size('icon-60', 60, 60, true);\r\n add_image_size('icon-100', 100, 100, true);\r\n add_image_size('icon-40', 40, 40, true);\r\n }", "private function buildImagesFields()\n {\n $groupName = Translate::getAdminTranslation(\"Images\", \"AdminProducts\");\n\n //====================================================================//\n // PRODUCT IMAGES\n //====================================================================//\n\n //====================================================================//\n // Product Images List\n $this->fieldsFactory()->create(SPL_T_IMG)\n ->Identifier(\"image\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Images\", \"AdminProducts\"))\n ->Group($groupName)\n ->MicroData(\"http://schema.org/Product\", \"image\");\n\n //====================================================================//\n // Product Images => Position\n $this->fieldsFactory()->create(SPL_T_INT)\n ->Identifier(\"position\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Position\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"positionImage\")\n ->Group($groupName)\n ->isNotTested();\n\n //====================================================================//\n // Product Images => Is Cover\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->Identifier(\"cover\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Cover\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"isCover\")\n ->Group($groupName)\n ->isNotTested();\n\n //====================================================================//\n // Product Images => Is Visible Image\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->Identifier(\"visible\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Visible\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"isVisibleImage\")\n ->Group($groupName)\n ->isNotTested();\n }", "public function presentation_images()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$data['presentation_images'] = $this->pim->get_all();\n $data['presentation_act'] = $this->pim->get_link();\n\t\t\t$this->load->view('presentation_images-admin', $data);\n\t\t}", "public function view_images()\n {\n $data['images'] = $this->Image_model->get_images();\n $this->load->view('student/index', $data);\n }", "public function index()\n {\n return view('admin.list.images', [\n 'pageImages' => Image::where('imageType', '=', 'page')->get(),\n 'backgroundImages' => Image::where('imageType', '=', 'background')->get()\n ]);\n }", "public function show_images(){\n\t\t\t$dir = '../pictures/';\n\t\t\t//checks if is an actual directory, opens it and reads each and returns filename.ext\n\t\t\tif (is_dir($dir)) {\n\t\t\t if ($dh = opendir($dir)) {\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t \tif( $file == '.' || $file == '..'){//readdir returns ., .. before actual filenames\n \t\tcontinue;//they are ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//href value is to a include file showlarge.inc.php\n\t\t\t\t\t\techo \"<a href=?value=showlarge&value={$file}>\";\n\t\t\t\t\t\techo \"<img class = 'picture' src='{$dir}{$file}'></a>\";\n\t\t\t }\n\t\t\t closedir($dh);\n\t\t\t }\n\t\t\t}\n\t\t}", "function buildGallery ()\t{\n\t\t\t// Get the needed Information\n\t\t\t\n\t\t}", "protected function buildImagesFields()\n {\n $groupName = Translate::getAdminTranslation(\"Images\", \"AdminProducts\");\n\n //====================================================================//\n // PRODUCT IMAGES\n //====================================================================//\n\n //====================================================================//\n // Product Images List\n $this->fieldsFactory()->create(SPL_T_IMG)\n ->identifier(\"image\")\n ->inList(\"images\")\n ->name(Translate::getAdminTranslation(\"Images\", \"AdminProducts\"))\n ->group($groupName)\n ->microData(\"http://schema.org/Product\", \"image\")\n ->isReadOnly(self::isSourceCatalogMode())\n ->addOption(\"shop\", MSM::MODE_ALL)\n ;\n\n //====================================================================//\n // Product Images => Position\n $this->fieldsFactory()->create(SPL_T_INT)\n ->identifier(\"position\")\n ->inList(\"images\")\n ->name(Translate::getAdminTranslation(\"Position\", \"AdminProducts\"))\n ->microData(\"http://schema.org/Product\", \"positionImage\")\n ->group($groupName)\n ->isReadOnly(self::isSourceCatalogMode())\n ->addOption(\"shop\", MSM::MODE_ALL)\n ->isNotTested()\n ;\n\n //====================================================================//\n // Product Images => Is Cover\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->identifier(\"cover\")\n ->inList(\"images\")\n ->name(Translate::getAdminTranslation(\"Cover\", \"AdminProducts\"))\n ->microData(\"http://schema.org/Product\", \"isCover\")\n ->group($groupName)\n ->isReadOnly(self::isSourceCatalogMode())\n ->addOption(\"shop\", MSM::MODE_ALL)\n ->isNotTested()\n ;\n\n //====================================================================//\n // Product Images => Is Visible Image\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->identifier(\"visible\")\n ->inList(\"images\")\n ->name(Translate::getAdminTranslation(\"Visible\", \"AdminProducts\"))\n ->microData(\"http://schema.org/Product\", \"isVisibleImage\")\n ->group($groupName)\n ->isReadOnly(self::isSourceCatalogMode())\n ->addOption(\"shop\", MSM::MODE_ALL)\n ->isNotTested()\n ;\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public function imagesAction()\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 \n \n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\") || $logedUser[\"idCompany\"] == 1) {\n $request = $this->getRequest();\n }\n \n $images = $this->getImageTable()->fetchAll($logedUser[\"idWebsite\"]);\n $this->layout(\"layout/images.phtml\");\n return array(\n \"images\" => $images,\n \"idWebsite\" => $logedUser[\"idWebsite\"]\n );\n } else {\n return $this->redirect()->toRoute(\"noPermission\");\n }\n }", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "protected function generateImages() {\n if ($this->buildNamespace($this->imageFolder) && $this->createShortUrl()) {\n foreach ($this->inputs as $input) {\n $this->generate($input);\n }\n }\n\n return $this->responseJSON();\n }", "private function generateThumbnailImagick(){\n\t}", "function mob_images() {\n\tupdate_option( 'thumbnail_size_w', 360 );\n\tupdate_option( 'thumbnail_size_h', 220 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\n\tupdate_option( 'medium_size_w', 654 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_crop', 0 );\n\n\tupdate_option( 'medium_large_size_w', 0 );\n\tupdate_option( 'medium_large_size_h', 0 );\n\n\tupdate_option( 'large_size_w', 850 );\n\tupdate_option( 'large_size_h', 400 );\n\tupdate_option( 'large_crop', 1 );\n\n\tadd_image_size( 'archive-blog', 360, 170, true );\t\n}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "protected function _build() {\n $alt_title = $this->isXhtml ? tep_output_string_protected( str_replace ( '&amp;', '&', $this->attributes['alt'] ) ) : tep_output_string( $this->attributes['alt'] );\n $parameters = tep_not_null( $this->parameters ) ? tep_output_string( $this->parameters ) : false;\n $width = (int)$this->_calculated_width;\n $height = (int)$this->_calculated_height;\n $this->_html = '<img width=\"' . $width . '\" height=\"' . $height . '\" src=\"' . $this->src . '\" title=\"' . $alt_title . '\" alt=\"' . $alt_title . '\"';\n if ( false !== $parameters ) $this->_html .= ' ' . html_entity_decode(tep_output_string( $parameters ));\n $this->_html .= $this->isXhtml ? ' />' : '>'; \n }", "public function addImagesSizes() {\n\t\t// add_image_size( 'small', 225, 9999 );\n\t\t// add_image_size( 'hero', 1600, 9999 );\n\t}", "public function providerBuildImage()\n {\n\n return [\n [\n ['action' => 'scale_and_crop', 'width' => 40, 'height' => '25%'],\n ['action' => 'scale_and_crop', 'width' => 40, 'height' => 125],\n ],\n [\n ['action' => 'scale', 'width' => 40],\n ['action' => 'scale', 'width' => 40],\n ],\n [\n ['action' => 'scale', 'width' => '50%'],\n ['action' => 'scale', 'width' => 250],\n ],\n [\n ['action' => 'crop', 'height' => '50%', 'yoffset' => 20],\n ['action' => 'crop', 'height' => 250, 'yoffset' => 20],\n ],\n [\n ['action' => 'crop', 'height' => 20, 'yoffset' => 'bottom'],\n ['action' => 'crop', 'height' => 20, 'yoffset' => 480],\n ],\n [\n ['action' => 'crop', 'width' => '50%', 'xoffset' => 'center'],\n ['action' => 'crop', 'width' => '250', 'xoffset' => 125],\n ],\n [\n ['action' => 'crop', 'width' => '20', 'xoffset' => 'left'],\n ['action' => 'crop', 'width' => '20', 'xoffset' => 0],\n ],\n ];\n }", "function print_images()\n {\n $images = $this->service->imageList();\n $image_choice = 0;\n foreach ($images as $image) {\n printf(\"%d) %s: Image %s requires min. %dMB of RAM and %dGB of disk\\n\",\n $image_choice, $image->id, $image->name, $image->minRam,\n $image->minDisk);\n $image_choice += 1;\n }\n }", "function show_images() {\n global $app;\n $images = new entities\\Image();\n $cursor = $images->getRange($app, 0);\n $posts = array();\n \n foreach ($cursor->toArray() as $post) {\n $posts[] = $post;\n }\n return $app['twig']->render('admin/admin_images.twig', array('images' => $posts));\n}", "function generate_image_sizes() {\n\t$display_options = get_customizer_settings()[ WPM_PREFIX . 'collection_style' ];\n\n\tadd_image_size(\n\t\tWPM_PREFIX . 'list_thumb',\n\t\t$display_options['list_image_max_width'],\n\t\t$display_options['list_image_max_height']\n\t);\n}", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function showThumbnails() {\n $this->generateHead();\n $thumbnailsArray = $this->getThumbnailsArray();\n for($i = 0; $i < $this->rowsCount * 2; $i ++){\n echo '<div class=\"col-xs-6\">';\n echo '<a href=\"big_img.php?img_id=' . $thumbnailsArray[$i]['id'] . '\" class=\"thumbnail\">';\n echo '<img src=\"images/thumbnails/' . $thumbnailsArray[$i]['filename'] . '\" alt=\"\">';\n echo '</a>';\n echo '</div>';\n }\n $this->generateFoot();\n }", "public function build()\n {\n if ($this->_inline) {\n $encoded_image = base64_encode(file_get_contents($this->_attributes['src']));\n $mime_type = image_type_to_mime_type($this->_image_type);\n $this->_attributes['src'] = \"data:{$mime_type};base64,{$encoded_image}\";\n\n if (isset($this->_attributes['async'])) {\n unset($this->_attributes['async']);\n }\n }\n\n $attributes = join(' ', $this->_makeAttributesArr());\n if (!empty($attributes)) {\n $attributes = ' ' . $attributes;\n }\n return \"<img{$attributes}>\";\n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "function outputImages($collectionObject) {\r\n\t$results = $collectionObject->getArray();\r\n\r\n\tfor($i=0;$i<$collectionObject->getCount();$i++){\r\n\t\techo '<div class=\"col-md-3\">';\r\n\t\techo '<a href=\"single-image.php?id=' . $results[$i]->getImageID() . '\">';\r\n\t\techo '<img src=\"travel-images/square-medium/'. $results[$i]->getPath() . '\" title=\"\" class=\"thumbnail\" />';\r\n\t\techo '</a>';\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "public function images(){\n $images = DB::table('images')->simplePaginate(15);\n return view('admin.images')->with('images', $images);\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}", "public function addImages()\n {\n $offices = $this->service->getOffices();\n\n return view('admin.office.addimages',['offices' => $offices]);\n }", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "public function add_image_sizes() {\n add_image_size( 'label_thumbnail', 100, 100, true );\n }", "function display_full_image_template($classified_id)\n {\n if (!$classified_id) {\n return false;\n }\n $db = DataAccess::getInstance();\n $listing = geoListing::getListing($classified_id);\n if ($listing && $listing->category) {\n $template_category = (int)$listing->category;\n } else {\n return false;\n }\n\n $view = geoView::getInstance();\n $view->setCategory((int)$template_category);\n //don't do the template stuff, let view class do that...\n //just set the vars\n $template_file = $view->getTemplateAttachment('84_detail', $this->language_id, $template_category);\n\n $this->get_image_data($db, $classified_id, 1);\n reset($this->images_to_display);\n\n $images = array();\n\n foreach ($this->images_to_display as $value) {\n $tpl = new geoTemplate(geoTemplate::MAIN_PAGE, '');\n\n //check any full sized image limits\n if (\n ($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) ||\n ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT)\n ) {\n if (($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) && ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT)) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH * 100) / $value[\"original_image_width\"];\n $imagevsize = ($value[\"original_image_height\"] * $imageprop) / 100 ;\n $image_width = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH;\n $image_height = ceil($imagevsize);\n\n if ($image_height > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT * 100) / $value[\"original_image_height\"];\n $imagehsize = ($value[\"original_image_width\"] * $imageprop) / 100 ;\n $image_height = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT;\n $image_width = ceil($imagehsize);\n }\n } elseif ($value[\"original_image_width\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH * 100) / $value[\"original_image_width\"];\n $imagevsize = ($value[\"original_image_height\"] * $imageprop) / 100 ;\n $image_width = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_WIDTH;\n $image_height = ceil($imagevsize);\n } elseif ($value[\"original_image_height\"] > $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT) {\n $imageprop = ($this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT * 100) / $value[\"original_image_height\"];\n $imagehsize = ($value[\"original_image_width\"] * $imageprop) / 100 ;\n $image_height = $this->ad_configuration_data->MAXIMUM_FULL_IMAGE_HEIGHT;\n $image_width = ceil($imagehsize);\n } else {\n $image_width = $value[\"original_image_width\"];\n $image_height = $value[\"original_image_height\"];\n }\n } else {\n $image_width = $value[\"original_image_width\"];\n $image_height = $value[\"original_image_height\"];\n }\n\n if ($value['icon']) {\n $image = \"<a href=\\\"\" . $value['url'] . \"\\\"><img src=\\\"\" . geoTemplate::getUrl('', $value['icon']) . \"\\\" alt=\\\"\\\" style=\\\"border: none;\\\" /></a>\";\n } else {\n $image = \"<img src='{$value[\"url\"]}' alt='' />\";\n }\n\n $tpl->assign('full_size_image', $image);\n if (strlen($value[\"image_text\"]) > 0) {\n $text = \"<br />\" . $value[\"image_text\"];\n $tpl->assign('full_size_text', $text);\n }\n\n $images[] = $tpl->fetch($template_file);\n }\n return $images;\n }", "function createImage($idName) { //TODO: Add parameter for passing image files to use instead \n echo '<img src=\"/php/cms-img/file2.png\" id=\"' . $idName . '\" class=\"nested\"/>';\n }", "public function index()\n {\n $images = Image::latest()->paginate(10);\n $tour = Tour::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n $category = Category::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n\n return view('admin.image.index', [\n 'data' => $images,\n 'tour' => $tour,\n 'category' => $category\n ]);\n }", "private function generate()\n {\n $originalImages = Storage::files(env('PHOTO_PATH'));\n\n foreach ($originalImages as $originalImage) {\n $pieces = explode('/', $originalImage);\n\n $exp = explode('.', end($pieces));\n\n $extension = end($exp);\n\n array_pop($exp);\n\n $imageId = implode('.', $exp);\n\n $photos = [];\n\n foreach ($this->dimensions as $key => $dimension) {\n $fileName = env('PHOTO_PATH_RESIZE') . \"{$imageId}_{$key}.$extension\";\n\n if (! Storage::exists($fileName)) {\n $img = Image::make(Storage::get($originalImage));\n $img->resize($dimension['width'], $dimension['height']);\n\n Storage::put($fileName, (string)$img->encode(), 'public');\n\n if (Storage::exists($fileName)) {\n $photos[$key] = asset(Storage::url($fileName));\n }\n }\n }\n\n /**\n * Save on Storage\n */\n if (count($photos)) {\n $photo = new Photo();\n $photo->name = $imageId;\n $photo->photos = $photos;\n $photo->photos = $photos;\n $photo->save();\n }\n }\n }", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "function build_bw_gallery () {\n\t/**\n\t* Start by collecting path and setup information\n\t**/\n\t$bwgallery_dr = dirname(dirname(__FILE__)); //directory of gallery core files\n\t$bwgallery_webdr = str_replace($_SERVER['DOCUMENT_ROOT'],\"\",dirname(dirname(__FILE__))); //relative path\n\t$bwgallery_img = scandir($bwgallery_dr.\"/images\",1); //gather list of files from images folder\n\t$bwgallery_ext_search = array(\"jpg\",\"jpeg\",\"gif\",\"png\"); //list of acceptable file extensions\n\t$bwgallery_thumb = \"\"; \n\t$bwgallery_display = \"\";\n\t\n\t/**\n\t* prepare image list\n\t**/\n\tforeach($bwgallery_img as $k=>$v) {\n\t\t$ext = pathinfo($v, PATHINFO_EXTENSION); //identify file extensions\n\t\tif (in_array($ext,$bwgallery_ext_search)) { //weed out non-image files\n\t\t\t$size = getimagesize($bwgallery_dr.\"/images/\".$v); //get image size\n\t\t\t$w = $size[0];\n\t\t\t$h = $size[1];\n\t\t\t$bwgallery_images[] = array('img'=>$v,'width'=>$size[0],'height'=>$size[1]);\n\t\t}\n\t}\n\t\n\t/**\n\t*get image information from csv if exists\n\t**/\n\t$bwgallery_descriptions = array();\n\tif (($handle = fopen($bwgallery_dr.\"/bw_gallery.csv\", \"r\")) !== FALSE) {\n\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t$bwgallery_descriptions[$data[0]] = $data[1];\n\t\t}\n\t\tfclose($handle);\n\t}\n\t\n\t/**\n\t* build html blocks for gallery\n\t**/\n\tforeach($bwgallery_images as $k=>$v) {\n\t\t$style = \"\";\n\t\t$bwgallery_thumb .= \"<li class=\\\"bw_gallery_titem\\\" rel=\\\"bw_gallery_imgdisplay_item\".$k.\"\\\"><img src=\\\"\".$bwgallery_webdr.\"/images/\".$v['img'].\"\\\" rel=\\\"bw_gallery_imgdisplay_item\".$k.\"\\\" /></li>\";\n\t\t\tif ($k == 0) {\n\t\t\t\t$style .= \"display:block;\";\n\t\t\t}\n\t\t\t$bwgallery_display .= \"<div class=\\\"bw_gallery_imgdisplay_item bw_gallery_imgdisplay_item\".$k.\"\\\" style=\\\"\".$style.\"\\\"><img src=\\\"\".$bwgallery_webdr.\"/images/\".$v['img'].\"\\\" /><div class=\\\"bw_gallery_imgdisplay_item_description\\\">\".$bwgallery_descriptions[$v['img']].\"</div></div>\";\n\t}\n\t\n\t/**\n\t* return variables for gallery display\n\t**/\n\treturn array(\n\t\t'webdr'=>$bwgallery_webdr,\n\t\t'images'=>$bwgallery_images,\n\t\t'thumb'=>$bwgallery_thumb,\n\t\t'display'=>$bwgallery_display\n\t);\n}", "public function storingImagesDataProvider(){\n\n return [\n [[['path' => 'my/file.png', 'height' => 200, 'width' => 300]]],\n [[['path' => 'my/file.png', 'height' => 200, 'width' => 300]], [['path' => 'test/new.png', 'height' => 500, 'width' => 250]]]\n\n ];\n }", "function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getImageAction()\n {\n $homebanner = $this->_getInitialBanner();\n $em = $this->getDoctrine()->getManager();\n $tagname = $homebanner->getName(); // Get image tag for home page banner slides\n\n $images = '';\n // TODO: add ability to use comma separated tags\n if (!empty($tagname)) {\n $images = $em->createQueryBuilder()\n ->select('bl')\n ->from('CmsXutBundle:Gist', 'bl')\n ->where('bl.type = :gisttype')\n ->setParameter('gisttype', 'image')\n ->addOrderBy('bl.date_created');\n\n $tag = $em->getRepository('CmsXutBundle:Tag')->findOneByName($tagname);\n if (count($tag) > 0) {\n $images = $images->innerJoin('bl.tags', 'tg')\n ->andWhere('tg.id = :tag')\n ->setParameter('tag', $tag->getId());\n\n $images = $images->getQuery()\n ->getResult();\n } else {\n $images = '';\n }\n }\n\n return $this->render('CmsHomeBannerBundle:Homebanner:images.html.twig', array(\n 'images' => $images,\n 'banner' => $homebanner\n ));\n }", "function shop_uc_product_image($variables) {\n static $rel_count = 0;\n $images = $variables['images'];\n\n // Get the current product image widget.\n $image_widget = uc_product_get_image_widget();\n\n $first = array_shift($images);\n\n //$output = '<div class=\"product-image\"><div class=\"main-product-image\">'; // Sudhakar\n $output = '<div class=\"product_img_big\">';\n $output .= '<a href=\"' . image_style_url('uc_product_full', $first['uri']) . '\" title=\"' . $first['title'] . '\"';\n if ($image_widget) {\n $image_widget_func = $image_widget['callback'];\n $output .= $image_widget_func($rel_count);\n } \n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_product',\n 'path' => $first['uri'],\n 'alt' => $first['alt'],\n 'title' => $first['title'],\n\t'width' => 100, // Sudhakar\n\t'height' => 92, // Sudhakar\n ));\n // $output .= '</a></div>'; // Sudhakar\n $output .= '</a>';\n\n if (!empty($images)) {\n $output .= '<div class=\"more-product-images\">';\n foreach ($images as $thumbnail) {\n // Node preview adds extra values to $images that aren't files.\n if (!is_array($thumbnail) || empty($thumbnail['uri'])) {\n continue;\n }\n $output .= '<a href=\"' . image_style_url('uc_product_full', $thumbnail['uri']) . '\" title=\"' . $thumbnail['title'] . '\"';\n if ($image_widget) {\n $output .= $image_widget_func($rel_count);\n }\n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_thumbnail',\n 'path' => $thumbnail['uri'],\n 'alt' => $thumbnail['alt'],\n 'title' => $thumbnail['title'],\n ));\n $output .= '</a>';\n }\n $output .= '</div>';\n }\n\n $output .= '</div>';\n $rel_count++;\n\n return $output;\n}", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "public function run()\n {\n foreach ($this->getImages() as $image) {\n Image::create($image);\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}", "function displayImages($albumDir, $whichGallery, $displayMode) {\n\t\t// create var to store name of folder where album of galleries is located\n\t\t$album = $albumDir.'/';\n\t\t\n\t\t//store value of the current target directory\n\t\t$targetGallery = $whichGallery.'/'; //pulled from a function argument 1\n\t\t\n\t\t//set currently selected gallery's pathway\n\t\t$currentGalleryPath = $album.$targetGallery;\n\t\t\n\t\t$large = 'large/'; //large images for cover background images (1800+px)\n\t\t$medium = 'medium/'; //standard size (max = 1100w)\t\n\t\t$small = 'small/'; //thumbnail for lightbox styled gallery (max. - 200w)\n\t\t\n\t\t//store dir to be scanned for contents into an array variable\n\t\t$imageList = scandir($currentGalleryPath.$medium);\n\t\t\n\t\tif (file_exists($currentGalleryPath.$large) &&\n\t\t\tfile_exists($currentGalleryPath.$medium) &&\n\t\t\tfile_exists($currentGalleryPath.$small)\n\t\t\t\n\t\t) {\n\t\t\t\n\t\t\n\t\t//initiate an empty array for unwanted items\n\t\t$unwanted = array();\n\t\t//define acceptable filetypes found in key[2] of getimagesize\n\t\t$acceptable_arrays = array(1,2,3,6,9);\n\t\t//print_r(get_defined_constants());\n\t\t//this defines all constants on the page. Look for imagetype to build array from.\n\t\t\n\t\t//loop through $imageList to remove unwanted items\n\t\tforeach ($imageList as $filename) {\n\t\t\t//check to see if item starts with '.' or if is a directory\n\t\t\tif ((strpos($filename,'.') == 0) || is_dir($filename)) {\n\t\t\t\t//push item into unwanted array\n\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t//compare current state of $imageList to current state of $unwanted and strip unwanted items from $imageList\n\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t} else {\n\t\t\t\t//store the file info inside $size array using getimagesize\n\t\t\t\t$size = getimagesize($album.$targetGallery.$medium.$filename);\t\n\t\t\t\tif (!$size[2] || !in_array($size[2], $acceptable_arrays)) {\n\t\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t\n\t\t<?php \n\t\t\t// ----- CREATE FILTERING ARRAYS TO BE USED LATER ----- //\n\t\t\t$fileExt = array('.jpg', '.jpeg', '.png', '.bmp', '.gif'); //for stripping extensions for alt text\n\t\t\t$characters = array('-', '_'); //stripping out special characters in filename for alt text\n\t\t\t\n\t\t\t//create $title of album to use for image gallery info below\n\t\t\t$title = ucwords(str_replace($characters,' ', $whichGallery));\n\t\t?>\n\t\t<?php switch ($displayMode) {\n\t\tcase 'img':\n\t\t\t//----- GRAB RANDOM IMAGE FOR IMG -----//\n\t\t\t\t//testing how array_rand() works ... returns numeric key integer\n\t\t\t\t//echo \"THIS IS THE RANDOM KEY PULLED: \";\n\t\t\t\t//$randomKey = array_rand($imageList);\n\t\t\t\t//$image = $imageList[$randomKey];\n\t\t\t\n\t\t\t//grab random image from $imageList\n\t\t\t$image = $imageList[array_rand($imageList)];\n\t\t\t\n\t\t\t//create alt text for image\n\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t?>\n\t\t<p class=\"random-image\"><img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image) ?>\" alt=\"<?php echo $alt ?>\"></p>\n\t\t<hr>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'background':\n\t\t//----- GRAB RANDOM IMAGE FOR BACKGROUND -----//\n\t\t$image = $imageList[array_rand($imageList)]; ?>\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tbackground: url(<?php echo $currentGalleryPath.$large.rawurlencode($image) ?>) no-repeat center center;\t\n\t\t\t\t-webkit-background-size: cover;\n\t\t\t\t-moz-background-size: cover;\n\t\t\t\t-o-background-size: cover;\n\t\t\t\tbackground-size: cover;\n\t\t\t}\n\t\t</style>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'lightbox':\n\t\t// ----- GENERATE THUMBNAIL GALLERY ----- //\n\t\t\n\t\t//call out globals for the lightbox switch case\n\t\tglobal $jquery, $lightbox;\n\t\t//test to see if jquery library has been called\n\t\tif (!isset($jquery)) {\n\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t$jquery = true;\n\t\t}\n\t\t//test to see if lightbox library has been called\n\t\tif (!isset($lightbox)) {\n\t\t\techo '<script src=\"js/lightbox.js\"></script>'.\"\\n\";\n\t\t\techo '<link href=\"css/lightbox.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t$lightbox = true;\n\t\t}\n\t\t?>\n\t\t<h2 class=\"gallery\"><?php echo $title; // announce the gallery?></h2>\n\t\t<ul class=\"gallery\">\n\t\t\t<?php\n\t\t\t\tforeach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" title=\"<?php echo $alt; ?>\" data-lightbox=\"<?php echo $title; ?>\" >\n\t\t\t\t\t\t<img src=\"<?php echo $currentGalleryPath.$small.rawurlencode($image) ?>\" alt=\"<?php echo $alt; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } break; ?>\n\t\t</ul>\n \n <?php \n\t\tcase 'slideshow':\n\t\t//call out globals for the lightbox switch case\n\t\t\tglobal $jquery, $slideshow;\n\t\t\t//test to see if jquery library has been called\n\t\t\tif (!isset($jquery)) {\n\t\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t\t$jquery = true;\n\t\t\t}\n\t\t\t//test to see if lightbox library has been called\n\t\t\tif (!isset($slideshow)) {\n\t\t\t\techo ' <script src=\"js/cycle2.min.js\"></script>'.\"\\n\";\n\t\t\t\techo '<link href=\"css/cycle2.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t\t$slideshow = true;\n\t\t\t}\n\t\t?> \n <div class=\"cycle-slideshow\" data-cycle-fx=fadeout data-cycle-speed=1500 Horz data-cycle-timeout=4000>\n <!-- empty element for overlay -->\n <div class=\"cycle-overlay\"></div>\n <?php foreach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt)); ?>\n <img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" data-cycle-title=\"<?php echo $title; ?>\" data-cycle-desc=\"<?php echo $alt; ?>\">\n <?php } //end foreach ?>\n </div>\n<?php break; ?>\n\t\t<?php\n\t\t\n\t\t}//END SWITCH $displayMode\n\t\t} else {\n\t\t\t//print this to screen if the directories cannot be found.\n\t\t\techo \"<p>The selected gallery is not available.</p>\";\t\n\t\t}//END file_exists() FUNCTION\n\t}", "public function index()\n {\n $imagesArray = glob(config('media.imagesPath').'*.*');\n if (count($imagesArray) > 0) {\n foreach ($imagesArray as $key => $image) {\n $imagesArray[$key] = substr($image, strlen(config('media.imagesPath')));\n }\n }\n\n return view('index', [\n 'imagesArray' => $imagesArray\n ]);\n }", "protected function show()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n $this->sendHeader('gif');\n imagegif($this->image, '');\n break;\n \n case 'image/jpeg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/jpg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/png':\n $this->sendHeader('png');\n imagepng($this->image, '', round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n }", "private function makeImageList()\n\t{\n\t\t$images_dir = self::$locator->banner_images_dir($this->trip, $this->slug);\n\t\t$trip = $this->trip;\n\t\t$slug = $this->slug;\n\t\t/// This is a hack so that unit testing does not have to setup Locator\n\t\t/// for every test.\n\t\tif (! is_dir($images_dir)) {\n\t\t\treturn [];\n\t\t}\n\t\t$list = scandir($images_dir);\n\t\t$x = [];\n\t\tforeach ($list as $ent) {\n\t\t\tif (($ent != \".\") && ($ent != \"..\") && (substr($ent, 0, 1) != \".\")) {\n\t\t\t\t$tmp = new \\stdClass();\n\t\t\t\t$tmp->url = self::$locator->url_banner_image($trip, $slug, $ent);\n\t\t\t\t$tmp->path = self::$locator->banner_image_filepath($trip, $slug, $ent);\n\t\t\t\t$x[] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$this->images_list = $x;\n\t}", "public function images()\n {\n return view('pages.images');\n }", "function albums_admin_show_images($album) {\n\tglobal $lang, $var1;\n\n\t$images = albums_get_images($album);\n\tif ($images == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span><br />';\n\n\telse {\n\t\tforeach ($images as $image) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1.'/'.$image['filename_image']; ?>\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1; ?>/thumb/<?php echo $image['filename_image']; ?>\" title=\"<?php echo $image['title']; ?>\" alt=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\">\n\t\t\t\t\t\t<span class=\"kop3\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<span class=\"small\"><?php echo $image['info']; ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_image']; ?>\" alt=\"<?php echo $lang['albums']['edit_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imageup&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/up.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imagedown&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/down.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deleteimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_image']; ?>\" alt=\"<?php echo $lang['albums']['delete_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($image);\n\t}\n}", "public function showOfficeImages()\n {\n $officeImages = $this->service->getOfficeImages();\n\n return view('admin.office.showimages',['officeImages' => $officeImages]);\n }", "public function Images()\n {\n $pngLeftTop = $this->objFromFixture('Image', 'pngLeftTop');\n $pngLeftTop->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightTop = $this->objFromFixture('Image', 'pngRightTop');\n $pngRightTop->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightTop->VerticalSliceBottomRightColor = '0000ff';\n $pngRightTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngRightTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightBottom = $this->objFromFixture('Image', 'pngRightBottom');\n $pngRightBottom->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightBottom->VerticalSliceBottomRightColor = '0000ff';\n $pngRightBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngRightBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n $pngLeftBottom = $this->objFromFixture('Image', 'pngLeftBottom');\n $pngLeftBottom->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftBottom->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngLeftBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n return array($pngLeftTop, $pngRightTop, $pngRightBottom, $pngLeftBottom);\n }", "function get_html_listing( $options=array() )\n\t{\n\t\t/**\n\t\t* Set a default for how many columns to show\n\t\t**/\n\t\t$options['imgs_per_col'] = ( isset( $options['imgs_per_col'] ) ) ? $options['imgs_per_col'] : 5;\n\n\t\t/**\n\t\t* Do we actually have images to show?\n\t\t**/\n\t\tif( $this->total_images )\n\t\t{\n\t\t\t/**\n\t\t\t* Output the beginning of the row\n\t\t\t**/\n\t\t\t$output .= $this->img_html->view_begin_row();\n\t\t\t\n\n\t\t\t/**\n\t\t\t* Loop through and display images\n\t\t\t**/\n\t\t\twhile( $i = $this->ipsclass->DB->fetch_row( $this->res ) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* Reset some variables\n\t\t\t\t**/\t\t\t\t\n\t\t\t\t$alt = \"\";\n\t\t\t\t$img_view_elements = array();\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* If we're showing 4 or more cols per row, shorten the caption\n\t\t\t\t**/\n\t\t\t\t\n\t\t\t\tif ( $options['imgs_per_col'] >= 4 )\n\t\t\t\t{\n\t\t\t\t\t$i['caption'] = $this->ipsclass->txt_truncate( $i['caption'], 25 );\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Do we need to start listing images on the next row?\n\t\t\t\t**/\t\t\t\t\t\n\t\t\t\tif( $col_count >= $options['imgs_per_col'] )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_end_row();\n\t\t\t\t\t$output .= $this->img_html->view_begin_row();\n\t\t\t\t\t$col_count = 0;\n\t\t\t\t}\n\t\t\t\t$col_count++;\n\n\t\t\t\t/**\n\t\t\t\t* Make an image tag\n\t\t\t\t**/\n\t\t\t\t$i['image'] = $this->glib->make_image_link( $i, $i['thumbnail'] );\t\t\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Figure out ordering\n\t\t\t\t**/\n\t\t\t\tfor( $j = 1; $j <=6; $j++ )\n\t\t\t\t{\n\t\t\t\t\tswitch( $this->_idx_order( $j ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* User Name\n\t\t\t\t\t\t**/\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'gallery_img_order_username':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_user'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$name = $this->glib->make_name_link( $i['mid'], ( $i['name'] ) ? $i['name'] : $this->ipsclass->lang['guest'] );\t\t\t\t\t\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['uploaded_by'], $name );\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Date\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_date':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_date'] )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['on'], $this->ipsclass->get_date( $i['date'], 'LONG' ) );\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\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Filesize\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_size':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_filesize'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['filesize'], $this->glib->byte_to_kb( $i['file_size'] ) );\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\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Comment Count\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_comment':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_comments'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['l_comments'], $i['comments'] );\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* View Count\n\t\t\t\t\t\t**/\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'gallery_img_order_view':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_views'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['l_views'], $i['views'] );\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Ratings\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_rating':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_rate'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( ! class_exists( \"rate\" ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\trequire( $this->ipsclass->gallery_root . 'rate.php' );\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$rate = new rate;\n $rate->ipsclass =& $this->ipsclass;\n $rate->glib =& $this->glib;\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $rate->rating_display( $this->img_html, $i ), \"\", 'rate' );\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* Multi-moderation\n\t\t\t\t**/\t\n\t\t\t\t\n\t\t\t\tif( $this->mod && ( $this->ipsclass->input['cmd'] == 'sc' || $this->ipsclass->input['cmd'] == 'si' ) )\n\t\t\t\t{\n\t\t\t\t\t$i['extra'] = \"<a href='#' title='' onclick='gallery_toggle_img(\\\"{$i['id']}\\\"); return false;'><img name='img{$i['id']}' src='style_images/{$this->ipsclass->skin['_imagedir']}/topic_unselected.gif' /></a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Display the remove link if this is a favorite image\n\t\t\t\t**/\t\n\t\t\t\tif( $this->favorite )\n\t\t\t\t{\n\t\t\t\t\t$i['extra'] = \"<div class='fauxbutton' style='width:auto' align='center'><img src='{$this->ipsclass->vars['img_url']}/aff_cross.gif' style='vertical-align:middle' alt='x' /> <a href='{$this->ipsclass->base_url}automodule=gallery&cmd=favs&op=del&img={$i['id']}'>{$this->ipsclass->lang['rem_fav']}</a></div>\";\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Loop through the image information and add it to our output\n\t\t\t\t**/\t\n\t\t\t\tforeach( $img_view_elements as $element )\n\t\t\t\t{\n\t\t\t\t\t$alt = ( $alt == 'class=\"alt\"' ) ? '' : 'class=\"alt\"';\n\t\t\t\t\t\n\t\t\t\t\t# Matt hack to make sure rating display is the same height as the rating dropdown\n\t\t\t\t\t$alt .= ( $element[2] == 'rate' AND ! strstr( $element[0], 'menu_build_menu(') ) ? \" style='height:25px'\" : \"\";\n\t\t\t\t\t\n\t\t\t\t\t$i['info'] .= $this->img_html->image_info_line( $element[0], $element[1], $alt );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* What kind of image are we displaying?\n\t\t\t\t**/\t\n\t\t\t\tif( $i['pinned'] && $this->pin )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img_pinned( $i );\n\t\t\t\t}\n\t\t\t\telse if( $i['approved'] )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img( $i );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img_hidden( $i );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $col_count != 0 )\n\t\t\t{\n\t\t\t\t$output .= $this->img_html->view_end_row();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output .= $this->img_html->basic_row( 'none_found' );\n\t\t}\n\n\t\treturn $output;\n\t}", "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 }", "function outputImageList() {\n\t//if (!isset($_SESSION['imagesIndexed']) || $_SESSION['imagesIndexed'] != false || !isset($allImages)) {\n\t\t$dir = opendir(\"../images\"); $counter = 1;\n\t\tdo {\n\t\t\t$nextDir = readdir($dir);\n\t\t\tif ($nextDir != '.' && $nextDir != '..' && $nextDir !== false) {\n\t\t\t\tif (filetype($nextDir) != 'dir' && fileExtension($nextDir) != 'html' && fileExtension($nextDir) != 'txt' && fileExtension($nextDir) != 'php') {\n\t\t\t\t\t$allImages[] = htmlspecialchars($nextDir);\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($nextDir !== false);\n\t\t\n\t\tfor ($i=0;$i<count($allImages); $i++) { $newImages[] = strtolower($allImages[$i]); }\n\t\t//echo 'Done,';\n\t\tarray_multisort($newImages, SORT_ASC, SORT_STRING, $allImages);\n\t//} else { /*$allImages = $_SESSION['allImages'];*/ unset($_SESSION['imagesIndexed']); } // Only re-index all files if the list is empty, in this case, $allImages must already be set\n\t\n\t//Print ImageList Table Header\n\t$ret = '<div>';\n\t\n\t$ret .= '<i>Total Images</i>: '.count($allImages).' <span id=\"imageListMsg\"></span><br><i>Listing</i> ';\n\t\n\t$_SESSION['imageSet'][0].\n\t\n\t\t$beginEntries = array();\n\t\tfor ($i=0;$i<count($allImages);$i+=$_SESSION['imageSet'][1]) { $beginEntries[] = $i; }\n\t\t$begins = '<select id=\"imageSetStart\" onchange=\"changeImageSet(this.value,'.(int)$_SESSION['imageSet'][1].')\">';\n\t\tfor ($i=0;$i<count($beginEntries);$i++) {\n\t\t\t$begins .= '<option value=\"'.$beginEntries[$i].'\" '.($_SESSION['imageSet'][0]==$beginEntries[$i]?'selected=\"\"':'').'>'.$beginEntries[$i].'</option>';\n\t\t}\n\t\t$begins .= '</select>';\n\t\t\n\t\t$setSizes = array(50,100,500,1000,2500,5000,10000);\n\t\t$ends = '<select id=\"imageSet\" onchange=\"changeImageSet('.(int)$_SESSION['imageSet'][0].',this.value)\">';\n\t\tfor($i=0;$i<count($setSizes);$i++) {\n\t\t\t$ends .= '<option value=\"'.$setSizes[$i].'\" '.($_SESSION['imageSet'][1]==$setSizes[$i]?'selected=\"\"':'').'>'.$setSizes[$i].'</option>';\n\t\t}\n\t\t$ends .= '</select>';\n\t\t\n\t\t$topbound = min($_SESSION['imageSet'][0]+$_SESSION['imageSet'][1],count($allImages));\n\t\n\t$ret .= $begins;\n\t\n\t$ret .= ' to '.$topbound.', <i>Show</i> '.$ends.\"\\r\\n\";\n\t\n\t$ret .= '<table class=\"imageTable\" width=\"100%\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';\n\t\n\t//Print each row/image for table\n\t\n\t//echo 'Outputting from '.$_SESSION['imageSet'][0].' to '.$topbound.'<br>';\n\t\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){ // Original method outputting all data\n\t\t$ret .= '<tr id=\"ir_' . $allImages[$i] . '\"><td class=\"' . ($i%2?'I2':'I1') . '\"><input type=\"image\" src=\"images/edit.png\" onclick=\"iR(\\'' . $allImages[$i] . '\\');\" /></td><td id=\"hovRow_' . $allImages[$i] . '\"';\n\t\tif ($i % 2) { $ret .= ' style=\"background-color: #EEE;\" onmouseover=\"hoverOn2(this);\" onmouseout=\"hoverOff2(this);\"'; }\n\t\telse { $ret .= ' onmouseover=\"hoverOn(this);\" onmouseout=\"hoverOff(this);\"'; }\n\t\t$ret .= '><div id=\"vDiv_' . $allImages[$i] . '\" class=\"I\" onclick=\"iC(\\'' . $allImages[$i] . '\\');\">' . htmlentities($allImages[$i]) . '</div>'.\n\t\t'<div id=\"eDiv_' . $allImages[$i] . '\" style=\"float: left; display: none;\">'.\n\t\t'<input type=\"text\" size=\"30\" id=\"tBox_' . $allImages[$i] . '\" value=\"' . $allImages[$i] . '\" />'.\n\t\t'<input type=\"image\" src=\"images/check.png\" onclick=\"imageSavename(\\'' . $allImages[$i] . '\\');\" /></div>'.\n\t\t'</td><td' . ($i%2 ? ' style=\"background-color: #EEE;\"' : '') . '>'.\n\t\t'<input type=\"image\" src=\"images/delete.png\" onclick=\"imageDelete(\\'' . $allImages[$i] . '\\');\" /></td></tr>';\n\t} //End old format\n\t\n\t/* $ret .= '[^S}'; // New format\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){\n\t\t$ret .= $allImages[$i].'[>}';\n\t}\n\t$ret .= '[^E}'; // End new format */\n\t\n\t$ret .= '</table>';\n\treturn $ret;\n}", "public function index()\n {\n return view('seller.pages.image.index', [\n 'images' => Image::where('seller_id', auth()->guard('seller')->user()->id)->get()\n ]);\n }", "private function generateThumbnailGD(){\n\t\t\n\t}", "private function prepareImageList() {\n\t\t\tforeach(scandir($this->templateDirectory) as $templateFileName) {\n\t\t\t\tif((strcmp($templateFileName, \".\") !== 0) && (strcmp($templateFileName, \"..\") !== 0)) {\n\t\t\t\t\t$this->imageList->addItem(new Image($this->templateDirectory, $templateFileName), $templateFileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function buildImage()\n\t{\n\t\t$this->buildFileName = $this->buildFileName();\n\t\t$this->buildCachedFileNamePath = $this->cachePath . '/' . $this->buildFileName;\n\t\t$this->buildCachedFileNameUrl = $this->cacheUrl . '/' . $this->buildFileName;\n\n\t\tif(!file_exists($this->buildCachedFileNamePath)) {\n\t\t\t$this->image = iImage::make($this->mediaFilePath);\n\n\t\t\t$this->image->{$this->method}($this->width, $this->height, $this->closure);\n\n\t\t\t$this->image->save($this->buildCachedFileNamePath, $this->quality);\n\t\t}\n\t}", "public function index()\n\t{\n $images = $this->repository->all();\n\n return view('images.index', compact('images'));\n\t}", "public function run()\n {\n $initials = array(\n ['url' => 'winners-chapel-owerri-0-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-1-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-2-1542948878.jpg']\n );\n \n foreach($initials as $i){\n Gallery::create($i);\n }\n }", "public function showImage()\n {\n }", "public function run()\n {\n \\App\\Image::create([\n 'title' => 'Unknown user',\n 'path' => 'assets/img/examples/unknown_user.jpg',\n ]);\n\n \\App\\Image::create([\n 'title' => 'test1 image01',\n 'path' => 'assets/img/test1.jpg',\n ]);\n\n \\App\\Image::create([\n 'title' => 'test1 image02',\n 'path' => 'assets/img/examples/blog6.jpg',\n ]);\n\n \\App\\Image::create([\n 'title' => 'test1 image03',\n 'path' => 'assets/img/examples/blog8.jpg',\n ]);\n\n \\App\\Image::create([\n 'title' => 'Luís Avatar',\n 'path' => 'assets/img/examples/Teeth.jpg',\n ]);\n }", "public function index()\n {\n return view('admin.images.index', ['images' => Image::all()]);\n }", "public function ImageRoutes()\n {\n $routes = [];\n foreach ($this->images as $image) {\n $routes[] = '/' . env('PROPERTY_IMAGE_DISK') . '/' . $image->filepath;\n }\n\n if (count($routes) == 0) {\n $routes[] = '/imgs/default_image.png';\n }\n $this->image_routes = $routes;\n }", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}", "public function image_sizes() {\n add_image_size('careerfy-job-medium', 358, 204, true); // posts for team grid and medium\n add_image_size('careerfy-posts-msmal', 85, 58, true); // posts for team grid and medium\n add_image_size('careerfy-emp-msmal', 132, 47, true); //\n add_image_size('careerfy-candidate-2', 350, 450, true); // posts for team grid and medium\n add_image_size('careerfy-testimonial-thumb', 268, 268, true); // posts for team grid and medium\n add_image_size('careerfy-service', 247, 252, true); // posts for team grid and medium\n }", "private function generateFrontend()\n {\n if ($this->galleryOrder) {\n $this->Template->multiImages = DataHelper::getMultiImgObjs($this->galleryOrder, deserialize($this->size));\n }\n\n #-- add classes\n if (is_array($this->objModel->classes)) {\n $this->objModel->classes = array_unique(array_merge($this->objModel->classes, HomeKiteeHelper::getLayoutClasses(array(\n 'design' => $this->hm_design\n ))));\n } else {\n $this->objModel->classes = array_unique(HomeKiteeHelper::getLayoutClasses(array(\n 'design' => $this->hm_design\n )));\n\n }\n }", "public function formGalleryHtml($images){\n $html = \"\";\n foreach($images as $photo){\n $name_corto = substr($photo->getName(), 0, 10) . \"...\";\n $imageSize = \"\";\n if (is_file(APPLICATION_PATH . \"/../public\" . $photo->getUrlSmall())) {\n $imageInfo = getimagesize(APPLICATION_PATH . \"/../public\" . $photo->getUrlSmall());\n $imageWidth = 112;\n $imageHeight = ($imageInfo[1] * $imageWidth) / $imageInfo[0];\n $imageSize = sprintf(\"width=\\\"%d\\\" heigth=\\\"%d\\\"\", $imageWidth, $imageHeight);\n }\n\n $html .= \"<li class=\\\"item-gallery\\\" indice=\\\"\".$photo->getId().\"\\\" uploadname=\\\"\".$this->getName().\"\\\">\n <div class=\\\"imgholder\\\">\n <img \".$imageSize.\" id=\\\"img-gallery-\".$photo->getId().\"\\\" src=\\\"\".$photo->getUrlSmall().\"\\\">\n </div>\n <p>\n <span data-placement=\\\"top\\\" data-toggle=\\\"tooltip\\\" data-original-title=\\\"\".$photo->getName().\"\\\">\".$name_corto.\"</span>\n </p>\n </li>\";\n \n \n }\n return $html;\n }", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n ?>\n\t\t<div class=\"happyden-feature-image\">\n\t\t\t\t<?php the_post_thumbnail( get_the_Id(), 'full' ); ?>\n\t\t</div>\n\t\t<?php\n\t}", "function ppom_generate_html_for_images( $images ) {\n\t\n\t\n\t$ppom_html\t= '<table class=\"table table-bordered\">';\n\tforeach($images as $id => $images_meta) {\n\t\t\n\t\t$images_meta\t= json_decode(stripslashes($images_meta), true);\n\t\t$image_url\t\t= stripslashes($images_meta['link']);\n\t\t$image_label\t= $images_meta['title'];\n\t\t$image_html \t= '<img class=\"img-thumbnail\" style=\"width:'.esc_attr(ppom_get_thumbs_size()).'\" src=\"'.esc_url($image_url).'\" title=\"'.esc_attr($image_label).'\">';\n\t\t\n\t\t$ppom_html\t.= '<tr><td><a href=\"'.esc_url($image_url).'\" class=\"lightbox\" itemprop=\"image\" title=\"'.esc_attr($image_label).'\">' . $image_html . '</a></td>';\n\t\t$ppom_html\t.= '<td>' .esc_attr(ppom_files_trim_name( $image_label )) . '</td>';\n\t\t$ppom_html\t.= '</tr>';\n\t\t\n\t}\n\t\n\t$ppom_html .= '</table>';\n\t\n\treturn apply_filters('ppom_images_html', $ppom_html);\n}", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "function os_images($id = 0){\n\t\t$result = $this->Azure->getOSImages();\t\t\n\t\t$OSImageDetails = \"\";\n\t\tif(!empty($id)){\n\t\t\t$OSImageDetails = $this->Azure->getOSImageDetails($id);\n\t\t}\n\t\t$this->template->load(\"main\",\"osimages\",array(\"osimages\" => $result,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"osimagedetails\" => $OSImageDetails,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"selectedosimage\" => $id));\t\t\t\n\t}", "public function index()\n {\n return view('admin.images.index', [\n 'menu' => $this->menu\n ]);\n }", "protected function scaleImages() {}", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "function druplex_field__field_blog_images($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}", "protected function makeThumbnails()\n {\n $sizes = [\n 'image_211' => [\n 'width' => 211,\n 'mode' => ImageInterface::THUMBNAIL_OUTBOUND,\n ],\n ];\n $data = $this->image;\n if (!$data) {\n return;\n }\n\n if (is_string($data)) {\n $tempFile = tempnam('/tmp', 'temp_');\n file_put_contents($tempFile, $data);\n $data = fopen($tempFile, 'r+');\n }\n\n if (stream_get_contents($data) == '') {\n return;\n }\n\n fseek($data, 0);\n $sourceImage = @ImagineImage::getImagine()->read($data);\n foreach ($sizes as $sizeName => $size) {\n $thumbnailAttributeName = $sizeName;\n if (!empty($size['width'])) {\n $width = $size['width'];\n if ($width < 0) {\n $originalWidgth = $sourceImage->getSize()->getWidth();\n if (-$originalWidgth < $width * 4) {\n $width = $sourceImage->getSize()->getWidth() + $width;\n } else {\n $width = $originalWidgth;\n }\n }\n } else {\n $width = null;\n }\n\n if (!empty($size['height'])) {\n $height = $size['height'];\n if ($height < 0) {\n $originalHeight = $sourceImage->getSize()->getHeight();\n if (-$originalHeight < $height * 4) {\n $height = $sourceImage->getSize()->getHeight() + $height;\n } else {\n $height = $originalHeight;\n }\n }\n } else {\n $height = null;\n }\n\n if (!empty($size['mode'])) {\n $mode = $size['mode'];\n } else {\n $mode = ImageInterface::THUMBNAIL_INSET;\n }\n\n BaseImage::$thumbnailBackgroundAlpha = 0;\n $image = ImagineImage::thumbnail($sourceImage, $width, $height, $mode);\n\n if (!empty($size['watermark'])) {\n $watermark = fopen($size['watermark'], 'r+');\n $watermark = ImagineImage::thumbnail($watermark, $image->getSize()->getWidth(), $image->getSize()->getHeight(), ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $watermark = ImagineImage::crop($watermark, $image->getSize()->getWidth(), $image->getSize()->getHeight());\n\n $image = ImagineImage::watermark($image, $watermark);\n }\n\n $fileName = tempnam(sys_get_temp_dir(), 'test');\n $image->save($fileName, [\n 'format' => $this->image_extension,\n ]);\n\n $thumbData = fopen($fileName, 'r+');\n $this->$thumbnailAttributeName = $thumbData;\n }\n\n fseek($data, 0);\n }", "function displayImageInformation()\n {\n // query the number of saved images of the account\n $savedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'SAVED'\") or die(mysql_error());\n \n // query the number of deleted images of the account\n $deletedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n // calculate the number of images\n $savedImagesCount = mysql_num_rows($savedImagesQuery);\n $deletedImagesCount = mysql_num_rows($deletedImagesQuery);\n $totalImagesCount = $savedImagesCount + $deletedImagesCount;\n \n // calculate the hard disk space the saved image has used\n $savedImagesFileSize = 0;\n \n for($i=0; $i<$savedImagesCount ; $i++)\n {\n // incrementally compute the file sizes of each saved images in Kilobytes\n // 1 KB = 1024 bytes\n $savedImagePath = mysql_result($savedImagesQuery,$i,\"path\");\n $savedImagesFileSize = $savedImagesFileSize + ((filesize($savedImagePath)) / 1024);\n }\n \n // calculate the hard disk space the deleted image has used\n $deletedImagesFileSize = 0;\n \n for($i=0; $i<$deletedImagesCount; $i++)\n {\n // incrementally compute the file sizes of each deleted images in kilobytes\n // 1 KB = 1024 bytes\n $deletedImagePath = mysql_result($deletedImagesQuery,$i,\"path\");\n $deletedImagesFileSize = $deletedImagesFileSize + ((filesize($deletedImagePath)) / 1024);\n }\n \n // compute the total disk space that is being used\n $totalImagesFileSize = $savedImagesFileSize + $deletedImagesFileSize;\n \n // display the images information\n echo \"\n <p>Image Information</p>\n <p id='box'>\n Saved Images : \".$savedImagesCount.\" (\".round($savedImagesFileSize,2).\" KB)<br>\n Deleted Images : \".$deletedImagesCount.\" (\".round($deletedImagesFileSize,2).\" KB)<br><br>\n Total Images : \".$totalImagesCount.\" (\".round($totalImagesFileSize,2).\" KB)<br>\n </p>\";\n \n return;\n }", "public function imagesManager()\n\t{\n\t\t$images = array();\n\n\t\t// Grab all images in the directory\n\t\t$files = File::allFiles(public_path() . '/uploads');\n\n\t\tforeach ($files as $file) {\n\t\t\t// Ignore thumbnail image\n\t\t\tif (!strpos($file, 'thumb_')) {\n\t\t\t\t// Get the image extension\n\t\t\t\t$ext = '.' . pathinfo($file, PATHINFO_EXTENSION);\n\t\t\t\t// Get the directory path for the image\n\t\t\t\t$path = explode( \"/\", substr($file,strpos($file,\"/uploads\")));\n\t\t\t\t// Remove file name to get only directory name\n\t\t\t\tarray_pop($path);\n\n\t\t\t\t$image_path = implode(\"/\", $path);\n\n\t\t\t\t$images[] = array(\"thumb\" => $image_path .'/thumb_' . basename($file), \"image\" => $image_path .'/' . basename($file), \"title\" => basename($file, $ext), \"link\" => $image_path .'/' . basename($file));\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json($images);\n\t}", "function admin_showimage($selection, $path, $options) { global $get, $uri;\n\t$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}\n\techo '<div class=\"show_img\">';\n\tif (!LOGGED && isAllowed('uplimg_access')) {echo t('not_allowed').'</div>'; exit;}\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/thumbs/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/thumbs/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t} else {$images = $images.'<li>\n\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>';}\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function index()\n {\n $catImages = CategoryImage::all();\n $images = Image::orderBy('id', 'DESC')->get();\n return view('back-end.image.index')->with(['images' => $images, 'catImages' => $catImages]);\n }", "protected function fetchImagesInContent(){\n if(isset($this->images)){\n return;\n }\n $texts = array(\n 'text' => $this->Article->text, \n 'full' => $this->Article->fulltext, \n 'intro' => $this->Article->introtext);\n $images = array();\n foreach ($texts as $key => $text) {\n if($text != ''){\n $fetchedImages = $this->extractImageFromHTML($text, $key);\n if($fetchedImages){\n $images = array_merge($images, $fetchedImages);\n }\n }\n }\n if(!empty($images)){\n $this->images = $images;\n }\n }", "public function run()\n {\n $image = new Image([\n \"path\" => \"placeholder_light.png\",\n \"alt\" => \"A placeholder image in light colors.\",\n \"description\" => \"The placeholder image with some light color.\",\n ]);\n $image->save();\n \n $image = new Image([\n \"path\" => \"placeholder_small_light.png\",\n \"alt\" => \"A small placeholder image in light colors.\",\n \"description\" => \"The small placeholder image with some light color.\",\n ]);\n $image->save();\n \n $image = new Image([\n \"path\" => \"placeholder_square_light.jpg\",\n \"alt\" => \"A square placeholder image in light colors.\",\n \"description\" => \"The square placeholder image with some light color.\",\n ]);\n $image->save();\n \n $image = new Image([\n \"path\" => \"placeholder_wide_dark.png\",\n \"alt\" => \"A wide placeholder image in dark colors.\",\n \"description\" => \"The wide placeholder image with some dark color.\",\n ]);\n $image->save();\n \n $image = new Image([\n \"path\" => \"placeholder_wide_light.png\",\n \"alt\" => \"A wide placeholder image in light colors.\",\n \"description\" => \"The wide placeholder image with some light color.\",\n ]);\n $image->save();\n }", "function item_image_gallery($attrs = array(), $imageType = 'square_thumbnail', $filesShow = null, $item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n\n $files = $item->Files;\n if (!$files) {\n return '';\n }\n\n $defaultAttrs = array(\n 'wrapper' => array('id' => 'item-images'),\n 'linkWrapper' => array(),\n 'link' => array(),\n 'image' => array()\n );\n if ($filesShow === null) {\n $filesShow = get_option('link_to_file_metadata');\n }\n $attrs = array_merge($defaultAttrs, $attrs);\n\n $html = '';\n if ($attrs['wrapper'] !== null) {\n $html .= '<div ' . tag_attributes($attrs['wrapper']) . '>';\n }\n foreach ($files as $file) {\n if ($attrs['linkWrapper'] !== null) {\n $html .= '<div ' . tag_attributes($attrs['linkWrapper']) . '>';\n }\n\n $image = file_image($imageType, $attrs['image'], $file);\n if ($filesShow) {\n $html .= link_to($file, 'show', $image, $attrs['link']);\n } else {\n $linkAttrs = $attrs['link'] + array('href' => $file->getWebPath('original'));\n $html .= '<a ' . tag_attributes($linkAttrs) . '>' . $image . '</a>';\n }\n\n if ($attrs['linkWrapper'] !== null) {\n $html .= '</div>';\n }\n }\n if ($attrs['wrapper'] !== null) {\n $html .= '</div>';\n }\n return $html;\n}", "public function RenderImages() {\n\t$outYes = $outNo = NULL;\n\twhile ($this->NextRow()) {\n\t $htTitle = $this->RenderImages_withLink_andSummary();\n\t if ($this->IsForSale()) {\n\t\t$outYes .= $htTitle;\n\t } else {\n\t\t$outNo .= $htTitle;\n\t }\n\t}\n\t\n\tif (is_null($outYes)) {\n\t $htYes = '<span class=content>There are currently no titles available for this topic.</spaN>';\n\t} else {\n\t $oSection = new vcHideableSection('hide-available','Titles Available',$outYes);\n\t $htYes = $oSection->Render();\n\t}\n\tif (is_null($outNo)) {\n\t $htNo = NULL;\t// no point in mentioning lack of unavailable titles\n\t} else {\n\t $oSection = new vcHideableSection('show-retired','Titles NOT available',$outNo);\n\t $oSection->SetDefaultHide(TRUE);\n\t $htNo = $oSection->Render();\n\t}\n\treturn $htYes.$htNo;\n }", "protected function loadImages() {\r\n $this->images = new \\App\\Table\\ImagesTable(App::getInstance()->getDb());\r\n }", "function images() {\n \n \tswitch($_POST['action']) {\n \tcase \"Delete\": \n\t\t\t\t\t\t\t$this->delete_image($_POST['imageId']); \n\t\t\t\t\t\t\tbreak;\n \tcase \"Delete Selected\":\n \t\t\t\t\tforeach($_POST['images'] as $imageId) \n\t\t\t\t\t\t\t\t$this->delete_image($imageId);\n \t\t\t\t\tbreak;\n \tcase \"uploaduniversal\": \n\t\t\t\t\t\t\t$this->upload_universal(); \n\t\t\t\t\t\t\tbreak;\n }\n\n switch($_POST['do']) {\n \tcase \"Upload New Asset\": \n\t\t\t\t\t\t\t\t\t\t$this->upload_uni_form(); \n\t\t\t\t\t\t\t\t\t\tbreak;\n\n \tdefault : {\n\t \t\t\t\t\t\t\techo $this->printHeader(\"Assets\");\n\t\t \t\t\t\t\t\t\t$this->images_list();\n\t \t}\n }\n echo \"</div>\";\n\n }", "protected function addImageSizeConfigs()\n {\n // TODO: add image size configs\n }", "public function run()\n {\n\n \t$imagedata = file_get_contents(asset('learningmachinelaravel/lm/public/test_thumbnail.jpg'));\n \t$base64 = base64_encode($imagedata);\n\n\t\tApp\\ImageItem::createItem([\n \t\t'name' => 'Image1',\n \t\t'summary' => 'Kissakuva kissasta',\n \t\t'category_id' => 6,\n \t\t'user_id' => 1,\n \t\t'tags' => 'PHP,Javascript,Node.js',\n \t\t'imagepath' => 'aws.amazon.com/8u4j54i3',\n \t\t'thumbnail' => $base64\n \t]);\n\n\t\tApp\\ImageItem::createItem([\n \t\t'name' => 'Image2',\n \t\t'summary' => 'Koirakuva koirasta',\n \t\t'category_id' => 4,\n \t\t'user_id' => 1,\n \t\t'tags' => 'PHP,Javascript,Clojure',\n \t\t'imagepath' => 'aws.amazon.com/8u4j54i3koira',\n \t\t'thumbnail' => $base64\n \t]); \n\n\t\tApp\\ImageItem::createItem([\n \t\t'name' => 'Päivänkakkara',\n \t\t'summary' => 'Although implode() can, for historical reasons, accept its parameters in either order, explode() cannot. You must ensure that the delimiter argument comes before the string argument.',\n \t\t'category_id' => 4,\n \t\t'user_id' => 1,\n \t\t'tags' => 'PHP,Javascript',\n \t\t'imagepath' => 'aws.amazon.com/8u4j54i3koira',\n \t\t'thumbnail' => $base64\n \t]); \n\n }", "public function carregar_imagem()\n\t{\n\t\t$id = $this->input->get(\"id_aluno\");\n\t\t$dados[\"aluno\"] = $this->Aluno_Model->retorna_aluno($id);\t\n\t\t//\tCARREGA A VIZUALIZACAO DA VIEW LISTA\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t\t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/fotografia', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "public function run()\n {\n $imageArray = array(\n 'cover/default.png', 'cover/avengers-infinity-war.jpg', 'cover/coco.jpg',\n 'cover/deadpool-2.jpg', 'cover/fantastic-beasts.jpg', 'cover/oceans-.jpg',\n 'cover/the-greatest-showman.jpg', 'cover/incredibles-2.jpg', 'cover/ant-man-and-the-wasp.jpg'\n );\n foreach($imageArray as $i){\n $image = new Image();\n $image->path = $i;\n $image->save();\n }\n }", "function addImage($path,$title,$description,$thumb,$lightbox,$uniqueID,$limitImages=0) {\n\t // count of images\n\t if ($limitImages > 1 || $limitImages==0) {\n $this->config['count']++;\n\t }\n // just add the wraps if there is a text for it\n $title = (!$title) ? '' : \"<h3>$title</h3>\";\n $description = (!$description) ? '' : \"<p>$description</p>\";\n \n // generate images\n if ($this->config['watermark']) {\n $imgTSConfigBig = $this->conf['big2.'];\n $imgTSConfigBig['file.']['10.']['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox2.'];\n $imgTSConfigLightbox['file.']['10.']['file'] = $path; \n } else {\n $imgTSConfigBig = $this->conf['big.'];\n $imgTSConfigBig['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox.'];\n $imgTSConfigLightbox['file'] = $path; \n } \n $bigImage = $this->cObj->IMG_RESOURCE($imgTSConfigBig);\n\n $lightbox = ($lightbox=='#' || $lightbox=='' || $this->config['showLightbox']!=1) ? 'javascript:void(0)' : $this->cObj->IMG_RESOURCE($imgTSConfigLightbox);\n \t$lightBoxImage='<a href=\"'.$lightbox.'\" title=\"'.$this->pi_getLL('textOpenImage').'\" class=\"open\"></a>';\n\n if ($thumb) {\n $imgTSConfigThumb = $this->conf['thumb.'];\n $imgTSConfigThumb['file'] = $path; \n $thumbImage = '<img src=\"'.$this->cObj->IMG_RESOURCE($imgTSConfigThumb).'\" class=\"thumbnail\" />';\n }\n\n\t // if just 1 image should be returned\n if ($limitImages==1) {\n \treturn '<img src=\"'.$bigImage.'\" class=\"full\" />';\n }\n\n // build the image element \n $singleImage .= '\n <div class=\"imageElement\">'.$title.$description.\n $lightBoxImage.'\n <img src=\"'.$bigImage.'\" class=\"full\" />\n '.$thumbImage.'\n </div>';\n\n\t\t// Adds hook for processing the image\n\t\t$config['path'] = $path;\n $config['title'] = $title;\n\t\t$config['description'] = $description;\n\t\t$config['uniqueID'] = $uniqueID;\n\t\t$config['thumb'] = $thumb;\n\t\t$config['large'] = $large;\n\t\t$config['lightbox'] = $lightbox;\n\t\t$config['limitImages'] = $limitImages;\n\t\t$config['lightBoxCode'] = $lightBoxImage;\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$singleImage = $_procObj->extraImageProcessor($singleImage,$config, $this);\n\t\t\t}\n\t\t} \n \n return $singleImage;\n }" ]
[ "0.66767216", "0.6653933", "0.662097", "0.6508861", "0.6464377", "0.64505446", "0.64118344", "0.6403195", "0.6401963", "0.6396919", "0.63388807", "0.6326887", "0.63045967", "0.629498", "0.62719315", "0.6271095", "0.6270881", "0.6254747", "0.62450004", "0.62233055", "0.6221337", "0.6201638", "0.61989343", "0.61772436", "0.6155237", "0.61302716", "0.6128164", "0.6101356", "0.60996497", "0.6092298", "0.6082532", "0.607184", "0.6066725", "0.6063983", "0.6050541", "0.60501426", "0.60468173", "0.6031109", "0.6009936", "0.59907323", "0.5980307", "0.5971747", "0.59668124", "0.59633434", "0.59570295", "0.5955962", "0.5947105", "0.59461296", "0.5937836", "0.5937451", "0.59286046", "0.5922304", "0.5921545", "0.5915964", "0.59094906", "0.59064287", "0.59006536", "0.5894953", "0.5892147", "0.5889117", "0.5884967", "0.5874341", "0.5871635", "0.5854359", "0.5849056", "0.58344144", "0.58168256", "0.5815576", "0.58155197", "0.5815276", "0.58068657", "0.5803692", "0.58008087", "0.58002996", "0.5797939", "0.5797818", "0.57921934", "0.5790233", "0.57773423", "0.5776762", "0.5775592", "0.57727593", "0.57718426", "0.5762449", "0.57490516", "0.5745769", "0.57438904", "0.57424307", "0.57381415", "0.5736766", "0.57332355", "0.5730898", "0.5727326", "0.57259446", "0.57183456", "0.5713552", "0.5713533", "0.57053494", "0.5696404", "0.5692389" ]
0.6767184
0
Build the vehicles select list
function buildVehiclesSelect($vehicles) { $prodList = '<select name="invId" id="invId">'; $prodList .= "<option>Choose a Vehicle</option>"; foreach ($vehicles as $vehicle) { $prodList .= "<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>"; } $prodList .= '</select>'; return $prodList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildVehiclesSelect($vehicles)\n{\n $prodList = '<select name=\"invId\" id=\"invId\">';\n $prodList .= \"<option>Choose a Vehicle</option>\";\n foreach ($vehicles as $vehicle) {\n $prodList .= \"<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>\";\n }\n $prodList .= '</select>';\n return $prodList;\n}", "protected function buildOptionsList() {\n }", "private function getSelectOptions() {\n $result = \"\";\n if($this->pleaseSelectEnabled) {\n $result .= '<option value=\"null\"> -- Please Select --</option>';\n }\n foreach($this->itemList as $key => $val) {\n $selectedText = \"\";\n if(in_array($key, $this->selectedItems)) {\n $selectedText = 'selected=\"selected\"';\n }\n $result .= '<option value=\"'.$key.'\" '.$selectedText.'>'.$val.'</option>'.\"\\n \\t\";\n }\n return $result;\n }", "function buildClassificationList($classifications)\n{\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">';\n $classificationList .= \"<option>Choose a Classification</option>\";\n foreach ($classifications as $classification) {\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\";\n }\n $classificationList .= '</select>';\n return $classificationList;\n}", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "function buildClassificationList($classifications){ \r\n $classificationList = '<select name=\"classificationId\" id=\"classificationList\">'; \r\n $classificationList .= \"<option>Choose a Classification</option>\"; \r\n foreach ($classifications as $classification) { \r\n $classificationList .= \"<option value='$classification[classificationId]'>$classification[classificationName]</option>\"; \r\n } \r\n $classificationList .= '</select>'; \r\n return $classificationList; \r\n }", "static function get_dropdown_options()\n {\n $rows = ORM::factory('actor')->where('parent_id=0')->orderby('actor')->find_all();\n \n foreach ($rows as $row){\n $hijos = array();\n $_t = ORM::factory('actor')->where('parent_id',$row->id)->orderby('actor')->select_list('id','actor');\n\n foreach($_t as $_id => $_n) {\n\n $_hijos = ORM::factory('actor')->where('parent_id',$_id)->orderby('actor')->select_list('id','actor');\n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_hijos);\n \n /* \n foreach($_hijos as $_idn => $_nn) {\n $_h[] = array('id' => $_idn, 'n' => $_nn, 'h' => ORM::factory('actor')->where('parent_id',$_idn)->select_list('id','actor'));\n }\n \n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_h);\n */\n }\n \n $opts[] = array('id' => $row->id, 'n' => $row->actor, 'h' => $hijos);\n }\n return $opts;\n }", "protected function createUserAndGroupListForSelectOptions() {}", "function vList() {\n $vlist=$this->getListVars();\n //need database,table,varname,tableinfo for variable =\n // browse=varname;ctrl=whatever;titl=something;whatever other options\n $postStrng=\"method=useQonFly\".\n '&db='.$this->dbName.\n '&tabl='.$this->tabl.\n '&index='.$this->indx;\n if ($vlist) {\n $postStrng.=\"&cmnd=qlist\";\n $chStrng=\"document.getElementById('updBrowse').style.visibility='visible';\";\n $chStrng.=\"jtAjaxLibSelect('$postStrng','varinfo','jtSpecs','1');\";\n echo \"<p><strong>Filter by</strong>\\n<select id=\\\"varinfo\\\" name=\\\"varinfo\\\"\";\n echo \" />\\n\";\n echo \"<option value=\\\"0\\\"> -- </option>\\n\";\n foreach ($vlist as $item) {\n $a=$this->xQueryInfo[\"$item\"];\n $code=\"$item;ctrl=\".$a->getSize().';titl='.$a->getLabel().';'.\n $this->implodeAllOpts($a);\n echo \"<option value=\\\"$code\\\">\",$a->getLabel(),\"</option>\\n\";\n }\n echo \"</select>\\n\";\n addButton('myChoice','Choose',$chStrng); \n //echo \"</p>\\n\";\n } //vlist not empty\n }", "function LUPE_option_combo_vet($Vet, $NomeCombo, $PreSelect, $LinhaFixa = ' ', $JS = '', $Style = '')\r\n{\r\n\r\n $numrows = count($Vet);\r\n\r\n $html = \"<select id='$NomeCombo' name='$NomeCombo' $JS style='$Style'>\\n\";\r\n\r\n\tif ($LinhaFixa != '')\r\n\t\t$html .= \"<option value=''>$LinhaFixa</option>\\n\";\r\n\r\n if ($numrows == 0) {\r\n\t\t$html .= \"<option value=''>Não há informação no sistema</option>\\n\";\r\n } else {\r\n\t ForEach($Vet as $Chave => $Valor ){\r\n \t\t $html .= \"<option value='$Chave'\";\r\n\r\n\t\t if ($PreSelect == $Chave)\r\n\t\t\t$html .= 'selected >';\r\n \t\t else\r\n\t\t\t$html .= '>';\r\n\r\n\t \t $html .= \"$Valor</option>\\n\";\r\n }\r\n }\r\n\r\n $html .= '</select>';\r\n\r\n return $html;\r\n}", "function build_selection_dropdown() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'wo_journal_main.id', 'text' => 'Record ID');\n\t$output[] = array('id' => 'wo_journal_main.wo_id', 'text' => 'Work Order Num');\n\t$output[] = array('id' => 'wo_journal_main.wo_title', 'text' => 'Work Order Title');\n\t$output[] = array('id' => 'wo_journal_main.priority', 'text' => 'Priority');\n\t$output[] = array('id' => 'wo_journal_main.sku', 'text' => 'SKU');\n\t$output[] = array('id' => 'wo_journal_main.qty', 'text' => 'Quantity');\n\t$output[] = array('id' => 'wo_journal_main.post_date', 'text' => 'Post Date');\n\t$output[] = array('id' => 'wo_journal_main.closed', 'text' => 'Closed');\n\t$output[] = array('id' => 'wo_journal_main.closed_date', 'text' => 'Closed Date');\n\t$output[] = array('id' => 'wo_journal_main.notes', 'text' => 'Notes');\n\t$output[] = array('id' => 'wo_journal_main.bom_list', 'text' => 'BOM List');\n\t$output[] = array('id' => 'wo_journal_main.ref_specs', 'text' => 'Reference Specs');\n\t$output[] = array('id' => 'wo_journal_main.ref_docs', 'text' => 'Reference Docs');\n\t$output[] = array('id' => 'bar_code', 'text' => 'SKU Bar Code');\n\t$output[] = array('id' => 'image_with_path', 'text' => 'SKU Image');\n\treturn $output;\n }", "public function ctlBuscaCompras(){\n\n\t\t$respuesta = Datos::mdlCompras(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"codProducto\"].'\">'.$item[\"noOperacion\"].' - '.$item[\"proveedor\"].' - '.$item[\"kg\"].' - '.$item[\"precio\"].'</option>';\n\t\t}\n\t}", "function build_machine_options( $mode )\n{\n // build a drop down list of special interests\n // mode can be 'ADD' or 'DISPLAY'\n\n // get access to a global stack of objects\n\n \n global $machines ;\n\n // reset the variable spave where we are going \n // to build the menu choice structure\n \n $pull_down = '<option value = \"\">MACHINES</option>' ;\n\n // dope how namy objects in the array\n \n $size = count( $machines ) ;\n // and process each one\n \n for ( $counter = 0 ;\n $counter < $size ;\n $counter++ )\n {\n if ( $machines[ $counter ]->active )\n // no sense offering de-activated options\n {\n $pull_down = $pull_down . '<option value = \"'\n . $machines[ $counter ]->short_name \n . '\">'\n . $machines[ $counter ]->name \n . '</option>' ;\n\n\n } // if\n } // for\n\n $pull_down = $pull_down . '<option value = \"Mark Addinall\">Mark Addinall</option>' ;\n\n return $pull_down ;\n\n}", "private function buildControls(){\n\n\t\t//create key - label pairs for this dropdown:\n\n\t\t$name = '_column_type_'.$this->fullId;\n\t\t$types = $this->getTypes();\n\n\t\tif( $this->referenceMode )\n\t\t\t$name = 'reference_'.$this->fullId;\n\n\n\t\tif( sizeof( $types ) > 1 ){\n\t\t\t\n\t\t\t$typeSelector = Field::select(\n\t\t\t\t$name,\n\t\t\t\t'',\n\t\t\t\t$types,\n\t\t\t\tarray(\n\t\t\t\t\t'defaultValue' => $this->type\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$class = 'column-controls column-choices-available';\n\n\t\t}else{\n\t\t\t$class = 'column-controls';\n\t\t\t$key = array_keys( $types );\n\t\t\t$typeSelector = Field::hidden( \n\t\t\t\t$name, \n\t\t\t\t[ \n\t\t\t\t\t'defaultValue' => $this->type, \n\t\t\t\t\t'class' => 'type-select'\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\techo '<div class=\"'.$class.'\">';\n\n\t\t\t//render the dropdown:\n\t\t\t$typeSelector->render();\n\t\t\techo '<h3 class=\"column-type\">'.$types[ $this->type ].'</h3>';\n\n\t\t\t//sorter\n\t\t\techo '<span class=\"sort dashicons dashicons-leftright\"></span>';\n\n\t\techo '</div>';\n\n\t}", "public function getNewChildSelectOptions()\n {\n $hlr = Mage::helper('amsegments');\n \n $conditions = array(\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Subscriber::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_subscriber',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Visit::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_visit',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Registration::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_registration',\n ),\n array(\n 'label' => $hlr->__(Amasty_Segments_Model_Segment_Condition_Customer_Days_Birthday::getDefaultLabel()),\n 'value' => 'amsegments/segment_condition_customer_days_birthday',\n )\n );\n \n \n $prefix = 'amsegments/segment_condition_customer_';\n $conditions = array_merge_recursive($conditions, Mage::getModel($prefix.'attributes')->getNewChildSelectOptions());\n\n return array(\n 'value' => $conditions,\n 'label'=>Mage::helper('amsegments')->__('Registered Customers')\n );\n }", "public function getRegistros()\n {\n if($this->input->post('id_cliente'))\n {\n $id_cliente = $this->input->post('id_cliente'); \n $contratos = $this->m_contratos->getRegistros($id_cliente, 'id_cliente');\n \n echo '<option value=\"\" disabled selected style=\"display:none;\">Seleccione una opcion...</option>';\n foreach ($contratos as $row) \n {\n echo '<option value=\"'.$row->id_vehiculo.'\">'.$row->vehiculo.'</option>';\n }\n }\n }", "function create_dropdown($list_of_objs, $selected_item ){\n\t\t$return_val=\"\";\n\t\tfor ($i=0;$i<sizeof($list_of_objs);$i=$i+1){\n\t\t\t$next_obj=$list_of_objs[$i];\n\t\t\t$return_val=$return_val.\"<option value=\\\"\";\n\t\t\t$return_val=$return_val.$next_obj->get_id();\n\t\t\t$return_val=$return_val.\"\\\"\";\n\t\t\tif ($selected_item==$next_obj->get_id()){\n\t\t\t\t$return_val=$return_val.\" selected=\\\"selected\\\" \";\n\t\t\t}\n\t\t\t$return_val=$return_val.\">\".$next_obj->get_name();\n\t\t\t$return_val=$return_val.\"</option>\";\n\t\t}\n\t\treturn $return_val;\n\t}", "public function brandForm(){\n $table = \"brands\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $brand){\n echo('<option value=\"'.$brand[\"brand_id\"].'\">'.$brand[\"brand_name\"].'</option>');\n }\n\n\n }", "function build_vehicle_javascript()\n\t{\n\t\tglobal $db;\n\n\t\t$make_q_id = \"SELECT id, make FROM \" . GARAGE_MAKES_TABLE . \" ORDER BY make ASC\";\n\t\n\t\tif( !($make_result = $db->sql_query($make_q_id)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\twhile ( $make_row = $db->sql_fetchrow($make_result) )\n\t\t{\n\t\t\t// Start this makes row in the output, this is where it gets confusing!\n\t\t\t$return .= 'cars[\"'.$make_row['make'].'\"] = new Array(\"'.$make_row['id'].'\", new Array(';\n\n\t\t\t$make_row_id = $make_row['id'];\n \t\t$model_q_id = \"SELECT id, model FROM \" . GARAGE_MODELS_TABLE . \" \n \t\t WHERE make_id = $make_row_id ORDER BY model ASC\";\n\n\t\t\tif( !($model_result = $db->sql_query($model_q_id)) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t\t} \n\n\t \t$model_string = '';\n\t\t\t$model_id_string = '';\n\n\t\t\t// Loop through all the models of this make\n\t\t\twhile ( $model_row = $db->sql_fetchrow($model_result) )\n\t\t\t{\n\t\t\t\t// Create the arrays that we will use in the output\n\t\t\t\t$model_string .= '\"'.$model_row['model'].'\",';\n\t\t\t\t$model_id_string .= '\"'.$model_row['id'] .'\",';\n\t\t\t}\n\t\t\t$db->sql_freeresult($model_result);\n\n\t\t\t// Strip off the last comma\n\t\t\t$model_string = substr($model_string, 0, -1);\n\t\t\t$model_id_string = substr($model_id_string, 0, -1);\n\n\t\t\t// Finish off this makes' row in the output\n\t\t\t$return .= $model_string .\"), new Array(\". $model_id_string .\"));\\n\";\n\t }\n\t\t$db->sql_freeresult($make_result);\n\n\t return $return;\n\t}", "function LUPE_criar_combo_vet($Vet, $NomeCombo, $PreSelect, $LinhaFixa = ' ', $JS = '', $Style = '')\r\n{\r\n\r\n $numrows = count($Vet);\r\n\r\n echo \"<select id='$NomeCombo' name='$NomeCombo' $JS style='$Style'>\\n\";\r\n\r\n\tif ($LinhaFixa != '')\r\n\t\techo \"<option value=''>$LinhaFixa</option>\\n\";\r\n\r\n if ($numrows == 0) {\r\n\t\techo \"<option value=''>Não há informação no sistema</option>\\n\";\r\n } else {\r\n\t ForEach($Vet as $Chave => $Valor ){\r\n \t\t echo \"<option value='$Chave'\";\r\n\r\n\t\t if ($PreSelect == $Chave)\r\n\t\t\techo 'selected >';\r\n \t\t else\r\n\t\t\techo '>';\r\n\r\n\t \t echo \"$Valor</option>\\n\";\r\n }\r\n }\r\n\r\n echo '</select>';\r\n\r\n return 0;\r\n}", "function make_regions_dropdown($search_name='',$cat_id=0){\n\t\t$locations\t\t\t\t=$this->get_locations();\n\t\t$home_location\t\t\t=$_SESSION['home_location'];\n\t\t$available_locations\t=array($home_location->location_id=>\"All \".$home_location->name);\n\t\t//---------------------------------------------------\n\t\tswitch($search_name){\n\t\t\tcase 'businesses':\n\t\t\tcase 'categories':\n\t\t\t\t$business=$this->cls('admin/class/business','external');\n\t\t\t\t$s=query(\"SELECT * FROM business_tbl WHERE failte <> -1\");\n\t\t\t\twhile($one=fetch_object($s)){\n\t\t\t\t\t$continue=true;\n\t\t\t\t\t$one->categories\t=$business->load_business_categories($one->business_id);\n\t\t\t\t\t$one->locations\t\t=$business->load_business_locations($one->business_id);\n\t\t\t\t\tif($cat_id){ //if category specified, then filter\n\t\t\t\t\t\tif(isset($one->categories[$cat_id])){\n\t\t\t\t\t\t\t$continue=true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$continue=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($continue){\n\t\t\t\t\t\tforeach($one->locations as $location_id=>$loc){\n\t\t\t\t\t\t\t$available_locations[$location_id]=$locations[$location_id];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t//$this->debug($search_name.\" = \".$cat_id);\n\t\t//$this->writelog();\n\t\t//---------------------------------------------------\n\t\t$form=$this->mod(\"form\")->form_style('block');\n\t\t$form->element(\"location_id\",array(\"db\"=>1,\"type\"=>\"SELECT\",\"label\"=>\"Location\",\"style\"=>\"width:230px;\",\"data\"=>$available_locations));\n\t\t$form->draw();\n\t\t$html=$form->elements[\"location_id\"]->elem;\n\t\t$html=str_replace(\"<br/>\",\"\",$html);\n\t\t//---------------------------------------------------\n\t\treturn $html;\n\t}", "function build_rr_list_html($selected,$selected_name,$cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$rr_list = \"<select name='rr_id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$rr_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$rr_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rr_list .= \"<option value=''>\".$lang['Select_A_Option'].\"</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, bhp, bhp_unit FROM \" . GARAGE_ROLLINGROAD_TABLE . \" WHERE garage_id = $cid\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query rollingroad', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $rollingroad = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$rr_list .= \"<option value='\".$rollingroad['id'].\"'>\".$rollingroad['bhp'].\" BHP @ \".$rollingroad['bhp_unit'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$rr_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'RR_LIST' => $rr_list)\n\t\t);\n\t\n\t\treturn;\n\t}", "function comboNiveles() {\n $opciones = \"\";\n $nvS = new Servicio();\n $niveles = $nvS->listarNivel(); //RETORNA UN ARREGLO\n\n while ($nivel = array_shift($niveles)) {\n $opciones .=\" <option value='\" . $nivel->getId_nivel() . \"'>\" . $nivel->getNombre() . \"</option>\";\n }\n return $opciones;\n}", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "protected function _buildListSelect($options)\n\t{\n\t\t$select = array();\n\n\t\t// get options\n\t\t$select[] = ' select *';\n\n\t\t// add from clause\n\t\t$select[] = 'from ' . $this->_getTableName();\n\n\t\t// aggregate clauses\n\t\t$select = (count($select) ? implode(' ', $select) : '');\n\n\t\treturn $select;\n\t}", "protected function _buildListSelect($options)\n\t{\n\t\t$select = array();\n\n\t\t// get the layout option from params\n\t\t$layout = $this->_getOption('layout', $options);\n\t\t$getMetaData = $this->_getOption('getMetaData', $options, false);\n\t\t$getPageId = $this->_getOption('getPageId', $options, false);\n\n\t\t// in some case, we only need a simple list of urls, with no\n\t\t// counting of additionnal date, pageids, aliases, etc\n\t\t$simpleUrlList = $this->_getOption('simpleUrlList', $options, false);\n\t\tif ($simpleUrlList)\n\t\t{\n\t\t\t$s = ' select distinct u1.*';\n\t\t\t$s .= $getMetaData ? ', m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t$s .= $getPageId ? ', p.newurl as nonsefurl, p.pageid as pageid, p.id as pageidid, p.type as pageidtype, p.hits as pageidhits' : '';\n\t\t\t$select[] = $s;\n\t\t\t// add from clause\n\t\t\tif ($getPageId)\n\t\t\t{\n\t\t\t\t$select[] = 'from ' . $this->_db->quoteName('#__sh404sef_pageids') . ' as p';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select[] = 'from ' . $this->_db->quoteName('#__sh404sef_urls') . ' as u1';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// regular query, with all bells and whistles\n\t\t\tswitch ($layout)\n\t\t\t{\n\t\t\t\tcase 'export' :\n\t\t\t\t\t$s = ' select distinct u1.*';\n\t\t\t\t\t$s .= $getMetaData ? ',m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t\t\t$select[] = $s;\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as d, ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'view404':\n\t\t\t\t\t$select[] = ' select distinct u1.*';\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$s = ' select distinct u1.*, count(d.`id`)-1 as duplicates, count(m.`id`) as metas';\n\t\t\t\t\t$s .= $getMetaData ? ', m.newurl as nonsefurl, m.id as metaid, m.metatitle as metatitle, m.metadesc as metadesc, m.metakey as metakey, m.metalang as metalang, m.metarobots as metarobots, m.canonical as canonical' : '';\n\t\t\t\t\t$select[] = $s;\n\t\t\t\t\t// add from clause\n\t\t\t\t\t$select[] = 'from ' . $this->_getTableName() . ' as d, ' . $this->_getTableName() . ' as u1 ';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// aggregate clauses\n\t\t$select = (count($select) ? implode(' ', $select) : '');\n\n\t\treturn $select;\n\t}", "function getNameOptions(){\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n \n // Select some fields\n //$query->select('DISTINCT name');\n $query->select('name');\n // From the hello table\n $query->from('#__helloworld_message');\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList();\n\t\t\t\n\t\t\tforeach($result as $item){\n\t\t\t\t$name = $item->name;\n\t\t\t\t$filter_name_options[] = JHTML::_('select.option', $name , $name);\n\t\t\t\t}\n\t\t\treturn $filter_name_options;\n\t\t\t\n\t\t\t}", "public function getNewChildSelectOptions()\n {\n $prefix = 'enterprise_customersegment/segment_condition_customer_address_';\n $result = array_merge_recursive(parent::getNewChildSelectOptions(), array(\n array(\n 'value' => $this->getType(),\n 'label' => Mage::helper('enterprise_customersegment')->__('Conditions Combination')\n ),\n Mage::getModel($prefix.'default')->getNewChildSelectOptions(),\n Mage::getModel($prefix.'attributes')->getNewChildSelectOptions(),\n ));\n return $result;\n }", "public function vehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 1)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "function\tdropdown_list($dbconn) {\n\t$sqlcom=\"select distinct spec_id,name from info;\";\n\t$dbres = pg_exec($dbconn, $sqlcom );\n\tif ( ! $dbres ) {echo \"Error : \" + pg_errormessage( $dbconn ); exit();} \n\t$row=0;\n\t$rowmax=pg_NumRows($dbres);\n\tprint \"<form method=\\\"post\\\" action=\\\"libSpec.php\\\"><select name=\\\"organism\\\" onchange=\\\"this.form.submit();\\\">\\n<option value=\\\"select\\\">Select an organism...</option>\\n\"; \n\twhile ($row<$rowmax) {\n\t $do = pg_Fetch_Object($dbres, $row);\n\t $name=$do->name;\n\t print \"<option value=\\\"$name\\\">$name</option>\\n\";\n\t $row++;\n\t}\n\tprint(\"</select></form>\\n\\n\");\n}", "function build_category_html($selected)\n\t{\n\t\tglobal $template, $db;\n\n\t $html = '<select name=\"category_id\" class=\"forminput\">';\n\t\n\t $sql = \"SELECT * FROM \" . GARAGE_CATEGORIES_TABLE . \" ORDER BY title ASC\";\n\t\n\t \tif ( !($result = $db->sql_query($sql)) )\n\t \t{\n\t \tmessage_die(GENERAL_ERROR, 'Could not category of mods for vehicle', '', __LINE__, __FILE__, $sql);\n\t \t}\n\t\n\t while ( $row = $db->sql_fetchrow($result) ) \n\t\t{\n\t\t\t$select = ( $selected == $row['id'] ) ? ' selected=\"selected\"' : '';\n\t\t\t$html .= '<option value=\"' . $row['id'] . '\"' . $select . '>' . $row['title'] . '</option>';\n\t }\n\t\n\t $html .= '</select>';\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'CATEGORY_LIST' => $html)\n\t\t);\n\t\n\t\treturn ;\n\t}", "public function createSelectOptions($options){\r\n\t\t$optionText = '';\r\n\t\tif(sizeof($options) >0){\t\r\n\t\t\tforeach($options as $key=>$option){\r\n\t\t\t\t$optionText .= '<option ';\r\n \t\t\t\tforeach($option as $sleKey=>$selOption) \r\n \t\t\t\t\t$optionText .= $sleKey.'=\"'.$selOption.'\" ';\r\n \t\t\t\t$optionText .= '>'.$key.'</option>';\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $optionText;\r\n\t}", "function genreopties(){\r\n\t\tglobal $pdo;\r\n\t\t\t//maken sql query\r\n\t\t$sql = \"SELECT DISTINCT genre_name FROM Genre\";\r\n\t\t\t//afschieten query\r\n\t\t$result = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\r\n\t\tforeach($result as $row){\r\n\t\t\tforeach($row as $genre){\r\n\t\t\t\techo '<option value='.$genre.'>'.$genre.'</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function montar_select_perfilPaciente(&$select_perfis, $objPerfilPaciente, $objPerfilPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_perfis = $objPerfilPacienteRN->listar($objPerfilPaciente);\n\n $select_perfis = '<select class=\"form-control selectpicker\" onchange=\"val()\" id=\"select-country idSel_perfil\"'\n . ' data-live-search=\"true\" name=\"sel_perfil\">'\n . '<option data-tokens=\"\" ></option>';\n\n foreach ($arr_perfis as $perfil) {\n $selected = '';\n if ($perfil->getIdPerfilPaciente() == $objPaciente->getIdPerfilPaciente_fk()) {\n $selected = 'selected';\n }\n\n $select_perfis .= '<option ' . $selected . ' value=\"' . $perfil->getIdPerfilPaciente() . '\" data-tokens=\"' . $perfil->getPerfil() . '\">' . $perfil->getPerfil() . '</option>';\n }\n $select_perfis .= '</select>';\n}", "function createRoomDropDown($dbSelected) {\n $tSQLselect = \"SELECT \";\n $tSQLselect .= \"loc_room \";\n $tSQLselect .= \"FROM \";\n $tSQLselect .= \"nhi_locations \";\n $tSQLselect .= \"order by loc_room \";\n\n\n $tSQLselect_Query = mysqli_query($dbSelected, $tSQLselect);\n\n $DropDown = \"\";\n $DropDown .= \" <option value=\\\"\\\">\\n\";\n while ($row = mysqli_fetch_assoc($tSQLselect_Query)) {\n\n foreach ($row as $idx => $r) {\n $DropDown .= \" <option value=\\\"$r\\\">\\n\";\n }\n }\n mysqli_free_result($tSQLselect_Query);\n\n return $DropDown;\n}", "function getSelectionOptions($filter) {\r\n global $parentCategory;\r\n if ($filter->isConditional()) {\r\n //displays the filter if the parent category is in the children category list\r\n if (!in_array($parentCategory, $filter->getCategory())) {\r\n //if its not found the function is returned\r\n return;\r\n }\r\n }\r\n //subvalues is a list of the items to add to the selection drop down of the filter\r\n $subvalues = array();\r\n if ($filter->isEnum()) {\r\n $subvalues = explode(\"','\", getEnumValues($filter->getTable(), $filter->getColumn()));\r\n } else {\r\n $subvalues = getColumList($filter->getTable(), $filter->getColumn(), $filter->getJoinTable(), $filter->getJoinColumn(), $filter->getComparator());\r\n }\r\n //if the dropdown is not empty, it'll create a select drop down box and add the values as options\r\n if (!empty($subvalues)) {\r\n $filterName = $filter->getName();\r\n echo $filterName . \": \";\r\n echo '<select name=\"' . $filterName . '\">' . $filterName;\r\n echo '<option></option>';\r\n foreach($subvalues as $sub) {\r\n $option = clean($sub);\r\n echo '<option value=\"' . $option . '\"' . (($_GET[\"$filterName\"] == $option) ? \" selected\" : \"\") . '>' . $option . \"</option>\";\r\n }\r\n echo \"</select> \";\r\n }\r\n }", "function selectHtml($idPlato, $name, $condicion, $parametros, $valorSeleccionado = \"\", $blanco = true, $orderby = \"1\") {\r\n $select = \"<select name='$name' id='$idPlato'>\";\r\n if ($blanco) {\r\n $select.= \"<option value='' />&nbsp $ </option>\";\r\n }\r\n $lista = $this->getList($condicion, $parametros, $orderby);\r\n foreach ($lista as $objeto) {\r\n $selected = \"\";\r\n if ($objeto->getIdPlato() == $valorSeleccionado) {\r\n $selected = \"selected\";\r\n }\r\n\r\n $select = \"<option $selected value='\" . $objeto->getIdPlato() . \"' >\" . $objeto->getNombre() . \",\" . $objeto->getDescripcion() .\r\n $objeto->getPrecio() . \"</option>\";\r\n }\r\n\r\n $select.=\"</select>\";\r\n return $select;\r\n }", "protected function getRecursiveSelectOptions() {}", "public static function selectOptions()\n {\n $options = (new static())->withQuery(function ($model){\n return $model->where('channel', self::$channel);\n })->buildSelectOptions();\n\n return collect($options)->prepend('请选择分类', 0)->all();\n }", "public function llenarCombo()\n {\n\n \n \t$area_destino = $_POST[\"dir\"];\n\n \t$options=\"\";\n \t\n \t$deptos = $this ->Modelo_direccion->obtenerCorreoDepto($area_destino);\n\n \tforeach ($deptos as $row){\n \t\t$options= '\n \t\t<option value='.$row->email.'>'.$row->email.'</option>\n \t\t'; \n \t\techo $options; \n \t}\n \t\n\n }", "public function dropdown()\n {\n $building_id = \\Request::get('building_id');\n return \\App\\Floor::where('building_id', $building_id)->lists('name','id');\n }", "function createConnectionSelectBoxes($number) {\n\tglobal $bands;\n\n\tfor ($i = 0; $i < $number; $i++) {\n\t\techo \"<select name='connection{$i}'>\";\n\t\t\techo \"<option value=''>-------</option>\";\n\t\tforeach ($bands as $band) {\n\t\t\techo \"<option value='{$band['id']}'>{$band['name']}</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}\n}", "function get_executives_and_fc()\r\n\t\t{\r\n\t\t\t$trr_id=$this->input->post('territory_id');\r\n\t\t\t$executives_list=$this->erpm->get_executives_by_territroy($trr_id);\r\n\t\t\t\r\n\t\t\techo '<select name=\"excutives_list\">';\r\n\t\t\t\techo '<option value=\"Choose\">Choose</option>';\r\n\t\t\t\tif($executives_list)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($executives_list as $executive)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<option value=\"'.$executive['employee_id'].'\">'.$executive['name'].'-'.$executive['role_name'].'</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\techo '</select>';\r\n\t\t}", "function selectList($name,$table,$option_name,$value_name,$curr_id,$script=\"\",$cond=\"\",$empty_option=0,$empty_value=\"\",$empty_str=\"\") {\n\n\t\tglobal $db, $db;\n\n\t\t$output\t\t = \"<select name=\\\"$name\\\" id=\\\"$name\\\" $script>\\n\";\n\t\tif ($empty_option) $output\t\t.= \"<option value=\\\"$empty_value\\\">$empty_str</option>\\n\";\n\n\t\tif(eregi(\"\\|\",$curr_id)){\n\t\t\t$curr_id_array=split(\"\\|\",$curr_id);\n\t\t}\n\n\t\tif(eregi(\"\\|\",$value_name)){\n\t\t\t$value_array=split(\"\\|\",$value_name);\n\t\t\t$value_query=preg_replace(\"#\\|#\",\",\",$value_name);\n\t\t}else{\n\t\t\t$value_query=$value_name;\n\t\t\t#echo\"<h1>value: $value_query | $value_name</h1>\";\n\t\t}\n\t\t$value_query=preg_replace(\"#,$#\",\"\",$value_query);\n\n\t\t$sql=\"select $option_name,$value_query from \".$table.\" $cond\";\n \n\t\t$result = $db->Execute(\"$sql\");\n\t\tif (!$result){\n\t\t\techo\"$sql\";\n\t\t\tprint $conn->ErrorMsg();\n\n\t\t}\n\t\twhile ( $row = $result->FetchRow() ) {\n\t\t\t//echo $curr_id.\"|\".$row[$this->fmtCase($option_name)].\"<br>\\n\";\n\t\t\tif(eregi(\"\\|\",$curr_id)){\n\t\t\t\t$selected= ((in_array($row[$this->fmtCase($option_name)],$curr_id_array))?\"selected \":\"\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$selected= (($curr_id==$row[$this->fmtCase($option_name)])?\"selected \":\"\");\n\t\t\t}\n\t\t\tif(eregi(\"\\|\",$value_name)){\n\n\t\t\t\tfor($i=0;$i<count($value_array);$i++){\n\t\t\t\t\t$each_value=strtolower($value_array[$i]);\n\t\t\t\t\t$_value .= $row[$each_value].\" -\";\n\t\t\t\t}\n\t\t\t\t$_value=preg_replace(\"#-$#\",\"\",$_value);\n\t\t\t}else{\n\t\t\t\t$value_name=strtolower($value_name);\n\t\t\t\t$_value=$row[$value_name];\n\t\t\t}\n\n\n\t\t\t$output .= \"<option value=\\\"\".$row[$this->fmtCase($option_name)].\"\\\" $selected>$_value</option>\\n\";\n\t\t\tunset($selected);\n\t\t\tunset($_value);\n\t\t}\n\t\t$result->Close();\n\n\t\t$output .= \"</SELECT>\\n\";\n\n\t\treturn $output;\n\t}", "public function render()\n {\n $fromList = array();\n $this->getFromList($fromList);\n $value = $this->getValue()!==null?$this->getValue():$this->getDefaultValue();\n $valueArray = explode(',', $value);\n \n $disabledStr = ($this->getEnabled() == \"N\") ? \"DISABLED=\\\"true\\\"\" : \"\";\n $style = $this->getStyle();\n $func = $this->getFunction();\n\n //$sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"[]\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n $sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n\n if ($this->blankOption) // ADD a blank option\n {\n $entry = explode(\",\",$this->blankOption);\n $text = $entry[0];\n $value = ($entry[1]!= \"\") ? $entry[1] : null;\n $entryList = array(array(\"val\" => $value, \"txt\" => $text ));\n $fromList = array_merge($entryList, $fromList);\n }\n\n $defaultValue = null;\n foreach ($fromList as $option)\n {\n $test = array_search($option['val'], $valueArray);\n if ($test === false)\n {\n $selectedStr = '';\n }\n else\n {\n $selectedStr = \"SELECTED\";\n $defaultValue = $option['val']; \n }\n $sHTML .= \"<OPTION VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr>\" . $option['txt'] . \"</OPTION>\";\n }\n if($defaultValue == null){\n \t$defaultOpt = array_shift($fromList);\n \t$defaultValue = $defaultOpt['val'];\n \tarray_unshift($fromList,$defaultOpt);\n }\n \n \n $this->setValue($defaultValue);\n $sHTML .= \"</SELECT>\";\n return $sHTML;\n }", "public function populateSuburbDropdown() {\n\n $qry = $this->db->prepare('SELECT DISTINCT SUBURB FROM n8598177.items;');\n $qry->execute();\n\n echo('\n <select name=\"search-suburb\" class=\"suburb-select-box\">\n <option disabled selected value=\"\">Suburb...</option>\n ');\n foreach ($qry as $hotspot) {\n echo '<option value=\"' . $hotspot['SUBURB'] . '\">' . $hotspot['SUBURB'] . '</option>';\n }\n echo '</select>';\n }", "function getClientsDropdown(){\n\t\t $data = array();\n\t\t $this->db->from('company');\n\t\t $this->db->where('client',1);\n\t\t $this->db->order_by('comp','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->comp]=$row->comp;\n\t\t }\n\t\t return $data;\n\t }", "public function getNewChildSelectOptions()\n {\n $productCondition = Mage::getModel('smile_virtualcategories/rule_condition_product');\n $productAttributes = $productCondition->loadAttributeOptions()->getAttributeOption();\n $attributes = array();\n\n foreach ($productAttributes as $code=>$label) {\n $attributes[] = array('value' => 'smile_virtualcategories/rule_condition_product|'.$code, 'label' => $label);\n }\n\n $conditions = array(\n array(\n 'value' => '',\n 'label' => Mage::helper('rule')->__('Please choose a condition to add...')\n ),\n array(\n 'value' => 'smile_virtualcategories/rule_condition_combine',\n 'label' => Mage::helper('catalogrule')->__('Conditions Combination')\n ),\n array(\n 'value' => $attributes,\n 'label' => Mage::helper('catalogrule')->__('Product Attribute')\n )\n );\n\n return $conditions;\n }", "function populateLocationDropdown($locations)\r\n{\r\n $result=\"\";\r\n foreach ($locations as $loc)\r\n {\r\n $result .= '<li value=\"' . $loc->getId() . '\" name=\"' . $loc->getBuilding() . '.' . $loc->getFloor() . '.' . $loc->getRoom() . '\"><a href=\"#\">' . $loc->getBuilding() . '.' . $loc->getFloor() . '.' . $loc->getRoom() . '</a></li>';\r\n }\r\n return $result;\r\n}", "function create_compute_resources_select($applicationId, $resourceHostId)\n{\n $computeResources = get_available_app_interface_compute_resources($applicationId);\n\n echo '<select class=\"form-control\" name=\"compute-resource\" id=\"compute-resource\">';\n\n foreach ($computeResources as $id => $name)\n {\n $selected = ($resourceHostId == $id)? ' selected' : '';\n\n echo '<option value=\"' . $id . '\"' . $selected . '>' .\n $name . '</option>';\n\n }\n\n echo '</select>';\n}", "function dropdown_tag ($xmlobjekt, $benutzer, $programmnr, $anweisungsnr, $tagtyp){\n\n #Liest den Wert des Tages aus\n $tagwert=$xmlobjekt->programm[$programmnr]->anweisung[$anweisungsnr]->wenn[0]->bedingung[$tagtyp]->wert[0];\n $index=100000*($benutzer+1)+10000*$programmnr+1000*($anweisungsnr+1)+100*0+10*$tagtyp+3;\n echo \"<select name=$index style=\\\"width:65px;\\\">\";\n if (strpos($tagwert,\"Mo\") !== false) {echo \"<option selected>Mo</option>\";} else {echo \"<option>Mo</option>\";}\n if (strpos($tagwert,\"Di\") !== false) {echo \"<option selected>Di</option>\";} else {echo \"<option>Di</option>\";}\n if (strpos($tagwert,\"Mi\") !== false) {echo \"<option selected>Mi</option>\";} else {echo \"<option>Mi</option>\";}\n if (strpos($tagwert,\"Do\") !== false) {echo \"<option selected>Do</option>\";} else {echo \"<option>Do</option>\";}\n if (strpos($tagwert,\"Fr\") !== false) {echo \"<option selected>Fr</option>\";} else {echo \"<option>Fr</option>\";}\n if (strpos($tagwert,\"Sa\") !== false) {echo \"<option selected>Sa</option>\";} else {echo \"<option>Sa</option>\";}\n if (strpos($tagwert,\"So\") !== false) {echo \"<option selected>So</option>\";} else {echo \"<option>So</option>\";}\n echo \"</select>\";\n}", "public function generateDropdown(){\n $this->load->model('profilelist');\n $this->load->model('Player');\n $playerresult = $this->Player->all();\n foreach($playerresult as $row){\n $this1 = array(\n 'playername' => $row->Player,\n \n );\n $lists[] = $this1; \n }\n $this->data['playerdropdown'] = $lists;\n }", "public function vehicles(){\n\t\t\t\n\t\t\tif(!$this->session->userdata('admin_logged_in')){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$url = 'admin/login?redirectURL='.urlencode(current_url());\n\t\t\t\tredirect($url);\t\t\t\t\t\t\t\n\t\t\t\t//redirect('admin/login/','refresh');\n\t\t\t\t\n\t\t\t}else{\t\t\t\n\n\t\t\t\t\t$username = $this->session->userdata('admin_username');\n\t\t\t\t\n\t\t\t\t\t$data['user_array'] = $this->Admin->get_user($username);\n\t\t\t\t\t\n\t\t\t\t\t$fullname = '';\n\t\t\t\t\tif($data['user_array']){\n\t\t\t\t\t\tforeach($data['user_array'] as $user){\n\t\t\t\t\t\t\t$fullname = $user->admin_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$data['fullname'] = $fullname;\n\t\t\t\t\t\n\t\t\t\t\t$data['unread_contact_us'] = $this->Contact_us->count_unread_messages();\n\t\t\t\t\t\n\t\t\t\t\t$messages_unread = $this->Messages->count_unread_messages($username);\n\t\t\t\t\tif($messages_unread == '' || $messages_unread == null){\n\t\t\t\t\t\t$data['messages_unread'] = 0;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$data['messages_unread'] = $messages_unread;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$data['header_messages_array'] = $this->Messages->get_header_messages($username);\n\t\t\t\t\t\n\t\t\t\t\t$enquiries_unread = $this->Sale_enquiries->count_unread_enquiries();\n\t\t\t\t\tif($enquiries_unread == '' || $enquiries_unread == null){\n\t\t\t\t\t\t$data['enquiries_unread'] = 0;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$data['enquiries_unread'] = $enquiries_unread;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t//SELECT VEHICLE TYPE DROPDOWN\n\t\t\t\t\t$vehicle_type = '<div class=\"form-group\">';\n\t\t\t\t\t$vehicle_type .= '<select name=\"vehicle_type\" id=\"vehicleType\" class=\"form-control select2\">';\n\t\t\t\t\t\n\t\t\t\t\t$vehicle_type .= '<option value=\"\" selected=\"selected\">Select</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('vehicle_types');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t$vehicle_type .= '<option value=\"'.$row['name'].'\" >'.$row['name'].'</option>';\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$vehicle_type .= '</select>';\n\t\t\t\t\t$vehicle_type .= '</div>';\t\n\t\t\t\t\t$data['vehicle_type'] = $vehicle_type;\n\t\t\t\t\t//*********END SELECT VEHICLE TYPE DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//*********SELECT VEHICLE MAKE DROPDOWN**********//\n\t\t\t\t\t//$vehicle_make = '<div class=\"form-group\">';\n\t\t\t\t\t//$vehicle_make .= '<select name=\"vehicle_make\" id=\"vehicleMake\" class=\"form-control select2\">';\n\t\t\t\t\t\n\t\t\t\t\t$vehicle_make = '<option value=\"\" selected=\"selected\">Select Make</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('vehicle_makes');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t$vehicle_make .= '<option value=\"'.$row['title'].'\" >'.$row['title'].'</option>';\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//$vehicle_make .= '</select>';\n\t\t\t\t\t//$vehicle_make .= '</div>';\t\n\t\t\t\t\t$data['vehicle_make'] = $vehicle_make;\n\t\t\t\t\t//*********END SELECT VEHICLE MAKE DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//*********SELECT VEHICLE MODEL DROPDOWN**********//\n\t\t\t\t\t//$vehicle_model = '<div class=\"form-group\">';\n\t\t\t\t\t//$vehicle_model .= '<select name=\"vehicle_model\" id=\"vehicle_model\" class=\"form-control\">';\n\t\t\t\t\t\n\t\t\t\t\t$vehicle_model = '<option value=\"\" selected=\"selected\">Select Model</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t$this->db->from('vehicle_models');\n\t\t\t\t\t$this->db->order_by('id');\n\t\t\t\t\t$result = $this->db->get();\n\t\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t$vehicle_model .= '<option value=\"'.$row['title'].'\" >'.$row['title'].'</option>';\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//$vehicle_model .= '</select>';\n\t\t\t\t\t//$vehicle_model .= '</div>';\t\n\t\t\t\t\t$data['vehicle_model'] = $vehicle_model;\n\t\t\t\t\t//*********END SELECT VEHICLE MODEL DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//count and display the number of Vehicles\n\t\t\t\t\t$count = $this->Vehicles->count_all();\n\t\t\t\t\t\t\n\t\t\t\t\tif($count == '' || $count == null){\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$data['vehicle_count'] = $count;\n\t\t\t\t\t\n\t\t\t\t\t//assign page title name\n\t\t\t\t\t$data['pageTitle'] = 'Vehicles';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//assign page title name\n\t\t\t\t\t$data['pageID'] = 'vehicles';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//load header and page title\n\t\t\t\t\t$this->load->view('admin_pages/header', $data);\n\t\t\t\t\t\t\t\n\t\t\t\t\t//load main body\n\t\t\t\t\t$this->load->view('admin_pages/vehicles_page', $data);\t\n\t\t\t\t\t\n\t\t\t\t\t//load footer\n\t\t\t\t\t$this->load->view('admin_pages/footer');\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}", "function makeList($listName, $listOptions, $selectOption ,$addAny) {\r\n\t$output = \"<select name = \\\"$listName\\\" id =\\\"$listName\\\">\\n\";\r\n\t// check if the option was for search or for adding and editing\r\n\tif ($addAny==\"addAny\") {\r\n\t\t$output .= \"<option selected=\\\"true\\\" value=\\\"any\\\">ANY</option>\";\r\n\t}\r\n\t// foreach statment to fill the options with the value and the text\r\n\tforeach ($listOptions as $key=>$value) {\r\n\t\tif ($selectOption == $value) {\r\n\t// check wich choice would be selected\r\n\t\t\t$output .= \"<option selected=\\\"true\\\" value=\\\"$key\\\">$value</option>\\n\";\r\n\t\t}\r\n\t\telse{\r\n\t// add options\r\n\t\t\t$output .= \"<option value=\\\"$key\\\">$value</option>\\n\";\r\n\t\t}\r\n\t}\r\n\t// close the select box\r\n\t$output .= \"</select>\\n\";\r\n\techo $output;\r\n}", "function comboRecompensas($id_recompensa = 0, $filter = \"\", $name_control = \"id_recompensa\"){\n\t$elements = recompensasController::getListAction(9999, $filter); ?>\n\t<select name=\"<?php echo $name_control;?>\" id=\"<?php echo $name_control;?>\" class=\"form-control\">\n\t\t<option value=\"0\"> ---- Selecciona una recompensa ---- </option>\n\t\t<?php foreach($elements['items'] as $element):?>\n\t\t<option value=\"<?php echo $element['id_recompensa'];?>\" <?php if ($id_recompensa == $element['id_recompensa']) echo ' selected=\"selected\" ';?>><?php echo $element['recompensa_name'];?></option>\n\t\t<?php endforeach;?>\n\t</select>\n<?php }", "function getLodDropDown($PROJECT, $FORM_ITEM_NAME, $MULTIPLE_SELECT) {\n $SCM_SCRIPTS_DIR = \"/opt/build/scm/scripts/buildServer/groovy\";\n\t//echo $SCM_SCRIPTS_DIR;\n $SOURCE_INFO = \"source /opt/cvbuild/.bash_profile 2>&1\";\n // get an array for each branch\n $lods = array();\n// $getLodCmd = $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=' . $LOG_LEVEL . ' --project=' . $PROJECT . ' --path_to_project=' . $PATH_TO_PROJECT; \n $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"'; \n// $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetTagsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"';\n exec($getLodCmd . ' | egrep -e \"^br_*\"', $lods);\n// exec($getLodCmd . ' | egrep -e \"^r_*\"', $lods);\n usort($lods, 'lodWLevelCompare');\n $lods = array_reverse($lods);\n\n if($MULTIPLE_SELECT == 'true') {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\" ' . 'multiple=\"multiple\" size=\"5\">';\n }\n else {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\">';\n }\n foreach ($lods as $lod) {\n $lod = str_replace('/','',$lod);\n $output = $output . '<option value=\"' . $lod . '\">' . $lod . '</option>';\n }\n $output = $output. '</select>';\n return $output;\n}", "function addSelectList($name, $option_list, $header = NULL, $attr_ar = array(),$OBJ) { \n $str = \"<select name=\\\"$name\\\" id=\\\"$name\\\" \"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">\\n\"; \n if ( isset($header) ) { \n $str .= \" <option value=\\\"\\\">$header</option>\\n\"; \n } \n foreach ( $option_list as $val => $text ) { \n $str .= \"<option value=\\\"$val\\\"\"; \n if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text) ) ) { \n $str .= ' selected '; \n } \n $str .= \">$text</option>\\n\"; \n } \n $str .= \"</select>\"; \n\t\t$OBJ->assign('_'.$name,$str);\n return $str; \n }", "function buildVehiclesDisplay($vehicles){\r\n $dv = '<ul id=\"inv-display\">';\r\n foreach ($vehicles as $vehicle) {\r\n $dv .= '<li>';\r\n $dv .= \"<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=\".urlencode($vehicle['invId']).\"'><img src='$vehicle[imgPath]' alt='Image of $vehicle[invMake] $vehicle[invModel] on phpmotors.com'></a>\";\r\n $dv .= '<hr>';\r\n $dv .= \"<a href='/phpmotors/vehicles/?action=vehicle-detail&invId=\".urlencode($vehicle['invId']).\"'><h2>$vehicle[invMake] $vehicle[invModel]</h2></a>\";\r\n $dv .= \"<span>$vehicle[invPrice]</span>\";\r\n $dv .= '</li>';\r\n }\r\n $dv .= '</ul>';\r\n return $dv;\r\n }", "function getFenzuCombo_html($viewid='',$is_relate=false)\n\t{\n\t\tglobal $adb;\n\t\tglobal $app_strings;\n\t\tglobal $current_user;\n\t\t\n\t\t$public_condition = \" 1 \";\n\n\t\t$tabid = getTabid($this->Fenzumodule);\n\t\t$ssql = \"select ec_fenzu.cvid,ec_fenzu.viewname from ec_fenzu inner join ec_tab on ec_tab.name = ec_fenzu.entitytype\";\n\t\t$ssql .= \" where ec_tab.tabid=\".$tabid.\" and \".$public_condition;\n\t\t$result = $adb->getList($ssql);\n\t\t$shtml = array();\n\t\tforeach($result as $cvrow)\n\t\t{\n\t\t\t//all should be gotten via app_strings by dingjianting on 2007-04-24 for Fenzu problem\n\n\t\t\tif($cvrow['viewname'] == $app_strings['All'])\n\t\t\t{\n\t\t\t\t$cvrow['viewname'] = $app_strings['COMBO_ALL'];\n\t\t\t}\n\n\n\t\t\tif(!$is_relate) {\n\t\t\t\tif($cvrow['setdefault'] == 1 && $viewid =='')\n\t\t\t\t{\n\t\t\t\t\t\t\t $shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t\t\t $this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telseif($cvrow['cvid'] == $viewid)\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t$this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t}\n\t\t\t//$shtml[$cvrow['cvid']] = $cvrow['viewname'];\n\t\t}\n\t\treturn $shtml;\n\t}", "function addSelectList4($name, $option_list, $header = NULL, $attr_ar = array(),$OBJ,$slted = NULL) { \n $str = \"<select name=\\\"$name\\\" id=\\\"$name\\\" \"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">\\n\"; \n if ( isset($header) ) { \n $str .= \" <option value=\\\"\\\">$header</option>\\n\"; \n } \n foreach ( $option_list as $val => $text ) { \n $str .= \"<option value=\\\"$val\\\" \"; \n if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text) ) || trim($slted) === trim($val) ) { \n $str .= ' selected '; \n } \n\t\t\tif (is_array($text[1])){\n\t\t\t\tforeach($text[1] as $keyext => $valext){\t\t\t\n\t\t\t\t\t\t$str .= ' item'.$keyext.' = \"'.$valext.'\" '; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n $str .= \" >\".$text[0].\"</option>\\n\"; \n } \n $str .= \"</select>\"; \n\t\t$OBJ->assign('_'.$name,$str);\n return $str; \n }", "function addSelectList2($name, $option_list, $header = NULL, $attr_ar = array(),$OBJ,$slted = NULL) { \n $str = \"<select name=\\\"$name\\\" id=\\\"$name\\\" \"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">\\n\"; \n if ( isset($header) ) { \n $str .= \" <option value=\\\"\\\">$header</option>\\n\"; \n } \n foreach ( $option_list as $val => $text ) { \n $str .= \"<option value=\\\"$val\\\" \"; \n if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text) ) || trim($slted) === trim($val) ) { \n $str .= ' selected '; \n } \n $str .= \">$text</option>\\n\"; \n } \n $str .= \"</select>\"; \n\t\t$OBJ->assign('_'.$name,$str);\n return $str; \n }", "function SelectValuesUnidad($db_conx) {\r\n $sql = \"SELECT uni_codigo, uni_descrip FROM tunidad ORDER BY uni_descrip ASC\";\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select class=\"unidadmedico\" multiple=\"multiple\" id=\"cmbunidad\">';\r\n $c = 0;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "function mfcs_get_request_building_list_options($location = NULL, $option = NULL, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n if ($hidden) {\n $options[0] = 'None';\n }\n\n $buildings = mfcs_load_buildings($location, NULL, $disabled);\n\n if ($option == 'special') {\n global $base_path;\n $module_path = drupal_get_path('module', 'mfcs');\n\n foreach ($buildings as &$building) {\n // to simplify the design and to avoid having to alter the code later on, use the building and building ids as the name of the file.\n $image_file_path = NULL;\n\n // look for generic building-specific images.\n if (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/buildings/' . $building->building_id . '.png')) {\n $image_file_path = $base_path . $module_path . '/images/buildings/' . $building->building_id . '.png';\n }\n elseif (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/buildings/' . $building->building_id . '.jpg')) {\n $image_file_path = $base_path . $module_path . '/images/buildings/' . $building->building_id . '.jpg';\n }\n elseif (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/buildings/0.png')) {\n $image_file_path = $base_path . $module_path . '/images/buildings/0.png';\n }\n\n $building_name = NULL;\n if (!empty($building->building_name)) {\n $building_name = check_plain($building->building_name);\n }\n $building_name = trim($building_name);\n\n $text = '';\n if (!is_null($image_file_path)) {\n $text = '<img src=\"' . $image_file_path . '\" alt=\"' . $building_name . '\" width=\"65\" class=\"building_image\">';\n }\n\n $text .= '<div class=\"building_name\">' . $building_name . '</div>';\n\n $options[$building->building_id] = $text;\n }\n\n // return now to avoid custom sorting.\n return $options;\n }\n else {\n foreach ($buildings as &$building) {\n $options[$building->building_id] = $building->building_name;\n }\n }\n\n asort($options);\n\n return $options;\n}", "public static function renderSelect();", "function montar_select_sexo(&$select_sexos, $objSexoPaciente, $objSexoPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_sexos = $objSexoPacienteRN->listar($objSexoPaciente);\n\n $select_sexos = '<select onfocus=\"this.selectedIndex=0;\" onchange=\"val_sexo()\" '\n . 'class=\"form-control selectpicker\" id=\"select-country idSexo\" data-live-search=\"true\" '\n . 'name=\"sel_sexo\">'\n . '<option data-tokens=\"\"></option>';\n\n foreach ($arr_sexos as $sexo) {\n $selected = '';\n if ($sexo->getIdSexo() == $objPaciente->getIdSexo_fk()) {\n $selected = 'selected';\n }\n $select_sexos .= '<option ' . $selected . ' value=\"' . $sexo->getIdSexo() . '\" data-tokens=\"' . $sexo->getSexo() . '\">' . $sexo->getSexo() . '</option>';\n }\n $select_sexos .= '</select>';\n}", "public function getNewChildSelectOptions()\n {\n $addressCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_address'\n );\n $addressAttributes = $addressCondition->loadAttributeOptions()\n ->getAttributeOption();\n $attributes = array();\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_subtotal',\n 'label' => Mage::helper('giftpromo')->__('Sub Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_grandtotal',\n 'label' => Mage::helper('giftpromo')->__('Grand Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_discounttotal',\n 'label' => Mage::helper('giftpromo')->__(\n 'Sub Total After Discounts'\n ));\n\n foreach ($addressAttributes as $code => $label) {\n $attributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_address|'\n . $code, 'label' => $label);\n }\n\n\n $checkoutCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_checkout'\n );\n $checkoutAttributes = $checkoutCondition->loadAttributeOptions()\n ->getAttributeOption();\n $chAttributes = array();\n\n foreach ($checkoutAttributes as $code => $label) {\n $chAttributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_checkout|'\n . $code, 'label' => $label);\n }\n\n $customerRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_customer_conditions',\n 'label' => Mage::helper('giftpromo')->__(\n 'Customer conditions combination'\n ))\n );\n $productRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_found',\n 'label' => Mage::helper('giftpromo')->__(\n 'Product attribute combination'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect',\n 'label' => Mage::helper('giftpromo')->__(\n 'Products Sub Selection'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect_free',\n 'label' => Mage::helper('giftpromo')->__('Cheapest Free')\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_upgrade',\n 'label' => Mage::helper('giftpromo')->__('Product Upgrades')\n )\n );\n\n $conditions = parent::getNewChildSelectOptions();\n $conditions = array_merge_recursive(\n $conditions,\n array(\n array('label' => Mage::helper('giftpromo')->__(\n 'Cart Attributes'\n ), 'value' => $attributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Checkout Attributes'\n ), 'value' => $chAttributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Customer Related Rules'\n ), 'value' => $customerRules),\n array('label' => Mage::helper('giftpromo')->__(\n 'Product Related Rules'\n ), 'value' => $productRules),\n // array('value' => 'giftpromo/promo_rule_condition_twitter_conditions', 'label' => Mage::helper('giftpromo')->__('Twitter conditions combination')),\n )\n );\n\n return $conditions;\n }", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('finder_dropdown_');\n $values = [];\n foreach($this->_model->getDropdowns() as $dropdown) {\n $prefix = 'dropdown_'.$dropdown->getId();\n\n $fieldset = $form->addFieldset($prefix, ['legend' => __('Dropdown #%1',$dropdown->getPos()+1)]);\n $fieldset->addField(\n $prefix . '_name',\n 'text',\n ['name'=>$prefix . '_name', 'label' => __('Name'), 'title' => __('Name'), 'required' => true]\n );\n $values[$prefix . '_name'] = $dropdown->getName();\n $fieldset->addField(\n $prefix . '_sort',\n 'select',\n [\n 'name'=>$prefix . '_sort', 'label' => __('Sort'), 'title' => __('Sort'), 'required' => true,\n 'values' => [\n ['value' => \\Amasty\\Finder\\Helper\\Data::SORT_STRING_ASC, 'label' => __('alphabetically, asc')],\n ['value' => \\Amasty\\Finder\\Helper\\Data::SORT_STRING_DESC, 'label' => __('alphabetically, desc')],\n ['value' => \\Amasty\\Finder\\Helper\\Data::SORT_NUM_ASC, 'label' => __('numerically, asc')],\n ['value' => \\Amasty\\Finder\\Helper\\Data::SORT_NUM_DESC, 'label' => __('numerically, desc')],\n ]\n ]\n );\n $values[$prefix . '_sort'] = $dropdown->getSort();\n\n $fieldset->addField(\n $prefix . '_range',\n 'select',\n [\n 'name'=>$prefix . '_range', 'label' => __('Range'), 'title' => __('Range'), 'required' => true,\n 'values' => [\n ['value' => 0, 'label' => __('No')],\n ['value' => 1, 'label' => __('Yes')],\n ]\n ]\n );\n $values[$prefix . '_range'] = $dropdown->getRange();\n }\n $form->setValues($values);\n $this->setForm($form);\n return parent::_prepareForm();\n }", "function displayFilterOptions() {\n\n if ($this->isPageType()) { \n\n $templates = $this->getAllPageTemplates(); \n\n echo '<select name=\"template\">';\n echo '<option value=\"\">Show all</option>';\n \n $currTemplate = isset($_GET['template'])? $_GET['template']:'';\n\n foreach ($templates as $template) {\n echo \"<option value={$template} \";\n if($template == $currTemplate) { echo 'selected=\"selected\"'; }\n echo \">\" . $template .\"</option>\"; \n }\n \n echo '</select>'; \n }\n }", "private function generate_filter_dropdowns() {\n $html = '';//no html\n \n //instance filter dropdown\n $instance_config = $this->get_settings_config_data();//get instance config\n if(isset($instance_config) && isset($instance_config->data)//if config exists, and data has been saved\n && count($instance_config->data) > 0) {//there is actually a filter saved\n \n $text = get_string('instance_filters', 'block_dd_content');//get label text\n $html .= $this->generate_filter_dropdown($text, $instance_config->data);//generate dropdown\n }\n\n //global filter dropdown\n $global_config_data = dd_content_get_admin_config();//grab global block config DATA (not the config itself)\n if(count($global_config_data) > 0) {//if a filter exists\n \n $text = get_string('global_filters', 'block_dd_content');//get global filter label\n $html .= $this->generate_filter_dropdown($text, $global_config_data);//create dropdown\n }\n \n \n return $html;\n }", "function SelectValuesLocalizacion($db_conx) {\r\n $sql = \"SELECT loc_codigo, loc_descrip FROM tlocalizacion ORDER BY loc_descrip ASC\";\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $data = '<select class=\"localizacion\" id=\"cmblocalizacion\">\r\n <option value=\"\">Seleccione...</option>';\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>'; \r\n }\r\n $data .= '</select\">';\r\n echo $data;\r\n}", "function construirComboSoloDatos($result) {\n\t\n\t$cadena = \"\";\n\tforeach($result as $opcion) {\t\t\n\t\t$cadena .= \"<option value=\\\"\". $opcion[\"codigo\"] .\"\\\">\" . $opcion[\"texto\"] . \"</option>\";\n\t}\n\t\n\treturn $cadena;\t\n}", "function _build_tree_select($params)\n\t{\n\t\t$params = array_merge(array(\n\t\t\t'tree'\t\t\t=> array(),\n\t\t\t'parent_id'\t\t=> 0,\n\t\t\t'current_parent'=> 0,\n\t\t\t'current_id'\t=> 0,\n\t\t\t'level'\t\t\t=> 0\n\t\t), $params);\n\n\t\textract($params);\n\n\t\tif ( ! $tree)\n\t\t{\n\t\t\tif ($pages = $this->db->select('id, parent_id, title')->get('pages')->result())\n\t\t\t{\n\t\t\t\tforeach($pages as $page)\n\t\t\t\t{\n\t\t\t\t\t$tree[$page->parent_id][] = $page;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! isset($tree[$parent_id]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$html = '';\n\n\t\tforeach ($tree[$parent_id] as $item)\n\t\t{\n\t\t\tif ($current_id == $item->id)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$html .= '<option value=\"' . $item->id . '\"';\n\t\t\t$html .= $current_parent == $item->id ? ' selected=\"selected\">': '>';\n\n\t\t\tif ($level > 0) \n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < ($level*2); $i++)\n\t\t\t\t{\n\t\t\t\t\t$html .= '&nbsp;';\n\t\t\t\t}\n\n\t\t\t\t$html .= '-&nbsp;';\n\t\t\t}\n\n\t\t\t$html .= $item->title . '</option>';\n\n\t\t\t$html .= $this->_build_tree_select(array(\n\t\t\t\t'tree'\t\t\t=> $tree,\n\t\t\t\t'parent_id'\t\t=> (int) $item->id,\n\t\t\t\t'current_parent'=> $current_parent,\n\t\t\t\t'current_id'\t=> $current_id,\n\t\t\t\t'level'\t\t\t=> $level + 1\n\t\t\t));\n\t\t}\n\n\t\treturn $html;\n\t}", "public function sublistcombo()\n\t{\n\t\techo'\n\t\t\t<select name=\"sublistcombo\" style=\"width: 180px;\">\n\t\t\t\t\t\n\t\t\t <option value=\"None\">None</option>\n\t\t\t <option value=\"Hindi\">Hindi</option>\n\t\t\t <option value=\"English\">English</option>\n\t\t\t <option value=\"Maths\">Maths</option>\n\t\t\t <option value=\"Social Science\">Social Science</option>\n\t\t\t <option value=\"General Science\">General Science</option>\n\t\t\t <option value=\"Sanscrit\">Sanscrit</option>\n\t\t\t <option value=\"Computer Science\">Computer Science</option>\n\t\t\t <option value=\"Physics\">Physics</option>\n\t\t\t <option value=\"Chemistry\">Chemistry</option>\n\t\t\t <option value=\"Higher Math\">Higher Math</option>\n\t\t\t <option value=\"Biology\">Biology</option>\n\t\t\t <option value=\"Sociology\">Sociology</option>\n\t\t\t <option value=\"Economics\">Economics</option>\n\t\t\t <option value=\"Accounts\">Accounts</option>\n\t\t\t <option value=\"History\">History</option>\n\t\t\t <option value=\"Finance\">Finance</option>\n\t\t\t <option value=\"Statistics\">Statistics</option>\n\t\t\t <option value=\"Civics\">Civics</option>\n\t\t\t <option value=\"Music\">Music</option>\n\t\t\t</select>\n\n\n\t\t';\n\t}", "public function getFuelTypeOptions()\n\t{\n\t\t$fuelType = FuelType::model()->findAll();\n\t\treturn CHtml::listData($fuelType, 'fuelTypeId', 'fuelTypeName');\n\t}", "public function getNewChildSelectOptions()\n {\n $conditions = [\n ['value' => $this->getType(), 'label' => __('Conditions Combination')],\n $this->_attributeFactory->create()->getNewChildSelectOptions(),\n ];\n\n $conditions = array_merge_recursive(parent::getNewChildSelectOptions(), $conditions);\n return $conditions;\n }", "function build_business_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$business_list = \"<select name='id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$business_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$business_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$business_list .= \"<option value=''>\".$lang['Select_A_Business'].\"</option>\";\n\t\t\t$business_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $business = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$business_list .= \"<option value='\".$business['id'].\"'>\".$business['title'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$business_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'BUSINESS_LIST' => $business_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "public function list_for_select(){\n\n\n $categories = new OsServiceCategoryModel();\n $categories = $categories->get_results();\n $response_html = '<option value=\"0\">'.__('Uncategorized', 'latepoint').'</option>';\n foreach($categories as $category){\n $response_html.= '<option>'.$category->name.'</option>';\n }\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n }", "public function get_select() {\r\n\t\t$html = '';\r\n\t\tforeach ( $this->taxonomies as $tax ) {\r\n\t\t\t$options = sprintf( '<option value=\"\">%s %s</option>', __('View All', 'themify-portfolio-posts'),\r\n\t\t\tget_taxonomy($tax)->label );\r\n\t\t\t$class = is_taxonomy_hierarchical( $tax ) ? ' class=\"level-0\"' : '';\r\n\t\t\tforeach ( get_terms( $tax ) as $taxon ) {\r\n\t\t\t\t$options .= sprintf( '<option %s%s value=\"%s\">%s%s</option>', isset( $_GET[$tax] ) ? selected( $taxon->slug, $_GET[$tax], false ) : '', '0' !== $taxon->parent ? ' class=\"level-1\"' : $class, $taxon->slug, '0' !== $taxon->parent ? str_repeat( '&nbsp;', 3 ) : '', \"{$taxon->name} ({$taxon->count})\" );\r\n\t\t\t}\r\n\t\t\t$html .= sprintf( '<select name=\"%s\" id=\"%s\" class=\"postform\">%s</select>', esc_attr( $tax ), esc_attr( $tax ), $options );\r\n\t\t}\r\n\t\techo $html;\r\n\t}", "function select02($nombreSelect,$arrayOpciones){\n\t$i = '0';\n\t$arrayResultado[$i++] = \"<select name=\\\"$nombreSelect\\\">\";\n\tforeach( $arrayOpciones as $key => $value ){\n\t\tif( $i == '1' ){\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\" selected=\\\"selected\\\">\".$value.\"</option>\";\n\t\t} else {\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\">\".$value.\"</option>\";\n\t\t}\n\t}\n\t$arrayResultado[$i++] = \"</select>\";\n\treturn $arrayResultado;\n/*\nforeach( $arrayResultado as $value){\n\techo $value.\"<br />\\n\";\n}\n*/\n}", "function categoria($productos) {\r\n $opciones = array(); \r\n foreach($productos->producto as $producto) {\r\n $opciones[] = $producto->categoria;\r\n }\r\n //eliminar los duplicados para mostrar el select con las opciones\r\n $opciones = array_unique($opciones);\r\n\r\n //crear las opciones del select sin repetidos\r\n for ($i=0; $i < count($opciones); $i++) { \r\n echo \"<option value='\" . $opciones[$i] . \"'>\" . ucwords($opciones[$i]) . \"</option>\";\r\n }\r\n }", "public function Lista_Ciudades()//FUNCION PARA LLAMAR LA LISTA DE DEPARTAMENTOS\n {\n \n include('conexion.php');\n \n\n $Consulta_Ciudad = \"SELECT * FROM p_ciudad ORDER BY ciud_nombre\";\n\t\t\t $Resultado_Consulta_Ciudad = $conexion->prepare($Consulta_Ciudad);\n $Resultado_Consulta_Ciudad->execute();\n\t\t\t\t\t while ($f = $Resultado_Consulta_Ciudad->fetch())\t\n {\n\t\t\t\t\t\t echo '<option value=\"'.$f[ciud_codigo].'\">'.$f[ciud_nombre].'</option>';\n }\n \n }", "function listadoSelect();", "public static function build_drop_down($selectname,$tablename,$match,$name = \"name\"){\n\n $db = new DB(DB_HOST, DB_USER, DB_PASS, DB_NAME) ;\n\n $value[$selectname] = \"<select name='$selectname' id='$selectname'>\";\n // $table = $db->getInstances($tablename);\n $sql = \"SELECT * FROM $tablename \";\n $table = $db->doQuery($sql,array(),array());\n\n $select = self::drop_down($table,$match,$selectname,$name );\n foreach($select as $row){\n\n $value[$selectname] = $value[$selectname].$row;\n\n }\n\n return $value[$selectname];\n\n }", "function buildFilterUI($dbh, $template, $vars) {\r\n $states = getRepresentedStates($dbh);\r\n for ($i=0; $i<count($states); $i++) {\r\n $states[$i]['selected'] = \"\";\r\n if (in_array($states[$i]['state'], $vars['states'])) {\r\n $states[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n \r\n $countries = getRepresentedCountries($dbh);\r\n for ($i=0; $i<count($countries); $i++) {\r\n $countries[$i]['selected'] = \"\";\r\n if (in_array($countries[$i]['country'], $vars['countries'])) {\r\n $countries[$i]['selected'] = \"selected\";\r\n }\r\n \r\n }\r\n \r\n $developers = getRepresenteddevelopers($dbh);\r\n for ($i=0; $i<count($developers); $i++) {\r\n $developers[$i]['selected'] = \"\";\r\n if (in_array($developers[$i]['id'], $vars['developers'])) {\r\n $developers[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n\r\n $sources = getRepresentedsources($dbh);\r\n for ($i=0; $i<count($sources); $i++) {\r\n $sources[$i]['selected'] = \"\";\r\n if (in_array($sources[$i]['id'], $vars['sources'])) {\r\n $sources[$i]['selected'] = \"selected\";\r\n }\r\n }\r\n \r\n $template->get('state-list')->loop($states);\r\n $template->get('country-list')->loop($countries);\r\n $template->get('developer-list')->loop($developers);\r\n $template->get('sources-list')->loop($sources);\r\n \r\n if ($vars['filter-state'] == \"on\") {\r\n $template->get('state-checked')->unmute();\r\n }\r\n \r\n if ($vars['filter-developer'] == \"on\") {\r\n $template->get('developer-checked')->unmute();\r\n }\r\n \r\n if ($vars['filter-source'] == \"on\") {\r\n $template->get('source-checked')->unmute();\r\n }\r\n if ($vars['filter-country'] == \"on\") {\r\n $template->get('country-checked')->unmute();\r\n }\r\n // Pedigree filters\r\n //$template->get('country-list')->loop(getRepresentedCountries($dbh));\r\n //$template->get('developer-list')->loop(getRepresentedDevelopers($dbh));\r\n //$template->get('sources-list')->loop(getRepresentedSources($dbh));\r\n \r\n // Stock filters\r\n $template->get('developer_options')->replace(getDeveloperOptions($dbh)); \r\n $template->get('type_options')->replace(getTypeOptions($dbh)); \r\n $template->get('linkage_options')->replace(getLinkageOptions($dbh)); \r\n $template->get('karyotype_options')->replace(getKaryotypeOptions($dbh)); \r\n \r\n }", "private function buildselectforwatches() {\n $this->isirdb->join('spis2users_watches', 'users_watches.id = spis2users_watches.watched_id', 'left');\n $this->isirdb->join('spis', 'spis2users_watches.spis_id = spis.id', 'left');\n\n $this->isirdb->select('\n users_watches.id AS id, \n users_watches.name AS name, \n users_watches.ic AS ic, \n users_watches.rc AS rc, \n users_watches.birthdate AS birthdate, \n users_watches.firstname AS firstname, \n users_watches.note AS note,\n users_watches.clientname AS clientname,\n has_likvidace AS likvidace,\n has_vat_debtor AS vatdebtor,\n has_account_change AS account_change,\n GROUP_CONCAT(spis.id, \"|\", spis.status_id SEPARATOR \",\") AS spises,\n users_watches.official_name AS official_name'\n , false);\t\t\t\t\t\t\n }", "public function getNewChildSelectOptions()\n {\n return array('value' => $this->getType(),\n 'label' => Mage::helper('bronto_reminder')->__('SKU'));\n }", "public function ctlBuscaClientes(){\n\n\t\t$respuesta = Datos::mdlClientes(\"clientes\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "function fillParties($year) {\n global $db;\n //vyber takych politickych stran, ktore boli zvolene v konkretnom volebnom obdobi (roku)\n $query = \"SELECT strany.nazov, vysledky.koalicia FROM strany \n INNER JOIN vysledky ON vysledky.id_strany = strany.id\n INNER JOIN volby ON vysledky.id_volby = volby.id\n WHERE volby.den1 like '{$year}%'\";\n\n $stmt = $db->query($query);\n $options = $stmt->fetchAll(PDO::FETCH_ASSOC);\n ;\n\n foreach ($options as $option) {\n if ($option['koalicia'] == 1) {\n echo \"<option value=\\\"{$option['nazov']}\\\">{$option['nazov']} (KOALICIA)</option>\";\n }\n else {\n echo \"<option value=\\\"{$option['nazov']}\\\">{$option['nazov']} (OPOZICIA)</option>\";\n }\n }\n}", "public function prepareOptions()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\t$query = 'SELECT name FROM options WHERE id_votes =\"'.$this->voteId.'\" ORDER BY id_option ASC ';\r\n\t\t\tif ($result = $mysqli->query($query))\r\n\t\t\t{\r\n\t\t\t\twhile($obj = $result->fetch_object())\r\n\t\t\t\t{\r\n\t\t\t\t\tarray_push($this->optionList,$obj->name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$mysqli->close(); \r\n\t\t}", "public function optionList(){\n $this->layout = null;\n\n\t $this->set('chamados',\n $this->Chamado->find('list', array(\n 'fields' => array('Chamado.id', 'Chamado.numero'),\n 'conditions' => array('Chamado.servico_id' => $this->params['url']['servico']))));\n }", "public function ctlBuscaMisBodegas(){\n\n\t\t$respuesta = Datos::mdlBodegas(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"destino\"].'\">'.$item[\"destino\"].'</option>';\n\t\t}\n\t}", "function getNationalityDropdownList($name, $initVal=\"\", $js=\"\") {\n $dList = \"<SELECT id=\\\"$name\\\" name=\\\"$name\\\" $js class=\\\"select\\\"><option value=\\\"\\\">Select from List</option>\";\n $dList.=\"<option value=\\\"British\\\">British</option>\";\n $nationalities = $this->getDBRecords(\"select label as name,value as id from nationality order by label\");\n for ($i = 0; $i < count($nationalities); $i++) {\n\n if (rtrim($initVal) == rtrim($nationalities[$i][\"id\"])) {\n $sel = \"selected\";\n }\n else\n $sel=null;\n $dList.= \"<option $sel value=\\\"\" . rtrim($nationalities[$i][\"id\"]) . \"\\\">\" . $nationalities[$i][\"name\"] . \"</option>\";\n }\n $dList.= \"</SELECT>\";\n\n return $dList;\n }", "public function getManufacturersForDropdown() {\n $manufacturers = $this->orderby('name','ASC')->get();\n $manufacturers_for_dropdown = [];\n foreach($manufacturers as $manufacturer) {\n $manufacturers_for_dropdown[$manufacturer->id] = $manufacturer->name;\n }\n return $manufacturers_for_dropdown;\n }", "function build_html_filter($clase, $filtro, $nombre, $valor = SIN_FILTRO){\n $f = '';\n $f .= \"<label for='filters[$filtro]'>\n $nombre</label>&nbsp;\n <select name='filters[$filtro]' onchange='this.parentNode.submit()'>\";\n\n $f.= \"<option value='\".SIN_FILTRO.\"'>--</option>\\n\";\n// <option value='0'>-- Sin $nombre --</option>\\n\";\n\n $instancias = $clase::find('all'); // TODO sustituir por index($filtros)\n // usort TODO\n usort($instancias, function($a, $b){\n return $a->_name > $b->_name;\n });\n foreach ($instancias as $i){\n $selected = '';\n\n if ($valor == $i->id){\n $selected = ' selected=\"selected\"';\n }\n\n $f.= \"<option value='\".$i->id.\"' $selected>\". $i->_name.'</option>';\n }\n $f.= \"</select>\\n\";\n return $f;\n}", "function get_combo_eventos() {\n $query = $this->db->query(\"select * from evento\");\n \n $result = \"\";\n if ($query) {\n if ($query->num_rows() == 0) {\n return false;\n } else {\n foreach ($query->result() as $reg) {\n $data[$reg->nEveId] = $reg->cEveTitulo;\n }\n $result=form_dropdown(\"cbo_evento_listar\", $data,'','id=\"cbo_evento_listar\" class=\"chzn-select\" style=\"width:250px\" required=\"required\"');\n //$result=form_dropdown(\"cbo_evento_listar\", $data,'','id=\"cbo_evento_listar\" style=\"width:auto\" required=\"required\"');\n return $result;\n }\n } else {\n return false;\n }\n }", "function hundope_select_field_render() { \n\t\n}", "function clients_select_setupSearch($ctlData,$data,$element_count) {\n\t## first we prepare the field selector entry\n\tif($ctlData['SEARCHABLE'] != 'no') {\n\t\tif($ctlData['IDENTIFIER'] == $data[$element_count]['identifier']) {\n\t\t\t$value_box_visibility = '';\n\t\t\t$field_selector = '<option label=\"'.$ctlData['NAME'].'\" value=\"'.$ctlData['IDENTIFIER'].'\" selected>'.$ctlData['NAME'].'</option>';\n\t\t} else {\n\t\t\t$value_box_visibility = 'style=\"display:none;\"';\n\t\t\t$field_selector = '<option label=\"'.$ctlData['NAME'].'\" value=\"'.$ctlData['IDENTIFIER'].'\">'.$ctlData['NAME'].'</option>';\t\t\n\t\t}\n\t\n\t\t## then we must tell the main programm the fucntionality for selecting our desired input form set\n\t\t$input_selector = \" else if (document.s.search#.value == '\".$ctlData['IDENTIFIER'].\"') { showElement_row#('row#_\".$ctlData['IDENTIFIER'].\"'); }\";\n\t\t\n\t\t## finally in the case, that we want to specify our own input element we can do this here\n\t\t$values = explode(',',$ctlData['LABELS']);\n\t\t$keys = explode(',',$ctlData['VALUES']);\n\t\t$count = count($values);\n\t\t\n\t\t## now preare the HTMl-Code for it\n\t\t$output = '';\n\t\t$output .= '<option label=\"select\" value=\"-1\">select</option>';\n\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\tif($keys[$i] == $data[$element_count]['value']) {\n\t\t\t\t$output .= '<option label=\"'.$values[$i].'\" value=\"'.$keys[$i].'\" selected>'.$values[$i].'</option>';\n\t\t\t} else {\n\t\t\t\t$output .= '<option label=\"'.$values[$i].'\" value=\"'.$keys[$i].'\">'.$values[$i].'</option>';\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t$input_element = '<div id=\"row#_'.$ctlData['IDENTIFIER'].'\" '.$value_box_visibility.'><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"middle\">\n\t\t\t\t\t\t\t<select name=\"operator#_'.$ctlData['IDENTIFIER'].'\"><option label=\"contains\" value=\"contains\">contains</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td><td align=\"left\" valign=\"top\"><img src=\"../../interface/images/blank.gif\" alt=\"\" width=\"10\" height=\"24\" border=\"0\">\n\t\t\t\t\t\t\t</td><td align=\"left\" valign=\"middle\"><select name=\"search_value#_'.$ctlData['IDENTIFIER'].'\">'.$output.'</select></td></tr></table></div>';\n\t\n\t\t## finally we return the setting\n\t\treturn array('fieldSelector'=>$field_selector,'inputSelector'=>$input_selector,'inputElement'=>$input_element,'inputName'=>\"row#_\".$ctlData['IDENTIFIER']);\n\t}\n}", "private function getSpec() {\n\t\t$html = '<div id=\"tal_ecoles\">';\n\t\t$html .= '<select id=\"tal_listEcoles\" onchange=\"tal_display(this)\">';\n\t\t$html .= '<option value=\"0\" selected=\"\" disabled=\"\">Choose...</option>';\n\t\tforeach ($this->_xml->ecole as $branch) {\n\t\t\t$html .= '<option value=\"'.$branch['id'].'\">'.$branch['name'].'</option>';\n\t\t}\n\t\t$html .= '</select>';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "function getLocationsOption()\n{\n $locations = getLocations();\n\n $options = \"\";\n\n foreach ($locations as $location) {\n $name = $location['building'] . \" - \" . $location['room'];\n $value = $location['idLocation'];\n $options .= \"<option value='$value'>$name</option>\";\n }\n return $options;\n}" ]
[ "0.7584048", "0.66605157", "0.605245", "0.6036802", "0.5951677", "0.5943212", "0.5908782", "0.5883085", "0.5868457", "0.5715422", "0.570622", "0.5702444", "0.5682596", "0.5668327", "0.5666378", "0.5661099", "0.56583834", "0.5655364", "0.5651713", "0.5647812", "0.56468326", "0.56376475", "0.56355315", "0.56230426", "0.5617502", "0.5606371", "0.55912465", "0.55887365", "0.5585344", "0.5561287", "0.55539984", "0.5549045", "0.5544681", "0.5542238", "0.5541235", "0.5533113", "0.55308783", "0.5530749", "0.5529224", "0.55143404", "0.55137384", "0.5506509", "0.5505451", "0.55031174", "0.550087", "0.54942113", "0.54922986", "0.5484787", "0.5472835", "0.5469491", "0.5467537", "0.5464711", "0.54591805", "0.5455882", "0.544975", "0.5449648", "0.5448611", "0.5444046", "0.54408747", "0.5439943", "0.54384214", "0.5414767", "0.5410324", "0.54092705", "0.5406908", "0.5404039", "0.53970075", "0.53954476", "0.53948617", "0.5392996", "0.53924507", "0.5389256", "0.5386173", "0.53836644", "0.538315", "0.53752387", "0.5375142", "0.5374933", "0.53731835", "0.5370802", "0.5367818", "0.5367692", "0.5366335", "0.5359762", "0.5358265", "0.5354591", "0.5353527", "0.535258", "0.53495115", "0.53485686", "0.533822", "0.53351104", "0.5333955", "0.533042", "0.5328243", "0.53256214", "0.5325587", "0.5318866", "0.5316891", "0.5315486" ]
0.78088266
0
Handles the file upload process and returns the path The file path is stored into the database
function uploadFile($name) { // Gets the paths, full and local directory global $image_dir, $image_dir_path; if (isset($_FILES[$name])) { // Gets the actual file name $filename = $_FILES[$name]['name']; if (empty($filename)) { return; } // Get the file from the temp folder on the server $source = $_FILES[$name]['tmp_name']; // Sets the new path - images folder in this directory $target = $image_dir_path . '/' . $filename; // Moves the file to the target folder move_uploaded_file($source, $target); // Send file for further processing processImage($image_dir_path, $filename); // Sets the path for the image for Database storage $filepath = $image_dir . '/' . $filename; // Returns the path where the file is stored return $filepath; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uploadPath();", "public function handle_upload()\n {\n }", "public function getUploadedFilePath()\n {\n return !empty($this->filepath) ? $this->filepath : \n (!empty($this->filename) ? (Yii::$app->params['uploadPath'] . $this->filename) : null);\n }", "public function 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 }", "protected function getFullPathToUploadFile()\n {\n return $this->fullPathToUploadFile;\n }", "function form_file_upload_handle($file_data, $field_config, $table_name = null) {\n $file_max_size = $field_config['file-max-size'] + 0;\n $file_type = $field_config['file-type'];\n if (strstr($file_data['type'], $file_type) === FALSE) {\n return \"The file type is {$file_data['type']} not {$file_type}\";\n }\n if ($file_data['size'] > $file_max_size) {\n return \"Size is bigger than \" . $file_max_size / 1024 . \"k\";\n }\n /**\n * ALL ok? then place the file and let it go... let it goooo! (my daughter Allison fault! <3 )\n */\n if (file_uploads::place_upload_file($file_data['tmp_name'], $file_data['name'], $table_name)) {\n return TRUE;\n } else {\n return file_uploads::get_last_error();\n }\n// $file_location = file_uploads::get_uploaded_file_path($file_data['name']);\n// $file_location_url = file_uploads::get_uploaded_file_url($file_data['name']);\n}", "public function upload(){\n \n if(!empty($_FILES['uploaded_file']))\n {\n $path = \"upload/\";\n $path = $path . basename( $_FILES['uploaded_file']['name']);\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n echo \"The file \". basename( $_FILES['uploaded_file']['name']). \n \" has been uploaded\";\n return $path;\n } else{\n echo \"There was an error uploading the file, please try again!\";\n }\n }\n }", "public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }", "public function upload()\n {\n // The file property can be empty if the field is not required\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->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = '/'.$this->getUploadDir().'/'.$this->getFile()->getClientOriginalName();\n //get the file name\n// $file = $this->getFile()->getClientOriginalName();\n// $info = pathinfo($file);\n// $file_name = basename($file,'.'.$info['extension']);\n// $this->name = $file_name ;\n// $this->setName($file_name);\n// // clean up the file property as you won't need it anymore\n// $this->file = null;\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\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 upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we 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 target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function getUploadedPath()\n {\n return $this->uploadedPath;\n }", "private function upload_file_and_get_path(): string\n {\n $this->load->library('upload');\n $image_path = \"\";\n $config['upload_path'] = './static/images/';\n $config['allowed_types'] = 'jpg|jpeg|png|gif|pdf';\n $config['encrypt_name'] = TRUE;\n $this->upload->initialize($config);\n if ($this->upload->do_upload('image_path')) {\n $info = $this->upload->data();\n $image_path = $info['file_name'];\n // delete the images present in table or else with every new upload unwanted files will keep on increasing\n } else {\n echo $this->upload->display_errors();\n return \"\";\n }\n return $image_path;\n }", "public function handleUploadFile() {\n\t\t$this->templateName = 'Upload.latte';\n\n\t\t$this->storage->addFile($_FILES['upload']['tmp_name'], $_FILES['upload']['name']);\n\n\t\t$this->template->url = $this->template->basePath . '/' . $this->storage->getBaseUrl() . '/' . $_FILES['upload']['name'];\n\t\t$this->template->message = 'Soubor byl nahrán';\n\t\t$this->template->setFile(__DIR__ . '/templates/' . $this->templateName);\n\t\t$this->template->render();\n\t\t$this->getPresenter()->terminate();\n\t}", "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 }", "public function uploadPath()\n {\n return call_user_func($this->savePath, $this->basePath);\n }", "public function getUploadPath()\n {\n return Yii::$app->params['upload_dir'] . DIRECTORY_SEPARATOR . $this->path;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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 \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n $filename = time().'_'.$this->getFile()->getClientOriginalName();\n\n // we 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 target filename as params\n $this->getFile()->move(\n self::$SERVER_PATH_TO_VIDEO_FOLDER,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload();", "public function getUploadPath()\n\t{\n\t\t// return Yii::app()->params->upload.'/';\n\t\treturn Yii::app()->config->fixedValues['upload_path'];\n\t}", "public function upload()\n {\n if (null === $this->getFile()) {\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 $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we 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 target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n // Check for create permission\n if (! $this->model->mayCreate()) {\n return $this->failure(403, lang('Files.notPermitted'));\n }\n\n // Verify upload succeeded\n $upload = $this->request->getFile('file');\n if (empty($upload)) {\n return $this->failure(400, lang('Files.noFile'));\n }\n if (! $upload->isValid()) {\n return $upload->getErrorString() . '(' . $upload->getError() . ')';\n }\n\n // Check for chunks\n if ($this->request->getPost('chunkIndex') !== null) {\n // Gather chunk info\n $chunkIndex = $this->request->getPost('chunkIndex');\n $totalChunks = $this->request->getPost('totalChunks');\n $uuid = $this->request->getPost('uuid');\n\n // Check for chunk directory\n $chunkDir = WRITEPATH . 'uploads/' . $uuid;\n if (! is_dir($chunkDir) && ! mkdir($chunkDir, 0775, true)) {\n return $this->failure(400, lang('Files.chunkDirFail', [$chunkDir]));\n }\n\n // Move the file\n try {\n $upload->move($chunkDir, $chunkIndex . '.' . $upload->getExtension());\n } catch (HTTPException $e) {\n log_message('error', $e->getMessage());\n\n return $this->failure(400, $e->getMessage());\n }\n\n // Check for more chunks\n if ($chunkIndex < $totalChunks - 1) {\n session_write_close();\n\n return '';\n }\n\n // Get chunks from target directory\n helper('filesystem');\n $chunks = get_filenames($chunkDir, true);\n if ($chunks === []) {\n throw FilesException::forNoChunks($chunkDir);\n }\n\n // Merge the chunks\n try {\n $path = merge_file_chunks(...$chunks);\n } catch (Throwable $e) {\n log_message('error', $e->getMessage());\n\n return $this->failure(400, $e->getMessage());\n }\n\n log_message('debug', 'Merged ' . count($chunks) . ' chunks to ' . $path);\n }\n\n // Get additional post data to pass to model\n $data = $this->request->getPost();\n $data['filename'] ??= $upload->getClientName();\n $data['clientname'] ??= $upload->getClientName();\n\n // Accept the file\n try {\n $file = $this->model->createFromPath($path ?? $upload->getRealPath(), $data);\n } catch (Throwable $e) {\n log_message('error', $e->getMessage());\n\n return $this->failure(400, $e->getMessage());\n }\n\n // Trigger the Event with the new File\n Events::trigger('upload', $file);\n\n if ($this->request->isAJAX()) {\n session_write_close();\n\n return '';\n }\n\n return redirect()->back()->with('message', lang('File.uploadSucces', [$file->clientname]));\n }", "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 }", "function upload_handler( $file ) {\n\t\t$this->add_ping( 'uploads', array( 'upload' => str_replace( $this->resolve_upload_path(), '', $file['file'] ) ) );\n\t\treturn $file;\n\t}", "public function upload()\n {\n if (null === $this->getFile()) {\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\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "abstract protected function doUpload();", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function process() {\n\t\t\n\t\t//Validate the upload\n\t\ttry {\n\t\t\t$this->validate();\n\t\t} catch(Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\t$filename = $this->getFilename();\n\t\t\n\t\t$full_path = $this->path . $filename;\n\t\t\n\t\t$uploaded = move_uploaded_file($this->file['tmp_name'], $full_path);\n\t\t\n\t\tif($uploaded === false) {\n\t\t\tthrow new Exception('Upload failed', '403');\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}", "public function get_full_uploaded_file_path()\n {\n return $this->full_uploaded_file_path;\n }", "public function upload() {\n if (null === $this->getFile()) {\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 // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function getRelativeUploadPath(): string;", "public function uploadFileAdmin(){\r\n $file = Input::file('file');\r\n $projectId = Input::get('PROJECT');\r\n $adminId = Input::get('CONSULTANT');\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/uploaded', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/uploaded/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n ToolsFunctions::notifyGeorgeOfFileUpload($project);\r\n }\r\n }\r\n }", "function upload(){\r\n\t\t\tglobal $_POST;\r\n\t\t\t$_POST['folder'] = str_replace('/umeos','',$_POST['folder']);\r\n\t\t\t$_POST['folder'] = str_replace('/root/infinite-home/','',$_POST['folder']);\r\n\r\n\t\t\tif (!empty($_FILES)) {\r\n\t\t\t\tforeach($_FILES as $file){\r\n\t\t\t if (!empty($file['tmp_name'])) {\r\n\t\t\t $this->mFile['size']\t= $file['size'];\r\n\t\t\t $this->mFile['type']\t= $file['type'];\r\n\t\t\t \t$tmp \t\t\t\t\t= $file['tmp_name'];\r\n\t\t\t \t$this->mFile['path'] \t= ($_POST['user_id']) ? $_SERVER['HTTP_HOST'].'/'. $_POST['user_id'] : $_SERVER['HTTP_HOST'] ;\r\n\t\t\t $this->mFile['name'] \t= $file['name'];\r\n\t\t\t $this->mFile['md5'] \t= md5_file($tmp);\r\n\t\t\t $this->mFile['real'] \t= htmlentities(urlencode($this->mFile['name']));\r\n\t\t\t $this->mFile['loc'] \t= '/^/'.$this->mFile['path'] .'/'. $this->mFile['md5'];\r\n\t\t\t $this->mFile['src'] \t= str_replace('//','/',$_SERVER['DOCUMENT_ROOT'].$this->mFile['loc']);\r\n\t\t\t // Uncomment the following line if you want to make the directory if it doesn't exist\r\n\t\t\t /**\r\n\t\t\t * we dont want to save the file in a dir tree...\r\n\t\t\t * only the db holds that info. instead we change save the file as its md5 hash.\r\n\t\t\t *\r\n\t\t\t */\r\n\r\n\t\t\t if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/^/')){\r\n\t\t\t \tmkdir($_SERVER['DOCUMENT_ROOT'].'/^/', 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t $path = $_SERVER['DOCUMENT_ROOT'].'/^/'.$this->mFile['path'];\r\n\t\t\t $path = str_replace('//','/',$path);\r\n\r\n\r\n\t\t\t if(!file_exists($path)){\r\n\t\t\t \tmkdir($path, 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t move_uploaded_file($tmp,$this->mFile['src']);\r\n\t\t\t return $this->Index();\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function getUploadedPath()\n {\n return $this->getUploadsFolder() . '/' . $this->getRootUploadedPath();\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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 $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function upload_file() {\n upload_file_to_temp();\n }", "public function process_file() {\n //\n $done = false;\n $error = '';\n //\n $filelist = directory_map('/var/lib/mysql-files/uploads/', 1);\n //\n // returns the table selected in the drop down\n //\n $table_name = $this->input->post('tablename');\n //\n // returns the array position of the selected item on the \n // dropdown list\n $fileno = $this->input->post('filename');\n //\n // get text as an array of strings, the dropdown returns a number\n //\n $textarray = $this->read_text($filelist[$fileno]);\n //\n // gets the first line of the text file\n //\n $text_line = $textarray[0];\n //\n $return_value = $this->check_import_match($table_name, $text_line);\n //\n // get list of table columns\n //\n $filepath = '/var/lib/mysql-files/uploads/'.$filelist[$fileno];\n // \n // loads a list of table names into an array\n //\n $tables = $this->load_table_names();\n // send back to import page with message\n if ($return_value === 0) { \n $this->data_driver->load_data($table_name, $filepath);\n //\n $message = 'Your data has been successfully imported';\n // this checks that new users have a role assigned\n $this->check_access_type();\n }\n else\n {\n $message = $return_value; \n }\n // call page\n $this->call_page($tables, $filelist, $message);\n }", "public function getFile()\n {\n $file = Input::file('report');\n $filename = $this->doSomethingLikeUpload($file);\n\n // Return it's location\n return $filename;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\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 $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n{\n // The file property can be empty if the field is not required\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->path\n );\n\n // Set the path property to the filename where you've saved the file\n //$this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n}", "public function upload()\n\t{\t\n\t\t// Grab the input file\n\t\t$this->file = Input::file('file');\t\n\n\t\t// Validate rules\n\t\t$rules = array(\n\t\t\t'file' => 'image|max:2000'\n\t\t);\n\n\t\t// New Validator instance\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// Validate the file\n\t\tif ($validator->fails()) {\n\t\t\t// Grab all error messages\n\t\t\t$errors = $validator->messages();\n\n\t\t\t$err_msg = '';\n\n\t\t\tforeach ($errors->all(':message') as $error) {\n\t\t\t\t$err_msg .= $error .' ';\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json(array('error' => $err_msg));\n\t\t}\n\n\t\t// Get the directory\n\t\t$this->dir = $this->getDirectory();\n\t\t// Move the file into the folder\n\t\treturn $this->moveFile();\n\t\t\n\t}", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we 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 target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "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 }", "protected function generateFullPathToUploadFile()\n {\n // $this->fullPathToUploadFile = str_replace(\"/\", \"\\\\\", storage_path('app/' . $this->pathToFile));\n $this->fullPathToUploadFile = storage_path('app/' . $this->pathToFile);\n }", "protected function getUploadPath()\n {\n return 'uploads/achtergrondfotos';\n }", "public function upload()\n\t{\n\t}", "function processAndStoreUploadedFile()\n{\n\t$allowedFileTypes = array(\"image/png\", \"image/jpeg\", \"image/gif\", \"text/plain\", \"application/pdf\");\n\t$allowedExtensions = array('jpg', 'jpeg', 'png', 'gif', 'pdf');\n\t\n\t\n\tif(in_array($_FILES['fileUpload']['type'], $allowedFileTypes))\n {\n \t$dateiname = standardizeFileName($_FILES['fileUpload']['name']);\n \tmove_uploaded_file (\n $_FILES['fileUpload']['tmp_name'] ,\n 'uploadedFiles/'. $dateiname);\n \techo \"Hochladen war erfolgreich <br>\";\n \techo \"<a href='uploadedFiles/\" . $_FILES['fileUpload']['name'] . \"'> uploadedFiles/\" . $_FILES['fileUpload']['name'] . \" </a> <br> <br>\";\n\t}\n\telse echo \"Ungültiger Dateityp\";\t\n}", "public static function uploadfile($upload_file){\r\n\t\t\r\n\t\t$file_store_options = array(\"base_dir\" => $file_upload_dir);\r\n\t\t\r\n \tif (empty($upload_file) && empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {\r\n \t\tthrow new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n \t}\r\n $file = new Filesobject();\r\n $file->file_orig_name = $upload_file['name'];\r\n $file->file_size\t = $upload_file['size'];\r\n $path_parts = pathinfo($file->file_orig_name);\r\n $file->file_extension = strtolower($path_parts['extension']);\r\n $file->file_mime_type = $upload_file['type'];\r\n $file->file_tmp_name = $upload_file['tmp_name'];\r\n $error = $upload_file['error']; \r\n if($error) {\r\n $error_msg = $this->uploadErrors[$error];\r\n if($error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n }\r\n else if($error == UPLOAD_ERR_NO_FILE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_EMPTY, \"upload_err_empty\");\r\n }\r\n else {\r\n throw new Exception($error_msg, Error::FILE_UNKNOWN_UPLOAD_ERROR);\r\n }\r\n }\r\n return self::handleKliqBoothFile($file);\r\n\t}", "public static function getUploadPath()\n {\n return '';\n }", "function handleUpload($db, $module, $id_column_name, $folder) {\n\t$params =checkParameters(array($id_column_name, \"userid\", \"insertedby\"));\n\t$id=$params[\"$id_column_name\"];\n\t$insertedby=$_REQUEST['insertedby'];\n\t$userid= $_REQUEST['userid'];\n\n\texistsUserid($db, $params['userid']);\n\texistsUserid($db, $params['insertedby']);\n\t\n\t$x = uploadFile(dirname(dirname(__FILE__)) . \"/$folder\");\n\tif($x) {\n\t\tprintResult(insert($db, $module,\n\t\t\t\tarray($id_column_name=>$id,\n\t\t\t\t\t\t\"originalFilename\"=>$x['name'], \"actualFileName\"=>$x['new_name'],\n\t\t\t\t\t\t\"userid\"=>$insertedby ,\"insertedby\"=>$userid )) );\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function upload()\n {\n if (null === $this->getFile()) {\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->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(){\n if (null === $this->getProductsFileImage()) {\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->getProductsFileImage()->move(\n $this->getUploadRootDir(),\n $this->getProductsFileImage()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getProductsFileImage()->getClientOriginalName();\n $this->productsImage = $this->getProductsFileImage()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->productsFileImage = null;\n }", "public function getFilesPath() {\n\t\treturn $this->uploadPath;\n\t}", "public function getUploadedFile(){\n\t\t\t$pic = isset($this->EMP_IMG) ? $this->EMP_IMG : 'default.jpg';\n\t\t\treturn Yii::$app->params['HRD_EMP_UploadUrl'].$pic;\n\t\t}", "function ft_hook_upload($dir, $file) {}", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "public function storeResumeFile()\n\t\t{\n\t\t\t// check to make sure file was posted\n\t\t\tif (!isset($_FILES['resume'])) {\n\t\t\t\t$this->throwJsonError(500, 'No resume file found.');\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// Get the PHP assigned file name & location from the RAM storage of the file\n\t\t\t$tmp_name = $_FILES['resume']['tmp_name'];\n\t\t\t// Get the original file name as uploaded\n\t\t\t$name = $_FILES['resume']['name'];\n\t\t\t// To ensure all files are unique, get the timestamp of the uplaod.\n\t\t\t$timestamp = date('YmdHis');\n\t\t\t// Determine the server location for the file to be stored.\n\t\t\t$location = \"$this->uploads_dir/$timestamp-$name\";\n\t\t\t// Store the file.\n\t\t\tif (move_uploaded_file($tmp_name, $location)) {\n\t\t\t\tchmod($location, 0666);\n\t\t\t\treturn $location;\n\t\t\t}\n\t\t\treturn $tmp_name;\n\t\t}", "abstract protected function getUploadDir(): string;", "function fileCommit(){\n\t\t// Target folder, make sure it is 777\n\t\t$target = \"uploads/\";\n\t\t\n\t\t// Appends the file name\n\t\t$target = $target . basename( $_FILES['file']['name']);\n\t\t\n\t\t// Moves the file to target\n\t\tmove_uploaded_file($_FILES['file']['tmp_name'], $target);\n\t\tif($_POST['sqlType'] == \"create\") {\n\t\t\t$result = mysql_query(createObject(getLangVar(\"userId\"), $_POST['objectText'], $_POST['parentId'], $_POST['objectTitle']));\n\t\t\t$result = mysql_query(createFile(fullURL($_FILES[\"file\"][\"name\"], \"uploads\"), $_FILES[\"file\"][\"size\"], $_FILES[\"file\"][\"type\"], mysql_insert_id()));\n\t\t\t$forwardId = mysql_insert_id();\n\t\t} else if($_POST['sqlType'] == \"edit\") {\n\t\t\t$result = mysql_query(editObject($_POST['objectText'], $_POST['parentId'], $_POST['objectTitle'], $_POST['objectId']));\n\t\t\t$result = mysql_query(editFile());\n\t\t\t$forwardId = $_POST['fileId'];\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"fileURL\") . $forwardId));\n\t}", "function doUpload(){\n if(count($_FILES) > 0){\n if(array_key_exists($this->name,$_FILES) AND $_FILES[$this->name]['name'] != \"\"){\n\n $this->CI->upload->initialize($this->config);\n\n if (!$this->CI->upload->do_upload($this->name)){\n show_error($this->CI->upload->display_errors());\n } \n else{\n $data = $this->CI->upload->data();\n $this->CI->codexmessages->add('info',$this->CI->lang->line('codexforms_file').' '.$_FILES[$this->name]['name'].' '.$this->CI->lang->line('codexforms_uploaded_correctly'),'',true);\n return $data['file_name'];\n }\n }\n }\n }", "public function upload()\n {\n }", "public function uploadfile($model) {\r\n $uploadSuccessPath = \"\";\r\n if (Yii::$app->request->isPost) {\r\n $model->image_id = UploadedFile::getInstance($model, \"image_id\");\r\n //文件上传存放的目录\r\n $dir = Yii::getAlias(\"@webroot\") . \"/upload/\" . date(\"Ymd\");\r\n if (!is_dir($dir))\r\n mkdir($dir);\r\n if ($model->validate()) {\r\n echo var_dump($model);\r\n exit;\r\n echo $model['image_id']->baseName;\r\n exit;\r\n //文件名\r\n $fileName = date(\"HiiHsHis\") . $model->image_id->baseName . \".\" . $model->image_id->extension;\r\n $dir = $dir . \"/\" . $fileName;\r\n\r\n\r\n $model->image_id->saveAs($dir);\r\n $uploadSuccessPath = \"/uploads/\" . date(\"Ymd\") . \"/\" . $fileName;\r\n }\r\n }\r\n// return $this->render(\"upload\", [\r\n// \"model\" => $model,\r\n// \"uploadSuccessPath\" => $uploadSuccessPath,\r\n// ]);\r\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "public function getUploadedFileInfo();", "public function publicUpload()\n {\n $this->request->validate([\n $this->inputName => $this->extensions,\n ]);\n\n if ($uploadedFile = $this->request->file($this->inputName))\n {\n $fileName = time() . $uploadedFile->getClientOriginalName();\n $uploadedFile->move(uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path, $fileName);\n $filePath = uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .$fileName;\n $image = $this->modelName::create(['name' => $fileName, 'path' => $filePath]);\n return $image->id;\n }\n\n }", "function upload(){\r\n\t\r\n\tvar_dump($_FILES);\r\n\tif(isset($_FILES[\"fileToUpload\"]) && !empty($_FILES[\"fileToUpload\"][\"name\"])){\r\n\t\t$target_dir = \"../pildid/\";\r\n\t\t$target_file = $target_dir . basename($_FILES[\"fileToUpload\"][\"name\"]);\r\n\t\t$uploadOk = 1;\r\n\t\t$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);\r\n\t\t// Check if image file is a actual image or fake image\r\n\t\tif(isset($_POST[\"submit\"])) {\r\n\t\t\t$check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\r\n\t\t\tif($check !== false) {\r\n\t\t\t\t//echo \"File is an image - \" . $check[\"mime\"] . \".\";\r\n\t\t\t\t$uploadOk = 1;\r\n\t\t\t} else {\r\n\t\t\t\techo \"File is not an image.\";\r\n\t\t\t\t$uploadOk = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Check if file already exists\r\n\t\tif (file_exists($target_file)) {\r\n\t\t\techo \"Sorry, file already exists.\";\r\n\t\t\t$uploadOk = 0;\r\n\t\t}\r\n\t\t// Check file size\r\n\t\tif ($_FILES[\"fileToUpload\"][\"size\"] > 500000) {\r\n\t\t\techo \"Sorry, your file is too large.\";\r\n\t\t\t$uploadOk = 0;\r\n\t\t}\r\n\t\t// Allow certain file formats\r\n\t\tif($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\"\r\n\t\t&& $imageFileType != \"gif\" ) {\r\n\t\t\techo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\r\n\t\t\t$uploadOk = 0;\r\n\t\t}\r\n\t\t// Check if $uploadOk is set to 0 by an error\r\n\t\tif ($uploadOk == 0) {\r\n\t\t\techo \"Sorry, your file was not uploaded.\";\r\n\t\t// if everything is ok, try to upload file\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$target_file = $target_dir.uniqid().\".\".$imageFileType;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (move_uploaded_file($_FILES[\"fileToUpload\"][\"tmp_name\"], $target_file)) {\r\n\t\t\t\t//echo \"The file \". basename( $_FILES[\"fileToUpload\"][\"name\"]). \" has been uploaded.\";\r\n\t\t\t\t\r\n\t\t\t\t// save file name to DB here\r\n\t\t\t\t$a = new StdClass();\r\n\t\t\t\t$a->name = $target_file;\r\n\t\t\t\treturn $a;\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\treturn \"Sorry, there was an error uploading your file.\";\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\treturn \"Please select the file that you want to upload!\";\r\n\t}\r\n\t\r\n}", "public function upload(){\n if($this->validateFile()){\n if(move_uploaded_file($this->tmpLocation, $this->fullUploadPath)){\n return true;\n }else{\n $this->addError(['Upload Error','File Upload Failed']);\n return false;\n }\n }\n return false;\n }", "public function getRootUploadedPath()\n {\n return \"{$this->uploaded_filename}\";\n }", "protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }", "public function uploadFileManufacturer(){\r\n $file = Input::file('file');\r\n $manufacturerId = Input::get('MANUFACTURER');\r\n $adminId = Input::get('CONSULTANT');\r\n $manufacturer = Project::find($manufacturerId);\r\n if($manufacturer!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n if(!File::exists(\"files/manufacturerFiles/\".$manufacturerId.\"/\")) {\r\n File::makeDirectory(\"files/manufacturerFiles/\".$manufacturerId.\"/\", 0755, true);\r\n }\r\n $file->move(public_path().'/files/manufacturerFiles/'.$manufacturerId.'/', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = 0;\r\n $uploadFile->manufacturer_id = $manufacturerId;\r\n $uploadFile->url = \"files/manufacturerFiles/\".$manufacturerId.\"/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n Transaction::createTransaction($adminId,'','','UPLOAD_FILE_FROM_MANUFACTURER',$fileName,'','','','','','');\r\n }\r\n }\r\n }", "function upload_file($CID,$formdata,$filedata,$holddir){\n\t\tif($filedata['uploadedfile']['name']){\n\t\t\tif(preg_match(\"/&/\",$filedata['uploadedfile']['name'])){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t$filedata['uploadedfile']['name'] = str_replace(\"%\",\"\",$filedata['uploadedfile']['name']);\n\t\t\t$filename=addslashes($filedata['uploadedfile']['name']);\n\t\t\t$filesize=$filedata['uploadedfile']['size'];\n\t\t\tif($filesize==0 || preg_match(\"/[`\\\"';]/\",$filename)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\t$status=$formdata['status'];\n\t\t\t$status=preg_replace(\"/>|<|\\\"|\\\\\\/\",\"\",$status);\n\t\t\t$status=addslashes($status);\n\t\t\t$comments=$formdata['comments'];\n\t\t\t$comments=preg_replace(\"/>|<|\\\"|\\\\\\/\",\"\",$comments);\n\t\t\t$comments=addslashes($comments);\n\t\t\t$fullpathtofile=$holddir.\"/\".$filedata['uploadedfile']['name'];\n //We need to see if the file already exists. If it does, it will be removed\n //and the new copy will be uploaded\n\t\t\t$this->db->set_query(\"select count(*) from upload_tracking where file_name='\".addslashes($filename).\"' and CID=$CID\");\n $this->db->execute_query();\n $row=$this->db->get_results(\"num\");\n\n if($row[0]>0){\n //get the fileiD\n $this->db->set_query(\"select ID from upload_tracking where file_name='\".addslashes($filename).\"' and CID=$CID\");\n\t\t\t\t$this->db->execute_query();\n $row=$this->db->get_results(\"num\");\n $fileID=$row[0];\n //remove the file\n $this->delete_file($fileID,$filename,$holddir);\n }\n\n\t\t\tmove_uploaded_file($filedata['uploadedfile']['tmp_name'],$holddir.\"/\".$filedata['uploadedfile']['name']);\n\t\t\t//Lets see if we can get teh mime type\n\t\t\t$filetype=$this->get_mime_type($fullpathtofile);\n\t\t\t//The files are up. Now lets place it in the database.\n\t\t\t$this->db=new DB(\"QuinnFM\");\n\t\t\t$this->db->set_query(\"insert into upload_tracking(\n\t\t\t\tCID,\n\t\t\t\tfile_name,\n\t\t\t\tfile_size,\n\t\t\t\tmime_type,\n\t\t\t\tupload_date,\n\t\t\t\tstatus,\n\t\t\t\tcomments)\n\t\t\t\tvalues (\n\t\t\t\t$CID,\n\t\t\t\t'$filename',\n\t\t\t\t$filesize,\n\t\t\t\t'$filetype',\n\t\t\t\tnow(),\n\t\t\t\t'$status',\n\t\t\t\t'$comments')\n\t\t\t\t\");\n\t\t\t\n\t\t\t$this->db->execute_query();\n\t\t\t//If file is uploaded, notify Vicki\n\t\t\t//Get Client Name\n\t\t\t$client_name=UserAdmin::get_client_name($CID);\n\t\t\t//Set temporary From\n\t\t\t$temp_from=\"From: \\\"Dictation Web Application\\\" <[email protected]>\";\n\t\t\t//mail(\"[email protected]\",\"Upload for $client_name\",\"\",\"$temp_from\");\n\t\t\tmail(\"[email protected]\",\"Upload for $client_name\",\"\",\"$temp_from\");\n\t\t}\n\t}", "private function upload_file()\n\t{\n\t\t/* File upload properties. */\n\t\t$config['upload_path'] = 'uploads/';\n $config['allowed_types'] = 'gif|jpg|jpeg|png|mp4|mov|wmv|avi|mp3';\n $config['max_filename'] = '255';\n $config['remove_spaces'] = TRUE;\n $config['encrypt_name'] = TRUE;\n $config['max_size'] = '102400'; //100 MB\n\n /* Load the file upload library with the provided configurations. */\n $this->load->library('upload', $config);\n\n /* If the upload was successful then return the file name. Otherwise, return false. */\n if($this->upload->do_upload('file'))\n {\n return $this->upload->data('file_name');\n }\n\n return false;\n\t}", "public function getUpload()\n {\n $index = $this->input->post(\"imageIndex\");\n if ($index == null) {\n echo \"Not a POST\";\n return;\n }\n $target_dir = $_SERVER['DOCUMENT_ROOT'] . \"/app/wed-upload/\";\n $target_file = $target_dir . $index;\n if (file_exists($target_file)) {\n error_log(\"Returning file: \" . $target_file);\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($target_file));\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($target_file));\n error_log(readfile($target_file));\n exit;\n } else {\n echo \"File not exist\";\n }\n }", "public function imagePath(){\n return $this->upload_directory.DS.$this->filename;\n }", "public function getUploadedsPath()\n {\n return $this->uploadedsPath;\n }", "protected function uploadFile()\n {\n return $this->getTelegram()->uploadFile(\n $this->method->apiEndpoint(),\n $this->method->toArray(),\n $this->method->fileUploadField()\n );\n }", "function handle_upload() {\n\t\tif ( !isset($_FILES['import']) ) {\n\t\t\t$file['error'] = '文件为空';\n\t\t}\n\t\t$temp_file = tempnam(sys_get_temp_dir(), 'chemcsv');\n\t\tmove_uploaded_file($_FILES[\"import\"][\"tmp_name\"], $temp_file);\n\t\t$file['file'] = $temp_file;\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\techo esc_html( $file['error'] ) . '</p>';\n\t\t\treturn false;\n\t\t} else if ( ! file_exists( $file['file'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\tprintf('无法读取导入的文件 <code>%s</code>.', esc_html( $file['file'] ) );\n\t\t\techo '</p>';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $file['file'];\n\t}", "public function upload(){\n\t\t\techo \"-->Uploading your file.<br/>\";\n\t\t\t//Check if the upload directory exists.\n\t\t\tif(!is_dir($this->upload_dir)){\n\t\t\t\t//Advice the user the upload directory does not exist\n\t\t\t\techo $this->upload_dir . \" directory does not exist.<br/>\";\n\t\t\t\t//And that we will attempt to create it\n\t\t\t\techo \"Attempting to create \" . $this->upload_dir . \" directory.<br/>\";\n\t\t\t\t//Attempt to make a new upload directory\n\t\t\t\tif(!mkdir($this->upload_dir, 0777, true)){\n\t\t\t\t\t//If it fails inform the user that the operation failed\n\t\t\t\t\techo \"Error creating the \" . $this->upload_dir . \" directory.<br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Move the uploaded CSV file into the upload directory\n\t\t\tif(move_uploaded_file($this->csv_file['tmp_name'],$this->upload_dir . \"/\" . $this->csv_file['name'])){\n\t\t\t\t//If the moving operation succeeds the function will return true\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//Otherwise it will return false\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "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 upload()\n {\n return $this->uploadOnce(Input::file('file'));\n }", "public function getUploadedFileName() {\n\t \t return $this->uploadedFileName;\n\t }", "function upload($path) {\r\n\t\t$ok = false;\r\n\r\n\t\t$this->uploadpath .= $path . '/';\r\n\r\n\t\tif ($this->validate()) {\r\n\t\t\t$this->filename = $this->params['form']['Filedata']['name'];\r\n\t\t\t$ok = $this->write();\r\n\t\t}\r\n\t\t\r\n\t\tif (!$ok) {\r\n\t\t\theader(\"HTTP/1.0 500 Internal Server Error\");\t//this should tell SWFUpload what's up\r\n\t\t\t$this->setError();\t//this should tell standard form what's up\r\n\t\t}\r\n\t\t\r\n\t\treturn ($ok);\r\n\t}", "static function file_uploads( $field_name , $path_to_files, $insert_id) {\n\n\t\t$moved_file_status = $file_status = null;\n\t\ttry {\n\t\t\t$img_info = $_FILES[$field_name];\n\t\t\t$img_name = $img_info['name'];\n\t\t\t$img_type = $img_info['type'];\n\t\t\t$img_tmp_name = $img_info['tmp_name'];\n\t\t\t$img_size = $img_info['size'];\n\t\t\tif(file_exists($path_to_files) == '')\n\t\t\t\tmkdir($path_to_files, 0777);\n\n\t\t\t$moved_file_status = move_uploaded_file($img_tmp_name, \"./\".$path_to_files.\"/\".$insert_id.\"_\".$img_name);\n\t\t\tif ($moved_file_status) {\n\t\t\t\t$file_status = \"success\";\n\t\t\t\treturn true;\n\t\t\t}\t\n\t\t}\n\t\tcatch (PDOException $e) {\n\t\t\t$file_status = 'error';\n\t\t\t$log_data = \"\".$e->getMessage().\"\".CONFIG::NEWLINE_ERROR.\"|\";\n\t\t}\n\t\treturn array($log_data, $file_status);\n\t\t\t\n\t}", "public function getUploadedFileUrl()\n {\n return !empty($this->fileurl) ? $this->fileurl : \n (!empty($this->filename) ? $this->uploadUrl . $this->filename : null);\n }", "public function execute() \n {\n\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') \n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultRedirectFactory->create();\n try{\n $target = $this->_mediaDirectory->getAbsolutePath('mycustomfolder/'); \n /** @var $uploader \\Magento\\MediaStorage\\Model\\File\\Uploader */\n $uploader = $this->_fileUploaderFactory->create(['fileId' => 'file']);\n /** Allowed extension types */\n $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png', 'zip', 'doc']);\n /** rename file name if already exists */\n $uploader->setAllowRenameFiles(true);\n /** upload file in folder \"mycustomfolder\" */\n $result = $uploader->save($target);\n if ($result['file']) {\n\n die($result['file']);\n //$this->messageManager->addSuccess(__('File has been successfully uploaded')); \n }\n } catch (\\Exception $e) {\n $this->messageManager->addError($e->getMessage());\n }\n return $this->resultRedirectFactory->create()->setPath(\n '*/*/upload', ['_secure'=>$this->getRequest()->isSecure()]\n ); \n\n\n }\n\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}", "function do_upload($field = 'userfile',$isTimestamp = false,$fname = \"\")\n\t{\n\t\tif ( ! isset($_FILES[$field]))\n\t\t{\n\t\t\t$this->set_error('upload_no_file_selected');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Is the upload path valid?\n\t\tif ( ! $this->validate_upload_path())\n\t\t{\n\t\t\t// errors will already be set by validate_upload_path() so just return FALSE\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Was the file able to be uploaded? If not, determine the reason why.\n\t\tif ( ! is_uploaded_file($_FILES[$field]['tmp_name']))\n\t\t{\n\t\t\t\n\t\t\t$error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error'];\n\n\t\t\tswitch($error)\n\t\t\t{\n\t\t\t\tcase 1:\t// UPLOAD_ERR_INI_SIZE\n\t\t\t\t\t$this->set_error('upload_file_exceeds_limit');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: // UPLOAD_ERR_FORM_SIZE\n\t\t\t\t\t$this->set_error('upload_file_exceeds_form_limit');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3: // UPLOAD_ERR_PARTIAL\n\t\t\t\t $this->set_error('upload_file_partial');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4: // UPLOAD_ERR_NO_FILE\n\t\t\t\t \n\t\t\t\t if($this->optional)\n\t\t\t\t {\n\t\t\t\t \t\treturn true;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $this->set_error('upload_no_file_selected');\n\t\t\t\t break;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase 6: // UPLOAD_ERR_NO_TMP_DIR\n\t\t\t\t\t$this->set_error('upload_no_temp_directory');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: // UPLOAD_ERR_CANT_WRITE\n\t\t\t\t\t$this->set_error('upload_unable_to_write_file');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8: // UPLOAD_ERR_EXTENSION\n\t\t\t\t\t$this->set_error('upload_stopped_by_extension');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault : $this->set_error('upload_no_file_selected');\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t\n\t\t// Set the uploaded data as class variables\n\t\t$this->file_temp = $_FILES[$field]['tmp_name'];\t\t\n\t\t\n\t\t$this->file_name = $this->_prep_filename($_FILES[$field]['name']);\n\t\t\n\t\tif($isTimestamp)\n\t\t{\n\t\t\t$parts\t\t= explode('.', $_FILES[$field]['name']);\n\t\t\t$ext\t\t= array_pop($parts);\n\t\t\t$filename\t= array_shift($parts);\n\t\t\t$this->file_name = $filename.\"_\".time().\".\".$ext;\n\t\t}\n\t\t\n\t\tif($fname <> \"\")\n\t\t{\n\t\t\t$this->file_name = $fname;\n\t\t}\n\t\t\n\t\t$this->file_size = $_FILES[$field]['size'];\t\t\n\t\t$this->file_type = preg_replace(\"/^(.+?);.*$/\", \"\\\\1\", $_FILES[$field]['type']);\n\t\t\n\t\t\n\t\t$this->file_type = strtolower($this->file_type);\n\t\t$this->file_ext\t = $this->get_extension($_FILES[$field]['name']);\n\t\t\n\t\t// Convert the file size to kilobytes\n\t\tif ($this->file_size > 0)\n\t\t{\n\t\t\t$this->file_size = round($this->file_size/1024, 2);\n\t\t}\n\n\t\t// Is the file type allowed to be uploaded?\n\t\tif ( ! $this->is_allowed_filetype($field))\n\t\t{\n\t\t\t$this->set_error('upload_invalid_filetype');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Is the file size within the allowed maximum?\n\t\tif ( ! $this->is_allowed_filesize())\n\t\t{\n\t\t\t$this->set_error('upload_invalid_filesize');\n\t\t\treturn FALSE;\n\t\t}\n\n\n\n\t\t// Are the image dimensions within the allowed size?\n\t\t// Note: This can fail if the server has an open_basdir restriction.\n\t\tif ( ! $this->is_allowed_dimensions())\n\t\t{\n\t\t\t$this->set_error('upload_invalid_dimensions');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Sanitize the file name for security\n\t\t$this->file_name = $this->clean_file_name($this->file_name);\n\t\t\n\t\t// Truncate the file name if it's too long\n\t\tif ($this->max_filename > 0)\n\t\t{\n\t\t\t$this->file_name = $this->limit_filename_length($this->file_name, $this->max_filename);\n\t\t}\n\n\t\t// Remove white spaces in the name\n\t\tif ($this->remove_spaces == TRUE)\n\t\t{\n\t\t\t$this->file_name = preg_replace(\"/\\s+/\", \"_\", $this->file_name);\n\t\t}\n\n\t\t/*\n\t\t * Validate the file name\n\t\t * This function appends an number onto the end of\n\t\t * the file if one with the same name already exists.\n\t\t * If it returns false there was a problem.\n\t\t */\n\t\t$this->orig_name = $this->file_name;\n\n\t\tif ($this->overwrite == FALSE)\n\t\t{\n\t\t\t$this->file_name = $this->set_filename($this->upload_path, $this->file_name);\n\t\t\t\n\t\t\tif ($this->file_name === FALSE)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\n\t\t * Move the file to the final destination\n\t\t * To deal with different server configurations\n\t\t * we'll attempt to use copy() first. If that fails\n\t\t * we'll use move_uploaded_file(). One of the two should\n\t\t * reliably work in most environments\n\t\t */\n\t\tif ( ! @copy($this->file_temp, $this->upload_path.$this->file_name))\n\t\t{\n\t\t\tif ( ! move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))\n\t\t\t{\n\t\t\t\t $this->set_error('upload_destination_error');\n\t\t\t\t return FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Run the file through the XSS hacking filter\n\t\t * This helps prevent malicious code from being\n\t\t * embedded within a file. Scripts can easily\n\t\t * be disguised as images or other file types.\n\t\t */\n\t\tif ($this->xss_clean == TRUE)\n\t\t{\n\t\t\t$this->do_xss_clean();\n\t\t}\n\n\n\t\t\n\t\t/*\n\t\t * Set the finalized image dimensions\n\t\t * This sets the image width/height (assuming the\n\t\t * file was an image). We use this information\n\t\t * in the \"data\" function.\n\t\t */\n\t\t$this->set_image_properties($this->upload_path.$this->file_name);\n\t\t\n\t\treturn TRUE;\n\t}", "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()\n {\n if (!ini_get('file_uploads'))\n {\n throw new Exception(\"Server setting forbids file uploads\");\n }\n if (empty($_FILES['uploadFile']))\n {\n throw new Exception(\"No file uploaded\");\n }\n\n $this->fileInfo = $_FILES['uploadFile'];\n\n if ($this->fileInfo['error'] != UPLOAD_ERR_OK)\n {\n if ($this->fileInfo['error'] == UPLOAD_ERR_INI_SIZE)\n {\n throw new Exception(\"File too big\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_FORM_SIZE)\n {\n throw new Exception(\"File too big\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_PARTIAL)\n {\n throw new Exception(\"Incomplete file upload\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_NO_FILE)\n {\n throw new Exception(\"No file selected or uploaded\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_NO_TMP_DIR)\n {\n throw new Exception(\"SYSTEM: Missing upload temp directory\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_CANT_WRITE)\n {\n throw new Exception(\"SYSTEM: Can't write to upload directory\");\n }\n elseif ($this->fileInfo['error'] == UPLOAD_ERR_EXTENSION)\n {\n throw new Exception(\"SYSTEM: Stopped by PHP extension\");\n }\n }\n\n if ($this->fileInfo['type'] != 'text/css'){\n throw new Exception(\"Plain vanilla CSS files only please\");\n }\n\n $this->tmpFile = $this->fileInfo['tmp_name'];\n\n // would need to spend some time to get this nailed down. returing text/x-c++ on sample css files I've tried\n /*\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n echo \"<br/>MIME: \" . finfo_file($finfo, $tmpFile);\n finfo_close($finfo);\n */\n\n if (!is_uploaded_file($this->tmpFile))\n {\n throw new Exception(\"SYSTEM: Temp file is not a legitimate uploaded file\");\n }\n\n if (!is_dir($this->uploadDir))\n {\n throw new Exception(\"SYSTEM: Can't find upload dir\");\n }\n\n // save uploaded file\n $this->filepath = $this->uploadDir . DIRECTORY_SEPARATOR . $this->fileInfo['name'];\n\n if (!move_uploaded_file($this->tmpFile, $this->filepath))\n {\n throw new Exception(\"SYSTEM: Unable to move temp file to upload dir\");\n }\n }" ]
[ "0.7407422", "0.7088717", "0.7075692", "0.6971553", "0.68665946", "0.6832987", "0.6820952", "0.67938834", "0.6791494", "0.6741928", "0.6738314", "0.67152804", "0.6682245", "0.66656154", "0.6647367", "0.6637334", "0.6629151", "0.6602371", "0.65785533", "0.65688777", "0.6562753", "0.6562753", "0.6562753", "0.6562753", "0.6531465", "0.6528832", "0.65136254", "0.64856726", "0.64423263", "0.64377993", "0.6426376", "0.6423551", "0.6407618", "0.6391601", "0.63766176", "0.63695806", "0.63644487", "0.6353564", "0.63528734", "0.63438207", "0.6337271", "0.63287264", "0.63186795", "0.6308224", "0.6304932", "0.6286414", "0.6283661", "0.62831676", "0.62813395", "0.62735426", "0.6268492", "0.6266865", "0.6248703", "0.6208269", "0.6187595", "0.61722213", "0.6171316", "0.61707276", "0.6151446", "0.615115", "0.61459076", "0.6140315", "0.6125869", "0.6123525", "0.6115455", "0.6099881", "0.6094479", "0.60857725", "0.6072814", "0.6063091", "0.6062125", "0.6054904", "0.60513484", "0.60505867", "0.6048743", "0.604743", "0.6044864", "0.6043568", "0.6039183", "0.60330164", "0.60256845", "0.601928", "0.60031587", "0.5997011", "0.5993948", "0.5993429", "0.5992888", "0.59879655", "0.5981214", "0.59769416", "0.59618753", "0.5957022", "0.5953359", "0.595281", "0.595239", "0.59500676", "0.5946893", "0.5946215", "0.5945268", "0.5940309", "0.59393007" ]
0.0
-1
Processes images by getting paths and creating smaller versions of the image
function processImage($dir, $filename) { // Set up the variables $dir = $dir . '/'; // Set up the image path $image_path = $dir . $filename; // Set up the thumbnail image path $image_path_tn = $dir.makeThumbnailName($filename); // Create a thumbnail image that's a maximum of 200 pixels square resizeImage($image_path, $image_path_tn, 200, 200); // Resize original to a maximum of 500 pixels square resizeImage($image_path, $image_path, 500, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function processImageStack() {\n\n foreach($this->imagePath as $imagePath) {\n $this->processSingleImage($imagePath);\n }\n }", "protected function combineImages() {}", "protected function processImage() {}", "private function generate()\n {\n $originalImages = Storage::files(env('PHOTO_PATH'));\n\n foreach ($originalImages as $originalImage) {\n $pieces = explode('/', $originalImage);\n\n $exp = explode('.', end($pieces));\n\n $extension = end($exp);\n\n array_pop($exp);\n\n $imageId = implode('.', $exp);\n\n $photos = [];\n\n foreach ($this->dimensions as $key => $dimension) {\n $fileName = env('PHOTO_PATH_RESIZE') . \"{$imageId}_{$key}.$extension\";\n\n if (! Storage::exists($fileName)) {\n $img = Image::make(Storage::get($originalImage));\n $img->resize($dimension['width'], $dimension['height']);\n\n Storage::put($fileName, (string)$img->encode(), 'public');\n\n if (Storage::exists($fileName)) {\n $photos[$key] = asset(Storage::url($fileName));\n }\n }\n }\n\n /**\n * Save on Storage\n */\n if (count($photos)) {\n $photo = new Photo();\n $photo->name = $imageId;\n $photo->photos = $photos;\n $photo->photos = $photos;\n $photo->save();\n }\n }\n }", "protected function processImage()\n {\n // Start from the last scale (bigger image).\n $tier = (count($this->_scaleInfo) - 1);\n $row = 0;\n $ul_y = 0;\n $lr_y = 0;\n\n list($root, $ext) = $this->getRootAndDotExtension($this->_imageFilename);\n\n // Create a row from the original image and process it.\n while ($row * $this->tileSize < $this->_originalHeight) {\n $ul_y = $row * $this->tileSize;\n $lr_y = ($ul_y + $this->tileSize < $this->_originalHeight)\n ? $ul_y + $this->tileSize\n : $this->_originalHeight;\n $saveFilename = $root . '-' . $tier . '-' . $row . '.' . $ext;\n $width = $this->_originalWidth;\n $height = abs($lr_y - $ul_y);\n $crop = [];\n $crop['width'] = $width;\n $crop['height'] = $height;\n $crop['x'] = 0;\n $crop['y'] = $ul_y;\n $this->imageResizeCrop($this->_imageFilename, $saveFilename, [], $crop);\n\n $this->processRowImage($tier, $row);\n ++$row;\n }\n }", "abstract public function process($image, $actions, $dir, $file);", "protected function scaleImages() {}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->met_image_name = @iconv(\"utf-8\",\"GBK\",$this->met_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->met_image_name){\n $this->met_image_name = strtolower(trim($this->met_image_name));\n $met_image_type = $this->get_type($this->met_image_name);\n $met_image = $this->createImage($met_image_type,$this->met_image_name);\n $met_image_w=ImageSX($met_image);\n $met_image_h=ImageSY($met_image);\n $temp_met_image = $this->getPos($src_image_w,$src_image_h,$this->met_image_pos,$met_image);\n $met_image_x = $temp_met_image[\"dest_x\"];\n $met_image_y = $temp_met_image[\"dest_y\"];\n\t if($this->get_type($this->met_image_name)=='png'){imagecopy($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h);}\n\t else{imagecopymerge($src_image,$met_image,$met_image_x,$met_image_y,0,0,$met_image_w,$met_image_h,$this->met_image_transition);}\n}\nif ($this->met_text){\n $temp_met_text = $this->getPos($src_image_w,$src_image_h,$this->met_text_pos);\n $met_text_x = $temp_met_text[\"dest_x\"];\n $met_text_y = $temp_met_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->met_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $met_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $met_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->met_text_size, $this->met_text_angle, $met_text_x, $met_text_y, $met_text_color,$this->met_text_font, $this->met_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "private function _getPathsForUrl($image)\n {\n $convertedImageStr = StringHelper::asciiString(urldecode($image));\n $urlParts = parse_url($convertedImageStr);\n $pathParts = pathinfo($urlParts['path']);\n $hashRemoteUrl = craft()->imager->getSetting('hashRemoteUrl');\n $hashPath = craft()->imager->getSetting('hashPath');\n \n if ($hashPath) {\n $targetFolder = '/' . md5($pathParts['dirname']);\n } else {\n $targetFolder = $pathParts['dirname'];\n }\n\n if ($hashRemoteUrl) {\n if (is_string($hashRemoteUrl) && $hashRemoteUrl == 'host') {\n $parsedDirname = substr(md5($urlParts['host']), 0, 10) . $targetFolder;\n } else {\n $parsedDirname = md5($urlParts['host'] . $pathParts['dirname']);\n }\n } else {\n $parsedDirname = str_replace('.', '_', $urlParts['host']) . $targetFolder;\n }\n\n $runtimePath = IOHelper::getRealPath(craft()->path->getRuntimePath());\n $this->sourcePath = ImagerService::fixSlashes($runtimePath . 'imager/' . $parsedDirname . '/');\n $this->sourceUrl = $image;\n $this->targetPath = ImagerService::fixSlashes(craft()->imager->getSetting('imagerSystemPath') . $parsedDirname . '/');\n $this->targetUrl = craft()->imager->getSetting('imagerUrl') . $parsedDirname . '/';\n $this->sourceFilename = $this->targetFilename = str_replace(' ', '-', $pathParts['basename']);\n \n // check if the temp path for remote files exists or can be created.\n if (!IOHelper::getRealPath($this->sourcePath)) {\n IOHelper::createFolder($this->sourcePath, craft()->config->get('defaultFolderPermissions'), true);\n\n if (!IOHelper::getRealPath($this->sourcePath)) {\n $msg = Craft::t('Temp folder “{sourcePath}” does not exist and could not be created', array('sourcePath' => $this->sourcePath));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n }\n\n // check if the file is already downloaded\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename) ||\n ((craft()->imager->getSetting('cacheDurationRemoteFiles') !== false) && (IOHelper::getLastTimeModified($this->sourcePath . $this->sourceFilename)->format('U') + craft()->imager->getSetting('cacheDurationRemoteFiles') < time()))\n ) {\n $this->_downloadFile($this->sourcePath . $this->sourceFilename, $image);\n\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename)) {\n $msg = Craft::t('File could not be downloaded and saved to “{sourcePath}”', array('sourcePath' => $this->sourcePath));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n } else {\n throw new Exception($msg);\n }\n }\n }\n }", "function imageMaint() {\n\t\n //$path = realpath(APPPATH).'/libraries/IMagick_Image.php';\n//require_once($path);\n////$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/';\n//$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/LL9138TR_frisbeeRed/';\n//$util = new ImageUtil();\n////$util->imageToDir($path2);\n////$util->cleanUp($path2);\n//$util->removeDir($path2);\n//print $util->log();\n//exit;\n }", "public function processImages($userid)\n {\n $fatherId = 0;\n if ( ($this->getEventCode() != null) && $this->checkGalleryAvailability() ) {\n $fatherId = $this->getHashId($this->getEventCode());\n }\n \n //get array of images\n // TODO: user specific locations; not implemented in version 1.0\n $imgs = glob(IMAGE_STORAGE_PATH . \"*.{Jpg,jpg,JPG,png,PNG}\", GLOB_BRACE);\n //print_r($imgs);\n \n $numberOfImages = count($imgs);\n \n //lets add file modify time to array\n $temp = array();\n for ($i = 0; $i < count($imgs); $i++ ) {\n $name = $imgs[$i];\n $mtime = filemtime($imgs[$i]);\n array_push($temp,\n array (\n 'name' => $name,\n 'mtime' => $mtime)\n );\n } \n //sort using cmpImgTime which compares unix timestamps\n usort($temp, array(\"qr\", \"cmpImgTime\"));\n \n //print_r($temp);\n //echo \"<br>\";\n \n //Stores last QRCode\n $imgbelongstocode = null;\n $imghashid = null;\n \n //before start processing images estimating time to accomplish and +50% \n set_time_limit( $numberOfImages * PROCESS_TIME_OF_ONE_IMAGE * 1.5 );\n // echo (\"Estimated time to execute is: \" . ($numberOfImages * PROCESS_TIME_OF_ONE_IMAGE * 1.5) . \" seconds <br>\\n\"); //debug\n $db = new Database();\n $this->database = $db->connect();\n \n // Start processing\n // first get last code which were under process\n $imgbelongstocode = $this->getLastUsedHash($userid);\n $imghashid = $this->getHashId($imgbelongstocode);\n //echo ('$imgbelongstocode: '. $imgbelongstocode .\"\\n\");\n //echo ('$imghashid: '. $imghashid .\"\\n\");\n \n $i = 0; // count images processed\n foreach ($temp as $item) {\n $path = pathinfo($item['name']);\n // print_r ($path); //debug\n //resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n $fullSize = $this->resizeImage($path['dirname'] .\"/\". $path['basename'], FULL_SIZE_IMAGE_MAX_WIDTH, FULL_SIZE_IMAGE_MAX_HEIGHT, IMG_SUBPATH_FULL_SIZE);\n $mediumSize = $this->resizeImage($fullSize);\n $thumbnail = $this->resizeImage($mediumSize, THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT, IMG_SUBPATH_THUMBNAIL);\n \n $qrText = $this->readQrCodeFromImage($mediumSize);\n //echo(\"QRTEXT: \" . $qrText);\n \n // collect hash from captured URL\n //echo (\"QRTEXT: \" . $qrText. \"\\n\");\n preg_match('/(?<=\\/album\\/)[a-zA-Z0-9]{1,50}/', $qrText, $matches);\n //print_r($matches);\n \n //if problems with regular expression use this simple explode\n //$parsedHash = explode('/album/', $qrText);\n //$matches = $parsedHash[1];\n\n // if qr code was able to read from image\n if ( $qrText ) {\n //query db to see if hash matches\n try {\n $sql = (\"SELECT Id, FatherId, Hash FROM hash\n WHERE Hash = :Hash\");\n \n $stmt = $this->database->prepare($sql);\n $stmt->bindParam(':Hash', $matches[0], PDO::PARAM_STR);\n \n $stmt->execute();\n $dbHash = $stmt->fetch(PDO::FETCH_ASSOC);\n \n if (! is_array($dbHash)) {\n \n //die(\"This QR-code doesn't exists our database.\");\n $this->throwException(QR_CODE_DO_NOT_EXIST, \"This QR-code doesn't exists our database.\");\n }\n\n //store last qr code\n $imgbelongstocode = $dbHash['Hash'];\n $imghashid = $dbHash['Id'];\n //echo (\"Image belongs to qr-code : \" . $imgbelongstocode . \"<br> \\n\"); //debug\n \n } catch (Exception $e) {\n //die(\"DB ERROR: \" . $e->getMessage());\n \n $this->throwException(DATABASE_ERROR, \"Database select error.\");\n }\n \n }\n //we have to rename image, include hash in image name\n rename($fullSize, IMAGE_STORAGE_PATH . IMG_SUBPATH_FULL_SIZE . $imgbelongstocode . \"_\" . $path['basename']);\n rename($mediumSize, IMAGE_STORAGE_PATH . IMG_SUBPATH_MEDIUM . $imgbelongstocode . \"_\" . $path['basename']);\n rename($thumbnail, IMAGE_STORAGE_PATH . IMG_SUBPATH_THUMBNAIL . $imgbelongstocode . \"_\" . $path['basename']);\n \n try {\n $sql = (\"INSERT INTO images(HashId,\n NameOnDisk,\n Deleted,\n CreatedOn)\n VALUES (:HashId,\n :NameOnDisk,\n :Deleted,\n :CreatedOn)\");\n $stmt = $this->database->prepare($sql);\n \n $date = new DateTime();\n $createdOn = $date->format('Y-m-d H:i:s');;\n $deleted = 0;\n $nameondisk = $imgbelongstocode . \"_\" . $path['basename'];\n \n //echo(\"INFO: \" . $imghashid.$nameondisk.$deleted.$createdOn);\n \n $stmt->bindParam(':HashId', $imghashid, PDO::PARAM_STR);\n $stmt->bindParam(':NameOnDisk', $nameondisk, PDO::PARAM_STR);\n $stmt->bindParam(':Deleted', $deleted, PDO::PARAM_STR);\n $stmt->bindParam(':CreatedOn', $createdOn, PDO::PARAM_STR);\n \n $stmt->execute();\n //$stmt->debugDumpParams(); //debug\n // if fatherid is something else than zero. Lets combine hash to an event\n // Update hash fatherid to an event id\n if ( $fatherId != 0 ) {\n //echo (\"UPDATE FATHERID: \". $fatherId .\"\\n\");\n //echo ('$imghashid '. $imghashid .\"\\n\");\n $sql = (\"UPDATE hash SET FatherId = :fatherid WHERE Id = :hashid\");\n $stmt = $this->database->prepare($sql);\n $stmt->bindParam(':hashid', $imghashid, PDO::PARAM_STR);\n $stmt->bindParam(':fatherid', $fatherId, PDO::PARAM_STR);\n //$stmt->debugDumpParams(); //debug\n $stmt->execute();\n }\n \n } catch (Exception $e) {\n $this->throwException(DATABASE_ERROR, \"Database insert error..\");\n }\n \n // if KEEP_ORIGINAL_PHOTO is true let's move it to IMG_SUBPATH_ORIGINAL folder, otherwise delete it\n if ( KEEP_ORIGINAL_PHOTO ) {\n // Line below: do not rename orginal to helps with debug and testing\n //rename ($path['dirname'] .\"/\". $path['basename'], $path['dirname'] . \"/\" . IMG_SUBPATH_ORIGINAL . $path['basename']);\n rename ($path['dirname'] .\"/\". $path['basename'], $path['dirname'] . \"/\" . IMG_SUBPATH_ORIGINAL . $imgbelongstocode . \"_\" . $path['basename']);\n } else {\n unlink ( $path['dirname'] .\"/\". $path['basename'] );\n }\n \n $i++;\n } // END processing / end foreach\n \n \n // Update db for last used ID\n $this->setLastUsedHash($userid, $imgbelongstocode);\n \n // return number of images were processed\n return $i . \" image(s) were processed\";\n \n \n $db->disconnect();\n\n \n }", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "function mergeImages($files) {\n global $TMPFILES;\n global $MIN_IMAGE_WIDTH, $TMP_PATH; // from config\n $res = array();\n $TMPFILES []= $TMP_PATH . '/' . substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 16);\n $res['tmpFileName'] = end($TMPFILES);\n\n // load images\n $width = 2147483647;\n foreach ($files as $key => &$file) {\n $imgData = loadImage($file['tmpFileName']);\n if (empty($imgData)) {\n throw new Exception(\"Bad image.\");\n }\n $file = array_merge($file, $imgData);\n $file['width'] = $file['imageInfo'][0];\n $file['height'] = $file['imageInfo'][1];\n if ($width > $file['width']) {\n $width = $file['width'];\n }\n }\n if ($width < $MIN_IMAGE_WIDTH) {\n $width = $MIN_IMAGE_WIDTH;\n }\n $height = 0;\n foreach ($files as $key => &$file) {\n $file['newWidth'] = $width;\n if ($file['width']) {\n $file['newHeight'] = ($width / $file['width']) * $file['height'];\n $height += $file['newHeight'];\n }\n }\n $height += count($files) - 1;\n $dstImage = imagecreatetruecolor($width, $height);\n imagefill($dstImage, 0, 0, 0xFFFFFF);\n $hgh=0;\n foreach ($files as $key => &$file) {\n imagecopyresampled($dstImage, $file['image'], 0, $hgh, 0, 0, $width, $file['newHeight'], $file['width'], $file['height']);\n $hgh += $file['newHeight'] + 1;\n imagedestroy($file['image']);\n deleteFile($file['tmpFileName']);\n }\n\n imagepng($dstImage, $res['tmpFileName']);\n $res['contentType'] = 'image/png';\n $res['hash'] = hash_file('sha256', $res['tmpFileName']);\n $res['srcPathInfo'] = pathinfo(basename($src));\n $res['ext'] = 'png';\n $res['imgType'] = 3;\n imagedestroy($dstImage);\n return $res;\n}", "public function execute()\n\t{\n\t\t$outputPath = null != $this->outputPath ? $this->outputPath : $this->imagePath;\n\t\t$dotPos = stripos($outputPath, '.');\n\t\t$path = substr($outputPath, 0, $dotPos);\n\t\t$ext = substr($outputPath, $dotPos+1);\n\t\t\n\t\t$this->setDensities();\n\t\t\n\t\t$filter = $this->imagine instanceof \\Imagine\\Imagick\\Imagine \n\t\t ? \\Imagine\\Image\\ImageInterface::FILTER_POINT \n\t\t : \\Imagine\\Image\\ImageInterface::FILTER_UNDEFINED;\n\t\t \n\t\tforeach ($this->densities as $dens => $size) {\n\t\t\t$this->imagine->open($this->imagePath)\n\t\t\t ->resize(new \\Imagine\\Image\\Box($size[0], $size[1]), $filter)\n\t\t\t ->save($path.'-'.$dens.'.'.$ext, array($this->compressionType => $this->compressionValue));\n\t\t}\n\t}", "abstract public function getPathImage($id, $filename);", "function frameImage($inside = 0, $imagesPath = array(), $imgHeight = 600, $imagesWidth = array(), $imagesAngles = array(), $poleColor = null, $poleWidth = 1, $poleHeight = 1)\n{ \n $rowImagick = new Imagick();\n \n foreach($imagesPath as $imgIndex => $imgPath) {\n $imagick = new Imagick(realpath($imgPath));\n\n $imagick->getImageGeometry();\n $imgGeo = $imagick->getImageGeometry();\n $imgOrgWidth = $imgGeo['width'];\n $imgOrgHeight = $imgGeo['height'];\n $imgWidth = $imagesWidth[$imgIndex];\n\n if(isset($imagesAngles[$imgIndex])) {\n $angleX = ($imagesAngles[$imgIndex]) == 90 ? - ($imagesAngles[$imgIndex] - 10) : - $imagesAngles[$imgIndex];\n } else {\n $angleX = -100;\n }\n $angleY = 0;\n $thetX = deg2rad ($angleX);\n $thetY = deg2rad ($angleY);\n\n $s_x1y1 = array(0, 0); // LEFT BOTTOM\n $s_x2y1 = array($imgWidth, 0); // RIGHT BOTTOM\n $s_x1y2 = array(0, $imgHeight); // LEFT TOP\n $s_x2y2 = array($imgWidth, $imgHeight); // RIGHT TOP\n\n $d_x1y1 = array(\n $s_x1y1[0] * cos($thetX) - $s_x1y1[1] * sin($thetY),\n $s_x1y1[0] * sin($thetX) + $s_x1y1[1] * cos($thetY)\n );\n $d_x2y1 = array(\n $s_x2y1[0] * cos($thetX) - $s_x2y1[1] * sin($thetY),\n $s_x2y1[0] * sin($thetX) + $s_x2y1[1] * cos($thetY)\n );\n $d_x1y2 = array(\n $s_x1y2[0] * cos($thetX) - $s_x1y2[1] * sin($thetY),\n $s_x1y2[0] * sin($thetX) + $s_x1y2[1] * cos($thetY)\n );\n $d_x2y2 = array(\n $s_x2y2[0] * cos($thetX) - $s_x2y2[1] * sin($thetY),\n $s_x2y2[0] * sin($thetX) + $s_x2y2[1] * cos($thetY)\n );\n\n $imageprops = $imagick->getImageGeometry();\n $imagick->setImageBackgroundColor(new ImagickPixel('transparent'));\n $imagick->resizeimage($imgWidth, $imgHeight, \\Imagick::FILTER_LANCZOS, 0, true); \n if($poleColor) {\n $imagick->borderImage($poleColor, $poleWidth, $poleHeight);\n }\n\n $points = array(\n $s_x1y2[0], $s_x1y2[1], # Source Top Left\n $d_x1y2[0], $d_x1y2[1], # Destination Top Left\n $s_x1y1[0], $s_x1y1[1], # Source Bottom Left \n $d_x1y1[0], $d_x1y1[1], # Destination Bottom Left \n $s_x2y1[0], $s_x2y1[1], # Source Bottom Right \n $d_x2y1[0], $d_x2y1[1], # Destination Bottom Right \n $s_x2y2[0], $s_x2y2[1], # Source Top Right \n $d_x2y2[0], $d_x2y2[1] # Destination Top Right \n );\n //echo '<pre>'; print_r($points); die;\n\n $imagick->setImageVirtualPixelMethod(\\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);\n $imagick->distortImage(\\Imagick::DISTORTION_PERSPECTIVE, $points, true);\n //$imagick->scaleImage($imgWidth, $imgHeight, false);\n $rowImagick->addImage($imagick); \n }\n\n $rowImagick->resetIterator();\n $combinedRow = $rowImagick->appendImages(false);\n\n $canvas = generateFinalImage($combinedRow);\n header(\"Content-Type: image/png\");\n echo $canvas->getImageBlob();\n}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->gz_image_name = @iconv(\"utf-8\",\"GBK\",$this->gz_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->gz_image_name){\n $this->gz_image_name = strtolower(trim($this->gz_image_name));\n $gz_image_type = $this->get_type($this->gz_image_name);\n $gz_image = $this->createImage($gz_image_type,$this->gz_image_name);\n $gz_image_w=ImageSX($gz_image);\n $gz_image_h=ImageSY($gz_image);\n $temp_gz_image = $this->getPos($src_image_w,$src_image_h,$this->gz_image_pos,$gz_image);\n $gz_image_x = $temp_gz_image[\"dest_x\"];\n $gz_image_y = $temp_gz_image[\"dest_y\"];\n\t if($this->get_type($this->gz_image_name)=='png'){imagecopy($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h);}\n\t else{imagecopymerge($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h,$this->gz_image_transition);}\n}\nif ($this->gz_text){\n $temp_gz_text = $this->getPos($src_image_w,$src_image_h,$this->gz_text_pos);\n $gz_text_x = $temp_gz_text[\"dest_x\"];\n $gz_text_y = $temp_gz_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->gz_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $gz_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $gz_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->gz_text_size, $this->gz_text_angle, $gz_text_x, $gz_text_y, $gz_text_color,$this->gz_text_font, $this->gz_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "public function copyImages();", "function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function _saveImage( $content_new_and_paths = null , $supplier = null) {\n\t\t$image = array();\n\t\t$supplierToGet = $supplier;\n\t\tforeach ( $content_new_and_paths as $content_new_and_path) {\n\n\t\t\t$parentGift = $this->Gift->find('first', array( 'conditions' => array('Gift.code' => trim($content_new_and_path[1]), 'Gift.supplier' => $supplierToGet) ) ) ;\n\n\t\t\t/*\n\t\t\t$parentImageCount = $this->Image->find('count', array( 'conditions' => array('Image.gift_id' => $parentGift) ) ) ;\n\t\t\tif ( $parentGiftCount > 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t*/\n\t\t\t\n \t\tif ( isset($content_new_and_path[12]) && $content_new_and_path[12] != null ) {\n \t\t\t\n \t\t\tforeach ( $content_new_and_path[12] as $image ) {\n \t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tif ( trim($image) != null ) {\n \t\t\t\t\t\t$data_image['Image']['img'] = trim($image);\n \t\t\t\t\t\t$data_image['Image']['gift_id'] = $parentGift['Gift']['id'];\n \t\t\t\t\t\t\n \t\t\t\t\t\t//debug($data_image);\n \t\t\t\t\t\t$imageCheck = $this->Image->find( 'first', array('conditions' => array('Image.gift_id' => $parentGift['Gift']['id'], 'Image.img' => trim($image) ) ) ) ;\n \t\t\t\t\t\tif( $imageCheck == array() )\t{\n \t\t\t\t\t\t\t$this->Image->save($data_image);\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t$this->Image->id = $imageCheck['Image']['id'];\n \t\t\t\t\t\t\t\t$this->Image->save($data_image);\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\t$this->Image->id = null;\n \n \t\t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t} else {\n \t\t\t\n \t\t\t$data_image['Image']['img'] = 'noimg.jpg';\n \t\t\t$data_image['Image']['gift_id'] = $parentGift['Gift']['id'];\n \t\t\t$this->Image->save($data_image);\n \t\t\t$this->Image->id = null;\t\t \t\t\t\n \t\t}\n \t} \n\t\t\t\t\n\t}", "private function generateThumbnailImagick(){\n\t}", "function mergereagentandarrow($filename_x, $filename_y, $filename_result) {\n\n list($width_x, $height_x) = getimagesize($filename_x);\n list($width_y, $height_y) = getimagesize($filename_y);\n\n // Create new image with desired dimensions\n\n $image = imagecreatetruecolor($width_y, $height_x + $height_y);\n$white = imagecolorallocate($image, 255, 255, 255);\nimagefill($image, 0, 0, $white);\n\n\n // Load images and then copy to destination image\n\n $image_x = imagecreatefromgif($filename_x);\n $image_y = imagecreatefromgif($filename_y);\n\n imagecopy($image, $image_x, ($width_y-$width_x)/2, 0, 0, 0, $width_x, $height_x);\n imagecopy($image, $image_y, 0, $height_x, 0, 0, $width_y, $height_y);\n\n // Save the resulting image to disk (as JPEG)\n\n imagegif($image, $filename_result);\n\n\n\n\n // Clean up\n\n imagedestroy($image);\n imagedestroy($image_x);\n imagedestroy($image_y);\n\n}", "protected function importLayoutImages_processCopiedImages(){\n\t\t\n\t\t\n\t\tforeach($this->arrImportImages as $key=>$arrImage){\n\t\t\t\n\t\t\t//get image ID\n\t\t\t$imageID = $this->insertAttachmentByImage($arrImage);\n\t\t\tif(empty($imageID))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t//update image id\n\t\t\t$arrImage[\"imageid\"] = $imageID;\n\t\t\t$this->arrImportImages[$key] = $arrImage;\n\t\t}\n\t\t\n\t}", "public function execRegenerateImgs(){\n\t\t$cnt=0;\n\t\t$dir = Environment::getVariable(\"dataDir\") . '/img/';\n\t\t$files = Finder::findFiles($this->id . \"-*.png\")->from($dir);\n\n\t\tforeach ($files as $file => $info) {\n\t\t\tunlink($file);\n\t\t\t$cnt++;\n\t\t}\n\n\t\t$this->execNumberOfPages();\n\t\t$this->execBookmarks();\n\t\t$this->execIndexFulltext();\n\t\t$this->execConvertImages();\n\n\t\treturn $cnt;\n\t}", "function get_image($names, $images=array(), $options=array()){\n\tglobal $FUNCTION_ROOT, $get_imagex;\n\textract($options);\n\t//2013-05-01: much at names as array until complete\n\tif(is_array($names)){\n\t\t$name=current($names); //string\n\t\tforeach($names as $n=>$v){\n\t\t\tunset($names[$n]);\n\t\t\tbreak;\n\t\t}\n\t}else{\n\t\t$name=$names;\n\t\t$names=array();//empty it\n\t}\n\tif(!isset($targetReplace))$targetReplace=' ';\n\tif(!strlen($name))return;\n\t\n\tif(!$return)$return=($get_imagex['return'] ? $get_imagex['return'] : 'multi');\n\t\n\tif(!$precedence)$precedence=array('png','jpg','jpeg','gif','svg');\n\tif(!$regexFilter)$regexFilter='[^-a-z0-9_]+';\n\tif($appendage=='_')$appendage='(_(.+))*';\n\n\tif(is_string($images)){\n\t\tif($a=$get_imagex['locations'][$images]){\n\t\t\t$images=$a;\n\t\t}else{\n\t\t\t$images=$get_imagex['locations'][$images]=get_file_assets($images,array('positiveFilters'=>'\\.(jpg|gif|png|svg)$',));\n\t\t}\n\t}\n\tif(@empty($images))return;\n\n\tif($externalImageFunction){\n\t\t//Added 2008-10-31 - this allows an external function to process, it must globalize $get_image - with nodes of name (case-sensitive), width, and height. The source returned must be the actual path to the image plus name\n\t\treturn $externalImageFunction($names, $images, $options);\n\t}\t\n\t\n\tif(!($normalize===false))$normalize=(is_bool($normalize) ? '/[^-a-zA-Z0-9]/' : $normalize);\n\tif($normalize)$name=preg_replace($normalize,'',strtolower($name));\n\n\t\n\t//don't forget about this\n\t$appendage; //normally (_(.+))*\n\tif(!$appendageIndex)$appendageIndex=2;\n\t\n\tforeach($precedence as $ext){\n\t\t//handle special characters\n\t\t$str=str_replace('+','\\+',$name);\n\t\t$str=str_replace('.','\\.',$str);\n\t\t\n\t\t$nameRegex='/^'.$str.$appendage.'\\.'.$ext.'$/i';\n\t\tforeach($images as $n=>$v){\n\t\t\tif($debug)prn(\"nameRegex=$nameRegex\\ntargetReplace=$targetReplace\\nresult=\".preg_replace('/'.$targetReplace.'/','',$n));\n\t\t\tif(!preg_match($nameRegex,preg_replace('/'.$targetReplace.'/','',$n),$m))continue;\n\t\t\tif($debug)error_alert('match');\n\t\t\t//note what we use for the key - we switch to case-sensitive\n\t\t\t$get_image[$v['name']]=$v;\n\t\t\t$get_image[$v['name']]['length']=strlen($v['name']);\n\t\t\tif(strlen($m[$appendageIndex]))$get_image[$v['name']]['description']=$m[$appendageIndex];\n\t\t}\n\t}\n\tif($debug)error_alert(look);\n\tif(count($get_image)){\n\t\tif(!function_exists('subkey_sort'))require($FUNCTION_ROOT.'/function_array_subkey_sort_v300.php');\n\t\t$get_image=subkey_sort($get_image,'length');\n\t\t//return methods here\n\t\tif($return=='multi'){\n\t\t\treturn $get_image;\n\t\t}else if($return=='string'){\n\t\t\t$get_imagex['params']=current($get_image);\n\t\t\t$a=current($get_image);\n\t\t\treturn $a['name'];\n\t\t}else if($return=='array'){\n\t\t\treturn current($get_image);\n\t\t}else exit('improper return method for get_image v2.30');\n\t}\n\t\n\t//2013-05-01: call function recursively with next names present\n\tif(count($names))return get_image($names, $images, $options);\n}", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "function processImage($dir, $filename)\n{\n // Set up the variables\n $dir = $dir . '/';\n\n // Set up the image path\n $image_path = $dir . $filename;\n\n // Set up the thumbnail image path\n $image_path_tn = $dir . makeThumbnailName($filename);\n\n // Create a thumbnail image that's a maximum of 200 pixels square\n resizeImage($image_path, $image_path_tn, 200, 200);\n\n // Resize original to a maximum of 500 pixels square\n resizeImage($image_path, $image_path, 500, 500);\n}", "function my_merge_image ($first_img_path, $second_img_path){\n $width = 1024;\n $height = 512;\n\n //Create new img from file with true color\n $first_img_path = imagecreatefrompng($first_img_path);\n $im = imagecreatetruecolor($width, $height);\n\n // copy and resize part of an img from the path and \"paste\" them side by side\n imagecopyresampled($im, $first_img_path, 0, 0, 0, 0, 1024, 1024, 1024, 1024);\n $second_img_path = imagecreatefrompng($second_img_path);\n imagecopyresampled($im, $second_img_path, 512, 0, 0, 0, 1024, 1024, 1024, 1024);\n\n //save png img from the given img ($im)\n //imagepng($im, \"final_img.png\");\n}", "public function generate()\n {\n $self = $this;\n\n // Clear errors\n $this->_errors = array();\n\n // Normalize destination image path\n $this->imgDestPath = str_replace(array('\\\\', '/'), DIRECTORY_SEPARATOR, $this->imgDestPath);\n\n // Check modification time\n if ((is_dir($this->imgSourcePath)) && (is_file($this->imgDestPath))) {\n $imgSourceStat = stat($this->imgSourcePath);\n $imgDestStat = stat($this->imgDestPath);\n if ($imgSourceStat['mtime'] <= $imgDestStat['mtime']) {\n $this->addError(static::ERROR_SPRITE_EQUALS_TO_SOURCE);\n return;\n }\n }\n\n // Get list of images\n $fillImgList = function($dir) use(&$self, &$xOffset, &$imgList, &$imgWidth, &$imgHeight, &$fillImgList) {\n $imageList = glob($dir . DIRECTORY_SEPARATOR . '*.{' . $self->imgSourceExt . '}', GLOB_BRACE);\n foreach ($imageList as $imagePath) {\n\n // Skip previously generated sprite\n if ($imagePath === $self->imgDestPath) {\n continue;\n }\n\n // Get image sizes\n $imageSize = @getimagesize($imagePath);\n if ($imageSize === false) {\n $self->addError($self::ERROR_WRONG_IMAGE_FORMAT, $imagePath);\n continue;\n } else {\n list($itemWidth, $itemHeight, $itemType) = $imageSize;\n }\n\n // Check size\n if ($self->imgSourceSkipSize) {\n if (($itemWidth > $self->imgSourceSkipSize) || ($itemHeight > $self->imgSourceSkipSize)) {\n continue;\n }\n }\n\n // Inc sprite size\n $imgWidth += $itemWidth;\n if ($itemHeight > $imgHeight) {\n $imgHeight = $itemHeight;\n }\n\n // Push image to the list\n $imgList[$imagePath] = array(\n 'width' => $itemWidth,\n 'height' => $itemHeight,\n 'x' => $xOffset,\n 'ext' => image_type_to_extension($itemType, false),\n );\n\n $xOffset += $itemWidth;\n }\n $subdirList = glob($dir . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);\n foreach ($subdirList as $subdir) {\n $fillImgList($subdir);\n }\n };\n $xOffset = 0;\n $imgList = array();\n $imgWidth = $imgHeight = 0;\n $fillImgList($this->imgSourcePath);\n if (count($imgList) === 0) {\n $this->addError(static::ERROR_NO_SOURCE_IMAGES);\n return;\n }\n\n // Create transparent image\n $dest = imagecreatetruecolor($imgWidth, $imgHeight);\n imagesavealpha($dest, true);\n $trans_colour = imagecolorallocatealpha($dest, 0, 0, 0, 127);\n imagefill($dest, 0, 0, $trans_colour);\n\n // Init CSS\n $cssList = array();\n $cssList[] = array(\n 'selectors' => array(\n '[class^=\"' . $this->cssNamespace . '-\"]',\n '[class*=\" ' . $this->cssNamespace . '-\"]',\n ),\n 'styles' => array(\n 'background-image' => 'url(\"' . $this->cssImgUrl . '\")',\n 'background-position' => '0 0',\n 'background-repeat' => 'no-repeat',\n 'display' => 'inline-block',\n 'height' => '64px',\n 'vertical-align' => 'middle',\n 'width' => '64px',\n ),\n );\n\n // Copy all images, create CSS file and list of tags\n $this->_tagList = array();\n foreach ($imgList as $imgPath => $imgData) {\n\n // Copy image\n $imgCreateFunc = 'imagecreatefrom' . $imgData['ext'];\n if (!function_exists($imgCreateFunc)) {\n continue;\n }\n $src = $imgCreateFunc($imgPath);\n imagealphablending($src, true);\n imagesavealpha($src, true);\n imagecopy($dest, $src, $imgData['x'], 0, 0, 0, $imgData['width'], $imgData['height']);\n imagedestroy($src);\n\n // Append CSS (if not a magic action)\n $sourcePathLeng = mb_strlen($this->imgSourcePath);\n $class = '.' . $this->cssNamespace . '-' . mb_substr($imgPath, $sourcePathLeng + 1);\n $class = mb_substr($class, 0, mb_strlen($class) - mb_strlen($imgData['ext']) - 1);\n $class = str_replace(DIRECTORY_SEPARATOR, '-', $class);\n $isMagicAction = false;\n foreach (static::$magicActions as $magicAction) {\n $isMagicAction = (mb_substr($class, -mb_strlen('.' . $magicAction)) === '.' . $magicAction);\n if ($isMagicAction) {\n break;\n }\n }\n if (!$isMagicAction) {\n $cssList[] = array(\n 'selectors' => array($class),\n 'styles' => array(\n 'background-position' => '-' . $imgData['x'] . 'px 0',\n 'height' => $imgData['height'] . 'px',\n 'width' => $imgData['width'] . 'px',\n ),\n );\n }\n\n // Check if image has magic action (active, hover, target)\n if (!$isMagicAction) {\n $extPos = mb_strrpos($imgPath, $imgData['ext']);\n foreach (static::$magicActions as $magicAction) {\n if ($extPos !== false) {\n $magicActionPath = substr_replace($imgPath, $magicAction . '.' . $imgData['ext'], $extPos, strlen($imgData['ext']));\n $hasMagicAction = isset($imgList[$magicActionPath]);\n } else {\n $hasMagicAction = false;\n }\n if ($hasMagicAction) {\n $magicActionData = $imgList[$magicActionPath];\n $css = array();\n if (in_array($magicAction, array('checked', 'disabled'))) {\n $css['selectors'] = array(\n \"input:{$magicAction} + {$class}\",\n \"{$class}.{$magicAction}\",\n );\n } else {\n $css['selectors'] = array(\n \"{$class}:{$magicAction}\",\n \"{$class}.{$magicAction}\",\n \".wrap-{$this->cssNamespace}:{$magicAction} {$class}\",\n \".wrap-{$this->cssNamespace}.{$magicAction} {$class}\",\n );\n }\n $css['styles'] = array(\n 'background-position' => '-' . $magicActionData['x'] . 'px 0',\n 'background-position-x' => '-' . $magicActionData['x'] . 'px',\n 'height' => $magicActionData['height'] . 'px',\n 'width' => $magicActionData['width'] . 'px',\n );\n $cssList[] = $css;\n }\n }\n }\n\n // Append tag\n if (!$isMagicAction) {\n $this->_tagList[] = '<span class=\"' . mb_substr($class, 1) . '\"></span>';\n }\n }\n\n // Save image to file\n $imgDestExt = mb_strtolower(mb_substr($this->imgDestPath, mb_strrpos($this->imgDestPath, '.') + 1));\n switch ($imgDestExt) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($dest, $this->imgDestPath);\n break;\n case 'gif':\n imagegif($dest, $this->imgDestPath);\n break;\n case 'png':\n imagepng($dest, $this->imgDestPath);\n break;\n default:\n $this->addError(static::ERROR_UNKNOWN_IMAGE_EXT, $this->imgDestPath);\n return;\n break;\n }\n imagedestroy($dest);\n\n // Save CSS file\n $cssString = '';\n foreach ($cssList as $css) {\n $cssString .= implode(',', $css['selectors']) . '{';\n foreach ($css['styles'] as $key => $value) {\n $cssString .= $key . ':' .$value . ';';\n }\n $cssString .= '}';\n }\n file_put_contents($this->cssPath, $cssString);\n }", "static public function uploadMultiFiles(&$files_arry, $path_relative = '', $pre_name = \"\")\n {\n\n #Verify directory name\n if (!file_exists(IMAGES)) {\n mkdir(IMAGES, 0777);\n }\n\n if ( !file_exists(IMAGES . $path_relative) ) {\n mkdir(IMAGES . $path_relative, 0777);\n }\n\n $imagenes = [];\n\n $total = count($files_arry['name']);\n\n if( $total > 0)\n {\n $img_desc = UploadFiles::reArrayFiles($files_arry);\n\n if(count($img_desc) > 0)\n {\n\n foreach($img_desc as $file)\n {\n if (!empty($file['tmp_name']) && $file['tmp_name'] != \"\" )\n {\n $name = $file['name'] ;\n # extension file\n $info = new SplFileInfo($name);\n $extension = $info->getExtension();\n\n # new name and url imgen\n $new_name = $pre_name.date('YmdHms',time()).mt_rand(1000,9999) .\".{$extension}\" ;\n\n if(!empty($path_relative)) {\n $imagen_url = \"{$path_relative}/{$new_name}\" ;\n }\n else{\n $imagen_url = \"{$new_name}\" ;\n }\n\n $imagen_url = IMAGES_DIR.\"/{$imagen_url}\" ;\n\n # ruta destino(donde se movera el archivo )\n $ruta_destino = IMAGES.'../'.\"{$imagen_url}\";\n\n # ruta destino(donde se movera el archivo )\n $file_ok = move_uploaded_file($file['tmp_name'], $ruta_destino);\n\n $imagenes[] = $imagen_url ;\n\n }elseif ($file[\"error\"] > 0)\n {\n echo \"Error: \" . $file['error'] . \"<br>\";\n $imagenes[] = '';\n }\n\n }\n\n }\n\n return $imagenes ;\n }\n }", "public function processImages()\n \t{\n $this->save();\n if (! $this->errorMessage)\n \t\t parent::uploadImages('image', 'RecipeImage', \"recipeID\");\n \n \t}", "public function run()\n {\n $imageArray = array(\n 'cover/default.png', 'cover/avengers-infinity-war.jpg', 'cover/coco.jpg',\n 'cover/deadpool-2.jpg', 'cover/fantastic-beasts.jpg', 'cover/oceans-.jpg',\n 'cover/the-greatest-showman.jpg', 'cover/incredibles-2.jpg', 'cover/ant-man-and-the-wasp.jpg'\n );\n foreach($imageArray as $i){\n $image = new Image();\n $image->path = $i;\n $image->save();\n }\n }", "function images_data_split($all_pic,$folder_name,$size)\r\n{\r\n\t \r\n //image_url + ? + id \r\n $image_url_id=array();\r\n\r\n for($index=0;$index<count($all_pic);$index++)\r\n {\r\n \t\r\n array_push($image_url_id,$all_pic[$index]['images'][$size]['source']);\r\n \r\n }\r\n //split the array in 40 size\t\r\n $select_images_split=array();\r\n $select_images_split=array_chunk($image_url_id,40, true);\r\n \r\n \r\n for($index1=0;$index1<count($select_images_split);$index1++)\r\n { \r\n \t global $folder_name;\r\n \t //images add in folder\r\n \t images_add_folder($select_images_split[$index1],$folder_name);\r\n \t\r\n \t \r\n } \t\t\t\r\n \r\n \r\n}", "private function generateThumbnailGD(){\n\t\t\n\t}", "public function run()\n {\n foreach ($this->getImages() as $image) {\n Image::create($image);\n }\n }", "public function process($image_path)\n\t{\n\t\t$items = [];\n\t\t$image = new Image($image_path, $this->config);\n\t\t$summary = $image->getSummary();\n\t\tforeach ($summary['colors'] as $hex => $_) {\n\t\t\t$tiles = $this->config->getTilesOfColor($hex);\n\t\t\t$data = [];\n\t\t\tforeach ($tiles as $k => $tile) {\n\t\t\t\t$data[$k] = $tile->brick->getSize();\n\t\t\t}\n\t\t\tarray_multisort($data, SORT_DESC, $tiles);\n\t\t\tforeach ($tiles as $tile) {\n\t\t\t\t$item = new Item($tile, $image->fillTile($tile));\n\t\t\t\tif ($item->quantity) {\n\t\t\t\t\t$items[] = $item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->merge($items);\n\t\treturn $image;\n\t}", "function get_image_paths($base_url, $base_path)\n{\n $out = array();\n\n require_code('images');\n require_code('files');\n\n $handle = @opendir($base_path);\n if ($handle !== false) {\n while (false !== ($file = readdir($handle))) {\n if (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) {\n $this_path = $base_path . $file;\n if (is_file($this_path)) {\n if (is_image($file)) {\n $this_url = cms_rawurlrecode($base_url . rawurlencode($file));\n $out[$this_path] = $this_url;\n }\n } elseif ((strlen($file) != 2) || (strtoupper($file) != $file)) {\n $out = array_merge($out, get_image_paths($base_url . $file . '/', $base_path . $file . '/'));\n }\n }\n }\n closedir($handle);\n }\n\n return $out;\n}", "protected function createThumbnails() {\n\t\tglobal $prindot;\n\t\t$success = true;\n\n\t\t$fileName = $this->uploadName;\n\t\t$targetDir = $prindot['paths']['storage_root_js'];\n\n$filePath = $targetDir . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filepath:\"' . $filePath . '\"');\n\n$filePath_thumbnail = $targetDir . $prindot['paths']['thumbnails'] . DIRECTORY_SEPARATOR . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filePath_thumb:\"' . $filePath_thumbnail . '\"');\n\n$filePath_preview = $targetDir . $prindot['paths']['previews'] . DIRECTORY_SEPARATOR . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filePath_preview:\"' . $filePath_preview . '\"');\n\n\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"written file '\" . $filePath . \"'\");\n\t\t// TODO: hier thumbnail und preview generieren (und ggf. info.datei mit wichtigen daten, damit nicht immer wieder aufgefragt werden muss )\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : preview : '\" . $filePath_preview . \"'\");\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : thumbnail : '\" . $filePath_thumbnail . \"'\");\n\n\n\t\t// thumbs and previews\n\n\t\t// TODO: make preview and thumbnail with dedicated php file (same logic as with logs.php etc)\n\t\t// ... so previews may be rendered if deleted before\n\n\t\t$filename = $filePath;\n\n\t\t$dir = $_SERVER[\"SCRIPT_FILENAME\"];\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t$dir = dirname($dir) . '/';\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t//$dir = $dir . $prindot['paths']['storage_root_js'];\n\t\t//error_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t/* Create new object */\n\t\t//$im = new Imagick( 'D:\\xampp\\htdocs\\prindot\\plupload2\\examples\\uploads\\cylinder.jpg' );\t// OK\n\t\t//$im = new Imagick( __DIR__ . '/' . $filename );\n\t\t$im = new Imagick($dir . $filename);\n\n\t\t$i = $im->getImageProperties(\"*\", true);\n\t\t//error_log(my_print_r($i));\n\t\t$r = $im->getImageResolution();\n\t\t//error_log(my_print_r($r));\n\t\t$g = $im->getImageGeometry();\n\t\t//error_log(my_print_r($g));\n\t\t//die();\n\t\t// PREVIEW\n\t\t/* Scale down */\n\t\t$im->thumbnailImage($prindot['dimensions']['previews']['width'], $prindot['dimensions']['previews']['height'], true);\n\t\t$im->setImageFormat('jpeg');\n\n\t\t/* save */\n\t\t$outpath = $dir . $filePath_preview . \".jpg\";\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"outpath '\" . $outpath . \"'\");\n\t\t@unlink($outpath);\n\t\t$im->writeImage($outpath);\n\n\t\t//echo \"preview FERTIG (\" . $outpath . \")<br>\";\n\t\t// THUMBNAIL\n\t\t/* Scale down */\n\t\t$im->thumbnailImage($prindot['dimensions']['thumbnails']['width'], $prindot['dimensions']['thumbnails']['height'], true);\n\t\t$im->setImageFormat('jpeg');\n\n\t\t/* save */\n\t\t$outpath = $dir . $filePath_thumbnail . \".jpg\";\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"outpath '\" . $outpath . \"'\");\n\t\t@unlink($outpath);\n\t\t$im->writeImage($outpath);\n\n\t\t//echo \"thumbnail FERTIG (\" . $outpath . \")<br>\";\n\t\treturn $success;\n\t}", "function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "function create_image($source,$sizes){\n // Tony Smith uploaded a big image once (7000x3000pixels) that was 1.1MB as a JPEG compressed,\n // but when inflated out using imagecreatefromjpeg used more memory than there was available!\n // So lets make this nice and large to handle Tony's massive bits\n ini_set('memory_limit', '256M');\n\n // Save parts of source image path\n $path_parts = pathinfo($source);\n\n // Load image and get image size.\n $img = imagecreatefromjpeg($source);\n $width = imagesx($img);\n $height = imagesy($img);\n\n foreach($sizes as $s){\n\n // Create new filename\n $new_name = $path_parts['dirname'].\"/\".$path_parts['filename'].\"_\".$s['suffix'].\".\".$path_parts['extension'];\n\n // Scale to fit the required width\n if ($width > $height) {\n $newwidth = $s['dim'];\n $divisor = $width / $s['dim'];\n $newheight = floor($height/$divisor);\n }else{\n $newheight = $s['dim'];\n $divisor = $height / $s['dim'];\n $newwidth = floor($width/$divisor);\n }\n\n // Create a new temporary image.\n $tmpimg = imagecreatetruecolor($newwidth,$newheight);\n \n // Copy and resize old image into new image.\n imagecopyresampled($tmpimg,$img,0,0,0,0,$newwidth,$newheight,$width,$height);\n\n // Save thumbnail into a file.\n imagejpeg($tmpimg,$new_name,$s['q']);\n\n // release the memory\n imagedestroy($tmpimg);\n\n }\n imagedestroy($img);\n}", "public function ImageRoutes()\n {\n $routes = [];\n foreach ($this->images as $image) {\n $routes[] = '/' . env('PROPERTY_IMAGE_DISK') . '/' . $image->filepath;\n }\n\n if (count($routes) == 0) {\n $routes[] = '/imgs/default_image.png';\n }\n $this->image_routes = $routes;\n }", "public static function sequenceMerge($strSavePath, $intOutputType, $arrImagePath, $intXNum, $intYNum)\n {\n $intNum = $intXNum * $intYNum;\n if ($intNum > count($arrImagePath)) return null;\n\n /**\n * 使用imagecreatetruecolor代替imagecreate,参考https://segmentfault.com/q/1010000013154816\n */\n $resImage = imagecreatetruecolor(self::intWidth * $intXNum, self::intWidth * $intYNum);\n// $resImage = imagecreate(self::intWidth * $intXNum, self::intWidth * $intYNum);\n// foreach ($arrImagePath as $intIndex => $strImagePath) {\n for ($intIndex = 0; $intIndex < $intNum; ++$intIndex) {\n $strImagePath = $arrImagePath[$intIndex];\n// $intWidth = null;\n// $intHeight = null;\n// $type = null;\n// $attr = null;\n list($intWidth, $intHeight, $type, $attr) = getimagesize($strImagePath);\n\n// try\n// {\n// }\n// catch(\\Exception $e)\n// {\n// echo 'Message: ' .$e->getMessage();\n// }\n// finally\n// {\n// echo $strImagePath . \"<br>\";\n// }\n// echo \"getimagesize($strImagePath) : $intWidth, $intHeight, $type, $attr \\n\";\n $resSourceImage = null;\n// \\exif_imagetype($strImagePath)\n switch ($type) {\n case IMAGETYPE_JPEG:\n $resSourceImage = imagecreatefromjpeg($strImagePath);\n break;\n case IMAGETYPE_PNG:\n $resSourceImage = imagecreatefrompng($strImagePath);\n break;\n case IMAGETYPE_GIF:\n $resSourceImage = imagecreatefromgif($strImagePath);\n break;\n default:\n echo \"unknown type: {$type} \\n\";\n }\n /**\n * w=4, h=3\n * + + + +\n * + + + +\n * + + - +\n * 求index=10的x和y的公式\n * x = index % w\n * y = index / h - 1\n */\n $intDstX = self::intWidth * ($intIndex % $intXNum);\n $intDstY = self::intWidth * intval($intIndex / $intXNum);\n $intSrcX = 0;\n $intSrcY = 0;\n $intDstW = self::intWidth;\n $intDstH = self::intWidth;\n $intSrcW = $intWidth;\n $intSrcH = $intHeight;\n if ($intWidth != self::intWidth || $intHeight != self::intWidth) {\n// imagecopyresized($resImage, $resSourceImage, $intDstX, $intDstY, $intSrcX, $intSrcY, $intDstW, $intDstH, $intSrcW, $intSrcH);\n imagecopyresampled($resImage, $resSourceImage, $intDstX, $intDstY, $intSrcX, $intSrcY, $intDstW, $intDstH, $intSrcW, $intSrcH);\n } else {\n imagecopy($resImage, $resSourceImage, $intDstX, $intDstY, $intSrcX, $intSrcY, $intSrcW, $intSrcH);\n }\n }\n\n $resOutput = null;\n switch ($intOutputType) {\n case self::TYPE_BMP:\n// $resOutput = imagebmp($resImage, $strSavePath);\n break;\n case self::TYPE_GIF:\n if (is_null($strSavePath)) header(\"Content-Type: image/gif\");\n $resOutput = imagegif($resImage, $strSavePath);\n break;\n case self::TYPE_JPEG:\n if (is_null($strSavePath)) header(\"Content-Type: image/jpeg\");\n $resOutput = imagejpeg($resImage, $strSavePath);\n break;\n case self::TYPE_PNG:\n if (is_null($strSavePath)) header(\"Content-Type: image/png\");\n $resOutput = imagepng($resImage, $strSavePath);\n// $resOutput = imagepng($resImage);\n break;\n }\n return $resOutput;\n }", "function spiplistes_corrige_img_pack ($img) {\n\tif(preg_match(\",^<img src='dist/images,\", $img)) {\n\t\t$img = preg_replace(\",^<img src='dist/images,\", \"<img src='../dist/images\", $img);\n\t}\n\treturn($img);\n}", "protected function iterateImages() {\n $currentFilesNumber = 0;\n\n // Cycle through all file to check number of images present in folder.\n foreach ($this->getIterator($this->filePath) as $info) {\n if ($info->isDot() || $info->isDir()) {\n continue;\n }\n\n if ($info->isFile() && $this->isImage($info)) {\n $currentFilesNumber += 1;\n }\n }\n\n // If the limit for maximum number of images was not reached\n // than upload file to the folder.\n if ($currentFilesNumber < $this->maxFilesInFolder) {\n $filaName = $this->getFileName($this->file->getClientOriginalName(), $currentFilesNumber);\n\n $this->file->move($this->filePath, $filaName);\n\n return UPLOAD_PATH . $this->typeFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder . '/' . $filaName;\n } else {\n\n // If not create a new folder to upload the file.\n // The new folder's name is a date (corrispondent to lastFolder date), \n // incremented by one day. \n $this->lastFolder = date('Y-m-d', strtotime($this->lastFolder) + 86400);\n\n $newPath = $this->rootFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder;\n\n mkdir($newPath, 0777);\n \n // Set id file's name to 0.\n $filaName = $this->getFileName($this->file->getClientOriginalName(), 0);\n\n $this->file->move($newPath, $filaName);\n\n return UPLOAD_PATH . $this->typeFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder . '/' . $filaName;\n }\n }", "private function drawImage($image, $items, $x_origin, $y_origin, $size) {\n if (empty($items)) {\n return $image;\n }\n\n // Leafs -- stitch together photos\n if (!is_array(current($items))) {\n $uris = [];\n foreach ($items as $item) {\n $media = $this->insta->getMedia($item);\n $source_images[] = imagecreatefromjpeg($media->data->images->standard_resolution->url);\n }\n\n $n = count($source_images);\n\n /* 1 image - cover the entire square\n *\n * + - - - +\n * | |\n * | A |\n * | |\n * + - - - +\n */\n if ($n == 1) {\n // Image A\n imagecopyresampled(\n $image, $source_images[0], // destination, source images\n $x_origin, $y_origin, // x & y destination\n 0, 0, // x & y source\n $size, $size, // width & height destination\n 640, 640 // width & height source\n );\n }\n\n /* 2 images - place vertical middle portions next to each other\n *\n * + - + - +\n * | | |\n * | A | B |\n * | | |\n * + - + - +\n */\n elseif ($n == 2) {\n // Image A\n imagecopyresampled(\n $image, $source_images[0], // destination, source images\n $x_origin, $y_origin, // x & y destination\n 160, 0, // x & y source\n $size / 2, $size, // width & height destination\n 320, 640 // width & height source\n );\n\n // Image B\n imagecopyresampled(\n $image, $source_images[1], // destination, source images\n $x_origin + ($size / 2), $y_origin, // x & y destination\n 160, 0, // x & y source\n $size / 2, $size, // width & height destination\n 320, 640 // width & height source\n );\n }\n\n /* 3 images - place 1st vertical, 2nd two in right half stacked on top of one another\n *\n * + - + - +\n * | | B |\n * | A + - +\n * | | C |\n * + - + - +\n */\n elseif ($n == 3) {\n // Image A\n imagecopyresampled(\n $image, $source_images[0], // destination, source images\n $x_origin, $y_origin, // x & y destination\n 160, 0, // x & y source\n $size / 2, $size, // width & height destination\n 320, 640 // width & height source\n );\n\n // Image B\n imagecopyresampled(\n $image, $source_images[1], // destination, source images\n $x_origin + ($size / 2), $y_origin, // x & y destination\n 0, 0, // x & y source\n $size / 2, $size / 2, // width & height destination\n 640, 640 // width & height source\n );\n\n // Image C\n imagecopyresampled(\n $image, $source_images[2], // destination, source images\n $x_origin + ($size / 2), $y_origin + ($size / 2), // x & y destination\n 0, 0, // x & y source\n $size / 2, $size / 2, // width & height destination\n 640, 640 // width & height source\n );\n }\n\n /* 4 images - place in a 2x2 grid\n *\n * + - + - +\n * | A | B |\n * | - + - +\n * | C | D |\n * + - + - +\n */\n elseif ($n == 4) {\n $this->drawImage($image, [$items[0]], $x_origin + $size / 2, $y_origin, $size / 2);\n $this->drawImage($image, [$items[1]], $x_origin, $y_origin, $size / 2);\n $this->drawImage($image, [$items[2]], $x_origin, $y_origin + $size / 2, $size / 2);\n $this->drawImage($image, [$items[3]], $x_origin + ($size / 2), $y_origin + ($size / 2), $size / 2);\n }\n }\n\n // Branches -- Divide into 4 quadrants and iterate\n else {\n $this->drawImage($image, $items[0], $x_origin + $size / 2, $y_origin, $size / 2);\n $this->drawImage($image, $items[1], $x_origin, $y_origin, $size / 2);\n $this->drawImage($image, $items[2], $x_origin, $y_origin + $size / 2, $size / 2);\n $this->drawImage($image, $items[3], $x_origin + ($size / 2), $y_origin + ($size / 2), $size / 2);\n }\n\n return $image;\n }", "private function set_img_path()\n {\n $file_name = sprintf('%03d',$this->img_count);\n $this->img_path = L_TEMP_IMAGE_PATH.$file_name.\".png\";\n $this->img_count++;\n }", "function image_arr_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $tmp_dest = $destination_folder;\n for ($index = 0; $index < count($source_pic['tmp_name']); $index++) {\n $destination_folder = $tmp_dest;\n $image_info = getimagesize($source_pic['tmp_name'][$index]);\n $source_pic_name = $source_pic['name'][$index];\n $source_pic_tmpname = $source_pic['tmp_name'][$index];\n $source_pic_size = $source_pic['size'][$index];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].gif\";\n $namafile = \"$filename[$index].gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].png\";\n $namafile = \"$filename[$index].png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].bmp\";\n $namafile = \"$filename[$index].bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n $url[] = $namafile;\n }\n return ($url);\n}", "public function createImage1(){\n $this->createHexagon(150,75, 50, 200, 150, 325, 275, 325, 350,200, 275, 75);\n $this->createCircle(200, 200, 200, 200, 0, 360);\n $this->createLine(200, 125, 125, 200);\n $this->createLine(200, 125, 275, 200);\n $this->createLine(125, 200, 200, 275);\n $this->createLine(275, 200, 200, 275);\n $this->generateImage();\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "function _initFiles()\r\n {\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $strPath = $this->mediaTypePaths[$this->_mediaType][0].$this->_path;\r\n } else {\r\n $strPath = ASCMS_CONTENT_IMAGE_PATH.$this->_path;\r\n }\r\n\r\n $objDir = @opendir($strPath);\r\n\r\n $arrFiles = array();\r\n\r\n if ($objDir) {\r\n $path = array();\r\n if ( $this->_path !== \"/\"\r\n && preg_match('#(.*/).+[/]?$#', $this->_path, $path)) {\r\n array_push($this->_arrDirectories, array('name' => '..', 'path' => $path[1], 'icon' => $this->_iconPath.'Folder.png'));\r\n }\r\n\r\n $file = readdir($objDir);\r\n while ($file !== false) {\r\n// TODO: This match won't work for arbitrary thumbnail file names as they\r\n// may be created by the Image class!\r\n if ($file == '.' || $file == '..' || preg_match('/(?:\\.(?:thumb_thumbnail|thumb_medium|thumb_large)\\.[^.]+$)|(?:\\.thumb)$/i', $file) || $file == 'index.php') {\r\n $file = readdir($objDir);\r\n continue;\r\n }\r\n array_push($arrFiles, $file);\r\n $file = readdir($objDir);\r\n }\r\n closedir($objDir);\r\n\r\n sort($arrFiles, SORT_NATURAL | SORT_FLAG_CASE);\r\n\r\n foreach ($arrFiles as $file) {\r\n if (is_dir($strPath.$file)) {\r\n array_push($this->_arrDirectories, array('name' => $file, 'path' => $this->_path.$file, 'icon' => $this->_getIcon($strPath.$file)));\r\n } else {\r\n $filesize = @filesize($strPath.$file);\r\n if ($filesize > 0) {\r\n $filesize = round($filesize/1024);\r\n } else {\r\n $filesize = 0;\r\n }\r\n $arrDimensions = array(0 => 0, 1 => 0);\r\n if (\\Cx\\Core_Modules\\Media\\Controller\\MediaLibrary::_isImage($strPath.$file)) {\r\n $arrDimensions = @getimagesize($strPath.$file);\r\n }\r\n array_push($this->_arrFiles, array('name' => $file, 'path' => $this->_path.$file, 'size' => $filesize, 'icon' => $this->_getIcon($strPath.$file), 'width' => intval($arrDimensions[0]), 'height' => intval($arrDimensions[1])));\r\n }\r\n }\r\n }\r\n }", "function makeIcons_MergeCenter($src, $dst, $dstx, $dsty) {\n // $dst = destination image location\n // $dstx = user defined width of image\n // $dsty = user defined height of image\n $allowedExtensions = 'jpg jpeg gif png';\n\n $name = explode(\".\", $src);\n $currentExtensions = $name[count($name) - 1];\n $extensions = explode(\" \", $allowedExtensions);\n\n for ($i = 0; count($extensions) > $i; $i = $i + 1) {\n if ($extensions[$i] == $currentExtensions) {\n $extensionOK = 1;\n $fileExtension = $extensions[$i];\n break;\n }\n }\n\n if ($extensionOK) {\n $size = getImageSize($src);\n $width = $size[0];\n $height = $size[1];\n\n if ($width >= $dstx AND $height >= $dsty) {\n $proportion_X = $width / $dstx;\n $proportion_Y = $height / $dsty;\n\n if ($proportion_X > $proportion_Y) {\n $proportion = $proportion_Y;\n } else {\n $proportion = $proportion_X;\n }\n $target['width'] = $dstx * $proportion;\n $target['height'] = $dsty * $proportion;\n\n $original['diagonal_center'] =\n round(sqrt(($width * $width) + ($height * $height)) / 2);\n $target['diagonal_center'] =\n round(sqrt(($target['width'] * $target['width']) +\n ($target['height'] * $target['height'])) / 2);\n\n $crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\n if ($proportion_X < $proportion_Y) {\n $target['x'] = 0;\n $target['y'] = round((($height / 2) * $crop) / $target['diagonal_center']);\n } else {\n $target['x'] = round((($width / 2) * $crop) / $target['diagonal_center']);\n $target['y'] = 0;\n }\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n $from = ImageCreateFromJpeg($src);\n } elseif ($fileExtension == \"gif\") {\n $from = ImageCreateFromGIF($src);\n } elseif ($fileExtension == 'png') {\n $from = imageCreateFromPNG($src);\n }\n\n $new = ImageCreateTrueColor($dstx, $dsty);\n\n imagecopyresampled($new, $from, 0, 0, $target['x'], $target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\n if ($fileExtension == \"jpg\" OR $fileExtension == 'jpeg') {\n imagejpeg($new, $dst, 70);\n } elseif ($fileExtension == \"gif\") {\n imagegif($new, $dst);\n } elseif ($fileExtension == 'png') {\n imagepng($new, $dst);\n }\n }\n }\n}", "function imageToThumb($fname, $imgheight, $imgwidth, $foldername) {\r\n\t// Open the directory\r\n\t$pathToImages = urldecode ( $_REQUEST [\"jpath\"] );\r\n\t$pathToThumbs = urldecode ( $_REQUEST [\"jpath\"] ) . $foldername . \"/\";\r\n\t$dir = opendir ( $pathToImages );\r\n\tini_set ( \"memory_limit\", \"1000M\" );\r\n\r\n\t// Loop through it, looking for any/all JPG files:\r\n\tif (readdir ( $dir )) {\r\n\t\t// Parse path for the extension\r\n\t\t$info = pathinfo ( $pathToImages . $fname );\r\n\t\t\r\n\t\tif (strtolower ( $info ['extension'] ) == 'jpg') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefromjpeg ( \"{$pathToImages}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'png') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefrompng ( \"{$pathToImages}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'gif') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefromgif ( \"{$pathToImages}{$fname}\" );\r\n\t\t}\r\n\r\n\t\t$width = imagesx ( $img );\r\n\t\t$height = imagesy ( $img );\r\n\t\t\r\n\t\t/* Calculate thumbnail size\r\n\t\t * $new_width = $thumbWidth;\r\n\t\t * $new_height = floor($height * ( $thumbWidth / $width )); */\r\n\t\t\r\n\t\t$new_width = $imgwidth;\r\n\t\t$new_height = $imgheight;\r\n\t\t\r\n\t\t// Create a new temporary image\r\n\t\t$tmp_img = imagecreatetruecolor ( $new_width, $new_height );\r\n\t\t\r\n\t\t// Copy and resize old image into new image\r\n\t\timagecopyresized ( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\r\n\t\t\r\n\t\tif (strtolower ( $info ['extension'] ) == 'jpg') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagejpeg ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'png') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagepng ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'gif') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagegif ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Close the directory\r\n\tclosedir ( $dir );\r\n}", "function get_images($img_id, $image_sizes)\n{\n if ($image_sizes)\n foreach ($image_sizes as $size_name => $size) {\n $img = get_image($img_id, $size['w'], $size['h']);\n $image['url_' . $size_name] = $img['url'];\n $image['file_' . $size_name] = $img['filename'];\n }\n\n if (!$img)\n $img = get_image($img_id);\n \n $image['img_id'] = $img['id'];\n $image['name'] = $img['name'];\n $image['alt'] = $img['alt'];\n $image['title'] = $img['title'];\n $image['url'] = $img['url'];\n\n return $image;\n}", "function pushImages() \n\t{\n\t\tglobal $imageDir;\n\t\tglobal $studentImageDir;\t\t\n\t\tglobal $countImgs;\n\t\tglobal $countStudents;\n\t\t\n\t\t//Set up arrays of found images\n\t\t//This is being done ahead of the for statements since UNC's system\n\t\t//I think took the empty globs as FALSE instead of an empty array.\n\t\t$slideshow_pngs = glob($imageDir . \"*.png\");\n\t\t$slideshow_bigPNGs = glob($imageDir . \"*.PNG\");\n\t\t$slideshow_jpgs = glob($imageDir . \"*.jpg\");\n\t\t$slideshow_bigJPGs = glob($imageDir . \"*.JPG\");\n\t\t//global $fullImageDir;\n\n\t\t// Build top slideshow array\n\t\tif ($slideshow_pngs and !empty($slideshow_pngs))\n\t\t{\n\t\t\tforeach ($slideshow_pngs as $png) {\n\t\t\t\t//tempAr will be populated into the slideshow javascript\n\t\t\t\t//the first element is the thumbnail\n\t\t\t\t//the second element is the large image file\n\t\t\t\t//echo(\"tempAr = ['$png', '\" . substr_replace($png, $fullImageDir, 0, strlen($imageDir)) . \"'];\");\t\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($slideshow_bigPNGs and !empty($slideshow_bigPNGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigPNGs as $png) {\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_jpgs and !empty($slideshow_jpgs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_jpgs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_bigJPGs and !empty($slideshow_bigJPGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigJPGs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo(\"myImageArray.sort()\"); //sort our slideshow alphabetically\n\t\t\n\t}", "protected function generateImages() {\n if ($this->buildNamespace($this->imageFolder) && $this->createShortUrl()) {\n foreach ($this->inputs as $input) {\n $this->generate($input);\n }\n }\n\n return $this->responseJSON();\n }", "function drush_large_images_compress($dir, $min_size, $quality) {\n if ($quality > 100 || $quality < 1) {\n drush_set_error('Detected invalid quality value; must be between 1 and 100');\n drush_die();\n }\n\n if ($quality < 40) {\n if (!drush_confirm(dt('WARNING! Are you sure you want to use such a low quality?'))) {\n drush_user_abort();\n drush_die();\n }\n }\n\n // Build an array of all managed files\n $result = db_query('SELECT fid, uri FROM file_managed');\n $fids_uris = array();\n if ($result) {\n while ($row = $result->fetchAssoc()) {\n $fids_uris[$row['fid']] = str_replace(array('public://', 'private://'), '', $row['uri']);\n }\n }\n\n $images = large_images_find_images($dir, $min_size);\n if (!empty($images)) {\n foreach ($images as $image_fullpath) {\n $original_filesize = filesize($image_fullpath);\n\n // No matter where the executes drush from, we want our pathing to start from the Drupal root directory\n drush_shell_exec('pwd');\n $pwd = drush_shell_exec_output();\n $path_from_drupal_root = ltrim(str_replace($pwd, '', $image_fullpath), '/');\n\n // Remove \"sites/default/files\" and similar from the path\n // to get the same type of path we see in the file_managed table's \"uri\" column\n $public_prefix = variable_get('file_public_path', conf_path() . '/files');\n $private_prefix = variable_get('file_public_path');\n $temp_prefix = variable_get('file_temporary_path');\n $uri_without_scheme = ltrim(str_replace(array($public_prefix, $private_prefix, $temp_prefix), '', $path_from_drupal_root), '/');\n\n $fids = array();\n foreach ($fids_uris as $fid => $uri) {\n // Check if the uri without the scheme is referenced by file_managed\n if ($uri == $uri_without_scheme) {\n $fids[] = $fid;\n }\n }\n\n // Compress them image\n if (large_images_compress_image($image_fullpath, $quality)) {\n // If we don't clear the cache, filesize() will return the old size\n clearstatcache(TRUE, $image_fullpath);\n\n // Update the database\n $fids_status = '';\n if (!empty($fids)) {\n foreach (file_load_multiple($fids) as $file) {\n $file->filesize = filesize($file->uri);\n file_save($file);\n }\n $fids_status = '| db-updated FID #' . implode(', #', $fids);\n }\n\n drush_log(dt('!path | !old --> !new !fids_status', array(\n '!path' => $path_from_drupal_root,\n '!old' => large_images_human_filesize($original_filesize),\n '!new' => large_images_human_filesize(filesize($image_fullpath)),\n '!fids_status' => $fids_status,\n )), 'ok');\n }\n else {\n drush_set_error(dt('!path | Error compressing file', array('!path' => $path_from_drupal_root)));\n }\n }\n }\n else {\n drush_log(dt('No image files found.'), 'ok');\n }\n}", "public function run()\n {\n $default = [\n \t[['id'=> Conf::IMAGE_USER], ['path'=> 'images/user.jpg']],\n \t[['id'=> Conf::IMAGE_CATEGORY], ['path'=> 'images/category.jpg']],\n \t[['id'=> Conf::IMAGE_PRODUCT], ['path'=> 'images/product.jpg']],\n [['id'=> Conf::IMAGE_BUYER], ['path'=> 'images/buyer.jpg']],\n [['id'=> Conf::IMAGE_SELLER], ['path'=> 'images/seller.jpg']],\n [['id'=> Conf::IMAGE_SLIDE_1], ['path'=> 'images/slide1.png']],\n [['id'=> Conf::IMAGE_SLIDE_2], ['path'=> 'images/slide2.png']],\n [['id'=> Conf::IMAGE_SLIDE_3], ['path'=> 'images/slide3.png']],\n ];\n\n foreach ($default as $key => $value) {\n \tImage::updateOrCreate($value[0], $value[1]);\n }\n }", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "public function actionFixImageNames()\n {\n $prodImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'product' . DIRECTORY_SEPARATOR;\n // $prImgs = glob($prodImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $prImgs = glob($prodImgDir . '*.{jpg}', GLOB_BRACE);\n $c = count($prImgs);\n $y = $x = $r = $n = 0;\n if ($c > 0) {\n foreach ($prImgs as $img) {\n $bN = basename($img);\n $art = substr($bN, 0, -4);\n if (strlen($art) > 16) {\n $art = substr($art, 0, 16);\n }\n if ($n <= 16 || $n == 19 || $n == 85 || $n == 159) {\n echo 'Skipped image ' . $n . '...' . PHP_EOL;\n $n ++;\n continue;\n }\n echo 'Checking image (' . $n . '): ' . $bN . ' check articul: ' . $art . PHP_EOL;\n\n $civQuery = CatalogItemVariant::find()\n ->where(['published' => 1]);\n $civ = $civQuery->andFilterWhere(['like', 'img_url', $art])\n ->asArray()\n ->one();\n if (!empty($civ['img_url'])) {\n // echo 'Found CIV: ' . var_export($civ, 1) . PHP_EOL;\n $bNok = basename($civ['img_url']);\n if ($bNok != $bN) {\n echo 'Base name OK: ' . $bNok . ' != ' . $bN . PHP_EOL;\n\n $oldName = $prodImgDir . $bN;\n $newName = $prodImgDir . $bNok;\n if (file_exists($newName)) {\n echo 'Destination file exists: ' . $newName . PHP_EOL;\n $x ++;\n } else {\n try {\n $oldName = escapeshellarg($oldName);\n $newName = escapeshellarg($newName);\n if (rename($oldName, $newName)) {\n echo 'Renamed image from: ' . $bN . ' to: ' . $bNok . PHP_EOL;\n $r ++;\n }\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), PHP_EOL;\n continue;\n }\n }\n \n } else {\n $y ++;\n }\n }\n $n ++;\n }\n echo 'Renamed ' . $r . ' images. Good names: ' . $y . '. Images exists: ' . $x . '.' . PHP_EOL;\n }\n }", "function makethumbs()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll access to the file system and we'll use the Joomla way to all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$thumb_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"thumbs\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik whe you need it.\n\t\t$new_w = 90;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $thumb_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\n\t\t} //the files are now in the /images/content/arts_curriculum/thumbs directory\n\n\t\t$this->setRedirect( 'index.php?option=' . $option. '&task=makesitesmages&controller=items' , 'Thumbnails are made' );\n\n\n\t}", "public function run()\n {\n //\n $dados1 = [\n 'path' => 'caminho1/image.jpg'\n ];\n $dados2 = [\n 'path' => 'caminho2/image.jpg'\n ];\n $dados3 = [\n 'path' => 'caminho3/image.jpg'\n ];\n $dados4 = [\n 'path' => 'caminho4/image.jpg'\n ];\n $dados5 = [\n 'path' => 'caminho5/image.jpg'\n ];\n $dados6 = [\n 'path' => 'caminho6/image.jpg'\n ];\n $dados7 = [\n 'path' => 'caminho7/image.jpg'\n ];\n $dados8 = [\n 'path' => 'caminho8/image.jpg'\n ];\n $dados9 = [\n 'path' => 'caminho9/image.jpg'\n ];\n $dados10 = [\n 'path' => 'caminho10/image.jpg'\n ];\n $dados11 = [\n 'path' => 'caminho11/image.jpg'\n ];\n $dados12 = [\n 'path' => 'caminho12/image.jpg'\n ];\n\n Image::create($dados1);\n echo \"Caminho 1 criado \\n\";\n\n Image::create($dados2);\n echo \"Caminho 2 criado \\n\";\n\n Image::create($dados3);\n echo \"Caminho 3 criado \\n\";\n\n Image::create($dados4);\n echo \"Caminho 4 criado \\n\";\n\n Image::create($dados5);\n echo \"Caminho 5 criado \\n\";\n\n Image::create($dados6);\n echo \"Caminho 6 criado \\n\";\n\n Image::create($dados7);\n echo \"Caminho 7 criado \\n\";\n\n Image::create($dados8);\n echo \"Caminho 8 criado \\n\";\n\n Image::create($dados9);\n echo \"Caminho 9 criado \\n\";\n\n Image::create($dados10);\n echo \"Caminho 10 criado \\n\";\n\n Image::create($dados11);\n echo \"Caminho 11 criado \\n\";\n\n Image::create($dados12);\n echo \"Caminho 12 criado \\n\";\n }", "abstract protected function processImage (string $src): string;", "private function makeImageList()\n\t{\n\t\t$images_dir = self::$locator->banner_images_dir($this->trip, $this->slug);\n\t\t$trip = $this->trip;\n\t\t$slug = $this->slug;\n\t\t/// This is a hack so that unit testing does not have to setup Locator\n\t\t/// for every test.\n\t\tif (! is_dir($images_dir)) {\n\t\t\treturn [];\n\t\t}\n\t\t$list = scandir($images_dir);\n\t\t$x = [];\n\t\tforeach ($list as $ent) {\n\t\t\tif (($ent != \".\") && ($ent != \"..\") && (substr($ent, 0, 1) != \".\")) {\n\t\t\t\t$tmp = new \\stdClass();\n\t\t\t\t$tmp->url = self::$locator->url_banner_image($trip, $slug, $ent);\n\t\t\t\t$tmp->path = self::$locator->banner_image_filepath($trip, $slug, $ent);\n\t\t\t\t$x[] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$this->images_list = $x;\n\t}", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "public function chngPics(Request $request) {\n $rules = array(\n 'image_src' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n );\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return Redirect::back()\n ->withErrors($validator)\n ->withInput();\n }\n $usr_id = Auth::user()->id;\n $image = $request->file('image_src');\n if ($image) {\n\n $DIR = 'public/userimages/user_' . $usr_id;\n $SMALL = $DIR . '/' . 'small/';\n $MEDIUM = $DIR . '/' . 'medium/';\n $ORG = $DIR . '/' . 'original/';\n //$helper = new App\\http\\Controllers\\HelperController();\n\n if (!file_exists($DIR)) {\n\n mkdir($DIR, 0755, true);\n\n if (!file_exists($SMALL))\n mkdir($SMALL, 0755, true);\n\n if (!file_exists($MEDIUM))\n mkdir($MEDIUM, 0755, true);\n\n if (!file_exists($ORG))\n mkdir($ORG, 0755, true);\n }\n else {\n if (file_exists($DIR)) {\n\n //mkdir($DIR);\n\n if (!file_exists($SMALL))\n mkdir($SMALL, 0755, true);\n\n if (!file_exists($MEDIUM))\n mkdir($MEDIUM, 0755, true);\n\n if (!file_exists($ORG))\n mkdir($ORG, 0755, true);\n }\n }\n\n\n\n /* new code added for remove replacement of iphone posts from other posts date:3/10/2016 */\n \n $filename = time() . rand(1000, 9999) . '.' . $image->getClientOriginalExtension();\n // $ORG = str_replace(\"public/\",\"\",$ORG);\n\n // $location = public_path($ORG);\n $location = $ORG;\n \n $image->move($location, $filename);\n \n $imageController = new ImageController($usr_id);\n $thumbMedium = $imageController->resizeImage(140, 140, $filename, $ORG.$filename, $MEDIUM.\"/\".$filename); \n $thumbSmall = $imageController->resizeImage(35,30, $filename, $ORG.$filename, $SMALL.\"/\".$filename); \n \n //copy($MEDIUM . $filename, $SMALL . $filename);\n //copy($MEDIUM . $filename, $ORG . $filename);\n \n if($thumbMedium && $thumbSmall) {\n $update =userProfile::where('uid', '=', $usr_id)->update(['img' => $filename]); \n \n session(['profilepic' =>$filename]);\n \n return Response::json(array('success' => true, 'img' => URL($MEDIUM . $filename)), 200);\n }else{\n return Response::json(array('success' => false, 'message'=>'Error to upload image'), 200);\n }\n }\n }", "function optimizeImages($dir=null, $maxSize=1024) {\n\n CliMode::printHeaderBox('Optimize Images');\n\n if (!$dir) {\n Tht::error(\"Need a directory.\");\n }\n\n $dir = Tht::realpath($dir);\n if (!is_dir($dir)) {\n Tht::error(\"Not a directory:\\n $dir\");\n }\n\n $audit = $this->auditImages($dir);\n\n if (!$audit['numImages']) {\n echo \"No images to optimize.\\n\\n\";\n return;\n }\n\n $msg = \"Optimize (\" . $audit['numImages'] . \") images under:\\n $dir\\n\\n\";\n $msg .= \"The original images will be backed up to sub-folders named `_originals`.\\n\\n\";\n $msg .= \"Continue?\";\n if (!Tht::module('System')->u_confirm($msg)) {\n Tht::exitScript(0);\n }\n\n echo \"\\n\\nOptimizing images...\\n\\n\";\n usleep(500000);\n\n $numImages = 0;\n $numSkipped = 0;\n $oldSizeTotal = 0;\n $newSizeTotal = 0;\n\n foreach ($audit['images'] as $f) {\n\n $origDir = $f['dirPath'] . '/_originals';\n $origPath = $origDir . '/' . $f['fileName'];\n $relPath = str_replace($dir, '', $f['fullPath']);\n\n if (!is_dir($origDir)) {\n Tht::module('*File')->u_make_dir($origDir);\n }\n\n echo $relPath . \"\\n\";\n\n try {\n $result = Tht::module('Image')->optimize($f['fullPath'], $maxSize);\n } catch (\\Exception $e) {\n $result = [ 'error' => $e->getMessage() ];\n }\n\n if ($result['error']) {\n echo \" SKIP: \" . $result['error'] . \"\\n\\n\";\n copy($f['fullPath'], $origPath);\n $numSkipped += 1;\n continue;\n }\n\n $optPath = $result['newFile'];\n\n $oldSize = round(filesize($f['fullPath']) / 1024, 1);\n $newSize = round(filesize($optPath) / 1024, 1);\n $oldSizeTotal += $oldSize;\n $newSizeTotal += $newSize;\n $numImages += 1;\n\n rename($f['fullPath'], $origPath);\n rename($optPath, $f['fullPath']);\n\n $pc = 100 - (round($newSize / $oldSize, 2) * 100);\n echo \" \" . $oldSize . \"k -> \" . $newSize . \"k = \" . $pc . \"%\\n\\n\";\n }\n\n $pc = 0;\n $delta = 0;\n if ($numImages) {\n $pc = 100 - round($newSizeTotal / $oldSizeTotal, 2) * 100;\n $delta = round($oldSizeTotal - $newSizeTotal);\n }\n\n echo \"\\n-------------------------\\n\\n\";\n echo \"Images Optimized: $numImages\\n\";\n echo \"Images Skipped: $numSkipped\\n\\n\";\n echo \"Bytes Cut: $delta kb\\n\";\n echo \"Total: \" . $pc . \"%\\n\\n\";\n echo \"NOTE: File extensions were retained, but the underlying types might have changed.\\n\\n\";\n }", "function makeIcons_MergeCenter($src, $dst, $dstx, $dsty){\n//$dst = destination image location\n//$dstx = user defined width of image\n//$dsty = user defined height of image\n\n$allowedExtensions = 'jpg jpeg gif png';\n\n$name = explode(\".\", $src);\n$currentExtensions = $name[count($name)-1];\n$extensions = explode(\" \", $allowedExtensions);\n\nfor($i=0; count($extensions)>$i; $i=$i+1){\nif($extensions[$i]==$currentExtensions)\n{ $extensionOK=1;\n$fileExtension=$extensions[$i];\nbreak; }\n}\n\nif($extensionOK){\n\n$size = getImageSize($src);\n$width = $size[0];\n$height = $size[1];\n\nif($width >= $dstx AND $height >= $dsty){\n\n$proportion_X = $width / $dstx;\n$proportion_Y = $height / $dsty;\n\nif($proportion_X > $proportion_Y ){\n$proportion = $proportion_Y;\n}else{\n$proportion = $proportion_X ;\n}\n$target['width'] = $dstx * $proportion;\n$target['height'] = $dsty * $proportion;\n\n$original['diagonal_center'] =\nround(sqrt(($width*$width)+($height*$height))/2);\n$target['diagonal_center'] =\nround(sqrt(($target['width']*$target['width'])+\n($target['height']*$target['height']))/2);\n\n$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\nif($proportion_X < $proportion_Y ){\n$target['x'] = 0;\n$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n}else{\n$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n$target['y'] = 0;\n}\n\nif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){\n$from = ImageCreateFromJpeg($src);\n}elseif ($fileExtension == \"gif\"){\n$from = ImageCreateFromGIF($src);\n}elseif ($fileExtension == 'png'){\n $from = imageCreateFromPNG($src);\n}\n\n$new = ImageCreateTrueColor ($dstx,$dsty);\n\nimagecopyresampled ($new, $from, 0, 0, $target['x'],\n$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\n if($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){\nimagejpeg($new, $dst, 70);\n}elseif ($fileExtension == \"gif\"){\nimagegif($new, $dst);\n}elseif ($fileExtension == 'png'){\nimagepng($new, $dst);\n}\n}\n}\n}", "public function processImages()\n {\n // Start by scanning for any new images\n Mage::getModel('udder_deflate/scan')->findImages();\n\n // Then compress the list of images in the queue\n Mage::getModel('udder_deflate/compress')->compressAll();\n\n return $this;\n }", "function combo_get_image_paths($selected_path, $base_url, $base_path)\n{\n $out = new Tempcode();\n\n $paths = get_image_paths($base_url, $base_path);\n $i = 0;\n foreach ($paths as $pretty => $url) {\n $checked = (($url == $selected_path) || (($selected_path == '') && ($i == 0)));\n $out->attach(do_template('FORM_SCREEN_INPUT_RADIO_LIST_ENTRY_PICTURE', array('_GUID' => 'd2ff01291e5f0c0e4cf4ee5b6061593c', 'CHECKED' => $checked, 'NAME' => 'path', 'VALUE' => $url, 'URL' => $url, 'PRETTY' => $pretty)));\n $i++;\n }\n\n return $out;\n}", "protected function makeImagePath()\n {\n // Create image path, nesting folders by splitting the record ID\n $path = $this->originalImageFilePathRoot . chunk_split($this->recordId, 3, '/') . $this->endDirectory;\n\n // Create the path if the directory does not exist\n if (!is_dir($path)) {\n try {\n mkdir($path, 0775, true);\n } catch (\\Exception $e) {\n $this->log->error('Failed to create image directory path: ' . $path);\n throw new \\Exception('Failed to create image directory path');\n }\n }\n\n $this->originalImageFilePath = $path;\n }", "function insert_image($temp_name, $path_main, $path_add, $entitle, $width = 0, $height = 0, $resize_type = '', $srcx = 0, $srcy = 0) {\n // create directories\n $dir_arr = explode('/', $path_add);\n $direct_temp = $_SERVER['DOCUMENT_ROOT'] . '/' . $path_main . '/';\n for ($i = 0; $i < count($dir_arr); $i++) {\n if (!is_dir($direct_temp . $dir_arr[$i])) {\n mkdir($direct_temp . $dir_arr[$i]);\n }\n $direct_temp .= $dir_arr[$i] . '/';\n }\n $size = getimagesize($temp_name);\n $type = $size['mime'];\n $new_name = 'none';\n switch ($type) {\n case 'image/jpeg':\n $new_name = $entitle . \".jpg\";\n break;\n case 'image/png':\n $new_name = $entitle . \".png\";\n break;\n case 'image/gif':\n $new_name = $entitle . \".gif\";\n break;\n }\n if ($new_name === 'none')\n return false;\n // resize calc\n $new_width = 0;\n $new_height = 0;\n $src_width = $size[0];\n $src_height = $size[1];\n if ($width && $height) {\n if ($resize_type == '') { // simple resize\n $new_width = $width;\n $new_height = $height;\n } elseif ($resize_type == 'w') { // resize by width\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } elseif ($resize_type == 'h') { // resize by height\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n } elseif ($resize_type == 'max') { // resize by max\n if ((1.0 * $width / $height) < (1.0 * $size[0] / $size[1])) {\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } else {\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n }\n } elseif ($resize_type == 'min') { // cut resize\n if ((1.0 * $width / $height) > (1.0 * $size[0] / $size[1])) {\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } else {\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n }\n } elseif ($resize_type == 'cut') {\n if ((1.0 * $width / $height) > (1.0 * $size[0] / $size[1])) {\n $src_width = $size[0];\n $src_height = intval($src_width * $height / $width);\n $new_width = $width;\n $new_height = $height;\n } else {\n $src_height = $size[1];\n $src_width = intval($src_height * $width / $height);\n $new_width = $width;\n $new_height = $height;\n }\n }\n } else {\n if (!copy($temp_name, $direct_temp . $new_name))\n return '';\n return $path_add . $new_name;\n }\n\n // resizing\n switch ($type) {\n //int imagecopyresampled (\n // resource dst_im, resource src_im, \n // int dstX, int dstY, int srcX, int srcY, \n // int dstW, int dstH, int srcW, int srcH)\n case 'image/jpeg':\n $src = imagecreatefromjpeg($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagejpeg($dest, $direct_temp . $new_name, 75);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n case 'image/png':\n $src = imagecreatefrompng($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagepng($dest, $direct_temp . $new_name);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n case 'image/gif':\n $src = imagecreatefromgif($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagegif($dest, $direct_temp . $new_name);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n }\n chmod($direct_temp . $new_name, 0777);\n return $path_add . $new_name;\n }", "public function process(ContainerBuilder $container)\n {\n $uploadRoot = $container->getParameter(\"exploring_file_utility.upload_root\");\n $filenameGenerator = $container->getParameter(\"exploring_file_utility.filename_generator\");\n\n $availableSubdirs = array();\n /** @var \\DirectoryIterator[] $dirIterator */\n $dirIterator = new \\DirectoryIterator($uploadRoot);\n\n foreach ( $dirIterator as $dir ) {\n if ( $dir->isDir() && !$dir->isDot() ) {\n $availableSubdirs[] = $dir->getFilename();\n }\n }\n\n if ( $filenameGenerator ) {\n $filenameGenerator = new Reference($container->getParameter(\n \"exploring_file_utility.filename_generator\"\n ));\n }\n\n $fileManagerDefinition = $container->findDefinition(FileManager::class);\n $fileManagerDefinition->replaceArgument(0, $availableSubdirs);\n $fileManagerDefinition->replaceArgument(2, $filenameGenerator);\n\n $chainExecutorRef = NULL;\n $chains = $container->getParameter('exploring_file_utility.image_chains');\n\n if ( $chains ) {\n $taggedChainSteps = array_keys($container->findTaggedServiceIds('exploring_file_utility.image_chain_step'));\n\n $stepRefs = array();\n\n foreach ( $taggedChainSteps as $stepName ) {\n $stepRefs[] = $container->getDefinition($stepName);\n }\n\n $container->getDefinition('exploring_file_utility.image_chain_executor')\n ->setArguments(array($chains, $stepRefs));\n\n $chainExecutorRef = new Reference('exploring_file_utility.image_chain_executor');\n }\n\n $imageEngineService = $container->getParameter(\"exploring_file_utility.image_engine\");\n\n switch ( $imageEngineService ) {\n case Constants::ENGINE_GD:\n $arguments = array(\n new Reference(FileManager::class),\n new Reference(\"exploring_file_utility.imageengine_gd\"),\n $chainExecutorRef\n );\n break;\n case Constants::ENGINE_IMAGICK:\n $arguments = array(\n new Reference(FileManager::class),\n new Reference(\"exploring_file_utility.imageengine_imagick\"),\n $chainExecutorRef\n );\n break;\n default:\n $arguments = array(\n new Reference(FileManager::class),\n new Reference($imageEngineService),\n $chainExecutorRef\n );\n }\n\n $container->findDefinition(ImageProcessor::class)\n ->setArguments($arguments);\n }", "private function prepareImageList() {\n\t\t\tforeach(scandir($this->templateDirectory) as $templateFileName) {\n\t\t\t\tif((strcmp($templateFileName, \".\") !== 0) && (strcmp($templateFileName, \"..\") !== 0)) {\n\t\t\t\t\t$this->imageList->addItem(new Image($this->templateDirectory, $templateFileName), $templateFileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function run() {\r\nif(!($new_image = @imagecreatetruecolor($this->new_width, $this->new_height)))\r\nthrow new Exception(\"Error while the new image was initialized\");\r\n\r\nswitch($this->type) {\r\ncase 1:\r\n$image = imagecreatefromgif($this->src);\r\n$transparent_index = imagecolortransparent($image);\r\n$transparent_color = imagecolorsforindex($image, $transparent_index);\r\n$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\nimagefill($new_image, 0, 0, $transparent_index);\r\nimagecolortransparent($new_image, $transparent_index);\r\nbreak;\r\ncase 2:\r\n$image = imagecreatefromjpeg($this->src);\r\nbreak;\r\ncase 3:\r\n$image = imagecreatefrompng($this->src);\r\nimagealphablending($new_image, false);\r\nimagesavealpha($new_image, true);\r\nbreak;\r\ndefault:\r\nthrow new Exception('<b>Error:</b> The image type was not recognized');\r\nbreak;\r\n}\r\n\r\ntry {\r\nimagecopyresampled($new_image, $image, 0, 0, 0, 0, $this->new_width, $this->new_height, $this->width, $this->height);\r\n}\r\ncatch(Exception $e) {\r\nthrow new Exception(\"<b>Error:</b> The image couldn't be resized\");\r\n}\r\n\r\nswitch($this->type) {\r\ncase 1:\r\nimagegif($new_image, $this->dest);\r\nbreak;\r\ncase 2:\r\nimagejpeg($new_image, $this->dest);\r\nbreak;\r\ncase 3:\r\nimagepng($new_image, $this->dest);\r\nbreak;\r\ndefault:\r\nthrow new Exception('Error while the image was created');\r\nbreak;\r\n}\r\n\r\n$this->releaseMemory($image, $new_image);\r\n}", "function build() {\n \n $gif = new GIFExtractor();\n $dir = $gif ->getDirectory();\n \n $last = null;\n $open = opendir($dir);\n while($item = readdir($open)){\n if($item == \".\" OR $item == \"..\") {\n continue;\n } \n \n $last = $item;\n }\n $file = file_load($last);\n \n $return = $gif ->toArray((array)$file);\n $this -> printLine('Files / ' . $last, \"<pre>\" .print_r($return, true) . \"</pre>\");\n \n // Delete those\n foreach($return as $file_item){\n unlink($file_item);\n }\n \n $this -> printLine('Recreate', $last);\n $return2 = $gif ->toArray((array)$file, true);\n \n $this -> printLine('New Created / ' . $last, \"<pre>\" .print_r($return2, true) . \"</pre>\");\n }", "function image_sizes() {\n\tadd_image_size( 'rwd-small', 400, 200 );\n\tadd_image_size( 'rwd-medium', 800, 400 );\n\tadd_image_size( 'rwd-large', 1200, 600 );\n\tadd_image_size( 'rwd-mediumx2', 1600, 800 );\n\tadd_image_size( 'rwd-xl', 2000, 1000 );\n\tadd_image_size( 'rwd-largex2', 2400, 1200 );\n\tadd_image_size( 'rwd-xlx2', 4000, 2000 );\n}", "function _get_all_image_ids_type(&$ids, $dir, $type, $recurse, $dirs_only, $skip)\n{\n $has_skip = ($skip !== array());\n\n $_dir = @opendir($dir);\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n if ($file[0] == '.' || $file == 'index.html') {\n continue; // Optimisation, so no need for should_ignore_file call\n }\n if ($has_skip && in_array($file, $skip)) {\n continue;\n }\n\n $path = $dir . (($dir != '') ? '/' : '') . $file;\n $is_dir = is_dir($path);\n\n if ($is_dir) {\n if (($recurse) && (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) && ((strlen($file) != 2) || (strtoupper($file) != $file))) {\n $type_path = $type . (($type != '') ? '/' : '');\n\n if ($dirs_only) {\n $ids[] = $type_path . $file;\n }\n _get_all_image_ids_type($ids, $path, $type_path . $file, true, $dirs_only, $skip);\n }\n } else {\n if (!$dirs_only) {\n if ((preg_match('#^[' . URL_CONTENT_REGEXP . ']+\\.(png|jpg|gif)$#', $file) != 0/*optimisation*/) || (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS))) {\n $type_path = $type . (($type != '') ? '/' : '');\n\n $dot_pos = strrpos($file, '.');\n if ($dot_pos === false) {\n $dot_pos = strlen($file);\n }\n if (is_image($file)) {\n $ids[] = $type_path . substr($file, 0, $dot_pos);\n }\n }\n }\n }\n }\n closedir($_dir);\n }\n}", "protected function makeThumbnails()\n {\n $sizes = [\n 'image_211' => [\n 'width' => 211,\n 'mode' => ImageInterface::THUMBNAIL_OUTBOUND,\n ],\n ];\n $data = $this->image;\n if (!$data) {\n return;\n }\n\n if (is_string($data)) {\n $tempFile = tempnam('/tmp', 'temp_');\n file_put_contents($tempFile, $data);\n $data = fopen($tempFile, 'r+');\n }\n\n if (stream_get_contents($data) == '') {\n return;\n }\n\n fseek($data, 0);\n $sourceImage = @ImagineImage::getImagine()->read($data);\n foreach ($sizes as $sizeName => $size) {\n $thumbnailAttributeName = $sizeName;\n if (!empty($size['width'])) {\n $width = $size['width'];\n if ($width < 0) {\n $originalWidgth = $sourceImage->getSize()->getWidth();\n if (-$originalWidgth < $width * 4) {\n $width = $sourceImage->getSize()->getWidth() + $width;\n } else {\n $width = $originalWidgth;\n }\n }\n } else {\n $width = null;\n }\n\n if (!empty($size['height'])) {\n $height = $size['height'];\n if ($height < 0) {\n $originalHeight = $sourceImage->getSize()->getHeight();\n if (-$originalHeight < $height * 4) {\n $height = $sourceImage->getSize()->getHeight() + $height;\n } else {\n $height = $originalHeight;\n }\n }\n } else {\n $height = null;\n }\n\n if (!empty($size['mode'])) {\n $mode = $size['mode'];\n } else {\n $mode = ImageInterface::THUMBNAIL_INSET;\n }\n\n BaseImage::$thumbnailBackgroundAlpha = 0;\n $image = ImagineImage::thumbnail($sourceImage, $width, $height, $mode);\n\n if (!empty($size['watermark'])) {\n $watermark = fopen($size['watermark'], 'r+');\n $watermark = ImagineImage::thumbnail($watermark, $image->getSize()->getWidth(), $image->getSize()->getHeight(), ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $watermark = ImagineImage::crop($watermark, $image->getSize()->getWidth(), $image->getSize()->getHeight());\n\n $image = ImagineImage::watermark($image, $watermark);\n }\n\n $fileName = tempnam(sys_get_temp_dir(), 'test');\n $image->save($fileName, [\n 'format' => $this->image_extension,\n ]);\n\n $thumbData = fopen($fileName, 'r+');\n $this->$thumbnailAttributeName = $thumbData;\n }\n\n fseek($data, 0);\n }", "private function generateThumbnails(Image $image) {\n\n\t $attrs = $image->attributesToArray();\n\t $this->command->info(\"Generating thumbs for '{$attrs['path']}'\");\n\n\t $filePath = dirname(__FILE__).\"/Images/{$attrs['path']}\";\n\t $pathAsArray = explode(\".\", $attrs['path']);\n\t $extension = end($pathAsArray);\n\t $baseName = basename($attrs['path'], \".{$extension}\");\n\n\t array_map(function($size) use ($filePath, $extension, $attrs, $baseName){\n\n\t\t $this->command->info(\"Generating {$size[0]}x{$size[1]} thumb\");\n\t\t $thumb = $this->imageManager->make($filePath)->fit($size[0], $size[1])->stream($extension, 80);\n\t\t Storage::put(\"public/images/{$attrs['id']}/{$baseName}-{$size[0]}x{$size[1]}.{$extension}\", $thumb);\n\n\t\t Thumbnail::create([\n\t\t\t 'path' => \"{$baseName}-{$size[0]}x{$size[1]}.{$extension}\",\n\t\t\t 'image_id' => $attrs['id'],\n\t\t\t 'width' => $size[0],\n\t\t\t 'height' => $size[1]\n\t\t ]);\n\n\t }, $this->thumbSizes);\n\n }", "public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}", "private function procEsfPic($url){\r\n $picurl = WEB_ROOT.$url;\r\n //计算图片缩放比例\r\n $imageInfo = @getimagesize($picurl);\r\n $arrParts = pathinfo($url);\r\n $sExtN = strtolower($arrParts['extension']);\r\n $newurl = $arrParts['dirname'] . '/' . date(\"YW\") . \"/\" . $arrParts['basename'];\r\n $targetSrc = WEB_ROOT.$newurl;\r\n\r\n $srcWidth = $imageInfo[0];\r\n $srcHeight = $imageInfo[1];\r\n\r\n $thumbscale = min(160 / $srcWidth, 160 / $srcHeight); // 计算缩放比例\r\n $smlscale = min(320 / $imageInfo[0], 320 / $imageInfo[1]); // 计算缩放比例\r\n $midscale = min(900 / $imageInfo[0], 900 / $imageInfo[1]); // 计算缩放比例\r\n // 图像小于缩放大小,安原始图像大小生成图片,即$scale值为1\r\n if (ceil($thumbscale) > 1) {\r\n $thumbscale = '100%';\r\n } else {\r\n $thumbscale = ($thumbscale * 100) . '%';\r\n }\r\n if (ceil($smlscale) > 1) {\r\n $smlscale = '100%';\r\n } else {\r\n $smlscale = ($smlscale * 100) . '%';\r\n }\r\n if (ceil($midscale) > 1) {\r\n $midscale = '100%';\r\n } else {\r\n $midscale = ($midscale * 100) . '%';\r\n }\r\n\r\n $thumb_x = substr($targetSrc, 0, strrpos($targetSrc, '.')) . '_x.' . $sExtN;\r\n $thumb_s = substr($targetSrc, 0, strrpos($targetSrc, '.')) . '_s.' . $sExtN;\r\n $thumb_m = substr($targetSrc, 0, strrpos($targetSrc, '.')) . '_m.' . $sExtN;\r\n\r\n //Image::open($this->disk_path)->resize($this->thumbWidth,$this->thumbHeight)->save($thumb_x, $sExtN);\r\n Image::open($picurl)->resize($thumbscale)->save($thumb_x, $sExtN);\r\n Image::open($picurl)->resize($smlscale)->save($thumb_s, $sExtN);\r\n Image::open($picurl)->resize($midscale)->save($thumb_m, $sExtN);\r\n\r\n $fsize = filesize($picurl);//ceil(filesize($picurl) / 1000) . \"k\"; //获取文件大小\r\n //移动原始图片\r\n $rlt = FileUtil::moveFile($picurl, $targetSrc);\r\n\r\n //返回处理图片信息\r\n $attachData=array();\r\n $attachData['rlt'] = $rlt;\r\n $attachData['name'] = $arrParts['basename'];\r\n $attachData['url'] = $newurl;\r\n $attachData['type'] = strtolower($arrParts['extension']);\r\n $attachData['size'] = $fsize;\r\n $attachData['update_at'] = time();\r\n return $attachData;\r\n }", "public function Do_Upload_images($image, $path, $date_added, $page_uid, $page_type = NULL) {\n\n $this->_queries->_res = NULL;\n $get_number_of_images = $this->_queries->GetData(\"promotional_images\", \"page_id\", $page_uid, $option = \"6\");\n\n\n $number = $get_number_of_images['row_count'];\n if ($number < \"1\") {\n var_dump($number);\n $dir = ABSOLUTH_PATH_IMAGES;\n\n foreach ($_FILES as $k => $file) {\n // Create directory if it does not exist\n if (!is_dir(ABSOLUTH_PATH_IMAGE_FRONT_END . \"page_id_\" . $page_uid . \"_images/\")) {\n mkdir(ABSOLUTH_PATH_IMAGE_FRONT_END . \"page_id_\" . $page_uid . \"_images/\");\n }\n\n\n $upload_file_new_name = preg_replace('/^.*\\.([^.]+)$/D', \"image_\" . $page_uid . \"_\" . ((int) $number + 1) . \".$1\", basename($file['name'][\"promo\"][\"uploadimage\"]));\n\n\n $upload_file = ABSOLUTH_PATH_IMAGE_FRONT_END . \"page_id_\" . $page_uid . \"_images/\" . $upload_file_new_name;\n\n\n $path = \"/r.frontend/images/page_id_\" . $page_uid . \"_images/\";\n $uploadOk = 1;\n\n $imageFileType = pathinfo($upload_file, PATHINFO_EXTENSION);\n }\n\n if (isset($_POST['form']['promo']['douploadimage'])) {\n\n $check = getimagesize($file[\"tmp_name\"]['promo']['uploadimage']);\n\n if ($check !== FALSE) {\n $uploadOk = 1;\n } else {\n $uploadOk = 0;\n }\n }\n if (file_exists($upload_file)) {\n $uploadOk = 0;\n }\n if ($file[\"size\"]['promo']['uploadimage'] > 5000000) {\n \n }\n if ($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\" && $imageFileType != \"gif\") {\n $uploadOk = 0;\n }\n if ($uploadOk == 0) {\n \n } else {\n\n if (move_uploaded_file($file[\"tmp_name\"]['promo']['uploadimage'], $upload_file)) {\n\n $image_name = preg_replace('/^.*\\.([^.]+)$/D', \"image_\" . $page_uid . \"_\" . ((int) $number + 1) . \".$1\", basename($file['name'][\"promo\"][\"uploadimage\"]));\n\n $table = array(\"table1\" => \"promotional_images\");\n $columns = array(\"`page_id`\", \"`image_name`\", \"`image_path`\", \"`date_added`\");\n\n $values = array(\"'\" . $page_uid . \"'\", \"'\" . $image_name . \"'\", \"'\" . $path . \"'\", \"'\" . DATE_ADDED . \"'\");\n $values_to_insert = array(\n \"tables\" => $table,\n \"columns\" => $columns,\n \"values\" => $values\n );\n $insert_images_into = $this->_queries->Insertvalues($values_to_insert, $option = \"1\");\n return true;\n } else {\n return false;\n }\n }\n } else {\n $flag = 1;\n if ($flag == 1) {\n $message = \"<li class='list-group-item list-group-item-warning'><i class='glyphicon glyphicon-info-sign'></i>&nbsp;\"\n . \"Only one image per page is allowed. Please delete the previous image.</li>\";\n echo $message;\n }\n }\n }", "public function reprocess()\n {\n $fileLocation = $this->storage == 'filesystem' ? $this->path('original') : $this->url('original');\n\n if (!$this->originalFilename() || !file_exists($fileLocation)) {\n return;\n }\n\n foreach ($this->styles as $style) {\n $file = FileFactory::create($fileLocation);\n\n $ext = pathinfo($file->getFilename(), PATHINFO_EXTENSION);\n if (\n $style->dimensions\n && (\n $file->isImage()\n || in_array($ext, ['psd', 'ai', 'eps', 'ar3'])\n )\n ) {\n if ($ext == 'psd') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/psd.png'), 'psd.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ai') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ai.png'), 'ai.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'eps') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/eps.png'), 'eps.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ar3') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ar3.png'), 'ar3.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($file->isImage()) {\n $file = $this->resizer->resize($file, $style);\n }\n }\n else {\n $file = $file->getRealPath();\n }\n\n $filePath = $this->path($style->name);\n $this->move($file, $filePath);\n }\n }", "function PREFIX_add_image_sizes() {\n\t/*\n\t// 16:9\n\tadd_image_size( 'wide-xsmall', 295, 165, true );\n\tadd_image_size( 'wide-small', 360, 202, true );\n\tadd_image_size( 'wide-medium', 470, 264, true );\n\tadd_image_size( 'wide-large', 770, 433, true );\n\tadd_image_size( 'wide-xlarge', 1440, 810, true );\n\n\t// 4x3\n\tadd_image_size( 'ratio-4-3-small', 300, 225, true );\n\tadd_image_size( 'ratio-4-3-medium', 470, 353, true );\n\tadd_image_size( 'ratio-4-3-large', 740, 555, true );\n\tadd_image_size( 'ratio-4-3-xlarge', 1440, 1080, true );\n\n\t// Golden Ratio\n\tadd_image_size( 'ratio-gold-small', 300, 300 * 0.618, true );\n\tadd_image_size( 'ratio-gold-medium', 470, 470 * 0.618, true );\n\tadd_image_size( 'ratio-gold-large', 740, 740 * 0.618, true );\n\tadd_image_size( 'ratio-gold-xlarge', 1440, 1440 * 0.618, true );\n\n\t// Square\n\tadd_image_size( 'square-xsmall', 160, 160, true );\n\tadd_image_size( 'square-small', 300, 300, true );\n\tadd_image_size( 'square-medium', 470, 470, true );\n\tadd_image_size( 'square-large', 800, 800, true );\n\t*/\n}", "function get_image($id, $width = 0, $height = 0)\n{\n\n $item = db()->query('SELECT * FROM images WHERE id = ' . $id);\n $image = $item[0];\n if (!$image)\n return false;\n $f = explode(',', $image['files']);\n $files = array();\n foreach ($f as $file)\n $files[] = trim($file);\n $image['full_filename'] = global_conf()['absolute_root_path'] . 'i/' . $files[0];\n $image['url'] = global_conf()['http_root_path'] . 'i/' . $files[0];\n $imag['filename'] = $files[0];\n $image['files'] = $files;\n $resize_mode = get_resize_mode($width, $height, $image['width'], $image['height']);\n if ($resize_mode == 'none')\n return $image;\n\n $path_parts = pathinfo($files[0]);\n $extension = $path_parts['extension'];\n list($filename) = explode('.', $path_parts['basename']);\n\n switch ($resize_mode) {\n case 'width':\n $thumbnail_filename = $filename . 'w' . $width . '.' . $extension;\n break;\n\n case 'height':\n $thumbnail_filename = $filename . 'h' . $height . '.' . $extension;\n break;\n }\n\n if (!file_exists(global_conf()['absolute_root_path'] . '/i/' . $thumbnail_filename)) {\n copy($image['full_filename'], global_conf()['absolute_root_path'] . '/i/' . $thumbnail_filename);\n chmod(global_conf()['absolute_root_path'] . 'i/' . $thumbnail_filename, 0666);\n if ($resize_mode == 'width')\n resize_img($thumbnail_filename, global_conf()['absolute_root_path'] . 'i/', $width, 0);\n\n else\n resize_img($thumbnail_filename, global_conf()['absolute_root_path'] . 'i/', 0, $height);\n\n $image['files'][] = $thumbnail_filename;\n db()->update('images', $id, array('files' => array_to_string($image['files'])));\n }\n\n $image['url'] = global_conf()['http_root_path'] . 'i/' . $thumbnail_filename;\n $image['full_filename'] = global_conf()['absolute_root_path'] . 'i/' . $thumbnail_filename;\n $image['filename'] = $thumbnail_filename;\n\n return $image;\n}", "public function run() {\n\n // make enough memory available to scale bigger images\n ini_set('memory_limit', $this->thumb->options['memory']);\n \n // create the gd lib image object\n switch($this->thumb->image->mime()) {\n case 'image/jpeg':\n $image = @imagecreatefromjpeg($this->thumb->image->root()); \n break;\n case 'image/png':\n $image = @imagecreatefrompng($this->thumb->image->root()); \n break;\n case 'image/gif':\n $image = @imagecreatefromgif($this->thumb->image->root()); \n break;\n default:\n raise('The image mime type is invalid');\n break;\n } \n\n // check for a valid created image object\n if(!$image) raise('The image could not be created');\n\n // cropping stuff needs a couple more steps \n if($this->thumb->options['crop'] == true) {\n\n // Starting point of crop\n $startX = floor($this->thumb->tmp->width() / 2) - floor($this->thumb->result->width() / 2);\n $startY = floor($this->thumb->tmp->height() / 2) - floor($this->thumb->result->height() / 2);\n \n // Adjust crop size if the image is too small\n if($startX < 0) $startX = 0;\n if($startY < 0) $startY = 0;\n \n // create a temporary resized version of the image first\n $thumb = imagecreatetruecolor($this->thumb->tmp->width(), $this->thumb->tmp->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n \n // crop that image afterwards \n $cropped = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $cropped = $this->keepColor($cropped);\n imagecopyresampled($cropped, $thumb, 0, 0, $startX, $startY, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->tmp->width(), $this->thumb->tmp->height()); \n imagedestroy($thumb);\n \n // reasign the variable\n $thumb = $cropped;\n\n } else {\n $thumb = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->result->width(), $this->thumb->result->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n } \n \n // convert the thumbnail to grayscale \n if($this->thumb->options['grayscale']) {\n imagefilter($thumb, IMG_FILTER_GRAYSCALE);\n }\n\n // convert the image to a different format\n if($this->thumb->options['to']) {\n\n switch($this->thumb->options['to']) {\n case 'jpg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'gif': \n imagegif($thumb, $this->thumb->root()); \n break; \n }\n\n // keep the original file's format\n } else {\n\n switch($this->thumb->image->mime()) {\n case 'image/jpeg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'image/png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'image/gif': \n imagegif($thumb, $this->thumb->root()); \n break;\n }\n\n }\n\n imagedestroy($thumb);\n \n }", "function drush_large_images_list($dir, $min_size) {\n $images = large_images_find_images($dir, $min_size);\n if (!empty($images)) {\n foreach ($images as $image) {\n $img_size = getimagesize($image);\n drush_log(dt('!size !wx!h !path', array(\n '!path' => $image,\n '!w' => str_pad($img_size[0], 5, ' ', STR_PAD_LEFT),\n '!h' => str_pad($img_size[1], 5, ' ', STR_PAD_RIGHT),\n '!size' => str_pad(large_images_human_filesize(filesize($image)), 9, ' '),\n )), 'ok');\n }\n }\n else {\n drush_log(dt('No image files found.'), 'ok');\n }\n}", "public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "private function updateImgThumbnail()\n {\n //====================================================================//\n // Load Object Images List\n foreach (Image::getImages(SLM::getDefaultLangId(), $this->ProductId) as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}", "public function addImagesSizes() {\n\t\t// add_image_size( 'small', 225, 9999 );\n\t\t// add_image_size( 'hero', 1600, 9999 );\n\t}", "public function createImage3(){\n $this->triangleCreate(240, 100, 290, 50, 340, 100);\n $this->triangleCreate(40, 300, 90, 250, 140, 300);\n $this->triangleCreate(440, 300, 490, 250, 540, 300);\n $this->createLine(265, 100, 105, 265);\n $this->createLine(315, 100, 475, 265);\n $this->createLine(125, 285, 455, 285);\n $this->generateImage();\n }", "function image_sprite($sprite_abspath, $icons_abspaths, $orientation = 'portrait', $padding = 5)\n{\n\n // open all the images, create teardown function\n $sprite = new \\Imagick();\n $icons = array();\n\n foreach($icons_abspaths as $icon_abspath) {\n $icons[] = new \\Imagick($icon_abspath);\n }\n\n $tear_down = function ($return) use (&$sprite, $icons) {\n foreach($icons as $icon) {\n $icon->clear();\n $icon->destroy();\n }\n $sprite->clear();\n $sprite->destroy();\n return $return;\n };\n\n // calculate dimensions\n $max_width = $max_height = 0;\n foreach($icons as $icon) {\n $max_height = max($max_height, $icon->getImageHeight());\n $max_width = max($max_width, $icon->getImageWidth());\n }\n $sprite_width = $max_width + ($padding * 2);\n $sprite_height = $max_height + ($padding * 2);\n if ($orientation == 'landscape') {\n $sprite_width *= count($icons);\n } else {\n $sprite_height *= count($icons);\n }\n\n // check if we really need to do this\n $sprite_mtime = file_exists($sprite_abspath) ? filemtime($sprite_abspath):0;\n $icons_mtime = 0;\n\n foreach($icons_abspaths as $icon_abspath) {\n $icons_mtime = max($icons_mtime, filemtime($icon_abspath));\n }\n\n if ($sprite_mtime >= $icons_mtime) {\n $sprite_size = getimagesize($sprite_abspath);\n if ($sprite_size[0] == $sprite_width && $sprite_size[1] == $sprite_height) {\n return $tear_down(array(\n 'box_height' => $max_height,\n 'box_width' => $max_width,\n 'sprite_height' => $sprite_height,\n 'sprite_width' => $sprite_width,\n ));\n }\n }\n\n // compose the sprite\n $sprite->newImage($sprite_width, $sprite_height, new \\ImagickPixel('transparent'));\n\n foreach($icons as $n => $icon) {\n $x = $y = $padding;\n $x += round(($max_height - $icon->getImageHeight())/2);\n $y += round(($max_width - $icon->getImageWidth())/2);\n $cumulative_padding = $n * $padding * 2;\n if ($orientation == 'landscape') {\n $x += ($n * $max_width) + $cumulative_padding;\n } else {\n $y += ($n * $max_height) + $cumulative_padding;\n }\n $sprite->compositeImage($icon, \\Imagick::COMPOSITE_COPY, $x, $y);\n }\n $sprite->setImageCompressionQuality(100);\n $sprite->writeImage($sprite_abspath);\n\n return $tear_down(array(\n 'box_height' => $max_height + ($padding * 2),\n 'box_width' => $max_width + ($padding * 2),\n 'icon_height' => $max_height,\n 'icon_width' => $max_width,\n 'sprite_height' => $sprite_height,\n 'sprite_width' => $sprite_width,\n ));\n\n}", "protected function imageProcess($value) {\n if (static::isArrayNumeric($value)) {\n $output = array();\n foreach ($value as $item) {\n $output[] = $this->imageProcess($item);\n }\n return $output;\n }\n return array(\n 'id' => $value['fid'],\n 'self' => file_create_url($value['uri']),\n 'filemime' => $value['filemime'],\n 'filesize' => $value['filesize'],\n 'width' => $value['width'],\n 'height' => $value['height'],\n 'styles' => $value['image_styles'],\n );\n }", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "function storeImages()\n {\n }", "abstract protected function paths();" ]
[ "0.71595985", "0.68345433", "0.67023957", "0.6509673", "0.6453629", "0.6415463", "0.62737244", "0.61988723", "0.61672896", "0.6140493", "0.6051794", "0.6050297", "0.6038673", "0.6007389", "0.5968761", "0.5933317", "0.59270424", "0.59164745", "0.58583045", "0.58471507", "0.5838943", "0.5817081", "0.5814074", "0.5790774", "0.57834285", "0.57511395", "0.57511264", "0.5748118", "0.57440925", "0.5716752", "0.569831", "0.5694144", "0.5690354", "0.5675726", "0.56666726", "0.5647795", "0.5643315", "0.563073", "0.5626338", "0.5621043", "0.5613201", "0.5602177", "0.5595831", "0.5592707", "0.557887", "0.5574234", "0.5564351", "0.55612606", "0.5559261", "0.55495775", "0.5536794", "0.55212075", "0.55069566", "0.55054647", "0.55026764", "0.5494845", "0.5492941", "0.5488892", "0.5488663", "0.54850024", "0.54831046", "0.5466338", "0.5461636", "0.54595286", "0.5459464", "0.54580915", "0.5446739", "0.54465306", "0.54383796", "0.54297423", "0.54237735", "0.542372", "0.5404674", "0.5402322", "0.5402125", "0.5399219", "0.53903884", "0.53857744", "0.53835094", "0.53816134", "0.5373165", "0.53712016", "0.53634906", "0.5356703", "0.5355594", "0.5330082", "0.5328048", "0.53259975", "0.5312546", "0.5310799", "0.5308951", "0.53017086", "0.5296046", "0.52952963", "0.5288143", "0.5285908", "0.52857363", "0.52791554", "0.5269287", "0.52685183" ]
0.560764
41
Checks and Resizes image
function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) { // Get image type $image_info = getimagesize($old_image_path); $image_type = $image_info[2]; // Set up the function names switch ($image_type) { case IMAGETYPE_JPEG: $image_from_file = 'imagecreatefromjpeg'; $image_to_file = 'imagejpeg'; break; case IMAGETYPE_GIF: $image_from_file = 'imagecreatefromgif'; $image_to_file = 'imagegif'; break; case IMAGETYPE_PNG: $image_from_file = 'imagecreatefrompng'; $image_to_file = 'imagepng'; break; default: return; } // ends the swith // Get the old image and its height and width $old_image = $image_from_file($old_image_path); $old_width = imagesx($old_image); $old_height = imagesy($old_image); // Calculate height and width ratios $width_ratio = $old_width / $max_width; $height_ratio = $old_height / $max_height; // If image is larger than specified ratio, create the new image if ($width_ratio > 1 || $height_ratio > 1) { // Calculate height and width for the new image $ratio = max($width_ratio, $height_ratio); $new_height = round($old_height / $ratio); $new_width = round($old_width / $ratio); // Create the new image $new_image = imagecreatetruecolor($new_width, $new_height); // Set transparency according to image type if ($image_type == IMAGETYPE_GIF) { $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127); imagecolortransparent($new_image, $alpha); } if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) { imagealphablending($new_image, false); imagesavealpha($new_image, true); } // Copy old image to new image - this resizes the image $new_x = 0; $new_y = 0; $old_x = 0; $old_y = 0; imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height); // Write the new image to a new file $image_to_file($new_image, $new_image_path); // Free any memory associated with the new image imagedestroy($new_image); } else { // Write the old image to a new file $image_to_file($old_image, $new_image_path); } // Free any memory associated with the old image imagedestroy($old_image); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function imageCheck($target,$width=1,$height=1){\n if($width==1&&$height==1){\n return is_array(getimagesize($target));\n }else{\n $rvalue = false;\n if(is_array(getimagesize($target))){\n try {\n $img = new Imagick($target);\n if(strtoupper($img->getImageFormat())=='GIF'){\n $img = $img->coalesceImages();\n $img = $img->coalesceImages();\n do {\n if($width==0||$height==0)\n $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1);\n else $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1,true);\n } while ($img->nextImage());\n $img = $img->deconstructImages();\n $img->writeImages($target,true);\n }else{\n if($width==0||$height==0)\n $img->thumbnailImage($width, $height);\n else $img->thumbnailImage($width, $height,true);\n $img->writeImage($target);\n }\n $img->destroy();\n $rvalue = true;\n } catch (Exception $e) {\n }\n }\n return $rvalue;\n }\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }", "function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}", "public function testResizeIfNeededNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/tall-image.jpg', true);\n $this->assertTrue($resized);\n }", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function resizeImage($file, $desfile, $size, $imgobj) {\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_resizeImageIM($file, $desfile, $size))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_resizeImageNETPBM($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_resizeImageGD1($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_resizeImageGD2($file, $desfile, $size, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "protected function scaleImages() {}", "function has_image_size($name)\n {\n }", "public function test_resize_and_crop() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50, true );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 100,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}", "private function needsResizing(Image $image)\n {\n return $image->width() > $this->maxWidth || $image->height() > $this->maxHeight;\n }", "public function test_resize() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 75,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "function _resizeImageIM($src_file, $dest_file, $new_size) {\r\n \t$retval = $output = null;\r\n $cmd = $this->_IM_path.\"convert -resize $new_size \\\"$src_file\\\" \\\"$dest_file\\\"\";\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function ajax_check_banner_image_size() {\n \n $path = $_FILES['banner_image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION); \n \n $allowTypes = array('jpg','jpeg','gif','png');\n if(in_array(strtolower($ext),$allowTypes)){\n list($w, $h) = getimagesize($_FILES[\"banner_image\"][\"tmp_name\"]);\n if ($w == 1346 && $h == 660) echo 'Success'; else echo 'Error';\n } else {\n echo 'File_Ext_Err';\n }\n }", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "public function check_image_sizes($image_file){\n\t\t\t$error['error_exists'] = false;\n\t\t\t$error['error_message'] = false;\n\t\t\t\n\t\t\t//if the image file is not there then show error\n\t\t\tif (!isset($image_file) || $image_file == null){\n\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist'];\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$image_size = getimagesize($image_file);\n\n\t\t\t\t$width = $image_size[0];\n\t\t\t\t$height = $image_size[1];\n\t\t\t\t\n\t\t\t\t//must be greater than a certain dimension\n\t\t\t\tif ($width < $this->file_uploading_settings['min_height_width'] || $height < $this->file_uploading_settings['min_height_width']){\n\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['min_image_size_error'];\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//must be smaller than a certain dimension -> no need to do if config set to 0 -> 0 = unlimited\n\t\t\t\tif ($this->file_uploading_settings['max_width'] > 0){\n\t\t\t\t\tif ($width > $this->file_uploading_settings['max_width']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->file_uploading_settings['max_height'] > 0){\n\t\t\t\t\tif ($height > $this->file_uploading_settings['max_height']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\treturn $error;\n\n\n\t\t\t\n\t\t}", "function calc_size()\n\t{\n\t\t\t$size = getimagesize(ROOT_PATH . $this->file);\n\t\t\t$this->width = $size[0];\n\t\t\t$this->height = $size[1];\n\t}", "public function sizeImg($width, $height, $crop = true);", "public function test_resize() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "public function test_resize_and_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50, true );\n\n\t\t$this->assertEquals( array( 'width' => 100, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}", "function refreshImageSize() {\n\t\tif($this->intTableKeyValue != \"\") {\n\t\t\tif ( $this->arrObjInfo['imageurl'] ) {\n\t\t\t\tif($this->arrObjInfo['imagewidth'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imagewidth'] = $imageSize[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->arrObjInfo['imageheight'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imageheight'] = $imageSize[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "public function resize_fit(IImageInformation $src, $width, $height);", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }", "function reduce_image(string $fileName, string $targetFile, int $maxWidth, int $maxHeight, string $outFormat = \"image/png\", string $img_string=\"\") : bool{\n\t\n\t//Check if we have to reduce physical image or an image contained in a variable\n\tif($fileName != \"string\"){\n\n\t\t//Check if image exists or not\n\t\tif(!file_exists($fileName))\n\t\t\treturn false;\n\t\t\n\t\t//Try to get image size\n\t\tif(!$imageInfos = getimagesize($fileName))\n\t\t\treturn false; //File doesn't seems to be an image\n\n\t}\n\telse {\n\t\t//Get informations about the image in the string\n\t\tif(!$imageInfos = getimagesizefromstring($img_string))\n\t\t\treturn false; //Couldn't create image\n\t}\n\n\t//Extract image width and height\n\t$width = $imageInfos[0];\n\t$height = $imageInfos[1];\n\n\t//Check image size\n\tif($width == 0 || $height == 0)\n\t\treturn false; //Can't process such image\n\n\t//Try to open image\n\tif($fileName === \"string\")\n\t\t$src = imagecreatefromstring($img_string);\n\telseif($imageInfos['mime'] === \"image/png\")\n\t\t$src = imagecreatefrompng($fileName);\n\telseif($imageInfos['mime'] === \"image/jpeg\")\n\t\t$src = imagecreatefromjpeg($fileName);\n\telseif($imageInfos['mime'] === \"image/gif\")\n\t\t$src = imagecreatefromgif($fileName);\n\t//elseif($imageInfos['mime'] === \"image/x-ms-bmp\")\n\t//\t$src = imagecreatefrombmp($fileName);\n\telse\n\t\treturn false; //Unrecognized image type\n\t\n\t//Check if image size can be kept as is\n\tif($width <= $maxWidth AND $height <= $maxHeight){\n\t\t//We keep the same dimensions\n\t\t$newWidth = $width;\n\t\t$newHeight = $height;\n\t}\n\telseif($width > $maxWidth){\n\t\t$newWidth = $maxWidth;\n\t\t$newHeight = floor(($height*$maxWidth)/$width);\n\t}\n\telse {\n\t\t$newHeight = $maxHeight;\n\t\t$newWidth = floor(($width*$maxHeight)/$height);\n\t}\n\n\t//Create reduced image\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\n\t//Copy image\n\timagecopyresized($dest, $src, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\n\t//Try to export image\n\t//PNG\n\tif($outFormat === \"image/png\"){\n\t\tif(!imagepng($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//JPEG\n\telseif($outFormat === \"image/jpeg\"){\n\t\tif(!imagejpeg($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//UNSUPPORTED\n\telse\n\t\treturn false; //Unkown export format\n\n\t//Success\n\treturn true;\n}", "function _resizeImageGD2($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD can only handle JPG, PNG & GIF images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n \t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n } else {\r\n \t$src_img = @imagecreatefromgif($src_file);\r\n \t$dst_img = imagecreatetruecolor($destWidth,$destHeight);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $dest_file);\r\n } else {\r\n \timagegif($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "public function fileNeedsProcessing()\n {\n // @todo Implement fileNeedsProcessing() method.\n\n /**\n * Checks to perform:\n * - width/height smaller than image, keeping aspect ratio?\n */\n }", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "public static function set_image_size() {\n $size = get_option( 'yith_woocompare_image_size' );\n\n if( ! $size ) {\n return;\n }\n\n $size['crop'] = isset( $size['crop'] ) ? true : false;\n add_image_size( 'yith-woocompare-image', $size['width'], $size['height'], $size['crop'] );\n }", "function __resize(&$tmp, $width, $height) {\n\t\t\n\t\t// call `convert -geometry`\n\t\t//\n\t\t$cmd = $this->__command(\n\t\t\t'convert',\n \t\"-geometry {$width}x{$height}! \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t\t. \" \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t);\n\n exec($cmd, $result, $errors);\n\t\treturn ($errors == 0);\n\t\t}", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "private function makeImageSize(): void\n {\n list($width, $height) = getimagesize($this->getUrl());\n $size = array('height' => $height, 'width' => $width );\n\n $this->width = $size['width'];\n $this->height = $size['height'];\n }", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function resize($src_file, $dest_file, $new_size, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n // height/width\n $ratio = max($img_meta['width'], $img_meta['height']) / $new_size;\n $ratio = max($ratio, 1.0);\n $destWidth = (int)($img_meta['width'] / $ratio);\n $destHeight = (int)($img_meta['height'] / $ratio);\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not convert image.');\n }\n $dst_img = imagecreate($destWidth, $destHeight);\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight,\n $img_meta['width'], $img_meta['height']);\n\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function image_process_gd($action = 'resize')\n\t{\t\n\t\t$v2_override = FALSE;\n\t\t\t\n\t\tif ($action == 'crop')\n\t\t{\n\t\t\t// If the target width/height match the source then it's pointless to crop, right?\n\t\t\n\t\t\tif ($this->dst_width >= $this->src_width AND $this->dst_height >= $this->src_width)\n\t\t\t{\n\t\t\t\t// We'll return true so the user thinks the process succeeded.\n\t\t\t\t// It'll be our little secret...\n\n\t\t\t\treturn TRUE; \n\t\t\t}\n\t\t\t\n\t\t\t// Reassign the source width/height if cropping\n\t\t\t\n\t\t\t$this->src_width = $this->dst_width;\n\t\t\t$this->src_height = $this->dst_height;\t\n\t\t\t\t\n\t\t\t// GD 2.0 has a cropping bug so we'll test for it\n\t\t\t\n\t\t\tif ($this->gd_version() !== FALSE)\n\t\t\t{\n\t\t\t\t$gd_version = str_replace('0', '', $this->gd_version());\t\t\t\n\t\t\t\t$v2_override = ($gd_version == 2) ? TRUE : FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the target width/height match the source, AND if\n\t\t\t// the new file name is not equal to the old file name\n\t\t\t// we'll simply make a copy of the original with the new name\t\t\n\t\t\n\t\t\tif (($this->src_width == $this->dst_width AND $this->src_height == $this->dst_height) AND ($this->file_name != $this->new_file_name))\n\t\t\t{\n\t\t\t\tif ( ! @copy($this->full_src_path, $this->full_dst_path))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error('imglib_copy_failed');\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\t\n\t\t\t// If resizing the x/y axis must be zero\n\t\t\t\n\t\t\t$this->x_axis = 0;\n\t\t\t$this->y_axis = 0;\n\t\t}\n\t\t\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Create the image handle\n\t\t/** ---------------------------------*/\n\t\t\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/** Create The Image\n\t\t/** ---------------------------------*/\n\t\t\t\t\n\t\tif ($this->resize_protocol == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE)\n\t\t{\n\t\t\t$create\t= 'imagecreatetruecolor';\n\t\t\t$copy\t= 'imagecopyresampled';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$create\t= 'imagecreate';\t\n\t\t\t$copy\t= 'imagecopyresized';\n\t\t}\n\n\t\t$dst_img = $create($this->dst_width, $this->dst_height); \n\t\t\n\t\t$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->dst_width, $this->dst_height, $this->src_width, $this->src_height); \n\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($dst_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($dst_img); \n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "function oniros_image_support(){\n\t// add as many as the project might require\n\t// smaller images do not get resized, but largeones will get cropped.\n\n\t// name width height crop?\n\tadd_image_size( 'image_size_name', 400, 400, true);\n}", "function resizeImage($CurWidth, $CurHeight, $MaxSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//Construct a proportional size of new image\n\t$ImageScale\t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \n\t$NewWidth\t= ceil($ImageScale*$CurWidth);\n\t$NewHeight\t= ceil($ImageScale*$CurHeight);\n\t\n\tif($CurWidth < $NewWidth || $CurHeight < $NewHeight)\n\t{\n\t\t$NewWidth = $CurWidth;\n\t\t$NewHeight = $CurHeight;\n\t}\n\t$NewCanves \t= imagecreatetruecolor($NewWidth, $NewHeight);\n\t// Resize Image\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n\n}", "function ImageUpload($imagefieldname, $savename, $maxheight, $maxwidth, $minheight, $minwidth) {\r\n global $imageuploaddir, $imageuploadmaxsize, $debuglog;\r\n // first 2 globals are only retrieved for use here, debuglog is to append error messages\r\n $imagedir = $imageuploaddir;\r\n $thiserror = \"\";\r\n $uploadedfile_name = $_FILES[$imagefieldname]['name'];\r\n $uploadedfile_tmp = $_FILES[$imagefieldname]['tmp_name'];\r\n $uploadedfile_size = $_FILES[$imagefieldname]['size'];\r\n $uploadedfile_type = $_FILES[$imagefieldname]['type'];\r\n if ($uploadedfile_size > $imageuploadmaxsize) {\r\n $thiserror .= \"Error: Uploaded image size must be less than \" . $imageuploadmaxsize/1000000 . \" MB!<br />\";\r\n } else {\r\n if (isset($_FILES[$imagefieldname]['name'])) {\r\n $temp_img = $imagedir.'tmp_'.$savename;\r\n $prod_img = $imagedir.$savename;\r\n move_uploaded_file($uploadedfile_tmp, $temp_img);\r\n chmod ($temp_img, octdec('0666'));\r\n $sizes = getimagesize($temp_img);\r\n if ($sizes[0] == 0 || $sizes[1] == 0) { $imageszerror = \"Y\"; $imageulerror = \"Y\"; }\r\n else {\r\n $aspect_ratio = $sizes[1]/$sizes[0];\r\n if ($sizes[1] <= $maxheight) { $new_width = $sizes[0]; $new_height = $sizes[1]; }\r\n else { $new_height = $maxheight; $new_width = abs($new_height/$aspect_ratio); }\r\n if ($new_width <= $maxwidth) { $new_width = $new_width; $new_height = $new_height; }\r\n else { $new_width = $maxwidth; $new_height = abs($new_width*$aspect_ratio); }\r\n $destimg=ImageCreateTrueColor($new_width,$new_height);\r\n }\r\n $debuglog .= \"W: $new_width H: $new_height (After Max Adjustment)<br />\\n\";\r\n if ($uploadedfile_type == \"image/jpeg\" || $uploadedfile_type == \"image/pjpeg\") { $srcimg=ImageCreateFromJPEG($temp_img); }\r\n else if ($uploadedfile_type == \"image/gif\") { $srcimg=ImageCreateFromGIF($temp_img); }\r\n else if ($uploadedfile_type == \"image/png\" || $uploadedfile_type == \"image/x-png\") { $srcimg=ImageCreateFromPNG($temp_img); }\r\n else if ($uploadedfile_type == \"image/bmp\") { $srcimg=ImageCreateFromBMP($temp_img); }\r\n else {\r\n $imageulerror = \"Y\";\r\n if ($imageszerror == \"Y\") { $thiserror .= \"Error: Uploaded file has 0 for either height or length!<br />\"; }\r\n $thiserror .= \"Error: $uploadedfile_type used.<br>Only GIF, JPEG, PNG, and Windows BMP files allowed!<br />\";\r\n }\r\n if ($imageulerror != \"Y\") {\r\n if(function_exists('imagecopyresampled')) {\r\n imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n } else {\r\n Imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n }\r\n }\r\n if ($srcimg) {\r\n // Fix for minimum width and height\r\n if ($new_width < $minwidth || $new_height < $minheight) {\r\n if ($new_height < $minheight) {\r\n $newy = intval(($minheight-$new_height)/2);\r\n $thisheight = $minheight;\r\n } else {\r\n $newy = 0;\r\n $thisheight = $new_height;\r\n }\r\n if ($new_width < $minwidth) {\r\n $newx = intval(($minwidth-$new_width)/2);\r\n $thiswidth = $minwidth;\r\n } else {\r\n $newx = 0;\r\n $thiswidth = $new_width;\r\n }\r\n $debuglog .= \"W: $thiswidth H: $thisheight (After Min Adjustment)<br />\\n\";\r\n $destimg=imagecreatetruecolor($thiswidth, $thisheight);\r\n $bk=imagecolorallocate($destimg, 255, 255, 255);\r\n imagefill($destimg,0,0,$bk);\r\n imagecopy($destimg, $srcimg, $newx, $newy, 0, 0, $new_width, $new_height);\r\n }\r\n // Sharpen image\r\n $sharpenmatrix = array(\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n array(-1.0, 28, -1.0), // array(-1, 16, -1),\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n );\r\n $sharpendivisor = array_sum(array_map('array_sum', $sharpenmatrix));\r\n imageconvolution($destimg, $sharpenmatrix, $sharpendivisor, 0);\r\n // Finally output production image\r\n ImageJPEG($destimg,$prod_img,95);\r\n }\r\n if ($imageulerror != \"Y\") { imagedestroy($destimg); }\r\n if (file_exists($temp_img)) { unlink($temp_img); }\r\n }\r\n }\r\n if ($imageulerror != \"Y\") { $success = \"Y\"; } else { $success = \"N|$thiserror\"; }\r\n return $success;\r\n}", "public function processImage($path_to_image,$ar_size)\r\n\t{\r\n\t\t$config['image_library'] \t= 'gd';\r\n\t\t$config['source_image'] \t= $path_to_image;\r\n\t\t$config['create_thumb'] \t= FALSE;\r\n\t\t$config['maintain_ratio'] \t= FALSE;\r\n\t\t$config['width'] \t\t\t= $ar_size['width'];\r\n\t\t$config['height'] \t\t\t= $ar_size['height'];\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$this->load->library('image_lib', $config);\r\n\t\t\r\n\t\tif ( ! $this->image_lib->resize())\r\n\t\t{\r\n \t\techo $this->image_lib->display_errors();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function smart_resize_image($file, $string = null, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false, $quality = 100, $grayscale = false\n) {\n\n if ($height <= 0 && $width <= 0)\n return false;\n if ($file === null && $string === null)\n return false;\n\n # Setting defaults and meta\n $info = $file !== null ? getimagesize($file) : getimagesizefromstring($string);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n $cropHeight = $cropWidth = 0;\n\n # Calculating proportionality\n if ($proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n }\n else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n $widthX = $width_old / $width;\n $heightX = $height_old / $height;\n\n $x = min($widthX, $heightX);\n $cropWidth = ($width_old - $width * $x) / 2;\n $cropHeight = ($height_old - $height * $x) / 2;\n }\n\n # Loading image to memory according to type\n switch ($info[2]) {\n case IMAGETYPE_JPEG: $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_GIF: $file !== null ? $image = imagecreatefromgif($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_PNG: $file !== null ? $image = imagecreatefrompng($file) : $image = imagecreatefromstring($string);\n break;\n default: return false;\n }\n\n # Making the image grayscale, if needed\n if ($grayscale) {\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n }\n\n # This is the resizing/resampling/transparency-preserving magic\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $transparency = imagecolortransparent($image);\n $palletsize = imagecolorstotal($image);\n\n if ($transparency >= 0 && $transparency < $palletsize) {\n $transparent_color = imagecolorsforindex($image, $transparency);\n $transparency = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n imagefill($image_resized, 0, 0, $transparency);\n imagecolortransparent($image_resized, $transparency);\n } elseif ($info[2] == IMAGETYPE_PNG) {\n imagealphablending($image_resized, false);\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n imagefill($image_resized, 0, 0, $color);\n imagesavealpha($image_resized, true);\n }\n }\n imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight);\n\n\n # Taking care of original, if needed\n if ($delete_original) {\n if ($use_linux_commands)\n exec('rm ' . $file);\n else\n @unlink($file);\n }\n\n # Preparing a method of providing result\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n\n # Writing image according to type to the output destination and image quality\n switch ($info[2]) {\n case IMAGETYPE_GIF: imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, $quality);\n break;\n case IMAGETYPE_PNG:\n $quality = 9 - (int) ((0.9 * $quality) / 10.0);\n imagepng($image_resized, $output, $quality);\n break;\n default: return false;\n }\n\n return true;\n}", "public function resize(IImageInformation $src, $width, $height);", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "public function _set_new_size_auto()\n {\n if (empty($this->source_width) || empty($this->source_height)) {\n if ( ! $this->SILENT_MODE) {\n trigger_error('Missing source image sizes!', E_USER_WARNING);\n }\n return false;\n }\n $k1 = $this->source_width / $this->limit_x;\n $k2 = $this->source_height / $this->limit_y;\n $k = $k1 >= $k2 ? $k1 : $k2;\n if ($this->reduce_only && $k1 <= 1 && $k2 <= 1) {\n $this->output_width = $this->source_width;\n $this->output_height = $this->source_height;\n } else {\n $this->output_width = round($this->source_width / $k, 0);\n $this->output_height = round($this->source_height / $k, 0);\n }\n return true;\n }", "function __checkDimensions($filePath) {\n\t\t$size = getimagesize($filePath);\n\t\t\t\t\n\t\tif(!$size) {\n\t\t\t$this->Session->setFlash('We could not check that image\\'s size, so we can\\'t upload it.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\n\t\tif($size[0] > 800 || $size[1] > 800) {\n\t\t\t$this->Session->setFlash('Images cannot be any larger than 800 by 800 pixels.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t\t\n\t}", "public function save() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n $ext = $this->getImageExt();\n $quality = $this->__imageQuality;\n $dirSavePath = dirname($this->__imageSavePath);\n \n if (empty($this->__imageSavePath) || !is_dir($dirSavePath)) {\n $this->setError(__d('cloggy','Image save path not configured or maybe not exists.'));\n } else { \n \n /*\n * create resized image\n */\n switch($ext) {\n \n case 'jpg':\n case 'jpeg':\n\n if (imagetypes() & IMG_JPG) {\n @imagejpeg($this->__imageResized,$this->__imageSavePath,$quality); \n }\n\n break;\n\n case 'gif':\n\n if (imagetypes() & IMG_GIF) {\n @imagegif($this->__imageResized,$this->__imageSavePath); \n }\n\n break;\n\n case 'png':\n\n $scaleQuality = round($this->__imageQuality/100) * 9;\n $invertScaleQuality = 9 - $scaleQuality;\n\n if (imagetypes() & IMG_PNG) {\n @imagepng($this->__imageResized,$this->__imageSavePath,$invertScaleQuality); \n }\n\n break;\n\n } \n \n } \n \n /*\n * destroy resized image\n */\n if ($this->__imageResized) {\n \n //destroy resized image\n imagedestroy($this->__imageResized);\n \n } \n \n }\n \n }", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "protected function fitMagic(): void\n {\n $this->image->fit($this->fitWidth, $this->fitHeight, function ($constraint) {\n $constraint->upsize();\n });\n }", "public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function image_size_input_fields($post, $check = '')\n {\n }", "function _resizeImageNETPBM($src_file, $des_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"pnmtopng > $des_file\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $des_file\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $des_file\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function resizeImage($fileName, $newWidth = 100 , $newHeight = 100, $cropType = 0, $outputFileName = \"\", $quality = 75){\r\n $imgCreateFun=array(1 => \"imagecreatefromgif\", 2 => \"imagecreatefromjpeg\", 3 => \"imagecreatefrompng\");\r\n $imgOutputFun=array(1 => \"imagegif\", 2 => \"imagejpeg\", 3 => \"imagepng\");\r\n \r\n if(file_exists($fileName)){\r\n $myFileInfo = getimagesize($fileName);\r\n $imgWidth = $myFileInfo[0];\r\n $imgHeight = $myFileInfo[1];\r\n \r\n $resCords = getPropSizes($imgWidth, $imgHeight, $newWidth, $newHeight, $cropType);\r\n \r\n $imgType = $myFileInfo[2];\r\n if(in_array($imgType,array_keys($imgCreateFun))){\r\n $image_p = imagecreatetruecolor($newWidth, $newHeight);\r\n $image = $imgCreateFun[$imgType]($fileName);\r\n imagecopyresampled($image_p, $image, 0, 0, $resCords[\"srcX\"], $resCords[\"srcY\"], $newWidth, $newHeight, $resCords[\"srcW\"], $resCords[\"srcH\"]); \r\n if(!file_exists($outputFileName)){\r\n if(!$outputFileName){\r\n header(\"Content-type: \".$myFileInfo[\"mime\"]);\r\n }\r\n $imgOutputFun[$imgType]($image_p, $outputFileName, $quality);\r\n imagedestroy($image_p);\r\n imagedestroy($image); \r\n }\r\n else{\r\n imagedestroy($image_p);\r\n imagedestroy($image);\r\n die(\"Cannot write output image - Filename already exists\");\r\n }\r\n \r\n }\r\n else{\r\n die(\"Image Type not supported\");\r\n }\r\n }\r\n else{\r\n die(\"Source file not found\");\r\n }\r\n}", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "public function CalcWidthHeight()\n {\n list($this->width, $this->height) = $this->imgInfo;\n\n $aspectRatio = $this->width / $this->height;\n\n if($this->cropToFit && $this->newWidth && $this->newHeight) {\n $targetRatio = $this->newWidth / $this->newHeight;\n $this->cropWidth = $targetRatio > $aspectRatio ? $this->width : round($this->height * $targetRatio);\n $this->cropHeight = $targetRatio > $aspectRatio ? round($this->width / $targetRatio) : $this->height;\n if($this->verbose) { self::verbose(\"Crop to fit into box of {$this->newWidth}x{$this->newHeight}. Cropping dimensions: {$this->cropWidth}x{$this->cropHeight}.\"); }\n }\n else if($this->newWidth && !$this->newHeight) {\n $this->newHeight = round($this->newWidth / $aspectRatio);\n if($this->verbose) { self::verbose(\"New width is known {$this->newWidth}, height is calculated to {$this->newHeight}.\"); }\n }\n else if(!$this->newWidth && $this->newHeight) {\n $this->newWidth = round($this->newHeight * $aspectRatio);\n if($this->verbose) { self::verbose(\"New height is known {$this->newHeight}, width is calculated to {$this->newWidth}.\"); }\n }\n else if($this->newWidth && $this->newHeight) {\n $ratioWidth = $this->width / $this->newWidth;\n $ratioHeight = $this->height / $this->newHeight;\n $ratio = ($ratioWidth > $ratioHeight) ? $ratioWidth : $ratioHeight;\n $this->newWidth = round($this->width / $ratio);\n $this->newHeight = round($this->height / $ratio);\n if($this->verbose) { self::verbose(\"New width & height is requested, keeping aspect ratio results in {$this->newWidth}x{$this->newHeight}.\"); }\n }\n else {\n $this->newWidth = $this->width;\n $this->newHeight = $this->height;\n if($this->verbose) { self::verbose(\"Keeping original width & heigth.\"); }\n }\n }", "function logonscreener_image_is_valid($info) {\n $valid = $info['width'] == $GLOBALS['screen_width']\n && $info['height'] == $GLOBALS['screen_height']\n && $info['extension'] == 'jpeg'\n && $info['file_size'] <= LOGONSCREENER_MAX_FILESIZE;\n\n if ($valid) {\n logonscreener_log('Image is valid with no further transformation.');\n }\n\n return $valid;\n}", "public function isValid() {\n if ($this->advanced) {\n $this->image = imagecreatefromstring($this->image);\n }\n\n if (!$this->checkFiletype()) {\n trigger_error('Image format is invalid', E_USER_ERROR);\n failed(WEBROOT . '/', 'Image format is invalid');\n return false;\n }\n if ($this->isVideo) {\n $videoAtts = $this->getVideoAttributes();\n $width = $videoAtts['width'];\n $height = $videoAtts['height'];\n if ($width != $height) {\n trigger_error('Video is not 1:1 aspect ratio', E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is not 1:1 aspect ratio');\n return false;\n }\n if ($width < MINIMAGESIZE) {\n trigger_error('Video is smaller than ' . MINIMAGESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is smaller than ' . MINIMAGESIZE);\n return false;\n }\n \n $filesize = filesize($this->image);\n $maxFilesize = Helper::getInstance()->convertToBytes(MAXVIDEOFILESIZE, 'mb');\n if ($filesize > $maxFilesize) {\n trigger_error('Video is too large, max filesize is ' . MAXVIDEOFILESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is too large, max filesize is ' . MAXVIDEOFILESIZE);\n return false;\n }\n } else if ($this->filetype == 'svg') {\n \n } else {\n if ($this->advanced) {\n $width = imagesx($this->image);\n $height = imagesy($this->image);\n } else {\n $imageSize = getimagesize($this->image);\n $width = $imageSize[0];\n $height = $imageSize[1];\n }\n if ($width != $height) {\n trigger_error('Image is not 1:1 aspect ratio', E_USER_ERROR);\n failed(WEBROOT . '/', 'Image is not 1:1 aspect ratio');\n return false;\n }\n if ($width < MINIMAGESIZE) {\n trigger_error('Image is smaller than ' . MINIMAGESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Image is smaller than ' . MINIMAGESIZE);\n return false;\n }\n }\n \n return true;\n }", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "public function testResizeIfNeededNotNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/small-image.jpg', true);\n $this->assertFalse($resized);\n\n // wide image to be resized\n $resized = Processor::resizeIfNeeded('/app/tests/wide-image.jpg', true);\n $this->assertTrue($resized);\n }", "public function resizeImage($file, $mime, $maxWidth=-1, $maxHeight=-1) {\n\t\tif ($maxWidth == -1 && $maxHeight == -1) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t//rely on GD\n\t\tif (!function_exists('imagecreate')) { return; }\n/*\n\t\tif ($this->dataItem->mime == '') {\n\t\t\t$this->figureMime();\n\t\t} else {\n\t\t\t$this->mimeType = $this->dataItem->mime;\n\t\t}\n\n\t\t$tmpfname = tempnam('/tmp/', \"cgnimg_\");\n\t\t$si = fopen($tmpfname, \"w+b\");\n*/\n\n\t\tswitch ($mime) {\n\t\t\tcase 'image/png':\n\t\t\t$orig = imageCreateFromPng($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/jpg':\n\t\t\t$orig = imageCreateFromJpeg($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/gif':\n\t\t\t$orig = imageCreateFromGif($file);\n\t\t\tbreak;\n\t\t}\n\t\tif (!$orig) { \n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = imageSx($orig);\n\t\t$height = imageSy($orig);\n\t\tif ($width > $maxWidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $maxWidth / $width;\n\t\t\t$newwidth = $maxWidth;\n\t\t\t$newheight = $height * $ratio;\n\t\t} else {\n\t\t\t$newwidth = $width;\n\t\t\t$newheight = $height;\n\t\t}\n\n\t\t$thumbwidth = 50;\n\t\t$thumbheight = 50;\n\n\t\tif ($width > $thumbwidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $thumbwidth / $width;\n\t\t\t$new2width = $thumbwidth;\n\t\t\t$new2height = intval($height * $ratio);\n\t\t} else {\n\t\t\t//Check if image is really tall and thin.\n\t\t\t//Don't do this for the medium size image because \n\t\t\t// vertically tall images aren't a problem for most layouts.\n\t\t\tif ($height > $thumbheight) {\n\t\t\t\t$ratio = $thumbheight / $height;\n\t\t\t\t$new2height = $thumbheight;\n\t\t\t\t$new2width = intval($width * $ratio);\n\t\t\t} else {\n\t\t\t\t//use defaults, image is small enough \n\t\t\t\t$new2width = $width;\n\t\t\t\t$new2height = (int)$height;\n\t\t\t}\n\t\t}\n\t\t$webImage = imageCreateTrueColor($newwidth,$newheight);\n\t\tif (!$webImage) { die('no such handle');}\n\t\timageCopyResampled(\n\t\t\t$webImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$newwidth, $newheight,\n\t\t\t$width, $height);\n\n\n\n\t\t$thmImage = imageCreateTrueColor($new2width,$new2height);\n\t\timageCopyResampled(\n\t\t\t$thmImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$new2width, $new2height,\n\t\t\t$width, $height);\n\n/*\nheader('Content-type: image/png');\nimagePng($thmImage);\nexit();\n */\n\t\t$dir = dirname($file);\n\t\t$base = basename($file);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $webImage, $dir.'/w'.$base.'.png', 6);\n\n//\t\t$this->dataItem->web_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($webImage);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $thmImage, $dir.'/t'.$base.'.png', 6 );\n//\t\t$this->dataItem->thm_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($thmImage);\n\t}", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Construct a proportional size of new image\r\n\t$ImageScale \t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \r\n\t$NewWidth \t\t\t= ceil($ImageScale*$CurWidth);\r\n\t$NewHeight \t\t\t= ceil($ImageScale*$CurHeight);\r\n\t$NewCanves \t\t\t= imagecreatetruecolor($NewWidth, $NewHeight);\r\n\t\r\n\t// Resize Image\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\t}\r\n\r\n}", "public static function ScaleThumbnailSizes($image, $maxwidth = -1, $maxheight = -1,\n $behaviour = 1, $upscale = false)\n {\n if(empty($image) ||\n (is_string($image) && !is_file($image)) ||\n !is_resource($image) )\n return false;\n\n if(is_string($image))\n {\n list($width, $height) = @getimagesize($image);\n $maxwidth = intval($maxwidth);\n $maxheight = intval($maxheight);\n }\n else\n {\n $maxwidth = $width = imagesx($image);\n $maxheight = $height = imagesy($image);\n }\n $maxwidth = Is_Valid_Number($maxwidth,0,1,SD_MEDIA_MAX_DIM);\n $maxheight = Is_Valid_Number($maxheight,0,1,SD_MEDIA_MAX_DIM);\n\n if(empty($maxwidth) || empty($maxheight))\n {\n return false;\n }\n\n //Calculate the width:height ratio\n $owidth = $width;\n $oheight = $height;\n $ratio = $height/$width;\n if($maxheight < 0 || $maxwidth < 0)\n {\n if($maxheight < 0 && $maxwidth < 0)\n {\n //Do nothing\n }\n elseif ($maxheight < 0)\n {\n $width = $maxwidth;\n $height = round($width*$ratio);\n }\n elseif ($maxwidth < 0)\n {\n $height = $maxheight;\n $width = round($height/$ratio);\n }\n }\n elseif ($ratio == 1)\n {\n //Same Height/Width\n if ($maxheight === $maxwidth)\n {\n $width = $maxwidth;\n $height = $maxheight;\n }\n else\n {\n $height = min($maxheight,$maxwidth);\n $width = min($maxheight,$maxwidth);\n }\n }\n else\n {\n $case1_width = $maxwidth;\n $case1_height = round($case1_width*$ratio);\n $case1_area = round($case1_width*$case1_height);\n\n $case2_height = $maxheight;\n $case2_width = round($case2_height/$ratio);\n $case2_area = round($case2_width*$case2_height);\n\n //Check if it is an ambiguous case\n if(($case1_width <= $maxwidth) && ($case1_height <= $maxheight) &&\n ($case2_width <= $maxwidth) && ($case2_height <= $maxheight))\n {\n //$behaviour Sometimes, 2 values are obtained. Set this to 1 to return the\n //one with the bigger pixel area or 2 to return the one with smaller pixel area.\n if($behaviour == 1)\n {\n if($case1_area >= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n else\n {\n if($case1_area <= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n else\n {\n if ($case1_width <= $maxwidth && $case1_height <= $maxheight)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n\n if(($height > $oheight) || ($width > $owidth))\n {\n $width = $owidth;\n $height = $oheight;\n }\n $array = array((int)$width,(int)$height);\n return $array;\n\n }", "function cs_getimagesize($imagePath, $maxWidth = 0, $maxHeight = 0)\r\n{\r\n\t$use_curl = false;\r\n\tif (strtolower(substr($imagePath, 0, 7)) == 'http://'\r\n\t\t\t|| strtolower(substr($imagePath, 0, 6) == 'ftp://'))\r\n\t\t$use_curl = true;\n\t/* use curl if available, we can set decent timeouts for it */\r\n\tif ($use_curl && function_exists('curl_version') && function_exists('gd_info'))\n\t{\n\t\t$file_contents = cs_curl_contents($imagePath);\n\r\n\t\tif ($file_contents === false)\n\t\t\treturn false;\n\t\t$new_image = imagecreatefromstring($file_contents);\n\t\tif ($new_image !== false)\n\t\t{\n\t\t\t$size = array();\n\t\t\t$size[0] = imagesx($new_image);\n\t\t\t$size[1] = imagesy($new_image);\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t\t$size = getimagesize($imagePath);\r\n\t\n\tif ($size === false)\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\tif ($maxWidth > 0)\r\n\t{\r\n\t\tif ($maxHeight > 0)\r\n\t\t{\r\n\t\t\t/* both matter */\r\n\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t{\r\n\t\t\t\tif ($size[1] > $maxHeight)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((1.0*$size[0] / $maxWidth ) > (1.0*$size[1] / $maxHeight))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/* width is the important factor */ \r\n\t\t\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t\t\t$size[0] = $maxWidth;\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/* height is the important factor */ \r\n\t\t\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t\t\t$size[1] = $maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/* only width */\r\n\t\t\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t\t\t$size[0] = $maxWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif ($size[1] > $maxHeight)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* only height */\r\n\t\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t\t$size[1] = $maxHeight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* only width matters */\r\n\t\t\tif ($size[0] > $maxWidth)\r\n\t\t\t{\r\n\t\t\t\t$size[1] = (int) ($size[1] * (1.0*$maxWidth / $size[0]));\r\n\t\t\t\t$size[0] = $maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif ($maxHeight > 0)\r\n\t\t{\r\n\t\t\t/* only height matters */\r\n\t\t\tif ($size[1] > $maxHeight)\r\n\t\t\t{\r\n\t\t\t\t$size[0] = (int) ($size[0] * (1.0*$maxHeight / $size[1]));\r\n\t\t\t\t$size[1] = $maxHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* else if both are 0, we don't need to do anything */\r\n\t}\r\n\treturn $size;\r\n}", "function get_image_size($image) {\n if($image = getimagesize($image)) {\n $image[2] = image_type_to_extension($image[2],false);\n if($image[2] == 'jpeg') {\n $image[2] = 'jpg';\n }\n return $image;\n } else {\n return false;\n }\n}", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "private function checkImage(){\r\n \r\n $images = $this->image;\r\n @$imageName = $images['name'];\r\n @$imageTmp = $images['tmp_name'];\r\n @$imageSize = $images['size'];\r\n @$imageError = $images['error'];\r\n $imageExe = explode('.', $imageName);\r\n $imageExe = strtolower(end($imageExe));\r\n $newName = uniqid('post' , FALSE) . '.' . $imageExe;\r\n \r\n $allowed = [\"jpg\",\"jpeg\" ,\"bmp\" , \"gif\",\"png\"];\r\n// if(in_array($imageExe, $allowed) != 1) {\r\n// Messages::setMsg(\"خطأ\", \"يجب اختيار صورة حقيقية\", \"danger\") ;\r\n// echo Messages::getMsg();\r\n if(0) {\r\n \r\n }else if($imageSize > 1024 * 1024) {\r\n echo \"حجم الصورة جدا كبير\";\r\n }else if($imageError != 0) {\r\n echo \"يرجى ادخال صورة صحيحة\";\r\n }\r\n else{\r\n $dir = __DIR__ . \"/../libs/photos/\" ;\r\n if(!file_exists($dir)){\r\n mkdir($dir,TRUE);\r\n }\r\n $filedire = $dir.$newName;\r\n if(move_uploaded_file($imageTmp, $filedire)) {\r\n $this->uploadImage = $newName;\r\n }\r\n return TRUE;\r\n } // end else\r\n \r\n return false;\r\n }", "protected function processImage()\n {\n // Start from the last scale (bigger image).\n $tier = (count($this->_scaleInfo) - 1);\n $row = 0;\n $ul_y = 0;\n $lr_y = 0;\n\n list($root, $ext) = $this->getRootAndDotExtension($this->_imageFilename);\n\n // Create a row from the original image and process it.\n while ($row * $this->tileSize < $this->_originalHeight) {\n $ul_y = $row * $this->tileSize;\n $lr_y = ($ul_y + $this->tileSize < $this->_originalHeight)\n ? $ul_y + $this->tileSize\n : $this->_originalHeight;\n $saveFilename = $root . '-' . $tier . '-' . $row . '.' . $ext;\n $width = $this->_originalWidth;\n $height = abs($lr_y - $ul_y);\n $crop = [];\n $crop['width'] = $width;\n $crop['height'] = $height;\n $crop['x'] = 0;\n $crop['y'] = $ul_y;\n $this->imageResizeCrop($this->_imageFilename, $saveFilename, [], $crop);\n\n $this->processRowImage($tier, $row);\n ++$row;\n }\n }", "function resizeImage($width, $height, $quality = 8, $ratio = false){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = ($quality > 10 ? 10 : max($quality, 0)) * 10;\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }" ]
[ "0.8113505", "0.7085443", "0.70314085", "0.68301684", "0.68097025", "0.6801972", "0.67775345", "0.67615557", "0.6752481", "0.6678836", "0.66656107", "0.66516554", "0.66501224", "0.66137785", "0.6577751", "0.6572114", "0.65445787", "0.6540436", "0.6525844", "0.6522556", "0.65186024", "0.6513761", "0.6507603", "0.65021664", "0.6495492", "0.64879483", "0.64853173", "0.6479589", "0.6468424", "0.64653015", "0.6464826", "0.6461695", "0.64340246", "0.6392937", "0.638473", "0.63780135", "0.63699716", "0.6362983", "0.6355254", "0.6352549", "0.6342702", "0.63287205", "0.6323541", "0.6320959", "0.63190705", "0.63120157", "0.6303424", "0.63021404", "0.63014704", "0.63002163", "0.62910324", "0.6280007", "0.62668407", "0.6252223", "0.6249029", "0.6242968", "0.62336236", "0.62325376", "0.62317103", "0.6220065", "0.62084526", "0.62081814", "0.6196082", "0.61957383", "0.61949563", "0.6186681", "0.6178972", "0.6177974", "0.6172405", "0.61694825", "0.61693436", "0.61683667", "0.6165573", "0.61620855", "0.6157328", "0.6154329", "0.6153988", "0.6152936", "0.6150245", "0.6146235", "0.61459666", "0.6144253", "0.61299217", "0.61196667", "0.61152744", "0.6108109", "0.610656", "0.6102015", "0.6092041", "0.60908246", "0.60903615", "0.60837114", "0.60798776", "0.6077102", "0.6075005", "0.6069245", "0.6066534", "0.6061347", "0.60610497", "0.60597146" ]
0.6120032
83
ends resizeImage function / Reviews Functions
function displayReviews($reviews){ $reviewConatainer="<ul id='reviews'>"; foreach($reviews as $blocks){ $reviewConatainer.='<li>'; // take first character from first name $clientName = substr($blocks['clientFirstname'], 0,1); // transform to uppercase $clientName = strtoupper($clientName); // transform fist character from Lastname to uppercase $clientLasname = ucfirst($blocks['clientLastname']); $userReviewName = $clientName.$clientLasname; //Simplify date $date = substr($blocks['reviewDate'],0,10); $reviewConatainer.="<p><span>$userReviewName</span> wrote on $date</p>"; $reviewConatainer.="<p class='reviewText'>$blocks[reviewText]</p>"; $reviewConatainer.='</li>'; } $reviewConatainer.='</ul>'; return $reviewConatainer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "public static function resize(){\n\n}", "public function resizeImage()\n {\n \treturn view('resizeImage');\n }", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function refreshImageSize() {\n\t\tif($this->intTableKeyValue != \"\") {\n\t\t\tif ( $this->arrObjInfo['imageurl'] ) {\n\t\t\t\tif($this->arrObjInfo['imagewidth'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imagewidth'] = $imageSize[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->arrObjInfo['imageheight'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imageheight'] = $imageSize[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function scaleImages() {}", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function vt_resize( $attach_id = null, $img_url = null, $width, $height, $crop = false ) {\n\t\n\t//initialise variable to prevent wp_debug mode error.\n\t$file_path = '';\n\t$image_src[0] = '';\n\t$image_src[1] = '';\n\t$image_src[2] = '';\n\t\t\n\t// we use the attachment id if it is given.\n\tif ( $attach_id ) {\n\t\n\t\t$image_src = wp_get_attachment_image_src( $attach_id, 'full' );\n\t\t//file path will return abnormally if given attachment id is wrong.\n\t\t$file_path = get_attached_file( $attach_id );\n\t\t\n\t\t//echo \"This is from attachment id \".$file_path.\"<br/>\";\n\t\n\t// if not use the image url to find the attachment ID!\n\t} else if ( $img_url ) {\n\t\t\n\t\t\n\t\t$attachment_id = truethemes_get_attachment_id_from_src($img_url);\n\t\t$image_src_ed = wp_get_attachment_image_src( $attachment_id, 'full' );\n\t\t$get_file_path = get_attached_file( $attachment_id );\n\t\t//file path will return abnormally if given image url is wrong. \n\t\t$file_path = $get_file_path;\n\t\t\n\t\t//echo \"This is from image src \".$file_path.\"<br/>\";\n\t\t\n\t $orig_size = $image_src_ed;\n\t\t\n\t\t$image_src[0] = $orig_size[0];\n\t\t$image_src[1] = $orig_size[1];\n\t\t$image_src[2] = $orig_size[2];\n\t\t\t\t\t\t\t\t\t\n\t}\n\t\n\t$file_info = pathinfo( $file_path );\n\t//initialise variable to prevent WP_debug mode error.\n\t$file_info['extension'] = '';\n\t$file_info['dirname'] = '';\n\t$extension = '.'. $file_info['extension'];\n\n\t// the image path without the extension\n\t$no_ext_path = $file_info['dirname'].'/'.$file_info['filename'];\n\n\t$cropped_img_path = $no_ext_path.'-'.$width.'x'.$height.$extension;\n\n\t// checking if the file size is larger than the target size\n\t// if it is smaller or the same size, stop right here and return\n\tif ( $image_src[1] > $width || $image_src[2] > $height ) {\n\n\t\t// the file is larger, check if the resized version already exists (for $crop = true but will also work for $crop = false if the sizes match)\n\t\tif ( file_exists( $cropped_img_path ) ) {\n\n\t\t\t$cropped_img_url = str_replace( basename( $image_src[0] ), basename( $cropped_img_path ), $image_src[0] );\n\t\t\t\n\t\t\t$vt_image = array (\n\t\t\t\t'url' => $cropped_img_url,\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t\t\n\t\t\treturn $vt_image;\n\t\t}\n\n\t\t// $crop = false\n\t\tif ( $crop == false ) {\n\t\t\n\t\t\t// calculate the size proportionaly\n\t\t\t$proportional_size = wp_constrain_dimensions( $image_src[1], $image_src[2], $width, $height );\n\t\t\t$resized_img_path = $no_ext_path.'-'.$proportional_size[0].'x'.$proportional_size[1].$extension;\t\t\t\n\n\t\t\t// checking if the file already exists\n\t\t\tif ( file_exists( $resized_img_path ) ) {\n\t\t\t\n\t\t\t\t$resized_img_url = str_replace( basename( $image_src[0] ), basename( $resized_img_path ), $image_src[0] );\n\n\t\t\t\t$vt_image = array (\n\t\t\t\t\t'url' => $resized_img_url,\n\t\t\t\t\t'width' => $proportional_size[0],\n\t\t\t\t\t'height' => $proportional_size[1]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\treturn $vt_image;\n\t\t\t}\n\t\t}\n\n\t\t// no cache files - let's finally resize it\n\t\t\n\t\t//function check for WordPress 3.5 wp_get_image_editor\n\t\tif(function_exists('wp_get_image_editor')){\n\t\t$new_img_path = tt_resize_image( $file_path, $width, $height, $crop );\n\t\t}else{\n\t\t$new_img_path = image_resize( $file_path, $width, $height, $crop );\t\t\n\t\t}\n\n\t\t$new_img_size = getimagesize( $new_img_path );\n\t\t$new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );\n\n\t\t// resized output\n\t\t$vt_image = array (\n\t\t\t'url' => $new_img,\n\t\t\t'width' => $new_img_size[0],\n\t\t\t'height' => $new_img_size[1]\n\t\t);\n\t\t\n\t\treturn $vt_image;\n\t}\n\n\t// default output - without resizing\n\t$vt_image = array (\n\t\t'url' => $image_src[0],\n\t\t'width' => $image_src[1],\n\t\t'height' => $image_src[2]\n\t);\n\n\treturn $vt_image;\n}", "public function resize(IImageInformation $src, $width, $height);", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function media_upload_max_image_resize()\n {\n }", "function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}", "public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }", "public function image_size(){\n\t\t//add_image_size( 'thumb-owl', 205, 205, true );\n//\tadd_image_size( 'thumb-150', 150, 150, true);\n//\tadd_image_size( 'thumb-120', 120, 120, true);\n//\tadd_image_size( 'thumb-100', 100, 100, true );\n//\tadd_image_size( 'thumb-250', 250, 250, true );\n// // add_image_size( 'thumb-150', 150, 150, true ); //wordpress thumbail\n// add_image_size( 'thumb-60', 60, 60, true);\n//\t\t//add_image_size( 'thumb-editor', 500, 9999, true );\n//remove_image_size( 'thumb-editor');\n\t\t//remove_image_size('large');\n\t\t//remove_image_size('medium_large');\n\t}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "function __resize(&$tmp, $width, $height) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function cjpopups_resize_image($src, $width, $height = null, $crop = false, $single = false){\n\trequire_once(sprintf('%s/aq_resizer.php', cjpopups_item_path('helpers_dir')));\n\t$resized = aq_resize($src, $width, $height, $crop, $single);\n\tif(!empty($resized)){\n\t\treturn $resized;\n\t}else{\n\t\t$placeholder = 'http://placehold.it/'.$width.'x'.$height.'&text=No+Thumbnail';;\n\t\tif($single){\n\t\t\t$return = $placeholder;\n\t\t}else{\n\t\t\t$return[] = $placeholder;\n\t\t\t$return[] = $width;\n\t\t\t$return[] = $height;\n\t\t}\n\t\treturn $return;\n\t}\n}", "public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }", "public function resize(array $dimensions) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// does the dimensions array have the appropriate values to work with?\n if (isset($dimensions[\"width\"]) || isset($dimensions[\"height\"])) {\n// has the width value been omitted, while the height value given?\n if (!isset($dimensions[\"width\"]) && isset($dimensions[\"height\"])) {\n// is the height an integer?\n// -> if so, assign the height variable and assign the width variable scaled similarly to the height\n if (is_int($dimensions[\"height\"])) {\n $width = (int) floor($this->_width * ($dimensions[\"height\"] / $this->_height));\n $height = $dimensions[\"height\"];\n }\n }\n// or has the height value been omitted, and the width value given?\n else if (isset($dimensions[\"width\"]) && !isset($dimensions[\"height\"])) {\n// is the width an integer?\n// -> if so, assign the width variable and assign the height variable scaled similarly to the width\n if (is_int($dimensions[\"width\"])) {\n $width = $dimensions[\"width\"];\n $height = (int) floor($this->_height * ($dimensions[\"width\"] / $this->_width));\n }\n }\n// or both values were provided\n else {\n// are both width and height values integers?\n// -> if so, assign the width and height variables\n if (is_int($dimensions[\"width\"]) && is_int($dimensions[\"height\"])) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n }\n }\n\n// have the width and height variables been assigned?\n// -> if so, proceed with cropping\n if (isset($width, $height)) {\n// generating the placeholder resource\n $resized_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and resizing it accordingly\n imagecopyresampled($resized_image, $this->_resource, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);\n\n// assigning the new image attributes\n $this->_resource = $resized_image;\n $this->_width = $width;\n $this->_height = $height;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() was not provided the apporpriate arguments (given array must contain \\\"width\\\" and \\\"height\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() attempting to access a non-existent resource (check if the image was loaded by Image2::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "function imgResize_gallery($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$allowedFormat=array('image/*'),$Maxfilesize=2097152,$filename_body='')\t{\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t$handle->allowed = $allowedFormat;\n\t\t$handle->file_max_size = $Maxfilesize;\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif($filename_body!='')\n\t\t\t$handle->file_name_body_add = $filename_body;\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif((($img_proper[0]>$imgx && $img_proper[1]>$imgy) || ($img_proper[0]>$imgx && $img_proper[1]<$imgy)) && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function sizeImg($width, $height, $crop = true);", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "function add_image_size($name, $width = 0, $height = 0, $crop = \\false)\n {\n }", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function resize($new_x = 0, $new_y = 0)\r\n {\r\n // 0 means keep original size\r\n $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);\r\n $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);\r\n // Now do the library specific resizing.\r\n return $this->_resize($new_x, $new_y);\r\n }", "function oniros_image_support(){\n\t// add as many as the project might require\n\t// smaller images do not get resized, but largeones will get cropped.\n\n\t// name width height crop?\n\tadd_image_size( 'image_size_name', 400, 400, true);\n}", "public function resize_fit(IImageInformation $src, $width, $height);", "public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}", "public function imageResize($imageUrl, $imageSize) {\n if (! file_exists ( Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED )) {\n mkdir ( Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED, 0777 );\n }\n \n $imageName = substr ( strrchr ( $imageUrl, \"/\" ), 1 );\n // get file extension\n $extension = end ( explode ( \".\", $imageName ) );\n $imageName = uniqid () . '.' . $extension;\n $imageResized = Mage::getBaseDir ( static::MEDIA ) . DS . static::MOBILEAPP . DS . static::RESIZED . DS . $imageName;\n $dirImg = Mage::getBaseDir () . str_replace ( \"/\", DS, strstr ( $imageUrl, '/' . static::MEDIA ) );\n if (! file_exists ( $imageResized ) && file_exists ( $dirImg )) :\n $imageObj = new Varien_Image ( $dirImg );\n $imageObj->constrainOnly ( true );\n $imageObj->keepAspectRatio ( true );\n $imageObj->keepFrame ( false );\n $imageObj->resize ( $imageSize, null );\n $imageObj->save ( $imageResized );\n \n \n \n \n \n \n endif;\n return Mage::getBaseUrl ( static::MEDIA ) . static::MOBILEAPP . \"/\" . static::RESIZED . \"/\" . $imageName;\n }", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = \\false)\n {\n }", "public function createThumbnail($imageName,$newWidth,$newHeight) {\n $path = $this->img_dir . '/' . $imageName;\n $mime_info = getimagesize($path);\n $mime = $mime_info['mime'];\n\n $src_img = $this->image_data($path, $mime);\n if($src_img===false) return false;\n\n $old_w = imageSX($src_img);\n $old_h = imageSY($src_img);\n\n $source_aspect_ratio = $old_w / $old_h;\n $desired_aspect_ratio = $newWidth / $newHeight;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n /*\n * Triggered when source image is wider\n */\n $thumb_h = $newHeight;\n $thumb_w = ( int ) ($newHeight * $source_aspect_ratio);\n } else {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $thumb_w = $newWidth;\n $thumb_h = ( int ) ($newWidth / $source_aspect_ratio);\n }\n\n $dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);\n\n $color = imagecolorallocatealpha($dst_img, 0, 0, 0, 127);\n imagefill($dst_img,0,0,$color);\n imagesavealpha($dst_img, true);\n\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);\n\n if($this->is_crop_hard) {\n $x = ($thumb_w - $newWidth) / 2;\n $y = ($thumb_h - $newHeight) / 2;\n\n $tmp_img = imagecreatetruecolor($newWidth, $newHeight);\n $color = imagecolorallocatealpha($tmp_img, 0, 0, 0, 127);\n imagefill($tmp_img,0,0,$color);\n imagesavealpha($tmp_img, true);\n\n imagecopy($tmp_img, $dst_img, 0, 0, $x, $y, $newWidth, $newHeight);\n $dst_img = $tmp_img;\n }\n\n $new_thumb_loc = $this->thumb_dir . $imageName;\n $result = $this->save($dst_img, $new_thumb_loc, $mime);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n return $result;\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$thumb_image_name,90);\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function resizeImage($CurWidth, $CurHeight, $MaxSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//Construct a proportional size of new image\n\t$ImageScale\t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \n\t$NewWidth\t= ceil($ImageScale*$CurWidth);\n\t$NewHeight\t= ceil($ImageScale*$CurHeight);\n\t\n\tif($CurWidth < $NewWidth || $CurHeight < $NewHeight)\n\t{\n\t\t$NewWidth = $CurWidth;\n\t\t$NewHeight = $CurHeight;\n\t}\n\t$NewCanves \t= imagecreatetruecolor($NewWidth, $NewHeight);\n\t// Resize Image\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n\n}", "function resize_rep_image($rep_image)\n{\n if (($rep_image != '') && (function_exists('imagepng')) && (get_value('resize_rep_images') !== '0') && (preg_match('#^uploads/repimages/#', $rep_image) != 0)) {\n $_rep_image = $rep_image;\n if (url_is_local($rep_image)) {\n $_rep_image = get_custom_base_url() . '/' . $rep_image;\n }\n convert_image($_rep_image, get_custom_file_base() . '/uploads/repimages/' . basename(rawurldecode($rep_image)), -1, -1, intval(get_option('thumb_width')), true, null, false, true);\n }\n\n return $rep_image;\n}", "public function resizeImage($file, $mime, $maxWidth=-1, $maxHeight=-1) {\n\t\tif ($maxWidth == -1 && $maxHeight == -1) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t//rely on GD\n\t\tif (!function_exists('imagecreate')) { return; }\n/*\n\t\tif ($this->dataItem->mime == '') {\n\t\t\t$this->figureMime();\n\t\t} else {\n\t\t\t$this->mimeType = $this->dataItem->mime;\n\t\t}\n\n\t\t$tmpfname = tempnam('/tmp/', \"cgnimg_\");\n\t\t$si = fopen($tmpfname, \"w+b\");\n*/\n\n\t\tswitch ($mime) {\n\t\t\tcase 'image/png':\n\t\t\t$orig = imageCreateFromPng($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/jpg':\n\t\t\t$orig = imageCreateFromJpeg($file);\n\t\t\tbreak;\n\n\t\t\tcase 'image/gif':\n\t\t\t$orig = imageCreateFromGif($file);\n\t\t\tbreak;\n\t\t}\n\t\tif (!$orig) { \n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = imageSx($orig);\n\t\t$height = imageSy($orig);\n\t\tif ($width > $maxWidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $maxWidth / $width;\n\t\t\t$newwidth = $maxWidth;\n\t\t\t$newheight = $height * $ratio;\n\t\t} else {\n\t\t\t$newwidth = $width;\n\t\t\t$newheight = $height;\n\t\t}\n\n\t\t$thumbwidth = 50;\n\t\t$thumbheight = 50;\n\n\t\tif ($width > $thumbwidth) {\n\t\t\t//resize proportionately\n\t\t\t$ratio = $thumbwidth / $width;\n\t\t\t$new2width = $thumbwidth;\n\t\t\t$new2height = intval($height * $ratio);\n\t\t} else {\n\t\t\t//Check if image is really tall and thin.\n\t\t\t//Don't do this for the medium size image because \n\t\t\t// vertically tall images aren't a problem for most layouts.\n\t\t\tif ($height > $thumbheight) {\n\t\t\t\t$ratio = $thumbheight / $height;\n\t\t\t\t$new2height = $thumbheight;\n\t\t\t\t$new2width = intval($width * $ratio);\n\t\t\t} else {\n\t\t\t\t//use defaults, image is small enough \n\t\t\t\t$new2width = $width;\n\t\t\t\t$new2height = (int)$height;\n\t\t\t}\n\t\t}\n\t\t$webImage = imageCreateTrueColor($newwidth,$newheight);\n\t\tif (!$webImage) { die('no such handle');}\n\t\timageCopyResampled(\n\t\t\t$webImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$newwidth, $newheight,\n\t\t\t$width, $height);\n\n\n\n\t\t$thmImage = imageCreateTrueColor($new2width,$new2height);\n\t\timageCopyResampled(\n\t\t\t$thmImage, $orig,\n\t\t\t0, 0,\n\t\t\t0, 0,\n\t\t\t$new2width, $new2height,\n\t\t\t$width, $height);\n\n/*\nheader('Content-type: image/png');\nimagePng($thmImage);\nexit();\n */\n\t\t$dir = dirname($file);\n\t\t$base = basename($file);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $webImage, $dir.'/w'.$base.'.png', 6);\n\n//\t\t$this->dataItem->web_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($webImage);\n\n//\t\tob_start(); // start a new output buffer\n\t\timagePng( $thmImage, $dir.'/t'.$base.'.png', 6 );\n//\t\t$this->dataItem->thm_image = ob_get_contents();\n//\t\tob_end_clean(); // stop this output buffer\n\t\timageDestroy($thmImage);\n\t}", "private function doImageResize($img)\n\t{\n\t\t// Determine the new dimensions:\n\t\t$d = $this->getNewDims($img);\n\n\t\t// Determine what functions to use:\n\t\t$funcs = $this->getImageFunctions($img);\n\n\t\t// Create the image resources for resampling:\n\t\t$src_img = $funcs[0]($img);\n\t\t$new_img = $this->imageCreateTransparent($d[0], $d[1]);\n\n\t\tif(imagecopyresampled(\n\t\t\t$new_img, $src_img, 0, 0, 0, 0, $d[0], $d[1], $d[2], $d[3]\n\t\t\t))\n\t\t\t{\n\t\t\t\timagedestroy($src_img);\n\t\t\t\tif($new_img && $funcs[1]($new_img, $img))\n\t\t\t\t{\n\t\t\t\t\timagedestroy($new_img);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Could not resample the image!');\n\t\t\t}\n\t}", "function _wp_add_additional_image_sizes()\n {\n }", "public function test_resize() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 75,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "private function makeImageSize(): void\n {\n list($width, $height) = getimagesize($this->getUrl());\n $size = array('height' => $height, 'width' => $width );\n\n $this->width = $size['width'];\n $this->height = $size['height'];\n }", "function rest_add_image_size() {\n add_image_size( 'rest_post_thumbnail', 712, 348, true );\n}", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "function resizeImage($width, $height, $quality = 8, $ratio = false) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1], \"attrib\");\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2],\"attrib\");\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "function custom_image_sizes() {\n}", "function _resize() {\r\n return null; //PEAR::raiseError(\"No Resize method exists\", true);\r\n }", "function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Construct a proportional size of new image\r\n\t$ImageScale \t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \r\n\t$NewWidth \t\t\t= ceil($ImageScale*$CurWidth);\r\n\t$NewHeight \t\t\t= ceil($ImageScale*$CurHeight);\r\n\t$NewCanves \t\t\t= imagecreatetruecolor($NewWidth, $NewHeight);\r\n\t\r\n\t// Resize Image\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\t}\r\n\r\n}", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "public function register_image_sizes() {\n\n }", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function recreate_thumb($image_array) {\n\tif(!file_exists($image_array[\"image_thumb_path\"])) {\n\t\t@require_once(__CHV_PATH_CLASSES__.'class.imageresize.php');\n\t\t$thumb = new ImageResize($image_array[\"image_path\"], $image_array[\"image_thumb_path\"], chevereto_config('thumb_width'), chevereto_config('thumb_height'), true);\n\t}\n}", "function resizeImage($fileName, $newWidth = 100 , $newHeight = 100, $cropType = 0, $outputFileName = \"\", $quality = 75){\r\n $imgCreateFun=array(1 => \"imagecreatefromgif\", 2 => \"imagecreatefromjpeg\", 3 => \"imagecreatefrompng\");\r\n $imgOutputFun=array(1 => \"imagegif\", 2 => \"imagejpeg\", 3 => \"imagepng\");\r\n \r\n if(file_exists($fileName)){\r\n $myFileInfo = getimagesize($fileName);\r\n $imgWidth = $myFileInfo[0];\r\n $imgHeight = $myFileInfo[1];\r\n \r\n $resCords = getPropSizes($imgWidth, $imgHeight, $newWidth, $newHeight, $cropType);\r\n \r\n $imgType = $myFileInfo[2];\r\n if(in_array($imgType,array_keys($imgCreateFun))){\r\n $image_p = imagecreatetruecolor($newWidth, $newHeight);\r\n $image = $imgCreateFun[$imgType]($fileName);\r\n imagecopyresampled($image_p, $image, 0, 0, $resCords[\"srcX\"], $resCords[\"srcY\"], $newWidth, $newHeight, $resCords[\"srcW\"], $resCords[\"srcH\"]); \r\n if(!file_exists($outputFileName)){\r\n if(!$outputFileName){\r\n header(\"Content-type: \".$myFileInfo[\"mime\"]);\r\n }\r\n $imgOutputFun[$imgType]($image_p, $outputFileName, $quality);\r\n imagedestroy($image_p);\r\n imagedestroy($image); \r\n }\r\n else{\r\n imagedestroy($image_p);\r\n imagedestroy($image);\r\n die(\"Cannot write output image - Filename already exists\");\r\n }\r\n \r\n }\r\n else{\r\n die(\"Image Type not supported\");\r\n }\r\n }\r\n else{\r\n die(\"Source file not found\");\r\n }\r\n}", "function resize_img($dir_in, $dir_out, $imedat='defaultname.jpg', $max=500,$new) {\r\n\r\n $img = $dir_in . '/' . $imedat;\r\n $extension = array_pop(explode('.', $imedat));\r\n $fileExt = strtolower(end(explode('.',$imedat)));\r\n $imedat = $new.$fileExt;\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n $image = ImageCreateFromJPEG($img);\r\n break;\r\n \r\n case 'png':\r\n $image = ImageCreateFromPNG($img);\r\n break;\r\n \r\n default:\r\n $image = false;\r\n }\r\n\r\n\r\nif(!$image){\r\n // not valid img stop processing\r\n return false; \r\n}\r\n\r\n $vis = imagesy($image);\r\n $sir = imagesx($image);\r\n\r\n if(($vis < $max) && ($sir < $max)) {\r\n $nvis=$vis; $nsir=$sir;\r\n } else {\r\n if($vis > $sir) { $nvis=$max; $nsir=($sir*$max)/$vis;}\r\n elseif($vis < $sir) { $nvis=($max*$vis)/$sir; $nsir=$max;}\r\n else { $nvis=$max; $nsir=$max;}\r\n }\r\n\r\n $out = ImageCreateTrueColor($nsir,$nvis);\r\n ImageCopyResampled($out, $image, 0, 0, 0, 0, $nsir, $nvis, $sir, $vis);\r\n\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n imageinterlace($out ,1);\r\n ImageJPEG($out, $dir_out . '/' . $imedat, 75);\r\n break;\r\n \r\n case 'png':\r\n ImagePNG($out, $dir_out . '/' . $imedat);\r\n break;\r\n \r\n default:\r\n $out = false;\r\n }\r\n\r\n if(!$out){\r\n return false;\r\n }\r\n \r\nImageDestroy($image);\r\nImageDestroy($out);\r\n\r\nreturn true;\r\n}", "protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}" ]
[ "0.7226951", "0.72027385", "0.71870244", "0.7103431", "0.7094963", "0.7039208", "0.7012308", "0.69961786", "0.69903344", "0.6964784", "0.6963558", "0.6930311", "0.6909252", "0.68589705", "0.6849555", "0.6824427", "0.682291", "0.679686", "0.6771909", "0.67260414", "0.67086107", "0.67058355", "0.66694415", "0.6665533", "0.6663021", "0.6662889", "0.6662231", "0.6659931", "0.6658874", "0.6654135", "0.66420186", "0.66322285", "0.6630291", "0.66257143", "0.66041297", "0.6585376", "0.65814745", "0.65794057", "0.657293", "0.65721047", "0.6567128", "0.6566201", "0.6565647", "0.6564352", "0.65609074", "0.6560849", "0.6558418", "0.6550252", "0.65498924", "0.6533151", "0.65298307", "0.65285313", "0.65253234", "0.6520415", "0.65097535", "0.64994204", "0.6474159", "0.6472024", "0.64551014", "0.6438025", "0.6421482", "0.64175904", "0.6416066", "0.641581", "0.63998336", "0.6396347", "0.63944215", "0.63936704", "0.63890404", "0.6384021", "0.63767797", "0.63713795", "0.6370575", "0.63664114", "0.6359913", "0.6355849", "0.63541275", "0.63533694", "0.63475263", "0.6344687", "0.634384", "0.63428193", "0.6342499", "0.63421285", "0.6332065", "0.63194245", "0.63185596", "0.6317977", "0.62994045", "0.62861747", "0.6280662", "0.6280276", "0.6280201", "0.6279049", "0.62788254", "0.6263779", "0.6252225", "0.62515765", "0.6244122", "0.6238428", "0.6237825" ]
0.0
-1
Display reviwes manaement veiw
function reviewsMangment($userReviews){ $rc = "<ul>"; foreach ($userReviews as $review){ $date = substr($review['reviewDate'],0,10); $rc .="<li> $review[invMake] $review[invModel] $date <a href='/phpmotors/reviews/?action=update-review&reviewId=".urlencode($review['reviewId'])."'>Edit</a> | <a href='/phpmotors/reviews/?action=delete-review&reviewId=".urlencode($review['reviewId'])."'>Delete</a> </li>"; } $rc .= '</ul>'; return $rc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function affiche (){\n\t\t\t//affiche en retour à la ligne\n\t\t\techo '<pre>';\n\t\t\tprint_r(array(\n\t\t\t\tname=>$this->Getname(),\n\t\t\t\tpv=>$this->Getpv(),\n\t\t\t\tlevel=>$this->Getlevel(),\n\t\t\t\tattack1=>$this->Getattack1(),\n\t\t\t\tattack2=>$this->Getattack2(),\n\t\t\t\ttype=>$this->Gettype()\n\t\t\t\t));\n\t\t\techo '</pre>';\n\t\t}", "public function recap(){\n\t\techo \"----- INFO\" . $this->getNom() . \" ----- <br>\";\n\t\techo $this->getNom() . \" a \" . $this->getVie() . ' points de vie <br>';\n\t}", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "public function tocar(){\n echo \"Tocando no volume: \" . $this->volume . \" decibéis. <br>\";\n }", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "public function mostrarInfo()\n {\n // $datos.= \"Cuatrimestre\".$this->cuatrimestre;\n // return parent::mostrarInfo().\" \".$datos;\n }", "public function luas()\n {\n return $this->panjang * $this->lebar;\n }", "public function abrirMenu() {\n echo $this->getLigado()?\"<p>Esta ligado? : SIM <br>\":\"Esta ligado : NON <br></p>\";\n echo $this->getTocando()?\"Esta tocando? : SIM\":\"Esta tocando? : NON\";\n echo \"<br>Volume: \" . $this->getVolume();\n // Pra colocar barrinhas simulando o volume\n for ($i=0; $i <=$this->getVolume(); $i+=10) {\n echo \"|\";\n }\n echo \"<br>\";\n }", "public function getManaCost()\n {\n return $this->manaCost;\n }", "public function mostrar(){\n\t\t\t\techo \"<p> Hola soy un $this->marca, modelo $this->modelo</php> \";\n\t\t\t}", "public function visualizar() {\n echo $this->getTabuleiro();\n }", "Public function displayInfo(){ \r\n\t\t\techo \"The info about the dress.\"; \r\n\t\t\techo $this->color; \r\n\t\t\techo $this->fabric ; \r\n\t\t\techo $this->design;\r\n\t\t\techo self::MEDIUM;\r\n\t\t}", "function baretat($id){\n{\n\tif ($id == 1)\n\t{\n\t\techo \"Rage : $OFFSET_RAGE; / $OFFSET_RAGE_MAX\";\n\t}\n\telseif ($id == 4)\n\t{\n\t\techo \"Energie : $OFFSET_ENER / $OFFSET_ENER_MAX\";\n\t}\n\telseif ($id == 6)\n\t{\n\t\techo \"P. Runique : 0 / 0\";\n\t}\n\telseif ($id == 2 || ($id) == 3 || ($id) == 5 || ($id) == 7 || ($id) == 8 || ($id) == 9 || ($id) == 11)\n\t{\n\t\techo \"Mana : $OFFSET_MANA / $OFFSET_MANA_MAX\";\n\t}\n}\n}", "public function reporteManipuladores(){\n\t\t$manipuladores = $this->ModeloReportes->obtenerManipuladores();\n\n\t\t$parameters = [\n\t\t\t'title'=> 'Active Manipulators Report',\n\t\t\t'manipuladores'=>$manipuladores,\n\t\t];\n\t\t$this->view('reportes/manipuladores', $parameters);\n\t}", "public function show(Matoleo $matoleo)\n {\n //\n }", "public function legalesMentions()\n {\n echo $this->getRender()->render('legalesMentions.twig');\n }", "public function show($id)\n {\n $pelatihan = Pelatihan::findOrFail($id);\n $anggaran = $pelatihan->anggaran;\n \n $anggaran->map(function ($item) {\n $item['total'] = $item->jumlah_anggaran * $item->pelatihan->kuota * $item->volume;\n\n return $item;\n });\n return view('admin.anggaran.show', compact('pelatihan','anggaran'));\n }", "function afficher() {\r\n \r\n if($this->getEtat()){\r\n echo \"0\";\r\n }else{\r\n \r\n echo \"&nbsp\";\r\n }\r\n \r\n }", "public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}", "public function show()\n {\n //\n return 'Rosie can i have a dance';\n }", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "public function Movil() {\n\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t$plantilla->Parametro('Titulo', 'Comunicación');\n\t\t\t$plantilla->Parametro('avisos', $this->Modelo->avisos());\n\t\t\techo $plantilla->MostrarPlantilla(implode(DIRECTORY_SEPARATOR, array('Dispositivos', 'Movil.html')));\n\t\t}", "public function mostrar()\n\t\t{\n\t\t\tfor ($i=0; $i<count($this->nombres); $i++) { \n\t\t\t\techo $this->nombres[$i].\" \".$this->apellidos[$i].\"<br>\";\n\t\t\t}\n\t\t}", "public function graphic()\n {\n return \"die-\" . $this->value;\n }", "public function showAction()\n {\n $em =$this->getDoctrine()->getManager();\n $liste = $em->getRepository('ProduitBundle:PanierProduit')->findAll();\n\n $prixtotal=0;\n $somme=0;\n foreach ($liste as $value)\n {\n $prixtotal=$value->getPrix();\n $somme=$prixtotal+$somme;\n }\n\n $tab=array(\"somme\"=>$somme);\n\n return $this->render('@Eco/Panier/page_index_panier.html.twig', array(\n 'liste'=> $liste,'tab'=> $tab));\n\n }", "function affiche_image_armure($image_armures, $nom_armure, $defense_armure, $description_armures,\n\t\t\t\t\t\t\t $BonusPerception_armures, $bonusPv_armure){\n\t\t\t\t\t\t\t\t \n\t$description_arme = $description_armures;\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\techo \"<td width=50 height=50 align=center>\n\t\t\t<img tabindex='0' src='../images/armures/$image_armures' width=50 height=50 \n\t\t\t\t\tdata-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom'\n\t\t\t\t\ttitle=\\\"<b>$nom_armure</b>\\\" \";\n\techo \"\t\t\tdata-content=\\\"\t<div><img src=../images/armures/$image_armures></div>\n\t\t\t\t\t\t\t\t\t<div><u>Defense :</u> $defense_armure</div>\";\n\t\t\t if($BonusPerception_armures){\n\t\t\t\techo \"<div><u>Bonus Perception :</u> $BonusPerception_armures</div>\";\n\t\t\t }\n\t\t\t if($bonusPv_armure){\n\t\t\t\techo \"<div><u>bonus Pv :</u> $bonusPv_armure</div>\";\n\t\t\t }\n\t\t\t echo \"<div><b>Description</b></div><div>$description_armures</div>\\\" >\";\n}", "public function show(Umrah $umrah)\n {\n //\n }", "public function getMilage()\n {\n }", "public function show(tblm_target_rencana_luaran $tblm_target_rencana_luaran)\n {\n //\n }", "public function actionMuestraPuntoHumedad(){\n $dataHumedad= Test::model()->consultaPuntoHumedad();\n $time=strtotime ( $dataHumedad[\"date_test\"] )*1000;\n echo CJSON::encode(array(\"humedad\"=>(double)$dataHumedad[\"humedad\"],\"time\"=>$time)); \n }", "public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "public function show(Mapel $mapel)\n {\n //\n }", "public function index()\n {\n $sp2bj = Sppbj::where('user_id', auth()->user()->id)->orderBy('id', 'DESC')->first();\n $spm = Spm::where('user_id', auth()->user()->id)->orderBy('id', 'DESC')->first();\n $subtotal = $sp2bj\n ->barang\n ->map(function ($el) {\n return $el->harga_satuan * $el->jumlah;\n })->sum();\n return view('admin.spm.cetak', compact('sp2bj', 'spm', 'subtotal'));\n }", "public function toString()\n {\n echo \"<h3>Executive Manager</h3>\";\n parent::toString();\n echo \"<br><strong>Bonus</strong>: $\", number_format($this->getBonus(), 2);\n }", "public function show($card_id) {\n\t\t$this->load->helper('cards_display');\n\t\t$this->load->database();\n\t\t\n\t\t$this->db->select('*')->from('cards')->where('cards.card_id', $card_id);\n\t\t$card_hdl = $this->db->get();\n\t\tforeach ($card_hdl->result() as $row) {\t\t\t\n\t\t\t$view_data['card_name'] = $row->card_name;\n\t\t\t$view_data['converted_mana_cost'] = $row->converted_mana_cost;\n\t\t\t$view_data['card_type'] = $row->card_type;\n\t\t\t$view_data['card_subtype'] = $row->card_subtype;\n\t\t\t$view_data['card_power'] = $row->power;\n\t\t\t$view_data['card_defense'] = $row->defense;\n\t\t\t$view_data['card_text'] = trim($row->card_text);\n\t\t}\n\n\t\t// On get les infos de mana pour afficher les pictos\n\t\t$this->db->select('*')->from('cards_mana_costs');\n\t\t$this->db->join('mana_forms', 'mana_forms.mana_form_id = cards_mana_costs.mana_form_id', 'left');\t\t\n\t\t$this->db->where('cards_mana_costs.card_id', $card_id)->order_by('mana_forms.display_order', 'ASC'); \n\t\t$card_infos_hdl = $this->db->get();\n\t\t$card_infos = $card_infos_hdl->result();\t\t\n\t\tforeach ($card_infos_hdl->result() as $row) {\n\t\t\t$view_data['mana_cost'][] = $row->mana_form_code;\n\t\t}\n\t\t\n\t\t// On load les editions pour l'affichage et pour trouver un scan de la carte\n\t\t$this->db->select('*')->from('cards_releases');\n\t\t$this->db->join('editions', 'editions.edition_id = cards_releases.edition_id', 'left');\n\t\t$this->db->join('rarities', 'rarities.rarity_id = cards_releases.rarity_id', 'left');\n\t\t$this->db->where('cards_releases.card_id', $card_id)->order_by('editions.date', 'DESC'); \n\t\t$card_infos_hdl = $this->db->get();\n\t\t$card_infos = $card_infos_hdl->result();\n\t\t$view_data['display_edition_code'] = null;\n\t\tforeach ($card_infos_hdl->result() as $row) {\t\t\t\n\t\t\t$view_data['rarity_name'] = $row->rarity_name;\n\t\t\t$view_data['display_editions_img'][] = array('edition_name' => $row->edition_name, 'edition_code' => $row->edition_code, 'rarity_code' => $row->rarity_code);\n\t\t\t\n\t\t\t//On trouve une images qui correspond\n\t\t\tif($view_data['display_edition_code'] == null && file_exists($_SERVER['DOCUMENT_ROOT']._IMAGES_DIR_.'scans/'.$row->edition_code.'/'.$view_data['card_name'].'.full.jpg') ) {\n\t\t\t\t$view_data['display_edition_code'] = $row->edition_code;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t$this->viewlinker->view('cards/cards_show', $view_data);\n\t}", "function data_mhs(){\r\n\t\t\techo \"KodeMataKuliah : \".$this->KodeMataKuliah.\"<br />\";\r\n\t\t\techo \"SKS : \".$this->SKS.\"<br />\";\r\n\t\t\techo \"Daftar matakuliah yang diambil:<br />\";\r\n\t\t\t\r\n\t\t\t$i = 0; // nomor urut daftar SKS matakuliah yang diambil\r\n\t\t\tforeach($this->NamaMataKuliah as $mk){\r\n\t\t\t\techo ++$i.\". \".$mk.\"<br />\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Cuma buat ganti baris aja kok :-)\r\n\t\t\techo \"<br />\";\r\n\t\t}", "public function getMaitre()\n {\n return $this->maitre;\n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "function hitungDeterminan($p1, $p2, $p3, $p4) {\n $determinan = (($p1 * $p4) - ($p2 * $p3));\n\n // menampilkan matriks\n echo \"<table style='border-left: solid black 2px; border-right: solid black 2px;' cellspacing='5' cellpadding='5'>\n <tr>\n <td> $p1 </td>\n <td> $p2 </td>\n </tr>\n <tr>\n <td> $p3 </td>\n <td> $p4 </td>\n </tr>\n </table>\";\n echo \"<h3>Determinan dari matriks tersebut adalah $determinan </h3>\"; // menampilkan teks dibawah matriks\n\n}", "public function berekenOppervlakte() {\n $opp_grondvlak = $this->x * $this->y;\n $opp_totaal = $opp_grondvlak / 2;\n return \"De uitgerekende oppervlakte van het driehoek is: \" . $opp_totaal;\n }", "function show_final_potions($pure_perk) {\n\t\techo count($this->potion_list).\" potions<br/>\".PHP_EOL;\n\t\techo \"<table>\".PHP_EOL;\n\t\techo \"<tr>\".PHP_EOL;\n\t\techo \"<th>#</th>\".PHP_EOL;\n\t\techo \"<th>Count</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 1</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 2</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 3</th>\".PHP_EOL;\n\t\techo \"<th>Effects</th>\".PHP_EOL;\n\t\techo \"<th>Value</th>\".PHP_EOL;\n\t\techo \"</tr>\".PHP_EOL;\n\t\t//for each potion: get ingredient names from database\n\t\tforeach($this->potion_list as $i => $potion) {\n\t\t\t$where = \"iid = '$potion->ingredient1'\";\n\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t$i_1 = db_CRUD::get_result()[0];\n\t\t\t$where = \"iid = '$potion->ingredient2'\";\n\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t$i_2 = db_CRUD::get_result()[0];\n\t\t\tif($potion->ingredient_cnt == 3) {\n\t\t\t\t$where = \"iid = '$potion->ingredient3'\";\n\t\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t\t$i_3 = db_CRUD::get_result()[0];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i_3 = ' ';\n\t\t\t$effect_list = '';\n\t\t\t//if purity perk is active: format effects to show voided effects\n\t\t\tif($pure_perk == 'y') {\n\t\t\t\tforeach($potion->effect as $key => $effect) {\n\t\t\t\t\tdb_CRUD::select('effect', 'e_name, poison', 'eid = '.$effect);\n\t\t\t\t\t$result = db_CRUD::get_result();\n\t\t\t\t\tif($potion->poison == $result[1])\n\t\t\t\t\t\t$effect_list .= $result[0];\n\t\t\t\t\telse\n\t\t\t\t\t\t$effect_list .= \"<del>\".$result[0].\"</del>\";\n\t\t\t\t\tif($key < count($potion->effect)-1)\n\t\t\t\t\t\t$effect_list .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($potion->effect as $key => $effect) {\n\t\t\t\t\tdb_CRUD::select('effect', 'e_name', 'eid = '.$effect);\n\t\t\t\t\t$effect_list .= db_CRUD::get_result()[0];\n\t\t\t\t\tif($key < count($potion->effect)-1)\n\t\t\t\t\t\t$effect_list .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"<tr>\".PHP_EOL;\n\t\t\techo \"<td>\".($i+1).\"</td>\".PHP_EOL;\n\t\t\techo \"<td>$potion->cnt</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_1</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_2</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_3</td>\".PHP_EOL;\n\t\t\techo \"<td>$effect_list</td>\".PHP_EOL;\n\t\t\techo \"<td>$potion->value</td>\".PHP_EOL;\n\t\t\techo \"</tr>\".PHP_EOL;\n\t\t}\n\t\techo \"</table>\".PHP_EOL;\n\t}", "function mostrar_plan(){\n\t\tif (isset($_GET['temp']) && $_GET['temp']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$temp=$_GET['temp'];\n\t\t\t$sql=\"SELECT * FROM habitaciones2 WHERE id='$temp'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->id=$id;\n\t\t\t$this->id_cat=$resultado['id'];\n\t\t\t$this->nombre=$resultado['nombre'];\n\t\t\t$this->prioridad=$resultado['orden'];\n\t\t\t$this->mostrar=$resultado['listar'];\n\t\t\t$this->descripcion=$resultado['descripcion'];\n\t\t\t$this->precio=$resultado['precio'];\n\t\t\t$this->maxadultos=$resultado['maxAdultos'];\n\t\t} \n\t}", "public function displaymahasiswa()\r\n {\r\n $query = \"select * from data_mahasiswa\";\r\n return $this->db->query($query);\r\n }", "public function admin_pengaduan_masyarakat()\n {\n $aduan = Pengaduan::latest()->get();\n return view('Admin.petugas.pengaduan', ['aduan' => $aduan]);\n }", "function xstats_displayMaxValueListMisc($gameId) {\n echo( \"<H3>Spitzenwerte im Spiel</H3>\");\n $statsAvailablePlayerIndicies = xstats_getAvailablePlayerIndicies($gameId);\n $statsMaxTurn = xstats_getMaxTurn($gameId);\n echo( xstats_displayMaxSum( $gameId, 'coloniestakencount', $statsMaxTurn, $statsAvailablePlayerIndicies ) );\n echo( xstats_displayMaxValue( $gameId, 'planetcount') );\n echo( xstats_displayMaxValue( $gameId, 'colonistcount') );\n echo( xstats_displayMaxValue( $gameId, 'cantoxcount') );\n echo( xstats_displayMaxValue( $gameId, 'lemincount') );\n echo( xstats_displayMaxValue( $gameId, 'factorycount') );\n echo( xstats_displayMaxValue( $gameId, 'minescount') );\n xstats_displayMaxWaitTime( $gameId );\n}", "function medicament($med){\n $don = json_decode($med);\n\n $this->SetFont('Arial','',15);\n $this->Cell(0,6,\"Tableau de consomation des medicaments \");\n $this->Ln();\n $this->SetFont('Times','B',12);\n $this->Cell(140,5,'Medicaments',1);\n $this->Cell(20,5,'Type',1,0,'C',0);\n $this->Cell(27,5,'Quantites',1,0,'C',0);\n $this->Ln(); \n\n $this->SetFont('Times','',12);\n foreach($don as $v){\n $this->Cell(140,5,utf8_decode($v->nom),1);\n $this->Cell(20,5,utf8_decode($v->types),1,0,'C',0);\n $this->Cell(27,5,$v->quantite,1,0,'C',0);\n $this->Ln(); \n }\n $this->Ln(); \n\n }", "public function index()\n {\n $data = Pelatihan::latest()->get();\n $anggaran = Anggaran::all();\n $anggaran->map(function ($item) {\n $item['total'] = $item->jumlah_anggaran * $item->pelatihan->kuota * $item->volume;\n\n return $item;\n });\n\n return view('admin.anggaran.index', compact('data','anggaran'));\n }", "public function mostrar_rutas(){\n for ($i=1; $i <count($this->lista_rutas) ; $i++) { \n \n for($j=0;$j< count($this->lista_rutas[$i]->getRuta());$j++){\n print_r($this->pn[$this->lista_rutas[$i]->getRuta()[$j]].\" \");\n //print_r($this->lista_rutas[$i]->getPuntaje()[$j]. \" \");\n }\n \n echo \"Resultado \";\n print_r(array_sum($this->lista_rutas[$i]->getRes()));\n echo \"<br>\";\n }\n }", "public function mostrarMarcaAction()\n {\n $repository = $this->getDoctrine()->getRepository('AmpaBundle:marca');\n // find *all* ropa\n $marca = $repository->findAll();\n return $this->render('AmpaBundle:Carpeta_marca:marcas.html.twig',array('tablaMarca' => $marca ));\n }", "public function actionKnprLapresPulau() {\n return $this->render('knpr/knpr-lapres-pulau');\n }", "function showScore()\n\t{\n\t\treturn '\n\t\t<input type=\"hidden\" id=\"score_'.$this->i.'\" value=\"'.$this->score.'\"/> \n\t\t<input type=\"hidden\" id=\"ups_'.$this->i.'\" value=\"'.$this->ups.'\"/> \n\t\t<input type=\"hidden\" id=\"downs_'.$this->i.'\" value=\"'.$this->downs.'\"/> \n\t\t<center> '\n . $this->score . \"[\" . $this->ups . \"/\" . $this->downs . \"]\" . '<br />\n\t\t</center>\n\t\t';\n\t}", "public function luas_Persegi()\n {\n $hitung = $this->lebar * $this->panjang;\n return $hitung;\n }", "public function getMataPelajaran();", "public function show(){\n\n\n /** Récupération des droit de l'utilisateur authentifié pour gérer le menu */\n $userA = Auth::user();\n $respoDI = $userA->estResponsableDI();\n $respoUE = $userA->estResponsableUE();\n $respoForm = $userA->estResponsableForm();\n\n $photoUrl = Photos::where('id_utilisateur', $userA->id)->first();\n $statuts = Statut::all();\n $civilite = User::select('civilite')->where('id', '=', $userA->id)->first();\n\n if ($civilite->civilite == \"M.\") $civilites = array(\"M.\" => \"M.\",\"Mme\" => \"Mme\");\n else $civilites = array(\"Mme\" => \"Mme\", \"M.\" => \"M.\");\n\n $photoUrl = Photos::where('id_utilisateur', $userA->id)->first();\n $tmp = null;\n\n if ($photoUrl != null) {\n $url = $photoUrl->adresse;\n $tmp = explode(\"images\", $url);\n }\n\n $statuts = Statut::all();\n $uesUserA = EnseignantDansUE::where('id_utilisateur', $userA->id)->get();\n $uesExUserA = EnseignantDansUEExterne::where('id_utilisateur', $userA->id)->get();\n $heurestotals = 0;\n\n foreach ($uesUserA as $ue) {\n\n $heurestotals = $heurestotals + $ue->cm_nb_heures*1.5 + ($ue->td_nb_groupes*$ue->td_heures_par_groupe)\n + ($ue->tp_nb_groupes*$ue->tp_heures_par_groupe)*1.5\n + ($ue->ei_nb_groupes*$ue->ei_heures_par_groupe)*1.25;\n }\n \n foreach ($uesExUserA as $ue) {\n\n $heurestotals = $heurestotals + $ue->cm_nb_heures*1.5 + ($ue->td_nb_groupes*$ue->td_heures_par_groupe)\n + ($ue->tp_nb_groupes*$ue->tp_heures_par_groupe)*1.5\n + ($ue->ei_nb_groupes*$ue->ei_heures_par_groupe)*1.25;\n }\n\n\t if ($this->getStatutVolumeMin() > 0) {\n\t $pourcentage = ($heurestotals / $this->getStatutVolumeMin())*100;\n\n if ($pourcentage > 100){\n $pourcentage = 100;\n }\n }\n else {\n\t $pourcentage = 100;\n }\n\n\n return view('profil')\n ->with('userA', $userA)\n ->with('statuts', $statuts)\n ->with('civilites', $civilites)\n ->with('photoUrl', $tmp[1])\n ->with('respoDI', $respoDI)\n ->with('respoUE', $respoUE)\n ->with('respoForm', $respoForm)\n ->with('heuresTotals', $heurestotals)\n ->with('pourcentage', $pourcentage);\n }", "public function show(Movel $movel)\n {\n //\n }", "public function renderAnimes() {\n\t\t$result = '';\n\t\tforeach ($this->getAnimes() as $anime) {\n\t\t\t$result .= $this->renderAnime($anime);\n\t\t}\t\t\n\t\treturn $result;\n\t}", "public function RicercaAvanzata(){\n $view = new VRicerca();\n $view->mostraFiltri();\n }", "function show_temp_potions($pure_perk) {\n\t\techo count($this->temp_potion).\" potions<br/>\".PHP_EOL;\n\t\techo \"<table>\".PHP_EOL;\n\t\techo \"<tr>\".PHP_EOL;\n\t\techo \"<th>#</th>\".PHP_EOL;\n\t\techo \"<th>Count</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 1</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 2</th>\".PHP_EOL;\n\t\techo \"<th>Ingredient 3</th>\".PHP_EOL;\n\t\techo \"<th>Effects</th>\".PHP_EOL;\n\t\techo \"<th>Value</th>\".PHP_EOL;\n\t\techo \"</tr>\".PHP_EOL;\n\t\tforeach($this->temp_potion as $i => $potion) {\n\t\t\t$where = \"iid = '$potion->ingredient1'\";\n\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t$i_1 = db_CRUD::get_result()[0];\n\t\t\t$where = \"iid = '$potion->ingredient2'\";\n\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t$i_2 = db_CRUD::get_result()[0];\n\t\t\tif($potion->ingredient_cnt == 3) {\n\t\t\t\t$where = \"iid = '$potion->ingredient3'\";\n\t\t\t\tdb_CRUD::select('ingredient', 'i_name', $where);\n\t\t\t\t$i_3 = db_CRUD::get_result()[0];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i_3 = ' ';\n\t\t\t$effect_list = '';\n\t\t\t//if purity perk is active: format effects to show voided effects\n\t\t\tif($pure_perk == 'y') {\n\t\t\t\tforeach($potion->effect as $key => $effect) {\n\t\t\t\t\tdb_CRUD::select('effect', 'e_name, poison', 'eid = '.$effect);\n\t\t\t\t\t$result = db_CRUD::get_result();\n\t\t\t\t\tif($potion->poison == $result[1])\n\t\t\t\t\t\t$effect_list .= $result[0];\n\t\t\t\t\telse\n\t\t\t\t\t\t$effect_list .= \"<del>\".$result[0].\"</del>\";\n\t\t\t\t\tif($key < count($potion->effect)-1)\n\t\t\t\t\t\t$effect_list .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($potion->effect as $key => $effect) {\n\t\t\t\tdb_CRUD::select('effect', 'e_name', 'eid = '.$effect);\n\t\t\t\t\t$effect_list .= db_CRUD::get_result()[0];\n\t\t\t\t\tif($key < count($potion->effect)-1)\n\t\t\t\t\t\t$effect_list .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"<tr>\".PHP_EOL;\n\t\t\techo \"<td>\".($i+1).\"</td>\".PHP_EOL;\n\t\t\techo \"<td>$potion->cnt</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_1</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_2</td>\".PHP_EOL;\n\t\t\techo \"<td>$i_3</td>\".PHP_EOL;\n\t\t\techo \"<td>$effect_list</td>\".PHP_EOL;\n\t\t\techo \"<td>$potion->value</td>\".PHP_EOL;\n\t\t\techo \"</tr>\".PHP_EOL;\n\t\t}\n\t\techo \"</table>\".PHP_EOL;\n\t}", "function printMarquesina() {\n\t\t$SQLStrQuery=\"SELECT * FROM Marquesina LIMIT 1\";\n\t\tSQLQuery($ResponsePointer,$nMarque,$SQLStrQuery,true); // Realiza la consulta\n\t\tConvertPointerToArray($ResponsePointer,$Marque,$nMarque,1); // Pertenece a dbmngmtAdmin.php\n\t\treturn $Marque;\n\t}", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "public function displayAnime ($name) {\n $anime = new Anime();\n $anime->getAnime($name);\n ?>\n <div class=\"background\">\n <div class=\"cover\">\n <?php echo $anime->getPicDir(); ?>\n </div>\n <div class=\"description\">\n <?php echo $anime->description; ?>\n </div>\n <div class=\"eps\">\n <?php\n $eps = DataBase::Current()->ReadRows(\"SELECT * from {'dbprefix'}episodes WHERE name='\".$name.\"'\");\n if ($eps) {\n foreach ($eps as $ep) {\n ?>\n <div class=\"episode<?PHP echo $ep->episode; ?>\">\n <?php\n echo $ep->name;\n echo $ep->title;\n ?>\n </div>\n <?php\n }\n }\n ?>\n </div>\n </div>\n <?PHP\n }", "public function mostra(){\n echo \"<tr><td>\".$this->codi.\"</td><td>\".$this->nom.\"</td></tr>\";\n }", "function calculeaza_tva($pret) {\n\tglobal $tva; // variabila globala\n\n\t$pret_cu_tva = $pret * $tva;\n\treturn \"pret fara tva: <b>$pret</b> Pret cu tva: <b>$pret_cu_tva</b>\" ;\n}", "public function show(Peminjaman $peminjaman)\n {\n //\n \n }", "public function show()\n {\n echo 'Value: ' . $this->value . '<br>';\n }", "function votoMedio($nome) {\n\t$rows = selectVotoMedio($nome);\n\t$voto = 0;\n\tforeach ($rows as $row){\n\t\t$voto = $row[\"votoMedio\"];\n\t}\n\t$votoFormattato = number_format($voto, 1);\n\treturn $votoFormattato;\n}", "public function show(medicina $medicina)\n {\n //\n }", "public function berekenOppervlakte() {\n $opp_grondvlak = Figuur::$PI * $this->y * $this->y;\n $opp_mantel = 2 * Figuur::$PI * $this->y * $this->x;\n $opp_totaal = $opp_grondvlak + $opp_grondvlak + $opp_mantel;\n\n return \"De uitgerekende oppervlakte van de cilinder is: \" . $opp_totaal;\n }", "public function show(Relevamiento $relevamiento)\n\t{\n\t\t//\n\t}", "public function anime(){\t\n\t\t\t$LimitRowPegination = 4;\n\t\t\t$API_LastUpdateAnime = SiteMap::LastUpdateAnime(18,0,$LimitRowPegination);\n\t\t\t$PTR_API['API_LastUpdateAnime'] = $API_LastUpdateAnime;\n\t\t\t$this->load->view('seo/sitemap_anime',$PTR_API);\n\t\t}", "function rekamMedis($nomor_pasien)\n\t{\n\n\t}", "public function afficherPanier(){ \n $txt = \"\";\n foreach($this->listeProduits as $value){\n\t$p = $value[0]; // objet produit\n\t$q = $value[1]; // quantité\n\t$txt .= $q . \" unités x \" . $p->getNomProduit() . \" à \" .\n\t$p->getPrixHTVA() . \" euros\\n\";\n\t}\t\n\treturn $txt;\n }", "public function elegir()\n {\n // Trae todas las marcas\n $marcas = Marca::all();\n // Las devuelve a la vista MarcaElegir para poder elegir alguna\n return view('marcaElegir', compact('marcas'));\n }", "public function showSomeMonumentsAction()\n {\n //la création de l'entité Manager par l'appel de doctrine (notre ORM)\n $em=$this->getDoctrine()->getManager();\n //la récupération de données avec Repository\n $tab=$em->getRepository(Monument::class)->findAll();\n return $this->render('@Museum/Monument/showSomeMonuments.html.twig',array('Monument'=>$tab));\n }", "public function printPusryciai(){\n return $this->pusryciai;\n echo $pusryciai;\n }", "public function getShow($id)\n {\n return view('inventory/munits.show')->with([\n\t\t\t'munits' \t => Unit::findOrFail($id), \n\t\t\t$this->menuKey => $this->menuValue\n\t\t]);\n }", "public function medicine_history_dispense()\n {\n return view('hact.reports.medicine.medicine_dispense');\n }", "public function getMarca(){ return $this->marca;}", "function paludisme($nb_susp,$nb_tdr_moins,$nb_tdr_plus,$nb_traite){\n $this->SetFont('Arial','',15);\n $this->Cell(0,6,\"Tableau de Paludisme\");\n $this->Ln();\n $this->SetFont('Times','',12);\n $this->Cell(140,5,\"Nombre de supect de paludisme \",1);\n $this->Cell(14,5,$nb_susp,1,0,'R');\n $this->Ln();\n $this->Cell(140,5,utf8_decode(\"Nombre de cas de paludisme testés\"),1);\n $this->Cell(14,5,$nb_tdr_moins + $nb_tdr_plus,1,0,'R');\n $this->Ln();\n $this->Cell(140,5,\"Nombre de cas de TDR+\",1);\n $this->Cell(14,5,$nb_tdr_plus,1,0,'R');\n $this->Ln();\n $this->Cell(140,5,utf8_decode(\"Nombre de cas de paludisme traités (confirmé)\"),1);\n $this->Cell(14,5,$nb_traite,1,0,'R');\n $this->Ln();\n $this->Ln();\n }", "public function show(){\n return 'hola desde la funcion show';\n }", "public function viewAction()\n {\n $em = $this->getDoctrine()->getManager();\n $repository = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository('MoezBackBundle:paquet');\n $listePaquets=$repository->FindPaquetExpirired();\n foreach ($listePaquets as $paquet)\n {\n $paquet->setEtat(\"fini\");\n\n $em->flush();\n }\n\n $paquets = $em->getRepository('MoezBackBundle:paquet')->findAll();\n\n return $this->render('@MoezBack/paquet/v.html.twig', array(\n 'paquets' => $paquets,\n ));\n }", "public function __toString(){\n\t\t\t//imprimir resultados\n\t\t\treturn \"<h2>Resultados</h2> <b>Edad: </b>\" .$this->edad. \" a&ntilde;os<br> <b>Altura: </b>\" .$this->altura. \" cm<br> <b>Peso:</b> \" .$this->peso. \" kg<br> <b>IMC:</b> \"\n\t\t\t. self::imc();// . self::registro() ;\t//Llamar a un metodo declarado dentro de la misma clase\n\t\t}", "function aurora_borealis() {\n\t$chosen = steamed_hams_get_lyric();\n\techo \"<p id='seymour'>$chosen</p>\";\n}", "public function actionMasaze_i_tretmani()\n\t{\n\t $this->getLang();\n\t\t$this->base('masaze_i_tretmani');\n $this->naslovStranice = 'Masaže i Tretmani';\n\t\t$this->render('clanak');\n \n\t}", "public function message()\n {\n return 'Valor Aprobado y Cotizado no son iguales.';\n }", "public function showPrice() {\n return 'This ' .$this->getColor() .' vehicle cost ' . $this->getPrice() ;\n }", "function muestra($valor,$renglon)\n\t{\n\n\t\tif($renglon % 2){\n\t\t\t$fondo = \"#bbbbbb\";\n\t\t}else{\n\t\t\t$fondo = \"#ffffff\";\n\t\t}\n\t\tif ($valor < 0.5) {\n\t\t\t$color = \"red\";\n\t\t}else{\n\t\t\t$color = \"blue\";\n\t\t}\n\t\techo \"<td bgcolor='$fondo'><font color='$color'>$valor</font></td>\\n\";\n\t}", "public function show(Mandat $mandat)\n {\n //\n }", "function xstats_displayMaxValueListShips($gameId) {\n echo( \"<H3>Spitzenwerte im Spiel</H3>\");\n $statsAvailablePlayerIndicies = xstats_getAvailablePlayerIndicies($gameId);\n $statsMaxTurn = xstats_getMaxTurn($gameId);\n echo( xstats_displayMaxSum( $gameId, 'lj', $statsMaxTurn, $statsAvailablePlayerIndicies ) );\n echo( xstats_displayMaxValue( $gameId, 'shipcount') );\n echo( xstats_displayMaxValue( $gameId, 'freightercount') );\n echo( xstats_displayMaxValue( $gameId, 'shipcount-freightercount') );\n echo( xstats_displayMaxValue( $gameId, 'sumcargohold') );\n}", "public function show(Manuales $manuales)\n {\n //\n }", "public function avancer($vitesse) {\n $this->vitesse = $vitesse;\n\n return \"la voiture roule à \" .$this->vitesse.\"km/h\";\n}", "public function vreme()\n {\n return view('mladenovac.vreme');\n }", "public function getFraisHorsForfait($mois) {\n $idVisiteur = Session::get('id');\n $unFrais = new GsbFrais();\n $mesFraisHorsForfait = $unFrais->getLesFraisHorsForfait($idVisiteur, $mois);\n $titreVue = \"Liste des frais hors forfait de la fiche \" . $mois;\n // On affiche la liste des Frais Hors Forfait\n $montantTotal = 0;\n foreach ($mesFraisHorsForfait as $fhf){\n $montantTotal = $montantTotal + $fhf->montant;\n }\n return view('listeFraisHorsForfait', compact('mesFraisHorsForfait', 'mois', 'titreVue','montantTotal'));\n }", "public function display_acheter(){\n $bien = \\App\\Annonce_bien::where('type_annonce_id', 5)->take(6)->get();\n $type_b=\\App\\Type_bien::pluck('nom','id');\n $type_a=\\App\\Type_annonce::pluck('name','id');\n $region=\\App\\Region::pluck('nom','id');\n return view('menu.acheter', compact('bien','type_b','type_a','region'));\n }", "public function show(MataKuliah $mataKuliah)\n {\n //\n }", "public function getPanjRengM()\n {\n return $this->panj_reng_m;\n }", "public function adminStatsAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\n\t\t// redirection des non-admins\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location: account');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t//récupération des infos produits\n\t\t$productsManager = new ProductsManager();\n\t\t$products = $productsManager -> getAllWithStats();\n\n\t\t//pour tous les produits, récupération du total des ventes s'ils ont déjà été vendus\n\t\t$productsNumber = $productsManager -> count();\n\t\tfor ($i=0; $i < $productsNumber; $i++) { \n\t\t\tif ($products[$i]['quantityOrdered'] === null) {\n\t\t\t\t$products[$i]['quantityOrdered'] = 0;\n\t\t\t\t$products[$i]['total']['HTTotal'] = 0;\n\t\t\t\t$products[$i]['total']['TTCTotal'] = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$products[$i]['total'] = $productsManager -> getTotal($products[$i]['productId']); \n\t\t\t}\n\n\t\t}\n\t\t$this -> viewData['products'] = $products;\n\n\t\t//récupération des infos de catégories\n\t\t$categoriesManager = new CategoriesManager();\n\t\t$this -> viewData['categories'] = $categoriesManager -> getAll();\n\t\t$this -> viewData['CSRFToken'] = $customer['CSRFToken'];\n\t\t$this -> generateView('products/admin-stats.phtml');\n\t}", "function promedios_por_materia($vector){\n echo \"<hr> ############# Promedios por materia #############\";\n $calificacion1=0;\n $calificacion2=0;\n $calificacion3=0;\n $calificacion4=0;\n $calificacion5=0;\n $calificacion6=0;\n foreach ($vector as $key => $value) {\n $calificacion1=$calificacion1+$vector[$key][0];\n $calificacion2=$calificacion2+$vector[$key][1];\n $calificacion3=$calificacion3+$vector[$key][2];\n $calificacion4=$calificacion4+$vector[$key][3];\n $calificacion5=$calificacion5+$vector[$key][4];\n $calificacion6=$calificacion6+$vector[$key][5];\n }\n $prom=$calificacion1/10;\n echo \"<br> Promedio materia 1: \".$prom;\n $prom=$calificacion2/10;\n echo \"<br> Promedio materia 2: \".$prom;\n $prom=$calificacion3/10;\n echo \"<br> Promedio materia 3: \".$prom;\n $prom=$calificacion4/10;\n echo \"<br> Promedio materia 4: \".$prom;\n $prom=$calificacion5/10;\n echo \"<br> Promedio materia 5: \".$prom;\n $prom=$calificacion6/10;\n echo \"<br> Promedio materia 6: \".$prom;\n }", "public function daftarPerusahaan()\n {\n $admin = Admin::where('level','perusahaan')->get();\n\n return view('/admin/data_admin_perusahaan', compact('admin'));\n }", "function getVat($productId, $showPercent = '')\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Preis,UstZone FROM \" . PREFIX . \"_modul_shop_artikel WHERE Id = '$productId'\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\r\n\t\t$sql2 = $GLOBALS['db']->Query(\"SELECT Wert FROM \" . PREFIX . \"_modul_shop_ust WHERE Id = '$row->UstZone'\");\r\n\t\t$row2 = $sql2->fetchrow();\r\n\t\t$sql2->close();\r\n\r\n\t\t$mu = explode('.', $row2->Wert);\r\n\t\t$multiplier = (strlen($mu[0])==1) ? '1.0' . $mu[0] . $mu[1] : '1.' . $mu[0] . $mu[1];\r\n\r\n\t\t$vat = ($showPercent==1) ? $row2->Wert : $multiplier;\r\n\t\treturn $vat;//echo \"$row->Preis / 100 * $row2->Wert --> $vat € (Multi:$multiplier)<br>\";\r\n\t}", "public function ToString() {\n\n echo \"Información de la figura:<br>\n \n -Color: {$this->_color} <br>\n -Perimetro: {$this->_perimetro} <br>\n -Superficie: {$this->_superficie} <br>\";\n }" ]
[ "0.6146755", "0.60834306", "0.5960743", "0.5910915", "0.58897215", "0.5688248", "0.5672813", "0.56533855", "0.5647011", "0.56231403", "0.5581109", "0.5564898", "0.5560913", "0.55602664", "0.5548997", "0.55343515", "0.5518477", "0.5485794", "0.54725397", "0.5461679", "0.5411311", "0.5407826", "0.54040664", "0.53890467", "0.53837216", "0.53798026", "0.53628", "0.5359725", "0.5355704", "0.53523874", "0.53376275", "0.533467", "0.5333578", "0.53248364", "0.5322981", "0.5322526", "0.53191555", "0.53188926", "0.53159577", "0.53153247", "0.5302496", "0.52992994", "0.5296334", "0.528498", "0.5277972", "0.52776223", "0.5276404", "0.5275065", "0.5274174", "0.5271999", "0.52622753", "0.5261657", "0.52602726", "0.525875", "0.52587396", "0.52494776", "0.5249011", "0.5247347", "0.52396846", "0.5236782", "0.52365404", "0.5232187", "0.52243024", "0.52232474", "0.5222325", "0.52209544", "0.52204925", "0.5217439", "0.52162683", "0.52073747", "0.52034575", "0.5202497", "0.51988757", "0.51982176", "0.5197991", "0.5192866", "0.5188181", "0.5187424", "0.51820654", "0.5178392", "0.51756096", "0.5173217", "0.5168336", "0.5168319", "0.5165871", "0.5151396", "0.51430666", "0.5141374", "0.51362884", "0.5133499", "0.51272357", "0.5121114", "0.51156574", "0.5115115", "0.51140046", "0.5103388", "0.5101971", "0.5101871", "0.50969553", "0.50946045", "0.5093125" ]
0.0
-1
Display the specified resource.
public function show($id) { $data = Cate::find($id); return [ 'result' => new Result(true), 'data' => $data, ]; }
{ "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
Update the specified resource in storage.
public function update(CateUpdateRequest $request, $id) { $cate = Cate::find($id); $cate->fill($request->input()); $cate->save(); return [ 'result' => new Result(true), 'cate' => $cate ]; }
{ "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
Function used to set job response
public function setResponse(bool $success, string $message = '', $content = null): self { $this->response = new ResponseModel($success, $message, $content); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setResponse() {\n }", "function set_Json_Response()\n {\n $this->setCommand();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }", "public function setResponse( $response ){\n \n $this->response = $response;\n \n }", "public function setResponse(Response $response) {}", "private function setResult($res) {\n\t\t$this->result = $res;\n\t\t$this->statusCode = $this->result['FbiMsgsRs']['@attributes']['statusCode'];\n\t\t//$this->statusMsg = $this->result['FbiMsgsRs']['@attributes']['statusMessage'];\n\t}", "public function setResponse(Response $response)\n\t{\n\t\t$this->_output = $output = new Output;\n\t\t$response->setBodyGenerator(function() use($output)\n\t\t{\n\t\t\t$output->sendBody();\n\t\t});\n\t}", "abstract public function response();", "function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}", "function setResponse(){\n\t// Set the response message header\n\t// This example just sets a basic header response but you may need to \n\t// add some more checks, authentication, etc \n\t$header = array(\n\t\t'status'\t=> 'ok',\n\t\t'message'\t=> 'Service call was successful'\n\t);\n\t\n\treturn $header; \n}", "private function processOptions()\r\n {\r\n $this->response = new Response(null, 200);\r\n }", "public function setResponse($response)\n\t{\n\t\t$this->response = $response;\n\t}", "protected function sendResponse() {}", "public function Response($response) {\n\t\t\n\t}", "protected function _handleResponse(){\n $this->_results[] = array(\n 'http_code' => $this->getInfoHTTPCode(),\n 'response' => $this->getResponse(),\n 'server' => $this->getUrl()\n );\n }", "public function response()\n {\n }", "protected function _response() {}", "public function setSuccessResponse()\r\n {\r\n $this->setResponse(self::STATUS_CODE_OK);\r\n }", "public function post()\n\t{\n\t\t\n\t\t$this->plugin->setResponse( $result );\n\t}", "private function after_execute($response)\n {\n }", "public function update_job_response($job_responses,$update_data) {\n\t\t$this->db->where_in('applyid', $job_responses);\n\t\treturn $this->db->update('apply_job',$update_data);\n\t}", "public function send_response() {\n\t\n\t\t$return = $this->get_response();\n\t\t\n\t\t/* send it and terminate this instance */\n\t\tif($this->get_errors()) {\n\t\t\twp_send_json_error($return);\t\t\t\t\t\t\n\t\t} else {\n \t\tif( null === $this->wp_query ) {\n \t\t\twp_send_json_success($return); \t\t \t\t\n \t\t} else {\n \t\t\n \t\t\t$data = array(\n \t\t\t'success' => true,\n \t\t\t'data' => $return,\n \t\t\t'query' => $this->parse_wp_query_object_2_js( $this->wp_query )\n \t\t\t);\n \t\t\twp_send_json($data); // build a custom wp_send_json_success with an extra property \n \t\t}\t\t\t\n\t\t}\n\t}", "public function response ();", "public function setPaymentExecutionResult($response, $request) {\n $this->paymentExecutionResult = $response;\n }", "public function response();", "public function sendResponse();", "public function hello($request, $response, $args){\n// \t\t$c->test();\n// \t\techo $c->test;\n\n \t\t$c = new BatchJob();\n \t\t$c->hello();\n \t\t\n \t\tdie();\n \t\n \t\t$w = new FeedbackQueue();\n \t\techo \"<pre>\";\n \t\tprint_r(get_class_methods($response));\n \t\t$this->view->logger->info(\"!!!!!!!!!!!!!!!!!!!\");\n \t\treturn $response->withJson(array(\"data\"=>\"Tetete\"));\n }", "protected function construct_response()\n {\n $this->feedback['ok'] = $this->ok;\n $this->feedback['code'] = $this->code;\n $this->feedback['resource'] = $this->resource;\n }", "public function getResponse($response) {\r\n\r\n\r\n }", "public function responseAction() {\n\n if ($this->_user == 'user') {\n $this->_redirect('/');\n }\n\n $form = new Yourdelivery_Form_Testing_Response();\n $testCaseId = (integer) $this->getRequest()->getParam('id');\n $testCaseExpId = (integer) $this->getRequest()->getParam('eid');\n try {\n $testCase = new Yourdelivery_Model_Testing_TestCase($testCaseId);\n $testCaseExpectation = new Yourdelivery_Model_Testing_TestCaseExpectation($testCaseExpId);\n } catch (Yourdelivery_Exception_Database_Inconsistency $exc) {\n $this->error('Requested site does not exists.');\n $this->_redirect('/testing_cms/');\n return;\n }\n\n $this->view->title = $testCase->getTitle();\n $this->view->testCaseExp = $testCaseExpectation;\n $this->view->testCaseId = $testCaseId;\n $this->view->testCaseExpectationId = $testCaseExpId;\n $this->view->userName = $this->_user;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $values['testCaseId'] = $testCaseId;\n $values['testCaseExpectationId'] = $testCaseExpId;\n $testCaseExecutor = new Yourdelivery_Model_Testing_TestCaseExecutor();\n $testCaseExecutorsResponse = new Yourdelivery_Model_Testing_TestCaseExecutorsResponse();\n $testCaseExecutor->setData($values);\n $values['testCaseExecutorId'] = $testCaseExecutor->save();\n if (strlen($values['response']) > 0) {\n $values['additionalInfo'] = $_SERVER['HTTP_USER_AGENT'];\n $email = new Yourdelivery_Sender_Email_Template('testing_cms_response');\n $email->setSubject('Testing-CMS-Response');\n $email->assign('link', sprintf('/testing_cms/responsestats/id/%s/eid/%s', $values['testCaseId'], $values['testCaseExpectationId']));\n $email->assign('msg', $values['response']);\n $email->assign('tester', $values['executor']);\n $email->addTo('[email protected]');\n $email->addTo('[email protected]');\n $email->send();\n }\n $testCaseExecutorsResponse->setData($values);\n $testCaseExecutorsResponse->save();\n $nextId = $testCase->getNextId($testCaseExpId);\n $this->success('Saved response.');\n\n\n\n if (is_null($nextId)) {\n $this->_redirect(sprintf('testing_cms/overviewexecutor/id/%d', $testCaseId));\n }\n $this->_redirect(sprintf('testing_cms/response/id/%d/eid/%d', $testCaseId, $nextId['id']));\n } else {\n $this->error($form->getMessages());\n $this->_redirect(sprintf('testing_cms/response/id/%d/eid/%d', $testCaseId, $testCaseExpId));\n }\n }\n }", "public function setResponse(Response $response): void;", "public function setResponse(array $response)\n {\n $this->response = $response;\n }", "private static function response()\n {\n $response = self::$response;\n self::$response = [Key::STATUS => Key::FAILED, Key::CODE => '', Key::MESSAGE => '', Key::DATA => []];\n return $response;\n }", "static function setResponse($msg, $suc = false, $val = array()){\n self::$response = array(\n 'success' => $suc,\n 'message' => $msg,\n 'values' => $val\n );\n }", "function jobInfoOutput($output)\n {\n\n $dataUndefined = empty($output) ? '' : $this->jobDetailsoutput($output);\n\n return response()->json(['job' => $dataUndefined]);\n }", "abstract protected function setresults();", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "public function CallBack($response);", "public function sendResponse($result, $exitWhenDone = false)\n {\n }", "public function setHttpResponse($httpResponse);", "public function & GetResponse ();", "function updateResponse($name, $value) {\n\t\t\t$this->responseVar[$name] = $value;\n\t\t}", "public function setUpDefaultVars() {\n $this->response['numAttempts'] = new qti_variable('single', 'integer', array('value' => 0));\n $this->response['duration'] = new qti_variable('single', 'float', array('value' => 0));\n $this->outcome['completionStatus'] = new qti_variable('single', 'identifier', array('value' => 'not_attempted'));\n \n // TODO: We have this to get around mistakes (?) in the example QTI - should we?\n $this->outcome['completion_status'] = $this->outcome['completionStatus'];\n }", "private function responseHandle() {\n // call hook function\n is_callable(config('hooks.onResponse')) && call_user_func(config('hooks.onResponse'), $this);\n // response data\n $this->responder->output();\n }", "private function setResponse($msg){\n $_SESSION[self::RESPONSE_SESSION] = $msg;\n }", "public function setResponse(namespace\\Response $response)\n {\n $this->response = $response;\n }", "public function setResponse(Response $response)\n {\n $this->_response = $response;\n }", "public function amend_customize_save_response($data)\n {\n }", "public function amend_customize_save_response($data)\n {\n }", "public function store_result() {}", "private function setQueue() {\n if (count($this->request->q) > 0) {\n try {\n $this->client->setQueue(array($this->request->q));\n $this->view->addParameter(\"result\", \"success\");\n } catch(Exception $e) {\n $this->view->addParameter(\"result\", \"failure\");\n $this->view->addParameter(\"data\", \"Failed to execute '{$this->request->action}' action\");\n }\n } else {\n $this->view->addParameter(\"result\", \"invalid\");\n $this->view->addParameter(\"data\", \"Query array must not be empty\");\n }\n }", "public function exec(): ResponseBean\n {\n }", "public function testSetJobNameSetsCall()\n {\n $this->class->set_job_name('job');\n\n $this->assertEquals('resque/job', $this->get_reflection_property_value('request')['call']);\n }", "protected function afterResponse()\n {\n }", "public function setResponse(Response $response) {\n $this->response = $response;\n }", "public function respon(){\n //update 'status'\n }", "public function CallBack($response) {\n\t\n\t}", "function response($code){\n $this->response_code = $code;\n }", "protected function run()\n {\n //to use\n\n //$this->task is available here\n //$this->queue is available here\n\n //set $this->exit_response to any value before returning\n //with a EXIT_STATUS. This will be saved to response column of the $task object.\n\n //if you want to retry\n //return self::EXIT_STATUS_RETRY\n\n //if you do not want to retry\n //return self::EXIT_STATUS_RETRY\n\n //if success\n //return self::EXIT_STATUS_OK\n\n\n }", "function erase_response() {\n $this->performed = FALSE;\n $this->response = new Trails_Response();\n }", "protected function process_response( $response ) {\n\n\t\t$this->response = $response;\n\n\t\tdo_action( 'wp_mail_smtp_providers_gmail_mailer_process_response', $this->response, $this->phpmailer );\n\t}", "public function respond()\n {\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n }", "public function setResponse(Response $response)\n {\n $this->response = $response;\n }", "function yms_send_response($success_string, $result)\n{\n global $lang, $output;\n \n if ( $result === true )\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'success',\n 'message' => $lang->get($success_string)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"info-box\">' . $lang->get($success_string) . '</div>'\n );\n }\n }\n else\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'error',\n 'error' => $lang->get($result)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"error-box\">' . $lang->get($result) . '</div>'\n );\n }\n }\n}", "public function set_returned($returned) {\n $this->returned = $returned;\n }", "public function prepareResponse();", "public function setResponseStatus($status) {}", "public function getResponse()\n {\n }", "protected function processing()\n {\n $this->response = $this->response->withStatus(203);\n $this->jsonBody($this->payload->getOutput());\n }", "private function _setReponseArray() {\n try {\n $this->RESP = array(\n 'MSG' => $this->MSG,\n 'STATUS' => $this->STATUS\n );\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setReponseArray function - ' . $ex);\n }\n }", "public function setHttpResponse(ResponseInterface $response)\n {\n // assign the http response instance itself.\n $this->responseInstance = $response;\n\n // assign the http response status code.\n $this->responseStatusCode = $response->getStatusCode();\n\n // assign the http response status message.\n $this->responseStatusMessage = $response->getReasonPhrase();\n\n // assign the http response headers.\n $this->responseHeaders = collect($response->getHeaders());\n\n // assign the parsed http response body.\n $this->responseBody = $this->decodeResponseBody($response->getBody());\n\n }", "public function getResponse() {\n\t}", "public function markresolvedAction() {\r\n \r\n \t$log_id = $_POST['log_id'];print_r();\r\n \t$this->jobs->resolve($log_id);\r\n \t$data = array();\r\n \t$data['status'] = \"success\";\r\n \t$data['message'] = \"Alert resolved successfully.\";\r\n \techo json_encode($data);\r\n \tdie;\r\n }", "abstract public function processResponse($response);", "public function setResponse(ResponseInterface $request);", "public function setResponse(Response $response) {\n $this->_response = $response;\n $this->_isHandled = true;\n }", "public function setResult($result)\n\t{\n\t\t$this->result = $result;\n\t}", "protected final function getResponse()\n {\n $this->response = \n $this->communicator->getResponse($this->buildCommand());\n }", "protected function build_ipp_jobs_response($jobs=null) {\n\t}", "public function setResponseQuestion()\n {\n if($this->input->server('REQUEST_METHOD') == 'GET')\n {\n if (isset($_GET[\"call_id\"]) && isset($_GET[\"user_id\"]) && isset($_GET[\"question_id\"]) && isset($_GET[\"response\"]))\n {\n $response_data = array(\n 'call_id' => $this->input->get('call_id'),\n 'user_id' => $this->input->get('user_id'),\n 'question_id' => $this->input->get('question_id'),\n 'response' => $this->input->get('response')\n );\n\n $this->form_validation->set_data($response_data);\n $this->form_validation->set_rules($this->Question_model->setResponse());\n\n //On Wrong Validation\n if($this->form_validation->run() == FALSE)\n {\n echo json_encode(array('result' => array('error' => true, 'message' => validation_errors())));\n return;\n }\n\n if($response_data['response'] == 3)\n {\n $response_data['response'] = \"like\";\n }\n elseif($response_data['response'] == 4)\n {\n $response_data['response'] = \"dislike\";\n }\n elseif($response_data['response'] == 5)\n {\n $response_data['response'] = \"report\";\n }\n else\n {\n $response_data['response'] = \"invalid\";\n }\n //Insert Response Data\n $response_id= $this->Question_model->insertResponse($response_data);\n if($response_id)\n {\n echo json_encode(array('result' => array('error' => false)));\n return;\n }\n echo json_encode(array('result' => array('error' => true)));\n return;\n\n\n }\n\n else\n {\n echo json_encode(array('result' => array('error' => true, 'message' => 'wrong params')));\n return;\n }\n }\n }", "public function getResponseOutput() {\n // Empty, to be overridden\n }", "public function getResponse() {\n }", "private function after_execute_actions($response, $key = null)\n {\n }", "public function getResponse() {}", "public function getResponse() {}", "public function reply()\n\t{\n\t\tif($this->return){\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}else{\n\t\t\t$this->_reply(200, 'Ok', $this->return);\n\t\t}\n\t\texit();\n\t}", "public static function setResponse(ResponseInterface $response)\n {\n $coroutineId = self::getCoroutineId();\n self::$context[$coroutineId][self::RESPONSE_KEY] = $response;\n }", "public function execute()\n\t{\n\t\t$iso = $this->getLanguage()->getISO();\n\t\t$_SERVER['REQUEST_URI'] = preg_replace(\"/_lang=[a-z]{2}/\", \"_lang=\".$iso , urldecode($_SERVER['REQUEST_URI']));\n\t\t$_REQUEST['_lang'] = $iso;\n\t\tGDO_Session::set('gdo-language', $iso);\n\t\tTrans::setISO($iso);\n\t\t\n\t\t# Build response\n\t\t$response = GDT_Success::responseWith('msg_language_set', [$this->getLanguage()->displayName()]);\n\t\t\n\t\t# Redirect if 'ref' is set\n\t\tif ($url = $this->gdoParameterVar('ref'))\n\t\t{\n\t\t\t$url = preg_replace(\"/_lang=[a-z]{2}/\", \"_lang=\".$iso , $url);\n\t\t\t$response->addField(Website::redirect($url));\n\t\t}\n\n\t\treturn $response;\n\t}", "public function setResponse(Response $response)\n {\n $this->response = $response;\n \n $this->stopPropagation();\n }", "public function resetResponse()\n\t{\n\t\t$this->_response = NULL;\n\t\t$this->_redirect = NULL;\n\t}", "public function setJobOrder()\n {\n $input = Request::all();\n $validator = Validator::make($input, [\n 'order' => 'required',\n 'job_id' => 'required',\n 'board_id' => 'required',\n ]);\n if($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n $job = $this->jobRepo->getById($input['job_id']);\n $board = $this->service->getById($input['board_id']);\n $response = $this->service->setJobOrder($board, $job, $input['order']);\n return ApiResponse::success([\n 'message' => trans('response.success.updated', ['attribute' => 'Order'])\n ]);\n }", "private function successResponse($input) {\n\t\t$result = new stdClass;\n\t\t$result->success = true;\n\t\t$result->id = $input->job[0][\"id\"];\n\t\t$result->msgid = $input->msgid;\n\t\t$result->url = $input->job[0][\"apply\"];\n\t\t$result->msg = \"\";\n\n\t\treturn $result;\n\t}", "public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}", "protected function setResponse($status_code, $message='')\r\n {\r\n $this->response_vars['status_code'] = $status_code;\r\n $this->response_vars['message'] = $message;\r\n }", "public function scheduleJob(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface {\n $command = $this->commandFactory->create('Feature');\n $command->setParameters($request->getParsedBody());\n $this->commandBus->handle($command);\n\n $command = $this->commandFactory->create('ResponseDispatch');\n $command\n ->setParameter('request', $request)\n ->setParameter('response', $response)\n ->setParameter('statusCode', 201);\n\n return $this->commandBus->handle($command);\n }", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $args) { \n $current_time = DateTimeComponent::getDateTime();\n \n $end_time = $current_time + self::RESET_QUOTA_PROCESS_LIMIT_TIME;\n $num_records_processed = 0;\n\n $reminder = (int) $_SERVER[\"argv\"][2];\n $modulo = (int) $_SERVER[\"argv\"][3];\n\n LoggerComponent::log(\"Reset quota process start\", self::LOG_FILE_QUOTA_RESET_PROCESS);\n\n $model_account_sending_methods = new AccountSendingMethods();\n\n while ($current_time <= $end_time) {\n\n $condition = [\n \"fields\" => [\n \"asm.id\",\n \"asm.total_limit\",\n \"abm.plan_id\"\n ],\n \"where\" => [\n [\"where\" => [\"asm.next_reset\", \"<=\", $current_time ]],\n [\"where\" => [\"asm.status\", \"<>\", SHAppComponent::getValue(\"app_constant/STATUS_DELETE\") ]]\n ],\n \"join\" => [\n \"account_billing_master\"\n ],\n \"limit\" => 1 \n ];\n \n if ( !empty($modulo) && !is_null($reminder) ) {\n $condition[\"where\"][] = [\"where\" => [\"asm.id%\" . $modulo, \"=\", $reminder ]]; \n }\n\n try {\n $row_data = $model_account_sending_methods->fetch($condition);\n\n } catch(\\Exception $e) {\n LoggerComponent::log(\"Database error: \" . $e->getMessage(), self::LOG_FILE_QUOTA_RESET_PROCESS);\n }\n\n if (!empty($row_data[\"id\"])) {\n\n LoggerComponent::log(\"Start process of #\" .$row_data[\"id\"], self::LOG_FILE_QUOTA_RESET_PROCESS);\n \n try {\n \n $save = $model_account_sending_methods->setQuota($row_data[\"plan_id\"], $row_data[\"id\"]);\n\n if ($save) {\n LoggerComponent::log(\"Quota reset of #\" . $row_data[\"id\"] . \" is successfully\", self::LOG_FILE_QUOTA_RESET_PROCESS);\n } else {\n LoggerComponent::log(\"Quota not reset #\" . $row_data[\"id\"] . \" Error :\" . $model_account_sending_methods->getQueryError(), self::LOG_FILE_QUOTA_RESET_PROCESS);\n }\n\n } catch(\\Exception $e) {\n LoggerComponent::log(\"Database error of #\" . $row_data[\"id\"] . \" Error :\" . $e->getMessage(), self::LOG_FILE_QUOTA_RESET_PROCESS);\n }\n\n LoggerComponent::log(\"Process Finished for Reset Quota of #\". $row_data[\"id\"], self::LOG_FILE_QUOTA_RESET_PROCESS);\n \n } else {\n LoggerComponent::log(\"Record not found to be processing\", self::LOG_FILE_QUOTA_RESET_PROCESS);\n break;\n }\n\n $current_time = DateTimeComponent::getDateTime();\n $num_records_processed++;\n }\n\n LoggerComponent::log(\"Total \".$num_records_processed.\" records to be proceed\", self::LOG_FILE_QUOTA_RESET_PROCESS);\n LoggerComponent::log(\"===================================================\", self::LOG_FILE_QUOTA_RESET_PROCESS);\n \n }", "private function setResponse($response)\n {\n if (!is_array($response) && !is_object($response)) {\n\n $this->response = json_decode((string) $response, true);\n }\n }", "public function saveResponse($responseID, $response);" ]
[ "0.6955188", "0.63468874", "0.59772277", "0.59672487", "0.59569657", "0.5909629", "0.58698195", "0.58636844", "0.58546287", "0.5849248", "0.5826125", "0.57500404", "0.5709512", "0.5672829", "0.565541", "0.56550103", "0.5651117", "0.56470084", "0.56395155", "0.56302196", "0.5601901", "0.55741686", "0.55407286", "0.5485997", "0.5475529", "0.54711884", "0.54625654", "0.5460709", "0.54564404", "0.5455425", "0.5436541", "0.5418074", "0.54028696", "0.5393002", "0.5365226", "0.5354881", "0.53544796", "0.53544796", "0.53544796", "0.5345173", "0.5344243", "0.5341596", "0.53155875", "0.53132325", "0.5309099", "0.53052706", "0.53005785", "0.53000945", "0.52896345", "0.52879447", "0.52879447", "0.52836823", "0.52825487", "0.5277962", "0.525509", "0.5253017", "0.52491975", "0.5249078", "0.52449214", "0.5238485", "0.5238358", "0.52349114", "0.5231437", "0.52305925", "0.5211771", "0.5211771", "0.52110624", "0.5204803", "0.51904655", "0.51889944", "0.5187117", "0.5185081", "0.5182403", "0.51807594", "0.51785827", "0.5178126", "0.51749456", "0.51739186", "0.5173722", "0.51689494", "0.5156785", "0.51557904", "0.51519686", "0.51465607", "0.5144679", "0.5136401", "0.51217693", "0.51217693", "0.5111264", "0.51044416", "0.5101932", "0.5093094", "0.509179", "0.50893235", "0.50892484", "0.5088612", "0.5083264", "0.5081931", "0.5080268", "0.5076768", "0.5075055" ]
0.0
-1
Getter for job response
public function getResponse(): ResponseModel { return $this->response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->job;\n }", "function get_response() {\n return $this->response;\n }", "protected function getResponse()\n {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getTriggerJobReply()\n {\n return $this->get(self::_TRIGGER_JOB_REPLY);\n }", "public function getResponse(){\n \n return $this->response;\n \n }", "public function getResponse()\r\n {\r\n return $this->response;\r\n }", "public function get_response()\n {\n return $this->response; \n }", "function getResponse() {\n\t\treturn $this->Response;\n\t}", "public function getResponse ()\n {\n return $this->response;\n }", "protected function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->get('response');\n }", "public function getResponse()\n {\n return $this->get('response');\n }", "public function getJob(): string\n {\n return $this->job;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse()\n {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {\n return $this->response;\n }", "public function getResponse() {}", "public function getResponse() {}", "public function getResponse() {\n\t\treturn $this->data->getResponse();\n\t}", "public function response()\r\n {\r\n return $this->response;\r\n }", "public function response()\r\n {\r\n return $this->response;\r\n }", "public function get_response()\n\t{\n\t\treturn $this->response;\n\t}", "public function get_response()\n\t{\n\t\treturn $this->response;\n\t}", "public function getResponse() {\r\n\r\n return $this->response;\r\n\r\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getRequestResponse()\r\n {\r\n return $this->request_response;\r\n }", "function getResponse() {\n\t\treturn $this->m_response;\n\t}", "public function getResponse(): mixed\n {\n return $this->response;\n }", "public function response()\n {\n return $this->response;\n }", "public function response()\n {\n return $this->response;\n }", "public function getResponse() {\n return $this->_response;\n }", "public function getResponse()\r\n\t{\r\n\t\treturn $this -> response;\r\n\t}", "public function getResponse()\n {\n return $this->_response;\n }", "public function getResponse()\n {\n return $this->_response;\n }", "public function getResponse()\n {\n return $this->_response;\n }", "public function job()\n\t{\n\t\t$job = Resque::redis()->get('worker:' . $this);\n\t\tif (!$job) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn json_decode($job, true);\n\t\t}\n\t}", "public function getResponse() {\n\t\treturn $this->response;\n\t}", "public function getProcessorResponse()\n {\n return $this->processor_response;\n }", "public function getResponse()\n {\n return $this->result->getResponse();\n }", "public function getResponse() {\n\n return $this->response;\n }", "public function getResponse()\n {\n if (!empty($this->response['error'])) {\n return $this->handleError($this->response['error']);\n }\n return Arr::get($this->response, 'result', $this->response);\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }" ]
[ "0.6734401", "0.6734401", "0.6727866", "0.67125434", "0.66979074", "0.66979074", "0.66979074", "0.668678", "0.6682224", "0.6664702", "0.6662667", "0.66602707", "0.66389066", "0.66083246", "0.66066056", "0.6604454", "0.6604454", "0.6587935", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.65866965", "0.6582237", "0.6582237", "0.6582237", "0.6582237", "0.65780824", "0.65780824", "0.6567586", "0.65651554", "0.65651554", "0.65548486", "0.65548486", "0.6550444", "0.65331125", "0.6532464", "0.6530899", "0.65288085", "0.6507027", "0.64958936", "0.64958936", "0.6494878", "0.6494364", "0.6490079", "0.6490079", "0.6490079", "0.64873964", "0.6483171", "0.64732844", "0.6460618", "0.64564455", "0.6441984", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64264494", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467", "0.64257467" ]
0.0
-1
Create a new user This command creates a new user which has access to the backend user interface. It is recommended to user the email address as a username.
public function createAccountCommand($username, $password, $roles, $authenticationProvider = 'DefaultProvider') { $account = $this->accountFactory->createAccountWithPassword($username, $password, explode(',', $roles), $authenticationProvider); $this->accountRepository->add($account); $this->outputLine('Created account "%s".', array($username)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\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 createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "public function actionCreate()\n {\n $model = new BackendUser();\n\n $post = Yii::$app->request->post();\n if($post){\n $post['BackendUser']['password'] = md5($post['BackendUser']['password']);\n }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['/user/']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create_user($username, $password, $email){\n\n\t$hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\t$sql = \"INSERT INTO users VALUES \n\t(NULL, :type_id, :email, :username, :password, :created_at, :updated_at)\";\n\t$statement = $this->dbh->prepare($sql);\n\t$statement->execute([\n\t\t'type_id' => '2',\n\t\t'email' => $email,\n\t\t'username' => $username,\n\t\t'password' => $hashed_password,\n\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t'updated_at' => date('Y-m-d H:i:s')\n\t\t]);\n\techo \"signup succesfull\";\n\t // header(\"refresh:3;url=index.php\"); \n\t}", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$this->addToTitle(\"Create Account\");\n\t\t$model=new User('create');\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$temp_passwd = $_POST['User']['password'];\n\t\t\t$temp_usernm = $_POST['User']['email'];\n\t\t\tif($model->validate()&&$model->save())\n\t\t\t{\n\t\t\t\t//log create new uesr\n\t\t\t\tYii::log(\"new user sign up, email:$model->email\");\n\t\t\t\t\n\t\t\t\t$emailServe = new EmailSending();\n\t\t\t\t$emailServe->sendEmailConfirm($model);\n\t\t\t\t\n\t\t\t\t$model->moveToWaitConfirm();\n\t\t\t\t$this->redirect(array('email/waitConfirm'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array('model'=>$model));\n\t}", "public function actionCreate(string $username, string $name, string $email, string $password)\n {\n $user = new User();\n\n $user->scenario = User::SCENARIO_CREATE;\n $user->username = $username;\n $user->password = $password;\n $user->name = $name;\n $user->email = $email;\n\n if ($user->save()) {\n return ExitCode::OK;\n }\n\n echo Console::errorSummary($user) . PHP_EOL;\n return ExitCode::UNSPECIFIED_ERROR;\n }", "public function createUser()\n {\n $c = $this->getConnectionWithConfig('default');\n\n // First we create the record that we need to update\n $create = 'CREATE (u:User {name: $name, email: $email, username: $username})';\n // The bindings structure is a little weird, I know\n // but this is how they are collected internally\n // so bare with it =)\n $createCypher = $c->getCypherQuery($create, array(\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'username' => $this->user['username'],\n ));\n\n return $this->client->run($createCypher['statement'], $createCypher['parameters']);\n }", "public function create()\n {\n $cmd = $this->artisan('user:create testuser [email protected]');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertNotEmpty($user);\n $this->assertSame('[email protected]', $user->email);\n $this->assertNotEmpty($user->password);\n $this->assertFalse((bool) $user->administrator);\n }", "function create_user($username, $password, $email)\n {\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function createUser( $email, $username, $name, $surname, $mobile, $password)\n {\t\t\n\t\t$data = $this->call(array(\"user\" => array(\"email\"=>$email, \"username\"=>$username, \"name\"=>$name, \"surname\"=>$surname, \"mobile\"=>$mobile, \"password\"=>md5($password))), \"POST\", \"users.json\");\n\t\treturn $data;\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function createNewUser($email)\n {\n User::create([\n 'email' => $email,\n 'password' => bcrypt('password'),\n ]);\n }", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function testPostUserCreateNewUserWithEmailUsernamePassword()\n {\n $userPayload = [\n 'email' => '[email protected]',\n 'username' => 'new_user',\n 'plain_password' => 'new_password',\n ];\n $this->performPostUser($userPayload);\n $this->assertAcceptedSuccess();\n $this->assertUserCreated('new_user');\n }", "public function createUser()\n {\n }", "public function createUser($name, $username, $password, $email) {\n $conn = $this->getConnection();\n $pass = md5($password . getenv('SALT'));\n $saveQuery = \"INSERT INTO User (Name, Username, Password, Email) VALUES (:name, :username, :password, :email)\";\n\n // sanitize inputs\n $q = $conn->prepare($saveQuery);\n $q->bindParam(\":name\", $name);\n $q->bindParam(\":username\", $username);\n $q->bindParam(\":password\", $pass);\n $q->bindParam(\":email\", $email);\n\n $q->execute();\n }", "public function create(string $username, string $email): User\n {\n $userRegisterService = new UserRegisterService(\n new WriteRepository(\n new WriteDataMapperRepository()\n )\n );\n return $userRegisterService->create($username, $email);\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "public function create_user($username, $password, $email, $name) {\n $username = $this->real_escape_string($username);\n $password = $this->real_escape_string($password);\n $email = $this->real_escape_string($email);\n $name = $this->real_escape_string($name);\n $query = \"INSERT INTO `users` (`username`, `password`, `email`, `name`) VALUES ('\" . $username\n . \"', '\" . $password\n . \"', '\" . $email\n . \"', '\" . $name . \"')\";\n return $this->query($query);\n }", "public function executeCreateAdmin() {\n do {\n if (!empty($email_input)) {\n echo \"That is not a valid email.\\n\";\n }\n $email_input = $this->readline('Email: ');\n } while (!$email = Scrub::email($email_input));\n\n do {\n $password = $this->readline('Password: ');\n } while (strlen($password) < 6);\n\n $res = UserModel::create($email, $password);\n if ($res['success']) {\n $user = ClientUser::getInstance(); \n $user->setType(UserModel::TYPE_ADMIN);\n } else {\n echo \"Failed to create user.\\n\";\n }\n }", "public function create_user($username, $password, $email) \n\t{\n\t\t$data = array(\n\t\t\t'username'\t\t=> $username,\n\t\t\t'password'\t\t=> $this->_hash($password),\n\t\t\t'email'\t\t\t=> $email,\n\t\t);\n\n\t\t$this->CI->db->insert('admin', $data);\n\n\t\treturn $this->CI->db->insert_id();\n\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function createUser($data)\n {\n $entity = new \\AppBundle\\Entity\\User();\n $entity->setName($data[\"username\"]);\n $entity->setEmail($data[\"email\"]);\n $entity->setHash($this->generateHash($data[\"password\"]));\n\n $this->em->persist($entity);\n $this->em->flush();\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public static function create($email, $password, $name)\n\t{\n\t\ttry\n\t\t{\n\t\t\tif (!\\Auth::create_user($email, $password, $name))\n\t\t\t{\n\t\t\t\tthrow new \\FuelException('Failed to create user.');\n\t\t\t}\n\n\t\t\treturn \\Util_Task::output_message('Create site user '.$name.'.');\n\t\t}\n\t\tcatch(\\FuelException $e)\n\t\t{\n\t\t\treturn \\Util_Task::output_message(sprintf('createuser error: %s', $e->getMessage()), false);\n\t\t}\n\t}", "private function createUser()\n {\n $sl = $this->getServiceManager();\n $userService = $sl->get(\"zfcuser_user_service\");\n $randomness = \"mockuser_\".mt_rand();\n $data = array(\n \"username\" => \"{$randomness}\",\n \"password\" => \"password\",\n \"passwordVerify\" => \"password\",\n \"display_name\" => \"MOCKUSER\",\n \"email\" => \"{$randomness}@google.com\"\n );\n $user = $userService->register($data);\n\n return $user;\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function actionCreate()\n {\n $model = new User();\n if(null !== (Yii::$app->request->post()))\n {\n if($this->saveUser($model))\n {\n Yii::$app->session->setFlash('userUpdated');\n $this->redirect(['update', 'id' => $model->getId()]);\n return;\n }\n\n }\n\n return $this->render('@icalab/auth/views/user/create', ['model' => $model]);\n }", "public function createNewUser(string $email, string $password, string $firstname, string $surname) {\n \n if(!$this->DBConnectionStatus) $this->connectToDatabase(); //to ensure database connection made first.\n\n $hashedPassword = password_hash($password);\n\n $sqlInsertUserCommand = \"INSERT INTO `\".QuickConfig::DATABASE_SCHEMA.\"`.`\".QuickConfig::USER_TABLE.\"` \"\n .\"(`email`, `firstname`, `lastname`, `password`)\"\n .\"VALUES ('%s', '%s', '%s', '%s')\";\n $sqlInsertUserCommand = sprintf($sqlInsertUserCommand, \n mysqli_real_escape_string($this->DBConnection, $email),\n mysqli_real_escape_string($this->DBConnection, $firstname),\n mysqli_real_escape_string($this->DBConnection, $lastname),\n mysqli_real_escape_string($this->DBConnection, $hashedPassword));\n\n if($queryResult = mysqli_query($this->DBConnection,$sqlInsertUserCommand)) {\n return true;\n } else {\n return false;\n }\n }", "public function create_admin($username, $password, $email){\n\n\t$hashed_password = password_hash('admin', PASSWORD_DEFAULT);\n\t// TRUNCATE TABLE users;\n\t$sql = \"INSERT INTO users VALUES \n\t(NULL, :type_id, :email, :username, :password, :created_at, :updated_at)\";\n\t$statement = $this->dbh->prepare($sql);\n\t$statement->execute([\n\t\t'type_id' => '1',\n\t\t'email' => $email,\n\t\t'username' => $username,\n\t\t'password' => $hashed_password,\n\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t'updated_at' => date('Y-m-d H:i:s')\n\t\t]);\n\techo \"signup succesfull\";\n\t // header(\"refresh:3;url=index.php\"); \n\t}", "private function createNewUser($username, $password, $email){\n \n //generate random salt for user and apply it to password\n $salt = $this->getNewSalt();\n $password = hash('sha256', $password.$salt);\n \n $sql = $this->db->prepare(\"INSERT INTO shoppinglist_users(\"\n . \" username, \"\n . \" email, \"\n . \" password, \"\n . \" salt\"\n . \")\"\n \n . \"VALUES ( :username, \"\n . \" :email, \"\n . \" :password, \"\n . \" :salt\"\n . \")\"\n );\n \n $sql->bindValue(\":username\", $username, PDO::PARAM_STR);\n $sql->bindValue(\":email\", $email, PDO::PARAM_STR);\n $sql->bindValue(\":password\", $password, PDO::PARAM_STR);\n $sql->bindValue(\":salt\", $salt, PDO::PARAM_STR);\n \n if($sql->execute()){\n \n return TRUE;\n \n } else {\n \n return FALSE;\n \n }\n \n }", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function create()\n {\n return $this->userService->create();\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "function newUser($email, $password){\n\n}", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$user->username \t\t= Input::get('username');\n\t\t$user->password \t\t= Hash::make(Input::get('password'));\n\t\t$user->email \t\t \t= Input::get('email');\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('user/add')->with('sukses', 'Data User Sudah Tersimpan');\n\t}", "public function create_user($email, $screen_name, $is_super_user, $is_active)\n\t{\n\t\t$this->db->set('email', $email);\n\t\t$this->db->set('screen_name', $screen_name);\n\t\t$this->db->set('is_super_user', $is_super_user);\n\t\t$this->db->set('is_active', $is_active);\n\n\t\t$this->db->insert('user');\n\n\t\treturn $this->db->insert_id();\n\t}", "public function create() {\n $username = Input::get('reg_username');\n $email = Input::get('email');\n $password = Input::get('reg_password');\n $confirm_password = Input::get('confirm_password');\n\n // Make sure that both passwords are identical\n if (strcmp($password, $confirm_password) == 0) {\n $hashed_password = Hash::make($password);\n try {\n $user = new User;\n $user -> username = $username;\n $user -> email = $email;\n $user -> password = $hashed_password;\n $user -> save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'Error: Failed to register user in database.',\n 'alert-class' => 'alert-danger'\n ));\n }\n\n // Login the new user automatically\n $user = User::where('username', '=', $username) -> first();\n Auth::login($user);\n\n return Redirect::route('home') -> with(array(\n 'alert-message' => 'Welcome! You have successfully created an account, and have been logged in.',\n 'alert-class' => 'alert-success'\n ));\n }\n\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'The attempt to create an account was unsuccessful!',\n 'alert-class' => 'alert-danger'\n ));\n }", "public function createAction(Request $request)\r\n {\r\n $entity = new User();\r\n $form = $this->createForm(new UserType(), $entity);\r\n\r\n $factory = $this->get('security.encoder_factory');\r\n $encoder = $factory->getEncoder($entity);\r\n $plainPassword = $this->generatePassword();\r\n $password = $encoder->encodePassword($plainPassword, $entity->getSalt());\r\n \r\n $entity->setPassword($password);\r\n $entity->setPasswordRetype($password);\r\n $entity->setUserHash(substr(md5(microtime()), 0, 15));\r\n \r\n $form->bind($request);\r\n if ($form->isValid()) {\r\n $em = $this->getDoctrine()->getManager();\r\n $em->persist($entity);\r\n $em->flush();\r\n \r\n $message = \\Swift_Message::newInstance()\r\n ->setContentType('text/html')\r\n ->setSubject('CatMS - Create Account')\r\n ->setFrom(array('[email protected]' => 'CatMS Admin'))\r\n ->setTo($entity->getEmail())\r\n ->setBody(\r\n $this->renderView(\r\n 'CatMSAuthBundle:Email:create-account.html.twig',\r\n array('newPw' => $plainPassword, 'username' => $entity->getUsername())\r\n )\r\n );\r\n $this->get('mailer')->send($message);\r\n\r\n $this->get('session')->getFlashBag()->add('noticeSuccess', 'User has been create. Temporary password is '.$plainPassword);\r\n \r\n return $this->redirect($this->generateUrl('user_show', array('id' => $entity->getId())));\r\n }\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function create_user(int $type_id, string $username, string $email, string $password = null): void\n {\n // Als het wachtwoord toch niet sterk genoeg is exitten we. Dan gaat de functie ook niet meer door.\n if ($this->check_password_strong_enough($password) === false)\n exit('Het wachtwoord was niet sterk genoeg. <a href=\"/views/users/create.php\">Ga terug</a> en probeer het nog een keer.');\n else\n {\n // Als we hier komen, is het wachtwoord dus sterk genoeg!\n $hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\n $sql = 'INSERT INTO users (type_id, username, email, password)\n VALUES (:type_id, :username, :email, :password)';\n\n $this->statement_execute($sql, [\n 'type_id' => $type_id,\n 'username' => $username,\n 'email' => $email,\n 'password' => $hashed_password\n ]);\n }\n }", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "function new_user($firstName,$lastName,$email,$password){\t\n $salt = generate_salt();\n $encPassword = encrypt_password($password,$salt);\n\n //$user = create_user_object($firstName,$lastName,$email,$encPassword,$salt,$userType);\n save_user_info($firstName,$lastName,$email,$encPassword,$salt);\n \n return true;\n}", "public function create(CreateUserRequest $request) {\n $user = $request->commit();\n\n //Trigger user edited event\n event(new UserCreated($user));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User created'\n ]);\n }", "protected function _createUser() {\n\t\t$user = System_Locator_TableLocator::getInstance()->get('User')->createRow();\n\t\t$user->username = $this->getUsername();\n\t\t$user->setPassword($this->getPassword());\n\t\t$user->email = $this->getEmail();\n\t\t$user->countryCode = $this->getCountryCode();\n\t\t$user->createdAt = date(DATE_ISO8601); \n\t\treturn $user;\n\t}", "public function create()\n {\n return view(\"backend.user.create\");\n }", "function CreateUser ($username, $password, $email) {\n $path = REST_PATH . '/users.xml';\n\n $username = filter_var($username, FILTER_SANITIZE_STRING);\n $password = filter_var($password, FILTER_SANITIZE_STRING);\n $email = filter_var($email, FILTER_SANITIZE_STRING);\n\n // Setup the POST NAME/VALUE pairs\n $postdata = http_build_query(\n array(\n 'Username' => $username,\n 'Password' => $password,\n 'PrivateEmail' => $email\n )\n );\n\n // Call Rest API\n $result = CallRestApi($path, $postdata, 'POST');\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n \n return $xml->User->Id;\n}", "public function register( CreateUserRequest $request ) {\n // store the user in the database\n $credentials = $request->only( 'name', 'email', 'password');\n $credentials[ 'password' ] = bcrypt( $credentials[ 'password' ] );\n $user = User::create($credentials);\n\n // now wire up the provider account (e.g. facebook) to the user, if provided.\n if ( isset( $request['provider'] ) && isset( $request['provider_id'] ) && isset( $request['provider_token'] ) ) {\n $user->accounts()->save( new Account( [\n 'provider' => $request['provider'],\n 'provider_id' => $request['provider_id'],\n 'access_token' => $request['provider_token'],\n ] ) );\n }\n\n // return the JWT to the user\n $token = JWTAuth::fromUser( $user );\n return response( compact( 'token' ), 200 );\n }", "public function createEnterpriseUser($input);", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "public function createUser($email)\n\t{\n\t\t$existingUser = $this->getUserByEmail($email);\n\t\tif ($existingUser) {\n\t\t\treturn $existingUser;\n\t\t}\n\n\t\t$client = $this->client;\n\t\t$userIndex = $this->getUserIndex();\n\t\t$ref = $this->getUsersReference();\n\n\t\t$client->startBatch();\n\t\t$userNode = $client->makeNode()\n\t\t\t->setProperties(array(\n\t\t\t\t'email' => $email,\n\t\t\t))\n\t\t\t->save()\n\t\t\t->relateTo($ref, 'USER')\n\t\t\t\t->save()\n\t\t\t\t->getStartNode();\n\t\t$userIndex->add($userNode, 'email', $userNode->getProperty('email'));\n\t\t$client->commitBatch();\n\n\t\treturn new User($userNode);\n\t}", "public function createUser(UserInterface $user, $password);", "public function actionCreate() {\n\t\t$model = new User();\n\t\t\n\t\tif (isset($_POST['User'])) {\n\t\t\t$error = FALSE;\n\t\t\t$model->attributes = Yii::app()->input->post('User');\n\t\t\t\n\t\t\tif ($model->validate()) {\n\t\t\t\n\t\t\t\t$user = User::model()->findByAttributes(array(\n\t\t\t\t\t'username'\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model->username\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (isset($user)) {\n\t\t\t\t\t$error = 'Username already present';\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['country'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['country'],Yii::app()->params->countries)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'State are invalid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['job'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['job'],Yii::app()->params->jobs)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'Job are invalid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\n\t\t\t\t\t$_POST['User']['sex'] != '' &&\n\t\t\t\t\t!array_key_exists($_POST['User']['sex'],Yii::app()->params->sexs)\n\t\t\t\t) {\n\t\t\t\t\t$error = 'Sex are invalid';\n\t\t\t\t}\n\t\t\t\tif (!$error) {\n\t\t\t\t\t$model->password = CPasswordHelper::hashPassword($model->password);\n\t\t\t\t\t$model->save();\n\t\t\t\t\t$this->redirect(array('site/login'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFlash($error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'\t\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model,\n\t\t));\n\t}", "public function create() {\n // TODO: Admin Policy\n return view('auth.user_add');\n }", "public function actionCreate()\n {\n $model = new User();\n\n $model->load(['username' => 'foo',\n 'auth_key' => '46344hsgdsgsa8',\n 'password_hash' => 'adsfhsd6363',\n 'password_reset_token' => 'adsfhsd6363',\n 'email' => 'adsfhsd6363'\n ]);\n\n if ($model->load(Yii::$app->request->post())) {\n\n $arr_request = Yii::$app->request->post()['User'];\n\n $this->formInputDataValidation($arr_request, $model);\n\n $model->auth_key = Yii::$app->security->generateRandomString();\n\n $model->email = $arr_request['email'];\n\n $model->created_at = time();\n\n $model->updated_at = time();\n\n $model->username = $arr_request['username'];\n\n $model->password_hash = Yii::$app->security->generatePasswordHash($arr_request['password']);\n\n $model->status = 10;\n\n $model->save();\n\n return $this->render('view', [\n 'model' => $this->findModel($model->id),\n ]);\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function theAdminHasCreatedUser(\n\t\tstring $user,\n\t\tstring $password,\n\t\tstring $email,\n\t\tstring $displayName\n\t): void {\n\t\t$response = GraphHelper::createUser(\n\t\t\t$this->featureContext->getBaseUrl(),\n\t\t\t$this->featureContext->getStepLineRef(),\n\t\t\t$this->featureContext->getAdminUsername(),\n\t\t\t$this->featureContext->getAdminPassword(),\n\t\t\t$user,\n\t\t\t$password,\n\t\t\t$email,\n\t\t\t$displayName\n\t\t);\n\t\tif ($response->getStatusCode() !== 200) {\n\t\t\t$this->throwHttpException($response, \"Could not create user $user\");\n\t\t} else {\n\t\t\t$this->featureContext->setResponse($response);\n\t\t}\n\t}", "public function createAction(Request $request)\n { \n $entity = new User();\n $form = $this->createForm(new UserType(), $entity);\n $form->handleRequest($request);\n \n if ($form->isValid()) {\n $encoder = $this->container->get('security.encoder_factory')\n ->getEncoder($entity);\n \n $entity->setPassword($encoder->encodePassword($entity->getPassword(), null));\n $entity->setActive(true);\n $entity->setRegistrerDate(new DateTime('now'));\n \n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n $this->get('session')->getFlashBag()->add(\n 'notice', 'El usuario se ha agregado exitosamente'\n );\n\n return $this->redirect($this->generateUrl('user'));\n }\n\n return $this->render('UserBundle:Backend:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "function create_user()\n\t{\n\t\t$this->data['title'] = \"Create User\";\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t$tables = $this->config->item('tables','ion_auth');\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique['.$tables['users'].'.email]');\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() == true)\n\t\t{\n\t\t\t$username = strtolower($this->input->post('first_name')) . ' ' . strtolower($this->input->post('last_name'));\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data))\n\t\t{\n\t\t\t//check to see if we are creating the user\n\t\t\t//redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//display the create user form\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_user', $this->data);\n\t\t}\n\t}", "public function create_with_password()\n {\n $cmd = $this->artisan('user:create testuser [email protected] --password=passwd');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('passwd', $user->password));\n }", "public function CreateUser(string $name, \n string $username, \n string $email, \n string $password, \n string $birthdate)\n {\n\n }", "public function create()\n {\n if ( Gate::denies('criar-user')){\n abort(403, 'Não tem Permissão para criar um utilizador');\n }\n return view('users.create');\n }", "public function actionCreate()\n {\n $model = new User();\n\n if (isset($_POST['User']))\n {\n\n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n $model->setAttributes($_POST['User']);\n $model->salt = Registration::model()->generateSalt();\n $model->password = Registration::model()->hashPassword($model->password, $model->salt);\n $model->registrationIp = Yii::app()->request->userHostAddress;\n\n if ($model->save())\n {\n $profile = new Profile();\n $profile->user_id = $model->id;\n if ($profile->save())\n {\n $transaction->commit();\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пользователь добавлен!'));\n $this->redirect(array('view', 'id' => $model->id));\n }\n else\n {\n throw new CDbException(Yii::t('user', 'При создании пользователя произошла ошибка! Подробности в журнале исполнения.'));\n }\n }\n\n }\n catch (CDbException $e)\n {\n $transaction->rollback();\n Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, UserModule::$logCategory);\n Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, $e->getMessage());\n $this->redirect(array('create'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "private function _addUser($inputs)\n\t{\n\t\tCraft::log('Creating user.');\n\n\t\t$this->_user = new UserModel();\n\n\t\t$this->_user->username = $inputs['username'];\n\t\t$this->_user->newPassword = $inputs['password'];\n\t\t$this->_user->email = $inputs['email'];\n\t\t$this->_user->admin = true;\n\n\t\tif (craft()->users->saveUser($this->_user))\n\t\t{\n\t\t\tCraft::log('User created successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not create the user.', LogLevel::Error);\n\t\t\tthrow new Exception(Craft::t('There was a problem creating the user:').$this->_getFlattenedErrors($this->_user->getErrors()));\n\t\t}\n\t}", "function createUser($cid, $username, $password) {\n\t\t$dao = new UserData();\n\t\t$values = array(\n\t\t\t\"contact\" => $cid,\n\t\t\t\"login\" => $username,\n\t\t\t\"password\" => $password\n\t\t);\n\t\t$dao->create($values);\n\t}", "private function createNewUser():User\n {\n $entityManager = $this->getDoctrine()->getManager();\n\n //create user\n $user = new User();\n $user->setEmail($this->request->request->get('email'));\n $user->setPassword('');\n $entityManager->persist($user);\n $entityManager->flush();\n //create user\n\n //encode user password\n $user->setPassword($user->encodePassword($this->request->request->get('password')));\n $entityManager->persist($user);\n $entityManager->flush();\n //encode user password\n return $user;\n }", "function create_user($username, $email, $password,$type)\n\t{\n\t\tif ((strlen($username) > 0) AND !$this->users->is_username_available($username)) {\n\t\t\t$this->error = array('username' => 'auth_username_in_use');\n\n\t\t} else {\n\t\t\t// Hash password using phpass\n\t\t\t$hasher = new PasswordHash(\n\t\t\t\t\t$this->config->item('phpass_hash_strength', 'Bvoucher'),\n\t\t\t\t\t$this->config->item('phpass_hash_portable', 'Bvoucher'));\n\t\t\t$hashed_password = $hasher->HashPassword($password);\n\n\t\t\t$data = array(\n\t\t\t\t'username'\t=> $username,\n\t\t\t\t'password'\t=> $hashed_password,\n\t\t\t\t'email'\t\t=> $email,\n\t\t\t\t'last_ip'\t=> $this->input->ip_address(),\n\t\t\t);\n\n\t\t\tif (!is_null($res = $this->users->create_user($data, !$email_activation))) {\n\t\t\t\t$data['id'] = $res['id'];\n\t\t\t\t$data['password'] = $password;\n\t\t\t\tunset($data['last_ip']);\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "public function create(array $data) \n {\n // Prepare datas\n unset($data['rules']); // No db persistence\n $data['email'] = strtolower($data['email']);\n $data['salt'] = $this->app['password']->generateSalt(time());\n $data['password'] = $this->app['password']->encode($data['password'], $data['salt']);\n $data['enabled'] = 1;\n \n // Dates\n $now = date('Y-m-d H:i:s');\n $data['created'] = $now;\n $data['updated'] = $now;\n\n // Create user in db\n return $this->repository->insert($data);\n }", "public function createUser($fname, $lname, $uname, $pass, $email)\n\t{\n\n\t\t//Try to insert new user into the database\n\n\t\t//Create and return a new user object\n\n\t\treturn new User($fname, $lname, $uname, $pass, $email, 1);\n\t}", "public function save(CreateUserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $pass = $this->get_password($request);\n $user = User::create([\n 'name' => $request->input('name'),\n 'phone_number' => $request->input('phone_number'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($pass),\n 'role_id' => $request->input('role_id', 3)\n ]);\n\n $user->notify(new AdminUserCreated($user, $pass));\n\n return redirect()->route('active_user', $user->id);\n }", "public function newUserAction()\n {\n $user = (new UserModel())->createUser();\n echo (new View('userCreated'))\n ->addData('user', $user)\n ->render();\n }", "public function createAction(Request $request)\n {\n /** @var $dispatcher EventDispatcherInterface */\n $dispatcher = $this->get('event_dispatcher');\n $entity = new User();\n $form = $this->createCreateForm($entity)\n ->add('create', 'submit', array('label' => 'c'));\n $form->handleRequest($request);\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $factory = $this->get('security.encoder_factory');\n $encoder = $factory->getEncoder($entity);\n $password = $encoder->encodePassword($entity->getPassword(), $entity->getSalt());\n $entity->setPassword($password);\n $em->persist($entity);\n $em->flush();\n\n $this->successFlashBag('successful.create');\n\n $event = new AdminEvent([\n 'eventType' => 'create',\n 'entity' => $entity,\n ]);\n $dispatcher->dispatch(AdminEvents::ADMIN_USER_CHANGE_CREATE, $event);\n return $this->redirectToRoute(\n 'vipa_admin_user_show',\n [\n 'id' => $entity->getId(),\n ]\n );\n }\n\n return $this->render(\n 'VipaAdminBundle:AdminUser:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function create ( Request $request )\n {\n\n\n if( $request->isMethod( 'post' ) )\n {\n\n try\n {\n\n $user = new User();\n $user->name = $request->input( 'name' );\n $user->email = $request->input( 'email' );\n $user->password = bcrypt( $request->input( 'password' ) );\n $user->save();\n\n }\n catch( Exception $ex ) \n {\n\n return(\n back()\n ->with(\n [\n 'flash_error' => 'Failed to create new user.',\n 'flash_exception' => $ex->getMessage()\n ]\n )\n );\n\n }\n\n return(\n back()\n ->with( [ 'flash_success' => 'New Users Added' ] )\n );\n\n }\n else\n {\n return(\n view('users.create')\n );\n }\n\n }", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function actionCreate()\n {\n $model = new User();\n Yii::$app->view->params['editing'] = false;\n\n //Init curl\n $curl = new curl\\Curl();\n\n // POST request to api\n if ($model->load(Yii::$app->request->post())) {\n $response = $curl->setRawPostData(\n json_encode([\n 'name' => $model['name'],\n 'last_name' => $model['last_name'],\n 'group_id' => $model['group_id'],\n 'username' => $model['username'],\n 'password' => $model['password']\n ]))\n ->post(Yii::$app->params['createUser']);\n\n return $this->redirect(Yii::$app->request->referrer ?: Yii::$app->homeUrl);\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreateAdmin($mobile, $email, $username, $password)\n\t{\n\t\t$user = new User();\n\t\t$user->mobile = $mobile;\n\t\t$user->email = $email;\n\t\t$user->username = iconv(\"gbk\", \"utf-8\", $username);\n\t\t$user->password = $password;\n\t\t$user->status = User::STATUS_ACTIVE;\n\t\t$user->generateAuthKey();\n\t\t\n\t\tif($user->save())\n\t\t{\n\t\t\t$role = Yii::$app->authManager->getRole(\"administrator\");\n\t\t\tYii::$app->authManager->assign($role, $user->id);\n\t\t\t\n\t\t\t$this->stdout(\"Create administrator with mobile \" . $mobile . \" done.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->stderr(\"Create administrator with mobile \" . $mobile . \" failed with following errors.\\n\");\n\t\t\tforeach ($user->getErrors() as $attribute => $errors) {\n\t\t\t\t$this->stderr(\"<\" . $attribute . \">\\n\");\n\t\t\t\tforeach ($errors as $error)\n\t\t\t\t{\n\t\t\t\t\t$this->stderr(\" \" . iconv(\"utf-8\", \"gbk\", $error) . \"\\n\");\n\t\t\t\t}\n\t\t\t\t$this->stderr(\"\\n\");\n\t\t\t}\n\t\t}\n\t}", "public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }", "public function create_user()\n\t{\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('/admin/login', 'refresh');\n\t\t}\n\t\t$this->data['title'] = $this->lang->line('create_user_heading');\n\n\t\t//See the ion_auth config to check if allow_user_registration is TRUE\n\t\tif( ! $this->config->item('allow_user_registration', 'ion_auth')){\n\n\t\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t\t{\n\t\t\t\tredirect('/admin', 'refresh');\n\t\t\t}\n\n\t\t}\n\n\n\t\t$tables = $this->config->item('tables', 'ion_auth');\n\t\t$identity_column = $this->config->item('identity', 'ion_auth');\n\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'trim|required');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'trim|required');\n\t\tif ($identity_column !== 'email')\n\t\t{\n\t\t\t$this->form_validation->set_rules('identity', $this->lang->line('create_user_validation_identity_label'), 'trim|required|is_unique[' . $tables['users'] . '.' . $identity_column . ']');\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email|is_unique[' . $tables['users'] . '.email]');\n\t\t}\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$identity = ($identity_column === 'email') ? $email : $this->input->post('identity');\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() === TRUE && $this->ion_auth->register($identity, $password, $email, $additional_data))\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['identity'] = array(\n\t\t\t\t'name' => 'identity',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'identity',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('identity'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\n\t\t\t$this->load->view('templates/header',$this->data);\n\t\t\t$this->load->view('/admin/create_user');\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}", "public function createUser($username, $password) {\n // Check username is a valid email\n if (!preg_match(\"/^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-z0-9\\-]+\\.[a-zA-z0-9]+$/\", $username))\n return new Message(false, \"Registration failed: invalid username provided.\", null);\n \n // Check password format\n if (!preg_match(\"/[a-z]/\", $password) || (!preg_match(\"/[0-9A-Z]/\", $password)))\n return new Message(false, \"Registration failed: invalid password provided.\", null);\n \n // Encode the password\n $enc_passw = password_hash($password, PASSWORD_DEFAULT);\n \n // Begin the transaction\n $this->db->begin_transaction();\n\n // Prepare the query\n $stmt = $this->getOrPrepareQuery(Airplane::STMT_ADD_USER);\n if (!$stmt || !$stmt->bind_param(\"ss\", $username, $enc_passw)) {\n $this->db->rollback();\n return new Message(false, \"Registration failed: database error ($stmt->errno).\", null);\n }\n\n // Execute the query and check results\n if (!$stmt->execute()) {\n $this->db->rollback();\n \n // Check if it is a primary key constraint error\n if ($stmt->errno === 1062)\n return new Message(false, \"Registration failed: a user with the same name already exists.\", null);\n else\n return new Message(false, \"Registration failed: database error ($stmt->errno).\", null);\n }\n\n // Free the statements results\n $stmt->free_result();\n\n // Commit the transaction\n $this->db->commit();\n\n return new Message(true, \"Registration successful.\", null);\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "protected function createUserAccount(array $user_data) {\n $lang = $this->languageManager->getCurrentLanguage()->getId();\n $mail = $user_data['mail'];\n $default_user_data = [\n 'init' => $mail,\n 'name' => str_replace('@', '.', $mail),\n 'pass' => user_password(),\n 'langcode' => $lang,\n 'preferred_langcode' => $lang,\n 'preferred_admin_langcode' => $lang,\n 'roles' => array_keys(array_filter($this->configuration['create_user']['roles'])) ?? [],\n ];\n $user_data = array_merge($default_user_data, $user_data);\n\n $account = User::create();\n $account->enforceIsNew();\n\n foreach ($user_data as $name => $value) {\n $account->set($name, $value);\n }\n\n // Does the account require admin approval?\n $admin_approval = $this->configuration['create_user']['admin_approval'];\n if ($admin_approval) {\n // The account registration requires further approval.\n $account->block();\n }\n else {\n // No further admin approval is required, log the user in.\n $account->activate();\n }\n\n return $account;\n }", "public function createUser($request) {\n $response = $this->client->request('POST', 'user', [\n 'body' => $request,\n 'form_params' => [\n 'name' => $request->input('name'),\n 'email' => $request->input('email'),\n 'password'=> md5($request->input('password'))\n ]\n ]);\n \n return $response;\n }" ]
[ "0.7808013", "0.7639282", "0.7437577", "0.7408493", "0.7402834", "0.7402834", "0.7402834", "0.7402834", "0.7204184", "0.7102936", "0.7093755", "0.70836735", "0.7083158", "0.70817983", "0.7067123", "0.7065401", "0.7062736", "0.7054613", "0.69758433", "0.6972999", "0.69536614", "0.6941601", "0.6930014", "0.69137585", "0.6903238", "0.68677384", "0.68571454", "0.682637", "0.6825543", "0.6805178", "0.68034166", "0.67955035", "0.67762226", "0.6734508", "0.6733377", "0.67114055", "0.6704939", "0.66915315", "0.66822344", "0.66689086", "0.665418", "0.66531855", "0.6625208", "0.66169846", "0.65983254", "0.6575379", "0.6568117", "0.656351", "0.65429765", "0.65414816", "0.65398014", "0.65339833", "0.65339816", "0.65326446", "0.652969", "0.6523966", "0.65123576", "0.6506233", "0.6505872", "0.6503507", "0.6496049", "0.6486223", "0.64825547", "0.64802027", "0.6479374", "0.6478894", "0.6478641", "0.64762515", "0.64762515", "0.64704597", "0.64703095", "0.6466303", "0.6458355", "0.6458355", "0.6454949", "0.64508235", "0.6450133", "0.6446475", "0.6446418", "0.64451444", "0.6443545", "0.644264", "0.6436284", "0.64304984", "0.6430198", "0.64196444", "0.6415328", "0.64138895", "0.6407807", "0.63932824", "0.63931984", "0.6391758", "0.6388558", "0.6388128", "0.63849574", "0.63822204", "0.6372623", "0.6372301", "0.63696396", "0.635213", "0.63418233" ]
0.0
-1
Set a new password for the given user This allows for setting a new password for an existing user account.
public function setPasswordCommand($username, $password, $authenticationProvider = 'DefaultProvider') { $account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($username, $authenticationProvider); if (!$account instanceof \TYPO3\Flow\Security\Account) { $this->outputLine('User "%s" does not exist.', array($username)); $this->quit(1); } $account->setCredentialsSource($this->hashService->hashPassword($password, 'default')); $this->accountRepository->update($account); $this->outputLine('The new password for user "%s" was set.', array($username)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changePassword(User $user, string $newPassword): void;", "public function setPassword($newPassword);", "public function setPassword($userid, $password);", "public function savePasswordToUser($user, $password);", "public function setPassword($newPassword){\n\t}", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "public function changeUserPassword($uid,$newPassword);", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "public function changePassword(PasswordChangeForm $form, User $user);", "public function setPassword( $user, $password )\n {\n return true;\n }", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "public function changePassword(Sh4bangUserInterface $user, string $newPassword): void\r\n {\r\n $password = $this->passwordEncoder->encodePassword($user, $newPassword);\r\n $user->setPassword($password);\r\n }", "public function set_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "function setUserPassword($user_password) {\n $this->fields['user_password'] = $user_password;\n return $this;\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function updatePassword(UserInterface $user);", "function wp_set_password( $password, $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t$hash = wp_hash_password( $password );\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->users,\n\t\t\t[\n\t\t\t\t'user_pass' => $hash,\n\t\t\t\t'user_activation_key' => '',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID' => $user_id,\n\t\t\t]\n\t\t);\n\n\t\twp_cache_delete( $user_id, 'users' );\n\n\t\treturn $hash;\n\t}", "function setPassword($user,$password) {\r\n\t\t$wpuser=get_userdatabylogin($user->mName);\r\n\t\tif(!$wpuser)\r\n\t\t\treturn false;\r\n\t\twp_set_password($password,$wpuser->user_id);\r\n\t\treturn true;\r\n\t}", "public function setPassword(User $user){\n return $this->respond($user->addCredentials(AuthEmail::AUTH_TYPE, $this->_cleaned));\n }", "public function setPassword($value);", "function wp_set_password($password, $user_id)\n {\n }", "public function changePassword(ICrugeStoredUser $user, $newPassword)\r\n {\r\n $epwd = $newPassword;\r\n if (CrugeUtil::config()->useEncryptedPassword == true) {\r\n $epwd = CrugeUtil::hash($newPassword);\r\n }\r\n $user->password = $epwd;\r\n }", "public function updatePassword($user){\n\t\tUser::where('id', $this->id)\n\t\t\t->update([\n\t\t\t\t'password' => bcrypt($user['password']),\n\t\t\t\t'updated_by' => $this->name,\n\t\t\t\t'updated_by' => Auth::user()->name\n\t\t]);\n\t}", "public function setPassword ( $newPassword ) {\n $this->hashedPassword = $newPassword;\n }", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "public static function setPassword(string $newPassword): void\n {\n self::writeConfiguration(['password' => password_hash($newPassword, PASSWORD_DEFAULT)]);\n }", "public function updatePassword(ExtendedUserInterface $user);", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function assignNewPassword(Users $entity, $password)\n {\n }", "public function setPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_1'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_1'));\n\t\t\n\t\t$this->_password = $value;\n\t}", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function setPassword($password)\n {\n $this->new_password = $password;\n $this->pass = Yii::$app->security->generatePasswordHash($password);\n }", "public function setUserPassword($userarr)\n {\n // Convert the password to an passhash\n $userarr['passhash'] = Services_User_Util::passToHash($this->_settings->get('pass_salt'), $userarr['newpassword1']);\n\n $this->_userDao->setUserPassword($userarr);\n }", "public function setPassword(string $employeeId, string $password);", "protected function changePassword() {}", "public function setPassword(){\n\t}", "public function setPasswordAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n $record = $this->getUserRegistrationMapper()->findByUser($user);\n\n if (!$record || !$this->userRegistrationService->isTokenValid($user, $token, $record)) {\n // Invalid Token, Lets surprise the attacker\n return $this->notFoundAction();\n }\n\n if ($record->isResponded()) {\n // old link, password is already set by the user\n return $this->redirectToPostVerificationRoute();\n }\n\n $form = $this->getServiceLocator()->get('HtUserRegistration\\SetPasswordForm');\n\n if ($this->getRequest()->isPost()) {\n $form->setData($this->getRequest()->getPost());\n if ($form->isValid()) {\n $this->userRegistrationService->setPassword($form->getData(), $record);\n\n return $this->redirectToPostVerificationRoute();\n }\n }\n\n return array(\n 'user' => $user,\n 'form' => $form\n );\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function changePassword($user, $password)\n {\n return $user->update(['password' => bcrypt($password)]);\n }", "public function setPassword($var)\n {\n GPBUtil::checkString($var, False);\n $this->password = $var;\n }", "public static function setPassword($user, $password)\n {\n return plexcel_set_password(self::getConnection(),\n $user,\n $password);\n }", "public function setPassword($password) {\n $this->set('password', $password, 'user');\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function user_changed_password($user_id, $new_password) {\n \n }", "public function setPassword($password) {\n $this->user_password = $password;\n }", "function changePassword($password, $userid){\n $query = \"UPDATE users_account SET password = ? WHERE userid = ?\";\n $paramType = \"si\";\n $paramValue = array(\n $password,\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function setPassword(Request $request, User $user)\n {\n $request->validate([\n 'current_password' => ['required',new MatchOldPassword],\n 'new_password' => ['required'],\n 'new_confirm_password' => ['same:new_password'],\n ]);\n\n //$user->roles()->sync($request->roles);\n $user->password = Hash::make($request->new_password);\n $user->save();\n return redirect()->back()->with('success',\"Password change successfully.\");\n }", "public function setPassword($password) {\r\n // Hash the password and set it on the user object\r\n $this->passwordhash = password_hash($password, PASSWORD_DEFAULT);\r\n }", "private function SetNewPassword($newPwd)\n\t{\n\t\t$this->Salt = salt();\n\t\t$this->Password = hashPwd($newPwd, $this->Salt);\n\t}", "public function setPassword($p) {\n $this->_password = $p;\n }", "private function resetPassword($user, $password)\n {\n $user->forceFill([\n 'password' => bcrypt($password)\n ])->save();\n }", "public function changePassword($user_id,$password)\r\n\t{\r\n\t\t$data=array('password'=>$password);\r\n\t\t$where=$this->getAdapter()->quoteInto('user_id=?',$user_id);\r\n\t\t$this->update($data,$where);\r\n\t}", "public function changePassword($username, $password);", "public function changePassword($user)\n {\n if (\\Gate::denies('create', 'user-respondent')) {\n return false;\n }\n\n $user->password = str_random(6);\n\n $user->save();\n\n $message = [\n 'flash_message'=> \\Lang::get('admin/users.new_password').'&nbsp;'\n .$user->password.'&nbsp;'.\\Lang::get('admin/users.successfully_created')\n ];\n\n return back()->with($message);\n }", "public function setPassword(string $password): void\n {\n }", "public function setPassword($newPassword) {\n\t\t$this->netxPassword = $newPassword;\n\t}", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "public static function setNewPassword($user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat) {\n\t\t// validate the password\n\t\tif (!self::validateResetPassword($user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat)) {\n\t\t\treturn false;\n\t\t}\n\t\t// crypt the password (with the PHP 5.5+'s password_hash() function, result is a 60 character hash string)\n\t\t$user_password_hash = password_hash($user_password_new, PASSWORD_DEFAULT);\n\t\t// write the password to database (as hashed and salted string), reset user_password_reset_hash\n\t\tif (self::saveNewUserPassword($user_name, $user_password_hash, $user_password_reset_hash)) {\n\t\t\tSession::add(Session::SESSION_FEEDBACK_POSITIVE, Text::get('FEEDBACK_PASSWORD_CHANGE_SUCCESSFUL'));\n\t\t\treturn true;\n\t\t} else {\n\t\t\tSession::add(Session::SESSION_FEEDBACK_NEGATIVE, Text::get('FEEDBACK_PASSWORD_CHANGE_FAILED'));\n\t\t\treturn false;\n\t\t}\n\t}", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function user_update_password($user, $newpassword) {\n $user = get_complete_user_data('id', $user->id);\n // This will also update the stored hash to the latest algorithm\n // if the existing hash is using an out-of-date algorithm (or the\n // legacy md5 algorithm).\n return update_internal_user_password($user, $newpassword);\n }", "public static function change_password(user_record_detail $user, $new_pw)\n\t{\n\t\t$model = new user_data_main();\n\t\treturn $model->change_password($user, $new_pw);\n\t}", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n\n //Auth::login($user);\n }", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n Auth::login($user);\n }", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n Auth::login($user);\n }", "public function setNewPassword($password) {\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\n }", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "public function modifpassword($user,$passwd){\n \n }", "public function setPassword($Password_user)\n {\n $this->Password_user = $Password_user;\n return $this;\n }", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function usersPasswordPut($user_id, $password) {\n\t\t$url = $this->usersUrl($user_id) . '/password';\n\t\t$output = $this->put($url, $password, 'text/plain');\n\t\treturn $output;\n\t}", "Public Function changePassword($NewPassword)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET Password = md5('$NewPassword') WHERE ID = $this->id\");\n\t}", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function setPassword($id)\n {\n $this->password = $id;\n }", "public function setPassword($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->password !== $v) {\n\t\t\t$this->password = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::PASSWORD;\n\t\t}\n\n\t\treturn $this;\n\t}", "private function set_password($idUser,$type,$newpass){\n\t\tif ($type == \"email\"){\n\t\t\t$datauser = array(\n\t\t\t\t'password' => $this->f1_newpass_encrypt($newpass)\n\t\t\t);\n\t\t}else if ($type == \"google\") {\n\t\t\t$datauser = array(\n\t\t\t\t'googleUID' => $this->openssl('encrypt',$newpass)\n\t\t\t);\n\t\t}else if ($type == \"facebook\"){\n\t\t\t$datauser = array(\n\t\t\t\t'facebookUID' => $this->openssl('encrypt',$newpass)\n\t\t\t);\n\t\t}\n\n\t\t$updatepass = $this->Main_model->CustomUpdate(\"user\",\"idUser\",$idUser,$datauser);\n\t\treturn $updatepass;\n\t}", "function setPassword($password = false)\n {\n $this->password = $password;\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }" ]
[ "0.800322", "0.78537005", "0.7814909", "0.7690685", "0.76173264", "0.7614786", "0.7514632", "0.74557436", "0.7414512", "0.7413278", "0.73913443", "0.73728204", "0.73714644", "0.73094", "0.7309104", "0.72929764", "0.72840303", "0.72679484", "0.7266989", "0.72617227", "0.7220546", "0.7212977", "0.7210301", "0.7197702", "0.71484417", "0.71313673", "0.71203226", "0.71144134", "0.71107954", "0.7083293", "0.70405", "0.70397437", "0.7038044", "0.7024495", "0.7018289", "0.70065933", "0.69906104", "0.69872105", "0.6975269", "0.69606376", "0.69606376", "0.69606376", "0.6949024", "0.6929121", "0.6927247", "0.6922741", "0.6918034", "0.6915573", "0.6905141", "0.6895331", "0.6878356", "0.6876968", "0.6876209", "0.6853722", "0.6852833", "0.6851009", "0.6835856", "0.68350554", "0.6830948", "0.6830557", "0.6818678", "0.67996", "0.67886466", "0.67784107", "0.67778546", "0.6768187", "0.67569387", "0.6747699", "0.67464453", "0.674608", "0.674608", "0.67366254", "0.6731851", "0.6729091", "0.6728398", "0.6723213", "0.67229825", "0.6721077", "0.67185843", "0.6717969", "0.67141986", "0.67111087", "0.6696153", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464", "0.66853464" ]
0.0
-1
Add a role to a user This command allows for adding a specific role to an existing user. Currently supported roles: "Editor", "Administrator"
public function addRoleCommand($username, $role, $authenticationProvider = 'DefaultProvider') { $account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($username, $authenticationProvider); if (!$account instanceof \TYPO3\Flow\Security\Account) { $this->outputLine('User "%s" does not exist.', array($username)); $this->quit(1); } $role = new \TYPO3\Flow\Security\Policy\Role($role); if ($account->hasRole($role)) { $this->outputLine('User "%s" already has the role "%s" assigned.', array($username, $role)); $this->quit(1); } $account->addRole($role); $this->accountRepository->update($account); $this->outputLine('Added role "%s" to user "%s".', array($role, $username)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRole($username, $role);", "public function add_role($role)\n {\n }", "function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function AddRole ($roleName = NULL, $idRole = NULL);", "public function addRoleToUser() {\n\t\tif (self::userHasRole($this->user_id, $this->role_id)) {\n\t\t\treturn \"user already has the role\";\n\t\t}\n\t\t$this->init_database('a+');\n\t\tfwrite(self::$db, \"\\n\".$this->user_id . \",\". $this->role_id);\n\t\tfclose(self::$db);\n\t\treturn \"\\nadded successfully\\n\";\n\t}", "public function actionCreateRole($role_name, $user_id_or_name){\n $user_id = $this->getUserId($user_id_or_name);\n\n $auth = Yii::$app->authManager;\n $role = $auth->createRole($role_name . '-user-id-' . $user_id);\n $auth->add($role);\n }", "public function addUserRole($role)\r\n {\r\n if($this->userRoleModel->isExistUserRole($role['id']))\r\n {\r\n $this->userRoleModel->updateExistingUserRole($role);\r\n }\r\n else\r\n {\r\n //IF role not exist then add new role\r\n $this->userRoleModel->addNewUserRole($role);\r\n }\r\n }", "function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}", "public function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function attachRole($role);", "public function attachRole($role);", "public function addRole($role)\n {\n $this->roles[] = $role;\n }", "public function addRole($role)\n {\n $role = strtoupper($role);\n if ($role === static::ROLE_DEFAULT) {\n return;\n }\n if (!in_array($role, $this->roles, true)) {\n $this->roles[] = $role;\n }\n }", "protected function addRole()\n\t{\n\t\tglobal $rbacadmin, $rbacreview, $rbacsystem,$ilErr,$ilCtrl;\n\n\t\t$form = $this->initRoleForm();\n\t\tif($form->checkInput())\n\t\t{\n\t\t\t$new_title = $form->getInput(\"title\");\n\t\t\t\n\t\t\tinclude_once './Services/AccessControl/classes/class.ilObjRole.php';\n\t\t\t$role = new ilObjRole();\n\t\t\t$role->setTitle($new_title);\n\t\t\t$role->setDescription($form->getInput('desc'));\n\t\t\t$role->create();\n\t\t\t\n\t\t\t$GLOBALS['rbacadmin']->assignRoleToFolder($role->getId(),$this->getCurrentObject()->getRefId());\n\t\t\t\n\t\t\t// protect\n\t\t\t$rbacadmin->setProtected(\n\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t$role->getId(),\n\t\t\t\t$form->getInput('pro') ? 'y' : 'n'\n\t\t\t);\n\n\t\t\t// copy rights \n\t\t\t$right_id_to_copy = $form->getInput(\"rights\");\n\t\t\tif($right_id_to_copy)\n\t\t\t{\n\t\t\t\t$parentRoles = $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId(),true);\n\t\t\t\t$rbacadmin->copyRoleTemplatePermissions(\n\t\t\t\t\t$right_id_to_copy,\n\t\t\t\t\t$parentRoles[$right_id_to_copy][\"parent\"],\n\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t$role->getId(),\n\t\t\t\t\tfalse);\n\n\t\t\t\tif($form->getInput('existing'))\n\t\t\t\t{\n\t\t\t\t\tif($form->getInput('pro'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_PROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\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\t// add to desktop items\n\t\t\tif($form->getInput(\"desktop\"))\n\t\t\t{\n\t\t\t\tinclude_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';\n\t\t\t\t$role_desk_item_obj = new ilRoleDesktopItem($role->getId());\n\t\t\t\t$role_desk_item_obj->add(\n\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\tilObject::_lookupType($this->getCurrentObject()->getRefId(),true));\n\t\t\t}\t\t\n\n\t\t\tilUtil::sendSuccess($this->lng->txt(\"role_added\"),true);\n\t\t\t$this->ctrl->redirect($this,'perm');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$this->tpl->setContent($form->getHTML());\n\t\t}\n\t}", "public function addRole($role) {\n if (!$this->hasRole($role)) {\n $this->roles[] = $role;\n }\n }", "function wv_create_user_roles($roleName, $roleKey, $capability_Arr) {\n add_role($roleKey, $roleName, $capability_Arr);\n }", "protected function add()\n {\n $userModel = config('admin.database.users_model');\n $roleModel = config('admin.database.roles_model');\n\n $username = null;\n\n while ($username === null) {\n $answer_username = $this->ask('Please enter a username to login');\n\n if ($userModel::where('username', '=', $answer_username)->exists()) {\n\n $this->line(\"<error>Username is exists: </error> $answer_username\");\n } else {\n $username = $answer_username;\n }\n }\n\n $password = null;\n\n while ($password === null) {\n $answer_password = $this->secret('Please enter a password to login');\n\n $answer_password_again = $this->secret('Please enter the password again');\n\n if ($answer_password != $answer_password_again) {\n $this->line(\"<error>Password do not match</error>\");\n } else {\n $password = bcrypt($answer_password);\n }\n }\n\n $name = $this->ask('Please enter a name to display');\n\n if ($this->confirm('Add role for user?', true)) {\n $roles = $roleModel::all();\n\n if (!$this->confirm('All role?', true)) {\n /** @var array $selected */\n $selectedOption = $roles->pluck('name')->toArray();\n\n $selected = $this->choice('Please choose a role for the user, or you can use \",\" to make multiple', $selectedOption, null, null, true);\n\n $selected = Arr::wrap($selected);\n\n $roles = $roles->filter(function ($role) use ($selected) {\n return in_array($role->name, $selected);\n });\n }\n }\n\n $user = new $userModel(compact('username', 'password', 'name'));\n\n $user->save();\n\n if (isset($roles)) {\n $user->roles()->attach($roles);\n }\n\n $this->line('<info>User created successfully: </info> ' . $name);\n }", "public function addUserRole($role)\n {\n if ($this->userRoles->contains($role)) {\n return false;\n }\n\n return $this->userRoles->add($role);\n }", "public function addRole(string $role): void\n {\n if (!in_array($role, $this->roles)) {\n $this->roles[] = $role;\n }\n }", "function roleCreate(Role $role);", "function addRole()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $roleName = $this->input->post('roleName');\n $result = $this->user_model->findRole($roleName);\n if (count($result) > 0) {\n $this->session->set_flashdata('error', '角色创建失败.');\n echo(json_encode(array('status' => FALSE)));\n return;\n }\n $data = array(\n 'role' => $roleName,\n 'parent_id' => $this->login_id,\n 'permission' => '[]'\n );\n\n $result = $this->user_model->addNewRole($data);\n if ($result > 0) {\n $this->session->set_flashdata('success', '新角色创建成功.');\n echo json_encode(array('status' => TRUE));\n } else {\n $this->session->set_flashdata('error', '角色创建失败.');\n echo json_encode(array('status' => FALSE));\n }\n }\n }", "function set_role( $user_id, $new_role = '' ) {\r\n\t\t\t// Validate user id\r\n\t\t\t$user = get_userdata( $user_id );\r\n\r\n\t\t\t// User exists\r\n\t\t\tif ( ! empty( $user ) ) {\r\n\t\t\t\t// Get users old UM role\r\n\t\t\t\t$role = UM()->roles()->get_um_user_role( $user_id );\r\n\r\n\t\t\t\t// User already has this role so no new role is set\r\n\t\t\t\tif ( $new_role === $role || ( ! $this->is_role_custom( $new_role ) && user_can( $user, $new_role ) ) ) {\r\n\t\t\t\t\t$new_role = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Users role is different than the new role\r\n\r\n\t\t\t\t\t// Remove the old UM role\r\n\t\t\t\t\tif ( ! empty( $role ) && $this->is_role_custom( $role ) ) {\r\n\t\t\t\t\t\t$user->remove_role( $role );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add the new role\r\n\t\t\t\t\tif ( ! empty( $new_role ) ) {\r\n\t\t\t\t\t\t$user->add_role( $new_role );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_when_role_is_set\r\n\t\t\t\t\t * @description Action before user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_when_role_is_set', 'function_name', 10, 1 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_when_role_is_set', 'my_when_role_is_set', 10, 1 );\r\n\t\t\t\t\t * function my_when_role_is_set( $user_id ) {\r\n\t\t\t\t\t * // your code here\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\tdo_action( 'um_when_role_is_set', $user_id );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_before_user_role_is_changed\r\n\t\t\t\t\t * @description Action before user role changed\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_before_user_role_is_changed', 'function_name', 10 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_before_user_role_is_changed', 'my_before_user_role_is_changed', 10 );\r\n\t\t\t\t\t * function my_before_user_role_is_changed() {\r\n\t\t\t\t\t * // your code here\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\tdo_action( 'um_before_user_role_is_changed' );\r\n\r\n\t\t\t\t\tUM()->user()->profile['role'] = $new_role;\r\n\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_member_role_upgrade\r\n\t\t\t\t\t * @description Action on user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t\t\t * {\"var\":\"$role\",\"type\":\"string\",\"desc\":\"User role\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_member_role_upgrade', 'function_name', 10, 2 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_member_role_upgrade', 'my_member_role_upgrade', 10, 2 );\r\n\t\t\t\t\t * function my_member_role_upgrade( $old_role, $new_role ) {\r\n\t\t\t\t\t * // your code here\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\tdo_action( 'um_member_role_upgrade', $role, UM()->user()->profile['role'] );\r\n\r\n\t\t\t\t\tUM()->user()->update_usermeta_info( 'role' );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_after_user_role_is_changed\r\n\t\t\t\t\t * @description Action after user role changed\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_after_user_role_is_changed', 'function_name', 10 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_after_user_role_is_changed', 'my_after_user_role_is_changed', 10 );\r\n\t\t\t\t\t * function my_after_user_role_is_changed() {\r\n\t\t\t\t\t * // your code here\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\tdo_action( 'um_after_user_role_is_changed' );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_after_user_role_is_updated\r\n\t\t\t\t\t * @description Action after user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t\t\t * {\"var\":\"$role\",\"type\":\"string\",\"desc\":\"User role\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_after_user_role_is_updated', 'function_name', 10, 2 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_after_user_role_is_updated', 'my_after_user_role_is_updated', 10, 2 );\r\n\t\t\t\t\t * function my_after_user_role_is_updated( $user_id, $role ) {\r\n\t\t\t\t\t * // your code here\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\tdo_action( 'um_after_user_role_is_updated', $user_id, $role );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// User does don exist so return false\r\n\t\t\t\t$new_role = false;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * UM hook\r\n\t\t\t *\r\n\t\t\t * @type filter\r\n\t\t\t * @title um_set_user_role\r\n\t\t\t * @description User role was changed\r\n\t\t\t * @input_vars\r\n\t\t\t * [{\"var\":\"$new_role\",\"type\":\"string\",\"desc\":\"New role\"},\r\n\t\t\t * {\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t * {\"var\":\"$user\",\"type\":\"array\",\"desc\":\"Userdata\"}]\r\n\t\t\t * @change_log\r\n\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t * @usage\r\n\t\t\t * <?php add_filter( 'um_set_user_role', 'function_name', 10, 1 ); ?>\r\n\t\t\t * @example\r\n\t\t\t * <?php\r\n\t\t\t * add_filter( 'um_set_user_role', 'my_set_user_role', 10, 1 );\r\n\t\t\t * function my_set_user_role( $new_role ) {\r\n\t\t\t * // your code here\r\n\t\t\t * return $new_role;\r\n\t\t\t * }\r\n\t\t\t * ?>\r\n\t\t\t */\r\n\t\t\treturn apply_filters( 'um_set_user_role', $new_role, $user_id, $user );\r\n\t\t}", "public function setUserRole(User $user, Role $role);", "public function admin_add()\n\t{\n\t\tif (!empty( $this->request->data)) {\n\t\t\t$this->Role->create();\n\t\t\tif ( $this->Role->save( $this->request->data ) ) {\n\t\t\t\t$this->Session->setFlash(__d('admin', 'Role created.'), 'flash_success', array('plugin' => 'Pukis'));\n\t\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t\t}\n\t\t\t\n\t\t\t$this->Session->setFlash(__d('users', 'Unknown error occured!'), 'flash_error', array('plugin' => 'Pukis'));\n\t\t\t$this->ajaxRedirect('/admin/users/roles/index');\n\t\t}\n\t}", "public function setRole($role);", "public function addRole( $rol )\n {\n\t\n\t array_push($this->roles, $rol);\n\t\n }", "function lb_subscription_grant_role($account, $subscription) {\n user_multiple_role_edit(array($account->uid), 'add_role', $subscription->field_assign_role[LANGUAGE_NONE][0]['rid']);\n}", "public function testShouldAddRoleToUser()\n {\n $userAdmin = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $userAdmin->attachRole($role);\n\n $this->actingAs($userAdmin);\n\n $user = factory(User::class)->create();\n\n $updatedRole = (new UpdateUserRoleService())->execute([\n \"userId\" => $user->id,\n \"roleId\" => $role->id,\n ]);\n\n $this->assertTrue(is_numeric($updatedRole->roles[0]->id));\n }", "public function addRoleForUser(UserEntity $user, $role)\n {\n $roles = $user->getRoles();\n\n if (! in_array($role, $roles)) {\n $this->userRolePivotMapper->addRoleForUser($user->getId(), $role);\n\n array_push($roles, $role);\n\n $user->setRoles($roles);\n }\n }", "function add_manager_role()\n{\n add_role('manager', __(\n 'Manager'),\n array(\n 'read' => true, // Allows a user to read\n 'create_posts' => true, // Allows user to create new posts\n 'edit_posts' => true, // Allows user to edit their own posts\n )\n );\n}", "function SetUserRole ($userRoleId = null, $data = array()) {\n $answer = $this->answer;\n\n if ($userRoleId) {\n // update user role\n $this->db\n ->where('role_id', $userRoleId)\n ->update('user_role', $data);\n // here must be notification email function\n }\n else {\n // create user role\n $this->db->insert('user_role', $data);\n $userRoleId = $this->db->insert_id();\n\n // here must be notification email function, new id is for it\n }\n\n $answer['success'] = true;\n $answer['result'] = $userRoleId;\n return $answer;\n }", "private function DiscordMemberAddRole($user_id, $role_id)\n {\n $request = $this->request(\"guilds/{$this->config->discord->guild_id}/members/{$user_id}/roles/\" . $role_id,\n null,\n \"discord\",\n \"PUT\",\n false, [\n \"Authorization: Bot {$this->config->discord->bot->token}\"\n ]);\n return ($request['code'] == 204 ? true : false);\n }", "static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }", "public function addAction()\n {\n $this->view->layout()->title = $this->view->t('Add role');\n \n $form = $this->_model->getRoleForm();\n $form->setAction($this->view->url());\n $this->view->form = $form;\n \n // Post?\n if (!$this->_request->isPost()) {\n return;\n }\n \n // Validate the form\n $isValid = $form->isValid($this->_request->getPost());\n \n // Check if cancel not clicked\n if($form->getElement('cancel')->isChecked()) {\n $this->_goToOverview();\n return;\n }\n \n // Has errors?\n if(!$isValid) {\n return;\n }\n \n // create the role in the DB\n $role = $this->_model->saveRoleForm($form);\n if(!$role) {\n $this->_messenger->addError($this->view->t(\n 'There was a problem saving the role, try again or contact platform administrator.'\n ));\n return;\n }\n \n // we created the role\n $this->_messenger->addSuccess($this->view->t(\n 'Role <strong>%s</strong> created', $role->name\n ));\n \n $this->_goToOverview();\n }", "public function addRoleToUser($user_id, $role_id)\n\t{\n\t\t$data = array(\n\t\t\t'user_id' => $user_id,\n\t\t\t'role_id' => $role_id\n\t\t);\n\t\t\n\t\t$user_role = $this->getUserRoleModel()->addRoleToUser($data);\n\t\treturn $user_role;\n\t}", "public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $this->role = $var;\n\n return $this;\n }", "public function addRole(EntityManagerInterface $manager, UsersRepository $repo)\n {\n $id = $_POST['id'];\n $role = $_POST['role'];\n $user = $repo->findOneBy(['id' => $id]);\n if (in_array($role, $user->getRoles(), true)) {\n $this->addFlash(\n 'warning',\n 'La personne a déjà ce role'\n );\n return $this->redirectToRoute('admin_user');\n }else{\n $newRole = $user->getRoles();\n array_push($newRole, $role);\n $user->setRoles($newRole);\n $manager->persist($user);\n $manager->flush();\n $this->addFlash(\n 'success',\n 'Role ajouter avec success'\n );\n return $this->redirectToRoute('admin_user');\n }\n }", "public function assignRole ($name);", "public static function attachRole($user, $role)\n\t{\n\t\ttry {\n\t\t\t$user_role = UserRole::create(['user_id' => $user->id, 'role_id' => $role->id]);\n\t\t\treturn $user_role;\n\t\t} catch (\\Throwable $th) {\n\t\t\tLog::error('error on userRole in CommanHelper '. $th->getMessage());\n\t\t}\n\t}", "public function actionCreate_role() { \n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('user_role')) {\n return $this->redirect(['site/index']);\n }\n $model = new DvUsersRole();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'New User Role Created Successfully');\n return $this->redirect(['dv-users/create_role']);\n } else {\n return $this->render('create_role', [ 'model' => $model]);\n }\n }", "public function actionRole()\n {\n foreach (USER::getRoleOptions() as $key => $val) {\n\n self::log(\"\\n\" . $val . ' Role-id is ' . $key . \"\\n\");\n }\n\n if (is_null($this->email)) {\n\n self::log('Email required ! (Hint -e=)');\n\n return ExitCode::DATAERR;\n }\n\n $model = User::findOne([\n 'email' => $this->email\n ]);\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->role_id)) {\n\n self::log('Current Role Id is ' . $model->role_id . \"\\n\");\n self::log('Add correct Role id (Hint -r=)');\n\n return ExitCode::DATAERR;\n }\n\n if (is_null(ArrayHelper::getValue(USER::getRoleOptions(), $this->role_id))) {\n\n self::log('Please enter correct role id :');\n\n return ExitCode::DATAERR;\n }\n\n $model->role_id = $this->role_id;\n\n if (! $model->save()) {\n\n self::log('Please enter valid Role Id ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Role Id successfully Updated !');\n\n return ExitCode::OK;\n }", "function set_user_role($role, $user_id = null) {\n\tglobal $db;\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\t$prepared = $db->prepare(\"\n UPDATE users\n\t\t\tSet role_id = (SELECT role_id FROM roles WHERE name = ?)\n\t\t\tWhere user_id = ?\n \");\n\n\t$prepared->bind_param('si', $role, $user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public static function createRole()\n {\n add_action('init', __NAMESPACE__ . '\\DigitalWebmaster::renameAdministratorRole');\n }", "public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "public function setRole($role)\n {\n return wp_update_user([\n 'ID' => $this->ID,\n 'role' => $role,\n ]);\n }", "public function setRole($userId, $roleId);", "public function add_customer_user_role() {\n add_role(\n 'customer',\n 'Customer',\n [\n 'read' => true,\n ]\n );\n }", "public function add_user_role($role_name) {\n \n $check = DB::table('user_role_master')->insert(array('role_name' => $role_name));\n return $check;\n \n }", "function gdlr_lms_add_user_role(){\r\n\t\tadd_role('instructor', __('Instructor', 'gdlr-lms'), \r\n\t\t\tarray('instructor'=>true, 'read'=>true, 'edit_users'=>true, 'edit_dashboard'=>true, 'upload_files'=>true,\r\n\t\t\t\t 'edit_course'=>true, 'edit_courses'=>true, 'edit_published_courses'=>true, 'publish_courses'=>true, 'delete_course'=>true, 'delete_courses'=>true, 'delete_published_courses'=>true,\r\n\t\t\t\t 'edit_quiz'=>true, 'edit_quizzes'=>true, 'edit_published_quizzes'=>true,'publish_quizzes'=>true, 'delete_quiz'=>true, 'delete_quizzes'=>true, 'delete_published_quizzes'=>true,\r\n\t\t\t\t 'course_taxes'=>true )\r\n\t\t);\r\n\t\tadd_role('student', __('Student', 'gdlr-lms'));\r\n\t\t\r\n\t\t$administrator = get_role('administrator');\r\n\t\t\r\n\t\t$administrator->add_cap('course_taxes');\r\n\t\t$administrator->add_cap('course_taxes_edit');\r\n\t\t$administrator->add_cap('edit_course');\r\n\t\t$administrator->add_cap('read_course');\r\n\t\t$administrator->add_cap('delete_course');\r\n\t\t$administrator->add_cap('edit_courses');\r\n\t\t$administrator->add_cap('edit_others_courses');\r\n\t\t$administrator->add_cap('publish_courses');\r\n\t\t$administrator->add_cap('read_private_courses');\r\n $administrator->add_cap('delete_courses');\r\n $administrator->add_cap('delete_private_courses');\r\n $administrator->add_cap('delete_published_courses');\r\n $administrator->add_cap('delete_others_courses');\r\n $administrator->add_cap('edit_private_courses');\r\n $administrator->add_cap('edit_published_courses');\t\r\n\r\n\t\t$administrator->add_cap('edit_quiz');\r\n\t\t$administrator->add_cap('read_quiz');\r\n\t\t$administrator->add_cap('delete_quiz');\r\n\t\t$administrator->add_cap('edit_quizzes');\r\n\t\t$administrator->add_cap('edit_others_quizzes');\r\n\t\t$administrator->add_cap('publish_quizzes');\r\n\t\t$administrator->add_cap('read_private_quizzes');\r\n $administrator->add_cap('delete_quizzes');\r\n $administrator->add_cap('delete_private_quizzes');\r\n $administrator->add_cap('delete_published_quizzes');\r\n $administrator->add_cap('delete_others_quizzes');\r\n $administrator->add_cap('edit_private_quizzes');\r\n $administrator->add_cap('edit_published_quizzes');\t\t\r\n\t\t\r\n\t\t// 1.01 capability fix\r\n\t\t$instructor = get_role('instructor');\r\n\t\t$instructor->add_cap('edit_published_courses');\r\n\t\t$instructor->add_cap('edit_published_quizzes');\r\n\t}", "public function add_role(){\n// $admin->name = 'admin';\n// $admin->display_name = 'User Administrator';\n// $admin->description = 'User is allowed to manage and edit other users';\n// $admin->save();\n\n// $user = User::where('name','admin')->first();\n// $user->attachRole(2);\n //这个添加方法也可以\n// $user->roles()->attach($admin->id); //只需传递id即可\n\n// $editUser = new Permission();\n// $editUser->name = 'edit-user';\n// $editUser->display_name = 'Edit Users';\n// $editUser->description = 'edit existing users';\n// $editUser->save();\n\n //给角色添加权限\n// $owner = Role::where('name','admin')->first();\n// $owner->attachPermission(1);\n //另一种写法,多权限\n// $admin = Role::where('name','admin')->first();\n// $admin->perms()->sync([1,2]);\n\n //检查权限角色\n $user = User::find(2);\n//\n// if($user->hasRole('owner')){\n// echo 'yes';\n// }else{\n// echo 'no';\n// }\n\n if($user->hasRole('admin')){\n echo 'yes';\n }else{\n echo 'no';\n }\n if($user->can('edit-user')){\n echo 'yes permission';\n }else{\n echo 'no permission';\n }\n\n// $user->hasRole(['owner', 'admin'], true); //同时具有角色的时候,才显示true\n// $user->can(['edit-user', 'create-post'], true); // false //同时具有多个权限的时候才显示true\n echo \"<br/>\".Auth::user()->name.\"<br/>\";\n if(Auth::user()->can('create-post')){\n echo 'i have perms';\n }else{\n\n echo 'i don.t have';\n }\n }", "public function addRole(RoleModel $role)\n {\n EntityManager::persist($role);\n EntityManager::flush();\n }", "public static function addMemberRole($guild_id, $user_id, $role_id)\r\n {\r\n $result = Api::put(\r\n '/guilds/' . $guild_id . '/members/' . $user_id . '/roles/' . $role_id\r\n );\r\n\r\n return $result->getStatus() === 204;\r\n }", "public function setAuthenticatedRole($role);", "public function add()\n {\n\n return view('admin.add_role',\n [ \n 'activeTab' => 'users', \n 'activeLink' => 'addRole',\n 'userRoles' => Role::get() \n ] \n );\n }", "function after_switch_theme() {\n \\add_role('demo', __('Demo', 'theme-piber'), get_role('administrator')->capabilities);\n \\wp_insert_user(array(\n 'user_login' => 'demo',\n 'user_pass' => 'demo',\n 'role' => 'demo',\n ));\n}", "public function testAddRole()\n {\n $this->assertEquals([[PhpAro::DEFAULT_ROLE]], $this->Acl->Aro->roles('foobar'));\n $this->Acl->Aro->addRole(['User/foobar' => 'Role/accounting']);\n $this->assertEquals([['Role/accounting'], ['User/foobar']], $this->Acl->Aro->roles('foobar'));\n }", "private static function add_user_roles($user_id, $roles)\n {\n }", "public function addRole($id)\n {\n $roles = Role::all();\n $user = User::find($id);\n return view ('roles.add',['roles'=>$roles,'user'=>$user]);\n }", "public function addUserRole(Request $request) {\n try {\n return view('backend.acl.add_user_role');\n } catch (Exception $ex) {\n \n }\n }", "public function addRole(Request $request) {\n try {\n $roleId = ($request->get('role_id'))?$request->get('role_id'):null;\n $roleInfo = [];\n if ($roleId) {\n $roleInfo = $this->userRepo->getRole($roleId);\n \n }\n return view('backend.acl.add_role')\n ->with('role_id', $roleId)\n ->with('roleInfo',$roleInfo);\n } catch (Exception $ex) {\n return redirect()->back()->withErrors(Helpers::getExceptionMessage($ex));\n }\n \n }", "public static function addRole(Request $request)\n {\n\n if (!method_exists($request->user(), \"addRole\"))\n return response(['message' => \"Method not defined. Add trait [\\Kolgaev\\Users\\Models\\UsersRoleAndPermission] to the user model\"], 500);\n\n if (!$user = Users::getUserModel($request->id))\n return response()->json(['message' => \"User not found\"], 400);\n\n if (Users::getRoleModel()->find($request->id))\n return response()->json(['message' => \"Role not found\"], 400);\n\n $user->addRole($request->role_id);\n\n return response()->json([\n 'message' => \"Role added to user\",\n ]);\n\n }", "public function roleAdd()\n {\n return view('role.addEdit');\n }", "public function set_role($role)\n {\n }", "public function testAddExistingRole() {\n // Set-up a mock user with role 'administrator'.\n $account = $this->prophesizeEntity(UserInterface::class);\n $account->hasRole('administrator')->willReturn(TRUE);\n\n // We do not expect a call of the 'addRole' method.\n $account->addRole(Argument::any())->shouldNotBeCalled();\n\n // Mock the 'administrator' user role.\n $administrator = $this->prophesize(RoleInterface::class);\n $administrator->id()->willReturn('administrator');\n\n // Test adding one role.\n $this->action\n ->setContextValue('user', $account->reveal())\n ->setContextValue('roles', [$administrator->reveal()])\n ->execute();\n\n $this->assertEquals($this->action->autoSaveContext(), [], 'Action returns nothing for auto saving since the user has the role already.');\n }", "function set_user_role_woocommerce( $args ) {\n\t$args['role'] = 'subscriber';\n\treturn $args;\n}", "static public function add()\n {\n add_role(\n self::ROLE_KEY, // identifiant du rôle\n self::ROLE_NAME, // nom d'affichage du rôle\n // capabilities\n [ \n 'read' => true,\n \n //'edit_events' => true, // cette cap concerne l'ensemble des posts (tous types confondus)\n 'publish_events' => false,\n 'edit_event' => true, \n 'delete_event' => true,\n 'edit_others_events' => false,\n 'delete_others_events' => false,\n 'edit_published_events' => false, \n\n 'manage_events' => true,\n 'edit_events' => true, \n 'assign_events' => true, \n ] \n ); \n }", "public function addRole(RoleInterface $role)\n {\n if (!$this->hasRole($role)) {\n $this->roles[] = $role;\n }\n }", "public function giveRole($role)\n {\n return Role::whereName($role)\n ->firstOrFail()\n ->assignRoleTo($this);\n }", "public function addRole(Role $role): bool {\n if ($this->roles->contains($role)) {\n return false;\n }\n\n $this->roles->add($role);\n $role->addUser($this);\n\n return true;\n }", "public function addRole($formData)\n\t{\n\t\t$data = array(\n\t\t\t\"role_name\" => $formData['rol_name'],\n\t\t\t\"status\" => $formData['status']\n\t\t);\n\t\t$role = $this->getRoleModel()->addRole($data);\n\t\treturn $role;\n\t}", "public function addUser($data, $setRole = true)\n {\n return parent::addUser($data, $setRole);\n }", "public function addUserToRoleByName(User $user, string $roleName)\n {\n if (! $role = $this->roleRepository->findOneByName($roleName)) {\n return;\n }\n\n $this->addUserToRole($user, $role);\n }", "public function attachRole(User $user)\n {\n $user->roles()->attach(request('role'));\n\n return back();\n }", "public function update_user_role(Request $request) {\n $user = User::find($request->member_id);\n if((string)$request->new_value == '1') {\n $user->roles()->attach($request->role_id);\n return $user->first_name . ' ' . $user->last_name . ' now has new role (' . $request->role_id . ')';\n }\n else {\n $user->roles()->detach($request->role_id);\n return $user->first_name . ' ' . $user->last_name . ' no longer has role role (' . $request->role_id . ')';\n }\n }", "public function putRole($role)\n {\n if ( is_string($role) )\n {\n $role = Role::whereRoleName($role)->first();\n }\n return $this->roles()->attach($role);\n }", "public function addRole($id, $role_id)\n {\n return $this->handleRole('add', $id, $role_id);\n }", "public function assignRole($role)\n {\n if (!Yii::$app->authManager->checkAccess($this->id, $role)) {\n $authRole = Yii::$app->authManager->getRole($role);\n Yii::$app->authManager->assign($authRole, $this->id);\n\n return true;\n }\n\n return false;\n }", "function isa_editor_manage_users()\n{\n if (get_option('isa_add_cap_editor_once') != 'done') {\n // let editor manage users\n $edit_editor = get_role('editor'); // Get the user role\n $edit_editor->add_cap('edit_users');\n $edit_editor->add_cap('list_users');\n $edit_editor->add_cap('promote_users');\n $edit_editor->add_cap('create_users');\n $edit_editor->add_cap('add_users');\n $edit_editor->add_cap('delete_users');\n\n update_option('isa_add_cap_editor_once', 'done');\n }\n}", "function exchange_add_user_management_for_editors() {\n\t$role = get_role( 'editor' );\n\t$caps = exchange_get_user_caps();\n\tforeach ( $caps as $cap ) {\n\t\t$role->add_cap( $cap );\n\t}\n}", "public function testUpdateRole()\n {\n }", "public function testUpdateRole()\n {\n }", "public function addRole(Role $role)\n {\n $this->roles[] = $role;\n return $this;\n }", "function assign_user_role($userId, $roleId) {\n\t\tglobal $database;\n\t\t$assignrolequery = \"INSERT INTO user_in_rules (user_id, role_id) VALUES (:userId, :roleId)\";\n\n\t\t$stmt = $database->prepare($assignrolequery);\n\n\t\t$stmt->bindParam(':userId', $userId);\n\t\t$stmt->bindParam(':roleId', $roleId);\n\n\t\t$stmt->execute();\n\t}", "public function assignRole($role)\n {\n $roles = is_array($role) ? $role : [$role];\n $roles = array_map(function($role) {\n return is_string($role) ? Role::find($role) : $role;\n }, $roles);\n $this->set('roles', $roles);\n $result = TableFactory::getUserModel()\n ->save($this) !== false;\n RolesTableTrait::refreshCache($this->id);\n\n return $result;\n }", "public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }", "public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }", "public function creating(Role $role)\n {\n $role->created_by = $this->userId;\n }", "public function create(RoleUserRequest $request)\n {\n $role = $this->model->findOrNew(0);\n\n Former::populate($role);\n\n return $this->theme->of('user::user.role.create', compact('role'))->render();\n }", "public function hasRole($user, string $role = 'login'): bool {}", "private function add_new_roles(){\n\t\tif( empty( $this->new_roles ) ) return true;\n\t\tif( ! in_array( 'administrator', $this->new_roles ) ) $this->new_roles[] = 'administrator'; // Ensure Max level of access\n\t\t$processed_roles = $this->process_roles( $this->new_roles );\n\t\tarray_walk( $processed_roles, function( $val, $role ){\n\t\t\t$this->wp_roles->add_role( $role, $val->name, $val->capabilities );\n\t\t});\n\t}", "public function addRole($id){\n $array_id = [];\n $roles = $this->roles($id);\n foreach($roles as $user){\n array_push($array_id, $user->id);\n }\n $this->users()->sync($array_id);\n }", "public function addUserRole(Request $request, User $user)\n {\n if ($request->role_ids) {\n $user->roles()->syncWithoutDetaching($request->role_ids);\n }\n return $this->successResponse('Assigned successfully');\n }", "public function assignRole($role)\n {\n return $this->roles()->attach($role);\n }", "public function assignUser(Request $request, Role $role)\n {\n if(Auth::user()->can('assign-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->assignRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) assigné(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role avec la liste des permissions possibles\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }", "public static function AddRole (RoleTable $tableRole, User $user) : void\n {\n /**\n * @var Role\n */\n $role = $tableRole->findRole([\"id\" => $user->getId()]);\n $user->setRole($role);\n }", "public function assignRole($role)\n {\n return $this->role()->save(\n Role::whereName($role)->firstOrFail()\n );\n }", "public function setUserRole(FormEvent $e)\n {\n $form = $ev->getParam('form'); // Form object\n $entity = $ev->getParam('entity');\n if ($entity instanceof \\ZendCommerce\\User\\Entity\\User){\n // add Role 'User' after registration\n $objectManager = $e->getApplication()->getServiceManager()->get('Doctrine\\ORM\\EntityManager');\n $role = $objectManager->getRepository('\\ZendCommerce\\User\\Entity\\Role')->findBy(array('roleId' => 'User'));\n $user->addRoles(new \\Doctrine\\Common\\Collections\\ArrayCollection($role));\n $objectManager->flush(); \n } \n \n }", "public function edit(rbacRoleUser $rbacRoleUser)\n {\n //\n }", "public function assignRole($role)\n {\n return $this->roles()->sync([$role]);\n }", "public function createRole() {\n\t\t$Permissions = discover_permissions();\n\n\t\treturn \\view( 'admin.roles.create', compact( 'Permissions' ) );\n\t}" ]
[ "0.78929883", "0.76876915", "0.74237394", "0.73169243", "0.72742784", "0.71059334", "0.7093353", "0.70523655", "0.70049286", "0.69236803", "0.69236803", "0.6915478", "0.6877522", "0.68172604", "0.66711676", "0.6635117", "0.66057265", "0.6603692", "0.6600718", "0.6597044", "0.6551393", "0.6547915", "0.6533793", "0.6519121", "0.65094024", "0.6497562", "0.64863926", "0.6483186", "0.64829767", "0.6473091", "0.6460224", "0.64414847", "0.6399813", "0.6393", "0.63724506", "0.63692796", "0.6357536", "0.63275677", "0.6311905", "0.63039434", "0.62737304", "0.6271017", "0.62634796", "0.6262733", "0.6258155", "0.6231879", "0.62150675", "0.62101966", "0.62059027", "0.62040025", "0.6161679", "0.6141944", "0.61416423", "0.61379594", "0.6137019", "0.61217654", "0.61182815", "0.61035115", "0.6100534", "0.6097612", "0.60968924", "0.6084099", "0.6081757", "0.6067117", "0.6059555", "0.60594016", "0.6059378", "0.6055127", "0.6052391", "0.6050536", "0.60449576", "0.60108286", "0.5985936", "0.5976858", "0.59731156", "0.5959894", "0.5952445", "0.5948522", "0.59483296", "0.59480524", "0.59480524", "0.59456956", "0.59425205", "0.5941956", "0.5930375", "0.5930375", "0.5917324", "0.59139735", "0.59006435", "0.5896252", "0.5892143", "0.58888155", "0.58859795", "0.5880556", "0.5873545", "0.5871968", "0.5868248", "0.58625275", "0.58499265", "0.58448935" ]
0.69706064
9
Remove a role from a user
public function removeRoleCommand($username, $role, $authenticationProvider = 'DefaultProvider') { $account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($username, $authenticationProvider); if (!$account instanceof \TYPO3\Flow\Security\Account) { $this->outputLine('User "%s" does not exist.', array($username)); $this->quit(1); } $role = new \TYPO3\Flow\Security\Policy\Role($role); if (!$account->hasRole($role)) { $this->outputLine('User "%s" does not have the role "%s" assigned.', array($username, $role)); $this->quit(1); } $account->removeRole($role); $this->accountRepository->update($account); $this->outputLine('Removed role "%s" from user "%s".', array($role, $username)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeRole($username, $role);", "function remove_role($role)\n {\n }", "public function remove_role($role)\n {\n }", "public function remove_role($role)\n {\n }", "public function removing_user_from_role_works()\n {\n $this->withoutExceptionHandling();\n\n $user = $this->createAdminUser();\n $admin = $this->createAdminUser();\n\n $response = $this->actingAs($admin)->get(route('remove-role', ['id' => $user->id, 'role' => 1]));\n\n $response->assertStatus(200);\n $response->assertViewIs('site.confirm');\n\n $See[] = $user->name;\n $See[] = __('user.confirm_remove_button');\n\n $response->assertSeeInOrder($See);\n\n $response = $this->actingAs($admin)->post(route('remove-role', ['id' => $user->id, 'role' => 1]), ['confirm' => true]);\n\n $data['user_id'] = $user->id;\n $data['role_id'] = 1;\n\n $this->assertDatabaseMissing('user_role', $data);\n\n $response->assertRedirect(route('profile', $user->id));\n }", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "function roleDelete(Role $role);", "public function RemoveRole ($roleName = NULL, $idRole = NULL);", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "public function testRemoveUserRole()\n {\n $data = ['role' => 'administrator'];\n\n $this->removeUserRole($this->user->id, $data)\n ->assertRedirect();\n\n $this->assertNull(\n $this->user->roles()->where('name', $data['role'])->first()\n );\n }", "public function detachRole($role);", "public function removeUserRole(Request $request, User $user)\n {\n if ($request->role_id) {\n $user->roles()->detach($request->role_id);\n }\n return $this->successResponse('Deleted successfully');\n }", "public function destroy(UserRole $userRole)\n {\n //\n }", "public function removeRole($role)\n {\n $this->roles()->detach($this->getStoredRole($role));\n }", "public function destroy(rbacRoleUser $rbacRoleUser)\n {\n //\n }", "public function revokeUser(Request $request, Role $role)\n {\n if(Auth::user()->can('revoke-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->removeRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais perdu le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) révoqué(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }", "function delete_user_role($id)\n {\n return $this->db->delete('user_role',array('id'=>$id));\n }", "function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }", "public function unassign($role, $permission);", "public function removeRoles() {\n $this->roles()->detach();\n }", "public function deleting(Role $role)\n {\n }", "function revokeRole($userName, $role) {\n\n Util::throwExceptionIfNullOrBlank($userName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($role, \"Role\");\n $encodedUserName = Util::encodeParams($userName);\n $encodedRole = Util::encodeParams($role);\n $responseObj = new App42Response();\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try { \n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['userName'] = $userName;\n $signParams['role'] = $role;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/\" . $encodedUserName . \"/revoke/\" . $encodedRole;\n $response = RestClient::delete($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $responseObj->setStrResponse($response->getResponse());\n $responseObj->setResponseSuccess(true);\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $responseObj;\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "function unassign($Role, $UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n \n\t if ($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n }\n $RoleID = Rbac::getInstance()\n ->getRbacManager()\n ->getRoleManager()\n ->getId($Role)\n ;\n \n\t return $databaseManager->request(\n 'DELETE FROM ' . $databaseManager->getTablePrefix() . 'userroles'\n . ' WHERE UserID=? AND RoleID=?'\n , [$UserID, $RoleID]) >= 1;\n\t}", "public function removeRole($role)\n {\n $role = is_string($role) ? Role::find($role) : $role;\n $result = TableFactory::getUserModel()\n ->association('Roles')\n ->unlink($this, [$role]);\n RolesTableTrait::refreshCache($this->id);\n\n return $result;\n }", "function delete_role ($role_id) {\r\n $conn = db_connect();\r\n $query = \"delete from roles where role_id = '\".$role_id.\"'\";\r\n $result = $conn->query($query);\r\n $query = \"delete from role_priv where role_id = '\".$role_id.\"'\";\r\n $result1 = $conn->query($query);\r\n\r\n // change the users` priv to default\r\n $result2 = $conn->query(\"update users set role_id = '1' where role_id = '\".$role_id.\"'\");\r\n\r\n if (!$result || !$result1 || !$result2) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }", "public function roles_destroy($user_id, $role_id)\n {\n $user = User::find($user_id);\n $user->roles()->detach($role_id);\n\n return response()->json([ 'message' => 'Rol del usuario eliminado']);\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "public function destroy($id)\n {\n $user = User::find($id);\n if($user->id != 1){\n\n if($user->role_id != 4){\n\n $user->role_id = 4;\n $user->save();\n return back()->withSuccess('User Role Has been Removed');\n\n }else{\n return back()->withErrors('The User already in Pending Mode');\n }\n }else{\n return back()->withErrors('Super Admin Undeletable');\n }\n\n\n\n\n }", "public function removeRole($role)\n {\n return $this->roles()->detach($role);\n }", "public static function deassign_user_role($user_id, $role_id)\n\t{\n\t\t$result = DB::update(self::TABLE_USER_ROLES)\n\t\t\t->set(array(\n\t\t\t\t\"active\" => 0\n\t\t\t))\n\t\t\t->where(\"user_id\", \"=\", $user_id)\n\t\t\t->and_where(\"role_id\", \"=\", $role_id)\n\t\t\t->execute();\n\t\t\t\n\t\treturn $result;\n\t}", "public function removeRole($id) {\n $where['role'] = $id;\n $existe = $this->db->get_where($this->tables['users'], $where)->row();\n if (!$existe) {\n $this->db->delete($this->tables['role_permissions'], array('role' => $id));\n $this->db->delete($this->tables['roles'], array('id' => $id));\n return true;\n }\n return false;\n \n \n }", "private function deleteRoleUser($department_id, $role_id){\n \n $user_role = DB::table('role_user')->where('department_id', $department_id)->where('role_id', $role_id)->delete(); \n }", "public function testShouldDeleteRoleToUser()\n {\n $userAdmin = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $userAdmin->attachRole($role);\n\n $this->actingAs($userAdmin);\n\n $user = factory(User::class)->create();\n\n $updatedRole = (new RemoveUserRoleService())->execute([\n \"userId\" => $user->id,\n \"roleId\" => $role->id,\n ]);\n\n $this->assertTrue(count($updatedRole->roles) < 1);\n }", "public function deleteUserRole(int $userId): bool;", "function lb_subscription_revoke_role($account, $subscription) {\n user_multiple_role_edit(array($account->uid), 'remove_role', $subscription->field_assign_role[LANGUAGE_NONE][0]['rid']);\n}", "public function delete_role($role_id){\n\t\treturn ORM::delete($role_id);\n\t}", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }", "public function remove(AccountDomainModels\\Role $entity)\n {\n $id = $entity->id()->value();\n\n $this->model->destroy($id);\n }", "public function revoke(Role $role, User $user)\n\t{\n\t\t$user->removeRole($role);\n\n\t\tactivity()->on($role)->withProperties(['user' => $user->full_name])->log('RoleRevoked');\n\n\t\t$response = ['message' => __('auth::roles.revoked')];\n\n\t\tif($user->id == auth()->user()->id) $response['event'] = 'user-updated';\n\n\t\treturn $response;\n\t}", "public static function removeRole(Request $request)\n {\n\n if (!method_exists($request->user(), \"removeRole\"))\n return response(['message' => \"Method not defined. Add trait [\\Kolgaev\\Users\\Models\\UsersRoleAndPermission] to the user model\"], 500);\n\n if (!$user = Users::getUserModel($request->id))\n return response()->json(['message' => \"User not found\"], 400);\n\n if (Users::getRoleModel()->find($request->role_id))\n return response()->json(['message' => \"Role not found\"], 400);\n\n $user->removeRole($request->role_id);\n\n return response()->json([\n 'message' => \"Role removed to user\",\n ]);\n\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function destroy(Role $role)\n {\n if(Auth::user()->can('destroy-roles')){\n ActivityLogger::activity(\"Suppression du role ID:\".$role->id.'('.$role->name.') par l\\'utilisateur ID:'.Auth::id().\"(\".Auth::user()->name.\")\");\n $role->delete();\n return redirect()->route(\"roles.index\")->with('success', 'Role supprimé avec succès'); \n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }", "public function deleting(Role $role)\n {\n $role->syncPermissions();\n }", "public function deletePermissionRoleByRoleID($id);", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function removeUser(UserInterface $user);", "public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}", "public static function RoleDelete($id) {\n $role = Roles::find($id);\n $role->status = 0;\n $role->save(); \n }", "public function destroy($id)\n {\n $role = Role::find($id);\n $role->syncPermissions([]);\n \n $users = User::whereHas(\"roles\", function($q) use ($id){ $q->where(\"id\", $id); })->get();\n foreach($users as $user){\n $user->removeRole($role->name); \n } \n \n $role->delete();\n \n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully!');\n }", "public function destroy(Role $role)\n {\n //dd($role->toArray());\n $role->detachAllPermissions();\n $role->delete();\n writeLog('刪除 角色',$role->toArray());\n Session::flash('flash_message', '刪除成功!');\n // flash()->overlay('刪除成功!','系統訊息:');\n return redirect('/admin/role');\n }", "public function destroy(Role $role)\n {\n $deleted = ($role->users()->count()) ? FALSE : $role->delete();\n if ($deleted) {\n sweet_alert()->success('Role Deleted', 'Role and all its permissions has been deleted successfully');\n return redirect(route('listRoles'));\n }\n sweet_alert()->overlay('Error', \"role could not deleted because it's assigned to one or more admin\",'error');\n return redirect(route('listRoles'));\n\n }", "public function destroy(Role $role)\n {\n //\n DB::beginTransaction();\n try{\n $role->delete();\n DB::commit();\n return redirect('roles');\n }catch(\\Exception $e){\n DB::rollBack();\n return redirect('roles');\n }\n }", "function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}", "public function revokeUsersAccess(Request $request, Role $role)\n {\n $this->authorize('delete', User::class);\n\n $users = $role->users()\n ->whereNull('expires_at')\n ->orWhereDate('expires_at', '>', Carbon::now())\n ->orWhere('user_id', '!=', $request->user()->id)\n ->get();\n\n $users->each(function ($user, $key) use ($role) {\n $user->roles()->updateExistingPivot($role->id, ['expires_at' => Carbon::now()]);\n });\n\n return back()->withSuccess(\"{$role->name} role revoked from assigned users.\");\n }", "public function destroy(Role $role)\n {\n //check if role has users\n if ($role->users->count() > 0) {\n return back()->withError('Role has users assigned to it. You can only disable it.');\n }\n\n //delete\n if ($role->delete()) {\n return back()->withSuccess('Role deleted successfully.');\n }\n }", "public function destroy(RoleUserRequest $request, $role, $id)\n {\n try {\n $this->model->delete($id);\n\n return $this->success(trans('message.success.deleted', ['Module' => trans('user::role.name')]), 200);\n } catch (Exception $e) {\n return $this->error($e->getMessage());\n }\n }", "public function deleteRole($roleID)\n {\n $result = $this->sdb->query(\n 'select appuser.username from appuser,appuser_role_link as arl where arl.rid=$1 and arl.uid=appuser.id',\n array($roleID));\n $usernames = \"\";\n while($row = $this->sdb->fetchrow($result))\n {\n $usernames .= $row['username'] . \" \";\n }\n if ($usernames)\n {\n throw new \\snac\\exceptions\\SNACDatabaseException(\"Tried to delete role still used by users: $usernames\");\n }\n else\n {\n $this->sdb->query(\n 'delete from privilege_role_link where rid=$1',\n array($roleID));\n $this->sdb->query(\n 'delete from role where id=$1 and id not in (select distinct(rid) from appuser_role_link)',\n array($roleID));\n }\n }", "public function delete($role_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminRoleModel->remove($role_id);\r\n }", "public function destroy(Role $role)\n {\n $role->permissions()->detach();\n $role->delete();\n return redirect(\\Config::get(\"admin\").\"/roles/\");\n }", "public function destroy(Role $role) {\n\t\t$this->authorize('hasaccess', 'roles.destroy');\n\t\t$role->delete();\n\t\treturn redirect()->route('role.index')->with('status_success', 'Role successfully removed');\n\t}", "public function deleteUser($role,$id)\n {\n // $delete_user_role = DB::table('user_roles')->where('user_id',$id)->delete();\n $delete_from_user_table = DB::table('users')->where('user_id',$id)->delete();\n $user = UserInformation::find($id);\n $user->delete();\n return redirect(route('admin.list_user',['role'=>$role]))->with('success','Delete user successfully.');\n\n }", "public static function deleteUser($user_id , $role){\n $user_id ;\n $user = User::where(\"id\",$user_id)->where(\"role_id\",$role)->first();\n $user_id = $user->user_id ;\n if(User::destroy($user->id)){\n return $user_id;\n }\n else{\n return \"false\";\n }\n }", "public static function delete(Role $role)\n {\n $role->delete();\n }", "public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n\n if ( $this->role_exists( 'customer' ) ) {\n remove_role( 'customer' );\n }\n\n if ( $this->role_exists( 'shop_manager' ) ) {\n remove_role( 'shop_manager' );\n }\n }", "function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}", "public function destroy(User $user)\n {\n $user->roles()->detach();\n $user->destroy();\n return redirect()->route('moderate.users.index')->with(Session::flash('success','item has been deleted!'));\n }", "public function del_role(){\n\t\textract($_POST);\n\n\t\t//Connection establishment to get data from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/del_role?role_id='.$role_id;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//api processing ends\n\n\t\tif($response['status']==0){\n\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\techo '<div class=\"alert alert-warning\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "public function removeRole(string $roleName)\n {\n $roleId = Role::getIdByName($roleName);\n\n \\DB::table('user_roles')->where([\n 'user_id' => $this->id,\n 'role_id' => $roleId,\n ])->delete();\n }", "public function destroy(Role $role)\n {\n\n // $role->delete();\n // return ResponseHelper::success();\n }", "public function destroy($id)\n {\n // Gate::authorize('haveaccess', 'rol.destroy');\n $user= Role::find($id);\n $user->delete();\n\n return redirect('sistema/iniciorole')->with('success','Haz eliminado un rol con exito');\n }", "public function destroy(Role $role)\n {\n\n //Si es un rol permiso administrativo no permitir eliminarlo\n if ($role->name=='admin') {\n return response()->json(['data' => 'Acceso denegado'], 403);\n }\n\n $role->delete();\n return response()->json(['data' => $role], 200);\n\n }", "public function destroy($id)\n {\n $oRole = Sentinel::findRoleById($id);\n $oRole->users()->detach();\n $oRole->delete();\n \n return redirect($this->sPath)->withOk(\"L'objet a été supprimé.\");\n }", "public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}", "public function destroy(Role $role)\n {\n $role->delete();\n\n return redirect()->route('admin.user_managment.role.index');\n }", "public function destroy($id)\n {\n $user = User::find($id); \n $this->authorize('delete', $user);\n $user->delete();\n // Delete the associated roles\n DB::table('role_user')->where('user_id',$id)->delete();\n return redirect('/users')->with('success', 'User Deleted');\n }", "public function destroy(User $user)\n {\n $user->roles()->detach();\n return redirect()->route('level.index');\n }", "public function detachRole($role)\n {\n if (is_object($role)) {\n $role = $role->getKey();\n }\n\n if (is_array($role)) {\n $role = $role['id'];\n }\n\n $this->roles()->detach($role);\n }", "public function destroy ($id) {\n permiss ( 'role.delete' );\n\n $role = $this->entity->find($id);\n \n if ( $role->cascade && $role->delete() ) {\n return response()->json([\n 'code' => 204,\n 'data' => 'deleted user'\n ]);\n }\n\n return response()->json([\n 'code' => 500,\n 'data' => 'Error to deleted role'\n ]);\n }", "public function destroy(Role $role)\n {\n try{\n $role->delete();\n return redirect()->back()\n ->with('success', 'Role Deleted successfully.');\n }catch(\\Exception $e){\n DB::rollback();\n return Redirect::back()->with('error',$e->getMessage());\n }\n }", "public function dropUser( $user )\n {\n \n $person = $this->db->select( 'SELECT id_person from wbfsys_role_user where upper(name) = upper(\\''.$user.'\\') ', 'id_person', true );\n \n $this->db->delete( 'DELETE FROM wbfsys_role_user WHERE upper(name) = upper(\\''.$user.'\\') ' );\n \n if( $person )\n $this->db->delete( 'DELETE FROM core_person WHERE rowid = '.$person );\n \n }", "public function forgetRole()\n {\n // if (is_string($role))\n // {\n // $role = Role::whereRoleName($role)->first();\n // }\n $roles = Role::get();\n\n return $this->roles()->detach($roles);\n }", "public function destroyRole($role_id) {\n $conn = DBConnection::getInstance();\n $role = $this->getRoleData($role_id)['name'];\n if ($role == 'staff') {\n return false;\n }\n $conn->startTransaction();\n if (!$this->DeleteRole($role_id)){\n $conn->rollback();\n return false;\n }\n if (!$this->deleteRoleProp($role)){\n $conn->rollback();\n return false;\n }\n $this->destroyXML($role);\n if (!$this->destroySchema($role)){\n $conn->rollback();\n return false;\n }\n $conn->commit();\n return $role;\n }", "public function removeUserFromRoleByName(User $user, string $roleName)\n {\n if (! $role = $this->roleRepository->findOneByName($roleName)) {\n return;\n }\n\n $this->removeUserFromRole($user, $role);\n }", "public function delete($id)\n {\n $role = $this->findById($id);\n\n \n $role->delete();\n }", "public static function removeMemberRole($guild_id, $user_id, $role_id)\r\n {\r\n $result = Api::delete(\r\n '/guilds/' . $guild_id . '/members/' . $user_id . '/roles/' . $role_id\r\n );\r\n\r\n return $result->getStatus() === 204;\r\n }", "public function deleteRoles( Role $role ): ?RedirectResponse {\n\t\tif ( $role->name !== 'super-admin' ) {\n\t\t\ttry {\n\t\t\t\t$role->delete();\n\n\t\t\t\treturn redirect()->back()->with( 'success', 'Role deleted successfully.' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\treturn redirect()->back()->withErrors( [ 'Could not delete role.' ] );\n\t\t\t}\n\t\t}\n\n\t\treturn redirect()->back()->withErrors( [ 'Cannot delete super-admin role.' ] );\n\t}", "public function destroy($id)\n {\n //\n $user = User::where('id',$id)->with('roles')->first();\n foreach($user->roles as $role){\n if ($role['slug'] == 'superadmin') {\n Session::flash('warning', 'Failed! Unable to delete a User');\n return Redirect::back();\n }\n }\n $user->delete();\n Session::flash('message', 'Success! You have deleted a User');\n return Redirect::back();\n }", "function delete_role($roles_id)\n {\n return $this->db->delete('roles',array('roles_id'=>$roles_id));\n }", "public function destroy(Role $role)\n {\n \n $this->authorize('delete', $role);\n $role->delete();\n return redirect()->route('admin.roles.index')->withFlash('Role eliminado correctamente');\n \n }", "public function destroy(Role $role)\n {\n if ($role->name == 'super-admin') {\n return redirect()->route('role.index');\n }\n\n $role->delete();\n\n return redirect()->route('role.index');\n }", "public function destroy(Role $role)\n {\n $role->delete();\n\n return 'Success';\n }", "public function destroy($id)\n {\n //\n $delete = Role::destroy($id);\n }", "public function removeListener($user, $role) {\n\t\t$sql = \"UPDATE `char_players` SET `terminated`=CURRENT_TIMESTAMP WHERE `charFK`=$this->uid AND `userFK`=$user AND `role`=$role LIMIT 1\";\n\t\t$this->mysqli->query($sql);\n\t\tif ($this->mysqli->affected_rows==1) return 1;\n\t\telse return -1;\n\t}", "public function remove_user() { return $this->STOR->remove_user(); }", "public function destroy(Role $role)\n {\n $this->authorize('delete', $role);\n $role->delete();\n }" ]
[ "0.8328603", "0.8047605", "0.80001885", "0.79981226", "0.7838622", "0.77902114", "0.77600473", "0.7727452", "0.7659778", "0.74432653", "0.7421057", "0.7352167", "0.73409647", "0.7229905", "0.721011", "0.70708543", "0.69848835", "0.6951225", "0.6941198", "0.6930036", "0.691814", "0.6912397", "0.6892073", "0.686641", "0.68452865", "0.68442756", "0.6837468", "0.6831878", "0.6829044", "0.6829044", "0.6816721", "0.6813221", "0.6807378", "0.6801878", "0.6784896", "0.67810655", "0.6758634", "0.674744", "0.6741337", "0.6705632", "0.6705632", "0.6705632", "0.6698911", "0.6694", "0.6667203", "0.6649775", "0.6649027", "0.66390914", "0.66297865", "0.6604356", "0.6547388", "0.6546219", "0.6533294", "0.6530875", "0.6516949", "0.6500774", "0.6500441", "0.6495", "0.6490873", "0.64849615", "0.64819854", "0.64533615", "0.6430042", "0.64241165", "0.64183795", "0.641511", "0.640991", "0.64022017", "0.6400228", "0.6391417", "0.6383972", "0.6383477", "0.63757205", "0.63674164", "0.6353643", "0.63508064", "0.6345778", "0.6340357", "0.6336512", "0.6329979", "0.6314081", "0.6313875", "0.6293104", "0.62905294", "0.6289715", "0.6285142", "0.6257433", "0.62519485", "0.62503934", "0.6249364", "0.62448645", "0.62305427", "0.6229347", "0.622778", "0.6218329", "0.62143826", "0.6212213", "0.6208977", "0.61947757", "0.61910814" ]
0.6370081
73
load the user profile from the IDp api client
function getUserProfile() { try{ $data = $this->api->getProfile( $this->api->getCurrentUserId() ); } catch( Exception $e ){ throw new Exception( "User profile request failed! {$this->providerId} returned an error while requesting the user profile.", 6 ); } if ( ! is_object( $data ) ) { throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 ); } $this->user->profile->identifier = $this->api->getCurrentUserId(); $this->user->profile->displayName = @ $data->basicprofile->name; $this->user->profile->description = @ $data->aboutme; $this->user->profile->gender = @ $data->basicprofile->gender; $this->user->profile->photoURL = @ $data->basicprofile->image; $this->user->profile->profileURL = @ $data->basicprofile->webUri; $this->user->profile->age = @ $data->age; $this->user->profile->country = @ $data->country; $this->user->profile->region = @ $data->region; $this->user->profile->city = @ $data->city; $this->user->profile->zip = @ $data->postalcode; return $this->user->profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserProfile() {\n\n\t\t$data = $this->api->get( 'people/~:('. implode(',', $this->config['fields']) .')?format=json' );\n\n\t\t// if the provider identifier is not received, we assume the auth has failed\n\t\tif ( ! isset( $data->id ) ) {\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response: \" . Hybrid_Logger::dumpData( $data ), 6 );\n\t\t}\n\n\t\t// # store the user profile.\n\t\t$this->user->profile->identifier = ( property_exists ( $data, 'id' ) ) ? $data->id : '';\n\t\t$this->user->profile->firstName = ( property_exists ( $data, 'firstName' ) ) ? $data->firstName : '';\n\t\t$this->user->profile->lastName = ( property_exists ( $data, 'lastName' ) ) ? $data->lastName : '';\n\t\t$this->user->profile->profileURL = ( property_exists ( $data, 'publicProfileUrl' ) ) ? $data->publicProfileUrl : '';\n\t\t$this->user->profile->email = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->emailVerified = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->photoURL = ( property_exists ( $data, 'pictureUrl' ) ) ? $data->pictureUrl : '';\n\t\t$this->user->profile->description = ( property_exists ( $data, 'summary' ) ) ? $data->summary : '';\n\t\t$this->user->profile->country = ( property_exists ( $data, 'country' ) ) ? strtoupper( $data->country ) : '';\n\t\t$this->user->profile->displayName = trim( $this->user->profile->firstName . ' ' . $this->user->profile->lastName );\n\n\t\tif ( property_exists( $data, 'phoneNumbers' ) && property_exists( $data->phoneNumbers, 'phoneNumber' ) ) {\n\t\t\t$this->user->profile->phone = (string) $data->phoneNumbers->phoneNumber;\n\t\t} else {\n\t\t\t$this->user->profile->phone = null;\n\t\t}\n\n\t\tif ( property_exists( $data, 'dateOfBirth' ) ) {\n\t\t\t$this->user->profile->birthDay = (string) $data->dateOfBirth->day;\n\t\t\t$this->user->profile->birthMonth = (string) $data->dateOfBirth->month;\n\t\t\t$this->user->profile->birthYear = (string) $data->dateOfBirth->year;\n\t\t}\n\n\t\treturn $this->user->profile;\n\t}", "public function userProfile() {\n\t\t\t$request = $this->api(\"GET\", \"/me\");\n\t\t\t\n\t\t\t$request->execute();\n\t\t\t$response = $request->responseObject();\n\t\t\t$response->id = $response->ID;\n\t\t\treturn $response;\n\t\t}", "public function getUserProfile();", "function getUserProfile()\n\t{\n\t\t// ask kakao api for user infos\n\t\t$data = $this->api->api( \"user/me\" ); \n \n\t\tif ( ! isset( $data->id ) || isset( $data->error ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = @ $data->id; \n\t\t$this->user->profile->displayName = @ $data->properties->nickname;\n\t\t$this->user->profile->photoURL = @ $data->properties->thumbnail_image;\n\n\t\treturn $this->user->profile;\n\t}", "function getProfile(){\n $profile = $this->loadUser();\n return $profile;\n }", "public function loadProfileInformation() {\n\t\t\t$procedure = \"get\" . $this->mode_ . \"Information\"; \n\t\t\t$this->profileInformation_ = $this->dbHandler_->call($procedure, \"%d\", array($this->id_));\n\t\t}", "function getUserProfile()\n\t{\n\t\t$response = $this->api->get( 'user/get.json' );\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error: \" . $this->errorMessageByStatus( $this->api->http_code ), 6 );\n\t\t}\n\n\t\tif ( ! is_object( $response ) || ! isset( $response->id_user ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response.\", 6 );\n\t\t}\n\n\t\t# store the user profile.\n\t\t$this->user->profile->identifier = (property_exists($response,'id_user'))?$response->id_user:\"\";\n\t\t$this->user->profile->displayName = (property_exists($response,'username'))?$response->username:\"\";\n\t\t$this->user->profile->profileURL = (property_exists($response,'user_url'))?$response->user_url:\"\";\n\t\t$this->user->profile->photoURL = (property_exists($response,'avatar_url'))?$response->avatar_url:\"\";\n//unknown\t\t$this->user->profile->description = (property_exists($response,'description'))?$response->description:\"\";\n\t\t$this->user->profile->firstName = (property_exists($response,'firstname'))?$response->firstname:\"\";\n\t\t$this->user->profile->lastName = (property_exists($response,'name'))?$response->name:\"\";\n\n\t\tif( property_exists($response,'gender') ) {\n\t\t\tif( $response->gender == 1 ){\n\t\t\t\t$this->user->profile->gender = \"male\";\n\t\t\t}\n\t\t\telseif( $response->gender == 2 ){\n\t\t\t\t$this->user->profile->gender = \"female\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->user->profile->gender = \"\";\n\t\t\t}\n\t\t}\n\n\t\t$this->user->profile->language = (property_exists($response,'lang'))?$response->lang:\"\";\n\n\t\tif( property_exists( $response,'birth_date' ) && $response->birth_date ) {\n $birthday = date_parse($response->birth_date);\n\t\t\t$this->user->profile->birthDay = $birthday[\"day\"];\n\t\t\t$this->user->profile->birthMonth = $birthday[\"month\"];\n\t\t\t$this->user->profile->birthYear = $birthday[\"year\"];\n\t\t}\n\n\t\t$this->user->profile->email = (property_exists($response,'email'))?$response->email:\"\";\n\t\t$this->user->profile->emailVerified = (property_exists($response,'email'))?$response->email:\"\";\n\n//unknown\t\t$this->user->profile->phone = (property_exists($response,'unknown'))?$response->unknown:\"\";\n\t\t$this->user->profile->address = (property_exists($response,'address1'))?$response->address1:\"\";\n\t\t$this->user->profile->address .= (property_exists($response,'address2'))?$response->address2:\"\";\n\t\t$this->user->profile->country = (property_exists($response,'country'))?$response->country:\"\";\n//unknown\t\t$this->user->profile->region = (property_exists($response,'unknown'))?$response->unknown:\"\";\n\t\t$this->user->profile->city = (property_exists($response,'city'))?$response->city:\"\";\n\t\t$this->user->profile->zip = (property_exists($response,'postalcode'))?$response->postalcode:\"\";\n\n\t\treturn $this->user->profile;\n\t}", "function getUserProfile()\n\t{\n\t\t// refresh tokens if needed \n\t\t$this->refreshToken();\n\n\t\ttry{\n\t\t\t$authTest = $this->api->api( \"auth.test\" );\n\t\t\t$response = $this->api->get( \"users.info\", array( \"user\" => $authTest->user_id ) );\n\t\t}\n\t\tcatch( SlackException $e ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error: $e\", 6 );\n\t\t}\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ), 6 );\n\t\t}\n\n\t\tif ( ! is_object( $response ) || ! isset( $response->user->id ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response.\", 6 );\n\t\t}\n\t\t# store the user profile. \n\t\t$this->user->profile->identifier\t\t=\t@$response->user->id;\n\t\t$this->user->profile->profileURL\t\t=\t\"\";\n\t\t$this->user->profile->webSiteURL\t\t=\t\"\";\n\t\t$this->user->profile->photoURL\t\t\t=\t@$response->user->profile->image_original;\n\t\t$this->user->profile->displayName\t\t=\t@$response->user->profile->real_name;\n\t\t$this->user->profile->description\t\t=\t\"\";\n\t\t$this->user->profile->firstName\t\t\t=\t@$response->user->profile->first_name;\n\t\t$this->user->profile->lastName\t\t\t=\t@$response->user->profile->last_name;\n\t\t$this->user->profile->gender\t\t\t=\t\"\";\n\t\t$this->user->profile->language\t\t\t=\t\"\";\n\t\t$this->user->profile->age\t\t\t\t=\t\"\";\n\t\t$this->user->profile->birthDay\t\t\t=\t\"\";\n\t\t$this->user->profile->birthMonth\t\t=\t\"\";\n\t\t$this->user->profile->birthYear\t\t\t=\t\"\";\n\t\t$this->user->profile->email\t\t\t\t=\t@$response->user->profile->email;\n\t\t$this->user->profile->emailVerified\t =\t\"\";\n\t\t$this->user->profile->phone\t\t\t\t=\t\"\";\n\t\t$this->user->profile->address\t\t\t=\t\"\";\n\t\t$this->user->profile->country\t\t\t=\t\"\";\n\t\t$this->user->profile->region\t\t\t=\t\"\";\n\t\t$this->user->profile->city\t\t\t\t=\t\"\";\n\t\t$this->user->profile->zip\t\t\t\t=\t\"\";\n\n\t\treturn $this->user->profile;\n\t}", "abstract protected function getUserProfile();", "function getUserProfile()\r\n\t{\r\n\t\ttry{ \r\n\t\t\t$data = $this->api->api('/me'); \r\n\t\t}\r\n\t\tcatch( Exception $e ){\r\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error while requesting the user profile.\", 6 );\r\n\t\t} \r\n\r\n\t\t// if the provider identifier is not recived, we assume the auth has failed\r\n\t\tif ( ! isset( $data[\"id\"] ) )\r\n\t\t{ \r\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response.\", 6 );\r\n\t\t}\r\n\r\n\t\t# store the user profile. \r\n\t\t$this->user->profile->identifier = @ $data['id'];\r\n\t\t$this->user->profile->displayName = @ $data['name'];\r\n\t\t$this->user->profile->firstName = @ $data['first_name'];\r\n\t\t$this->user->profile->lastName \t= @ $data['last_name'];\r\n\t\t$this->user->profile->photoURL = \"https://graph.facebook.com/\" . $this->user->profile->identifier . \"/picture\";\r\n\t\t$this->user->profile->profileURL \t= @ $data['link']; \r\n\t\t$this->user->profile->webSiteURL \t= @ $data['website']; \r\n\t\t$this->user->profile->gender \t= @ $data['gender'];\r\n\t\t$this->user->profile->description \t= @ $data['bio'];\r\n\t\t$this->user->profile->email \t= @ $data['email'];\r\n\t\t$this->user->profile->region \t= @ $data['hometown'][\"name\"];\r\n\r\n\t\tif( isset( $data['birthday'] ) ) {\r\n\t\t\tlist($birthday_month, $birthday_day, $birthday_year) = @ explode('/', $data['birthday'] );\r\n\r\n\t\t\t$this->user->profile->birthDay = $birthday_day;\r\n\t\t\t$this->user->profile->birthMonth = $birthday_month;\r\n\t\t\t$this->user->profile->birthYear = $birthday_year;\r\n\t\t}\r\n\r\n\t\treturn $this->user->profile;\r\n \t}", "public function __loadUser()\n {\n\t$facebook = $this->fb;\n\t$this->user = $facebook->api(\"/me\", \"GET\");\n\t$this->userid = $facebook->getUser();\n\treturn;\n }", "public function public_profile_get() {\n $this->response(App\\Auth::profile(), REST_Controller::HTTP_OK);\n }", "public function getUserProfile()\n {\n $this->sandbox = ($this->config[\"paypal_sandbox\"] == 'Y');\n\n // refresh tokens if needed\n $this->refreshToken();\n\n // store for seamless checkout\n Tygh::$app['session']['paypal_token'] = $this->token( \"access_token\" );\n\n // ask google api for user infos\n $response = $this->api->api( \"https://api\".($this->sandbox?'.sandbox' : '').\".paypal.com/v1/identity/openidconnect/userinfo/?schema=openid\" );\n\n if ( ! isset( $response->user_id ) || isset( $response->message ) ) {\n throw new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n }\n\n $this->user->profile->identifier = (property_exists($response,'user_id'))? md5($response->user_id):\"\";\n $this->user->profile->firstName = (property_exists($response,'given_name'))?$response->given_name:\"\";\n $this->user->profile->lastName = (property_exists($response,'family_name'))?$response->family_name:\"\";\n $this->user->profile->displayName = (property_exists($response,'name'))?$response->name:\"\";\n $this->user->profile->photoURL = (property_exists($response,'picture'))?$response->picture:\"\";\n $this->user->profile->gender = (property_exists($response,'gender'))?$response->gender:\"\";\n $this->user->profile->email = (property_exists($response,'email'))?$response->email:\"\";\n $this->user->profile->emailVerified = (property_exists($response,'email_verified'))?$response->email_verified:\"\";\n $this->user->profile->language = (property_exists($response,'locale'))?$response->locale:\"\";\n $this->user->profile->phone = (property_exists($response,'phone_number'))?$response->phone_number:\"\";\n if (property_exists($response,'address')) {\n $address = $response->address;\n $this->user->profile->address = (property_exists($address,'street_address'))?$address->street_address:\"\";\n $this->user->profile->city = (property_exists($address,'locality'))?$address->locality:\"\";\n $this->user->profile->zip = (property_exists($address,'postal_code'))?$address->postal_code:\"\";\n $this->user->profile->country = (property_exists($address,'country'))?$address->country:\"\";\n $this->user->profile->region = (property_exists($address,'region'))?$address->region:\"\";\n }\n\n if ( property_exists($response,'birthdate') ) {\n if (strpos($response->birthdate, '-') === false) {\n if ($response->birthdate !== '0000') {\n $this->user->profile->birthYear = (int) $response->birthdate;\n }\n } else {\n list($birthday_year, $birthday_month, $birthday_day) = explode( '-', $response->birthdate );\n\n $this->user->profile->birthDay = (int) $birthday_day;\n $this->user->profile->birthMonth = (int) $birthday_month;\n if ($birthday_year !== '0000') {\n $this->user->profile->birthYear = (int) $birthday_year;\n }\n }\n }\n\n return $this->user->profile;\n }", "public function fetch(): object\n {\n return $this->get('userProfile/v1/internal/users/' . $this->accountId . '/profiles');\n }", "public function fetch(): object\n {\n return $this->get('userProfile/v1/internal/users/' . $this->accountId . '/profiles');\n }", "function getUserProfile()\n\t{\n\t\t$data = $this->api->api( \"v1/market/private/user/account.json\" );\n\t\tif ( ! isset( $data->account ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = @ $data->account->surname;\n\t\t$this->user->profile->displayName = @ $data->account->firstname . ' ' . $data->account->surname;\n\t\t$this->user->profile->photoURL = @ $data->account->image;\n\t\t$this->user->profile->profileURL = @ $data->account->image;\n\n\t\t// request user emails from envato api\n\t\ttry{\n\t\t\t$email = $this->api->api(\"v1/market/private/user/email.json\");\n\t\t\t$this->user->profile->email = @ $email->email;\n\t\t}\n\t\tcatch( Exception $e ){\n\t\t\tthrow new Exception( \"User email request failed! {$this->providerId} returned an error: $e\", 6 );\n\t\t}\n\n\t\treturn $this->user->profile;\n\t}", "function load( $id )\r\n\t{\r\n\r\n\t\t$sql = \"SELECT * FROM user_profiles WHERE user_id = $id\";\r\n\t\t$row = $this->database->query_firstrow( $sql );\r\n\t\r\n\t\t$this->id = $row['id'];\r\n\t\t$this->user_id = $row['user_id'];\r\n\t\t$this->username = $row['username'];\r\n\t\t$this->gender = $row['gender'];\r\n\t\t$this->dob = $row['dob'];\r\n\t\t$this->country_id = $row['country_id'];\r\n\t\t$this->picture = $row['picture'];\r\n\t\t$this->link = $row['link'];\r\n\t\t$this->phone = $row['phone'];\r\n\t\t$this->likes = $row['likes'];\r\n\t\t$this->dislikes = $row['dislikes'];\r\n\t\t$this->hobbies = $row['hobbies'];\r\n\t\t$this->is_active = $row['is_active'];\r\n\t\t$this->created_on = $row['created_on'];\r\n\t\t$this->last_modified_on = $row['last_modified_on'];\r\n\t}", "public function profile(){\n // using the auth() helper we are returning the authenticated user info\n return auth('api')->user();\n }", "private function getProfile() {\n if(!$this->profile = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/app/get_user_data.jsp?_plus=true')) {\n throw new Exception($this->feedErrorMessage);\n }\n }", "public function getProfile()\n {\n $profile = new \\login\\user\\Profile($this->db);\n if (array_key_exists('profile_id', $this->data)) {\n $profile->loadFromId($this->data['profile_id']);\n }\n return $profile;\n }", "public function getUserProfile(){\n\n\t\treturn $this->cnuser->getUserProfile($this->request->header('Authorization'));\n\t}", "public function getProfile($userid);", "function getProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t$data=$this->data;\n\t\t\t\t$playerId = $data['User']['playerId'];\n\t\t\t\t$token = $data['User']['secToken'];\n\t\t\t\t//pr($token);die('ok');\n\t\t\t\t$playerdetails = $this->User->find('first', array('conditions' => array('User.id' => $playerId,'User.secToken' => $token)));\n\t\t\t\t\t\t//pr($playerdetails);die;\t\n\t\t\t\t\t\tif($playerdetails)\n\t\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t$response['response']['firstName'] \t= $playerdetails['User']['firstname'];\n\t\t\t\t\t\t$response['response']['wieght'] \t= $playerdetails['User']['wieght'];\n\t\t\t\t\t\t$response['response']['school'] \t= $playerdetails['User']['school'];\n\t\t\t\t\t\t$response['response']['profilePicture'] = LIVE_SITE.'/img/upload_userImages/'.$playerdetails['User']['image'];\n\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\tdie();\n\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\n}\n}", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "function getProfileUser($id) {\n $this->load->model('Usermodel');\n print_r(json_encode($this->Usermodel->fetchProfileUser($id)));\n }", "function profile()\n\t{\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Set the client information to display in the view\n\t\t$this->set(compact('user'));\n\t}", "public function getProfile(){\n\t\treturn (new Profile($this->userName));\n\t}", "public function loadGlobalProfile()\n {\n $globalProfile = UserProfile::find()\n ->where('user_id = ' . Yii::$app->user->id)\n ->one();\n Yii::$app->session->set('user.global_profile', $globalProfile);\n }", "function get_user()\n{\n$response = $GLOBALS['http']->request('GET', '/api/users/@me', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $_SESSION['auth_token']\n ]\n]);\n\n$responseBody = $response->getBody(true); \n$response = json_decode($responseBody, true);\n$_SESSION['username'] = $response['username'];\n$_SESSION['discrim'] = $response['discriminator'];\n$_SESSION['user_id'] = $response['id'];\n$_SESSION['user_avatar'] = $response['avatar'];\n}", "public function getProfile()\n {\n ProfileResource::withoutWrapping();\n MinistryResource::withoutWrapping();\n\n if (request()->has('complete') && request()->complete) {\n return new ProfileResource(auth()->user());\n } else {\n return new MinistryResource(auth()->user());\n }\n }", "public function getCurrentProfile(){\n\n try{\n\n if( $this->hasToken() ){\n\n $account = $this->asObj( '/profile' );\n\n return $account->data;\n\n }\n else\n throw new ClientException(\"You need an authorization token, in order to request a profile.\");\n\n }\n catch (ResourceNotFoundException $e){\n //account does not exist\n return NULL;\n }\n\n }", "public function profile()\n {\n return response()->json(auth('api')->user());\n }", "function getProfile($id){\n return $this->activity_model->fetchProfile($id)->row();;\n }", "public function loadUserDetail($id) {\n \t$_user = new class_User();\n \n \t$user = $_user->getUserDetail($id);\n \n \treturn $user;\n }", "function user_get_profile_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $this->user_getid() : $id; //If ID is null, then fetch *this* user profile\n\t\t$columns = $this->DB->database_build_query('USER_PROFILE');\n\t\t$profile = $this->DB->database_select('users', $columns,\n\t\t\t\t\t\t array('uid' => $uid), 1);\n\t\tif($profile == FALSE)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn $profile;\n\t}", "public function profileAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['phone'])){\n $user->setPhone($data['phone']);\n }\n if(isset($data['email'])){\n $user->setPhone($data['email']);\n }\n if(isset($data['workphone'])){\n $user->setWorkPhone($data['workphone']);\n }\n if(isset($data['workemail'])){\n $user->setWorkEmail($data['workemail']);\n }\n if(!$user->save()){\n $this->setErrorResponse('Cannot update user profile');\n }\n $this->_helper->json($user);\n }", "public function profile()\n {\n return response()->json(['userPenaksir' => Auth::guard('api-penaksir')->user()], 200);\n }", "public function profile()\n\t{\n\t\t// echo $this->fungsi->user_login()->nik;\n\t\t$query = $this->user_m->get($this->fungsi->user_login()->nik);\n\t\t$data['data'] = $query->row();\n\t\t$this->template->load('template2', 'profile', $data);\n\t}", "function requestProfile() {\n $username = $_GET['username'];\n\n $response = retrieveProfile($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "private function getUser()\n {\n $userObj = new Core_Model_Users;\n return $userObj->profile();\n }", "public function getProfile()\n {\n return $this->request('me');\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function getProfile()\n {\n return $this->profile;\n }", "public function GetProfile()\n {\n return $this->profile;\n }", "public function getUserProfileByUserId($userid) {\n try {\n $userProfileObject = User::model()->getUserProfileByUserId($userid);\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getUserProfileByUserId::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n return $userProfileObject;\n }", "public function userprofile()\n {\n return $this -> hasOne(user_profile::class);\n }", "protected function loadUser()\n {\n $sixreps = new Sixreps(Yii::app()->params['api_host']);\n\n try {\n list($body, $info) = $sixreps->get('/users/me', array(\n 'access_token' => Yii::app()->user->user_token,\n ));\n }\n catch (Exception $e) {}\n\n $this->_model = $body;\n\n return $this->_model;\n }", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function loadUserByOAuthUserResponse(UserResponseInterface $response) {\n // Check service login\n $serviceName = $response->getResourceOwner()->getName();\n\n switch ($serviceName) {\n case 'facebook':\n // Get user data from Facebook \n $userData = $response->getResponse();\n $userid = $userData['id'];\n $socialEmail = $response->getEmail();\n $firstname = $userData['first_name'];\n $gender = $userData['gender'];\n $lastname = $userData['last_name'];\n $link = $userData['link'];\n $locale = $userData['locale'];\n $realName = $response->getRealName();\n $timezone = $userData['timezone'];\n $updatedTime = $userData['updated_time'];\n $verified = $userData['verified'];\n // Get profile image\n $userFb = \"https://graph.facebook.com/\" . $userid;\n $profilePicture = $userFb . \"/picture?width=260&height=260\";\n $nickname = $response->getNickname();\n // Get oauth token\n $oauthToken = $response->getAccessToken();\n $expiresIn = $response->getExpiresIn();\n $data = [\n \"facebook_id\" => $userid,\n \"facebook_access_token\" => $oauthToken,\n \"facebook_access_token_expires_in\" => $expiresIn,\n \"email\" => $socialEmail,\n \"firstname\" => $firstname,\n \"lastname\" => $lastname,\n \"gender\" => $gender,\n \"link\" => $link,\n \"locale\" => $locale,\n \"realname\" => $realName,\n \"timezone\" => $timezone,\n \"updated_time\" => $updatedTime,\n \"verified\" => $verified,\n \"profile_picture\" => $profilePicture,\n \"nick\" => $nickname\n ];\n\n // Check if this user exists in the database\n $socialManager = $GLOBALS['kernel']->getContainer()->get('my_facebook_manager');\n $socialUser = $socialManager->loadUserBySocialId($userid);\n\n break;\n case 'google':\n // Get user data from Google \n $userData = $response->getResponse();\n $userid = $userData['id'];\n $socialEmail = $response->getEmail();\n $firstname = $userData['given_name'];\n $lastname = $userData['family_name'];\n $gender = $userData['gender'];\n $link = $userData['link'];\n $locale = $userData['locale'];\n $realName = $response->getRealName();\n $verified = $userData['verified_email'];\n $profilePicture = $response->getProfilePicture();\n // Get oauth token\n $oauthToken = $response->getAccessToken();\n $expiresIn = $response->getExpiresIn();\n $data = [\n \"google_id\" => $userid,\n \"google_access_token\" => $oauthToken,\n \"google_access_token_expires_in\" => $expiresIn,\n \"email\" => $socialEmail,\n \"firstname\" => $firstname,\n \"lastname\" => $lastname,\n \"gender\" => $gender,\n \"link\" => $link,\n \"locale\" => $locale,\n \"realname\" => $realName,\n \"verified\" => $verified,\n \"profile_picture\" => $profilePicture\n ];\n\n // Check if this user exists in the database\n $socialManager = $GLOBALS['kernel']->getContainer()->get('my_google_manager');\n $socialUser = $socialManager->loadUserBySocialId($userid);\n\n break;\n case 'twitter':\n // Get user data from Twitter\n $userData = $response->getResponse();\n $userid = $userData['id'];\n $socialEmail = null;\n $realName = $response->getRealName();\n $screenName = $userData['screen_name'];\n $followersCount = $userData['followers_count'];\n $friendsCount = $userData['friends_count'];\n $listedCount = $userData['listed_count'];\n $createdAt = $userData['created_at'];\n $favouritesCount = $userData['favourites_count'];\n $locale = $userData['lang'];\n $profilePicture = $userData['profile_image_url'];\n // Get oauth token\n $oauthToken = $response->getAccessToken();\n $oauthTokenSecret = $response->getTokenSecret();\n $expiresIn = $response->getExpiresIn();\n $data = [\n \"twitter_id\" => $userid,\n \"twitter_access_token\" => $oauthToken,\n \"twitter_access_token_secret\" => $oauthTokenSecret,\n \"twitter_access_token_expires_in\" => $expiresIn,\n \"realname\" => $realName,\n \"screen_name\" => $screenName,\n \"followers_count\" => $followersCount,\n \"friends_count\" => $friendsCount,\n \"listed_count\" => $listedCount,\n \"created_at\" => $createdAt,\n \"favourites_count\" => $favouritesCount,\n \"locale\" => $locale,\n \"profile_picture\" => $profilePicture,\n ];\n\n // Check if this user exists in the database\n $socialManager = $GLOBALS['kernel']->getContainer()->get('my_twitter_manager');\n $socialUser = $socialManager->loadUserBySocialId($userid);\n\n break;\n }\n \n // Check if this id exists in the DB\n $user = $this->userManager->findUserBy(array($this->getProperty($response) => $userid));\n \n // When the user is registrating\n if (null === $user) {\n \n // Check if email is null\n if ($socialEmail == null) {\n $socialEmail = $userid . '@' . $userid . '.com';\n }\n \n // We check for the email existence - if so, update user.\n if ($existentUser = $this->userManager->findUserByEmail($socialEmail)) {\n // If user exists - go with the HWIOAuth way\n \n $setter = 'set' . ucfirst($serviceName);\n $setterId = $setter . 'Id';\n\n // Update access token\n $existentUser->$setterId($userid);\n \n // Download the social profile picture if user hasn't a profile picture with us\n if (null === $existentUser->getProfilePicture()) {\n $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager');\n $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture);\n \n // Update the profile picture\n $existentUser->setProfilePicture($profilePictureId);\n } \n\n $this->userManager->updateUser($existentUser);\n \n // Check if social user exists\n if (null === $socialUser) {\n // Create new social user\n $socialManager->createSocialUser($data, $existentUser);\n } else {\n // Update social user data\n $socialManager->updateSocialUserData($socialUser, $data, $existentUser);\n }\n\n return $existentUser;\n }\n\n // If user doesn't exist, create new user\n $setter = 'set' . ucfirst($serviceName);\n $setterId = $setter . 'Id';\n\n // Create new user here\n $user = $this->userManager->createUser();\n $user->$setterId($userid);\n // I have set all requested data with the user's username\n // Modify here with relevant data\n $user->setUsername('########');\n $user->setUsernameChange('0');\n $user->setVideonaRegister('0');\n $user->setEmail($socialEmail);\n // Insert user id like a password until user creates a password with us\n $user->setPlainPassword($userid);\n $user->setEnabled(true);\n \n // Download the social profile picture if user has a profile picture\n if ($profilePicture) {\n $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager');\n $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture);\n\n // Update the profile picture\n $user->setProfilePicture($profilePictureId);\n } \n\n // Update user\n $this->userManager->updateUser($user);\n \n // Check if social user exists\n if (null === $socialUser) {\n // Create new social user\n $socialManager->createSocialUser($data, $user);\n } else {\n // Update social user data\n $socialManager->updateSocialUserData($socialUser, $data, $user);\n }\n\n return $user;\n }\n\n // If user exists - go with the HWIOAuth way\n $user = parent::loadUserByOAuthUserResponse($response);\n\n // Download the social profile picture if user hasn't a profile picture with us\n if (null === $user->getProfilePicture()) {\n $imageManager = $GLOBALS['kernel']->getContainer()->get('my_image_manager');\n $profilePictureId = $imageManager->saveOriginalImage($user, $profilePicture);\n \n // Update the profile picture\n $user->setProfilePicture($profilePictureId);\n \n // Update user\n $this->userManager->updateUser($user);\n }\n \n // Check if social user exists\n if (null === $socialUser) {\n // Create new social user\n $socialManager->createSocialUser($data, $user);\n } else {\n // Update social user data\n $socialManager->updateSocialUserData($socialUser, $data, $user);\n }\n\n return $user;\n }", "protected function readUserProfile()\n {\n if (isset($_GET['code'])) {\n $params = array(\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'grant_type' => 'authorization_code',\n 'code' => $_GET['code']\n );\n\n $tokenInfo = $this->post('https://accounts.google.com/o/oauth2/token', $params);\n\n if (isset($tokenInfo['access_token']) && isset($tokenInfo['id_token']))\n {\n $params = array('id_token' => $tokenInfo['id_token']);\n $validateToken = $this->get('https://www.googleapis.com/oauth2/v1/tokeninfo', $params);\n\n if (!isset($validateToken['email'])) {\n return false;\n }\n\n $params = array('access_token' => $tokenInfo['access_token']);\n $userInfo = $this->get('https://www.googleapis.com/plus/v1/people/me', $params);\n\n if (isset($userInfo['kind']) && $userInfo['kind'] == 'plus#person')\n {\n $this->parseUserData($userInfo);\n\n $this->userInfo['email'] = $validateToken['email'];\n\n if (isset($this->response['birthday']))\n {\n $birthDate = explode('-', $this->response['birthday']);\n $this->userInfo['birthDay'] = isset($birthDate[2]) ? $birthDate[2] : null;\n $this->userInfo['birthMonth'] = isset($birthDate[1]) ? $birthDate[1] : null;\n $this->userInfo['birthYear'] = isset($birthDate[0]) ? $birthDate[0] : null;\n }\n\n return true;\n }\n }\n }\n\n return false;\n }", "function profile ($user_id) {\n global $sql;\n $res = $sql->sql_select_array_query(\"SELECT * FROM `profile` WHERE user_id = '{$user_id}'\");\n return count($res) > 0 ? $res[0] : null;\n }", "public function get_profile($user_profile_data){\n\t\t$user_name = $_SESSION['username'];\n\t\t// get user id for the logged in user\n\t\t$user_id = Database::user_id_query($user_name);\n\t\t//call static fucntion to get contents of user profile\n\t\t$user_profile_data = UserProfileHelper::get_user_profile($user_id);\n\t\treturn $user_profile_data;\n\t}", "public function profile()\n {\n $profile = $this->userRepository->getCurrentUserProfile();\n return response()->json(['user' => $profile], 200);\n }", "public function profile()\n {\n try {\n $user = auth('api')->user();\n return $this->sendResponse($user, trans('actions.get.success'));\n } catch (Exception $ex) {\n return $this->sendError([], trans('actions.get.failed'));\n }\n }", "public function loadProfile($id)\n { \n $user = User::where('user_id', $id)->get(); \n return view('./profile')->with('user', $user);\n }", "public function getUserProfile() {\n global $user, $db;\n\n $userID = $user->getId();\n\n $sql = 'SELECT p.firstName, p.lastName, p.dob, p.addressFirst, p.addressSecond, p.city, p.postcode, p.mobile, p.bio\n FROM users AS u\n JOIN profiles AS p ON p.userId = u.id\n WHERE u.id = ?';\n\n $stmt = $db->get()->prepare($sql);\n\n if ($stmt) {\n $stmt->execute([$userID]);\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n }", "public function api_entry_getprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n unset($user->password);\n\n $this->load->model('Mdl_Requests');\n $this->load->model('Mdl_Prays');\n\n $user->ipray_praying_for_me = 0;\n $user->ipray_i_am_praying_for = 0;\n $user->ipray_request_attended = 0;\n\n $prays = $this->Mdl_Prays->getAll();\n $requests = array();\n\n if (count($prays)) {\n foreach ($prays as $key => $val) {\n $request = $this->Mdl_Requests->get($val->request);\n $prayer = $this->Mdl_Users->get($val->prayer);\n\n if ($_POST[\"user\"] == $request->host) {\n if ($val->status == 1) $user->ipray_request_attended++;\n $user->ipray_praying_for_me++;\n }\n if ($_POST[\"user\"] == $val->prayer) {\n $user->ipray_i_am_praying_for++;\n }\n }\n }\n \n\n parent::returnWithoutErr(\"User profile fetched successfully.\", $user);\n }", "public function show()\n {\n return response([\n 'user' => new UserResource(Auth::user()->load('profile')),\n ]);\n }", "public function profile()\n {\n $profile = Auth::user();\n return response()->json(compact('profile'));\n }", "public function testDestiny2GetProfile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function fetchProfile($userId, $fields)\n {\n $profile = new JFBConnectProfileDataInstagram();\n $url = 'https://api.instagram.com/v1/users/'.$userId; // get the current user\n try\n {\n $jdata = $this->provider->client->query($url);\n\n if ($jdata->code == 200)\n {\n $data = json_decode($jdata->body, true);\n $profile->loadObject($data['data']);\n }\n }\n catch (Exception $e)\n {\n if (JFBCFactory::config()->get('facebook_display_errors'))\n JFBCFactory::log($e->getMessage());\n }\n\n return $profile;\n }", "public function profile()\n {\n try {\n $user = $this->guard()->user();\n $success['users'] = $user;\n return Helper::successResponse($success, 'Successfully get profile');\n } catch (\\Exception $e) {\n return Helper::errorResponse($e->getCode(), $e->getMessage());\n }\n }", "function wpcom_vip_get_user_profile( $email_or_id ) {\n\n\tif ( is_numeric( $email_or_id ) ) {\n\t\t$user = get_user_by( 'id', $email_or_id );\n\t\tif ( ! $user )\n\t\t\treturn false;\n\n\t\t$email = $user->user_email;\n\t} elseif ( is_email( $email_or_id ) ) {\n\t\t$email = $email_or_id;\n\t} else {\n\t\t$user_login = sanitize_user( $email_or_id, true );\n\t\t$user = get_user_by( 'login', $user_login );\n\t\tif ( ! $user )\n\t\t\treturn;\n\n\t\t$email = $user->user_email;\n\t}\n\n\t$hashed_email = md5( strtolower( trim( $email ) ) );\n\t$profile_url = esc_url_raw( sprintf( '%s.gravatar.com/%s.php', ( is_ssl() ? 'https://secure' : 'http://www' ), $hashed_email ), array( 'http', 'https' ) );\n\n\t$profile = wpcom_vip_file_get_contents( $profile_url, 1, 900 );\n\tif ( $profile ) {\n\t\t$profile = unserialize( $profile );\n\n\t\tif ( is_array( $profile ) && ! empty( $profile['entry'] ) && is_array( $profile['entry'] ) ) {\n\t\t\t$profile = $profile['entry'][0];\n\t\t} else {\n\t\t\t$profile = false;\n\t\t}\n\t}\n\treturn $profile;\n}", "function GetUserProfileInfo($access_token) {\t\n\t\t$url = 'https://www.googleapis.com/plus/v1/people/me';\t\t\t\n\t\t\n\t\t$ch = curl_init();\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\t\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. $access_token));\n\t\t$data = json_decode(curl_exec($ch), true);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\t\t\n\t\tif($http_code != 200) \n\t\t\tthrow new Exception('Error : Failed to get user information');\n\t\t\t\n\t\treturn $data;\n\t}", "public function profileInfo()\n {\n\n return response()->json(User::where('id', '=', Auth::user()->id)->get());\n }", "public function userProfile() {\n return response()->json(auth()->user());\n }", "public function getUserData()\n {\n $data = array();\n\n $identity = $this->openid->identity;\n\n if ($identity) {\n $steamId = str_replace('http://steamcommunity.com/openid/id/', '', $identity);\n\n $query = http_build_query(array(\n 'key' => $this->getOption('apiKey'),\n 'steamids' => $steamId\n ));\n\n $url = $this->getOption('profileUrl') . '?' . $query;\n\n $json = json_decode(file_get_contents($url));\n\n if (count($json->response->players)) {\n $data = (array) $json->response->players[0];\n }\n }\n\n return $data;\n }", "public function user() {\n $connection = new HTTPConnector($this);\n $url = $this->credential->getRequestUrl(BitcasaConstants::METHOD_USER . BitcasaConstants::METHOD_PROFILE);\n if (!BitcasaUtils::isSuccess($connection->get($url))) {\n return null;\n }\n\n $response = $connection->getResponse(true);\n\n $user = User::getInstance($response);\n return $user;\n }", "public function profileAction() {\n\t\t$this->view->assign('account', $this->accountManagementService->getProfile());\n\t}", "private function getSpotifyProfile()\r\n {\r\n Application::$app->checkSpotifyToken();\r\n $curl = curl_init();\r\n\r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => 'https://api.spotify.com/v1/me',\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_ENCODING => '',\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 0,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => 'GET',\r\n CURLOPT_HTTPHEADER => array(\r\n 'Accept: application/json',\r\n 'Content-Type: application/json',\r\n 'Authorization: Bearer ' . $_SESSION['user_token']\r\n ),\r\n ));\r\n\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n\r\n return json_decode($response, true);\r\n }", "public static function user() {\n // $userInfo = $oauth2->userinfo->get();\n $userInfo = json_decode(json_encode(['email' => '@', 'gender' => null, 'name' => 'test', 'picture' => 'f']));\n return User::fromGoogleUser($userInfo);\n \n }", "public function profile(){\n\t\t$this->common_lib->profile($this->user,$this->menu,$this->group->name);\n\t}", "function getProfile($prj_id, $usr_id)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->getProfile($usr_id);\n }", "public function load() {\n\t\tglobal $config;\n\t\n\t\tif($this->exists()){ // User exists\n\t\t\tif(!empty($this->data['id']))\n\t\t\t\t$where = 'id = '.$this->data['id'];\n\t\t\telseif(!empty($this->data['fbid']))\n\t\t\t\t$where = 'fbid = '.$this->data['fbid'];\n\t\t\t\t\n\t\t\t$result = $config['database']->query(\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM nuusers\n\t\t\t\tWHERE $where\n\t\t\t\tLIMIT 1\n\t\t\t\");\n\t\t\t$row = $result->fetch_assoc();\n\t\t\t\n\t\t\tforeach($row as $key => $val){\n\t\t\t\tif($key == 'options'){\n\t\t\t\t\t$this->data['options'] = json_decode($val, true);\n\t\t\t\t}else if(is_string($val)){\n\t\t\t\t\tif(!get_magic_quotes_gpc())\n\t\t\t\t\t\t$this->data[$key] = stripslashes($val);\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->data[$key] = $val;\n\t\t\t\t}else{\n\t\t\t\t\t$this->data[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($this->data['photo'])){\n\t\t\t\tglobal $config;\n\t\t\t\t\n\t\t\t\tif($this->data['faculty'])\n\t\t\t\t\t$this->data['photo'] = $config['imagesurl'].'/faculty.jpg';\n\t\t\t\telse\n\t\t\t\t\t$this->data['photo'] = $config['imagesurl'].'/anonymous.gif';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->data['level'] = $this->loadLevel();\n\t\t\t$this->data['levelProgress'] = $this->loadLevelProgress();\n\t\t\t$this->data['rank'] = $this->loadRank();\n\t\t\t$this->data['achievements'] = $this->loadAchievements();\n\t\t\t$this->data['post_counts'] = $this->loadPostCounts();\n\t\t\t\n\t\t\treturn $result;\n\t\t}else{ // User does not exists\n\t\t\tif($this->data['fbid']){ // New user from facebook\n\t\t\t\tglobal $fbme;\n\t\t\t\t\n\t\t\t\t$y = substr($fbme['birthday'],6);\n\t\t\t\t$m = substr($fbme['birthday'],0,2);\n\t\t\t\t$d = substr($fbme['birthday'],3,2);\n\t\t\t\t$bday = $y.'-'.$m.'-'.$d;\n\t\t\t\t\n\t\t\t\t$create = $this->create(array(\n\t\t\t\t\t'first_name' => $fbme['first_name'],\n\t\t\t\t\t'last_name' => $fbme['last_name'],\n\t\t\t\t\t'email' => $fbme['email'],\n\t\t\t\t\t'birthday' => $bday,\n\t\t\t\t\t'gender' => $fbme['gender']\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\treturn $create;\n\t\t\t}else{ // Invalid user id\n\t\t\t\t$this->data['id'] = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['user_id' => 'id']);\n }", "public function getProfileData(){\n\t\t// Get stackoverflow id\n\t\t$userId = get_option('stackoverflowUser');\n\n\t\t// Get data from api\n\t\t$url ='https://api.stackexchange.com/2.2/users/' . $userId . '?site=stackoverflow';\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\t// Set so curl_exec returns the result instead of outputting it.\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t// Get the response and close the channel.\n\t\t$response = json_decode(curl_exec($ch));\n\t\tcurl_close($ch);\n\n\t\t$profileData = array(\n\t\t\t'profileLink' => $response->items[\"0\"]->link,\n\t\t\t'reputation' => $response->items[\"0\"]->reputation,\n\t\t\t'goldBadges' => $response->items[\"0\"]->badge_counts->gold,\n\t\t\t'silverBadges' => $response->items[\"0\"]->badge_counts->silver,\n\t\t\t'bronzeBadges' => $response->items[\"0\"]->badge_counts->bronze,\n\t\t\t'lastFetch' => date('d-m-Y H:m:s')\n\t\t);\n\t\t// Update data\n\t\tupdate_option('StackoverflowData', $profileData);\n\t}", "public function userProfile() {\n \n return response()->json( auth()->user()\n \n \n \n \n \n );\n }", "public static function getUserInfo(int $id)\n {\n $userProfil = User::where('id', $id)->first();\n return $userProfil;\n }", "public function getUserProfile()\n {\n $user = $this->security->getUser();\n return $user;\n }", "protected function getResourceObject()\n {\n return new Profile($this->api);\n }", "public function show($id) {\n $profile = Profile::where(\"profile_id\", $id)->with(\"placuser\")->first();\n return $profile;\n }", "public function account() {\n $connection = new HTTPConnector($this);\n $url = $this->credential->getRequestUrl(BitcasaConstants::METHOD_USER . BitcasaConstants::METHOD_PROFILE);\n if (!BitcasaUtils::isSuccess($connection->get($url))) {\n return null;\n }\n\n $response = $connection->getResponse(true);\n\n $accountInfo = Account::getInstance($response);\n return $accountInfo;\n }", "public function show($id)\n {\n //\n $user = User::find($id);\n $profile = $user->profile;\n $profile['username'] = $user->username;\n return response()->json($profile);\n }", "private function GetInstructorProfile($WH_ID=0)\n\t{\n $record = $this->SQL->GetRecord(array(\n 'table' => $GLOBALS['TABLE_instructor_profile'],\n 'keys' => '*',\n 'where' => \"wh_id='$WH_ID' AND active=1\",\n ));\n if ($this->Show_Query) echo \"<br /><br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n $this->profile = array(\n\t\t\t'name' => \"{$record['first_name']} {$record['last_name']}\",\n 'picture' => $record['primary_pictures_id'], //'instructor_53456.gif',\n //'location' => \"{$record['location_city']}, {$record['location_state']}\",\n //'experience' => $record['experience_years'],\n 'description' => $record['profile'],\n 'types' => $record['yoga_types'],\n\t\t);\n\t}", "public function getProfile() {\n\t\treturn $this->profile;\n\t}", "public function getUserData()\r\n \t{\r\n \t\tif ($this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn $this->_client->api('/me');\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public function getProfileAction()\n\t{\n\t\t// Find own profile by authorisation token\n\t\tif ($this->request->hasPost('token')) {\n\t\t\tif ($auth = AuthTokens::findFirstByToken($this->request->getPost('token'))) {\n\t\t\t\treturn $this->reply->asJson([\n\t\t\t\t\t'success' => true,\n\t\t\t\t\t'message' => '',\n\t\t\t\t\t'user' => [\n\t\t\t\t\t\t'firstname' => $auth->users->userFirstname,\n\t\t\t\t\t\t'lastname' => $auth->users->userLastname,\n\t\t\t\t\t\t'prefix' => $auth->users->userPrefix,\n\t\t\t\t\t\t'phone' => $auth->users->userPhone,\n\t\t\t\t\t\t'email' => $auth->users->userEmail,\n\t\t\t\t\t\t'points' => $auth->users->userPoints,\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn $this->reply->withFail(Response::ERROR_INVALID_AUTH);\n\t\t\t}\n\n\t\t// Find another profile by user id\n\t\t} else if (\n\t\t\t$this->request->hasPost('id') &&\n\t\t\tis_numeric($this->request->getPost('id'))\n\t\t) {\n\t\t\tif ($user = Users::findFirst($this->request->getPost('id'))) {\n\t\t\t\treturn $this->reply->asJson([\n\t\t\t\t\t'success' => true,\n\t\t\t\t\t'message' => '',\n\t\t\t\t\t'user' => [\n\t\t\t\t\t\t'firstname' => $user->userFirstname,\n\t\t\t\t\t\t'lastname' => $user->userLastname,\n\t\t\t\t\t\t'prefix' => $user->userPrefix,\n\t\t\t\t\t\t'points' => $user->userPoints,\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn $this->reply->asJson([\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => 'Invalid user id.'\n\t\t\t\t]);\n\t\t\t}\n\n\t\t// Invalid parameters\n\t\t} else {\n\t\t\treturn $this->reply->withFail(Response::ERROR_INVALID_PARAMS);\n\t\t}\n\t}", "static function getProfileID($user_id)\n\t{\n\n\t\t$profile = ORM::for_table('PROFILE')->select('profile_id')->where('owner_id', $user_id)->find_one();\n\n\t\treturn $profile;\n\t}", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "function update_user_profile() {\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggdomainname = $CFG->wwwroot.$config->elggpath;\n $elggmethod = 'get.user.info';\n $elgg_api_key = $config->elggapikey;\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $elggdomainname.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $dataobject = new stdClass;\n $dataobject->id = $result->id;\n if($fetched->result->firstname || $fetched->result->firstname !== null) {\n $dataobject->firstname = $fetched->result->firstname;\n }\n if($fetched->result->lastname || $fetched->result->lastname !== null) {\n $dataobject->lastname = $fetched->result->lastname;\n }\n if($fetched->result->email || $fetched->result->email !== null) {\n $dataobject->email = $fetched->result->email;\n }\n if($fetched->result->phone || $fetched->result->phone !== null) {\n $dataobject->phone1 = $fetched->result->phone;\n }\n if($fetched->result->mobile || $fetched->result->mobile !== null) {\n $dataobject->phone2 = $fetched->result->mobile;\n }\n if($fetched->result->city || $fetched->result->city !== null) {\n $dataobject->city = $fetched->result->city;\n $dataobject->country = 'BR';\n }\n if($fetched->result->description || $fetched->result->description !== null) {\n $dataobject->description = $fetched->result->description;\n }\n $DB->update_record('user',$dataobject);\n unset($dataobject);\n if($fetched->result->company || $fetched->result->company !== null) {\n $companyfieldid =[];\n try {\n $companyfieldid = $DB->get_record_sql(\"SELECT uid.id,uid.data\n FROM {user_info_data} AS uid\n JOIN {user_info_field} AS uif ON (uif.id = uid.fieldid)\n WHERE uid.userid = :userid\n AND uif.shortname = 'empresa'\",array('userid'=>$result->id),MUST_EXIST);\n if(strcmp($companyfieldid->data,$fetched->result->company) !== 0) {\n $DB->update_record('user_info_data',array('id'=>$companyfieldid->id,'data'=>$fetched->result->company));\n }\n }\n catch(Exception $e) {\n echo $e;\n }\n }\n }\n }\n }\n return true;\n}", "protected function initUserInfoAttributes()\n {\n return $this->api(\"user/get_user_info\", 'GET', ['oauth_consumer_key'=>$this->getUserAttributes()['client_id'], 'openid'=>$this->getUserAttributes()['openid']]);\n }", "public function getProfile()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getProfile() : null;\r\n }", "public function getProfile()\n {\n $res = $this->getEntity()->getProfile();\n\t\tif($res === null)\n\t\t{\n\t\t\t$this->setProfile(SDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->findByCriteria('Profile', array('primary' => $this::getPrimary())));\n\t\t\treturn $this->getEntity()->getProfile();\n\t\t}\n return $res;\n }", "protected function getUserFromAccessToken()\n {\n try {\n return $this->api('GET', '/v1/people/~:(id,firstName,lastName,headline)');\n } catch (LinkedInApiException $e) {\n return;\n }\n }", "public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}", "protected function getUserProfile() {\n $profile = (new FacebookRequest(\n $this->fbSession, 'GET', '/me'\n ))->execute()->getGraphObject(GraphUser::className());\n //return\n return $profile;\n }", "public function fetchProfile($id, array $options = [])\n {\n $data = [\n '_id' => $id\n ];\n\n $response = $this->kuzzle->query(\n $this->buildQueryArgs('getProfile'),\n $data,\n $options\n );\n\n return new Profile($this, $response['result']['_id'], $response['result']['_source'], $response['result']['_meta']);\n }", "public function profile()\n {\n $id = $this->Auth->user('id');\n $user = $this->Users->get($id, [\n 'contain' => []\n ]);\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n //avoid mass-assignment attack\n $options = [\n 'fieldList' => [\n 'email',\n 'username',\n 'password',\n 'first_name',\n 'last_name',\n 'address_1',\n 'address_2',\n 'suburb',\n 'state',\n 'post_code',\n 'mobile',\n 'phone',\n ]\n ];\n\n $user = $this->Users->patchEntity($user, $this->request->getData(), $options);\n if ($this->Users->save($user)) {\n\n $this->Flash->success(__('Your profile has been updated.'));\n return $this->redirect(\"/\");\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "public function get_profile($username = '')\n {\n\n\n if($username) $this->username = $username;\n\n $details = (Object) $this->user_details($this->username);\n\n $profile = $details->profile;\n\n $not_valid = !(!empty($profile) and FILE::isExist($profile,\"profile\"));\n\n if($not_valid) return;\n\n return $profile;\n\n\n }" ]
[ "0.70147586", "0.69734836", "0.69304895", "0.69040716", "0.6845906", "0.6828981", "0.68215376", "0.67172414", "0.668077", "0.6634352", "0.656285", "0.6529293", "0.6527742", "0.6527256", "0.6527256", "0.6507267", "0.65028745", "0.6475412", "0.6470527", "0.64657557", "0.6409142", "0.6407862", "0.6405086", "0.6373802", "0.6341762", "0.6288476", "0.61822224", "0.61710256", "0.61473596", "0.61159015", "0.6112467", "0.6098852", "0.6079272", "0.60723865", "0.60278356", "0.60144114", "0.6009928", "0.6008175", "0.598476", "0.59701264", "0.5950261", "0.5944594", "0.5944594", "0.5944594", "0.5943663", "0.59436274", "0.59426606", "0.5942158", "0.59399664", "0.5935673", "0.5929533", "0.5924162", "0.59089094", "0.5906797", "0.5904853", "0.590482", "0.5904311", "0.5892086", "0.58823305", "0.587717", "0.587179", "0.5867443", "0.5866285", "0.5862164", "0.5852064", "0.581882", "0.5811705", "0.58019954", "0.57970536", "0.5791888", "0.57856715", "0.5783177", "0.5777768", "0.57769626", "0.5761851", "0.57478434", "0.5745605", "0.57444274", "0.573839", "0.57316107", "0.5719346", "0.57189465", "0.5716232", "0.5715007", "0.57142234", "0.57135206", "0.5711696", "0.5705573", "0.5703524", "0.5699441", "0.5695919", "0.569403", "0.56855434", "0.56850713", "0.5685057", "0.56797343", "0.56553996", "0.56530696", "0.5649809", "0.5647424" ]
0.6858198
4
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { foreach (BoardConfiguration::where('task_id', '!=', '')->get() as $Setting) { $this->User = User::find($Setting->user_id); Auth::login($this->User); $Class = "App\\Console\\Commands\\Task\\Tasks\\{$Setting->tasks[$Setting->task_id]}"; $Task = new $Class; $Task->boot($Setting, $this->User); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Condition used to check if a content element is in a certain column This is used in the Permissions.ts TSConfig file to make sure only certain content elements are placed in certain columns.
public function matchCondition(array $conditionParameters) { $result = false; if (0 === count($conditionParameters)) { $result = true; } else { $colPos = (int)$conditionParameters[0]; $get = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET(); // Case 2). Adding a new element using the new-element icon if (isset($get['colPos'])) { $result = $colPos === (int)$get['colPos']; // Case 3). Right after new element creation } elseif (isset($get['defVals']['tt_content']['colPos'])) { $result = $colPos === (int)$get['defVals']['tt_content']['colPos']; // Case 1). edit one or more existing elements } elseif (isset($get['edit']['tt_content'])) { $getUid = $get['edit']['tt_content']; if (is_array($getUid)) { $uid = (int)abs(rtrim(key($getUid), ',')); $result = $colPos === $this->getColPosFromDatabase($uid); } // Case 4). Elements pasted from a clipboard } elseif (is_array($get['CB'])) { $newColPosData = $GLOBALS['BE_USER']->getSessionData('core.www_tue_ce.newColPos'); if (is_array($newColPosData) && ($colPos == $newColPosData['colPos'])) { $result = true; }; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function beUserHasRightToSeeMultiColumnContainer () {\r\n\t\t$hasAccess = true;\r\n\t\t$TSconfig = t3lib_BEfunc::getPagesTSconfig($GLOBALS['SOBE']->id);\r\n\t\t\r\n\t\t\t// check remove items\r\n\t\tif(!empty($TSconfig['TCEFORM.']['tt_content.']['CType.']['removeItems'])) {\r\n\t\t\t$hasAccess = t3lib_div::inList($TSconfig['TCEFORM.']['tt_content.']['CType.']['removeItems'], 'multicolumn') ? false : true;\r\n\t\t\tif(!$hasAccess) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\t// is admin?\r\n\t\tif(!empty($GLOBALS['BE_USER']->user['admin'])) {\r\n\t\t\treturn $hasAccess;\r\n\t\t}\r\n\t\t\r\n\t\t\t// is explicitADmode allow ?\r\n\t\tif($GLOBALS['TYPO3_CONF_VARS']['BE']['explicitADmode'] === 'explicitAllow') {\r\n\t\t\t$hasAccess = t3lib_div::inList($GLOBALS['BE_USER']->groupData['explicit_allowdeny'], 'tt_content:CType:multicolumn:ALLOW') ? true : false;\r\n\t\t} else {\r\n\t\t\t$hasAccess = t3lib_div::inList($GLOBALS['BE_USER']->groupData['explicit_allowdeny'], 'tt_content:CType:multicolumn:DENY') ? false : true;\r\n\t\t}\r\n\t\t\r\n\t\treturn $hasAccess;\r\n\t}", "public function hasRowContents(){\n return $this->_has(1);\n }", "public function has(string $col) : bool;", "public function hasColumns(){\n return $this->_has(3);\n }", "public function hasContent(){\n return $this->_has(6);\n }", "public function hasContent(){\n return $this->_has(4);\n }", "public function hasColumnNumber(){\n return $this->_has(5);\n }", "function spr_exclude_column_found($column) {\nglobal $spr_exclude_db_debug;\n\n\t$rs = safe_query('SELECT * FROM '.safe_pfx('txp_section'),$spr_exclude_db_debug);\n\t$a = nextRow($rs);\n\treturn array_key_exists($column, $a);\n}", "public function isAvailable($column, $value){\n\n $vars = $this->theHand->fetchWithConditions($this->table,$column, \"$column='$value'\");\n\n return count($vars)==0;\n\n\n }", "protected function checkInModal($column){\n\n if($this->model->where($column, '=',$this->token)->exists()){\n return true;\n }\n return false;\n }", "function is_element_used($rows, $element_name){\n $result = false;\n foreach ($rows as $key => $template_part) {\n foreach ($template_part['_elements'] as $key => $element) {\n # code...\n //var_dump($element['type'] );\n if(isset($element['type']) && $element['type'] == $element_name){\n $result = true;\n break;\n }\n }\n \n }\n\n return $result;\n }", "abstract public function hasRow();", "public function hasCell(){\n return $this->_has(1);\n }", "function verify_column( $column, $table, $db = null ) {\n\n\t\t$columns = $this->get_columns( $table, $db );\n\t\treturn in_array( $column, $columns );\n\n\t}", "public function hasColumn($name);", "public function hasContent() {}", "private function setupIfColumn() {\n \n Blade::directive('if_column', function($expression) {\n $col = $this->stringParamAsString($expression); //gets col\n return '<?php '\n .' if ( (isset($show_columns) && array_search('.$col.',$show_columns)!==FALSE) || '\n . '(isset($hide_columns) && array_search('.$col.',$hide_columns)===FALSE) || '\n .' (!isset($show_columns) && !isset($hide_columns)) ): ?>';\n\n });\n }", "public function hasContentElement(): bool\n {\n return $this->isChildElementSet(1);\n }", "abstract public function hasContent();", "public function isColumn($key)\n {\n return in_array(strtolower($key), $this->columns());\n }", "public function hasRowSet(){\n return $this->_has(8);\n }", "public function hasHeader() {\n return is_array($this->colName) && !empty($this->colName);\n }", "public function hasInfluencedContent();", "function kusurinotakagi_has_table_of_contents() {\n//\tif ( is_singular( 'blog' ) ) {\n//\t\treturn true;\n//\t}\n//\tif ( is_single() ) {\n//\t\treturn true;\n//\t}\n\n\treturn false;\n}", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function isAt($row, $column);", "function issetTableColumn($table_name, $column_name)\n{\n global $wpdb;\n $columns = $wpdb->get_results(\"SHOW COLUMNS FROM \" . $table_name, ARRAY_A);\n foreach ($columns as $column) {\n if ($column['Field'] == $column_name) {\n return true;\n }\n }\n}", "function isDisplayCondition($displayCond,$row,$ffValueKey='')\t{\n\t\t$output = FALSE;\n\n\t\t$orparts = t3lib_div::trimExplode('||', $displayCond, 1);\n\t\tforeach ($orparts as $orpart)\t{\n\t\t\t$andparts = t3lib_div::trimExplode('&&', trim($orpart), 1);\n\t\t\t$andout = true;\n\t\t\tforeach ($andparts as $part)\t{\n\t\t\t\t$part = trim($part);\n\t\t\t\tif (strpos(strtoupper($part), ':CONTAINS:')!==false)\t{\n\t\t\t\t\t$parts = explode(':',$part);\n\t\t\t\t\tswitch(strtoupper($parts[0]))\t{\t// Type of condition:\n\t\t\t\t\t\tcase 'FIELD':\n\t\t\t\t\t\t\t$theFieldValue = $ffValueKey ? $row[$parts[1]][$ffValueKey] : $row[$parts[1]];\n\t\t\t\t\t\t\tswitch((string)$parts[2])\t{\n\t\t\t\t\t\t\t\tcase 'CONTAINS':\n\t\t\t\t\t\t\t\t\tif (!preg_match('/(^|,)'.preg_quote($parts[3], '/').'($|,|\\|)/', $theFieldValue))\t{\n\t\t\t\t\t\t\t\t\t\t$andout = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$andout = 0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$andout = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else\t{\n\t\t\t\t\t$andout &= parent::isDisplayCondition($part, $row, $ffValueKey);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output |= $andout;\n\t\t}\n\t\treturn $output;\n\t}", "public function hasRowRange(){\n return $this->_has(3);\n }", "private function checkSevenDayInCol():bool\n {\n $stmt = $this->pdo->query(\"SHOW COLUMNS FROM `distribution_municipalities` LIKE '%_sevendayin'\");\n return !is_bool($stmt->fetch());\n }", "public function isValidCustomRow(){\n return $this->capacity === $this->getNbSeatsCustomRow();\n }", "private function has_column($column)\n {\n $object_vars = get_object_vars($this);\n\n //check if the key exists\n return array_key_exists($column, $object_vars);\n }", "private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }", "private function hasNoColumns() {\n if (count($this->columns) === 0) return true;\n\n\n if (count($this->columns) === 1 && isset($this->columns['*'])) {\n return true;\n }\n\n return false;\n }", "public function hasContent(){ return !empty($this->content); }", "function isColumnValid(array $grid, int $x, bool $verbose = false): bool;", "public function checkEnableColumnEdit()\n\t{\n\t\treturn false;\n\t}", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function hasColumn($columnName)\r\n {\r\n }", "public function hasCells();", "private function getFormatStatusFromContent(){\n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t\treturn true;\n\t\t }\n\t\t \n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t \n\t\t if(EducationalUtil::isRoleTypeCC($this->roleType, $this->roleNamesObj)){\n\t\t\t$NUM_OF_PIECES_FOR_MEMBER_OLD = 5;\n\t\t\t$NUM_OF_PIECES_FOR_NON_MEMBER_OLD = 6;\n\t\t\tif(((count($contentArray) == $NUM_OF_PIECES_FOR_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::MEMBER_TAG)) ||\n\t\t\t ((count($contentArray) == $NUM_OF_PIECES_FOR_NON_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::NONE_MEMBER_TAG))){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t } else {\n\t\t\t$NUM_OF_PIECES_FOR_MEMBER_OLD = 3;\n\t\t\t$NUM_OF_PIECES_FOR_NON_MEMBER_OLD = 4;\n\t\t\t\n\t\t\tif(((count($contentArray) == $NUM_OF_PIECES_FOR_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::MEMBER_TAG)) ||\n\t\t\t ((count($contentArray) == $NUM_OF_PIECES_FOR_NON_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::NONE_MEMBER_TAG))){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t }\n\t }", "public function hasColumn($column)\n {\n $parameters = [];\n $parameters['handler'] = 'aql';\n $parameters['explanation'] = \"Checking if any document within the table has the '\"\n .implode(', ', (array) $column)\n .\"' column(s).\";\n $parameters['column'] = $column;\n\n return $this->addCommand('hasAttribute', $parameters);\n }", "public function in($column,$val);", "public function access() {\n \treturn true;\n // return count($this->selectContentRowsToConvert());\n }", "protected function isVisible()\n {\n $result = parent::isVisible()\n && static::getWidgetTarget() != \\XLite\\Core\\Request::getInstance()->target\n && 0 < $this->getData(new \\XLite\\Core\\CommonCell, true);\n\n if ($result) {\n\n if (!\\XLite\\Core\\CMSConnector::isCMSStarted()) {\n\n if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = in_array($this->viewListName, array('sidebar.second', 'sidebar.single'));\n\n } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = ('center.bottom' == $this->viewListName);\n }\n }\n }\n\n return $result;\n }", "function has_other_constraint_column($column, $other_columns) {\n\t\tif (count($other_columns) == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t$columns = array_unique(array_merge(array($column), $other_columns));\n\t\treturn count(array_filter($this->constraints, function($constraint) use ($columns) {\n\t\t\treturn $columns == array_intersect($constraint['columns'], $columns);\n\t\t})) > 0;\n\t}", "public function hasColumn($tableName, $columnName);", "public function testIsColumnAvailable()\n {\n /* ----------------------------------------------------\n * in below $csvData var we have faked the header data\n * -----------------------------------------------------*/\n $csvData = [['first_name','last_name','address']]; \n \n $column = 'first_name';\n\n /*\n |--------------------------------------------------------------------------\n | Success Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the success scenario\n |\n */\n\n $resp = $this->isColumnAvailable($column, $csvData);\n\n /* ------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable in case when column is available\n * -------------------------------------------------------------------------------*/\n $this->assertEqualsCanonicalizing($resp,[\"key\"=>0,\"name\"=>\"first_name\"]);\n \n\n /*\n |--------------------------------------------------------------------------\n | Failure Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the failure scenario\n |\n */\n\n $resp = $this->isColumnAvailable('unknown_column', $csvData);\n\n /* ----------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable method in case when column not found\n * -----------------------------------------------------------------------------------*/\n $this->assertFalse($resp);\n \n }", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "protected function isModerationConstraint(array $where, $column)\n {\n return $where['column'] == $column;\n }", "protected function projectSpecificSectionsCondition()\n {\n return\n isset($this->get['urls']) ||\n //F\n isset($this->get['divisions-products']) ||\n isset($this->get['translations']) ||\n //A\n isset($this->get['products']) ||\n isset($this->get['pages']);\n }", "public function getViaTableCondition();", "public function isSortedBy($column);", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function contains()\n {\n \n }", "function kouka_has_table_of_contents() {\n\tif ( is_singular( 'blog' ) ) {\n\t\treturn true;\n\t}\n\n\tif ( is_single() ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "protected function _hasHeader() {\n return (isset ($this->colName) && !empty ($this->colName));\n }", "function isEnrolled($columnId, $userId)\n {\n \t$this->db->where('planningKolomId', $columnId);\n \t$this->db->where('gebruikerId', $userId);\n\n \t$result = $this->db->get('aanwezigheid')->row();\n \n \treturn (isset($result) ? true : false);\n }", "public function has(array $data, $column)\n {\n if (strpos($column, '.')) {\n list($model, $column) = explode('.', $column);\n return isset($data[$model][$column]) || isset($data[\"{$model}.{$column}\"]);\n }\n return isset($data[$this->model->alias][$column]) || isset($data[\"{$this->model->alias}.{$column}\"]) || isset($data[$column]);\n }", "public function manageColumns( $column ){\n global $post; \n if( $this->fields_list[$column] == 'checkbox' && get_post_meta( $post->ID, $column, true) == 1):\n echo \"Yes\";\n else:\n echo __( get_post_meta($post->ID, $column, true) );\n endif;\n }", "protected function isPublishedConstraint(array $where, $column)\n\t{\n\t\treturn ($where['type'] == 'Basic' && $where['column'] == $column && $where['value'] == 1);\n\t}", "public function hasColumn($name) {\n $info = $this->_data->getDeepValue('columns/' . $name);\n return !empty($info);\n }", "public static function hasContent(): bool\n {\n return true;\n }", "private function checkImportEssentialField($type) {\n $mandatoryFields = EfrontImport::getMandatoryFields($type);\n $not_found = false;\n foreach ($mandatoryFields as $dbField => $columnName) {\n if (!isset($this -> mappings[$dbField])) {\n $not_found = true;\n break;\n }\n }\n if ($not_found) {\n $this -> log[\"failure\"][\"headerproblem\"] = _HEADERDOESNOTINCLUDEESSENTIALCOLUMN . \": \" . implode(\",\", $mandatoryFields);\n return false;\n } else {\n return true;\n }\n }", "function is_part_of_primary_keys($column) {\n\t\t$result = count(array_filter($this->constraints, function($constraint) use ($column) {\n\t\t\treturn $constraint['type'] == 'PRIMARY KEY' AND in_array($column, $constraint['columns']);\n\t\t})) > 0;\n\t\treturn $result;\n\t}", "public function columnExists( $tablename, $columnname );", "public function hasPivotData(): bool;", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "public function hasElements() {}", "public function hasAllowRowInterleaving(){\n return $this->_has(6);\n }", "function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->id == 0) ? -1 : $row->id), $contentids))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n }", "function mf_mysql_column_exist($table_name, $column_name,$dbh) {\r\n\r\n\t\t$query = \"SHOW COLUMNS FROM $table_name LIKE '$column_name'\";\r\n\t\t$sth = mf_do_query($query,array(),$dbh);\r\n\t\t$row = mf_do_fetch_result($sth);\r\n\t\t\r\n\t\tif(!empty($row)){\r\n\t\t\treturn true;\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private function hasContent( $node ) {\n return $node->count() > 0 ? true : false;\n }", "function existHead($coment){\r\n\t\treturn isset($this->Head[$coment]);\r\n\t}", "protected function columnMatchCheck ( $lineColumns ) {\n }", "private function checkIfRequestedIdIsInElementsTree() {\n $bitReturn = true;\n\n //check if requested systemid is part of the elements tree\n $objData = class_objectfactory::getInstance()->getObject($this->getSystemid());\n\n while(!$objData instanceof class_module_mediamanager_repo && $objData != null)\n $objData = class_objectfactory::getInstance()->getObject($objData->getPrevId());\n\n //if the requested systemid belong to the tree set in the pageelement, the systemids should match.\n if($objData == null || $objData->getSystemid() != $this->arrElementData[\"repo_id\"])\n $bitReturn = false;\n\n return $bitReturn;\n }", "static public function hasColumn($table, $column)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function hasColumn($column) {\n\t\t$returnValue = FALSE;\n\t\tif (array_key_exists($column, $this->_allowedColumns)) {\n\t\t\t$returnValue = TRUE;\n\t\t}\n\n\t\treturn $returnValue;\n\t}", "function has_column($column_name)\n {\n if (empty($this->object->_table_columns)) {\n $this->object->lookup_columns();\n }\n return array_search($column_name, $this->object->_table_columns) !== FALSE;\n }", "public function hasCustomFields() {\n $q = Doctrine::getTable('ArticleCustomFields2ArtCategories')\n ->createQuery()\n ->where('artcategory_id = ?', $this->ArtCategories->getPrimaryKey());\n\n return $q->execute() == null;\n }", "public function hasRowCount(){\n return $this->_has(7);\n }", "function check_if_table_has_entries_for_bereich($schema, $table, $bereich_gml_id) {\n\t\t$sql = \"SELECT TRUE FROM \" . $schema . \".\" . $table;\n\t\t$sql .= \" WHERE gehoertzubereich_href ILIKE '%\" . $bereich_gml_id . \"' LIMIT 1;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql,4, 0);\n\t\t$result = pg_fetch_row($ret[1]);\n\t\treturn $result[0] ? true : false; \n\t}", "public function hasDescription(){\n return $this->_has(5);\n }", "function get_status_column($column) {\n $status = 'ok icon-green';\n\n // Check if there is at least one 'false' in $column\n if (in_array(false, $column)) {\n $status = 'adjust icon-yellow';\n\n // Check if there is at least one 'true' in $column\n if (!in_array(true, $column)) {\n $status = 'remove icon-red';\n }\n }\n\n return $status;\n}", "public function takesTwoColumns() {\n return false;\n }", "public function inListForItemContainedReturnsTrueDataProvider() {}", "public function hasColumns($type = NULL)\n\t{\n\t\treturn count($type == NULL ? $this->getColumns() : $this->getColumns($type)) > 0;\n\t}", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "public function hasSql(){\n return $this->_has(1);\n }", "public function validateIsFullColumn($selectedColumn){\r\n //in case of a full Column\r\n if($this->board->gameBoard[0][$selectedColumn-1] != Board::CELL){\r\n columnIsFullMsg($this->currentPlayer);\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasContentSegment($segment);", "public function hasEntries(){\n return $this->_has(2);\n }", "private function hasContent($node)\n {\n return $node->count() > 0 ? true : false;\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 }", "protected function checkGalleryColumn()\n {\n $db = $this->db;\n $query = $db->getQuery(true);\n $query->select('gallery');\n $query->from($db->quoteName('#__k2_items'));\n $query->where($db->quoteName('id').\" = \".$db->quote($this->id));\n $db->setQuery($query);\n $result = $db->loadResult();\n if ($result) {\n return true;\n }\n return false;\n }" ]
[ "0.6062957", "0.5882016", "0.577921", "0.57612467", "0.5696731", "0.56465274", "0.5608349", "0.5556337", "0.55024123", "0.5495213", "0.5486442", "0.5465334", "0.5418901", "0.5388088", "0.5380476", "0.5376956", "0.5375346", "0.531481", "0.53114223", "0.5308563", "0.52926284", "0.5284586", "0.52469015", "0.5239919", "0.522719", "0.522719", "0.522719", "0.522719", "0.5214323", "0.5211276", "0.5210974", "0.5199358", "0.5182141", "0.51813114", "0.51556605", "0.51537895", "0.51439124", "0.51372784", "0.5130286", "0.50862765", "0.5085976", "0.508321", "0.5079273", "0.50759333", "0.50587595", "0.5046058", "0.5042591", "0.5035948", "0.5034238", "0.50270844", "0.50074226", "0.5001744", "0.5001391", "0.50008845", "0.49948457", "0.49942535", "0.498883", "0.498883", "0.498883", "0.49838647", "0.49835518", "0.49711928", "0.4966814", "0.4953556", "0.4950471", "0.49441195", "0.49372092", "0.49215573", "0.48994127", "0.48988712", "0.4889522", "0.48881128", "0.48832303", "0.4882763", "0.48802507", "0.48774406", "0.48739642", "0.48721486", "0.48692694", "0.48666874", "0.48629433", "0.4859813", "0.48581344", "0.48561865", "0.48526338", "0.48504105", "0.4849883", "0.48426926", "0.48390818", "0.48382667", "0.4836526", "0.48309866", "0.48267087", "0.48267087", "0.48259017", "0.48198882", "0.48197705", "0.4814803", "0.48145965", "0.48141083", "0.48081976" ]
0.0
-1
Get the colPos from a content element in the database
protected function getColPosFromDatabase($contentElementUid) { $queryResult = $this->getDatabaseConnection()->sql_query( 'SELECT colPos FROM tt_content WHERE uid =' . $contentElementUid ); /** @var array $contentElement */ $contentElement = $this->getDatabaseConnection()->sql_fetch_assoc($queryResult); $this->getDatabaseConnection()->sql_free_result($queryResult); return (int)$contentElement['colPos']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPositionColumn();", "public function columnOffset();", "protected function getPositionColumn()\n {\n return $this->positionColumn ?? 'position';\n }", "public function getColumn(){\n\n $part = substr($this->input, 0, $this->index);\n $pos = strrpos($part,\"\\n\");\n return $this->index - $pos;\n }", "protected function getLayoutColPosVals()\n {\n $select_fields = 'uid, config';\n $where = 'deleted = 0';\n $orderBy = 'uid';\n $table = 'tx_gridelements_backend_layout';\n $resource = $this->execSelect($select_fields, $where, $orderBy, $table);\n if ($resource === false) {\n $this->results['error'] = 'error_no_ge_config';\n return 0;\n }\n\n $layoutColPosVals = array();\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $pattern = '/colPos\\s*=\\s*\\d+/';\n $matches = array();\n preg_match_all($pattern, $row['config'], $matches);\n\n $colPosVals = preg_replace('/colPos\\s*=\\s*/', '', $matches[0]);\n $layoutColPosVals[$row['uid']] = $colPosVals;\n }\n return $layoutColPosVals;\n }", "function getColumnIndex($colName){\n\t\tfor ($i = 0; $i < count($this->m_descs); $i++){\n\t\t\t$desc = $this->m_descs[$i];\n\t\t\tif (0 == strcmp($colName, $desc->getColName())){\n\t\t\t\treturn $i;\n\t\t\t}\n\t\t}\n return -1;\n\t}", "public function getStartColumn()\n {\n return $this->start_column;\n }", "public function position()\n\t{\n\t\treturn $this->getField('position');\n\t}", "public function column() : int\n {\n return $this->column;\n }", "public function getFirstCol() : int\n {\n\n // Convert A1:D3 to A1.\n list($startRef,) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert A1 to 1.\n $startCol = preg_replace('/([0-9])/', '', $startRef);\n\n return XlsxTools::convRefToNumber($startCol);\n }", "public function getColumn(): string;", "private function getPositionSubSql() {\n\t\t$table = $this->query->getTableMap()::TABLE_NAME;\n\t\t$col = Model::aliasproperty('id');\n\t\t$sql = \"SELECT $col, @rownum := @rownum + 1 AS position FROM $table\";\n\t\t$whereClause = $this->getWhereClauseString();\n\n\t\tif (empty($whereClause) === false) {\n\t\t\t$sql .= ' WHERE ' . $whereClause;\n\t\t}\n\t\treturn $sql;\n\t}", "protected function loadDocCommentPos(): ?int\n {\n $docHelper = $this->getDocHelper();\n\n return $docHelper->hasDocBlock() ? $docHelper->getBlockStartPosition() : null;\n }", "public function _getColPos($colname, $cols)\n {\n /* Make sure array is not empty, and the parameter is an array */\n if (empty($cols) || !is_array($cols) || !array_key_exists($colname, $cols)) {\n return false;\n }\n\n unset($cols['primary']);\n\n /* Get the index for the column */\n if (($position = array_search($colname, array_keys($cols))) === false) {\n return false;\n }\n\n return $position;\n }", "public function getPosition() : int\n {\n $rtn = $this->data['position'];\n\n return $rtn;\n }", "public function ColCount() {\n return $this->_coln;\n }", "protected function transferNestedColumnPosition()\n {\n $select_fields = 'tx_multicolumn_parentid, colPos';\n $where = 'tx_multicolumn_parentid > 0 AND deleted = 0';\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n $this->results['error'] = 'error_no_mc_contents';\n return false;\n }\n\n // Find colPos values used for elements in multicolum containers\n $mcColPosValsPerParent = array();\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $mcpid = $row['tx_multicolumn_parentid'];\n if (!isset($mcColPosValsPerParent[$mcpid])) {\n $mcColPosValsPerParent[$mcpid] = array(\n 'colPosVals' => array(),\n 'geLayout' => '',\n );\n }\n $mcColPosValsPerParent[$mcpid]['colPosVals'][] = $row['colPos'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n\n // Update colPos values\n foreach ($mcColPosValsPerParent as $mcpid => &$array) {\n $array['colPosVals'] = array_unique($array['colPosVals']);\n $select_fields = 'uid, tx_gridelements_backend_layout';\n $where = 'uid = ' . $mcpid;\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n continue; // Parent container doesn't exist anymore.\n }\n\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $array['geLayout'] = $row['tx_gridelements_backend_layout'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n }\n\n $layoutColPosVals = $this->getLayoutColPosVals();\n foreach ($mcColPosValsPerParent as $mcpid => $array) {\n $i = 0;\n foreach ($array['colPosVals'] as $colPos) {\n $where = 'tx_multicolumn_parentid = ' . $mcpid\n . ' AND colPos = ' . $colPos;\n $geColumn = $i + 100;\n $geColPos = -2; // Column NOT available in GE layout\n if (isset($layoutColPosVals[$array['geLayout']][$i])) {\n $geColumn = $layoutColPosVals[$array['geLayout']][$i];\n $geColPos = -1; // Column available in GE layout\n }\n $fields_values = array(\n 'colPos' => $geColPos,\n 'backupColPos' => $colPos,\n 'tx_gridelements_columns' => $geColumn,\n );\n $this->execUpdate($where, $fields_values);\n ++$i;\n }\n }\n $this->results['transferNestedColumnPosition'] = true;\n return true;\n }", "public function getCol()\n {\n return $this->col;\n }", "public function getCurrentSortedColumn()\n {\n return $this->_currentSortedColumn;\n }", "public static function columnNumber($col) {\n $col = str_pad($col,2,'0',STR_PAD_LEFT);\n $i = ($col{0} == '0') ? 0 : (ord($col{0}) - 64) * 26;\n $i += ord($col{1}) - 64;\n return $i;\n }", "protected function getDocCommentPos()\n {\n if ($this->docCommentPos === false) {\n $this->docCommentPos = $this->loadDocCommentPos();\n }\n\n return $this->docCommentPos;\n }", "public function fetchColumn($columnIndex = 0);", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getRowOffset();", "public function getPosition() {\n return $this->getValue('position');\n }", "function getCol($sql){\n\t\t$res_array = $this->query($sql);\n\t\tif (array_key_exists(0, $res_array) AND array_key_exists(0, $res_array[0])){\n\t\t\treturn $res_array[0][0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getLastCol() : int\n {\n\n // Convert A1:D3 to D3.\n list(,$endRef) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert D3 to 4.\n $endCol = preg_replace('/([0-9])/', '', $endRef);\n\n return XlsxTools::convRefToNumber($endCol);\n }", "public function getLastColumnPosition($project_id)\n {\n return (int) $this->db\n ->table(self::TABLE)\n ->eq('project_id', $project_id)\n ->desc('position')\n ->findOneColumn('position');\n }", "public function getColumn() { return $this->column; }", "function pos(){\n return ftell($this->handle);\n }", "private function getPositionSubSql() {\n\t\t$table = $this->query->getTableMap()::TABLE_NAME;\n\t\t$sql = \"SELECT Arcucustid, ar3pacctnbr, @rownum := @rownum + 1 AS position FROM $table\";\n\t\t$whereClause = $this->getWhereClauseString();\n\t\tif (empty($whereClause) === false) {\n\t\t\t$sql .= ' WHERE ' . $whereClause;\n\t\t}\n\t\treturn $sql;\n\t}", "public function position()\n {\n return $this->i;\n }", "abstract protected function html_column_param();", "public function firstCol() {\n\t}", "public function getColumnCount()\n {\n $res = $this->getMetaData();\n $colcount = 0;\n foreach ($this->_metaData['sections'] as $section) {\n $sec_colcount = 0;\n foreach ($section['columns'] as $col) {\n if (isset($col['colspan'])) {\n $sec_colcount += $col['colspan'];\n } else {\n $sec_colcount++;\n }\n }\n if ($sec_colcount > $colcount) {\n $colcount = $sec_colcount;\n }\n }\n\n return $colcount;\n }", "public function position()\r\n\t{\r\n\t\treturn ftell($this->getPointer());\r\n\t}", "public function getColumn(): string\n {\n return $this->_column;\n }", "final private function checkCol($i,$j){\n\t\tfor($k=0;$k<$j; $k++)\n\t\t\tif (isset($this->contents[$i]->contents[$k]->attrs['colspan']) and \n\t\t\t\t\t(int)$this->contents[$i]->contents[$k]->attrs['colspan'] + $k > $j)\n\t\t\treturn $k+1;\n\t\treturn 0;\n\t}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public static function queryColWithIndex($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[$row[0]] = $row[1];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "public function FindCol($col) {\n\t\t$crawler = $this->tail->Next();\n\n\t\tif ($this->tail->Column() === $col) {\n\t\t\treturn $this->tail;\n\t\t}\n\n\t\tif ($this->head->Column() === $col) {\n\t\t\treturn $this->head;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->count - 1; $i++) {\n\t\t\tif ($crawler->Column() === $col)\n\t\t\t\treturn $crawler;\n\t\t\t$crawler = $crawler->Next();\n\t\t}\n\t\treturn null;\n\t}", "public function getPosition()\r\n {\r\n return ftell($this->handle);\r\n }", "public function getOrdinalPosition()\n {\n return $this->ordinal_position;\n }", "public function getOffset()\n {\n if (! isset($this->offset)) {\n $this->offset = (int)$this->getXPath($this->getDom())->query($this->getOffsetQuery())->item(0)->value;\n }\n return $this->offset;\n }", "public function getPos();", "public function getPos();", "public static function colIndex($colLetter): int\n {\n $colNumber = self::colNumber($colLetter);\n\n if ($colNumber > 0) {\n return $colNumber - 1;\n }\n\n return $colNumber;\n }", "private function get_last_display_column()\r\n\t\t{\r\n\t\t\t$last_display_col = 0;\r\n\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']) $last_display_col = $key_col;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $last_display_col;\r\n\t\t}", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getSortColumn();", "function searchRowColum($input){\n\t$indices = array_keys($input);\n\t$pos = count($indices);\n\t$aux = explode(\"t\", $indices[$pos-1]);\n\t$rowColum = explode(\"#\", $aux[1]);\n\treturn $rowColum;\n}", "protected function getcolspan(){\r\n\t\t$x_points=$this->GTemp->struct->XPoints;\r\n\t\treturn array_search($this->x2, $x_points)-array_search($this->x1, $x_points);\r\n\t}", "public function getColumn()\n {\n return $this->get('Column');\n }", "public function getPosition()\n {\n return $this->getData(self::POSITION);\n }", "function getOffset() ;", "public function position() {\n\t\treturn $this->position;\n\t}", "public function getColumns()\n {\n return strlen($this->string);\n }", "function getPosition() { return $this->readText(); }", "public function getTextPosition()\n\t{\n\t\treturn $this->textPosition;\n\t}", "function getPosition() { return $this->readText(); }", "function setActionsColPos($pos) \n\t{\n\t\tif(preg_match('/^[1-9][0-9]*$/',$pos) && $this->col_num >= $pos)\n\t\t$this->actionsColPos = $pos;\n\t}", "protected function _getLastAbsoluteX()\n {\n for ($k=count($this->table)-1; $k>=0; $k--) {\n if ($this->table[$k]['x'] && $this->table[$k]['position']) return $this->table[$k]['x'];\n }\n return $this->_pdf->getlMargin();\n }", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "function getPosition()\n\t{\n\t\treturn $this->Info['Position'];\n\t}", "public static function position()\n {\n return static::$position;\n }", "public static function position()\n {\n return static::$position;\n }", "public function getCaretOffset() {}", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "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 get_column_id()\n\t{\n\t\treturn $this->table.'.id';\n\t}", "public function getPosition(): string;", "public function get_position()\n {\n\n if ( $file = fopen($this->path,\"r\") ) {\n\n $string_number = 0;\n $position = 0;\n while(($line = fgets($file,4096)) !== false && !$position) {\n\n $string_number++;\n if(strpos($line,$this->str) !== false) {\n\n $position = strpos($line,$this->str);\n }\n }\n echo 'номер строки: ' . $string_number . ', позиция: ' . ($position+1);\n\n } else {\n\n echo 'ничего не вышло';\n\n }\n\n }", "public function getEndColumn()\n {\n return $this->end_column;\n }", "public function getOffset();", "public function getOffset();", "public function getOffset();", "private function getPosition()\n {\n if (false === ($position = @ftell($this->getHandle()))) {\n $error = error_get_last();\n\n throw new RuntimeException($error['message']);\n }\n\n return $position;\n }", "public function getSqlCol()\n {\n return $this->sqlCol;\n }", "public function getPosition(): int\n {\n return $this->position;\n }", "public function getPosition(): int\n {\n return $this->position;\n }", "public function getPosition() {\n\t\treturn $this->position;\n\t}", "public function getPosition() {\n\t\treturn $this->position;\n\t}", "public function getColumna() {\n return $this->columna;\n }", "public function getElementDim(): int\n {\n return $this->col2;\n }", "function getCols() { return $this->_cols; }", "public function getColumn( $sQuery ){\n $oQuery = $this->query( $sQuery );\n $this->checkQuery( $oQuery );\n return $oQuery->fetchColumn( );\n }", "abstract public function getColumnsCount();", "function getTamColumna($texto){\n $pos1 = strpos($texto, ';');\n $nroCaracteres = substr($texto,$pos1+1,strlen($texto));\n $textoTitulo = utf8_decode(substr($texto,0,$pos1));\n $espacioTitulo = $this->GetStringWidth($textoTitulo);\n $valorColumna = 0;\n if (strlen($textoTitulo) < $nroCaracteres){\n $espacioRestante = ($nroCaracteres - $this->GetStringWidth($textoTitulo))*$this->GetStringWidth(' ');\n $valorColumna = $this->GetStringWidth($textoTitulo) + $espacioRestante;\n }else{\n $valorColumna = $this->GetStringWidth($textoTitulo);\n\n }\n\n return $valorColumna;\n\n}", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "public function getOffset() {}", "public function getOffset() {}", "public function getOffset() {}", "function getColumns() {return $this->_columns;}", "public function lastCol() {\n\t}" ]
[ "0.76174587", "0.7289113", "0.68652093", "0.66942096", "0.6408288", "0.6118814", "0.6085125", "0.6034319", "0.5988009", "0.5843853", "0.58199114", "0.5746704", "0.5730189", "0.57267284", "0.57145965", "0.56802636", "0.5676263", "0.5662575", "0.5657394", "0.56508076", "0.5646389", "0.5615805", "0.5587596", "0.5587596", "0.5579404", "0.5562944", "0.55618596", "0.55523014", "0.55472046", "0.5541698", "0.54798675", "0.5474962", "0.54699826", "0.54632837", "0.5458812", "0.5458629", "0.545668", "0.5451628", "0.5450984", "0.54416174", "0.54416174", "0.54416174", "0.54416174", "0.54416174", "0.5414553", "0.5405294", "0.5401665", "0.54004097", "0.5397422", "0.5388938", "0.5388938", "0.5382854", "0.53592896", "0.534986", "0.5346725", "0.5335127", "0.53232837", "0.53155386", "0.53062916", "0.52982485", "0.529391", "0.5274973", "0.5269389", "0.52675223", "0.52617395", "0.52596754", "0.52529746", "0.5249634", "0.5248805", "0.5225432", "0.5225432", "0.52222776", "0.52217865", "0.52121335", "0.5211977", "0.52098465", "0.5209574", "0.52079713", "0.5201396", "0.5201396", "0.5201396", "0.51929975", "0.5192463", "0.51873016", "0.51873016", "0.5185311", "0.5185311", "0.5182507", "0.5178414", "0.51745343", "0.51721364", "0.51719177", "0.51707894", "0.5166781", "0.51660955", "0.5165374", "0.5165374", "0.5165374", "0.5163648", "0.51585346" ]
0.73617625
1
Get the database connection
protected function getDatabaseConnection() { return $GLOBALS['TYPO3_DB']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}", "public static function get_connection() {\n if (static::$instance === null) {\n static::$instance = new Database;\n }\n return static::$instance->db_handle;\n\t}", "public static function getDatabaseConnection() {\n\t\treturn self::$con;\n\t}", "public function getConnection(): \\codename\\core\\database\r\n {\r\n return $this->db;\r\n }", "public static function getConnection(){\n return static::$db;\n }", "public function getConnection()\n {\n return $this->db;\n }", "public static function getDbConnection(){\n\t\tif(!isset(self::$db)){\n\t\t\tself::setDbConnection();\n\t\t}\n\t\treturn self::$db;\n\t}", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "public function getConnection() {\n return Database::instance();\n }", "public function getDatabaseConnection(){\n return $this->dbConnection;\n }", "function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public static function conn()\n {\n return (static::inst())::$_db;\n }", "public static function getConnection() {\n if (!self::$db) {\n //new connection object\n new dbConn();\n }\n //return connection\n return self::$db;\n }", "protected function getDatabaseConnection() {\n\t\treturn $GLOBALS['TYPO3_DB'];\n\t}", "protected function getDatabaseConnection() {\n\t\treturn $GLOBALS['TYPO3_DB'];\n\t}", "public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }", "protected function getDatabaseConnection()\n {\n return $GLOBALS['TYPO3_CONF_VARS']['DB'];\n }", "public function get_connection()\n {\n return $this->connection();\n }", "public function getConnection()\n {\n return Database::getConnection($this->connection);\n }", "protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }", "public static function getConnection() {\r\n //Guarantees single instance, if no connection object exists then create one.\r\n if (!self::$db) {\r\n //new connection object.\r\n new dbConn();\r\n }\r\n //return connection.\r\n return self::$db;\r\n }", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "protected function db()\n\t\t{\n\t\t\tif( !$this->_db ) {\n\t\t\t\t$this->_db = \\Kalibri::db()->getConnection( $this->connectName );\n\t\t\t}\n\n\t\t\treturn $this->_db;\n\t\t}", "protected function getDatabaseConnection()\n\t{\n\t\t$connection = $this->royalcms['config']['cache.connection'];\n\n\t\treturn $this->royalcms['db']->connection($connection);\n\t}", "public function getDbConnection()\n {\n $this->conn = Registry::get('db');\n }", "public function GetConn() {\n\n return $this->\n config['dbconn'];\n }", "public function getConnection() {\n return $this->objDBConnection;\n }", "public function getConnection() {\n return $this->objDBConnection;\n }", "public function getConnection(){\n return $this->dbConnection;\n }", "private function connection()\n {\n return Database::connection($this->connectionName);\n }", "public function db()\n {\n return $this->getConnection();\n }", "public function connection()\n {\n return static::$DB;\n }", "public static function getDBConnection() {\n if (DB::$db==null) {\n DB::$db = new self();\n }\n return DB::$db->dbh;\n }", "private function getDbConnection()\n {\n $config = $this->config;\n $connectionParams = array(\n 'path' => $this->appRoot . '/vpu.db',\n 'driver' => $config['config']['database']['driver']\n );\n return DriverManager::getConnection($connectionParams, new Configuration());\n }", "protected function getDatabaseConnection( )\n {\n if( sfConfig::get('sf_use_database') )\n {\n try\n {\n return Doctrine_Manager::connection();\n }\n catch( Doctrine_Connection_Exception $e )\n {\n new sfDatabaseManager(sfContext::getInstance()->getConfiguration());\n return Doctrine_Manager::connection();\n }\n }\n\n return null;\n }", "public function getDbConnection()\n\t{\n\t\treturn parent::getDbConnection();\n\t}", "public function get_database_resource()\n\t{\n\t\t$this->_connection or $this->connect();\n\n\t\treturn $this->_connection;\n\t}", "public static function getConnection() {\n if(!self::$con) {\n new Database();\n }\n\n // return the writeable db connection\n return self::$con;\n }", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "private function getConnection(): Connection\n {\n return $this->databaseConnection;\n }", "protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}", "public static function getConnection(){\n if (self::$_instance === null){\n self::$_instance = new DB();\n }\n return self::$_instance;\n }", "public function getConnection(){\n \n $this->conn = null;\n \n if (is_dir($this->db_url)) {\n $this->conn=$this->db_url;\n }\n \n return $this->conn;\n }", "protected function getDatabase()\n {\n if(!self::$_database)\n {\n self::connect();\n }\n return self::$_database;\n }", "public function getConnection(){\n\t\tif($this->con == null){\n\t\t\t$this->connect();\n\t\t\treturn $this->con;\n\t\t}\n\t\treturn $this->con;\n\t}", "protected function getConnection()\n {\n $host = DB_HOST;\n $dbName = DB_NAME;\n $dbUser = DB_USER;\n $dbPass = DB_PASS;\n // mysql\n $dsn = 'mysql:host=' . $host . ';dbName=' . $dbName;\n $db = new \\PDO($dsn, $dbUser, $dbPass);\n $connection = $this->createDefaultDBConnection($db, $dbName);\n return $connection;\n }", "public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }", "public function getConnection()\n {\n return $this->createDefaultDBConnection($this->_pdo, Zend_Registry::get('config')->database->dbname);\n }", "protected function getConnection()\n {\n $pdo = new PDO($GLOBALS['DB_DSN'],\n $GLOBALS['DB_USER'],\n $GLOBALS['DB_PASSWORD']);\n return $this->createDefaultDBConnection($pdo, $GLOBALS['DB_NAME']);\n }", "public function get_connection()\n {\n return $this->connection;\n }", "public static function getConnection()\n {\n if (static::$connection == null) {\n static::$connection = new mysqli(static::DB_HOST, static::DB_USER, static::DB_PASS, static::DB_NAME);\n\n if (static::$connection == null) die(\"Couldn't connect to the database\");\n }\n\n return static::$connection;\n }", "public static function getConnection() {\n return self::$defaultConnection;\n }", "public function getConnection()\n {\n $connection = DB::connection($this->poolName);\n\n if (isset($this->database)) {\n $connectionDatabase = $connection->getSelectDb() ?: $connection->getDb();\n if ($this->database !== $connectionDatabase) {\n $connection->db($this->database);\n }\n }\n\n return $connection;\n }", "private function connectToDatabase()\n {\n return DbConnection::connectToDatabase($this->link);\n }", "public function db () : Connection {\n return Manager::connection($this->connection());\n }" ]
[ "0.8697612", "0.8605568", "0.85822105", "0.8569528", "0.85384864", "0.849004", "0.84641755", "0.84612453", "0.8457801", "0.84310544", "0.8425498", "0.8411327", "0.8397318", "0.8361616", "0.8361616", "0.8347151", "0.8331177", "0.829789", "0.8288185", "0.8281096", "0.82805854", "0.8266712", "0.8264642", "0.8264642", "0.82595354", "0.8253373", "0.8246267", "0.8226657", "0.8225373", "0.8225373", "0.821591", "0.8205549", "0.81976336", "0.81928635", "0.8188552", "0.8174716", "0.8162971", "0.8145283", "0.8138804", "0.80857444", "0.8085383", "0.8085383", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.8085293", "0.80852735", "0.80852735", "0.80852735", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80850434", "0.80722487", "0.8057152", "0.80475897", "0.80418444", "0.8018048", "0.8004723", "0.7999875", "0.7990529", "0.7990529", "0.7984842", "0.7978827", "0.7967673", "0.794747", "0.7943821", "0.7931052", "0.7926226" ]
0.8286199
26
This test can be only run in php53. That is beacuse ENT_IGNORE is not available in earlier versions of php
public function itReplacesBadCharacters() { $bad_chars = array( "\x01" => ' ', "\x02" => ' ', "\x03" => ' ', "\x04" => ' ', "\x05" => ' ', "\x06" => ' ', "\x07" => ' ', "\x08" => ' ', "\x0b" => ' ', "\x0c" => ' ', "\x0e" => ' ', "\x0f" => ' ', "\x11" => ' ', "’" => '&rsquo;', ); foreach ($bad_chars as $bad_char => $replace) { $string = htmlentities($bad_char, ENT_IGNORE, 'UTF-8'); $bad_text = html_entity_decode($string, ENT_IGNORE, 'ISO-8859-1'); $returned = Encoding_SupportedXmlCharEncoding::getXMLCompatibleString($bad_text); $this->assertEqual($returned, $replace); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNoEncodeImmuneCharsForXML()\n {\n $this->assertEquals(\n 'testTEST0123,.-_ ',\n $this->_xmlEntityCodec->encode(\n $this->_immune_xml,\n 'testTEST0123,.-_ '\n )\n );\n }", "public function testParseHtmlEntities()\n {\n $file = __DIR__ . '/data/encoding.txt';\n $full_message = file_get_contents($file);\n $this->assertNotEmpty($full_message);\n\n $structure = Mime_Helper::decode($full_message, true, true);\n $this->assertEquals(\n \"\\npöördumise töötaja.\\n<b>Võtame</b> töösse võimalusel.\\npöördumisele süsteemis\\n\\n\", $structure->body\n );\n }", "public function testEscape() {\n $this->assertEquals('\"Double\" quotes', Sanitize::escape('\"Double\" quotes', array('flags' => ENT_NOQUOTES)));\n $this->assertEquals('&quot;Double&quot; quotes', Sanitize::escape('\"Double\" quotes', array('flags' => ENT_COMPAT)));\n $this->assertEquals('&quot;Double&quot; quotes', Sanitize::escape('\"Double\" quotes', array('flags' => ENT_QUOTES)));\n\n $this->assertEquals(\"'Single' quotes\", Sanitize::escape(\"'Single' quotes\", array('flags' => ENT_NOQUOTES)));\n $this->assertEquals(\"'Single' quotes\", Sanitize::escape(\"'Single' quotes\", array('flags' => ENT_COMPAT)));\n $this->assertEquals(\"&#039;Single&#039; quotes\", Sanitize::escape(\"'Single' quotes\", array('flags' => ENT_QUOTES)));\n\n $this->assertEquals('&lt;Html&gt; tags', Sanitize::escape('<Html> tags', array('flags' => ENT_NOQUOTES)));\n $this->assertEquals('&lt;Html&gt; tags', Sanitize::escape('<Html> tags', array('flags' => ENT_COMPAT)));\n $this->assertEquals('&lt;Html&gt; tags', Sanitize::escape('<Html> tags', array('flags' => ENT_QUOTES)));\n\n if ($this->is54) {\n $this->assertEquals('&quot;Double&quot; quotes', Sanitize::escape('\"Double\" quotes', array('flags' => ENT_QUOTES | ENT_HTML5)));\n $this->assertEquals('&quot;Double&quot; quotes', Sanitize::escape('\"Double\" quotes', array('flags' => ENT_QUOTES | ENT_XHTML)));\n $this->assertEquals(\"&apos;Single&apos; quotes\", Sanitize::escape(\"'Single' quotes\", array('flags' => ENT_QUOTES | ENT_HTML5)));\n $this->assertEquals(\"&#039;Single&#039; quotes\", Sanitize::escape(\"'Single' quotes\", array('flags' => ENT_QUOTES | ENT_XHTML)));\n $this->assertEquals('&lt;Html&gt; tags', Sanitize::escape('<Html> tags', array('flags' => ENT_QUOTES | ENT_HTML5)));\n $this->assertEquals('&lt;Html&gt; tags', Sanitize::escape('<Html> tags', array('flags' => ENT_QUOTES | ENT_XHTML)));\n }\n }", "public function testEncodeImmuneCharsForXML()\n {\n $immune = array();\n $this->assertEquals(\n 'testTEST0123&#x2c;&#x2e;&#x2d;&#x5f;&#x20;',\n $this->_xmlEntityCodec->encode(\n $immune,\n 'testTEST0123,.-_ '\n )\n );\n }", "function decodespecialchars($str){\n\t$str = ereg_replace(\"\\n\",\"\\\\n\",$str);\n\t$str = ereg_replace(\"\\r\",\"\\\\r\",$str);\n\t$str=ereg_replace(\"&#039;\",\"'\",$str);\n\t$str=ereg_replace(\"&amp;\",\"&\",$str);\n\t$str=ereg_replace(\"&#59;\",\"\\;\",$str);\n\t$str=ereg_replace(\"&#35;\",\"#\",$str);\n\t$str=ereg_replace(\"&#34;\",'\"',$str);\n\t$str=ereg_replace(\"&#39;\",\"'\",$str);\n\t$str=ereg_replace(\"&#58;\",\":\",$str);\n\t$str=ereg_replace(\"&#47;\",\"\\/\",$str);\n\t$str=ereg_replace(\"&#33;\",\"!\",$str);\n\t$str=ereg_replace(\"&#63;\",\"\\?\",$str);\n\t//special character\n\t$str=ereg_replace(\"&#8218;\",\"�\",$str);\n\t$str=ereg_replace(\"&#402;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8222;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8230;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8224;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8225;\",\"�\",$str);\n\t$str=ereg_replace(\"&#710;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8240;\",\"�\",$str);\n\t$str=ereg_replace(\"&#352;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8249;\",\"�\",$str);\n\t$str=ereg_replace(\"&#338;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8216;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8217;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8220;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8221;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8226;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8211;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8212;\",\"�\",$str);\n\t$str=ereg_replace(\"&#732;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8482;\",\"�\",$str);\n\t$str=ereg_replace(\"&#353;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8250;\",\"�\",$str);\n\t$str=ereg_replace(\"&#339;\",\"�\",$str);\n\t$str=ereg_replace(\"&#376;\",\"�\",$str);\n\t$str=htmlspecialchars_decode($str);\n\treturn $str;\n}", "public function testEncodeInvalidCharsReplacedBySpace()\n {\n $this->assertEquals(\n 'a b c d e f&#x9;g',\n $this->_xmlEntityCodec->encode(\n $this->_immune_xml,\n 'a' . chr(0) . 'b' . chr(4) . 'c' . chr(128) . 'd' .\n chr(150) . 'e' . chr(159) . 'f' . chr(9) . 'g'\n )\n );\n }", "function testHTMLInj($data){\n $original = $data;\n \n /*convert 5 predefined characters into HTML values.\t\t\n They are > (&gt;), < (%lt;), \" (&quot;), ' (&#039;), & (&amp;) */\t\t\t\n $data = htmlspecialchars($data);\n\n //check for possible html injection\n return !($data === $original);\n }", "function repair_broken_character_encoding() {\r\n\t\t$array_replaces = array(\r\n\t\t// multibyte\r\n\t\t'&acirc;&amp;#x80;&amp;#x99;' => '&rsquo;',\r\n\t\t'&acirc;&amp;#x80;&amp;#x91;' => '-',\r\n\t\t'&acirc;&amp;#x80;&amp;#x93;' => '&ndash;',\r\n\t\t'&Acirc;<q>&laquo;' => '<q>&laquo;',\r\n\t\t'&Acirc;&nbsp;&raquo;</q>' => '&nbsp;&raquo;</q>',\r\n\t\t// single byte\r\n\t\t'&Atilde;&copy;' => 'é',\r\n\t\t'&Atilde;&amp;#x89;' => 'É',\r\n\t\t'&Atilde;&reg;' => 'î',\r\n\t\t'&Atilde;&sect;' => 'ç',\r\n\t\t'&Atilde;&amp;#x98;' => '&bull;',\r\n\t\t'&Atilde;&uml;' => 'è',\r\n\t\t'&Atilde;&acute;' => 'ô',\r\n\t\t'&Atilde;&nbsp;&raquo;' => 'û',\r\n\t\t'&Atilde;&ordf;' => 'ê',\r\n\t\t'&Atilde;&amp;#x87;' => '&Ccedil;',\r\n\t\t'&Atilde;&sup1;' => '&ugrave;',\r\n\t\t'&Atilde;&amp;#x80;' => '&Agrave;',\r\n\t\t'&Atilde;&cent;' => '&acirc;',\r\n\t\t'&Atilde;&amp;#x88;' => '&Egrave;',\r\n\t\t'&Atilde;<q>&laquo;&nbsp;' => 'ë',\r\n\t\t'&Aring;&amp;#x93;' => '&oelig;',\r\n\t\t'&thinsp;&acirc;€&brvbar;' => '&hellip;',\r\n\t\t'.&Acirc; ' => '.&nbsp; ',\r\n\t\t'&amp;#x9C;&acirc;&amp;#x80;&brvbar;' => '&hellip;',\r\n\t\t'&acirc;&amp;#x80;&amp;#x9D;' => '&rdquo;',\r\n\t\t'&acirc;&amp;#x80;' => '&ldquo;',\r\n\t\t'&acirc;€™' => '&rsquo;',\r\n\t\t'&nbsp;? ' => ' à ',\r\n\t\t'&Aring;“' => '&oelig;',\r\n\t\t);\r\n\t\t$total_count = 0;\r\n\t\tforeach($array_replaces as $search => $replace) {\r\n\t\t\t$this->code = str_replace($search, $replace, $this->code, $count);\r\n\t\t\t$total_count += $count;\r\n\t\t}\r\n\t\t$this->code = str_replace('&Atilde;', 'à', $this->code, $count); // have to be careful with this last step since what's being used to identify character encodinbg problems itself has to also be repaired\r\n\t\t$total_count += $count;\r\n\t\tReTidy::warning_if($total_count . ' instances of broken character encoding repaired.', $total_count);\r\n\t\tif(strpos($this->code, '&Atilde;') !== false || strpos($this->code, 'Ã') !== false) {\r\n\t\t\tReTidy::warning('&Atilde; was found so character encoding problems likely remain.');\r\n\t\t}\r\n\t}", "function _wp_kses_decode_entities_chr($matches)\n {\n }", "function file_get_contents_utf8($fn) {\r\n\t$content = @file_get_contents($fn);\r\n\tif ( $content === false ) {return false;}\r\n\treturn mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n}", "function wp_kses_decode_entities($content)\n {\n }", "function sanitize_utf8($str){\n return htmlentities($str);\n }", "function file_get_contents_utf8_advanced($fn) {\r\n\t$options = array(\r\n\t\t'http' => array(\r\n\t\t\t'method' => \"GET\",\r\n\t\t\t'user_agent' => \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\\r\\n\", // i.e. Googlebot\r\n\t\t\t'header' => \"Accept-language: en\\r\\n\"\r\n\t\t)\r\n\t);\r\n\r\n $context = stream_context_create($options);\r\n $content = file_get_contents($fn, false, $context);\r\n \r\n\tif ( $content === false ) {return false;}\r\n\treturn mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n}", "function file_get_contents_utf8($fn) {\r\n $content = file_get_contents($fn);\r\n return mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n // return iconv(mb_detect_encoding($content, 'UTF-8, ISO-8859-2, ISO-8859-1, ASCII'), true), \"UTF-8\", $content);\r\n}", "function convert_invalid_entities($content)\n {\n }", "function mysql_entities_fix_string($data)\n {\n // Fix &entity\\n;\n $data = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $data);\n $data = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $data);\n $data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);\n $data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');\n\n // Remove any attribute starting with \"on\" or xmlns\n $data = preg_replace('#(<[^>]+?[\\x00-\\x20\"\\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);\n\n // Remove javascript: and vbscript: protocols\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`\\'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2nojavascript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2novbscript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u', '$1=$2nomozbinding...', $data);\n\n // Only works in IE: <span style=\"width: expression(alert('Ping!'));\"></span>\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu', '$1>', $data);\n\n // Remove namespaced elements (we do not need them)\n $data = preg_replace('#</*\\w+:\\w[^>]*+>#i', '', $data);\n\n do\n {\n // Remove really unwanted tags\n $old_data = $data;\n $data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);\n }\n while ($old_data !== $data);\n $data = trim($data);\n $data = stripslashes($data);\n $data=htmlspecialchars($data);\n return $data;\n }", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)\n{\n static $_double_encode = null;\n static $is_loaded_1 = false;\n static $is_loaded_2 = false;\n if ($_double_encode === null) {\n $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n }\n if (!$char_set) {\n $char_set = $_CHARSET;\n }\n switch ($esc_type) {\n case 'html':\n if ($_double_encode) {\n // php >=5.3.2 - go native\n return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n // php <5.2.3 - only handle double encoding\n return htmlspecialchars($string, ENT_QUOTES, $char_set);\n } else {\n // php <5.2.3 - prevent double encoding\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n $string = str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // no break\n case 'htmlall':\n if ($_MBSTRING) {\n // mb_convert_encoding ignores htmlspecialchars()\n if ($_double_encode) {\n // php >=5.3.2 - go native\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n // php <5.2.3 - only handle double encoding\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n } else {\n // php <5.2.3 - prevent double encoding\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n $string =\n str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // htmlentities() won't convert everything, so use mb_convert_encoding\n return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);\n }\n // no MBString fallback\n if ($_double_encode) {\n return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n return htmlentities($string, ENT_QUOTES, $char_set);\n } else {\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlentities($string, ENT_QUOTES, $char_set);\n $string = str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // no break\n case 'url':\n return rawurlencode($string);\n case 'urlpathinfo':\n return str_replace('%2F', '/', rawurlencode($string));\n case 'quotes':\n // escape unescaped single quotes\n return preg_replace(\"%(?<!\\\\\\\\)'%\", \"\\\\'\", $string);\n case 'hex':\n // escape every byte into hex\n // Note that the UTF-8 encoded character ä will be represented as %c3%a4\n $return = '';\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '%' . bin2hex($string[ $x ]);\n }\n return $return;\n case 'hexentity':\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n $return = '';\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n $return .= '&#x' . strtoupper(dechex($unicode)) . ';';\n }\n return $return;\n }\n // no MBString fallback\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '&#x' . bin2hex($string[ $x ]) . ';';\n }\n return $return;\n case 'decentity':\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n $return = '';\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n $return .= '&#' . $unicode . ';';\n }\n return $return;\n }\n // no MBString fallback\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '&#' . ord($string[ $x ]) . ';';\n }\n return $return;\n case 'javascript':\n // escape quotes and backslashes, newlines, etc.\n return strtr(\n $string,\n array(\n '\\\\' => '\\\\\\\\',\n \"'\" => \"\\\\'\",\n '\"' => '\\\\\"',\n \"\\r\" => '\\\\r',\n \"\\n\" => '\\\\n',\n '</' => '<\\/'\n )\n );\n case 'mail':\n if ($_MBSTRING) {\n if (!$is_loaded_2) {\n if (!is_callable('mb_str_replace')) {\n }\n $is_loaded_2 = true;\n }\n return mb_str_replace(\n array(\n '@',\n '.'\n ),\n array(\n ' [AT] ',\n ' [DOT] '\n ),\n $string\n );\n }\n // no MBString fallback\n return str_replace(\n array(\n '@',\n '.'\n ),\n array(\n ' [AT] ',\n ' [DOT] '\n ),\n $string\n );\n case 'nonstd':\n // escape non-standard chars, such as ms document quotes\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n if ($unicode >= 126) {\n $return .= '&#' . $unicode . ';';\n } else {\n $return .= chr($unicode);\n }\n }\n return $return;\n }\n $_length = strlen($string);\n for ($_i = 0; $_i < $_length; $_i++) {\n $_ord = ord(substr($string, $_i, 1));\n // non-standard char, escape it\n if ($_ord >= 126) {\n $return .= '&#' . $_ord . ';';\n } else {\n $return .= substr($string, $_i, 1);\n }\n }\n return $return;\n default:\n return $string;\n }\n}", "function create_latin1_entities_exhausting_document() {\t\t//var_dump(get_html_translation_table());\r\n\t\t//print(\"1\");\r\n\t\t//<!ENTITY nbsp \"&#160;\">\r\n\t\t//var_dump(file_get_contents(\"DTD/xhtml-lat1.ent\"));\r\n\t\t//$contents = file_get_contents(\"DTD/xhtml-lat1.ent\");\r\n\t\t//$contents = file_get_contents(\"mappings/latin1.php\");\r\n\t\tinclude('mappings' . DS . 'latin1.php');\r\n\t\t//var_dump($latin1array);exit(0);\r\n\t\tforeach($latin1array as $index => $value) {\r\n\t\t\tforeach($value as $index2 => $value2) {\r\n\t\t\t\tprint($value2 . \" \");\r\n\t\t\t}\r\n\t\t\tprint(\"<br>\\r\\n\");\r\n\t\t}exit(0);\r\n\t\t//var_dump($contents);exit(0);\r\n\t\t//preg_match_all('/<!ENTITY\\s+([^\\s]+)\\s+\"([^\"]+)\">/is', $contents, $matches);\r\n\t\t//foreach($matches[0] as $index => $value) {\r\n\t\t//\tprint(html_entity_decode($matches[2][$index]) . \" &\" . $matches[1][$index] . \"; \" . $matches[2][$index] . \"\\r\\n\");\r\n\t\t//}\r\n\t\t//var_dump($matches);\r\n\t\t//var_dump(htmlentities(\"Équipe à l&rsquo;exécution\"));\r\n\t}", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "public function testSpecialChar()\n\t{\n\t\t$special = array(\n\t\t\t'symbol' => '! @ # $ % ^ & * ( ) _ + - = [ ] \\ { } | ; \\' : \" , . / < > ? &amp; &lt; &#039;',\n\t\t\t'html' => '<body><a href=\"http://example.com\">click</a></body>',\n\t\t\t'space' => \"white \\t\\n space\", // no cdata tag for this\n\t\t\t'raw' => '<span>comm]]>ent</span>', // premature end cdata tag will be escaped\n\t\t);\n\n\t\t$xml = $this->getDataElement();\n\t\tInterspire_Xml::addArrayToXML($xml, $special);\n\t\t$out = Interspire_Xml::prettyIndent($xml);\n\n\t\t$expected = Interspire_Xml::getDeclaration();\n\t\t$expected .= '\n<data>\n <symbol><![CDATA['.$special['symbol'].']]></symbol>\n <html><![CDATA['.$special['html'].']]></html>\n <space>'.$special['space'].'</space>\n <raw><![CDATA[<span>comm]]]]><![CDATA[>ent</span>]]></raw>\n</data>\n';\n\t\t$this->assertTrue(Interspire_Xml::validateXMLString($out));\n\t\t$this->assertEquals($expected, $out);\n\n\t\t// reverse\n\t\t$xml = simplexml_load_string($out);\n\t\t$result = Interspire_Xml::xml2array($xml);\n\t\t$this->assertEquals($special, $result);\n\n\t\t// test all html entities\n\t\t$entities = array();\n\t\tforeach (get_html_translation_table(HTML_ENTITIES) as $entity => $encode) {\n\t\t\t$key = str_replace(array('&', ';'), '', $encode);\n\t\t\t$entities[$key] = $encode;\n\t\t}\n\n\t\t$xml = $this->getDataElement();\n\t\tInterspire_Xml::addArrayToXML($xml, $entities);\n\t\t$out = Interspire_Xml::prettyIndent($xml);\n\n\t\t$this->assertTrue(Interspire_Xml::validateXMLString($out));\n\t\t$xml = simplexml_load_string($out);\n\t\t$result = Interspire_Xml::xml2array($xml);\n\t\t$this->assertEquals($entities, $result);\n\t}", "public function testAscii3()\n {\n $this->assertEquals(Str::ascii('arrête'), 'arrete');\n }", "public function testDecodeDoesNotProduceMixedCharacterEncoding()\n {\n $codec = new \\PHPESAPI\\PHPESAPI\\Codecs\\XMLEntityCodec();\n // expecting a UTF-8 encoded string\n $expected = mb_convert_encoding(\"a b c d e f\\x09g h i j\\xa0k\\xa1l\\xa2m\", 'UTF-8', 'ISO-8859-1');\n // check that the encoding conversion went well and the expected string is correct\n $expected_unpacked = array(\n 1 => 0x61, 2 => 0x20, 3 => 0x62, 4 => 0x20,\n 5 => 0x63, 6 => 0x20, 7 => 0x64, 8 => 0x20,\n 9 => 0x65, 10 => 0x20, 11 => 0x66, 12 => 0x09,\n 13 => 0x67, 14 => 0x20, 15 => 0x68, 16 => 0x20,\n 17 => 0x69, 18 => 0x20, 19 => 0x6a, 20 => 0xc2,\n 21 => 0xa0, 22 => 0x6b, 23 => 0xc2, 24 => 0xa1,\n 25 => 0x6c, 26 => 0xc2, 27 => 0xa2, 28 => 0x6d,\n );\n $unpacked = unpack('C*', $expected);\n $this->assertSame(\n $expected_unpacked,\n $unpacked,\n 'Ensuring expected value was correctly encoded to UTF-8 - %s'\n );\n // decode and hope we get $expected!\n $this->assertEquals(\n $expected,\n $codec->decode(\n 'a b c d e f&#x9;g h i j&#xa0;k&#xa1;l&#xa2;m'\n )\n );\n }", "function is_entity_breaker($entity) { // &#8216;&#8217;??\n return !(stripos('&#8216;&#8217;&apos;&quot;&#039;&#39;&rsquo;&lsquo;&rdquo;&ldquo;', $entity) !== FALSE);\n }", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "function e($string){\n\n return htmlentities($string,'UTF-8', ENT_QUOTES,false);\n\n\n\n\n\n}", "private function check_utf8_support() {\n\t\treturn 'utf-8' === strtolower( get_bloginfo( 'charset' ) );\n\t}", "private function detect_encoding( $str ) {\r\n }", "public static function isNotUtf8Charset() {}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "private static function safe_charset($html) {\n\t//--\n\treturn SmartUnicode::html_entities($html);\n\t//--\n}", "public function testUnescape() {\n\t\t$string = 'Tom &quot;&amp;&#x2F;Or&quot; &#x27;Jerry&#x27; &lt;[email protected]&gt;';\n\t\t$expected = 'Tom \"&/Or\" \\'Jerry\\' <[email protected]>';\n\t\t$result = _::unescape($string);\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function testFindUnicodeText(): void\n {\n $soup = new Soup('<h1>寿司🍣</h1>');\n $this->assertEquals('寿司🍣', $soup->find(text: '寿司🍣'));\n }", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "function wp_kses_normalize_entities3($matches)\n {\n }", "function decode_entities($text, $exclude = array()) {\n static $table;\n // We store named entities in a table for quick processing.\n if (!isset($table)) {\n // Get all named HTML entities.\n $table = array_flip(get_html_translation_table(HTML_ENTITIES));\n // PHP gives us ISO-8859-1 data, we need UTF-8.\n $table = array_map('utf8_encode', $table);\n // Add apostrophe (XML)\n $table['&apos;'] = \"'\";\n }\n $newtable = array_diff($table, $exclude);\n\n // Use a regexp to select all entities in one pass, to avoid decoding\n // double-escaped entities twice.\n return preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities(\"$1\", \"$2\", \"$0\", $newtable, $exclude)', $text);\n}", "public function testNonAscii(): void\n {\n $string = '133 ťéşť тест δοκιμή';\n\n self::assertEquals(\n $string,\n Pseudolocale::pseudolocalize($string, Pseudolocale::REPLACE_ALL, '', '')\n );\n }", "function decode($string) {\n return htmlspecialchars_decode($string, ENT_HTML5 | ENT_QUOTES);\n}", "public function encodeEncodesCorrectlyDataProvider() {}", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function correctIllegalEntities($str) {\n $chars = array(\n 128 => '&#8364;',\n 130 => '&#8218;',\n 131 => '&#402;',\n 132 => '&#8222;',\n 133 => '&#8230;',\n 134 => '&#8224;',\n 135 => '&#8225;',\n 136 => '&#710;',\n 137 => '&#8240;',\n 138 => '&#352;',\n 139 => '&#8249;',\n 140 => '&#338;',\n 142 => '&#381;',\n 145 => '&#8216;',\n 146 => '&#8217;',\n 147 => '&#8220;',\n 148 => '&#8221;',\n 149 => '&#8226;',\n 150 => '&#8211;',\n 151 => '&#8212;',\n 152 => '&#732;',\n 153 => '&#8482;',\n 154 => '&#353;',\n 155 => '&#8250;',\n 156 => '&#339;',\n 158 => '&#382;',\n 159 => '&#376;');\n foreach (array_keys($chars) as $num)\n $str = str_replace(\"&#\".$num.\";\", $chars[$num], $str);\n return $str;\n }", "function correctIllegalEntities($str) {\n $chars = array(\n 128 => '&#8364;',\n 130 => '&#8218;',\n 131 => '&#402;',\n 132 => '&#8222;',\n 133 => '&#8230;',\n 134 => '&#8224;',\n 135 => '&#8225;',\n 136 => '&#710;',\n 137 => '&#8240;',\n 138 => '&#352;',\n 139 => '&#8249;',\n 140 => '&#338;',\n 142 => '&#381;',\n 145 => '&#8216;',\n 146 => '&#8217;',\n 147 => '&#8220;',\n 148 => '&#8221;',\n 149 => '&#8226;',\n 150 => '&#8211;',\n 151 => '&#8212;',\n 152 => '&#732;',\n 153 => '&#8482;',\n 154 => '&#353;',\n 155 => '&#8250;',\n 156 => '&#339;',\n 158 => '&#382;',\n 159 => '&#376;');\n foreach (array_keys($chars) as $num)\n $str = str_replace(\"&#\".$num.\";\", $chars[$num], $str);\n return $str;\n }", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function decode_entities( $matches ) {\n\t\t\tif ( function_exists( 'mb_convert_encoding' ) ) {\n\t\t\t\t$content = mb_convert_encoding( $matches[1], 'UTF-8', 'HTML-ENTITIES' );\n\t\t\t} else {\n\t\t\t\t$content = htmlspecialchars_decode( html_entity_decode( html_entity_decode( $matches[1], ENT_QUOTES | ENT_XML1, 'UTF-8' ) ) );\n\t\t\t}\n\t\t\treturn $content;\n\t\t}", "function wp_kses_normalize_entities2($matches)\n {\n }", "function e($var){\n return trim(htmlentities($var,ENT_QUOTES,\"UTF-8\"));\n}", "public function testAscii1()\n {\n $this->assertEquals(Str::ascii('étoile'), 'etoile');\n }", "public function testAcceptMultibyteCharacterKey(): void\n {\n $key = 'いい知らせ';\n $expected = 'חדשות טובות';\n $this->testNotStrict->set($key, $expected);\n $actual = $this->testNotStrict->get($key);\n $this->assertEquals($expected, $actual);\n }", "function utf8_to_iso_8859_1() {\r\n\t\t$result = preg_match('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', $this->code, $encoding_matches);\r\n\t\tif($result) {\r\n\t\t\t$this->code = iconv(\"UTF-8\", \"CP1252\" . \"//TRANSLIT\", $this->code);\r\n\t\t\t$this->code = htmlspecialchars($this->code);\r\n\t\t\t$this->code = htmlentities($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = preg_replace('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"', $this->code);\r\n\t\t}\r\n\t}", "function replacespecialchars($str){\n\t$str=trim($str);\n\t$str=ereg_replace(\"&quot;\",\"\",$str);\n\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t$str=ereg_replace(\"&\",\"&amp;\",$str);\n\t$str=ereg_replace(\"\\;\",\"&#59;\",$str);\n\t$str=ereg_replace(\"-\",\"\",$str);\n\t$str=ereg_replace(\"#\",\"\",$str);\n\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t$str=ereg_replace('\"',\"\",$str);\n\t$str=ereg_replace(\"'\",\"\",$str);\n\t$str=ereg_replace(\",\",\"\",$str);\n\t$str=ereg_replace(\"!\",\"\",$str);\n\t$str=ereg_replace(\"'\",\"\",$str);\n\t$str=ereg_replace(\"&\",\"\",$str);\n\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t$str=ereg_replace(\":\",\"\",$str);\n\t$str=ereg_replace(\",\",\"\",$str);\n\t$str=ereg_replace(\";\",\"\",$str);\n\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t$str=ereg_replace(\"!\",\"\",$str);\n\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t$str=ereg_replace(\" \",\" \",$str);\n\t$str=ereg_replace(\" \",\" \",$str);\n\t$str=ereg_replace(\"�\",\"&#8218;\",$str);\n\t$str=ereg_replace(\"�\",\"&#402;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8222;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8230;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8224;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8225;\",$str);\n\t$str=ereg_replace(\"�\",\"&#710;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8240;\",$str);\n\t$str=ereg_replace(\"�\",\"&#352;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8249;\",$str);\n\t$str=ereg_replace(\"�\",\"&#338;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8216;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8217;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8220;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8221;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8226;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8211;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8212;\",$str);\n\t$str=ereg_replace(\"�\",\"&#732;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8482;\",$str);\n\t$str=ereg_replace(\"�\",\"&#353;\",$str);\n\t$str=ereg_replace(\"�\",\"&#8250;\",$str);\n\t$str=ereg_replace(\"�\",\"&#339;\",$str);\n\t$str=ereg_replace(\"�\",\"&#376;\",$str);\n\t$str=strtolower($str);\n\treturn $str;\n}", "public function testExceptionEncoding()\n {\n if (!mb_internal_encoding('UTF-8')) {\n $this->expectException('\\vipnytt\\SitemapParser\\Exceptions\\SitemapParserException');\n new SitemapParser('SitemapParser');\n }\n }", "protected function assertNoEscaped($raw) {\n @trigger_error('AssertLegacyTrait::assertNoEscaped() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertNoEscaped() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n $this->assertSession()->assertNoEscaped($raw);\n }", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "function entify_nonprinting_chars($text)\n{\n $text = str_replace(\"\\r\\n\", \"<br />\", $text);\n $text = str_replace(\"\\n\", \"<br />\", $text);\n $text = str_replace(\"\\r\", \"<br />\", $text); //unnecessary b/c of wordbreak, but included for completeness\n $text = str_replace(\"\\t\", \"&nbsp;&nbsp;&nbsp;&nbsp;\", $text);\n\n return $text;\n}", "function wp_kses_normalize_entities( $string, $context = 'html' ) {\n $string = str_replace( '&', '&amp;', $string );\n \n // Change back the allowed entities in our list of allowed entities.\n if ( 'xml' === $context ) {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $string );\n } else {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n }\n $string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n \n return $string;\n}", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "function encoding_conv($var, $enc_out, $enc_in='utf-8')\r\n{\r\n$var = htmlentities($var, ENT_QUOTES, $enc_in);\r\nreturn html_entity_decode($var, ENT_QUOTES, $enc_out);\r\n}", "function doHtmlSpecChars() {\n $this->description = htmlspecialchars($this->description);\n $this->postsHeader = htmlspecialchars($this->postsHeader);\n $this->postBody = htmlspecialchars($this->postBody);\n $this->postsFooter = htmlspecialchars($this->postsFooter);\n $this->formLogged = htmlspecialchars($this->formLogged);\n $this->form = htmlspecialchars($this->form);\n $this->navigation = htmlspecialchars($this->navigation);\n $this->name = htmlspecialchars($this->name);\n $this->nameLin = htmlspecialchars($this->nameLin);\n $this->memberName = htmlspecialchars($this->memberName);\n $this->date = htmlspecialchars($this->date);\n $this->time = htmlspecialchars($this->time); \n $this->nextPage = htmlspecialchars($this->nextPage);\n $this->previousPage =htmlspecialchars($this->previousPage);\n $this->firstPage = htmlspecialchars($this->firstPage);\n $this->lastPage = htmlspecialchars($this->lastPage);\n\t$this->gravDefault = htmlspecialchars($this->gravDefault);\n }", "function utf8ToHtmlEntities($string) { \n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */ \n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string)) { \n\t return $string; \n\t\t}\n\t // decode three byte unicode characters \n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\", \n\t $string); \n\n\t // decode two byte unicode characters \n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\", \n\t $string); \n\n\t return $string; \n\t}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "public function testEscape() {\n\t\t$string = 'Tom \"&/Or\" \\'Jerry\\' <[email protected]>';\n\t\t$expected = 'Tom &quot;&amp;&#x2F;Or&quot; &#x27;Jerry&#x27; &lt;[email protected]&gt;';\n\t\t$result = _::escape($string);\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// test unescaping a string\n\t\t$result = _::escape($result, false);\n\t\t$this->assertEquals($string, $result);\n\t}", "function wp_check_invalid_utf8($text, $strip = \\false)\n {\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function wp_set_internal_encoding()\n {\n }", "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}", "function clean_encode_message($yourmessage)\n{\n\n require_once('class.UBBCodeN.php');\n $myUBB = new UBBCodeN();\n\n $yourmessage = $myUBB->encode($yourmessage);\n\n // $yourmessage = str_replace('\"','&#34;', $yourmessage);\n $yourmessage = entify_nonprinting_chars($yourmessage);\n\n return $yourmessage;\n}", "public function testFindUnicodeAttribute(): void\n {\n $soup = new Soup('<h1 id=\"寿司🍣\">here it is</h1>');\n $this->assertEquals('here it is', $soup->find(id: '寿司🍣')?->text);\n }", "public function test_cl_image_tag_special_characters_encoding()\n {\n $tag = cl_image_tag(\n \"test's special < \\\"characters\\\" >\",\n array(\"width\" => 10, \"height\" => 10, \"crop\" => \"fill\", \"format\" => \"png\", \"alt\" => \"< test's > special \\\"\")\n );\n $expected = \"<img src='\" . self::DEFAULT_UPLOAD_PATH . \"c_fill,h_10,w_10/\" .\n \"test%27s%20special%20%3C%20%22characters%22%20%3E.png'\" .\n \" alt='&lt; test&#039;s &gt; special &quot;' height='10' width='10'/>\";\n\n $this->assertEquals($expected, $tag);\n }", "public function passOnEncodingAuto()\n {\n return false;\n }", "public function testEncodeForXML()\n {\n $this->assertEquals(\n '&quot;&gt;&lt;script&gt;alert&#x28;&apos;XSS&apos;&#x29;&lt;&#x2f;script&gt;&lt;foo attr&#x3d;&quot;',\n $this->_xmlEntityCodec->encode(\n $this->_immune_xml,\n '\"><script>alert(\\'XSS\\')</script><foo attr=\"'\n )\n );\n }", "function decode_entities($text) {\n $text= html_entity_decode($text,ENT_QUOTES,\"ISO-8859-1\"); #NOTE: UTF-8 does not work!\n //$text= preg_replace_callback('/&#(\\d+);/',\"chr(\\\\1)\",$text); #decimal notation\n //$text= preg_replace_callback('/&#x([a-f0-9]+);/mei',\"chr(0x\\\\1)\",matches); #hex notation\n return $text;\n}", "public function testEntitiesByteOrderMark()\n {\n $expected = [['text' => 'California', 'tag' => 'LOCATION', 'score' => 1.4244816233933328, 'offset' => 12, 'token_index' => 2, 'token_length' => 1]];\n $this->assertEquals($expected, $this->model()->doc(\"\\xEF\\xBB\\xBFWorks in California\")->entities());\n }", "public function encodeOnly($string){\n $final = html_entity_decode($string);\n return $final;\n }", "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "function encode_desc(&$data)\n{\n $to_entities = get_html_translation_table(HTML_ENTITIES);\n\n $from_entities = array_flip($to_entities);\n\n $data = strtr($data,$from_entities);\n $data = strtr($data,$to_entities);\n\n return $data;\n}", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "public function testSpaceAndTabNeverAppear()\n {\n\n $encoder = new QpMimeHeaderEncoder();\n $this->assertDoesNotMatchRegularExpression('~[ \\t]~', $encoder->encodeString(\"a \\t b\"), 'encoded-words in headers cannot contain LWSP as per RFC 2047.');\n }", "public function testUnicodeString() : void\n {\n $string = $this->basicSanitizer->sanitize('<p>আমি বাংলায় গান গাই</p>');\n $this->assertEquals('<p>আমি বাংলায় গান গাই</p>', $string);\n }", "public function testTextEncode()\n {\n $text = \"<a href='test'>Test</a>\";\n $this->assertEquals(\"&lt;a href='test'&gt;Test&lt;/a&gt;\", $this->obj->textEncode($text));\n }", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "public function testAscii2()\n {\n $this->assertEquals(Str::ascii('etoile'), 'etoile');\n }", "function seems_utf8($str)\n {\n }", "public function testTextRaw()\n {\n // Under text(), this would cause a code-page change (to a page that contains a Euro symbol), and single byte.\n $this -> printer -> textRaw(\"€\\n\");\n $this -> checkOutput(\"\\x1b@\\xe2\\x82\\xac\\x0a\");\n }", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"UTF-8//IGNORE\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n\t}", "function convertHtmlEntities($str)\n{\n return htmlentities($str, ENT_QUOTES, \"UTF-8\");\n}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function _wp_kses_decode_entities_chr_hexdec($matches)\n {\n }", "public function testCanBeEncoded()\n {\n $value = \"[#77675] New Issue:xxxxxxxxx xxxxxxx xxxxxxxx xxxxxxxxxxxxx xxxxxxxxxx xxxxxxxx, tähtaeg xx.xx, xxxx\";\n $res = Header::canBeEncoded($value);\n $this->assertTrue($res);\n\n $value = '';\n for ($i = 0; $i < 255; ++$i)\n $value .= chr($i);\n\n $res = Header::canBeEncoded($value);\n if ($res)\n var_Dump(Header::wrap($value));\n $this->assertFalse($res);\n }", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\n}", "function utf8entities($source)\r\n{\r\n // according to number of characters used to map unicode to ascii by utf-8\r\n $decrement[4] = 240;\r\n $decrement[3] = 224;\r\n $decrement[2] = 192;\r\n $decrement[1] = 0;\r\n \r\n // the number of bits to shift each charNum by\r\n $shift[1][0] = 0;\r\n $shift[2][0] = 6;\r\n $shift[2][1] = 0;\r\n $shift[3][0] = 12;\r\n $shift[3][1] = 6;\r\n $shift[3][2] = 0;\r\n $shift[4][0] = 18;\r\n $shift[4][1] = 12;\r\n $shift[4][2] = 6;\r\n $shift[4][3] = 0;\r\n \r\n $pos = 0;\r\n $len = strlen($source);\r\n $encodedString = '';\r\n while ($pos < $len)\r\n {\r\n $charPos = substr($source, $pos, 1);\r\n $asciiPos = ord($charPos);\r\n if ($asciiPos < 128)\r\n {\r\n $encodedString .= htmlentities($charPos);\r\n $pos++;\r\n continue;\r\n }\r\n \r\n $i=1;\r\n if (($asciiPos >= 240) && ($asciiPos <= 255)) // 4 chars representing one unicode character\r\n $i=4;\r\n else if (($asciiPos >= 224) && ($asciiPos <= 239)) // 3 chars representing one unicode character\r\n $i=3;\r\n else if (($asciiPos >= 192) && ($asciiPos <= 223)) // 2 chars representing one unicode character\r\n $i=2;\r\n else // 1 char (lower ascii)\r\n $i=1;\r\n $thisLetter = substr($source, $pos, $i);\r\n $pos += $i;\r\n \r\n // process the string representing the letter to a unicode entity\r\n $thisLen = strlen($thisLetter);\r\n $thisPos = 0;\r\n $decimalCode = 0;\r\n while ($thisPos < $thisLen)\r\n {\r\n $thisCharOrd = ord(substr($thisLetter, $thisPos, 1));\r\n if ($thisPos == 0)\r\n {\r\n $charNum = intval($thisCharOrd - $decrement[$thisLen]);\r\n $decimalCode += ($charNum << $shift[$thisLen][$thisPos]);\r\n }\r\n else\r\n {\r\n $charNum = intval($thisCharOrd - 128);\r\n $decimalCode += ($charNum << $shift[$thisLen][$thisPos]);\r\n }\r\n \r\n $thisPos++;\r\n }\r\n \r\n $encodedLetter = '&#'. str_pad($decimalCode, ($thisLen==1)?3:5, '0', STR_PAD_LEFT).';';\r\n $encodedString .= $encodedLetter;\r\n }\r\n \r\n return $encodedString;\r\n}", "public function escapeTextData($str)\n {\n if (!$str) {\n return; \n }\n\n //It's the wild wild web... and people import stuff from everywhere \n //We've seen these things pop up... \n $str = preg_replace(\"/\\r|\\n|\\t|\\'|\\\"/\", \" \",$str);\n\n // get rid of existing entities else double-escape\n $str = html_entity_decode(stripslashes($str),ENT_QUOTES,'UTF-8');\n $str = $this->escapeNonLatin1($str); \n $ar = preg_split('/(?<!^)(?!$)/u', $str ); // return array of every multi-byte character\n $str2 = ''; \n foreach ($ar as $c){\n $o = ord($c); \n $charInBytes = strlen($c); \n\n # trash any remaining larger than 3 bytes or 1 byte and bellow 31 \n if ( $charInBytes < 3 && ($o > 31 || strlen($c) > 1) ) {\n $str2 .= $c; \n } \n else {\n error_log(\"invalid char o: $o - c:[$c]\");\n $str2 .= ' '; \n } \n } \n return trim($str2);\n }", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function eEx($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "public function testEscape()\n\t{\n\t\t$this->assertEquals('foo', $this->_instance->escape('foo'));\n\t}", "function rteSafe($strText) {\n $tmpString = $strText;\n\n //convert all types of single quotes\n $tmpString = str_replace(chr(145), chr(39), $tmpString);\n $tmpString = str_replace(chr(146), chr(39), $tmpString);\n $tmpString = str_replace(\"'\", \"&#39;\", $tmpString);\n\n //convert all types of double quotes\n $tmpString = str_replace(chr(147), chr(34), $tmpString);\n $tmpString = str_replace(chr(148), chr(34), $tmpString);\n//\t$tmpString = str_replace(\"\\\"\", \"\\\"\", $tmpString);\n\n //replace carriage returns & line feeds\n $tmpString = str_replace(chr(10), \" \", $tmpString);\n $tmpString = str_replace(chr(13), \" \", $tmpString);\n\n return $tmpString;\n }", "function e_attr($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "public function test_cl_video_tag_special_characters_encoding()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie%27s%20id%21%40%23%24%25%5E%26%2A%28\";\n\n $this->assertEquals(\n \"<video poster='$expected_url.jpg' src='$expected_url.mp4'></video>\",\n cl_video_tag(\"movie's id!@#$%^&*(\", array('source_types' => \"mp4\"))\n );\n }", "public function get_test_utf8mb4_support()\n {\n }", "public function testRegistrationValuesContainSpecialCharacters(): void { }" ]
[ "0.6475374", "0.62963563", "0.62661266", "0.61922497", "0.6145783", "0.61179906", "0.59609157", "0.59336513", "0.5931832", "0.5898189", "0.58377635", "0.5817503", "0.5809556", "0.5790638", "0.57647306", "0.57581663", "0.5741571", "0.5735994", "0.5688061", "0.56790704", "0.56659293", "0.5661251", "0.56591594", "0.5657056", "0.5654455", "0.56452477", "0.5642415", "0.5628422", "0.5625324", "0.5615793", "0.5609347", "0.560699", "0.56062573", "0.5605984", "0.5603144", "0.560069", "0.55834025", "0.55792385", "0.5574758", "0.5574739", "0.5569672", "0.5569672", "0.55655897", "0.55610913", "0.55406314", "0.55372113", "0.5535559", "0.5532352", "0.55241805", "0.55206877", "0.551145", "0.5500116", "0.5496314", "0.5490879", "0.54907244", "0.5487649", "0.5486011", "0.5473051", "0.5461313", "0.5453463", "0.5452561", "0.5444447", "0.5443461", "0.54364175", "0.5433965", "0.54316306", "0.54264295", "0.5420676", "0.5417321", "0.54135257", "0.5412606", "0.54125845", "0.54117", "0.5400535", "0.53971833", "0.53892857", "0.5388289", "0.53829753", "0.5375918", "0.53757596", "0.5368892", "0.5366386", "0.53645307", "0.53638244", "0.53518087", "0.5351175", "0.53493387", "0.534905", "0.5346193", "0.53446525", "0.53444713", "0.5342523", "0.53356147", "0.5334443", "0.5330442", "0.53260404", "0.5324839", "0.53233254", "0.5322667", "0.53222024" ]
0.56630385
21
/ Create a merchantAuthenticationType object with authentication details retrieved from the constants file
public function update_customer_profile($card_details, $customerProfileId = "1511420207", $customerPaymentProfileId = "1511265906"){ $merchantAuthentication = new AnetAPI\MerchantAuthenticationType(); $merchantAuthentication->setName($this->authorize['merchant_login_id']); $merchantAuthentication->setTransactionKey($this->authorize['merchant_transaction_key']); // Set the transaction's refId $refId = 'ref' . time(); // echo $customerProfileId;die; $request = new AnetAPI\GetCustomerPaymentProfileRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId( $refId); $request->setCustomerProfileId($customerProfileId); $request->setCustomerPaymentProfileId($customerPaymentProfileId); $controller = new AnetController\GetCustomerPaymentProfileController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION); // $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) { $billto = new AnetAPI\CustomerAddressType(); $billto = $response->getPaymentProfile()->getbillTo(); $creditCard = new AnetAPI\CreditCardType(); $creditCard->setCardNumber((int) $card_details['card_number'] ); $creditCard->setExpirationDate($card_details['expiry']); $creditCard->setCardCode($card_details['cvc']); $paymentCreditCard = new AnetAPI\PaymentType(); $paymentCreditCard->setCreditCard($creditCard); $paymentprofile = new AnetAPI\CustomerPaymentProfileExType(); $paymentprofile->setCustomerPaymentProfileId($customerPaymentProfileId); $paymentprofile->setPayment($paymentCreditCard); // Submit a UpdatePaymentProfileRequest $request = new AnetAPI\UpdateCustomerPaymentProfileRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setCustomerProfileId($customerProfileId); $request->setPaymentProfile( $paymentprofile ); $controller = new AnetController\UpdateCustomerPaymentProfileController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION); // $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) { $payment_method['card_name'] = $card_details['card_name']; $payment_method['card_number'] = substr($card_details['card_number'], -4); $payment_method['expiry'] = $card_details['expiry']; $payment_method['is_validated'] = 1; $payment_method['updated_at'] = date('Y-m-d H:i:s'); $this->db->update('payment_methods', $payment_method, ['customer_profile_id' => $customerProfileId]); return true; } else if ($response != null) { $errorMessages = $response->getMessages()->getMessage(); return "Failed to Update Customer Payment Profile : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText(); } } else if (is_null($response) && !isset($errorMessages)){ return "Sandbox and production mode confilct"; } else { return "Failed to Get Customer Payment Profile : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}", "abstract public function getPaymentAuthorizationCode();", "public function getAuthentication(): Authentication;", "public static function createAuthenticationCompany(){\n\t\t$continent_id = ModelTestHelper::createContinent();\n\t\t$currency_id = ModelTestHelper::createCurrency();\n\t\t$country_id = ModelTestHelper::createCountry($continent_id, $currency_id);\n\t\t$company_id = ModelTestHelper::createCompany($country_id, $currency_id, \"AUTH\");\n\t\t$company = Company::find($company_id);\n\t\treturn $company;\n\t}", "public function getAccessTokenType(){\n $this->tokenType = variable_get(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, 'bearer');\n return $this;\n }", "public function __construct($params=array()) {\n $this->CI= & get_instance();\n $this->CI->config->load('authnet');\n $authnet_config=$this->CI->config->item('auth_net_details');\n if(isset($authnet_config[ENVIRONMENT]) && !empty($authnet_config[ENVIRONMENT])) {\n $authnet_details=$authnet_config[ENVIRONMENT];\n if(isset($authnet_details['api_login']) && trim($authnet_details['api_login']!='') && isset($authnet_details['transaction_key']) && trim($authnet_details['transaction_key']!='')) {\n $this->api_login=trim($authnet_details['api_login']);\n $this->transaction_key=trim($authnet_details['transaction_key']);\n if(isset($authnet_details['sandbox'])) $this->sandbox=$authnet_details['sandbox'];\n if(isset($authnet_details['timezone']) && trim($authnet_details['timezone'])!='') date_default_timezone_set(trim($authnet_details['timezone']));\n\n if($this->api_login!='' && $this->transaction_key!='') {\n $this->merchantAuth = new AnetAPI\\MerchantAuthenticationType();\n $this->merchantAuth->setName($this->api_login);\n $this->merchantAuth->setTransactionKey($this->transaction_key);\n }\n }\n }\n }", "public function getAuthenticationProvider();", "public function __construct()\n {\n $this->merchant = [\n 'key' => getenv('MERCHANT_KEY'),\n 'secret' => getenv('MERCHANT_SECRET')\n ];\n }", "public function getPayerAuthenticationResponse();", "abstract public function createLoginService($type='');", "function __create_auth_token($email, $password, $account_type, $service) {\n\n return new AuthToken($email, $password, $account_type, $service);\n\n}", "public function __construct()\n {\n $types = include(config_path('usertypes.php'));\n $this->userTypes = $types[Auth::user()->group];\n }", "private static function create(): Authentication\n {\n // Get the request to check the authorization token.\n $request = Request::createFromGlobals();\n\n // Default value if no token was sent.\n $accessToken = null;\n\n if ($request->headers->has('Authorization')) {\n $bearerToken = $request->headers->get('Authorization');\n\n // Search if the token is a Bearer.\n if (\\strpos($bearerToken, 'Bearer ') !== 0) {\n throw new \\UnexpectedValueException('The authorization is not a Bearer token.');\n }\n\n // Remove the Bearer from the token.\n $jwt = \\substr($bearerToken, 7);\n\n // Get the AccessToken.\n $accessToken = AccessTokenServiceFactory::get()->getAccessToken($jwt);\n\n // Throw exception if the token is revoked.\n if ($accessToken->revoked()) {\n throw new TokenRevokedException();\n }\n }\n\n return new AuthManager($accessToken);\n }", "abstract public function getAuthenticator();", "public function __construct()\n {\n parent::__construct(new WalletType);\n }", "public function getAuthenticationType() {\n\t\treturn $this->_mAuthenticationType;\n\t}", "function getAuthParameters($params)\n{\n $authParameters = new AuthenticationParameters();\n $authParameters->Reseller = $params['Reseller'];\n $authParameters->Username = $params['Username'];\n $authParameters->Password = $params['Password'];\n\n return $authParameters;\n}", "protected function _get_configuration(){\n\n return new Payment_Configuration();\n\n }", "public function getGrantType();", "function getMerchant()\n{\n # Check if user already login or user is merchant \n if(Auth::check() && Auth::user()->checkRole(['merchant_admin']))\n return Auth::user()->merchant;\n}", "public function createAuthenticationProvider(ContainerBuilder $container, array $config): string;", "public function getAuthenticationProvider() {\n\t\tif (!$this->authenticationProvider) {\n\t\t\t/** @var Dispatcher $dispatcher */\n\t\t\t$dispatcher = $this->dispatcher ? $this->dispatcher : Dispatcher::getSharedDispatcher();\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$authenticationProviderClass = 'Tx_' . $extension . '_Rest_AuthenticationProvider';\n\t\t\tif (!class_exists($authenticationProviderClass)) {\n\t\t\t\t$authenticationProviderClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AuthenticationProvider';\n\t\t\t}\n\n\n\t\t\t// Use the found Authentication Provider\n\t\t\tif (class_exists($authenticationProviderClass)) {\n\t\t\t\t$this->authenticationProvider = $this->get($authenticationProviderClass);\n\t\t\t} else {\n\t\t\t\t// Use the default Authentication Provider\n\t\t\t\t#$authenticationProviderClass = 'Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider';\n\t\t\t\t$this->authenticationProvider = $this->get('Cundd\\\\Rest\\\\Authentication\\\\AuthenticationProviderCollection', array(\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider'),\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\CredentialsAuthenticationProvider'),\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$this->authenticationProvider->setRequest($dispatcher->getRequest());\n\t\t}\n\t\treturn $this->authenticationProvider;\n\t}", "function __construct($settings=array()){\n\t\t\n\t\tOpenPayU_Configuration::setEnvironment('sandbox');\n\t\t//PayU::$apiKey \t\t= $settings['apiKey'];\n\t\t/*PayU::$apiLogin \t= $settings['apiLogin'];\n\t\tPayU::$merchantId = $settings['merchantId'];\n\t\tPayU::$language \t= $settings['language'];\n\t\tPayU::$isTest \t\t= $settings['test'];*/\n\t}", "public function __construct()\n {\n parent::__construct();\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $this->authMfaMode = $oConfig->item('authTwoFactorMode');\n $aConfig = $oConfig->item('authTwoFactor');\n $this->authMfaConfig = $aConfig[$this->authMfaMode];\n }", "public function getAuthType()\n {\n return $this->auth_type;\n }", "private function getMockAuthentication()\n {\n return $this->getMock('Mremi\\UrlShortener\\Provider\\Bitly\\AuthenticationInterface');\n }", "public function testConstructor_validCredentials()\n {\n $credentials = array(\n 'login' => '8954jM4pCcWZ',\n 'tran_key' => '7828uzaA6j83MHQr'\n );\n\n $gateway = new Mercantile_Gateways_AuthNetCim($credentials);\n }", "public function createToken();", "public function __construct() {\n $this->id_merchant = \\Session::get('authMerchant.id_merchant');\n }", "private function _init() {\n\n global $admin_settings;\n global $payment_list;\n\n new KP_Korapay_Shortcode;\n\n $admin_settings = KP_Korapay_Admin_Settings::get_instance();\n $payment_list = KP_Korapay_Payment_List::get_instance();\n\n if ( is_admin() ) {\n KP_Tinymce_Plugin::get_instance();\n }\n\n if ($admin_settings->get_option_value( 'go_live' ) === 'yes' ) {\n $this->api_base_url = 'https://api.korapay.com/merchant';\n }\n\n }", "public function __construct() {\n parent::__construct();\n $this->checkAuth();\n $this->load->model(\"merchant_info\", \"Merchant\");\n }", "public function __construct() {\n\n $this->loadMerchantInformation();\n }", "public function createAuthenticationToken()\n {\n $tokens = [\n $this->createLdapAuthenticationToken(),\n $this->createLocalAuthenticationToken(),\n ];\n // remove not configured items\n $tokens = array_filter($tokens);\n\n if (count($tokens) == 1) {\n return array_shift($tokens);\n }\n\n $token = new MixedUsernamePasswordToken(\n $this->username,\n $this->password,\n AuthProviderManagerBuilder::PROVIDER_KEY_MIXED\n );\n array_walk($tokens, [$token, 'addToken']);\n return $token;\n }", "static public function generate($region) {\n\t\t$authenticator = new Authenticator($region);\n\t\t$authenticator->initialize();\n\t\treturn $authenticator;\n\t}", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function __construct($h)\n { \t\n\n $hybridauth_settings = $h->getSerializedSettings('hybridauth');\n }", "public function getNewAuthCode()\n {\n return new AuthCodeEntity();\n }", "public static function factory($type, array $config = array())\n\t{\n\t\t$class = 'Authorizenet_'.ucfirst($type);\n\t\treturn new $class($config);\n\t}", "public function getActiveCartSignInMode();", "public function setClientAuthenticationType($val)\n {\n $this->_propDict[\"clientAuthenticationType\"] = $val;\n return $this;\n }", "public function testCreateNetworkMerakiAuthUser()\n {\n }", "public function setType($type)\n {\n if (in_array($type, [self::AUTH_BASIC, self::AUTH_DIGEST])) {\n $this->type = $type;\n }\n\n return $this;\n }", "function _getMerchantId($method) {\r\n\t\treturn $method->hellaspay_merchant_id;\r\n\t}", "private function __construct() {\n $this->clientID = 'e115c5664b1048779845396ce09fd2f1';\n $this->clientSecret = '1f1c62ca735f4b64a96c6e53e7f9b0fe';\n $this->redirectUri = 'http://demo.qodeinteractive.com/instagram-app/instagram-redirect.php';\n $this->responseType = 'code';\n $this->tokenURL = 'https://api.instagram.com/oauth/access_token';\n $this->code = get_option(self::CODE_OPTION_NAME);\n $this->userID = get_option(self::USER_ID_OPTION_NAME);\n $this->accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n $this->apiURL = 'https://api.instagram.com/v1';\n $this->helper = new QodeInstagramHelper();\n }", "protected function _construct()\n {\n $this->_init('hipay/paymentProfile');\n }", "public function authentication(): AuthenticationInterface;", "abstract public function getPaymentMethod();", "public static function createFromDiscriminatorValue(ParseNode $parseNode): AuthenticationMethodTarget {\n $mappingValueNode = $parseNode->getChildNode(\"@odata.type\");\n if ($mappingValueNode !== null) {\n $mappingValue = $mappingValueNode->getStringValue();\n switch ($mappingValue) {\n case '#microsoft.graph.microsoftAuthenticatorAuthenticationMethodTarget': return new MicrosoftAuthenticatorAuthenticationMethodTarget();\n case '#microsoft.graph.smsAuthenticationMethodTarget': return new SmsAuthenticationMethodTarget();\n case '#microsoft.graph.voiceAuthenticationMethodTarget': return new VoiceAuthenticationMethodTarget();\n }\n }\n return new AuthenticationMethodTarget();\n }", "protected function authenticate() {\n $this->load_instagram_class();\n $instagram = new Instagram( array(\n 'apiKey' => $this->get_option( 'client_id' ),\n 'apiSecret' => $this->get_option( 'client_secret' ),\n 'apiCallback' => admin_url( self::SETTINGS_PAGE )\n ) );\n\n if ( $token = $this->get_option( 'oauth_token' ) ) {\n $instagram->setAccessToken( $token );\n\n } elseif ( isset( $_GET['code'] ) ) {\n // Clear $this->options so we have to reload them\n $this->options = null;\n $options = get_option( self::WP_OPTIONS_NAME );\n $options['oauth_token'] = $instagram->getOAuthToken( $_GET['code'], true );\n update_option( self::WP_OPTIONS_NAME, $options );\n }\n return $instagram;\n }", "public function getAuthenticationMode() {\n\t}", "public function testAuthenticationServiceAuthenticationCreate()\n {\n }", "public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "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}", "abstract protected function getPaymentMethodCode();", "public function getAuthMode();", "public static function authorizeTransaction($transaction) {\n\t\t\tif (!array_key_exists($transaction['type'], self::$transactionMap)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$transaction['type'] = self::$transactionMap[$transaction['type']];\n\t\t\t}\n\t\t\t// set transaction values\n\t\t\t$authnet_values = array(\n\t\t\t\t'x_test_request' => authorize::$testMode ? 'TRUE' : 'FALSE',\n\t\t\t\t'x_login' => $transaction['login'],\n\t\t\t\t'x_version' => \"3.1\",\n\t\t\t\t'x_delim_char' => self::$deliminator,\n\t\t\t\t'x_delim_data' => 'TRUE',\n\t\t\t\t'x_url' => 'FALSE',\n\t\t\t\t'x_type' => $transaction['type'],\n\t\t\t\t'x_method' => $transaction['method'],\n\t\t\t\t'x_tran_key' => $transaction['key'],\n\t\t\t\t'x_relay_response' => 'FALSE',\n\t\t\t\t'x_cust_id' => $transaction['customer_id'],\n\t\t\t\t'x_invoice_num' => $transaction['invoice_num'],\n\t\t\t\t'x_description' => $transaction['description'],\n\t\t\t\t'x_card_num' => $transaction['card_num'],\n\t\t\t\t'x_exp_date' => $transaction['exp_month'].'/'.$transaction['exp_year'],\n\t\t\t\t'x_card_code' => $transaction['card_code'],\n\t\t\t\t'x_amount' => $transaction['amount'],\n\t\t\t\t'x_first_name' => $transaction['first_name'],\n\t\t\t\t'x_last_name' => $transaction['last_name'],\n\t\t\t\t'x_address' => $transaction['address'],\n\t\t\t\t'x_city' => $transaction['city'],\n\t\t\t\t'x_state' => $transaction['state'],\n\t\t\t\t'x_zip' => $transaction['zip'],\n\t\t\t\t'x_country' => $transaction['country'],\n\t\t\t\t'x_recurring_billing' => 'NO',\n\t\t\t\t'x_bank_aba_code' => $transaction['bank_aba_code'],\n\t\t\t\t'x_bank_acct_num' => $transaction['bank_acct_num'],\n\t\t\t\t'x_bank_acct_type' => $transaction['bank_acct_type'],\n\t\t\t\t'x_bank_name' => $transaction['bank_name'],\n\t\t\t\t'x_bank_acct_name' => $transaction['bank_acct_name']\n\t\t\t);\n\t\t\t// prepare post\n\t\t\t$fields = '';\n\t\t\tforeach ($authnet_values as $key => $val) {\n\t\t\t\t$fields .= $key.'='.urlencode($val).'&';\n\t\t\t}\n\t\t\t$ch = curl_init($transaction['host']); // URL of gateway for cURL to post to\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // set to return response data instead of TRUE(1)\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, '& ')); // use HTTP POST to send form data\n\t\t\t$response = curl_exec($ch); // execute post and get response\n\t\t\tcurl_close ($ch); // close stream\n\t\t\t$responseArray = explode(self::$deliminator, $response);\n\t\t\t$return = array();\n\t\t\t$return['responseCode'] = $responseArray[0];\n\t\t\t$return['responseText'] = isset(self::$responseMap[$responseArray[0]]) ? self::$responseMap[$responseArray[0]] : 'Error';\n\t\t\t$return['subCode'] = $responseArray[1];\n\t\t\t$return['reasonCode'] = $responseArray[2];\n\t\t\t$return['reasonText'] = $responseArray[3];\n\t\t\t$return['approvalCode'] = $responseArray[4];\n\t\t\t$return['avsCode'] = $responseArray[5];\n\t\t\t$return['avsResponse'] = isset(self::$avsMap[$responseArray[5]]) ? self::$avsMap[$responseArray[5]] : 'NO VALUE RETURNED';\n\t\t\t$return['transactionID'] = $responseArray[6];\n\t\t\t$return['invoiceNumber'] = $responseArray[7];\n\t\t\t$return['description'] = $responseArray[8];\n\t\t\t$return['amount'] = $responseArray[9];\n\t\t\t$return['method'] = $responseArray[10];\n\t\t\t$return['type'] = $responseArray[11];\n\t\t\t$return['memberID'] = $responseArray[12];\n\t\t\t$return['cvvCode'] = $responseArray[38];\n\t\t\t$return['cvvResponse'] = isset(self::$cvvMap[$responseArray[38]]) ? self::$cvvMap[$responseArray[38]] : 'NO VALUE RETURNED';\n\t\t\t$md5verify = $transaction['hashKey'].$transaction['login'].$responseArray[7].$responseArray[10];\n\t\t\t$verification = md5($md5verify);\n\t\t\t$securityHash = strtolower($responseArray[37]);\n\t\t\tif ($verification === $securityHash) {\n\t\t\t\t$return['error'] = false;\n\t\t\t} else {\n\t\t\t\t$return['error'] = 'Security hash does not match: '.$securityHash;\n\t\t\t\ttrigger_error('Security hash does not match in transaction response for member '.$transaction['member_id'].', invoice '.$transaction['invoice_number'], E_USER_WARNING);\n\t\t\t}\n\t\t\treturn $return;\n\t\t}", "public function __construct()\n {\n // To ignore the Notice instead of Isset on missing POST vars\n error_reporting(E_ALL & ~E_NOTICE);\n $_SESSION['auth_service'] = $_POST['auth_type'];\n\n if ($_SESSION['auth_service'] == \"jwt\") {\n $this->authService = new JWTService();\n } else {\n $this->authService = new CodeGrantService();\n }\n }", "public function __construct($consumer_key, $consumer_secret, $signature_method = OAUTH_SIG_METHOD_HMACSHA1, $auth_type = OAUTH_AUTH_TYPE_AUTHORIZATION) {}", "public function testCreateToken(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\t\n\t\t$parameters = PayUTestUtil::buildParametersCreateToken();\n\t\t\n\t\t$response = PayUTokens::create($parameters);\n\t\t\n\t\t$this->assertEquals(PayUResponseCode::SUCCESS, $response->code);\n\t\t$this->assertNotNull($response->creditCardToken);\n\t\t$this->assertNotNull($response->creditCardToken->creditCardTokenId);\n\t\t\t\t\n\t}", "private static function init_microsoft() {\n // Microsoft is a custom setup.\n $record = (object) [\n 'name' => 'Microsoft',\n 'image' => 'https://www.microsoft.com/favicon.ico',\n 'baseurl' => '',\n 'loginscopes' => 'openid profile email user.read',\n 'loginscopesoffline' => 'openid profile email user.read offline_access',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public function getAuthMode() {}", "public function setDefaultAuthTypes()\n {\n global $user;\n\n // set the type 'basic_info'\n $name = \"basic_info\";\n $description = \"Access your basic account information like username,first name, last name, email address, date of birth\";\n $values = array('username' => $user->getUsername(), 'first_name' => $user->getFirstName(), 'last_name' => $user->getLastName(), 'email' => $user->getEmail(), 'birthday' => $user->getBirthDate());\n $this->addAuthType($name, $description, $values);\n\n }", "private function getAndSetAuthInfo() {\n #Authentication\n #$this->userIdentifier will be empty if the unser doesn't provide a credential\n #If in the future we implement API keys, then I suggest we only look for\n #the DN if the API key isn't presented.\n #Failure to authenticate is handled elsewhere\n if(is_null($this->userIdentifier)){\n $this->userIdentifier = Get_User_Principle_PI();\n $this->userIdentifierType = 'X509';\n }\n }", "protected function authenticate(){\n $user = User::create([\n 'name' => 'test',\n 'email' => '[email protected]',\n 'password' => Hash::make('secret1234'),\n ]);\n $this->user = $user;\n $token = JWTAuth::fromUser($user);\n return $token;\n }", "public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "function authorizeCreditCard($amount,$fname,$lname,$email,$shipping_address,$city,$province)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\\SampleCodeConstants::MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(\\SampleCodeConstants::MERCHANT_TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber(\"4111111111111111\");\n $creditCard->setExpirationDate(\"2038-12\");\n $creditCard->setCardCode(\"123\");\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"10101\");\n $order->setDescription(\"Golf Shirts\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany($email);\n $customerAddress->setAddress($shipping_address);\n $customerAddress->setCity($city);\n $customerAddress->setState($province);\n $customerAddress->setZip(\"72000\");\n $customerAddress->setCountry(\"Pakistan\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"99999456654\");\n $customerData->setEmail($email);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authOnlyTransaction\");\n $transactionRequestType->setAmount($amount);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getMessages() != null) {\n echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n } else {\n echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n } else {\n echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n return $response;\n}", "function getGrantType()\n {\n return 'client_credentials';\n }", "public function getApiTransactionType($transactionType)\n {\n $mapping = array(\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_AUTH_CAPTURE => 'authCaptureTransaction',\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_AUTH_ONLY => 'authOnlyTransaction',\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_CAPTURE_ONLY => 'captureOnlyTransaction',\n );\n\n return array_key_exists($transactionType, $mapping) ? $mapping[$transactionType] : $transactionType;\n }", "function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "protected function initializeAuthCode($authCode, $type)\n {\n $authCodeString = $this->generateRandomString();\n $authCodeString = md5(serialize($authCode) . $authCodeString);\n $authCode->setAuthCode($authCodeString);\n\n $authCode->setType($type);\n $authCode->setValidUntil($this->getValidUntil());\n }", "public function __construct($merchant, $password)\n\t{\n\t\t$this->merchant\t= $merchant; // merchant id\n\t\t$this->password\t= $password; // security key (about 80 chars)\n\n\t\t$this->validNames = array(\"version\", \"language\", \"country\", \"currency\", \"device\", \"content\",\n\t\t\t\"type\", \"algorithm\", \"stamp\", \"amount\", \"reference\", \"message\", \"return\", \"cancel\", \"reject\", \n\t\t\t\"delayed\", \"delivery_date\", \"firstname\", \"familyname\", \"address\", \"postcode\", \"postoffice\", \n\t\t\t\"status\", \"email\", \"phone\", \"mac\");\t\t\t\n\t}", "public function getAuthenticationKey();", "private function getAuthorization()\n {\n // Post id_token\n if (new DateTime() > $this->tokenExpire) {\n $this->refreshToken();\n }\n $data = [\n 'authenticationToken' => $this->idToken,\n ];\n $url = \"https://api2.ov-chipkaart.nl/femobilegateway/v1/api/authorize\";\n $authorizationResponse = (self::Execute($url, $data));\n\n // Returns string\n $this->authorizationToken = $authorizationResponse['o'];\n }", "function assignHQFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.hqusers';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('hq_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function __construct(\n readonly string $type,\n readonly string $accessToken,\n readonly int $expiresIn = 0,\n ) {\n }", "private static function _createAuthIdentity($user)\n\t{\n\t\t$identity = new stdClass;\n\t\t$identity->id = $user->id;\n\t\t$identity->handle = $user->handle;\n\t\t//$identity->user_type = $user->user_type;\n\t\t$identity->first_name = $user->first_name;\n\t\t$identity->last_name = $user->last_name;\n\t\t$identity->email = $user->email;\n\t\treturn $identity;\n\t}", "function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}", "public function getAuth();", "public function getAuth();", "public function getMerchantCode()\n {\n return Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'merchant_code', $this->getStoreId());\n }", "public function __construct($config)\n {\n $this->authnet_values['x_login'] = $config['auth_net_login_id'];\n $this->authnet_values['x_tran_key'] = $config['auth_net_tran_key'];\n \n $this->required_fields['x_login'] = !empty($config['auth_net_login_id']);\n $this->required_fields['x_tran_key']= !empty($config['auth_net_tran_key']);\n\n $this->curl_config = $config['curl_config'];\n $this->test_mode = $config['test_mode'];\n\n Kohana::log('debug', 'Authorize.net Payment Driver Initialized');\n }", "public function testAuthenticationServiceAuthenticationInformation()\n {\n }", "public function getTypeAttribute()\n {\n if($this->personal_access_client) {\n return OAuthClientType::PERSONAL();\n }\n\n if($this->password_client) {\n return OAuthClientType::PASSWORD();\n }\n\n if($this->redirect === '') {\n return OAuthClientType::CREDENTIALS();\n }\n\n return OAuthClientType::AUTH_CODE();\n }", "public function corporateSigninAction()\n {\n // specify required fields\n $requirements = array(\n 'username',\n 'password',\n 'client',\n 'client_id',\n 'client_secret',\n 'grant_type'\n );\n\n // fech post json data\n $params = $this->fetchRequestData($requirements);\n\n $client = $params['client'];\n $params['clientType'] = 0;\n // @TODO Add these as constants in constant yml file\n\n // web client\n\n //define('CLIENT_WEB', 0);\n\n //iphone client\n\n //define('CLIENT_IOS', 1);\n\n // android client\n\n //define('CLIENT_ANDROID', 2);\n\n // android client\n\n //define('CLIENT_WINDOWS', 3);\n\n // android client\n\n //define('CLIENT_NOKIA', 4);\n\n // android client\n\n //define('CLIENT_BLACKBERRY', 5);\n switch ($client) {\n case \"ANDROID\":\n $params['clientType'] = 2;\n break;\n case \"IOS\":\n $params['clientType'] = 1;\n break;\n case \"WINDOWS\":\n $params['clientType'] = 3;\n break;\n case \"BLACKBERRY\":\n $params['clientType'] = 5;\n break;\n case \"NOKIA\":\n $params['clientType'] = 4;\n break;\n }\n\n //validate first for invalid password\n $validatePass = $this->get('UserServices')->validateUserLengthPassword($params['password']);\n\n if (isset($validatePass['success']) && $validatePass['success'] == false) {\n throw new HttpException(422, $validatePass['message']);\n }\n\n if (($userRec = $this->get('UserServices')->userLogin($params))) {\n $invalid = false;\n if (isset($params['model_number'])) {\n $paramsTrack['ipAddress'] = (isset($params['REMOTE_ADDR']) && !empty($params['REMOTE_ADDR'])) ? $params['REMOTE_ADDR'] : '';\n\n $paramsTrack['forwardedIpAddress'] = (isset($params['HTTP_X_FORWARDED_FOR']) && !empty($params['HTTP_X_FORWARDED_FOR'])) ? $params['HTTP_X_FORWARDED_FOR'] : '';\n $paramsTrack['userAgent'] = $params['model_number'];\n $paramsTrack['userId'] = $userRec['row']['cc_id'];\n $this->get('UserServices')->userLoginTrack($paramsTrack);\n }\n } else {\n $invalid = true;\n }\n\n $userInfo = array();\n if ($invalid) {\n throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n } else {\n $userInfo['status'] = 'success';\n $userInfo['ssid'] = $userRec['token'];\n $userInfo['username'] = $userRec['row']['cc_yourusername'];\n $userInfo['fname'] = $userRec['row']['cc_fname'];\n $userInfo['lname'] = $userRec['row']['cc_lname'];\n $directory = '/' . $this->container->getParameter('USER_AVATAR_RELATIVE_PATH');\n $profilePic = $userRec['row']['cc_profilePic'];\n if ($profilePic == '') {\n $profilePic = 'he.jpg';\n if ($userRec['row']['cc_gender'] == 'F') {\n $profilePic = 'she.jpg';\n }\n }\n $avatar = $directory . $profilePic;\n $userInfo['avatar'] = $avatar;\n\n if ($userRec['row']['cc_displayFullname'] == 1) {\n $fullname = $userInfo['fname'] . \" \" . $userInfo['lname'];\n if (strlen($fullname) <= 1) {\n $fullname = $userRec['row']['cc_yourusername'];\n }\n } else {\n $fullname = $userRec['row']['cc_yourusername'];\n }\n\n $userInfo['fullname'] = $fullname;\n $userInfo['email'] = $userRec['row']['cc_youremail'];\n $userInfo['userid'] = $userRec['row']['cc_id'];\n\n //inserting to cms_tubers\n $val = array(\n 'userId' => $userInfo['userid'],\n 'longitude' => isset($params['long']) ? $params['long'] : 0,\n 'latitude' => isset($params['lat']) ? $params['lat'] : 0,\n 'ipAddress' => $this->request->server->get('REMOTE_ADDR', ''),\n 'forwardedIpAddress' => $this->request->server->get('HTTP_X_FORWARDED_FOR', ''),\n 'userAgent' => $this->request->server->get('HTTP_USER_AGENT', ''),\n 'uid' => $userInfo['ssid'],\n 'clientType' => $params['clientType'],\n 'socialToken' => '',\n 'keepMeLogged' => 1\n );\n $this->get('UserServices')->userToSession($val);\n }\n\n $request = Request::createFromGlobals();\n $request->request->set('client_id', $params['client_id']);\n $request->request->set('client_secret', $params['client_secret']);\n $request->request->set('grant_type', $params['grant_type']);\n $request->request->set('username', $params['username']);\n $request->request->set('password', $params['password']);\n\n $tokenDetails = $this->get('OauthHelperServices')->getTokenInfo($request);\n $tokenDetailsEncoded = $tokenDetails->getContent();\n $tokenDetailsDeco = json_decode($tokenDetailsEncoded, TRUE);\n\n if (isset($tokenDetailsDeco['error']) && $tokenDetailsDeco['error']) {\n throw new HttpException(400, $tokenDetailsDeco['error_description']);\n }\n\n $userInfo['token'] = $tokenDetailsDeco;\n $userInfo['account'] = array('account_id' => $userRec['row']['cc_corpoAccountId'], 'account_name' => $userRec['row']['ca_name']);\n\n //updating cms_mobile_token table\n $val['tokenId'] = (isset($params['registration_id']) && $params['registration_id']) ? $params['registration_id'] : '';\n $val['platform'] = $params['clientType'];\n $val['aptType'] = $client;\n $this->get('UserServices')->userToMobileToken($val);\n\n //updating oauth token table\n if (isset($params['device_information']) && $params['device_information']) {\n $val['accessToken'] = $userInfo['token']['access_token'];\n $val['deviceInformation'] = json_encode($params['device_information']);\n $this->get('UserServices')->updateOauthAccessToken($val);\n }\n\n\n $response = new Response(json_encode($userInfo));\n $response->setStatusCode(200);\n return $response;\n }", "private static function init_facebook() {\n // Facebook is a custom setup.\n $record = (object) [\n 'name' => 'Facebook',\n 'image' => 'https://facebookbrand.com/wp-content/uploads/2016/05/flogo_rgb_hex-brc-site-250.png',\n 'baseurl' => '',\n 'loginscopes' => 'public_profile email',\n 'loginscopesoffline' => 'public_profile email',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}", "public function getUserType();", "public function getUserType();", "private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}", "public function __construct()\n {\n $this->user = JWTAuth::parseToken()->authenticate();\n }", "public function getMerchantId()\n {\n return $this->isSandboxMode() ? $this->getSetting( 'MerchantIdTest' ) : $this->getSetting( 'MerchantId' );\n }", "public function testComAdobeGraniteAuthOauthImplBearerAuthenticationHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.impl.BearerAuthenticationHandler';\n\n $crawler = $client->request('POST', $path);\n }", "public function getApiInstance()\n {\n $params = func_num_args();\n if ($params > 2 || $params < 1) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN'));\n }\n if ($params == 1) {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0));\n $api->set_platform(self::PLATFORM_OPENPLATFORM);\n } else {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0), func_get_arg(1));\n $api->set_platform(self::PLATFORM_STD);\n }\n if ($this->_switcher->getWebsiteId() != 0) {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId())) {\n $api->sandbox_mode(true);\n }\n } else {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode')) {\n $api->sandbox_mode(true);\n }\n }\n\n\n $api->set_type(self::TYPE);\n\n //$api->set_so((string)$this->_moduleContext->getVersion()); //TODO tracking\n\n return $api;\n\n }", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "protected function _authenticateCreateAuthResult()\n {\n return new Zend_Auth_Result(\n $this->_authenticateResultInfo['code'],\n $this->_authenticateResultInfo['identity'],\n $this->_authenticateResultInfo['messages']\n );\n }", "protected function _authenticateCreateAuthResult()\n {\n return new Zend_Auth_Result(\n $this->_authenticateResultInfo['code'],\n $this->_authenticateResultInfo['identity'],\n $this->_authenticateResultInfo['messages']\n );\n }", "public static function createFromDiscriminatorValue(ParseNode $parseNode): CredentialUserRegistrationDetails {\n return new CredentialUserRegistrationDetails();\n }", "abstract public function initializePayment($request_body);", "protected function allowedTokenTypes() {\n return ['samlauth-account', 'user'];\n }" ]
[ "0.5910793", "0.55366606", "0.5528246", "0.53520894", "0.5320093", "0.5278251", "0.52673197", "0.51783717", "0.5116644", "0.50472945", "0.50056213", "0.49597767", "0.4956573", "0.49559554", "0.4951448", "0.49490044", "0.49415153", "0.49393824", "0.4928695", "0.49243787", "0.4916037", "0.49082813", "0.49075207", "0.4900771", "0.48984912", "0.48970082", "0.4894998", "0.4892093", "0.48917148", "0.48873574", "0.4885312", "0.48790222", "0.4868924", "0.48679557", "0.48556787", "0.4838106", "0.48338172", "0.48292467", "0.4819206", "0.4810603", "0.48085612", "0.47966018", "0.47873798", "0.47778177", "0.47769147", "0.47744718", "0.47700536", "0.47519246", "0.47491646", "0.47392684", "0.47368565", "0.4730997", "0.47308823", "0.47205162", "0.47180167", "0.47110036", "0.47069603", "0.4696694", "0.46788996", "0.46784362", "0.46773604", "0.46772367", "0.46715873", "0.46668854", "0.4655041", "0.4652101", "0.46481082", "0.4644892", "0.4641213", "0.46378413", "0.46350276", "0.46326083", "0.46313864", "0.46263933", "0.4623195", "0.46224716", "0.46211487", "0.46206594", "0.46160588", "0.46160588", "0.46101815", "0.46101242", "0.46060818", "0.46050707", "0.4583814", "0.45824066", "0.45754585", "0.45709127", "0.45697406", "0.45697406", "0.45683953", "0.45674387", "0.45643944", "0.45567954", "0.45542988", "0.4539827", "0.45350862", "0.45272955", "0.4526603", "0.45228416", "0.4520157" ]
0.0
-1
/ Create a merchantAuthenticationType object with authentication details retrieved from the constants file
public function get_customer_profile($customer_profile_id = 1511419029){ $merchantAuthentication = new AnetAPI\MerchantAuthenticationType(); $merchantAuthentication->setName($this->authorize['merchant_login_id']); $merchantAuthentication->setTransactionKey($this->authorize['merchant_transaction_key']); $request = new AnetAPI\GetCustomerProfileRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setCustomerProfileId($customer_profile_id); $controller = new AnetController\GetCustomerProfileController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION); // $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); echo '<pre>'; print_r($response->getProfile()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}", "abstract public function getPaymentAuthorizationCode();", "public function getAuthentication(): Authentication;", "public static function createAuthenticationCompany(){\n\t\t$continent_id = ModelTestHelper::createContinent();\n\t\t$currency_id = ModelTestHelper::createCurrency();\n\t\t$country_id = ModelTestHelper::createCountry($continent_id, $currency_id);\n\t\t$company_id = ModelTestHelper::createCompany($country_id, $currency_id, \"AUTH\");\n\t\t$company = Company::find($company_id);\n\t\treturn $company;\n\t}", "public function getAccessTokenType(){\n $this->tokenType = variable_get(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, 'bearer');\n return $this;\n }", "public function __construct($params=array()) {\n $this->CI= & get_instance();\n $this->CI->config->load('authnet');\n $authnet_config=$this->CI->config->item('auth_net_details');\n if(isset($authnet_config[ENVIRONMENT]) && !empty($authnet_config[ENVIRONMENT])) {\n $authnet_details=$authnet_config[ENVIRONMENT];\n if(isset($authnet_details['api_login']) && trim($authnet_details['api_login']!='') && isset($authnet_details['transaction_key']) && trim($authnet_details['transaction_key']!='')) {\n $this->api_login=trim($authnet_details['api_login']);\n $this->transaction_key=trim($authnet_details['transaction_key']);\n if(isset($authnet_details['sandbox'])) $this->sandbox=$authnet_details['sandbox'];\n if(isset($authnet_details['timezone']) && trim($authnet_details['timezone'])!='') date_default_timezone_set(trim($authnet_details['timezone']));\n\n if($this->api_login!='' && $this->transaction_key!='') {\n $this->merchantAuth = new AnetAPI\\MerchantAuthenticationType();\n $this->merchantAuth->setName($this->api_login);\n $this->merchantAuth->setTransactionKey($this->transaction_key);\n }\n }\n }\n }", "public function getAuthenticationProvider();", "public function __construct()\n {\n $this->merchant = [\n 'key' => getenv('MERCHANT_KEY'),\n 'secret' => getenv('MERCHANT_SECRET')\n ];\n }", "public function getPayerAuthenticationResponse();", "abstract public function createLoginService($type='');", "function __create_auth_token($email, $password, $account_type, $service) {\n\n return new AuthToken($email, $password, $account_type, $service);\n\n}", "public function __construct()\n {\n $types = include(config_path('usertypes.php'));\n $this->userTypes = $types[Auth::user()->group];\n }", "abstract public function getAuthenticator();", "private static function create(): Authentication\n {\n // Get the request to check the authorization token.\n $request = Request::createFromGlobals();\n\n // Default value if no token was sent.\n $accessToken = null;\n\n if ($request->headers->has('Authorization')) {\n $bearerToken = $request->headers->get('Authorization');\n\n // Search if the token is a Bearer.\n if (\\strpos($bearerToken, 'Bearer ') !== 0) {\n throw new \\UnexpectedValueException('The authorization is not a Bearer token.');\n }\n\n // Remove the Bearer from the token.\n $jwt = \\substr($bearerToken, 7);\n\n // Get the AccessToken.\n $accessToken = AccessTokenServiceFactory::get()->getAccessToken($jwt);\n\n // Throw exception if the token is revoked.\n if ($accessToken->revoked()) {\n throw new TokenRevokedException();\n }\n }\n\n return new AuthManager($accessToken);\n }", "public function __construct()\n {\n parent::__construct(new WalletType);\n }", "public function getAuthenticationType() {\n\t\treturn $this->_mAuthenticationType;\n\t}", "function getAuthParameters($params)\n{\n $authParameters = new AuthenticationParameters();\n $authParameters->Reseller = $params['Reseller'];\n $authParameters->Username = $params['Username'];\n $authParameters->Password = $params['Password'];\n\n return $authParameters;\n}", "protected function _get_configuration(){\n\n return new Payment_Configuration();\n\n }", "public function getGrantType();", "function getMerchant()\n{\n # Check if user already login or user is merchant \n if(Auth::check() && Auth::user()->checkRole(['merchant_admin']))\n return Auth::user()->merchant;\n}", "public function createAuthenticationProvider(ContainerBuilder $container, array $config): string;", "public function getAuthenticationProvider() {\n\t\tif (!$this->authenticationProvider) {\n\t\t\t/** @var Dispatcher $dispatcher */\n\t\t\t$dispatcher = $this->dispatcher ? $this->dispatcher : Dispatcher::getSharedDispatcher();\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$authenticationProviderClass = 'Tx_' . $extension . '_Rest_AuthenticationProvider';\n\t\t\tif (!class_exists($authenticationProviderClass)) {\n\t\t\t\t$authenticationProviderClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AuthenticationProvider';\n\t\t\t}\n\n\n\t\t\t// Use the found Authentication Provider\n\t\t\tif (class_exists($authenticationProviderClass)) {\n\t\t\t\t$this->authenticationProvider = $this->get($authenticationProviderClass);\n\t\t\t} else {\n\t\t\t\t// Use the default Authentication Provider\n\t\t\t\t#$authenticationProviderClass = 'Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider';\n\t\t\t\t$this->authenticationProvider = $this->get('Cundd\\\\Rest\\\\Authentication\\\\AuthenticationProviderCollection', array(\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider'),\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\CredentialsAuthenticationProvider'),\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$this->authenticationProvider->setRequest($dispatcher->getRequest());\n\t\t}\n\t\treturn $this->authenticationProvider;\n\t}", "function __construct($settings=array()){\n\t\t\n\t\tOpenPayU_Configuration::setEnvironment('sandbox');\n\t\t//PayU::$apiKey \t\t= $settings['apiKey'];\n\t\t/*PayU::$apiLogin \t= $settings['apiLogin'];\n\t\tPayU::$merchantId = $settings['merchantId'];\n\t\tPayU::$language \t= $settings['language'];\n\t\tPayU::$isTest \t\t= $settings['test'];*/\n\t}", "public function __construct()\n {\n parent::__construct();\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $this->authMfaMode = $oConfig->item('authTwoFactorMode');\n $aConfig = $oConfig->item('authTwoFactor');\n $this->authMfaConfig = $aConfig[$this->authMfaMode];\n }", "public function getAuthType()\n {\n return $this->auth_type;\n }", "private function getMockAuthentication()\n {\n return $this->getMock('Mremi\\UrlShortener\\Provider\\Bitly\\AuthenticationInterface');\n }", "public function testConstructor_validCredentials()\n {\n $credentials = array(\n 'login' => '8954jM4pCcWZ',\n 'tran_key' => '7828uzaA6j83MHQr'\n );\n\n $gateway = new Mercantile_Gateways_AuthNetCim($credentials);\n }", "public function createToken();", "public function __construct() {\n $this->id_merchant = \\Session::get('authMerchant.id_merchant');\n }", "private function _init() {\n\n global $admin_settings;\n global $payment_list;\n\n new KP_Korapay_Shortcode;\n\n $admin_settings = KP_Korapay_Admin_Settings::get_instance();\n $payment_list = KP_Korapay_Payment_List::get_instance();\n\n if ( is_admin() ) {\n KP_Tinymce_Plugin::get_instance();\n }\n\n if ($admin_settings->get_option_value( 'go_live' ) === 'yes' ) {\n $this->api_base_url = 'https://api.korapay.com/merchant';\n }\n\n }", "public function __construct() {\n parent::__construct();\n $this->checkAuth();\n $this->load->model(\"merchant_info\", \"Merchant\");\n }", "public function __construct() {\n\n $this->loadMerchantInformation();\n }", "public function createAuthenticationToken()\n {\n $tokens = [\n $this->createLdapAuthenticationToken(),\n $this->createLocalAuthenticationToken(),\n ];\n // remove not configured items\n $tokens = array_filter($tokens);\n\n if (count($tokens) == 1) {\n return array_shift($tokens);\n }\n\n $token = new MixedUsernamePasswordToken(\n $this->username,\n $this->password,\n AuthProviderManagerBuilder::PROVIDER_KEY_MIXED\n );\n array_walk($tokens, [$token, 'addToken']);\n return $token;\n }", "static public function generate($region) {\n\t\t$authenticator = new Authenticator($region);\n\t\t$authenticator->initialize();\n\t\treturn $authenticator;\n\t}", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function __construct($h)\n { \t\n\n $hybridauth_settings = $h->getSerializedSettings('hybridauth');\n }", "public function getNewAuthCode()\n {\n return new AuthCodeEntity();\n }", "public static function factory($type, array $config = array())\n\t{\n\t\t$class = 'Authorizenet_'.ucfirst($type);\n\t\treturn new $class($config);\n\t}", "public function getActiveCartSignInMode();", "public function setClientAuthenticationType($val)\n {\n $this->_propDict[\"clientAuthenticationType\"] = $val;\n return $this;\n }", "public function testCreateNetworkMerakiAuthUser()\n {\n }", "public function setType($type)\n {\n if (in_array($type, [self::AUTH_BASIC, self::AUTH_DIGEST])) {\n $this->type = $type;\n }\n\n return $this;\n }", "function _getMerchantId($method) {\r\n\t\treturn $method->hellaspay_merchant_id;\r\n\t}", "private function __construct() {\n $this->clientID = 'e115c5664b1048779845396ce09fd2f1';\n $this->clientSecret = '1f1c62ca735f4b64a96c6e53e7f9b0fe';\n $this->redirectUri = 'http://demo.qodeinteractive.com/instagram-app/instagram-redirect.php';\n $this->responseType = 'code';\n $this->tokenURL = 'https://api.instagram.com/oauth/access_token';\n $this->code = get_option(self::CODE_OPTION_NAME);\n $this->userID = get_option(self::USER_ID_OPTION_NAME);\n $this->accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n $this->apiURL = 'https://api.instagram.com/v1';\n $this->helper = new QodeInstagramHelper();\n }", "protected function _construct()\n {\n $this->_init('hipay/paymentProfile');\n }", "public function authentication(): AuthenticationInterface;", "abstract public function getPaymentMethod();", "public static function createFromDiscriminatorValue(ParseNode $parseNode): AuthenticationMethodTarget {\n $mappingValueNode = $parseNode->getChildNode(\"@odata.type\");\n if ($mappingValueNode !== null) {\n $mappingValue = $mappingValueNode->getStringValue();\n switch ($mappingValue) {\n case '#microsoft.graph.microsoftAuthenticatorAuthenticationMethodTarget': return new MicrosoftAuthenticatorAuthenticationMethodTarget();\n case '#microsoft.graph.smsAuthenticationMethodTarget': return new SmsAuthenticationMethodTarget();\n case '#microsoft.graph.voiceAuthenticationMethodTarget': return new VoiceAuthenticationMethodTarget();\n }\n }\n return new AuthenticationMethodTarget();\n }", "protected function authenticate() {\n $this->load_instagram_class();\n $instagram = new Instagram( array(\n 'apiKey' => $this->get_option( 'client_id' ),\n 'apiSecret' => $this->get_option( 'client_secret' ),\n 'apiCallback' => admin_url( self::SETTINGS_PAGE )\n ) );\n\n if ( $token = $this->get_option( 'oauth_token' ) ) {\n $instagram->setAccessToken( $token );\n\n } elseif ( isset( $_GET['code'] ) ) {\n // Clear $this->options so we have to reload them\n $this->options = null;\n $options = get_option( self::WP_OPTIONS_NAME );\n $options['oauth_token'] = $instagram->getOAuthToken( $_GET['code'], true );\n update_option( self::WP_OPTIONS_NAME, $options );\n }\n return $instagram;\n }", "public function getAuthenticationMode() {\n\t}", "public function testAuthenticationServiceAuthenticationCreate()\n {\n }", "public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "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}", "abstract protected function getPaymentMethodCode();", "public function getAuthMode();", "public static function authorizeTransaction($transaction) {\n\t\t\tif (!array_key_exists($transaction['type'], self::$transactionMap)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$transaction['type'] = self::$transactionMap[$transaction['type']];\n\t\t\t}\n\t\t\t// set transaction values\n\t\t\t$authnet_values = array(\n\t\t\t\t'x_test_request' => authorize::$testMode ? 'TRUE' : 'FALSE',\n\t\t\t\t'x_login' => $transaction['login'],\n\t\t\t\t'x_version' => \"3.1\",\n\t\t\t\t'x_delim_char' => self::$deliminator,\n\t\t\t\t'x_delim_data' => 'TRUE',\n\t\t\t\t'x_url' => 'FALSE',\n\t\t\t\t'x_type' => $transaction['type'],\n\t\t\t\t'x_method' => $transaction['method'],\n\t\t\t\t'x_tran_key' => $transaction['key'],\n\t\t\t\t'x_relay_response' => 'FALSE',\n\t\t\t\t'x_cust_id' => $transaction['customer_id'],\n\t\t\t\t'x_invoice_num' => $transaction['invoice_num'],\n\t\t\t\t'x_description' => $transaction['description'],\n\t\t\t\t'x_card_num' => $transaction['card_num'],\n\t\t\t\t'x_exp_date' => $transaction['exp_month'].'/'.$transaction['exp_year'],\n\t\t\t\t'x_card_code' => $transaction['card_code'],\n\t\t\t\t'x_amount' => $transaction['amount'],\n\t\t\t\t'x_first_name' => $transaction['first_name'],\n\t\t\t\t'x_last_name' => $transaction['last_name'],\n\t\t\t\t'x_address' => $transaction['address'],\n\t\t\t\t'x_city' => $transaction['city'],\n\t\t\t\t'x_state' => $transaction['state'],\n\t\t\t\t'x_zip' => $transaction['zip'],\n\t\t\t\t'x_country' => $transaction['country'],\n\t\t\t\t'x_recurring_billing' => 'NO',\n\t\t\t\t'x_bank_aba_code' => $transaction['bank_aba_code'],\n\t\t\t\t'x_bank_acct_num' => $transaction['bank_acct_num'],\n\t\t\t\t'x_bank_acct_type' => $transaction['bank_acct_type'],\n\t\t\t\t'x_bank_name' => $transaction['bank_name'],\n\t\t\t\t'x_bank_acct_name' => $transaction['bank_acct_name']\n\t\t\t);\n\t\t\t// prepare post\n\t\t\t$fields = '';\n\t\t\tforeach ($authnet_values as $key => $val) {\n\t\t\t\t$fields .= $key.'='.urlencode($val).'&';\n\t\t\t}\n\t\t\t$ch = curl_init($transaction['host']); // URL of gateway for cURL to post to\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // set to return response data instead of TRUE(1)\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, '& ')); // use HTTP POST to send form data\n\t\t\t$response = curl_exec($ch); // execute post and get response\n\t\t\tcurl_close ($ch); // close stream\n\t\t\t$responseArray = explode(self::$deliminator, $response);\n\t\t\t$return = array();\n\t\t\t$return['responseCode'] = $responseArray[0];\n\t\t\t$return['responseText'] = isset(self::$responseMap[$responseArray[0]]) ? self::$responseMap[$responseArray[0]] : 'Error';\n\t\t\t$return['subCode'] = $responseArray[1];\n\t\t\t$return['reasonCode'] = $responseArray[2];\n\t\t\t$return['reasonText'] = $responseArray[3];\n\t\t\t$return['approvalCode'] = $responseArray[4];\n\t\t\t$return['avsCode'] = $responseArray[5];\n\t\t\t$return['avsResponse'] = isset(self::$avsMap[$responseArray[5]]) ? self::$avsMap[$responseArray[5]] : 'NO VALUE RETURNED';\n\t\t\t$return['transactionID'] = $responseArray[6];\n\t\t\t$return['invoiceNumber'] = $responseArray[7];\n\t\t\t$return['description'] = $responseArray[8];\n\t\t\t$return['amount'] = $responseArray[9];\n\t\t\t$return['method'] = $responseArray[10];\n\t\t\t$return['type'] = $responseArray[11];\n\t\t\t$return['memberID'] = $responseArray[12];\n\t\t\t$return['cvvCode'] = $responseArray[38];\n\t\t\t$return['cvvResponse'] = isset(self::$cvvMap[$responseArray[38]]) ? self::$cvvMap[$responseArray[38]] : 'NO VALUE RETURNED';\n\t\t\t$md5verify = $transaction['hashKey'].$transaction['login'].$responseArray[7].$responseArray[10];\n\t\t\t$verification = md5($md5verify);\n\t\t\t$securityHash = strtolower($responseArray[37]);\n\t\t\tif ($verification === $securityHash) {\n\t\t\t\t$return['error'] = false;\n\t\t\t} else {\n\t\t\t\t$return['error'] = 'Security hash does not match: '.$securityHash;\n\t\t\t\ttrigger_error('Security hash does not match in transaction response for member '.$transaction['member_id'].', invoice '.$transaction['invoice_number'], E_USER_WARNING);\n\t\t\t}\n\t\t\treturn $return;\n\t\t}", "public function __construct()\n {\n // To ignore the Notice instead of Isset on missing POST vars\n error_reporting(E_ALL & ~E_NOTICE);\n $_SESSION['auth_service'] = $_POST['auth_type'];\n\n if ($_SESSION['auth_service'] == \"jwt\") {\n $this->authService = new JWTService();\n } else {\n $this->authService = new CodeGrantService();\n }\n }", "public function getAuthMode() {}", "public function testCreateToken(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\t\n\t\t$parameters = PayUTestUtil::buildParametersCreateToken();\n\t\t\n\t\t$response = PayUTokens::create($parameters);\n\t\t\n\t\t$this->assertEquals(PayUResponseCode::SUCCESS, $response->code);\n\t\t$this->assertNotNull($response->creditCardToken);\n\t\t$this->assertNotNull($response->creditCardToken->creditCardTokenId);\n\t\t\t\t\n\t}", "public function __construct($consumer_key, $consumer_secret, $signature_method = OAUTH_SIG_METHOD_HMACSHA1, $auth_type = OAUTH_AUTH_TYPE_AUTHORIZATION) {}", "private static function init_microsoft() {\n // Microsoft is a custom setup.\n $record = (object) [\n 'name' => 'Microsoft',\n 'image' => 'https://www.microsoft.com/favicon.ico',\n 'baseurl' => '',\n 'loginscopes' => 'openid profile email user.read',\n 'loginscopesoffline' => 'openid profile email user.read offline_access',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public function setDefaultAuthTypes()\n {\n global $user;\n\n // set the type 'basic_info'\n $name = \"basic_info\";\n $description = \"Access your basic account information like username,first name, last name, email address, date of birth\";\n $values = array('username' => $user->getUsername(), 'first_name' => $user->getFirstName(), 'last_name' => $user->getLastName(), 'email' => $user->getEmail(), 'birthday' => $user->getBirthDate());\n $this->addAuthType($name, $description, $values);\n\n }", "private function getAndSetAuthInfo() {\n #Authentication\n #$this->userIdentifier will be empty if the unser doesn't provide a credential\n #If in the future we implement API keys, then I suggest we only look for\n #the DN if the API key isn't presented.\n #Failure to authenticate is handled elsewhere\n if(is_null($this->userIdentifier)){\n $this->userIdentifier = Get_User_Principle_PI();\n $this->userIdentifierType = 'X509';\n }\n }", "protected function authenticate(){\n $user = User::create([\n 'name' => 'test',\n 'email' => '[email protected]',\n 'password' => Hash::make('secret1234'),\n ]);\n $this->user = $user;\n $token = JWTAuth::fromUser($user);\n return $token;\n }", "public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "function authorizeCreditCard($amount,$fname,$lname,$email,$shipping_address,$city,$province)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\\SampleCodeConstants::MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(\\SampleCodeConstants::MERCHANT_TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber(\"4111111111111111\");\n $creditCard->setExpirationDate(\"2038-12\");\n $creditCard->setCardCode(\"123\");\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"10101\");\n $order->setDescription(\"Golf Shirts\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany($email);\n $customerAddress->setAddress($shipping_address);\n $customerAddress->setCity($city);\n $customerAddress->setState($province);\n $customerAddress->setZip(\"72000\");\n $customerAddress->setCountry(\"Pakistan\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"99999456654\");\n $customerData->setEmail($email);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authOnlyTransaction\");\n $transactionRequestType->setAmount($amount);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getMessages() != null) {\n echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n } else {\n echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n } else {\n echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n return $response;\n}", "function getGrantType()\n {\n return 'client_credentials';\n }", "public function getApiTransactionType($transactionType)\n {\n $mapping = array(\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_AUTH_CAPTURE => 'authCaptureTransaction',\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_AUTH_ONLY => 'authOnlyTransaction',\n Mage_Paygate_Model_Authorizenet::REQUEST_TYPE_CAPTURE_ONLY => 'captureOnlyTransaction',\n );\n\n return array_key_exists($transactionType, $mapping) ? $mapping[$transactionType] : $transactionType;\n }", "function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "protected function initializeAuthCode($authCode, $type)\n {\n $authCodeString = $this->generateRandomString();\n $authCodeString = md5(serialize($authCode) . $authCodeString);\n $authCode->setAuthCode($authCodeString);\n\n $authCode->setType($type);\n $authCode->setValidUntil($this->getValidUntil());\n }", "public function __construct($merchant, $password)\n\t{\n\t\t$this->merchant\t= $merchant; // merchant id\n\t\t$this->password\t= $password; // security key (about 80 chars)\n\n\t\t$this->validNames = array(\"version\", \"language\", \"country\", \"currency\", \"device\", \"content\",\n\t\t\t\"type\", \"algorithm\", \"stamp\", \"amount\", \"reference\", \"message\", \"return\", \"cancel\", \"reject\", \n\t\t\t\"delayed\", \"delivery_date\", \"firstname\", \"familyname\", \"address\", \"postcode\", \"postoffice\", \n\t\t\t\"status\", \"email\", \"phone\", \"mac\");\t\t\t\n\t}", "public function getAuthenticationKey();", "private function getAuthorization()\n {\n // Post id_token\n if (new DateTime() > $this->tokenExpire) {\n $this->refreshToken();\n }\n $data = [\n 'authenticationToken' => $this->idToken,\n ];\n $url = \"https://api2.ov-chipkaart.nl/femobilegateway/v1/api/authorize\";\n $authorizationResponse = (self::Execute($url, $data));\n\n // Returns string\n $this->authorizationToken = $authorizationResponse['o'];\n }", "function assignHQFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.hqusers';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('hq_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function __construct(\n readonly string $type,\n readonly string $accessToken,\n readonly int $expiresIn = 0,\n ) {\n }", "function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}", "private static function _createAuthIdentity($user)\n\t{\n\t\t$identity = new stdClass;\n\t\t$identity->id = $user->id;\n\t\t$identity->handle = $user->handle;\n\t\t//$identity->user_type = $user->user_type;\n\t\t$identity->first_name = $user->first_name;\n\t\t$identity->last_name = $user->last_name;\n\t\t$identity->email = $user->email;\n\t\treturn $identity;\n\t}", "public function getAuth();", "public function getAuth();", "public function getMerchantCode()\n {\n return Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'merchant_code', $this->getStoreId());\n }", "public function __construct($config)\n {\n $this->authnet_values['x_login'] = $config['auth_net_login_id'];\n $this->authnet_values['x_tran_key'] = $config['auth_net_tran_key'];\n \n $this->required_fields['x_login'] = !empty($config['auth_net_login_id']);\n $this->required_fields['x_tran_key']= !empty($config['auth_net_tran_key']);\n\n $this->curl_config = $config['curl_config'];\n $this->test_mode = $config['test_mode'];\n\n Kohana::log('debug', 'Authorize.net Payment Driver Initialized');\n }", "public function getTypeAttribute()\n {\n if($this->personal_access_client) {\n return OAuthClientType::PERSONAL();\n }\n\n if($this->password_client) {\n return OAuthClientType::PASSWORD();\n }\n\n if($this->redirect === '') {\n return OAuthClientType::CREDENTIALS();\n }\n\n return OAuthClientType::AUTH_CODE();\n }", "public function testAuthenticationServiceAuthenticationInformation()\n {\n }", "public function corporateSigninAction()\n {\n // specify required fields\n $requirements = array(\n 'username',\n 'password',\n 'client',\n 'client_id',\n 'client_secret',\n 'grant_type'\n );\n\n // fech post json data\n $params = $this->fetchRequestData($requirements);\n\n $client = $params['client'];\n $params['clientType'] = 0;\n // @TODO Add these as constants in constant yml file\n\n // web client\n\n //define('CLIENT_WEB', 0);\n\n //iphone client\n\n //define('CLIENT_IOS', 1);\n\n // android client\n\n //define('CLIENT_ANDROID', 2);\n\n // android client\n\n //define('CLIENT_WINDOWS', 3);\n\n // android client\n\n //define('CLIENT_NOKIA', 4);\n\n // android client\n\n //define('CLIENT_BLACKBERRY', 5);\n switch ($client) {\n case \"ANDROID\":\n $params['clientType'] = 2;\n break;\n case \"IOS\":\n $params['clientType'] = 1;\n break;\n case \"WINDOWS\":\n $params['clientType'] = 3;\n break;\n case \"BLACKBERRY\":\n $params['clientType'] = 5;\n break;\n case \"NOKIA\":\n $params['clientType'] = 4;\n break;\n }\n\n //validate first for invalid password\n $validatePass = $this->get('UserServices')->validateUserLengthPassword($params['password']);\n\n if (isset($validatePass['success']) && $validatePass['success'] == false) {\n throw new HttpException(422, $validatePass['message']);\n }\n\n if (($userRec = $this->get('UserServices')->userLogin($params))) {\n $invalid = false;\n if (isset($params['model_number'])) {\n $paramsTrack['ipAddress'] = (isset($params['REMOTE_ADDR']) && !empty($params['REMOTE_ADDR'])) ? $params['REMOTE_ADDR'] : '';\n\n $paramsTrack['forwardedIpAddress'] = (isset($params['HTTP_X_FORWARDED_FOR']) && !empty($params['HTTP_X_FORWARDED_FOR'])) ? $params['HTTP_X_FORWARDED_FOR'] : '';\n $paramsTrack['userAgent'] = $params['model_number'];\n $paramsTrack['userId'] = $userRec['row']['cc_id'];\n $this->get('UserServices')->userLoginTrack($paramsTrack);\n }\n } else {\n $invalid = true;\n }\n\n $userInfo = array();\n if ($invalid) {\n throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n } else {\n $userInfo['status'] = 'success';\n $userInfo['ssid'] = $userRec['token'];\n $userInfo['username'] = $userRec['row']['cc_yourusername'];\n $userInfo['fname'] = $userRec['row']['cc_fname'];\n $userInfo['lname'] = $userRec['row']['cc_lname'];\n $directory = '/' . $this->container->getParameter('USER_AVATAR_RELATIVE_PATH');\n $profilePic = $userRec['row']['cc_profilePic'];\n if ($profilePic == '') {\n $profilePic = 'he.jpg';\n if ($userRec['row']['cc_gender'] == 'F') {\n $profilePic = 'she.jpg';\n }\n }\n $avatar = $directory . $profilePic;\n $userInfo['avatar'] = $avatar;\n\n if ($userRec['row']['cc_displayFullname'] == 1) {\n $fullname = $userInfo['fname'] . \" \" . $userInfo['lname'];\n if (strlen($fullname) <= 1) {\n $fullname = $userRec['row']['cc_yourusername'];\n }\n } else {\n $fullname = $userRec['row']['cc_yourusername'];\n }\n\n $userInfo['fullname'] = $fullname;\n $userInfo['email'] = $userRec['row']['cc_youremail'];\n $userInfo['userid'] = $userRec['row']['cc_id'];\n\n //inserting to cms_tubers\n $val = array(\n 'userId' => $userInfo['userid'],\n 'longitude' => isset($params['long']) ? $params['long'] : 0,\n 'latitude' => isset($params['lat']) ? $params['lat'] : 0,\n 'ipAddress' => $this->request->server->get('REMOTE_ADDR', ''),\n 'forwardedIpAddress' => $this->request->server->get('HTTP_X_FORWARDED_FOR', ''),\n 'userAgent' => $this->request->server->get('HTTP_USER_AGENT', ''),\n 'uid' => $userInfo['ssid'],\n 'clientType' => $params['clientType'],\n 'socialToken' => '',\n 'keepMeLogged' => 1\n );\n $this->get('UserServices')->userToSession($val);\n }\n\n $request = Request::createFromGlobals();\n $request->request->set('client_id', $params['client_id']);\n $request->request->set('client_secret', $params['client_secret']);\n $request->request->set('grant_type', $params['grant_type']);\n $request->request->set('username', $params['username']);\n $request->request->set('password', $params['password']);\n\n $tokenDetails = $this->get('OauthHelperServices')->getTokenInfo($request);\n $tokenDetailsEncoded = $tokenDetails->getContent();\n $tokenDetailsDeco = json_decode($tokenDetailsEncoded, TRUE);\n\n if (isset($tokenDetailsDeco['error']) && $tokenDetailsDeco['error']) {\n throw new HttpException(400, $tokenDetailsDeco['error_description']);\n }\n\n $userInfo['token'] = $tokenDetailsDeco;\n $userInfo['account'] = array('account_id' => $userRec['row']['cc_corpoAccountId'], 'account_name' => $userRec['row']['ca_name']);\n\n //updating cms_mobile_token table\n $val['tokenId'] = (isset($params['registration_id']) && $params['registration_id']) ? $params['registration_id'] : '';\n $val['platform'] = $params['clientType'];\n $val['aptType'] = $client;\n $this->get('UserServices')->userToMobileToken($val);\n\n //updating oauth token table\n if (isset($params['device_information']) && $params['device_information']) {\n $val['accessToken'] = $userInfo['token']['access_token'];\n $val['deviceInformation'] = json_encode($params['device_information']);\n $this->get('UserServices')->updateOauthAccessToken($val);\n }\n\n\n $response = new Response(json_encode($userInfo));\n $response->setStatusCode(200);\n return $response;\n }", "private static function init_facebook() {\n // Facebook is a custom setup.\n $record = (object) [\n 'name' => 'Facebook',\n 'image' => 'https://facebookbrand.com/wp-content/uploads/2016/05/flogo_rgb_hex-brc-site-250.png',\n 'baseurl' => '',\n 'loginscopes' => 'public_profile email',\n 'loginscopesoffline' => 'public_profile email',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "public function getUserType();", "public function getUserType();", "public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}", "private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}", "public function getMerchantId()\n {\n return $this->isSandboxMode() ? $this->getSetting( 'MerchantIdTest' ) : $this->getSetting( 'MerchantId' );\n }", "public function __construct()\n {\n $this->user = JWTAuth::parseToken()->authenticate();\n }", "public function testComAdobeGraniteAuthOauthImplBearerAuthenticationHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.impl.BearerAuthenticationHandler';\n\n $crawler = $client->request('POST', $path);\n }", "public function getApiInstance()\n {\n $params = func_num_args();\n if ($params > 2 || $params < 1) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN'));\n }\n if ($params == 1) {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0));\n $api->set_platform(self::PLATFORM_OPENPLATFORM);\n } else {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0), func_get_arg(1));\n $api->set_platform(self::PLATFORM_STD);\n }\n if ($this->_switcher->getWebsiteId() != 0) {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId())) {\n $api->sandbox_mode(true);\n }\n } else {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode')) {\n $api->sandbox_mode(true);\n }\n }\n\n\n $api->set_type(self::TYPE);\n\n //$api->set_so((string)$this->_moduleContext->getVersion()); //TODO tracking\n\n return $api;\n\n }", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "protected function _authenticateCreateAuthResult()\n {\n return new Zend_Auth_Result(\n $this->_authenticateResultInfo['code'],\n $this->_authenticateResultInfo['identity'],\n $this->_authenticateResultInfo['messages']\n );\n }", "protected function _authenticateCreateAuthResult()\n {\n return new Zend_Auth_Result(\n $this->_authenticateResultInfo['code'],\n $this->_authenticateResultInfo['identity'],\n $this->_authenticateResultInfo['messages']\n );\n }", "public static function createFromDiscriminatorValue(ParseNode $parseNode): CredentialUserRegistrationDetails {\n return new CredentialUserRegistrationDetails();\n }", "protected function allowedTokenTypes() {\n return ['samlauth-account', 'user'];\n }", "abstract public function initializePayment($request_body);" ]
[ "0.59119105", "0.5536457", "0.5527294", "0.53496224", "0.5320145", "0.5277579", "0.5267329", "0.517796", "0.5117303", "0.5048447", "0.5005212", "0.4959125", "0.4956645", "0.49545348", "0.4952741", "0.49495524", "0.49412787", "0.4940237", "0.4932282", "0.49260667", "0.4914828", "0.49081847", "0.4907485", "0.49003935", "0.48999146", "0.48956102", "0.48929873", "0.4891818", "0.4891775", "0.48877424", "0.4885705", "0.4879175", "0.4868204", "0.48667258", "0.48589897", "0.48368698", "0.48339662", "0.48287857", "0.48207912", "0.48099813", "0.48084098", "0.47967026", "0.47890195", "0.47772017", "0.47767696", "0.47736076", "0.4771797", "0.47524163", "0.47485107", "0.4739763", "0.47352028", "0.47300914", "0.47283813", "0.47200373", "0.47199914", "0.47122762", "0.4708133", "0.46961904", "0.46785566", "0.46780708", "0.4677961", "0.4676553", "0.467293", "0.46658704", "0.4653819", "0.46513507", "0.4648023", "0.4647693", "0.46453208", "0.46380183", "0.46344614", "0.46326816", "0.4630471", "0.46246347", "0.46229282", "0.46227416", "0.46222845", "0.46207884", "0.46162033", "0.46162033", "0.46128047", "0.46094856", "0.4606904", "0.4604745", "0.45845246", "0.45819047", "0.45759204", "0.45726913", "0.45726913", "0.4572135", "0.4567254", "0.45663995", "0.456629", "0.45555007", "0.45541698", "0.45390922", "0.45345184", "0.45267144", "0.45253435", "0.45224956", "0.4522424" ]
0.0
-1
If some valid syntax isn't in the HHVM/Hack tests, use it here to make sure it's permitted by the types
private static function syntaxExamples() { // https://github.com/hhvm/hhast/issues/150 $_ = function () { return [self::class => self::class]; }; // https://github.com/hhvm/hhast/issues/151 $_ = function ($x) { return \is_a($__tmp1__ = $x->flatten([]), \get_class($this)) ? $__tmp1__ : null; }; $_ = function ($x) { return \is_a($__tmp2__ = $x->flatten([]), \get_class($this)) ? $__tmp2__ : (function () { throw new \TypeError('Failed assertion'); })(); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }", "public function testGetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = \"I like to party sometimes until four\";\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testInvalidInputTypeException()\r\n\t{\r\n\t\tnew Delimiters(array(1));\r\n\t}", "public function validDataTypes();", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "public function testAnotherInvalidSyntax(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_X, Grammar::T_X, Grammar::T_C]);\n }", "public function testIsValidFailing()\n {\n $this->assertFalse($this->helper->isValid('s1', 15));\n $this->assertFalse($this->helper->isValid('s2', true));\n $this->assertFalse($this->helper->isValid('i1', 12.1));\n $this->assertFalse($this->helper->isValid('i2', 'eleven'));\n $this->assertFalse($this->helper->isValid('i3', 12.6));\n $this->assertFalse($this->helper->isValid('i4', -2));\n $this->assertFalse($this->helper->isValid('i5', 83));\n $this->assertFalse($this->helper->isValid('i6', false));\n $this->assertFalse($this->helper->isValid('f1', 12));\n $this->assertFalse($this->helper->isValid('f2', [12.67]));\n $this->assertFalse($this->helper->isValid('f3', 13.0));\n $this->assertFalse($this->helper->isValid('b', [true]));\n $this->assertFalse($this->helper->isValid('b', 0));\n $this->assertFalse($this->helper->isValid('a', 'blue'));\n $this->assertFalse($this->helper->isValid('m', 'true'));\n $this->assertFalse($this->helper->isValid('m', false));\n $this->assertFalse($this->helper->isValid('r', 'memb3rType'));\n }", "function rawpheno_valid_trait_format($trait) {\n $is_valid = TRUE;\n $trait = trim($trait);\n // Test if the trait uses parenthesis.\n // ( and ) indicate that unit is supplied with the trait name,\n // otherwise, ignore this check (e.g. comments)\n if (preg_match('/[(|)]/', $trait) === 1 && $trait != 'Lodging (Scale: 1-5) upright - lodged') {\n // With these characters present, test if the format is trait name (unit).\n\n // Pattern: first string can be any chars but ( and ) followed by 0 or more space then 1 ( then any chars and )\n // plus optional any chars but ( and ) as the end of string.\n $is_valid = (preg_match('/\\A[^()]+\\s*\\({1}[^)(]+\\)[^)(]*\\z/i', $trait) === 1) ? TRUE : FALSE;\n }\n\n return $is_valid;\n}", "public function testIsThereAnySyntaxError()\n {\n $this->assertTrue(is_object($this->transaction));\n }", "public function testIsValidPassing()\n {\n $this->assertTrue($this->helper->isValid('s1', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('s2', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('i1', 12));\n $this->assertTrue($this->helper->isValid('i2', -11));\n $this->assertTrue($this->helper->isValid('i3', 116));\n $this->assertTrue($this->helper->isValid('i4', 916));\n $this->assertTrue($this->helper->isValid('i5', -83));\n $this->assertTrue($this->helper->isValid('i6', -99));\n $this->assertTrue($this->helper->isValid('f1', 12.53));\n $this->assertTrue($this->helper->isValid('f2', 1.5e5));\n $this->assertTrue($this->helper->isValid('f3', -22.79));\n $this->assertTrue($this->helper->isValid('b', true));\n $this->assertTrue($this->helper->isValid('b', false));\n $this->assertTrue($this->helper->isValid('a', [1, 2, 3]));\n $this->assertTrue($this->helper->isValid('m', true));\n $this->assertTrue($this->helper->isValid('m', 'false'));\n $this->assertTrue($this->helper->isValid('r', 'memberType'));\n }", "function checkType($instruction)\n{ // INSTRUKCE S JEDNIM ARGUMENTEM\n if (count($instruction) == 2)\n {\n // kontrola int\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola bool\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola string\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola type\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n // kontrola var\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola nil\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n // ostatni ...@neco filtrovat jako chybu\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n // kontrola label\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n\n else if (count($instruction) == 3)\n { // INSTRUKCE S DVEMA ARGUMENTY\n //////////////////////////////////// prvni argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// druhy argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[2])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[2]))))\n {\n $sec_arg = \"int\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = ltrim(($instruction[2]),\"int@\");\n echo \" <arg2 type=\\\"int\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^bool@true$/', ($instruction[2])))\n {\n $sec_arg = \"bool_t\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"bool\\\">true</arg2>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[2])))\n {\n $sec_arg = \"bool_f\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"bool\\\">false</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = substr(($instruction[2]),7);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[2])))\n {\n $sec_arg = \"type\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"type\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[2]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[2])))\n {\n $sec_arg = \"var\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"var\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[2])))\n {\n $sec_arg = \"nil\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = substr(($instruction[2]),4);\n echo \" <arg2 type=\\\"nil\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[2])))\n {\n $sec_arg = \"label\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"label\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n\n }\n\n else if (count($instruction) == 4)\n { // INSTRUKCE S TREMI ARGUMENTY\n //////////////////////////////////// prvni argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// druhy argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[2])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[2]))))\n {\n $sec_arg = \"int\";\n $instruction[2] = ltrim(($instruction[2]),\"int@\");\n echo \" <arg2 type=\\\"int\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^bool@true$/', ($instruction[2])))\n {\n $sec_arg = \"bool_t\";\n echo \" <arg2 type=\\\"bool\\\">true</arg2>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[2])))\n {\n $sec_arg = \"bool_f\";\n echo \" <arg2 type=\\\"bool\\\">false</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n $instruction[2] = substr(($instruction[2]),7);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[2])))\n {\n $sec_arg = \"type\";\n echo \" <arg2 type=\\\"type\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[2]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[2])))\n {\n $sec_arg = \"var\";\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"var\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[2])))\n {\n $sec_arg = \"nil\";\n $instruction[2] = substr(($instruction[2]),4);\n echo \" <arg2 type=\\\"nil\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[2])))\n {\n $sec_arg = \"label\";\n echo \" <arg2 type=\\\"label\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// treti argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[3])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[3]))))\n {\n $th_arg = \"int\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = ltrim(($instruction[3]),\"int@\");\n echo \" <arg3 type=\\\"int\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^bool@true$/', ($instruction[3])))\n {\n $th_arg = \"bool_t\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"bool\\\">true</arg3>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[3])))\n {\n $th_arg = \"bool_f\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"bool\\\">false</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[3])))\n {\n $th_arg = \"string\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = substr(($instruction[3]),7);\n $instruction[3] = preg_replace('/&/', \"&amp;\", $instruction[3]);\n $instruction[3] = preg_replace('/</', \"&lt;\", $instruction[3]);\n $instruction[3] = preg_replace('/>/', \"&gt;\", $instruction[3]);\n echo \" <arg3 type=\\\"string\\\">{$instruction[3]}</arg3>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[3])))\n {\n $th_arg = \"string\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"string\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[3])))\n {\n $th_arg = \"type\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"type\\\">{$instruction[3]}</arg3>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[3]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[3])))\n {\n $th_arg = \"var\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = preg_replace('/&/', \"&amp;\", $instruction[3]);\n $instruction[3] = preg_replace('/</', \"&lt;\", $instruction[3]);\n $instruction[3] = preg_replace('/>/', \"&gt;\", $instruction[3]);\n echo \" <arg3 type=\\\"var\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[3])))\n {\n $th_arg = \"nil\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = substr(($instruction[3]),4);\n echo \" <arg3 type=\\\"nil\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[3])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[3])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[3])))\n {\n $th_arg = \"label\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"label\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n\n }\n\n}", "public function testIsThereAnySyntaxError(): void\r\n {\r\n $tx = $this->getTx();\r\n $transaction = new Transaction($tx);\r\n $this->assertInternalType('object', $transaction);\r\n }", "public function testSetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = 'This is a string';\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->setMultiple($keyValuePairs);\n }", "public function testIsThereAnySyntaxError() {\n\t\t$var = new Convertor;\n\t\t$this->assertTrue(is_object($var));\n\t\tunset($var);\n\t}", "public function testQueryArgumentsTypeQualifiedStrict()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar,\n _8_bit, _9_time, _10_uuid)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n //$types = 'idssbsss';\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => [\n 0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_INT,\n ],\n '_1_float' => [\n 1.0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_FLOAT,\n ],\n '_2_decimal' => [\n '2.0',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_DECIMAL(14,2),\n ],\n '_3_varchar' => [\n 'type qualified strict',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARCHAR('max'),\n ],\n '_4_blob' => [\n sprintf(\"%08d\", decbin(4)),\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARBINARY('max'),\n ],\n '_5_date' => [\n $time,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_DATE,\n ],\n '_6_datetime' => [\n $time,\n SQLSRV_PARAM_IN,\n null,\n //SQLSRV_SQLTYPE_DATETIME2,\n SQLSRV_SQLTYPE_DATETIME,\n ],\n '_7_nvarchar' => [\n 'n varchar',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_NVARCHAR('max'),\n ],\n '_8_bit' => [\n 0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_BIT,\n ],\n '_9_time' => [\n '10:30:01',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_TIME,\n ],\n '_10_uuid' => [\n '123e4567-e89b-12d3-a456-426655440000',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_UNIQUEIDENTIFIER,\n ],\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n\n $args['_0_int'][0] = '1';\n //$args['_0_int'][0] = 'hest';\n $args['_1_float'][0] = '1.1';\n $args['_2_decimal'][0] ='2.2';\n $args['_3_varchar'][0] = 'type qualified strict updated';\n $args['_5_date'][0] = $time->ISODate;\n //$args['_5_date'][0] = 'cykel';\n $args['_6_datetime'][0] = $time->ISODate;\n $args['_8_bit'][0] = true;\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "public function testBasicPreconditionFail1()\n {\n $this->typeSafetyTestClass->iNeedStrings('stringer', 12);\n }", "public function testTypes(){\n //assertEquals(2, \"2\") will pass\n\n //assertSame is strict. 1 != \"1\"\n //$this->assertSame(\"lol\" - 2, -2); // Non numeric value error\n //$this->assertSame(\"Anything\" - 1, -1); // Non numerif value error\n $this->assertSame(\"0\" + 4, 4);\n $this->assertSame(\"0\" . 4, \"04\");\n $this->assertSame(\"0\" - 4, -4);\n $this->assertSame(\"0\" * 4, 0);\n $this->assertSame(\"0\" / 4, 0);\n //$this->assertSame(\"0\" / 0, 0); //Division by Zero exception\n //$this->assertSame(\"foo\" - \"bar\", 0); //Non numeric error\n //$this->assertNotSame(\"foo\" - \"bar\", 2); Non numeric value\n //$this->assertNotSame(\"foo\" - \"bar\", false); //Non numeric value\n //$this->assertSame(\"foo\" * \"bar\", 0); //Non numeric value\n //$this->assertSame(\"foo\" / \"bar\", 0); //Division by Zero exception\n\n }", "public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }", "public function testRegexes()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /(ab)*/ \");\n $this->assertEquals(array(\"ababab\"), $grammar1->parse(\"ababab\"));\n $grammar = $this->grammar->parse(\" number ::= /a\\\\.b/ \");\n $this->assertEquals(array(\"a.b\"), $grammar->parse(\"a.b\"));\n\n $this->expectException(ParseFailureException::_CLASS);\n $grammar1->parse(\"aXb\");\n }", "public function testErrorTypeInteraction(): void \n {\n $param = new PhpStanType('bool');\n $this->assertEquals('void', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('void', $param->getSignatureType(Method::FALSY_TYPE));\n \n //int|false => int if the method is falsy\n $param = new PhpStanType('int|false');\n $this->assertEquals('int', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('int', $param->getSignatureType(Method::FALSY_TYPE));\n\n //int|null => int if the method is nullsy\n $param = new PhpStanType('int|null');\n $this->assertEquals('int', $param->getDocBlockType(Method::NULLSY_TYPE));\n $this->assertEquals('int', $param->getSignatureType(Method::NULLSY_TYPE));\n\n $param = new PhpStanType('array|false|null');\n $this->assertEquals('array|null', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('?array', $param->getSignatureType(Method::FALSY_TYPE));\n }", "public function testInvalidAllOf() {\n $this->expectException(ParseException::class);\n $schema = new Schema(['$ref' => '#/components/schemas/Invalid1'], $this->lookup);\n $valid = $schema->validate(['type' => 'Invalid1']);\n }", "public function checkSafety($expression) {\n\t\tif (preg_match('/\\b(\\w+)\\s*\\(/', $expression, $m)) {\n\t\t\tif (!in_array($m[1], array_keys($this->allowed)) && ! strcasecmp($m[1], 'and') && ! strcasecmp($m[1], 'or')) {\n\t\t\t\t// A not allowed function is found\n\t\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t\t}\n\t\t}\n\t\tif (strpos($expression, chr(10))) {\n\t\t\t// newline is forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error\");\n\t\t}\n\t\tif (preg_match('/[`\\{\\}\\[\\]\\;]/', $expression, $m)) {\n\t\t\t// metacharacters are forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t}\n\t\tif (preg_match('/\\$\\$([^\\s]+)/', $expression, $m)) {\n\t\t\t// $$ is forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t}\n\t}", "function check() {\n\n // TODO check for valid strings\n return true;\n }", "protected function checkInvalidSqlModes() {}", "public function testValidateSpecialChars(): void\n {\n $this->assertFalse($this->validate('some-text-123'));\n }", "public function testInvalidJson()\n {\n $this->parser->parse('{\"$eq\": [\"benchmark\", foo__');\n }", "public function testValidateFormMalformed()\n {\n $formData = ['jelly'];\n $this->expectException(TypeError::class);\n $case = GRUB\\Validator\\Validator::validateIngredient($formData);\n }", "protected function syntaxCheck(&$str)\n {\n $errors = false;\n $current_file = 'file://' . end($this->process->sources);\n $balanced_parens = substr_count($str, \"(\") === substr_count($str, \")\");\n $balanced_curlies = substr_count($str, \"{\") === substr_count($str, \"}\");\n\n $validate_pairings = function ($str, $pairing) use ($current_file)\n {\n if ($pairing === '{}') {\n $opener_patt = '~\\{~';\n $balancer_patt = Regex::make('~^{{block}}~');\n }\n else {\n $opener_patt = '~\\(~';\n $balancer_patt = Regex::make('~^{{parens}}~');\n }\n\n // Find unbalanced opening brackets.\n preg_match_all($opener_patt, $str, $matches, PREG_OFFSET_CAPTURE);\n foreach ($matches[0] as $m) {\n $offset = $m[1];\n if (! preg_match($balancer_patt, substr($str, $offset), $m)) {\n $substr = substr($str, 0, $offset);\n $line = substr_count($substr, \"\\n\") + 1;\n $column = strlen($substr) - strrpos($substr, \"\\n\");\n return \"Unbalanced '{$pairing[0]}' in $current_file, Line $line, Column $column.\";\n }\n }\n\n // Reverse the string (and brackets) to find stray closing brackets.\n $str = strtr(strrev($str), $pairing, strrev($pairing));\n\n preg_match_all($opener_patt, $str, $matches, PREG_OFFSET_CAPTURE);\n foreach ($matches[0] as $m) {\n $offset = $m[1];\n $substr = substr($str, $offset);\n if (! preg_match($balancer_patt, $substr, $m)) {\n $line = substr_count($substr, \"\\n\") + 1;\n $column = strpos($substr, \"\\n\");\n return \"Stray '{$pairing[1]}' in $current_file, Line $line, Column $column.\";\n }\n }\n\n return false;\n };\n\n if (! $balanced_curlies) {\n $errors = true;\n warning($validate_pairings($str, '{}') ?: \"Unbalanced '{' in $current_file.\");\n }\n if (! $balanced_parens) {\n $errors = true;\n warning($validate_pairings($str, '()') ?: \"Unbalanced '(' in $current_file.\");\n }\n\n return $errors ? false : true;\n }", "function _validateFormat($format)\n {\n if (!array_key_exists($format, $this->conf['all_syntax']))\n $format = 'text';\n \n return $format; \n }", "static function unittest_concept () {\n\n PhlintTest::assertNoIssues('\n class A {\n function foo () {}\n }\n class B {\n function bar () {}\n }\n function f () {\n $foo = \"a\";\n $a = new A();\n if ($a instanceof B)\n $a->bar();\n elseif (isset($undefinedVariable))\n $a->foo();\n else\n $a->foo();\n $a->foo();\n }\n ');\n\n PhlintTest::assertIssues('\n function bar ($y) {\n return $y + 1;\n }\n function foo ($x = 0) {\n if ($x instanceof \\DateTimeInterface)\n $x = $x->format(\"U\");\n elseif (!is_numeric($x))\n $x = \"0\";\n bar($x);\n }\n ', [\n '\n Provided variable *$y* of type *string* is not compatible in the expression *$y + 1* on line 2.\n Trace #1: Function *bar(0|\\'0\\')* specialized for the expression *bar($x)* on line 9.\n ',\n ]);\n\n }", "public function testInvalidSyntaxWithEmpty(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([]);\n }", "public function testValidateString(): void\n {\n $this->assertFalse($this->validate('some text'));\n }", "function testBugs() {\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a]!=';';block=b]</b>\", array('a'=>';'), \"\", \"test bug #1\");\r\n\t\t// $this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a]=';';block=b]</b>\", array('a'=>';'), \"<b></b>\", \"test bug #2\"); // bug\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'!=';';block=b]</b>\", array('a'=>';'), \"\", \"test bug #3\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'=';';block=b]</b>\", array('a'=>';'), \"<b></b>\", \"test bug #4\");\r\n\t\t\r\n\t\t// vicious: with a simple quote as value\r\n\t\t//$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a;htmlconv=esc]!='''';block=b]</b>\", array('a'=>'\\''), \"\", \"test bug #5\");\r\n\t\t//$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a;htmlconv=esc]='''';block=b]</b>\", array('a'=>'\\''), \"<b></b>\", \"test bug #6\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a;htmlconv=esc]'!='''';block=b]</b>\", array('a'=>'\\''), \"\", \"test bug #7\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a;htmlconv=esc]'='''';block=b]</b>\", array('a'=>'\\''), \"<b></b>\", \"test bug #8\");\r\n\t\t\r\n\t\t// vicious: with an ']' as value\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'!=']';block=b]</b>\", array('a'=>']'), \"\", \"test bug #11\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'=']';block=b]</b>\", array('a'=>']'), \"<b></b>\", \"test bug #12\");\r\n\t}", "public function testIsValidType()\n {\n $this->assertFalse(\n Method::invoke($this->type, 'isValidType', $this, 'test'),\n 'The value should not be valid.'\n );\n\n $this->assertTrue(\n Method::invoke($this->type, 'isValidType', $this, 1.23),\n 'The value should be valid.'\n );\n }", "public function testInvalidOperator()\n {\n $this->parser->parse('{foo: {$asdasd: \"bar\"}}');\n }", "public function testNotString()\n {\n $values = array(\n 1, 1.4, null, new stdClass(), true, false\n );\n\n foreach ($values as $value) {\n $this->assertSame(false, $this->_validator->isValid($value));\n }\n }", "public function testParseThrowsExceptionWhenInvalidFormatting(): void\n {\n $lines = ['double=equals=here'];\n\n $parser = new IniParser('');\n $parser->setFileLines($lines);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Too many equals in line: double=equals=here');\n $parser->parse();\n }", "public function check($code) {\n $code = trim($code);\n // last token should be ;\n if(substr($code, -1) != ';') {\n $this->error = ['line' => (substr_count($code, \"\\n\") + 1), 'prev' => ']', 'token' => ';', 'must' => true];\n return false;\n }\n // exclude last token\n $code = substr($code, 0, -1);\n // get all tokens\n $tokens = token_get_all($code);\n $prev = false;\n $this->error['line'] = false;\n foreach($tokens as $token) {\n if(is_array($token)) {\n $tn = token_name($token['0']);\n if(in_array($tn, ['T_WHITESPACE', 'T_COMMENT']))\n continue;\n $this->error = ['line' => $token[2], 'prev' => $prev, 'token' => $tn];\n if(!in_array($tn, self::$valid_tokens))\n return false;\n elseif($tn == 'T_STRING' && !in_array(strtolower($token[1]), ['true', 'false']))\n return false;\n if($this->validSequence($prev, $tn))\n $prev = $tn;\n else\n return false; \n } else {\n // line will be defined in any case, so no needed to define it here \n $this->error['prev'] = $prev;\n $this->error['token'] = $token;\n if(in_array($token, self::$valid_symbols) && $this->validSequence($prev, $token))\n $prev = $token;\n else\n return false;\n }\n }\n // chek pairs of $braces\n $braces = 0;\n $inString = 0;\n $this->error['line'] = 0;\n foreach($tokens as $token) {\n if($inString & 1) {\n switch ($token) {\n case '`':\n case '\"': --$inString; break;\n }\n } else {\n switch ($token) {\n case '`':\n case '\"': ++$inString; break;\n \n case '[': case '(': ++$braces; break;\n case ']': case ')':\n if ($inString) {\n --$inString;\n }\n else {\n --$braces;\n if ($braces < 0) {\n return false;\n }\n }\n break;\n }\n }\n }\n if ($braces) {\n return false;\n }\n return true;\n }", "private function checkFormatParam($format)\n {\n $format = strtolower($format);\n\n // Clean the code, check that it matches\n $formatArray = preg_grep(\"/^(json|raw)$/\", explode(\"\\n\", $format));\n\n if(empty($formatArray)){\n\n // Throw exception, banner term code is not valid\n throw new \\Exception('The format: \"' . $format . '\" is not supported. Use json or xml');\n\n }\n\n return $format;\n\n }", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function testInvalidStrings()\n {\n $values = array(\n '1995-05-11T18:60:09-08:45',\n '1996-05-11T18:50:09+25:00',\n '2002-13-11',\n '2004-00-01'\n );\n\n foreach ($values as $value) {\n $this->assertSame(false, $this->_validator->isValid($value));\n }\n }", "protected function check_string()\n {\n $string_regex = \"/^string@.*/\";\n $backslash_regex = \"/\\\\\\/\";\n $escape_regex = \"/\\\\\\[0-9]{3}/\";\n $test = preg_match($escape_regex, $this->token);\n $result = preg_match($string_regex, $this->token);\n // checks if token is string\n if($result)\n {\n $backslashes = preg_match_all($backslash_regex, $this->token);\n // if token has backslashes\n if($backslashes > 0)\n {\n // get count of sequences\n $escapes = preg_match_all($escape_regex, $this->token);\n // if there is not same number of escapes and sequences = error\n if($escapes != $backslashes)\n {\n fwrite(STDERR, \"Error, wrong escape sequence!\\n\");\n exit(23);\n }\n }\n }\n }", "public function testQueryArgumentTypesDetect()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar)\n VALUES (?, ?, ?, ?, null, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => 0,\n '_1_float' => 1.0,\n '_2_decimal' => '2.0',\n '_3_varchar' => 'arguments types detected',\n /*'_4_blob' => [\n sprintf(\"%08d\", decbin(4)),\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARBINARY('max'),\n ],*/\n '_5_date' => $time,\n '_6_datetime' => $time,\n '_7_nvarchar' => 'n varchar',\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "public function testGetMultipleInvalidTypeKeyWithinNotString(): void\n {\n $obj = new \\stdClass;\n $obj->animal = \"Frog\";\n $obj->mineral = \"Quartz\";\n $obj->vegetable = \"Spinach\";\n $keyValuePairs = array(\n \"testInt\" => 5,\n \"testFloat\" => 3.278,\n \"testString\" => \"WooHoo\",\n \"testBoolean\" => true,\n \"testNull\" => null,\n \"testArray\" => array(1, 2, 3, 4, 5),\n \"testObject\" => $obj\n );\n // this is what triggers it\n $keyValuePairs[] = 'Hello';\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "private function is_valid($mutation_data) {\n if (count($mutation_data) >= 5) {\n $chromosome_format = preg_match(\"/^chr/\", $mutation_data[0]);\n $wild_format = preg_match(\"/^[A,C,G,T]$/\", $mutation_data[6]);\n $mut_format = preg_match(\"/^[A,C,G,T]$/\", $mutation_data[7]);\n return $chromosome_format && $wild_format && $mut_format;\n } else {\n return false;\n }\n }", "public function testRegistrationValuesContainSpecialCharacters(): void { }", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "public function looksValid()\r\n\t{\r\n return true;\r\n\t}", "public function testValidationCaseForSettingWrongFormattedStringForPublicKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testConstructNotString()\n {\n $this->setExpectedException('Modern_String_Exception', 'Value must be string');\n new Modern_String(array('foo'));\n }", "public function testSyntaxExceptionIsThrownIfCompiledTemplateIsNotValid()\n {\n $this->expectException('\\JonnyW\\PhantomJs\\Exception\\SyntaxException');\n\n $template = <<<EOF\n console.log(;\nEOF;\n $procedure = $this->getProcedure('http_default');\n $procedure->setTemplate($template);\n\n $request = $this->getRequest();\n $request->setUrl('http://test.com');\n\n $compiler = $this->getProcedureCompiler();\n $compiler->compile($procedure, $request);\n\n }", "public function testRegistrationEmailWrongFormat(): void { }", "public function testPreventsCRLFAttackViaFromString()\n {\n $this->expectException(InvalidArgumentException::class);\n $header = Authorization::fromString(\"Authorization: xxx\\r\\n\\r\\nevilContent\");\n }", "public function testIsThereAnySyntaxError() {\n $var = new ircsasw\\timeline\\Timeline;\n $this->assertTrue(is_object($var));\n unset($var);\n }", "public function testConfidenceWrongType()\n {\n new Text('Foo bar', '50');\n }", "public function testHasKindsSupport0()\n{\n\n $actual = $this->parserFactory->hasKindsSupport();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function getAllowedTypes() {\n\treturn array('substition','formatting');\n}", "public function testRejectsASchemaWhichDefinesABuiltInType()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $fakeString = newScalarType([\n 'name' => 'String',\n 'serialize' => function () {\n return null;\n },\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $queryType = newObjectType([\n 'name' => 'Query',\n 'fields' => [\n 'normal' => ['type' => stringType()],\n 'fake' => ['type' => $fakeString],\n ]\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'Schema must contain unique named types but contains multiple types named \"String\".'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n newSchema(['query' => $queryType]);\n\n $this->addToAssertionCount(1);\n }", "public function supportsVarcharWithoutSize();", "function testBug7759() \n {\n $sText = <<<SCRIPT\n<?php\necho 0;\nswitch(1) {\ncase 1:\ncase 5: // 5\necho 1;\nbreak;\ncase 2: //2\necho \"something\";\necho \"something\";\ncase 3: /*3 */ /* 3? */\ncase 4: \ndefault:\necho '2';\nbreak;\n}\necho 1;\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\necho 0;\nswitch (1) {\n case 1:\n case 5: // 5\n echo 1;\n break;\n case 2: //2\n echo \"something\";\n echo \"something\";\n case 3: /*3 */ /* 3? */\n case 4:\n default:\n echo '2';\n break;\n}\necho 1;\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function testRejectsAScalarTypeDefiningParseValueAndParseLiteralWithAnIncorrectType()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeScalar must provide both \"parseValue\" and \"parseLiteral\" functions.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n 'serialize' => function () {\n return null;\n },\n 'parseValue' => '',\n 'parseLiteral' => '',\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "public function valid($strChunk);", "public function testNotString(): void\n {\n $validator = new LengthValidator();\n $result = $validator->validate(9);\n\n $this->assertFalse($result->isValid());\n }", "function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}", "function testDoNotGuessIfSpecified() {\n\t\t$result = $this->helper->__guessInputType('Test.foo', array('type' => 'bar'));\n\t\t$this->assertEqual($result, 'bar');\n\t}", "public function testThrowsExceptionOnInvalidFormat()\n {\n $parser = new Parser($this->createTwig());\n $parser->parse('invalid-format');\n }", "function assertNativeType(string $type, $value): void // phpcs:ignore\n{\n}", "public function testBasicPreconditionFail3()\n {\n $this->typeSafetyTestClass->iNeedNumeric('four');\n }", "public function test_invalidNestedContentCommands() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\n {code: \"ApacheVelocity\"}\n Some text here.\n {code}\n{code}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_UNESCAPED_NESTED_COMMAND,\n $parser->getCollection()\n );\n }", "public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }", "public function isPhp() {}", "abstract protected function getValidType(): string;", "public function testCaseInsensitive()\n {\n $this->assertError($this->sniffResult, 9, 'The interface DATETIMEINTERFACE is intended for type hints only and is not implementable.');\n $this->assertError($this->sniffResult, 10, 'The interface datetimeinterface is intended for type hints only and is not implementable.');\n }", "public function testValidVersionString(): void\n\t{\n\t\t$version = Version::createFromString('40306');\n\t\t$this->assertEquals(4, $version->major);\n\t\t$this->assertEquals(3, $version->minor);\n\t\t$this->assertEquals(6, $version->patch);\n\t}", "function NeedQuotesNumeric($type)\n{\n if($type == 203 || $type == 8 || $type == 129 || $type == 130 || \n\t\t$type == 7 || $type == 133 || $type == 134 || $type == 135 ||\n\t\t$type == 201 || $type == 205 || $type == 200 || $type == 202 || $type==72 || $type==13)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function testExecuteSingleValidatorFail()\n {\n $init = '123456789';\n $str = new \\Pv\\PString($init, array('numeric', 'length[0,5]'));\n\n $result = $str->validate(1);\n }", "public function testGetMultipleInvalidTypeBoolean(): void\n {\n $keyValuePairs = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testBasicPreconditions()\n {\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iNeedStrings('stringer', 'testinger');\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iNeedArrays(array('test', 'test2'), array());\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iNeedNumeric(12, 5);\n $this->typeSafetyTestClass->iNeedNumeric(42);\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n }", "private function checkString($value)\n {\n if (!preg_match(\"/^[a-zA-Z ]*$/\", $value))\n {\n echo \"ERRORE nella Stringa : \" . $value;\n throw new InvalidArgumentException();\n }\n return true;\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "public function testRegistrationValuesTooShort(): void { }", "public function testInvalidVersionString(): void\n\t{\n\t\t$this->expectException(LycheeInvalidArgumentException::class);\n\t\tVersion::createFromString('1000000');\n\t}", "public function testRejectsAScalarTypeDefiningParseValueButNotParseLiteral()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeScalar must provide both \"parseValue\" and \"parseLiteral\" functions.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n 'serialize' => function () {\n return null;\n },\n 'parseValue' => function () {\n return null;\n },\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "public function testIsInvalid()\n {\n $this->todo('stub');\n }", "public function testQueryArgumentsTypeQualifyHelpers()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar,\n _8_bit, _9_time, _10_uuid)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n //$types = 'idssbsss';\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => MsSqlQuery::argIn(MsSqlQuery::IN_INT, 0),\n '_1_float' => MsSqlQuery::argIn(MsSqlQuery::IN_FLOAT, 1.0),\n '_2_decimal' => MsSqlQuery::argIn(MsSqlQuery::IN_DECIMAL_14_2, 2.0),\n '_3_varchar' => MsSqlQuery::argIn(MsSqlQuery::IN_VARCHAR, 'type qualify helpers'),\n '_4_blob' => MsSqlQuery::argIn(MsSqlQuery::IN_VARBINARY, sprintf(\"%08d\", decbin(4))),\n '_5_date' => MsSqlQuery::argIn(MsSqlQuery::IN_DATE, $time),\n '_6_datetime' => MsSqlQuery::argIn(MsSqlQuery::IN_DATETIME, $time),\n '_7_nvarchar' => MsSqlQuery::argIn(MsSqlQuery::IN_NVARCHAR, 'n varchar'),\n '_8_bit' => MsSqlQuery::argIn(MsSqlQuery::IN_BIT, 0),\n '_9_time' => MsSqlQuery::argIn(MsSqlQuery::IN_TIME, '10:30:01'),\n '_10_uuid' => MsSqlQuery::argIn(MsSqlQuery::IN_UUID, '123e4567-e89b-12d3-a456-426655440000'),\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n\n $args['_0_int'][0] = '1';\n //$args['_0_int'][0] = 'hest';\n $args['_1_float'][0] = '1.1';\n $args['_2_decimal'][0] ='2.2';\n $args['_3_varchar'][0] = 'type qualify helpers updated';\n $args['_5_date'][0] = $time->ISODate;\n //$args['_5_date'][0] = 'cykel';\n $args['_6_datetime'][0] = $time->ISODate;\n $args['_8_bit'][0] = true;\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "function _is_valid($string, $min_length, $max_length, $regex)\r\n{\r\n $str = trim($string);\r\n if(empty($str))\r\n {\r\n return(false);\r\n }\r\n\r\n\r\n // Does the string entirely consist of characters of $type?\r\n if(!ereg(\"^$regex$\",$string))\r\n {\r\n return(false);\r\n }\r\n\r\n // Check for the optional length specifiers\r\n $strlen = strlen($string);\r\n\r\n if(($min_length != 0 && $strlen < $min_length) || ($max_length != 0 && $strlen > $max_length))\r\n {\r\n return(false);\r\n\r\n }\r\n\r\n // Passed all tests\r\n return(true);\r\n\r\n\r\n}", "private static function checkType($t)\n\t{\n\t\t// void and null are not allowed:\n\t\tif( $t === \"void\"\n\t\t|| Strings::endsWith($t, \"]void\")\n\t\t|| Strings::startsWith($t, \"void[\") )\n\t\t\treturn \"void not allowed in cast()\";\n\t\tif( $t === \"null\"\n\t\t|| Strings::endsWith($t, \"]null\")\n\t\t|| Strings::startsWith($t, \"null[\") )\n\t\t\treturn \"null not allowed in cast()\";\n\t\t\n\t\t// Absolute class names not allowed:\n\t\tif( Strings::startsWith($t, \"\\\\\")\n\t\t|| strpos($t, \"]\\\\\") !== FALSE )\n\t\t\treturn \"absolute class name not allowed in cast()\";\n\t\t\n\t\t// Generics not allowed:\n\t\tif( strpos($t, \"<\") !== FALSE )\n\t\t\treturn \"forbidden cast to generic type: $t\";\n\t\t\n\t\treturn \"\";\n\t}", "public function testCanBeUsedAsString()\n {\n\n }", "public function testRejectsAScalarTypeDefiningParseLiteralButNotParseValue()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeScalar must provide both \"parseValue\" and \"parseLiteral\" functions.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n 'serialize' => function () {\n return null;\n },\n 'parseLiteral' => function () {\n return null;\n },\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "function yy_syntax_error($yymajor, $TOKEN)\n {\n#line 11 \"src/SQLParser/Parser.y\"\n\n $expect = array();\n foreach ($this->yy_get_expected_tokens($yymajor) as $token) {\n $expect[] = self::$yyTokenName[$token];\n }\n throw new RuntimeException('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. ') Expecting ' . implode(\",\", $expect));\n#line 2819 \"src/SQLParser/Parser.php\"\n }", "public function beginsWithReturnsInvalidArgumentDataProvider() {}", "public function testSetMultipleInvalidTypeKeyWithinNotString(): void\n {\n $obj = new \\stdClass;\n $obj->animal = \"Frog\";\n $obj->mineral = \"Quartz\";\n $obj->vegetable = \"Spinach\";\n $keyValuePairs = array(\n \"testInt\" => 5,\n \"testFloat\" => 3.278,\n \"testString\" => \"WooHoo\",\n \"testBoolean\" => true,\n \"testNull\" => null,\n \"testArray\" => array(1, 2, 3, 4, 5),\n \"testObject\" => $obj\n );\n // this is what triggers it\n $keyValuePairs[] = 'Hello';\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->setMultiple($keyValuePairs);\n }", "public function testIsThereAnySyntaxError()\n {\n $colors = new Jervenclark\\Colors\\Colors;\n $this->assertTrue(is_object($colors));\n unset($colors);\n }", "protected function validateOrThrow() {}", "public function testBadArgs() {\n $resolver = new SprintfResolver();\n\n $this->expectException(ValidationException::class);\n $this->expectExceptionMessage('args');\n $actual = $resolver->resolve(['format' => 'foo', 'args' => 'foo'], []);\n }", "public function testCreate()\n {\n $exception = InvalidArgumentException::create('tested value', 123.456, ['string', GrammarInterface::class]);\n $this->assertEquals(\n 'Tested value expected to be string or Finesse\\QueryScribe\\GrammarInterface, double given',\n $exception->getMessage()\n );\n\n $exception = InvalidArgumentException::create('Argument $foo', new Raw(''), ['foo']);\n $this->assertEquals(\n 'Argument $foo expected to be foo, Finesse\\QueryScribe\\Raw given',\n $exception->getMessage()\n );\n }", "function isCommitValid(string $commit)\n{\n return preg_match(\"/[a-z0-9]{40}/\", $commit);\n}", "public function testSaveDataTableStringsNotParseableToDataTypes() {\r\n $record = ['UUID' => 'uuid1tRMR2', 'bool' => 'not parsable', 'int' => 'not parsable', 'string' => 'testReadMultipleRecords 2'];\r\n\t\t$datatable = new avorium_core_data_DataTable(1, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, $record['UUID']);\r\n\t\t$datatable->setCellValue(0, 1, $record['bool']);\r\n\t\t$datatable->setCellValue(0, 2, $record['int']);\r\n\t\t$datatable->setCellValue(0, 3, $record['string']);\r\n $this->setExpectedException('Exception');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t}", "public function setTypes(){\n $this->var = false;\n $this->symb = false;\n $this->label = false;\n $type = '';\n \n //Ulozi postupne do jednotlivych promennych jestli dany argument odpovida nejakemu danemu vzoru a pote v podminkach rozhodneme typ argumentu (ktery na konci funkce ulozime do typu) a take jestli je argument var, symb, label nebo type\n $var = preg_match(\"/^(TF|LF|GF)@((\\p{L}|-|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n $int = preg_match(\"/^int@([\\+\\-])?([0-9])*$/u\", $this->arg);\n $bool = preg_match(\"/^bool@(true|false)$/u\", $this->arg);\n $string = preg_match(\"/^string@(\\p{L}|[^(\\w\\\\\\)]|\\d|[_]|\\\\\\\\([0-9][0-9][0-9]))*$/u\", $this->arg);\n $nil = preg_match(\"/^nil@nil$/u\", $this->arg);\n $label = preg_match(\"/^((\\p{L}|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n if($var){\n $type = \"var\";\n $this->var = true;\n $this->symb = true;\n }\n if($int){\n $type = \"int\";\n $this->symb = true;\n }\n if($bool){\n $type = \"bool\";\n $this->symb = true;\n }\n if($string){\n $type = \"string\";\n $this->symb = true;\n }\n if($nil){\n $type = \"nil\";\n $this->symb = true;\n }\n if($label){\n if(preg_match(\"/^(int|bool|string)$/u\", $this->arg)){\n $this->type_type = true;\n }\n $type = \"label\";\n $this->label = true; \n }\n if(!($var||$int||$bool||$string||$nil||$label)){\n fwrite(STDERR, \"CHYBA \".ERROR_23.\" - spatny argument\\n\");\n exit(ERROR_23);\n }\n $this->setType($type);\n }", "function testBug1597() \n {\n $sText = <<<SCRIPT\n<?php\nif (\\$_POST[\"url\"] != \"\") //inserting data\n{\n}\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nif (\\$_POST[\"url\"] != \"\") //inserting data\n{\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }" ]
[ "0.6435279", "0.61733", "0.6087122", "0.59889054", "0.5985797", "0.5921954", "0.58977157", "0.58839667", "0.58731234", "0.586502", "0.58238155", "0.5756265", "0.5751384", "0.5750584", "0.5715456", "0.57070374", "0.56916493", "0.5626371", "0.5608669", "0.56054044", "0.5604574", "0.5589994", "0.5587462", "0.5577871", "0.5558823", "0.5523107", "0.55198234", "0.5514834", "0.550222", "0.5475235", "0.547474", "0.54743326", "0.5468999", "0.5464269", "0.5461619", "0.54537135", "0.5446776", "0.5428314", "0.5411154", "0.54076755", "0.5397852", "0.5371407", "0.53691435", "0.5349662", "0.5349209", "0.53483725", "0.5347881", "0.5345275", "0.5328702", "0.53026783", "0.52967083", "0.5295009", "0.5292475", "0.52882314", "0.5285114", "0.52846766", "0.5281831", "0.5280827", "0.5274693", "0.5271265", "0.52678883", "0.5253257", "0.52515477", "0.5249761", "0.52451265", "0.52327293", "0.52319205", "0.52215695", "0.5221065", "0.521803", "0.5213286", "0.52083415", "0.5208032", "0.52053547", "0.52019787", "0.520184", "0.5200628", "0.52004194", "0.5200306", "0.5193358", "0.5192423", "0.5191653", "0.51909304", "0.51904386", "0.51886535", "0.51851827", "0.5182307", "0.51761264", "0.5175792", "0.5174721", "0.5170827", "0.5164454", "0.51640755", "0.51635593", "0.5155769", "0.5155733", "0.5139705", "0.51373225", "0.51372486", "0.5125308" ]
0.5758699
11
Retrieves the Role manager to use.
public static function get() { static $manager = null; if ( $manager === null ) { if ( function_exists( 'wpcom_vip_add_role' ) ) { $manager = RoleManagerVIP::get_instance(); } if ( ! function_exists( 'wpcom_vip_add_role' ) ) { $manager = RoleManagerWP::get_instance(); } } return $manager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "protected function getManager()\n {\n return $this->manager;\n }", "public function getManager() {\n return $this->manager;\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "public function getRoleModel()\n\t{\n\t\treturn $this->roleModel = new RoleModel();\n\t}", "public static function getRoleModel()\n {\n return static::getModel('Roles');\n }", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\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 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 $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\t{\n\t\tif ($this->roles->count())\n\t\t\treturn $this->roles[0]->name;\n\n\t\treturn null;\n\t}", "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 role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\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 return($this->role);\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role', 'id', 'role_id');\n }", "function getRole()\n {\n return $this->role;\n }", "public function getRole() {\n return $this->role;\n }", "public function getRole()\n {\n $userIdentity = $this->getIdentity();\n if ($userIdentity === false) {\n return false;\n }\n return $userIdentity->role;\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\UserRoles', 'role_id', '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 function getRole();", "public function getRole();", "function role() {\n isset($this->_role) || $this->_load_from_session();\n return $this->_role;\n }", "public function getRole() \n {\n return $this->role;\n }", "public function getManager()\n {\n return $this->hasOne(User::class, ['id' => 'manager_id']);\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function getRole() {}", "private function getArrangementProgramManager() {\n return $this->get('seip.arrangement_program.manager');\n }", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "public function getRole()\n {\n return $this->_getVar('user_role');\n }", "public function getRole()\n {\n return $this->hasOne(ParticulerTypes::className(), ['ID' => 'RoleID']);\n }", "public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Role');\n }", "public function getSingleRole() {\n return $this->roles[0];\n }", "public function getRole()\n {\n return $this->sessionStorage->user['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 }", "private function getUserManager() {\n return $this->get('seip.user_manager');\n }", "public function getRole()\n {\n return new Horde_Pear_Package_Contents_Role_HordeApplication();\n }", "public static function role(): Role\n {\n return new Role;\n }", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public function getModel()\n {\n return $this->RoleMaster;\n }", "public function get_role()\n {\n }", "protected function getSecurityManager() {\n return $this->dependencyInjector->get('ride\\\\library\\\\security\\\\SecurityManager');\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 function GetUserRole()\n {\n return $this->role;\n }", "public function getResourceManager()\n {\n if (!$this->resourceManager) {\n $this->resourceManager = new MemcachedResourceManager();\n }\n return $this->resourceManager;\n }", "public function getRole()\n {\n return $this->getPredisClient()->role();\n }", "public function getResourceManager() {\n// \tthrow new osid_OperationFailedException('getResourceManager() is not yet implemented.');\n \t\n \tif (!isset($this->resourceManager)) {\n \t\t$this->resourceManager = $this->impl_getRuntimeManager()->getManager(osid_OSID::RESOURCE(), 'banner_resource_ResourceManager', '3.0.0');\n \t}\n \t\n \treturn $this->resourceManager;\n\t}", "public function getRoleId()\n {\n return $this->__get(\"role_id\");\n }", "protected function getIntentionManager()\n {\n return $this->get('intention.execution_manager');\n }", "public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}", "public function getMapper()\n {\n if (null === $this->_mapper) {\n $this->setMapper(new Maerdo_Model_Mappers_Componentauthrole());\n }\n return $this->_mapper;\n }", "public function getCurrentRole()\n {\n return $this->currentRole;\n }", "public function getManager() {\n return $this->em;\n }", "public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }", "public function getRoleId()\n {\n if (array_key_exists(\"roleId\", $this->_propDict)) {\n return $this->_propDict[\"roleId\"];\n } else {\n return null;\n }\n }", "public function getRoleId()\n {\n return $this->roleId;\n }", "public function getRoleId()\n {\n return $this->roleId;\n }", "public function getRoleId()\n {\n return $this->roleId;\n }", "public function getRole(): string|null\n {\n if (!$this->hasRole()) {\n $this->setRole($this->getDefaultRole());\n }\n return $this->role;\n }", "public static function getInstance()\n {\n if (self::$instance == null)\n {\n self::$instance = new RoleDAO();\n }\n \n return self::$instance;\n }", "function getAutoAssignRole() {\n \t$role_id = $this->getAutoAssignRoleId();\n \treturn $role_id ? Roles::findById($role_id) : null;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRoleId() {\n if (Yii::app()->getSession()->get('roleId'))\n return Yii::app()->getSession()->get('roleId');\n return null;\n }", "public static function getUserRole()\n {\n return self::getInstance()->_getUserRole();\n }", "protected function getUserManager() {\n return $this->get('fos_user.user_manager');\n }", "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 getRoleId()\n\t{\n\t\treturn $this->_roleId;\n\t}", "protected function getManager($manager)\n {\n switch ($manager) {\n case 'cms':\n return \\Winter\\User\\Classes\\AuthManager::instance();\n case 'backend':\n return \\Backend\\Classes\\AuthManager::instance();\n }\n\n throw new ApplicationException('Invalid manager provided. Must be either \"cms\" or \"backend\".');\n }", "public function getRole() {\n\n return session('role');\n\n }", "public function getRoleDataSource()\n\t{\n\t\tif ($this->_roleDataSource === null)\n\t\t{\n\t\t\t$this->_roleDataSource = new Application_Model_RoleMapper;\n\t\t}\n\t\t\n\t\treturn $this->_roleDataSource;\n\t}", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }", "public function getRole()\n {\n return $this->getName();\n }", "public function getObjectManager(): mixed\n {\n return $this->objectManager;\n }", "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 }", "protected function getObjectManager()\n {\n return $this->_objectManager;\n }", "protected function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getManager($name = null)\n {\n return $this->entityManager;\n }", "public function getRoleId() {\n return $this->roleId;\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class, 'manager_roles', 'user_id', 'role_id')->withTimestamps();\n }", "public function getRoleType() {\r\n\t return $this->roleType;\r\n\t}" ]
[ "0.6890441", "0.68621635", "0.68621635", "0.68621635", "0.6841516", "0.6753865", "0.6740957", "0.66282755", "0.65834385", "0.64943206", "0.6446718", "0.6436054", "0.6425184", "0.64227283", "0.6413139", "0.63930273", "0.6382889", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6354982", "0.6347689", "0.63311684", "0.6319472", "0.63011104", "0.62946975", "0.6259183", "0.62542015", "0.6194863", "0.6194863", "0.6190897", "0.6174023", "0.6170436", "0.61491877", "0.61491877", "0.61491877", "0.61491877", "0.61491877", "0.61455756", "0.61451316", "0.6129626", "0.609842", "0.60874784", "0.6080882", "0.607244", "0.6051678", "0.60459805", "0.60429317", "0.6040821", "0.6036801", "0.6034753", "0.6015417", "0.60152084", "0.60143155", "0.60130304", "0.6010355", "0.6008446", "0.59982073", "0.5988692", "0.59785724", "0.59605074", "0.5931597", "0.59273386", "0.591634", "0.5910504", "0.59097284", "0.59057564", "0.5905217", "0.5902801", "0.5902801", "0.5902801", "0.5890006", "0.588272", "0.5876963", "0.586295", "0.586295", "0.58574086", "0.58572584", "0.58516175", "0.5841193", "0.5837897", "0.58363414", "0.58291686", "0.58251965", "0.5815132", "0.58141017", "0.57945657", "0.578969", "0.578292", "0.5781401", "0.57651794", "0.576151", "0.57574075", "0.5753439" ]
0.8018739
0
Determine if the user is authorized to make this request.
public function authorize(): bool { return auth('api')->check(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules(): array { return [ 'status' => 'nullable', 'from_date' => 'nullable', 'to_date' => 'nullable', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index() { $products = Product::with(['photo', 'category', 'subcategory'])->take(4)->latest('created_at')->get(); $users = User::with(['photo'])->take(4)->latest('created_at')->get();//Volgens created_at sorteren 4 weergeven return view('admin.index', compact('users', 'products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index() { $user = Auth::user(); if ($user->flag_admin == 1) { return view('dashboard/content_management/promo/index'); }else{ return Redirect::to('/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Composes and returns mail object
function getMail() { if ($this->_mail === false) { $rcpt = $this->getRecipients(); if ($rcpt) { $this->_mail = new Ac_Mail_Message(false, $rcpt, $this->subject, $this->from); Ac_Util::simpleBind($this->mailExtraSettings, $this->_mail); if ($this->replyTo) $this->_mail->replyTo = $this->replyTo; $this->_template->currentSendout = $this; $this->_mail->htmlBody = $this->_template->fetch($this->templatePart); } else $this->_mail = null; } return $this->_mail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createMailMessage();", "private function clone_mail()\n {\n return clone $this->mail_transport;\n }", "public static function createInstance()\n {\n return new MailMessage('[email protected]');\n }", "function get () {\n $this->_build_mail();\n\n $mail = 'To: '.$this->xheaders['To'].\"\\n\";\n $mail .= 'Subject: '.$this->xheaders['Subject'].\"\\n\";\n $mail .= $this->headers . \"\\n\";\n $mail .= $this->full_body;\n return $mail;\n }", "function _instanceMail($smtp) {\n\n require_once 'Mail.php';\n\n/*\n $params = array(\n 'sendmail_path' => '/usr/lib/sendmail',\n 'host' => 'localhost'\n );\n\n $mail_obj = Mail::factory('sendmail', $params);\n*/\n // seteo del smtp\n $params = array(\n 'host' => $smtp\n );\n\n $mail_obj = Mail::factory('smtp', $params);\n\n return $mail_obj;\n }", "public function toMail(): MailMessage\n {\n return tap(static::makeMailMessage(), function (MailMessage $message) {\n $message->subject(__('Successful new backup of :application_name', [\n 'application_name' => $this->applicationName(),\n ]));\n\n $this->getBackupDestinations()->each(function (BackupDestination $destination) use ($message) {\n $message->line(__('Great news, a new backup of :application_name was successfully created on the disk named :disk_name.', [\n 'application_name' => $this->applicationName(),\n 'disk_name' => $destination->diskName(),\n ]));\n\n $this->backupDestinationProperties($destination)->each(function ($value, $name) use ($message) {\n $message->line(\"{$name}: $value\");\n });\n });\n });\n }", "public static function factory()\n\t\t{\n\t\t\t// crea la nuova istanza della classe Mail e la ritorna\n\t\t\treturn new Mailer();\n\t\t}", "protected function prepare_mail()\n {\n // Subject\n $subject_text = $this->subject;\n $subject = '=?UTF-8?B?' . base64_encode($subject_text) . '?=';\n\n // Message\n $message = ($this->message);\n\n // To\n $to = '';\n\n foreach($this->to as $item){\n if(empty($item[1])){\n $to .= $item[0];\n }else {\n $to .= '=?UTF-8?B?' . base64_encode($item[1]) . '?= <'.$item[0].'>';\n }\n }\n\n // From\n $from = '';\n\n if(empty($this->from[1])){\n $from .= $this->from[0];\n }else {\n $from .= '=?UTF-8?B?' . base64_encode($this->from[1]) . '?= <'.$this->from[0].'>';\n }\n\n // Reply\n $reply = '';\n\n foreach($this->reply as $item){\n if(empty($item[1])){\n $reply .= $item[0];\n }else {\n $reply .= '=?UTF-8?B?' . base64_encode($item[1]) . '?= <'.$item[0].'>';\n }\n }\n\n if(!empty($reply)){\n $header_reply = 'Reply-To: ' . $reply . \"\\r\\n\"; // Reply-To\n }else{\n $header_reply='';\n }\n\n // CC\n $cc = '';\n\n foreach($this->cc as $item){\n if(empty($item[1])){\n $cc .= $item[0];\n }else {\n $cc .= '=?UTF-8?B?' . base64_encode($item[1]) . '?= <'.$item[0].'>';\n }\n }\n\n if(!empty($cc)){\n $header_cc = 'Cc: ' . $cc . \"\\r\\n\"; // Cc\n }else{\n $header_cc='';\n }\n\n // BCC\n $bcc = '';\n\n foreach($this->bcc as $item){\n if(empty($item[1])){\n $bcc .= $item[0];\n }else {\n $bcc .= '=?UTF-8?B?' . base64_encode($item[1]) . '?= <'.$item[0].'>';\n }\n }\n\n if(!empty($cc)){\n $header_bcc = 'Bcc: ' . $bcc . \"\\r\\n\"; // Bcc\n }else{\n $header_bcc = '';\n }\n\n // Type\n if($this->isHtml){\n $type = \"text/html\";\n }else{\n $type = \"text/plain\";\n }\n\n // Headers\n $headers = '';\n $headers .= 'From: ' . $from . \"\\r\\n\"; // From\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\"; // MIME\n $headers .= $header_reply; // Reply-To\n $headers .= $header_cc; // CC\n $headers .= $header_bcc; // BCC\n $headers .= 'X-Mailer: PHP/' . phpversion(); // Mailer\n\n // Attachments \n $files = $this->attachment; \n\n // Boundary \n $semi_rand = md5(time()); \n $mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\"; \n \n // Headers for attachment \n $headers .= \"\\nContent-Type: multipart/mixed;\\n\" . \" boundary=\\\"{$mime_boundary}\\\"\"; \n \n // Multipart boundary \n $message = \"--{$mime_boundary}\\n\" . \"Content-Type: $type; charset=\\\"UTF-8\\\"\\n\" . \n \"Content-Transfer-Encoding: 7bit\\n\\n\" . $message . \"\\n\\n\"; \n \n // Preparing attachment \n if(!empty($files)){ \n for($i=0;$i<count($files);$i++){ \n if(is_file($files[$i])){ \n $file_name = basename($files[$i]); \n $file_size = filesize($files[$i]); \n \n $message .= \"--{$mime_boundary}\\n\"; \n $fp = @fopen($files[$i], \"rb\"); \n $data = @fread($fp, $file_size); \n @fclose($fp); \n $data = chunk_split(base64_encode($data)); \n $message .= \"Content-Type: application/octet-stream; name=\\\"\".$file_name.\"\\\"\\n\" . \n \"Content-Description: \".$file_name.\"\\n\" . \n \"Content-Disposition: attachment;\\n\" . \" filename=\\\"\".$file_name.\"\\\"; size=\".$file_size.\";\\n\" . \n \"Content-Transfer-Encoding: base64\\n\\n\" . $data . \"\\n\\n\"; \n } \n } \n } \n \n $message .= \"--{$mime_boundary}--\"; \n\n return compact(\"subject\", \"message\", \"to\", \"headers\");\n }", "protected function createMailDriver()\n {\n return MailTransport::newInstance();\n }", "public function getMail()\n {\n if (null === $this->_transport) {\n\n $options = $this->getOptions();\n\n foreach ($options as $key => $option) {\n $options[strtolower($key)] = $option;\n }\n\n $this->setOptions($options);\n\n if (isset($options['transport']) &&\n !is_numeric($options['transport'])\n ) {\n $this->_transport = $this->_setupTransport(\n $options['transport']\n );\n\n if (!isset($options['transport']['register']) ||\n $options['transport']['register'] == '1' ||\n (isset($options['transport']['register']) &&\n !is_numeric($options['transport']['register']) &&\n (bool) $options['transport']['register'] == true)\n ) {\n Xulub_Mail::setDefaultTransport($this->_transport);\n }\n }\n\n $this->_setDefaults('from');\n $this->_setDefaults('replyTo');\n $this->_setDefaults('bcc');\n }\n\n return $this->_transport;\n }", "public function toMail(): MailMessage\n {\n return (new MailMessage())\n ->subject('There is created an login for u on '.config('app.name'))\n ->greeting('Hello,')\n ->line('A administrator has created an login for u on '.config('app.name'))\n ->line('You can login with the following password: '.$this->input['password'])\n ->action('login', route('login'));\n }", "public function getContent(): MailingContent\n {\n return new MailingContent();\n }", "public function prepareEmail($message)\n {\n $fromEmail = array_keys($message->getFrom())[0];\n $fromName = (is_null($message->getFrom())) ? null : array_values($message->getFrom())[0];\n $toEmail = array_keys($message->getTo())[0];\n $toName = (is_null($message->getTo())) ? null : array_values($message->getTo())[0];\n $replyToEmail = (is_null($message->getReplyTo())) ? null : array_keys($message->getReplyTo())[0];\n\n // Following RFC 1341, section 7.2, if either text/html or text/plain are to be sent in your email: text/plain needs to be first\n // So, use array_shift instead of array_pop\n $parts = array_map(function ($part) {\n return new Content($part->getContentType(), $part->getBody());\n }, $message->getChildren());\n\n $mail = new Mail(\n new Email($fromName, $fromEmail),\n $message->getSubject(),\n new Email($toName, $toEmail),\n array_shift($parts)\n );\n\n // set Reply-To header\n $mail->setReplyTo(['email' => $replyToEmail]);\n\n foreach($parts as $part) {\n $mail->addContent($part);\n }\n\n $preserved = [\n \"Content-Transfer-Encoding\",\n \"Content-Type\",\n \"MIME-Version\",\n \"Date\",\n \"Message-ID\",\n \"From\",\n \"Subject\",\n \"To\",\n \"Reply-To\",\n \"Subject\",\n \"From\"\n ];\n\n foreach($message->getHeaders()->getAll() as $header) {\n if (!in_array($header->getFieldName(), $preserved)) {\n $mail->addHeader($header->getFieldName(), $header->getFieldBody());\n }\n }\n\n // to track bounce/feedback notification\n $mail->addCustomArg(\"runtime_message_id\", $message->getHeaders()->get('X-Acelle-Message-Id')->getFieldBody());\n\n return $mail;\n }", "private function _build_mail () {\n if (empty($this->sendto) && (empty($this->body) && empty($this->htmlbody))) {\n throw new Exception(\"Cannot send, need more information\");\n }\n\n // build the headers\n $this->headers = \"\";\n\n $this->xheaders['To'] = implode(',', $this->sendto);\n\n $cc_header_name = ($this->apply_windows_bugfix) ? 'cc': 'Cc';\n if (!empty($this->sendcc)) $this->xheaders[$cc_header_name] = implode(',', $this->sendcc);\n if (!empty($this->sendbcc)) $this->xheaders['Bcc'] = implode(',', $this->sendbcc);\n\n if($this->receipt) {\n if(isset($this->xheaders['Reply-To'])) {\n $this->xheaders['Disposition-Notification-To'] = $this->xheaders['Reply-To'];\n }\n elseif (isset($this->xheaders['From'])) {\n $this->xheaders['Disposition-Notification-To'] = $this->xheaders['From'];\n }\n }\n\n if($this->charset != '') {\n $this->xheaders['Mime-Version'] = '1.0';\n $this->xheaders['Content-Type'] = 'text/plain; charset='.$this->charset;\n $this->xheaders['Content-Transfer-Encoding'] = $this->ctencoding;\n }\n\n if (!$this->xheaders['X-Mailer']) {\n $this->xheaders['X-Mailer'] = 'King-Fu MimeMail';\n }\n\n // setup the body ready for sending\n $this->_set_body();\n\n foreach ($this->xheaders as $head => $value) {\n $rgx = ($this->apply_windows_bugfix) ? 'Subject' : 'Subject|To'; // don't strip out To header for bugfix\n if (!preg_match('/^'.$rgx.'$/i', $head)) $this->headers .= $head.': '.strtr($value, \"\\r\\n\", ' ').\"\\n\";\n }\n }", "function Get()\r\n\t\t{\r\n\t\t$this->_build_headers();\r\n\t\tif( sizeof( $this->aattach ) > 0 )\r\n\t\t\t{\r\n\t\t\t$this->_build_attachement();\r\n\t\t\t$this->body= $this->body . $this->attachment;\r\n \t}\r\n\t\t$mail = $this->headers;\r\n\t\t$mail .= \"\\n$this->body\";\r\n\t\treturn $mail;\r\n\t\t}", "public function compose() {\n return $this->createMessage();\n }", "function enviarEmail($assunto, $descrição, $emailDe, $nomeDe, $emailPara, $nomePara)\n {\n $mail = new PHPMailer();\n // Define os dados do servidor e tipo de conexão\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->IsSMTP(); // Define que a mensagem será SMTP\n $mail->Host = \"mail.codeboys.pt\"; // Endereço do servidor SMTP\n $mail->SMTPAuth = true; // Autenticação\n $mail->Username = '[email protected]'; // Usuário do servidor SMTP\n $mail->Password = 'codeboys2016'; // Senha da caixa postal utilizada\n // Define o remetente\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->From = $emailDe; // Seu e-mail\n $mail->FromName = $nomeDe; // Seu nome\n // Define os destinatário(s)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n //$mail->AddAddress('[email protected]', 'Luis Filipe');\n $mail->AddAddress($emailPara, $nomePara);\n /* $sql1 = \"select email from utilizador where id='$idMaterial' and hospital='$hospital' and utilizado=0\";\n $resultado1=$this->bd->executarSQL($sql1);\n while ($row = $resultado1->fetch(PDO::FETCH_ASSOC)) {\n\n }*/\n// $mail->AddAddress('[email protected]');\n //$mail->AddCC('[email protected]', 'Ciclano'); // Copia\n //$mail->AddBCC('[email protected]', 'Fulano da Silva'); // Cópia Oculta\n // Define os dados técnicos da Mensagem\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->IsHTML(true); // Define que o e-mail será enviado como HTML\n //$mail->CharSet = 'iso-8859-1'; // Charset da mensagem (opcional)\n // Define a mensagem (Texto e Assunto)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->Subject = utf8_decode($assunto); // Assunto da mensagem\n $mail->Body = utf8_decode($descrição);\n $mail->AltBody = utf8_decode($assunto);\n // Define os anexos (opcional)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n //$mail->AddAttachment(\"c:/temp/documento.pdf\", \"novo_nome.pdf\"); // Insere um anexo\n // Envi a o e-mail\n $enviado = $mail->Send();\n // Limpa os destinatários e os anexos\n $mail->ClearAllRecipients();\n $mail->ClearAttachments();\n // Exibe uma mensagem de resultado\n if ($enviado) {\n// echo \"E-mail enviado com sucesso!\";\n return true;\n } else {\n// echo \"Não foi possível enviar o e-mail.\";\n// echo \"<b>Informações do erro:</b> \" . $mail->ErrorInfo;\n return $mail->ErrorInfo;\n }\n }", "public function createMimeMessage();", "protected function create_notification_email_object()\n\t{\n\t\t$category = $this->category();\n\n\t\t$email = new Charcoal_Email;\n\t\t$email->to = $this->get_notified_email_address();\n\t\t$email->reply_to = $this->get_lead_email_address();\n\n\t\tif ( $category ) {\n\t\t\t$email->subject = $category->p('confirmation_email_subject')->text();\n\t\t\t$email->from = $category->p('confirmation_email_from')->text();\n\t\t\t$email->cc = $category->v('confirmation_email_cc');\n\t\t\t$email->bcc = $category->v('confirmation_email_bcc');\n\t\t}\n\n\t\treturn $email;\n\t}", "public function build() {\n\n //validate\n if (!$this->data instanceof \\App\\Models\\EmailQueue) {\n return;\n }\n\n //[attachement] send emil with an attahments\n if (is_array($this->attachment)) {\n return $this->from(config('system.settings_email_from_address'), config('system.settings_email_from_name'))\n ->subject($this->data->emailqueue_subject)\n ->with([\n 'content' => $this->data->emailqueue_message,\n ])\n ->view('pages.emails.template')\n ->attach($this->attachment['filepath'], [\n 'as' => $this->attachment['filename'],\n 'mime' => 'application/pdf',\n ]);\n } else {\n //[no attachment] send email without any attahments\n return $this->from(config('system.settings_email_from_address'), config('system.settings_email_from_name'))\n ->subject($this->data->emailqueue_subject)\n ->with([\n 'content' => $this->data->emailqueue_message,\n ])\n ->view('pages.emails.template');\n }\n }", "public function build()\n {\n return $this->from($this->mailData [\"from_address\"])->subject($this->mailData[\"subject\"])->view('emails.rappel-rdv');\n }", "public function compose_mail_modal()\n {\n $str = '<div class=\"modal fade\" id=\"newmail-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">';\n $str .= '<div class=\"credential-panel\" id=\"newmail-panel\">';\n $str .= '<div class=\"credential-form\" id=\"newmail-form\">';\n $str .= '<h2 class=\"sign-in font-24 modal-header mail_subject\" id = \"modal-header\">New Message</h2>';\n $str .= '</br>';\n\n $str .= '<label class=\"credential-label\" style=\"margin-top: 0px\">To:</label>';\n $str .= '<input class=\"newmail-credential\" id=\"newmail_receiver\" type=\"text\">';\n\n $str .= '<label class=\"credential-label\">Subject:</label>';\n $str .= '<input class=\"newmail-credential\" id=\"newmail_subject\" type=\"text\">';\n\n $str .= '<label class=\"credential-label\">Message:</label>';\n $str .= '<textarea class=\"newmail-textarea\" rows=\"8\" cols=\"50\" id=\"newmail_body\"></textarea>';\n\n $str .= '<input type=\"submit\" class=\"btn-default register-button\" id=\"newmail_send\" value=\"Send\" onclick=\"sendMail();\">';\n $str .= '</div>';\n $str .= '</div>';\n $str .= '</div>';\n return $str;\n }", "public function getMailInterface()\n {\n return $this->getInnerInterface();\n }", "public function mail()\n\t{\n\t\treturn $this->_mail;\n\t}", "public function getMail();", "function Email($from=\"\", $to=\"\", $cc=\"\", $bcc=\"\", $subject=\"\", $smtp_server=EMAIL_SMTP_SERVER, $smtp_port=EMAIL_SMTP_PORT, $pop3_user=EMAIL_POP3_USER, $pop3_pass=EMAIL_POP3_PASS, $pop3_server=EMAIL_POP3_SERVER, $pop3_port=EMAIL_POP3_PORT, $socket_timeout=EMAIL_CONNECTION_TIMEOUT) {\n\t\t\n\t\t$this->smtp_server \t= $smtp_server;\n\t\t$this->smtp_port \t= $smtp_port;\n\t\t$this->smtp_fp\t\t= 0;\n\t\t\n\t\t$this->email_from \t= $from;\n\t\t$this->email_to\t\t= $to;\n\t\t$this->email_cc\t\t= $cc;\n\t\t$this->email_bcc\t= $bcc;\n\t\t\n\t\t$this->email_rcptlist\t= array();\n\t\t\n\t\t$this->email_subject\t= $subject;\n\n\t\t$this->email_messages = array();\n\t\t$this->email_attachments = array();\n\t\t\n\t\t$this->email_boundry_message = '_-_Message-Boundry_-_';\n\t\t$this->email_boundry_parts = '_-_Message-Parts_-_';\n\t\t\n\t\t$this->pop3_authenticate = false;\n\t\t\n\t\t$this->pop3_user\t= $pop3_user;\n\t\t$this->pop3_pass\t= $pop3_pass;\n\t\t$this->pop3_server\t= $pop3_server;\n\t\t$this->pop3_port\t= $pop3_port;\n\t\t\n\t\t$this->socket_timeout = $socket_timeout;\n\t\n\t\t$this->debug_mode\t= false;\n\t\t$this->debug_data\t= '';\n\t\t\n\t}", "public function withTemplate(string $template): TemplatedMailInterface;", "public static function buildFromContent( $subject, $htmlContent='', $plaintextContent=NULL, $type = 'transactional', $useWrapper=TRUE )\n\t{\n\t\t$email = static::factory( $type );\n\t\t$email->type = $type;\n\t\t$email->subject = $subject;\n\t\t$email->htmlContent = $htmlContent;\n\t\t$email->plaintextContent = ( $plaintextContent === NULL ) ? static::buildPlaintextBody( $htmlContent ) : $plaintextContent;\n\t\t$email->useWrapper = $useWrapper;\n\t\treturn $email;\n\t}", "abstract protected function _sendMail ( );", "public function send() {\n $mail = $this->initializeMail();\n $mail->subject = $this->subject; \n $mail->MsgHTML($this->body);\n if($this->is_admin) {\n //send email to the admin\n $mail->setFrom($this->sender->email, $this->sender->name);\n $mail->addAddress(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n }else{\n $mail->addAddress($this->recipient->email, $this->recipient->name);\n $mail->setFrom(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n \n }\n $mail->send();\n return $mail;\n }", "protected function createMailMock()\n {\n $mailMock = $this->getMock(\\Sys25\\RnBase\\Utility\\Email::class, ['sendMessage']);\n $mailMock->expects($this->any())->method('sendMessage')->will($this->returnArgument(0));\n\n return $mailMock;\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "public function getMailjetMessage(Swift_Mime_Message $message)\n {\n $contentType = $this->getMessagePrimaryContentType($message);\n $fromAddresses = $message->getFrom();\n $fromEmails = array_keys($fromAddresses);\n $toAddresses = $message->getTo();\n $ccAddresses = $message->getCc() ? $message->getCc() : [];\n $bccAddresses = $message->getBcc() ? $message->getBcc() : [];\n\n $attachments = array();\n\n // Process Headers\n $headers = array();\n $mailjetSpecificHeaders = $this->prepareHeaders($message);\n\n if ($replyTo = $this->getReplyTo($message)) {\n $headers = array_merge($headers, array('Reply-To' => $replyTo));\n }\n\n // @TODO only Format To, Cc, Bcc\n $to = \"\";\n foreach ($toAddresses as $toEmail => $toName) {\n $to .= \"$toName <$toEmail>\";\n }\n $cc = \"\";\n foreach ($ccAddresses as $ccEmail => $ccName) {\n $cc .= \"$toName <$toEmail>\";\n }\n $bcc = \"\";\n foreach ($bccAddresses as $bccEmail => $bccName) {\n $bcc .= \"$toName <$toEmail>\";\n }\n\n // Handle content\n $bodyHtml = $bodyText = null;\n if ($contentType === 'text/plain') {\n $bodyText = $message->getBody();\n } elseif ($contentType === 'text/html') {\n $bodyHtml = $message->getBody();\n } else {\n $bodyHtml = $message->getBody();\n }\n\n\n // Handle attachments\n foreach ($message->getChildren() as $child) {\n if ($child instanceof Swift_Attachment) {\n $attachments[] = array(\n 'Content-type' => $child->getContentType(),\n 'Filename' => $child->getFilename(),\n 'content' => base64_encode($child->getBody())\n );\n } elseif ($child instanceof Swift_MimePart && $this->supportsContentType($child->getContentType())) {\n if ($child->getContentType() == \"text/html\") {\n $bodyHtml = $child->getBody();\n } elseif ($child->getContentType() == \"text/plain\") {\n $bodyText = $child->getBody();\n }\n }\n }\n\n $mailjetMessage = array(\n 'FromEmail' => $fromEmails[0],\n 'FromName' => $fromAddresses[$fromEmails[0]],\n 'Html-part' => $bodyHtml,\n 'Text-part' => $bodyText,\n 'Subject' => $message->getSubject(),\n 'Recipients' => $this->getRecipients($message)\n );\n\n if (count($headers) > 0) {\n $mailjetMessage['Headers'] = $headers;\n }\n\n if (count($mailjetSpecificHeaders) > 0) {\n $mailjetMessage = array_merge($mailjetMessage, $mailjetSpecificHeaders);\n }\n\n if (count($attachments) > 0) {\n $mailjetMessage['Attachments'] = $attachments;\n }\n\n // @TODO bulk messages\n\n return $mailjetMessage;\n }", "public static function smtp_inner () \n { \n $html = null;\n\n $top = __( 'SMTP Send : Message', 'default-message' );\n $inner = self::smtp_inner_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'smtp', $top, $inner, $bottom );\n\n return $html;\n }", "protected function _transport_mail($cfg=null)\n\t{\n\t\treturn Swift_MailTransport::newInstance();\n\t}", "public function build()\n {\n return $this->subject('Laxyo Energy')\n ->view('request_for_item.SendMail')->attachData(base64_decode($this->pdf), \"Laxyo Enery Quotation Request.pdf\", [\n\t\t\t\t 'mime' => 'application/pdf',\n\t\t\t\t ]);\n }", "Function smtp_mail($to,$subject,$message,$additional_headers=\"\",$additional_parameters=\"\")\n{\n\tglobal $message_object;\n\n\treturn($message_object->Mail($to,$subject,$message,$additional_headers,$additional_parameters));\n}", "protected function prepareMessage() {\n\n\t\tif (empty($this->messageTemplate)) {\n\t\t\tthrow new \\RuntimeException('Messenger: message template was not defined', 1354536584);\n\t\t}\n\n\t\tif (empty($this->to)) {\n\t\t\tthrow new \\RuntimeException('Messenger: no recipient was defined', 1354536585);\n\t\t}\n\n\t\t// Substitute markers\n\t\t$subject = $this->getContentRenderer()->render($this->messageTemplate->getSubject(), $this->markers);\n\t\t$body = $this->getContentRenderer()->render($this->messageTemplate->getBody(), $this->markers);\n\n\t\t// Parse Markdown only if necessary\n\t\tif ($this->messageTemplate->getTemplateEngine() === TemplateEngine::FLUID_AND_MARKDOWN) {\n\t\t\t$body = Markdown::defaultTransform($body);\n\t\t}\n\n\t\t$this->getMailMessage()->setTo($this->getTo())\n\t\t\t->setCc($this->getCc())\n\t\t\t->setBcc($this->getBcc())\n\t\t\t->setFrom($this->getSender())\n\t\t\t->setReplyTo($this->getReplyTo())\n\t\t\t->setSubject($subject)\n\t\t\t->setBody($body, 'text/html');\n\n\t\t// Attach plain text version if HTML tags are found in body\n\t\tif ($this->hasHtml($body)) {\n\t\t\t$text = Html2Text::getInstance()->convert($body);\n\t\t\t$this->getMailMessage()->addPart($text, 'text/plain');\n\t\t}\n\n\t\t// Handle attachment\n\t\tforeach ($this->attachments as $attachment) {\n\t\t\t$this->getMailMessage()->attach($attachment);\n\t\t}\n\t}", "public function compose($view = null, array $params = [])\n {\n /** @var MessageInterface|BaseMessage $massage */\n $massage = $this->getMailer()->compose($view, $params);\n $massage->mailer = $this;\n return $massage;\n }", "function m_emailBuilder()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_TOPMSG_BLK\", \"topmsg_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_SELECT_BLK\", \"select_blk\");\n\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_BTN_BLK\", \"btn_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_TESTMAIL_BLK\", \"testmail_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_TESTMAIL_BLK\",\"TPL_SENDMAIL_BLK\", \"sendmail_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_TESTMAIL_BLK\",\"TPL_SENTMSG_BLK\", \"sentmsg_blk\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\n\t\t#INTIALIZING\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t$this->ObTpl->set_var(\"btn_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"topmsg_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"testmail_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"sendmail_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"sentmsg_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"select_blk\",\"\");\n\n\t\t$emailRs[0]->vSubject =\"\";\n\t\t$emailRs[0]->vSid =\"\";\n\t\t$emailRs[0]->tHtmlMail =\"\";\n\t\t$emailRs[0]->tTextMail =\"\";\n\t\t$emailRs[0]->tmSentDate=\"\";\n\t\t$emailRs[0]->vUserList=$this->libFunc->ifSet($this->request,\"leadid\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADMIN\",$_SESSION['uname']);\n\t\t#DISPLAYING MESSAGES\n\t\tif(isset($this->request['msg']) && $this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_UPDATED);\n\t\t\t$this->ObTpl->parse(\"topmsg_blk\",\"TPL_TOPMSG_BLK\");\n\t\t}\n\t\t\n\t\tif($this->err==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$this->errMsg);\n\t\t\t$this->ObTpl->parse(\"topmsg_blk\",\"TPL_TOPMSG_BLK\");\n\t\t}\n\n\t\t\n\t\tif(isset($_POST))\n\t\t{\n\t\t\tif(isset($this->request['subject']))\n\t\t\t\t$emailRs[0]->vSubject =$this->request['subject'];\n\t\t\tif(isset($this->request['sid']))\n\t\t\t\t$emailRs[0]->vSid=$this->request['sid'];\n\t\t\tif(isset($this->request['html_mail']))\n\t\t\t\t$emailRs[0]->tHtmlMail=$this->request['html_mail'];\n\t\t\tif(isset($this->request['text_mail']))\n\t\t\t\t$emailRs[0]->tTextMail=$this->request['text_mail'];\n\t\t\tif(isset($this->request['user_list']))\n\t\t\t\t$emailRs[0]->vUserList = $this->request['user_list'];\n\t\t}\n\n\n\t\tif(isset($this->request['id']) && !empty($this->request['id']) && is_numeric($this->request['id']))\n\t\t{\n\t\t\tif($this->err==0)\n\t\t\t{\n\t\t\t\t#DATABASE QUERY\n\t\t\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS.\" WHERE iMailid_PK='\".$this->request['id'].\"'\";\n\t\t\t\t$emailRs = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$this->libFunc->dateFormat2($emailRs[0]->tmSentDate));\n\t\t\t\tif(empty($emailRs[0]->tmSentDate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->parse(\"sendmail_blk\",\"TPL_SENDMAIL_BLK\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->parse(\"sentmsg_blk\",\"TPL_SENTMSG_BLK\");\n\t\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"testmail_blk\",\"TPL_TESTMAIL_BLK\");\t\n\t\t\t\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MODE\",\"edit\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$this->request['id']);\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BTNLBL\",LBL_EDITCAMPAIGN_BTN);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MODE\",\"add\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BTNLBL\",LBL_ADDCAMPAIGN_BTN);\n\t\t}\n\n\n\t\t$this->ObTpl->parse(\"btn_blk\",\"TPL_BTN_BLK\");\n\n\t\t$this->obDb->query = \"SELECT count(*) as cntCustomer FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n\t\t$custCnt = $this->obDb->fetchQuery();\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CUSTCNT\",$custCnt[0]->cntCustomer);\n\n\t\tif(isset($emailRs[0]->vVisitorList)){\n\t\t\tif($emailRs[0]->vVisitorList == \"0\"){\n\t\t\t\t$this->ObTpl->set_var(\"TPL_MAILN_VISITORS\",\"selected='selected'\");\t\n\t\t\t}else{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_MAILY_VISITORS\",\"selected='selected'\");\t\n\t\t\t}\n\t\t}\n\n\t\t$this->obDb->query = \"SELECT count(*) as cntVisitor FROM \".NEWSLETTERS;\n\t\t$cntVisitor = $this->obDb->fetchQuery();\n\t\t$this->ObTpl->set_var(\"TPL_VAR_VISITORCNT\",$cntVisitor[0]->cntVisitor);\n\n\t\t$this->obDb->query = \"SELECT * FROM \".LEADS.\" WHERE vdescription!=' '\";\n\t\t$leadRs = $this->obDb->fetchQuery();\n\t\t$recordCount1=$this->obDb->record_count;\n\t\tif($recordCount1>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$recordCount1;$j++)\n\t\t\t{\t\t\n\t\t\t\tif (isset($this->request['leadid']))\n {\n $emailRs[0]->vUserList = $this->request['leadid'];\n }\n \n if($emailRs[0]->vUserList==$leadRs[$j]->iLeadid_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SELECTED\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SELECTED\",\"\");\n\t\t\t\t}\n \n \n\t\t\t\t$this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $leadRs[$j]->iLeadid_PK.\"'\";\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNT\",$qryRs[0]->cnt);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LEADID\",$leadRs[$j]->iLeadid_PK);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_NAME\",$this->libFunc->m_displayContent($leadRs[$j]->vdescription));\n\n\t\t\t\t$this->ObTpl->parse(\"select_blk\",\"TPL_SELECT_BLK\",true);\n\t\t\t}\n\t\t}\t\n\n\t\t//******************************************\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($emailRs[0]->vSubject));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($emailRs[0]->vSid));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_HTMLMSG\",$this->libFunc->m_displayContent($emailRs[0]->tHtmlMail));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PLAINMSG\",$this->libFunc->m_displayContent($emailRs[0]->tTextMail));\t\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "public function it($from, $to, $subj, $body)\n {\n global $tmpGlobalConfig, $model, $options;\n\n // we going to use external SMTP server (such as gmail, zoho, etc) with remote auth\n // if ($model->config['email']['SENDMAIL_LOCAL'] == 0) {\n\n if ($options->get('smtp')) {\n\n// php-mailer without autoload !!!\n\n $tmpLibNs = 'PHPMailer\\\\PHPMailer\\\\';\n $tmpGlobalConfig['autoload']['main']['psr-4'][$tmpLibNs] = DIR_LIBS.'/php/PHPmailer/';\n\n\n $tmp_lib = '\\\\'.$tmpLibNs.'PHPMailer';\n $tmpMail = new $tmp_lib();\n\n require realpath(ABSPATH.DIR_LIBS.'/php/PHPmailer/SMTP.php');\n\n $tmpMail->IsSMTP();\n\n\n // debugging: 1 = errors and messages, 2 = messages only\n $tmpMail->SMTPDebug = 0;//$options->get('SMTP_DEBUG');\n\n // enable SMTP authentication\n $tmpMail->SMTPAuth = 1;//$options->get('SMTP_AUTH');\n\n // Sets SMTP server ex. smtp.gmail.com smtp.zoho.com\n $tmpMail->Host = $options->get('SMTP_HOST');\n\n // Secure conection ex. tls - gmail , ssl - zoho mail\n $tmpMail->SMTPSecure = $options->get('SMTP_SEC');\n\n // Set the SMTP port ex. 587 - gmail , 465 - zoho\n $tmpMail->Port = $options->get('SMTP_PORT');\n\n // SMTP account username\n $tmpMail->Username = $options->get('SMTP_NAME');\n // SMTP account password\n $tmpMail->Password = $options->get('SMTP_PASS');\n\n // $tmpMail->AuthType = 'password'; !!! !!! ???\n // $tmpMail->oauth = null; !!! !!! ???\n\n\n $tmpMail->From = $options->get('SMTP_NAME');//$options->get('SMTP_FROM');\n $tmpMail->FromName = $options->get('SMTP_NAME');//$options->get('SELF_NAME');\n\n // Email priority (1 = High, 3 = Normal, 5 = low)\n $tmpMail->Priority = 3;\n $tmpMail->CharSet = 'UTF-8';\n $tmpMail->Encoding = '8bit';\n $tmpMail->ContentType = 'text/html; charset=utf-8\\r\\n';\n // RFC 2822 Compliant for Max 998 characters per line\n $tmpMail->WordWrap = 900;\n\n $tmpMail->AddAddress($to);\n\n $tmpMail->Subject = $subj;\n\n // $tmpMail->isHTML( TRUE );\n\n $tmpMail->Body = $body;\n $tmpMail->AltBody = $body;\n $tmpMail->Send();\n $tmpMail->SmtpClose();\n\n if ($tmpMail->IsError()) {\n return false;\n } else {\n return true;\n }\n } else {\n // we going to use local sendmail\n ini_set(\"sendmail_from\", $from);\n\n if ($from == '' || $to == '' || $subj == '' || $body == '') {\n return;\n }\n\n $mx = false;\n\n $headers = \"\";\n\n $headers .= \"Mime-Version: 1.0\\n\";\n $headers .= \"Content-type: text/plain; charset=iso-8559-1\\n\";\n $headers .= \"Content-Transfer-Encoding: 8bit\\n\";\n $headers .= \"X-Priority: 3\\n\";\n\n $headers .= \"From: $from\\n\";\n $headers .= \"Reply-To: $from\\n\";\n $headers .= \"X-Mailer: ChinaTown simple mailer\\n\";\n\n $extras = \"-f \".$from;\n\n $headers .= \"Date:\".date(\"D, d M Y H:i:s O\").\" \\n\";\n\n $body = strip_tags($body);\n\n if (!DEBUG_MODE) {\n $mx = mail($to, $subj, $body, $headers, $extras);\n }\n return $mx;\n }\n }", "public function create()\n {\n /** Zend_Mail_Transport_Sendmail */\n require_once \"Zend/Mail/Transport/Sendmail.php\";\n\n return new Zend_Mail_Transport_Sendmail(\n $this->_parameters\n );\n }", "static function getSmtp(){\n\n\t\tif(!self::$_smtp){\n\n\t\t\trequire_once('Mail.php');\n\t\t\trequire_once('Mail/mime.php');\n\n\t\t\t$host = Yii::app()->params[\"smtpHostName\"];\n\t\t\t$username = Yii::app()->params[\"smtpUserName\"];\n\t\t\t$password = Yii::app()->params[\"smtpPassword\"];\n\n\t\t\tself::$_smtp = Mail::factory('smtp',\n\t\t\tarray ('host' => $host,\n \t\t\t\t'auth' => true,\n \t\t\t\t'username' => $username,\n \t\t\t\t'password' => $password,\n\t\t\t\t\t'persist' => true,\n\n\t\t\t));\n\t\t}\n\n\t\treturn self::$_smtp;\n\t}", "private function newMessage()\n {\n /* @var $config ModuleOptions */\n $config = $this->serviceLocator->get('EscoMail\\Options');\n\n $this->message = new Message();\n $this->message->setFrom($config->getMailSendFrom(), $config->getMailSendFromName());\n\n return $this->message;\n }", "public function toMail($notifiable){\n $pdf = \\PDF::loadView('panel.cajeros.reporte')->stream('reporte.pdf');\n return (new MailMessage)\n ->subject('Comprobante Electrónico- Cuentas por Cobrar')\n ->greeting('Hola')\n ->line('Estimado cliente')\n ->line('Reciba un cordial saludo de quienes hacemos el grupo CXC. Nos complace\n informarle que su documento electrónico ha sido generado con el Nro: PAGO-XXXXX')\n ->attachData($pdf, 'reporte.pdf', [\n 'mime' => 'application/pdf',\n ])\n ->line('Adjunto encontrará su documento electrónico.')\n ->salutation('Saludos, '. config('app.name'));\n }", "function enviar_email($email,$sujeto, $msj, $headers){\n\treturn mail($email,$sujeto, $msj, $headers);\n\t\n}", "private function _setupMessage(Mail $mail, User $user) : Mail\n\t{\n\t\t$mail->assignParams($this->_getMessageParams($user));\n\t\tif ($this->_getMessageAttachment()) {\n\t\t\t$mail->addAttachment($this->_getMessageAttachment(), 'editorial-report.csv');\n\t\t}\n\t\treturn $mail;\n\t}", "function clsRecordemails()\r\n\r\n {\r\n\r\n\r\n\r\n global $FileName;\r\n\r\n $this->Visible = true;\r\n\r\n $this->Errors = new clsErrors();\r\n\r\n $this->ds = new clsemailsDataSource();\r\n\r\n $this->InsertAllowed = false;\r\n\r\n $this->UpdateAllowed = false;\r\n\r\n if($this->Visible)\r\n\r\n {\r\n\r\n $this->ComponentName = \"emails\";\r\n\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n\r\n $this->from_user_id = new clsControl(ccsLabel, \"from_user_id\", \"From User Id\", ccsText, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n\r\n $this->emaildate = new clsControl(ccsLabel, \"emaildate\", \"date\", ccsText, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n\r\n $this->subject = new clsControl(ccsLabel, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n\r\n $this->message = new clsControl(ccsLabel, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n\r\n $this->message->HTML = true;\r\n\r\n $this->Delete = new clsButton(\"Delete\");\r\n\r\n $this->cancel = new clsButton(\"cancel\");\r\n\r\n }\r\n\r\n }", "function enviarEmail($destinatario,$asunto,$cuerpo) {\r\n\r\n\r\n\t# Defina el número de e-mails que desea enviar por periodo. Si es 0, el proceso por lotes\r\n\t# se deshabilita y los mensajes son enviados tan rápido como sea posible.\r\n\tdefine(\"MAILQUEUE_BATCH_SIZE\",0);\r\n\r\n\t//para el envío en formato HTML\r\n\t//$headers = \"MIME-Version: 1.0\\r\\n\";\r\n\t\r\n\t// Cabecera que especifica que es un HMTL\r\n\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\n\t\r\n\t//dirección del remitente\r\n\t$headers .= utf8_decode(\"From: GUSTAVO OMAR AVILA - PROCOMEX <[email protected]>\\r\\n\");\r\n\t\r\n\t//ruta del mensaje desde origen a destino\r\n\t$headers .= \"Return-path: \".$destinatario.\"\\r\\n\";\r\n\t\r\n\t//direcciones que recibirán copia oculta\r\n\t$headers .= \"Bcc: [email protected]\\r\\n\";\r\n\t\r\n\tmail($destinatario,$asunto,$cuerpo,$headers); \t\r\n}", "function enviamail($datos) {\n //Create a new PHPMailer instance\n // Crear una nueva instancia de PHPMailer habilitando el tratamiento de excepciones\n try {\n $mail = new PHPMailer(true);\n// Configuramos el protocolo SMTP con autenticación\n $mail->IsSMTP();\n $mail->SMTPAuth = true;\n// Puerto de escucha del servidor\n $mail->Port = 587;\n// Dirección del servidor SMTP\n $mail->Host = 'mail.dentalia.com.mx';\n// Usuario y contraseña para autenticación en el servidor\n $mail->Username = \"[email protected]\";\n $mail->Password = \"x#l%=pcDw,TS\";\n $mail->SMTPOptions = array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n );\n\n//Set who the message is to be sent from\n $mail->setFrom('[email protected]', 'Dentalia');\n//Set an alternative reply-to address\n $mail->addReplyTo('[email protected]', 'Dentalia');\n//Set who the message is to be sent to\n //$mail->addAddress('[email protected]', 'Geovanny De Leon');\n $nombre = $datos['nombre'] . \" \" . $datos['apaterno'] . \" \" . $datos['amaterno'];\n $mail->addAddress($datos['email'], $nombre);\n //$mail->addCC('[email protected]', 'Geovanny De Leon');\n//Set the subject line\n $mail->Subject = utf8_decode('Confirmación de Cita en dentalia');\n//Read an HTML message body from an external file, convert referenced images to embedded,\n//convert HTML into a basic plain-text alternative body\n $msj = file_get_contents('parts/mailer.html');\n $replacename = str_replace(\"{patname}\", $nombre, $msj);\n $replaceclnic = str_replace(\"{nombreclinic}\", $datos['cliname'], $replacename);\n $dia = date(\"l\", strtotime($datos['fecha']));\n\n if ($dia == \"Monday\")\n $dia = \"Lunes\";\n if ($dia == \"Tuesday\")\n $dia = \"Martes\";\n if ($dia == \"Wednesday\")\n $dia = \"Miércoles\";\n if ($dia == \"Thursday\")\n $dia = \"Jueves\";\n if ($dia == \"Friday\")\n $dia = \"Viernes\";\n if ($dia == \"Saturday\")\n $dia = \"Sábado\";\n if ($dia == \"Sunday\")\n $dia = \"Domingo\";\n\n $mes = date(\"F\", strtotime($datos['fecha']));\n\n if ($mes == \"January\")\n $mes = \"Enero\";\n if ($mes == \"February\")\n $mes = \"Febrero\";\n if ($mes == \"March\")\n $mes = \"Marzo\";\n if ($mes == \"April\")\n $mes = \"Abril\";\n if ($mes == \"May\")\n $mes = \"Mayo\";\n if ($mes == \"June\")\n $mes = \"Junio\";\n if ($mes == \"July\")\n $mes = \"Julio\";\n if ($mes == \"August\")\n $mes = \"Agosto\";\n if ($mes == \"September\")\n $mes = \"Setiembre\";\n if ($mes == \"October\")\n $mes = \"Octubre\";\n if ($mes == \"November\")\n $mes = \"Noviembre\";\n if ($mes == \"December\")\n $mes = \"Diciembre\";\n $dia2 = date(\"d\", strtotime($datos['fecha']));\n $ano = date(\"Y\", strtotime($datos['fecha']));\n $replacefecha = str_replace(\"{fecha}\", $dia . \", \" . $dia2 . \" de \" . $mes . \" de \" . $ano, $replaceclnic);\n $hor = explode(\"-\", $datos['horai']);\n $horaini = date('h:ia', strtotime($hor[0]));\n $horaend = date('h:ia', strtotime($hor[1]));\n $horaconc = $horaini . \" a \" . $horaend;\n $replacef = str_replace(\"{horario}\", $horaconc, $replacefecha);\n\n// $ruta = \"webcal://\" . $_SERVER[\"SERVER_NAME\"] . \"/parts/evento.ics\";\n// /* reemplazamos para el calendario */\n// $replaceCal = str_replace(\"{ruta}\", $ruta, $replacef);\n\n $final = str_replace(\"{dirclinic}\", $datos['clidir'], $replacef);\n\n\n $mail->msgHTML(utf8_decode($final));\n\n\n// var_dump($final);\n// echo \"cual es el error?\";\n if ($mail->send()) {\n //echo \"Message sent!\";\n return true;\n } else {\n echo \"Mailer Error: \" . $mail->ErrorInfo;\n }\n } catch (Exception $e) {\n echo 'informacion sobre el mail: ', $e->getMessage(), \"\\n\";\n }\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject(__('[:appName] 您的投稿(#:id)通過了審核!', [\n 'appName' => appName(),\n 'id' => base_convert($this->cards->id, 10, 36),\n ]))\n ->greeting(__('嗨囉!:user,', [\n 'user' => $this->user->name,\n ]))\n ->line(__('我們在 :createdAt(:createdAtDiff) 收到了您的投稿,經過了繁複的群眾審核後,您的文章在 :publishAt(:publishAtDiff) 的時候達到通過門檻,並且發表出去了!恭喜!', [\n 'createdAt' => $this->cards->created_at->toDatetimeString(),\n 'createdAtDiff' => $this->cards->created_at->diffForHumans(),\n 'publishAt' => $this->cards->updated_at->toDatetimeString(),\n 'publishAtDiff' => $this->cards->updated_at->diffForHumans(),\n ]))\n ->line(__('「:content」', [\n 'content' => $this->cards->content,\n ]))\n ->action(__('來去看看文章'), route('frontend.social.cards.show', ['id' => $this->cards->id]))\n ->line(__('對了,請不要回覆這封電子郵件(no-reply)!這個信箱不會理你,因為我也不會打開來收信,如果你有任何問題,你可以寄信給「:email」給我。', [\n 'email' => config('mail.from.address'),\n ]))\n ->line(__('大概是這樣。'));\n }", "public function getGeneratedMessage()\n {\n # Force the template to render\n (string) $this->prepareTemplate();\n\n $m = $this->template->__message;\n\n if (!$m->getFrom()) {\n trigger_error(\"You should add 'from' information.\", E_USER_WARNING);\n }\n\n if (!$m->getSubject()) {\n trigger_error(\"You should add 'subject'.\", E_USER_WARNING);\n }\n\n if (!$m->getHeader('To')) {\n trigger_error(\"You should add recipients.\", E_USER_WARNING);\n }\n\n foreach ($this->attachments as $attachment) {\n list($filename, $content, $type) = $attachment;\n $m->addAttachment($filename, $content, $type);\n }\n\n return $m;\n }", "function enviarEmailAdministrador($assunto, $descrição, $emailDe, $nomeDe)\n {\n $mail = new PHPMailer();\n // Define os dados do servidor e tipo de conexão\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n// $mail->IsSMTP(); // Define que a mensagem será SMTP\n// $mail->Host = \"smtp.gmail.com\"; // Endereço do servidor SMTP\n// $mail->SMTPAuth = true; // Usa autenticação SMTP? (opcional)\n// $mail->Username = '[email protected]'; // Usuário do servidor SMTP\n// $mail->Password = 'asdasdasd'; // Senha do servidor SMTP\n // Define o remetente\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->From = $emailDe; // Seu e-mail\n $mail->FromName = $nomeDe; // Seu nome\n // Define os destinatário(s)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->AddAddress('[email protected]', 'Luis Filipe');\n $sql1 = \"select nome,email from utilizador where nivel=1 and activo=1\";\n $resultado1=$this->bd->executarSQL($sql1);\n while ($row1 = $resultado1->fetch(PDO::FETCH_ASSOC)) {\n $mail->AddAddress($row1['email'], $row1['nome']);\n }\n// $mail->AddAddress('[email protected]');\n //$mail->AddCC('[email protected]', 'Ciclano'); // Copia\n //$mail->AddBCC('[email protected]', 'Fulano da Silva'); // Cópia Oculta\n // Define os dados técnicos da Mensagem\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->IsHTML(true); // Define que o e-mail será enviado como HTML\n //$mail->CharSet = 'iso-8859-1'; // Charset da mensagem (opcional)\n // Define a mensagem (Texto e Assunto)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->Subject = utf8_decode($assunto); // Assunto da mensagem\n $mail->Body = utf8_decode($descrição);\n $mail->AltBody = utf8_decode($assunto);\n // Define os anexos (opcional)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n //$mail->AddAttachment(\"c:/temp/documento.pdf\", \"novo_nome.pdf\"); // Insere um anexo\n // Envi a o e-mail\n $enviado = $mail->Send();\n // Limpa os destinatários e os anexos\n $mail->ClearAllRecipients();\n $mail->ClearAttachments();\n // Exibe uma mensagem de resultado\n if ($enviado) {\n// echo \"E-mail enviado com sucesso!\";\n return true;\n } else {\n// echo \"Não foi possível enviar o e-mail.\";\n// echo \"<b>Informações do erro:</b> \" . $mail->ErrorInfo;\n return $mail->ErrorInfo;\n }\n }", "public function fabrique_message_par_enveloppe() {\n\t\t$message = array (\n\t\t\t\t'subject' => $this->getObjEnveloppe ()\n\t\t\t\t\t->getSujet (),\n\t\t\t\t'importance' => 'Low'\n\t\t);\n\t\tif ($this->getObjEnveloppe ()\n\t\t\t->getMailCorpHtmlFlag ()) {\n\t\t\t$message ['body'] = array (\n\t\t\t\t\t\"contentType\" => \"HTML\",\n\t\t\t\t\t\"content\" => $this->getObjEnveloppe ()\n\t\t\t\t\t\t->getMailCorpHtml ()\n\t\t\t);\n\t\t} else if ($this->getObjEnveloppe ()\n\t\t\t->getMailCorpTextFlag ()) {\n\t\t\t$message ['body'] = array (\n\t\t\t\t\t\"contentType\" => \"TEXT\",\n\t\t\t\t\t\"content\" => $this->getObjEnveloppe ()\n\t\t\t\t\t\t->getMailCorpText ()\n\t\t\t);\n\t\t}\n\t\tif ($this->getObjEnveloppe ()\n\t\t\t->getSignatureFlag ()) {\n\t\t\t$message ['body'] [\"content\"] .= $this->getObjEnveloppe ()\n\t\t\t\t->getSignature ();\n\t\t}\n\t\tif ($this->getObjEnveloppe ()\n\t\t\t->getFichierAttacheFlag ()) {\n\t\t\t$message [\"hasAttachments\"] = true;\n\t\t}\n\t\t$this->prepare_from ( $this->getObjEnveloppe ()\n\t\t\t->getMailFrom (), $message );\n\t\t$this->prepare_to ( $this->getObjEnveloppe ()\n\t\t\t->getMailTo (), $message );\n\t\t$this->prepare_cc ( $this->getObjEnveloppe ()\n\t\t\t->getMailCc (), $message );\n\t\t$this->prepare_bcc ( $this->getObjEnveloppe ()\n\t\t\t->getMailBcc (), $message );\n\t\t$this->onDebug ( $message, 1 );\n\t\treturn $this->setEmailContent ( $message );\n\t}", "public static function emailContentConstruct($mail_subject,$mail_message,$mail_params,$data)\n {\n \t\n\t\t$mail_params_explode = explode(\",\",$mail_params);\n\t\t\t\n\t\tif(!empty($data))\n\t\t{\n\t\t\tif(!empty($mail_params_explode))\n\t\t\t{\n\t\t\t\tforeach ($mail_params_explode as $key => $value) \n\t\t\t\t{\n\t\t\t\t\t$mail_message = str_replace($mail_params_explode[$key],$data[$key], $mail_message); \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($data as $key => $value) \n\t\t\t\t{\n\t\t\t\t\t$mail_message = str_replace(\"##\".$key.\"##\",$data[$key], $mail_message); \t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t $data['mail_subject'] = $mail_subject;\n\t\t$data['mail_message'] = $mail_message;\n\t\treturn $data;\n\t}", "function mailing($query_mail, $row) {\n global $dbAccess, $smarty;\n require_once COMMON_CORE_PATH . \"/mailer.class.php\";\n $m = new mailer($dbAccess);\n $res = $m->send_email(\n $query_mail, array(\n \"vars\" => $row['mail_vars'],\n \"to\" => array(\n array(\n \"email\" => $row[\"recipient_email\"],\n \"name\" => $row[\"recipient_name\"],\n )\n ),\n \"cc\" => array(\n array(\n \"email\" => $row[\"cc_email\"],\n \"name\" => $row[\"cc_name\"],\n )\n ),\n \"mail_body\" => $row['mail_body'],\n \"attach\" => isset($row[\"attach\"]) ? $row[\"attach\"] : \"\",\n \"images\" => isset($row[\"images\"]) ? $row[\"images\"] : \"\"\n )\n );\n }", "function process_mail(){\n\t\t$result = true;\n\t\t\n\t\tif(count($this->to) < 1){\n\t\t\treturn 'No email address.';\n\t\t}\n\t\t$this->set_eol();\n\t\t$this->get_message_type();\n\t\t$this->set_boundary();\n\t\t$headers = $this->set_headers();\n\t\t$body = $this->set_body();\n\t\t\n\t\tif($body == ''){\n\t\t\treturn 'Empty email body.';\n\t\t}\n\t\t$result = $this->send_mail($headers, $body);\n\t\treturn $result;\n\t}", "public function appendMail(\\PB_Mail $value)\n {\n return $this->append(self::MAIL, $value);\n }", "function clsRecordemails()\r\n {\r\n\r\n global $FileName;\r\n $this->Visible = true;\r\n $this->Errors = new clsErrors();\r\n $this->ds = new clsemailsDataSource();\r\n $this->ReadAllowed = false;\r\n $this->InsertAllowed = false;\r\n $this->UpdateAllowed = false;\r\n $this->DeleteAllowed = false;\r\n $this->Visible = (CCSecurityAccessCheck(\"1;2\") == \"success\");\r\n if($this->Visible)\r\n {\r\n $this->ReadAllowed = CCUserInGroups(CCGetGroupID(), \"1;2\");\r\n $this->InsertAllowed = CCUserInGroups(CCGetGroupID(), \"1;2\");\r\n $this->ComponentName = \"emails\";\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->message = new clsControl(ccsTextArea, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n $this->Insert = new clsButton(\"Insert\");\r\n $this->item_id = new clsControl(ccsHidden, \"item_id\", \"Item Id\", ccsInteger, \"\", CCGetRequestParam(\"item_id\", $Method));\r\n $this->to_user_id = new clsControl(ccsHidden, \"to_user_id\", \"To User Id\", ccsInteger, \"\", CCGetRequestParam(\"to_user_id\", $Method));\r\n $this->from_user_id = new clsControl(ccsHidden, \"from_user_id\", \"From User Id\", ccsInteger, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n $this->emaildate = new clsControl(ccsHidden, \"emaildate\", \"date\", ccsInteger, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n $this->subject = new clsControl(ccsHidden, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n if(!$this->FormSubmitted) {\r\n if(!strlen($this->from_user_id->GetValue()))\r\n $this->from_user_id->SetValue(CCGetUserID());\r\n if(!strlen($this->emaildate->GetValue()))\r\n $this->emaildate->SetValue(time());\r\n }\r\n }\r\n }", "private function getMails()\n {\n $data = array();\n /**@var $mail Enlight_Components_Mail */\n foreach ($this->mails as $mail) {\n $data[] = array(\n 'information' => array(\n 'From' => $mail->getFrom(),\n 'From name' => $mail->getFromName(),\n 'Default from' => $mail->getDefaultFrom(),\n 'Recipients' => $mail->getRecipients(),\n 'Subject' => $mail->getSubject(),\n 'Subject - plain' => $mail->getPlainSubject(),\n 'To' => $mail->getTo(),\n 'Charset' => $mail->getCharset(),\n 'Date' => $mail->getDate(),\n 'Html body' => $mail->getBodyHtml(),\n 'Text body' => $mail->getBodyText(),\n 'Default reply to' => $mail->getDefaultReplyTo(),\n 'Header encoding' => $mail->getHeaderEncoding(),\n 'Message ID' => $mail->getMessageId(),\n 'Mime' => $mail->getMime(),\n 'Mime boundary' => $mail->getMimeBoundary(),\n 'Part count' => $mail->getPartCount(),\n 'Parts' => $mail->getParts(),\n 'Type' => $mail->getType(),\n ),\n 'content' => $mail->getPlainBody()\n );\n }\n\n return $data;\n }", "public function toMail($notifiable)\n { \n \n return (new MailMessage)\n ->subject('¡Te han agregado al equipo de un objetivo en Participes!')\n ->markdown('mail.objectives.join', ['user' => $notifiable, 'objective' => $this->objective, 'role' => ($this->role == 'manager' ? 'coordinardor/a' : 'reportero/a')]);\n \n }", "public function sendEmail()\n {\n // Make sure we are signed in\n if ( false === $this->isSignedIn() ) {\n $this->signIn();\n }\n\n $transport = $this->getOutlookWebTransport();\n $zendMail = $transport->getZendMail();\n $zendMailHeaders = $zendMail->getHeaders();\n\n // Extract the TO string\n $toString = '';\n if ( false === array_key_exists( 'To', $zendMailHeaders ) ) {\n throw new Atc_Mail_Transport_Exception( 'No TO recipients set' );\n }\n $toArray = $zendMailHeaders['To'];\n unset( $toArray['append'] );\n $toString = implode( ';', $toArray );\n\n // Extract the CC string\n $ccString = '';\n if ( true === array_key_exists( 'Cc', $zendMailHeaders ) ) {\n $ccArray = $zendMailHeaders['Cc'];\n unset( $ccArray['append'] );\n if ( false === empty( $ccArray ) ) {\n $ccString = implode( ';', $ccArray );\n }\n }\n\n // Extract the BCC string\n $bccString = '';\n if ( true === array_key_exists( 'Bcc', $zendMailHeaders ) ) {\n $bccArray = $zendMailHeaders['Bcc'];\n unset( $bccArray['append'] );\n if ( false === empty( $bccArray ) ) {\n $bccString = implode( ';', $bccArray );\n }\n }\n\n // Extract the subject string\n $subjectString = '';\n if ( false === array_key_exists( 'Subject', $zendMailHeaders ) ) {\n throw new Atc_Mail_Transport_Exception( 'No subject set' );\n }\n $subjectArray = $zendMailHeaders['Subject'];\n $subjectString = implode( ';', $subjectArray );\n\n // Extract the body string\n $bodyString = $zendMail->getBodyText( true );\n\n // Set the email compose form values\n $composeEmailPage = new Atc_Mail_Transport_OutlookWeb_Browser_WebPage_ComposeEmail( $this );\n $composeEmailPage->setTo( $toString );\n $composeEmailPage->setCc( $ccString );\n $composeEmailPage->setBcc( $bccString );\n $composeEmailPage->setSubject( $subjectString );\n $composeEmailPage->setBody( $bodyString );\n\n // Submit the compose form\n $composeEmailPage->postEmailComposeForm();\n }", "public function getNewMail()\n {\n return $this->get(self::_NEW_MAIL);\n }", "public function smtp_enviar_email(){\n\n //inicializo a classe do PHPMailer\n $mail \t= \tnew PHPMailer();\n\n //defino os parametros que vou utilizar\n $body\t\t\t\t= $this->mensagem;\n $emailsender\t\t= $this->smtp_email;\n $nomesender\t\t\t= $this->enviadopor;\n $destino\t\t\t= $this->destino;\n $assunto\t\t\t= $this->assunto;\n\n $mail->IsSMTP(); \t\t\t\t\t\t\t\t\t\t// telling the class to use SMTP\n $mail->Host \t= $this->smtp;\t\t\t\t\t\t// SMTP server\n $mail->SMTPDebug \t= 1; \t\t\t// enables SMTP debug information (for testing)\n $mail->SMTPAuth \t= true; \t\t\t// enable SMTP authentication\n $mail->Port \t= $this->smtp_port; // set the SMTP port\n $mail->Username \t= $this->smtp_email; \t\t\t\t// SMTP account username\n $mail->Password \t= $this->smtp_senha; \t\t // SMTP account password\n $mail->CharSet \t\t= 'UTF-8';\n\n //crio o corpo HTML p/ o envio da mensagem\n $corpo = $this->create_html_email();\n\n $mail->From \t = $this->smtp_email;\n $mail->FromName = $nomesender;\n\n $mail->Subject = $this->assunto;\n $mail->AltBody = \"Caso não visualize essa mensagem entre em contato conosco.\";\n\n\n $mail->MsgHTML($corpo);\n $mail->AddReplyTo($this->replay_mail, $this->replay_name);\n\n\n $mail->AddAddress($destino[0]['email'], $destino[0]['nome']);\n //crio um contador p/ enviar os e-mails em cópia\n if(count($destino) > 1){\n unset($destino[0]);\n foreach($destino as $valor){\n $mail->AddBCC($valor['email'], $valor['nome']);\n }\n }\n\n if($mail->Send()){\n echo $this->alert_toast(1);\n }else{\n echo $this->alert_toast(0);\n }\n\n return;\n }", "public static function composeEmailAddress( ezcMailAddress $item )\r\n {\r\n $name = trim( $item->name );\r\n if ( $name !== '' )\r\n {\r\n // remove the quotes around the name part if they are already there\r\n if ( $name{0} === '\"' && $name{strlen( $name ) - 1} === '\"' )\r\n {\r\n $name = substr( $name, 1, -1 );\r\n }\r\n\r\n // add slashes to \" and \\ and surround the name part with quotes\r\n if ( strpbrk( $name, \",@<>:;'\\\"\" ) !== false )\r\n {\r\n $name = str_replace( '\\\\', '\\\\\\\\', $name );\r\n $name = str_replace( '\"', '\\\"', $name );\r\n $name = \"\\\"{$name}\\\"\";\r\n }\r\n\r\n switch ( strtolower( $item->charset ) )\r\n {\r\n case 'us-ascii':\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n\r\n case 'iso-8859-1': case 'iso-8859-2': case 'iso-8859-3': case 'iso-8859-4':\r\n case 'iso-8859-5': case 'iso-8859-6': case 'iso-8859-7': case 'iso-8859-8':\r\n case 'iso-8859-9': case 'iso-8859-10': case 'iso-8859-11': case 'iso-8859-12':\r\n case 'iso-8859-13': case 'iso-8859-14': case 'iso-8859-15' :case 'iso-8859-16':\r\n case 'windows-1250': case 'windows-1251': case 'windows-1252':\r\n case 'utf-8':\r\n if ( strpbrk( $name, \"\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff\" ) === false )\r\n {\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n // break intentionally missing\r\n\r\n default:\r\n $preferences = array(\r\n 'input-charset' => $item->charset,\r\n 'output-charset' => $item->charset,\r\n 'scheme' => 'Q',\r\n 'line-break-chars' => ezcMailTools::lineBreak()\r\n );\r\n $name = iconv_mime_encode( 'dummy', $name, $preferences );\r\n $name = substr( $name, 7 ); // \"dummy: \" + 1\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n $text = $item->email;\r\n }\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns the array $items consisting of ezcMailAddress objects\r\n * as one RFC822 compliant address string.\r\n *\r\n * Set foldLength to control how many characters each line can have before a line\r\n * break is inserted according to the folding rules specified in RFC2822.\r\n *\r\n * @param array(ezcMailAddress) $items\r\n * @param int $foldLength\r\n * @return string\r\n */\r\n public static function composeEmailAddresses( array $items, $foldLength = null )\r\n {\r\n $textElements = array();\r\n foreach ( $items as $item )\r\n {\r\n $textElements[] = ezcMailTools::composeEmailAddress( $item );\r\n }\r\n\r\n if ( $foldLength === null ) // quick version\r\n {\r\n return implode( ', ', $textElements );\r\n }\r\n\r\n $result = \"\";\r\n $charsSinceFold = 0;\r\n foreach ( $textElements as $element )\r\n {\r\n $length = strlen( $element );\r\n if ( ( $charsSinceFold + $length + 2 /* comma, space */ ) > $foldLength )\r\n {\r\n // fold last line if there is any\r\n if ( $result != '' )\r\n {\r\n $result .= \",\" . ezcMailTools::lineBreak() .' ';\r\n $charsSinceFold = 0;\r\n }\r\n $result .= $element;\r\n }\r\n else\r\n {\r\n if ( $result == '' )\r\n {\r\n $result = $element;\r\n }\r\n else\r\n {\r\n $result .= ', ' . $element;\r\n }\r\n }\r\n $charsSinceFold += $length + 1 /*space*/;\r\n }\r\n return $result;\r\n }\r\n\r\n /**\r\n * Returns an ezcMailAddress object parsed from the address string $address.\r\n *\r\n * You can set the encoding of the name part with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddress will asume that\r\n * the name part is mime encoded.\r\n *\r\n * This method does not perform validation. It will also accept slightly\r\n * malformed addresses.\r\n *\r\n * If the mail address given can not be decoded null is returned.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddress( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $address\r\n * @param string $encoding\r\n * @return ezcMailAddress\r\n */\r\n public static function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n // we don't care about the \"group\" part of the address since this is not used anywhere\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }\r\n\r\n /**\r\n * Returns an array of ezcMailAddress objects parsed from the address string $addresses.\r\n *\r\n * You can set the encoding of the name parts with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddresses will asume that\r\n * the name parts are mime encoded.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddresses( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $addresses\r\n * @param string $encoding\r\n * @return array(ezcMailAddress)\r\n */\r\n public static function parseEmailAddresses( $addresses, $encoding = \"mime\" )\r\n {\r\n $addressesArray = array();\r\n $inQuote = false;\r\n $last = 0; // last hit\r\n $length = strlen( $addresses );\r\n for ( $i = 0; $i < $length; $i++ )\r\n {\r\n if ( $addresses[$i] == '\"' )\r\n {\r\n $inQuote = !$inQuote;\r\n }\r\n else if ( $addresses[$i] == ',' && !$inQuote )\r\n {\r\n $addressesArray[] = substr( $addresses, $last, $i - $last );\r\n $last = $i + 1; // eat comma\r\n }\r\n }\r\n\r\n // fetch the last one\r\n $addressesArray[] = substr( $addresses, $last );\r\n\r\n $addressObjects = array();\r\n foreach ( $addressesArray as $address )\r\n {\r\n $addressObject = self::parseEmailAddress( $address, $encoding );\r\n if ( $addressObject !== null )\r\n {\r\n $addressObjects[] = $addressObject;\r\n }\r\n }\r\n\r\n return $addressObjects;\r\n }\r\n\r\n /**\r\n * Returns an unique message ID to be used for a mail message.\r\n *\r\n * The hostname $hostname will be added to the unique ID as required by RFC822.\r\n * If an e-mail address is provided instead, the hostname is extracted and used.\r\n *\r\n * The formula to generate the message ID is: [time_and_date].[process_id].[counter]\r\n *\r\n * @param string $hostname\r\n * @return string\r\n */\r\n public static function generateMessageId( $hostname )\r\n {\r\n if ( strpos( $hostname, '@' ) !== false )\r\n {\r\n $hostname = strstr( $hostname, '@' );\r\n }\r\n else\r\n {\r\n $hostname = '@' . $hostname;\r\n }\r\n return date( 'YmdGHjs' ) . '.' . getmypid() . '.' . self::$idCounter++ . $hostname;\r\n }\r\n\r\n /**\r\n * Returns an unique ID to be used for Content-ID headers.\r\n *\r\n * The part $partName is default set to \"part\". Another value can be used to provide,\r\n * for example, a file name of a part. $partName will be encoded with base64 to be\r\n * compliant with the RFCs.\r\n *\r\n * The formula used is [base64( $partName )].\"@\".[time].[counter]\r\n *\r\n * @param string $partName\r\n * @return string\r\n */\r\n public static function generateContentId( $partName = \"part\" )\r\n {\r\n return str_replace( array( '=', '+', '/' ), '', base64_encode( $partName ) ) . '@' . date( 'His' ) . self::$idCounter++;\r\n }\r\n\r\n /**\r\n * Sets the endLine $character(s) to use when generating mail.\r\n * The default is to use \"\\r\\n\" as specified by RFC 2045.\r\n *\r\n * @param string $characters\r\n */\r\n public static function setLineBreak( $characters )\r\n {\r\n self::$lineBreak = $characters;\r\n }\r\n\r\n /**\r\n * Returns one endLine character.\r\n *\r\n * The default is to use \"\\n\\r\" as specified by RFC 2045.\r\n *\r\n * @return string\r\n */\r\n public static function lineBreak()\r\n {\r\n // Note, this function does deliberately not\r\n // have a $count parameter because of speed issues.\r\n return self::$lineBreak;\r\n }\r\n\r\n /**\r\n * Decodes mime encoded fields and tries to recover from errors.\r\n *\r\n * Decodes the $text encoded as a MIME string to the $charset. In case the\r\n * strict conversion fails this method tries to workaround the issues by\r\n * trying to \"fix\" the original $text before trying to convert it.\r\n *\r\n * @param string $text\r\n * @param string $charset\r\n * @return string\r\n */\r\n public static function mimeDecode( $text, $charset = 'utf-8' )\r\n {\r\n $origtext = $text;\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // something went wrong while decoding, let's see if we can fix it\r\n // Try to fix lower case hex digits\r\n $text = preg_replace_callback(\r\n '/=(([a-f][a-f0-9])|([a-f0-9][a-f]))/',\r\n create_function( '$matches', 'return strtoupper($matches[0]);' ),\r\n $origtext\r\n );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Workaround a bug in PHP 5.1.0-5.1.3 where the \"b\" and \"q\" methods\r\n // are not understood (but only \"B\" and \"Q\")\r\n $text = str_replace( array( '?b?', '?q?' ), array( '?B?', '?Q?' ), $origtext );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Try it as latin 1 string\r\n $text = preg_replace( '/=\\?([^?]+)\\?/', '=?iso-8859-1?', $origtext );\r\n $text = iconv_mime_decode( $text, 0, $charset );\r\n\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns a new mail object that is a reply to the current object.\r\n *\r\n * The new mail will have the correct to, cc, bcc and reference headers set.\r\n * It will not have any body set.\r\n *\r\n * By default the reply will only be sent to the sender of the original mail.\r\n * If $type is set to REPLY_ALL, all the original recipients will be included\r\n * in the reply.\r\n *\r\n * Use $subjectPrefix to set the prefix to the subject of the mail. The default\r\n * is to prefix with 'Re: '.\r\n *\r\n * @param ezcMail $mail\r\n * @param ezcMailAddress $from\r\n * @param int $type REPLY_SENDER or REPLY_ALL\r\n * @param string $subjectPrefix\r\n * @param string $mailClass\r\n * @return ezcMail\r\n */\r\n static public function replyToMail( ezcMail $mail, ezcMailAddress $from,\r\n $type = self::REPLY_SENDER, $subjectPrefix = \"Re: \",\r\n $mailClass = \"ezcMail\" )\r\n {\r\n $reply = new $mailClass();\r\n $reply->from = $from;\r\n\r\n // To = Reply-To if set\r\n if ( $mail->getHeader( 'Reply-To' ) != '' )\r\n {\r\n $reply->to = ezcMailTools::parseEmailAddresses( $mail->getHeader( 'Reply-To' ) );\r\n }\r\n else // Else To = From\r\n\r\n {\r\n $reply->to = array( $mail->from );\r\n }\r\n\r\n if ( $type == self::REPLY_ALL )\r\n {\r\n // Cc = Cc + To - your own address\r\n $cc = array();\r\n foreach ( $mail->to as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n foreach ( $mail->cc as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n $reply->cc = $cc;\r\n }\r\n\r\n $reply->subject = $subjectPrefix . $mail->subject;\r\n\r\n if ( $mail->getHeader( 'Message-Id' ) )\r\n {\r\n // In-Reply-To = Message-Id\r\n $reply->setHeader( 'In-Reply-To', $mail->getHeader( 'Message-ID' ) );\r\n\r\n // References = References . Message-Id\r\n if ( $mail->getHeader( 'References' ) != '' )\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' )\r\n . ' ' . $mail->getHeader( 'Message-ID' ) );\r\n }\r\n else\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'Message-ID' ) );\r\n }\r\n }\r\n else // original mail is borked. Let's support it anyway.\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' ) );\r\n }\r\n\r\n return $reply;\r\n }\r\n\r\n /**\r\n * Guesses the content and mime type by using the file extension.\r\n *\r\n * The content and mime types are returned through the $contentType\r\n * and $mimeType arguments.\r\n * For the moment only for image files.\r\n *\r\n * @param string $fileName\r\n * @param string $contentType\r\n * @param string $mimeType\r\n */\r\n static public function guessContentType( $fileName, &$contentType, &$mimeType )\r\n {\r\n $extension = strtolower( pathinfo( $fileName, PATHINFO_EXTENSION ) );\r\n switch ( $extension )\r\n {\r\n case 'gif':\r\n $contentType = 'image';\r\n $mimeType = 'gif';\r\n break;\r\n\r\n case 'jpg':\r\n case 'jpe':\r\n case 'jpeg':\r\n $contentType = 'image';\r\n $mimeType = 'jpeg';\r\n break;\r\n\r\n case 'png':\r\n $contentType = 'image';\r\n $mimeType = 'png';\r\n break;\r\n\r\n case 'bmp':\r\n $contentType = 'image';\r\n $mimeType = 'bmp';\r\n break;\r\n\r\n case 'tif':\r\n case 'tiff':\r\n $contentType = 'image';\r\n $mimeType = 'tiff';\r\n break;\r\n\r\n default:\r\n return false;\r\n }\r\n return true;\r\n }\r\n}", "public function createEmail($subject, $body, $recipients, $attachements = []): Mail\n {\n return $this->mailBuilder->createEmailEntity($subject, $body, $recipients, $attachements);\n }", "public function toMail($notifiable)\n {\n $today = Carbon::today(config('dotcfp.timezone'));\n $lastSubmissionDate = Carbon::createFromFormat('Y-m-d', config('dotcfp.cfp_end_date'), config('dotcfp.timezone'))->endOfDay();\n\n if ($lastSubmissionDate->isYesterday()) {\n throw new \\LogicException('CFP submissions has been ended.');\n }\n\n if ($lastSubmissionDate->isToday()) {\n $subject = sprintf('Today is the last day for %s CFP Submissions', config('dotcfp.event_name'));\n } else {\n $subject = sprintf('Last %d days for %s CFP Submissions', (int)ceil($lastSubmissionDate->diffInHours($today) / 24), config('dotcfp.event_name'));\n }\n\n return (new MailMessage)\n ->subject($subject)\n ->greeting(sprintf('Hello, %s', $this->userName))\n ->line(sprintf('You are registered but haven\\'t send your proposal(s) yet. %s submissions were accepted until %s. Please get involved!', config('dotcfp.event_name'), (new \\DateTime(config('dotcfp . cfp_end_date')))->format('M d, Y')))\n ->action('Submit your talk(s)!', route('talks.create'));\n }", "public function getMailFactory()\n {\n return $this->mailFactory;\n }", "function clsRecordemails2()\r\n\r\n {\r\n\r\n\r\n\r\n global $FileName;\r\n\r\n $this->Visible = true;\r\n\r\n $this->Errors = new clsErrors();\r\n\r\n $this->ds = new clsemails2DataSource();\r\n\r\n $this->UpdateAllowed = false;\r\n\r\n $this->DeleteAllowed = false;\r\n\r\n if($this->Visible)\r\n\r\n {\r\n\r\n $this->ComponentName = \"emails2\";\r\n\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n\r\n $this->subject = new clsControl(ccsTextBox, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n\r\n $this->subject->Required = true;\r\n\r\n $this->message = new clsControl(ccsTextArea, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n\r\n $this->Insert = new clsButton(\"Insert\");\r\n\r\n $this->Cancel = new clsButton(\"Cancel\");\r\n\r\n $this->to_user_id = new clsControl(ccsHidden, \"to_user_id\", \"To User Id\", ccsInteger, \"\", CCGetRequestParam(\"to_user_id\", $Method));\r\n\r\n $this->from_user_id = new clsControl(ccsHidden, \"from_user_id\", \"From User Id\", ccsInteger, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n\r\n $this->emaildate = new clsControl(ccsHidden, \"emaildate\", \"date\", ccsInteger, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n\r\n $this->been_read = new clsControl(ccsHidden, \"been_read\", \"Been Read\", ccsInteger, \"\", CCGetRequestParam(\"been_read\", $Method));\r\n\r\n }\r\n\r\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \n\t\t\t\tglobal $error;\n\t\t\t\n\t\t\t\t$nome_completo = $Nome.\"\".$Sobrenome;\n\t\t\t\t$mail = new PHPMailer(true);\n\t\t\t\t$mail->CharSet = 'UTF-8';\n\t\t\t\t$phpmail->Body = utf8_decode($body);\n\t\t\t\t$mail->IsHTML(true);\n\t\t\t\t$mail->IsSMTP();\t\t// Ativar SMTP\n\t\t\t\t$mail->SMTPDebug = 0;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\n\t\t\t\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\n\t\t\t\t$mail->SMTPSecure = 'tls';\t// SSL REQUERIDO pelo GMail\n\t\t\t\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\n\t\t\t\t$mail->Port = 587; \t\t// A porta 587 deverá estar aberta em seu servidor\n\t\t\t\t$mail->Username = GUSER;\n\t\t\t\t$mail->Password = GPWD;\n\t\t\t\t$mail->From = \"[email protected]\";\n\t\t\t\t$mail->FromName = \"Kepler\";\n\t\t\t\t$mail->Subject = $assunto;\n\t\t\t\t$mail->Body = $corpo;\n\t\t\t\t$mail->AddEmbeddedImage('imagens/logo.png', 'logoimg');\n\n\t\t\t\t$mail->Body = '\n\t\t\t\t\t\t\t\t\t<style type = \"text/css\">\n\t\t\t\t\t\t\t\t\t#mae{\n\t\t\t\t\t\t\t\t\t\tbackground-color: white;\n\t\t\t\t\t\t\t\t\t\twidth:700px;\n\t\t\t\t\t\t\t\t\t\theight:600px;\n\t\t\t\t\t\t\t\t\t\tborder-style: none;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t#topo{\n\t\t\t\t\t\t\t\t\t\tbackground-color: black;\n\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\theight: 72px;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t#corpo_email{\n\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\tmargin-left: 60px;\n\t\t\t\t\t\t\t\t\t\tmargin-top: 50px;\n\t\t\t\t\t\t\t\t\t\ttext-align: left;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t.botao{\n\t\t\t\t\t\t\t\t\t\tbackground-color: #4CAF50;\n\t\t\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\t\t\tcolor: white;\n\t\t\t\t\t\t\t\t\t\tpadding: 15px 32px;\n\t\t\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\t\t\ttext-decoration: none;\n\t\t\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\t\t\t\tmargin: 4px 2px;\n\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t#link{\n\t\t\t\t\t\t\t\t\t\tfloat: center;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</style>\n\t\t\t\t\t\t\t\t<html lang = \"pt-br\">\n\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t<meta charset = \"utf-8\">\n\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t\talçfjkaslçdf\n\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t</html>\n\t\t\t\t\t\t\t\t';\n\t\t\t\t$phpmail->Body = utf8_decode($body);\n\t\t\t\t$mail->AddAddress($para);\n\t\t\t\t$mail->Send();\t\t\t\n\t\t\t}", "function supermailer ($h) {\r\n $mail_addheaders = array();\r\n $mail_addheaders[] = 'From: '.$h['from'];\r\n $h['replyto'] == ''? $h['from']:$h['replyto']; # avoid anti-spam\r\n $mail_addheaders[] = 'Reply-To: '.$h['replyto'];\r\n if ($h['bcc'])\r\n $mail_addheaders[] = 'Bcc: '.$h['bcc'];\r\n $mail_addheaders[] = 'X-Mailer: '.(($GLOBALS['mail_xmailer'] == '')? 'supermailer/dsw/sh/2004': $GLOBALS['mail_xmailer']);\r\n $mail_addheaders_str = join(\"\\r\\n\",$mail_addheaders);\r\n #~ echo $mail_addheaders_str;exit;\r\n\r\n $mail_body = $h['body'];\r\n $mail_to = $h['to'];\r\n $mail_subject = $h['subject'];\r\n\r\n # Some MTA confuse \\r\\n and translate it to \\n\\n, causing double lines. This will makes them happy:\r\n $mail_addheaders_str = str_replace(\"\\r\\n\", \"\\n\", $mail_addheaders_str);\r\n $mail_body = str_replace(\"\\r\\n\", \"\\n\", $mail_body);\r\n\r\n return mail($mail_to, $mail_subject, $mail_body, $mail_addheaders_str);\r\n\r\n}", "function pmail($m, $r)\n{\n $mail = new PHPMailer(true);\n\n try {\n //Server settings\n $mail->SMTPDebug = false;\n $mail->isSMTP();\n $mail->Host = 'smtp.gmail.com';\n $mail->CharSet = 'UTF-8';\n $mail->SMTPAuth = true;\n $mail->Username = '[email protected]';\n $mail->Password = 'peerlessmag33'; // SMTP password\n $mail->SMTPSecure = 'ssl';\n $mail->Port = 465;\n\n\n //Recipients \n $mail->setFrom('[email protected]', 'Example');\n \n \n $mail->addReplyTo('[email protected]');\n \n $mail->addAddress($r['mail'], $r['name']); // Add a recipient\n\n\n // Attachments\n //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n\n\n\n // $mail->AddEmbeddedImage('files/source/main.png', 'logo','main');\n\n $mail->isHTML(true);\n\n if ($m['mess'] == \"issue1\") {\n $message = $m['content'];\n } else if ($m['mess'] == \"confirm\" || $m['mess'] == \"recovery\") {\n // Content\n $message = '<style type=\"text/css\">\n title{text-align:center;}\n </style>\n <table width=\"100%\" style=\"text-align:center;\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td>\n <table cellspacing=\"0\" cellpadding=\"0\" style=\"margin:auto;\">\n <tr>\n <td width=\"100%\" align=\"center\" style=\"border-radius: 2px;\">\n <a href=\"\" target=\"_blank\" style=\" border-radius: 2px;display:block;margin:auto;text-align:center;color:#fff;\">\n <img alt=\"portal\" src=\"\" \n width=\"200px\" style=\"display: block;margin:auto;\"> \n </a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\n<table style=\"width:100%;text-align:center;\">\n <tr>\n <td>\n <h1 style=\"padding:4px;border-radius: 2px;font-family: Georgia;color: #000000;text-decoration: none;\"><style>table{width:100%;text-align:center;}</style>' . (($m['mess'] == \"confirm\") ? \"Confirm Your Email Address\" : \"Recover Your Password\") . '</h1>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>\n \n \n <table width=\"100%\" style=\"text-align:center;\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">Your ' . (($m['mess'] == \"confirm\") ? \"confirmation\" : \"Recovery\") . ' code is below - enter it into your open browser or click on the link</span>\n <br></br>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">Please enter the code exactly how it is here into your browser</span>\n <td></tr>\n </table>\n </td>\n</tr>\n </table>\n<br></br>\n<br></br>\n<br></br> \n<table width=\"100%\" style=\"text-align:center;\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"text-align:center;\" width=\"100%\">\n<tr>\n <td align=\"center\" valign=\"middle\" style=\"\">\n <a target=\"_blank\" href=' . $m['url'] . ' style=\"background-color:#ffa500; display: block; padding: 12px;max-width:700px; text-transform: capitalize;text-align:center;border-radius: 2px;font-family: Georgia;font-weight: 500; font-size: 14px;color:#ffffff;text-decoration: none;\">' . (($m['mess'] == \"confirm\") ? \"confirmation\" : \"Recovery\") . '</a>\n </td>\n</tr>\n </td>\n </table>\n</tr>\n </table>\n\n<br></br>\n\n<table width=\"100%\" style=\"text-align:center;\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">If you didn\\'t request this email, there\\'s nothing to worry about - you can safely ignore it.</span>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>'; //end herrre\n } else if ($m['mess'] == \"save\") {\n $message = '\n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td>\n <table cellspacing=\"0\" cellpadding=\"0\" style=\"margin:auto;\">\n <tr>\n <td align=\"center\" style=\"border-radius: 2px;\">\n <a href=\"/link/\" target=\"_blank\" style=\"padding: 8px 12px; border-radius: 2px;font-family: Helvetica, Arial, sans-serif;margin:auto;color: #ffffff;text-align:center;text-decoration: none;\">\n <img src=\"/link/\" width=\"200px\" style=\"display: block;\n margin:auto;\"> \n </a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\n<table style=\"width:100%;text-align:center;\">\n <tr>\n <td>\n <style>table{width:100%;text-align:center;}</style>\n <h1 style=\"padding:4px;border-radius: 2px;font-family: Georgia;color: #000000;text-decoration: none;\">Profile Changes</h1>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>\n \n \n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">Hello You Made Changes To Your Profile Earlier...Click The Link Below To Save Your Settings</span>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>\n<br></br>\n<br></br>\n<br></br> \n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table width=\"100%\">\n<tr>\n <td align=\"center\" valign=\"middle\" style=\"\">\n <a target=\"_blank\" href=' . $m['url'] . ' style=\"background-color:#ffa500; display: block; padding: 12px;max-width:700px; text-transform: capitalize;text-align:center;border-radius: 3px;font-family: Georgia;font-weight: 500; font-size: 14px;color:#ffffff;text-decoration: none; font-style: normal; \">Save Settings</a>\n </td>\n</tr>\n </td>\n </table>\n</tr>\n </table>\n\n<br></br>\n<br></br>\n\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">If you didn\\'t request this email, there\\'s nothing to worry about - you can safely ignore it.</span>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>'; //end herrre\n\n } else if ($m['mess'] == \"notify\") {\n\n $message = '\n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td>\n <table cellspacing=\"0\" cellpadding=\"0\" style=\"margin:auto;\">\n <tr>\n <td width=\"100%\" align=\"center\" style=\"border-radius: 2px;\">\n <a href=\"/link/\" target=\"_blank\" style=\" border-radius: 2px;display:block;margin:auto;text-align:center;color:#fff;\">\n <img alt=\"/link/\" src=\"/link/\" width=\"200px\" style=\"display: block;margin:auto;\"> \n </a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\n<table style=\"width:100%;text-align:center;\">\n <tr>\n <td>\n \n <h1 style=\"padding:4px;border-radius: 2px;font-family: Georgia;color: #000000;text-decoration: none;\">New Articles Ready For Review<style>table{width:100%;text-align:center;}</style></h1>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>\n\n <br></br>\n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">Hello ' . $r['name'] . ' You Have Up To 5 or More Waiting For Your Approval Click On The Button Below To Login.</span>\n\n<br></br>\n<br></br>\n\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table width=\"100%\">\n<tr>\n <td align=\"center\" valign=\"middle\" style=\"\">\n <a target=\"_blank\" href=' . $m['url'] . ' style=\"background-color:#ffa500; display: block; padding: 12px;max-width:700px; text-transform: capitalize;text-align:center;border-radius: 2px;font-family: Georgia;font-weight: 500; font-size: 14px;color:#ffffff;text-decoration: none; font-style: normal;\">Login</a>\n </td>\n</tr>\n </td>\n </table>\n</tr>\n </table>\n\n<br></br>\n<br></br>\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n <td>\n <table style=\"margin:auto;\">\n <tr>\n <td>\n <span style=\"padding:4px;border-radius: 2px;font-family: Georgia;font-size: 18px; color: #000000;text-decoration: none;\">If this email doesn\\'t seem familiar to you, there\\'s nothing to worry about - you can safely ignore it.</span>\n <td></tr>\n </td>\n </table>\n</tr>\n </table>';\n\n } else if ($m['mess'] == \"ninfo\") {\n $message = $m['info'];\n }\n $mail->Subject = $m['subject'];\n $mail->Body = $message;\n $mail->send();\n return true;\n } catch (Exception $e) {\n return false;\n }\n}", "public function toMail($notifiable)\n\t{\n\t return (new PageCreatedMail($this->page))->to($notifiable->email);\n\t}", "function enviaCorreo($nombre, $correo)\n{\n //Determinar horario y zona\n date_default_timezone_set('America/Mexico_City');\n setlocale(LC_TIME, 'es_MX.UTF-8');\n $fecha_hora = date(\"Y-m-d H:i:s\");\n require(\"./lib-mail/class.phpmailer.php\");\n $mail = new PHPMailer();\n $mail->IsSMTP();\n $mail->CharSet = 'UTF-8';\n\n $contacto = \"[email protected]\";\n $pwd_contacto = \"holaMundo123\";\n $para = $correo; //Para enviar el correo al que se anuncia\n\n //Asignar al host que manejaremos\n $mail->Host = \"smtp.hostinger.com\";\n $mail->SMTPAuth = true;\n $mail->Username = $contacto;//Correo electronico para SMTP\n $mail->Password = $pwd_contacto;//Contraseña para SMTP\n\n //destino\n $mail->From = $contacto;\n $mail->FromName = 'Portal Autos Torres';\n $mail->AddAddress($para);\n //opcional\n $mail->addCC('[email protected]');\n\n $mail->Port = 587;\n $mail->IsHTML(true);\n $mail->Subject = \"Gracias por contactarnos\";\n $mail->Body = '\n <div style=\"background-color:#f4f4f4\">\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\"></span> \n <div style=\"Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0px;padding-top:0px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;word-break:break-word\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:collapse;border-spacing:0px\">\n <tbody>\n <tr>\n <td style=\"width:600px\">\n <a href=\"https://houselink.info\" target=\"_blank\" data-saferedirecturl=\"https://www.google.com/url?q=https://houselink.info\">\n <img alt=\"\" height=\"auto\" src=\"https://ci4.googleusercontent.com/proxy/Po-LEee6KkQ92jHbvXJOCjdUxW2gKhzL8ZJB09VrOLxrLnpRqx-6_aiyPFHZsRM5tKrOAUer8wr2f522e0wEC8Q=s0-d-e1-ft#http://kj1x.mjt.lu/img/kj1x/b/lmnt4/mwtmx.jpeg\" style=\"border:none;border-radius:px;display:block;outline:none;text-decoration:none;height:auto;width:100%\" title=\"\" width=\"600\" class=\"CToWUd\">\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0px 20px 0px;padding-bottom:5px;padding-top:5px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:0px 25px 0px 25px;padding-top:5px;padding-bottom:0px;word-break:break-word\">\n <div style=\"font-family:Arial,sans-serif;font-size:13px;line-height:22px;text-align:left;color:#55575d\">\n <h1 style=\"font-size:20px;font-weight:bold\"><span style=\"font-size:16px\">Xin chào ${user},</span></h1>\n </div>\n </td>\n </tr>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:0px 25px 0px 25px;padding-top:0px;padding-bottom:0px;word-break:break-word\">\n <div style=\"font-family:Arial,sans-serif;font-size:13px;line-height:22px;text-align:left;color:#55575d\">\n <p style=\"font-size:13px;margin:10px 0\">${message}</p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0px;padding-top:0px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:0px 25px 0px 25px;padding-top:5px;padding-bottom:0px;word-break:break-word\">\n </td>\n </tr>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:0px 25px 0px 25px;padding-top:0px;padding-bottom:0px;word-break:break-word\">\n <div style=\"font-family:Arial,sans-serif;font-size:13px;line-height:22px;text-align:left;color:#55575d\">\n ${customArea}\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:1px;padding-top:10px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:10px 25px;padding-top:5px;padding-right:20px;padding-bottom:5px;padding-left:20px;word-break:break-word\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:separate;line-height:100%\">\n <tbody>\n <tr>\n <td align=\"center\" bgcolor=\"#1675A9\" role=\"presentation\" style=\"border:1px solid #e7e7e7;border-radius:3px;padding:10px 15px 10px 15px;background:#1675a9\" valign=\"middle\">\n <p style=\"background:#1675a9;color:#ffffff;font-family:Arial,sans-serif;font-size:13px;font-weight:normal;line-height:120%;Margin:0;text-decoration:none;text-transform:none\">\n <a href=\"https://houselink.info\" style=\"color:#ffffff;text-decoration:none;\"><span style=\"color:#ffffff;\"><b>Truy cập HOUSELINK</b></span></a>\n </p>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:10px;padding-top:1px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td style=\"font-size:0px;padding:10px 25px;padding-right:0px;padding-left:0px;word-break:break-word\">\n <p style=\"border-top:solid 2px #e7e7e7;font-size:1;margin:0px auto;width:100%\">\n </p>\n </td>\n </tr>\n <tr>\n <td align=\"left\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;padding-bottom:0px;word-break:break-word\">\n <div style=\"font-family:Arial,sans-serif;font-size:13px;line-height:22px;text-align:left;color:#55575d\">\n <p style=\"font-size:13px;line-height:8px;margin:10px 0\"><b>HOUSELINK JSC.,</b></p>\n <p style=\"font-size:13px;line-height:8px;margin:10px 0\">Level 9, Sannam tower, 78 Duy Tan St,&nbsp;Cau Giay Dist , Hanoi, Vietnam</p>\n <p style=\"font-size:13px;line-height:8px;margin:10px 0\">T:&nbsp;(84-24) 3795 5620 | F:&nbsp;(84-24) 3795 5620</p>\n <p style=\"font-size:13px;line-height:8px;margin:10px 0\">E: <a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a></p>\n <p style=\"font-size:13px;line-height:8px;margin:10px 0\"><u>Terms of Use</u>&nbsp;|&nbsp;<u>Privacy Policy©</u>&nbsp;</p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"Margin:0px auto;max-width:600px\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width:100%\">\n <tbody>\n <tr>\n <td style=\"direction:ltr;font-size:0px;padding:20px 0px 20px 0px;padding-bottom:0px;padding-top:0px;text-align:center;vertical-align:top\">\n <div class=\"m_2518046461046522955mj-column-per-100 m_2518046461046522955outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" style=\"font-size:0px;padding:0px 20px 0px 20px;padding-top:0px;padding-right:15px;padding-bottom:0px;word-break:break-word\">\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n ';\n return $mail->Send();\n}", "public function getMailMIME()\n {\n $result = '';\n $ismultipart = true;\n switch ($this->message_type) {\n case 'inline':\n $result .= $this->headerLine('Content-Type', 'multipart/related;');\n $result .= $this->textLine(\"\\tboundary=\\\"\" . $this->boundary[1] . '\"');\n break;\n case 'attach':\n case 'inline_attach':\n case 'alt_attach':\n case 'alt_inline_attach':\n $result .= $this->headerLine('Content-Type', 'multipart/mixed;');\n $result .= $this->textLine(\"\\tboundary=\\\"\" . $this->boundary[1] . '\"');\n break;\n case 'alt':\n case 'alt_inline':\n $result .= $this->headerLine('Content-Type', 'multipart/alternative;');\n $result .= $this->textLine(\"\\tboundary=\\\"\" . $this->boundary[1] . '\"');\n break;\n default:\n // Catches case 'plain': and case '':\n $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);\n $ismultipart = false;\n break;\n }\n // RFC1341 part 5 says 7bit is assumed if not specified\n if ($this->Encoding != '7bit') {\n // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE\n if ($ismultipart) {\n if ($this->Encoding == '8bit') {\n $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');\n }\n // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible\n } else {\n $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);\n }\n }\n\n if ($this->Mailer != 'mail') {\n $result .= $this->LE;\n }\n\n return $result;\n }", "private static function mail()\n {\n $files = ['Mail', 'Mailable', 'SMTP'];\n $folder = static::$root.'Mailing'.'/';\n\n self::call($files, $folder);\n\n $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];\n $folder = $folder.'Exceptions/';\n\n self::call($files, $folder);\n }", "public function compileFullEmail( $to, $cc=array(), $bcc=array(), $fromEmail = NULL, $fromName = NULL, $additionalHeaders = array(), $eol = \"\\r\\n\" )\n\t{\t\t\n\t\t$boundary = \"--==_mimepart_\" . md5( uniqid() );\n\t\t\n\t\t$return = '';\n\t\t\n\t\tforeach ( $this->_compileHeaders( $this->compileSubject( static::_getMemberFromRecipients( $to ) ), $to, $cc, $bcc, $fromEmail, $fromName, $additionalHeaders, $boundary ) as $k => $v )\n\t\t{\n\t\t\t$return .= \"{$k}: {$v}{$eol}\";\n\t\t}\n\t\t\n\t\t$return .= $eol;\n\t\t$return .= $eol;\n\t\t\n\t\t$return .= $this->_compileMessage( static::_getMemberFromRecipients( $to ), $boundary, $eol );\n\t\t\n\t\treturn $return;\n\t}", "private function composeBookingMailForCreator($a_user_id) {\r\n\t\t$lng = $this->lng;\r\n\r\n\t\t$this->initLanguage($a_user_id);\r\n\t\t$this->initMail();\r\n\t\t$this->setSubject($this->lng->txt('rep_robj_xrs_mail_booking_creator_subject'));\r\n\t\t$this->setBody(ilMail::getSalutation($a_user_id, $this->getLanguage()));\r\n\t\t$this->appendBody(\"\\n\\n\");\r\n\t\t$this->appendBody($lng->txt('rep_robj_xrs_mail_booking_creator_message') . \"\\n\");\r\n\t\t$this->appendBody($lng->txt('rep_robj_xrs_room') . \" \");\r\n\t\t$this->appendBody($this->s_roomname . \" \");\r\n\t\t$this->appendBody($lng->txt('rep_robj_xrs_from') . \" \");\r\n\t\t$this->appendBody($this->datestart->get(IL_CAL_FKT_DATE, 'd.m.Y H:s') . \" \");\r\n\t\t$this->appendBody($lng->txt('rep_robj_xrs_to') . \" \");\r\n\t\t$this->appendBody($this->dateend->get(IL_CAL_FKT_DATE, 'd.m.Y H:s'));\r\n\t\t$this->appendBody(\"\\n\\n\");\r\n\t\t$this->appendBody(ilMail::_getAutoGeneratedMessageString($this->language));\r\n\t}", "function _build_attachement()\r\n\t\t{\r\n\t\t$this->boundary= \"------------\" . md5( uniqid(\"myboundary\") ); // TODO : variable bound\r\n\r\n\t\t$this->headers .= \"MIME-Version: 1.0\\nContent-Type: multipart/mixed;\\n boundary=\\\"$this->boundary\\\"\\n\\n\";\r\n\t\t$this->fullBody = \"This is a multi-part message in MIME format.\\n--$this->boundary\\nContent-Type: text/plain; charset=utf-8\\n\"\r\n\t\t\t. \"Content-Transfer-Encoding: 7bit\\n\\n\" . $this->body .\"\\n\";\r\n\t\t$sep= chr(13) . chr(10);\r\n\r\n\t\t$ata= array();\r\n\t\t$k=0;\r\n\r\n\t\t// for each attached file, do...\r\n\t\tfor( $i=0; $i < sizeof( $this->aattach); $i++ )\r\n\t\t\t{\r\n\t\t\t$filename = $this->aattach[$i];\r\n\t\t\t$basename = $this->aattachname[$i];\r\n\t\t\t$ctype = $this->actype[$i]; // content-type\r\n\t\t\t$disposition = $this->adispo[$i];\r\n \t\t\tif( ! file_exists( $filename) )\r\n\t\t\t\t{\r\n\t\t\t\techo \"Class Mail, method attach : file $filename can't be found\";\r\n\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t$subhdr= \"--$this->boundary\\nContent-type: $ctype;\\n name=\\\"$basename\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disposition;\\n filename=\\\"$basename\\\"\\n\";\r\n\t\t\t$ata[$k++] = $subhdr;\r\n\t\t\t// non encoded line length\r\n\t\t\t$linesz= filesize( $filename)+1;\r\n\t\t\t$fp= fopen( $filename, 'r' );\r\n\t\t\t$data= base64_encode(fread( $fp, $linesz));\r\n\t\t\tfclose($fp);\r\n\t\t\t$ata[$k++] = chunk_split( $data );\r\n \t}\r\n\t\t$this->attachment= implode($sep, $ata);\r\n\t\t}", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \n\t\t\t\tglobal $error;\n\t\t\t\ttry{\n\t\t\t\t\trequire_once(\"PHPMailer/src/Exception.php\");\n\t\t\t\t\trequire_once(\"PHPMailer/src/PHPMailer.php\");\n\t\t\t\t\trequire_once(\"PHPMailer/src/SMTP.php\");\n\t\t\t\t\t$mail = new PHPMailer(true);\n\t\t\t\t\t$mail->CharSet = 'UTF-8';\n\t\t\t\t\t$phpmail->Body = utf8_decode($body);\n\t\t\t\t\t$mail->IsHTML(true);\n\t\t\t\t\t$mail->IsSMTP();\t\t// Ativar SMTP\n\t\t\t\t\t$mail->SMTPDebug = 0;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\n\t\t\t\t\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\n\t\t\t\t\t$mail->SMTPSecure = 'tls';\t// SSL REQUERIDO pelo GMail\n\t\t\t\t\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\n\t\t\t\t\t$mail->Port = 587; \t\t// A porta 587 deverá estar aberta em seu servidor\n\t\t\t\t\t$mail->Username = GUSER;\n\t\t\t\t\t$mail->Password = GPWD;\n\t\t\t\t\t$mail->From = \"[email protected]\";\n\t\t\t\t\t$mail->FromName = \"Kepler\";\n\t\t\t\t\t$mail->Subject = $assunto;\n\t\t\t\t\t$mail->Body = $corpo;\n\t\t\t\t\t$mail->AddEmbeddedImage('imagens/logo.png', 'logoimg');\n\n\t\t\t\t\t$mail->Body = '\n\t\t\t\t\t\t\t\t\t\t<style type = \"text/css\">\n\t\t\t\t\t\t\t\t\t\t#mae{\n\t\t\t\t\t\t\t\t\t\t\tbackground-color: white;\n\t\t\t\t\t\t\t\t\t\t\twidth:700px;\n\t\t\t\t\t\t\t\t\t\t\theight:600px;\n\t\t\t\t\t\t\t\t\t\t\tborder-style: none;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t#topo{\n\t\t\t\t\t\t\t\t\t\t\tbackground-color: black;\n\t\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\t\theight: 72px;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t#corpo_email{\n\t\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\t\tmargin-left: 60px;\n\t\t\t\t\t\t\t\t\t\t\tmargin-top: 50px;\n\t\t\t\t\t\t\t\t\t\t\ttext-align: left;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t.botao{\n\t\t\t\t\t\t\t\t\t\t\tbackground-color: #4CAF50;\n\t\t\t\t\t\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\t\t\t\t\t\tcolor: white;\n\t\t\t\t\t\t\t\t\t\t\tpadding: 15px 32px;\n\t\t\t\t\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t\t\t\t\t\ttext-decoration: none;\n\t\t\t\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\t\t\t\t\tmargin: 4px 2px;\n\t\t\t\t\t\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t#link{\n\t\t\t\t\t\t\t\t\t\t\tfloat: center;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</style>\n\t\t\t\t\t\t\t\t\t<html lang = \"pt-br\">\n\t\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t\t<meta charset = \"utf-8\">\n\t\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t\t\t<div id = \"mae\"style = \"background-color: white;\n\t\t\t\t\t\t\t\t\t\t\t\twidth:700px;\n\t\t\t\t\t\t\t\t\t\t\t\theight:600px;\n\t\t\t\t\t\t\t\t\t\t\t\tborder-style: none;\">\n\t\t\t\t\t\t\t\t\t\t\t<div id = \"topo\" style = \"background-color: black;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 72px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"cid:logoimg\" width=\"200px\" style = \"float : left\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div id = \"corpo_email\" style = \"width: 700px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin-left: 60px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmargin-top: 50px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttext-align: left;\">\n\t\t\t\t\t\t\t\t\t\t\t\tOlá ' . $GLOBALS['nome'] . ' '.$GLOBALS['sobrenome'].'.\n\t\t\t\t\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\t\t\t\t\tPara confirmar seu cadastro clique no botão abaixo:\n\t\t\t\t\t\t\t\t\t\t\t\t<br><br><center>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"http://200.145.153.172/kepler/Kepler/confirma_email_cadastro?codigo='. $GLOBALS['codigo'] .'\" class = \"botao\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle = \"background-color: #4CAF50; border: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: white; padding: 15px 32px; text-align: center;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttext-decoration: none; display: inline-block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont-size: 16px; margin: 4px 2px; cursor: pointer; margin-left: -30px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tConfirmar cadastro\n\t\t\t\t\t\t\t\t\t\t\t\t</a></center>\n\t\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\tCaso o botão não funcione, utilize o endereço abaixo para confirmar seu cadastro:\n\t\t\t\t\t\t\t\t\t\t\t\t<br><br><br><center>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"http://200.145.153.172/kepler/Kepler/confirma_email_cadastro.php?codigo='. $GLOBALS['codigo'] .'\" id = \"link\" style = \"float: center; margin-left: -20px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\thttp://200.145.153.172/kepler/Kepler/confirma_email_cadastro.php?codigo='. $GLOBALS['codigo'] .'\n\t\t\t\t\t\t\t\t\t\t\t\t</a></center>\n\t\t\t\t\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\t\t\t\t\tEquipe Kepler.\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t<div id = \"topo\" style = \"background-color: black;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: 700px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: 72px;\">\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t\t</html>\n\t\t\t\t\t\t\t\t\t';\n\t\t\t\t\t$phpmail->Body = utf8_decode($body);\n\t\t\t\t\t$mail->AddAddress($para);\n\n\t\t\t\t\tif(!$mail->Send()) {\n\t\t\t\t\t\t$_SESSION['msg_email_retorna'] == \"Erro ao enviar o e-mail\";\n\t\t\t\t\t\t$erro3 = 1;\n\t\t\t\t\t\t//return false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_SESSION['msg_email_retorna'] == \"E-mail enviado com sucesso\";\n\t\t\t\t\t\t//return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (phpmailerException $e) {\n\t\t\t\t\t$_SESSION['msg_email_retorna'] == \"E-mail inserido não existe\";\n\t\t\t\t\t$erro3 = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "function SendEmail($to, $subject, $body, $from=\"\", $cc=\"\", $bcc=\"\", $type=\"text/plain\") {\n global $dbAccess, $smarty;\n\n if ($from) {\n $fromMailcheck = $this->SpamCheck($from);\n if ($fromMailcheck == false) {\n $errorMsg[] = \"Invalid From email address.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n return false;\n }\n }\n\n if ($to) {\n $toMailcheck = $this->SpamCheck($to);\n if ($toMailcheck == false) {\n $errorMsg[] = \"Invalid To email address.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n return false;\n }\n }\n\n $user = $dbAccess->UserLoad(\"UserType = 'admin'\");\n\n $defaultFrom = $user['UserEmail'];\n\n // Bundle up the variables into a structured array for altering.\n $message = array(\n 'to' => $to,\n 'from' => (isset($from) && $from != '') ? $from : $defaultFrom,\n 'subject' => '',\n 'body' => array()\n );\n\n\n // Build the default headers\n $headers = array(\n 'MIME-Version' => '1.0',\n 'Content-Type' => $type . '; charset=UTF-8; format=flowed; delsp=yes',\n 'Content-Transfer-Encoding' => '8Bit',\n 'X-Mailer' => PROJECT_NAME\n );\n\n if ($defaultFrom) {\n // To prevent e-mail from looking like spam, the addresses in the Sender and\n // Return-Path headers should have a domain authorized to use the originating\n // SMTP server. Errors-To is redundant, but shouldn't hurt.\n $headers['From'] = $headers['Reply-To'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $defaultFrom;\n }\n if ($from) {\n $headers['From'] = $headers['Reply-To'] = $from;\n }\n $message['headers'] = $headers;\n\n $message['body'] = $body;\n $message['subject'] = $subject;\n\n // Optionally send e-mail.\n $message['result'] = $this->EMail($message);\n\n // Log errors\n if (!$message['result']) {\n $errorMsg[] = \"Unable to send e-mail. Please contact the site admin, if the problem persists.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n }\n\n return $message['result'];\n }", "function enviar(){\n\t\t$mail = new PHPMailer();\n\t\t\n\t\t// Define os dados do servidor e tipo de conexão\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t$mail->IsSMTP(); // Define que a mensagem será SMTP\n\t\t$mail->Host = 'ssl://smtp.gmail.com:465';\n\t\t$mail->SMTPAuth = true; // Usa autenticação SMTP? (opcional)\n\t\t$mail->Port = $this->configPort;\n\t\t$mail->Username = $this->configUsuario; // Usuário do servidor SMTP\n\t\t$mail->Password = $this->configSenha; // Senha do servidor SMTP\n\t\t$mail->SMTPSecure = \"ssl\"; \n\t\t$mail->SMTPKeepAlive = true; \n\t\t$mail->Mailer = \"smtp\"; \n\t\t$mail->CharSet = 'utf-8'; \n\t\t$mail->SMTPDebug = 0; \n\t\t\n\t\t// Define o remetente\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t$mail->From = $this->remetenteEmail; // Seu e-mail\n\t\t$mail->FromName = $this->remetenteNome; // Seu nome\n\t\t\n\t\t// Define os destinatário(s)\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\t\tif(isset($this->paraEmail)){\t\n\t\t$mail->AddAddress(''. $this->paraEmail. '',''.$this->nomeEmail.'');\n\t\t}\n\t\tif(isset($this->copiaEmail)){\n\t\t$mail->AddCC(''.$this->copiaEmail.'', ''.$this->copiaNome.''); // Copia\n\t\t}\n\t\tif(isset($this->copiaOculta)){\n\t\t$mail->AddBCC(''.$this->copiaOculta.'', ''.$this->nomeCopiaOculta.''); // Cópia Oculta\n\t\t}\n\t\t// Define os dados técnicos da Mensagem\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t$mail->IsHTML(true); // Define que o e-mail será enviado como HTML\n\t\t$mail->CharSet = 'utf-8'; // Charset da mensagem (opcional)\n\t\t\n\t\t// Define a mensagem (Texto e Assunto)\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t$mail->Subject = \"\".$this->assuntoEmail.\"\"; // Assunto da mensagem\n\t\t$mail->Body = \"\".$this->conteudoEmail.\"\";// Conteudo da mensagem a ser enviada\n\t\t$mail->AltBody = \"Por favor verifique seu leitor de email.\";\n\t\t\n\t\t// Define os anexos (opcional)\n\t\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\tif(!empty($this->anexo)){\n\t\t$mail->AddAttachment(\"\".$this->anexo.\"\"); // Insere um anexo\n\t\t}\n\t\t// Envia o e-mail\n\t\t$enviado = $mail->Send();\n\t\t\n\t\t// Limpa os destinatários e os anexos\n\t\t$mail->ClearAllRecipients();\n\t\t$mail->ClearAttachments();\n\t\t\n\t\t// Exibe uma mensagem de resultado\n\t\tif($this->confirmacao == 1){\n\t\t\tif ($enviado) {\n\t\t\techo $this->mensagem;\n\t\t\t} else {\n\t\t\t\techo $this->erroMsg;\n\t\t\t\tif($this->confirmacaoErro == 1){\n\t\t\t\t\techo \"<b>Informações do erro:</b> <br />\" . $mail->ErrorInfo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "public function getMail()\n {\n return $this->_transport->getMail();\n }", "public function protectedMailto($display, $attrs = array())\n {\n $email = '';\n $class_ori = (empty($attrs['class'])) ? '' : $attrs['class'];\n\n // set icon class, unless no-icon class isset or another icon class ('mail-icon-...') is found and display does not contain image\n if ($this->optionValues['icon'] > 0 && (empty($this->optionValues['no_icon_class'])\n || strpos($class_ori, $this->optionValues['no_icon_class']) === FALSE) && strpos($class_ori, 'mail-icon-') === FALSE\n && !($this->optionValues['image_no_icon'] == 1\n && (bool) preg_match($this->regexps['image'], $display))) {\n $icon_class = 'mail-icon-' . $this->optionValues['icon'];\n\n $attrs['class'] = (empty($attrs['class'])) ? $icon_class : $attrs['class'] .' '.$icon_class;\n }\n\n // set user-defined class\n if (!empty($this->optionValues['class_name']) && strpos($class_ori, $this->optionValues['class_name']) === FALSE) {\n $attrs['class'] = (empty($attrs['class'])) ? $this->optionValues['class_name'] : $attrs['class'].' '.$this->optionValues['class_name'];\n }\n\n // check title for email address\n if (!empty($attrs['title'])) {\n $attrs['title'] = $this->replacePlainEmails($attrs['title'], '{{email}}'); // {{email}} will be replaced in javascript\n }\n\n // create element code\n $link = '<a ';\n\n foreach ($attrs AS $key => $value) {\n if (strtolower($key) == 'href' && $this->optionValues['protect']) {\n // get email from href\n $email = substr($value, 7);\n\n $encoded_email = $this->getEncEmail($email);\n\n // set attrs\n $link .= 'href=\"javascript:;\" ';\n $link .= 'data-enc-email=\"'.$encoded_email.'\" ';\n } else {\n $link .= $key.'=\"'.$value.'\" ';\n }\n }\n\n // remove last space\n $link = substr($link, 0, -1);\n\n $link .= '>';\n $link .= ($this->optionValues['protect'] && preg_match($this->regexps['emailPlain'], $display) > 0) ? $this->getProtectedDisplay($display) : $display;\n $link .= '</a>';\n\n // filter\n $link = apply_filters('wpml_mailto', $link, $display, $email, $attrs);\n\n // just in case there are still email addresses f.e. within title-tag\n $link = $this->replacePlainEmails($link);\n\n return $link;\n }", "private function emailTemplate($data) {\n $body = array_reduce($data, function($prevInput, $curInput) {\n return $prevInput . '<p style=\"font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:2px;\">' . $curInput['name'] . ': ' . $curInput['value'] . '</p>' . PHP_EOL;\n });\n\n $email = '<!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>New Online Donation</title>\n <style type=\"text/css\">\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important; }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important; }\n table[class=body] .content {\n padding: 0 !important; }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important; }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; }\n table[class=body] .btn table {\n width: 100% !important; }\n table[class=body] .btn a {\n width: 100% !important; }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; }}\n @media all {\n .ExternalClass {\n width: 100%; }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; }\n .btn-primary table td:hover {\n background-color: #34495e !important; }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; } }\n </style>\n </head>\n <body class=\"\" style=\"background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background-color:#f6f6f6;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;display:block;max-width:960px;padding:10px;width:100%;Margin:0 auto !important;\">\n <div class=\"content\" style=\"box-sizing:border-box;display:block;Margin:0 auto;max-width:100%;padding:10px;\">\n <span class=\"preheader\" style=\"color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0;\">New Form Submission</span>\n <table class=\"main\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background:#fff;border-radius:3px;width:100%;\">\n <tr>\n <td class=\"wrapper\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">\n <p style=\"font-family:sans-serif;font-size:24px;font-weight:normal;margin:0;Margin-bottom:24px;\">Here are the details:</p>\n ' . $body . '\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n </td>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>';\n \n return $email;\n }", "function buildEmailBody($parts, $preview=NULL, $unsubscribe=FALSE) {\n $ci = &get_instance();\n return $ci->load->view('email_view', array(\n 'parts' => $parts,\n 'preview' => $preview,\n 'unsubscribe' => $unsubscribe\n ), TRUE);\n }", "private function handleMail ()\n {\n if ( count ($this->fileData['envelope_to']) > 0 )\n {\n if ( array_key_exists ('MESS_ENGINE', $this->config) )\n {\n switch ($this->config['MESS_ENGINE']) {\n case 'MAIL':\n case 'PHPMAILER':\n require_once PATH_THIRDPARTY . \"phpmailer/phpmailer.php\";\n\n switch ($this->config['MESS_ENGINE']) {\n case 'MAIL':\n $oPHPMailer = new PHPMailer();\n $oPHPMailer->Mailer = 'mail';\n break;\n case 'PHPMAILER':\n $oPHPMailer = new PHPMailer (true);\n $oPHPMailer->Mailer = 'smtp';\n break;\n }\n\n $oPHPMailer->SMTPAuth = (isset ($this->config['SMTPAuth']) ? $this->config['SMTPAuth'] : '');\n\n switch ($this->config['MESS_ENGINE']) {\n case 'MAIL':\n break;\n case 'PHPMAILER':\n //Posible Options for SMTPSecure are: \"\", \"ssl\" or \"tls\"\n if ( isset ($this->config['SMTPSecure']) && preg_match ('/^(ssl|tls)$/', $this->config['SMTPSecure']) )\n {\n $oPHPMailer->SMTPSecure = $this->config['SMTPSecure'];\n }\n break;\n }\n $oPHPMailer->CharSet = \"UTF-8\";\n $oPHPMailer->Encoding = \"8bit\";\n $oPHPMailer->Host = $this->config['MESS_SERVER'];\n $oPHPMailer->Port = $this->config['MESS_PORT'];\n $oPHPMailer->Username = $this->config['MESS_ACCOUNT'];\n $oPHPMailer->Password = $this->config['MESS_PASSWORD'];\n $oPHPMailer->SetFrom ($this->fileData['from_email'], utf8_decode ($this->fileData['from_name']));\n\n if ( isset ($this->fileData['reply_to']) )\n {\n if ( $this->fileData['reply_to'] != '' )\n {\n $oPHPMailer->AddReplyTo ($this->fileData['reply_to'], $this->fileData['reply_to_name']);\n }\n }\n\n $msSubject = $this->fileData['subject'];\n\n if ( !(mb_detect_encoding ($msSubject, \"UTF-8\") == \"UTF-8\") )\n {\n $msSubject = utf8_encode ($msSubject);\n }\n\n $oPHPMailer->Subject = $msSubject;\n\n $msBody = $this->fileData['body'];\n\n if ( !(mb_detect_encoding ($msBody, \"UTF-8\") == \"UTF-8\") )\n {\n $msBody = utf8_encode ($msBody);\n }\n\n $oPHPMailer->Body = $msBody;\n\n $attachment = @unserialize ($this->fileData['attachments']);\n if ( $attachment === false )\n {\n $attachment = $this->fileData['attachments'];\n }\n if ( is_array ($attachment) )\n {\n foreach ($attachment as $key => $fileAttach) {\n if ( file_exists ($fileAttach) )\n {\n $oPHPMailer->AddAttachment ($fileAttach, is_int ($key) ? '' : $key );\n }\n }\n }\n\n foreach ($this->fileData['envelope_to'] as $sEmail) {\n if ( strpos ($sEmail, '<') !== false )\n {\n preg_match ($this->longMailEreg, $sEmail, $matches);\n $sTo = trim ($matches[3]);\n $sToName = trim ($matches[1]);\n $oPHPMailer->AddAddress ($sTo, $sToName);\n }\n else\n {\n $oPHPMailer->AddAddress ($sEmail);\n }\n }\n\n //CC\n foreach ($this->fileData['envelope_cc'] as $sEmail) {\n if ( strpos ($sEmail, '<') !== false )\n {\n preg_match ($this->longMailEreg, $sEmail, $matches);\n if ( isset ($matches[1]) && isset ($matches[3]) )\n {\n $sTo = trim ($matches[3]);\n $sToName = trim ($matches[1]);\n }\n else\n {\n $sTo = \"[email protected]\";\n $sToName = \"Michael Hampton\";\n }\n\n $oPHPMailer->AddCC ($sTo, $sToName);\n }\n else\n {\n $oPHPMailer->AddCC ($sEmail);\n }\n }\n\n //BCC\n foreach ($this->fileData['envelope_bcc'] as $sEmail) {\n if ( strpos ($sEmail, '<') !== false )\n {\n preg_match ($this->longMailEreg, $sEmail, $matches);\n $sTo = trim ($matches[3]);\n $sToName = trim ($matches[1]);\n $oPHPMailer->AddBCC ($sTo, $sToName);\n }\n else\n {\n $oPHPMailer->AddBCC ($sEmail);\n }\n }\n\n $oPHPMailer->IsHTML ($this->fileData[\"contentTypeIsHtml\"]);\n\n if ( $this->config['MESS_ENGINE'] == 'MAIL' )\n {\n $oPHPMailer->WordWrap = 300;\n }\n\n if ( $oPHPMailer->Send () )\n {\n $this->error = '';\n $this->status = 'sent';\n }\n else\n {\n $this->error = $oPHPMailer->ErrorInfo;\n $this->status = 'failed';\n }\n break;\n case 'OPENMAIL':\n //G::LoadClass ('package');\n //G::LoadClass ('smtp');\n $pack = new package ($this->fileData);\n $header = $pack->returnHeader ();\n $body = $pack->returnBody ();\n $send = new smtp();\n $send->setServer ($this->config['MESS_SERVER']);\n $send->setPort ($this->config['MESS_PORT']);\n $send->setUsername ($this->config['MESS_ACCOUNT']);\n\n $passwd = $this->config['MESS_PASSWORD'];\n $passwdDec = $this->decrypt ($passwd, 'EMAILENCRYPT');\n $auxPass = explode ('hash:', $passwdDec);\n\n if ( count ($auxPass) > 1 )\n {\n if ( count ($auxPass) == 2 )\n {\n $passwd = $auxPass[1];\n }\n else\n {\n array_shift ($auxPass);\n $passwd = implode ('', $auxPass);\n }\n }\n\n $this->config['MESS_PASSWORD'] = $passwd;\n $send->setPassword ($this->config['MESS_PASSWORD']);\n $send->setReturnPath ($this->fileData['from_email']);\n $send->setHeaders ($header);\n $send->setBody ($body);\n $send->setEnvelopeTo ($this->fileData['envelope_to']);\n if ( $send->sendMessage () )\n {\n $this->error = '';\n $this->status = 'sent';\n }\n else\n {\n $this->error = implode (', ', $send->returnErrors ());\n $this->status = 'failed';\n }\n break;\n }\n }\n }\n }", "function send_email($to='', $fromMail='', $subject='', $html_content='', $text_content='', $headers='') { \n\n\t$html_content = (!empty($html_content)) ? str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '', $html_content) : '';\n\n\t// # Setup mime boundary\n\t$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';\n\n\t$headers = \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: multipart/alternative; boundary=\\\"$mime_boundary\\\"\\r\\n\";\n\t$headers .= \"Content-Transfer-Encoding: 7bit\\r\\n\";\n\n\t$body\t = \"This is a multi-part message in mime format.\\n\\n\";\n\n\t// # Add in plain text version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/plain; charset=charset=\\\"us-ascii\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t$body\t.= $text_content;\n\t$body\t.= \"\\n\\n\";\n\n\t// # Add in HTML version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/html; charset=\\\"UTF-8\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 8bit\\n\\n\";\n\t$body\t.= wordwrap($html_content,500,\"\\r\\n\");\n\t$body\t.= \"\\n\\n\";\n\n\t// # Attachments would go here\n\t// # But this whole email thing should be turned into a class to more logically handle attachments, \n\n\t// # End email\n\t$body\t.= \"--$mime_boundary--\\n\"; // # trailing --, required to close email body for mime's\n\n\t// # Finish off headers\n\t$headers .= \"From: \".$fromMail.\"\\r\\n\";\n\t$headers .= \"X-Sender-IP: \".$_SERVER['argv'][3].\"\\r\\n\";\n\t$headers .= 'Date: '.date('n/d/Y g:i A').\"\\r\\n\";\n\t$headers .= \"Reply-To: \".STORE_OWNER_EMAIL_ADDRESS.\" \\r\\n\";\n\n\t// # Mail it out\n\treturn mail($to, $subject, $body, $headers);\n}", "function getEmailMessage($msg_text, $msg_html) {\n\t$message = \"------=MIME_BOUNDRY_message_parts\\n\";\n\t$message .= \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\";\n\t$message .= \"Content-Transfer-Encoding: quoted-printable\\n\";\n\t$message .= \"Content-ID: RSSmsg\\n\"; //addition\n\t$message .= \"\\n\";\n\t$message .= \"$msg_text \\n\";\n\t$message .= \"\\n\";\n\t/* html section begins */\n\t$message .= \"------=MIME_BOUNDRY_message_parts\\n\";\n\t$message .= \"Content-Type: text/html; charset=iso-8859-1\\n\";\n\t$message .= \"Content-Transfer-Encoding: quoted-printable\\n\";\n\t$message .= \"Content-ID: RSShtmlmsg\\n\"; //addition\n\t$message .= \"\\n\";\n\t/* html message begins */\n\t$message .= \"<link rel=3D\\\"stylesheet\\\" href=3D\\\"https://login.retailservicesystems.com/styles.css\\\" type=3D\\\"text/css\\\">\";\n\t$message .= \"$msg_html \\n\";\n\t/* html message ends */\n\t$message .= \"\\n\";\n\t/* this ends the message part */\n\t$message .= \"------=MIME_BOUNDRY_message_parts--\\n\";\n\t$message .= \"\\n\";\n\t/* message ends */\n\t$message .= \"------=MIME_BOUNDRY_main_message--\\n\";\n\treturn $message;\n}", "function call_mailer($mail,$fn,$email)\n {\n //Simfatic Forms saves email Name<email> form. The functions take the name and email seperate\n $arr = $this->addr($email);\n \n return $mail->$fn($arr[0],$arr[1]);\n }", "protected function __EnviaEmailTemplate($out,$email=NULL,$c=array(),$v=array(),$cp=array())\n{\n\t$msg = str_replace($c,$v,str_replace('[@dominio]',self::_http_ori,$out['template_email_mensagem']));\n\t\n\t$this->AbrirSMTP();\n\t\n\t$this->phpmailer->ClearAllRecipients();\n\t\n\t$this->phpmailer->Subject = '=?UTF-8?B?'.base64_encode(str_replace($c,$v,$out['template_email_assunto'])).'?=';\n\t$this->phpmailer->Body = $msg;\n\t$this->phpmailer->AltBody = strip_tags(str_replace('<br>',\"\\n\",$msg));\n\t\n\tif($email)\n\t{ $this->phpmailer->AddAddress($email); }\n\telse\n\t{ $this->phpmailer->AddAddress(self::smtp_email); }\n\t\n\tif($cp)\n\t{\n\t\tforeach($cp as $v) $this->phpmailer->AddCC($v);\n\t}\n\t\n\tif(!$this->phpmailer->Send())\n\t{\n\t\techo $this->phpmailer->ErrorInfo;\n\t\treturn ;\n\t}\n\t\n\treturn true;\n}", "public function enviar(){\n\t\t\t$email = array(\n\t\t \t\t'nome'=>$this->remover_caracter($this->nome),\n\t\t \t\t'email'=>$this->email,\n\t\t\t\t'assunto'=>$this->remover_caracter($this->assunto),\n\t\t \t\t'texto'=>$this->remover_caracter($this->mensagem)\n\t\t\t);\n\t\t\tif( is_file($this->logo) ){\n\t\t\t\t$imagem_nome=$this->logo;\n\t\t\t\t$arquivo=fopen($imagem_nome,'r');\n\t\t\t\t$contents = fread($arquivo, filesize($imagem_nome));\n\t\t\t\t$encoded_attach = chunk_split(base64_encode($contents));\n\t\t\t\tfclose($arquivo);\n\t\t\t}\n\t\t\t$limitador = \"_=======\". date('YmdHms'). time() . \"=======_\";\n\n\t\t\t$mailheaders = \"From: \".$email['email'].\"\\r\\n\";\n\t\t\t$mailheaders .= \"MIME-version: 1.0\\r\\n\";\n\t\t\t$mailheaders .= \"Content-type: multipart/related; boundary=\\\"$limitador\\\"\\r\\n\";\n\t\t\t$cid = date('YmdHms').'.'.time();\n\n\t\t\t$texto=\"\n\t\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t\".header('Content-type: text/html; charset=utf-8').\"\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<img src=\\\"cid:$cid\\\">\n\t\t\t\t\t<h1>Desenvolvedor avulso para Web</h1>\n\t\t\t\t\t<br>\n\t\t\t\t\t<p><strong>\".$email['nome'].\"</strong>: Solicitou contato, sobre :<em>\".$email['assunto'].\"</em></p>\n\t\t\t\t\t<p>com a seguinte mensagem: <span>\".$email['texto'].\"</span></p>\n\t\t\t\t\t<p>email: \".$email['email'].\"</p>\n\t\t\t\t\t<a href='http://\". $this->url .\"'><font size=3>\". $this->url .\"</font></a>\n\t\t\t\t</body>\n\t\t\t\t</html>\n\t\t\t\";\n\n\t\t\t$msg_body = \"--$limitador\\r\\n\";\n\t\t\t$msg_body .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n\t\t\t$msg_body .= \"$texto\";\n\n\t\t\t$emailPara = explode('@',$this->para)[1];\n\t\t\treturn mail($this->para ,\"Um novo Cliente Contactou o Site \". $emailPara ,$msg_body, $mailheaders);\n\t\t}", "public static function NewMessage($mailer,$to=null,$cc=null,$bcc=null,$subject=null)\n {\n $conf=Config::Get('mail');\n\n if (!$conf->mailers->{$mailer})\n throw new MailerException(\"Missing '{$mailer}' in mail configuration.\");\n\n $class=$conf->mailers->{$mailer}->class;\n if (!$class)\n throw new MailerException(\"Missing class in '{$mailer}' configuration.\");\n\n $components=explode('.',$class);\n\n if (count($components)==0)\n throw new MailerException(\"Invalid driver in '{$mailer}' configuration.\");\n\n if (count($components)==1)\n {\n $uses='sys.mail.'.$class.'.'.$class.'_email';\n $class=$class.'Email';\n }\n else\n {\n $uses=$class;\n $class=str_replace('_','',array_pop($components));\n }\n\n uses($uses);\n return new $class($conf->mailers->{$mailer},$to,$cc,$bcc,$subject);\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 }", "public function GetMailMIME() {\n\t $result = '';\n\t switch($this->message_type) {\n\t case 'plain':\n\t $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);\n\t $result .= sprintf(\"Content-Type: %s; charset=\\\"%s\\\"\", $this->ContentType, $this->CharSet);\n\t break;\n\t case 'attachments':\n\t case 'alt_attachments':\n\t if($this->InlineImageExists()){\n\t $result .= sprintf(\"Content-Type: %s;%s\\ttype=\\\"text/html\\\";%s\\tboundary=\\\"%s\\\"%s\", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);\n\t } else {\n\t $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');\n\t $result .= $this->TextLine(\"\\tboundary=\\\"\" . $this->boundary[1] . '\"');\n\t }\n\t break;\n\t case 'alt':\n\t $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');\n\t $result .= $this->TextLine(\"\\tboundary=\\\"\" . $this->boundary[1] . '\"');\n\t break;\n\t }\n\t\n\t if($this->Mailer != 'mail') {\n\t $result .= $this->LE.$this->LE;\n\t }\n\t return $result;\n\t}", "public function __toString() {\n\t\t$str = '';\n\t\t$str .= '<pre>' . \"\\n <br />\";\n\t\t$str .= '---------------------------------------------------------- ' . \"\\n <br />\";\t\t\n\t\t$str .= 'To: ' . $this->makeAddressStringFromArray($this->_mailTo) . \"\\n <br />\";\n\t\t$str .= 'Cc: ' . $this->makeAddressStringFromArray($this->_mailCc) . \"\\n <br />\";\n\t\t$str .= 'Bcc: ' . $this->makeAddressStringFromArray($this->_mailBcc) . \"\\n <br />\";\n\t\t$str .= 'Reply-To: ' . $this->_mailReplyTo . \"\\n <br />\";\n\t\t$str .= 'Reply-To Name: ' . $this->_mailReplyToName . \"\\n <br />\";\n\t\t$str .= 'From: ' . $this->_mailFrom . \"\\n <br />\";\n\t\t$str .= 'From Name: ' . $this->_mailFromName . \"\\n <br />\";\n\t\t$str .= 'Subject: ' . $this->_mailSubject . \"\\n <br />\";\n\t\t$str .= 'Body: ' . $this->_mailBody . \"\\n <br />\";\n\t\t$str .= 'Body encoded QT: ' . $this->quotedPrintable($this->_mailBody) . \"\\n <br />\";\n\t\t$str .= 'Body wraped: ' . $this->wordWrap($this->_mailBody,75) . \"\\n <br />\";\t\t\n\t\tfor($i=0,$c=count($this->_mailFiles); $i<$c; $i++) {\n\t\t\t$str .= 'File ' . $i . ' Name: ' . $this->_mailFiles[$i]['fileName'] . ' Type: ' . $this->_mailFiles[$i]['fileType'] . ' Disposition: ' . $this->_mailFiles[$i]['fileDisposition'] . \"\\n <br />\";\n\t\t}\n\t\t$str .= '---------------------------------------------------------- ' . \"\\n <br />\";\n\t\t$str .= 'Text Type: ' . $this->_mailTextType . \"\\n <br />\";\n\t\t$str .= 'Charset: ' . $this->_mailCharset . \"\\n <br />\";\n\t\t$str .= 'Priority: ' . $this->_mailPriority . \"\\n <br />\";\n\t\t$str .= 'MSPriority: ' . $this->_mailMsMailPriority . \"\\n <br />\";\n\t\t$str .= 'Text Plain Encoding: ' . $this->_mailTextPlainContentTransferEncoding . \"\\n <br />\";\n\t\t$str .= 'Text HTML Encoding: ' . $this->_mailTextHtmlContentTransferEncoding . \"\\n <br />\";\n\t\t$str .= 'File Encoding: ' . $this->_mailFileContentTransferEncoding . \"\\n <br />\";\t\t\n\t\t$str .= 'Alternative Text: ' . $this->_mailAlternativeText . \"\\n <br />\";\n\t\t$str .= 'Protocol: ' . $this->_mailProtocol . \"\\n <br />\";\n\t\t\t$endl = ($this->_endString == \"\\r\\n\") ? '\\r\\n' : '\\n';\n\t\t$str .= 'Endl: ' . $endl . \"\\n <br />\";\n\t\t\t$wp = ($this->_wordWrap === true) ? 1 : 0;\n\t\t$str .= 'Word Wrap: ' . $wp . \"\\n <br />\";\n\t\t$str .= 'Mailer: ' . $this->_mailMailer . \"\\n <br />\";\n\t\t$str .= 'Mime Version: ' . $this->_mailMimeVersion . \"\\n <br />\";\n\t\t$str .= 'Mime Info: ' . $this->_mailMimeInfo . \"\\n <br />\";\n\t\t$str .= 'Mime Multipart: ' . $this->_mailMimeTypeMultipart . \"\\n <br />\";\n\t\t\t$ml = ($this->_mailMultipart === true) ? 1 : 0;\t\t\n\t\t$str .= 'Send Multipart: ' . $ml . \"\\n <br />\";\n\t\t$str .= '---------------------------------------------------------- ' . \"\\n <br />\";\n\t\t$str .= 'Header String: ' . $this->_mailPreparedHeaders . \"\\n <br />\";\n\t\t$str .= '---------------------------------------------------------- ' . \"\\n <br />\";\t\t\n\t\t$str .= 'Body String: ' . $this->_mailPreparedBody . \"\\n <br />\";\n\t\t$str .= '---------------------------------------------------------- ' . \"\\n <br />\";\t\t\n\t\t$str .= '</pre>' . \"\\n <br />\";\n\t\treturn $str;\n\t}", "public function toMail($notifiable)\n {\n $this->data['urlInfo'] = url(Auth::user()->getIntendedUrl().'/home/convdetails/'.$this->conv->id);\n $this->data['urlChiusura'] = url(Auth::user()->getIntendedUrl().'/home/validazione/'.$this->conv->id);\n $this->data['conv'] = $this->conv;\n\n $emailresp = $notifiable->responsabile()->email; \n\n if (App::environment(['local','preprod'])) { \n \n return (new MailMessage) \n ->cc(config('unidem.administrator_email'))\n ->subject('Richiesta approvazione') \n ->markdown('mail.richiesta.validazione',$this->data);\n\n } else{\n\n return (new MailMessage)\n ->cc([$emailresp, Auth::user()->email]) \n ->bcc(config('unidem.administrator_email'))\n ->subject('Richiesta approvazione') \n ->markdown('mail.richiesta.validazione',$this->data);\n }\n\n\n \n }", "function enviar_mail_mov($datos)\r\n{\r\n\tglobal $db,$titulo_pagina;\r\n\t//ver el origen y destino\r\n\t$sql = \"select temp1.nombre as origen, temp1.id_deposito as id_origen,temp2.nombre as destino, temp2.id_deposito as id_destino from movimiento_material join depositos as temp1 on (temp1.id_deposito = deposito_origen) join depositos as temp2 on (temp2.id_deposito = deposito_destino) where id_movimiento_material = \".$datos['Id'];\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\r\n $origen = $result->fields['origen'];\r\n\t$destino = $result->fields['destino'];\r\n $id_origen = $result->fields['id_origen'];\r\n $id_destino = $result->fields['id_destino'];\r\n\r\n\t//buscar el responsable del deposito origen\r\n\t$sql = \"select usuarios.mail from depositos join responsable_deposito using (id_deposito) join usuarios using (id_usuario) where id_deposito = \".$id_origen;\r\n\t$result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\t$responsable_origen = array();\r\n\twhile (!$result->EOF) {\r\n\t\t$responsable_origen[] = $result->fields['mail'];\r\n\t\t$result->MoveNext();\r\n\t}\r\n\r\n\t//buscar el responsable del deposito origen\r\n\t$sql = \"select usuarios.mail from depositos join responsable_deposito using (id_deposito) join usuarios using (id_usuario) where id_deposito = \".$id_destino;\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\t$responsable_destino = array();\r\n\twhile (!$result->EOF) {\r\n\t\t$responsable_destino[] = $result->fields['mail'];\r\n\t\t$result->MoveNext();\r\n\t}\r\n\r\n\t//tengo que prepara el \"para\" para enviar el mail\r\n\t//el problema es que se pueden repetir los mail\r\n\t//armo un arreglo con los mail\r\n\t$mail_para = array ();\r\n //la variable \"$responsable_origen\" es arreglo por eso hago un merge para que me quede solo un arreglo\r\n $mail_para= array_merge($mail_para,$responsable_origen);\r\n //la variable \"$responsable_destino\" es arreglo por eso hago un merge para que me quede solo un arreglo\r\n $mail_para= array_merge($mail_para,$responsable_destino);\r\n //saco el tamaño del arreglo por que no se como me quedo despues de los merge\r\n $i=sizeof($mail_para);\r\n\t//$para = \"[email protected],\".join(\",\",$responsable_origen).\",\".join(\",\",$responsable_destino);\r\n\tif($origen==\"New Tree\" || $destino==\"New Tree\"){\r\n\t $mail_para[$i]=\"[email protected]\";\r\n\t $i++;\r\n\t $mail_para[$i]=\"[email protected]\";\r\n\t $i++;\r\n\t //$para.=\",[email protected],[email protected]\";\r\n\t}\r\n\t//agregar responsables\r\n\r\n\t$asunto = \"$titulo_pagina Nº: \".$datos['Id'];\r\n\t$contenido = \"$titulo_pagina Nº \".$datos['Id'].\".\\n\";\r\n\t$contenido.= \"Depósito de Origen: \".$origen.\".\\n\";\r\n\t$contenido.= \"Depósito de Destino: \".$destino.\".\\n\";\r\n\t$contenido.= \"Autorizado por \".$datos['Usuario'].\" el día \".fecha($datos[\"Fecha\"]).\".\\n\";\r\n\t$contenido.= \"\\nDetalle del movimiento: \\n\";\r\n\r\n\r\n\t//obtener el detalle del movimiento\r\n\t$sql = \"select cantidad,descripcion from detalle_movimiento where id_movimiento_material = \".$datos['Id'];\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\r\n $contenido.= \"Cantidad | Descripción \\n\";\r\n $contenido.= \"--------------------------------------------------------------\\n\";\r\n\r\n while (!$result->EOF) {\r\n \t$contenido.=\" \".$result->fields['cantidad'].\" \".$result->fields['descripcion'].\"\\n\";\r\n \t$result->MoveNext();\r\n }\r\n\r\n\t//agrego datos si tiene logistica integrada\r\n\tif ($datos['id_logistica_integrada']!=''){\r\n\t\t//todo lo que sigue es para el para\r\n\r\n\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t$i++;\r\n\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t$i++;\r\n\t\t//$para = $para. \" [email protected]\";\r\n\t\t//$para = $para. \", [email protected]\";\r\n\t\t$sql = \"select * from\r\n\t\t\t\t (select (nombre|| ' ' ||apellido) as usuario, mail from sistema.usuarios)as lado_a\r\n\t\t\t\tjoin\r\n\t\t\t\t (select usuario from mov_material.log_movimiento where id_movimiento_material = \".$datos['Id'].\"\r\n\t\t\t\t group by usuario\r\n\t\t\t\t )as lado_b\r\n\t\t\t\tusing (usuario)\";\r\n \t$result_mail = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\r\n \twhile (!$result_mail->EOF){\r\n \t\t//$para = $para. \", \" . $result_mail->fields['mail'];\r\n \t\t$mail_para[$i]=$result_mail->fields['mail'];\r\n \t\t$i++;\r\n \t\t$result_mail->MoveNext();\r\n \t}\r\n\r\n \t//saco el tamaño del arreglo para asegurarme que esta en la posicion correcta para seguir\r\n\t\t$i=sizeof($mail_para);\r\n\r\n \t//si esta asociado a una licitacion\r\n\t\tif ($datos['asociado_a']=='lic') {\r\n\t\t\t$sql = \"select mail as mail_patrocinador, mail_lider from (\r\n\t\t\t\t\tselect mail as mail_lider, patrocinador from\r\n\t\t\t\t\t(\r\n\t\t\t\t\tselect id_licitacion, lider, patrocinador from\r\n\t\t\t\t\t (select id_licitacion from mov_material.movimiento_material where id_movimiento_material = \".$datos['Id'].\") as a\r\n\t\t\t\t\tjoin\r\n\t\t\t\t\t licitaciones.licitacion\r\n\t\t\t\t\tusing (id_licitacion)\r\n\t\t\t\t\t)as b\r\n\t\t\t\t\tleft join sistema.usuarios\r\n\t\t\t\t\ton id_usuario = lider\r\n\t\t\t\t\t)as c\r\n\t\t\t\t\tleft join sistema.usuarios\r\n\t\t\t\t\ton id_usuario = patrocinador\";\r\n\t\t $result_mail = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\t\t if ($result_mail->fields['mail_lider']!=''){\r\n\t\t \t$mail_para[$i]=$result_mail->fields['mail_lider'];\r\n\t\t\t\t$i++;\r\n\t\t \t//$para = $para. \", \".$result_mail->fields['mail_lider'];\r\n\t\t }\r\n\t\t if ($result_mail->fields['mail_patrocinador']!=''){\r\n\t\t \t$mail_para[$i]=$result_mail->fields['mail_patrocinador'];\r\n\t\t\t\t$i++;\r\n\t\t \t//$para = $para. \", \".$result_mail->fields['mail_patrocinador'];\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t//si esta asociado a un caso\r\n\t\tif ($datos['asociado_a']=='caso'){\r\n\t\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t\t$i++;\r\n\t\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t\t$i++;\r\n\t\t\t//$para = $para. \", [email protected], [email protected] \";\r\n\t\t}\r\n\r\n\t\t//todo lo que sigue es para el contenido\r\n\t\t$sql = \"select * from mov_material.logistica_integrada where id_logistica_integrada = \". $datos['id_logistica_integrada'];\r\n\t\t$result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\t\t$contenido.=\"\\n\\n\\n\";\r\n\t\t$contenido.=\"----------------------- Logistica Integrada -------------------\\n\\n\";\r\n\t\t$contenido.=\"Dirección: \". $result->fields['direccion'] .\"\\n\";\r\n\t\t$contenido.=\"Fecha de envio: \". fecha ($result->fields['fecha_envio_logis']) .\"\\n\";\r\n\t\t$contenido.=\"Contacto: \". $result->fields['contacto'] .\"\\n\";\r\n\t\t$contenido.=\"Telefono: \". $result->fields['telefono'] .\"\\n\";\r\n\t\t$contenido.=\"Código Postal: \". $result->fields['cod_pos'] .\"\\n\\n\";\r\n\t\t$contenido.= \"--------------------------------------------------------------\\n\";\r\n\t}\r\n\t//fin de agrego datos si tiene logistica integrada\r\n\t//print_r ($mail_para);\r\n\t$para=elimina_repetidos($mail_para,0);\r\n\t//no envia el mail a juan manuel lo saco del string, en caso que se encuentre ultimo el mail\r\n\t$para=ereg_replace(\"[email protected]\",\"\",$para);\r\n\t//no envia el mail a juan manuel lo saco del string, en caso que se encuentre distinto del ultimo el mail\r\n\t$para=ereg_replace(\"[email protected],\",\"\",$para);\r\n/*\techo \"<br> los ok: \".$para;\r\n\tdie();*/\r\n\tenviar_mail($para, $asunto, $contenido,'','','',0);\r\n}", "public function build()\n\t{\n \treturn $this->to($this->user->email)\n \t\t\t->from('[email protected]')\n ->view('email.register_confirmation')\n ->with([\n 'token' => $this->user->email_confirmation_token,\n 'email' => $this->user->email\n ]);\n\t}" ]
[ "0.6905763", "0.61797136", "0.6173315", "0.6156689", "0.6069785", "0.6041911", "0.59983474", "0.5963014", "0.5960338", "0.5936944", "0.5922275", "0.5894485", "0.58692044", "0.58519435", "0.58277094", "0.5685993", "0.5683205", "0.56743014", "0.56663007", "0.565762", "0.5621353", "0.5606857", "0.5599704", "0.5587734", "0.55584556", "0.5541277", "0.55386513", "0.5533924", "0.5503622", "0.54809725", "0.54685473", "0.5464457", "0.54480803", "0.54480064", "0.54464424", "0.54451424", "0.5419276", "0.5413045", "0.53998196", "0.53983164", "0.5380676", "0.53658795", "0.5360571", "0.5352237", "0.5349865", "0.53377736", "0.5336163", "0.5325141", "0.53093797", "0.5308661", "0.5305159", "0.53001267", "0.5299564", "0.52955395", "0.5291713", "0.5287787", "0.5285489", "0.5279129", "0.5269277", "0.52575636", "0.52509916", "0.5249996", "0.5247416", "0.52387017", "0.523371", "0.5212921", "0.5210625", "0.52055967", "0.5205313", "0.5191378", "0.5190366", "0.5183137", "0.51823705", "0.5179893", "0.5178601", "0.51710814", "0.51582175", "0.5156089", "0.51534295", "0.51517504", "0.51471746", "0.51445556", "0.5144186", "0.5142054", "0.51415104", "0.5139256", "0.5130949", "0.5125842", "0.5125732", "0.51221156", "0.5120569", "0.51184136", "0.5113883", "0.5111566", "0.510969", "0.5108955", "0.5101829", "0.51000935", "0.5098174", "0.50943613" ]
0.65684193
1
Run the database seeds.
public function run() { DB::table('cat_report')->insert([ ['name' => 'Otro'], ['name' => 'Servicio'], ['name' => 'Seguridad'] ]); }
{ "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
Create a random star image
public function getImage(int $width = 300, int $height = 300) { // Créé une ressource en mémoire $img = imagecreate($width, $height); imagecolorallocate($img, rand(0, 255),rand(0, 255),rand(0, 255)); $randColor = imagecolorallocate($img, rand(0, 255),rand(0, 255),rand(0, 255)); $randColor2 = imagecolorallocatealpha($img, rand(0, 255),rand(0, 255),rand(0, 255), rand(0,126)); imagefilledrectangle($img,25,25,275,275, $randColor); imagefilledpolygon($img, array( 150, 25, 200, 100, 275, 100, 225, 175, 275, 275, 150, 225, 25, 275, 75, 175, 25, 100, 100, 100 ), 10, $randColor2); // Créé un fichier jpeg à partir de la ressource ob_start(); imagepng($img); $png = ob_get_clean(); return $png; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateImgStarfield() {\r\n $img_starfield = $config[ConfigurationKey::prefix_img_starfield];\r\n $img_starfield = rand(0, $config[ConfigurationKey::number_img_starfield]);\r\n return $img_starfield;\r\n }", "function noisemaker($im)\n{\n imageSetThickness($im, 2);\n for ($i = 1; $i < 200; $i++) {\n imageSetPixel($im, rand(5, 195), rand(75, 5), imageColorAllocate($im, 8, 24, 89));\n }\n for ($i = 1; $i < 4; $i++) {\n imageline($im, rand(5, 195), rand(60, 20), rand(5, 195), rand(60, 20), imageColorAllocate($im, 240, 240, 240));\n }\n return;\n}", "public function random(): GifData;", "private function _addNoise() {\r\n\t\t// Reset foreground color to default.\r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\t\t\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\tfor ($i = 0; $i < abs($this->_noiseModifier); $i++) {\r\n\t\t\t// Set random foreground color if desired.\r\n\t\t\t($this->useRandomColorNoise) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\t\r\n\t\t\t// Add some random pixels\r\n\t\t\t//imagesetpixel($this->_resource, rand() % 200, rand() % 50, $foreground);\r\n\t\t\timagesetpixel($this->_resource, rand(0, $width), rand(0, $height), $foreground);\r\n\t\t}\r\n\t}", "public function getRandomImg(){\n $pics = $this->getImgs();\n if ( count($pics) == 0){\n return null;\n }\n // seed random function\n mt_srand((double)microtime()*1000000);\n // get an random index:\n $rand = mt_rand(0, count($pics)-1);\n return $pics[$rand];\n }", "function randomImage ( $array ) {\n\n $total = count($array);\n\n $call = rand(0,$total-1);\n\n return $array[$call];\n\n}", "function constructRating($rating) {\n $imgTags = \"\";\n\n // first output the gold stars\n for ($i=0; $i < $rating; $i++) {\n $imgTags .= '<img src=\"images/star-gold.svg\" width=\"16\" />';\n }\n\n // then fill remainder with white stars\n for ($i=$rating; $i < 5; $i++) {\n $imgTags .= '<img src=\"images/star-white.svg\" width=\"16\" />';\n }\n\n return $imgTags;\n}", "function constructRating($rating) {\n $imgTags = \"\";\n \n // first output the gold stars\n for ($i=0; $i < $rating; $i++) {\n $imgTags .= '<img src=\"images/star-gold.svg\" width=\"16\" />';\n }\n \n // then fill remainder with white stars\n for ($i=$rating; $i < 5; $i++) {\n $imgTags .= '<img src=\"images/star-white.svg\" width=\"16\" />';\n } \n \n return $imgTags; \n}", "function getRating()\n{\n $actualRating = rand(0,50) / 10;\n\n $starFull = $actualRating;\n \n $starPartial = 0;\n\n if (is_float($starFull))\n {\n\n $starPartial = 1;\n\n $starFull = (int)$starFull;\n\n }\n\n $star_empty = 5 - $starFull - $starPartial;\n\n $ratingDisplay = '';\n\n for($i = 0; $i < $starFull; $i++) {\n $ratingDisplay .= 'Full Star ';\n }\n\n if ($starPartial)\n {\n $ratingDisplay .= 'Partial Star ';\n }\n\n for($i = 0; $i < $star_empty; $i++) {\n $ratingDisplay .= 'Empty Star ';\n }\n\n echo $ratingDisplay . ' (' . $actualRating . \")\";\n}", "public function getRandomImage():string\n {\n $dir = $_SERVER['DOCUMENT_ROOT'] . Steps::MODULE_IMG_PATH;\n $files = array_values(array_diff(scandir($dir), ['..', '.']));\n $randKey = array_rand($files);\n $randFile = $files[$randKey];\n $randImg = $dir . $randFile;\n return $randImg;\n }", "public function getrandommoomusicimage() {\n\t\t\t\n\t\t\t$images = array(\"croo-doris.png\",\"croo-henry.png\",\"croo-maggie.png\",\"croo-ollie.png\");\n\t\t\t\n\t\t\t$randomImageIndex = rand(0, count($images) - 1);\n\t\t\t$v = View::getInstance();\n\t\t\t$themePath = $v->getThemePath();\n\t\t\t\n\t\t\t$fullImagePath = $themePath . '/images/' . $images[$randomImageIndex];\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\treturn $fullImagePath;\n\t\t}", "public function _random() {\n\t\tif( $this->type == 'image' ) {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth);\n\t\t} else {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth, array('txt', 'html'));\n\t\t}//end if\n\n\t\t$this->set( PSUFiles::chooseRandomElement($files) );\n\t}", "private function custom_noise($diff)\n\t{\n\t\t$imagex = imagesx($this->image);\n\t\t$imagey = imagesy($this->image);\n\n\t\tfor($x = 0; $x < $imagex; ++$x)\n\t\t{\n\t\t\tfor($y = 0; $y < $imagey; ++$y)\n\t\t\t{\n\t\t\t\tif(rand(0, 1) )\n\t\t\t\t{\n\t\t\t\t\t$rgb = imagecolorat($this->image, $x, $y);\n\t\t\t\t\t$red = ($rgb >> 16) & 0xFF;\n\t\t\t\t\t$green = ($rgb >> 8) & 0xFF;\n\t\t\t\t\t$blue = $rgb & 0xFF;\n\t\t\t\t\t$modifier = rand($diff * -1, $diff);\n\t\t\t\t\t$red += $modifier;\n\t\t\t\t\t$green += $modifier;\n\t\t\t\t\t$blue += $modifier;\n\n\t\t\t\t\tif ($red > 255) $red = 255;\n\t\t\t\t\tif ($green > 255) $green = 255;\n\t\t\t\t\tif ($blue > 255) $blue = 255;\n\t\t\t\t\tif ($red < 0) $red = 0;\n\t\t\t\t\tif ($green < 0) $green = 0;\n\t\t\t\t\tif ($blue < 0) $blue = 0;\n\n\t\t\t\t\t$newcol = imagecolorallocate($this->image, $red, $green, $blue);\n\t\t\t\t\timagesetpixel($this->image, $x, $y, $newcol);\n\t\t\t\t}//end if\n\t\t\t}//end for\n\t\t}//end for\n\t}", "public function random();", "protected static function _writeNoise() {\n\t\tfor($i = 0; $i < 10; $i++){\n\t\t\t//Noise color\n\t\t $noiseColor = imagecolorallocate(\n\t\t self::$_image, \n\t\t mt_rand(150,225), \n\t\t mt_rand(150,225), \n\t\t mt_rand(150,225)\n\t\t );\n\t\t\tfor($j = 0; $j < 5; $j++) {\n\t\t\t\t//Draw noise\n\t\t\t imagestring(\n\t\t\t self::$_image,\n\t\t\t 5, \n\t\t\t mt_rand(-10, self::$imageL), \n\t\t\t mt_rand(-10, self::$imageH), \n\t\t\t self::$codeSet[mt_rand(0, 27)], //The text for the random noise letters or numbers\n\t\t\t $noiseColor\n\t\t\t );\n\t\t\t}\n\t\t}\n\t}", "private function randomColor()\n {\n return imagecolorallocate($this->image, rand(150, 200), rand(150, 200), rand(150, 200));\n }", "public function getRandomImage($position)\n\t{\n\t\t$min\t= 0;\n\t\t$offset\t= Model_Location::getImageType($position);\n\t\t$imagesArray = $this->getAllImages();\n\t\t$images\t= $imagesArray[$offset];\n\t\t$max\t= count($images) - 1;\n\t\t$image\t= $images[mt_rand($min, $max)];\n\t\treturn $image;\n\t}", "public function getRandomPicture()\n\t{\n\t\t//but beware as it is still possible its even possible that it does so multiple times\n\t\t//if it is increase the extra chance but this you shouldn't make it to high as it will reduce the randomness \n\t\t\n\t\t//get amount of entries in the database \n\t\t//if you know the amount use that instead but right now it could grow as people can still upload\n\t\t$sql=\"select count(*) as counter from photo\";\n\t\t$query = $this->db->prepare($sql);\n $query->execute();\n\t\t$countArray=$query->fetch();\n\t\t$count=$countArray->counter;\n\t\t$entry=rand(1,$count)-1;\n\t\t//try to get a random picture from the database\n\t\t$sql = sprintf(\"SELECT id,`file` FROM photo LIMIT %s,1\", $entry);\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute();\n\t\t//we now have a random selected picture\n\t\treturn $query->fetch();\n\t}", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "function create_image(){\r\n\t$wmark = imagecreatefrompng('img/stamp.png');\r\n\t//Load jpg image\r\n\t$image = imagecreatefromjpeg('img/image'.rand(1,3).'.jpg');\r\n\t\r\n\t//Get image width/height\r\n\t$width = imagesx($image);\r\n\t$height = imagesy($image);\r\n\t\r\n\t// Set the margins for the stamp and get the height/width of the stamp image\r\n\t$marge_right = 10;\r\n\t$marge_bottom = 10;\r\n\t$sx = imagesx($wmark);\r\n\t$sy = imagesy($wmark);\r\n\t\r\n\t// Copy the stamp image onto our photo using the margin offsets and the photo width to calculate positioning of the stamp. \r\n\timagecopy($image, $wmark, $width-$sx-$marge_right, $height-$sy-$marge_bottom,0,0,$sx,$sy);\r\n\t\r\n\t// Prepare the final image and save to path. If you only pass $image it will output to the browser instead of a file.\r\n\timagepng($image,\"generatedImage.png\");\r\n\t\r\n\t// Output and free memory\r\n\timagedestroy($image);\r\n}", "function tfnm_star_rating( $rating ){\n\t$image_name = floor( $rating );\n\t$decimal = $rating - $image_name;\n\n\tif( $decimal >= .5 ){\n\t\t$image_name .= '_half';\n\t}\n\n\treturn plugin_dir_url( dirname( __FILE__ ) ) . 'public/images/yelp_stars/web_and_ios/regular/regular_' . $image_name . '.png';\n}", "public function create_image(){\n\t\t$md5_hash = md5(rand(0,999));\n\t\t$security_code = substr($md5_hash, 15, 5);\n\t\t$this->Session->write('security_code',$security_code);\n\t\t$width = 80;\n\t\t$height = 22;\n\t\t$image = ImageCreate($width, $height);\n\t\t$black = ImageColorAllocate($image, 37, 170, 226);\n\t\t$white = ImageColorAllocate($image, 255, 255, 255);\n\t\tImageFill($image, 0, 0, $black);\n\t\tImageString($image, 5, 18, 3, $security_code, $white);\n\t\theader(\"Content-Type: image/jpeg\");\n\t\tImageJpeg($image);\n\t\tImageDestroy($image);\n\t}", "public function generate(Image $image);", "public function noise($value=30)\n\t{\n\t\t$this->checkImage();\n\t\t$value = max(0, min($value, 255));\n\t\t$imageX = $this->optimalWidth;\n\t\t$imageY = $this->optimalHeight;\n\t\t$rand1 = $value;\n\t\t$rand2 = -1 * $value;\n\n\t\tfor ($x = 0; $x < $imageX; ++$x) {\n\t\t\tfor ($y = 0; $y < $imageY; ++$y) {\n\t\t\t\tif (rand(0,1)) {\n\t\t\t\t\t$rgb = imagecolorat($this->imageResized, $x, $y);\n\t\t\t\t\t$red = ($rgb >> 16) & 0xFF;\n\t\t\t\t\t$green = ($rgb >> 8) & 0xFF;\n\t\t\t\t\t$blue = $rgb & 0xFF;\n\t\t\t\t\t$modifier = rand($rand2, $rand1);\n\t\t\t\t\t$red += $modifier;\n\t\t\t\t\t$green += $modifier;\n\t\t\t\t\t$blue += $modifier;\n\t\t\t\t\tif ($red > 255) $red = 255;\n\t\t\t\t\tif ($green > 255) $green = 255;\n\t\t\t\t\tif ($blue > 255) $blue = 255;\n\t\t\t\t\tif ($red < 0) $red = 0;\n\t\t\t\t\tif ($green < 0) $green = 0;\n\t\t\t\t\tif ($blue < 0) $blue = 0;\n\t\t\t\t\t$newCol = imagecolorallocate($this->imageResized, $red, $green, $blue);\n\t\t\t\t\timagesetpixel($this->imageResized, $x, $y, $newCol);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function get_random_header_image()\n {\n }", "function stars(){\n\n\n\t\tglobal $typeInt, $stars;\n\n\t\tif ($stars == '') return;\n\n\t\t$typearr = array(1,2,3,5,23);\n\n\t\tif (in_array($typeInt,$typearr)){\n\n\t\t\t$galleryLink = '<img src=\"/images/interface/'.$stars.'.star.hotel.gif\" alt=\"'.$stars.' star accommodation\" align=\"absbottom\" />';\n\n\t\treturn $galleryLink;\n\n\t\t}\n\n\t}", "public function __construct()\n\t{\n\t\t$this->digit=4;\n\t\t$this->picHeight=22;\n\t\t$this->picWidth=$this->digit*15;\n\t\t$this->border=1;//1 have border 0 no boder\n\t\t$this->fontSize=30;\n\t\t$this->alpha='';//\"abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWSYZ\";\n\t\t$this->number=\"0123456789\";\n\t\tsrand((double)microtime()*1000000);//Initialize random number\n\t\t//header(\"Content-type:image/png\");\n\t}", "function GenerateRating($rating, $location) {\nglobal $setting, $template;\n\t\t\n\tif ($location == 'wallpaper') {\n\t\t$empty_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['wallpaper_empty_star'].'\" alt=\"Rating star\" />';\n\t\t$half_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['wallpaper_half_star'].'\" alt=\"Rating star\" />';\n\t\t$star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['wallpaper_star'].'\" alt=\"Rating star\" />';\n\t}\n\telse if ($location == 'category') {\n\t\t$empty_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['category_empty_star'].'\" alt=\"Rating star\" />';\n\t\t$half_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['category_half_star'].'\" alt=\"Rating star\" />';\n\t\t$star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['category_star'].'\" alt=\"Rating star\" />';\n\t}\n\telse if ($location == 'homepage') {\n\t\t$empty_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['homepage_empty_star'].'\" alt=\"Rating star\" />';\n\t\t$half_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['homepage_half_star'].'\" alt=\"Rating star\" />';\n\t\t$star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['homepage_star'].'\" alt=\"Rating star\" />';\n\t}\n\telse {\n\t\t$empty_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['featured_empty_star'].'\" alt=\"Rating star\" />';\n\t\t$half_star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['featured_half_star'].'\" alt=\"Rating star\" />';\n\t\t$star = '<img src=\"'.$setting['site_url'].$setting['template_url'].'/images/'.$template['featured_star'].'\" alt=\"Rating star\" />';\n\t}\n\n\t\n\tif ($rating <= 0 ){$rating_images = $empty_star.$empty_star.$empty_star.$empty_star.$empty_star;}\n\tif ($rating >= 0.5){$rating_images = $half_star.$empty_star.$empty_star.$empty_star.$empty_star;}\n\tif ($rating >= 1 ){$rating_images = $star.$empty_star.$empty_star.$empty_star.$empty_star;}\n\tif ($rating >= 1.5){$rating_images = $star.$half_star.$empty_star.$empty_star.$empty_star;}\n\tif ($rating >= 2 ){$rating_images = $star.$star.$empty_star.$empty_star.$empty_star;}\n\tif ($rating >= 2.5){$rating_images = $star.$star.$half_star.$empty_star.$empty_star;}\n\tif ($rating >= 3 ){$rating_images = $star.$star.$star.$empty_star.$empty_star;}\n\tif ($rating >= 3.5){$rating_images = $star.$star.$star.$half_star.$empty_star;}\n\tif ($rating >= 4 ){$rating_images = $star.$star.$star.$star.$empty_star;}\n\tif ($rating >= 4.5){$rating_images = $star.$star.$star.$star.$half_star;}\n\tif ($rating >= 5 ){$rating_images = $star.$star.$star.$star.$star;}\n\t\n\treturn $rating_images;\n// Get rating END\n}", "public static function printStars($stars)\n {\n $redStars = 0;\n $halfStars = 0;\n $whiteStars = 5; \n if($stars)\n {\n $redStars = floor($stars);\n $halfStars = $stars - $redStars ? 1 : 0;\n $whiteStars = 5 - ceil($stars);\n }\n for($i = 1; $i <= $redStars; $i ++) echo \"<img src='theme/default/images/raty/star-on.png' />\";\n for($i = 1; $i <= $halfStars; $i ++) echo \"<img src='theme/default/images/raty/star-half.png' />\";\n for($i = 1; $i <= $whiteStars; $i ++) echo \"<img src='theme/default/images/raty/star-off.png' />\";\n }", "public function createImage1(){\n $this->createHexagon(150,75, 50, 200, 150, 325, 275, 325, 350,200, 275, 75);\n $this->createCircle(200, 200, 200, 200, 0, 360);\n $this->createLine(200, 125, 125, 200);\n $this->createLine(200, 125, 275, 200);\n $this->createLine(125, 200, 200, 275);\n $this->createLine(275, 200, 200, 275);\n $this->generateImage();\n }", "function randomPattern($x, $y = NULL, $density = 60)\n{\n if ($y === NULL) {\n $y = $x;\n }\n $p = '';\n for ($row=1; $row<=$y; $row++) {\n for ($col=1; $col<=$x; $col++) {\n if (rand(1,100) <= $density) {\n $p .= 'X';\n } else {\n $p .= ' ';\n }\n }\n $p .= \"\\n\";\n }\n \n return $p;\n}", "public function getImage() {\n $items = $this->getItems();\n shuffle($items); // Randomize order of items to generate different baords each load\n $board_arrangement = $this->arrange($items);\n\n $image = imagecreatetruecolor(IMGSIZE, IMGSIZE);\n $black = imagecolorallocate($image, 0, 0, 0);\n imagefill($image, 0, 0, $black);\n\n return $this->drawImage($image, $board_arrangement, 0, 0, IMGSIZE);\n }", "private function generate_image_ugly($code) {\n\t\t$pincode = ( int ) (1000000.0 * $code / (mt_getrandmax () + 1.0));\n\t\t$pincode = strval ( $pincode );\n\t\tif (! $this->generate_encrypt_string ( $pincode )) {\n\t\t\treturn false;\n\t\t}\n\t\t// print http header\n\t\t$this->set_code_key ();\n\t\t// set-cookie must be printed befor this\n\t\theader ( \"Content-type: image/\" . $this->imgtype . \"\\n\\n\" );\n\t\t// omit return value\n\t\t// create an image\n\t\t$img = imagecreate ( $this->imgwidth, $this->imgheight );\n\t\t// allocate color for image\n\t\t$color [ \"white\" ] = imagecolorallocate ( $img, 255, 255, 255 );\n\t\t$color [ \"black\" ] = imagecolorallocate ( $img, 0, 0, 0 );\n\t\t$color [ \"gray\" ] = imagecolorallocate ( $img, 40, 40, 40 );\n\t\t$color [ \"point\" ] = imageColorallocate ( $img, 80, 180, 40 );\n\t\t// (int)$num is equal to intval( $num)\n\t\tfor($i = 0; $i < (rand () % intval ( $this->imgwidth * $this->imgheight / 200 )); $i ++) {\n\t\t\t// draw a line\n\t\t\timageline ( $img, rand () % $this->imgwidth, \n\t\t\trand () % $this->imgheight, \n\t\t\trand () % $this->imgwidth, \n\t\t\trand () % $this->imgheight, $color [ \"black\" ] );\n\t\t}\n\t\t\n\t\tfor($i = 0; $i < intval ( $this->imgwidth * $this->imgheight / 20 ); $i ++) {\n\t\t\t// draw a single pixel\n\t\t\timagesetpixel ( $img, rand () % $this->imgwidth, \n\t\t\trand () % $this->imgheight, $color [ \"black\" ] );\n\t\t}\n\t\t// draw pincode horizontally\n\t\t$font = 5;\n\t\timagestring ( $img, $font, \n\t\t\t(imagesx ( $img ) / 2 - strlen ( $pincode ) * imagefontwidth ( $font ) / 2), \n\t\t\t(imagesy ( $img ) / 2 - imagefontheight ( $font ) / 2), \n\t\t\t$pincode, $color [ \"black\" ] );\n\t\t$showimgfunc = \"image\" . $this->imgtype;\n\t\t$showimgfunc ( $img );\n\t\t// destroy image\n\t\timagedestroy ( $img );\n\t\treturn true;\n\t}", "public function getStarImageHTML()\n {\n $message = 'num votes = ' . $this->numVotes;\n die($message);\n\n if ($this->numVotes < 1){\n return '(no votes yet)';\n }\n\n if ($this->voteAverage > 80){\n return '<img src=\"images/stars5.png\" alt=\"five starts star\">';\n }\n\n if ($this->voteAverage > 60){\n return '<img src=\"images/stars4.png\" alt=\"four star\">';\n }\n\n if ($this->voteAverage > 45){\n return '<img src=\"images/stars3.png\" alt=\"three star\">';\n }\n\n if ($this->voteAverage > 25){\n return '<img src=\"images/stars2.png\" alt=\"two star\">';\n }\n\n if ($this->voteAverage > 10){\n return '<img src=\"images/stars1.png\" alt=\"one star\">';\n }\n\n // if get here, just give half a star\n return '<img src=\"images/starsHalf.png\" alt=\"half star\">';\n\n }", "private function create_blank_image() {\r\n\t\t$image = imagecreatetruecolor( $this->diameter,$this->diameter );\r\n\r\n\t\t/* we also need a transparent background ... */\r\n\t\timagesavealpha($image, true);\r\n\r\n\t\t/* create a transparent color ... */\r\n\t\t$color = imagecolorallocatealpha($image, 0, 0, 0, 127);\r\n\r\n\t\t/* ... then fill the image with it ... */\r\n\t\timagefill($image, 0, 0, $color);\r\n\r\n\t\t/* nothing to do then ... just save the new image ... */\r\n\t\t$this->cutted_image = $image;\r\n\r\n\t\t/* go back and see what should we do next ..? */\r\n\t\treturn;\r\n\r\n\t}", "public function get_random_image($id, $type='thumb')\n\t{\n\t\t$images = ORM::factory('image')->where('tid', '=', $id)->find_all()->as_array();\n\t\tif(!empty($images)) {\n\t\t\tif($type == 'regular') {\n\t\t\t\treturn $images[rand(0,count($images)-1)]->path;\n\t\t\t} else if($type == 'thumb') {\t\t\t\n\t\t\t\t$img = explode(\".\", $images[rand(0, count($images)-1)]->path);\n\t\t\t\treturn $img[0] . '_thumb.' . $img[1];\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn \"images/default_thumb.jpg\";\n\t}", "function random_unsplash($width=800, $height=600, $raw=0, $randID=0) {\n\t$skipList = array(35, 312, 16, 403, 172, 268, 267, 349, 69, 103, 24, 140, 47, 219, 222, 184, 306, 70, 371, 385, 45, 211, 95, 83, 150, 233, 275, 343, 317, 278, 429, 383, 296, 292, 193, 299, 195, 298, 68, 148, 151, 129, 277, 333, 85, 48, 128, 365, 138, 155, 257, 37, 288, 407);\n\tif ( $randID == 0 ) {\n\t\t$randID = random_number_between_but_not(0, 506, $skipList); //Update the second number here as more Unsplash.it photos become available.\n\t}\n\tif ( $raw ) {\n\t\treturn 'http://unsplash.it/' . $width . '/' . $height . '?image=' . $randID;\n\t} else {\n\t\treturn 'http://unsplash.it/' . $width . '/' . $height . '?image=' . $randID . '\" title=\"Unsplash ID #' . $randID;\n\t}\n}", "function drawRating($rating) {\n $image = imagecreate(102,10);\n $back = ImageColorAllocate($image,0,0,0);\n echo $back;\n $border = ImageColorAllocate($image,0,0,0);\n $red = ImageColorAllocate($image,255,60,75);\n $fill = ImageColorAllocate($image,44,81,150);\n ImageFilledRectangle($image,0,0,101,9,$back);\n// ImageFilledRectangle($image,1,1,$rating,9,$fill);\n// ImageRectangle($image,0,0,101,9,$border);\n imagePNG($image,\"aaa.png\");\n imagedestroy($image);\n}", "private function _setRandomColor() {\r\n\t\t// Generate random color code.\r\n\t\t$color = array('R' => rand(0, 255), 'G' => rand(0, 255), 'B' => rand(0, 255));\r\n\t\t\r\n\t\t// Set generated color code.\r\n\t\treturn imagecolorallocate($this->_resource, $color['R'], $color['G'], $color['B']);\r\n\t}", "function bone_string($avg_rating) {\r\n $bone = \"\";\r\n $count = 0;\r\n while($count < $avg_rating) {\r\n $bone .= \"<img class='bone' src='../images/bone.png' alt='bone'>\";\r\n $count += 1;\r\n }\r\n return($bone);\r\n}", "public function getRandomImages($count=4) {\n\t\treturn $this->getImagesFromGET(\"https://dog.ceo/api/breeds/image/random/\".$count);\n\t}", "public function image();", "public function image();", "function random_image($dir){\n$directory=\"{$_SERVER['DOCUMENT_ROOT']}/novademo-localhost/$dir\";\n\n$leading = substr($directory,0,1);\n$trailing = substr($directory,-1,1);\n\nif($leading=='/')\n$directory=substr($directory,1);\n\nif($trailing!='/')\n$directory = $directory.'/';\nif(empty($directory) or !is_dir($directory))\n{\ndie('Directory :\"'.$directory.'\" ,Not Found...Sorry !!');\n}\n$files=scandir($directory,1);\n$make_array = array();\nforeach($files as $id => $files)\n{\n$info =pathinfo($directory.$file);\n$image_extensions = array('jpg','jpeg','png','gif','ico');\nif(!in_array($info['extension'],$image_extensions))\n\tunset($file);\nelse\n\t{\n\t$file=str_replace(' ','%20',$file);\n\t$temp=array($id=>$file);\n\tarray_push($make_array,$temp);\n\t}\n}\nif(sizeof($make_array)==0)\n{\ndie('No images in, \"'.$directory.'\" ,Directory');\n}\n$total = count($make_array)-1;\n$random_image=rand(0,$total);\nreturn $directory;\n$make_array[$random_image][$random_image];\n}", "private function custom_scatter($dist)\n\t{\n\t\t$imagex = imagesx($this->image);\n\t\t$imagey = imagesy($this->image);\n\n\t\tfor ($x = 0; $x < $imagex; ++$x)\n\t\t{\n\t\t\tfor ($y = 0; $y < $imagey; ++$y)\n\t\t\t{\n\n\t\t\t\t$distx = rand($dist * -1, $dist);\n\t\t\t\t$disty = rand($dist * -1, $dist);\n\n\t\t\t\tif ($x + $distx >= $imagex) continue;\n\t\t\t\tif ($x + $distx < 0) continue;\n\t\t\t\tif ($y + $disty >= $imagey) continue;\n\t\t\t\tif ($y + $disty < 0) continue;\n\n\t\t\t\t$oldcol = imagecolorat($this->image, $x, $y);\n\t\t\t\t$newcol = imagecolorat($this->image, $x + $distx, $y + $disty);\n\t\t\t\timagesetpixel($this->image, $x, $y, $newcol);\n\t\t\t\timagesetpixel($this->image, $x + $distx, $y + $disty, $oldcol);\n\n\t\t\t}\n\t\t}//end for\n\t}", "public function testGifRandom()\n {\n $gif = $this->service->random();\n $this->assertNotNull($gif);\n $this->assertNotEmpty($gif->title);\n $this->assertNotEmpty($gif->url);\n }", "private function generate_image_pretty($code) {\n\t\t// files needed\n\t\t$ffiles [ 0 ] = \"/usr/local/share/fonts/bookos.ttc\";\n\t\t$ffiles [ 1 ] = \"/usr/local/share/fonts/cour.ttc\";\n\t\t$ffiles [ 2 ] = \"/usr/local/share/fonts/georgia.ttc\";\n\t\t$ffiles [ 3 ] = \"/usr/local/share/fonts/gothic.ttc\";\n\t\tforeach ( $ffiles as $fontfile ){\n\t\t\tif (! file_exists ( $fontfile )) {\n\t\t\t\t$this->_seterror ( \"Font file doesn't exist\", - 4 );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$count = 0;\n\t\t$pincode = 100000;\n\t\twhile ( $pincode >= 100000 && ($count ++) < 10 ){\n\t\t\t$pincode = intval ( (1000000.0 * $code / (rand () + 1.0)) );\n\t\t}\n\t\t$pinstr = strval ( $pincode );\n\t\tif (! $this->generate_encrypt_string ( $pinstr )) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// print http header\n\t\t$this->set_code_key ();\n\t\t// set-cookie must be printed befor this\n\t\theader ( \"Content-type: image/\" . $this->imgtype . \"\\n\\n\" );\n\t\t// omit return value\n\t\t// create image\n\t\t$img = imagecreate ( $this->imgwidth, $this->imgheight );\n\t\t// get the index or the closest value of assigned color\n\t\t$colors [ 0 ] = imagecolorresolve ( $img, 255, 255, 255 ); // white\n\t\t$colors [ 1 ] = imagecolorresolve ( $img, 0, 0, 0 ); // black\n\t\t$colors [ 2 ] = imagecolorresolve ( $img, 9, 9, 53 );\n\t\t$colors [ 3 ] = imagecolorresolve ( $img, 53, 9, 9 );\n\t\t$colors [ 4 ] = imagecolorresolve ( $img, 10, 53, 10 );\n\t\t$colors [ 5 ] = imagecolorresolve ( $img, 53, 52, 58 );\n\t\t$colors [ 6 ] = imagecolorresolve ( $img, 41, 39, 29 );\n\t\t$colors [ 7 ] = imagecolorresolve ( $img, 41, 44, 14 );\n\t\t$colors [ 8 ] = imagecolorresolve ( $img, 16, 51, 54 );\n\t\t$colors [ 9 ] = imagecolorresolve ( $img, 34, 54, 27 );\n\t\t$colors [ 10 ] = imagecolorresolve ( $img, 71, 33, 16 );\n\t\t$x = 2;\n\t\t$y = 20;\n\t\t\n\t\t$fakeimg = imagecreate ( $this->imgwidth, $this->imgheight );\n\t\t\n\t\t// draw some confusion lines\n\t\t\n\t\tfor($i = 0; $i < strlen ( $pinstr ); $i ++) {\n\t\t\timagesetthickness ( $img, 3 * $i );\n\t\t\t$line_color = imagecolorallocate ( $img, rand ( 150, 255 ), rand ( 150, 255 ), rand ( 150, 255 ) );\n\t\t\t// draw a line\n\t\t\timageline ( $img, rand () % $this->imgwidth, \n\t\t\t\trand () % $this->imgheight, \n\t\t\t\trand () % $this->imgwidth, \n\t\t\t\trand () % $this->imgheight, $line_color );\n\t\t}\n\t\t\n\t\tfor($i = 0; $i < strlen ( $pinstr ); $i ++) {\n\t\t\t$size = $this->getrand ( 10, 15 );\n\t\t\t$angle = $this->getrand ( - 1500, 1500 ) * M_PI / 180;\n\t\t\t$nFont = $this->getrand ( 0, sizeof ( $ffiles ) - 1 );\n\t\t\t// can not user colors[0](white), number won't be shown well in\n\t\t\t// white\n\t\t\t$nColor = $this->getrand ( 1, sizeof ( $colors ) - 1 );\n\t\t\t$lastpos = array_fill ( 0, 7, 0 );\n\t\t\t// draw virtually\n\t\t\t$lastpos = imagettftext ( $fakeimg, $size, $angle, 0, 0, 0, $ffiles [ $nFont ], $pinstr [ $i ] );\n\t\t\t\n\t\t\tif ($lastpos [ 0 ] > $lastpos [ 6 ]) {\n\t\t\t\t$leftlean = TRUE;\n\t\t\t} else {\n\t\t\t\t$leftlean = FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t$drift_x = $leftlean ? $lastpos [ 0 ] - $lastpos [ 6 ] : 0;\n\t\t\t// draw a real number of pincode\n\t\t\t$lastpos = imagettftext ( $img, $size, $angle, $x + $drift_x, $y, $colors [ $nColor ], $ffiles [ $nFont ], $pinstr [ $i ] );\n\t\t\t$x += $leftlean ? $lastpos [ 2 ] - $lastpos [ 6 ] : $lastpos [ 4 ] - $lastpos [ 0 ] + 1;\n\t\t}\n\t\tfor($i = 0; $i < intval ( $this->imgwidth * $this->imgheight / 70 ); $i ++) {\n\t\t\t// draw a pixel\n\t\t\timagesetpixel ( $img, rand () % $this->imgwidth, rand () % $this->imgheight, $colors [ 1 ] );\n\t\t}\n\t\t\n\t\t$showimgfunc = \"image\" . $this->imgtype;\n\t\t$showimgfunc ( $img );\n\t\t// destroy image\n\t\timagedestroy ( $img );\n\t\t\n\t\treturn true;\n\t\n\t}", "public function randomAssetAction()\n {\n\n $this->setAlbumUidRestrictions();\n\n $mediaAlbum = $this->mediaAlbumRepository->findRandom();\n $this->view->assign('mediaAlbum', $mediaAlbum);\n }", "public function randomItem();", "protected function _makeImage()\n {\n $result = array();\n $width='170';\n $height='40';\n $characters= mt_rand(5,7);\n $possible = '123456789aAbBcCdDeEfFgGhHIijJKLmMnNpPqQrRstTuUvVwWxXyYZz';\n $code = '';\n $i = 0;\n while ($i < $characters) {\n $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);\n $i++;\n }\n $font = './fonts/Milonga-Regular.ttf';\n /* font size will be 70% of the image height */\n $font_size = $height * 0.67;\n try {\n $image = @imagecreate($width, $height);\n /* set the colours */\n $text_color = imagecolorallocate($image, 20, 40, 100);\n $noise_color = imagecolorallocate($image, 100, 120, 180);\n /* generate random dots in background */\n for( $i=0; $i<($width*$height)/3; $i++ ) {\n imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);\n }\n /* generate random lines in background */\n for( $i=0; $i<($width*$height)/150; $i++ ) {\n imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color);\n }\n /* create textbox and add text */\n $textbox = imagettfbbox($font_size, 0, $font, $code);\n $x = ($width - $textbox[4])/2;\n $y = ($height - $textbox[5])/2;\n imagettftext($image, $font_size, 0, $x, $y, $text_color, $font , $code);\n ob_start();\n imagejpeg($image);\n $image_code = ob_get_contents ();\n ob_end_clean();\n imagedestroy($image);\n $result = array();\n $result['1'] = base64_encode($image_code);\n Tinebase_Session::getSessionNamespace()->captcha['code'] = $code;\n } catch (Exception $e) {\n if (Core::isLogLevel(LogLevel::NOTICE)) Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' ' . $e->getMessage());\n }\n return $result;\n }", "public function createTemporaryImage()\n {\n $tmpDir = sys_get_temp_dir();\n $fileName = $tmpDir . DIRECTORY_SEPARATOR . 'image_project_unit_test_' . time() . rand() . '.jpg';\n $gd = imagecreatetruecolor(400, 300);\n imagefill($gd, 50, 50, 1);\n\n imagejpeg($gd, $fileName, 100);\n imagedestroy($gd);\n\n return $fileName;\n }", "public function run(Faker $faker)\n {\n $realestates_id = Realestate::all()->pluck('id')->toArray();\n for($i = 0 ; $i<100; $i++){\n $image_realestate = new Image_Realestate();\n $image_realestate->realestate_id = $faker->randomElement($realestates_id);\n $image_realestate->url = 'asset\\visitor\\img\\francesca-tosolini-XcVm8mn7NUM-unsplash.jpg' ;\n $image_realestate->save();\n }\n\n }", "function getUserImageInitial($userId, $name)\n{\n return getAvatarUrl().\"?name=$name&size=30&rounded=true&color=fff&background=\".getRandomColor($userId);\n}", "public function scatter($value=4)\n\t{\n\t\t$this->checkImage();\n\t\t$value = (int)$value;\n\t\t$imageX = $this->optimalWidth;\n\t\t$imageY = $this->optimalHeight;\n\t\t$rand1 = $value;\n\t\t$rand2 = -1 * $value;\n\n\t\tfor ($x = 0; $x < $imageX; ++$x) {\n\t\t\tfor ($y = 0; $y < $imageY; ++$y) {\n\t\t\t\t$distX = rand($rand2, $rand1);\n\t\t\t\t$distY = rand($rand2, $rand1);\n\t\t\t\tif ($x + $distX >= $imageX) continue;\n\t\t\t\tif ($x + $distX < 0) continue;\n\t\t\t\tif ($y + $distY >= $imageY) continue;\n\t\t\t\tif ($y + $distY < 0) continue;\n\t\t\t\t$oldCol = imagecolorat($this->imageResized, $x, $y);\n\t\t\t\t$newCol = imagecolorat($this->imageResized, $x + $distX, $y + $distY);\n\t\t\t\timagesetpixel($this->imageResized, $x, $y, $newCol);\n\t\t\t\timagesetpixel($this->imageResized, $x + $distX, $y + $distY, $oldCol);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function findRandom();", "private function makeSquare($image_path, $i)\n {\n//\n// $img1 = $this->image_instance($image_path[$i]);\n//\n// $img1->resize(520, 520);\n// $img1->save(public_path() . '/' . $this->store_path . '/' . $this->square_name);\n// $this->result['square_path'][$i] = $this->store_path . '/' . $this->square_name;\n//\n//\n//\n//\n//\n//\n//\n\n $this->square_name = $this->rand . 'square_image.jpg';\n\n $img1 = $this->image_instance($image_path[$i]);\n $img1->resize(520, 520);\n\n\n $watermark = Image::make(public_path($this->watermark_path));\n// $watermarkSize = $img->width() - 200; //size of the image minus 20 margins\n// $watermarkSize = $img->width() / 2; //half of the image size\n $watermarkSize = round($img1->width() * ((100 - $this->resizePercentage) / 100), 2); //watermark will be $resizePercentage less then the actual width of the image\n $watermark->resize($watermarkSize, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img1->insert($watermark, $this->position);\n\n\n $img1->save(public_path() . '/' . $this->store_path . '/' . $this->square_name);\n $this->result['square_path'][$i] = $this->store_path . '/' . $this->square_name;\n\n\n }", "function random_color_part() {\n\t\treturn str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);\n\t}", "private function randomArtName()\n {\n $art = $this->availableArt();\n\n return $art[array_rand($art)];\n }", "public function generateBlankImage($config){ \n\t\t$image = imagecreatetruecolor($config['img_width'], $config['img_height']);\n\t\timagesavealpha($image, true);\n\t\t$transparent = imagecolorallocatealpha($image, 0, 0, 0, 127);\n\t\timagefill($image, 0, 0, $transparent);\n\t\t// cache the output\n\t\tob_start();\n\t\timagepng($image);\n\t\t$img = ob_get_contents();\n\t\tob_end_clean();\n\t\t// return the string\n\t\treturn base64_encode($img);\n\t}", "public function colorImage() {}", "function getStarRating($rating){\r\n $statement = \"\";\r\n for($int= 0;$int<$rating;$int++){\r\n $statement .= \"<span class='fa fa-star checked' style='font-size:12px'></span>\";\r\n }\r\n return $statement;\r\n }", "function getStarRating($rating){\r\n $statement = \"\";\r\n for($int= 0;$int<$rating;$int++){\r\n $statement .= \"<span class='fa fa-star checked' style='font-size:12px'></span>\";\r\n }\r\n return $statement;\r\n }", "public function createImage3(){\n $this->triangleCreate(240, 100, 290, 50, 340, 100);\n $this->triangleCreate(40, 300, 90, 250, 140, 300);\n $this->triangleCreate(440, 300, 490, 250, 540, 300);\n $this->createLine(265, 100, 105, 265);\n $this->createLine(315, 100, 475, 265);\n $this->createLine(125, 285, 455, 285);\n $this->generateImage();\n }", "private function generate()\n {\n $output = '';\n $length = strlen($this->str);\n\n\n for ($i = 1; $i < 5; $i++) {\n // get random char\n $char = $this->str[rand(0, $length - 1)];\n $output .= $char;\n\n // get font size\n $fontSize = ($this->level > 1) ? rand(20, 48) : 28;\n imagettftext($this->imageResource, $fontSize, rand(-35, 35), 35 * $i, 55, imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)), $this->font, $char);\n }\n\n $this->code = ($this->caseSensitive) ? $output : strtolower($output);\n }", "function zuus_player() {\n\t$directory = get_template_directory() . '/images/zuus_player/';\n\t$files = glob($directory . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\n\n\t$image = '';\n\tif($files !== false) { \n\t\t$file = array_rand($files);\n\t\t$image = basename($files[$file]);\n\t}\n\t\n\tif($image != '') {\n\t\techo '<div class=\"zuus_player\">';\n\t\t\techo '<img class=\"img-responsive\" alt=\"zuus_player\" src=\"' . THEME_DIR . '/images/zuus_player/' . $image .'\" />';\n\t\techo '</div>';\n\t}\n\t\n}", "function displaySymbol($randomValue, $pos){\n \n \n switch($randomValue){\n case 0: $symbol = \"seven\";\n break;\n case 1: $symbol = \"cherry\";\n break;\n case 2: $symbol = \"lemon\";\n break;\n case 3: $symbol = \"grapes\";\n \n }\n \n echo \"<img id = 'reel$pos' src = 'img/$symbol.png' alt = '$symbol' title ='\".ucfirst($symbol). \"' width = '70' >\";\n }", "public function run()\n {\n for ($i = 0; $i <= 1000; $i++) {\n \\App\\Image::create([\n 'path' => '/images/product0'. rand(1, 9) . '.png',\n 'product_id' => rand(1, 60)\n ]);\n }\n }", "function random_color() {\n\t\treturn random_color_part() . random_color_part() . random_color_part();\n\t}", "function create_image($cap)\n\n{\n\n unlink(\"./assets/image1.png\");\n\n global $image;\n\n $image = imagecreatetruecolor(200, 50) or die(\"Cannot Initialize new GD image stream\");\n\n $background_color = imagecolorallocate($image, 255, 255, 255);\n\n $text_color = imagecolorallocate($image, 0, 255, 255);\n\n $line_color = imagecolorallocate($image, 64, 64, 64);\n\n $pixel_color = imagecolorallocate($image, 0, 0, 255);\n\n imagefilledrectangle($image, 0, 0, 200, 50, $background_color);\n\n for ($i = 0; $i < 3; $i++) {\n\n imageline($image, 0, rand() % 50, 200, rand() % 50, $line_color);\n\n }\n\n for ($i = 0; $i < 1000; $i++) {\n\n imagesetpixel($image, rand() % 200, rand() % 50, $pixel_color);\n\n }\n\n $text_color = imagecolorallocate($image, 0, 0, 0);\n\n ImageString($image, 22, 30, 22, $cap, $text_color);\n\n imagepng($image, \"./assets/image1.png\");\n $_SESSION[\"captcha\"] = $cap;\n}", "function rotateBg() {\r\n\tglobal $backgrounds, $bgImage, $i;\r\n\t$c = count($backgrounds);\r\n\tif ($c==0) return;\r\n\t$r = random($c);\r\n\tif ($backgrounds[$r]==''&&$i<10) {\r\n\t\t$i++;\r\n\t\trotateBg();\r\n\t} elseif ($i>=10) {\r\n\t\tif (!$bgImage||$bgImage=='') {\r\n\t\t\t$bgImage='bg_lock.gif';\r\n\t\t} else {\r\n\t\t\t$bgImage=$bgImage;\r\n\t\t}\r\n\t} else {\r\n\t\t$bgImage = $backgrounds[$r];\r\n\t};\r\n\treturn $bgImage;\r\n}", "function displaySymbol($randomValue){\n //using conditions\n //$randomValue = rand(0,4);\n echo $randomValue;\n \n /*\n if($randomValue == 0){\n $symbol =\"cherry\";\n }\n else if($randomValue == 1){\n $symbol =\"grapes\";\n }\n else if($randomValue == 2){\n $symbol =\"lemon\";\n }\n else if($randomValue == 3){\n $symbol =\"orange\";\n }\n else {\n $symbol =\"seven\";\n }\n */\n \n //trhee or more if statements\n switch ($randomValue){\n case 0 :\n $symbol =\"cherry\";\n break;\n case 1 :\n $symbol =\"grapes\";\n break;\n case 2 :\n $symbol =\"lemon\";\n break;\n case 3 :\n $symbol =\"orange\";\n break;\n case 4 :\n $symbol =\"seven\";\n break;\n }\n echo \"<img src='img/$symbol.png' alt='$symbol' title='\". ucfirst($symbol) .\"' width='70' >\";\n }", "function testGenRandom() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "function random_color_part() {\n return str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);\n}", "public static function seedRand() {\r\n\t\tsrand((int)((($m=microtime(true))-((int)$m))*pow(10,(int)log10(PHP_INT_MAX)))); \r\n\t}", "public function run()\n {\n Post::all()->each(function ($post){\n Image::factory()->times(rand(0,5))->create(['post_id' => $post->id]);\n\n// $image = Image::factory()->make();\n// $image->post_id = $post->id;\n// $image->save();\n });\n }", "static public function fake($Settings)\n {\n //====================================================================//\n // Image Faker Parameters\n $i = (int) mt_rand(0,count($Settings[\"Images\"]) - 1);\n $Dir = dirname(dirname(dirname(__DIR__))) . \"/Resources/img/\"; \n $File = $Settings[\"Images\"][$i];\n $FullPath = $Dir . $File;\n// $Name = \"Fake Image \" . substr(preg_replace('/[^A-Za-z0-9\\-]/', '', utf8_encode(mt_rand())), 0, 3);\n $Name = \"Fake Image \" . $i;\n \n //====================================================================//\n // Build Image Array\n $Image = array();\n //====================================================================//\n // ADD MAIN INFOS\n //====================================================================//\n // Image Name\n $Image[\"name\"] = $Name;\n //====================================================================//\n // Image Filename\n $Image[\"filename\"] = $File;\n $Image[\"file\"] = $File;\n //====================================================================//\n // Image File Identifier (Full Path Here)\n $Image[\"path\"] = $Dir . $File;\n //====================================================================//\n // Image Publics Url\n $Image[\"url\"] = filter_input(INPUT_SERVER, \"HTTP_HOST\") . $File;\n \n //====================================================================//\n // ADD COMPUTED INFOS\n //====================================================================//\n // Images Informations\n if (file_exists($FullPath) ) {\n $ImageDims = getimagesize($FullPath);\n $Image[\"width\"] = $ImageDims[0];\n $Image[\"height\"] = $ImageDims[1];\n }\n $Image[\"md5\"] = md5_file($FullPath);\n $Image[\"size\"] = filesize($FullPath);\n \n return $Image;\n }", "private function createImage() {\n $this->Imagick = new \\Imagick();\n\n /* Create the ImagickPixel object (used to set the background color on image) */\n $bg = new \\ImagickPixel();\n\n /* Set the pixel color to white */\n $bg->setColor( $this->bg_color );\n\n /* Create a drawing object and set the font size */\n $ImagickDraw = new \\ImagickDraw();\n\n /* Set font and font size. You can also specify /path/to/font.ttf */\n if ($this->font) $ImagickDraw->setFont($this->font);\n $ImagickDraw->setFontSize( $this->font_size );\n\n /* Create new empty image */\n $this->Imagick->newImage( $this->image_width, $this->image_height, $bg );\n\n /* Write the text on the image */\n $this->Imagick->annotateImage( $ImagickDraw, $this->text_position_left, $this->text_position_top, 0, $this->getCaptchaText() );\n\n /* Add some swirl */\n $this->Imagick->swirlImage( 20 );\n\n /* Create a few random lines */\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n\n /* Draw the ImagickDraw object contents to the image. */\n $this->Imagick->drawImage( $ImagickDraw );\n\n /* Give the image a format */\n $this->Imagick->setImageFormat( $this->image_format );\n }", "function catch_first_image() {\r\n global $post, $posts;\r\n $first_img = '';\r\n ob_start();\r\n ob_end_clean();\r\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\r\n $first_img = $matches [1] [0];\r\n\r\n if(empty($first_img)){ //Defines a default image\r\n $random = mt_rand(1, 20);\r\n echo get_bloginfo ( 'stylesheet_directory' );\r\n echo '/images/random/'.$random.'.jpg';\r\n }\r\n return $first_img;\r\n }", "function random_color($alpha = 1) {\n $red = rand(0, 255);\n $green = rand(0, 255);\n $blue = rand(0, 255);\n return \"rgba($red,$blue,$green,$alpha)\";\n}", "function generate() ;", "function getImage();", "private function generateThumbnailGD(){\n\t\t\n\t}", "public function generate()\r\n {\r\n if(!extension_loaded('gd'))\r\n {\r\n return Console::error(\"GD library is currently not supported in your machine.\");\r\n }\r\n\r\n if(!file_exists($this->image_path))\r\n {\r\n return Console::error(\"Location is missing or invalid.\");\r\n }\r\n\r\n if(!empty($this->images))\r\n {\r\n Console::log(\"Sprite \" . static::$version);\r\n Console::success(\"Sprite generation has started...\");\r\n Console::lineBreak();\r\n\r\n Console::warn(\"Sprite Name :\\e[39m \" . $this->name);\r\n Console::warn(\"Location :\\e[39m \" . $this->location);\r\n Console::warn(\"Icons Found :\\e[39m \" . sizeof($this->images));\r\n Console::warn(\"Image Type :\\e[39m \" . implode(\", \", $this->extensions));\r\n Console::warn(\"Image Path :\\e[39m \" . $this->image_path . \"\\sprite-\" . $this->name . \".png\");\r\n Console::warn(\"CSS Path :\\e[39m \" . $this->css_path . \"\\sprite-\" . $this->name . \".css\");\r\n\r\n $tiles = array();\r\n $width = 0;\r\n $height = 0;\r\n $largest_height = 0;\r\n $largest_heights = array();\r\n $canvas_width = 0;\r\n $canvas_height = 0;\r\n $n = 0;\r\n\r\n foreach($this->images as $image)\r\n {\r\n $n++;\r\n\r\n if($image->exists() && \r\n $image->getWidth() >= $this->getMinSize() && \r\n $image->getHeight() >= $this->getMinSize() &&\r\n $image->getWidth() <= $this->getMaxSize() &&\r\n $image->getHeight() <= $this->getMaxSize()\r\n )\r\n {\r\n $x = $width;\r\n $y = $height;\r\n $z = false;\r\n\r\n if($image->getHeight() > $largest_height)\r\n {\r\n $largest_height = $image->getHeight();\r\n }\r\n\r\n $tiles[] = new Tile($image, $x, $y);\r\n\r\n if(($width + $image->getWidth()) > $width && ($width + $image->getWidth()) <= $this->max_width)\r\n {\r\n $width += $image->getWidth();\r\n }\r\n\r\n if($width > $canvas_width)\r\n {\r\n $canvas_width = $width;\r\n }\r\n\r\n if($n == sizeof($this->images) && !$z)\r\n {\r\n $z = true;\r\n $largest_heights[] = $largest_height;\r\n }\r\n\r\n if(($width + $image->getWidth()) > $this->max_width)\r\n {\r\n $width = 0;\r\n $height += $largest_height;\r\n\r\n if(!$z)\r\n {\r\n $largest_heights[] = $largest_height;\r\n }\r\n\r\n $largest_height = 0;\r\n }\r\n }\r\n }\r\n \r\n if(empty($tiles))\r\n {\r\n return Console::error(\"No image assets to compile.\");\r\n }\r\n\r\n $canvas_height = array_sum($largest_heights);\r\n $canvas = imagecreatetruecolor($canvas_width, $canvas_height);\r\n $file_img = $this->image_path . '\\sprite-' . $this->name . '.png';\r\n $file_css = $this->css_path . '\\sprite-' . $this->name . '.css';\r\n $copies = array();\r\n $css = array();\r\n\r\n Console::warn(\"Canvas Width :\\e[39m \" . $canvas_width . 'px');\r\n Console::warn(\"Canvas Height :\\e[39m \" . $canvas_height . 'px');\r\n Console::lineBreak();\r\n\r\n if(file_exists($file_img))\r\n {\r\n Console::success(\"Existing sprite image has been deleted.\");\r\n unlink($file_img);\r\n }\r\n\r\n if(file_exists($file_css))\r\n {\r\n Console::success(\"Existing sprite stylesheet has been deleted.\");\r\n unlink($file_css);\r\n }\r\n\r\n imagefill($canvas, 0, 0, IMG_COLOR_TRANSPARENT);\r\n imagesavealpha($canvas, true);\r\n imagealphablending($canvas, true);\r\n\r\n if(!is_null($this->base_url))\r\n {\r\n $background = $this->base_url . \"/sprite-\" . $this->name . '.png';\r\n }\r\n else\r\n {\r\n $background = \"sprite-\" . $this->name . '.png';\r\n }\r\n\r\n $css[] = \".sprite-\" . $this->name . \"{background-image:url('$background') !important;background-color:transparent;background-repeat:no-repeat}\";\r\n\r\n foreach($tiles as $tile)\r\n {\r\n $image = $tile->getImage();\r\n $resource = $tile->getResource();\r\n\r\n imagecopy($canvas, $resource, $tile->getX(), $tile->getY(), 0, 0, $tile->getWidth(), $tile->getHeight());\r\n\r\n $copies[] = $resource;\r\n $styles = \".sprite-\" . $this->name . \"-\" . $image->getName() . \"{\";\r\n $styles .= \"background-position:\" . ($tile->getX() * -1) . \"px \" . ($tile->getY() * -1) . \"px !important;\";\r\n $styles .= \"width:\" . $tile->getWidth() . \"px;\";\r\n $styles .= \"height:\" . $tile->getHeight() . \"px\";\r\n\r\n $css[] = $styles . \"}\";\r\n }\r\n\r\n Console::success(\"Sprite image has been generated.\");\r\n imagepng($canvas, $file_img, $this->quality);\r\n imagedestroy($canvas);\r\n\r\n foreach($copies as $copy)\r\n {\r\n imagedestroy($copy);\r\n }\r\n\r\n $file = fopen($file_css, 'w');\r\n fwrite($file, implode(PHP_EOL, $css));\r\n fclose($file);\r\n\r\n Console::success(\"Sprite stylesheet has been generated.\");\r\n Console::success(\"Sprite has been successfully generated.\");\r\n }\r\n else\r\n {\r\n Console::error(\"No image assets to compile.\");\r\n }\r\n }", "public function getRandomAvatar(): string {\n\t\t$avatarsArray = $this->getAvatars();\n\n\t\treturn $avatarsArray[array_rand($avatarsArray)];\n\t}", "private function generateSpritemap ()\n {\n $sprites = $this->sprites;\n $len = count($sprites);\n $node;\n\n usort($sprites, function ( $a, $b ) {\n $asa = $a->height;\n $bsa = $b->height;\n return ($asa > $bsa) ? -1 : 1;\n });\n\n $packer = new SpritePacker;\n $packer->fit($sprites);\n\n $this->width = $packer->pack->w;\n $this->height = $packer->pack->h;\n\n $spritemap = imagecreatetruecolor($this->width, $this->height);\n $color = imagecolorallocatealpha($spritemap, 255, 255, 255, 127);\n imagefill($spritemap, 0, 0, $color);\n imagecolortransparent($spritemap, imagecolorallocatealpha($spritemap, 0, 0, 0, 127));\n imagealphablending($spritemap, false);\n imagesavealpha($spritemap, true);\n\n foreach ($sprites as $sprite) {\n if ($sprite->fit) {\n $fit = $sprite->fit;\n imagecopyresampled($spritemap, $sprite->getResource(), $fit->x, $fit->y, 0, 0, $sprite->width, $sprite->height, $sprite->original_width, $sprite->original_height);\n }\n }\n imagepng($spritemap, __DIR__.'/test.png');\n }", "function Generate()\n \t{\n \t\t\n \t}", "function sample($generator, $times, $seed = 10) {\n mt_srand($seed);\n return Eris\\Sample::of($generator, 'mt_rand')->repeat($times)->collected();\n}", "public function shuffle();", "public function definition()\n {\n $files = Storage::allFiles('/public/images');\n $randomFile = $files[rand(0, count($files) - 1)];\n\n return [\n 'status' => $this->faker->numberBetween(1,2),\n 'name' => $this->faker->city(),\n 'rating' => $this->faker->randomFloat(2,1,10),\n 'description' => $this->faker->paragraph(3),\n // 'image' => $this->faker->image('public/images', 140, 207, null, false),\n 'image' => basename($randomFile)\n ];\n }", "private static function writeNoise($im, int $width, int $height) {\n $codeSet = '2345678abcdefhijkmnpqrstuvwxyz';\n for ($i = 0; $i < 10; $i++) {\n // noise color\n $noiseColor = imagecolorallocate($im, mt_rand(150, 225), mt_rand(150, 225), mt_rand(150, 225));\n for ($j = 0; $j < 5; $j++) {\n // draw\n imagestring($im, 5, mt_rand(-10, $width), mt_rand(-10, $height), $codeSet[mt_rand(0, 29)], $noiseColor);\n }\n }\n }", "public function Random()\n {\n return parent::Random();\n }", "private function _getRandomAngle() {\r\n\t\t// Choose which random angle to use.\r\n\t\treturn (rand(0, 1)) ? rand(0, 60) : rand(300, 360);\r\n\t}", "function wc_rating_star_markup( $product_id ){\n if(get_post_type($product_id) == 'product'){\n $rating = get_post_meta( $product_id, '_wc_average_rating', true );\n $rating = floor($rating);\n \n for($star = 0; $star < $rating; $star++) { \n echo '<svg class=\"rating rating--active list-item__meta-icon icon\"><use xlink:href=\"' . get_template_directory_uri() . '/img/symbol-defs.svg#icon-star\"></use></svg>';\n } \n \n for($star = $rating; $star < 5; $star++){ \n echo '<svg class=\"rating list-item__meta-icon icon\"><use xlink:href=\"' . get_template_directory_uri() . '/img/symbol-defs.svg#icon-star\"></use></svg>';\n }\n }\n}", "protected function _createImage()\n {\n $this->_height = $this->scale * 60;\n $this->_width = 1.8 * $this->_height;\n $this->_image = imagecreate($this->_width, $this->_height);\n ImageColorAllocate($this->_image, 0xFF, 0xFF, 0xFF);\n }", "public function gen_thumbnail()\n {\n }", "public function gen_thumbnail()\n {\n }", "public function run()\n {\n $books = Book::all()->all();\n $count = sizeof($books)+1;\n shuffle($books);\n factory(App\\Picture::class,$count)->create()->each(function ($picture, $books) {\n $key = is_array($books) ? array_rand($books, 1):null;\n $book = is_array($books) ? $books[$key]:$books;\n $picture->book()->associate($book);\n $picture->save();\n unset($books[$key]);\n });\n\n }", "function is_random_header_image($type = 'any')\n {\n }", "function createImg()\n {\n // imagem de origem\n if ($this->ext == \"png\")\n $img_origem= imagecreatefrompng($this->origem);\n\t\telseif ($this->ext == \"gif\")\n $img_origem= imagecreatefromgif($this->origem);\n elseif ($this->ext == \"jpg\" || $this->ext == \"jpeg\")\n $img_origem= imagecreatefromjpeg($this->origem);\n\t\t\telseif ($this->ext == \"jpg\" || $this->ext == \"jpeg\")\n $img_origem= imagecreatefromwbmp($this->origem);\n return $img_origem;\n }", "public function generate();", "public function generate();" ]
[ "0.707569", "0.6469052", "0.6275206", "0.62309813", "0.6226524", "0.6219485", "0.6163294", "0.6142326", "0.5906499", "0.5887831", "0.58828706", "0.58058685", "0.57976896", "0.57786185", "0.5762002", "0.5724785", "0.56916887", "0.56537706", "0.56439424", "0.5578183", "0.557336", "0.5540969", "0.55322623", "0.55301946", "0.55122286", "0.5430395", "0.54289985", "0.5416233", "0.5383193", "0.5381465", "0.5341026", "0.5272311", "0.52619636", "0.5258072", "0.5237046", "0.5234222", "0.52303475", "0.5215744", "0.52125466", "0.5200133", "0.5169743", "0.51551056", "0.51551056", "0.5114705", "0.5079283", "0.50598806", "0.50465506", "0.5041379", "0.5004665", "0.50007886", "0.49946725", "0.4987879", "0.49860093", "0.49814948", "0.49773195", "0.49750605", "0.49661785", "0.49613047", "0.49545914", "0.49480358", "0.49480185", "0.49480185", "0.49458805", "0.4945645", "0.49430913", "0.49420157", "0.49373952", "0.49238858", "0.49025196", "0.49010575", "0.48919705", "0.48824444", "0.4882081", "0.48669976", "0.48658216", "0.48617068", "0.4852342", "0.48489454", "0.48486435", "0.48436034", "0.48430622", "0.48404714", "0.48100248", "0.4807987", "0.48059735", "0.48004687", "0.48003143", "0.47838208", "0.47834682", "0.47743943", "0.47655746", "0.4752922", "0.47473297", "0.47394523", "0.47255638", "0.47255638", "0.47238687", "0.47234765", "0.47173116", "0.47138166", "0.47138166" ]
0.0
-1
EDITAR PRODUCTO, se retornan los datos del id especificado (id de producto)
public function editarProductoModel($datosModel){ $stmt = Conexion::conectar()->prepare("SELECT * FROM products WHERE id = :id"); $stmt->bindParam(":id", $datosModel, PDO::PARAM_INT); $stmt->execute(); return $stmt->fetch(); $stmt->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editar_producto(){\t\t\n\t\t$this->accion=\"Editando Datos del Producto\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$this->fecha=$this->convertir_fecha($this->fecha);\n\t\t\t$sql=\"UPDATE producto SET nombre_pro='$this->nombre', categoria_pro='$this->categoria', prioridad_pro='$this->prioridad', detal_pro='$this->detal', mayor_pro='$this->mayor', limite_pro='$this->limite', descripcion_pro='$this->descripcion', claves_pro='$this->claves', marca_pro='$this->marca',hotel_pro='$this->hotel',principal_pro='$this->principal' WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/\");\n\t\t}else{\n\t\t $this->mostrar_producto();\n\t\t $sql=\"SELECT * FROM categoria ORDER BY prioridad_cat ASC\";\n\t\t $consulta=mysql_query($sql) or die(mysql_error());\n\t\t while ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t\t}\n\t}", "public function edit(Producto $producto)\n {\n \n }", "public function editarProducto($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"UPDATE producto set nombre='$datos[0]',descripcion='$datos[1]',imagen='$datos[2]', \n codigo_categoria='$datos[3]', stock='$datos[4]', precio='$datos[5]' WHERE id='$datos[6]'\";\n return $result= mysqli_query($conexion, $sql);\n }", "public function editarAction($idProducto){\n \n $em = $this->getDoctrine()->getManager();\n $producto_modif = $em->getRepository('TodoCerdoTodoCerdoBundle:Producto')->find($idProducto);\n \n \n if (!$producto_modif) {\n throw $this->createNotFoundException('El producto no existe');\n \n }\n \n $editForm = $this->createForm(new ProductoType(), $producto_modif);\n $deleteForm = $this->createDeleteForm($idProducto);\n \n\n return $this->render('TodoCerdoTodoCerdoBundle:Producto:editarProducto.html.twig', array(\n 'producto' => $producto_modif,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n \n \n }", "function editProducto($producto)\n{\n\t\t$con = getDBConnection();\n\t\t$sql = \"UPDATE productos SET nombre = :nombre, descripcion = :descripcion, precio = :precio WHERE id = :id\";\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->bindParam(':id', $producto->id);\n\t\t$stmt->bindParam(':nombre', $producto->nombre);\n\t\t$stmt->bindParam(':descripcion', $producto->descripcion);\n\t\t$stmt->bindParam(':precio', $producto->precio);\n\t\t$stmt->execute();\n}", "public function editar($idProducto){\n\n $producto = $this->request->getPost(\"producto\");\n $precio = $this->request->getPost(\"precio\");\n $descripcion = $this->request->getPost(\"descripcion\");\n\n if($this->validate('formularioEditarProducto')){\n \n // Intentar conectar a la base de datos e insertar Datos\n try {\n // Sacarle una fotocopia de la class (Crear un objeto)\n $modelo = new ProductoModel();\n\n // Armo el paquete de datos a registrar\n $datos = array(\n \"p_producto\" => $producto,\n \"p_precio\" => $precio,\n \"p_descripcion\" => $descripcion\n );\n // Agrego los datos\n $modelo->update($idProducto,$datos);\n\n // Entrego una respuesta\n $mensaje = \"Exito editando el producto\";\n return redirect()->to(site_url('/Producto'))->with('mensaje',$mensaje);\n\n } catch (\\Exception $error) {\n $mensaje = $error->getMessage();\n return redirect()->to(site_url('/Producto'))->with('mensaje',$mensaje);\n }\n\n }else{\n $mensaje= \"Falta información para la edición del producto\";\n return redirect()->to(site_url('/Producto'))->with('mensaje',$mensaje);\n }\n \n }", "public function updateProducto(){\n $sql='UPDATE producto set nombre = ?, precio = ?, descripcion = ?, foto = ?, estado = ?, idCategoria = ?, idProveedor = ? where idProducto = ?';\n $params= array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->proveedor, $this->id);\n return Database::executeRow($sql,$params);\n }", "public function edit(Product $produto)\n {\n //\n }", "public function edit(producto $producto)\n {\n //\n }", "public function updateAction($idProducto)\n {\n $em = $this->getDoctrine()->getManager();\n\n $producto = $em->getRepository('TodoCerdoTodoCerdoBundle:Producto')->find($idProducto);\n\n if (!$producto) {\n throw $this->createNotFoundException('No es posible encontrar la receta.');\n }\n \n \n \n $editForm = $this->createForm(new ProductoType(), $producto);\n $deleteForm = $this->createDeleteForm($idProducto);\n\n //$request = $this->getRequest();\n\n $request = Request::createFromGlobals();\n if ($request->getMethod() == 'POST') {\n \n $editForm->bind($request);\n \n $valido=false;\n $valido=$editForm->isValid();\n if ($valido) {\n $em->persist($producto);\n $em->flush();\n\n //return $this->redirect($this->generateUrl('TodoCerdoTodoCerdoBundle_editarproducto', array('idProducto' => $idProducto)));\n return $this->redirect($this->generateUrl('TodoCerdoTodoCerdoBundle_productos'));\n }\n }\n\n return $this->render('TodoCerdoTodoCerdoBundle:Producto:editarProducto.html.twig', array(\n 'producto' => $producto,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function EditarProducto($parametros = null){\n if($this->controller->isLogged() && $_SESSION[\"ADMIN\"]==1){\n $id = $parametros[':ID'];\n if(($_POST['producto'])!= null && ($_POST['precio'])!= null && ($_POST['marca'])!= null && ($_POST['temporada'])!= null){ \n $producto= $_POST['producto'];\n $precio = $_POST['precio'];\n $marca = $_POST['marca'];\n $temporada = $_POST['temporada'];\n $this->model->EditarProducto($id,$producto,$precio,$marca,$temporada);\n $productos = $this->model->GetInventario();\n $this->view->ShowProductos($productos);\n }else{\n header(\"Location: \".BASE_URL.\"adminProductos\");\n }\n }else{\n header(\"Location: \".BASE_URL.\"login\");\n }\n }", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function editar() {\n\t\t$POST = array();\n\n\t\tif(!empty($this->request->data['img']))\n\t\t{\t\t\t\t\t\n\t\t\t$this->request->data['img'] = $this->DIRUPLOAD.$this->request->data['img'];\t\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$imgAtual = $this->Produto->query(sprintf(\"Select img FROM produtos where id = %d\", $this->request->data['id']));\n\t\t\t$this->request->data['img'] = $imgAtual[0]['produtos']['img'];\n\t\t}\t\t\n\n\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\t\t\n\n\t\t$POST = array('Produto'=>$this->request->data);\t\n\t\tif ($this->Produto->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Produto editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu produto.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}", "public function edit(Produto $produto)\n {\n //\n }", "public function edit(SalidasProducto $salidasProducto)\n {\n //\n }", "function editar_pr_factura_inventario(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n\t $f = new Pr_factura();\n $f->get_by_id($u->pr_facturas_id);\n $u->espacios_fisicos_id = $f->espacios_fisicos_id;\n $u->lote_id = $f->lote_id;\n $u->costo_total = ($u->cantidad * $u->costo_unitario);\n\t$u->existencia = $u->cantidad;\n $u->cproveedores_id = $f->cproveedores_id;\n $u->fecha = date(\"Y-m-d H:i:s\");\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function editar(\n\t\t\t$prod_id, \n\t\t\t$prod_codigo, \n\t\t\t$prod_prefijo, \n\t\t\t$prod_nombre,\n\t\t\t$prod_descripcion,\t\n\t\t\t$prod_valor,\n\t\t\t$prod_valor_pronto_pago,\n\t\t\t$prod_stock\n\t\t){\n\n\t\t$sql = \"UPDATE producto \n\t\t\t\tSET prod_codigo = '$prod_codigo', \n\t\t\t\t\tprod_prefijo = '$prod_prefijo', \n\t\t\t\t\tprod_nombre = '$prod_nombre',\n\t\t\t\t\tprod_descripcion = '$prod_descripcion',\t\n\t\t\t\t\tprod_valor = '$prod_valor',\n\t\t\t\t\tprod_valor_pronto_pago = '$prod_valor_pronto_pago',\n \t\t\t\t\tprod_stock = '$prod_stock' \n\t\t\t\tWHERE prod_id = '$prod_id'\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public static function updateProduct( $data )\n {\n $consulta = DataBase::consulta(\"select * from productos where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\");\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Comprobar si el nuevo producto editado existe\n if(count($consulta) > 0 ) {\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$consulta[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n\n } else {\n\n DataBase::insertar('\n insert into productos (producto, categoria)\n values (\"'.$data[\"editNameProduct\"].'\", '.$data[\"editCategoryProduct\"].')\n ');\n $idProducto = DataBase::consulta(\"\n select idProducto from productos\n where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\n \");\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$idProducto[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n }\n }", "public function edit(productos_cia $productos_cia)\n {\n //\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}", "static public function editProduct($datos){\n\n\t\tif(isset($datos[\"idProducto\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $datos[\"tituloProducto\"]) && preg_match('/^[,\\\\.\\\\a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"descripcionProducto\"]) ){\n\n\t\t\t\t/*=============================================\n\t\t\t\tELIMINAR LAS FOTOS DE MULTIMEDIA DE LA CARPETA cuando se elige eliminar las fotos del modal\n\t\t\t\t=============================================*/\n\t\t\t\tif($datos[\"tipo\"] == \"fisico\"){\n\n\t\t\t\t\t$item = \"id\";\n\t\t\t\t\t$valor = $datos[\"idProducto\"];\n\n\t\t\t\t\t$traerProductos = ProductsModel::showProducts(\"products\", $item, $valor);\n\n\t\t\t\t\tforeach ($traerProductos as $key => $value) {\n\t\t\t\t\t\n\t\t\t\t\t\t$multimediaBD = json_decode($value[\"multimedia\"],true);\n\t\t\t\t\t\t$multimediaEditar = json_decode($datos[\"multimedia\"],true);\n\n\t\t\t\t\t\t$objectMultimediaBD = array();\n\t\t\t\t\t\t$objectMultimediaEditar = array();\n\n\t\t\t\t\t\tforeach ($multimediaBD as $key => $value) {\n\n\t\t\t\t\t\t array_push($objectMultimediaBD, $value[\"foto\"]);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($multimediaEditar as $key => $value) {\n\n\t\t\t\t\t\t array_push($objectMultimediaEditar, $value[\"foto\"]);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* array_duff Compara array1 con uno o más arrays y devuelve los valores de array1 que no estén presentes en ninguno de los otros arrays.\n\t\t\t\t\t\tes decir devuelve las fotos eliminadas en el modal al editar el producto*/\n\n\t\t\t\t\t\t$borrarFoto = array_diff($objectMultimediaBD, $objectMultimediaEditar);\n\n\t\t\t\t\t\tforeach ($borrarFoto as $key => $value) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tunlink(\"../\".$value);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PORTADA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaPortada = \"../\".$datos[\"antiguaFotoPortada\"];\n\n\t\t\t\tif(isset($datos[\"fotoPortada\"][\"tmp_name\"]) && !empty($datos[\"fotoPortada\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tBORRAMOS ANTIGUA FOTO PORTADA\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tunlink(\"../\".$datos[\"antiguaFotoPortada\"]);\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPortada\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 1280;\n\t\t\t\t\t$nuevoAlto = 720;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PRINCIPAL\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaFotoPrincipal = \"../\".$datos[\"antiguaFotoPrincipal\"];\n\n\t\t\t\tif(isset($datos[\"fotoPrincipal\"][\"tmp_name\"]) && !empty($datos[\"fotoPrincipal\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tBORRAMOS ANTIGUA FOTO PRINCIPAL\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tunlink(\"../\".$datos[\"antiguaFotoPrincipal\"]);\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 400;\n\t\t\t\t\t$nuevoAlto = 450;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN OFERTA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaOferta = \"../\".$datos[\"antiguaFotoOferta\"];\n\n\t\t\t\tif(isset($datos[\"fotoOferta\"][\"tmp_name\"]) && !empty($datos[\"fotoOferta\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tBORRAMOS ANTIGUA FOTO OFERTA\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"antiguaFotoOferta\"] != \"\"){\n\n\t\t\t\t\t\tunlink(\"../\".$datos[\"antiguaFotoOferta\"]);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoOferta\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 640;\n\t\t\t\t\t$nuevoAlto = 430;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\t\t\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tPREGUNTAMOS SI VIENE OFERTE EN CAMINO\n\t\t\t\t=============================================*/\n\t\t\t\tif($datos[\"selActivarOferta\"] == \"oferta\"){\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t\t\t \"id\"=>$datos[\"idProducto\"],\n\t\t\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t\t\t \"idCabecera\"=>$datos[\"idCabecera\"],\n\t\t\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"], \n\t\t\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t\t\t \"oferta\"=>1,\n\t\t\t\t\t\t\t\t \"precioOferta\"=>$datos[\"precioOferta\"],\n\t\t\t\t\t\t\t\t \"descuentoOferta\"=>$datos[\"descuentoOferta\"],\n\t\t\t\t\t\t\t\t \"imgOferta\"=>substr($rutaOferta,3),\n\t\t\t\t\t\t\t\t \"finOferta\"=>$datos[\"finOferta\"]\n\t\t\t\t\t\t\t\t );\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t \t\t \"id\"=>$datos[\"idProducto\"],\n\t\t\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t\t\t \"idCabecera\"=>$datos[\"idCabecera\"],\n\t\t\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"],\n\t\t\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t\t\t \"oferta\"=>0,\n\t\t\t\t\t\t\t\t \"precioOferta\"=>0,\n\t\t\t\t\t\t\t\t \"descuentoOferta\"=>0,\n\t\t\t\t\t\t\t\t \"imgOferta\"=>\"\",\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \"finOferta\"=>\"\"\n\t\t\t\t\t\t\t\t );\n\n\t\t\t\t}\n\n\t\t\t\tHeadersModel::editHeader(\"headers\", $datosProducto);\n\n\t\t\t\t$respuesta = ProductsModel::editProduct(\"products\", $datosProducto);\n\n\t\t\t\treturn $respuesta;\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El nombre del producto no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t}", "public function edit($id)\n {\n $guzzle = new Guzzle;\n \n try{\n $response = $guzzle->request('GET', URL_API . \"products/{$id}\", [\n 'headers' => [\n 'Authorization' => \"Bearer {$this->token}\",\n ],\n \"http_errors\" => false,\n \n ]);\n \n $product = json_decode($response->getBody())->data;\n \n $title = \"Editar Produtos: {$product->nome}\";\n \n return view('testes-api.produtos.edit', compact('product','title'));\n //dd(json_decode($response->getBody()));\n }catch(ClientException $e){\n $responseBody = $e->getResponse();\n \n dd($responseBody);\n }catch (RequestException $e) {\n $responseBody = $e->getResponse();\n \n dd($responseBody);\n }\n }", "function editar_producto($id_producto)\n {\n \t $data=$this->cunsultas();\n \t $data['consulta_producto']=producto::\n \tjoin('categoria','producto.id_categoria','=','categoria.id')\n \t->join('unidad','producto.id_unidad','=','unidad.id')\n \t->where('producto.id',$id_producto)\n\t->first();\n \t return view('paginas.editar_producto',$data);\n }", "public function edit($id)\n {\n $producto=Productos::find($id); \n\n $prov=Proveedor::find($producto->codgo_prov); \n\n $tipo_producto = DB::table('deta_parametros')\n -> where('deta_parametros.cod_parametro','=',$this->cod_tipo_producto)\n -> lists('deta_parametro','id');\n\n return view('productos.editar',compact('producto','tipo_producto','prov'));\n }", "public function edit(Produtos $produtos)\n {\n //\n }", "public function updateAction(Request $request, $id)\n{\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Productosprogramas')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Productosprogramas entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n $accion = ' ';\n $this->get(\"gema.utiles\")->traza($accion);\n $em->flush();\n\n \n \n\n \n return $this->redirect($this->generateUrl('admin_productosprogramas_edit', array('id' => $id)));\n \n}", "public function edit(ProductosServicio $productosServicio)\n {\n //\n }", "public function edit($id)\n {\n $producto = Producto::findOrFail($id);\n $oferta = $producto->oferta;\n $proveedor = Proveedor::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $categorias = Categoria::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $familias = Familia::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $subfamilias = Subfamilia::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $monedacompra = Moneda::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $subfamiliaId = $producto->subfamilia->id;\n $monedas = Moneda::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $currency = Moneda::where('id','=', $producto->monedacompra)->first();\n $currency = $currency->id;\n $origin = $producto->origen;\n\n $ultCodigo = Producto::orderBy('id','DESC')->first();\n if(is_null($ultCodigo)){\n $ultCodigo = 0;\n } else {\n $ultCodigo = intVal($ultCodigo->codigo);\n }\n\n switch ($producto->monedacompra) {\n case 1:\n $costo = $producto->costopesos;\n break;\n case 2:\n $costo = $producto->costodolar;\n break;\n case 3:\n $costo = $producto->costoeuro;\n break;\n default:\n $costo = $producto->costopesos;\n break;\n }\n \n return view('vadmin.productos.edit')\n ->with('producto', $producto)\n ->with('ultCodigo', $ultCodigo)\n ->with('oferta', $oferta)\n ->with('proveedor', $proveedor)\n ->with('categorias', $categorias)\n ->with('familias', $familias)\n ->with('subfamilias', $subfamilias)\n ->with('subfamiliaId', $subfamiliaId)\n ->with('origin', $origin)\n ->with('monedacompra', $monedacompra)\n ->with('monedas', $monedas)\n ->with('currency', $currency);\n\n }", "function editaProducte($idProducte, $nom, $descripcio, $preu){\n $conn=connexioBD();\n $sql=\"UPDATE productes SET nom='$nom', descripcio='$descripcio', preu='$preu' WHERE id='$idProducte'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al editar\".$conn->error);\n }\n $conn->close();\n}", "public function edit(Product $product) //Editar\n {\n //\n }", "function editar_temporada_producto(){\t\t\n\t\t$this->accion=\"Editar Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$temporada=$_GET['id'];\n\t\t\t$this->asignar_valores2();\n\t\t\t$this->desde=$this->convertir_fecha($this->desde);\n\t\t\t$this->hasta=$this->convertir_fecha($this->hasta);\n\t\t\t\n\t\t\t$sql=\"UPDATE temporadas2 SET activa='$this->mostrar', orden='$this->prioridad', fecha_inicio='$this->desde', fecha_fin='$this->hasta', texto_alternativo='$this->alternativo', titulo_adicional='$this->titulo', precio_pax_adic='$this->paxadicional', edadNinosDesde1='$this->desde_a', edadNinosHasta1='$this->hasta_a', precio_ninos='$this->precio_a', edadNinosDesde2='$this->desde_b', edadNinosHasta2='$this->hasta_b', precio_ninos2='$this->precio_b' WHERE id='$temporada'\";\n\t\t\t\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}else{\n\t\t\t$this->mostrar_temporada();\n\t\t}\n\t}", "public function edit($id)\n {\n $shop = DB::table('products')->select(\n 'products.*',\n 'products.id as pro_id',\n 'categories.*',\n 'shops.*'\n )\n ->leftjoin('shops','shops.id', 'products.shop_id')\n ->leftjoin('categories','categories.id', 'products.cat_id')\n ->where('products.id', $id)\n ->where('products.user_id', Auth::user()->id)\n ->first();\n\n $data['objs'] = $shop;\n // dd($shop);\n\n $cat = DB::table('categories')->select(\n 'categories.*'\n )\n ->where('user_id', Auth::user()->id)\n ->orderBy('id', 'asc')\n ->get();\n\n $data['cat'] = $cat;\n\n\n $shop_id = DB::table('shops')->select(\n 'shops.*'\n )\n ->where('user_id', Auth::user()->id)\n ->orderBy('id', 'desc')\n ->get();\n\n $data['shop_id'] = $shop_id;\n\n $img_all = DB::table('product_images')->select(\n 'product_images.*'\n )\n ->where('product_id', $id)\n ->get();\n $data['img_all'] = $img_all;\n\n $data['header'] = 'แก้ไข '.$shop->product_name;\n $data['url'] = url('admin/product/'.$id);\n $data['method'] = \"put\";\n return view('admin.product.edit',$data);\n }", "public function editar($codigoProduto) {\n\t\t\t\n\t\t$produto = $this->produtoModel->retornaProduto($codigoProduto);\n\t\t\n\t\tif (empty($produto)) {\n\t\t\tredirect('produto', $this->session->set_flashdata('erro', 'Produto não encontrado'));\n\t\t}\n\t\t\n\t\t$data = array(\n\t\t\t'codigoProduto' => $produto[0]->codigoProduto, \n\t\t\t'valor' => $produto[0]->precoProduto,\n\t\t\t'quantidade' => $produto[0]->qtdeProduto,\n\t\t\t'descricao' => $produto[0]->descricaoProduto\n\t\t);\n\t\t\n\t\t$data['titulo'] = \"Editar Produto\";\n\t\t\t\t\n\t\t$this->load->view('partials/header');\n\t\t$this->load->view('produto', $data);\n\t\t$this->load->view('partials/footer');\n\t}", "public function updateProducto($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE productos SET nombre=:nombre, precio=:precio,codigo=:codigo, ruta_img=:ruta_img,idCategoria=:idCategoria WHERE idProducto=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":precio\", $datos[\"precio\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":codigo\", $datos[\"codigo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":ruta_img\", $datos[\"foto\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":idCategoria\", $datos[\"categoria\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n }", "public function edit($id)\n {\n //\n\n $objeto= SeccionTiendaProducto::find($id);\n \n $matrizListado= SeccionTiendaCategoria::select('id', 'nombre')->get();\n $arrayListado = array();\n \n foreach($matrizListado as $arr) {\n $arrayListado[$arr->id] = $arr->nombre;\n }\n \n return view('adm.seccion_tienda_productos.editar', compact('objeto'), ['arrayListado' => $arrayListado, 'accion' => 'update', 'verbo' => 'post', 'nombreDeAccion' => 'Editar producto']);\n }", "static public function ctrEditarProductoInventario(){\n\n\t\tif(isset($_POST[\"editarNombre\"])){\n\n\t\t\t\n/*\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoCliente\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"nuevoDocumentoId\"]) &&\n\t\t\t preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"nuevoEmail\"]) && \n\t\t\t preg_match('/^[()\\-0-9 ]+$/', $_POST[\"nuevoTelefono\"]) && \n\t\t\t preg_match('/^[#\\.\\-a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaDireccion\"]))*/\n\n\t\t\t \t$tabla = \"inventario\";\n\n \n\t\t\t \t$datos = array(\n\t\t\t \t\t\"id\"=>$_POST[\"idInventarioEdicion\"],\n\t\t\t \t\t\"codigo_barras\"=>$_POST[\"editarCodigo\"],\n\t\t\t\t\t \"nombre\"=>$_POST[\"editarNombre\"],\n\n\t\t\t\t\t \"cantidad_alerta\"=>$_POST[\"editarCantidadAlerta\"],\n\t\t\t\t\t \"costo_ideal\"=>$_POST[\"editarCostoIdeal\"],\n\t\t\t\t \n\t\t\t\t\t \n\n\t\t\t\t\t \"medida_ingreso\"=>$_POST[\"editarMedida\"]);\n\n\t\t\t\t\t\n\t\t\t \t$respuesta = ModeloInventario::mdlEditarInventario($tabla, $datos);\n\n\n\tif( \t$respuesta == \"ok\" ) {\n\n\n \n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El producto ha sido creado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"inventario\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t \n\n\t\t\t\t} else echo '<script>\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"'.$respuesta. '\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t}).then(function(result){\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location = \"inventario\";\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t</script>';\n\n\t\t\n\n\t\t} \n\n\t}", "public function edit($id)\n {\n //\n $producto = Producto::find($id);\n // dd($producto);\n return view('editarProducto', compact('producto'));\n }", "function editProduct()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$category=Core_Settings_CManageProducts::displayCategory($query->records[0]['category_parent_id']);\n\t\t\t\n\t\t\t$sqlid='select category_id from category_table where category_id in(select category_id \n\t\t\tfrom products_table where product_id='.$id.')';\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$subcat=Core_Settings_CManageProducts::displaySubCategory($query->records[0]['category_id']);\n\t\t\t\n\t\t\treturn Display_DManageProducts::editProduct($obj->records,$category,$subcat);\n\t }\n\t}", "public function editarProducto(Request $request){\n $datos = $request[\"json_datos\"];\n return ProductoModel::editarProducto($datos);\n }", "public function edit(TipoProductos $tipoProductos)\n {\n //\n }", "public function editProduct($id = 0){\n Session::put('menu_item_parent', 'content');\n Session::put('menu_item_child', 'products');\n Session::put('menu_item_child_child', '');\n\n $communities = Community::where('status', 1)->get();\n $providers = Provider::get();\n $OfferProduct = OfferProduct::where('productIdx', $id)->get()->first();\n if(!$OfferProduct){\n Session::flash('flash_error', 'Record you are looking to edit is not found or deleted.');\n return back();\n }\n $data = array('id', 'communities', 'OfferProduct','providers');\n \n return view('admin.products_edit', compact($data));\n }", "public function edit($id)\n {\n $sql1 = \"SELECT id, nombre FROM tb_marcas\";\n $marcas = DB::select($sql1);\n $sql2 = \"SELECT id, nombre_tipo_alimento FROM tb_tipos_alimentos\";\n $tipo_alimentos = DB::select($sql2);\n $sql3 = \"SELECT id, nombres FROM tb_dirigidos\";\n $dirigidos = DB::select($sql3);\n $producto = tb_producto::FindOrFail($id);\n return view('productos.editar', compact('producto', 'marcas', 'tipo_alimentos', 'dirigidos'));\n }", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Productosprogramas')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Productosprogramas entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('gemaBundle:Productosprogramas:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editar() {\n if ($this->session->userdata('rol') == NULL || $this->session->userdata('rol') != 1) {\n redirect(base_url() . 'iniciar');\n }\n $dato = ['titulo' => \" Editar producto\",\n 'es_usuario_normal' => FALSE,\n 'perfil' => $this->usuario_model->consultarPerfil($this->session->userdata('idUsuario')),\n 'mrol' => $this->usuario_model->mostrarRol($this->session->userdata('rol'))];\n\n// $data['subcategorias'] = $this->subcategoria_model->obtenerSubCategorias();\n\n $idProducto = $this->uri->segment(3);\n $obtenerProducto = $this->productos_model->obtener_productos_a_modificar($idProducto);\n\n // cargar el helper de manejo de formularios\n $this->load->helper('form');\n // cargar libreria para validar formularios\n\n if ($obtenerProducto != FALSE) {\n foreach ($obtenerProducto->result() as $fila) {\n $DescripcionProducto = strip_tags(trim($fila->DescripcionProducto));\n $NombreProducto = strip_tags(trim($fila->NombreProducto));\n $minimoStock = $fila->minimoStock;\n $MaximoStock = $fila->MaximoStock;\n $Existencias = $fila->Existencias;\n $subcategoria = $fila->Subcategoria_idSubcategoria;\n }\n $data = array(\n 'id' => $idProducto,\n 'descripcion' => rtrim($DescripcionProducto),\n 'producto' => $NombreProducto,\n 'minStock' => $minimoStock,\n 'maxStock' => $MaximoStock,\n 'exist' => $Existencias,\n 'idsub' => $subcategoria,\n 'categorias_select' => $this->categoria_model->traerCategoriasXSubcategoria(),\n 'nombreSub' => $this->productos_model->obtener_nombreSubcategoria($subcategoria),\n 'nombreCategoria' => $this->productos_model->obtener_nombreCategoria($subcategoria)\n );\n } else {\n $data = '';\n return FALSE;\n }\n $this->load->view('templates/admin/headerAdmin', $dato);\n $this->load->view('templates/admin/menuV');\n $this->load->view('templates/admin/menuH', $dato);\n $this->load->view('productos/actualizaProducto', $data);\n $this->load->view('templates/admin/Fadmin');\n }", "public function editProduct($id)\n {\n $this->isAdmin();\n\n $productModel = new ProductModel();\n\n $pattern = 'adminProduct';\n $this->isReferer($pattern);\n\n if ($_POST) {\n\n if ($_POST['title'] && $_POST['vendor'] && $_POST['type'] && $_POST['price'] && $_POST['description']) {\n\n $validateResult = $productModel->validate($_POST);\n\n if ($validateResult === true) {\n\n if ($productModel->editProduct($_POST, $id)) {\n\n FileCache::deleteCache(CACHE_DIRECTORY);\n\n if ($this->uploadImage($_FILES['image'], $id)) {\n\n Session::set('admin-success', 'Товар отредактирован c изменением изображения');\n\n } else {\n\n Session::set('admin-success', 'Товар отредактирован без изменения изображения');\n }\n\n header(\"Location: /adminProduct\");\n die();\n\n } else {\n\n Session::set('admin-warning', 'Произошла ошибка');\n\n header(\"Location: /adminProduct\");\n die();\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля со * должны быть заполнены';\n }\n }\n\n $this->data['productInfo'] = $productModel->getById($id);\n\n $this->adminRender('edit');\n }", "function actualizar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t$tipo = ($datos['tipo'] == 1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql = \"UPDATE app_productos SET codigo = '\" . $datos['codigo'] . \"', nombre = '\" . $datos['nombre'] . \"', minimos = \" . $datos['cant_min'] . \", factor= '\".$datos['factor'].\"' WHERE id=\".$datos['id_receta'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function editOwnProduct($editProductName, $editProductDescription, $editProductImage, $editProductQuantity, $editProductPrice, $productId) {\n\n $query = $this->db->prepare(\"UPDATE `products` SET `product_name` = ?, `product_description` = ?, `product_image_url` = ?, `product_quantity` = ?, `product_price` = ? WHERE `product_id` = ?\");\n\n $query->bindValue(1, $editProductName);\n $query->bindValue(2, $editProductDescription);\n $query->bindValue(3, $editProductImage);\n $query->bindValue(4, $editProductQuantity);\n $query->bindValue(5, $editProductPrice);\n $query->bindValue(6, $productId);\n\n\n try {\n\n $query->execute();\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "function editar_producto_precio($id, $precio){\n\t\t$conexion_bd = conectar_bd();\n\t\t\n\t\t//Prepaprar la consulta\n\t\t$dml = 'UPDATE `producto` SET `precio` = precio WHERE `producto`.`id` = id ';\n\t\tif ( !($statement = $conexion_bd->prepare($dml)) ){\n\t\t\tdie(\"Error: (\" . $conexion_bd->errno . \") \" . $conexion_bd->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Unir los parametros de la funcion con los parametros de la consulta\n\t\t// El primer argumento de bind_param es el formato de cada parametro\n\t\tif (!$statement->bind_param(\"s\", $precio)) {\n\t\t\tdie(\"Error en vinculación: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Ejecutar la consulta\n\t\tif (!$statement->execute()) {\n\t\t\tdie(\"Error en ejecución: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t//Desconectarse de la base de datos\n\t\t\t desconectar_bd($conexion_bd);\n\t\t\t return 1;\n \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(product $product)\n {\n //\n }", "public function edit(product $product)\n {\n //\n }", "public function edit(product $product)\n {\n //\n }", "public function editarPagoController()\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{\n\t\t\t\t$datosController = $_GET[\"id\"];\n\t\t\t\t$respuesta = Datos::editarPagoModel($datosController, \"pagos\");\n\t\t\t\t$actualDate = $respuesta['fecha_envio'];\n\t\t\t\t$newDate = date('Y-m-d\\TH:i:s', strtotime($actualDate));\n\n\t\t\t\t//Se crea el formulario donde iran los respectivos datos del pago que se pretende modificar\n\t\t\t\techo'<div class=\"card card-success\">\n \t\t\t<div class=\"card-header\">\n \t\t\t<h3 class=\"card-title\">Editar Producto</h3>\n \t\t\t</div>\n \t\t\t<div class=\"card-body\">\n \t\t\t\t<input name=\"idEditar\" class=\"form-control form-control-lg\" type=\"hidden\" placeholder=\".input-lg\" value = \"'.$respuesta[\"id_pago\"].'\">\n \t\t\t\t<br>\n\n \t\t\t<input name=\"mamaEditar\" class=\"form-control form-control-lg\" type=\"text\" placeholder=\".input-lg\" value = \"'.$respuesta[\"nombre_mama\"].'\">\n \t\t\t<br>\n \t\t\t<input name=\"fecha_pago\" class=\"form-control form-control-lg\" type=\"date\" placeholder=\".input-lg\" value = \"'.$respuesta['fecha_pago'].'\">\n \t\t\t<br>\n\n \t\t\t<input name=\"fecha_envio\" class=\"form-control form-control-lg\" type=\"datetime-local\" placeholder=\".input-lg\" value = \"'.$newDate.'\">\n \t\t\t<br>\n \t\t\t<input name=\"folioEditar\" class=\"form-control form-control-lg\" type=\"text\" placeholder=\".input-lg\" value = \"'.$respuesta[\"folio\"].'\">\n \t\t\t<br>\n \t<br>\n \t\t\t<button type=\"submit\" name=\"btn_actualizar\" id=\"btn\" class=\"btn btn-block btn-outline-primary\" onclick=\"confirmarUpdate();\" style=\"float:right;\">Guardar cambios</button>\n \t\t\t</div>\n \t\t</div>';\n\t\t\t}\n\n\t\t}", "public function edit($id)\n {\n //\n $pedido = $this->pedido->find($id);\n $clientes= Cliente::all()->pluck('nome','id');//recupera dados da tabela clientes\n $products = Product::all()->pluck('name','id','preco');//recupera dados da tabela clientes\n // $clientes = Cliente::all()->pluck('nome','id');//recupera dados da tabela clientes\n // $products = Product::all()->pluck('name','id','preco');//recupera dados da tabela clientes\n\n $title = \"Editar Produto: ($pedido->id)\";\n\n return view('site.painel.pedido.create-pedido', compact('title', 'total_pedido', 'pedido','clientes', 'data_pedido','products'));\n }", "public function edit($id) {\n \n $product = $this->product->find($id);\n \n $tittle = \"Editar produto - $product->name\";\n \n $categories = ['eletronicos','cozinha','banho'];\n \n \n return view('painel.products.create', compact('tittle','categories', 'product'));\n }", "public function edita()\n\t {\t\n\t\t$id=$_REQUEST['id'];\n\t\t$car=$_REQUEST['car'];\n\t\t$nom=$_REQUEST['nom'];\n\t\t$cod=$_REQUEST['cod'];\n\t\t$niv=$_REQUEST['niv'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$cur_data=array();\n\t\t$cur_data['id_curso']=$id;\n\t\t$cur_data['id_carrera']=$car;\n\t\t$cur_data['nombre']=$nom;\n\t\t$cur_data['codigo']=$cod;\n\t\t$cur_data['nivel']=$niv;\n\t\t$cur_data['observacion']=$obs;\n\t\t$cur_data['estado']=$est;\n\t\t\n\t\tprint_r($cur_data);\n\t\t$curso=new cursos;\n\t\t$curso->edit($cur_data);\n\t\t$data1=$curso->lista();\n\t\t$this->principal();\n\t }", "function edit($id = null) {\n\t\t$this->account();\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Không tồn tại ', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\tif (!empty($this->data)) {\n\t\t\t$data['Product'] = $this->data['Product'];\n $data['Product']['images'] = $_POST['userfile'];\n\t\t\tif ($this->Product->save($data['Product'])) {\n\t\t\t\t$this->Session->setFlash(__('Bài viết sửa thành công', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Bài viết này không sửa được vui lòng thử lại.', true));\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->Product->read(null, $id);\n\t\t}\n\t\t$this->loadModel(\"Catproduct\");\n $list_cat = $this->Catproduct->generatetreelist(null,null,null,\" _ \");\n $this->set(compact('list_cat'));\n\t\t$this->set('edit',$this->Product->findById($id));\n\t}", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function update(SeccionTiendaProductoRequest $request, $id)\n {\n $precio_original= $request->get('precio_original');\n $descuento= $request->get('descuento');\n\n if ($descuento > 0) {\n $cantidad_a_descontar= ($precio_original * $descuento) / 100;\n $precio_con_descuento= $precio_original - $cantidad_a_descontar;\n }else{\n $precio_con_descuento= $request->get('precio_original');\n }\n //\n $objeto = SeccionTiendaProducto::find($id);\n $objeto->fk_categoria = $request->get('fk_categoria');\n $objeto->nombre = $request->get('nombre');\n $objeto->descripcion = $request->get('descripcion');\n $objeto->precio_original = $request->get('precio_original');\n $objeto->precio_con_descuento = $precio_con_descuento;\n $objeto->descuento = $request->get('descuento');\n $objeto->coleccion = $request->get('coleccion');\n $objeto->peso = $request->get('peso');\n $objeto->orden = $request->get('orden');\n\n //ruta de imagen\n $rutaDeCarpeta= 'images/seccion_tienda_productos/';\n $idArchivo= $id;\n\n // imagen de producto\n if ($request->hasFile('imagen')) {\n $nombreArchivo= \"producto_\".$idArchivo;\n $extension= $request->imagen->extension();\n\n $rutaConArchivo= $rutaDeCarpeta.$nombreArchivo.'.'.$extension;\n\n // Subir imagen:\n $archivo= $request->file('imagen');\n Storage::put($rutaConArchivo, File::get($archivo));\n\n if ($request->file('imagen')->isValid()) {\n $objeto->ruta = $rutaConArchivo;\n }\n }\n\n // guia de talles\n if ($request->hasFile('guia_de_talle')) {\n $nombreArchivoTalle= \"guia_talle_\".$idArchivo;\n $extensionTalle= $request->guia_de_talle->extension();\n\n $rutaConArchivoTalle= $rutaDeCarpeta.$nombreArchivoTalle.'.'.$extensionTalle;\n\n // Subir imagen:\n $archivoTalle= $request->file('guia_de_talle');\n Storage::put($rutaConArchivoTalle, File::get($archivoTalle));\n\n if ($request->file('guia_de_talle')->isValid()) {\n $objeto->guia_de_talle = $rutaConArchivoTalle;\n }\n }\n\n $objeto->save();\n\n $request->session()->flash('guardado', 'cambios guardados');\n return back();\n }", "function editar_estado(){\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 aprobado_pro='$valor' WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t//if($valor==1)\n\t\t\t\t//$this->enviar_correos2($id);\n\t\t\theader(\"location:/admin/producto/\");\n\t\t}\n\t}", "public function edit($id_cliente){}", "function edit_producto($id){\n\n $query = $this->db->get_where('productos', array('id' => $id),1);\n\n if($query->num_rows() == 1) {\n return $query;\n } else {\n return FALSE;\n }\n }", "public function edit_product($id){\n \t$edit = DB::table('products')\n \t\t\t ->where('id',$id)\n \t\t\t ->first();\n \treturn view('product.edit_product')->with(\"edit\",$edit);\n }", "public function edit(Product $product) {\n //\n }", "public function edit($id, array $data)\n {\n $product = $this->findById($id);\n $product->name = e($data['name']);\n $product->slug = Str::slug($data['name'], '-');\n $product->short_description = e($data['short_description']);\n \n\n $product->save();\n\n // $product->tags()->sync($data['tags']);\n // $product->categories()->sync($data['categories']);\n\n return $product;\n }", "public function editarAction()\n {\n $id = (int)$this->_request->getParam('id', 0);\n\n /* Traigo el formulario*/\n $form = $this->_form->getFrmEdita();\n $form->setAction($this->view->baseUrlController . '/editar/id/'. $id .'/');\n\n if ($this->_request->isPost()) { /* Si se ha submiteado el formulario, se procede a guardar los datos */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Recibo los datos del formulario por _POST */\n $formData = $this->_request->getPost();\n\n /* Lleno el formulario con los datos recibidos por _POST */\n $form->populate($formData); \n\n /* Verifico valores que llegan desde el formulario */\n $numero = $form->numero->getValue();\n if ($numero == ''){\n $numero = 0;\n }\n \n \n $expediente_id = $form->expediente_id->getValue();\n if ($expediente_id == ''){\n $expediente_id = 0;\n }\n \n $procedimiento_id = $form->procedimiento_id->getValue();\n if ($procedimiento_id == ''){\n $procedimiento_id = NULL;\n }\n \n \n /* Creo mi objeto */\n $data = array('id' => $id,\n 'expediente_id' => $expediente_id, \n 'dependencia_id' => $form->dependencia_id->getValue(),\n 'firma' => $form->firma->getValue(),\n 'cargo' => $form->cargo->getValue(),\n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'fecha_documento' => $form->fecha_documento->getValue(),\n 'numero' => $numero,\n 'siglas' => $form->siglas->getValue(),\n 'asunto' => $form->asunto->getValue(),\n 'anexos' => $form->anexos->getValue(), \n 'procedimiento_id' => $procedimiento_id, \n 'dependencia_registra_id' => $form->dependencia_registra_id->getValue(), \n 'usuario_id' => $this->_usuario->id \n );\n\n try {\n /* Actualizo mi objeto */\n $this->_modelo->save($data);\n } catch(Exception $ex) {\n // echo 'error|'.$ex->getMessage();\n \n /* Para mostrar el error en el Flash Messenger y mantener los datos del formulario */\n $this->_helper->FlashMessenger(array('error' => $ex->getMessage())); \n \n $form->populate($formData);\n $this->view->form = $form;\n return $this->render('editar');\n /* */\n \n }\n\n $this->_helper->redirector('poratender', 'documentos', 'gidoc'); \n \n } else { /* Se llama al formulario */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Obtengo el objeto de la tabla Documento */\n $obj = $this->_modelo->getById($id);\n\n if (null === $obj) {\n //$this->_redirect('/');\n }\n /* Paso los campos del objeto a un array */\n $arrayData = $obj->toArray();\n\n $date = new Zend_Date($arrayData['fecha_documento'], Zend_Date:: ISO_8601);\n\t $fecha = $date->toString('dd/MM/yyyy');\n\t $arrayData['fecha_documento'] = $fecha;\n \n if($arrayData['procedimiento_id'] == null ){\n $arrayData['procedimiento_id'] = ''; \n }\n \n /* Creo variable para poder ocultar el botón guardar, si el que edita no es el dueño del registro */\n $this->view->usua_idregistro = $arrayData['usuario_id'];\n\n /* Variables para poder subir archivos */\n $this->view->id = $id;\n /* Para el Grid archivos */\n /* Configuración del jqgrid */\n $this->view->archivos_colNames = \"'Archivo',''\";\n $this->view->archivos_colModel = \"{name:'descripcion', index:'descripcion', width:50},\n {name:'opcion', index:'opcion', width:10}\";\n $this->view->archivos_sortName = \"descripcion\"; /* Nombre del campo de la tabla por la que debe ser ordenado al cargar los datos. Generalmente es el pk de la tabla */\n \n /* Fin: Variables para poder subir archivos */\n \n /* LLeno los campos del formulario con los datos del array */\n $form->populate($arrayData);\n $this->view->form = $form;\n //$this->_helper->layout->disableLayout();\n $this->render('editar'); \n\n }\n }", "public function edit($id)\n {\n $prod = Inventario::find($id);\n\n $prov = Proveedor::lists('proveedor', 'id');\n $rec[\"SI\"]=\"SI\";\n $rec[\"NO\"]=\"NO\";\n $status[\"Activo\"]=\"Activo\";\n $status[\"Baja\"]=\"Baja\";\n $porcentaje[\"15\"]=\"15\";\n $porcentaje[\"20\"]=\"20\";\n $porcentaje[\"25\"]=\"25\";\n $porcentaje[\"30\"]=\"30\";\n $porcentaje[\"35\"]=\"35\";\n $porcentaje[\"40\"]=\"40\";\n $porcentaje[\"45\"]=\"45\";\n $porcentaje[\"50\"]=\"50\";\n return view('inventario.edit',['prod'=>$prod],compact('prov','porcentaje','rec','status'));\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit($id)\n {\n //\n $iduser=Auth::user()->id;\n $vale=EmpresaDepartamentoUser::findOrFail($id);\n if($vale->bloqueo ==0 || $vale->bloqueo ===$iduser) {\n $vale->bloqueo = $iduser;\n $vale->save();\n\n $products = $vale->details_product;\n //echo $vale;\n $tbody = '<tr></tr>';\n $i = 0;\n // echo $products;\n foreach ($products as $product) {\n $tbody .= '<tr id=\"resultado' . $i . '\">' .\n '<td><div id=\"div_error_codproducto' . $i . '\"><input id=\"codproducto' . $i . '\" class=\"form-control\" type=\"search\" name=\"codproducto[]\" value=\"' . $product->pivot->product_id . '\"praceholder =\"EJ: 04008006\" required onkeyup=\"buscarproductos(' . $i . ')\" > <span id=\"error_codproducto' . $i . '\" class=\"help-block\" style=\"display: none;\"></span> </div></td>' .\n '<td><input id=\"nameproduct' . $i . '\" class=\"form-control input-sm\" OnFocus=\"this.blur()\" name=\"nameproduct' . $i . '\" value=\"' . $product->name_product . '\"></td>' .\n '<td class=\"col-md-1\"><input id=\"stockproduct' . $i . '\" class=\"form-control input\" OnFocus=\"this.blur()\" name=\"stockproduct' . $i . '\" value= ' . $product->stock_product . ' ></div></td> ' .\n '<td class=\"col-md-1\"><input id=\"precioproduct' . $i . '\" class=\"form-control input-sm\" OnFocus=\"this.blur()\" name=\"precioproduct' . $i . '\" value= ' . $product->precio_product . ' ></div></td>' .\n '<td class=\"col-md-1\"><input id=\"cantidad' . $i . '\" class=\"form-control input-sm\" name=\"cantidad' . $i . '\" value=\"' . $product->pivot->cantidad . '\" required ></div></td>' .\n '<td class=\"col-md-1\"><a class=\"btn btn-danger btn-xs\"onclick=\"eliminarFila(' . $i . ')\"><i class=\"fa fa-trash fa-2x\" aria-hidden=\"true\"></i></a></td>' .\n '</tr>';\n $i++;\n }\n //'<td><div id=\"diverror_codproducto'+i+'\"><input id=\"codproducto'+i+'\" class=\"form-control\" type=\"search\" name=\"codproducto[]\" placeholder=\"EJ: 04008006\" required onkeyup=\"buscarproductos(' + i + ')\" > <span id=\"error_codproducto'+i+'\"class=\"help-block\" style=\"display: none;\"></span></div></td> ' +\n\n //<td><input id=\"nameproduct'+id+'\" class=\"form-control input-sm\" OnFocus=\"this.blur()\" name=\"nameproduct'+id+'\" value= '+response.name_product+' ></div></td>\n return response()->json([\n 'id' => $vale->id,\n 'namevale' => $vale->name_vale,\n 'departamentos' => $vale->departamento_id,\n 'totalproduct' => $vale->total_product,\n 'tbody' => $tbody,\n\n ]);\n }else{\n $titulo='No se puede Editar ';\n $body='<h4>La solicitud '.$vale->name_vale.' no se puede editar por este momentos, esta siendo visualizada por otro usuario </h4>';\n return response()->json([\n\n 'titulo' => $titulo,\n 'body' => $body,\n ],422);\n\n }\n /* $iduser=Auth::user()->id;\n $user= User::findOrFail($iduser);\n $empre=array();\n $depto=array();\n\n foreach($user->vale_empresas as $empresa){\n $empre[]=$empresa->id;\n\n }\n var_dump($empre);*/\n /*\n foreach ($user->user_departamentos as $departamento){\n $depto[]=$departamento->id;\n }\n\n //return view('admin.edit',compact('user'));\n return response()->json([\n 'id' => $user->id,\n 'name' => $user->name,\n 'last_name' => $user->last_name,\n 'email'=>$user->email,\n 'type' => $user->type,\n 'empresa'=>$empre,\n 'departamento'=>$depto,\n\n ]);*/\n }", "public function editar(){\n $sql = \"UPDATE especialidad SET Especialidad = ? 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->especialidad);\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 }", "public function edit($id)\n {\n /*\n if (! Gate::allows('hargajual_view')) {\n return abort(401);\n }\n */\n \n //$hargajual = HargaJual::findOrFail($id);\n //return view('hargajual.edit', compact('hargajual'));\n\n //$kontak = Kontak::findOrFail($id);\n //$produk = Product::pluck('nama_produk', 'id');\n //$hargajual = HargaJual::findOrFail($id);\n //return view('hargajual.edit', compact('hargajual','kontak','produk'));\n \n //$kontak = Kontak::findOrFail($id);\n JavaScript::put([\n 'id' => $id\n ]);\n \n //$hargajual = HargaJual::findOrFail($id);\n $produkuom = ProdukUom::where('id','=',$id)->first();\n //$kontak = Product::findOrFail($id);\n $produk = DB::table('produk_uoms')->select('uom_id')->where('id',$id)->first();\n \n $produks = Product::where('id',$produkuom->produk_id)->first();\n\n //$kontak = Kontak::all();\n //$produk = Product::pluck('nama_produk', 'id');\n \n $hargajual = DB::table('produk_uoms')->where('id',$id)->first();\n $hargajual =\n [\n 'hargajual' => $hargajual\n ]; \n return view('products.produkuom.edit', $hargajual, compact('produk','produks','kontak','produkuom'));\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }" ]
[ "0.79248345", "0.7909097", "0.79006255", "0.7808983", "0.7763881", "0.7702607", "0.7685938", "0.76822126", "0.7595196", "0.74935496", "0.74881953", "0.74848497", "0.74773556", "0.74655867", "0.7452791", "0.74383277", "0.73660684", "0.7335586", "0.7313008", "0.7296999", "0.7286743", "0.72339207", "0.72124475", "0.7204272", "0.72036237", "0.7169965", "0.71256685", "0.7108478", "0.7105144", "0.70748806", "0.7074541", "0.70730686", "0.7055899", "0.7052426", "0.7045451", "0.7039442", "0.70192194", "0.70155156", "0.7001488", "0.6997964", "0.69946694", "0.69925386", "0.6987343", "0.69656664", "0.6964503", "0.6959959", "0.695331", "0.6953056", "0.6948714", "0.6943411", "0.69358724", "0.69358724", "0.69358724", "0.69281137", "0.6927959", "0.6918864", "0.69184905", "0.69137704", "0.69056463", "0.69056463", "0.6902294", "0.6896682", "0.6886747", "0.6886714", "0.6885654", "0.68846256", "0.68822014", "0.68807185", "0.68806833", "0.6880445", "0.6874241", "0.68729824", "0.68616074", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792", "0.685792" ]
0.0
-1
ACTUALIZAR PRODUCTO, dado un arreglo asociativo con los datos a actualizar actualiza los datos del producto correspondiente $stmt = Conexion::conectar()>prepare("INSERT INTO products (nombreProd, descProduc, BuyPrice, SalePrice, Proce) VALUES (:nombre,:des,:buy, :sale, :price)");
public function actualizarProductoModel($datosModel){ $stmt = Conexion::conectar()->prepare("UPDATE products SET nombreProd = :nombre, descProduc = :des, BuyPrice = :buy, SalePrice = :sale, Proce=:price WHERE id = :id"); $stmt->bindParam(":nombre", $datosModel["nombre"]); $stmt->bindParam(":des", $datosModel["des"]); $stmt->bindParam(":buy", $datosModel["buy"]); $stmt->bindParam(":sale", $datosModel["sale"]); $stmt->bindParam(":price", $datosModel["price"]); $stmt->bindParam(":id", $datosModel["id"], PDO::PARAM_INT); if($stmt->execute()){ return "success"; } else{ return "error"; } $stmt->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newProducto($producto)\n{\n\t$con = getDBConnection();\n\t$stmt = $con->prepare(\"INSERT INTO productos (nombre, descripcion, precio) VALUES (:nombre, :descripcion, :precio)\");\n\t$stmt->bindParam(':nombre', $producto->nombre);\n\t$stmt->bindParam(':descripcion', $producto->descripcion);\n\t$stmt->bindParam(':precio', $producto->precio);\n\t$stmt->execute();\n}", "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 }", "static public function mdlIngresarProducto($tabla,$datos){\n\n \t$stmt = Conexion::conectar() -> prepare(\"INSERT INTO $tabla(\n \t\tupcid,producto,precio,iva,unidad,categoria,proveedor,estatus) \n\t\t VALUES (:upcid,:producto,:precio,:iva,:unidad,:categoria,:proveedor,:estatus)\");\n\n\t$stmt -> bindParam(\":upcid\", $datos[\"upc\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":producto\", $datos[\"nomproducto\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":precio\", $datos[\"precioproducto\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":iva\", $datos[\"iva\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":unidad\", $datos[\"unidadproducto\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":categoria\", $datos[\"categoriaproducto\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":proveedor\", $datos[\"proveedorp\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":estatus\", $datos[\"estatus\"],PDO::PARAM_STR);\n\n\t\n\n \tif($stmt -> execute()){\n\t\t\n \t\treturn \"ok\"; \n \t} else {\n \t\treturn \"error\";\n \t}\n\t\n \t$stmt -> close();\n \t$stmt = null; \n\n }", "public function add_data()\n {\n try\n {\n if($this->id_producto!=NULL) //Identificar si llega un ID nulo o declarado\n {\n $sql=\"UPDATE productos set proveedores_id_proveedor=?,categoria_id_Categoria=?,nom_producto=?,pre_producto=?,can_producto=? WHERE id_producto = ?\";\n \n }else{\n $sql=\"INSERT into productos Values(0,?,?,?,?,?)\";\n }\n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->proveedores_id_proveedor);\n $consulta->bindParam(2,$this->categoria_id_Categoria);\n $consulta->bindParam(3,$this->nom_producto);\n $consulta->bindParam(4,$this->pre_producto);\n $consulta->bindParam(5,$this->can_producto); \n if($this->id_producto!=null)//Se asigna el valor del ID si esta declarado\n {\n $consulta->bindParam(6,$this->id_producto); \n }\n $consulta->execute();\n $this->con=null; \n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "public function insertarProducto($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto(nombre, descripcion, imagen, codigo_categoria, stock, precio)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "function addProduct($productName, $productCategoryId, $productDescription, $productPrice, $productStock) {\n global $conn; \n $query = 'INSERT INTO product (id, name, description, price, cat_id, stock)\n VALUES (DEFAULT, :name, :description, :price, :cat_id, :stock)'; \t\t\t\t\t\t\t\t\n $stmt = $conn->prepare($query);\t\t\t\t\t\t\n $stmt->execute( array(':name'=>$productName, ':description'=>$productDescription, ':price'=>$productPrice, ':cat_id'=>$productCategoryId, ':stock'=>$productStock) ); \n }", "public static function insertNewProduct($data)\n {\n //Compruebas si existe\n $consulta = DataBase::consulta(\"\n select * from productos where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n //Segunda parte\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Tercera Parte\n //Insertamos el producto y detalles de producto\n if(count($consulta) == 0 && $idEmpresa > 0) {\n DataBase::insertar('insert into productos (producto, categoria) values (\"'.$data[\"saveNameProduct\"].'\", '.$data[\"listCategory\"].')');\n $idProducto = DataBase::consulta(\n \"select idProducto from productos\n where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$idProducto[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n //existe la empresa y el producto\n } else if ($idEmpresa > 0) {\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$consulta[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n }\n }", "public function insert($datos){\r\n try{\r\n $query = $this->db->connect()->prepare('INSERT INTO PRODUCTO (ID_PRODUCTO, NOMBRE, DESCRIPCION, PRECIO, FOTO, STOCK, CATEGORIA) VALUES(:id_producto, :nombre, :descripcion,:precio, :foto, :stock, :categoria)');\r\n $query->execute(['id_producto' => $datos['id_producto'], 'nombre' => $datos['nombre'], 'descripcion' => $datos['descripcion'], 'precio' => $datos['precio'], 'foto' => $datos['foto'], 'stock' => $datos['stock'], 'categoria' => $datos['categoria']]);\r\n return true;\r\n }catch(PDOException $e){\r\n //echo $e->getMessage();\r\n //echo \"Ya existe esa matrícula\";\r\n return false;\r\n }\r\n \r\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}", "function productToSale($product_id, $order_id, $product_price, $product_amount, $product_name, $product_description){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn -> prepare('INSERT INTO `order_products` (`product_id`, `order_id`, `product_price`, `product_amount`,`product_name`,`product_description`)\n\t\t\t\t\t\t\t\t\tVALUES (?, ?, ?, ?, ?, ?)');\n\t\t$sth \t-> execute(array($product_id, $order_id, $product_price, $product_amount, $product_name, $product_description));\n\t}", "public function insertar($newVal){\r\n\r\n\t\t$query= 'INSERT INTO Productos (nombre_Producto, factor, capacidad, id_Tipo_Cerveza, foto) \r\n\t\tVALUES (:nombre, :factor, :capacidad, :idTipoCerveza, :foto)';\r\n\r\n\t\ttry{\r\n\t\t\t$conexion= Conexion::conectar();\r\n\t\t\t$comando= $conexion->prepare($query);\r\n\r\n\t\t\t$nombre= $newVal->getNombre();\r\n\t\t\t$factor= $newVal->getFactor();\r\n\t\t\t$capacidad= $newVal->getCapacidad();\r\n\t\t\t$idTipoCerveza= $newVal->getTipoCerveza()->getId();\r\n\t\t\t$foto= $newVal->getFotoDireccion();\r\n\r\n\t\t\t$comando->bindParam(':nombre', $nombre);\r\n\t\t\t$comando->bindParam(':factor', $factor);\r\n\t\t\t$comando->bindParam(':capacidad', $capacidad);\r\n\t\t\t$comando->bindParam(':idTipoCerveza', $idTipoCerveza);\r\n\t\t\t$comando->bindParam(':foto', $foto);\r\n\r\n\t\t\t$comando->execute();\r\n\t\t}\tcatch(Exception $e){\r\n\t\t\tthrow new Exception(\"No se pudo Conectar a la Base de Datos\");\r\n\t\t\t\r\n\t\t}\r\n\t}", "function save_product(array $product)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n INSERT INTO products\n (name, slug, price, brand, description, categories)\n VALUES\n (:name, :slug, :price, :brand, :description, :categories)\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':name' => $product['name'],\n ':slug' => slugfy($product['name']),\n ':price' => $product['price'],\n ':brand' => $product['brand'],\n ':description' => $product['description'],\n ':categories' => $product['categories'],\n ]);\n}", "function addProduct($conn, $prod){\n\n $query = \"INSERT INTO produtos (nome,preco,quant,id_categoria )VALUES\n \n ('{$prod->getnome()}', {$prod->preco}, {$prod->quant}, {$prod->categoria->id} )\";\n\n return (mysqli_query($conn, $query));\n}", "public function InsertProductData(){\n\t \n $sReqProd = \"INSERT INTO products (name, description, id_cat) VALUES (:name, :description, :id_cat)\";\n $name = $_SESSION['products']['name'];\n $desc = $_SESSION['products']['desc'];\n $id_cat = $_SESSION['products']['cat'] ;\n\n $sReqPrice = \"INSERT INTO products_prices (name, incl_tax, id_product) VALUES (:pricename, :incl, :id_prod)\";\n $iNbPrices = count($_SESSION['prices']['name_prices']);\n\n // begin transaction\n SPDO::getInstance()->beginTransaction();\n try{\n\n // Insert product\n $insert_prod = SPDO::getInstance()->prepare($sReqProd);\n $insert_prod->bindParam(':name', $name);\n $insert_prod->bindParam(':description', $desc);\n $insert_prod->bindParam('id_cat', $id_cat);\n $insert_prod->execute();\n\n // Insert prices\n $lastIdProd = SPDO::getInstance()->lastInsertId();\n $insert_prices = SPDO::getInstance()->prepare($sReqPrice);\n for ($i=0 ; $i < $iNbPrices ; $i++){\n $insert_prices->bindParam(':pricename', $_SESSION['prices']['name_prices'][$i]);\n $insert_prices->bindParam(':incl', $_SESSION['prices']['prices'][$i]);\n $insert_prices->bindParam(':id_prod', $lastIdProd);\n $insert_prices->execute();\n }\n\n //commit\n SPDO::getInstance()->commit(); \n\n } catch(Excption $e){\n SPDO::getInstance()->rollback();\n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n $this->DisplayResultRqt(false, 'admin.php?p=product&a=create_prod', '', '');\n }\t\t\n \n $this->DisplayResultRqt(true, 'admin.php?p=product&a=create_prod', '', ''); \n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n\n\t}", "public function insertarProductoCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto_comprar(id_cliente, id_producto,nombre,precio,compro,fecha)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "function createProduct($conn, $product, $description, $category, $price, $userId) {\n $sql = \"INSERT INTO products (product_name, descriptions, category_id, list_price, userId) VALUES (?, ?, ?, ?, ?)\";\n $stmt = mysqli_stmt_init($conn);\n if (!mysqli_stmt_prepare($stmt, $sql)){\n header(\"location: ../members.php?error=stmtfailed\");\n exit();\n } \n $stmt = mysqli_stmt_init($conn);\n if (!mysqli_stmt_prepare($stmt, $sql)){\n header(\"location: ../members.php?error=stmtfailed\");\n exit();\n } \n \n mysqli_stmt_bind_param($stmt, \"sssss\", $product, $description, $category, $price, $userId);\n mysqli_stmt_execute($stmt);\n mysqli_stmt_close($stmts);\n header(\"location: ../members.php?error=none\" );\n exit();\n}", "public function Add(){\t\n\t try{\n\t\t $conn = DBConnect::GetConnection();\n\t\t \n\t\t $query=\"INSERT INTO product(product_name,unit_price,image_name,description,category,quantity_in_stock) VALUES \t\t\t\t\t(:name,:uPrice,:imageName,:des,:cate:,qty)\";\n\t\t \n\t\t $st=$conn->prepare($query);\n\t\t \n\t\t $st->bindvalue(\":name\",$this->productName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":uPrice\",$this->price,PDO::PARAM_INT); /*for the double PARAM type is what?*/\n\t\t $st->bindvalue(\":imageName\",$this->imageName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":des\",$this->description,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":cate\",$this->cate,PDO::PARAM_STR); //category id->foreign key\n\t\t $st->bindvalue(\":qty\",$this->qty,PDO::PARAM_INT);\n\t\t \n\t\t \n\t\t $st->execute();\n\t\t echo 'Done';\n\t\t \n\t }\n\t catch(PDOException $e){\n\t\t echo 'Fail to connect';\n\t\t echo $e->getMessage();\t \n }\n }", "public function addNewOwnProduct($newProductName, $newProductDescription, $newProductImage, $newProductQuantity, $newProductPrice) {\n\n $query = $this->db->prepare(\"INSERT INTO `products` (`product_name`, `product_description`, `product_image_url`, `product_quantity`, `product_price`, `vendor_id`) VALUES ( ?, ?, ?, ?, ?, ? ) \");\n\n $query->bindValue(1, $newProductName);\n $query->bindValue(2, $newProductDescription);\n $query->bindValue(3, $newProductImage);\n $query->bindValue(4, $newProductQuantity);\n $query->bindValue(5, $newProductPrice);\n $query->bindValue(6, 28);\n\n try {\n\n $query->execute();\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "function addProduct($name, $category_id, $description, $large_description, $price, $stock, $img_src){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn -> prepare('INSERT INTO `product` (`id`, `name`, `category_id`, `description`, `large_description`, `price`, `stock`, `img_src`)\n\t\t\t\t\t\t\t\t\tVALUES (NULL, ?, ?, ?, ?, ?, ?, ?)');\n\t\t$sth \t-> execute(array($name, $category_id, $description, $large_description, $price, $stock, $img_src));\n\t}", "function addProduct($DBConnect)\n{\n if (isset($_POST['submit'])) {\n $name = htmlentities($_POST['name']); // product name\n $price = htmlentities($_POST['price']); // price from the product\n $status = htmlentities($_POST['status_select']); // is product active or inactive\n $time = htmlentities($_POST['producing_time']); // time to produce a product\n $category = htmlentities($_POST['select_category']); // product category\n // $image = $_POST['img'];\n $image = \"https://robohash.org/optioquasidicta.png?size=100x100&set=set1\"; // product image\n $special = htmlentities(''); // allergies from products\n\n\n $addProduct = \"INSERT INTO product (pc_id, product_name, product_producingTime, product_special, product_image, product_status, price) VALUES (?, ?, ?, ?, ?, ?, ?)\";\n if ($insertStatement = mysqli_prepare($DBConnect, $addProduct)) {\n mysqli_stmt_bind_param($insertStatement, \"isissis\", $category, $name, $time, $special, $image, $status, $price);\n if ($insertExecute = mysqli_stmt_execute($insertStatement)) {\n echo \"<script>alert('Success')</script>\";\n } else {\n echo \"<script>alert('Something went wrong')</script>\";\n echo mysqli_error($DBConnect);\n }\n } else {\n echo \"<script>alert('Please fill in all the fields')</script>\";\n }\n mysqli_stmt_close($insertStatement);\n }\n}", "public function create(Produto $produto){\n $sql = 'INSERT INTO produtos (nome, descricao) VALUES(?,?)';\n \n // Preparar a query\n $stmt = Conexao::getConn()->prepare($sql);\n // Associando oque vai ser inserido no banco, com o objeto que foi passado no parametro\n $stmt->bindValue(1,$produto->getNome());\n $stmt->bindValue(2,$produto->getDescricao());\n\n // Executando query\n $stmt->execute();\n\n }", "function ajoutProduit($nom, $prix, $categorie, $quantite, $desc, $idVendeur, $dataImg, $date)\n{\n\n require(\"./modele/connexionBD.php\");\n\n $sql_ajt = \"INSERT INTO `produit`(`idProduit`, `NomProduit`, `PrixProduit`, `QteProduit`, `Categorie`, `idVendeur`,`image`,`Description`,`DateTime`) \n VALUES (null,:nomP,:prixP,:qteP,:catP,:idV,:img,:decrit,:datetemps)\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':nomP', $nom);\n $statement->bindParam(':prixP', $prix);\n $statement->bindParam(':qteP', $quantite);\n $statement->bindParam(':catP', $categorie);\n $statement->bindParam(':img', $dataImg);\n $statement->bindParam(':idV', $idVendeur);\n $statement->bindParam(':decrit', $desc);\n $statement->bindParam(':datetemps', $date);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n return true;\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n}", "public function create(Product $product) {\n\n $sql = 'INSERT INTO products (name, description) VALUES (?,?)';\n\n $register = Connection::getConn() -> prepare($sql);\n $register -> bindValue(1, $product -> getName());//este valor é equivalente a primeira interrogação do VALUES da linha 9, assim por diante\n $register -> bindValue(2, $product -> getDescription());\n $register -> execute();\n\n }", "static public function mdlIngresarRegistro($tabla,$datos){\n\t\t$sql = \"INSERT INTO $tabla (product_id, client_id, quantity, sale_id, price) VALUES (:product_id, :client_id, :quantity, :sale_id, :price)\";\n\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\tif ($pdo->execute([\n\t\t\t'product_id' => $datos['product_id'],\n\t\t\t'client_id' => $datos['client_id'],\n\t\t\t'quantity' => $datos['quantity'],\n\t\t\t'sale_id' => $datos['sale_id'],\n\t\t\t'price' => $datos['price']\n\t\t])) {\n\t\t\treturn \"ok\";\n\t\t} else {\n\t\t\treturn \"error\";\n\t\t}\n\t\t\n\n\n\t\t$pdo -> close();\n\t\t$pdo = null;\n\t}", "function ajoutPanierBd($idProd, $qteProd, $idUser)\n{\n require(\"./modele/connexionBD.php\");\n $sql_ajt = \"INSERT INTO `panier`(`idPanier`, `nbProduits`, `idUtilisateur`, `idProduit`) VALUES \n (null,:qteProd,:idUser,:idProd)\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':qteProd', $qteProd);\n $statement->bindParam(':idUser', $idUser);\n $statement->bindParam(':idProd', $idProd);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n return true;\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n}", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "function insertarProducto($con,$user,$foto1,$foto2,$foto3,$nombre,$precio,$descripcion,$peso,$dimension,$marca,$color,$envase,$categoria,$estado){\n\n $fecha = new DateTime();\n\n $fechaImagen = $fecha->format('dmYHis');\n\n //URL UPLOADS \n $link = \"http://localhost/TiendaPHP-Ajax/uploads/\";\n\n //VARIABLE OBTIENE ID DEL USUARIO QUE ESTA EN LA SESSION\n $idUsuario = selectSessionId($con,$user);\n\n //llenamos los valores a insertar\n $valor1 = 0;\n\n $valor2 = $link.$fechaImagen.$foto1;\n\n if ($foto2 === \"\") {\n \n $valor3 = $link.$foto2;\n\n }else{\n\n $valor3 = $link.$fechaImagen.$foto2;\n }\n\n if ($foto3 === \"\") {\n\n $valor4 = $link.$foto3;\n \n }else{\n\n $valor4 = $link.$fechaImagen.$foto3;\n\n }\n\n $valor5 = $nombre;\n\n $valor6 = $precio;\n\n $valor7 = $descripcion;\n\n $valor8 = $peso;\n\n $valor9 = $dimension;\n\n $valor10 = $marca;\n\n $valor11 = $color;\n\n $valor12 = $envase;\n\n $valor13 = $categoria;\n\n $valor14 = $estado;\n\n $valor15 = $fecha->format('d-m-Y');\n\n $valor16 = 0;\n\n $valor17 = $idUsuario;\n\n $sql = \"INSERT INTO `producto`(`id`, `imagen_front`, `imagen_back`,`imagen_left`, `nombre`, `precio`, `descripcion`, `peso`, `dimension`, `marca`, `color`, `envase`, `categoria`, `estado`, `fecha`,`numero_visitas`, `id_cliente`)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n $consultaPreparada = $con->prepare($sql);\n\n $consultaPreparada->bind_param(\"issssdsssssssssii\",$valor1,$valor2,$valor3,$valor4,$valor5,$valor6,$valor7,$valor8,$valor9,$valor10,$valor11,$valor12,$valor13,$valor14,$valor15,$valor16,$valor17);\n\n /* VALIDAMOS PARA ENVIAR MENSAJE DE INSERCION O NO INSERCION DEL PRODUCTO */\n if($consultaPreparada->execute()){\n\n $directorio = \"../uploads/\";\n\n $fichero1 = $directorio.basename($fechaImagen.$_FILES['image1']['name']);\n \n $fichero2 = $directorio.basename($fechaImagen.$_FILES['image2']['name']);\n \n $fichero3 = $directorio.basename($_FILES['image3']['name']); \n \n /* AQUI MOVEMOS EL ARCHIVO AL SERVIDOR */\n move_uploaded_file($_FILES['image1']['tmp_name'],$fichero1);\n \n move_uploaded_file($_FILES['image2']['tmp_name'],$fichero2);\n\n move_uploaded_file($_FILES['image3']['tmp_name'],$fichero3);\n\n $error['result']=\"true\";\n\n echo json_encode($error);\n\n }else{\n\n $error['result']=\"false\";\n\n echo json_encode($error);\n }\n}", "function addProd($categoryId, $invName, $invDescription, $invImage, $invThumbnail, $invPrice, $invStock, $invSize, $invWeight, $invLocation, $invVendor, $invStyle) {\n $db = acmeConnect();\n //SQL\n $sql = 'INSERT INTO inventory (categoryId, invName, invDescription, invImage, invThumbnail, invPrice, invStock, invSize, invWeight, invLocation, invVendor, invStyle) VALUES (:categoryId, :invName, :invDescription, :invImage, :invThumbnail, :invPrice, :invStock, :invSize, :invWeight, :invLocation, :invVendor, :invStyle)';\n // Create the prepared statement using the acme connection\n $stmt = $db->prepare($sql);\n // The next 11 lines replace the placeholders in the SQL\n // statement with the actual values in the variables\n // and tells the database the type of data it is\n $stmt->bindValue(':categoryId', $categoryId, PDO::PARAM_STR);\n $stmt->bindValue(':invName', $invName, PDO::PARAM_STR);\n $stmt->bindValue(':invDescription', $invDescription, PDO::PARAM_STR);\n $stmt->bindValue(':invImage', $invImage, PDO::PARAM_STR);\n $stmt->bindValue(':invThumbnail', $invThumbnail, PDO::PARAM_STR);\n $stmt->bindValue(':invPrice', $invPrice, PDO::PARAM_STR);\n $stmt->bindValue(':invStock', $invStock, PDO::PARAM_STR);\n $stmt->bindValue(':invSize', $invSize, PDO::PARAM_STR);\n $stmt->bindValue(':invWeight', $invWeight, PDO::PARAM_STR);\n $stmt->bindValue(':invLocation', $invLocation, PDO::PARAM_STR);\n $stmt->bindValue(':invVendor', $invVendor, PDO::PARAM_STR);\n $stmt->bindValue(':invStyle', $invStyle, PDO::PARAM_STR);\n //this runs the statements above and inserts the data into the database\n $stmt->execute();\n //this checks to see how many rows were added as a result of the above statements\n $rowsChanged = $stmt->rowCount();\n //this closes the interaction between the function and the database server\n $stmt->closeCursor();\n //This sends the results from the rowCount above to the controller (used in showing a success message I assume)\n return $rowsChanged;\n }", "function constitueCommande($idProd,$idCommande,$qteProd){\n require(\"./modele/connexionBD.php\");\n $sql_ajt = \"INSERT INTO `constitue`(`idProduit`, `idCommande`, `qteProduit`) \n VALUES (:idp,:idc,:qteP);\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':idc', $idCommande);\n $statement->bindParam(':idp', $idProd);\n $statement->bindParam(':qteP', $qteProd);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n\n}", "static public function mdlCreateProduct($table, $data){\n\t\t$stmt = Connection::connect()->prepare(\"INSERT INTO $table(id_category, name, stock, buying_price, selling_price) VALUES (:id_category, :name, :stock, :buying_price, :selling_price) \");\n\n\t\t$stmt->bindParam(\":id_category\", $data[\"id_category\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":name\", $data[\"name\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":stock\", $data[\"stock\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":buying_price\", $data[\"buying_price\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":selling_price\", $data[\"selling_price\"], PDO::PARAM_STR);\n\n\t\tif ($stmt ->execute()) {\n\t\t\treturn \"ok\";\n\t\t}else{\n\t\t\treturn \"error\";\n\t\t}\n\t\t$stmt -> close();\n\t\t$stmt -> null;\n\t}", "static public function mdlIngresarEntrada($tabla, $datos){\n\t\t\n\t\t\n\n\t\n\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(codigo, id_responsable, id_proveedor,id_comprobante,comprobante, secuencia, descripcion, productos,neto,impuesto,total_pagar,fecha_emision,fecha_vencimiento) VALUES (:codigo, :id_responsable, :id_proveedor,:id_comprobante,:comprobante, :secuencia, :descripcion, :productos,:neto,:impuesto,:total_pagar,:fecha_emision,:fecha_vencimiento)\");\n\t\n\t\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":id_responsable\", $datos[\"id_responsable\"], PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(\":id_proveedor\", $datos[\"id_proveedor\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":id_comprobante\", $datos[\"id_comprobante\"], PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(\":comprobante\", $datos[\"comprobante\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":secuencia\", $datos[\"secuencia\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":descripcion\", $datos[\"descripcion\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":productos\", $datos[\"productos\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":neto\", $datos[\"neto\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto\"], PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(\":total_pagar\", $datos[\"total_pagar\"], PDO::PARAM_STR);\t\t\n\t\t\t$stmt->bindParam(\":fecha_emision\", $datos[\"fecha_emision\"], PDO::PARAM_STR);\t\t\n\t\t\t$stmt->bindParam(\":fecha_vencimiento\", $datos[\"fecha_vencimiento\"], PDO::PARAM_STR);\t\t\n\n\n\n\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t\t\n\n\t\t}else{\n\n\t\t\treturn $stmt->errorInfo();\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function insertarProducto($codigo,$descripcion, $cantidad, $precio) {\r\n $pdo = Database::connect();\r\n $sql = \"insert into producto(codigo, descripcion, cantidad, precio)VALUES (?, ?, ?, ?)\";\r\n $consulta = $pdo->prepare($sql);\r\n //Ejecutamos y pasamos los parametros:\r\n try {\r\n $consulta->execute(array($codigo,$descripcion,$cantidad,$precio));\r\n } catch (PDOException $e) {\r\n Database::disconnect();\r\n throw new Exception($e->getMessage());\r\n }\r\n Database::disconnect();\r\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 }", "function save() \n\t{\n\t\t$conn = new Conexion();\n\t\tif ($this->id<>0) \n\t\t\t{ \n\n\t\t$sql = $conn->prepare(\"update productos set idMoneda = '$this->idMoneda', idCategoria = '$this->idCategoria', idSubCategoria = '$this->idSubCategoria', descripcion = '$this->descripcion', fechaCarga = '$this->fechaCarga', idUsuario = '$this->idUsuario', activo = '$this->activo', aviso_stock = '$this->aviso_stock', precio = '$this->precio', desc1 = '$this->desc1', desc2 = '$this->desc2', desc3 = '$this->desc3', utilidad = '$this->utilidad', iva = '$this->iva' where id='$this->id'\");\n\t\t$sql->execute();\n\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$sql = $conn->prepare(\"insert into productos values (null, '$this->idMoneda', '$this->idCategoria','$this->idSubCategoria', '$this->descripcion', '$this->fechaCarga', '$this->idUsuario', '$this->activo', '$this->aviso_stock', '$this->precio', '$this->desc1', '$this->desc2', '$this->desc3', '$this->utilidad', '$this->iva')\");\n\t\t\t$sql->execute();\n\t\t\t$this->id = $conn->lastInsertId();\n\n\t\t\t} \n\t\t$sql=null;\n\t\t$conn=null;\t\n\t}", "static public function mdlIngresarProveedor($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, rfc, direccion, codpostal, ciudad, email, telefono, contacto, tel_contacto, email_contacto, ultusuario, estatus) VALUES (:nombre, :rfc, :direccion, :codpostal, :ciudad, :email, :telefono, :contacto, :tel_contacto, :email_contacto, :ultusuario, :estatus)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codpostal\", $datos[\"codpostal\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ciudad\", $datos[\"ciudad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":contacto\", $datos[\"contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tel_contacto\", $datos[\"tel_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email_contacto\", $datos[\"email_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ultusuario\", $datos[\"ultusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":estatus\", $datos[\"estatus\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function RegistrarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"producto\"]) or empty($_POST[\"codcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\t$ingrediente = $_POST['codingrediente'];\n\t\t$repeated = array_filter(array_count_values($ingrediente), function($count) {\n\t\t\treturn $count > 1;\n\t\t});\n\t\tforeach ($repeated as $key => $value) {\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\n\t\t$sql = \" select codproducto from productos where codproducto = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codproducto\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n##################### REGISTRAMOS LOS NUEVOS PRODUCTOS ####################################\n\t\t\t$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproducto);\n\t\t\t$stmt->bindParam(2, $producto);\n\t\t\t$stmt->bindParam(3, $codcategoria);\n\t\t\t$stmt->bindParam(4, $preciocompra);\n\t\t\t$stmt->bindParam(5, $precioventa);\n\t\t\t$stmt->bindParam(6, $existencia);\n\t\t\t$stmt->bindParam(7, $stockminimo);\n\t\t\t$stmt->bindParam(8, $ivaproducto);\n\t\t\t$stmt->bindParam(9, $descproducto);\n\t\t\t$stmt->bindParam(10, $codproveedor);\n\t\t\t$stmt->bindParam(11, $codigobarra);\n\t\t\t$stmt->bindParam(12, $favorito);\n\t\t\t$stmt->bindParam(13, $statusproducto);\n\n\t\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t\t$producto = strip_tags($_POST[\"producto\"]);\n\t\t\t$codcategoria = strip_tags($_POST[\"codcategoria\"]);\n\t\t\t$preciocompra = strip_tags($_POST[\"preciocompra\"]);\n\t\t\t$precioventa = strip_tags($_POST[\"precioventa\"]);\n\t\t\t$existencia = strip_tags($_POST[\"existencia\"]);\n\t\t\t$stockminimo = strip_tags($_POST[\"stockminimo\"]);\n\t\t\t$ivaproducto = strip_tags($_POST[\"ivaproducto\"]);\n\t\t\t$descproducto = strip_tags($_POST[\"descproducto\"]);\n\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\tif (strip_tags($_POST['codigobarra']!=\"\")) { $codigobarra = strip_tags($_POST['codigobarra']); } else { $codigobarra ='00000000000'; }\n\t\t\t$favorito = strip_tags($_POST[\"favorito\"]);\n\t\t\t$statusproducto = strip_tags($_POST[\"statusproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproceso);\n\t\t\t$stmt->bindParam(2, $codresponsable);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciom);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codproceso = strip_tags($_POST['codproceso']);\n\t\t\t$codresponsable = strip_tags(\"0\");\n\t\t\t$codproducto = strip_tags($_POST['codproducto']);\n\t\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t\t$entradas = strip_tags($_POST['existencia']);\n\t\t\t$salidas = strip_tags(\"0\");\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = strip_tags($_POST['existencia']);\n\t\t\t$preciom = strip_tags($_POST['precioventa']);\n\t\t\t$costototal = strip_tags($_POST['precioventa'] * $_POST['existencia']);\n\t\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t\t$stmt->execute();\n\n################## SUBIR FOTO DE PRODUCTO ######################################\n//datos del arhivo \n\t\t\tif (isset($_FILES['imagen']['name'])) { $nombre_archivo = $_FILES['imagen']['name']; } else { $nombre_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['type'])) { $tipo_archivo = $_FILES['imagen']['type']; } else { $tipo_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['size'])) { $tamano_archivo = $_FILES['imagen']['size']; } else { $tamano_archivo =''; } \n//compruebo si las características del archivo son las que deseo \n\t\t\tif ((strpos($tipo_archivo,'image/jpeg')!==false)&&$tamano_archivo<200000) \n\t\t\t{ \n\t\t\t\tif (move_uploaded_file($_FILES['imagen']['tmp_name'], \"fotos/\".$nombre_archivo) && rename(\"fotos/\".$nombre_archivo,\"fotos/\".$codproducto.\".jpg\"))\n\t\t\t\t{ \n## se puede dar un aviso\n\t\t\t\t} \n## se puede dar otro aviso \n\t\t\t}\n################## FINALIZA SUBIR FOTO DE PRODUCTO ######################################\n\n\n###################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ###########################\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$query = \" insert into productosvsingredientes values (null, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproducto);\n\t\t$stmt->bindParam(2, $codingrediente);\n\t\t$stmt->bindParam(3, $cantidad);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$codingrediente = strip_tags($_POST['codingrediente'][$i]);\n\t\t$cantidad = strip_tags($_POST['cantidad'][$i]);\n\t\t$stmt->execute();\n\t}\n}\n################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ##################\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL PRODUCTO FUE REGISTRADO EXITOSAMENTE\";\necho \"</div>\";\t\t\nexit;\n}\nelse\n{\n\techo \"3\";\n\texit;\n}\n}", "function ajouter_article($nom,$prix,$quantite,$description,$type){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO article(id_article, nom_article, prix_article, quantite_article, description_article,type_article) VALUES (:id_article, :nom_article, :prix_article,:quantite_article, :description_article,:type_article)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_article'=>'',\r\n\t\t'nom_article'=>$nom,\r\n\t\t'prix_article'=>$prix,\r\n\t\t'quantite_article'=>$quantite,\r\n\t\t'description_article'=>$description,\r\n\t\t'type_article'=>$type));\r\n\r\n}", "function createProduct($category_id, $product, $price, $image)\r\n{\r\n $productResults = false;\r\n \r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"INSERT INTO products SET category_id = :category_id, product = :product, price = :price, image = :image\");\r\n \r\n $binds = array(\r\n // Used to place new array information under a new ID in Corps table\r\n \":category_id\" => $category_id,\r\n \":product\" => $product,\r\n \":price\" => $price,\r\n \":image\" => $image\r\n );\r\n \r\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) \r\n {\r\n $productResults = true;\r\n }\r\n \r\n return $productResults;\r\n \r\n}", "public function Add(){\t\n\t try{\n\t\t $conn = DBConnection::GetConnection();\n\t\t \n\t\t $query=\"INSERT INTO product(product_name,unit_price,image_name,description,category, quantity_in_stock) VALUES (:name,:uPrice,:imageName,:des,:cate,:qty)\";\n\t\t \n\t\t $st=$conn->prepare($query);\n\t\t \n\t\t $st->bindvalue(\":name\",$this->productName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":uPrice\",$this->price,PDO::PARAM_INT); /*for the double PARAM type is what?*/\n\t\t $st->bindvalue(\":imageName\",$this->imageName,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":des\",$this->description,PDO::PARAM_STR);\n\t\t $st->bindvalue(\":cate\",$this->cate,PDO::PARAM_STR); \n\t\t $st->bindvalue(\":qty\",$this->qty,PDO::PARAM_INT);\n\t\t \n\t\t \n\t\t $result=$st->execute();\t \n\t\t return $result;\n\t }\n\t catch(PDOException $e){\n\t\t echo 'Fail to connect';\n\t\t echo $e->getMessage();\t \n }\t \n\t \n }", "public function ActualizarProductos()\n\t{\n\t\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"producto\"]) or empty($_POST[\"codcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\tif (isset($_POST['codingrediente'])) {\n\n\t\t\t$ingrediente = $_POST['codingrediente'];\n\t\t\t$repeated = array_filter(array_count_values($ingrediente), function($count) {\n\t\t\t\treturn $count > 1;\n\t\t\t});\n\t\t\tforeach ($repeated as $key => $value) {\n\t\t\t\techo \"2\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\tself::SetNames();\n\t\t$sql = \" update productos set \"\n\t\t.\" codproducto = ?, \"\n\t\t.\" producto = ?, \"\n\t\t.\" codcategoria = ?, \"\n\t\t.\" preciocompra = ?, \"\n\t\t.\" precioventa = ?, \"\n\t\t.\" existencia = ?, \"\n\t\t.\" stockminimo = ?, \"\n\t\t.\" ivaproducto = ?, \"\n\t\t.\" descproducto = ?, \"\n\t\t.\" codproveedor = ?, \"\n\t\t.\" codigobarra = ?, \"\n\t\t.\" favorito = ?, \"\n\t\t.\" statusproducto = ? \"\n\t\t.\" where \"\n\t\t.\" codalmacen = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $codproducto);\n\t\t$stmt->bindParam(2, $producto);\n\t\t$stmt->bindParam(3, $codcategoria);\n\t\t$stmt->bindParam(4, $preciocompra);\n\t\t$stmt->bindParam(5, $precioventa);\n\t\t$stmt->bindParam(6, $existencia);\n\t\t$stmt->bindParam(7, $stockminimo);\n\t\t$stmt->bindParam(8, $ivaproducto);\n\t\t$stmt->bindParam(9, $descproducto);\n\t\t$stmt->bindParam(10, $codproveedor);\n\t\t$stmt->bindParam(11, $codigobarra);\n\t\t$stmt->bindParam(12, $favorito);\n\t\t$stmt->bindParam(13, $statusproducto);\n\t\t$stmt->bindParam(14, $codalmacen);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$producto = strip_tags($_POST[\"producto\"]);\n\t\t$codcategoria = strip_tags($_POST[\"codcategoria\"]);\n\t\t$preciocompra = strip_tags($_POST[\"preciocompra\"]);\n\t\t$precioventa = strip_tags($_POST[\"precioventa\"]);\n\t\t$existencia = strip_tags($_POST[\"existencia\"]);\n\t\t$stockminimo = strip_tags($_POST[\"stockminimo\"]);\n\t\t$ivaproducto = strip_tags($_POST[\"ivaproducto\"]);\n\t\t$descproducto = strip_tags($_POST[\"descproducto\"]);\n\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\tif (strip_tags($_POST['codigobarra']!=\"\")) { $codigobarra = strip_tags($_POST['codigobarra']); } else { $codigobarra ='00000000000'; }\n\t\t$favorito = strip_tags($_POST[\"favorito\"]);\n\t\t$statusproducto = strip_tags($_POST[\"statusproducto\"]);\n\t\t$codalmacen = strip_tags($_POST[\"codalmacen\"]);\n\t\t$stmt->execute();\n\n################## SUBIR FOTO DE PRODUCTO ######################################\n//datos del arhivo \n\t\tif (isset($_FILES['imagen']['name'])) { $nombre_archivo = $_FILES['imagen']['name']; } else { $nombre_archivo =''; }\n\t\tif (isset($_FILES['imagen']['type'])) { $tipo_archivo = $_FILES['imagen']['type']; } else { $tipo_archivo =''; }\n\t\tif (isset($_FILES['imagen']['size'])) { $tamano_archivo = $_FILES['imagen']['size']; } else { $tamano_archivo =''; } \n//compruebo si las características del archivo son las que deseo \n\t\tif ((strpos($tipo_archivo,'image/jpeg')!==false)&&$tamano_archivo<200000) \n\t\t{ \n\t\t\tif (move_uploaded_file($_FILES['imagen']['tmp_name'], \"fotos/\".$nombre_archivo) && rename(\"fotos/\".$nombre_archivo,\"fotos/\".$codproducto.\".jpg\"))\n\t\t\t{ \n## se puede dar un aviso\n\t\t\t} \n## se puede dar otro aviso \n\t\t}\n################## FINALIZA SUBIR FOTO DE PRODUCTO ######################################\n\n\n################## PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS #################\n\t\tif (isset($_POST['codingrediente'])) {\n\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$query = \" update productosvsingredientes set \"\n\t\t.\" cantracion = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ? and codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $cantidad);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$stmt->bindParam(3, $codingrediente);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$codingrediente = strip_tags($_POST['codingrediente'][$i]);\n\t\t$cantidad = strip_tags($_POST['cantidad'][$i]);\n\t\t$stmt->execute();\n\t}\n}\n}\n#################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ########################\n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL PRODUCTO FUE ACTUALIZADO EXITOSAMENTE\";\necho \"</div>\";\nexit;\n}", "public function insertProduct(Product $product);", "public function addProduct($name, $price, $path){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM products WHERE Product_Name=:name;\");\r\n $stmt->bindParam('name',$name);\r\n $stmt->execute();\r\n $_SESSION[\"add_product_check\"]=$stmt->fetchAll(PDO::FETCH_ASSOC);\r\n if(strlen($name) > 3 && count($_SESSION[\"add_product_check\"])==0){\r\n $stmt = $this->DB->prepare ( \"INSERT INTO products VALUES(NULL, :name, :price, :image_path, 0);\");\r\n $stmt->bindParam('name',$name);\r\n $stmt->bindParam('price',$price);\r\n $stmt->bindParam('image_path',$path);\r\n $stmt->execute ();\r\n }\r\n }", "public function insertProduct($description, $price)\r\n {\r\n $sql = 'INSERT INTO products (description, price) VALUES (:description, :price)';\r\n $stmt = $this->connection->prepare($sql);\r\n\r\n // Bind parameters to statement variables\r\n $stmt->bindParam(':description', $description);\r\n $stmt->bindParam(':price', $price);\r\n\r\n // Execute statement\r\n $stmt->execute();\r\n\r\n }", "public function createProduct($name,$price){\n\n $stmt = $this->con->prepare(\"INSERT INTO image_new(name, price) values(?, ?)\");\n\n //Binding the parameters\n $stmt->bind_param(\"ss\", $name, $price);\n\n //Executing the statment\n $result = $stmt->execute();\n\n //Closing the statment\n $stmt->close();\n\n //If statment executed successfully\n if ($result) {\n return $this->con->insert_id;\n } else {\n echo 'failed to created product';\n return 0;\n\t\t}\t\t\t\n }", "static public function mdlIngresarUsuario($tabla, $datos){\n\n $stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombres,apellidos,tipo_documento,documento,celular,email,profesion,tipo_vinculacion,cvlac,cargo,ficha,fecha_vinculacion,fecha_desvinculacion,estado_vinculacion,contrasena,id_programa,id_rol ) VALUES (:nombres,:apellidos,:tipo_documento,:documento,:celular,:email,:profesion,:tipo_vinculacion,:cvlac,:cargo,:ficha,:fecha_vinculacion,:fecha_desvinculacion,:estado_vinculacion,:contrasena,:id_programa,:id_rol)\");\n\n $p=null;\n if($datos[\"id_programa\"]==\"NULL\"){\n $p=null;\n }else{\n $p=$datos[\"id_programa\"];\n }\n\n $stmt->bindParam(\":nombres\", $datos[\"nombres\"], PDO::PARAM_STR);\n $stmt->bindParam(\":apellidos\", $datos[\"apellidos\"], PDO::PARAM_STR);\n $stmt->bindParam(\":tipo_documento\", $datos[\"tipo_documento\"], PDO::PARAM_STR);\n $stmt->bindParam(\":documento\", $datos[\"documento\"], PDO::PARAM_STR);\n $stmt->bindParam(\":celular\", $datos[\"celular\"], PDO::PARAM_STR);\n $stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n $stmt->bindParam(\":profesion\", $datos[\"profesion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":tipo_vinculacion\", $datos[\"tipo_vinculacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":cvlac\", $datos[\"cvlac\"], PDO::PARAM_STR);\n $stmt->bindParam(\":cargo\", $datos[\"cargo\"], PDO::PARAM_STR);\n $stmt->bindParam(\":ficha\", $datos[\"ficha\"], PDO::PARAM_STR);\n $stmt->bindParam(\":fecha_vinculacion\", $datos[\"fecha_vinculacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":fecha_desvinculacion\", $datos[\"fecha_desvinculacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":estado_vinculacion\", $datos[\"estado_vinculacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"], PDO::PARAM_STR);\n $stmt->bindParam(\":id_programa\", $p, PDO::PARAM_STR);\n $stmt->bindParam(\":id_rol\", $datos[\"id_rol\"], PDO::PARAM_STR);\n \n if($stmt->execute()){\n\n return \"ok\";\n\n }else{\n\n return \"error\";\n\n }\n\n $stmt->close();\n\n $stmt = null;\n\n }", "public function inserir(Product $d) {\n if ($this->con->isConnected()) {\n $sql = \"INSERT INTO products (name) VALUES(?)\";\n $stmt = $this->con->prepare($sql);\n if ($stmt) {\n $nome = $d->getName();\n $stmt->bind_param('s',$nome);\n if ($stmt->execute()) {\n $id = $this->con->getLastID();\n $d->setId($id);\n $stmt->close();\n return $d;\n }\n $stmt->close();\n }\n }\n return null; \n }", "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}", "public function mudar(){\n\n\t\t//$stmt = $conn->prepare(\"UPDATE tb_produtos SET nome = :NOME, qte = :QTE, cod = :COD, dtCadastro = :DTCADASTRO, preco = :PRECO, valorTotal = :VALORTOTAL WHERE nome = :NOMEID OR cod = :NOMEID \");\n\n\t\t$this->nomeId = $_POST['nomeId'];\n\t\t$this->nome = $_POST['nomeProduto'];\n\t\t$this->qte = $_POST['qteProduto'];\n\t\t$this->cod = $_POST['cod'];\n\t\t$this->ordCod = $this->cod;\n\t\t$this->dtCadastro = $_POST['dtCadastro'];\n\t\t$this->preco = (100 * $_POST['valor']);\n\t\t$this->valorTotal = ($this->qte * $this->preco);\n\n\n\t\t//$stmt->bindParam(\":NOME\", $this->nome);\n\t\t//$stmt->bindParam(\":QTE\", $this->qte);\n\t\t//$stmt->bindParam(\":COD\", $this->cod);\n\t\t//$stmt->bindParam(\":DTCADASTRO\", $this->dtCadastro);\n\t\t//$stmt->bindParam(\":PRECO\", $this->preco);\n\t\t//$stmt->bindParam(\":VALORTOTAL\", $this->valorTotal);\n\t\t//$stmt->bindParam(\":NOMEID\", $this->nomeId);\n\n\t\t//$stmt->execute();\n\n\n\t\t$conn = new Sql();\n\n\t\t$stmt = $conn->query(\"UPDATE tb_produtos SET nome = :NOME, qte = :QTE, cod = :COD, ordCod = :ORDCOD, dtCadastro = :DTCADASTRO, preco = :PRECO, valorTotal = :VALORTOTAL WHERE nome = :NOMEID OR cod = :NOMEID \", array(\n\t\t\t':NOMEID'=>$this->nomeId,\n\t\t\t':NOME'=>$this->nome,\n\t\t\t':QTE'=> $this->qte,\n\t\t\t':COD' => $this->cod,\n\t\t\t':ORDCOD'=>$this->ordCod,\n\t\t\t':DTCADASTRO' => $this->dtCadastro,\n\t\t\t':PRECO'=> $this->preco,\n\t\t\t':VALORTOTAL'=>$this->valorTotal\n\t\t));\n\t}", "function addFormaPago($db,$nombre,$porcentaje,$logo){\n $stmt = $db->prepare(\"INSERT INTO formaPago \n (nombre,porcentaje,logo) \n VALUES (:nombre, :porcentaje, :logo)\");\n $stmt->bindParam(':nombre', $nombre);\n $stmt->bindParam(':porcentaje', $porcentaje);\n $stmt->bindParam(':logo', $logo);\n $res = $stmt->execute();\n return $res;\n }", "public function insert($producto);", "function add_article($bdd, $articles) {\n $req = $bdd->prepare('INSERT INTO articles(name, description, price, poids, image, stock, for_sale, Categories_id) \n VALUES(:name, :description, :price, :poids, :image, :stock, :for_sale, :Categories_id)');\n $req->execute(array(\n 'name' => $articles[0],\n 'description' => $articles[1],\n 'price' => $articles[2],\n 'poids' => $articles[3],\n 'image' => $articles[4],\n 'stock' => $articles[5],\n 'for_sale' => $articles[6],\n 'Categories_id' => $articles[7]\n ));\n\n echo \"L'article \".$articles[0].\" a bien été ajouté !\";\n}", "public function updateProducto($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE productos SET nombre=:nombre, precio=:precio,codigo=:codigo, ruta_img=:ruta_img,idCategoria=:idCategoria WHERE idProducto=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":precio\", $datos[\"precio\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":codigo\", $datos[\"codigo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":ruta_img\", $datos[\"foto\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":idCategoria\", $datos[\"categoria\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n }", "public function registro($cod, $nom, $des, $pen, $pas, $fec, $cat)\n {\n $q = \"insert into productos(codigo_producto, nombre_producto, desc_producto, precio_entrada, precio_salida, fecha_ingreso, estado_producto, id_categoria) values('$cod','$nom','$des','$pen','$pas','$fec',1,'$cat')\";\n $consulta = $this->con->query($q) or die ('Error!' . $this->con->error);\n \n }", "function insertar_producto($con){\t\n\t\t$this->accion=\"Datos del Nuevo Producto\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT nombre_pro FROM producto WHERE nombre_pro='$this->nombre'\";\n\t\t\t$verificar=mysql_query($sql) or die(mysql_error());\n\t\t\tif(!$resultado = mysql_fetch_array($verificar)){\n\t\t\t\t$this->codigo=$this->crear_codigo($this->categoria,\"\");\n\t\t\t\t$this->fecha=$this->convertir_fecha($this->fecha);\n\t\t\t\t$sql=\"INSERT INTO producto VALUES ('', '$this->codigo', '$this->nombre', '$this->categoria', '$this->prioridad', '$this->detal', '$this->mayor', '$this->limite', '$this->descripcion' , '$this->claves', '0', '$this->marca', '0','$this->principal','$this->hotel')\";\n\t\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$id=mysql_insert_id($con);\n\t\t\t\theader(\"location:/admin/producto/detalle.php?id=$id\");\n\t\t\t}else{\n\t\t\t\t$this->mensaje2=\"error\";\n\t\t\t}\n\t\t}\n\t\t$sql=\"SELECT * FROM categoria ORDER BY prioridad_cat ASC\";\n\t\t$consulta=mysql_query($sql)or die(mysql_error());;\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function insertProduct($data)\n {\n $this->db->insert('produits', $data);\n }", "function AddProduct()\n{\n global $connection;\n global $productCreated, $productExist, $productErrorQuery;\n $productCreated = $productExist = $productErrorQuery = '';\n\n if (isset($_POST['save_products'])) {\n $productName = addslashes($_POST['productName']);\n $fiscal_code = addslashes($_POST['fiscal_code']);\n $productUnit = addslashes($_POST['productUnit']);\n $productPriceBought = addslashes($_POST['productPriceBought']);\n $productPriceSold = addslashes($_POST['productPriceSold']);\n\n $user = addslashes($_POST['user']);\n $category = addslashes($_POST['category']);\n $supplierId = addslashes($_POST['supplierId']);\n $expiration_date = date('Y-m-d', strtotime($_POST['expiration_date']));\n $product_check_query = \"SELECT * FROM product WHERE productName = '$productName'\";\n $result_check_query = mysqli_query($connection, $product_check_query);\n $count_product = mysqli_num_rows($result_check_query);\n\n if ($count_product > 0) {\n $productExist = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ky produkt ekziston!\", \"error\")\n </script>';\n } else {\n $query_insert = \"INSERT INTO product(productName,fiscal_code,productUnit, productPriceBought,productPriceSold,expiration_date,id_category,userId,supplierId) VALUES('$productName','$fiscal_code','$productUnit','$productPriceBought','$productPriceSold','$expiration_date','$category',' $user','$supplierId')\";\n $result_insert = mysqli_query($connection, $query_insert);\n\n if ($result_insert) {\n $productCreated = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Produkti u krijua me sukses!\", \"success\")\n </script>';\n } else {\n $productErrorQuery = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë krijimit të produktit! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n }\n}", "function proposition($CONNEXION, $PRODUIT, $QTE, $PRIX, $DATE){\n\n\t\t/* select pour id du produit à partir du nom! */\n\t\t$queryID=\"SELECT idType FROM TypeProduit\n\t\t\t\t\tWHERE nomProd=\".$PRODUIT.\";\"\n\t\t$result=sybase_query($queryID, $CONNEXION);\n\t\t$idProd=sybase_result($result);\n\t\n\t\t/* select pour récupérer le RCS du fournisseur à partir de la table Users avec $USERNAME= LOGIN */\n\t\t$queryRCS=\"SELECT idU from Users\n\t\t\t\t\tWHERE typeU=2\n\t\t\t\t\tAND loginU=\".$USERNAME\";\"\n\t\t$result=sybase_query($queryRCS, $CONNEXION);\n\t\t$RCS=SYBASE_RESULT($result);\n\t\t\n\t\n\t\t$query = \"INSERT INTO Produit VALUES (getdate(), \".$qte.\", \".$prix.\", \".$date.\", \".$RCS.\", null, \".$idProd.\";\n\t\t$result = sybase_query($query, $CONNEXION);\n\n\t}", "public function createProduct(Product $product) {\n $stmt = $this->db->prepare(\"insert into product values (0, :username, :title, :description, :price, :category, :image, 1);\");\n $stmt->bindValue(\"username\", $product->getUsername(), PDO::PARAM_STR);\n $stmt->bindValue(\"title\", $product->getTitle(), PDO::PARAM_STR);\n $stmt->bindValue(\"description\", $product->getDescription(), PDO::PARAM_STR);\n $stmt->bindValue(\"price\", $product->getPrice(), PDO::PARAM_STR);\n $stmt->bindValue(\"category\", $product->getCategory(), PDO::PARAM_STR);\n $stmt->bindValue(\"image\", $product->getImage(), PDO::PARAM_STR);\n $stmt->execute();\n }", "public static function inserirProdutoCarrinho(){\n if(isset($_SESSION['user'])){\n //USUARIO LOGADO COM CARRINHO\n if(isset($_SESSION['user']['carrinhoId'])){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"UPDATE carrinhos SET produto_id=:idp, quantidade=:qnt, idCliente=:idC WHERE id=:id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n\n //USUARIO LOGADO SEM CARRINHO\n }else{\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"INSERT INTO carrinhos(produto_id,quantidade,idCliente) VALUES (:prodId, :qnt, :idCliente)\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$produto['produto_id']);\n $stmt->bindValue(2,self::$produto['quantidade']);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->execute();\n if($stmt->rowCount()){\n return true;\n }throw new \\Exception(\"Nao Foi Possivel adicionar produto ao carrinho\");\n }\n\n //USUARIO NAO LOGADO\n }else{\n //USUARIO NAO LOGADO COM CARRINHO\n if(isset($_SESSION['carrinho'])){\n $expPro = explode(';',$_SESSION['carrinho']['produto_id']);\n $expQuant = explode(';',$_SESSION['carrinho']['quantidade']);\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $_SESSION['carrinho'] = array('produto_id'=>$impPro,'quantidade'=>$impQuant);\n return true;\n //USUARIO NAO LOGADO SEM CARRINHO\n }else{\n $_SESSION['carrinho'] = array('produto_id'=>self::$produto['produto_id'],'quantidade'=>self::$produto['quantidade']);\n return true;\n \n }\n \n }\n }", "static public function mdlActualizarProducto($tabla,$datos){\n\t\t$sql = \"UPDATE $tabla SET product_id =:product_id, client_id =:client_id, quantity =:quantity, price =:price WHERE sale_id =:sale_id\";\n\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\tif ($pdo->execute([\n\t\t\t'product_id' => $datos['product_id'],\n\t\t\t'client_id' => $datos['client_id'],\n\t\t\t'quantity' => $datos['quantity'],\n\t\t\t'sale_id' => $datos['sale_id'],\n\t\t\t'price' => $datos['price']\n\t\t])) {\n\t\t\treturn \"ok\";\n\t\t} else {\n\t\t\treturn \"error\";\n\t\t}\n\t\t\n\n\n\t\t$pdo -> close();\n\t\t$pdo = null;\n\t}", "public function actualizarProducto($codigo, $descripcion,$cantidad, $precio){\r\n //Preparamos la conexión a la bdd:\r\n $pdo=Database::connect();\r\n $sql=\"update producto set descripcion=?,cantidad=?,precio=? where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo,$descripcion,$cantidad,$precio));\r\n Database::disconnect();\r\n }", "function add_new_product($product_info) {\r\n try {\r\n $params = array(\r\n array('name' => ':product_name', 'value' => $product_info['product_name']),\r\n array('name' => ':product_number', 'value' => &$product_info['product_number']),\r\n array('name' => ':product_type', 'value' => &$product_info['product_type']),\r\n array('name' => ':notes', 'value' => &$product_info['notes']),\r\n array('name' => ':category_id', 'value' => &$product_info['category_id']),\r\n array('name' => ':width', 'value' => &$product_info['width']),\r\n array('name' => ':height', 'value' => &$product_info['height']),\r\n array('name' => ':h_length', 'value' => &$product_info['h_length']),\r\n array('name' => ':re_demand_border', 'value' => &$product_info['re_demand_border']),\r\n array('name' => ':primary_unit_name', 'value' => &$product_info['primary_unit_name']),\r\n array('name' => ':secondary_unit_name', 'value' => &$product_info['secondary_unit_name']),\r\n array('name' => ':primary_unit_quantity', 'value' => &$product_info['primary_unit_quantity']),\r\n array('name' => ':secondary_unit_quantity', 'value' => &$product_info['secondary_unit_quantity']),\r\n array('name' => ':quantity_status', 'value' => &$product_info['quantity_status']),\r\n array('name' => ':res', 'value' => &$result)\r\n );\r\n\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"begin :res := product_actions.add_new_product(:product_name,:product_number,:product_type,:notes,:category_id,:width,:height,:h_length,:re_demand_border,:primary_unit_name,:secondary_unit_name,:primary_unit_quantity,:secondary_unit_quantity,:quantity_status); end;\");\r\n foreach ($params as $variable) {\r\n oci_bind_by_name($stmt, $variable[\"name\"], $variable[\"value\"]);\r\n }\r\n oci_execute($stmt);\r\n return $result;\r\n } catch (Exception $ex) {\r\n return $ex;\r\n }\r\n }", "function inserir(Produto $produto){\n $conexao = \"pgsql:host=localhost;dbname=app_produtos\";\n $usuario = \"postgres\";\n $senha = \"postgresql\";\n\n $pdo = new PDO($conexao,$usuario,$senha);\n\n $comando = $pdo->prepare(\"INSERT INTO produto(nome,preco) VALUES (:nome, :preco)\");\n\n $comando->bindParam(':nome',$produto->nome);\n $comando->bindParam(':preco',$produto->preco);\n\n $comando->execute();\n\n var_dump($pdo->lastInsertId());\n }", "static public function mdlGuardarCompra($datos) {\r\n\r\n $sql = \"INSERT INTO compras(id_proveedor, tipo_compra, id_tipo_documento, id_usuario, fecha_compra, serie_documento, num_documento, iva, total_compra, descuento, observaciones, estado) VALUES (:id_proveedor, :tipo_compra, :id_tipo_documento, :id_usuario, :fecha_compra, :serie_documento, :num_documento, :iva, :total_compra, :descuento, :observaciones, :estado)\";\r\n\r\n $stmt = Conexion::conectar()->prepare($sql);\r\n\r\n $stmt->bindParam(\":id_proveedor\", $datos[\"id_proveedor\"], PDO::PARAM_INT);\r\n $stmt->bindParam(\":tipo_compra\", $datos[\"tipo_compra\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":id_tipo_documento\", $datos[\"id_tipo_documento\"], PDO::PARAM_INT);\r\n $stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_INT);\r\n $stmt->bindParam(\":fecha_compra\", $datos[\"fecha_compra\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":serie_documento\", $datos[\"serie_documento\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":num_documento\", $datos[\"num_documento\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":iva\", $datos[\"iva\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":total_compra\", $datos[\"total_compra\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":descuento\", $datos[\"descuento\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":observaciones\", $datos[\"observaciones\"], PDO::PARAM_STR);\r\n $stmt->bindParam(\":estado\", $datos[\"estado\"], PDO::PARAM_INT);\r\n\r\n if ($stmt->execute()) {\r\n\r\n return \"ok\";\r\n\r\n } else {\r\n\r\n return \"error\";\r\n\r\n }\r\n\r\n }", "static public function mdlIngresarproyecto($tabla, $datos){\n\t\t\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla (id_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, codigo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,nombreproyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,fecha ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (:id_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :codigo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :nombreproyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :fecha\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\");\n\n\t\t$stmt->bindParam(\":id_programacion_anual\", $datos[\"id_programacion_anual\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_entes\", $datos[\"id_entes\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombreproyecto\", $datos[\"nombreproyecto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo\", $datos[\"tipo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha\", $datos[\"fecha\"], PDO::PARAM_STR);\n\n//var_dump($datos);\n//exit($datos);\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\t$arr=$stmt->errorInfo();\n\t\t\treturn $arr[2];\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function insert($productItem) {\n if (!isset($_SESSION[\"PurchaseId\"])) {\n $cmd = 'INSERT INTO ' . TABLE_PURCHASE . ' (account_id) ' .\n 'VALUES (:account_id)';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':account_id', (isset($_SESSION['UserId']) ? $_SESSION['UserId'] : null));\n $sql->execute();\n\n $_SESSION[\"PurchaseId\"] = $GLOBALS['db']->lastInsertId();\n }\n\n \n $cmd = 'SELECT * FROM product WHERE id = :id';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':id', $productItem['product_id']);\n $sql->execute();\n\n $data = $sql->fetch(PDO::FETCH_ASSOC);\n\n $cmd = 'INSERT INTO ' . TABLE . ' (description, price, quantity, product_id, purchase_id) ' .\n 'VALUES (:description, :price, :quantity, :product_id, :purchase_id)';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':description', $data['description']);\n $sql->bindValue(':price', getTotalPriceForItem($data, $productItem));\n $sql->bindValue(':quantity', $productItem['quantity']);\n $sql->bindValue(':product_id', $productItem['product_id']);\n $sql->bindValue(':purchase_id', $_SESSION[\"PurchaseId\"]);\n $sql->execute();\n \n}", "function ajouter_commande($date,$id_client,$prix_commande){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO commande(id_commande, date_commande, client_id, prix_commande) VALUES (:id_commande, :date_commande, :client_id, :prix_commande)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_commande'=>'',\r\n\t\t'date_commande'=>$date,\r\n\t\t'client_id'=>$id_client,\r\n\t\t'prix_commande'=>$prix_commande));\r\n\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}", "function insertProduct($cantidad, $modelo, $marca, $linea, $tipo, $garantiaEnMeses, $calle)\n {\n $cantidad = strtoupper($cantidad);\n $modelo = strtoupper($modelo);\n $marca = strtoupper($marca);\n $linea = strtoupper($linea);\n $tipo = strtoupper($tipo);\n $garantiaEnMeses = strtoupper($garantiaEnMeses);\n $calle = strtoupper($calle);\n $query = $this->db->query(\"call insertProduct('$cantidad', '$modelo', '$marca', '$linea', '$tipo', '$garantiaEnMeses', '$calle');\");\n }", "function insertar_temporada_producto(){\t\t\n\t\t$this->accion=\"Insertar Nueva Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores2();\n\t\t\t$this->desde=$this->convertir_fecha($this->desde);\n\t\t\t$this->hasta=$this->convertir_fecha($this->hasta);\n\t\t\t\n\t\t\t$sql=\"INSERT INTO temporadas2 VALUES ('', '$this->id', '$this->mostrar', '$this->prioridad', 'Por Fecha', '0', '$this->desde', '$this->hasta', '0', '0', '$this->alternativo', '0', '0', '$this->titulo', 'NULL', '$this->paxadicional', 'NULL', '$this->desde_a', '$this->hasta_a', '$this->precio_a', '0', 'NULL', '$this->desde_b', '$this->hasta_b', '$this->precio_b', '0', 'NULL', '0', '0', '0', '0', 'NULL')\";\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}\n\t}", "public static function guardar($datos){\n $producto = new Producto($datos['producto']);\n $producto->categoria = $producto->srtCategoria($datos['categorias']);\n $producto->save();\n $producto->categorias()->attach($datos['categorias']);\n $idsDimensiones = $producto->arrDimensiones($datos);\n $articulos = $producto->arrArticulos($datos['colores'], $idsDimensiones, $producto->id);\n DB::table('articulos')->insert($articulos);\n }", "public function insertProd($produto){\t\t\n\t\t$sql = \"INSERT INTO \".$this->nomeTabela.\" VALUES(null, '\". $produto->getNome().\"', '\".$produto->getImagem().\"', \".$produto->getPreco().\")\";\n\t\treturn mysql_query($sql);\n\t}", "function insertar_productos($id,$id_dep,$id_dep_destino=0,$es_pedido_material=0,$id_licitacion=-1,$nrocaso=-1)\r\n{\r\nglobal $db,$_ses_user;\r\n\r\n$db->StartTrans();\r\n\r\n if($es_pedido_material)\r\n { $titulo_material=\"Pedido de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Pedido de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n else\r\n { $titulo_material=\"Movimiento de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Movimiento de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n\r\n //traemos las filas que estan en la BD\r\n $items_en_bd=get_items_mov($id);\r\n //traemos los items que estan en la tabla\r\n $items=get_items_mov();\r\n//print_r($items);\r\n$fecha=date(\"Y-m-d H:i:s\",mktime());\r\n$usuario=$_ses_user[\"name\"];\r\n\r\n //primero borramos los productos que se borraron en la tabla\r\n $a_borrar=\"\";\r\n $cantidades_acum=0;\r\n for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n {\r\n for($i=0;$i<$items['cantidad'];$i++)\r\n {\r\n //si el id es igual al de la bd,\r\n //entonces esta insertada de antes\r\n if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n {//controlamos si las cantidad en la fila difiere de la que esta guardada.\r\n //si lo hace debemos actualizar la cantidad reservada\r\n if($items[$i]['id_prod_esp']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n {\r\n \t //no se puede cambiar la cantidad de la fila\r\n \t die(\"Error: No se puede cambiar las cantidades de la fila.\");\r\n }//de if($items[$i]['id_producto']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n \t break;\r\n }//de if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n //si $i==$items['cantidad'] significa que la fila se borro, y\r\n //hay que eliminarla de la BD\r\n if($i==$items['cantidad'])\r\n {\r\n \t $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n\r\n }\r\n //si habia un producto y se borro, hay que eliminar la fila\r\n //(este caso extremo falla si no se agrega este if\r\n if($i==0 && $items['cantidad']==1 && $items[$i]['id_prod_esp']==\"\")\r\n {\r\n $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n }\r\n\r\n }//de for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n\r\n //si hay filas de movimiento a borrar, eliminamos las reservas\r\n //y luego la fila del movimiento insertar_recibidos_mov\r\n\r\n /*\r\n echo \"<br>\";\r\n echo \"a borrar : *** \";\r\n print_r($a_borrar);\r\n echo \" **** \";\r\n */\r\n if($a_borrar!=\"\"){\r\n $a_borrar=substr($a_borrar,0,strlen($a_borrar)-1);\r\n $filas_borrar=split(\",\",$a_borrar);\r\n $cantidades=substr($cantidades,0,strlen($cantidades)-1);\r\n $cantidades_b=split(\",\",$cantidades);\r\n $tam=sizeof($filas_borrar);\r\n $array_id_prod_esp=split(\",\",$id_prod_esp_a_borrar);\r\n for($g=0;$g<$tam;$g++)\r\n cancelar_reserva($array_id_prod_esp[$g],$cantidades_b[$g],$id_dep,\"Se cancelo el $titulo_material Nº $id\",9,\"\",$filas_borrar[$g]);\r\n\r\n //luego borramos todas las filas que haya que borrar, del\r\n $query=\"delete from detalle_movimiento where id_detalle_movimiento in ($a_borrar)\";\r\n sql($query) or fin_pagina(\"<br>Error al borrar los productos del movimiento <br>$query\");\r\n }//de if($a_borrar!=\"\")\r\n else\r\n $filas_borrar=array();\r\n\r\n $tam_filas_borrar=sizeof($filas_borrar);\r\n //luego insertamos los productos nuevos\r\n for($i=0;$i<$items['cantidad'];$i++) {\r\n //si el id de detalle_movimiento es vacio, entonces hay que insertarlo\r\n if($items[$i]['id_detalle_movimiento']==\"\")\r\n {\r\n if($items[$i]['id_prod_esp']!=\"\")\r\n {\r\n $query=\"select nextval('detalle_movimiento_id_detalle_movimiento_seq') as id_detalle_movimiento\";\r\n $id_det=sql($query)or fin_pagina();\r\n \t $query=\"insert into detalle_movimiento(id_detalle_movimiento,id_movimiento_material,id_prod_esp,descripcion,cantidad,precio)\r\n values(\".$id_det->fields['id_detalle_movimiento'].\",$id,\".$items[$i]['id_prod_esp'].\",'\".$items[$i]['descripcion'].\"',\".$items[$i]['cantidad'].\",\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\")\r\n \";\r\n \t sql($query) or fin_pagina(\"<br>Error al insertar el producto $i del movimiento <br>$query\");\r\n \t //si la cantidad ya reservada para la fila es vacia, ingresamos una nueva reserva por la cantidad de la fila\r\n \t if ($items[$i][\"cantidad_res\"]==\"\" || $items[$i][\"cantidad_res\"]==0)\r\n \t {\treservar_stock($items[$i]['id_prod_esp'],$items[$i]['cantidad'],$id_dep,\"Reserva de Productos para $titulo_material Nº $id\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n \t }\r\n\t\t\t\t\t\t //en cambio, si la cantidad reservada es mayor que cero, en caso de tener que reservar mas, desde el stock disponible\r\n\t\t\t\t\t\t //lo que se hace es agregar a la reserva ya hecha, los nuevos productos,\r\n\t\t\t\t\t\t //(PORQUE SOLO PUEDE HABER UN DETALLE RESERVA POR FILA DE PM O DE OC)\r\n\t\t\t\t\t\t //Ademas se corrigen en consecuencia las\r\n\t\t\t\t\t\t //cantidades disponibles y reservadas de ese producto en ese stock, si es necesario.\r\n else if ($items[$i][\"cantidad_res\"]>0){\r\n\t\t\t\t\t\t\tif ($nrocaso) {\r\n\r\n\t\t\t\t\t\t \t$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\t from stock.en_stock\r\n\t\t\t\t\t\t\t\t\t join stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\t where nrocaso='$nrocaso'\r\n\t\t\t\t\t\t\t\t\t and id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t and id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\t order by cantidad_reservada ASC\";\r\n\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$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\tfrom stock.en_stock\r\n\t\t\t\t\t\t\t\t\t\tjoin stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\twhere id_licitacion= $id_licitacion\r\n\t\t\t\t\t\t\t\t\t\tand id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t\tand id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\torder by cantidad_reservada ASC\r\n\t\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t\t }\r\n\r\n\r\n\t\t\t\t\t\t\t$rta_consulta=sql($consulta, \"c311\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t//en la primera entrada viene la reserva de mayor cantidad, que es la que afectaremos mas abajo\r\n\t\t\t\t\t\t\t// por lo tanto la saltamos\r\n\t\t\t\t\t\t\t$cantidad_primer_reserva=$rta_consulta->fields[\"cantidad_reservada\"];\r\n\t\t\t\t\t\t\t$id_primer_reserva=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n\t\t\t\t\t\t\t$rta_consulta->MoveNext();\r\n\t\t\t\t\t\t\t//luego acumulamos las demas cantidades de las reservas restantes, si es que hay\r\n\t\t\t\t\t\t\t$acum_otras_reservas=0;$index=0;\r\n\t\t\t\t\t\t\t//y creamos un arreglo con los id de detalle reserva que debemos descontar, y sus respectivas cantidades actuales\r\n\t\t\t\t\t\t\t$reservas_a_bajar=array();\r\n \t\t\t\t\t\t\twhile (!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t{\r\n \t\t\t\t\t\t\t $acum_otras_reservas+=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index]=array();\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"id\"]=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"cantidad_reservada\"]=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $index++;\r\n\r\n \t\t\t\t\t\t\t $rta_consulta->MoveNext();\r\n \t\t\t\t\t\t\t}//de while(!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t$rta_consulta->Move(0);\r\n\r\n\t\t\t\t\t\t\t $id_en_stock=$rta_consulta->fields[\"id_en_stock\"];\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es mayor que la reservada, entonces se necesita reservar la diferencia\r\n\t\t\t\t\t\t\t\t//desde el stock disponible. Para eso aumentamos la cantidad de la reserva ya presente y movemos\r\n\t\t\t\t\t\t\t\t//las cantidades de la tabla en_stock, como corresponda\r\n\r\n\t\t\t\t\t\t\t\tif($items[$i]['cantidad']>$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad']-$items[$i][\"cantidad_res\"];\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es menor que la reservada\r\n\t\t\t\t\t\t\t\telse if($items[$i]['cantidad']<$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t//indicamos que solo se debe usar parte de la reserva del producto hecha desde OC, por lo que\r\n\t\t\t\t\t\t\t\t\t//solo se resta esa cantidad. Y ademas, se debe generar una nueva reserva para esos productos\r\n\t\t\t\t\t\t\t\t\t//que se van a usar para este PM\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=1;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\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$cantidad_aumentar=0;\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t//Si hay una sola reserva hecha y si la cantidad a usar para la fila del PM es menor que la reservada, significa que solo se usa una\r\n\t\t\t\t\t\t\t\t//parte de dicha reserva, entonces....\r\n\t\t\t\t\t\t\t\tif($acum_otras_reservas==0 && $nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//Solo se descuenta de la reserva atada a la licitacion para ese producto, generada por la OC,\r\n\t\t\t\t\t\t\t\t\t//la cantidad que se va a utilizar.\r\n\t\t\t\t\t\t\t\t\t//Primero se descuenta de la cantidad reservada de la tabla en_stock\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_reservada=cant_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego se decrementa la cantidad de la reserva asociada a la licitacion de ese producto\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c317: Error al actualizar la reserva para licitacion de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t \t\t die(\"Error Interno PM485: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(se utilizan esos productos de la reserva hecha por la OC)\r\n\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar488)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//Y luego se genera una nueva reserva, para la fila del pedido de material actual, con esa cantidad,\r\n\t\t\t\t\t\t\t\t\t//que se desconto de la reserva hecha por la OC\r\n\t\t\t\t\t\t\t\t\treservar_stock($items[$i]['id_prod_esp'],$cantidad_aumentar,$id_dep,\"Reserva de Productos para $titulo_material\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n\r\n\t\t\t\t\t\t\t\t\t//como la funcion reservar_stock descuenta de la cantidad disponible\r\n\t\t\t\t\t\t\t\t\t//y agrega a la cantidad reservada del stock la cantidad pasada como parametro, es necesario volver\r\n\t\t\t\t\t\t\t\t\t//a incrementar la cantidad disponible para compensar,\r\n\t\t\t\t\t\t\t\t\t// debido a que los productos que ahora estan reservados para el PM antes lo estaban para la OC,\r\n\t\t\t\t\t\t\t\t\t// por lo que los productos ya fueron descontados de stock disponibles y agregados a la cantidad reservada\r\n\t\t\t\t\t\t\t\t\t//cuando se hizo la reserva desde la OC al recibir los productos\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\r\n\t\t\t\t\t\t\t\t\t \";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al compensar las cantidades del stock<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t}//de if($nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\telse//no se hace una nueva reserva y el PM pasara a tener toda la reserva generada desde la OC\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//si no hay nada que sacar del stock disponible entonces ponemos esa cantidad en cero\r\n \t\t\t\t\t\t\t\t if($sacar_de_stock_disp==0)\r\n\t\t\t\t\t\t\t\t\t $cantidad_aumentar=0;\r\n\r\n\t\t\t\t\t\t\t\t\t //agregamos a la reserva actual hecha para la licitacion, los productos disponibles necesarios para\r\n\t\t\t\t\t\t\t\t\t//completar la cantidad que requiere la fila de PM (si es necesario),\r\n\t\t\t\t\t\t\t\t\t// y le sacamos la relacion que tenia con la fila de OC\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c516: Error al actualizar la reserva de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego actualizamos las cantidades disponibles y reservadas en stock, si la cantidad a aumentar es mayor que cero\r\n\t\t\t\t\t\t\t\t\tif($cantidad_aumentar>0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\t\t\t//restamos los productos que se reservan de la cantidad disponible y los sumamos a la cantidad\r\n\t\t\t\t\t\t\t\t\t\t//reservada\r\n\t\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp-$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t\t cant_reservada=cant_reservada+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM539: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar537)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t}//de if($cantidad_aumentar>0)\r\n\r\n\t\t\t\t\t\t\t\t if($acum_otras_reservas)\r\n\t\t\t\t\t\t\t\t {//si habia mas de una reserva por el mismo producto provenientes de OC distintas, se eliminan, excepto la primera, todas\r\n\t\t\t\t\t\t\t\t\t//las reservas restantes que se utilizaron, de las que estan indicadas en $reservas_a_bajar, para que se mantenga\r\n\t\t\t\t\t\t\t\t\t//la idea de una unica reserva por detalle_movimiento\r\n\t\t\t\t\t\t\t\t\t//y se agrega el registro del movimiento en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(Se pone el movimiento de que se utilizaron esas reservas)\r\n\t\t\t\t\t\t\t\t\t//El procedimiento es sumar a la primer reserva la cantidad de las otras, necesaria para satisfacer la cantidad\r\n\t\t\t\t\t\t\t\t\t//que la fila del PM requiere. Lo que se use de las otras reservas se pondra como utilizado en el log del stock\r\n\t\t\t\t\t\t\t\t\t//y se descontara o eliminara de detalle_reserva. Lo que quede sin usarse, queda atado a la OC como estaba.\r\n\t\t\t\t\t\t\t\t\t//En caso de que se use una parte de una reserva y la otra no, se genera un nuevo log de stock parar la parte\r\n\t\t\t\t\t\t\t //que se utilizó de la OC, y se decuenta la cantidad usada, de la reserva afectada. Esto se explica mejor\r\n\t\t\t\t\t\t\t //durante la ejecucion del codigo que sigue:\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_pedida_para_fila=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad acumulada para satisfacer la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t//es hasta ahora la cantidad de la primer reserva\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas=$cantidad_primer_reserva;\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad que se saca de las restantes reservas, para agregarle a la primera\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar=0;\r\n\r\n //vamos acumulando el resto de las cantidades de las otras reservas, hasta que se acumule la cantidad pedida\r\n //por la fila, o hasta que se acaben las reservas disponibles\r\n\t\t\t\t\t\t\t\t\t\tfor($j=0;$j<sizeof($reservas_a_bajar);$j++ )\r\n {\r\n \t//si falta acumular para completar la cantidad requerida por la fila\r\n if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n {\r\n \t$cant_reserva_actual=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n \t//utilizamos de la reserva actual, solo la cantidad necesaria que es:\r\n \t$cantidad_faltante=$cantidad_pedida_para_fila-$cantidad_acumulada_de_reservas;\r\n\r\n \tif($cant_reserva_actual<=$cantidad_faltante)\r\n \t{\r\n \t\t//si la cantidad para la reserva que estamos viendo es justo\r\n \t\t//lo que esta faltando, o no alcanza para cubrir todo lo que esta faltando\r\n \t\t//acumulamos toda esa reserva para la fila (es decir: se utilizan todos los productos de esa reserva)\r\n \t\t$cantidad_a_utilizar=$cant_reserva_actual;\r\n \t\t$cantidad_no_utilizada=0;\r\n \t}\r\n \telse if($cantidad_faltante>0)\r\n \t{\r\n \t\t//si en cambio, la cantidad faltante (que es mayor que cero) para cubrir lo requerido por la fila es\r\n \t\t//menor que la cantidad en la reserva que estamos viendo,\r\n \t\t//utilizamos de esa reserva solo la cantidad faltante, pero el resto la dejamos como estaba en la reserva\r\n \t\t$cantidad_a_utilizar=$cantidad_faltante;\r\n \t\t$cantidad_no_utilizada=$cant_reserva_actual-$cantidad_faltante;\r\n \t}\r\n \telse\r\n \t die(\"Error interno: la cantidad acumulada ($cantidad_acumulada_de_reservas) no es mayor o igual que la pedida por la fila($cantidad_pedida_para_fila)<br>\r\n \t \t Pero la cantidad faltante es igual a cero. Consulte a la División Software por este error. \");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas+=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$cantidad_no_utilizada;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar+=$cantidad_a_utilizar;\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n else//si ya se acumulo todo lo que la fila pedia, la reserva queda como esta y lo indicamos en el arreglo\r\n {\r\n \t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n\r\n }//de for($j=0;$j<$reservas_a_bajar;$j++)\r\n\r\n //agregamos a la primer reserva, la cantidad que se utilizara de las demas reservas\r\n $query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_total_a_sumar,\r\n id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\t sql($query, \"<br>c612: Error al actualizar la reserva de la fila con las otras reservas<br>\") or fin_pagina();\r\n\r\n //luego, por cada reserva afectada extra, descontamos las cantidades utilizadas\r\n for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n {\r\n \t//si de esta reserva se utilizo algo de su cantidad debemos descontar esa cantidad\r\n \t//ya sea actualizando la cantidad de la reserva en cuestion, si aun queda una parte\r\n \t//sin utilizar; o eliminando ese detalle de reserva porque se utilizó completa\r\n \tif($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n \t{\r\n \t\t//si se utilizó toda la cantidad para esa reserva, simplemente se elimina la reserva,\r\n \t\t//debio a que ya quedó esa cantidad registrada como parte de la primer reserva con id: $id_primer_reserva\r\n \t\tif($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\t{\r\n \t\t\t$query=\"delete from stock.detalle_reserva where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al eliminar la reserva con id \".$reservas_a_bajar[$j][\"id\"].\"<br>\") or fin_pagina();\r\n \t\t}//de if($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\telseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\t{\r\n \t\t\t//si la cantidad de la reserva a utilizar es menor que la reservada, entonces se resta de dicha reserva\r\n \t\t\t//la cantidad utilizada, y se registra en el log de stock que se utilizo esa cantidad\r\n \t\t\t$query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al actualizar la cantidad del detalle de la reserva<br>\") or fin_pagina();\r\n\r\n \t\t\t//la cantidad utilizada entra a la primer reserva, por lo que solo es necesario registrar el log en\r\n \t\t\t//los movimientos de stock la utilizacion de $reservas_a_bajar[$j][\"cantidad_utilizada\"]\r\n \t\t\t//para la reserva $reservas_a_bajar[$j][\"id\"]\r\n\r\n \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM654: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t//generamos el log\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n\r\n\t\t\t //y generamos el correspondiente log indicando que se utilizaron productos reservados\r\n\t\t\t \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM700: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n \t\t}//de elseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\telse\r\n \t\t{\r\n \t\t\t//SI ENTRA POR ACA SIGNIFICA QUE LA CANTIDAD UTILIZADA ES MAYOR A LA RESERVADA PARA ESA RESERVA,\r\n \t\t\t//POR LO TANTO LA DECISION ANTERIOR AL ARMAR EL ARREGLO $reservas_a_bajar FUE INCORRECTA. ENTONCES\r\n \t\t\t//NO SE PUEDE CONTINUAR CON LA EJECUCION PORQUE ALGO ESTA MAL HECHO\r\n \t\t\tdie(\"Error interno: La cantidad que se decidio utilizar para la reserva con id \".$reservas_a_bajar[$j][\"id\"].\" es mayor a la que estaba reservada originalmente.<br>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCantidad a utilizar: \".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" - Cantidad reservada: \".$reservas_a_bajar[$j][\"cantidad_reservada\"].\"<br>\r\n \t\t\t No se puede continuar la ejecución. Contacte a la División Software\");\r\n \t\t}//del else\r\n\r\n \t}//de if($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n\r\n }//de for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n\r\n\t\t\t\t\t\t\t\t\t}//if($acum_otras_reservas)\r\n\r\n\t\t\t\t\t\t\t\t}//del else de if($nueva_reserva_pm)\r\n///////////////////////////////\r\n\r\n\t\t\t\t\t\t }//de if ($items[$i][\"cantidad_res\"]>0)\r\n }//de if($items[$i]['id_producto'])\r\n }//de if($items[$i]['id_detalle_movimiento']==\"\")\r\n //sino, si la fila no fue borrada, la actualizamos\r\n elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n {\r\n\r\n\t for($j=0;$j<$items_en_bd['cantidad'];$j++){\r\n\r\n\t if ($items_en_bd[$j][\"id_detalle_movimiento\"]==$items[$i][\"id_detalle_moviento\"])\r\n\t $cantidad_reservada_bd=$items_en_bd[$j][\"cantidad\"];\r\n\r\n\t }\r\n\r\n\t if ($cantidad_reservada_bd==$items[$i][\"cantidad\"])\r\n\t {\r\n\t //se modifico la cantidad y tendriamos que borrar los reservados\r\n\t //cancelar_reserva\r\n\t //reservar_stock\r\n\t }\r\n\r\n\t $query=\"update detalle_movimiento set descripcion='\".$items[$i]['descripcion'].\"',cantidad=\".$items[$i]['cantidad'].\",precio=\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\"\r\n\t where id_detalle_movimiento=\".$items[$i]['id_detalle_movimiento'];\r\n\t sql($query) or fin_pagina(\"<br>Error al actualizar el producto $i del movimiento <br>$query\");\r\n\r\n\r\n }//de elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n $db->CompleteTrans();\r\n}", "function guardar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t$tipo = ($datos['tipo']==1) ? 1 : 4 ;\n\n\n\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_productos\n\t\t\t\t\t\t(codigo, nombre, precio, linea, costo_servicio, id_unidad_venta, id_unidad_compra,\n\t\t\t\t\t\t\ttipo_producto\n\t\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['codigo'].\"','\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t1, \".$datos['costo'].\", \".$datos['unidad_venta'].\", \".$datos['unidad_compra'].\", \".$tipo.\"\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda los campos de foodware\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_campos_foodware\n\t\t\t\t\t\t(id_producto, ganancia)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$result.\"', '\".$datos['margen_ganancia'].\"')\";\n\t\t// return $sql;\n\t\t$result_foodware =$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function insert($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "function insert($data){\n try{\n $query=$this->db->conn()->prepare(\"INSERT INTO ALUMNO (NOMBRE,APELLIDO,TELEFONO) VALUES (:nombre,:apellido,:telefono)\");\n $query->execute(['nombre'=>$data['nombre'],'apellido'=>$data['apellido'],'telefono'=>$data['telefono']]);\n return true;\n }catch(PDOException $e){\n return false;\n }\n }", "function UpdateProduct($productId, $name, $desc, $imageUrl, $basePrice, $salePrice, $catId)\n{\n global $conn;\n \n $sql = \"UPDATE product \n SET Name = :Name, Description = :Description, ImageUrl = :ImageUrl, \n BasePrice = :BasePrice, SalePrice = :SalePrice, CategoryID = :catId \n WHERE ProductID = :ProductID\";\n \n $np = array();\n $np[':Name'] = $name;\n $np[':Description'] = $desc;\n $np[':ImageUrl'] = $imageUrl;\n $np[':BasePrice'] = $basePrice;\n $np[':SalePrice'] = $salePrice;\n $np[':catId'] = $catId;\n $np[':ProductID'] = $productId;\n \n $stmt = $conn->prepare($sql);\n $stmt->execute($np);\n\n return true;\n}", "function altaProducte($nom, $descripcio, $preu, $idUsuari){\n $conn=connexioBD();\n $sql=\"INSERT INTO productes (nom, descripcio, preu, usuari_id) VALUES ('$nom', '$descripcio', '$preu', $idUsuari)\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al darte de alta\".$conn->error);\n }else{\n $idProducte=$conn->insert_id;\n return $idProducte;\n }\n $conn->close();\n}", "function actualizarProducto(){\n\t\t$x = $this->pdo->prepare('UPDATE producto SET cantidadExistencia = ?, precio = ? \n\t\t\tWHERE codProducto = ?');\n\t\t$x-> execute(array($this->cantidadExistencia,$this->precio,$this->codProducto));\n\t\treturn $x;\n\t}", "public function agregar_EquipoExt($datosEquipo){\n\n //prepared statement y relacionamiento:\n $stmt=$this->db->prepare(\"CALL INSERT_EQUIPOEXT(:nombre,:marca,:modelo,:fc,:fs,\n :codmod,:codcli,:pc,:ps,:ubicacion,:garantia,:estado, :placa)\");\n $stmt->bindParam(':placa', $placa);\n $stmt->bindParam(':nombre', $nombre);\n $stmt->bindParam(':marca', $marca);\n $stmt->bindParam(':modelo', $modelo);\n $stmt->bindParam(':fc', $fc);\n $stmt->bindParam(':fs', $fs);\n $stmt->bindParam(':codmod', $codmod);\n $stmt->bindParam(':codcli', $codcli);\n $stmt->bindParam(':pc', $pc);\n $stmt->bindParam(':ps', $ps);\n $stmt->bindParam(':ubicacion',$ubicacion);\n $stmt->bindParam(':garantia',$garantia);\n $stmt->bindParam(':estado',$estado);\n\n $placa=$datosEquipo['placa'];\n $nombre=$datosEquipo['nombre'];\n $marca=$datosEquipo['marca'];\n $modelo=$datosEquipo['modelo'];\n $fc=$datosEquipo['fc'];\n $fs=$datosEquipo['fs'];\n $codmod=$datosEquipo['cod_mod'];\n $codcli=$datosEquipo['cod_cliente'];\n $pc=$datosEquipo['pc'];\n $ps=$datosEquipo['ps'];\n $ubicacion=$datosEquipo['ubicacion'];\n $garantia=$datosEquipo['garantia'];\n $estado=$datosEquipo['estado'];\n\n $stmt->execute();\n\n $this->db=null; //cerrar conexión\n\n\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 }", "static public function mdlIngresarAutoconsumo($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_usuario,codigo , descripcion, productos, total, fecha_emision) VALUES (:id_usuario, :codigo, :descripcion, :productos, :total, :fecha_emision)\");\n\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":descripcion\", $datos[\"descripcion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":productos\", $datos[\"productos\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":total\", $datos[\"total\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_emision\", $datos[\"fecha_emision\"], PDO::PARAM_STR);\n\t\n\t\t\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn $stmt->errorInfo();\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function agregar_EquipoAlm($datosEquipo){\n\n $stmt=$this->db->prepare(\"CALL INSERT_EQUIPOALM(:nombre,:marca,:modelo,:fc,:pc)\");\n $stmt->bindParam(':nombre', $nombre);\n $stmt->bindParam(':marca', $marca);\n $stmt->bindParam(':modelo', $modelo);\n $stmt->bindParam(':fc', $fc);\n $stmt->bindParam(':pc', $pc);\n\n $nombre=$datosEquipo['nombre'];\n $marca=$datosEquipo['marca'];\n $modelo=$datosEquipo['modelo'];\n $fc=$datosEquipo['fc'];\n $pc=$datosEquipo['pc'];\n\n $stmt->execute();\n\n $this->db=null; //cerrar conexión\n\n\n }", "static public function createProduct($datos){\n\n\t\tif(isset($datos[\"tituloProducto\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $datos[\"tituloProducto\"]) && preg_match('/^[,\\\\.\\\\a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"descripcionProducto\"]) ){\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PORTADA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaPortada = \"../views/img/cabeceras/default/default.jpg\";\n\n\t\t\t\tif(isset($datos[\"fotoPortada\"][\"tmp_name\"]) && !empty($datos[\"fotoPortada\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPortada\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 1280;\n\t\t\t\t\t$nuevoAlto = 720;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PRINCIPAL\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/default/default.jpg\";\n\n\t\t\t\tif(isset($datos[\"fotoPrincipal\"][\"tmp_name\"]) && !empty($datos[\"fotoPrincipal\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 400;\n\t\t\t\t\t$nuevoAlto = 450;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN OFERTA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaOferta = \"\";\n\n\t\t\t\tif(isset($datos[\"fotoOferta\"][\"tmp_name\"]) && !empty($datos[\"fotoOferta\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoOferta\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 640;\n\t\t\t\t\t$nuevoAlto = 430;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tPREGUNTAMOS SI VIENE OFERTE EN CAMINO\n\t\t\t\t=============================================*/\n\t\t\t\tif($datos[\"selActivarOferta\"] == \"oferta\"){\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"], \n\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t \"oferta\"=>1,\n\t\t\t\t\t\t \"precioOferta\"=>$datos[\"precioOferta\"],\n\t\t\t\t\t\t \"descuentoOferta\"=>$datos[\"descuentoOferta\"],\n\t\t\t\t\t\t \"imgOferta\"=>substr($rutaOferta,3),\n\t\t\t\t\t\t \"finOferta\"=>$datos[\"finOferta\"]\n\t\t\t\t\t );\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"], \n\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t \"oferta\"=>0,\n\t\t\t\t\t\t \"precioOferta\"=>0,\n\t\t\t\t\t\t \"descuentoOferta\"=>0,\n\t\t\t\t\t\t \"imgOferta\"=>\"\",\n\t\t\t\t\t\t \"finOferta\"=>\"\"\n\t\t\t\t\t );\n\n\t\t\t\t}\n\n\t\t\t\t//return $datosProducto;\n\n\t\t\t\tHeadersModel::createHeader(\"headers\", $datosProducto);\n\n\t\t\t\t$respuesta = ProductsModel::createProduct(\"products\", $datosProducto);\n\n\t\t\t\treturn $respuesta;\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"error\",\n\t\t\t\t\t title: \"¡El nombre del producto no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\tif (result.value) {\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\t}", "public function insertarMovimiento(\n $fecha,\n $id_producto,\n $cantidad,\n $precio,\n $id_proveedor,\n $id_empleado,\n $compra_venta,\n $id_categoria\n ) {\n $mensaje = \" \";\n\n try {\n\n $conexion = conexion::conectar();\n $sql = \"INSERT INTO movimientos (fecha,\n id_producto, \n cantidad, \n precio, \n id_proveedor, \n id_empleado,\n compra_venta, \n id_categoria) \n VALUES (:fecha,:id_producto,:cantidad,:precio,:id_proveedor,:id_empleado,:compra_venta,:id_categoria)\";\n\n $stmt = $conexion->prepare($sql);\n\n $stmt->bindParam(\":fecha\", $fecha);\n $stmt->bindParam(\":id_producto\", $id_producto);\n $stmt->bindParam(\":cantidad\", $cantidad);\n $stmt->bindParam(\":precio\", $precio);\n $stmt->bindParam(\":id_proveedor\", $id_proveedor);\n $stmt->bindParam(\":id_empleado\", $id_empleado);\n $stmt->bindParam(\":compra_venta\", $compra_venta);\n $stmt->bindParam(\":id_categoria\", $id_categoria);\n $stmt->execute();\n\n $mensaje = \"Realizado con exito !!\";\n } catch (PDOException $e) {\n\n echo \" el error es\" . $e->getMessage();\n }\n\n $stmt = null;\n return $mensaje;\n }", "public function create($pdo, $objAux){\n $cod_product = $objAux -> get('name_product');\n $cant_pro = $objAux -> get('cant_pro');\n \n\t\t\t\n $sql=\"insert into lista_venta (cod_product, cant_pro) values(?,?)\";\n $sentencia = $pdo -> prepare($sql);\n $sentencia -> execute (array( $cod_product, $cant_pro));\n }", "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}", "public function InsertarProducto(){\n if($this->controller->isLogged() && $_SESSION[\"ADMIN\"]==1){\n if(($_POST['producto'])!=null && ($_POST['precio'])!=null && ($_POST['marca'])!=null && ($_POST['temporada_id'])!=null){ \n $producto= $_POST['producto'];\n $precio = $_POST['precio'];\n $marca = $_POST['marca'];\n $temporada = $_POST['temporada_id'];\n $this->model->InsertarProducto($producto, $precio, $marca, $temporada);\n header(\"Location: \".BASE_URL.\"adminProductos\");\n }\n header(\"Location: \".BASE_URL.\"adminProductos\");\n }else{\n header(\"Location: \".BASE_URL.\"login\");\n }\n }", "function addProduct($insertProduct)\n{\n $pid = $insertProduct['pid'];\n $cid = $insertProduct['cid'];\n $name = $insertProduct['name'];\n $price = $insertProduct['price'];\n $sdesc = $insertProduct['sdesc'];\n $ldesc = $insertProduct['ldesc'];\n $image = $insertProduct['image'];\n $tags = $insertProduct['tags'];\n $color = $insertProduct['color'];\n\n // echo $pid, $cid, $name, $price, $sdesc, $ldesc;\n // exit();\n\n global $conn;\n $sql = \"INSERT INTO products (`product_id`, `category_id`, `name`, `price`,\n `short_desc`, `long_desc`, `image`, `tags`, `color`) VALUES ('$pid', '$cid', '$name', '$price', '$sdesc',\n '$ldesc', '$image', '$tags', '$color')\";\n if (mysqli_query($conn, $sql)) {\n $msg = \"Product Added Suuccessfully\";\n return $msg;\n }\n}", "protected function insertProdutcsTable($user)\n {\n DB::connection('mysql_shop')->table('producto')->insert(array(\n array(\n 'imagen' => 'product1.jpg',\n 'categoria_id' => '1',\n 'codigo' => '001',\n 'nombre' => 'PRODUCTO 1',\n 'precio_compra' => '20000',\n 'precio_venta' => '33000',\n 'stock_minimo' => '0',\n 'stock_maximo' => '0',\n 'fecha_vencimiento' => '',\n 'ubicacion' => '',\n 'ganancia' => '0',\n 'mostrar_stock' => '0',\n 'destacado_tienda' => '1',\n 'tienda' => '1',\n 'descripcion' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere.;',\n 'descripcion_larga' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere. Pellentesque vel tortor varius, sagittis dolor tristique, mattis sapien. Morbi diam risus, iaculis in eros quis, fermentum accumsan massa. Ut id felis eget nibh volutpat tincidunt non vitae nisl. Integer dapibus ultricies nibh id luctus. Quisque tempus felis sed purus pulvinar congue. Donec sed enim at quam lacinia ornare. Proin sed nunc eu felis luctus suscipit vitae finibus dui. Fusce augue ligula, tincidunt ac ante eu, consectetur dignissim elit. Vivamus sollicitudin nisl dolor, eget bibendum mauris laoreet sit amet. Aliquam sagittis lacus quis lacus dapibus suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;',\n ),\n array(\n 'imagen' => 'product2.jpg',\n 'categoria_id' => '1',\n 'codigo' => '002',\n 'nombre' => 'PRODUCTO 2',\n 'precio_compra' => '2000',\n 'precio_venta' => '5500',\n 'stock_minimo' => '0',\n 'stock_maximo' => '0',\n 'fecha_vencimiento' => '',\n 'ubicacion' => '',\n 'ganancia' => '0',\n 'mostrar_stock' => '0',\n 'destacado_tienda' => '1',\n 'tienda' => '1',\n 'descripcion' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere.;',\n 'descripcion_larga' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere. Pellentesque vel tortor varius, sagittis dolor tristique, mattis sapien. Morbi diam risus, iaculis in eros quis, fermentum accumsan massa. Ut id felis eget nibh volutpat tincidunt non vitae nisl. Integer dapibus ultricies nibh id luctus. Quisque tempus felis sed purus pulvinar congue. Donec sed enim at quam lacinia ornare. Proin sed nunc eu felis luctus suscipit vitae finibus dui. Fusce augue ligula, tincidunt ac ante eu, consectetur dignissim elit. Vivamus sollicitudin nisl dolor, eget bibendum mauris laoreet sit amet. Aliquam sagittis lacus quis lacus dapibus suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;',\n ),\n array(\n 'imagen' => 'product3.jpg',\n 'categoria_id' => '1',\n 'codigo' => '003',\n 'nombre' => 'PRODUCTO 3',\n 'precio_compra' => '22000',\n 'precio_venta' => '36000',\n 'stock_minimo' => '0',\n 'stock_maximo' => '0',\n 'fecha_vencimiento' => '',\n 'ubicacion' => '',\n 'ganancia' => '0',\n 'mostrar_stock' => '0',\n 'destacado_tienda' => '1',\n 'tienda' => '1',\n 'descripcion' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere.;',\n 'descripcion_larga' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere. Pellentesque vel tortor varius, sagittis dolor tristique, mattis sapien. Morbi diam risus, iaculis in eros quis, fermentum accumsan massa. Ut id felis eget nibh volutpat tincidunt non vitae nisl. Integer dapibus ultricies nibh id luctus. Quisque tempus felis sed purus pulvinar congue. Donec sed enim at quam lacinia ornare. Proin sed nunc eu felis luctus suscipit vitae finibus dui. Fusce augue ligula, tincidunt ac ante eu, consectetur dignissim elit. Vivamus sollicitudin nisl dolor, eget bibendum mauris laoreet sit amet. Aliquam sagittis lacus quis lacus dapibus suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;',\n ),\n array(\n 'imagen' => 'product4.jpg',\n 'categoria_id' => '1',\n 'codigo' => '004',\n 'nombre' => 'PRODUCTO 4',\n 'precio_compra' => '9000',\n 'precio_venta' => '17000',\n 'stock_minimo' => '0',\n 'stock_maximo' => '0',\n 'fecha_vencimiento' => '',\n 'ubicacion' => '',\n 'ganancia' => '0',\n 'mostrar_stock' => '0',\n 'destacado_tienda' => '1',\n 'tienda' => '1',\n 'descripcion' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere.;',\n 'descripcion_larga' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo nec mi pulvinar posuere. Pellentesque vel tortor varius, sagittis dolor tristique, mattis sapien. Morbi diam risus, iaculis in eros quis, fermentum accumsan massa. Ut id felis eget nibh volutpat tincidunt non vitae nisl. Integer dapibus ultricies nibh id luctus. Quisque tempus felis sed purus pulvinar congue. Donec sed enim at quam lacinia ornare. Proin sed nunc eu felis luctus suscipit vitae finibus dui. Fusce augue ligula, tincidunt ac ante eu, consectetur dignissim elit. Vivamus sollicitudin nisl dolor, eget bibendum mauris laoreet sit amet. Aliquam sagittis lacus quis lacus dapibus suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;',\n )\n ));\n\n DB::connection('mysql_shop')->table('stock_actual')->insert(array(\n array(\n 'almacen_id' => 1,\n 'producto_id' => 1,\n 'unidades' => 10,\n ),\n array(\n 'almacen_id' => 1,\n 'producto_id' => 2,\n 'unidades' => 10,\n ),\n array(\n 'almacen_id' => 1,\n 'producto_id' => 3,\n 'unidades' => 10,\n ),\n array(\n 'almacen_id' => 1,\n 'producto_id' => 4,\n 'unidades' => 10,\n )\n ));\n\n for ($i = 1; $i <= 4; $i++) {\n $product = 'product' . $i;\n\n if (!is_dir(public_path('uploads/'. $user->dbConfig->base_dato . '/imagenes_productos/'))) {\n mkdir(public_path('uploads/'. $user->dbConfig->base_dato . '/imagenes_productos/'), 0777, true);\n }\n\n File::copy(public_path('/img/' . $product . '.jpg'), public_path('uploads/'. $user->dbConfig->base_dato . '/imagenes_productos/' . $product . '.jpg'));\n }\n }", "public static function updateProduct( $data )\n {\n $consulta = DataBase::consulta(\"select * from productos where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\");\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Comprobar si el nuevo producto editado existe\n if(count($consulta) > 0 ) {\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$consulta[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n\n } else {\n\n DataBase::insertar('\n insert into productos (producto, categoria)\n values (\"'.$data[\"editNameProduct\"].'\", '.$data[\"editCategoryProduct\"].')\n ');\n $idProducto = DataBase::consulta(\"\n select idProducto from productos\n where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\n \");\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$idProducto[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n }\n }", "function createProduct(ProductEntity $product)\n {\n $sql = \"INSERT INTO \" . DB_NAME . \".`products`(`name`, `doamine realise`, `tache realisee`, `image`) \n VALUES (:name,:doamine realise,:tache realisee,:image)\";\n try {\n $result = $this->connexion->prepare($sql);\n $data = $result->execute(array(\n ':name' => $product->getName(),\n ':doamine realise' => $product->getDomaine_realise(),\n ':tache realisee' => $product->getTache_realisee(),\n ':image' => $product->getImage()\n ));\n if ($data) {\n return $this->connexion->lastInsertId();\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "function tambah($data) \n{\n $conn = koneksi();\n\n $img = htmlspecialchars($data['img']);\n $nama = htmlspecialchars($data['nama']);\n $ukuran = htmlspecialchars($data['ukuran']);\n $deskripsi = htmlspecialchars($data['deskripsi']);\n $harga = htmlspecialchars($data['harga']);\n $stok = htmlspecialchars($data['stok']);\n $produk = htmlspecialchars($data['produk']);\n\n $query = \"INSERT INTO tabel_product VALUES\n ('', '$img', '$nama', '$ukuran', '$deskripsi', '$harga', '$stok', '$produk')\";\n\n mysqli_query($conn, $query);\n\n return mysqli_affected_rows($conn);\n}", "static public function mdlIngresarInventario($tabla, $datos){\n\n \t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, medida_ingreso, cantidad_alerta, costo_ideal ,codigo_barras, fecha, sincronizado ) VALUES (:nombre, :medida_ingreso, :cantidad_alerta, :costo_ideal ,:codigo_barras, :fecha , 0 )\");\n\n \n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":medida_ingreso\", $datos[\"medida_ingreso\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cantidad_alerta\", $datos[\"cantidad_alerta\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":costo_ideal\", $datos[\"costo_ideal\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codigo_barras\", $datos[\"codigo_barras\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha\", $datos[\"fecha\"], PDO::PARAM_STR);\n\t\t\n\n \t\tif( $stmt -> execute()) \n \t\t\treturn \"ok\";\n \t\telse \n \t\t\treturn \"error\";\n\n \t\t$stmt-> close();\n \t\t$stmt= null;\n \t}", "function insert_to_uo($db, $orderID, $flour_qty, $cheese_qty) {\n $query = 'INSERT INTO undelivered_orders VALUES (:order_id, :flour, :cheese)';\n $statement = $db->prepare($query);\n $statement->bindValue(':order_id', $orderID); \n $statement->bindValue(':flour', $flour_qty); \n $statement->bindValue(':cheese', $cheese_qty); \n $statement->execute(); \n $statement->closeCursor();\n}", "public function save()\n {\n try {\n global $connection;\n if ($this->purchase_uuid == \"\") {\n $sqlQuery =\n \"CALL purchase_insert(:p_product_uuid,:p_customer_uuid,:p_quantity, :p_comments, :p_price, :p_subtotal, :p_taxes, :p_grandtotal)\";\n\n $PDOStatement = $connection->prepare($sqlQuery);\n\n $PDOStatement->bindParam(\n ':p_product_uuid',\n $this->product_uuid\n );\n $PDOStatement->bindParam(\n ':p_customer_uuid',\n $this->customer_uuid\n );\n $PDOStatement->bindParam(':p_quantity', $this->quantity);\n $PDOStatement->bindParam(':p_comments', $this->comment);\n $PDOStatement->bindParam(':p_price', $this->price);\n $PDOStatement->bindParam(':p_subtotal', $this->subtotal);\n $PDOStatement->bindParam(':p_taxes', $this->taxes);\n $PDOStatement->bindParam(':p_grandtotal', $this->grandtotal);\n\n $PDOStatement->execute();\n return true;\n }\n } catch (Exception $E) {\n echo $E->getMessage();\n return false;\n }\n }", "public function setPremio($datos)\n {\n $stmt = Conexion::conectar()->prepare(\"INSERT INTO premios (nombre,costo)\n VALUES (:nombre,:precio)\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":precio\", $datos[\"precio\"] , PDO::PARAM_STR);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\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 }", "function editProducto($producto)\n{\n\t\t$con = getDBConnection();\n\t\t$sql = \"UPDATE productos SET nombre = :nombre, descripcion = :descripcion, precio = :precio WHERE id = :id\";\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->bindParam(':id', $producto->id);\n\t\t$stmt->bindParam(':nombre', $producto->nombre);\n\t\t$stmt->bindParam(':descripcion', $producto->descripcion);\n\t\t$stmt->bindParam(':precio', $producto->precio);\n\t\t$stmt->execute();\n}", "static public function mdlIngresaritems($tabla, $datos){\n\t\t\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_accion_centra\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_partida_presupuestaria\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_fuente_financiamiento\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_actvcomercial\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_municipio\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_estado\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_ccnu\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,especificacion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,cantidad\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,i\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,ii\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,iii\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,iv\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,und\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,costo_unitario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,precio_total\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,alicuota_iva\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,monto_iva\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,monto_total\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,ano\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,fecha\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,codigo ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (:id_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_accion_centra\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_partida_presupuestaria\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_fuente_financiamiento\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_actvcomercial\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_municipio\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_estado\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_ccnu\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:especificacion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:cantidad\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:i\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:ii\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:iii\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:iv\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:und\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:costo_unitario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:precio_total\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:alicuota_iva\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:monto_iva\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:monto_total\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:ano\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:fecha \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t,:codigo)\");\n\n$stmt->bindParam(\":id_programacion_anual\", $datos[\"id_programacion_anual\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_proyecto\", $datos[\"id_proyecto\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_accion_centra\", $datos[\"id_accion_centra\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_entes\", $datos[\"id_entes\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_partida_presupuestaria\", $datos[\"id_partida_presupuestaria\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_fuente_financiamiento\", $datos[\"id_fuente_financiamiento\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_actvcomercial\", $datos[\"id_actvcomercial\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_municipio\", $datos[\"id_municipio\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_estado\", $datos[\"id_estado\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_ccnu\", $datos[\"id_ccnu\"], PDO::PARAM_STR);\n$stmt->bindParam(\":especificacion\", $datos[\"especificacion\"], PDO::PARAM_STR);\n$stmt->bindParam(\":cantidad\", $datos[\"cantidad\"], PDO::PARAM_STR);\n$stmt->bindParam(\":i\", $datos[\"i\"], PDO::PARAM_STR);\n$stmt->bindParam(\":ii\", $datos[\"ii\"], PDO::PARAM_STR);\n$stmt->bindParam(\":iii\", $datos[\"iii\"], PDO::PARAM_STR);\n$stmt->bindParam(\":iv\", $datos[\"iv\"], PDO::PARAM_STR);\n$stmt->bindParam(\":und\", $datos[\"und\"], PDO::PARAM_STR);\n$stmt->bindParam(\":costo_unitario\", $datos[\"costo_unitario\"], PDO::PARAM_STR);\n$stmt->bindParam(\":precio_total\", $datos[\"precio_total\"], PDO::PARAM_STR);\n$stmt->bindParam(\":alicuota_iva\", $datos[\"alicuota_iva\"], PDO::PARAM_STR);\n$stmt->bindParam(\":monto_iva\", $datos[\"monto_iva\"], PDO::PARAM_STR);\n$stmt->bindParam(\":monto_total\", $datos[\"monto_total\"], PDO::PARAM_STR);\n$stmt->bindParam(\":ano\", $datos[\"ano\"], PDO::PARAM_STR);\n$stmt->bindParam(\":tipo\", $datos[\"tipo\"], PDO::PARAM_STR);\n$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n$stmt->bindParam(\":fecha\", $datos[\"fecha\"], PDO::PARAM_STR);\n$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\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\n//var_dump($datos);\n//exit($datos);\nif($stmt->execute()){\n\n\treturn \"ok\";\n\n}else{\n\n\t$arr=$stmt->errorInfo();\n\treturn $arr[2];\n\n}\n\n$stmt->close();\n$stmt = null;\n\n}", "public function save()\n {\n \n global $connection;\n //echo \"Im on the purchases ->save()\";\n\n\n //if($this->customer_id == \"\")\n //{\n #set error handler\n #set exception handler\n #call stored procedures\n $SQLQuery = \"CALL purchases_insert(\"\n . \":fk_customer_id,\"\n . \":fk_product_id,\"\n . \":purchase_quantity,\"\n . \":purchase_price,\"\n . \":purchase_comment,\"\n . \":purchase_subtotal,\"\n . \":purchase_taxesAmount,\"\n . \":purchase_grandtotal);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":fk_customer_id\", $this->customer_id);\n $PDOStatement->bindParam(\":fk_product_id\", $this->product_id);\n $PDOStatement->bindParam(\":purchase_quantity\", $this->purchase_quantity);\n $PDOStatement->bindParam(\":purchase_price\", $this->purchase_price);\n $PDOStatement->bindParam(\":purchase_comment\", $this->purchase_comment);\n $PDOStatement->bindParam(\":purchase_subtotal\", $this->purchase_subtotal);\n $PDOStatement->bindParam(\":purchase_taxesAmount\", $this->purchase_taxesAmount);\n $PDOStatement->bindParam(\":purchase_grandtotal\", $this->purchase_grandTotal);\n \n $PDOStatement->execute(); \n }" ]
[ "0.8028034", "0.76822054", "0.7514043", "0.7371036", "0.7244796", "0.72040266", "0.71453357", "0.71063894", "0.70620036", "0.70212555", "0.6981778", "0.69788176", "0.695198", "0.6944085", "0.69093907", "0.6841821", "0.68402296", "0.68132037", "0.67915267", "0.6755007", "0.6751126", "0.6749574", "0.674941", "0.67434156", "0.67345077", "0.6722594", "0.67099035", "0.6671658", "0.665453", "0.66299146", "0.6604745", "0.65869755", "0.6578058", "0.6574542", "0.65584636", "0.6554084", "0.6541121", "0.65349543", "0.65289843", "0.6516474", "0.65112484", "0.6503958", "0.64782566", "0.64715534", "0.6470881", "0.6470429", "0.6456823", "0.6449583", "0.64452624", "0.64433485", "0.6437199", "0.6413095", "0.6409472", "0.64002866", "0.64001167", "0.6399006", "0.63972765", "0.6381012", "0.63805723", "0.63760185", "0.6375439", "0.6370464", "0.637029", "0.6367407", "0.63660836", "0.6365264", "0.63522214", "0.6345252", "0.63269514", "0.63247436", "0.6321473", "0.6319579", "0.6318917", "0.631834", "0.6302314", "0.6301812", "0.62986547", "0.6292156", "0.62858176", "0.62850475", "0.6284385", "0.62665033", "0.6249444", "0.6248959", "0.62449825", "0.62445813", "0.6242837", "0.624071", "0.62362313", "0.6232953", "0.62286496", "0.622637", "0.6222146", "0.62197363", "0.6210645", "0.6196092", "0.619494", "0.6193735", "0.6182278", "0.61821187", "0.6174298" ]
0.0
-1
BORRAR PRODUCTO, dado un id, borra el producto de la tabla products
public function borrarProductoModel($datosModel){ $stmt = Conexion::conectar()->prepare("DELETE FROM products WHERE id = :id"); $stmt->bindParam(":id", $datosModel, PDO::PARAM_INT); if($stmt->execute()){ return "success"; } else{ return "error"; } $stmt->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buscarProducto($idProducto)\n {\n $crudProducto=new crudProducto();\n return $crudProducto->buscarProducto($idProducto);\n\n }", "public function ProductosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function producto_tralado_por_id($id_producto,$id_ingreso){\n $conectar= parent::conexion();\n $sql=\"select p.modelo,p.marca,p.medidas,p.color,e.id_producto,e.id_ingreso,e.categoriaub,e.stock from producto as p inner join existencias as e on p.id_producto=e.id_producto and e.id_producto=? and id_ingreso=?\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $id_producto);\n $sql->bindValue(2, $id_ingreso);\n $sql->execute();\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function obtener_productos_ordencompra($id)\n {\n $this->db->join('productosordencompra','productosordencompra.idproducto=productos.idproducto');\n $this->db->where('productosordencompra.idordencompra',$id);\n return $this->db->get('productos')->result();\n }", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "public function get_producto_por_id($id_producto){\n\n $conectar= parent::conexion();\n\n //$output = array();\n\n $sql=\"select * from producto where id_producto=?\";\n\n $sql=$conectar->prepare($sql);\n\n $sql->bindValue(1,$id_producto);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n\n }", "public static function pro2($id){\n return DB::table('productos')\n ->join('detalle_contratos', 'detalle_contratos.idProd', '=', 'productos.id')\n ->where('detalle_contratos.idcontratos', '=', $id )\n //->where('detalle_compras.idcomps','=',$id);\n //->join('compras', 'compras.id', '=', )\n \n ->select('detalle_contratos.*','productos.nomProd','productos.cPromedio')\n //->orderBy('productos.id')\n ->get();\n }", "function getProducte($idProducte){\n $conn=connexioBD();\n $sql=\"SELECT * FROM productes WHERE id='$idProducte'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($producte=$resultado->fetch_assoc()){\n $product=$producte; \n }\n }\n return $product;\n $resultado->free();\n $conn->close();\n}", "public function DetalleProductosPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function getProductDetailsById($id) {\r\n global $tableProducts;\r\n\r\n $dbc = connection();\r\n $dbc->quote($tableProducts);\r\n $req = \"SELECT p.id AS idProduit, p.title, p.short_desc, p.long_desc, p.is_frontpage,\"\r\n . \" p.availability_date, p.expiration_date, p.view_count, p.id_brand, b.id AS idBrand,\"\r\n . \" b.name AS brandName, (NOW() < availability_date OR NOW() > expiration_date) AS isExpired\"\r\n . \" FROM $tableProducts AS p\"\r\n . \" INNER JOIN brands as b ON p.id_brand = b.id\"\r\n . \" WHERE p.id = $id\";\r\n\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->execute();\r\n $data = $requPrep->fetch(PDO::FETCH_OBJ);\r\n $requPrep->closeCursor();\r\n\r\n return $data;\r\n}", "public function inventario_consultarProveedoresProducto($idProducto){\n \t\t\t\t\n \t\t$resultado = array();\t\n \t\t\t\n \t\t$query = \"SELECT \n\t\t\t\t\t\t\t PP.costo, P.nombre AS nombreProveedor, P.telefono1\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t tb_productos_proveedores AS PP\n\t\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t\t tb_proveedores AS P ON P.idProveedor = PP.idProveedor\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t PP.idProducto = '$idProducto'\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n \t\n }", "public function listaProductos($id)\n{\n conectar::conexiones();\n $sql=\"SELECT id, nombreArticulo, ventaFinal, ventaProvedor FROM items\";\n $query=mysql_query($sql);\n\n echo '<div class=\"table-responsive\">\n <table id=\"dataTable1\" class=\"table table-bordered table-striped-col\">\n <thead>\n <tr>\n <th>Nombre</th>\n <th>Valor Normal</th>\n <th>Valor Con Descuento</th>\n <th></th>\n \n </tr>\n </thead>\n \n ';\n \n while ($rs=mysql_fetch_array($query)) {\n # code...\n\n echo ' <tr>\n <td>'.$rs[\"nombreArticulo\"].'</td>\n <td align=\"center\">$'.number_format($rs[\"ventaFinal\"]).'</td>\n <td align=\"center\">$'.number_format($rs[\"ventaProvedor\"]).'</td>\n <td>\n\n <a href=\"'.$this->datospagina(5).'/productos/producto.php?id='.$id.'&producto='.$this->encrypt($rs[\"id\"], publickey).'\">\n <button class=\"btn btn-primary\"><i class=\"fa fa-edit\"></i> ¿Quieres Editarlo?</button>\n </a>\n\n <a href=\"'.$this->datospagina(5).'/productos/lista.php?id='.$id.'&eliminar='.$this->encrypt($rs[\"id\"].\"-eliminar-0\", publickey).'\">\n <button class=\"btn btn-danger\"> <i class=\"fa fa-trash\"></i> Necesitas Borrarlo?</button>\n </a>\n </td>\n </tr>\n ';\n }\n\n echo ' </tbody>\n </table>\n </div>\n ';\n conectar::desconectar();\n}", "public static function TraerProductosBD()\n\t{\n\t\ttry {\n\n\t\t\t$ListaDeProductosLeidos = array();\n\n\t\t\t/*$cB=$obj->codBarra;\n\t\t\t$n=$obj->nombre;\n\t\t\t$pF=$obj->pathFoto;*/\n\t\t\t$pdo=new PDO(\"mysql:dbname=productos\",\"root\",\"\");\n\t\t\t$band=$pdo->prepare(\"SELECT codigo_barra AS codBarra, nombre, path_foto AS pathFoto FROM producto\");\n \t\t\t$band->execute();\n\n\t\t\twhile ($prod=$band->fetchObject(\"Producto\")) {\n\t\t\t\tarray_push($ListaDeProductosLeidos,$prod);\n\t\t\t}\n\n\t\t\treturn $ListaDeProductosLeidos;\n\t\t} catch (PDOException $e) {\n \t\t\techo $e->getMessage();\n\t\t\t\treturn false;\n\t\t}\n\t}", "function consultarProducto (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM producto');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "public function obtenerUno($IdProducto)\n\t{\n\t\ttry\n\t\t{ \n $this->conectar();\n \n\t\t\t$registro = null; /*Se declara una variable que almacenará el registro obtenido de la BD*/\n \n\t\t\t$sentenciaSQL = $this->conexion->prepare(\"SELECT IdProducto, NombreProducto, Descripcion, Precio, Stock, Categoria,Marca, Descuento,Proveedor, Estado,Foto\n\t\t\tFROM producto WHERE IdProducto=?\"); /*Se arma la sentencia sql para seleccionar todos los registros de la base de datos*/\n\t\t\t$sentenciaSQL->execute([$IdProducto]);/*Se ejecuta la sentencia sql, retorna un cursor con todos los elementos*/\n \n /*Obtiene los datos*/\n\t\t\t$fila=$sentenciaSQL->fetch(PDO::FETCH_OBJ);\n\t\t\t\n $registro = new Producto;\n $registro->IdProducto=$fila->IdProducto;\n $registro->NombreProducto=$fila->NombreProducto;\n $registro->Descripcion=$fila->Descripcion;\n $registro->Precio=$fila->Precio;\n $registro->Stock=$fila->Stock;\n $registro->Categoria=$fila->Categoria;\n $registro->Marca=$fila->Marca;\n $registro->Descuento=$fila->Descuento;\n $registro->Proveedor=$fila->Proveedor;\n $registro->Estado=$fila->Estado;\n $registro->Foto=$fila->Foto;\n\t\t\t\n\t\t\treturn $registro; //Registro es un Empleado (objeto Empleado)\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n echo $e->getMessage();\n return null;\n\t\t}\n\t\tfinally\n\t\t{\n Conexion::cerrarConexion();\n }\n\t}", "function consultar_productos($marca=\"\"){\n\t\t//Primero conectarse a la bd\n\t\t$conexion_bd = conectar_bd();\n\n\t\t$resultado = \"<table><thead><tr><th>ID</th><th></th><th>Nombre de Marca</th><th></th><th>Acciones</th></tr></thead>\";\n\n\t\t/*$consulta = 'SELECT pr.descripcion as pr_descripcion, m.nombre as m_nombre, pr.cantidad as pr_cantidad, pr.precio as pr_precio, tp.nombre as tp_nombre, e.nombre as e_nombre FROM producto as pr, productotiene as pt, marca as m, tipoproducto as tp, estatus as e WHERE pr.id_producto = pt.id_producto AND m.id_marca = pt.id_marca AND tp.id_tipo = pt.id_tipo AND e.id_estatus = pt.id_estatus'; */\n\n\t\t$consulta = 'SELECT m.nombre as m_nombre, m.id as m_id FROM marca as m ';\n\t\t\n\t\t//Ahora con el buscador necesitamos un validador de que es lo que quiere buscar\n\t\tif ($marca != \"\") {\n\t\t\t$consulta .= \" WHERE m_id=\".$marca;\n\t\t}\n\n\n\t\t$resultados = $conexion_bd->query($consulta); \n\t\twhile ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n\t\t\t//$resultado .= $row[0]; //Se puede usar el índice de la consulta\n\t\t\t$resultado .= \"<tr>\";\n\t\t $resultado .= \"<td>\".$row['m_id'].\"</td>\";\n\t\t $resultado .= \"<td></td>\";\n\t\t $resultado .= \"<td>\".$row['m_nombre'].\"</td>\";\n\t\t $resultado .= \"<td></td>\";\n\t\t $resultado .= \"<td>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\"><i class=\\\"material-icons\\\">add_box</i></a>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\"><i class=\\\"material-icons\\\">edit</i></a>\";\n\t\t $resultado .= \"<a class=\\\"waves-effect waves-light btn-small\\\" href=\\\"registrarIngresoProductos.php\\\"><i class=\\\"material-icons\\\">receipt</i></a>\";\n\t\t $resultado .= '<a href=\"controlador_eliminar_producto.php?id='.$row['m_id'].'\"';\n\t\t $resultado .= borrarBoton();\n\t\t $resultado .= '</a>' ;\n\n\t\t /* $resultado .= '<a href=\"controlador_eliminar_producto.php?id='.$row['p_id'].' class=\"waves-effect waves-light btn-small red lighten-2\"><i class=\"material-icons\">delete</i></a>';*/\n\n\t\t $resultado .= \"</td>\" ;\n\t\t $resultado .= \"</tr>\" ;\n\t\t}\n\t\tmysqli_free_result($resultados); //Liberar la memoria\n\n\t\t// desconectarse al termino de la consulta\n\t\tdesconectar_bd($conexion_bd);\n\n\t\t$resultado .= \"</tbody></table>\";\n\n\t\treturn $resultado;\n\t}", "function getProduct()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`products`\";\n //echo $sql;exit();\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $products = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $product = new ProductEntity();\n $product->setIdProduct($data->id);\n $product->setName($data->name);\n $product->setDomaine_realise($data->domaine_realise);\n $product->setTache_realisee($data->tache_realisee);\n $product->setImage($data->image);\n $product->setCreatedAt($data->createdat);\n\n $products[] = $product;\n }\n\n if ($products) {\n return $products;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function getProductoByTiendaId($id){\n $this->db->select(\"*\");\n $this->db->from(\"producto\");\n $this->db->where(\"producto.trash\",\"0\");\n $this->db->where(\"producto.estado\",\"1\");\n\t $this->db->where(\"producto.tienda_id\",$id);\n $this->db->order_by('producto.producto_id', 'RANDOM');\n $resultado = $this->db->get();\n\t return $resultado->result();\n }", "public function DetallesComprasPorId()\n\t{\n\t\tif(base64_decode($_GET['tipoentrada'])==\"PRODUCTO\"){\n\n\t\t\tself::SetNames();\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria LEFT JOIN productos ON detallecompras.codproducto = productos.codproducto WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t} else {\n\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN ingredientes ON detallecompras.codproducto = ingredientes.codingrediente WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\n\t\t}\n\t}", "public function obtenerProductoxId($idProducto){\n\t\t\n\t\t\n\t\t$sql=\"select * From Producto where idProducto=\".$idProducto;\n\t\t\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "public function actionProdutocampanha($id)\n {\n $productsale = new Produtocampanha();\n\n $sales = Campanha::find()\n ->where (['>','campanhaDataInicio', date('Y-m-d')])\n ->orderBy('idCampanha')\n ->all();\n $sale = ArrayHelper::map($sales,'idCampanha','campanhaNome');\n \n //vai buscar produtoscampanhas ativos existentes\n $rows = (new Query())\n ->select(['idCampanha','idprodutos','campanhaNome','campanhaDataInicio','campanhaDataFim','campanhaPercentagem','produtoNome'])\n ->from('campanha')\n ->innerJoin('produtocampanha','campanha_idCampanha=idCampanha')\n ->innerJoin('produto','produtos_idprodutos=idprodutos')\n ->where (['<','campanhaDataInicio', date('Y-m-d')])\n ->andWhere(['>','campanhaDataFim', date('Y-m-d')]);\n $rows = $rows->all();\n \n foreach ($rows as $key => $value){\n if ($id == $rows[$key]['idprodutos']){\n $searchModel = new ProdutoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $model = new Produto();\n $model = Produto::find()->all();\n \n return $this->render('index', [\n 'error' => 'This product is already in active sale',\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'model' => $model,\n ]);\n }\n }\n \n if (Yii::$app->request->post()) {\n $productsale = Yii::$app->request->post('Produtocampanha');\n $sale = Yii::$app->request->post('Campanha');\n\n $productSale = new Produtocampanha();\n $productSale->produtos_idprodutos = $id;\n $productSale->campanha_idCampanha = $sale['campanhaNome'];\n $productSale->campanhaPercentagem = $productsale['campanhaPercentagem'];\n $productSale->save(false);\n\n return $this->redirect(['index']);\n }\n return $this->render('produtocampanha', [\n 'productsale' => $productsale,\n 'sale' => $sale,\n 'sales' => $sales,\n ]);\n }", "public function ComprasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN mediospagos ON compras.formacompra = mediospagos.codmediopago WHERE compras.codcompra = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public static function descontarProductoVenta($id, $cantidad, $venta){\n try{\n\n $conexion = new Conexion();\n $con = $conexion->getConexion();\n\n $cantidadBackups = $cantidad;\n\n $producto = Producto_model::selectId($id);\n \n // Seleccionamo el cns minimo\n $query = $con->prepare(\"SELECT MIN(cns) as cns FROM detalle_productos WHERE id_producto_dp = ? and stock > 0\");\n $query->execute([$id]);\n $cns_min = $query->fetch();\n\n $ban = true;\n $cns = $cns_min['cns'];\n \n $total_venta = $producto['precio_venta'] * $cantidad;\n $total_costo = 0;\n\n while($ban){\n\n $query = $con->prepare(\"SELECT * FROM detalle_productos WHERE cns = ?\");\n $query->execute([$cns]);\n $producto = $query->fetch();\n\n if($producto['stock'] >= $cantidad){\n $disponible = $producto['stock'] - $cantidad;\n $total_costo = $total_costo + ($cantidad * $producto['precio_compra']);\n $query = $con->prepare(\"UPDATE detalle_productos set stock = ? WHERE cns = ?\");\n $query->execute([$disponible,$producto['cns']]);\n $ban = false;\n }else{\n $cantidad = $cantidad - $producto['stock'];\n $total_costo = $total_costo + ($producto['stock'] * $producto['precio_compra']);\n $query = $con->prepare(\"UPDATE detalle_productos set stock = 0 WHERE cns = ?\");\n $query->execute([$producto['cns']]);\n $cns++;\n }\n\n }\n\n /* Insertamos el tabla ventas_producto */\n $query = $con->prepare(\"INSERT INTO ventas_producto (id_venta,id_producto,total_venta,total_costo,ganancia) VALUES (?,?,?,?,?)\");\n $query->execute([$venta,$id,$total_venta,$total_costo,($total_venta-$total_costo)]);\n \n\n // Actualizamos el stock\n $producto = Producto_model::selectId($id);\n $stock = $producto['stock'] - $cantidadBackups;\n $query = $con->prepare(\"UPDATE productos set stock = ? WHERE id_producto = ?\");\n $query->execute([$stock,$id]);\n\n // Insertamos en la tabla producto_descuentos\n $query = $con->prepare(\"INSERT INTO producto_descuentos (id_producto_pd,cantidad,razon) VALUES (?,?,?)\");\n $query->execute([$id,$cantidadBackups,'Venta']);\n\n $conexion->closeConexion();\n $con = null;\n\n return true;\n\n }catch(PDOException $e){\n return $e->getMessage();\n }\n }", "public function getProductoByPedido($id){\n // $sql = \"SELECT * FROM productos WHERE id IN \" \n // . \"(SELECT producto_id FROM lineas_pedidos WHERE pedido_id={$id})\";\n\n $sql = \"SELECT pr.*,lp.unidades FROM productos pr \" \n . \"INNER JOIN lineas_pedidos lp ON pr.id = lp.producto_id \" \n . \"WHERE lp.pedido_id={$id}\"; \n\n $productos = $this->db->query($sql);\n \n return $productos;\n \n\n }", "public function buscar_por_id ($id){\n $consulta = \"SELECT t1.id AS id_producto, t2.id AS id_tienda, t1.nombre AS nombre_producto, t2.nombre AS nombre_tienda, t1.imagen, t1.marca, t1.descripcion, t1.precio, t1.stock, t1.categoria FROM productos_en_venta AS t1 JOIN tiendas AS t2 WHERE t1.id = \".$id.\" AND t1.id_tienda=t2.id\";\n if($resultado = $this->conexion->query($consulta)){\n $fila = $resultado->fetch_assoc();\n return array(\"error\"=>null, \"producto\"=>$fila);\n }else{\n echo \"Error: (\" . $this->conexion->errno . \") \" . $this->conexion->error;\n }\n }", "function listar(){\n try{\n $sql=\"select * from producto\";\n $ps=$this->conexion->getConexion()->prepare($sql);\n $ps->execute(NULL);\n $resultado = [];\n while($row=$ps->fetch(PDO::FETCH_OBJ)){\n $producto = new producto(\n $row->pro_id,\n $row->pro_nombre,\n $row->pro_descripcion,\n $row->pro_cantidad,\n $row->pro_valor\n\n );\n //$producto ->setProId($row->pro_id);\n //$producto ->setProNombre($row->pro_nombre);\n //$producto ->setProDescripcion($row->pro_descripcion);\n //$producto ->setProCantidad($row->pro_cantidad);\n //$producto ->setProValor($row->pro_valor);\n array_push($resultado,$producto);\n }\n $this->conexion =null;\n }catch(PDOException $e){\n echo \"Fallo la conexion\" . $e->getMessage();\n }\n return $resultado;\n }", "public function getProductoID($id)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from productos where idProducto=:id');\n $stmt->bindParam(\":id\",$id);\n $stmt->execute();\n $resultado=$stmt->fetch();\n return $resultado;\n }", "public function add_data()\n {\n try\n {\n if($this->id_producto!=NULL) //Identificar si llega un ID nulo o declarado\n {\n $sql=\"UPDATE productos set proveedores_id_proveedor=?,categoria_id_Categoria=?,nom_producto=?,pre_producto=?,can_producto=? WHERE id_producto = ?\";\n \n }else{\n $sql=\"INSERT into productos Values(0,?,?,?,?,?)\";\n }\n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->proveedores_id_proveedor);\n $consulta->bindParam(2,$this->categoria_id_Categoria);\n $consulta->bindParam(3,$this->nom_producto);\n $consulta->bindParam(4,$this->pre_producto);\n $consulta->bindParam(5,$this->can_producto); \n if($this->id_producto!=null)//Se asigna el valor del ID si esta declarado\n {\n $consulta->bindParam(6,$this->id_producto); \n }\n $consulta->execute();\n $this->con=null; \n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "public function buscarProduto($id){\n if($this->con->isConnected()){\n $sql = \"SELECT id, name FROM products WHERE id = ?\";\n $stmt = $this->con->prepare($sql);\n if($stmt){\n $stmt->bind_param(\"i\",$id);\n if ($stmt->execute()){ \n $stmt->bind_result($id, $name);\n $stmt->store_result();\n $produto = null; \n if($stmt->num_rows > 0){\n $stmt->fetch();\n $produto = new Product($id, $name);\n }\n $stmt->close();\n return $produto;\n } \n }else{\n echo \"Não foi possível executar esse comando\";\n }\n }else{\n echo \"Você não está conectado!\";\n return null;\n }\n }", "public function listaProductos(){\n\n $respuesta = Datos::mdlListaProductos(\"productos\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n\n\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"codProducto\"].'</td>\n <td>'.$item[\"nombre\"].'</td>\n <td>'.$item[\"tipo\"].'</td>\n <td><a href=\"updtProducto.php?idEditar='.$item[\"idProducto\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n <td><a href=\"listaProductos.php?idBorrar='.$item[\"idProducto\"].'\" ><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n }\n\n }", "public function getProductos()\n {\n\n $sql = \"SELECT * FROM productos ORDER BY id DESC\";\n $producto = $this->db->prepare($sql);\n $producto->execute();\n\n return $producto;\n }", "public function listarProductos()\n {\n $crudProducto = new crudProducto(); //metodo para hacer la peticion de modelo producto\n return $crudProducto->listarProductos(); //retornar los valores del metodo listar productos\n }", "public function updateProducto(){\n $sql='UPDATE producto set nombre = ?, precio = ?, descripcion = ?, foto = ?, estado = ?, idCategoria = ?, idProveedor = ? where idProducto = ?';\n $params= array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->proveedor, $this->id);\n return Database::executeRow($sql,$params);\n }", "function comprobarProductoDuplicado() {\n\t\tif($this->id_nombre_producto == NULL) {\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"));\n\t\t} else {\t\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and id_nombre_producto<>%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"),\n\t\t\t\t$this->makeValue($this->id_nombre_producto, \"int\"));\n\t\t}\n\t\t$this->setConsulta($consulta);\n\t\t$this->ejecutarConsulta();\n\t\tif($this->getNumeroFilas() == 0) {\n\t\t\treturn false;\t\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function findById($id){\n if(!$this->conexion==null){\n // FETCH_ASSOC\n $stmt = $this->conexion->prepare(\"SELECT * FROM producto WHERE idProducto=:id\");\n $stmt->bindParam(':id', $id); \n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n // Ejecutamos\n $stmt->execute();\n // Mostramos los resultados\n if ($row = $stmt->fetch()){\n $p=new Producto($row);\n return $p;\n }\n }\n \n return null;\n }", "public static function agregarDetallesModel($id, $tabla, $datos){\n\t\t\t$sql = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id, id_producto, id_venta, nombre, cantidad, precio) VALUES (NULL,:producto, :venta, :nombre, :cantidad, :precio)\");\n\n\t\t\t$sql2 = Conexion::conectar()->prepare(\"UPDATE productos SET stock = stock-:stock WHERE id_producto=:producto\");\n\n\n\t\t\t$sql3 = Conexion::conectar()->prepare(\"INSERT INTO historial(id_historial, id_producto, id_usuario, id_tienda, fecha, nota, referencia, cantidad) VALUES(NULL, :producto, :usuario, :tienda, :fecha, :nota, :referencia, :cantidad)\");\n\n\t\t\tforeach ($_SESSION[\"carrito\"] as $producto) {\n\t\t\t\t$sql->bindParam(\":producto\", $producto->id_producto, PDO::PARAM_INT);\n\t\t\t\t$sql->bindParam(\":venta\", $id, PDO::PARAM_INT);\n\t\t\t\t$sql->bindParam(\":nombre\", $producto->nombre, PDO::PARAM_STR);\t\n\t\t\t\t$sql->bindParam(\":cantidad\", $producto->cantidad, PDO::PARAM_INT);\n\t\t\t\t$sql->bindParam(\":precio\", $producto->precio, PDO::PARAM_STR);\t\n\n\t\t\t\t$sql->execute();\n\n\t\t\t\t$sql2->bindParam(\":stock\", $producto->cantidad, PDO::PARAM_INT);\n\t\t\t\t$sql2->bindParam(\":producto\", $producto->id_producto, PDO::PARAM_INT);\n\t\t\t\t$sql2->execute();\n\n\t\t\t\t$nota = \"Venta del producto\";\n\t\t\t\t$referencia = \"000$datos[usuario]$producto->cantidad$producto->id_producto\";\n\t\t\t\t\n\t\t\t\t$sql3->bindParam(\":producto\", $producto->id_producto, PDO::PARAM_INT);\n\t\t\t\t$sql3->bindParam(\":usuario\", $datos[\"usuario\"], PDO::PARAM_INT);\n\t\t\t\t$sql3->bindParam(\":tienda\", $datos[\"tienda\"], PDO::PARAM_INT);\t\n\t\t\t\t$sql3->bindParam(\":fecha\", $datos[\"fecha\"], PDO::PARAM_INT);\n\t\t\t\t$sql3->bindParam(\":nota\", $nota, PDO::PARAM_STR);\t\n\t\t\t\t$sql3->bindParam(\":referencia\", $referencia, PDO::PARAM_STR);\n\t\t\t\t$sql3->bindParam(\":cantidad\", $producto->cantidad, PDO::PARAM_STR);\n\t\t\t\t$sql3->execute();\n\t\t\t}\n\n\t\t\treturn \"success\";\n\t\t}", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function find($id = 0)\n {\n\n $sql = 'SELECT products.id , product_name, categories.category_name, product_sku FROM `products`\n INNER JOIN product_properties_values on product_properties_values.id_product = products.id\n INNER JOIN categories on categories.id = product_properties_values.property_value\n WHERE products.id = ?';\n\n $sqlData = [(int)$id];\n $app = Application::instance();\n $product['header'] = $this->catalog = $app->db()->getArrayBySqlQuery($sql,$sqlData);\n\n /*$sql = 'SELECT products.product_name, products.product_price, products.product_sku FROM products\n WHERE products.id_parent_product ='. (int)$id\n ;*/\n\n\n $sql = 'SET @SQL = NULL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SELECT\n GROUP_CONCAT(DISTINCT\n CONCAT(\\'GROUP_CONCAT(IF(pr.product_property_name = \\\"\\', pr.`product_property_name`, \\'\\\", pp.property_value, NULL)) AS \\', pr.`product_property_name`)\n ) INTO @SQL\n FROM product_properties AS pr';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SET @SQL = CONCAT(\\'SELECT p .*, \\', @SQL, \\'\n FROM products AS p\n LEFT JOIN product_properties_values AS pp ON (p.id = pp.id_product)\n LEFT JOIN product_properties AS pr ON (pr.id = pp.id_property)\n WHERE p.id_parent_product =' . (int)$id . '\n AND deleted is NULL\n GROUP BY p.id ;\\')';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'PREPARE stmt FROM @SQL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'EXECUTE stmt';\n $product['list'] = $app->db()->getArrayBySqlQuery($sql);\n $sql = 'DEALLOCATE PREPARE stmt';\n $app->db()->getArrayBySqlQuery($sql);\n\n foreach ($product['list'] as $key => $good) {\n $product['list'][$key]['Photo'] = explode(',', $product['list'][$key]['Photo']);\n }\n\n\n $this->product = $product;\n\n\n return $this->product;\n }", "public function getAllOrderProductTable()\n {\n $statusComplete = false;\n try {\n // run your code here\n $sql = \"SELECT * FROM `pish_hikashop_order_product`\".\n \" WHERE `order_id` = \".$this->last_id.\";\"; //have error\n \n \n $result = $this->conn->query($sql);\n if ($result) {\n $rowcount = $result->num_rows;\n if ($rowcount > 0) {\n $dev_array = array();\n for ($i = 0; $i < $result->num_rows; $i++) {\n $row = $result->fetch_assoc();\n $dev_array[$i] = $row;\n }\n \n $message = '';\n //create message for send\n foreach($dev_array as $key => $value){\n $message .='تعداد ';\n $message .= $value['order_product_quantity'].' ';\n $message .='نام محصول: ';\n $message .= $value['order_product_name'];\n $message .= ' <br>';\n \n }\n $this->messageProducts = $message;\n\n return true;\n } else {\n $statusComplete = false;\n }\n } else {\n $statusComplete = false;\n return false;\n \n }\n } catch (exception $e) {\n //code to handle the exception\n return false;\n }\n return $statusComplete;\n }", "public function checkProducto(){\n $sql='SELECT * FROM producto where nombre = ?';\n $params=array($this->nombre);\n return Database::getRow($sql, $params);\n }", "function obtenerProducto($codProducto){\n\t\t$x = $this->pdo->prepare('SELECT * FROM producto where codProducto = ?');\n\t\t$x->execute(array($codProducto));\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "private function createViewProducto()\n {\n $this->addView('ListProductoSample', 'ProductoSample', 'products', 'fas fa-cubes');\n $this->addSearchFields('ListProductoSample', ['referencia', 'descripcion', 'observaciones']);\n $this->addOrderBy('ListProductoSample', ['referencia'], 'reference');\n $this->addOrderBy('ListProductoSample', ['descripcion'], 'description');\n $this->addOrderBy('ListProductoSample', ['precio'], 'price');\n $this->addOrderBy('ListProductoSample', ['stockfis'], 'stock');\n $this->addOrderBy('ListProductoSample', ['actualizado'], 'update-time');\n\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListProductoSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n\n $families = $this->codeModel::all('familias', 'codfamilia', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codfamilia', 'family', 'codfamilia', $families);\n\n $taxes = $this->codeModel::all('impuestos', 'codimpuesto', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codimpuesto', 'tax', 'codimpuesto', $taxes);\n\n $this->addFilterCheckbox('ListProductoSample', 'nostock', 'no-stock', 'nostock');\n $this->addFilterCheckbox('ListProductoSample', 'bloqueado', 'locked', 'bloqueado');\n $this->addFilterCheckbox('ListProductoSample', 'secompra', 'for-purchase', 'secompra');\n $this->addFilterCheckbox('ListProductoSample', 'sevende', 'for-sale', 'sevende');\n $this->addFilterCheckbox('ListProductoSample', 'publico', 'public', 'publico');\n }", "public function insertarProductoCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto_comprar(id_cliente, id_producto,nombre,precio,compro,fecha)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "public function loadProductList()\n {\n $selectQuery = $this->DBH->query(\"SELECT pr_name, pr_id, pcat_name, psub_name, sup_name FROM product JOIN product_subcategory ON psub_id = pr_subcategory JOIN product_category ON psub_category = pcat_id JOIN supplier ON pr_supplier = sup_id\");\n\n echo \"<table class=\\\"information\\\">\";\n echo \"<tr>\";\n echo \"<th>#</th>\";\n echo \"<th>Název produktu</th>\";\n echo \"<th>Název kategorie</th>\";\n echo \"<th>Název podkategorie</th>\";\n echo \"<th>Název dodavatele</th>\";\n echo \"<th></th>\";\n echo \"<th></th>\";\n echo \"</tr>\";\n\n $i = 1;\n while($r = mysql_fetch_assoc($selectQuery))\n {\n ?>\n\n <tr>\n <td><?php echo $i;?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pr_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pcat_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"psub_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareTExt($r[\"sup_name\"]);?></td>\n <td class=\"buttons\"><form method=\"post\" action=\"\"><input type=\"hidden\" name=\"deleteProduct\" value=\"<?php echo $this->FILTER->prepareInputForSQL($r[\"pr_id\"]); ?>\"><input onclick=\"return confirm('Opravdu chcete smazat tento produkt?');\" type=\"submit\" value=\"Smazat\" class=\"button\"></form></td>\n <td class=\"buttons\"><a href=\"Admin.php?action=Show&amp;edittype=product&amp;edit=<?php echo $this->FILTER->prepareText($r[\"pr_id\"]); ?>\">Editovat</a></td>\n </tr>\n\n <?php\n $i++;\n }\n\n echo \"</table>\";\n\n }", "public function getProductoRe(){\n\t\t$sql = \"SELECT id_producto, nombre, cantidad, precio_total, presentacion, proveedor, marca, tipo_producto FROM productos INNER JOIN presentaciones USING(id_presentacion) INNER JOIN proveedores USING(id_proveedor) INNER JOIN marca USING(id_marca) INNER JOIN tipo_producto USING(id_tipo_producto) ORDER BY id_producto\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function readProductos(){\n $sql='SELECT idProducto, foto, nombre, precio, cantidad, nombreProveedor, producto.estado from producto, proveedor where proveedor.idProveedor=producto.idProveedor and producto.estadoEliminacion= 1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public static function selecionarIdProduto($id){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"SELECT * FROM produtos WHERE id LIKE :id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(':id',$id);\n $stmt->execute();\n \n return $stmt->fetchObject();\n }", "function getProductbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock` > 0 AND `id` = ?\");\n\t\t$sth \t->execute(array($id));\n\n\t\treturn \t$sth;\n\t}", "static public function mdlIngresarProducto($tabla,$datos){\n\n \t$stmt = Conexion::conectar() -> prepare(\"INSERT INTO $tabla(\n \t\tupcid,producto,precio,iva,unidad,categoria,proveedor,estatus) \n\t\t VALUES (:upcid,:producto,:precio,:iva,:unidad,:categoria,:proveedor,:estatus)\");\n\n\t$stmt -> bindParam(\":upcid\", $datos[\"upc\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":producto\", $datos[\"nomproducto\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":precio\", $datos[\"precioproducto\"],PDO::PARAM_STR);\n \t$stmt -> bindParam(\":iva\", $datos[\"iva\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":unidad\", $datos[\"unidadproducto\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":categoria\", $datos[\"categoriaproducto\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":proveedor\", $datos[\"proveedorp\"],PDO::PARAM_STR);\n\t$stmt -> bindParam(\":estatus\", $datos[\"estatus\"],PDO::PARAM_STR);\n\n\t\n\n \tif($stmt -> execute()){\n\t\t\n \t\treturn \"ok\"; \n \t} else {\n \t\treturn \"error\";\n \t}\n\t\n \t$stmt -> close();\n \t$stmt = null; \n\n }", "public function productTable(){\n $table = \"products\";\n $results = $this->getAllrecords($table);\n foreach($results as $sbtable){\n\n echo('<tr>'.\n '<td>'. $sbtable[\"product_id\"]. '</td>'.\n '<td>'. $sbtable[\"product_title\"]. '</td>'.\n '<td>'. $sbtable[\"product_price\"]. '</td>'.\n '<td>'.\n ' <img src=\"http://localhost/shoppnReo/'.$sbtable[\"product_image\"].'\" alt=\"...\" class=\"rounded-circle\" style=\"width:6rem;height:6rem;\">'\n . '</td>'.\n '<td>'. $sbtable[\"product_keywords\"]. '</td>'.\n '<td><a class=\"btn btn-outline-warning btn-block\" href=\"http://localhost/shoppnReo/controller/process.php?produpid='.$sbtable[\"product_id\"].'\" >Edit</td>'.\n '<td><a class=\"btn btn-outline-danger btn-block\" href=\"http://localhost/shoppnReo/controller/process.php?proddelid='.$sbtable[\"product_id\"].'\" >Delete</td>'.\n '</tr>');\n\n \n\n }\n }", "function get_by_id_producto($id_producto){\n\t\t$data=array(\n\t\t\t'Id_platillo' => $id_producto\n\t\t);\n\t\t\n\t\t$query = $this->db->get_where('v_platillo_m', $data);\n\t\treturn $query->result_array();\n\t}", "public static function insertNewProduct($data)\n {\n //Compruebas si existe\n $consulta = DataBase::consulta(\"\n select * from productos where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n //Segunda parte\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Tercera Parte\n //Insertamos el producto y detalles de producto\n if(count($consulta) == 0 && $idEmpresa > 0) {\n DataBase::insertar('insert into productos (producto, categoria) values (\"'.$data[\"saveNameProduct\"].'\", '.$data[\"listCategory\"].')');\n $idProducto = DataBase::consulta(\n \"select idProducto from productos\n where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$idProducto[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n //existe la empresa y el producto\n } else if ($idEmpresa > 0) {\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$consulta[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n }\n }", "function listar($objeto){\n\t\t$condicion.=(!empty($objeto['id']))?' AND r.id='.$objeto['id']:'';\n\t// Filtra por los insumos preparados\n\t\t$condicion.=(!empty($objeto['insumos_preparados']))?' AND ids_insumos_preparados!=\\'\\'':'';\n\t// Filtra por tipo\n\t\t$condicion.=(!empty($objeto['tipo'])) ? ' AND p.tipo_producto = '.$objeto['tipo'] : '';\n\t// Filtros\n\t\t$condicion.=(!empty($objeto['filtro']) && $objeto['filtro'] == 'insumos_preparados_formula') ? ' AND (p.tipo_producto = 8 OR p.tipo_producto = 9) ' : '';\n\n\n\t// Ordena la consulta si existe\n\t\t$condicion.=(!empty($objeto['orden']))?' ORDER BY '.$objeto['orden']:'';\n\n\t\t$sql = \"SELECT\n\t\t\t\t\tp.id AS idProducto, p.nombre, p.costo_servicio AS costo,\n\t\t\t\t\tp.id_unidad_compra AS idunidadCompra, p.id_unidad_venta AS idunidad, p.factor as multiplo,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t\tnombre\n\t\t\t\t\tFROM\n\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad, u.factor, p.tipo_producto,\n\t\t\t\t\tr.ids_insumos_preparados AS insumos_preparados, r.ids_insumos AS insumos,\n\t\t\t\t\tr.preparacion, r.ganancia, ROUND(p.precio, 2) AS precio, p.codigo, p.minimos\n\t\t\t\tFROM\n\t\t\t\t\tapp_productos p\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_campos_foodware f\n\t\t\t\t\tON\n\t\t\t\t\t\tp.id = f.id_producto\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tcom_recetas r\n\t\t\t\t\tON\n\t\t\t\t\t\tr.id = p.id\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_unidades_medida u\n\t\t\t\t\tON\n\t\t\t\t\t\tu.id = p.id_unidad_compra\n\t\t\t\tWHERE\n\t\t\t\t\tp.status = 1 AND (p.tipo_producto = 8 OR p.tipo_producto = 9)\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "function ordenarProductos(){\n $productos = $this->model->orden();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }", "function mostrar_colores_producto(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM colorxpro, color WHERE producto_cxp='$id' AND id_color=color_cxp ORDER BY id_color ASC\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t$this->listado[] = $resultado;\n\t\t\t}\n\t\t} \n\t}", "public function getOneProducto()\n {\n $sql = \"SELECT * FROM productos WHERE id = {$this->getId()}\";\n $query = $this->conexion->query($sql);\n\n if ($query == true) {\n\n $resultado = $query->fetch_object();\n return $resultado;\n }\n }", "function obtenerProducto($id_producto){\n include 'conexion.php';\n\n try{\n $sql = \"SELECT nombre, imagen_completa, precio, descripcion, descripcion_corta FROM `productos` WHERE id = $id_producto\";\n $resultado = $bd->query($sql);\n } catch(Exception $e){\n echo $e->getMessage();\n return array();\n }\n return $resultado;\n}", "public function getProductbyId($id)\n {\n $this->db->select('*');\n $this->db->where('id', $id);\n $this->db->from($this->product); \n return $this->db->get();\n }", "function getProduct($id) {\n include('db/db.php'); // now we have $db to communicate with database\n include('db/model/Product.php');\n\n // Prepared Statement (prepare, bind, execute) -> prevent SQL injection\n $ready = $db->prepare(\"select name, description, image, time, cost from products where id = ?\");\n $ready->bind_param('d', $id);\n $ready->execute();\n \n $ready->store_result();\n $ready->bind_result($name, $description, $image, $time, $cost);\n\n // Check whether the product is exist or not\n if ($ready->fetch()) {\n $images = explode(';', $image);\n\n $image1 = $images[0];\n $image2 = $images[1];\n $image3 = $images[2];\n\n // return an object Product\n return new Product(\n $id,\n $name,\n $description,\n $image1,\n $image2,\n $image3,\n $time,\n $cost\n );\n }\n else {\n return 0;\n }\n }", "public function comentarioRow($idProducto){\n\t\t\t$res = $this->productoDetalleModelo->comentarioRow($idProducto);\n\t\t\tforeach ($res as $key) {\n\t\t\t\t$comentarioRow = $key['comentarioRow'];\n\t\t\t}\n\t\t\treturn $comentarioRow;\n\t\t}", "public function productosSelect()\n {\n $sql = mysqli_query($this->open(), \"SELECT p.IdProducto, p.NombreProducto,p.PrecioUnitario,p.preciopaquete,p.unidadesporpaquete,p.UnidadesEnStock , p.foto from\n productos p inner join categorias c inner join proveedores pro on p.IdCategoria=c.IdCategoria and\n p.IdProveedor=pro.IdProveedor;\");\n?>\n <!-- Main content -->\n <section class=\"content\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card\">\n\n\n <div class=\"card-header\">\n <h3 class=\"card-title\">Tabla de productos</h3>\n </div>\n <!-- /.card-header -->\n <div class=\"card-body\">\n <table id=\"example1\" class=\"table table-bordered table-striped\">\n <thead>\n <tr>\n <th>Nombre</th>\n <th>Precio</th>\n <th>Precio x Paquete</th>\n <th>Unidades x Paquete</th>\n <th>Stock</th>\n <th>Foto</th>\n <th>Modificar</th>\n <th>Eliminar</th>\n </tr>\n </thead>\n <tbody>\n <?php\n while ($row = mysqli_fetch_array($sql)) {\n echo \"<tr>\";\n $productosid = $row[0];\n echo \"<td>\" . $row[1] . \"</td>\";\n echo \"<td>s/\" . $row[2] . \"</td>\";\n echo \"<td>\" . $row[3] . \"</td>\";\n echo \"<td>\" . $row[4] . \"</td>\";\n echo \"<td>\" . $row[5] . \"</td>\";\n \n // decodificar base 64\n $foto = base64_encode($row[6]);\n if ($foto == \"\") {\n echo \"<td height='50'>No Disponible</td>\";\n } else {\n echo \"<td height='50'><img src='data:image/jpeg;base64,$foto' width='50'height='50'></td>\";\n }\n ?>\n <!-- Button trigger modal -->\n <td><button type=\"button\" class=\"btn btn-primary note-icon-pencil\" data-toggle=\"modal\" data-target=\"#exampleModal\" onclick=\"productosSelectOne('<?php echo $productosid ?>'); productosEditar(); return false\"></button></td>\n <!-- <button class=\"note-icon-pencil\" ></button> -->\n <td><button class=\"btn btn-danger note-icon-trash\" onclick=\"productosDelete('<?php echo $productosid ?>'); return false\"></button></td>\n <?php\n echo \"</tr>\";\n }\n ?>\n </tbody>\n <tfoot>\n <tr>\n <th>Nombre</th>\n <th>Precio</th>\n <th>Precio x Paquete</th>\n <th>Unidades x Paquete</th>\n <th>Stock</th>\n <th>Foto</th>\n <th>Modificar</th>\n <th>Eliminar</th>\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <!-- /.content -->\n\n <?php\n }", "public function productosOtrosProveedores(){\n if(Auth::user()->bodegas == 'si'){\n if(Auth::user()->admin_bodegas == 'si')\n $userId = Auth::user()->id;\n else\n $userId = Auth::user()->userAdminId();\n\n //dd(DB::select(\"SELECT producto_id from productos_historial WHERE productos_historial.proveedor_id = \".$this->id));\n $data = ABHistorialCosto::select(\"producto_id\")->where(\"proveedor_id\",$this->id)->get();\n $ids = [];\n foreach($data as $d){\n $ids[] = $d->producto_id;\n }\n }else{\n $userId = Auth::user()->userAdminId();\n //dd(DB::select(\"SELECT producto_id from productos_historial WHERE productos_historial.proveedor_id = \".$this->id));\n $data = ProductoHistorial::select(\"productos_historial.producto_id\")->where(\"proveedor_id\",$this->id)->get();\n $ids = [];\n foreach($data as $d){\n $ids[] = $d->producto_id;\n }\n }\n\n\n if(Auth::user()->bodegas == 'si')\n return ABProducto::whereNotIn(\"productos.id\",$ids)\n ->where(\"productos.usuario_id\",$userId);\n else\n\n return Producto::whereNotIn(\"productos.id\",$ids)\n ->where(\"productos.usuario_id\",$userId);\n /**\n * SELECT * FROM `productos` where productos.id not in (SELECT producto_id from productos_historial WHERE productos_historial.proveedor_id = 1)\n */\n }", "function get_tamanhos_produto($id)\n {\n return $this->db->get_where('tamanhos_produtos',array('idT'=>$id))->row_array();\n }", "public function mostrarProductoController()\n\t{\n\t\t$respuesta = Datos::mostrarProductoModel(\"Producto\");\n\n\t\tforeach ($respuesta as $key => $value) {\n\t\t\techo '<tr>\n\t\t\t\t\t\t<td>'.$value[\"idProducto\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"nombre\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"referencia\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"precio\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"peso\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"categoria\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"stock\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"fechaCreacion\"].'</td>\n\t\t\t\t\t\t<td>'.$value[\"fechaUltimaVenta\"].'</td>\n\t\t\t\t\t\t<td><a href=\"index.php?action=productos&idVender='.$value[\"idProducto\"].'\"><button type=\"button\" class=\"btn btn-success\">Vender</button></a></td>\n\t\t\t\t\t\t<td><a href=\"index.php?action=editar&idEditar='.$value[\"idProducto\"].'\"><button type=\"button\" class=\"btn btn-secondary\">Editar</button></a></td>\n\t\t\t\t\t\t<td><a href=\"index.php?action=productos&idEliminar='.$value[\"idProducto\"].'\"><button type=\"button\" class=\"btn btn-danger\">Eliminar</button></a></td>\n\t\t\t\t\t</tr>';\n\t\t}\n\t}", "public function buscar($newVal){\r\n\t\t\r\n\t\t$producto= null;\r\n\r\n\t\t$query= 'SELECT * \r\n\t\tFROM \tProductos \r\n\t\tWHERE \tid_Producto = :idProducto';\r\n\r\n\t\ttry{\r\n\t\t\t$conexion= Conexion::conectar();\r\n\t\t\t$comando= $conexion->prepare($query);\r\n\r\n\t\t\t$comando->bindParam(':idProducto', $newVal);\r\n\r\n\t\t\t$comando->execute();\r\n\r\n\t\t\tif($row = $comando->fetch()){\r\n\r\n\t\t\t\t$foto= new Foto();\r\n\t\t\t\t$foto->setDireccion($row['foto']);\r\n\r\n\t\t\t\t$daoTipoCerveza= DaoBDTipoCerveza::getInstance();\r\n\t\t\t\t$tipoCerveza= $daoTipoCerveza->buscar($row['id_Tipo_Cerveza']);\r\n\t\t\t\t\r\n\t\t\t\t$producto= new Producto($row['nombre_Producto'], $row['factor'], $row['capacidad'], $tipoCerveza, $foto);\r\n\t\t\t\t$producto->setId($row['id_Producto']);\r\n\r\n\t\t\t}\r\n\t\t}\tcatch(Exception $e){\r\n\t\t\tthrow new Exception(\"No se pudo Conectar a la Base de Datos\");\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $producto;\r\n\t}", "public function eliminarProductoCar($id){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql=\"DELETE from producto_comprar WHERE id='$id'\";\n return $result= mysqli_query($conexion, $sql);\n }", "public function getProductById($id){\n $prodDB=$this->promodel->getProductById($id);\n // create a new product\n $product = new Product();\n $product->id=$prodDB->id;\n $product->name=$prodDB->name;\n $product->category=$prodDB->category;\n $product->price=$prodDB->price;\n $product->qty=0;\n return $product;\n }", "public function setIdProducto($idProducto)\n {\n return $this->idProducto=$idProducto;\n }", "public function guardar_ordencompraproducto($data, $productos)\n {\n $this->db->trans_start();\n $this->db->insert('ordencompra',$data);\n $idordencompra = $this->db->insert_id();\n\n $index=0;\n foreach ($productos as $key => $producto){\n $data_productosordencompra[$index]['idproducto'] = $producto;\n $data_productosordencompra[$index]['idordencompra'] = $idordencompra;\n $index++;\n }\n\n $this->db->insert_batch('productosordencompra',$data_productosordencompra);\n $this->db->trans_complete();\n\n return $this->db->trans_status();\n\n }", "public function getProductById(int $id);", "public function setIdProducto($idProducto)\n {\n $this->idProducto = $idProducto;\n\n return $this;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function listar_productosMayorMenor($ordenar_producto, $p_id_seccion) {\n \n try {\n if($ordenar_producto == 1)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion;\n \";\n }\n if($ordenar_producto == 2)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio desc;\n \";\n }\n if($ordenar_producto == 3)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio asc \n \";\n }\n\n \n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function CargarDatosProducto($producto_id)\n {\n $resultado = array();\n $arreglo_resultado = array();\n\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->find($producto_id);\n if ($entity != null) {\n\n $arreglo_resultado['nombre'] = $entity->getNombre();\n $arreglo_resultado['categoria'] = ($entity->getCategoria() != null) ? $entity->getCategoria()->getCategoriaId() : \"\";\n $arreglo_resultado['marca'] = ($entity->getMarca() != null) ? $entity->getMarca()->getMarcaId() : \"\";\n $arreglo_resultado['porciento'] = ($entity->getPorciento() != null) ? $entity->getPorciento()->getValor() : \"\";\n $arreglo_resultado['titulo'] = $entity->getTitulo();\n $arreglo_resultado['descripcion'] = $entity->getDescripcion();\n $arreglo_resultado['caracteristica'] = $entity->getCaracteristica();\n $arreglo_resultado['tags'] = $entity->getTags();\n $arreglo_resultado['stock'] = $entity->getStock();\n $arreglo_resultado['precio'] = $entity->getPrecio();\n $arreglo_resultado['precioEspecial'] = $entity->getPrecioEspecial();\n $arreglo_resultado['destacado'] = ($entity->getDestacado() == 1) ? true : false;\n $arreglo_resultado['estado'] = ($entity->getEstado() == 1) ? true : false;\n $arreglo_resultado['url'] = $entity->getUrl();\n $arreglo_resultado['ficha'] = $entity->getFicha();\n $arreglo_resultado['disponibilidadInmediata'] = ($entity->getDisponibilidadInmediata() == 1) ? true : false;\n $arreglo_resultado['formaPago'] = $entity->getFormaPago();\n $arreglo_resultado['terminoDespacho'] = $entity->getTerminoDespacho();\n\n $imagen = $entity->getImagen();\n\n $ruta = $this->ObtenerURL();\n $dir = 'uploads/productos/';\n $ruta = $ruta . $dir;\n\n $size = (is_file($dir . $imagen)) ? filesize($dir . $imagen) : 0;\n $arreglo_resultado['imagen'] = array($imagen, $size, $ruta);\n\n\n $fecha = $entity->getFechapublicacion();\n if ($fecha != \"\") {\n $fecha = $fecha->format('d/m/Y H:i');\n }\n $arreglo_resultado['fecha'] = $fecha;\n\n //Imagenes del producto\n $productoimagenes = $this->getDoctrine()->getRepository('IcanBundle:ProductoImagen')->ListarImagenes($producto_id);\n $imagenes = array();\n foreach ($productoimagenes as $productoimagen) {\n\n $imagen = $productoimagen->getImagen();\n $size = (is_file($dir . $imagen)) ? filesize($dir . $imagen) : 0;\n\n array_push($imagenes, array(\n 'imagen' => $imagen,\n 'size' => $size,\n 'ruta' => $ruta,\n 'valida' => true\n ));\n }\n $arreglo_resultado['imagenes'] = $imagenes;\n\n //Productos relacionados\n $relacionados = array();\n $productos = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarRelacionados($producto_id);\n $posicion = 0;\n foreach ($productos as $key => $producto_relacion) {\n $producto = $producto_relacion->getProductoRelacion();\n if ($producto->getProductoId() != $producto_id) {\n array_push($relacionados, array(\n 'productorelacion_id' => $producto_relacion->getProductorelacionId(),\n 'producto_id' => $producto->getProductoId(),\n 'nombre' => $producto->getNombre(),\n \"categoria\" => ($producto->getCategoria() != null) ? $producto->getCategoria()->getNombre() : \"\",\n \"marca\" => ($producto->getMarca() != null) ? $producto->getMarca()->getNombre() : \"\",\n \"estado\" => ($producto->getEstado()) ? 1 : 0,\n \"imagen\" => $ruta . $producto->getImagen(),\n \"precio\" => number_format($producto->getPrecio(), 0, ',', '.'),\n \"fecha\" => $producto->getFechapublicacion() != \"\" ? $producto->getFechapublicacion()->format(\"d/m/Y H:i\") : \"\",\n \"views\" => $producto->getViews(),\n 'posicion' => $posicion\n ));\n $posicion++;\n }\n }\n $arreglo_resultado['relacionados'] = $relacionados;\n\n $resultado['success'] = true;\n $resultado['producto'] = $arreglo_resultado;\n }\n return $resultado;\n }", "public function getProductById($id){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE beer_ID = '$id'\"); \r\n\t}", "public function buscaPorId($id){\n \n \t\t\t/* Primeiro cria a query do MySQL */\n \t\t\t$id_query = \"SELECT * FROM atendimentocliente WHERE idChamada = \".$id;\n\n \t\t\t/* Envia a query para o banco de dados e verifica se funcionou */\n \t\t\t$result = mysqli_query($this->conexao, $id_query)\n \t\t\tor die(\"Erro ao listar produtos por ID: \" . mysql_error() );\n\n \t\t\t/* Cria variável de retorno e inicializa com NULL */\n \t\t\t$retorno = null;\n\n \t\t\t/* Se encontrou algo, pega todos os campos do resultado obtido */\n \t\t\tif( $row = mysqli_fetch_array($result, MYSQLI_ASSOC) ){\n \t\t\t\t//Cria nova instância da classe produto\n \t\t\t\t $retorno = new Atendimentocliente();\n \t\t\t\t//Preenche todos os campos do novo objeto\n\t\t\t\t $retorno->idChamada = $row[\"idChamada\"]; \n \t\t\t\t $retorno->atendeu = $row[\"atendeu\"];\n\t\t\t\t $retorno->refProduto = $row[\"refProduto\"];\n\t\t\t\t $retorno->motivoPlano = $row[\"motivoPlano\"];\n\t\t\t\t $retorno->dataVencimento = $row[\"dataVencimento\"];\n\t\t\t\t $retorno->debitoAutomatico = $row[\"debitoAutomatico\"];\n\t\t\t\t $retorno->debitoOfertado= $row[\"debitoOfertado\"];\n\t\t\t\t $retorno->observacao = $row[\"observacao\"];\n\t\t\t\t $retorno->dataChamada = $row[\"dataChamada\"];\n\t\t\t\t $retorno->idVendaServico= $row[\"idVendaServico\"];\n\t\t\t\t $retorno->notaAtendimento = $row[\"notaAtendimento\"];\n\t\t\t\t $retorno->FoiNaoConformidade= $row[\"FoiNaoConformidade\"];\n\t\t\t\t\n\t\t\t\t \n\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\treturn $retorno;\n\n\t\t }", "function mostrar_producto(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->id=$id;\n\t\t\t$this->codigo=$resultado['codigo_pro'];\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$this->nombre=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$this->nombre=$resultado['nombre_pro'];\n\t\t\t$this->principal=$resultado['principal_pro'];\n\t\t\t$this->suiche=false;\n\t\t\t$this->ruta=\"\"; $this->categoria=\"\";\n\t\t\t$this->buscar_ruta_nodo($resultado['categoria_pro']);\n\t\t\tfor($i=count($this->ruta)-1;$i>=0;$i--){\n\t\t\t\t$this->categoria.=\" &raquo; \".$this->ruta[$i]['nombre_cat'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->id_cat=$resultado['categoria_pro'];\n\t\t\t$this->prioridad=$resultado['prioridad_pro'];\n\t\t\t$this->vistas=$resultado['vistas_pro'];\n\t\t\t$this->hotel=$resultado['hotel_pro'];\n\t\t\t$this->detal=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$this->mayor=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$this->cantidad=$resultado['limite_pro'];\n\t\t\t$this->fecha=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$this->limite2=$temp=10;\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $this->limite[]=$i; else break;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$this->claves=$resultado['claves_pro'];\n\t\t\t$this->marca=$resultado['marca_pro'];\n\t\t\n\t\t} \n\t}", "public function listar_productos_carrito() {\n \n try {\n $sql = \"\n select \n p.descripcion,\n i.cantidad,\n i.precio_venta,\n e.importe_total,\n p.id_producto\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "function alta_pro_combo() {\n\t $d = new Producto_numeracion();\n\t $d->select(\"id\");\n\t $d->where('cproducto_id', $_POST['cproducto_id_combo']);\n\t $d->limit(1);\n\t $d->get();\n\t $cproducto_numeracion_id_combo = $d->id;\n\t $pc=new cproducto_combo();\n\t //$u->usuario_id = $GLOBALS['usuarioid'];\n\t //$u->get_by_id = $_POST['id'];\n\t //$related = $u->from_array($_POST);\n\t $pc->cproducto_id_combo=$_POST['cproducto_id_combo'];\n\t $pc->cproducto_numeracion_id_combo=$cproducto_numeracion_id_combo;\n\t $pc->cproducto_id_relacion=$_POST['cproducto_id_relacion'];\n\t $pc->cproducto_numeracion_id_relacion=$_POST['cproducto_numeracion_id_relacion'];\n\t $pc->fecha_cambio= date(\"Y-m-d\");\n\t $pc->hora_cambio= date(\"H:i:s\");\n\t $pc->usuario_id=$GLOBALS['usuarioid'];\n\t $pc->\tsemejante_producto_combo=$_POST['semejanza'];\n\t // save with the related objects\n\t if ($pc->save()) {\n\t //$u->get_by_id($u->id);\n\t $this->db->query(\"update cproductos set relacion=1 where id= $pc->cproducto_id_relacion\");\n\t $this->db->query(\"update control_actualizaciones set fecha_cambio='\" . date(\"Y-m-d\") . \"', hora='\" . date(\"H:i:s.u\") . \"' where id=1\");\n\t $this->db->query(\"update control_actualizaciones set fecha_cambio='\" . date(\"Y-m-d\") . \"', hora='\" . date(\"H:i:s.u\") . \"' where id=2\");\n\t //$this->db->query(\"update control_actualizaciones set fecha_cambio='\".date(\"Y/m/d\").\"' where id=1\");\n\t echo $pc->id;\n\t }\n\t else\n\t show_error(\"\" . $u->error->string);\n\t }", "public function actualizar_ordencompra($id, $data, $productos)\n {\n $this->db->trans_start();\n $this->db->where('idordencompra',$id);\n $this->db->delete('productosordencompra');\n\n $this->db->where('idordencompra',$id);\n $this->db->update('ordencompra',$data);\n\n $index=0;\n foreach ($productos as $key => $producto){\n $data_ordencompraproductos[$index]['idproducto'] = $producto;\n $data_ordencompraproductos[$index]['idordencompra'] = $id;\n $index++;\n }\n\n $this->db->insert_batch('productosordencompra',$data_ordencompraproductos);\n $this->db->trans_complete();\n\n return $this->db->trans_status();\n\n }", "function editar_producto(){\t\t\n\t\t$this->accion=\"Editando Datos del Producto\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$this->fecha=$this->convertir_fecha($this->fecha);\n\t\t\t$sql=\"UPDATE producto SET nombre_pro='$this->nombre', categoria_pro='$this->categoria', prioridad_pro='$this->prioridad', detal_pro='$this->detal', mayor_pro='$this->mayor', limite_pro='$this->limite', descripcion_pro='$this->descripcion', claves_pro='$this->claves', marca_pro='$this->marca',hotel_pro='$this->hotel',principal_pro='$this->principal' WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/\");\n\t\t}else{\n\t\t $this->mostrar_producto();\n\t\t $sql=\"SELECT * FROM categoria ORDER BY prioridad_cat ASC\";\n\t\t $consulta=mysql_query($sql) or die(mysql_error());\n\t\t while ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t\t}\n\t}", "public function lista_productos($com_id){ \n $data['componente'] = $this->model_componente->get_componente($com_id);\n if(count($data['componente'])!=0){\n\n $data['fase']=$this->model_faseetapa->get_fase($data['componente'][0]['pfec_id']);\n $proy_id=$data['fase'][0]['proy_id'];\n $data['menu']=$this->genera_menu($proy_id);\n $data['productos'] = $this->model_producto->list_prod($com_id); // Lista de productos\n $data['proyecto'] = $this->model_proyecto->get_id_proyecto($proy_id);\n $data['oregional']=$this->verif_oregional($proy_id); //// Verifica Objetivos regionales\n $data['monto_asig']=0;\n $data['monto_prog']=0;\n $data['monto_asig']=$this->model_ptto_sigep->suma_ptto_accion($data['proyecto'][0]['aper_id'],1);\n $data['monto_prog']=$this->model_ptto_sigep->suma_ptto_accion($data['proyecto'][0]['aper_id'],2);\n\n $monto_a=0;$monto_p=0;\n if(count($data['monto_asig'])!=0){\n $monto_a=$data['monto_asig'][0]['monto'];\n }\n if (count($data['monto_prog'])!=0) {\n $monto_p=$data['monto_prog'][0]['monto']; \n }\n\n $data['saldo']= round(($monto_a-$monto_p),2);\n $data['indi'] = $this->model_proyecto->indicador(); /// indicador\n $data['metas'] = $this->model_producto->tp_metas(); /// tp metas\n $data['oestrategicos'] = $this->model_mestrategico->list_objetivos_estrategicos(); /// Objetivos Estrategicos\n if(count($this->model_producto->ult_operacion($com_id))!=0){\n $data['cod_ope']=$this->model_producto->ult_operacion($com_id);\n }\n else{\n $data['cod_ope']=0;\n }\n\n /*--------- Proyecto de Inversion -----------*/\n if($data['proyecto'][0]['tp_id']==1){\n //$data['componente'] = $this->model_componente->get_componente_pi($com_id);\n $data['datos_proyecto']='<h1> PROYECTO : <small> '.$data['proyecto'][0]['aper_programa'].' '.$data['proyecto'][0]['proy_sisin'].''.$data['proyecto'][0]['aper_actividad'].' - '.$data['proyecto'][0]['proy_nombre'].'</small></h1>';\n $data['list_oregional']=$this->lista_oregional_pi($proy_id);\n $data['prod'] = $this->operaciones($proy_id,$com_id);\n $data['tit_comp']='UNIDAD RESPONSABLE';\n }\n /*--------- Operacion de Funcionamiento ----------*/\n else{\n $data['proyecto'] = $this->model_proyecto->get_datos_proyecto_unidad($proy_id);\n //$data['componente'] = $this->model_componente->get_componente($com_id);\n $data['datos_proyecto']='<h1> '.$data['proyecto'][0]['establecimiento'].' : <small> '.$data['proyecto'][0]['aper_programa'].' '.$data['proyecto'][0]['aper_proyecto'].''.$data['proyecto'][0]['aper_actividad'].' - '.$data['proyecto'][0]['tipo'].' '.$data['proyecto'][0]['act_descripcion'].' - '.$data['proyecto'][0]['abrev'].'</small></h1>';\n $data['list_oregional']=$this->lista_oregional($proy_id);\n $data['prod'] = $this->operaciones($proy_id,$com_id);\n $data['tit_comp']='SUBACTIVIDAD';\n }\n\n \n $this->load->view('admin/programacion/producto/list_productos', $data); /// Gasto Corriente\n\n }\n else{\n redirect('prog/list_serv/'.$com_id);\n }\n }", "function Show_product($id)\n\t{\t\n\t\t$servername = \"localhost\";\n\t\t$username = \"root\";\n\t\t$password = \"\";\n\t\t$dbname = \"sklep\";\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t\t$conn -> query(\"SET NAMES 'utf8'\");\n\t\tif ($conn -> connect_error) { die(\"Nie połączono z bazą danych: \" . $conn -> connect_error);}\n\n\t\t$sql = \"SELECT nazwa, opis, opinie_klientow, cena, dostepna_ilosc, producent, rozmiar, zdjecie FROM produkty WHERE id_produkty = $id\";\n\t\t$result = $conn -> query($sql);\n\t\tif ($result -> num_rows > 0)\n\t\t{\n\t \t\twhile($row = $result -> fetch_assoc())\n\t \t\t{\n\t \t\techo '<img src=\"images/products/'.$row[\"zdjecie\"].'\" width=\"150\" height=\"150\" alt=\"product.png\"><br>'.$row[\"nazwa\"].\" \".$row[\"rozmiar\"].'<br><span style=\"color:#FF5A00\"><b>KUP TERAZ: '.$row[\"cena\"].\" PLN</b></span>\";\n\t\t\t}\n\t\t} else { echo \"No results\"; }\n\t}", "public function listarProduct(Request $request){\n $data = Product::\n join('categories', 'categories.id', '=', 'products.categoria_id')\n ->where('products.categoria_id' , '=' , $request->idcategory )\n ->select(\n 'products.id',\n 'codigo',\n 'descripcion',\n 'imagen',\n 'stock',\n 'precio_venta'\n );\n\n //dd($data->get());\n\n return Datatables::of($data)\n //->editColumn('stock', '<button class=\"btn btn-danger btn-xs\">{{ $stock }}</button>')//Blade\n ->editColumn('descripcion', '{{ substr($descripcion,0, 40) }}')\n ->addColumn('stockbtn', function($data){\n if(intval($data->stock) <= 10)\n return '<button class=\"btn btn-danger btn-xs\">' .$data->stock.' </button>';\n else if (intval($data->stock) > 11 && intval($data->stock) < 15)\n return '<button class=\"btn btn-success btn-xs\">' .$data->stock.' </button>';\n else {\n return '<button class=\"btn btn-warning btn-xs\">' .$data->stock.' </button>';\n }\n })\n ->editColumn('imagen', function($data){\n if($data->imagen == null)\n return '/storage/anonymous_prod.png';\n else\n return $data->imagen;\n })\n ->rawColumns(['stockbtn'])\n ->toJson();\n }", "public function listadoProductos(){\n\n$sql = \"select idProducto,desc_Prod,presentacion,tipoProd,stock,m.nomMarca,c.nomCategoria,estadoProd from producto as p inner join Categoria as c ON c.idCategoria=p.idCategoria inner join Marca as m ON m.idMarca=p.idMarca where estadoProd=1 order by desc_Prod asc\";\n\t\n\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "function edit_producto($id){\n\n $query = $this->db->get_where('productos', array('id' => $id),1);\n\n if($query->num_rows() == 1) {\n return $query;\n } else {\n return FALSE;\n }\n }", "public function producto()\n {\n $lista_prod=Producto::TraerLista_Producto_asc();\n //generacion de bloques de producto en fila y por columnas de 4\n $seccion_prod='<div class=\"row pb-2\">';\n foreach ($lista_prod as $indice => $obj) \n {\n $indice+=1;\n if ($indice%4==0)\n {\n $seccion_prod.='\n <div class=\"pb-2 col-md-3\">\n <div class=\"card pt-3\">\n <img class=\"mx-auto\" src=\"'.asset('img/producto/'.$obj->foto).'\" height=\"70px\" alt=\"producto\"> \n <div class=\"card-body\">\n <h6 class=\"card-title\">'.$obj->nombre.'</h6>\n <p class=\"card-text\">'.$obj->descripcion.'</p>\n </div>\n </div>\n </div>';\n $seccion_prod.='</div>';\n $seccion_prod.='<div class=\"row pb-2\">'; \n }\n else \n {\n $seccion_prod.='\n <div class=\"pb-2 col-md-3\">\n <div class=\"card pt-3\">\n <img class=\"mx-auto\" src=\"'.asset('img/producto/'.$obj->foto).'\" height=\"70px\" alt=\"producto\"> \n <div class=\"card-body\">\n <h6 class=\"card-title\">'.$obj->nombre.'</h6>\n <p class=\"card-text\">'.$obj->descripcion.'</p>\n </div>\n </div>\n </div>';\n } \n }\n $seccion_prod.='</div>';\n return view('web.producto',compact('seccion_prod'));\n }", "public function ListarProductosVendidos() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT \n\tproductos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, productos.stockminimo, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad \n\tFROM\n\t(productos LEFT OUTER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) LEFT OUTER JOIN categorias ON \n\tcategorias.codcategoria=productos.codcategoria WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? AND detalleventas.codproducto is not null GROUP BY productos.codproducto\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN PRODUCTOS VENDIDOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function getProductos(){\n\t\t$this->db->select(\"p.*, m.nombre as marca, c.nombre as categoria,s.id_stock as id_stock, s.stock_minimo as stock_minimo, s.stock_actual as stock_actual ,pre.valor as valor,pre.codigo as codigo, pr.nombre as presentacion, pre.precio_compra as compra,pre.precio_venta as venta\");\n\t\t$this->db->from(\"productos p\");\n\t\t$this->db->join(\"marcas m\", \"p.id_marca = m.id_marca\");\n\t\t$this->db->join(\"categoria c\", \"p.id_categoria = c.id_categoria\");\n\t\t$this->db->join(\"stock s\", \"p.id_stock = s.id_stock\");\n\t\t$this->db->join(\"presentaciones_producto pre\", \"p.id_producto = pre.id_producto\");\n\t\t$this->db->join(\"presentacion pr\", \"pr.id_presentacion = pre.id_presentacion\");\n\t\t$this->db->where(\"p.estado\",1);\n\t\t$this->db->where(\"pre.equivalencia\",1);\n\t\t$this->db->order_by(\"categoria\");\n\t\t$resultados = $this->db->get();\n\t\treturn $resultados->result();\n\t}", "function actualizar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t$tipo = ($datos['tipo'] == 1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql = \"UPDATE app_productos SET codigo = '\" . $datos['codigo'] . \"', nombre = '\" . $datos['nombre'] . \"', minimos = \" . $datos['cant_min'] . \", factor= '\".$datos['factor'].\"' WHERE id=\".$datos['id_receta'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function RegistrarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"producto\"]) or empty($_POST[\"codcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\t$ingrediente = $_POST['codingrediente'];\n\t\t$repeated = array_filter(array_count_values($ingrediente), function($count) {\n\t\t\treturn $count > 1;\n\t\t});\n\t\tforeach ($repeated as $key => $value) {\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\n\t\t$sql = \" select codproducto from productos where codproducto = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codproducto\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n##################### REGISTRAMOS LOS NUEVOS PRODUCTOS ####################################\n\t\t\t$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproducto);\n\t\t\t$stmt->bindParam(2, $producto);\n\t\t\t$stmt->bindParam(3, $codcategoria);\n\t\t\t$stmt->bindParam(4, $preciocompra);\n\t\t\t$stmt->bindParam(5, $precioventa);\n\t\t\t$stmt->bindParam(6, $existencia);\n\t\t\t$stmt->bindParam(7, $stockminimo);\n\t\t\t$stmt->bindParam(8, $ivaproducto);\n\t\t\t$stmt->bindParam(9, $descproducto);\n\t\t\t$stmt->bindParam(10, $codproveedor);\n\t\t\t$stmt->bindParam(11, $codigobarra);\n\t\t\t$stmt->bindParam(12, $favorito);\n\t\t\t$stmt->bindParam(13, $statusproducto);\n\n\t\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t\t$producto = strip_tags($_POST[\"producto\"]);\n\t\t\t$codcategoria = strip_tags($_POST[\"codcategoria\"]);\n\t\t\t$preciocompra = strip_tags($_POST[\"preciocompra\"]);\n\t\t\t$precioventa = strip_tags($_POST[\"precioventa\"]);\n\t\t\t$existencia = strip_tags($_POST[\"existencia\"]);\n\t\t\t$stockminimo = strip_tags($_POST[\"stockminimo\"]);\n\t\t\t$ivaproducto = strip_tags($_POST[\"ivaproducto\"]);\n\t\t\t$descproducto = strip_tags($_POST[\"descproducto\"]);\n\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\tif (strip_tags($_POST['codigobarra']!=\"\")) { $codigobarra = strip_tags($_POST['codigobarra']); } else { $codigobarra ='00000000000'; }\n\t\t\t$favorito = strip_tags($_POST[\"favorito\"]);\n\t\t\t$statusproducto = strip_tags($_POST[\"statusproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproceso);\n\t\t\t$stmt->bindParam(2, $codresponsable);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciom);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codproceso = strip_tags($_POST['codproceso']);\n\t\t\t$codresponsable = strip_tags(\"0\");\n\t\t\t$codproducto = strip_tags($_POST['codproducto']);\n\t\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t\t$entradas = strip_tags($_POST['existencia']);\n\t\t\t$salidas = strip_tags(\"0\");\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = strip_tags($_POST['existencia']);\n\t\t\t$preciom = strip_tags($_POST['precioventa']);\n\t\t\t$costototal = strip_tags($_POST['precioventa'] * $_POST['existencia']);\n\t\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t\t$stmt->execute();\n\n################## SUBIR FOTO DE PRODUCTO ######################################\n//datos del arhivo \n\t\t\tif (isset($_FILES['imagen']['name'])) { $nombre_archivo = $_FILES['imagen']['name']; } else { $nombre_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['type'])) { $tipo_archivo = $_FILES['imagen']['type']; } else { $tipo_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['size'])) { $tamano_archivo = $_FILES['imagen']['size']; } else { $tamano_archivo =''; } \n//compruebo si las características del archivo son las que deseo \n\t\t\tif ((strpos($tipo_archivo,'image/jpeg')!==false)&&$tamano_archivo<200000) \n\t\t\t{ \n\t\t\t\tif (move_uploaded_file($_FILES['imagen']['tmp_name'], \"fotos/\".$nombre_archivo) && rename(\"fotos/\".$nombre_archivo,\"fotos/\".$codproducto.\".jpg\"))\n\t\t\t\t{ \n## se puede dar un aviso\n\t\t\t\t} \n## se puede dar otro aviso \n\t\t\t}\n################## FINALIZA SUBIR FOTO DE PRODUCTO ######################################\n\n\n###################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ###########################\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$query = \" insert into productosvsingredientes values (null, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproducto);\n\t\t$stmt->bindParam(2, $codingrediente);\n\t\t$stmt->bindParam(3, $cantidad);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$codingrediente = strip_tags($_POST['codingrediente'][$i]);\n\t\t$cantidad = strip_tags($_POST['cantidad'][$i]);\n\t\t$stmt->execute();\n\t}\n}\n################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ##################\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL PRODUCTO FUE REGISTRADO EXITOSAMENTE\";\necho \"</div>\";\t\t\nexit;\n}\nelse\n{\n\techo \"3\";\n\texit;\n}\n}", "public function createRow()\n {\n $sql = 'INSERT INTO productos(nombre_producto, descripcion_producto, precio_producto, imagen_producto, stock, estado_producto, id_marca, id_usuario)\n VALUES(?, ?, ?, ?, ?, ?, ?, ?)';\n $params = array($this->nombre, $this->descripcion, $this->precio, $this->imagen, $this->stock, $this->estado, $this->marca, $_SESSION['id_usuario']);\n return Database::executeRow($sql, $params);\n }", "public function actionTonerperProdotti() {\n $_prodotti = \\Yii::$app->db->createCommand(\n \"select p.id, sku, colore, resa, tipologia, ean, m.nome as marca\n , compatibile, compatibile_prezzo_tonerper as compatibile_prezzo, compatibile_url_foto\n , originale, originale_prezzo, originale_disponibile, originale_url_foto\n , p.part_number, p.sort, p.secondario\n from toner_product p\n join toner_marche m on p.id_marca = m.id\n where enabled = 1\"\n )->queryAll();\n\n //$ret = array();\n foreach($_prodotti as $k=>&$p) {\n\n $product_modelli = \\app\\models\\Toner\\ProductModelli::find()\n ->joinWith(\"modello\")\n ->andWhere([\"id_prodotto\" => $p[\"id\"]])\n ->andWhere([\"!=\", \"disabled\", 1])\n ->select([\"id_modello\"])\n ->asArray()\n ->all();\n\n $modelli = array();\n\n foreach ($product_modelli as $value) {\n $modelli[] = $value[\"id_modello\"];\n }\n\n $p[\"modelli\"] = $modelli;\n\n if (strpos($p[\"compatibile_url_foto\"], \"/photo/compatibili/\")===false)\n $p[\"compatibile_url_foto\"] = null;\n else\n $p[\"compatibile_url_foto\"] = \"https://galileo.pointec.it\".$p[\"compatibile_url_foto\"];\n\n if (strpos($p[\"originale_url_foto\"], \"/photo/originali/\")===false)\n $p[\"originale_url_foto\"] = null;\n else\n $p[\"originale_url_foto\"] = \"https://galileo.pointec.it\".$p[\"originale_url_foto\"];\n\n $oem = explode(\"#\", $p[\"part_number\"]);\n\n $oem = array_unique($oem);\n $oem = array_filter($oem);\n\n $p[\"part_number\"] = $oem;\n\n }\n\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\n return $_prodotti;\n\n print_r($_prodotti);\n\n }", "public function mostrarTablaProductos(){\n //para traer toda la informacion de la bd necesitamos encluir reuier_once\n $item = null;\n $valor = null;\n $orden = \"id_producto\";\n\n $productos = ControladorProductos::ctrMostrarProductos($item,$valor,$orden);\n \n \n //caso para los botones\n \n\n //para concatenar .=\n $datosJson = '{\n \"data\": [';\n //recorrido de lavarible $productos\n for ($i=0; $i < count($productos) ; $i++) { \n /*=============================================\n PARA LA IMAGEN\n =============================================*/\n if ($productos[$i][\"imagen\"] != \"\") {\n\n $imagen = \"<img src='\".$productos[$i][\"imagen\"].\"' width='40px'>\";\n }else{\n $imagen = \"<img src='vistas/img/productos/default/anonymous.png' width='40px'>\";\n }\n \n /*=============================================\n PARA LA CATEGORIA\n =============================================*/\n //agregaremos las categorias de la bd\n $item = \"id_categoria\";\n $valor = $productos[$i][\"id_categoria\"];\n\n $categorias = ControladorCategorias::ctrMostrarCategorias($item,$valor);\n\n /*=============================================\n STOCK PARA VER LA CANTIDAD\n =============================================*/\n if ($productos[$i][\"stock\"] <= 10) {\n $stock =\"<button class='btn btn-danger'>\".$productos[$i][\"stock\"].\"</button>\";\n }else if($productos[$i][\"stock\"] > 11 && $productos[$i][\"stock\"] <= 15){\n //para cambiar el color\n $stock =\"<button class='btn btn-warning'>\".$productos[$i][\"stock\"].\"</button>\";\n }else{\n $stock =\"<button class='btn btn-success'>\".$productos[$i][\"stock\"].\"</button>\";\n }\n\n /*=============================================\n PARA EDITAR O ELIMINAR\n =============================================*/\n //caso para los botones\n if(isset($_GET[\"perfilOculto\"]) && $_GET[\"perfilOculto\"] == \"Especial\"){\n\n $botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarProducto' id='btnEditarProducto' idProducto ='\".$productos[$i][\"id_producto\"].\"' data-toggle='modal' data-target='#modalEditarProducto'><i class='fa fa-pencil'></i></button></div>\";\n }else{\n $botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarProducto' idProducto='\".$productos[$i][\"id_producto\"].\"' data-toggle='modal' data-target='#modalEditarProducto'><i class='fa fa-pencil'></i></button><button class='btn btn-danger btnEliminarProducto' idProducto='\".$productos[$i][\"id_producto\"].\"' codigo='\".$productos[$i][\"codigo\"].\"' imagen= '\".$productos[$i][\"imagen\"].\"'><i class='fa fa-times'></i></button></div>\";\n\n }\n $datosJson .='[\n \"'.($i+1).'\",\n \"'.$imagen.'\",\n \"'.$productos[$i][\"codigo\"].'\",\n \"'.$productos[$i][\"descripcion\"].'\",\n \"'.$categorias[\"categoria\"].'\",\n \"'.$stock.'\",\n \"'.'S/ '.$productos[$i][\"precio_compra\"].'\",\n \"'.'S/ '.$productos[$i][\"precio_venta\"].'\",\n \"'.$productos[$i][\"fecha\"].'\",\n \"'.$botones.'\"\n ],'; //, es para la separacion de filas pero la ultima fila no tiene que ir con comas \n }\n //para quitar la ultima coma\n $datosJson = substr($datosJson, 0, -1);\n\n\t\t $datosJson .= '] \n\n\t\t }';\n\t\t\n\t\techo $datosJson;\n\n \n }", "public static function getProductoId($unId) {\r\n\r\n $consulta = \"SELECT * FROM productos WHERE id = :id\";\r\n $conexion = ConexionDB::conectar(\"tienda\");\r\n try {\r\n $stmt = $conexion->prepare($consulta);\r\n $stmt->bindParam(\":id\",$unId);\r\n $stmt->execute();\r\n $stmt->setFetchMode(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE, \"Carrodelacompra\\Producto\");\r\n $resultado = $stmt->fetch();\r\n } catch (PDOException $e){\r\n\t\t echo $e->getMessage();\r\n } \r\n\r\n ConexionDB::desconectar();\r\n return $resultado;\r\n\r\n }", "public function select($producto);", "public function tablaProductos () \n\t\t{\t\t\n\t\t\t//Javascript !!!\n\t\t\taddJs('js/products_table.js');\n\t\t\thidden ('iter',0); \n\t\t\t\n\t\t\techo '<table id=\"tabla_productos\" bgColor=#333 cellspacing=1 cellpadding=2 width=700><tbody>';\n\t\t\techo '<tr>'.\n\t\t\t\t\t'<th>Cantidad</th><th>Producto</th><th>Precio<br>sin Iva</th>'.\n\t\t\t\t\t'<th>Precio<br>con Iva</th><th>Total Neto</th><th>Total</th><th></th></tr>';\n\n\t\t\techo '</tbody></table>';\n\n\t\t\techo '<table bgColor=#333 cellspacing=1 cellpadding=2 width=700>';\n\t\t\t$this->tablaSumatoria();\n\t\t\techo '</table>';\t\t\t\n\t\t}", "public function ShowSaleProductsTable(){\n\n $item = null;\n $valor = null;\n $orden =\"id\";\n\n \t\t$productos = ControllerProducts::ctrShowProducts($item, $valor, $orden);\t\n\n \n\n $botones = \"<div class='btn-group'><button class='btn btn-warning'><i class='fa fa-pencil'></i></button><button class='btn btn-danger'><i class='fa fa-times'></i></button></div>\";\n\n $datosJson = '{\n \"data\": [';\n for($i = 0; $i < count($productos); $i++){\n\n /*========================================\n = Traemos la imagen =\n =============================================*/\n\n $imagen = \"<img src='\".$productos[$i][\"imagen\"].\"' width='40px'>\";\n\n\n /*========================================\n = Stock =\n =============================================*/\n \n if($productos[$i][\"stock\"] <= 10){\n\n $stock = \"<button class='btn btn-danger'>\".$productos[$i][\"stock\"].\"</button>\";\n \n }else if($productos[$i][\"stock\"] > 11 && $productos[$i][\"stock\"] <= 15){\n \n $stock = \"<button class='btn btn-warning'>\".$productos[$i][\"stock\"].\"</button>\";\n \n }else{\n \n $stock = \"<button class='btn btn-success'>\".$productos[$i][\"stock\"].\"</button>\";\n \n }\n\n /*========================================\n = Traemos las acciones =\n =============================================*/\n\n // $botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarProducto' idProducto='\".$productos[$i][\"id\"].\"' data-toggle='modal' data-target='#modalEditarProducto'><i class='fa fa-pencil'></i></button><button class='btn btn-danger btnEliminarProducto' idProducto='\".$productos[$i][\"id\"].\"' codigo='\".$productos[$i][\"codigo\"].\"' imagen='\".$productos[$i][\"imagen\"].\"'><i class='fa fa-times'></i></button></div>\";\n $botones = \"<div class='btn-group'><button class='btn btn-primary agregarProducto recuperarBoton' idProducto='\".$productos[$i][\"id\"].\"'>Agregar</button></div>\";\n\n\n $datosJson .= ' [\n \"'.($i+1).'\",\n \"'.$imagen.'\",\n \"'.$productos[$i][\"codigo\"].'\",\n \"'.$productos[$i][\"descripcion\"].'\",\n \"'.$stock.'\",\n \"'.$botones.'\"\n ],';\n\n }\n $datosJson = substr($datosJson, 0, -1);\n $datosJson .= ']\n \n }'; \n\n echo $datosJson;\n\n }", "public function exportShopProductToBepado($productId)\n {\n // You have to prevent that a bepado product is exported as your own product to bepado again.\n if ($this->isBepadoProduct($productId)) {\n throw new \\RuntimeException(\"You have to prevent that a bepado product is exported as your own product to bepado again.\");\n }\n\n $sql = \"INSERT IGNORE INTO shop_bepado_exported (p_id) VALUES (?)\";\n $this->conn->executeUpdate($sql, array($productId));\n }" ]
[ "0.70995796", "0.7055204", "0.70263666", "0.6775954", "0.6587867", "0.65728325", "0.6537069", "0.6472087", "0.64545155", "0.6441437", "0.6438928", "0.640231", "0.6395025", "0.63855135", "0.637788", "0.636536", "0.6336031", "0.6333014", "0.62810236", "0.6268155", "0.62549806", "0.6250892", "0.624936", "0.62384146", "0.62304777", "0.6227559", "0.6225007", "0.6189433", "0.6183687", "0.61812955", "0.6171646", "0.61491024", "0.6141109", "0.6125471", "0.6124518", "0.612253", "0.6116045", "0.61093324", "0.60897833", "0.6086604", "0.6086251", "0.60858095", "0.6083199", "0.60816664", "0.6072076", "0.60703146", "0.6069473", "0.60621953", "0.6062156", "0.6051937", "0.60496885", "0.6049523", "0.6043341", "0.6031915", "0.60285735", "0.6024868", "0.60240644", "0.6023178", "0.6016292", "0.6013778", "0.6012433", "0.6011303", "0.599592", "0.59952635", "0.59811026", "0.5981072", "0.5969175", "0.59636515", "0.5954582", "0.595343", "0.5941812", "0.5933296", "0.59309584", "0.59309584", "0.5928576", "0.59250146", "0.59207284", "0.5920134", "0.5915278", "0.5909898", "0.5903776", "0.59001166", "0.5898711", "0.5889418", "0.588176", "0.58799213", "0.5876862", "0.5875929", "0.58689845", "0.5866098", "0.5865671", "0.5864756", "0.5861675", "0.5858118", "0.5854945", "0.5853785", "0.5853303", "0.5847117", "0.5846466", "0.5845915", "0.5844871" ]
0.0
-1
Obtenir les commentaires en fonction de leur id
public function getComments($postId) { $db = $this->dbConnect(); $comments = $db->prepare('SELECT id, author, comment, DATE_FORMAT(comment_date, \'%d/%m/%Y à %Hh%imin%ss\') AS comment_date_fr FROM comments WHERE post_id = ? ORDER BY comment_date DESC'); $comments->execute(array($postId)); return $comments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_comment_ids()\n {\n }", "public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }", "function afficherCommentaires($_idRecette){\n $connexion= my_connect();\n $requette_commentaire=\"SELECT Commentaire,Idrecette,Datecommentaire FROM Commentaires where Idrecette = $_idRecette\";\n $table_commentaire_resultat = mysqli_query($connexion,$requette_commentaire); \n if($table_commentaire_resultat){\n echo (\"Commentaires:<ul> \");\n \n while($ligne_commentaire=mysqli_fetch_object($table_commentaire_resultat)){\n echo (\"<li>\".$ligne_commentaire->Datecommentaire.\": \".$ligne_commentaire->Commentaire.\"</li>\");\n }\n echo \"</ul>\";\n }else{\n echo \"<p>Erreur dans l'exécution de la requette</p>\";\n echo\"message de mysqli:\".mysqli_error($connexion);\n }\n mysqli_close($connexion);\n }", "public function getAllCommentaires()\n {\n $sql = 'SELECT COM_ID as id, COM_DATE as date,'\n . ' COM_AUTEUR as auteur, COM_CONTENU as contenu FROM t_commentaire'\n . ' ';\n $commentaires = $this->executerRequete($sql);\n return $commentaires;\n }", "public function getComments($idBillet) {\n $sql = 'select com_id as id, com_date as date,'\n . ' com_auteur as auteur, com_content as contenu from comment'\n . ' where ART_ID=?';\n $result = $this->executerRequete($sql, array($idBillet));\n $comments = [];\n foreach ($result as $row){\n $commentId = $row['id'];\n $comments[$commentId] = $this->buildObject($row);\n }\n return $comments;\n }", "public function getCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('SELECT `id`, `content`, `id_jeu`, `notepost`, `pseudo`, `totalContent`,(SELECT `title` FROM `jeux` WHERE `id`=`id_jeu`)AS titreJeu,(SELECT `categorie` FROM `jeux` WHERE `id`=`id_jeu`)AS categorieJeu FROM `commentaires` WHERE `id`=?');\n $req->execute(array($id));\n return $req;\n }", "public function get_commentaire(){retrun($id_local_commentaire); }", "public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }", "public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}", "public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "public function comments($id = null) \n\t{\n\t\t/* COMMENT BLOCK */\n\t\t$total = $this->Model->getCountComments($id);\n\t\t$per_page = 25;\n\n\t\t/* pages nav */\n\t\tlist($pages, $page) = pagination($total, $per_page, $this->getModuleURL('comments/' . ($id ? $id : '')));\n\t\t$this->_globalize(array('comments_pagination' => $pages));\n\n\t\t$offset = ($page - 1) * $per_page;\n\n\t\t$comments = $this->Model->getComments($id, $offset, $per_page);\n\t\tif ($comments && is_array($comments)) {\n\t\t\tforeach ($comments as $index => $entity) {\n\n\t\t\t\t$module = $entity->getModule();\n\t\t\t\t$markers = array();\n\n\t\t\t\t\n\t\t\t\t// COMMENT ADMIN BAR\n\t\t\t\t$ip = ($entity->getIp()) ? $entity->getIp() : 'Unknown';\n\t\t\t\t$moder_panel = '';\n\t\t\t\t$adm = false;\n\t\t\t\tif ($this->ACL->turn(array($module, 'edit_comments'), false)) {\n\t\t\t\t\t$moder_panel .= get_link('',\n\t\t\t\t\t'/' . $module . '/edit_comment_form/' . $entity->getId(), array('class' => 'fps-edit')) . '&nbsp;';\n\t\t\t\t\t$adm = true;\n\t\t\t\t}\n\n\t\t\t\tif ($this->ACL->turn(array($module, 'delete_comments'), false)) {\n\t\t\t\t\t$moder_panel .= get_link('',\n\t\t\t\t\t'/' . $module . '/delete_comment/' . $entity->getId(), array('class' => 'fps-delete', 'onClick' => \"return confirm('\" . __('Are you sure') . \"')\")) . '&nbsp;';\n\t\t\t\t\t$adm = true;\n\t\t\t\t}\n\n\t\t\t\tif ($adm) {\n\t\t\t\t\t$moder_panel = '<a target=\"_blank\" href=\"https://apps.db.ripe.net/search/query.html?searchtext=' \n\t\t\t\t\t\t\t. h($ip) . '\" class=\"fps-ip\" title=\"IP: ' . h($ip) . '\"></a>' . $moder_panel;\n\t\t\t\t}\n\n\n\t\t\t\t$img = array(\n\t\t\t\t\t'alt' => 'User avatar',\n\t\t\t\t\t'title' => h($entity->getName()),\n\t\t\t\t\t'class' => 'ava',\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Аватар\n\t\t\t\tif (file_exists(ROOT . '/sys/avatars/' . $entity->getUser_id() . '.jpg')) \n\t\t\t\t\t$url = get_url('/sys/avatars/' . $entity->getUser_id() . '.jpg');\n\t\t\t\telse \n\t\t\t\t\t$url = get_url('/sys/img/noavatar.png');\n\t\t\t\t\t\n\t\t\t\t$markers['avatar'] = '<img class=\"ava\" src=\"' . $url . '\" alt=\"User avatar\" />';\n\n\t\t\t\t\n\n\t\t\t\tif ($entity->getUser_id()) {\n\t\t\t\t\t$markers['name_a'] = get_link(h($entity->getName()), getProfileUrl((int)$entity->getUser_id()));\n\t\t\t\t\t$markers['user_url'] = get_url(getProfileUrl((int)$entity->getUser_id()));\n\t\t\t\t\t$markers['avatar'] = get_link($markers['avatar'], $markers['user_url']);\n\t\t\t\t} else {\n\t\t\t\t\t$markers['name_a'] = h($entity->getName());\n\t\t\t\t}\n\t\t\t\t$markers['name'] = h($entity->getName());\n\n\n\t\t\t\t$markers['moder_panel'] = $moder_panel;\n\t\t\t\t$markers['message'] = $this->Textarier->parseBBCodes($entity->getMessage(), $entity);\n\n\t\t\t\tif ($entity->getEditdate()!='0000-00-00 00:00:00') {\n\t\t\t\t\t$markers['editdate'] = 'Комментарий был изменён '.$entity->getEditdate();\n\t\t\t\t} else {\n\t\t\t\t\t$markers['editdate'] = '';\n\t\t\t\t}\n\n\t\t\t\t$entity->setEntry_url(get_url('/' . $module . '/view/' . $entity->getEntity_id()));\n\t\t\t\t$entity->setAdd_markers($markers);\n\t\t\t\t\n\t\t\t\t$comments[$index] = $entity;\n\t\t\t}\n\t\t}\n\t\t$this->comments = $this->render('viewcomment.html', array('commentsr' => $comments));\n\n\t\t$title = __('All comments');\n\t\tif ($id && intval($id) > 0) {\n\t\t\t$user = $this->Model->getById(intval($id));\n\t\t\tif ($user)\n\t\t\t\t$title = __('User comments') . ' \"' . h($user->getName()) . '\"';\n\t\t}\n $this->addToPageMetaContext('entity_title', $title);\n\n\n\t\t$navi = array(\n 'add_link' => ($this->ACL->turn(array($this->module, 'add_materials'), false))\n ? get_link(__('Add material'), $this->getModuleURL('add_form/')) : '',\n 'module_url' => get_url($this->getModuleURL()),\n 'category_url' => get_url($this->getModuleURL('comments/' . ($id ? $id : ''))),\n 'category_name' => $title,\n 'navigation' => get_link(__('Home'), '/') . __('Separator')\n . get_link(h($this->module_title), $this->getModuleURL()) . __('Separator')\n . $title,\n );\n\t\t$this->_globalize($navi);\n\n\n\t\treturn $this->_view('');\n\t}", "function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }", "function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}", "public function getComments($idPoem) {\n \n $sql = 'SELECT COM_ID as id, ' . \n ' COM_DATE as date, ' . \n ' COM_AUTHOR as author, ' . \n ' COM_CONTENT as content ' . \n 'FROM T_COMMENT ' . \n 'WHERE ARTICLE_ID = ? ';\n \n $comments = $this->executeQuery($sql, array($idPoem));\n \n return $comments;\n }", "function getIdCommentaire() {\n return $this->idCommentaire;\n }", "function load_comments($id_object){\n\t\tglobal $con;\n\t\t$comments=array();\n\t\t $query=mysqli_query($con,\"SELECT * FROM spip_forum WHERE id_objet='$id_object' ORDER BY id_forum DESC\");\n\t\t if($query){\n\t\t \tif(mysqli_num_rows($query)>0){\n\t\t \t\twhile($data=mysqli_fetch_assoc($query)){\n\t\t \t\t\t$comments[]=$data;\n\t\t \t\t}\n\t\t \t}\n\t\t }else{\n\t\t \tdie(mysqli_error($con));\n\t\t }\n\t\t return $comments;\n\t}", "function user_get_comment_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $_SESSION['uid'] : $id;\n\t\t$comments = $this->DB->database_select('user_comments', '*', array('to_user' => $uid));\n\t\treturn $comments;\n\t}", "function comment() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from comments where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function loadComments($_idRecette){\n $connexion= my_connect();\n $requette_commentaire=\"SELECT Idcommentaire, Commentaire, Idrecette, Datecommentaire FROM Commentaires where Idrecette = $_idRecette\";\n $table_commentaire_resultat = mysqli_query($connexion,$requette_commentaire); \n $commentaires = array();\n if($table_commentaire_resultat){ \n while($ligne_commentaire=mysqli_fetch_object($table_commentaire_resultat)){\n $commentaires += array($ligne_commentaire->Idcommentaire => array('textCommentaire' => $ligne_commentaire->Commentaire,'dateCommentaire' => $ligne_commentaire->Datecommentaire)); \n } \n }else{\n echo \"<p>Erreur dans l'exécution de la requette</p>\";\n echo\"message de mysqli:\".mysqli_error($connexion);\n }\n mysqli_close($connexion); \n return $commentaires;\n}", "public function getComments($idPost)\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE id_post='.$idPost);\n\n\t\t$comments=[];\n\t\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\t\n\t\t\t\t\t$comments[]=new Comments($datas);\t\t\n\t\t\t}\n\t\treturn $comments;\n\t\t\t\t\n\t}", "function selectComments($id_rubric, $type_comment)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tC.id_comment,\n\t\t\t\t\t\tC.type_comment,\n\t\t\t\t\t\tC.content,\n\t\t\t\t\t\tC.dateCreated,\n\t\t\t\t\t\tC.dateModified,\n\n\t\t\t\t\t\tU.id_user,\n\t\t\t\t\t\tU.user_pseudo,\n\t\t\t\t\t\tU.score\n\n\t\t\t\tFROM users AS U, comments AS C\t\t\t\t\n\t\t\t\tWHERE U.id_user = C.id_user\n\t\t\t\tAND C.id_rubric = :id_rubric\n\t\t\t\tAND C.type_comment = :type_comment\n\t\t\t\tORDER BY C.dateCreated DESC\n\t\t\t\tLIMIT 3\";\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_rubric\", $id_rubric);\n\t\t$stmt->bindValue(\":type_comment\", $type_comment);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetchAll();\n\t}", "function get_comment_to_edit($id)\n {\n }", "private function GetComments($_id)\n\t{\n\t\t//Get Database\n\t\t$_database = $this->ConnectDatabase();\n\t\t//Create Data\n\t\t$_data = array($_id);\n\t\t//Call and return Database Function\n\t\treturn $this->CallDatabase(\n\t\t\t$_database,\n\t\t\t$_data,\n\t\t\tfunction($_pdo, $_parameters)\n\t\t\t{\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"SELECT \n\t\t\t\t\t\tcm.id id, \n\t\t\t\t\t\tcm.description description, \n\t\t\t\t\t\tcm.ratting rate, \n\t\t\t\t\t\tcm.created date, \n\t\t\t\t\t\tcm.type `type`,\n\t\t\t\t\t\tus.nick_name user_nick, \n\t\t\t\t\t\tus.url_profile user_url_perfil\n\t\t\t\t\tFROM Comments cm\n\t\t\t\t\tLEFT JOIN Users us ON us.id = cm.id_user\n\t\t\t\t\tWHERE cm.id_partner = ?\n\t\t\t\t\");\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\n\t\t\t\t$_data = null;\n\t\t\t\twhile ($_row = $_query->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$_row['user_url_perfil'] = strlen($_row['user_url_perfil']) > 1 ? \n\t\t\t\t\t\t$this->image_client_path . $_row['user_url_perfil'] : \n\t\t\t\t\t\tnull;\n\t\t\t\t\t$_row['date'] = $this->ConvertDataClient($_row['date']);\n\t\t\t\t\t$_data = $_row;\n\t\t\t\t}\n\t\t\t\treturn $_data;\n\t\t\t}\n\t\t);\n\t}", "public static function findCommentsOn($id=0){\n\t\t//So custom find function() is needed\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM \".static::$table_name.\" WHERE post_id = \";\n\t\t$sql .= $connection->real_escape_string($id) . \" ORDER BY created ASC \";\n\t\t//echo $sql;\n\t\treturn static::findBySql($sql);\n\t}", "public function todosComentarios(){\n\t\t$comments_inf = [];\n\t\t$num=1;\n\t\t$sql_query = \"SELECT * FROM comentarios;\";\n\t\tif($result = $this->connection->query($sql_query))\n\t\t{\n\t\t\twhile($row = $result->fetch_assoc()){\n\t\t\t\t$comment_row = [\n\t\t\t\t\t\"num\"=>$num,\n\t\t\t\t\t\"id\" => $row[\"Id\"],\n\t\t\t\t\t\"name\" => $row[\"Nombre\"],\n\t\t\t\t\t\"date\" => $row[\"Fecha\"],\n\t\t\t\t\t\"time\" => $row[\"Hora\"],\n\t\t\t\t\t\"email\" => $row[\"Email\"],\n\t\t\t\t\t\"description\" => $row[\"Descripcion\"],\n\t\t\t\t\t\"ip\" => $row[\"IP\"],\n\t\t\t\t\t\"idEvento\" => $row[\"Id_Eventos\"]\n\t\t\t\t];\n\t\t\t\tarray_push($comments_inf,$comment_row);\n\t\t\t\t$num++;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo(\"Error al consultar comentarios en BD\");\n\t\t}\n\t\treturn $comments_inf;\n\t}", "function GetComments($f_id)\n\t{\n\t\t$sql_query = \"SELECT comments.*, members.nick_name, members.logo_file FROM `\".$this->sCommentTb.\"` AS comments LEFT JOIN `\".$GLOBALS['g_egltb_members'].\"` AS members ON comments.author_id=members.id HAVING comments.\".$this->sField.\"=\".(int)$f_id.\" ORDER BY comments.created DESC\";\n\t\treturn $this->pDBInterface->FetchArrayObject( $this->pDBInterface->Query( $sql_query ) );\n\t}", "public function getCommentsAdmin() \n {\n $db = $this->dbConnect();\n $reqPostComments = $this->bdd->query('SELECT id, id_post, author, comment, DATE_FORMAT(date_comment, \\'Le %d/%m/%Y à %H h %i\\') AS date_comment FROM comments ORDER BY date_comment DESC');\n $commentsId = $reqPostComments->fetchAll();\n $reqPostComments->closeCursor();\n return $commentsId;\n }", "public function getIdCommentaire()\n {\n return $this->Id_commentaire;\n }", "public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }", "function getcomment()\n\t{\n\t\t## variable initialization\n\t\tglobal $option, $mainframe, $db;\n\t\t$commentId = JRequest::getVar('cmtid', '', 'get', 'int');\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\n\t\t## for pagination\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . 'limitstart', 'limitstart', 0, 'int');\n\n\t\t## \tquery for delete the comments\n\t\tif ($commentId)\n\t\t{\n\t\t\t$query = \"DELETE FROM #__hdflv_comments\n \t\t WHERE id=\" . $commentId . \"\n \t\t OR parentid=\" . $commentId;\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t## message for deleting comment\n\t\t\t$mainframe->enqueueMessage( 'Comment Successfully Deleted' );\n\t\t}\n\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\t\t$query = \"SELECT COUNT(id) FROM #__hdflv_comments\n \t\t WHERE videoid = $id\";\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\t\tif (!$commentTotal)\n\t\t{\n\t\t\t$strRedirectPage = 'index.php?layout=adminvideos&option=' . JRequest::getVar('option') . '&user=' . JRequest::getVar('user');\n \t$mainframe->redirect($strRedirectPage);\n\t\t}\n\n\t\t$query=\"SELECT id as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid = 0 and published=1 and videoid=$id union\n\t\t\t\tSELECT parentid as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid !=0 and published=1 and videoid=$id\n\t\t\t\tORDER BY number desc,parentid\";## Query is to display the comments posted for particular video\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\n\t\t$pageNav = new JPagination($commentTotal, $limitstart, $limit);\n\n $query = \"$query LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t$db->setQuery($query);\n\t\t$comment = $db->loadObjectList();\n\n\t\t$query = \"SELECT `title` FROM #__hdflv_upload WHERE id = $id\";\n\t\t$db->setQuery($query);\n\t\t$videoTitle = $db->loadResult();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\t$comment = array('pageNav' => $pageNav, 'limitstart' => $limitstart, 'comment' => $comment ,'videotitle' => $videoTitle);\n\t\treturn $comment;\n\t}", "public function LoadAll(){\n //Järjestä ketjut niin, että tuorein ekana\n $all = $this->con->select(\"comments\",\"*\",[\n 'reply_to' => 0,\n 'service_id' => $this->service_id,\n 'ORDER' => [ 'comment_time' => 'DESC' ]\n ]);\n\n $commentstring = \"\";\n foreach($all as $chain){\n //Kootaan kaikki \n $tpl = $this->template_engine->loadTemplate('comment'); \n $subchain = $this->con->select(\"comments\", \"*\",[\n 'reply_to' => $chain[\"id\"],\n 'ORDER' => ['comment_time' => 'ASC']\n ]);\n //Huom: järjestä vastaukset niin, että tuorein viimeisenä\n $subchainstring = \"\";\n if($subchain){\n $subchainstring = \"\";\n foreach($subchain as $reply){\n $subtpl = $this->template_engine->loadTemplate('comment'); \n $subchainstring .= \"\\n{$subtpl->render($reply)}\";\n }\n }\n $commentstring .= $tpl->render(array_merge($chain,\n Array(\"subchain\" => $subchainstring)));\n\n }\n return $commentstring;\n }", "function getComments($post_id){\n GLOBAL $CONNECTION; \n $sql = \"SELECT * FROM comment WHERE post_id=$post_id ORDER BY commented_at DESC\";\n $comments = mysqli_query($CONNECTION, $sql);\n return $comments;\n }", "public function getComments() {}", "function fetchArticleComments()\r\n\t{\r\n\t\t$comments = array();\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_artikel_kommentare WHERE Publik = '1' AND ArtId = '\" . (int)$_REQUEST['product_id'] . \"' ORDER BY Id DESC\");\r\n\t\twhile($row = $sql->fetchrow())\r\n\t\t{\r\n\t\t\t$sql_u = $GLOBALS['db']->Query(\"SELECT Vorname,Nachname FROM \" . PREFIX . \"_users WHERE Id = '$row->Benutzer'\");\r\n\t\t\t$row_u = $sql_u->fetchrow();\r\n\r\n\t\t\t$row->Titel = htmlspecialchars($row->Titel);\r\n\t\t\t$row->Kommentar = nl2br(htmlspecialchars($row->Kommentar));\r\n\t\t\t$row->Autor = substr($row_u->Vorname,0,1) . '. ' . $row_u->Nachname;\r\n\t\t\tarray_push($comments, $row);\r\n\t\t}\r\n\t\treturn $comments;\r\n\t}", "public function getComments(int $id):array\n {\n $req=$this->pdo->prepare(\n 'SELECT comment_id,content,validated,commented_by,post_id,\n date_format(commented,\\' %d\\%m\\%Y à %Hh%imin%ss\\') as coment_date\n FROM comments \n WHERE comments.post_id = ? \n AND comments.validated IS NOT NULL\n ORDER BY coment_date DESC'\n );\n $req->execute([$id]);\n return $comments= $req->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }", "function aff_comm_post($id_post) {\n\n\t\t$req = $GLOBALS['bdd']->prepare('SELECT b.*, d.*\n\t\t\t\t\t\t\t\tFROM badin b\n\t\t\t\t\t\t\t\tINNER JOIN dactyle d\n\t\t\t\t\t\t\t\tON b.bigarade = d.dazibao\n\t\t\t\t\t\t\t\tWHERE b.balsamine = ? \n\t\t\t\t\t\t\t\tAND b.bouquetin = 2\n\t\t\t\t\t\t\t\tORDER BY b.brimade DESC');\n\t\t$req->execute(array($_POST['post_id']));\n\t\t\t\t\t\t\t\t\t\n\t\twhile ($donnees = $req->fetch())\n\t\t{\n\t\t?>\n\t\t\t<div id=\"<?php echo $donnees['baliverne'];?>\" >\n\t\t\t\t<div class=\"zone_comment\" id=\"zone_comment\">\n\t\t\t\t\t<div class=\"mini_profil_comment\">\n\t\t\t\t\t\t<img class=\"mini_profil_img\" src=\"/ressources/images/profil/<?php echo $donnees['dazibao'];?>/profil_<?php echo $donnees['dessication'];?>\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"auteur_et_date_comment\" >\n\t\t\t\t\t\t<a class=\"lien_nom_comment\" href=\"/<?php echo $donnees['diatribe'].'/'.$donnees['decapode'].'-'.$donnees['dazibao'].'/';?>\">\n\t\t\t\t\t\t\t<?php echo $donnees['decapode'];?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<div class=\"date_post\" >\n\t\t\t\t\t\t\tLe <?php echo $donnees['brimade'];?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"contenu_comment\">\n\t\t\t\t\t\t<?php echo $donnees['bryophite']; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t\t$req->closeCursor();\n\n\t}", "function supprimerToutCommentaires($_idRecette){\n // recherche de tout les commentaires de la recette\n $connexion= my_connect();\n $requette_commentaire=\"SELECT Idcommentaire FROM Commentaires where Idrecette = $_idRecette\";\n $table_commentaire_resultat = mysqli_query($connexion,$requette_commentaire); \n if($table_commentaire_resultat){ \n while($ligne_commentaire=mysqli_fetch_object($table_commentaire_resultat)){\n supprimerCommentaire($ligne_commentaire->Idcommentaire);\n }\n }\n else{\n echo \"<p>Erreur dans l'exécution de la requette</p>\";\n echo\"message de mysqli:\".mysqli_error($connexion);\n }\n mysqli_close($connexion);\n }", "public function showAllByComment($id, $premiereEntree, $messageTotal){\n\n\t\t$comments = [];\n\n\t\t$manager = $this->manager->getManager(); \n\n\t\t$listComments = $manager->prepare('SELECT * FROM comments WHERE post_id = ? ORDER BY id DESC LIMIT ' . $premiereEntree . ', ' . $messageTotal) or die(print_r($manager->errorMessage()));\n\n\t\t$listComments->execute(array($id));\n\n\t\twhile($comment = $listComments->fetch()){\n\n\t\t\t$comments[] = new Comment($comment);\n\t\t}\n\n\t\treturn $comments;\n\t}", "public function comments(){\n }", "public function selectComments() {\n $query=\"SELECT c.id_comentario, c.comentario, c.valoracion, cp.catalogo_producto, ec.estado_comentario, CONCAT(cl.nombres, ' ', cl.apellidos) as cliente, c.fecha_comentario\n FROM comentarios c\n INNER JOIN catalogo_productos cp\n ON cp.id_catalogo_producto = c.id_catalogo_producto\n INNER JOIN estados_comentario ec\n ON ec.id_estado_comentario = c.id_estado_comentario\n INNER JOIN clientes cl\n ON cl.id_cliente = c.id_cliente\";\n $params = null;\n return Database::getRow($query, $params);\n }", "public function getComments($id_root=0) {\n if ( empty($id_root) ) $id_root = $this->get('id_root');\n return $this->query_loads(\"id_root=$id_root AND id_parent>0 ORDER BY order_list ASC\");\n //return self::getCommentsInOrder($id_root);\n }", "public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }", "public function getComments($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state >= 2 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}", "public function getAllComments(){\n $comments = $this->db->query('SELECT * FROM comments');\n return $comments;\n }", "public function fetchAllByThreadId($id)\n {\n return $this->dibi->fetchAll('\n SELECT \n `id`, `text`, `ip`, `date`\n FROM\n `comment`\n WHERE\n `thread_id` = %i\n ', $id);\n \n }", "public function getComments() {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"SELECT * FROM comments_table where parent_id=0 ORDER BY create_date DESC;\";\n $result = mysql_query($sql, $db);\n $comments = [];\n while ($row = mysql_fetch_assoc($result)) {\n $comment = $row;\n $reply_1_sql = \"SELECT * FROM comments_table where parent_id=\" . $row['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_1 = mysql_query($reply_1_sql, $db);\n $replies = [];\n while ($row1 = mysql_fetch_assoc($result)) {\n $reply = $row1;\n $reply_2_sql = \"SELECT * FROM comments_table where parent_id=\" . $row1['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_2 = mysql_query($reply_2_sql, $db);\n $replies_to_replies = [];\n while ($row2 = mysql_fetch_assoc($result)) {\n $replies_to_replies[] = $row2;\n }\n $reply['replies'] = $replies_to_replies;\n $replies[] = $reply;\n }\n $comment['replies'] = $replies;\n $comments[] = $comment;\n }\n return $comments;\n }", "public function getComment(int $id)\n\t{\n\n\t\treturn $this->select('c.*', 'e.title AS `episode`','ch.name AS `chapter`', 'u.first_name', 'u.last_name', 'c.email')\n\t\t\t ->from('comments c')\n\t\t\t ->join('LEFT JOIN episodes e ON c.episode_id=e.id')\n\t\t\t ->join('LEFT JOIN chapters ch ON e.chapter_id=ch.id')\n\t\t\t ->join('LEFT JOIN users u ON c.user_id=u.id')\n\t\t\t ->where('c.id=?', $id)\n\t\t\t ->fetch();\n\t}", "public static function get_comments_save($id_user_mod) {\n\t\t$comments = CommentsSaveQModel::get_comments_save_by_user_id($id_user_mod);\n\t\t// dd($comments);\n\t\tforeach ($comments as $comment) {\n\t\t\t\n\t\t\tif ($comment->page == 'book') {\n\t\t\t\t$book = BooksQModel::get_book_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $book->name;\n\t\t\t} else if ($comment->page == 'character') {\n\t\t\t\t$character = CharactersQModel::get_character_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $character->name;\n\t\t\t} else if ($comment->page == 'author') {\n\t\t\t\t$author = AuthorsQModel::get_author_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $author->name;\n\t\t\t} else if ($comment->page == 'trans') {\n\t\t\t\t$trans = TransQModel::get_trans_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $trans->name;\n\t\t\t} else if ($comment->page == 'user') {\n\t\t\t\t$user = UsersQModel::get_user_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $user->name;\n\t\t\t} else if ($comment->page == 'read') {\n\t\t\t\t$chap = ChapsQModel::get_chap_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $chap->book_name.' '.$chap->name;\n\t\t\t}\n\t\t}\n\t\treturn $comments;\n\t}", "public function getComments($post_id)\n {\n $statement = $this->pdo->prepare(\"SELECT * FROM comments WHERE post_id = :post_id ORDER BY comments_id DESC\");\n\n $statement->execute(\n [\n \":post_id\" => $post_id,\n ]\n );\n\n $all_comments = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n $this->all_comments = $all_comments;\n }", "public function getAllCommentsByBattleID($battle_id) {\n $stmt = $this->db->query(\"SELECT *\n FROM comments\n INNER JOIN users\n ON comments.userid = users.userid\n WHERE battle_id = :id\");\n\n $stmt->bindParam(':id', $battle_id);\n $stmt->execute();\n $rows = array();\n while($row = $stmt->fetch()) {\n $rows[] = $row;\n }\n return $rows;\n\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function getId(int $id)\n {\n $query = $this->db->pdo->prepare('SELECT id, idnews, idparent, niveau, moderate, content, membre, addDate FROM comments WHERE id =' . $id);\n $query->execute(['id' => $id]);\n\n $donnees = $query->fetch(PDO::FETCH_ASSOC);\n\n return new Comment($donnees);\n }", "public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }", "public function readCommentCustomer(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=? and comentarios.estado = 1';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n\n }", "function GetComments($conn)\n\t{\n\t\t// get comments from sql\n\t\t$sql = \"SELECT * FROM comments\";\n\n\t\t// query the database\n\t\t$result = $conn->query($sql);\n\n\t\t// fetch the comments as an array\n\t\twhile ($row = $result->fetch_assoc())\n\t\t{\n\t\t\t// get comments from database that have correct user tag\n\t\t\t$userId = $row['uid'];\n\t\t\t$userSql = \"SELECT * FROM users WHERE idUsers='$userId'\";\n\t\t\t$userResult = $conn->query($userSql);\n\n\t\t\t// get all comments with user tags\n\t\t\tif ($userRow = $userResult->fetch_assoc())\n\t\t\t{\n\t\t\t\t// display user, date and message of the comments\n\t\t\t\techo \"<div class='comment-box'>\n\t\t\t\t\t\t<p style='font-weight:bold; font-size:18px;'>\".$userRow['uidUsers'].\"</p>\n\t\t\t\t\t\t<p style='font-size:12px; margin-top:-10px; color:#6e6e6e;'>\".$row['date'].\"</p>\n\t\t\t\t\t\t<p style='margin-bottom:0px;'>\".nl2br($row['message']).\"</p>\";\n\n\t\t\t\t// if the user is logged in\n\t\t\t\tif (isset($_SESSION['userId']))\n\t\t\t\t{\n\t\t\t\t\t// check if the user matches a comment\n\t\t\t\t\tif ($_SESSION['userId'] == $userRow['idUsers'])\n\t\t\t\t\t{\n\t\t\t\t\t\t// display the buttons for editing and deleting comments\n\t\t\t\t\t\techo \"<form class='comment-box-editform' method='POST' action='comment-edit.php'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='cid' value='\".$row['cid'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='uid' value='\".$row['uid'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='date' value='\".$row['date'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='message' value='\".$row['message'].\"'>\n\t\t\t\t\t\t\t\t\t<button>EDIT</button>\n\t\t\t\t\t\t\t\t</form>\n\n\t\t\t\t\t\t\t\t<form class='comment-box-deleteform' method='POST' action='\".DeleteComments($conn).\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='cid' value='\".$row['cid'].\"'>\n\t\t\t\t\t\t\t\t\t<button type='submit' name='commentDelete'>DELETE</button>\n\t\t\t\t\t\t\t\t</form>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close the comment section of html\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t}\n\t}", "public function commentsIndex() {\n $id = $_POST['id'];\n $comments = Comment::where('post_id', $id);\n echo json_encode($comments);\n\t}", "public function init_post_comments($id)\n {\n $_comments = '';\n $total_comments = total_rows(db_prefix() . 'mention_post_comments', [\n 'postid' => $id,\n ]);\n if ($total_comments > 0) {\n $page = $this->input->post('page');\n if (!$this->input->post('page')) {\n $_comments .= '<div class=\"panel-footer post-comment post-comment\">';\n }\n $comments = $this->mention_model->get_post_comments($id, $page);\n // Add +1 becuase the first page is already inited\n \n foreach ($comments as $comment) {\n $_comments .= $this->comment_single($comment);\n }\n \n if (!$this->input->post('page')) {\n $_comments .= '</div>';\n }\n }else{\n $_comments .= '<div class=\"panel-footer post-comment post-comment\">';\n $_comments .= '</div>'; // end comments footer\n }\n if (($this->input->is_ajax_request() && $this->input->get('refresh_post_comments')) || ($this->input->is_ajax_request() && $this->input->post('page'))) {\n echo html_entity_decode($_comments);\n } else {\n return $_comments;\n }\n }", "public function get_comments()\n {\n }", "public function getCommentsAdmin($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state <= 1 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "public function getAllComment()\n {\n return Comment::find()->with('user')->orderBy(['created_date'=>SORT_DESC])->all();\n \n }", "function editCommentsPost($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n $commentManager = new CommentManager();\n $listCommentsForPost = $commentManager->getListCommentsForPost($id);\n\n require'../app/Views/backViews/comment/backEditCommentsPostView.php';\n }", "public function getAllTheComments(){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $comments=array();\n\t\t\t foreach($result as $comment){\n\t\t\t\t$c1=new Comment();\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\tarray_push($comments,$c1);\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $comments;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public static function searchComments($id) {\n $db = Db::getInstance();\n $id = intval($id);\n $req = $db->prepare('call searchComment(?)');\n $req->execute([$id]);\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "function get_all_comments() {\n global $db;\n $query = \"SELECT c.comment_id, c.comment, c.user_id, c.created, u.userName FROM comments c\n JOIN users u on u.user_id = c.user_id\n ORDER BY created DESC\";\n $statement = $db->prepare($query);\n $statement->execute();\n $comments = $statement->fetchAll();\n $statement->closeCursor();\n return $comments; \n }", "public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}", "public function comments()\n {\n $comments = $this->comment->getAllComments();\n $this->buildView(array('comments' => $comments));\n }", "public function createCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('INSERT INTO commentaires(id_jeu)VALUE(?)');\n $req->execute(array($id));\n return $req;\n }", "public static function getCommentById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $commentItem = [];\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM comments WHERE id_to_what_post =' . $id);\n\n $i = 0;\n while($row = $result->fetch()) {\n //$commentItem[$i]['id_to_what_post'] = $row['id_to_what_post'];\n $commentItem[$i]['date'] = $row['date'];\n $commentItem[$i]['text'] = $row['text'];\n $commentItem[$i]['author'] = $row['author'];\n $i++;\n }\n\n return $commentItem;\n }\n }", "public function getDiscussionCommentairesAction(Request $request, $id)\n { \n $data['discussion'] = $this->container->get('ib_commentaire.manager.discussion')->findDiscussionById($id);\n if (!(null === $data['discussion']))\n {\n $data['commentaires'] = $this->getPaginationCommentaires($request, $data['discussion']);\n\n if(count($data['commentaires']) > 0)\n { \n $view = View::create()\n ->setData($data)\n ->setTemplate(new TemplateReference('IBCommentaireBundle', 'Discussion', 'commentaires'));\n\n $handler = $this->getViewHandler();\n return $handler->handle($view->setData(array('html' => $handler->renderTemplate($view, 'html'), 'lastdate' => $data['discussion']->getLastUpdate()->format('Y-m-d H:i:s'), 'reload' => true)));\n } \n\n return $this->onErrorMessage(\"La page existe pas ou plus.\");\n }\n\n return $this->onErrorMessage('Discussion introuvable.'); \n }", "function get_comment_ID()\n {\n }", "public static function getAllComment() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "function setIdComentaire($idCommentaire) {\n $this->idCommentaire = $idCommentaire;\n }", "function listo_komentet( $news_id ){\r\n\t\r\n\tglobal $db;\r\n\t\r\n\t//E beme te sigurte\r\n\t$news_id = mysql_real_escape_string($news_id);\r\n\t\r\n\t$result = mysql_query (\"SELECT * FROM comments WHERE news_id=$news_id \");\r\n\t\r\n\tif (!$result) {\r\n\t\tdie( mysql_error() )\t;\r\n\t}\r\n\t$text = '';\r\n\twhile( $comment = mysql_fetch_array( $result ) ) {\r\n\t\t\r\n\t\t$text.='<li>';\r\n\t\t$text.='<h4>' . $comment['name'] . '</h4>';\r\n\t\t$text.= '<p>' . nl2br ($comment['comment']) . '</p>';\r\n\t\t$text.='</li>';\r\n\t\r\n\t\t}\r\n\t\techo $text;\r\n\t}", "public function adminComment () {\n\t\t$req = $this->db->query('SELECT * , DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS commentDate FROM comment');\n\t\twhile ($data = $req->fetch())\n {\n \t$comments[]= new Comment($data); \n }\n if(isset($comments)){\n \treturn $comments;\n }\n\t \n\t}", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "public function getCommentsInfoByPostId($id) {\n $this->db->query('SELECT\n users.name,\n comments.content, posts.id AS postId,\n users.id AS userId,\n comments.id AS commentId,\n posts.created_at AS postCreated,\n users.created_at AS userCreated,\n comments.created_at AS commentCreated\n FROM\n comments\n INNER JOIN\n posts\n ON\n comments.post_id = posts.id\n INNER JOIN\n users\n ON\n comments.user_id = users.id\n WHERE \n comments.post_id = :id\n ORDER BY comments.created_at\n DESC;\n ');\n \n $this->db->bind(':id', $id);\n\n $result = $this->db->resultSet();\n\n return $result;\n }", "function allComment($errorId, $time){\n \t$con = new mysqli('localhost','heng','@powell135','200ok');\n \tif ($con -> connect_errno){\n \t\treturn CONNECTION_FAIL;\n \t}\n \t$query = \"select comment, time, screenShot, username, id from jnjn_comment where errorId = '$errorId' and time < '$time' order by time DESC limit 20\";\n \t$result = $con -> query($query);\n \t$comments = array();\n \t$i = 0;\n \twhile ($row = mysqli_fetch_array($result)) {\n \t\t$comments[] = new Comment($row['comment'],$row['time'],$row['screenShot'],$row['username'], $row['id']);\n \t}\n \t$result -> close();\n \treturn $comments;\n }", "public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }", "function get_comment_id_fields($post = \\null)\n {\n }", "public function getAllComments($rid) {\n $this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id \n WHERE recipe_id = :rid ORDER BY date DESC');\n $this->db->bind(':rid', $rid);\n return $this->db->resultSet();\n }", "function comments($post_id)\n {\n $data = $this->Post_model->basic($post_id);\n $data['table_id'] = 2000; //Código tabla posts\n\n $data['view_a'] = 'posts/comments_v';\n $this->App_model->view(TPL_ADMIN, $data);\n }", "public function getUserComments($userId) {\n $result = $this->WIdb->select(\n \"SELECT * FROM `WI_comments` WHERE `posted_by` = :id\",\n array (\"id\" => $userId)\n );\n\n return $result;\n }", "public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }", "private function lstComChap($idchap){\n\t\t\t$commentaires = $this->com->getLastCom($idchap);\n\t\t\t\t\n\t\t\techo $commentaires;\n\t\t}", "function obtenerComentariosPublicaciones($id){\n // $var_id_usuario = $idUsuario;\n //PASO 2: Incluimos archivo de conexión\n include(\"C:/xampp/htdocs/facebook/database/mysqli.inc.php\");\n //PASO 3: Definimos sentencia SQL\n $sentenciaMYSQL=\"SELECT commentario_id,commentario, last_update FROM facebook.commentario where post_id=\".$id.\" ORDER BY commentario_id ASC\";\n \n //PASO 4: En caso de obtener correctamente los datos iniciamos el bloque. En caso contratio indicamos el error.\n if($resultado = $objetoMySQLi->query($sentenciaMYSQL)){ \n //PASO 5: Si existen datos de resultado iniciamos la obtención de datos. Si no hay datos enviamos un mensaje.\n if($objetoMySQLi->affected_rows>0){ \n $i=0;\n //PASO 6 : Se efectúa una iteración para incorporar al arreglo los datos obtenidos.\n while($fila = $resultado->fetch_assoc()){\n //PASO 7 : Se incorporan los datos al arreglo\n $arreglo[$i]=array($fila['commentario_id'],$fila['commentario'],$fila['last_update']);\n $i++;\n }\n //PASO 8: Retornamos el arreglo.\n return $arreglo;\n }else{ \n echo \"Sin Comentarios...\"; \n } \n }else{ \n echo \"<br>No ha podido realizarse la consulta. Ha habido un error<br>\"; \n echo \"<i>Error:</i> \". $objetoMySQLi->error. \"<i>Código:</i> \". $objetoMySQLi->errno; \n } \n $objetoMySQLi->close(); \n }", "function get_comments($post_id){\n include('../../common/database/config.php');\n\n $sql = 'SELECT c.id,c.content,c.created_time,u.name FROM comments as c \n LEFT JOIN users as u on c.user_id = u.id\n where c.post_id = \"'.$post_id.'\"';\n $res = mysqli_query($conn,$sql);\n\n $res_array = mysqli_fetch_all($res, MYSQLI_ASSOC);\n\n return $res_array;\n}", "public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }", "public function getById($id)\n {\n return $this->comment\n ->where('id', $id)\n ->get();\n }", "function get_comments(){\n\n\t}", "function view_comments($album_id){\n $album_id = (int)$album_id;\n $comments = array();\n $query = mysql_query(\"SELECT * FROM comments WHERE album_id = $album_id\");\n\n while($comment_row = mysql_fetch_assoc($query)){\n $comments[] = array(\n 'id' => $comment_row['comment_id'],\n 'user_id' => $comment_row['user_id'],\n 'comment' => $comment_row['comment'],\n 'timestamp' => $comment_row['timestamp']\n );\n }\n return $comments;\n }", "public function getCommentsList($idArticle)\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'SELECT `comment`.`id`, `content`, `date`, `id_User`, `pseudo`, `avatar`, `id_Article`\r\n FROM `comment`\r\n LEFT JOIN `user`\r\n ON `comment`.`id_User` = `user`.`id`\r\n WHERE `id_Article` = :id_Article\r\n ORDER BY `date`'\r\n );\r\n $pdoStatment->bindValue(':id_Article', $idArticle, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $pdoStatment->fetchAll(PDO::FETCH_OBJ);\r\n }", "function tempera_list_comments() {\t\n\t\t\t\t\twp_list_comments( array( 'callback' => 'tempera_comment' ) );\n\t\t\t}", "public function showComments(){\n if (isset($_GET['id'])) {\n $postId = $_GET['id'];\n $postRepository = new PostRepository();\n //call to readById\n $post = $postRepository->readById($postId);\n $commentRepository = new CommentRepository();\n $commentlist = $commentRepository->getComments($postId);\n $this->commentView($post, $commentlist);\n }\n }", "function getComments($conn){\r\n $sql = \"SELECT * FROM comments ORDER BY cid DESC LIMIT 20\";\r\n $result = $conn->query($sql);\r\n while ($row = $result->fetch_assoc()){\r\n echo \"<div class='comment-box'><p>\";\r\n echo $row['uid'].\"<br>\";\r\n echo $row['date'].\"<br>\";\r\n echo nl2br($row['message']);\r\n echo \"</p></div>\";\r\n }\r\n \r\n}", "public function delCommentaire($idCommentaire)\n {\n $ids = implode(\",\",array_map('intval',$_POST['id_del']));\n $sql = 'SELECT COUNT(*) FROM commentaires WHERE id IN(' . $ids . ')';\n $nbSuppr = $this->executerRequete($sql, array());\n $sql = 'SELECT COUNT(*) FROM commentaires WHERE abusif=1';\n $nbTotalAbusif = $this->executerRequete($sql, array());\n $sql = 'DELETE FROM commentaires WHERE id IN(' . $ids . ')';\n $this->executerRequete($sql, array($idCommentaire));\n $tab=array($nbSuppr,$nbTotalAbusif);\n return $tab;\n }", "private function load() {\n\t\t\t$comments = array();\n\t\t\t\n\t\t\t$this->db->where('itemid', $this->itemid);\n\t\t\t$rows = $this->db->get('comments');\n\t\t\t\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$comments['author'] = $row['author'];\n\t\t\t\t$comments['via'] = $row['via'];\n\t\t\t\t$comments['date'] = $row['date'];\n\t\t\t\t$comments['comment'] = $row['comment'];\n\t\t\t\t$comments['avatar'] = $row['avatar'];\n\t\t\t\t$this->data[] = $comments;\n\t\t\t}\n\t\t}", "public function comment($id)\n {\n $comments=Question::where('url_id',$id)->get();\n return view('summary.comments',compact('comments',$comments));\n }" ]
[ "0.730391", "0.7279076", "0.7274053", "0.7138294", "0.7096878", "0.7080956", "0.6997329", "0.6934673", "0.6744257", "0.6740269", "0.6723633", "0.669541", "0.6674506", "0.66674006", "0.66173464", "0.66140264", "0.65997833", "0.65859944", "0.6585176", "0.6576593", "0.65737206", "0.6568718", "0.6542619", "0.6490162", "0.6471477", "0.64452344", "0.6421555", "0.64146364", "0.64120173", "0.641021", "0.64083725", "0.6383631", "0.6383597", "0.6382339", "0.63761187", "0.6373326", "0.6372838", "0.634917", "0.63383156", "0.63093764", "0.63061094", "0.6303031", "0.6299764", "0.62995535", "0.62988913", "0.62742436", "0.62690836", "0.6260481", "0.62593704", "0.6246461", "0.6241742", "0.62404484", "0.6239755", "0.6232201", "0.6222455", "0.6213935", "0.6212775", "0.62102854", "0.6207404", "0.6205885", "0.6201697", "0.6188097", "0.61843294", "0.6183211", "0.6179491", "0.61635065", "0.61632895", "0.6163279", "0.61610544", "0.6150984", "0.6140965", "0.61326456", "0.61320347", "0.6118641", "0.6115213", "0.6115085", "0.61081743", "0.61040735", "0.60934085", "0.6092953", "0.6083208", "0.6076031", "0.6075112", "0.6074659", "0.60736644", "0.60610735", "0.60598874", "0.6054703", "0.60538083", "0.60248405", "0.60218394", "0.60190284", "0.60183924", "0.6008168", "0.6005958", "0.6003841", "0.5988875", "0.5984343", "0.59843206", "0.59839094", "0.5983083" ]
0.0
-1
Ajouter un commentaire en BDD
public function postComment($postId, $author, $comment) { $db = $this->dbConnect(); $comments = $db->prepare('INSERT INTO comments(post_id, author, comment, comment_date) VALUES(?, ?, ?, NOW())'); $affectedLines = $comments->execute(array($postId, $author, $comment)); return $affectedLines; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function create($comment)\n {\n\n }", "function addComment($id){\n $newComment = $this->commentManager->postComment($id, $_POST['author'], $_POST['comment']);\n if($newComment === false){\n throw new \\Exception(\"Impossible d'ajouter le commentaire\");\n } else {\n header('Location: /episode/'.$id);\n }\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function ajoutCommentaire(SetUpComment $ajout)\n {\n\n $message = $ajout->getMessage();\n $note = $ajout->getNote();\n $login = $_SESSION['login'];\n $film = $ajout->getFilm();\n try\n {\n $bdd= new PDO('mysql:host=localhost;dbname=cinemaphp;charset=utf8','root','');\n }\n catch(Exception $e)\n {\n die('Erreur:'.$e->getMessage());\n }\n\n $req = $bdd->prepare('INSERT INTO comment (message,login,note,film) VALUES (?,?,?,?)');\n $req -> execute(array($message,$login,$note,$film));\n\n\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function add(Comment $comments)\n {\n $query = $this->db->pdo->prepare('INSERT INTO comments(idnews, idparent, niveau, moderate, content, membre, addDate) VALUES (:idnews, :idparent, :niveau, :moderate, :content, :membre, NOW())');\n $query->bindValue(':idnews', $comments->idnews(), PDO::PARAM_INT);\n $query->bindValue(':idparent', $comments->idparent(), PDO::PARAM_INT);\n $query->bindValue(':niveau', $comments->niveau(), PDO::PARAM_INT);\n $query->bindValue(':moderate', $comments->moderate(), PDO::PARAM_INT);\n $query->bindValue(':content', $comments->content(), PDO::PARAM_STR);\n $query->bindValue(':membre', $comments->membre(), PDO::PARAM_STR);\n\n $query->execute();\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }", "public function testCreateComment() {\n // Find any active product\n $product = ShopProduct::model()->published()->find();\n $this->assertTrue($product instanceof ShopProduct);\n\n $email = '[email protected]';\n $text = 'this is test comment' . microtime();\n\n // Open product page and post comment\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->type('id=Comment_name', 'tester');\n $this->type('id=Comment_email', $email);\n $this->type('id=Comment_text', $text);\n $this->clickAndWait(\"//input[@value='Отправить']\");\n\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->assertTrue($this->isTextPresent('Ваш комментарий успешно добавлен. Он будет опубликован после проверки администратором.'));\n\n $this->adminLogin();\n $this->open('/admin/shop/products/update?id=' . $product->id);\n $this->click('xpath=//a[contains(.,\"Отзывы\")]');\n $this->assertTrue($this->isTextPresent($email));\n $this->assertTrue($this->isTextPresent($text));\n }", "public function testAdd() {\n $data = array(\n 'fileId' => 1,\n 'version' => 1,\n 'comment' => 'New Comment',\n 'author' => 2,\n );\n\n $comments = new Application_Model_Comments();\n $id = $comments->add($data);\n $comment = $comments->find($id);\n\n $this->assertEquals($id, $comment->id);\n $this->assertEquals($data['fileId'], $comment->fileId);\n $this->assertEquals($data['version'], $comment->version);\n $this->assertEquals($data['comment'], $comment->comment);\n $this->assertEquals($data['author'], $comment->author);\n }", "public function testCreateComment(){\n $parameters = [\n 'commenting_username' => 'ridho',\n 'id_post' => 1,\n 'komentar' => 'keren, lanjutkan!'\n ];\n\n $this->post(\"/api/v1/komentar\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_komen',\n 'commenting_username',\n 'id_post',\n 'komentar',\n 'tanggal'\n ]\n ]\n );\n }", "public function actionAddcomment(){\n if(isset($_POST['text'])){\n $comment = new Comment();\n $comment->text = $_POST['text'];\n $comment->id_trainingentry = $_POST['id_trainingentry'];\n $comment->id_user = Yii::app()->user->id;\n $comment->id_visibility = $_POST['id_visibility'];\n $comment->date = date('Y-m-d G:i:s');\n $comment->seen = 0;\n \n $user = User::model()->findByPk(Yii::app()->user->id);\n \n header('Content-Type: text/xml');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n echo '<response>';\n echo '<validation>';\n if($comment->save()){\n echo 'ok';\n echo '</validation>';\n echo $this->createXmlComment($user, $comment);\n }else{\n echo 'error';\n echo '</validation>';\n }\n echo '</response>';\n }\n }", "public function addCommentAction()\n {\n /** @var Facepalm_Model_Row_Comment $comment */\n\n $this->_helper->assertHasParameter('point_id');\n\n $form = new Facepalm_Form_Comment();\n\n if($this->getRequest()->isPost()) {\n $post = $this->getRequest()->getPost();\n\n if($form->isValid($post)) {\n $comments = new Facepalm_Model_Comments();\n $comment = $comments->createRow($form->getValues());\n\n $form->persist($this->getCurrentUser(), $comment);\n\n $this->_helper->sendNotifications(\n $comment, $this->getCurrentUser()\n );\n\n $form->reset();\n }\n }\n\n $points = new Facepalm_Model_Points();\n $point = $points->find($this->_getParam('point_id'))->current();\n\n $form->getElement('point_id')->setValue($point->id);\n\n $this->view->point = $point;\n $this->view->form = $form;\n\n $this->_helper->layout->disableLayout();\n }", "public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function createCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('INSERT INTO commentaires(id_jeu)VALUE(?)');\n $req->execute(array($id));\n return $req;\n }", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function ajouterCommentaire($auteur, $contenu, $idBillet) {\r\n $sql = 'insert into t_commentaire(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)'\r\n . ' values(?, ?, ?, ?)';\r\n $date = date('Y-m-d H:i:s'); // Récupère la date courante\r\n $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet));\r\n }", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "Public function addComment(Request $request){\n // return $id;\n\n $this->validate($request,[ \n 'comment' => 'required', \n ],\n\n [\n 'comment.required' => ' اجرات خود را بنویسید ',\n ]);\n\n $user_id = Auth::user()->id;\n $comment = new AhkamComment;\n $comment->comment = $request->comment;\n $comment->ahkam_id = $request->ahkam_id;\n $comment->user_id = $user_id;\n DB::transaction(function() use ($comment) {\n $comment->save();\n });\n //to generate its notifications\n Helper::add_noti('Ahkam', $comment->id, $comment->ahkam_id);\n $request->session()->flash('alert-success', ' اجرات شما افزوده شد ' );\n return redirect()->back();\n \n }", "function addComment($franchise_id, $user_id, $comments) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"INSERT INTO \" . $db_table_prefix . \"comments (\n\t\tuser_id,\n\t\tfranchise_id,\n\t\tcomments,\n\t\tdate\n\t\t)\n\t\tVALUES (\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t'\" . time() . \"'\n\t\t)\");\n $stmt->bind_param(\"sss\", $user_id, $franchise_id, $comments);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n}", "public function ajouterCommentaire($auteur, $contenu, $idBillet) {\n $auteur = htmlspecialchars($auteur);\n $contenu = htmlspecialchars($contenu);\n $sql = 'insert into T_COMMENTAIRE(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)'\n . ' values(?, ?, ?, ?)';\n $date = date('Y-m-d H:i:s'); // Récupère la date courante\n $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet));\n }", "public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }", "private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }", "abstract protected function add(Comment $comment);", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "function addAction($postId, $author, $comment)\n{\n\n // if ($affectedLines === false) {\n // // Erreur gérée. Elle sera remontée jusqu'au bloc try du routeur !\n // throw new Exception('Impossible d\\'ajouter le commentaire !');\n // }\n // else {\n // header('Location: index.php?action=post&id=' . $postId);\n // }\n echo \"ajoute un commentaire\";\n}", "public function commentAction ()\n {\n /* @var $user User */\n $user = $this->getUser();\n if(!$user) {\n throw new UnauthorizedHttpException('You must be logged in to comment.');\n }\n \n $request = $this->getRequest();\n \n $decklist_id = filter_var($request->get('id'), FILTER_SANITIZE_NUMBER_INT);\n $decklist = $this->getDoctrine()\n ->getRepository('NetrunnerdbBuilderBundle:Decklist')\n ->find($decklist_id);\n \n $comment_text = trim(filter_var($request->get('comment'), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));\n if ($decklist && ! empty($comment_text)) {\n $comment_text = preg_replace(\n '%(?<!\\()\\b(?:(?:https?|ftp)://)(?:((?:(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)(?:\\.(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)*(?:\\.[a-z\\x{00a1}-\\x{ffff}]{2,6}))(?::\\d+)?)(?:[^\\s]*)?%iu',\n '[$1]($0)', $comment_text);\n \n $mentionned_usernames = array();\n if(preg_match_all('/`@([\\w_]+)`/', $comment_text, $matches, PREG_PATTERN_ORDER)) {\n $mentionned_usernames = array_unique($matches[1]);\n }\n \n $comment_html = Markdown::defaultTransform($comment_text);\n \n $now = new DateTime();\n \n $comment = new Comment();\n $comment->setText($comment_html);\n $comment->setCreation($now);\n $comment->setAuthor($user);\n $comment->setDecklist($decklist);\n \n $this->get('doctrine')\n ->getManager()\n ->persist($comment);\n $decklist->setTs($now);\n $decklist->setNbcomments($decklist->getNbcomments() + 1);\n\n $this->get('doctrine')\n ->getManager()\n ->flush();\n \n // send emails\n $spool = array();\n if($decklist->getUser()->getNotifAuthor()) {\n if(!isset($spool[$decklist->getUser()->getEmail()])) {\n $spool[$decklist->getUser()->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_author.html.twig';\n }\n }\n foreach($decklist->getComments() as $comment) {\n /* @var $comment Comment */\n $commenter = $comment->getAuthor();\n if($commenter && $commenter->getNotifCommenter()) {\n if(!isset($spool[$commenter->getEmail()])) {\n $spool[$commenter->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_commenter.html.twig';\n }\n }\n }\n foreach($mentionned_usernames as $mentionned_username) {\n /* @var $mentionned_user User */\n $mentionned_user = $this->getDoctrine()->getRepository('NetrunnerdbUserBundle:User')->findOneBy(array('username' => $mentionned_username));\n if($mentionned_user && $mentionned_user->getNotifMention()) {\n if(!isset($spool[$mentionned_user->getEmail()])) {\n $spool[$mentionned_user->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_mentionned.html.twig';\n }\n }\n }\n unset($spool[$user->getEmail()]);\n \n $email_data = array(\n 'username' => $user->getUsername(),\n 'decklist_name' => $decklist->getName(),\n 'url' => $this->generateUrl('decklist_detail', array('decklist_id' => $decklist->getId(), 'decklist_name' => $decklist->getPrettyname()), TRUE) . '#' . $comment->getId(),\n 'comment' => $comment_html,\n 'profile' => $this->generateUrl('user_profile', array(), TRUE)\n );\n foreach($spool as $email => $view) {\n $message = \\Swift_Message::newInstance()\n ->setSubject(\"[NetrunnerDB] New comment\")\n ->setFrom(array(\"[email protected]\" => $user->getUsername()))\n ->setTo($email)\n ->setBody($this->renderView($view, $email_data), 'text/html');\n $this->get('mailer')->send($message);\n }\n \n }\n \n return $this->redirect($this->generateUrl('decklist_detail', array(\n 'decklist_id' => $decklist_id,\n 'decklist_name' => $decklist->getPrettyName()\n )));\n \n }", "public function actionAdd()\n {\n $apiName = 'comment/add';\n $sessionId = null;\n \n $_JSON = $this->getJsonInput();\n \n try\n {\n if(!isset($_JSON) || empty($_JSON))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'No input received.');\n else if(!isset($_JSON['sessionId']) || empty($_JSON['sessionId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter session id.');\n else if(!isset($_JSON['postId']) || empty($_JSON['postId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter post id.');\n else if(!isset($_JSON['comment']) || empty($_JSON['comment']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter your comment.');\n else\n {\n $userId = $this->isAuthentic($_JSON['sessionId']);\n $user = User::model()->findByPk($userId);\n if (is_null($user))\n $result = $this->error($apiName, WS_ERR_WONG_USER, 'Please login before using this service.');\n else\n {\n $postId = filter_var($_JSON['postId'], FILTER_SANITIZE_NUMBER_INT);\n $post = Post::model()->findByPk($postId);\n if (is_null($post))\n $result = $this->error($apiName, WS_ERR_WONG_VALUE, 'Selected post does not exist.');\n else\n {\n $comment = new Comment('add_api');\n $comment->userId = $userId;\n $comment->postId = $postId;\n $comment->postUserId = $post->userId;\n $comment->comment = trim(mb_convert_encoding( $_JSON['comment'], \"UTF-8\", \"BASE64\" ));\n \n// $comment->comment = filter_var(base64_decode($_JSON['comment']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n// $comment->comment = $_JSON['comment'];\n //$comment->comment = filter_var($_JSON['comment'], FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n //save record\n $comment->save();\n \n $ignore_user = array(); \n \n if(isset($_JSON['userMentioned']) && count($_JSON['userMentioned']) > 0){\n \tforeach ($_JSON['userMentioned']as $userM){\t\n\t \t$userMentioned = new UserMentioned();\n\t \t$userMentioned->userId = filter_var($userM['userId'], FILTER_SANITIZE_NUMBER_INT);\n// \t \t$userMentioned->userName = filter_var(base64_decode($userM['userName']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n\t \t$userMentioned->userName = $userM['userName'];\n\t \t$userMentioned->postId = $postId;\n\t \t$userMentioned->commentId = $comment->id;\n\t \t$userMentioned->save();\n\t \tEvent::saveEvent(Event::USER_MENTIONED_COMMENT, $userId, $comment->postId, $comment->createDate, $userMentioned->userId);\n\t \t$ignore_user[] = $userMentioned->userId;\n \t}\n }\n \n \n \n\n \n if ($comment->hasErrors()) \n {\n throw new Exception(print_r($comment->getErrors(), true), WS_ERR_UNKNOWN);\n }\n \n //save event\n if($post->type == 'question'){\n \t$eventtype = 14;\n \t$message1 = $user->userName.' answered your question.';\n }\n else{\n \t$eventtype = Event::COMMENT_CREATED;\n \t$message1 = false;\n }\n \n Event::saveEvent($eventtype, $userId, $comment->postId, $comment->createDate, $post->userId);\n \n $ignore_user[] = $post->userId;\n $sql = 'SELECT DISTINCT userId FROM `comment` WHERE postId = '.$postId;\n \n $user_comments = Yii::app()->db->createCommand($sql)->queryAll(true);\n \n \n// var_dump($post->user->userName);\n \n if($post->type == 'question'){\n \t$eventtype = 15;\n \t$message1 = $user->userName.' also answered '.$post->user->userName.\"'s question.\";\n }\n else{\n \t$eventtype = 12;\n \t$message1 = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n }\n \n// $message = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n \n \n foreach ($user_comments as $comm){\n \t\n \tif(!in_array($comm['userId'], $ignore_user))\n// \t\t Event::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId']);\n \t\tEvent::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId'], $message1 );\n }\n \n //send notifications to followers of the post user\n// $sql = Follower::getQueryForFollower($post->userId);\n// $sql .= \" AND (s.deviceToken is not null OR s.deviceToken!='')\";\n// $followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// $message = $user->userName . ' has commented on a post.';\n// \n// foreach($followers as $follower)\n// {\n// $session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// if($session)\n// {\n// $session->deviceBadge += 1;\n// $session->save();\n// sendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// }\n// }\n \n $imagePath = Yii::app()->getBaseUrl(true) . '/images/user/';\n $thumbPath = Yii::app()->getBaseUrl(true) . '/images/user/thumb/';\n \n $sql = Comment::getQuery($imagePath, $thumbPath, $postId);\n $sql .= ' AND c.id=' . $comment->id;\n $newComment = Yii::app()->db->createCommand($sql)->queryRow(true);\n $newComment['timeElapsed'] = getTimeElapsed(date_create($newComment['createDate']), date_create($newComment['currentDate']));\n $newComment['userMentioned'] = UserMentioned::getUserByComment($newComment['id']);\n \n \n $result = array(\n 'api' => $apiName,\n 'apiMessage' => 'Comment saved successfully.',\n 'status' => 'OK',\n 'commentId' => $comment->id,\n 'comment' => $newComment\n );\n }\n }\n }\n } \n catch (Exception $e)\n {\n $result = $this->error($e->getCode(), Yii::t('app', $e->getMessage()),'TSASTT');\n }\n $this->sendResponse(json_encode($result, JSON_UNESCAPED_UNICODE));\n }", "public function testCollectionTicketCommentsAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function create(): string\n\t{\n\t\t$user = $this->user;\n\n\t\tif ($user->users_group_id == 1 ) {\n\t\t\t$status = ucfirst($this->request->post('status'));\n\t\t}else {\n\t\t\t$status = $this->settings;\n\t\t\t$status = $status->get('commentaires_status');\n\t\t}\n\n\t\t$this->data('user_id', $user->id)\n\t\t\t ->data('episode_id', $this->request->post('episode_id'))\n\t\t\t ->data('comment', ucfirst($this->request->post('details')))\n\t\t\t ->data('email', $user->email)\n\t\t\t ->data('created', $now = time())\n\t\t\t ->data('status', $status)\n\t\t\t ->data('reported', 0)\n\t\t\t ->data('ip', $this->request->server('REMOTE_ADDR'))\n\t\t\t ->insert('comments');\n\n\t\t$successMessage = 'votre commentaire est ajouté avec succèss .';\n\n\t\treturn $successMessage;\n\t}", "public function addCommentAction($parent=null)\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $post = $this->getQuestionById($parent);\n \n if($post[0]['commentTypeId'] == 1){\n $qid = $post[0]['id'];\n }\n else {\n $qid = $post[0]['questionId'];\n }\n \n $qt = $post[0]['title'];\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera kommentar',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, questionId, parentId, userId, userAcronym, userEmail, title, text, created) VALUES ('3', '\" . $qid . \"','\" . $parent . \"','\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $qt . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qw = '/question/view/' . $qid;\n $url = $this->url->create('') . $qw;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n\n $this->views->add('comment/view_single_post', [\n 'presentation' => $post\n ]);\n \n $this->theme->setTitle(\"Skriv en kommentar\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skriv en kommentar\",\n 'content' => $form->getHTML()\n ]);\n }\n }", "public function actionAddComment()\n {\n $profile = (new UsersProfile())->getProfile();\n $model = new Comment();\n $model->task_id = Yii::$app->request->get('task_id');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->task_id]);\n }\n\n return $this->render('add-comment', \\compact('model', 'profile'));\n }", "public function addComment(Request $request, $id){\n\n $comments = new comment();\n $comments->uid = Auth::user()->id;\n $comments->statusId = $id;\n $comments->comment = $request['comment'];\n \n $comments->save();\n return back();\n }", "public function actionAddVehicleCommentInd(){\t \n\t date_default_timezone_set(\"Europe/London\");\n\t \n\t // Gets basic vehicle info used in the save\n\t $vehicle = Vehicles::model()->getBasicInfo($_POST['vehicle_id']);\n\t \n\t // Adds the vehicle comment\n\t $vC = new VehicleComments();\n\t $vC->added_by = Yii::app()->user->id;\n\t $vC->comment = $_POST['comment'];\n\t $vC->date_added = date(\"Y-m-d H:i:s\");\n\t $vC->vehicle_id = $_POST['vehicle_id'];\n\t $vC->make_model_id = $vehicle['make_model_id'];\n\t $vC->save();\n\t}", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }", "public function create() {\n\n // Validate blog id in $_GET\n $validator = new \\Validator('GET');\n $validator->required()->integer()->validate('id');\n\n // If error occured return false\n if ($validator->hasErrors()) {\n return false;\n }\n\n // Validate comment\n $this->validator->required()->validate('comment');\n\n // If error occured return false\n if ($this->hasErrors()) {\n return false;\n }\n\n // Get blog to assing comment\n $blog = $this->em->find('Alt68\\Entities\\Blog', $_GET['id']);\n\n // If not find blog return false\n if (!$blog) {\n return false;\n }\n\n // Get commenter user to assing comment\n $commenter = $this->em->find('Alt68\\Entities\\User', $_SESSION['user']['id']);\n\n // If not find commenter return false\n if (!$commenter) {\n return false;\n }\n\n // Create new comment\n $newComment = new Comment();\n\n $newComment->setComment($_POST['comment']);\n $newComment->setBlog($blog);\n $newComment->setCommenter($commenter);\n $newComment->setCreated(new \\DateTime(\"now\"));\n\n $this->em->persist($newComment);\n $this->em->flush();\n\n return true;\n }", "public function doCreateComment()\n {\n if (isset($_POST)) {\n if (!$this->comment_is_valid($_POST['text'])) {\n header('Location: /post/details/?id=' . $_POST['post_id']);\n exit();\n }\n $text = htmlspecialchars($_POST['text']);\n $post_id = $_POST['post_id'];\n $this->commentRepository->create($_SESSION['userid'], $text, $post_id);\n }\n }", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function createComment(Request $request) {\n // get the post that the user commented on\n $post = Post::find($request['postid']);\n echo 'hello'. $request;\n\n // create a new comment\n $comment = new Comment();\n $comment->name = $request['name'];\n $comment->content = nl2br($request['content']);\n $comment->post_id = $post->id;\n $comment->save();\n\n // save the comment with a relation to the post\n //$post->comments()->save($comment);\n\n // go back to the post\n return Redirect()->route('viewPost', ['id' => $post->id]);\n }", "public function action_create($atr = null, $event_id = null)\n {\n if (Auth::has_access('comment.create'))\n {\n is_null($atr) and Response::redirect('/');\n is_null($event_id) and Response::redirect('/');\n\n $this->template->page_title = 'Pievieno komentāru!';\n $this->template->content = View::forge('comment/create');\n if ($atr == 'w' )\n {\n // 'whole' stands for comment to whole event\n $this->template->content->form_title = 'Pievieno komentāru pasākumam';\n }\n elseif ($atr == 'l')\n {\n // 'l' stands for comment to event location\n $this->template->content->form_title = 'Pievieno komentāru norises vietai';\n }\n elseif ($atr == 'd')\n {\n // 'd' stands for comment to event date\n $this->template->content->form_title = 'Pievieno komentāru norises laikam';\n }\n elseif ($atr == 'p')\n {\n // 'p' stands for comment to event participants\n $this->template->content->form_title = 'Pievieno komentāru dalībnieku skaitam';\n }\n elseif ($atr == 'f')\n {\n // 'f' stands for comment to event fee\n $this->template->content->form_title = 'Pievieno komentāru dalības maksai';\n }\n elseif ($atr == 't')\n {\n // 't' stands for comment to event takeaway\n $this->template->content->form_title = 'Pievieno komentāru līdzi ņemamajām lietām';\n }\n elseif ($atr == 'dc')\n {\n // 'dc' stands for comment to event dress code\n $this->template->content->form_title = 'Pievieno komentāru ģebšanās sitlam';\n }\n elseif ($atr == 'a')\n {\n // 'a' stands for comment to event assistants\n $this->template->content->form_title = 'Pievieno komentāru nepieciešamajiem palīgiem';\n }\n\n if (Input::method() == 'POST')\n {\n // comment submited, validate it\n if (Input::post('comment') and Input::post('comment') != '')\n {\n // check if comment isn't too long\n if (strlen(Input::post('comment')) <= 300)\n {\n // comments length is valid, create it\n $user_id = Auth::instance()->get_user_id();\n $user_id = $user_id[1];\n\n $comment = array(\n 'author_id' => $user_id,\n 'event_id' => $event_id,\n 'attribute' => $atr,\n 'message' => Input::post('comment'),\n 'created_at' => Date::time()->get_timestamp()\n );\n\n $new_comment = Model_Orm_Comment::forge($comment);\n $new_comment->save();\n\n Session::set_flash('success', 'Komentārs veiksmīgi pievienots');\n Response::redirect('event/view/'.$event_id);\n }\n else\n {\n // comment too long\n $errors[] = 'Komentāra ziņa nevar būt garāka par 300 simboliem!';\n Session::set_flash('errors', $errors);\n }\n }\n else\n {\n // comment not set\n $errors[] = 'Ievadi komentāru!';\n Session::set_flash('errors', $errors);\n }\n }\n }\n else\n {\n Response::redirect('/');\n }\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function createCommentary(){\n $sql='INSERT INTO comentarios (comentario, idProducto, idCliente, estado) VALUES (? , ? , ?, 1)';\n $params=array($this->comentario, $this->id, $this->cliente);\n return Database::executeRow($sql, $params);\n }", "function addComment($chapterId)\r\n\t{\r\n\t\t$commentManager = new CommentManager();\r\n\t\t\r\n\t\trequire_once('view/insertCommentView.php');\r\n\t}", "public function createAction()\n\t{\n\t\t$this->_helper->acl->authorizeUser(new Application_Model_Comment(), 'create', 'You are not allowed to create a new comment');\n\n\t\tif ($this->_request->isPost()) {\n\t\t\t$form = $this->getCreateForm();\n\n\t\t\tif (!$form->isValid($_POST)) {\n\t\t\t\t$this->sendJsonFormError($form);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data = new Application_Model_Comment();\n\t\t\t$data->id_user = $this->_user->getId();\n\t\t\t$data->comment = $_POST['comment'];\n\t\t\t$data->comment_type = $_POST['comment_type'];\n\n\t\t\t$r = $this->_commentMapper->save($data);\n\n\t\t\t$url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'comment', 'action' => 'index'));\n\t\t\t$this->_redirect($url);\n\t\t}\n\t}", "public function actionAdd() {\n $request = Yii::$app->request;\n $db = new Connection(Yii::$app->db);\n if (!is_null($request)) { //check wheter request exist or not\n $ip = $request->post('ip');\n $comment = $request->post('comment');\n $db->createCommand()->insert('discuss', [\n 'ip' => $ip,\n 'comment' => $comment,\n ])->execute();\n return json_encode([\"status\" => \"passed\"]);\n } else {\n return json_encode([\"status\" => \"failed\"]);\n }\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "function add_comments()\n {\n $result = $this->comment->verify_comment();\n if($result != NULL)\n {\n $this->session->set_flashdata('errors', $result);\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n else\n {\n $this->comment->add_comment($this->input->post(NULL, TRUE));\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n\n }", "public function addComment(){\n\t\t try{\n\t\t\t $conn=DBConnection::getConnection();\t\t\t \n\t\t\t \t\t\t \n\t\t\t $insertQuery=\"INSERT INTO comment(comment_description,comment_date,news_id,user_name)VALUES(:des,:com_date,:newsId,:user)\";\n\t\t\t $cmd=$conn->prepare($insertQuery);\n\t\t\t \n\t\t\t $cmd->bindValue(':des',$this->getCommentDescription(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':com_date',$this->getCommentDate(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':newsId',$this->getNewsId(),PDO::PARAM_INT);\n\t\t\t $cmd->bindValue(':user',$this->getUserName(),PDO::PARAM_STR);\n\t\t\t \n\t\t\t $returnedValue=$cmd->execute(); //Returns TRUE on success or FALSE on failure\n\t\t\t return $returnedValue;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "function postComment() {\n $username = $_POST['username'];\n $content = $_POST['content'];\n $commentDate = $_POST['commentDate'];\n $repliedCommentId = null;\n \n if (array_key_exists('repliedCommentId', $_POST)) {\n $repliedCommentId = $_POST['repliedCommentId'];\n }\n\n $response = insertComment($username, $content, $commentDate, $repliedCommentId);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function testCommentReceivedValid()\n {\n $user = factory(User::class)->create();\n $post = factory(Post::class)->create([\n 'author_id'=>$user->id\n ]);\n\n\n Mail::fake();\n\n $this->actingAs($user)->post('/posts/'.$post->id. '/comments',\n ['text'=>'this is some text more then fif..',\n 'author'=>'some_name']);\n\n Mail::assertSent(CommentReceived::class, function($mail) use ($post){\n return $mail->post->id === $post->id;\n });\n }", "public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function testCreateTaskComments()\n {\n }", "public function createComment(): CommentableInterface;", "public function setNewComment($t,$c,$u)\n {\n /* $response = $this->bddObject->query(\"INSERT INTO Commentaire (texte, post_id, membre_id) VALUES (:texte, :membre_id, :post_id)\"); */\n $newComment = $this->bddObject->prepare(\"INSERT INTO Commentaire (texte, post_id, membre_id) VALUES (:texte, :membre_id, :post_id)\");\n //passer paramètre en variable pas en string\n //$test=1;\n $newComment->bindParam(':texte',$t);\n $newComment->bindParam(':membre_id',$u);\n $newComment->bindParam(':post_id',$c);\n $newComment->execute();\n }", "public function insertComment($comment, $userid, $username, $profile_image_url, $battle_id, $date) {\n\n $stmt = $this->db->query(\"INSERT INTO comments (comment, userid, created_at, battle_id) VALUES ('$comment', '$userid', '$date', $battle_id)\");\n $stmt->execute();\n }", "public function addComment(Request $request, $id){\n $mess = $request->input('comment'); \n $email = \\Auth::user()->email;\n $user_data = User::all()->where('email', $email)->first();\n $blog_data = Blog::all()->where('user_id', $user_data[\"id\"])->first();\n \n Comment::create([\n 'user_id' => $user_data[\"id\"],\n 'blog_id' => $blog_data[\"id\"],\n 'comment_body' => trim($request->comment)\n ]);\n\n return redirect()->route('allblogs');\n }", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "private function addComment()\n {\n try\n {\n $request = $_POST;\n global $myquery;\n \n $valid_types = array('v','video','videos','t','topic','topics','cl','collection','collections','p','photo','photos');\n\n //check if video id provided\n if( !isset($request['type_id']) || $request['type_id']==\"\" )\n throw_error_msg(\"type id not provided\");\n\n if(!is_numeric($request['type_id']))\n throw_error_msg(\"invalid type id\");\n\n //check if comment provided\n if( !isset($request['comment']) || $request['comment']==\"\" )\n throw_error_msg(\"comment not provided\");\n\n //check if type provided\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check if type provided\n if( !in_array($request['type'], $valid_types) )\n throw_error_msg(\"invalid type provided\");\n\n $type = $request['type'];\n\n //check if reply_to provided\n $reply_to = NULL;\n if( isset($request['reply_to']) && $request['reply_to'] !=\"\" && is_numeric($request['reply_to']) )\n $reply_to = $request['reply_to'];\n\n if ( in_array($type, array('v','video','videos') ) ) \n {\n global $cbvid;\n $result = $cbvid->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('t','topic','topics') ) ) \n {\n global $cbgroup;\n $result = $cbgroup->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to);\n }\n elseif ( in_array($type, array('cl','collection','collections') ) ) \n {\n global $cbcollection;\n $result = $cbcollection->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to);\n }\n elseif ( in_array($type, array('p','photo','photos') ) ) \n {\n global $cbphoto;\n $result = $cbphoto->add_comment(clean($request['comment']),(int)$request['type_id'],$reply_to); \n }\n else \n {\n $result = $myquery->add_comment( clean($request['comment']), (int)$request['type_id'], $reply_to, clean($request['type']));\n }\n if( is_numeric($result) )\n {\n $comment_data = array();\n $uploader_data = array();\n\n $new_comment = $myquery->get_comment($result);\n foreach ($new_comment as $item => $theval) {\n if (isset($new_comment['comment_ip'])) {\n $uploader_data[$item] = $theval;\n } else {\n $comment_data[$item] = $theval;\n }\n\n unset($new_comment[$item]);\n }\n $to_print = array();\n $to_print['Uploader'] = $comment_data;\n $to_print['Comment'] = $uploader_data;\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"comments added\", \"data\" => $to_print);\n $this->response($this->json($data));\n } \n else\n {\n if( error() )\n {\n throw_error_msg(error('single')); \n } \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function comment($id_post, $comment) {\n\n\t\tif(!empty($comment))\n\t\t{\n\t\t\t$req = $GLOBALS['bdd']->prepare('INSERT INTO badin(balsamine, bigarade, bouquetin, brimade, bryophite) VALUES(:id_posts, :id_auteur, 2, NOW(), :comment)');\n\t\t\t$req->execute(array('id_posts' => $id_post,\n\t\t\t\t\t\t\t\t'id_auteur' => $_SESSION['id'],\n\t\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "function save_comment($comment_id)\n {\n }", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'username' => 'required',\n 'comment' => 'required'\n ]);\n\n Comment::create([\n 'products_id' => $request->id,\n //JIKA PARENT ID TIDAK KOSONG, MAKA AKAN DISIMPAN IDNYA, SELAIN ITU NULL\n 'parent_id' => $request->parent_id != '' ? $request->parent_id:NULL,\n 'username' => $request->username,\n 'comment' => $request->comment\n ]);\n return redirect()->back()->with(['success' => 'Komentar Ditambahkan']);\n }", "public function createComment(Request $request, \\App\\Group $group){\n $request->validate([\n 'comment_text'=>'required'\n ]);\n\n $comment = $group->comments()->create([\n 'text' => $request->comment_text,\n 'user_id' => Auth::user()->id\n ]);\n\n $group->notify(new GroupCommentCreated(Auth::user(), $group, $request->comment_text));\n return redirect()->route('groups.view', ['group'=>$group])->with('status', 'Your comment has been posted.');\n }", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }", "public function add_comment(request $request){\n // dd(Carbon::now());\n \n $user = user_data();\n\n $request->validate([\n 'comment_content' => 'required',\n // 'lost_lead_reason' => 'required',\n \n ]);\n Comments::create([\n 'comment_content' => $request->comment_content,\n 'lost_lead_reason' => $request->lost_lead_reason, \n 'user_id' => $request->user_id,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n \n ]);\n return response()->json([ 'success'=> 'Form is successfully submitted!']);\n\n }", "public function InsertComment($details)\n {\n $this->comments[] = $details;\n }", "public function testUserCommentsMethod()\n {\n $user = factory(User::class)->create();\n $user->comments()->save(factory(Comment::class)->create());\n\n $this->assertDatabaseHas('comments', [\n 'user_id' => $user->id,\n ]);\n }", "public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }", "public function commenter(Request $data)\n {\nif(Auth::check()){\n $comment = Commentaire::create([\n 'contenu' => $data['contenu'],\n 'evenement_id' => $data['evenement_id'],\n 'id_utilisateur' => Auth::user()->id,\n ]);\n\n if($comment){ return back()->with('success' , 'Commentaire ajouter'); }\n }\n\n return back()->with('errors' , 'Vous devez etre connecté pour pouvoir commenter!');\n}", "public function comment() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['comment']) && !empty($_POST['comment'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->comment(explode(\"/\", $this->_url)[1], $_POST['comment'])) {\n echo \"error\";\n }\n }\n }\n }", "public function testProfilePrototypeCreateComments()\n {\n\n }", "public function testFlagCreationComment()\n {\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = NULL;\n $flagCreated->CommentID = 1;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $insertedId = $flagCreated->FlagID;\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertEquals(NULL, $flagFetched->NarrativeID);\n $this->assertEquals(1, $flagFetched->CommentID);\n $this->assertEquals(\"Test\", $flagFetched->Comment);\n\n $flagFetched->delete();\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertNull($flagFetched);\n\n }", "public function post_order_comment()\n\t{\n\t\tif ($this->checkLogin('A') != '') {\n\t\t\t$product_id = $this->input->post('product_id');\n\t\t\t$comment_from = $this->input->post('comment_from');\n\t\t\t$commentor_id = $this->input->post('commentor_id');\n\t\t\t$deal_code = $this->input->post('deal_code');\n\t\t\t$comment = $this->input->post('comment');\n\t\t\t$data = array('date' => date(\"Y-m-d H:i:s\"),'product_id' => $product_id,'comment_from' => $comment_from,'commentor_id' => $commentor_id,'deal_code' => $deal_code,'comment' => $comment);\n\t\t\t$this->order_model->simple_insert(REVIEW_COMMENTS,$data);\n\t\t}\n\t}", "function insert_comment($user_id, $comment, $today){\n global $db;\n $query = 'INSERT INTO comments\n (comment, user_id, created)\n VALUES\n (:comment, :user_id, :created)';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment', $comment);\n $statement->bindValue(':user_id', $user_id);\n $statement->bindValue(':created', $today);\n $statement->execute();\n $statement->closeCursor();\n }", "function createComment($comments, $is_user){\n $createComment = new \\Project\\Models\\GuestbookCommentManager();\n $createComments = $createComment->createComment($comments, $is_user);\n\n header('Location: administration.php?action=dashboard');\n }", "public function doCreate(){\n //only logged in users can write comments\n if(Security::isAuthenticated()){\n if($_POST['send']){\n $userid = Security::getUser()->id;\n $postid = $_GET['blogid'];\n //protects from attackers\n $comment = htmlspecialchars($_POST['commentarea']);\n $time = date(\"Y-m-d\");\n $commentRepository = new CommentRepository();\n //call to createComment\n $commentRepository->createComment($userid, $postid, $comment, $time);\n header('Location: /comment/showComments?id='.$postid);\n }\n }else{\n echo'Only logged in users can write comments';\n }\n }", "public function addComment($body){\n // Comment::create([\n // 'body' => $body,\n // 'post_id' => $this->id\n // ]);\n\n\t\t$this->comments()->create(compact('body'));\n\t}", "public function addComment($comment) {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"INSERT INTO comments_table (parent_id, name, comment, create_date) VALUES (\" . $comment['parent_id'] . \", \" . $comment['name'] . \", \" . $comment['comment'] . \", NOW())\";\n $result = mysql_query($sql, $db);\n if($result) {\n $id = mysql_insert_id();\n $sql = \"SELECT * FROM comments_table where id=\" . $id . \";\";\n $result = mysql_query($sql, $db);\n $comment = mysql_result($result, 0);\n return $comment;\n } else {\n return 'save failed';\n }\n }", "public function createComment(Request $request){\n $validator = Validator::make($request->all(), [\n 'commenttext' => ['required', 'string', 'max:100'],\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n $post = Post::find($request->postid);\n $comment = new Comment();\n $comment->user()->associate(Auth::user());\n $comment->post()->associate($post);\n $comment->text = $request->commenttext;\n $comment->save();\n\n flash('Successfully created comment!')->success();\n return redirect()->back();\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function created(Comment $comment)\n {\n //\n }", "function postComment($errorId, $comment, $screenshot, $username){\n \t$con = new mysqli('localhost','heng','@powell135','200ok');\n \tif ($con -> connect_errno){\n \t\treturn CONNECTION_FAIL;\n \t}\n \t$time = date('Y-m-d H:i:s');\n \t$query = \"insert into jnjn_comment(errorId, comment, time, screenShot, username) values('$errorId', '$comment', '$time', '$screenshot', '$username')\";\n \tif($con -> query($query))\n \t\treturn $con -> insert_id;\n \telse \n \t\treturn FAIL;\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function articleAction()\n\t{\n\t\t$id = (int) $this->getRequest()->getParam('id');\n\t\t$this->view->article = $this->_blogService->findArticle($id);\n\t\t\n\t\t$form = new Application_Form_Comment();\n\t\t\n\t\tif ($this->getRequest()->isPost()) {\n\t\t $result = $this->_blogService->saveComment($form);\n\t\t \n\t\t\tif ($result instanceof Application_Model_Comment) {\n\t\t\t $this->view->message = \"Le commentaire {$result->getTitle()} a bien été créé\";\n\t\t\t} elseif (Application_Service_Blog::COMMENT_CREATION_FAILURE_FORM_INVALID == $result) {\n\t\t\t $this->view->message = \"Erreur dans les données du formulaire\";\n\t\t\t} else {\n\t\t\t $this->view->message = \"Erreur inconnue\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->view->form->setAction('/blog/article/id/' . $id);\n\t}" ]
[ "0.7441979", "0.7437014", "0.73652065", "0.7274808", "0.7168541", "0.71185267", "0.70384926", "0.7033251", "0.69935626", "0.691666", "0.68394893", "0.68220204", "0.6794708", "0.67844945", "0.677306", "0.67704356", "0.675354", "0.67355955", "0.67246795", "0.6721198", "0.6718111", "0.66917455", "0.6681179", "0.6678736", "0.66510034", "0.665088", "0.66388285", "0.6550486", "0.6537347", "0.6491588", "0.6444382", "0.643776", "0.6435495", "0.64260167", "0.6414229", "0.6411495", "0.6402701", "0.6397837", "0.6391764", "0.6384237", "0.6381335", "0.6347406", "0.6324258", "0.6321683", "0.63193715", "0.6314798", "0.6289777", "0.62801826", "0.62782294", "0.6275183", "0.62577367", "0.62559164", "0.6253414", "0.62523043", "0.6250672", "0.6249097", "0.6243757", "0.62409306", "0.6239237", "0.62276644", "0.62199146", "0.620838", "0.6202787", "0.6198917", "0.6192636", "0.6189138", "0.6185456", "0.6179759", "0.6175051", "0.61737806", "0.61733663", "0.6164872", "0.6149423", "0.6147971", "0.61442333", "0.6136236", "0.6135378", "0.61209875", "0.6119948", "0.61195034", "0.61161584", "0.6113764", "0.611262", "0.6108912", "0.61033237", "0.6102814", "0.60994005", "0.60993093", "0.6093902", "0.6092196", "0.6088825", "0.6075959", "0.60729194", "0.6067579", "0.6066662", "0.6066442", "0.6066335", "0.6062497", "0.60584295", "0.60576123", "0.6055251" ]
0.0
-1
Effacer un commentaire en BDD
public function deleteComment($id) { $db = $this->dbConnect(); $commentTarget = $db->prepare("DELETE FROM comments WHERE id=?"); $commentTarget->execute(array($id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function comment();", "public function testCreateTaskComments()\n {\n }", "public function testDeleteTaskComment()\n {\n }", "public function testProfilePrototypeCreateComments()\n {\n\n }", "public function testProfilePrototypeDeleteComments()\n {\n\n }", "public function testComment()\n {\n $client = static::createPantherClient();\n $crawler = $client->request('GET', '/projects/1');\n\n\n $client->waitFor('#projectTitle');\n $this->assertSame('Projects', $crawler->filter('h1:first-of-type')->text());\n $this->assertSame('Project Title 1', $crawler->filter('h1:nth-child(2)')->text());\n $client->takeScreenshot('/tmp/panther.png');\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function testCommentReceivedValid()\n {\n $user = factory(User::class)->create();\n $post = factory(Post::class)->create([\n 'author_id'=>$user->id\n ]);\n\n\n Mail::fake();\n\n $this->actingAs($user)->post('/posts/'.$post->id. '/comments',\n ['text'=>'this is some text more then fif..',\n 'author'=>'some_name']);\n\n Mail::assertSent(CommentReceived::class, function($mail) use ($post){\n return $mail->post->id === $post->id;\n });\n }", "public function testProfilePrototypeUpdateByIdComments()\n {\n\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }", "public function ajoutCommentaire(SetUpComment $ajout)\n {\n\n $message = $ajout->getMessage();\n $note = $ajout->getNote();\n $login = $_SESSION['login'];\n $film = $ajout->getFilm();\n try\n {\n $bdd= new PDO('mysql:host=localhost;dbname=cinemaphp;charset=utf8','root','');\n }\n catch(Exception $e)\n {\n die('Erreur:'.$e->getMessage());\n }\n\n $req = $bdd->prepare('INSERT INTO comment (message,login,note,film) VALUES (?,?,?,?)');\n $req -> execute(array($message,$login,$note,$film));\n\n\n }", "public function testListTaskComments()\n {\n }", "function deleteComment($commentId, $postId)\r\n{\r\n $commentManager = new Writer\\Blog\\Model\\CommentManager();\r\n $postManager = new Writer\\Blog\\Model\\PostManager();\r\n $blogManager = new Writer\\Blog\\Model\\BlogManager;\r\n \r\n $affectedLines = $commentManager->deleteComment($commentId);\r\n $post = $postManager->getPost($postId);\r\n $comments = $commentManager->getCommentsByStatus($postId);\r\n $descBlog = $blogManager->getBlog();\r\n $counter = $commentManager->matchComments($postId);\r\n \r\n if ($affectedLines === FALSE) {\r\n throw new Exception('Imposible de mettre à jour le commentaire');\r\n }\r\n else {\r\n session_start();\r\n require('view/backend/postView.php');\r\n }\r\n}", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }", "public function comments(){\n }", "public function testCreateComment() {\n // Find any active product\n $product = ShopProduct::model()->published()->find();\n $this->assertTrue($product instanceof ShopProduct);\n\n $email = '[email protected]';\n $text = 'this is test comment' . microtime();\n\n // Open product page and post comment\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->type('id=Comment_name', 'tester');\n $this->type('id=Comment_email', $email);\n $this->type('id=Comment_text', $text);\n $this->clickAndWait(\"//input[@value='Отправить']\");\n\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->assertTrue($this->isTextPresent('Ваш комментарий успешно добавлен. Он будет опубликован после проверки администратором.'));\n\n $this->adminLogin();\n $this->open('/admin/shop/products/update?id=' . $product->id);\n $this->click('xpath=//a[contains(.,\"Отзывы\")]');\n $this->assertTrue($this->isTextPresent($email));\n $this->assertTrue($this->isTextPresent($text));\n }", "function hide_comment($id, $com_id)\n{\n global $dbh;\n $query = 'UPDATE bugdb_comments SET active = 0 WHERE bug = ' . (int)$id .\n ' AND id = '.(int)$com_id;\n $res = $dbh->query($query);\n}", "public function isComment() {}", "function addAction($postId, $author, $comment)\n{\n\n // if ($affectedLines === false) {\n // // Erreur gérée. Elle sera remontée jusqu'au bloc try du routeur !\n // throw new Exception('Impossible d\\'ajouter le commentaire !');\n // }\n // else {\n // header('Location: index.php?action=post&id=' . $postId);\n // }\n echo \"ajoute un commentaire\";\n}", "public function testEditCommentError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => 'Edit title',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => ''),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_DISAPPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "function check_comment_flood_db()\n {\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function commentAction ()\n {\n /* @var $user User */\n $user = $this->getUser();\n if(!$user) {\n throw new UnauthorizedHttpException('You must be logged in to comment.');\n }\n \n $request = $this->getRequest();\n \n $decklist_id = filter_var($request->get('id'), FILTER_SANITIZE_NUMBER_INT);\n $decklist = $this->getDoctrine()\n ->getRepository('NetrunnerdbBuilderBundle:Decklist')\n ->find($decklist_id);\n \n $comment_text = trim(filter_var($request->get('comment'), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));\n if ($decklist && ! empty($comment_text)) {\n $comment_text = preg_replace(\n '%(?<!\\()\\b(?:(?:https?|ftp)://)(?:((?:(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)(?:\\.(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)*(?:\\.[a-z\\x{00a1}-\\x{ffff}]{2,6}))(?::\\d+)?)(?:[^\\s]*)?%iu',\n '[$1]($0)', $comment_text);\n \n $mentionned_usernames = array();\n if(preg_match_all('/`@([\\w_]+)`/', $comment_text, $matches, PREG_PATTERN_ORDER)) {\n $mentionned_usernames = array_unique($matches[1]);\n }\n \n $comment_html = Markdown::defaultTransform($comment_text);\n \n $now = new DateTime();\n \n $comment = new Comment();\n $comment->setText($comment_html);\n $comment->setCreation($now);\n $comment->setAuthor($user);\n $comment->setDecklist($decklist);\n \n $this->get('doctrine')\n ->getManager()\n ->persist($comment);\n $decklist->setTs($now);\n $decklist->setNbcomments($decklist->getNbcomments() + 1);\n\n $this->get('doctrine')\n ->getManager()\n ->flush();\n \n // send emails\n $spool = array();\n if($decklist->getUser()->getNotifAuthor()) {\n if(!isset($spool[$decklist->getUser()->getEmail()])) {\n $spool[$decklist->getUser()->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_author.html.twig';\n }\n }\n foreach($decklist->getComments() as $comment) {\n /* @var $comment Comment */\n $commenter = $comment->getAuthor();\n if($commenter && $commenter->getNotifCommenter()) {\n if(!isset($spool[$commenter->getEmail()])) {\n $spool[$commenter->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_commenter.html.twig';\n }\n }\n }\n foreach($mentionned_usernames as $mentionned_username) {\n /* @var $mentionned_user User */\n $mentionned_user = $this->getDoctrine()->getRepository('NetrunnerdbUserBundle:User')->findOneBy(array('username' => $mentionned_username));\n if($mentionned_user && $mentionned_user->getNotifMention()) {\n if(!isset($spool[$mentionned_user->getEmail()])) {\n $spool[$mentionned_user->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_mentionned.html.twig';\n }\n }\n }\n unset($spool[$user->getEmail()]);\n \n $email_data = array(\n 'username' => $user->getUsername(),\n 'decklist_name' => $decklist->getName(),\n 'url' => $this->generateUrl('decklist_detail', array('decklist_id' => $decklist->getId(), 'decklist_name' => $decklist->getPrettyname()), TRUE) . '#' . $comment->getId(),\n 'comment' => $comment_html,\n 'profile' => $this->generateUrl('user_profile', array(), TRUE)\n );\n foreach($spool as $email => $view) {\n $message = \\Swift_Message::newInstance()\n ->setSubject(\"[NetrunnerDB] New comment\")\n ->setFrom(array(\"[email protected]\" => $user->getUsername()))\n ->setTo($email)\n ->setBody($this->renderView($view, $email_data), 'text/html');\n $this->get('mailer')->send($message);\n }\n \n }\n \n return $this->redirect($this->generateUrl('decklist_detail', array(\n 'decklist_id' => $decklist_id,\n 'decklist_name' => $decklist->getPrettyName()\n )));\n \n }", "public function comment() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['comment']) && !empty($_POST['comment'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->comment(explode(\"/\", $this->_url)[1], $_POST['comment'])) {\n echo \"error\";\n }\n }\n }\n }", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "public function testGetTaskComment()\n {\n }", "public function changeComment($comment)\r\n {\r\n\r\n }", "function warquest_home_comment_edit_do() {\r\n\r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\t\t \r\n\t/* output */\r\n\tglobal $page;\r\n\t\t\t\r\n\tif ($uid!=0) {\r\n\t\t$query = 'select comment from comment where id='.$uid;\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$data = warquest_db_fetch_object($result);\r\n\t\t\r\n\t\t$comment = $data->comment;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/* Clear input parameters */\r\n\t\t$comment = \"\";\r\n\t}\r\n\t\r\n\t$page .= \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">function limitText(limitField, limitNum) { if (limitField.value.length >= limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } </script>\";\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\t\r\n\t\r\n\t$page .= '<table>';\r\n\t$page .= '<tr>';\r\n\t$page .= '<td width=\"500\">';\r\n\r\n\tif (isset($other->pid)) {\r\n\t\t$tmp = player_format($other->pid, $other->name, $other->country);\r\n\t} else {\r\n\t\t$tmp = t('GENERAL_ALL');\r\n\t}\r\n\t$page .= t('ALLIANCE_COMMENT_TEXT2', $tmp).'<br/>'; \r\n\t\r\n\t$page .= '<textarea style=\"width:100%\" id=\"comment\" name=\"comment\" rows=\"5\" ';\r\n\t$page .= 'onKeyDown=\"limitText(this,400)\">'.$comment.'</textarea><br/>';\r\n\t$page .= warquest_show_smilies();\r\n\t$page .= '<br/><br/>';\r\n\t\r\n\tif (isset($other->pid)) {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&oid='.$other->pid.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t} else {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t}\r\n\t\r\n\tif ($uid!=0) {\r\n\t\t$page .= ' ';\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_DELETE.'&uid='.$uid, t('LINK_DELETE'), 'delete');\r\n\t}\r\n\t\r\n\t$page .= '</td>';\r\n\t$page .= '</tr>';\r\n\t$page .= '</table>';\r\n\r\n\t$page .= '</div>';\t\r\n}", "function comment($id_post, $comment) {\n\n\t\tif(!empty($comment))\n\t\t{\n\t\t\t$req = $GLOBALS['bdd']->prepare('INSERT INTO badin(balsamine, bigarade, bouquetin, brimade, bryophite) VALUES(:id_posts, :id_auteur, 2, NOW(), :comment)');\n\t\t\t$req->execute(array('id_posts' => $id_post,\n\t\t\t\t\t\t\t\t'id_auteur' => $_SESSION['id'],\n\t\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "function validComment($newComment, $idc, $idp)\n{\n/*\t$oldComment = modifComment($oldComment);\n\t$newComment = modifComment($newComment);\n\t\n\trequire('view/frontend/editCommentView.php');*/\n\tvalidModifComment($newComment, $idc);\n\theader('Location: index.php?action=post&id=' . $idp);\n\t// echo $idp;\n}", "public function commentaireAction(){\n\t\t\t$mode \t\t= \"backend\";\n\t\t\t$action = @$_GET['action']; \n\t\t\t$this->cmt->setIdentifiant(@$_GET['idcom']);\n\t\t\t\n\t\t\tswitch($action){\n\t\t\t\tcase \"reset\"; \n\t\t\t\t\t$commentaires = $this->com->resetReport($this->cmt);\n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\n\t\t\t\tcase \"delete\"; \n\t\t\t\t\t$commentaires = $this->com->deleteComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"valide\"; \n\t\t\t\t\t$commentaires = $this->com->confirmComment($this->cmt); \n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\t\n\t\t\t\tdefault;\n\t\t\t\t\t$this->cmt->setNbrReport(@$_POST['valRprt']);\n\t\t\t\t\t$mode = \"frontend\";\n\t\t\t\t\t$commentaires = $this->com->reportComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\techo $this->info->resultAff(\"commen\", \"commentaires\", $commentaires, $mode);\n\t\t}", "public function testProfilePrototypeFindByIdComments()\n {\n\n }", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function testCreateComment(){\n $parameters = [\n 'commenting_username' => 'ridho',\n 'id_post' => 1,\n 'komentar' => 'keren, lanjutkan!'\n ];\n\n $this->post(\"/api/v1/komentar\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_komen',\n 'commenting_username',\n 'id_post',\n 'komentar',\n 'tanggal'\n ]\n ]\n );\n }", "function edit_comment($comment)\n {\n }", "public function postComments()\n {\n $comments = $this->initialData();\n $this->assertCount(3, json_decode($comments->postComments(1)));\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function create($comment)\n {\n\n }", "public function test_5()\n {\n $user1 = User::factory()->create();\n Storage::fake('avatars');\n $this->actingAs($user1)\n ->visit('/home')\n ->attach(UploadedFile::fake()->image('avatar.jpg'), 'image') //Upload the image using faker\n ->type('Testing Upload', 'body')\n ->press('Upload')\n ->type('Commenting Test', 'body')\n ->press('Comment')\n ->see('Commenting Test') //Check if comment is found on webpage\n ->seePageIs('/home');\n $this->seeInDatabase('comments',['text'=>'Commenting Test']); //Check if caption is stored in database\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function testProfilePrototypeDestroyByIdComments()\n {\n\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "function df_disable_comments_status()\n{\n return false;\n}", "function ffeeeedd_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) {\n case 'pingback' :\n case 'trackback' :\n // On affiche différemment les trackbacks. ?>\n <li <?php comment_class(); ?>>\n <p><?php _e( 'Pingback :', 'ffeeeedd' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'ffeeeedd' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php break;\n default :\n // On passe aux commentaires standards.\n global $post; ?>\n <li itemscope itemtype=\"http://schema.org/UserComments\">\n <article role=\"article\">\n <header>\n <?php echo get_avatar( $comment, 44 );\n printf( '<cite itemprop=\"creator\">%1$s %2$s</cite>',\n get_comment_author_link(),\n ( $comment->user_id === $post->post_author ) ? '<small> (' . __( 'Post author', 'ffeeeedd' ) . ' ) </small>' : ''\n );\n printf( '<time datetime=\"%2$s\" itemprop=\"commentTime\">%3$s</time>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n sprintf( '%1$s à %2$s', get_comment_date(), get_comment_time() )\n ); ?>\n </header>\n\n <?php if ( '0' == $comment->comment_approved ) { ?>\n <p><?php _e( 'Your comment is awaiting moderation.', 'ffeeeedd' ); ?>.</p>\n <?php } ?>\n\n <div itemprop=\"commentText\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'ffeeeedd' ), '<p>', '</p>' ); ?>\n </div>\n\n <div class=\"reply\" itemprop=\"replyToUrl\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'ffeeeedd' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div>\n </article>\n <?php break;\n }\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "function handle_editcomment($commentid)\n{\n\tdie(\"A hozzászólások nem szerkeszthetőek. A bejegyzések tulajdonosai <a href=\\\"/delcomment/$commentid\\\">törölhetik</a> a hozzászólásokat.\");\n}", "public function DeleteCommentProfil(){\n $valInfoMovie = new InfoMovie();\n $valUser = new User();\n $pre_reponse = $valInfoMovie->SQLgetOne(BDD::getInstance(),$_GET[\"param\"]);\n\n //On vérifie que la personne qui supprime est l'auteur ou admin\n if (($pre_reponse[1][\"ID_USER\"] != $_SESSION[\"ID_USER\"]) OR ($valUser->CheckAdminUser())){\n header(\"location:/\");\n }\n\n $valInfoMovie->setRate(-1);\n $valInfoMovie->setComment(\"\");\n\n $response = $valInfoMovie->SQLUpdateInfoMovie(BDD::getInstance(),$_GET[\"param\"]);\n\n if ($response[0]) {\n header(\"location:/profil\");\n } else {\n echo \"Une erreur c'est produite : \" . $response[1];\n }\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function testCollectionTicketCommentsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function addComments($artifact, $comments){\n\t\tforeach($comments as $c){\n\t\t\t$time = strtotime($c['date']);\n\t\t\t$uid = user_get_object_by_name($c['submitter'])->getID();\n\t\t\t$importData = array('time' => $time, 'user' => $uid);\n\t\t\t$artifact->addMessage($c['comment'], $importData);\n\t\t}\n\t}", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "public function have_comments()\n {\n }", "public function getComment() {}", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "public function setComment(Comment $comment): void;", "function warquest_home_comment_delete_do() {\r\n\t\r\n\t/* input */\r\n\tglobal $uid;\r\n\t\r\n\t/* output */\r\n\tglobal $comment;\r\n\tglobal $output;\r\n\t\r\n\tif (warquest_db_comment_delete($uid) == 1) {\r\n\t\t\r\n\t\t$message = t('HOME_MESSAGE_DELETED');\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\t\t\r\n\t\t\r\n\t\t$comment=\"\";\r\n\t\t$uid=0;\r\n\t}\r\n}", "private function spamComment()\n {\n try\n {\n global $myquery;\n\n $types = array('v','p','cl','t','u');\n\n $request = $_POST;\n\n if(!isset($request['cid']) || $request['cid']==\"\")\n throw_error_msg(\"cid not provided\"); \n \n if( !is_numeric($request['cid']) )\n throw_error_msg(\"invalid cid provided\"); \n\n if(!isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type provided.\"); \n\n $cid = $request['cid'];\n $myquery->spam_comment($cid);\n \n \n if($request['type'] != 't' && isset($request['typeid']))\n {\n $type = $requets['type'];\n $typeid = mysql_clean();\n update_last_commented($type,$typeid); \n }\n \n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $msg = msg_list();\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $msg[0]);\n $this->response($this->json($data)); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function the_comment()\n {\n }", "function df_disable_comments_status()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function testComAdobeCqSocialCommonsCommentsEndpointsImplCommentOperationSe()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.commons.comments.endpoints.impl.CommentOperationService';\n\n $crawler = $client->request('POST', $path);\n }", "public function testEditComplaintCommentsWithInvalidId(){\n $faker = Faker::create();\n $response = $this->json('PUT','/api/v1/comments',['complaint_comment_id' => 129,\n 'comment' => $faker->text]);\n $response\n ->assertStatus(404)\n ->assertJson([\n 'message' => 'Comment not found',\n ]); \n }", "function updateDiscussionComments() {\n try {\n $comments_table = TABLE_PREFIX . 'comments';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating discussion comments @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, body FROM $comments_table WHERE parent_type = 'Discussion'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('DiscussionComment', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $comments_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Discussion comments updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update discussion comments @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function testComment1()\n {\n $this->assertSame($this->request, $this->request->setComment1('foo'));\n $this->assertSame('foo', $this->request->getComment1());\n $this->assertSame('foo', $this->request->getDescription());\n }", "public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }", "function addComment($id){\n $newComment = $this->commentManager->postComment($id, $_POST['author'], $_POST['comment']);\n if($newComment === false){\n throw new \\Exception(\"Impossible d'ajouter le commentaire\");\n } else {\n header('Location: /episode/'.$id);\n }\n }", "public function testComments() {\n $db = self::$db;\n\n $def = new TableDef('comment');\n $def->setColumn('id', 'int')\n ->setColumn('parentID', 'int')\n ->setColumn('count', 'int', 0)\n ->addIndex(Db::INDEX_PK, 'id');\n $db->defineTable($def->toArray());\n\n $rows = [\n ['id' => 1, 'parentID' => 1, 'count' => 0],\n ['id' => 2, 'parentID' => 1, 'count' => 1],\n ['id' => 3, 'parentID' => 2, 'count' => 0],\n ['id' => 4, 'parentID' => 2, 'count' => 1]\n ];\n $db->load('comment', $rows);\n\n $dbRows = $db->get('comment', [])->fetchAll();\n $this->assertEquals($rows, $dbRows);\n }", "protected function check_comments()\n {\n $comments = preg_grep(\"/#.*$/\", $this->buffer);\n if(!empty($comments))\n {\n $this->stats->add_comm();\n $triggered = 0;\n $len = count($this->buffer);\n\n for($token = key($this->buffer); $token < $len; $token++)\n {\n \n if($triggered == 1)\n {\n unset($this->buffer[$token]);\n continue;\n }\n $isThere = preg_match(\"/#.*$/\", $this->buffer[$token]);\n if($isThere == 1)\n {\n $triggered = 1;\n }\n\n $value = preg_replace(\"/#.*$/\", \"\", $this->buffer[$token]);\n\n if($value == \"\")\n {\n unset($this->buffer[$token]);\n continue;\n }\n $this->buffer[$token] = $value;\n }\n\n if(empty($this->buffer))\n {\n $this->buffer = [NULL];\n } \n }\n }", "private function canComment(): bool\n {\n return true;\n }", "function hankart_disable_comments_status() {\n return false;\n}", "function upgrade_430_fix_comments()\n {\n }", "public function edit(Commentaire $commentaire)\n {\n //\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "function updateFileComments() {\n try {\n $comments_table = TABLE_PREFIX . 'comments';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating file comments @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, body FROM $comments_table WHERE parent_type = 'File'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('AssetComment', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $comments_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('File comments updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update file comments @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function run()\n {\n //\n $comment_contents = [\"Duis in adipisicing culpa minim laboris labore ipsum laborum aliquip nisi Lorem. Sit dolor nostrud elit occaecat fugiat est. Laboris ex ex culpa officia aliqua cupidatat ut qui eiusmod commodo qui consequat tempor quis. Eiusmod id nostrud quis ad exercitation laboris magna consequat amet veniam incididunt. Sit enim aliqua mollit eiusmod exercitation consectetur fugiat nisi sunt. Dolore sunt elit mollit dolore ullamco amet officia.\", \"Sit ex est non magna nisi veniam pariatur. Culpa deserunt non eu ad ea dolore aute ut. Enim reprehenderit est nulla labore minim adipisicing.\", \"Anim incididunt occaecat occaecat velit officia sit veniam Lorem est anim exercitation. Eiusmod do nulla esse esse sint consequat laboris incididunt nostrud cillum ex Lorem deserunt sunt. Exercitation cillum sunt labore excepteur dolor exercitation. Reprehenderit dolore ad id deserunt labore eiusmod cillum amet ipsum cillum cupidatat amet commodo. Nostrud sit aute quis sit ipsum officia do nisi laborum. Nulla consectetur est ex sint eu amet consequat exercitation ut Lorem et ad Lorem qui.\"];\n $blog_ids = [1, 2, 1];\n $commentator_ids = [1, 2, 1];\n\n foreach($comment_contents as $index => $comment_content){\n\n $comment = new Comment;\n $comment->comment_content = $comment_content;\n $comment->blog_id = $blog_ids[$index];\n $comment->commentator_id = $commentator_ids[$index];\n\n $comment->save();\n\n }\n\n\n\n }", "public function testFlagCreationComment()\n {\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = NULL;\n $flagCreated->CommentID = 1;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $insertedId = $flagCreated->FlagID;\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertEquals(NULL, $flagFetched->NarrativeID);\n $this->assertEquals(1, $flagFetched->CommentID);\n $this->assertEquals(\"Test\", $flagFetched->Comment);\n\n $flagFetched->delete();\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertNull($flagFetched);\n\n }", "public function testUserCommentsMethod()\n {\n $user = factory(User::class)->create();\n $user->comments()->save(factory(Comment::class)->create());\n\n $this->assertDatabaseHas('comments', [\n 'user_id' => $user->id,\n ]);\n }", "public function update()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"body\" => $this->body\n );\n $where_params = array(\"id\" => $this->id);\n $db->update(self::COMMENT_TABLE, $set_params, $where_params);\n }", "public function testCollectionTicketCommentsDelete()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function setComment($comment);", "public function setComment($comment);", "public function testProfilePrototypeGetComments()\n {\n\n }", "public function testProfilePrototypeExistsComments()\n {\n\n }", "public function testCollectionTicketCommentsAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "static public function upd_comment_stat(object $pp1, array $other=[]): string\n {\n self::$pp1 = $pp1 ;\n if (isset($pp1->shared_dbadapter_obj)) self::$utldb = $pp1->shared_dbadapter_obj ;\n //copy of an already created object can be made by cloning it.\n $uriq = $pp1->uriq ;\n if ('') { echo '<br /><h3>'.__METHOD__ .', line '. __LINE__ .' SAYS:</h3>'\n .'<br />works if redirect commented U R L query array ='.'$u riq=' ;\n if (isset($uriq))\n { echo '<pre>'; print_r($uriq) ; echo '</pre>'; }\n else { echo ' u riq arr. not set<br />' ; } \n //echo '<br />c l a s s name of $dm='.get_class($dm);\n }\n // outputs :\n //c l a s s name of $dm=B12phpfw\\Home_ctr\n //c l a s s name of $Db_post_comment=B12phpfw\\Db_post_comment\n\n $flds = \"SET status=:status, approvedby=:admin\" ;\n $qrywhere = \"WHERE id=:id\" ;\n\n $id = $uriq->id ;\n $stat = $uriq->stat ;\n $binds = [\n ['placeh'=>':status', 'valph'=>$stat, 'tip'=>'str']\n ,['placeh'=>':admin', 'valph'=>$_SESSION[\"adminname\"], 'tip'=>'str']\n ,['placeh'=>':id', 'valph'=>$id, 'tip'=>'int']\n ] ;\n\n $cursor = self::$utldb::uu( self::$tbl, $flds, $qrywhere, $binds );\n\n if ($cursor) {\n if ($stat == 'ON') {$_SESSION[\"MsgSuccess\"]=\"Comment $id approved ! \" ;\n } else {$_SESSION[\"MsgSuccess\"]=\"Comment $id DisApproved ! \" ;}\n }\n else { $_SESSION[\"MsgErr\"]=\"Update Comment $id Went Wrong (Comment approve failed). Try Again !\"; }\n\n /* ?><SCRIPT LANGUAGE=\"JavaScript\">\n alert( \"<?php echo __METHOD__ .', line '. __LINE__ .' SAYS: '\n .'\\\\n $dm->pp1[\\'comments\\']=' \n . (isset($dm->pp1->comments)?$dm->pp1->comments:'NOT SET')\n ; ?>\" \n ) ;\n </SCRIPT><?php */ //works if redirect commented\n //$dm->Redirect_to($dm->pp1->comments);\n return '1';\n }", "function deleteCom($comId)\n{\n $affectedLines = commentDelete($comId);\n if ($affectedLines === false) {\n throw new Exception('Impossible de supprimer le commentaires');\n }\n else {\n header('Location: index.php?action=manageComments');\n }\n}", "private function comment_edit_submit( ) {\n\n if ( ! ( in('post_ID') || in('comment_ID') || in('comment_parent') ) ) ferror(-500481, \"None of post_ID, comment_ID, comment_parent has provided.\");\n $comment_ID = in( 'comment_ID' );\n $update = $comment_ID ? true : false;\n \n \n if ( $update ) {\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n }\n else {\n $post_ID = in('post_ID');\n if ( empty( $post_ID ) ) {\n $comment = get_comment(in('comment_parent'));\n $post_ID = $comment->comment_post_ID;\n }\n }\n forum()->setCategoryByPostID($post_ID);\n\n\n\n //\n if ( $update ) { // update\n $this->endIfNotMyComment( $comment_ID );\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n add_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $user_ID = $this->get_post_author();\n $user = get_user_by( 'id', $user_ID );\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'comment_author' => $user->user_login,\n 'user_id' => $user_ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n $this->errorResponse(-50302, \"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n // $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ; // this is not used.\n\n //\n $files = in('files');\n if ( $files ) {\n $arr = explode('| |', $files);\n $files = array_filter( $arr );\n comment()->meta( $comment_ID, 'files', $files );\n }\n\n\n\n // Save All extra input into post meta.\n comment()->saveAllMeta( $comment_ID );\n\n\n $o = [ 'post_ID' => $post_ID, 'comment_ID' => $comment_ID ];\n // if ( in('response') == 'ajax' ) $o['comment'] = comment()->get_comment_with_meta( $comment_ID );\n $this->response( $o );\n }", "function df_disable_comments_status() {\n\treturn false;\n}", "function df_disable_comments_status() {\n\treturn false;\n}", "protected function _prepare_comment($comment)\n {\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function testMigration() {\n $this->installConfig(['comment']);\n $this->executeMigration('d6_comment_type');\n\n $this->assertEntity('comment_node_article', 'Article comment');\n $this->assertEntity('comment_node_company', 'Company comment');\n $this->assertEntity('comment_node_employee', 'Employee comment');\n $this->assertEntity('comment_node_event', 'Event comment');\n $this->assertEntity('comment_forum', 'Forum topic comment');\n $this->assertEntity('comment_node_page', 'Page comment');\n $this->assertEntity('comment_node_sponsor', 'Sponsor comment');\n $this->assertEntity('comment_node_story', 'Story comment');\n $this->assertEntity('comment_node_test_event', 'Migrate test event comment');\n $this->assertEntity('comment_node_test_page', 'Migrate test page comment');\n $this->assertEntity('comment_node_test_planet', 'Migrate test planet comment');\n $this->assertEntity('comment_node_test_story', 'Migrate test story comment');\n $this->assertEntity('comment_node_a_thirty_two_char', 'Test long name comment');\n }", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "public function testAfficherNotes()\n {\n\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Gestion Scolarité')\n ->visit('login')\n ->type('email', '[email protected]')\n ->type('password', 'dalia')\n ->press('SE CONNECTER')\n ->assertPathIs('/home')\n ->assertSee('Module')\n ->assertSee('Note CC')\n ->assertSee('Moyenne');\n\n });\n\n }" ]
[ "0.6625634", "0.65454084", "0.64513206", "0.6379023", "0.63754505", "0.6360422", "0.6338719", "0.6315823", "0.62520665", "0.62212783", "0.618579", "0.6179771", "0.617319", "0.6171886", "0.617079", "0.61694705", "0.6144656", "0.6143732", "0.6138712", "0.6137837", "0.61243385", "0.6109333", "0.6109158", "0.6105355", "0.6093317", "0.6084746", "0.60698485", "0.60285044", "0.60160124", "0.6004631", "0.59623843", "0.5958316", "0.5947779", "0.59369904", "0.5929918", "0.59218097", "0.5917724", "0.5912825", "0.59063333", "0.589792", "0.58948493", "0.58901507", "0.58806914", "0.5844772", "0.58391666", "0.58362204", "0.58287257", "0.58264875", "0.5819212", "0.5816422", "0.5808813", "0.5804217", "0.5797085", "0.5796147", "0.57888687", "0.5786963", "0.57853496", "0.5780478", "0.5780338", "0.5768073", "0.5755391", "0.57453394", "0.5740906", "0.57404214", "0.57360893", "0.57339287", "0.5733094", "0.5725177", "0.57244885", "0.57190317", "0.5715246", "0.5710757", "0.5709705", "0.5708071", "0.5703287", "0.5683371", "0.56793773", "0.5677739", "0.56707084", "0.5668641", "0.56640583", "0.566254", "0.56532466", "0.56488985", "0.56482315", "0.5647252", "0.5647252", "0.5641311", "0.5637424", "0.5634861", "0.5633806", "0.5631875", "0.5627804", "0.56243384", "0.5624239", "0.5624239", "0.56207246", "0.561201", "0.5610775", "0.5607641", "0.56066906" ]
0.0
-1
Signaler un commentaire en BDD
public function warningComment($id) { $db = $this->dbConnect(); $commentTarget = $db->prepare("UPDATE comments SET signalement = 'Oui' WHERE id=?"); $commentTarget->execute(array($id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function record_comment(){\n\t\t\t\n\t\t}", "public function testCommentReceivedValid()\n {\n $user = factory(User::class)->create();\n $post = factory(Post::class)->create([\n 'author_id'=>$user->id\n ]);\n\n\n Mail::fake();\n\n $this->actingAs($user)->post('/posts/'.$post->id. '/comments',\n ['text'=>'this is some text more then fif..',\n 'author'=>'some_name']);\n\n Mail::assertSent(CommentReceived::class, function($mail) use ($post){\n return $mail->post->id === $post->id;\n });\n }", "abstract public function comment();", "public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "public function comments(){\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "function addCommentHandler() {\n global $inputs;\n\n $content = $inputs['content'];\n $id = $inputs['id'];\n $replyId = insert('reply',[\n 'content' => $content\n ]);\n\n insert('posting_reply',[\n 'posting_id' => $id,\n 'reply_id' => $replyId\n ]);\n\n insert('member_reply',[\n 'member_id' => getLogin()['mid'],\n 'posting_id' => $id\n ]);\n\n formatOutput(true, 'success');\n}", "public function testCreateTaskComments()\n {\n }", "public function ajoutCommentaire(SetUpComment $ajout)\n {\n\n $message = $ajout->getMessage();\n $note = $ajout->getNote();\n $login = $_SESSION['login'];\n $film = $ajout->getFilm();\n try\n {\n $bdd= new PDO('mysql:host=localhost;dbname=cinemaphp;charset=utf8','root','');\n }\n catch(Exception $e)\n {\n die('Erreur:'.$e->getMessage());\n }\n\n $req = $bdd->prepare('INSERT INTO comment (message,login,note,film) VALUES (?,?,?,?)');\n $req -> execute(array($message,$login,$note,$film));\n\n\n }", "public function testCreateComment() {\n // Find any active product\n $product = ShopProduct::model()->published()->find();\n $this->assertTrue($product instanceof ShopProduct);\n\n $email = '[email protected]';\n $text = 'this is test comment' . microtime();\n\n // Open product page and post comment\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->type('id=Comment_name', 'tester');\n $this->type('id=Comment_email', $email);\n $this->type('id=Comment_text', $text);\n $this->clickAndWait(\"//input[@value='Отправить']\");\n\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->assertTrue($this->isTextPresent('Ваш комментарий успешно добавлен. Он будет опубликован после проверки администратором.'));\n\n $this->adminLogin();\n $this->open('/admin/shop/products/update?id=' . $product->id);\n $this->click('xpath=//a[contains(.,\"Отзывы\")]');\n $this->assertTrue($this->isTextPresent($email));\n $this->assertTrue($this->isTextPresent($text));\n }", "public function commentaireAction(){\n\t\t\t$mode \t\t= \"backend\";\n\t\t\t$action = @$_GET['action']; \n\t\t\t$this->cmt->setIdentifiant(@$_GET['idcom']);\n\t\t\t\n\t\t\tswitch($action){\n\t\t\t\tcase \"reset\"; \n\t\t\t\t\t$commentaires = $this->com->resetReport($this->cmt);\n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\n\t\t\t\tcase \"delete\"; \n\t\t\t\t\t$commentaires = $this->com->deleteComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"valide\"; \n\t\t\t\t\t$commentaires = $this->com->confirmComment($this->cmt); \n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\t\n\t\t\t\tdefault;\n\t\t\t\t\t$this->cmt->setNbrReport(@$_POST['valRprt']);\n\t\t\t\t\t$mode = \"frontend\";\n\t\t\t\t\t$commentaires = $this->com->reportComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\techo $this->info->resultAff(\"commen\", \"commentaires\", $commentaires, $mode);\n\t\t}", "public function create($comment)\n {\n\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function comment() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['comment']) && !empty($_POST['comment'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->comment(explode(\"/\", $this->_url)[1], $_POST['comment'])) {\n echo \"error\";\n }\n }\n }\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "public function alertComment($id,$alertComment)\n\t{\n\t\t$commentsManager = new Comments();\n\t\t$alertComments = $commentsManager-> updateComment($id,$alertComment); //appel d'une fonction d'un objet\n\t\trequire('view/ViewFrontEnd/signalCommentView.php');\n\t}", "public function testComment()\n {\n $client = static::createPantherClient();\n $crawler = $client->request('GET', '/projects/1');\n\n\n $client->waitFor('#projectTitle');\n $this->assertSame('Projects', $crawler->filter('h1:first-of-type')->text());\n $this->assertSame('Project Title 1', $crawler->filter('h1:nth-child(2)')->text());\n $client->takeScreenshot('/tmp/panther.png');\n }", "public function postComments()\n {\n $comments = $this->initialData();\n $this->assertCount(3, json_decode($comments->postComments(1)));\n }", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "public function testProfilePrototypeCreateComments()\n {\n\n }", "function comment()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('comment', $data)\n );\n $this->output($ret);\n }", "static public function comment_submission() {\n ?>\n\n /**\n * Déclenchement d'événements Google analytics lors de la soumission\n * d'un commentaire.\n *\n * source https://felix-arntz.me/blog/customizing-google-analytics-configuration-site-kit-plugin/\n */\n $('#commentform input[type=\"submit\"]').on('click',function(){\n console.log('SFP: Comment submited');\n if(typeof gtag=='function'){\n gtag('event','Commentaire',{\n 'event_category':'Implication',\n 'event_label':window.location.href\n });\n }\n });\n\n <?php\n }", "public function setComment(Comment $comment): void;", "function addAction($postId, $author, $comment)\n{\n\n // if ($affectedLines === false) {\n // // Erreur gérée. Elle sera remontée jusqu'au bloc try du routeur !\n // throw new Exception('Impossible d\\'ajouter le commentaire !');\n // }\n // else {\n // header('Location: index.php?action=post&id=' . $postId);\n // }\n echo \"ajoute un commentaire\";\n}", "public function changeComment($comment)\r\n {\r\n\r\n }", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "function wp_new_comment_notify_moderator($comment_id)\n {\n }", "public function commentAction ()\n {\n /* @var $user User */\n $user = $this->getUser();\n if(!$user) {\n throw new UnauthorizedHttpException('You must be logged in to comment.');\n }\n \n $request = $this->getRequest();\n \n $decklist_id = filter_var($request->get('id'), FILTER_SANITIZE_NUMBER_INT);\n $decklist = $this->getDoctrine()\n ->getRepository('NetrunnerdbBuilderBundle:Decklist')\n ->find($decklist_id);\n \n $comment_text = trim(filter_var($request->get('comment'), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));\n if ($decklist && ! empty($comment_text)) {\n $comment_text = preg_replace(\n '%(?<!\\()\\b(?:(?:https?|ftp)://)(?:((?:(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)(?:\\.(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)*(?:\\.[a-z\\x{00a1}-\\x{ffff}]{2,6}))(?::\\d+)?)(?:[^\\s]*)?%iu',\n '[$1]($0)', $comment_text);\n \n $mentionned_usernames = array();\n if(preg_match_all('/`@([\\w_]+)`/', $comment_text, $matches, PREG_PATTERN_ORDER)) {\n $mentionned_usernames = array_unique($matches[1]);\n }\n \n $comment_html = Markdown::defaultTransform($comment_text);\n \n $now = new DateTime();\n \n $comment = new Comment();\n $comment->setText($comment_html);\n $comment->setCreation($now);\n $comment->setAuthor($user);\n $comment->setDecklist($decklist);\n \n $this->get('doctrine')\n ->getManager()\n ->persist($comment);\n $decklist->setTs($now);\n $decklist->setNbcomments($decklist->getNbcomments() + 1);\n\n $this->get('doctrine')\n ->getManager()\n ->flush();\n \n // send emails\n $spool = array();\n if($decklist->getUser()->getNotifAuthor()) {\n if(!isset($spool[$decklist->getUser()->getEmail()])) {\n $spool[$decklist->getUser()->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_author.html.twig';\n }\n }\n foreach($decklist->getComments() as $comment) {\n /* @var $comment Comment */\n $commenter = $comment->getAuthor();\n if($commenter && $commenter->getNotifCommenter()) {\n if(!isset($spool[$commenter->getEmail()])) {\n $spool[$commenter->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_commenter.html.twig';\n }\n }\n }\n foreach($mentionned_usernames as $mentionned_username) {\n /* @var $mentionned_user User */\n $mentionned_user = $this->getDoctrine()->getRepository('NetrunnerdbUserBundle:User')->findOneBy(array('username' => $mentionned_username));\n if($mentionned_user && $mentionned_user->getNotifMention()) {\n if(!isset($spool[$mentionned_user->getEmail()])) {\n $spool[$mentionned_user->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_mentionned.html.twig';\n }\n }\n }\n unset($spool[$user->getEmail()]);\n \n $email_data = array(\n 'username' => $user->getUsername(),\n 'decklist_name' => $decklist->getName(),\n 'url' => $this->generateUrl('decklist_detail', array('decklist_id' => $decklist->getId(), 'decklist_name' => $decklist->getPrettyname()), TRUE) . '#' . $comment->getId(),\n 'comment' => $comment_html,\n 'profile' => $this->generateUrl('user_profile', array(), TRUE)\n );\n foreach($spool as $email => $view) {\n $message = \\Swift_Message::newInstance()\n ->setSubject(\"[NetrunnerDB] New comment\")\n ->setFrom(array(\"[email protected]\" => $user->getUsername()))\n ->setTo($email)\n ->setBody($this->renderView($view, $email_data), 'text/html');\n $this->get('mailer')->send($message);\n }\n \n }\n \n return $this->redirect($this->generateUrl('decklist_detail', array(\n 'decklist_id' => $decklist_id,\n 'decklist_name' => $decklist->getPrettyName()\n )));\n \n }", "private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }", "public function testCreateComment(){\n $parameters = [\n 'commenting_username' => 'ridho',\n 'id_post' => 1,\n 'komentar' => 'keren, lanjutkan!'\n ];\n\n $this->post(\"/api/v1/komentar\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_komen',\n 'commenting_username',\n 'id_post',\n 'komentar',\n 'tanggal'\n ]\n ]\n );\n }", "public function test_observer()\n {\n $this->initUserAndArticleModel();\n\n // 一级评论\n $response = $this->json('post', '/api/comment', $this->getPostData('article', 'test', $this->article->id));\n $rootComment = json_decode($response->getContent())->data;\n\n // 二级评论\n $response = $this->json('post', '/api/comment', $this->getPostData('comment', 'test', $rootComment->id));\n $articleCommented = CacheModel::getArticleCommented($this->article->id);\n\n $this->assertEquals(2, $articleCommented);\n\n // 三级评论\n $comment = json_decode($response->getContent())->data;\n $response = $this->json('post', '/api/comment', $this->getPostData('comment', 'test', $comment->id));\n $articleCommented = CacheModel::getArticleCommented($this->article->id);\n $this->assertEquals(3, $articleCommented);\n\n $rootCommentCommented = CacheModel::getCommentCommented($rootComment->id);\n $this->assertEquals(2, $rootCommentCommented);\n\n // 测试生成的通知 \n // 都是自己的评论,不进行通知\n $notifications = MessageBox::selectRaw('count(id) as count')->where('type', 'comment')->get()[0];\n $this->assertEquals(0, $notifications->count);\n }", "function addComments($artifact, $comments){\n\t\tforeach($comments as $c){\n\t\t\t$time = strtotime($c['date']);\n\t\t\t$uid = user_get_object_by_name($c['submitter'])->getID();\n\t\t\t$importData = array('time' => $time, 'user' => $uid);\n\t\t\t$artifact->addMessage($c['comment'], $importData);\n\t\t}\n\t}", "public function ReportComment(){ \r\n $this->comment();\r\n $this->reportPost();\r\n $this->_commentManager->getReportComment($this->_reportPostSecure,\"1\");\r\n header('location: '.$_GET[\"url\"].'&id='.$_GET[\"id\"]);\r\n }", "function addComment($id){\n $newComment = $this->commentManager->postComment($id, $_POST['author'], $_POST['comment']);\n if($newComment === false){\n throw new \\Exception(\"Impossible d'ajouter le commentaire\");\n } else {\n header('Location: /episode/'.$id);\n }\n }", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "public function testDeleteTaskComment()\n {\n }", "public function testAfficherNotes()\n {\n\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Gestion Scolarité')\n ->visit('login')\n ->type('email', '[email protected]')\n ->type('password', 'dalia')\n ->press('SE CONNECTER')\n ->assertPathIs('/home')\n ->assertSee('Module')\n ->assertSee('Note CC')\n ->assertSee('Moyenne');\n\n });\n\n }", "public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }", "public function signalerCom($idCom, $idBillet)\n {\n $this->commentaire->updateCommentaire('FALSE', $idCom);\n $_SESSION['info'] = 'Le commentaire a été signalé à l\\'auteur, merci. ';\n header('Location: index.php?action=billet&id='.$idBillet.'&page=1#postCom');\n }", "Public function addComment(Request $request){\n // return $id;\n\n $this->validate($request,[ \n 'comment' => 'required', \n ],\n\n [\n 'comment.required' => ' اجرات خود را بنویسید ',\n ]);\n\n $user_id = Auth::user()->id;\n $comment = new AhkamComment;\n $comment->comment = $request->comment;\n $comment->ahkam_id = $request->ahkam_id;\n $comment->user_id = $user_id;\n DB::transaction(function() use ($comment) {\n $comment->save();\n });\n //to generate its notifications\n Helper::add_noti('Ahkam', $comment->id, $comment->ahkam_id);\n $request->session()->flash('alert-success', ' اجرات شما افزوده شد ' );\n return redirect()->back();\n \n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function comm($c){\n\t\t$this->comment = $c;\n\t}", "public function setComment($comment);", "public function setComment($comment);", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function testComAdobeCqSocialCommonsEmailreplyImplCommentEmailEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.commons.emailreply.impl.CommentEmailEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function addReportOnComment($data, $db) \n {\n\n }", "function reportComment($episodeId, $commentId){\n $reportComment = $this->commentManager->reportComment(1, $commentId);\n if($reportComment === false){\n throw new \\Exception(\"Impossible de signaler le commentaire\");\n } else {\n header('Location: /episode/'.$episodeId);\n }\n }", "public function getComment() {}", "public function testListTaskComments()\n {\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "function comment($id_post, $comment) {\n\n\t\tif(!empty($comment))\n\t\t{\n\t\t\t$req = $GLOBALS['bdd']->prepare('INSERT INTO badin(balsamine, bigarade, bouquetin, brimade, bryophite) VALUES(:id_posts, :id_auteur, 2, NOW(), :comment)');\n\t\t\t$req->execute(array('id_posts' => $id_post,\n\t\t\t\t\t\t\t\t'id_auteur' => $_SESSION['id'],\n\t\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public function report_comment(){\r\n\t\t\r\n\t\t/* Require user. */\r\n\t\tif (!$this->_requireUser('Please sign in to report a comment.')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$commentId = Request::getInt('comment');\r\n\t\t\r\n\t\t/* Report object. */\r\n\t\tif ($this->report('comment', $commentId)){\r\n\t\t\t$message = $this->report_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->report_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function test_trigger_comment_added_by_tutor_event_creates_request() {\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // mock out GuzzleHttp\\Client\n $request = m::mock('\\GuzzleHttp\\Message\\Request');\n $request->shouldIgnoreMissing();\n $response = m::mock('\\GuzzleHttp\\Response');\n $response->shouldIgnoreMissing();\n $client = m::mock('\\GuzzleHttp\\Client');\n $client->shouldReceive('createRequest')\n ->once()\n ->andReturn($request);\n $client->shouldReceive('send')\n ->once()\n ->with($request)\n ->andReturn($response);\n\n $event = $this->_app['dragdrop_event']->handle_event('comment', array(\n 'context' => context_course::instance($course->id),\n 'objectid' => 999\n ), SEPARATEGROUPS, m::mock('dragdrop_user'), m::mock('dragdrop_model_manager'), $client);\n $this->assertTrue($event->is_triggered());\n }", "static function comment_post($id_comment){\n if(!(($id_user = PDOQueries::get_post_publisher_id_by_comment($id_comment)) > 0) || !(($id_post = PDOQueries::get_post_id_by_comment($id_comment)) > 0) || !(($id_publisher = PDOQueries::get_publisher_id($id_post)) > 0))\n throw new \\PersonalizeException(2001);\n $marker = '{comment_post}{id_publisher/'.$id_user.'}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Timeline::$post_id_page.'#'.$id_post.$id_comment;\n return PDOQueries::add_notification($id_publisher,$marker,$link);\n }", "public function actionComment()\n {\n\n if(isset($_POST['Comment']))\n {\n $model = new Comment;\n //$model->attributes=$_POST['Comment'];\n $model->a_id = $_POST['answer_id'];\n $model->author_id = $_POST['author_id'];\n\n $model->text = strip_tags($_POST['Comment']['text']);\n\n if($model->save()) {\n $receivers = User::model()->with(array('follow_question' => array('condition' => 'follow_question.q_id = ' . $_POST['question_id'])))->findAll();\n if ($receivers) {\n foreach ($receivers as $key => $receiver) {\n $notifications = UserNotifications::model()->findByPk($receiver->id);\n\n if ($receiver && $notifications)\n if ($notifications->comment_on_question == 1) {\n\n $subject = 'Question has been commented at ' . Yii::app()->name . '!';\n $message = CHtml::link('Question',\n 'http://' . $_SERVER['HTTP_HOST']. Yii::app()->baseUrl . '/question/view/id/' . $_POST['question_id']) . ' you are following has been commented ';\n\n UserModule::sendMail($receiver->email,$subject,$message);\n }\n }\n }\n Yii::app()->user->setFlash('answerCommented', \"Comment was posted successfully\");\n $this->redirect($this->createUrl('/question/view/id/' . $_POST['question_id']));\n }\n\n }\n\n }", "protected function report_comment_success_message(){\r\n\t\treturn 'The comment has been reported.';\r\n\t}", "function save_comment($comment_id)\n {\n }", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "public function the_comment()\n {\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function onBeforeSave()\n\t{\n\t\tif (empty($this->allow_comments))\n\t\t{\n\t\t\t$this->allow_comments = $this->Channel->deft_comments;\n\t\t}\n\t}", "public function isComment() {}", "public function testComment1()\n {\n $this->assertSame($this->request, $this->request->setComment1('foo'));\n $this->assertSame('foo', $this->request->getComment1());\n $this->assertSame('foo', $this->request->getDescription());\n }", "public function testComAdobeCqSocialCommonsCommentsEndpointsImplCommentOperationSe()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.commons.comments.endpoints.impl.CommentOperationService';\n\n $crawler = $client->request('POST', $path);\n }", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function flag_comment() {\n\t\t\tif ( empty( $_REQUEST[ 'comment_id' ] ) || (int) $_REQUEST[ 'comment_id' ] != $_REQUEST[ 'comment_id' ] ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_values_message ) );\n\t\t\t}\n\n\t\t\t$comment_id = (int) $_REQUEST[ 'comment_id' ];\n\t\t\tif ( $this->already_flagged( $comment_id ) ) {\n\t\t\t\t$this->cond_die( __( $this->already_flagged_message ) );\n\t\t\t}\n\n\t\t\t// checking if nonces help\n\t\t\tif ( ! isset( $_REQUEST[ 'sc_nonce' ] ) || ! wp_verify_nonce( $_REQUEST[ 'sc_nonce' ], $this->_plugin_prefix . '_' . $this->_nonce_key ) ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_nonce_message ) );\n\t\t\t} else {\n\t\t\t\t$this->mark_flagged( $comment_id );\n\t\t\t\t$this->cond_die( __( $this->thank_you_message ) );\n\t\t\t}\n\n\t\t}", "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "function reportcomment(){\n\t\t\t$this->load->model('User_model');\n\t\t\t$commentID = $_POST[\"commentID\"];\n\t\t\t$reason = $_POST[\"reason\"];\n\t\t\t$data = array('commentID'=>$commentID, 'reason'=>$reason);\n\t\t\t$query = $this->User_model->reportcommentModel($data);\n\t\t\t\n\t\t\tif($query){\n\t\t\t\techo 'reported';\n\t\t\t}\t\t\t\n\t\t}", "public function comment($msg) {\n $this->writeLine($msg, 'comment');\n }", "public function testProfilePrototypeUpdateByIdComments()\n {\n\n }", "public function have_comments()\n {\n }", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function postAddComment($buildingId)\n {\n $modelUser = new TfUser();\n $modelUserNotifyActivity = new TfUserNotifyActivity();\n $modeUserStatistic = new TfUserStatistic();\n $modelBuilding = new TfBuilding();\n $modelBuildingComment = new TfBuildingComment();\n $modelCommentNotify = new TfBuildingCommentNotify();\n\n $dataUserLogin = $modelUser->loginUserInfo();\n\n $content = Request::input('txtComment');\n if (count($dataUserLogin) > 0) {\n $loginUserId = $dataUserLogin->userId();\n $userBuildingId = $modelBuilding->userId($buildingId);\n $newInfo = ($loginUserId !== $userBuildingId) ? 1 : 0;\n\n if ($modelBuildingComment->insert($content, $newInfo, $buildingId, $loginUserId)) {\n $newCommentId = $modelBuildingComment->insertGetId();\n\n //update statistic of building\n $modelBuilding->plusComment($buildingId);\n\n //notify to building owner\n if (($loginUserId !== $userBuildingId)) {\n $modelCommentNotify->insert($newCommentId, $userBuildingId);\n $modeUserStatistic->plusActionNotify($userBuildingId);\n\n //insert notify\n $modelUserNotifyActivity->insert($userBuildingId, null, null, null, $newCommentId, null, null, null);\n }\n\n //notify to friend\n $listFriend = $modelUser->listFriendId($loginUserId);\n\n if (!empty($listFriend)) {\n foreach ($listFriend as $key => $value) {\n if ($userBuildingId != $value) {\n $modelCommentNotify->insert($newCommentId, $value);\n $modeUserStatistic->plusActionNotify($value);\n\n //insert notify\n $modelUserNotifyActivity->insert($value, null, null, null, $newCommentId, null, null, null);\n }\n }\n }\n\n $dataBuildingComment = $modelBuildingComment->getInfo($newCommentId);\n return view('map.building.comment.comment-object', compact('modelUser', 'dataBuildingComment'));\n }\n }\n\n }", "public function testGetTaskComment()\n {\n }", "public function testCollectionTicketCommentsAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function wap8_trackbacks( $comment ) {\n$GLOBALS['comment'] = $comment; ?>\n<li><?php printf( __( '%s', 'designcrumbs' ), get_comment_author_link() ) ?> <?php edit_comment_link( __( 'Edit', 'designcrumbs' ), '<span>', '</span>' ); ?>\n<?php\n}", "public function post_order_comment()\n\t{\n\t\tif ($this->checkLogin('A') != '') {\n\t\t\t$product_id = $this->input->post('product_id');\n\t\t\t$comment_from = $this->input->post('comment_from');\n\t\t\t$commentor_id = $this->input->post('commentor_id');\n\t\t\t$deal_code = $this->input->post('deal_code');\n\t\t\t$comment = $this->input->post('comment');\n\t\t\t$data = array('date' => date(\"Y-m-d H:i:s\"),'product_id' => $product_id,'comment_from' => $comment_from,'commentor_id' => $commentor_id,'deal_code' => $deal_code,'comment' => $comment);\n\t\t\t$this->order_model->simple_insert(REVIEW_COMMENTS,$data);\n\t\t}\n\t}", "function ffeeeedd_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) {\n case 'pingback' :\n case 'trackback' :\n // On affiche différemment les trackbacks. ?>\n <li <?php comment_class(); ?>>\n <p><?php _e( 'Pingback :', 'ffeeeedd' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'ffeeeedd' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php break;\n default :\n // On passe aux commentaires standards.\n global $post; ?>\n <li itemscope itemtype=\"http://schema.org/UserComments\">\n <article role=\"article\">\n <header>\n <?php echo get_avatar( $comment, 44 );\n printf( '<cite itemprop=\"creator\">%1$s %2$s</cite>',\n get_comment_author_link(),\n ( $comment->user_id === $post->post_author ) ? '<small> (' . __( 'Post author', 'ffeeeedd' ) . ' ) </small>' : ''\n );\n printf( '<time datetime=\"%2$s\" itemprop=\"commentTime\">%3$s</time>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n sprintf( '%1$s à %2$s', get_comment_date(), get_comment_time() )\n ); ?>\n </header>\n\n <?php if ( '0' == $comment->comment_approved ) { ?>\n <p><?php _e( 'Your comment is awaiting moderation.', 'ffeeeedd' ); ?>.</p>\n <?php } ?>\n\n <div itemprop=\"commentText\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'ffeeeedd' ), '<p>', '</p>' ); ?>\n </div>\n\n <div class=\"reply\" itemprop=\"replyToUrl\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'ffeeeedd' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div>\n </article>\n <?php break;\n }\n }", "public function add_comm()\n {\n $this->comments++;\n }", "public function createComment(): CommentableInterface;", "public function comment_ticket()\n {\n $response = array(\n 'status' => 'true',\n 'message' => ''\n );\n\n $status = $this->comments_processor->form_sanitation($_POST, 'Chat');\n\n if (!$status) {\n $response['status'] = 'false';\n }\n\n die(json_encode($response));\n }", "public function message()\n {\n return 'wrong comment id';\n }", "public function run()\n {\n $commi1 = new \\App\\Comment;\n $user =App\\User::find(1);\n $commi1->user()->associate($user);\n $commi1->text = 'Bitte Discountprodukte kaufen';\n\n // $articleList = App\\Unit::all()->first();\n //set relation to foreign key of unit\n //$commi1->Shoppinglist()->associate($articleList);\n $commi1->shopping_list_id = 1;\n\n $commi1->save();\n }", "public function addSignalement(Commentaire $commentaire)\r\n {\r\n $bdd = $this->bdd;\r\n $query = 'UPDATE t_commentaire SET COM_SIGNALEMENT = 1 WHERE COM_ID =' . $commentaire->getcomId();\r\n $req = $bdd->prepare($query);\r\n $req->bindValue('1', $commentaire->getComSignalement(), PDO::PARAM_INT);\r\n $req->execute();\r\n }", "public function updateCommentContent(Request $request, NotificationManager $notificationManager){\n $locale = $request->getLocale();\n $comId = $request->get('id');\n $evtId = $request->get('eid');\n $parentId = $request->get('cid');\n $comContent = $request->get('content');\n $stgId = $request->get('sid');\n $evtTypeId = $request->get('evtid');\n $oDateStr = $request->get('oDateStr');\n $expResDateStr = $request->get('expResDateStr');\n\n if($oDateStr != \"\"){$oDate = new DateTime($oDateStr);}\n $expResDate = $expResDateStr != \"\" ? new DateTime($expResDateStr) : null;\n $em = $this->em;\n /** @var EventComment */\n $comment = $comId ? $em->getRepository(EventComment::class)->find($comId) : new EventComment;\n $isCurrentlyModified = $comment->getContent() && $comContent != $comment->getContent();\n if(!$comId){\n \n $comment->setContent($comContent)\n ->setAuthor($this->user)\n ->setOrganization($this->org)\n ->setInitiator($this->user);\n if($parentId){\n $parent = $em->getRepository(EventComment::class)->find($parentId);\n $comment->setParent($parent);\n }\n\n if(!$evtId){\n /** @var Stage */\n $stage = $em->getRepository(Stage::class)->find($stgId);\n $eventType = $em->getRepository(EventType::class)->find($evtTypeId);\n $event = new Event;\n $event->setEventType($eventType)\n ->setOnsetDate($oDate)\n ->setExpResDate($expResDate)\n ->setOrganization($this->org)\n ->setInitiator($this->user);\n $stage->addEvent($event);\n } else {\n /** @var Event */\n $event = $em->getRepository(Event::class)->find($evtId);\n $stage = $event->getStage();\n }\n \n $recipients = $event->getStage()->getUniqueParticipations()->filter(fn(Participation $p) => $p->getUser() != $this->user)->map(fn(Participation $p) => $p->getUser())->getValues();\n $event->addComment($comment);\n $em->persist($event);\n //$em->flush();\n\n /*$response = $this->forward('App\\Controller\\MailController::sendMail', [\n 'recipients' => $recipients, \n 'settings' => [\n 'event' => $event, \n 'commentUpdate' => true,\n 'documentUpdate' => false\n ],\n 'actionType' => 'eventUpdate'\n ]);\n if($response->getStatusCode() == 500){ return $response; };*/\n\n } else {\n if($isCurrentlyModified){\n $comment->setContent($comContent)\n ->setModified(new DateTime);\n $em->persist($comment);\n //$em->flush();\n }\n }\n\n $notifiedUsers = $stage->getParticipants()->map(fn(Participation $p) => $p->getUser());\n\n if(!$evtId){\n $notificationManager->registerUpdates($event, $notifiedUsers, ElementUpdate::CREATION);\n }\n if(!$comId){\n $notificationManager->registerUpdates($comment, $notifiedUsers, ElementUpdate::CREATION, 'content');\n }\n\n $em->flush();\n /*\n foreach($event->getStage()->getParticipants() as $participation){\n $update = new Update;\n $update->setType($comId ? ElementUpdate::CHANGE : ElementUpdate::CREATION)\n ->setEventComment($comment)\n ->setUser($participation->getUser())\n ->setStage($stage)\n ->setActivity($stage->getActivity());\n $event->addUpdate($update);\n }*/\n\n $outputData = ['msg' => 'success', 'author' => $this->user->getFullName(), 'modified' => $comment->getModified() != null, 'inserted' => $this->nicetime($comment->getInserted(),$locale), 'cid' => $comment->getId()];\n if(!$evtId){\n $outputData['sid'] = $stgId;\n $outputData['eid'] = $event->getId();\n $eventName = $eventType->getEName();\n $eventGroup = $eventType->getEventGroup();\n $locale = $request->getLocale();\n $repoEG = $em->getRepository(EventGroup::class);\n $repoET = $em->getRepository(EventType::class);\n $outputData['od'] = $event->getOnsetdateU();\n $outputData['rd'] = $event->getExpResDateU();\n $outputData['p'] = $event->getPeriod();\n $outputData['it'] = $eventName->getIcon()->getType();\n $outputData['in'] = $eventName->getIcon()->getName();\n $outputData['gn'] = $eventGroup->getEventGroupName()->getId();\n $outputData['gt'] = $repoEG->getDTrans($eventGroup, $locale, $this->org);\n $outputData['tt'] = $repoET->getDTrans($eventType, $locale, $this->org);\n $outputData['nbc'] = $event->getComments()->count();\n $outputData['nbd'] = $event->getDocuments()->count();\n }\n return new JsonResponse($outputData, 200);\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }" ]
[ "0.6737391", "0.6616184", "0.6429513", "0.640985", "0.63532054", "0.63198006", "0.63005173", "0.621153", "0.6200189", "0.61040163", "0.6076796", "0.60599506", "0.60542214", "0.60466754", "0.6042426", "0.60196996", "0.6006864", "0.59674746", "0.5949651", "0.59389955", "0.5932207", "0.59295774", "0.59260505", "0.5917391", "0.5911051", "0.5908066", "0.58941746", "0.58903337", "0.5888686", "0.58780926", "0.5861631", "0.5854923", "0.58486205", "0.5831939", "0.5814335", "0.581262", "0.58039796", "0.5801557", "0.5792054", "0.57916856", "0.57888", "0.5782475", "0.57807165", "0.57552046", "0.5749753", "0.5746541", "0.5736142", "0.5733584", "0.57288736", "0.572345", "0.57207525", "0.5706955", "0.57040066", "0.57040066", "0.5701089", "0.57009643", "0.57001436", "0.56958055", "0.56927145", "0.5689978", "0.56887877", "0.567858", "0.567745", "0.5671207", "0.5669814", "0.56661713", "0.5662821", "0.56626976", "0.56561106", "0.565516", "0.56489104", "0.5644919", "0.5641811", "0.5635871", "0.56281996", "0.56209", "0.56184465", "0.5606314", "0.5592927", "0.55929226", "0.5591479", "0.55900747", "0.55895984", "0.5581969", "0.5581558", "0.55764973", "0.5566001", "0.5563345", "0.55624104", "0.55596995", "0.555719", "0.55475783", "0.554198", "0.55324256", "0.5526884", "0.551384", "0.5508542", "0.55054754", "0.55026954", "0.5501333", "0.5501333" ]
0.0
-1
Enlever le signalement d'un commentaire
public function unwarningComment($id) { $db = $this->dbConnect(); $commentTarget = $db->prepare("UPDATE comments SET signalement = 'Non' WHERE id=?"); $commentTarget->execute(array($id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function record_comment(){\n\t\t\t\n\t\t}", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function flag_comment() {\n\t\t\tif ( empty( $_REQUEST[ 'comment_id' ] ) || (int) $_REQUEST[ 'comment_id' ] != $_REQUEST[ 'comment_id' ] ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_values_message ) );\n\t\t\t}\n\n\t\t\t$comment_id = (int) $_REQUEST[ 'comment_id' ];\n\t\t\tif ( $this->already_flagged( $comment_id ) ) {\n\t\t\t\t$this->cond_die( __( $this->already_flagged_message ) );\n\t\t\t}\n\n\t\t\t// checking if nonces help\n\t\t\tif ( ! isset( $_REQUEST[ 'sc_nonce' ] ) || ! wp_verify_nonce( $_REQUEST[ 'sc_nonce' ], $this->_plugin_prefix . '_' . $this->_nonce_key ) ) {\n\t\t\t\t$this->cond_die( __( $this->invalid_nonce_message ) );\n\t\t\t} else {\n\t\t\t\t$this->mark_flagged( $comment_id );\n\t\t\t\t$this->cond_die( __( $this->thank_you_message ) );\n\t\t\t}\n\n\t\t}", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "public function comment() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['comment']) && !empty($_POST['comment'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->comment(explode(\"/\", $this->_url)[1], $_POST['comment'])) {\n echo \"error\";\n }\n }\n }\n }", "abstract public function comment();", "public function commentQuery()\n {\n $uznName = $_POST['uzn_name'];\n $uznID = $_POST['uzn_id'];\n\n $authID = @$_SESSION['sess_user_id'];\n $authName = @$_SESSION['sess_user_name'];\n $commText = htmlspecialchars($_POST['comment'], ENT_QUOTES);\n if(!isset($_SESSION['sess_user_id'])){\n echo 'Rakstīt atsauksmes var tikai ielogoti lietotāji. <br>';\n }\n if(isset($_SESSION['user_email_status']) &&\n $_SESSION['user_email_status'] == 'email_code_is_checked_email_verified'){\n\n $insert = \"INSERT INTO comment_section\n (comm_location_uzn, comm_location_uzn_id, comm_author_id, comm_auth_name,\n comm_tetx, comm_date)\n VALUES\n (?, ?, ?, ?, ?, NOW())\";\n $do = $this->connect()->prepare($insert);\n $do->execute([$uznName, $uznID, $authID, $authName, $commText]);\n echo \"Komentārs ir veiksmīgi izveidots.\";\n\n } else{\n echo 'Jums ir jāapstiprina e-pasts pirms rakstīt atsauksmes.';\n }\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function the_comment()\n {\n }", "function addAction($postId, $author, $comment)\n{\n\n // if ($affectedLines === false) {\n // // Erreur gérée. Elle sera remontée jusqu'au bloc try du routeur !\n // throw new Exception('Impossible d\\'ajouter le commentaire !');\n // }\n // else {\n // header('Location: index.php?action=post&id=' . $postId);\n // }\n echo \"ajoute un commentaire\";\n}", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "public function showSignaledComments()\n {\n foreach ($this->_commentsArray as $comment) {\n if ($comment['Signalement']==1) {\n echo commentsTemplate('signaled', $comment);\n }\n };\n }", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "Public function addComment(Request $request){\n // return $id;\n\n $this->validate($request,[ \n 'comment' => 'required', \n ],\n\n [\n 'comment.required' => ' اجرات خود را بنویسید ',\n ]);\n\n $user_id = Auth::user()->id;\n $comment = new AhkamComment;\n $comment->comment = $request->comment;\n $comment->ahkam_id = $request->ahkam_id;\n $comment->user_id = $user_id;\n DB::transaction(function() use ($comment) {\n $comment->save();\n });\n //to generate its notifications\n Helper::add_noti('Ahkam', $comment->id, $comment->ahkam_id);\n $request->session()->flash('alert-success', ' اجرات شما افزوده شد ' );\n return redirect()->back();\n \n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }", "function addComment($id){\n $newComment = $this->commentManager->postComment($id, $_POST['author'], $_POST['comment']);\n if($newComment === false){\n throw new \\Exception(\"Impossible d'ajouter le commentaire\");\n } else {\n header('Location: /episode/'.$id);\n }\n }", "public function commentAction() {\n $ses = new Application_Model_Session();\n $ses->startSession();\n {\n $request = $this->getRequest();\n $ExpId = $this->_getParam('expid');\n $form = new Campuswisdom_Form_Comment();\n $this->view->form = $form;\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($request->getPost())) {\n $mapper = new Campuswisdom_Model_ExpMapper();\n $Comment = $form->getValue(\"comment\");\n $mapper->setDbTable('campuswisdom_Model_DbTable_Comments');\n $smthn = $mapper->save($ExpId, $Comment);\n if ($smthn == null) {\n //an error occurred so nothing was saved\n } else {\n $ses->setSessionParameter('comnt', 1);\n }\n $this->_helper->redirector('viewcomments', 'exps', 'default', array('expid' => $ExpId));\n }\n }\n }\n }", "public function comments(){\n }", "public function keepComment ($id)\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('UPDATE comments SET signalement=0 where id_comment=?');\n $req->execute (array ( $id ));\n $message = \"\";\n return $message;\n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "public function isComment() {}", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "function view_comment()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\t$comment_id = $this->input->get('comment_id');\n\t\t$this->view_comments('', '', '', array($comment_id));\n\t}", "function verifiedComment($commentId){\n\tComment::unflag($commentId);\n\theader(\"Location: \".getenv('HOSTNAME').\"/index.php?action=adminGetArticle&id=\" . $_GET['articleId']);\n}", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "private function spamComment()\n {\n try\n {\n global $myquery;\n\n $types = array('v','p','cl','t','u');\n\n $request = $_POST;\n\n if(!isset($request['cid']) || $request['cid']==\"\")\n throw_error_msg(\"cid not provided\"); \n \n if( !is_numeric($request['cid']) )\n throw_error_msg(\"invalid cid provided\"); \n\n if(!isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type provided.\"); \n\n $cid = $request['cid'];\n $myquery->spam_comment($cid);\n \n \n if($request['type'] != 't' && isset($request['typeid']))\n {\n $type = $requets['type'];\n $typeid = mysql_clean();\n update_last_commented($type,$typeid); \n }\n \n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $msg = msg_list();\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $msg[0]);\n $this->response($this->json($data)); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "public function DeleteComment(){\r\n $this->idPost();\r\n $this->comment(); \r\n $this->_commentManager->DeleteComment($this->_idPostSecure);\r\n header('location: Gestioncommentaire'); \r\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function verif()\n {;\n if(empty($_SESSION['pseudo']))\n {\n $_SESSION['erreur2'] = \"Vous devez vous connecter !\";\n header('Location:ContenuRecette?id='.$_SESSION['recette']);\n }\n else\n {\n if(empty($_POST['commentaireRecette']))\n {\n echo 'vide';\n }\n else\n {\n $commentaire = htmlspecialchars($_POST['commentaireRecette']);\n $test = new RecetteModel();\n $test->postCommentaire($commentaire,$_SESSION['pseudo'],$_SESSION['recette']);\n header('Location:ContenuRecette?id='.$_SESSION['recette']);\n }\n }\n \t\n }", "protected function add_comment_success_message(){\r\n\t\treturn 'Thank you for <a href=\"#comments\" class=\"scroll\">commenting</a>.';\r\n\t}", "static function comment_post($id_comment){\n if(!(($id_user = PDOQueries::get_post_publisher_id_by_comment($id_comment)) > 0) || !(($id_post = PDOQueries::get_post_id_by_comment($id_comment)) > 0) || !(($id_publisher = PDOQueries::get_publisher_id($id_post)) > 0))\n throw new \\PersonalizeException(2001);\n $marker = '{comment_post}{id_publisher/'.$id_user.'}';\n $link = 'index.php?'.Navigation::$navigation_marker.'='.Timeline::$post_id_page.'#'.$id_post.$id_comment;\n return PDOQueries::add_notification($id_publisher,$marker,$link);\n }", "protected function prepareOnlineComment(){\n $this->onlineComment();\n header('Location: index.php?action=article&number='.$this->getNumber().'');\n }", "function wp_new_comment_notify_moderator($comment_id)\n {\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}", "private function comment_edit_submit( ) {\n\n if ( ! ( in('post_ID') || in('comment_ID') || in('comment_parent') ) ) ferror(-500481, \"None of post_ID, comment_ID, comment_parent has provided.\");\n $comment_ID = in( 'comment_ID' );\n $update = $comment_ID ? true : false;\n \n \n if ( $update ) {\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n }\n else {\n $post_ID = in('post_ID');\n if ( empty( $post_ID ) ) {\n $comment = get_comment(in('comment_parent'));\n $post_ID = $comment->comment_post_ID;\n }\n }\n forum()->setCategoryByPostID($post_ID);\n\n\n\n //\n if ( $update ) { // update\n $this->endIfNotMyComment( $comment_ID );\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n add_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $user_ID = $this->get_post_author();\n $user = get_user_by( 'id', $user_ID );\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'comment_author' => $user->user_login,\n 'user_id' => $user_ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n $this->errorResponse(-50302, \"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n // $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ; // this is not used.\n\n //\n $files = in('files');\n if ( $files ) {\n $arr = explode('| |', $files);\n $files = array_filter( $arr );\n comment()->meta( $comment_ID, 'files', $files );\n }\n\n\n\n // Save All extra input into post meta.\n comment()->saveAllMeta( $comment_ID );\n\n\n $o = [ 'post_ID' => $post_ID, 'comment_ID' => $comment_ID ];\n // if ( in('response') == 'ajax' ) $o['comment'] = comment()->get_comment_with_meta( $comment_ID );\n $this->response( $o );\n }", "function wp_spam_comment($comment_id)\n {\n }", "public function commentaireAction(){\n\t\t\t$mode \t\t= \"backend\";\n\t\t\t$action = @$_GET['action']; \n\t\t\t$this->cmt->setIdentifiant(@$_GET['idcom']);\n\t\t\t\n\t\t\tswitch($action){\n\t\t\t\tcase \"reset\"; \n\t\t\t\t\t$commentaires = $this->com->resetReport($this->cmt);\n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\n\t\t\t\tcase \"delete\"; \n\t\t\t\t\t$commentaires = $this->com->deleteComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"valide\"; \n\t\t\t\t\t$commentaires = $this->com->confirmComment($this->cmt); \n\t\t\t\t\tbreak; \t\n\t\t\t\t\t\t\n\t\t\t\tdefault;\n\t\t\t\t\t$this->cmt->setNbrReport(@$_POST['valRprt']);\n\t\t\t\t\t$mode = \"frontend\";\n\t\t\t\t\t$commentaires = $this->com->reportComment($this->cmt); \n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\techo $this->info->resultAff(\"commen\", \"commentaires\", $commentaires, $mode);\n\t\t}", "public function have_comments()\n {\n }", "public function getCommentaire()\n\t{\n\t\treturn $this->commentaire;\n\t}", "function ffeeeedd_comment( $comment, $args, $depth ) {\n $GLOBALS['comment'] = $comment;\n switch ( $comment->comment_type ) {\n case 'pingback' :\n case 'trackback' :\n // On affiche différemment les trackbacks. ?>\n <li <?php comment_class(); ?>>\n <p><?php _e( 'Pingback :', 'ffeeeedd' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'ffeeeedd' ), '<span class=\"edit-link\">', '</span>' ); ?></p>\n <?php break;\n default :\n // On passe aux commentaires standards.\n global $post; ?>\n <li itemscope itemtype=\"http://schema.org/UserComments\">\n <article role=\"article\">\n <header>\n <?php echo get_avatar( $comment, 44 );\n printf( '<cite itemprop=\"creator\">%1$s %2$s</cite>',\n get_comment_author_link(),\n ( $comment->user_id === $post->post_author ) ? '<small> (' . __( 'Post author', 'ffeeeedd' ) . ' ) </small>' : ''\n );\n printf( '<time datetime=\"%2$s\" itemprop=\"commentTime\">%3$s</time>',\n esc_url( get_comment_link( $comment->comment_ID ) ),\n get_comment_time( 'c' ),\n sprintf( '%1$s à %2$s', get_comment_date(), get_comment_time() )\n ); ?>\n </header>\n\n <?php if ( '0' == $comment->comment_approved ) { ?>\n <p><?php _e( 'Your comment is awaiting moderation.', 'ffeeeedd' ); ?>.</p>\n <?php } ?>\n\n <div itemprop=\"commentText\">\n <?php comment_text(); ?>\n <?php edit_comment_link( __( 'Edit', 'ffeeeedd' ), '<p>', '</p>' ); ?>\n </div>\n\n <div class=\"reply\" itemprop=\"replyToUrl\">\n <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'ffeeeedd' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>\n </div>\n </article>\n <?php break;\n }\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }", "public function commenter($auteur, $contenu, $idchapChapitre) {\n $this->commentaire->ajouterCommentaire($auteur, $contenu, $idchapChapitre);\n // actualise la vue du chapitre.\n $this->chapitre($idchapChapitre);\n }", "function comment_author($comment_id = 0)\n {\n }", "public function add_comm()\n {\n $this->comments++;\n }", "public function execute() {\n\t\tif(!empty($_POST['author']) OR (empty($_POST['author']) AND isset($_SESSION['username']) AND !empty($_POST['content']))) {\n\t\t\t$comment = new Comment();\n\t\t\t$comment->setArticleId($_GET['id']);\n\t\t\tif(isset($_SESSION['username'])) {\n\t\t\t\t$comment->setAuthor($_SESSION['username']);\n\t\t\t} else {\n\t\t\t\t$comment->setAuthor($_POST['author']);\n\t\t\t}\n\t\t\t$comment->setContent($_POST['content']);\n\t\t\tif(isset($_POST['parentId'])) {\n\t\t\t\t$comment->setParentId($_POST['parentId']);\n\t\t\t}\n\t\t\t$this->commentManager->add($comment);\n\t\t\t$_SESSION['flash']['success'] = 'Votre commentaire a bien été ajouté.';\n\t\t}\n\n\t\t// Signalement d'un commentaire.\n\t\tif(isset($_GET['action'])) {\n\t\t\tif($_GET['action'] == 'signal') {\n\t\t\t\t$comment = $this->commentManager->getSpecificComment($_GET['commentId']);\n\t\t\t\t$this->commentManager->signal($comment);\n\t\t\t\t$_SESSION['flash']['success'] = 'Le commentaire a bien été signalé. Il sera modéré par l\\'administrateur dès que possible.';\n\t\t\t}\n\t\t}\n\n\t\t// Les 5 derniers articles publiés et un article spécifique.\n\t\t$lastArticles = $this->articleManager->getLastArticles();\n\t\t$articleUnique = $this->articleManager->getUnique($_GET['id']);\n\t\t// Liste des commentaires de l'article courant et total de ses commentaires.\n\t\t$listOfComments = $this->commentManager->getComments($_GET['id']);\n\t\t$numberOfComments = $this->commentManager->count($_GET['id']);\n\n\t\t$viewSingle = new ViewSingle($articleUnique, $listOfComments, $numberOfComments, $lastArticles);\n\t\t$viewSingle->display();\n\t}", "public function message()\n {\n return 'wrong comment id';\n }", "public function warningComment($id)\n {\n $db = $this->dbConnect();\n $commentTarget = $db->prepare(\"UPDATE comments SET signalement = 'Oui' WHERE id=?\");\n $commentTarget->execute(array($id));\n }", "public function viphamcommentAction()\n\t{\n\t\t$idcomment = $this->getRequest()->getParam('idcomment');\r\n\t\t$idnews = $this->getRequest()->getParam('idnews');\r\n\t\t$mTinTuc = new Default_Model_Mtintuc();\r\n\t\t\r\n\t\t$mTinTuc->viphamComment($idcomment);\r\n\t\t$this->view->comment = $mTinTuc->getInfoComment($idcomment);\t\t\n\t}", "function getIdCommentaire() {\n return $this->idCommentaire;\n }", "function warquest_home_comment_edit_do() {\r\n\r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\t\t \r\n\t/* output */\r\n\tglobal $page;\r\n\t\t\t\r\n\tif ($uid!=0) {\r\n\t\t$query = 'select comment from comment where id='.$uid;\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$data = warquest_db_fetch_object($result);\r\n\t\t\r\n\t\t$comment = $data->comment;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/* Clear input parameters */\r\n\t\t$comment = \"\";\r\n\t}\r\n\t\r\n\t$page .= \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">function limitText(limitField, limitNum) { if (limitField.value.length >= limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } </script>\";\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\t\r\n\t\r\n\t$page .= '<table>';\r\n\t$page .= '<tr>';\r\n\t$page .= '<td width=\"500\">';\r\n\r\n\tif (isset($other->pid)) {\r\n\t\t$tmp = player_format($other->pid, $other->name, $other->country);\r\n\t} else {\r\n\t\t$tmp = t('GENERAL_ALL');\r\n\t}\r\n\t$page .= t('ALLIANCE_COMMENT_TEXT2', $tmp).'<br/>'; \r\n\t\r\n\t$page .= '<textarea style=\"width:100%\" id=\"comment\" name=\"comment\" rows=\"5\" ';\r\n\t$page .= 'onKeyDown=\"limitText(this,400)\">'.$comment.'</textarea><br/>';\r\n\t$page .= warquest_show_smilies();\r\n\t$page .= '<br/><br/>';\r\n\t\r\n\tif (isset($other->pid)) {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&oid='.$other->pid.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t} else {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t}\r\n\t\r\n\tif ($uid!=0) {\r\n\t\t$page .= ' ';\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_DELETE.'&uid='.$uid, t('LINK_DELETE'), 'delete');\r\n\t}\r\n\t\r\n\t$page .= '</td>';\r\n\t$page .= '</tr>';\r\n\t$page .= '</table>';\r\n\r\n\t$page .= '</div>';\t\r\n}", "public function getCommentaire() {\n return $this->commentaire;\n }", "function addCommentHandler() {\n global $inputs;\n\n $content = $inputs['content'];\n $id = $inputs['id'];\n $replyId = insert('reply',[\n 'content' => $content\n ]);\n\n insert('posting_reply',[\n 'posting_id' => $id,\n 'reply_id' => $replyId\n ]);\n\n insert('member_reply',[\n 'member_id' => getLogin()['mid'],\n 'posting_id' => $id\n ]);\n\n formatOutput(true, 'success');\n}", "function wap8_trackbacks( $comment ) {\n$GLOBALS['comment'] = $comment; ?>\n<li><?php printf( __( '%s', 'designcrumbs' ), get_comment_author_link() ) ?> <?php edit_comment_link( __( 'Edit', 'designcrumbs' ), '<span>', '</span>' ); ?>\n<?php\n}", "function tempera_comments_on() {\nglobal $temperas;\nforeach ($temperas as $key => $value) { ${\"$key\"} = $value; }\t\n\tif ( comments_open() && ! post_password_required() && $tempera_blog_show['comments'] && ! is_single()) :\n\t\tprint '<div class=\"comments-link\"><i class=\"icon-comments icon-metas\" title=\"' . __('Comments', 'tempera') . '\"></i>';\n\t\tprintf ( comments_popup_link( __( '<b>0</b>', 'tempera' ), __( '<b>1</b>', 'tempera' ), __( '<b>%</b>', 'tempera' ),(''),__('<b>-</b>','tempera') ));\n\t\tprint '</div>';\n\tendif;\n}", "public function comment_ticket()\n {\n $response = array(\n 'status' => 'true',\n 'message' => ''\n );\n\n $status = $this->comments_processor->form_sanitation($_POST, 'Chat');\n\n if (!$status) {\n $response['status'] = 'false';\n }\n\n die(json_encode($response));\n }", "public function addSignalement(Commentaire $commentaire)\r\n {\r\n $bdd = $this->bdd;\r\n $query = 'UPDATE t_commentaire SET COM_SIGNALEMENT = 1 WHERE COM_ID =' . $commentaire->getcomId();\r\n $req = $bdd->prepare($query);\r\n $req->bindValue('1', $commentaire->getComSignalement(), PDO::PARAM_INT);\r\n $req->execute();\r\n }", "static public function comment_submission() {\n ?>\n\n /**\n * Déclenchement d'événements Google analytics lors de la soumission\n * d'un commentaire.\n *\n * source https://felix-arntz.me/blog/customizing-google-analytics-configuration-site-kit-plugin/\n */\n $('#commentform input[type=\"submit\"]').on('click',function(){\n console.log('SFP: Comment submited');\n if(typeof gtag=='function'){\n gtag('event','Commentaire',{\n 'event_category':'Implication',\n 'event_label':window.location.href\n });\n }\n });\n\n <?php\n }", "public function commentAction ()\n {\n /* @var $user User */\n $user = $this->getUser();\n if(!$user) {\n throw new UnauthorizedHttpException('You must be logged in to comment.');\n }\n \n $request = $this->getRequest();\n \n $decklist_id = filter_var($request->get('id'), FILTER_SANITIZE_NUMBER_INT);\n $decklist = $this->getDoctrine()\n ->getRepository('NetrunnerdbBuilderBundle:Decklist')\n ->find($decklist_id);\n \n $comment_text = trim(filter_var($request->get('comment'), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));\n if ($decklist && ! empty($comment_text)) {\n $comment_text = preg_replace(\n '%(?<!\\()\\b(?:(?:https?|ftp)://)(?:((?:(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)(?:\\.(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)*(?:\\.[a-z\\x{00a1}-\\x{ffff}]{2,6}))(?::\\d+)?)(?:[^\\s]*)?%iu',\n '[$1]($0)', $comment_text);\n \n $mentionned_usernames = array();\n if(preg_match_all('/`@([\\w_]+)`/', $comment_text, $matches, PREG_PATTERN_ORDER)) {\n $mentionned_usernames = array_unique($matches[1]);\n }\n \n $comment_html = Markdown::defaultTransform($comment_text);\n \n $now = new DateTime();\n \n $comment = new Comment();\n $comment->setText($comment_html);\n $comment->setCreation($now);\n $comment->setAuthor($user);\n $comment->setDecklist($decklist);\n \n $this->get('doctrine')\n ->getManager()\n ->persist($comment);\n $decklist->setTs($now);\n $decklist->setNbcomments($decklist->getNbcomments() + 1);\n\n $this->get('doctrine')\n ->getManager()\n ->flush();\n \n // send emails\n $spool = array();\n if($decklist->getUser()->getNotifAuthor()) {\n if(!isset($spool[$decklist->getUser()->getEmail()])) {\n $spool[$decklist->getUser()->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_author.html.twig';\n }\n }\n foreach($decklist->getComments() as $comment) {\n /* @var $comment Comment */\n $commenter = $comment->getAuthor();\n if($commenter && $commenter->getNotifCommenter()) {\n if(!isset($spool[$commenter->getEmail()])) {\n $spool[$commenter->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_commenter.html.twig';\n }\n }\n }\n foreach($mentionned_usernames as $mentionned_username) {\n /* @var $mentionned_user User */\n $mentionned_user = $this->getDoctrine()->getRepository('NetrunnerdbUserBundle:User')->findOneBy(array('username' => $mentionned_username));\n if($mentionned_user && $mentionned_user->getNotifMention()) {\n if(!isset($spool[$mentionned_user->getEmail()])) {\n $spool[$mentionned_user->getEmail()] = 'NetrunnerdbBuilderBundle:Emails:newcomment_mentionned.html.twig';\n }\n }\n }\n unset($spool[$user->getEmail()]);\n \n $email_data = array(\n 'username' => $user->getUsername(),\n 'decklist_name' => $decklist->getName(),\n 'url' => $this->generateUrl('decklist_detail', array('decklist_id' => $decklist->getId(), 'decklist_name' => $decklist->getPrettyname()), TRUE) . '#' . $comment->getId(),\n 'comment' => $comment_html,\n 'profile' => $this->generateUrl('user_profile', array(), TRUE)\n );\n foreach($spool as $email => $view) {\n $message = \\Swift_Message::newInstance()\n ->setSubject(\"[NetrunnerDB] New comment\")\n ->setFrom(array(\"[email protected]\" => $user->getUsername()))\n ->setTo($email)\n ->setBody($this->renderView($view, $email_data), 'text/html');\n $this->get('mailer')->send($message);\n }\n \n }\n \n return $this->redirect($this->generateUrl('decklist_detail', array(\n 'decklist_id' => $decklist_id,\n 'decklist_name' => $decklist->getPrettyName()\n )));\n \n }", "public function get_commentaire(){retrun($id_local_commentaire); }", "function edit_comment($comment)\n {\n }", "public function Commento($idricetta){\n if(($_SERVER['REQUEST_METHOD']==\"POST\")){\n $session = Sessione::getInstance();\n if($session->isLoggedUtente()){\n $view = new VDettaglio();\n $commento = $view->recuperaCommento();\n $utente = $session->getUtente();\n $idutente = $utente->getId();\n //costruzione di ECommento\n $com = new ECommento($commento['testo'], $commento['data'], $commento['ora'], $idutente, $idricetta);\n $pm = FPersistentManager::getInstance();\n $id = $pm->store($com);\n //devo aggiornare l'oggetto utente nei dati di sessione (ha un nuovo commento)\n $utente = $pm->loadById(\"utente\", $idutente);\n $session->setUtenteLoggato($utente);\n if($id){\n //inserimento corretto, redirect a dettaglio ricetta attuale (usiamo il metodo Ricetta di questo controller)\n header('Location: /myRecipes/web/Ricette/Ricetta/'.$idricetta);\n } else {\n //messaggio errore inserimento non corretto\n $viewerr = new VErrore();\n $viewerr->mostraErrore(\"Inserimento commento non corretto\");\n }\n\n } else { //utente non loggato\n //redirect alla form di login\n header('Location: /myRecipes/web/Utente/Login');\n }\n\n }\n else{\n header('HTTP/1.1 405 Method Not Allowed');\n header('Allow: POST');\n }\n\n\n }", "function submit_comment($post)\n {\n $query = \"INSERT INTO comments (comment, users_id, messages_id)\n VALUES ('{$post['comment_content']}', '{$_SESSION['user_id']}', '{$post['post_id']}')\";\n run_mysql_query($query);\n header('Location:wall.php');\n exit();\n }", "public function ajax_comment(){\n\t\t\n $comment = isset( $_POST['message'] ) ? sanitize_text_field( $_POST['message'] ) : '';\n $post_id = isset( $_POST['post_id'] ) ? sanitize_text_field( $_POST['post_id'] ) : '';\n\t\t\t$user_id = isset( $_POST['user_id'] ) ? sanitize_text_field( $_POST['user_id'] ) : '';\n\t\t\t\n\t\t\t//Traigo data de usuario\n $user_data = get_userdata( $user_id );\n\n\t\t\t//Verifico que venga con informacion\n\t\t\tif ( '' === $comment \n\t\t\t\tOR '' === $post_id\n\t\t\t\tOR '' === $user_id\n\t\t\t) {\n\t\t\t\twp_send_json_error( 'Error en el pedido de informacion.');\t\n\t\t\t\t die();\n\t\t\t}\n\n $commentdata = array(\n\t\t\t\t'comment_author' => $user_data->user_login,\n\t\t\t\t'comment_content' \t=> $comment,\n\t\t\t\t'user_id' => $user_id,\n 'comment_post_ID' => $post_id,\n\t\t\t\t'comment_approved' => '1',\n\t\t\t\t'comment_type' => 'public'\n );\n \n if ( wp_insert_comment( $commentdata ) ) { \n\n //Tomo la data de la id denuncia\n $commentary = array();\n $commentaux['comment'] = $comment;\n $commentaux['user'] = $user_data->user_login;\n $commentaux['time'] = date( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) );\n array_push( $commentary , $commentaux ); //array\n\n\n\t\t\t\t\t$user = wp_get_current_user();\n\t\t\t\t\t//print_r($user);\n\t\t\t\t\t//Si lo puso una persona aviso a usuarios\n\t\t\t\t\tif ( ( $user->roles[0] == 'denunciante' ) OR ( $user->roles[0] == 'suscriptor' ) ){\n\t\t\t\t\t\t\t//Envio de mail\n\t\t\t\t\t\t\tmail_new_comment_vecino ( $user->user_nicename, '', '', $post_id );\n\t\t\t\t\t}\n\n echo json_encode( array(\n 'status' => 'success', \n 'commentary' => $commentary \n ));\n\t\t\t}else{\n\t\t\t\techo json_encode( array('loggedin'=>false, 'message'=>__('Error de usuario o contraseña. Volve a intentarlo.')));\n\t\t\t}\n\t\t\t\n\t\t\tdie();\t}", "function save_comment($id_thread,$id_objet,$title,$name,$email,$body){\n\t\tglobal $con;\n\t\t$statut;\n\t\t$date=date(\"Y-m-d h:i:s\");\n\t\t$query=mysqli_query($con,\"INSERT INTO spip_forum(id_forum,id_objet,objet,id_parent,id_thread,titre,texte,auteur,email_auteur,nom_site,url_site,statut,ip,maj,mobile,id_auteur,notification,notification_email,composition,composition_lock,date_heure,date_thread)\n\t\t\tVALUES(\\\"$id_thread\\\",'$id_objet','article','0','$id_thread','$title','$body','$name','$email','','','publie','NULL','','yes','0','1','','','0','$date','$date')\");\n\t\tif($query){\n\t\t\t$statut=true;\n\t\t}else{\n\t\t\t$statut=mysqli_error($con);\n\t\t}\n\n\t\treturn $statut;\n\t}", "function starkers_comment( $comment, $args, $depth ) {\n\t$GLOBALS['comment'] = $comment; \n\t?>\n\t<?php if ( $comment->comment_approved == '1' ): ?>\t\n\t<li>\n\t\t<article id=\"comment-<?php comment_ID() ?>\">\n\t\t\t<?php echo get_avatar( $comment ); ?>\n\t\t\t<h4><?php comment_author_link() ?></h4>\n\t\t\t<time><a href=\"#comment-<?php comment_ID() ?>\" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time>\n\t\t\t<?php comment_text() ?>\n\t\t</article>\n\t<?php endif; ?>\n\t</li>\n\t<?php \n}", "public function commenter($auteur, $comm, $idBillet)\n {\n $donnees = array('auteur' => $auteur,\n 'commentaire' => $comm,\n 'idBillet' => $idBillet);\n $commentaire = new Commentaire($donnees);\n $commentaire->setAuteur($auteur);\n $commentaire->setCommentaire($comm);\n $commentaire->setId_billet($idBillet);\n \n $this->commentaire->postCommentaire($commentaire);\n $_SESSION['info'] = 'Votre commentaire a bien été publié ! ';\n header('Location: index.php?action=billet&id='.$idBillet.'&page=1#ajoutCom');\n }", "function warquest_home_comment_delete_do() {\r\n\t\r\n\t/* input */\r\n\tglobal $uid;\r\n\t\r\n\t/* output */\r\n\tglobal $comment;\r\n\tglobal $output;\r\n\t\r\n\tif (warquest_db_comment_delete($uid) == 1) {\r\n\t\t\r\n\t\t$message = t('HOME_MESSAGE_DELETED');\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\t\t\r\n\t\t\r\n\t\t$comment=\"\";\r\n\t\t$uid=0;\r\n\t}\r\n}", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "public function getCommentaire()\n {\n return $this->commentaire;\n }", "public function getCommentaire()\n {\n return $this->commentaire;\n }", "public function commentaire($id)\n {\n $commentaire = Commentaire::findOrFail($id);\n $id_utilisateur = \\Auth::user()->id;\n \\Mail::to('[email protected]')->send(new AvertissementNuisanceCommentaireEmail($commentaire, $id_utilisateur));\n return back();\n }", "public function getComment() {}", "public function InsertComment()\n {\n global $DB, $categoryid, $mainsettings, $sdlanguage, $sdurl, $userinfo;\n\n if(empty($this->_internal_call))\n {\n $this->setPerm($this->plugin_id,$this->object_id);\n }\n if(empty($this->plugin_id) || empty($this->object_id))\n {\n return false;\n }\n $errors_arr = array();\n\n if(!CheckFormToken('comment_token', false))\n {\n $errors_arr[] = $sdlanguage['error_invalid_token'];\n }\n else\n if(!$this->hasPostAccess)\n {\n $errors_arr[] = $sdlanguage['comment_access_denied'];\n }\n\n $comment = GetVar('comment_comment', '', 'string', true, false);\n\t\n if(empty($userinfo['loggedin']))\n {\n $username = GetVar('comment_username', '', 'string', true, false);\n //SD343:\n if((strlen($username) < 3) ||\n ($username != preg_replace(\"/%0A|\\\\r|%0D|\\\\n|%00|\\\\0|\\\\t|%01|%02|%03|%04|%05|%06|%07|%08|%09|%0B|%0C|%0E|%0F|%10|%11|%12|%13/im\", '', $username)) ||\n (function_exists('DetectXSSinjection') && DetectXSSinjection(unhtmlspecialchars($comment))) )\n {\n $errors_arr[] = $sdlanguage['enter_comment_name'];\n }\n }\n else\n {\n $username = $userinfo['username'];\n }\n\n #$comment = htmlspecialchars(strip_tags(sd_htmlawed(unhtmlspecialchars($comment))));\n if(strlen($comment) < 3)\n {\n $errors_arr[] = $sdlanguage['enter_comment'];\n }\n\n if(!CaptchaIsValid())\n {\n $errors_arr[] = $sdlanguage['captcha_not_valid'];\n }\n\n // ########################################################################\n // ##################### SECURITY CHECK - START ###########################\n // ########################################################################\n // SD313: for security - detect SQL/XSS injection in original post\n // Note: functions are in \"functions_security.php\" which is normally\n // included already in \"init.php\", but better check by \"function_exists\"\n if(strlen($comment))\n {\n $comment = sd_unhtmlspecialchars($comment);\n $comment = preg_replace(\"/%0A|%0D|%00|\\\\0|%01|%02|%03|%04|%05|%06|%07|%08|%0B|%0C|%0E|%0F|%11|%12/im\", '', $comment);\n if(function_exists('DetectXSSinjection') && DetectXSSinjection($comment))\n {\n $comment = '';\n $errors_arr[] = $sdlanguage['comment_rejected'];\n unset($_POST['comment_comment']);\n }\n else\n {\n $comment = htmlspecialchars(strip_alltags($comment));\n }\n }\n\n //SD343: combined blacklist check and SFS checking user's email and IP\n $blacklisted = false;\n if(empty($errors_arr))\n {\n if(!empty($mainsettings['comments_sfs_antispam']) && defined('USERIP') &&\n function_exists('sd_sfs_is_spam') &&\n sd_sfs_is_spam((empty($userinfo['email'])?null:$userinfo['email']),USERIP))\n {\n $blacklisted = true;\n }\n if(!$blacklisted && !empty($mainsettings['comments_enable_blocklist_checks']) &&\n function_exists('sd_reputation_check'))\n {\n $blacklisted = sd_reputation_check(USERIP, 1, 'comments_enable_blocklist_checks');\n }\n\n if($blacklisted)\n {\n WatchDog('Comments','<b>Comment rejected (blacklisted): '.$username.\n '</b>, IP: </b><span class=\"ipaddress\">'.USERIP.'</span></b><br />'.\n ' for plugin id: '.$this->plugin_id.', object id: '.$this->object_id,\n WATCHDOG_ERROR);\n $errors_arr[] = $sdlanguage['ip_listed_on_blacklist'];\n }\n }\n\n // ########################################################################\n // ####################### SECURITY CHECK - END ###########################\n // ########################################################################\n\n $comment_id = false;\n $result = false;\n if(empty($errors_arr))\n {\n unset($_POST['comment_comment']);\n // check for repeat posting\n $DB->result_type = MYSQL_ASSOC;\n $lastentry = $DB->query_first('SELECT username, comment FROM {comments}\n WHERE pluginid = %d AND objectid = %d\n ORDER BY commentid DESC LIMIT 1',\n $this->plugin_id, $this->object_id);\n if(($lastentry['username'] == $username) && ($lastentry['comment'] == $comment))\n {\n $addJS = true;\n //SD360: return error message if called by Ajax\n if(Is_Ajax_Request())\n {\n return $sdlanguage['repeat_comment'];\n }\n else\n {\n if(empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['repeat_comment'], true);\n }\n $this->DisplayCommentRows();\n if(!empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['repeat_comment'], true);\n }\n }\n }\n else\n {\n $approved = ($userinfo['loggedin'] ||\n !empty($mainsettings['comments_guest_auto_approve'])) ? 1 : 0;\n //SD322: check for groups with approval being required:\n if($approved && empty($userinfo['adminaccess']))\n {\n $groups = isset($mainsettings['comments_require_approval_groups'])?$mainsettings['comments_require_approval_groups']:'';\n if(@in_array($userinfo['usergroupid'], sd_ConvertStrToArray($groups)))\n {\n $approved = 0;\n }\n }\n //SD342: censor comments if enabled\n if(!empty($mainsettings['censor_comments']))\n {\n $comment = sd_removeBadWords($comment);\n }\n if(strlen($comment) &&\n $DB->query('INSERT INTO '.PRGM_TABLE_PREFIX.'comments (pluginid, objectid, date, userid, username, comment, approved, ipaddress, categoryid)'.\n \" VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d)\",\n $this->plugin_id, $this->object_id, TIME_NOW, $userinfo['userid'],\n $username, $DB->escape_string($comment), $approved, USERIP, $categoryid))\n {\n $this->comment_id = $DB->insert_id();\n $this->UpdateCommentsCount();\n\n //SD342 check for max comments\n if(!empty($this->max_comments) && ($this->GetCommentsCount(false) >= $this->max_comments))\n {\n $this->allow_comments = false;\n }\n\n $this->SendNotification($username, $this->plugin_id, htmlspecialchars(strip_alltags(unhtmlspecialchars($comment))), $approved); //SD332\n\n //SD342: send subscription notifications if comment was approved\n if($approved)\n {\n if(!class_exists('SDSubscription'))\n {\n include_once(SD_INCLUDE_PATH.'class_userprofile.php');\n }\n $sub = new SDSubscription($userinfo['userid'],$this->plugin_id,$this->object_id,'comments',$categoryid);\n $sub->SendNotifications();\n unset($sub);\n }\n }\n\n //SD360: return true if called by ajax\n if(Is_Ajax_Request())\n {\n return true;\n }\n\n if($this->allow_comments && empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['comment_posted']);\n }\n $this->DisplayCommentRows();\n if($this->allow_comments && !empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($sdlanguage['comment_posted']);\n }\n $result = true;\n }\n }\n else\n if(!Is_Ajax_Request())\n {\n if(empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($errors_arr, true);\n }\n $this->DisplayCommentRows();\n if(!empty($mainsettings['commentorder']))\n {\n $this->DisplayCommentForm();\n DisplayMessage($errors_arr, true);\n }\n }\n\n //SD360: return true or first error message for ajax call\n if(Is_Ajax_Request())\n {\n return empty($errors_arr)?'success':$errors_arr[0];\n }\n\n $div_name = ($result?'success_message':'error_message');\n echo '\n<script type=\"text/javascript\">\njQuery(document).ready(function() {\n if (typeof jQuery.fn.scrollTo == \"undefined\") {\n jQuery.getScript(\"'.$sdurl.MINIFY_PREFIX_F.'includes/javascript/jquery.scrollTo-min.js\", function(){\n jQuery.scrollTo(\"form[name=comment-form-p'.$this->plugin_id.']\", 400);\n jQuery(\"div#'.$div_name.'\").delay(3000).slideUp();\n });\n } else {\n jQuery.scrollTo(\"form[name=comment-form-p'.$this->plugin_id.']\", 400);\n jQuery(\"div#'.$div_name.'\").delay(3000).slideUp();\n };\n});\n</script>\n ';\n\n return $result;\n\n }", "function handle_editcomment($commentid)\n{\n\tdie(\"A hozzászólások nem szerkeszthetőek. A bejegyzések tulajdonosai <a href=\\\"/delcomment/$commentid\\\">törölhetik</a> a hozzászólásokat.\");\n}", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function editcomment(Request $request){\n \n if($request->user_id == Auth::user()->id){\n $comment = AhkamComment::findOrFail($request->comment_id);\n $comment->comment = $request->comment;\n DB::transaction(function() use ($comment) {\n $comment->save();\n /*\n * Safe saving a file if an error occure db transaction rollback everything\n */\n });\n $request->session()->flash('alert-success', ' اجرات شما ویرایش شد ' );\n return redirect()->back();\n } else {\n return \"انجام نشد \";\n }\n\n}", "function addComment(int $postId, string $postTitle, string $author, string $comment, string $email)\r\n {\r\n //to encode the json\r\n header( 'Content-Type: application/json' );\r\n if (empty($author ) || empty( $comment ) || empty( $email )) {\r\n $data = array('reponse' => 'error', 'content' => \"Per poter inviare il messaggio bisogna riempire tutti i campi\");\r\n } else {\r\n $affectedLines = $this->CommentModel->postComment( $postId, $author, $comment, $email );\r\n\r\n if ($affectedLines === false) {\r\n throw new Exception( 'Impossibile aggiungere il commento !' );\r\n } else {\r\n // Create the Transport\r\n $transport = (new \\Swift_SmtpTransport( 'smtp.mailtrap.io', 2525 ))\r\n ->setUsername( 'dba91667e2ea0a' )\r\n ->setPassword( 'dc8598d61f7a38' );\r\n\r\n // Create the Mailer using your created Transport\r\n $mailer = new \\Swift_Mailer( $transport );//configuration smtp\r\n\r\n // Create a message\r\n $message = (new \\Swift_Message( 'Hai ricevuto un nuovo commento al tuo post \"' . $postTitle . '\"' ))\r\n ->setFrom( [$email => $author] )\r\n ->setTo( ['[email protected]' => 'A Damiano'] )\r\n ->setBody( 'Hai ricevuto un nuovo commento al tuo post dal titolo \"'. $postTitle. '\" <br><br>Ecco il commento:<br><br>\" '.$comment . '\" <br><br>Indirizzo e-mail dell\\'autore del commento: ' . $email. '<br><br>Puoi accedere alla pagina del commento, per decidere se approvarlo o meno, direttamente dal tuo spazio admin tramite questo <a href=\"http://localhost:8888/Damiano_Civiletto/adminPost-'. $postId. '\">link</a>', 'text/html' );\r\n\r\n // Send the message\r\n $result = $mailer->send( $message );\r\n\r\n if ($result) {\r\n $data = array('reponse' => 'success', 'content' => \"Il messaggio è stato inviato correttamente ma sarà visibile soltanto dopo essere stato approvato\");\r\n }\r\n }\r\n }\r\n echo json_encode( $data );\r\n }", "public function ajouterCommentaire($auteur, $contenu, $idBillet) {\n $auteur = htmlspecialchars($auteur);\n $contenu = htmlspecialchars($contenu);\n $sql = 'insert into T_COMMENTAIRE(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)'\n . ' values(?, ?, ?, ?)';\n $date = date('Y-m-d H:i:s'); // Récupère la date courante\n $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet));\n }", "function get_comment_ID()\n {\n }", "function voyage_mikado_comment($comment, $args, $depth) {\n\n $GLOBALS['comment'] = $comment;\n\n global $post;\n\n $is_pingback_comment = $comment->comment_type == 'pingback';\n $is_author_comment = $post->post_author == $comment->user_id;\n\n $comment_class = 'mkdf-comment clearfix';\n\n if($is_author_comment) {\n $comment_class .= ' mkdf-post-author-comment';\n }\n\n if($is_pingback_comment) {\n $comment_class .= ' mkdf-pingback-comment';\n }\n\n ?>\n\n <li>\n <div class=\"<?php echo esc_attr($comment_class); ?>\">\n <?php if(!$is_pingback_comment) { ?>\n <div class=\"mkdf-comment-image\"> <?php echo voyage_mikado_kses_img(get_avatar($comment, 75)); ?> </div>\n <?php } ?>\n <div class=\"mkdf-comment-text\">\n <div class=\"mkdf-comment-info\">\n <h5 class=\"mkdf-comment-name\">\n <?php if($is_pingback_comment) {\n esc_html_e('Pingback:', 'voyage');\n } ?>\n <?php echo wp_kses_post(get_comment_author_link()); ?>\n </h5>\n <span class=\"mkdf-comment-date\"><?php comment_time(get_option('date_format')); ?><?php esc_html_e(' at ', 'voyage'); ?><?php comment_time(get_option('time_format')); ?></span>\n </div>\n\n <?php if(!$is_pingback_comment) { ?>\n <div class=\"mkdf-text-holder\" id=\"comment-<?php echo comment_ID(); ?>\">\n <?php comment_text(); ?>\n <div class=\"mkdf-comment-reply-holder\">\n <?php\n comment_reply_link(array_merge($args, array(\n 'depth' => $depth,\n 'max_depth' => $args['max_depth']\n )));\n edit_comment_link();\n ?>\n </div>\n </div>\n <?php } ?>\n </div>\n </div>\n <?php //li tag will be closed by WordPress after looping through child elements ?>\n\n <?php\n }", "function save_comment($comment_id)\n {\n }", "public function ajouterCommentaire($auteur, $contenu, $idBillet) {\r\n $sql = 'insert into t_commentaire(COM_DATE, COM_AUTEUR, COM_CONTENU, BIL_ID)'\r\n . ' values(?, ?, ?, ?)';\r\n $date = date('Y-m-d H:i:s'); // Récupère la date courante\r\n $this->executerRequete($sql, array($date, $auteur, $contenu, $idBillet));\r\n }", "public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }", "public function ajoutCommentaire(SetUpComment $ajout)\n {\n\n $message = $ajout->getMessage();\n $note = $ajout->getNote();\n $login = $_SESSION['login'];\n $film = $ajout->getFilm();\n try\n {\n $bdd= new PDO('mysql:host=localhost;dbname=cinemaphp;charset=utf8','root','');\n }\n catch(Exception $e)\n {\n die('Erreur:'.$e->getMessage());\n }\n\n $req = $bdd->prepare('INSERT INTO comment (message,login,note,film) VALUES (?,?,?,?)');\n $req -> execute(array($message,$login,$note,$film));\n\n\n }", "function comment($id_post, $comment) {\n\n\t\tif(!empty($comment))\n\t\t{\n\t\t\t$req = $GLOBALS['bdd']->prepare('INSERT INTO badin(balsamine, bigarade, bouquetin, brimade, bryophite) VALUES(:id_posts, :id_auteur, 2, NOW(), :comment)');\n\t\t\t$req->execute(array('id_posts' => $id_post,\n\t\t\t\t\t\t\t\t'id_auteur' => $_SESSION['id'],\n\t\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "private function canComment(): bool\n {\n return true;\n }", "public function majCommentAction(Request $request,$id,$idsujet){\n $em2=$this->getDoctrine()\n ->getRepository('ForumBundle:Reponserc');\n $comment=$em2->find($id);\n $comment->contenu=$request->get('contenu');\n $em=$this->getDoctrine()->getManager();\n $em->flush();\n\n return $this->redirectToRoute('sujetByid',array('id'=>$idsujet));\n }", "public function DeleteCommentProfil(){\n $valInfoMovie = new InfoMovie();\n $valUser = new User();\n $pre_reponse = $valInfoMovie->SQLgetOne(BDD::getInstance(),$_GET[\"param\"]);\n\n //On vérifie que la personne qui supprime est l'auteur ou admin\n if (($pre_reponse[1][\"ID_USER\"] != $_SESSION[\"ID_USER\"]) OR ($valUser->CheckAdminUser())){\n header(\"location:/\");\n }\n\n $valInfoMovie->setRate(-1);\n $valInfoMovie->setComment(\"\");\n\n $response = $valInfoMovie->SQLUpdateInfoMovie(BDD::getInstance(),$_GET[\"param\"]);\n\n if ($response[0]) {\n header(\"location:/profil\");\n } else {\n echo \"Une erreur c'est produite : \" . $response[1];\n }\n }", "function comment() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from comments where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "protected function prepareSendEditComment(){\n if (!empty($_POST['comment'])) {\n $this->sendEditComment();\n header('Location: index.php?action=article&number='.$this->getNumber().'');\n }\n else{\n $this->prepareEditComment();\n }\n }" ]
[ "0.7094971", "0.70193523", "0.6935898", "0.69348186", "0.69106936", "0.6872578", "0.6756958", "0.6720305", "0.6681305", "0.66744405", "0.662212", "0.66194713", "0.66046304", "0.65486765", "0.65380794", "0.6521094", "0.65203184", "0.6458606", "0.64473003", "0.6407548", "0.640094", "0.63776374", "0.63621986", "0.63411313", "0.63216347", "0.63079834", "0.6302613", "0.6286054", "0.6279047", "0.62722766", "0.62710637", "0.6266039", "0.6262473", "0.62577724", "0.625722", "0.6242427", "0.6239853", "0.6239056", "0.6236051", "0.6233886", "0.62286496", "0.6224701", "0.6217374", "0.6209879", "0.62095875", "0.6192608", "0.61833376", "0.61794364", "0.6177678", "0.61645645", "0.61537313", "0.61465234", "0.61388177", "0.6135826", "0.613467", "0.6130803", "0.6127482", "0.6126004", "0.61240315", "0.6121902", "0.6106106", "0.6097915", "0.6083577", "0.6080791", "0.6080601", "0.6079948", "0.6075642", "0.6074891", "0.6066342", "0.60617846", "0.6055063", "0.60533667", "0.60526305", "0.60485846", "0.6048165", "0.60425854", "0.60420984", "0.6037621", "0.60366774", "0.60366774", "0.6036113", "0.6036025", "0.6029642", "0.60293883", "0.6025609", "0.6023582", "0.60234463", "0.60193044", "0.6014255", "0.6002959", "0.60022646", "0.6000143", "0.5999256", "0.5998326", "0.59982175", "0.5992218", "0.5991551", "0.5989218", "0.5978342", "0.59781694", "0.59777755" ]
0.0
-1
Obtenir le nombre total de commentaires
public function counterComment() { $db = $this->dbConnect(); $commentcount = $db->prepare("SELECT COUNT(id) AS countercom FROM comments"); $commentcount->execute(); $myvar = $commentcount->fetch(); return $myvar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNombreCommentaires()\n {\n $sql='SELECT COUNT(*) as nbCommentaires from t_commentaire';\n $resultat = $this->executerRequete($sql);\n $ligne=$resultat->fetch();\n return $ligne['nbCommentaires'];\n }", "public function getCommentCount();", "public function getCommentCount(): int;", "public function countComments(){\n return count($this->getComments());\n }", "public function get_comment_count() {\n\t\treturn (int)Jelly::select('user_comment')->where('user_id', '=', $this->id)->count();\n\t}", "public function getNumberOfComments()\n {\n return count($this->comments);\n \n /*$redis = Yii::$app->redis;\n $key = 'post:'. $this->id .':comments';\n \n return ($redis->get($key)>0)?$redis->get($key):0;*/\n }", "function countTotal() {\n $dbr = wfGetDB( DB_SLAVE );\n $count = 0;\n $s = $dbr->selectRow(\n 'Comments',\n array( 'COUNT(*) AS CommentCount' ),\n array( 'Comment_Page_ID' => $this->id ),\n __METHOD__\n );\n if ( $s !== false ) {\n $count = $s->CommentCount;\n }\n return $count;\n }", "public function getNbComments() {\n \n $nb_com = 0;\n foreach($this->comments as $com) { $nb_com++; }\n \n return $nb_com;\n }", "function numberComments($game_id) {\n $commentManager = new CommentManager();\n $comments = $commentManager->getCommentsForAuthor($game_id)->fetchAll();\n $nbComments = count($comments);\n \n return $nbComments;\n}", "function get_total_comments(){\n global $db;\n $query = 'SELECT count(*) FROM comments';\n $statement = $db->prepare($query);\n $statement->execute();\n // $comments = $statement->fetchAll();\n $total_comments = $statement->rowCount();\n $statement->closeCursor();\n return $total_comments;\n }", "public function getCommentCount()\n {\n return $this->commentCount = $this->get()->comment_count;\n }", "public function getCommentsCount()\n {\n return count($this->commentRepo->findAll());\n }", "public function getTotalTabComments() {\r\n\t\t$tab_comment_model = $this->load_model('TabCommentModel');\r\n\t\t$data = $tab_comment_model->getTotalTabComments($this->params['tab_id']);\r\n\r\n\t\t$this->sendResponse(1, $data);\r\n\t}", "public function getCommentsCount()\n\t{\n\t\treturn $this->comments_count;\n\t}", "public function getCommentsCnt() {\n return $this->commentCounter;\n }", "public function countNewComments()\n {\n \t$manager = $this->manager->getManager();\n\n \treturn $manager->query('SELECT COUNT(*) FROM comments WHERE ridden = 0')->fetchColumn();\n }", "public function getCommentCount(): int {\n\t\t$this->calculateThreadSummary();\n\t\treturn $this->commentCount;\n\t}", "function elgg_count_comments($entity) {\n\tif ($commentno = trigger_plugin_hook('comments:count', $entity->getType(),\n\t\tarray('entity' => $entity), false)) {\n\t\treturn $commentno;\n\t} else {\n\t\treturn count_annotations($entity->getGUID(), \"\", \"\", \"generic_comment\");\n\t}\n}", "function nb_get_post_number_of_comments( $object, $field_name, $request ) {\n return (int) get_comments_number( );\n\n}", "function mocca_count_comment($cat_name_posts_count) {\n $comment_arg = array(\n 'status' => 'approve'\n );\n $comment_count = 0;\n\n $all_comment = get_comments($comment_arg);\n\n foreach ($all_comment as $comment) {\n $post_id = $comment->comment_post_ID;\n if(! in_category($cat_name_posts_count, $post_id)) {\n continue;\n }\n $comment_count++;\n }\n echo $comment_count;\n }", "public function nombreTotalTableau(){\n $req = $this->db->query(\"SELECT COUNT(*) AS nb FROM tableau\");\n $sortie = $req->fetch(PDO::FETCH_OBJ);\n return $sortie->nb;\n }", "function GetCommentsCount($f_id)\n\t{\n\t\t$sql_query = \"SELECT COUNT(*) AS comment_count FROM `{$this->sCommentTb}` WHERE \".$this->sField.\"=\".(int)$f_id;\n\t\t$data = $this->pDBInterface->FetchObject( $this->pDBInterface->Query( $sql_query ) );\n\t\treturn (int)$data->comment_count;\n\t}", "public function increaseCommentCount()\n {\n \tif($this->comment_count != null)\n \t\t$this->comment_count++;\n \telse\n \t\t$this->comment_count = 1;\n \t$this->save();\n }", "public function totalCount();", "public function totalCount();", "public function getCommentsCount() {\n return CommentCount::getCommentCount($this->id, CommentCount::COMMENTABLE_MATCH);\n }", "function adventure_comment_count( $count ) { \r\n\tif ( ! is_admin() ) {\r\n\t\tglobal $id;\r\n\t\t$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));\r\n\t\treturn count($comments_by_type['comment']); }\r\n\telse {\r\n\t\treturn $count; } }", "private function updateCountsComment()\n {\n $this->commentManager->updateCommentsCount();\n }", "public function shortlisted_property_total_comment_count($post_data){\n $userId = $post_data['userId'];\n $searchId = $post_data['searchId'];\n $shortlistedId = $post_data['shortlistedId'];\n \n $sql = \"SELECT * FROM comments c WHERE c.searchId= $searchId AND c.deleteFlag != 1 AND c.shortlistedId = $shortlistedId\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->num_rows();\n }\n }", "public function countReportedComments()\n {\n \t$manager = $this->manager->getManager();\n\n \treturn $manager->query('SELECT COUNT(*) FROM comments WHERE reported = 1')->fetchColumn();\n }", "public function getNbComments(): ?int\n {\n return 10;\n }", "public function getNombreCommentairesSignales()\n {\n $sql='SELECT COUNT(*) as nbCommentairesSignales from t_commentaire WHERE COM_SIGN=1';\n $resultat=$this->executerRequete($sql);\n $ligne=$resultat->fetch();\n return $ligne['nbCommentairesSignales'];\n\n }", "function smarty_function_commentscount($params, &$smarty)\r\n{\r\n $hook = $_GET['url'];\r\n\r\n if(isset($params['hook']))\r\n {\r\n $hook = $params['hook'];\r\n }\r\n\r\n $count = count(Table::init(\"comments.comments\")\r\n ->setRequest((object) array('comment_hook' => $hook))\r\n ->doSelect()\r\n ->getRows()\r\n );\r\n \r\n $text = Language::get(($count == 1)? 'comment' : 'comments', getLang());\r\n \r\n return $count . \" \" . $text;\r\n}", "public function allWithCommentCount()\n {\n $sql = '\nSELECT p.id, p.title, p.chapo, p.date_creation, p.date_modification, COUNT(co.id) AS numberComments\nFROM posts AS p\nLEFT JOIN comments AS co ON co.post_id = p.id\nGROUP BY p.id\nORDER BY p.date_creation DESC ';\n return $this->db->request($sql, null, 'posts', true);\n }", "function getNumSpeakerComments(){\n\t\treturn $this->db->count_all($this->tableName);\n\t}", "public function total_comment_count($post_data){\n $searchId = $post_data['searchId'];\n $shortlistedId = $post_data['shortlistedId'];\n $loginUserId = $post_data['loginUserId'];\n $roomType = $post_data['roomType'];\n $roomType = \"'\".$roomType.\"'\";\n \n $sql = \"SELECT \n (SELECT COUNT(*) FROM comments c1 where c1.shortlistedId = c.shortlistedId AND c1.searchId = c.searchId AND c1.deleteFlag !=1) as total_comment_count\n FROM comments c WHERE c.shortlistedId = $shortlistedId AND c.searchId =$searchId GROUP BY c.shortlistedId\";\n // echo $sql;exit();\n $record = $this->db->query($sql); \n return $record->row('total_comment_count');\n }", "public function updateCommentCount()\n {\n $this->comment_count = $this->comments()->count();\n\n $this->save();\n }", "public static function nbContactsTotal() {\n $total = \\Phonebook\\Models\\CoreModel::findAll();\n $full_contacts = Count($total);\n return $full_contacts;\n echo $this->templates->render('home');\n }", "public function getNumRows()\n {\n $db = DB::conn();\n $query = \"SELECT COUNT(*) FROM \" . self::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->thread_id);\n $count = $db->value($query, $where_params);\n return $count; \n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function CounterMail(){\n\n $CantidadMails = ($this->ConfigModelo->select('rowCountWhere', 'Mensajes', 'estado', '0', 'Id', 'Id'));\n\n return $CantidadMails;\n\n }", "function get_comments_number_text($zero = \\false, $one = \\false, $more = \\false, $post = 0)\n {\n }", "public function getCommentsCountAttribute()\n {\n return Comment::where('video_id', (int) $this->id)->count();\n }", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM clientes\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "public function newContactsNumber()\n {\n // On calcule le nombre de recontacs demandés\n $sql = 'SELECT `item_id`\n FROM `items`\n WHERE `mission_id` = :mission\n AND `item_statut` = 4';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n $query->execute();\n\n // On récupère le nombre demandé\n return $query->rowCount();\n }", "public function getAmountOfTicketsLabel()\n {\n return Ticket::find()->creator($this->id)->count();\n }", "public function count(): int\n {\n return $this->content()->sum('quantity');\n }", "function count_topic_comments($id) {\n global $db;\n $total_comments = $db->count(tbl('comments'), \"comment_id\", \"type='t' AND type_id='$id'\");\n return $total_comments;\n }", "function tempera_number_comments() { ?>\n\t\t\t<h3 id=\"comments-title\"><i class=\"icon-replies\" ></i>\n\t\t\t\t<?php printf( _n( 'One Comment:', '%1$s Comments:', get_comments_number(), 'tempera' ),\n\t\t\t\tnumber_format_i18n( get_comments_number() )); ?>\n\t\t\t</h3>\n<?php }", "public function getCommentCounts() {\n $this->allowJSONP(true);\n\n $vanilla_identifier = val('vanilla_identifier', $_GET);\n if (!is_array($vanilla_identifier)) {\n $vanilla_identifier = [$vanilla_identifier];\n }\n\n $vanilla_identifier = array_unique($vanilla_identifier);\n\n $finalData = array_fill_keys($vanilla_identifier, 0);\n $misses = [];\n $cacheKey = 'embed.comments.count.%s';\n $originalIDs = [];\n foreach ($vanilla_identifier as $foreignID) {\n $hashedForeignID = foreignIDHash($foreignID);\n\n // Keep record of non-hashed identifiers for the reply\n $originalIDs[$hashedForeignID] = $foreignID;\n\n $realCacheKey = sprintf($cacheKey, $hashedForeignID);\n $comments = Gdn::cache()->get($realCacheKey);\n if ($comments !== Gdn_Cache::CACHEOP_FAILURE) {\n $finalData[$foreignID] = $comments;\n } else {\n $misses[] = $hashedForeignID;\n }\n }\n\n if (sizeof($misses)) {\n $countData = Gdn::sql()\n ->select('ForeignID, CountComments')\n ->from('Discussion')\n ->where('Type', 'page')\n ->whereIn('ForeignID', $misses)\n ->get()->resultArray();\n\n foreach ($countData as $row) {\n // Get original identifier to send back\n $foreignID = $originalIDs[$row['ForeignID']];\n $finalData[$foreignID] = $row['CountComments'];\n\n // Cache using the hashed identifier\n $realCacheKey = sprintf($cacheKey, $row['ForeignID']);\n Gdn::cache()->store($realCacheKey, $row['CountComments'], [\n Gdn_Cache::FEATURE_EXPIRY => 60\n ]);\n }\n }\n\n $this->setData('CountData', $finalData);\n $this->DeliveryMethod = DELIVERY_METHOD_JSON;\n $this->DeliveryType = DELIVERY_TYPE_DATA;\n $this->render();\n }", "function getNumeroDeBeneficiarios(){\n\t\t\t$benefs = 0;\n\t\t\t$sqlcreel = \"SELECT COUNT(idsocios_relaciones) AS 'beneficiarios'\n\t\t\t\t\t\t\tFROM socios_relaciones\n\t\t\t\t\t\t\tWHERE socio_relacionado=\" . $this->mCodigo . \" AND tipo_relacion=11\";\n\t\t\t$benefs = mifila($sqlcreel, \"beneficiarios\");\n\t\t\treturn $benefs;\n\t}", "public function add_comm()\n {\n $this->comments++;\n }", "public function countComment($id_root=0) {\n if ( empty($id_root) ) $id_root = $this->get('id_root');\n return post_data()->count(\"id_root=$id_root AND id_parent>0\");\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "function nb_demande(){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"SELECT COUNT(id_utilisateur) AS nb_demande FROM utilisateur WHERE devenir_star = TRUE\");\n\t\t\n\t\t$result = $req->fetch();\n\t\t\n\t\t$req->closeCursor();\n\t\treturn $result['nb_demande'];\n\t}", "public function GetCommentsCount($resetMembers = true)\n {\n $comments_count = 0;\n\n if(isset($this->comments_count_md_arr[$this->plugin_id][$this->object_id]))\n {\n $comments_count = (int)$this->comments_count_md_arr[$this->plugin_id][$this->object_id];\n }\n else\n {\n $comments_count = 0;\n }\n\n if(!empty($resetMembers)) $this->ResetMembers();\n\n return $comments_count;\n\n }", "function get_comments_number($post = 0)\n {\n }", "public function countCommentByPost($id)\n {\n \t$manager = $this->manager->getManager();\n\n \treturn $manager->query('SELECT COUNT(*) FROM comments WHERE post_id =' . $id)->fetchColumn();\n }", "public function getTotalNumberOfCommentsForANews($newsId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $queryForGetTotal=\"SELECT COUNT(comment_id) AS total_value FROM comment where news_id=\".$newsId.\"\";\n\t\t\t $tot_result=$conn->prepare($queryForGetTotal);\n\t\t\t $tot_result->execute();\n\t\t\t $tot= $tot_result->fetch(PDO::FETCH_ASSOC); \n\t\t\t $total=$tot['total_value']; \n\t\t\t $conn=null;\n\t\t\t return $total;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "function get_comment_pages_count($comments = \\null, $per_page = \\null, $threaded = \\null)\n {\n }", "function wp_update_comment_count($post_id, $do_deferred = \\false)\n {\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM grupo_usuario_tabelas '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "function get_total_replies(){\n global $db;\n $query = 'SELECT count(*) FROM replies';\n $statement = $db->prepare($query);\n $statement->execute();\n $total_replies = $statement->fetchAll();\n $total_replies = $statement->rowCount();\n $statement->closeCursor();\n return $total_replies;\n }", "public function nombreproduit(){\r\n\t\treturn array_sum($_SESSION['panier']);\r\n\t}", "Public Function getNoteCount()\n\t{\n\t\t$Notes = new User_Notes();\n\t\t$Notes = $Notes->GetAllNotes($this->id);\n\t\treturn sizeOf($Notes);\n\t}", "function get_pending_comments_num($post_id)\n {\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM ano_letivo '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function getCommentsCountAttribute()\n {\n // if relation is not loaded already, let's do it first\n if ( ! array_key_exists('commentsCount', $this->relations) )\n {\n $this->load('commentsCount');\n }\n\n $related = $this->getRelation('commentsCount');\n\n // then return the count directly\n return ($related) ? (int) $related->aggregate : 0;\n }", "private function getNumberOfComments($newsUid, &$pObj) {\n\t\t/* @var $pObj tx_ttnews */\n\t\t$recs = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('COUNT(*) AS t', 'tx_toctoc_comments_comments',\n\t\t\t\t'external_prefix=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('tx_ttnews', 'tx_toctoc_comments_comments') .\n\t\t\t\t' AND external_ref=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('tt_news_' . $newsUid, 'tx_toctoc_comments_comments') .\n\t\t\t\t' AND approved=1 ' .\n\t\t\t\t$pObj->cObj->enableFields('tx_toctoc_comments_comments'));\n\t\treturn $recs[0]['t'];\n\t}", "public function commentCount( $volleyId ){\n $count = null;\n $sql = 'SELECT count(*) as count FROM `hotornot-dev`.tblComments WHERE challenge_id = ?';\n $params = array( $volleyId );\n $stmt = $this->prepareAndExecute( $sql, $params );\n $data = $stmt->fetchAll( PDO::FETCH_CLASS, 'stdClass' );\n if( $data ){\n $count = $data[0]->count;\n }\n return (int) $count;\n }", "public function upCommentCount()\n {\n Doctrine_Query::create()->update('CheckIn c')->set('c.comment_count', 'c.comment_count + 1')->where('c.id = ?', $this->getId())->execute();\n }", "function getCommentcount($videoId) {\n ## variable initialization\n global $db;\n $query = \"SELECT count(id) FROM #__hdflv_comments WHERE videoid = $videoId\";\n $db->setQuery($query);\n $commentCount = $db->loadResult();\n return $commentCount;\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM negociacao_contas '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM conta_a_pagar '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM compra_coletiva '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function count_total_comments($user_id)\n {\n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n coalesce(a.total,0) + coalesce(b.total,0) as comments\n FROM users u\n LEFT OUTER JOIN(SELECT po.user_id,\n count(*) total\n FROM postopinion po\n LEFT JOIN postcontent pc ON pc.id = po.postcontent_id\n WHERE po.deleted_at IS NULL AND pc.deleted_at IS NULL\n AND po.mask= 0 AND po.hidden=0 \n GROUP BY po.user_id) as a ON a.user_id = u.id\n LEFT OUTER JOIN(SELECT t_op.user_id,\n count(*) total\n FROM topicopinion t_op\n LEFT JOIN topic t ON t.id = t_op.topic_id\n WHERE t_op.deleted_at IS NULL AND t.deleted_at IS NULL\n AND t_op.mask=0 AND t_op.hidden=0 \n GROUP BY t_op.user_id) as b ON b.user_id = u.id\n WHERE u.id={$user_id}\";\n \n return DB::select(DB::raw($sql)); \n }", "public function getCommentCountStr($page)\n {\n $commentCount = count($page->getComments());\n if ($commentCount == 0)\n return 'No comments';\n else if ($commentCount == 1) \n return '1 comment';\n else\n return $commentCount . ' comments';\n }", "public function getCommentCount($pageID){\n $commentDAO = new CommentDAO();\n return $commentDAO->getCommentsCountInDB($pageID);\n }", "function nb_demande_relais(){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"SELECT COUNT(nom_domain) AS nb_demande_relais relais_mail JOIN utilisateur ON relais_mail.utilisateur_id_utilisateur = utilisateur.id_utilisateur WHERE status_relais = '2'\");\n\t\t\n\t\t$result = $req->fetch();\n\t\t\n\t\t$req->closeCursor();\n\t\treturn $result['nb_demande_relais'];\n\t}", "public function total_notes()\n {\n $count = 0;\n\n foreach($this->sites as $site)\n $count = $count + $site->notes->count();\n\n return $count;\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM aluno '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function getCommentCount($post_id)\n {\n $comments = Comment::find()->where(['post_id' => $post_id,'status' => '1'])->orderBy(['created_date'=>SORT_DESC])->all();\n \n return count($comments);\n }", "public function getCountMensagens() \n\t{\n\t\t$query = \"SELECT COUNT(*) as Qtd_mensagem FROM mensagem WHERE id_usuario_destinatario = :id_usuario_destinatario\";\n\t\t$stmt = $this->db->prepare($query);\n\t\t$stmt->bindValue(':id_usuario_destinatario', $this->__get('id_usuario'));\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "public function get_total() { \n\n\t// Get total\n\t$this->total = DB::queryFirstField(\"SELECT count(*) FROM notifications\");\n\tif ($this->total == '') { $this->total = 0; }\n\n\t// Return\n\treturn $this->total;\n\n}", "function countUserComments($conn, $userId){\n\t\n\t$stmt = \"SELECT COUNT(*) as count FROM comments WHERE user_id = \" . $userId;\n\t$result = $conn->query($stmt);\n\t$row = $result->fetch_assoc();\n\t$count = $row['count'];\n\t\n\tif(!empty($count))\n\t\treturn $count;\n\treturn 0;\n}", "public function count() {\n\n // monta a query\n $this->db->select( 'count( distinct( CodFuncionario ) ) as Total' )\n ->from( 'Mensagens' );\n\n // faz a busca\n $busca = $this->db->get();\n\n // volta o resultado\n return ( $busca->num_rows() ) ? $busca->result_array()[0]['Total'] - 1 : 0;\n }", "public function getCommentCount($photo_uid) {\r\n\t\t$count = tx_cwtcommunity_lib_common::dbQuery('SELECT COUNT(uid) AS COUNT FROM tx_cwtcommunity_photo_comments WHERE photo_uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $count[0]['COUNT'];\r\n\t}", "function nombre_utilisateurs(){\n\n\t\t$bdd=connexion_BD('projetLion');\n\n\t\t$reponse = $bdd->query(\"SELECT COUNT(*) as nombre FROM login_users\");\n\n\t\t$donnees = $reponse->fetch();\n\t\t$reponse->closeCursor();\n\t\t\n\t\treturn $donnees['nombre'];\n\n\t}", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM servico\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "function iterateComments(){\n $this->commentsNumber += 1;\n }", "public function countCalendarEventDateComments() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_calendar_event_message\n\t\t\tWHERE\tmessageID NOT IN (SELECT messageID FROM wcf\".$this->dbNo.\"_calendar_event)\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute();\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "public function get_users_comments_count($firstname = \"\")\n {\n $contitions = \"\";\n if($firstname){\n $contitions .= 'where users.firstname like \"%'.mysql_real_escape_string($firstname).'%\"';\n $contitions .= 'OR stores.store_name like \"%'.mysql_real_escape_string($firstname).'%\"';\n $contitions .= 'OR discussion.comments like \"%'.mysql_real_escape_string($firstname).'%\"';\n }\n $result = $this->db->query(\"select *, discussion.created_date as dis_create from discussion join users on users.user_id=discussion.user_id join stores on stores.store_id=discussion.store_id $contitions order by discussion_id DESC \");\n \n return count($result);\n }", "function getUnreadCommentsCount() {\n\t\tglobal $LePress;\n\t\t$count = 0;\n\t\tforeach(get_comments() as $comment) {\n\t\t\t$meta = get_comment_meta($comment->comment_ID, 'lepress-read', true);\n\t\t\tif(($meta && $comment->comment_agent == 'LePressStudent') || wp_get_comment_status($comment->comment_ID) == 'unapproved') {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t//This is used, when both roles enabled - and teacher JS function makes a call\n\t\t\tif($LePress->isStudentFeatures() && $meta && $comment->comment_agent == 'LePressTeacher') {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}", "public function get_total() \n {\n return $this->db->count_all(\"blog\");\n }", "function getNombreArticle() {\n return ($this->nbarticle);\n }", "public function totClientesCadastrados(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes \";\n $rsclitot = $this->conexao->query($sql);\n $result = $rsclitot->fetch_array();\n $rstotcli = $result['total'];\n\n return $rstotcli;\n }", "public function count()\r\n\t{\r\n//\t\techo json_encode($this->db->query_first($sql));\r\n\t\techo json_encode(array('total'=>30));\r\n\t}", "function dsq_dash_comment_counts() {\n\tglobal $wpdb;\n// taken from wp-includes/comment.php - WP 2.8.5\n\t$count = $wpdb->get_results(\"\n\t\tSELECT comment_approved, COUNT( * ) AS num_comments \n\t\tFROM {$wpdb->comments} \n\t\tWHERE comment_type != 'trackback'\n\t\tAND comment_type != 'pingback'\n\t\tGROUP BY comment_approved\n\t\", ARRAY_A );\n\t$total = 0;\n\t$approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');\n\t$known_types = array_keys( $approved );\n\tforeach( (array) $count as $row_num => $row ) {\n\t\t$total += $row['num_comments'];\n\t\tif ( in_array( $row['comment_approved'], $known_types ) )\n\t\t\t$stats[$approved[$row['comment_approved']]] = $row['num_comments'];\n\t}\n\n\t$stats['total_comments'] = $total;\n\tforeach ( $approved as $key ) {\n\t\tif ( empty($stats[$key]) )\n\t\t\t$stats[$key] = 0;\n\t}\n\t$stats = (object) $stats;\n?>\n<style type=\"text/css\">\n#dashboard_right_now .inside,\n#dashboard_recent_comments div.trackback {\n\tdisplay: none;\n}\n</style>\n<script type=\"text/javascript\">\njQuery(function($) {\n\t$('#dashboard_right_now').find('.b-comments a').html('<?php echo $stats->total_comments; ?>').end().find('.b_approved a').html('<?php echo $stats->approved; ?>').end().find('.b-waiting a').html('<?php echo $stats->moderated; ?>').end().find('.b-spam a').html('<?php echo $stats->spam; ?>').end().find('.inside').slideDown();\n \t$('#dashboard_recent_comments div.trackback').remove();\n \t$('#dashboard_right_now .inside table td.last a, #dashboard_recent_comments .inside .textright a.button').attr('href', 'edit-comments.php?page=disqus');\n});\n</script>\n<?php\n}" ]
[ "0.76423097", "0.7639367", "0.74910307", "0.73166627", "0.7266562", "0.7227155", "0.7165992", "0.70966834", "0.70756364", "0.7061781", "0.7015644", "0.6926642", "0.6872187", "0.68612385", "0.6856903", "0.67862624", "0.67253834", "0.6644186", "0.66085154", "0.65790296", "0.65684503", "0.649377", "0.64925593", "0.6491016", "0.6491016", "0.649081", "0.6488512", "0.64823955", "0.64496267", "0.64231133", "0.6422736", "0.64207315", "0.6407993", "0.64030874", "0.6381793", "0.63739043", "0.634587", "0.634504", "0.63333935", "0.63323796", "0.63323796", "0.63323796", "0.62397337", "0.6237858", "0.6232361", "0.62254274", "0.6219218", "0.6219039", "0.6218385", "0.6216906", "0.62165594", "0.61962724", "0.6192611", "0.61818916", "0.61801827", "0.6169457", "0.6139405", "0.6135427", "0.61256593", "0.61235046", "0.6112919", "0.6110527", "0.61073375", "0.6101679", "0.6101083", "0.6082057", "0.60577327", "0.6042303", "0.6038626", "0.60364366", "0.6030665", "0.6029548", "0.6026479", "0.6016875", "0.6010354", "0.6010344", "0.60074466", "0.6005968", "0.6005613", "0.6004231", "0.600175", "0.59946734", "0.5992897", "0.59891224", "0.5983964", "0.59798694", "0.59753126", "0.596858", "0.595986", "0.595141", "0.5947696", "0.59467036", "0.59153134", "0.5912189", "0.5907193", "0.59069294", "0.5903457", "0.5902787", "0.59011513", "0.58995676" ]
0.7303601
4
Get customer credit amount
protected function getCreditAmount($customerId){ $creditAccount = ObjectManager::getInstance()->create('Vnecoms\Credit\Model\Credit'); $creditAccount->loadByCustomerId($customerId); return $creditAccount->getCredit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreditAmount()\n {\n if (!$this->getData('credit_amount')) {\n $creditAccount = $this->_creditFactory->create();\n $creditAccount->loadByCustomerId($this->getVendor()->getCustomer()->getId());\n \n $this->setData('credit_amount', $creditAccount->getCredit());\n }\n return $this->getData('credit_amount');\n }", "public function get_amountCustomer() {\n return $this->amountCustomer;\n }", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "public function getCredit()\n\t{\n\t\treturn $this->credit;\n\t}", "public function getCreditLineAmount()\n {\n return $this->creditLineAmount;\n }", "public function getCreditLineAmount()\n {\n return $this->creditLineAmount;\n }", "public function getBaseCredit(){\n return $this->creditAccount->getCredit();\n }", "public function get_total_credit(){\n $sql = \"SELECT * FROM payment WHERE paid_for={$this->id}\";\n $payments = Payment::find_by_sql($sql);\n $total_credits = 0;\n foreach ($payments as $payment) {\n $total_credits += $payment->amount;\n }\n\n return $total_credits;\n }", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function getCreditAttribute()\n {\n return $this->credit?->amount ?: null;\n }", "public function getCreditCardNumber()\n {\n return $this->creditCardNumber;\n }", "public function getCreditCard()\n {\n return $this->creditCard;\n }", "public function getBaseUsedCredit(){\n $usedCredit = $this->cart->getQuote()->getBaseCreditAmount() * 1;\n $usedCredit = abs($usedCredit);\n return $usedCredit?$usedCredit:\"\";\n }", "public function getTotalNettedCreditAmount()\n {\n return $this->totalNettedCreditAmount;\n }", "public function getCreditCard()\n\t{\n\t\treturn $this->credit_card;\n\t}", "public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }", "public function getUseCustomerBalance()\n\t{\n\t\treturn $this->_getOrderCreateModel()->getQuote()->getUseCustomerBalance();\n\t}", "public function getCustomerPaymentAmount($customerObj) {\n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $outstandingAmount = $customerObj->getOutandingAmount();\n $creditBalance = $gsaAccountingTransactionAccessorObj->selectCreditMemoCustomerAmount($customerObj->get_gsauid(),true); \n return bcsub($outstandingAmount ,$creditBalance ,$this->precision);\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function getCostMoney()\n {\n return $this->get(self::_COST_MONEY);\n }", "public function getCustomGiftcardAmount();", "public function getAccountingCost()\n {\n return $this->accountingCost;\n }", "public function getChargeTotalAmount()\n {\n return $this->chargeTotalAmount;\n }", "public function getAmount()\n {\n return $this->MoneyAmount;\n }", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getGiftcardAmount();", "public function balance_total($customer_id)\n {\n $this->con->select('balance');\n $this->con->from('credits');\n $this->con->where('credits.person_custo_id', $customer_id);\n $this->con->limit(1);\n $this->con->order_by('credit_id', 'desc');\n $query = $this->con->get();\n\n if ($query->num_rows() == 1) {\n return $query->row();\n } else {\n return false;\n }\n }", "public function getCreditInformation()\r\n\t{\r\n\t\treturn $this->root->getAttribute('creditstat');\r\n\t}", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getPaymentAuthorizationAmount();", "public function getamount()\n {\n return $this->amount;\n }", "public function getCreditClient(): ?float {\n return $this->creditClient;\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getUserAmount() {\n \t$_user = new class_User();\n \n \t$userAmount = $_user->getUserAmount();\n \n \treturn $userAmount;\n }", "public function getAmount()\n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getAccountingCostCode()\n {\n return $this->accountingCostCode;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\r\n\t{\r\n\t\treturn $this->getTransaction()->getAmount();\r\n\t}", "public function getAmount(): string\n {\n return $this->amount;\n }", "public function getAmount()\n\t{\n\t\treturn $this->amount;\n\t}", "public function getTransactionAmount() \n {\n return $this->_fields['TransactionAmount']['FieldValue'];\n }", "public function getBalance()\n {\n $customerId = Mage::getSingleton('customer/session')->getCustomerId();\n if (!$customerId) {\n return 0;\n }\n\n $model = Mage::getModel('wf_customerbalance/balance')\n ->setCustomerId($customerId)\n ->loadByCustomer();\n\n return $model->getAmount();\n }", "public function getCustomerAccountDetails($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef']\n\t\t];\n\n\t\treturn $response = $soapclient->getCustomerAccountDetails($params);\n\t}", "function get_credit_limit() {\n cache_randys_credit_values();\n $woo_cust_id = get_current_user_id();\n return get_transient( '_randys_credit_limit_' . $woo_cust_id );\n}", "public function getCustomer()\n {\n return $this->data->customer;\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->_amount;\n }", "public function getAmount()\n {\n return $this->_amount;\n }", "public function getCreditBalance($gsaUid, $orderWrapperUid=0) {\n trace('[METHOD] '.__METHOD__);\n $creditBalance = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance()->selectCreditMemoCustomerAmount($gsaUid,true);\n $reservedCredit = tx_ptgsaaccounting_orderCreditBalanceAccessor::getInstance()->selectReservedCreditBalanceCustomer($gsaUid,$orderWrapperUid);\n trace( $reservedCredit,0,' $reservedCredit');\n $creditBalance = bcsub($creditBalance,$reservedCredit,$this->precision);\n return $creditBalance;\n }", "public function getAmountAuthorized()\n {\n return $this->amountAuthorized instanceof TypedMoneyBuilder ? $this->amountAuthorized->build() : $this->amountAuthorized;\n }", "public function getCreditRuleData()\n {\n return $this->_helper->calculateCreditAmountforCart();\n }", "function getCustomerNo() {\n return $this->customerNo;\n }", "public function getMoney()\n {\n return $this->Money;\n }", "function debit($total, $creditCard)\n {\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function get_credit($key = 0)\n {\n }", "public function getAmount()\n {\n return $this->getData(self::AMOUNT);\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getCapturedAmount();", "public function getAmount(): string;", "function get_credit_available() {\n cache_randys_credit_values();\n $woo_cust_id = get_current_user_id();\n return get_transient( '_randys_credit_available_' . $woo_cust_id );\n}", "public function getFormatedBaseCredit(){\n return $this->formatBasePrice($this->getBaseCredit());\n// $baseCurrency = $this->_storeManager->getStore()->getBaseCurrency();\n// return $baseCurrency->formatPrecision($this->getBaseCredit(),2,[],false);\n }", "public function getCustomer() {\n return $this->customer;\n }", "public function getAmount()\n\t{\n\t\treturn $this->get('Amount');\n\t}", "public function getCustid()\n {\n return $this->custid;\n }", "public function getTransactionAmountInCents()\n {\n return $this->transactionAmount * 100;\n }", "public function getCustomerDetails($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef']\n\t\t];\n\n\t\treturn $response = $soapclient->getCustomerDetails($params);\n\t}", "public function getCashPaymentMoney(): ?Money\n {\n return $this->cashPaymentMoney;\n }", "public function amount() {\r\n\t\treturn $this->amount;\r\n\t}" ]
[ "0.79663885", "0.7920442", "0.7615811", "0.73398936", "0.71224856", "0.71224856", "0.70833886", "0.69903237", "0.6768489", "0.6765701", "0.674159", "0.6662768", "0.6641993", "0.66349065", "0.6632239", "0.66192955", "0.6556293", "0.65549713", "0.65246", "0.6516991", "0.64563787", "0.64443994", "0.6382081", "0.63555205", "0.6343822", "0.6343822", "0.6343822", "0.6343822", "0.6332435", "0.63265014", "0.6322096", "0.63206273", "0.63045955", "0.6286737", "0.6270416", "0.6254862", "0.6254862", "0.6254862", "0.6254862", "0.624357", "0.62408566", "0.62276137", "0.6202054", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.62018716", "0.61857545", "0.61475074", "0.6143272", "0.6130654", "0.61289304", "0.6119304", "0.6112479", "0.61081344", "0.6103461", "0.6103461", "0.6103461", "0.6103461", "0.6103461", "0.6091815", "0.6091815", "0.6089439", "0.6088074", "0.6085785", "0.60772806", "0.60768414", "0.6065732", "0.6061428", "0.6061428", "0.6061428", "0.6054015", "0.6042762", "0.6036714", "0.6036714", "0.6036714", "0.6036714", "0.60352254", "0.603124", "0.6026103", "0.60260534", "0.60189366", "0.59999794", "0.59972036", "0.5996617", "0.5990199", "0.59871316", "0.5980611" ]
0.718691
4
Get number of products of current vendor
public function getTotalProducts($vendorId) { $resource = ObjectManager::getInstance()->create('Magento\Catalog\Model\ResourceModel\Product'); $connection = $resource->getConnection(); $select = $connection->select(); $select->from( $resource->getTable('catalog_product_entity'), ['total_product' => 'count( entity_id )'] )->where( 'vendor_id = :vendor_id' ); $bind = ['vendor_id' => $vendorId]; $total = $connection->fetchOne($select, $bind); return $total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public function ProductCount()\n {\n return Products::count();\n }", "public function getNumProducts()\n {\n return $this->numProducts;\n }", "public function getProductCount()\n {\n return count($this->products);\n }", "function getProductCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/count.json' , $params ),true);\n\t}", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function countProduct(){\n return count(Product::all());\n }", "public function getProNumRows()\n {\n return $this->db->count_all('products');\n }", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "public function getAllProductsCount()\n {\n\n return $this->all()->count();\n }", "public function getProductsCount()\n\t{\n\t\tif ($this->hasData('products_count')) {\n\t\t\treturn $this->getData('products_count');\n\t\t}\n\n\t\tif (null === $this->getData('products_count')) {\n\t\t\t$this->setData('products_count', self::DEFAULT_PRODUCTS_COUNT);\n\t\t}\n\n\t\treturn $this->getData('products_count');\n\t}", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "public function countProducts()\n {\n $count = 0;\n foreach($this->products as $product) {\n /** @var ProductAbstract $product */\n switch ($product->getRequiredData()->getType()) {\n case DataAbstract::TYPE_CONFIGURABLE:\n /** @var Configurable $product */\n if (method_exists($product, 'getSimpleProducts')) {\n foreach ($product->getSimpleProducts() as $simple) {\n /** @var Simple $simple */\n $count++;\n }\n }\n $count++;\n break;\n default:\n $count++;\n break;\n }\n }\n\n return $count;\n }", "public function getProductQuantity()\n {\n }", "function getNumberItem()\n{\n\t$numberItems = \\Cart::instance('shopping')->count(false);\n\n return $numberItems;\n}", "public function getProductsCount()\n {\n if (null === $this->_productsCount) {\n $this->_productsCount = self::DEFAULT_PRODUCTS_COUNT;\n }\n return $this->_productsCount;\n }", "public function getResultCount()\n {\n if (!$this->getData('result_count')) {\n $size = $this->_getVendorCollection()->getSize();\n $this->_getQuery()->saveNumResults($size);\n $this->setResultCount($size);\n }\n return $this->getData('result_count');\n }", "public function count() {\n\n // query to count all product records\n $query = \"SELECT count(*) FROM $this->table_name\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return count\n return $rows[0];\n }", "function similarProductCount()\n {\n if($this->soap)\n return count($this->soap['SimilarProducts']);\n else\n return count($this->similarProducts);\n }", "function count_active_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 1');\n\t}", "public function getProductId(): int;", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "public function getCurrentGoodsCount()\n {\n return $this->count(self::_CURRENT_GOODS);\n }", "public static function count_product_ids() {\r\n\r\n\t\t\tif ( false === $count_product_ids = get_transient( 'cptpro_number_of_product_ids' ) ) {\r\n\r\n\t\t\t\t$count_product_ids = count( YIKES_Custom_Product_Tabs_Pro_Admin::fetch_all_product_ids() );\r\n\r\n\t\t\t\tset_transient( 'cptpro_number_of_product_ids', $count_product_ids, 10 * MINUTE_IN_SECONDS );\r\n\t\t\t}\r\n\r\n\t\t\treturn $count_product_ids;\r\n\t\t}", "public function getCountCarManufacturer(){\r\n\t\t$this->countManufacturer = getValue(\"SELECT active FROM tbl_user WHERE user_id=\".$this->getCarOwnerID());\r\n\t\treturn $this->countManufacturer;\r\n\t}", "private function CountProductsAction($dom)\n {\n $nbProducts = 0;\n $rows = $dom->documentElement->getElementsByTagName('row');\n $nbProducts = $rows->length;\n// foreach($dom->documentElement->getElementsByTagName('row') as $zRow)\n// {\n// $nbProducts++;\n// }\n return $nbProducts;\n }", "public function getShopCount()\n {\n return $this->count(self::_SHOP);\n }", "function product_novendor()\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering product_novendor() method ...\");\n\t\t$query = \"SELECT ec_products.productname, ec_products.deleted\n\t\t\tFROM ec_products\n\t\t\tWHERE ec_products.deleted = 0\n\t\t\tAND ec_products.vendor_id is NULL\";\n\t\t$result=$this->db->query($query);\n\t\t$log->debug(\"Exiting product_novendor method ...\");\n\t\treturn $this->db->num_rows($result);\n\t}", "public function findCountProd($id){\n return Product::where('id',$id)->first()->count;\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "function countProducts() {\r\n global $tableProducts;\r\n\r\n return countFields($tableProducts);\r\n}", "function count_new_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 3');\n\t}", "public static function itemCount() {\n\t\t$items = self::current('products');\n\t\t\n\t\t// count(false) == 1? Seriously, PHP? -_-\n\t\tif($items !== false and empty($items)) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\treturn count(self::items());\n\t}", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->get_where(ES_PRODUCTS, array('category_id' => $cat_id));\n return $query->num_rows();\n}", "function getRowCount() {\n\t\t$saleData = $this->getProducts();\n\t\t$saleSize = sizeof($saleData);\n\t\treturn $saleSize -=1;\n\t}", "function get_prodinv_count($st = NULL)\n {\n if ($st == \"NIL\") $st = \"\";\n $sql = \"select * from product where ProdName like '%$st%'\";\n $query = $this->db->query($sql);\n return $query->num_rows();\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "public function getActiveProducts(){\n $product = Product::where('active', 1)->count();\n return $product;\n }", "public function getProductLimit() {\r\n\t\t$config = $this->getConfig();\r\n $limit = $this->getData(\"product_count\");\r\n if(!$limit)\r\n $limit = $config[\"limit\"];\r\n return $limit;\r\n }", "public function getNbProd()\n {\n return $this->CollProduit->taille();\n }", "function wpcoupon_wc_change_number_products(){\r\n $shop_id = wc_get_page_id( 'shop' );\r\n $number = absint( get_post_meta( $shop_id, '_wpc_shop_number_products', true ) );\r\n if ( ! $number ) {\r\n $number = 12;\r\n }\r\n return $number;\r\n}", "function jml_product() {\n return $this->db->count_all('tb_transactions');\n }", "public function getBasketProductsCount(): int\n\t{\n\t\tif ($this->basketProducts === null) {\n\t\t\t$this->getBasketProducts();\n\t\t}\n\n\t\treturn $this->basketProductsCount;\n\t}", "public function get_rows(){ return $count = count($this->prod_id); }", "public function getStarGoodsCount()\n {\n return $this->count(self::_STAR_GOODS);\n }", "public function display_out_of_stocks_product_count(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOutOfStocksProduct = DB::select(\"SELECT COUNT(*) as data FROM stocks WHERE quantity < threshold\");\n // }else{\n // $getOutOfStocksProduct = DB::select('SELECT COUNT(*) as data FROM stocks WHERE quantity < threshold');\n // }\n \n // return response()->json([\n // 'count' => $getOutOfStocksProduct[0],\n // 'status' => 200\n // ]);\n\n $getOutOfStocksProduct = DB::table('product_stocks')->where('quantity', 0)->get()->count();\n\n \n return response()->json([\n 'count' => $getOutOfStocksProduct,\n 'status' => 200\n ]);\n }", "public function getTechCount()\n {\n return $this->count(self::TECH);\n }", "function get_count() {\n\t\t$count=0;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"select count(pr_id) as num from \".$this->_db_table);\n\t\tif (!$rs) {\n\t\t\tprint $db->ErrorMsg();\n\t\t} else {\n\t\t\t$count = $rs->fields[\"num\"];\n\t\t}\n\t\treturn $count;\n\t}", "public function record_count() {\n $count = $this->db->count_all('product');\n return $count;\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }", "static function customerCount( )\n {\n $db = eZDB::instance();\n $countArray = $db->arrayQuery( \"SELECT count( DISTINCT email) AS count FROM ezorder WHERE is_temporary='0'\" );\n return $countArray[0]['count'];\n }", "public function getSkuArrCount()\n {\n return $this->count(self::sku_arr);\n }", "public function getProductItemCounts()\n {\n if (array_key_exists(\"productItemCounts\", $this->_propDict)) {\n if (is_a($this->_propDict[\"productItemCounts\"], \"\\Microsoft\\Graph\\Model\\KeyValuePair\") || is_null($this->_propDict[\"productItemCounts\"])) {\n return $this->_propDict[\"productItemCounts\"];\n } else {\n $this->_propDict[\"productItemCounts\"] = new KeyValuePair($this->_propDict[\"productItemCounts\"]);\n return $this->_propDict[\"productItemCounts\"];\n }\n }\n return null;\n }", "public function getCountOfProduct(timpanyProductInterface $product)\n {\n return $this->_items[$product->getIdentifier()]['count'];\n }", "private function count()\n\t\t{\n\t\t\t$query = \"\tSELECT count(1) AS 'total'\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\n\t\t\t$row = $result->fetch_array(MYSQLI_ASSOC);\t\n\t\t\treturn $row['total'];\t\t\n\t\t}", "public function getCountByUser($user){\n $query = $this->getEntityManager()->createQuery(\n \"\n SELECT count(p.id) AS nbprods\n FROM StoreBackendBundle:Product AS p\n WHERE p.jeweler = :user\n \"\n )->setParameter(':user', $user);\n return $query->getSingleScalarResult();\n }", "function count()\n\t{\n\t\treturn count($this->getGoods());\n//\t\treturn count($this->getSESSION()[$this->sessionsGoodsKey]);\n\t}", "public function getInventoryCount()\n {\n return $this->where('quantity', '<>', '0')->get()->fetch('quantity')->sum();\n }", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getPurchasesCount() {\n\t\treturn $this->response['count'] ?: [];\n\t}", "public function getProductNum()\n {\n $value = $this->get(self::product_num);\n return $value === null ? (integer)$value : $value;\n }", "function edd_pup_customer_count( $email_id = null, $products = null, $subscribed = true, $filters = null ){\r\n\r\n\tif ( empty( $email_id ) && !is_numeric( $email_id ) ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( empty( $products ) ) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n global $wpdb;\r\n\r\n $count = 0;\r\n $b = $subscribed ? 0 : 1;\r\n $licensing = edd_get_option( 'edd_pup_license' );\r\n\t$products = !empty( $products ) ? $products : get_post_meta( $email_id, '_edd_pup_updated_products', TRUE );\r\n\t$filters = isset( $filters ) ? $filters : get_post_meta( $email_id, '_edd_pup_filters', true );\r\n\r\n\t// Filter bundle customers only\r\n\tif ( $filters['bundle_2'] ) {\r\n\r\n\t\t$bundleproducts = array();\r\n\t\t$bundlenum = 0;\r\n\r\n\t\tforeach ( $products as $id => $name ) {\r\n\t\t\tif ( edd_is_bundled_product( $id ) ) {\r\n\t\t\t\t$bundleproducts[ $id ] = $name;\r\n\t\t\t\t$bundlenum++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$products = $bundlenum > 0 ? $bundleproducts : $products;\r\n\t}\r\n\r\n // Active EDD Software Licensing integration\r\n\tif ( ( $licensing != false ) && is_plugin_active('edd-software-licensing/edd-software-licenses.php' ) ) {\r\n\r\n\t\t// Get customers who have a completed payment and are subscribed for updates\r\n\t\t$customers = $wpdb->get_results(\r\n\t \t\"\r\n\t \tSELECT post_id, meta_value\r\n\t \tFROM $wpdb->posts, $wpdb->postmeta\r\n\t \tWHERE $wpdb->posts.ID = $wpdb->postmeta.post_id\r\n\t \t\tAND post_type = 'edd_payment'\r\n\t \t\tAND post_status = 'publish'\r\n\t \t\tAND meta_key = '_edd_payment_meta'\r\n\t\t\t\tAND meta_value NOT LIKE '%%\\\"edd_send_prod_updates\\\";b:0%%'\r\n\t\t\t\", OBJECT_K);\r\n\r\n\t\t// Get updated products with EDD software licensing enabled\r\n\t\t$products_imp = implode( ',' , array_keys( $products ) );\r\n\t\t$licenseditems = $wpdb->get_results( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_edd_sl_enabled' AND meta_value = 1 AND post_id IN ( $products_imp )\", OBJECT_K );\r\n\r\n\t\tforeach ( $customers as $customer ) {\r\n\r\n\t\t\t$paymentmeta = unserialize( $customer->meta_value );\r\n\t\t\t$cart_details = is_array( $paymentmeta['cart_details'] ) ? $paymentmeta['cart_details'] : array( $paymentmeta['cart_details'] );\r\n\r\n\t\t\tforeach ( $cart_details as $item ) {\r\n\r\n\t\t\t\t// Skip $item if it is not a product being updated\r\n\t\t\t\tif ( !isset( $products[ $item['id'] ] ) ){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if they have purchased any non-licensed products which would send them the email anyway\r\n\t\t\t\tif ( !isset( $licenseditems[ $item['id'] ] ) && isset( $products[ $item['id'] ] ) ) {\r\n\r\n\t\t\t\t\t$count++;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t// Finally check to make sure customer has licenses then check that it is valid for that item.\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$licenses = edd_pup_get_license_keys( $customer->post_id );\r\n\t\t\t\t\t$enabled = get_post_status( $licenses[$item['id']]['license_id'] ) == 'publish' ? true : false;\r\n\r\n\t\t\t\t\tif ( !empty( $licenses ) && $enabled && in_array( edd_software_licensing()->get_license_status( $licenses[$item['id']]['license_id'] ), apply_filters( 'edd_pup_valid_license_statuses', array( 'active', 'inactive' ) ) ) ) {\r\n\r\n\t\t\t\t\t\t$count++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t// Inactive EDD Software Licensing integration\r\n\t} else {\r\n\r\n\t $n = count( $products );\r\n\t $i = 1;\r\n\t $q = '';\r\n\r\n\t\tforeach ( $products as $id => $name ) {\r\n\r\n\t\t\tif ( is_numeric( $id ) ) {\r\n\t\t\t\t$s = strlen( $id );\r\n\t\t\t\t$id = absint( $id );\r\n\r\n\t\t\t\tif ( $i === $n ) {\r\n\t\t\t\t\t$q .= \"meta_value LIKE '%\\\"id\\\";s:$s:\\\"$id\\\"%' OR meta_value LIKE '%\\\"id\\\";i:$id%' )\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$q .= \"meta_value LIKE '%\\\"id\\\";s:$s:\\\"$id\\\"%' OR meta_value LIKE '%\\\"id\\\";i:$id%' OR \";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t$customers = $wpdb->get_results(\r\n\t \t\"\r\n\t \tSELECT post_id, meta_value\r\n\t \tFROM $wpdb->posts, $wpdb->postmeta\r\n\t \tWHERE $wpdb->posts.ID = $wpdb->postmeta.post_id\r\n\t \t\tAND post_type = 'edd_payment'\r\n\t \t\tAND post_status = 'publish'\r\n\t \t\tAND meta_key = '_edd_payment_meta'\r\n\t\t\t\tAND (meta_value NOT LIKE '%%\\\"edd_send_prod_updates\\\";b:$b%%'\r\n\t\t\t\t\tAND ($q )\r\n\t\t\t\", OBJECT );\r\n\r\n\t\t$count = $wpdb->num_rows;\r\n\t}\r\n\r\n return $count;\r\n}", "public function getQuantityAvailable(): int;", "public function inventario_tatalProductos(){ \t\n\n\t\t\t$resultado = array();\n\t\t\t\n\t\t\t$query = \"Select count(idProducto) as cantidadProductos from tb_productos \";\n\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado['cantidadProductos'];\t\t\t\n\t\t\t\n\t\t\t\n }", "public function getShopListcount()\n {\n return count($this->shopList);\n }", "public function action_catalog_products_cout()\n {\n echo '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n echo '<tr><td width=\"120px\">Catalog Name</td><td width=\"100px\">在架产品数量</td><td width=\"100px\">下架产品数量</td></tr>';\n $catalogs = DB::select('id')->from('products_category')->where('visibility', '=', 1)->where('on_menu', '=', 1)->execute('slave');\n foreach($catalogs as $cata)\n {\n $catalog = Catalog::instance($cata['id']);\n $posterity_ids = $catalog->posterity();\n $posterity_ids[] = $cata['id'];\n $posterity_sql = implode(',', $posterity_ids);\n\n $sql = 'SELECT count(distinct products.id) as num FROM products LEFT JOIN catalog_products ON catalog_products.product_id=products.id \n WHERE catalog_products.catalog_id IN (' . $posterity_sql . ') AND products.site_id =1 AND products.visibility = 1';\n\n $onsale_count = DB::query(Database::SELECT, $sql . ' AND status = 1')->execute('slave')->get('num');\n $offsale_count = DB::query(Database::SELECT, $sql . ' AND status = 0')->execute('slave')->get('num');\n\n echo '<tr><td>' . $catalog->get('name') . '</td><td>' . $onsale_count . '</td><td>' . $offsale_count . '</td></tr>';\n }\n echo '</table>';\n }", "function qntdProdutosAnunciados()\n {\n //query paginas\n $query = 'SELECT COUNT(codigo) AS qntd_itens FROM produto WHERE produtor_fk = \"' . base64_decode($_SESSION['log_id']) . '\"';\n //num de produtos no bd\n $pagesDB = $this->selectCustom($query);\n $pagesDB = mysqli_fetch_assoc($pagesDB);\n\n return $pagesDB['qntd_itens'];\n }", "function getNumberOfSaleItems() {\n\t\tif($stmt = $this->connection->prepare(\"select salePrice from products;\")) {\n\t\t\t\t$stmt -> execute();\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($salePrice);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$saleData[] = array(\n\t\t\t\t\t\t\t'salePrice' => $salePrice\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$salePrice = array_filter($saleData);\n\t\t\t\t$numberOfSaleItems = sizeof($salePrice);\n\t\t}\n\t\treturn $numberOfSaleItems;\n\t}", "function retrieve_num_clients(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\t$result = $this->CI->users_promoters->retrieve_promoter_clients_list($this->promoter->up_id, $this->promoter->team->t_fan_page_id, array('count' => true));\n\t\t\n\t\treturn $result[0]->count_clients;\n\t\t\n\t}", "public function getEquipmentingItemCount()\n {\n return $this->count(self::EQUIPMENTING_ITEM);\n }", "function get_all_tamanhos_produtos_count()\n {\n $this->db->from('tamanhos_produtos');\n\n return $this->db->count_all_results();\n }", "public function count()\n {\n return count($this->drivers);\n }", "function numRowsProductos($clave)\n\t{\n\t\t$query=$this->db->query(\"call numBusquedaProd('\".$clave.\"');\");\n\t\t$query->next_result();\n\t\t$num=0;\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$num=$row->nume;\n\t\t}\n\t\treturn $num;\n\t}", "public function getProductSKU()\n {\n }", "public function count()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n }, 0);\n }", "function getSellerCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/count.json' , $params ),true);\n\t}", "public function getCartVolume() {\n $product_total = 0;\n\n $products = $this->getProducts();\n\n foreach ($products as $product) {\n //$product_total += $product['quantity'];\n $product_total += $product['quantity'];\n }\n\n return $product_total;\n }", "public function getCount(){\n\t\t$result = mysql_num_rows(mysql_query(\"select * from customer\"));\n\t\treturn $result;\n\t}", "function get_purchased_count( $conds = array() )\n\t{\n\t\t\n\t\t$this->db->select('rt_products.*, count(rt_transactions_counts.product_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_transactions_counts', 'rt_products.id = rt_transactions_counts.product_id');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_products.shop_id',$conds['shop_id']);\n \t\t$this->db->limit(5);\n \t\t$this->db->group_by('rt_transactions_counts.product_id');\n \t\t$this->db->order_by(\"t_count\", \"DESC\");\n\t\treturn $this->db->get();\n\t\t // print_r($this->db->last_query());die;\n\t}", "static function count_available()//$active=true)\n {\n global $objDatabase;\n\n $query = \"\n SELECT COUNT(*) AS `numof_records`\n FROM `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_discount_coupon`\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) return self::errorHandler();\n if ($objResult->EOF) return 0;\n return $objResult->fields['numof_records'];\n }", "function getNbProduits() {\n\t return $this->nbProduits;\n\t }", "public static function record_count() {\n\n\t\tif ( ! empty( $_GET['s'] ) ) {\n\n\t\t\treturn tux_su_get_db( array(\n\t\t\t\t'user_id' => $_GET['s'],\n\t\t\t\t'product_id' => $_GET['s'],\n\t\t\t\t'info' => $_GET['s'],\n\t\t\t\t'type' => 'license',\n\t\t\t\t'count' => true,\n\t\t\t\t'search' => true,\n\t\t\t) );\n\n\t\t} else {\n\n\t\t\treturn tux_su_get_db( array(\n\t\t\t\t'type' => 'license',\n\t\t\t\t'count' => true,\n\t\t\t) );\n\n\t\t}\n\t}", "public function getTargetProductsCount(array $params)\n {\n return $this->httpPost('/sp/targets/products/count',$params,[],false,$this->header);\n }", "public function count_items() {\n\t\treturn SalesHistoryDetailQuery::create()->filterByOrdernumber($this->oehhnbr)->count();\n\t}", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "public function view_stock_ListCount($id,$product,$added_by)\n\t{\n\t\t$query = $this->db->where('product',$product,'added_by',$added_by)->count_all_results('smb_stock'); \n\t\t\n return $query;\n\t}", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "public function count()\n {\n $count = $this->shutterstockQueryResult->count();\n return $count > 1000 ? 1000 : $count ;\n }", "public function getCount() {\n \treturn $this->count();\n }", "public function getCount()\n {\n return $this->count;\n }", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "public function getProductTotalCount($productData) {\n if (isset ( $productData ['sku'] )) {\n return count ( $productData ['sku'] );\n }\n }", "function count_archived_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 0');\n\t}", "public function getNumber()\n {\n return $this->model->count();\n }", "public function get_count_cart()\n\t{\n\t\t$UserId = $this->input->post('uid');\n\t\tif($UserId!='')\n\t\t{\n\t\t\t$a=$this->db->query(\"select count(*) as count from tb_admin_cart where userid='$UserId'\")->row_array();\n\t\t\t$b=$a['count'];\n\t\t\t\n\t\t\t//$b=count($result);\n\t\t\treturn $b;\n\t\t}\n\t\t\n\t}", "public function getCountSQL()\n {\n return 'SELECT COUNT(*) FROM product';\n }" ]
[ "0.77058846", "0.7454343", "0.7400336", "0.73645765", "0.7323935", "0.72988576", "0.72179997", "0.7146809", "0.71216726", "0.7060956", "0.67669386", "0.6725656", "0.6666449", "0.66342", "0.6625918", "0.65743613", "0.6573858", "0.65701693", "0.6568277", "0.65186995", "0.64970016", "0.64844215", "0.64523685", "0.6442591", "0.64044887", "0.6396917", "0.63943946", "0.63868123", "0.63807887", "0.6356405", "0.63393223", "0.63389164", "0.6335986", "0.63322425", "0.6331897", "0.63203114", "0.62961555", "0.6235899", "0.6232201", "0.62294185", "0.6192093", "0.6169468", "0.61682916", "0.61531013", "0.61356217", "0.61285454", "0.61180276", "0.6117584", "0.6112515", "0.6106121", "0.6105292", "0.6097079", "0.6088887", "0.6088132", "0.6075069", "0.60607404", "0.60469085", "0.60461134", "0.60205585", "0.60190266", "0.60129195", "0.6009632", "0.6004208", "0.6002976", "0.59921855", "0.5972093", "0.5965619", "0.59649277", "0.5951685", "0.5944834", "0.59363544", "0.59332263", "0.59238786", "0.59091866", "0.5890195", "0.58871484", "0.5884956", "0.5882177", "0.58763444", "0.58733535", "0.586675", "0.5861783", "0.5856388", "0.5854579", "0.5853252", "0.5831383", "0.58309454", "0.5825465", "0.58232445", "0.5821764", "0.582159", "0.58192986", "0.581136", "0.57979137", "0.5797793", "0.57950145", "0.57895", "0.57890505", "0.57881343", "0.57669157" ]
0.6214018
40
prepare the array so it can be used as a dropdown
public function get_for_admin() { $return_array = array(); $r = $this->where('deleted',NULL)->get_all(); foreach($r as $key=>$value) { $return_array[$value->id]=$value->name; } return $return_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectListArray($name,$array,$curr_id,$script=\"\",$empty_option=0) {\n\n\t\t$output\t\t = \"<select name=\\\"$name\\\" id=\\\"$name\\\" $script>\\n\";\n if ($empty_option) $output\t\t.= \"<option></option>\\n\";\n\n\t\tforeach ($array as $key=>$val) {\n\t\t\t$output .= \"<option value=\\\"\".$key.\"\\\" \".\n\t\t\t(($curr_id == $key)?\"selected\":\"\").\">\".$val.\"</option>\\n\";\n\t\t}\n\n\t\t$output .= \"</SELECT>\\n\";\n\n\t\treturn $output;\n\t}", "function arrayToSelect($theArray){\n\n\t$theSelect = \"<select name = \\\"course\\\">\";\n\t\n\tforeach($theArray as $element){\n\t\t$theSelect = $theSelect.\"<option>\". $element.\"</option>\";\n\t}\n\t\n\t$theSelect = $theSelect.\"</select>\";\n\t\n\treturn $theSelect;\n\t\n\t}", "public function FormatedSelectCustomizadoDetalle($array){\n\n $comprobante_id2 = '';\n $description = '';\n $i = 0;\n $contador = 1;\n foreach ($array as $value){\n if(($value[\"comprobante_id\"] != $comprobante_id2) && ($comprobante_id2 != '')){\n //le quito la ulima coma\n $result[$i]['descripcion'] = (isset($result[$i]['descripcion'])) ? substr($result[$i]['descripcion'], 0, -1) : '';\n \n $i++;\n $description = '';\n } \n \n $description .= $value['descripcion'].\",\";\n $result[$i]['comprobante_id'] = $value['comprobante_id'];\n $result[$i]['cli_razon_social'] = $value['cli_razon_social'];\n $result[$i]['cli_ruc'] = $value['cli_ruc'];\n $result[$i]['tipo_documento'] = $value['tipo_documento'];\n $result[$i]['descripcion'] = $description;\n $result[$i]['serie'] = $value['serie'];\n $result[$i]['numero'] = $value['numero'];\n $result[$i]['fecha_de_emision'] = $value['fecha_de_emision'];\n $result[$i]['fecha_de_vencimiento'] = $value['fecha_de_vencimiento'];\n $result[$i]['total_gravada'] = $value['total_gravada'];\n $result[$i]['total_igv'] = $value['total_igv'];\n $result[$i]['total_a_pagar'] = $value['total_a_pagar'];\n $result[$i]['total_detraccion'] = $value['total_detraccion'];\n $result[$i]['tipo_de_cambio'] = $value['tipo_de_cambio'];\n $result[$i]['enviado_sunat'] = $value['enviado_sunat'];\n $result[$i]['estado_sunat'] = $value['estado_sunat'];\n $result[$i]['enviado_cliente'] = $value['enviado_cliente'];\n $result[$i]['enviado_equipo'] = $value['enviado_equipo'];\n $result[$i]['tipo_documento'] = $value['tipo_documento'];\n $result[$i]['empresa'] = $value['empresa'];\n $result[$i]['abreviado'] = $value['abreviado'];\n $result[$i]['moneda'] = $value['moneda'];\n $result[$i]['simbolo'] = $value['simbolo']; \n \n $comprobante_id2 = $value[\"comprobante_id\"];\n \n //solamente para quitar la ultima coma.\n if(count($array) == $contador){\n $result[$i]['descripcion'] = (isset($result[$i]['descripcion'])) ? substr($result[$i]['descripcion'], 0, -1) : '';\n }\n $contador ++;\n }\n return $result;\n }", "private static function putDropUp($arr) {\n\t\tforeach ($arr as $k => $v) {\n\t\t\tself::$items[$k] = $v;\n\t\t}\n\t}", "public function crea_select($array,$id=null){\n\t\t$valores = '<option value=\"\">Selecciona</option>';\n\t\t//$array = json_decode($data);\n foreach ($array as $valor) {\n if ($id != null && $valor->id == $id)\n\t\t\t\t$valores .= '<option selected value=\"' . $valor->id . '\">' . $valor->nombre . '</option>';\n\t\t\telse\n $valores .= '<option value=\"' . $valor->id . '\">' . $valor->nombre . '</option>';\n\t\t}\n return $valores;\n }", "static function get_dropdown_options()\n {\n $rows = ORM::factory('actor')->where('parent_id=0')->orderby('actor')->find_all();\n \n foreach ($rows as $row){\n $hijos = array();\n $_t = ORM::factory('actor')->where('parent_id',$row->id)->orderby('actor')->select_list('id','actor');\n\n foreach($_t as $_id => $_n) {\n\n $_hijos = ORM::factory('actor')->where('parent_id',$_id)->orderby('actor')->select_list('id','actor');\n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_hijos);\n \n /* \n foreach($_hijos as $_idn => $_nn) {\n $_h[] = array('id' => $_idn, 'n' => $_nn, 'h' => ORM::factory('actor')->where('parent_id',$_idn)->select_list('id','actor'));\n }\n \n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_h);\n */\n }\n \n $opts[] = array('id' => $row->id, 'n' => $row->actor, 'h' => $hijos);\n }\n return $opts;\n }", "function input_dropdown_ui($array = array()){\n\t\t$input = self::input_label($array['label']);\n\t\tif(isset($array['class'])){\n\t\t\t$class_addon = ' '.$array['class'];\n\t\t}\n\t\telse{\n\t\t\t$class_addon = '';\n\t\t}\t\t\n\t\t$input .= '<select class=\"form-control'.$class_addon.'\"';\n\t\tforeach ($array as $key => $value) {\n\t\t\tif($key != \"option\" && $key != \"label\" && $key != \"value\" && $key != \"readonly\"){\n\t\t\t\t$input .= ' '.$key.'=\"'.$value.'\"';\t\t\t\t\n\t\t\t}\n\t\t\tif($key == \"readonly\" && $value == true){\n\t\t\t\t$input .= ' '.$key.'';\n\t\t\t}\t\t\t\n\t\t}\n\t\t$input .= '>';\n\t\tforeach ($array['option'] as $key => $value) {\n\t\t\tif(isset($array['value']) && $array['value'] == $key){\n\t\t\t\t$selected = 'selected';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$selected ='';\n\t\t\t}\n\t\t\t$input .= '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t}\n\t\t$input .= '</select>';\n\t\treturn $input;\n\t}", "public function generateDropdown(){\n $this->load->model('profilelist');\n $this->load->model('Player');\n $playerresult = $this->Player->all();\n foreach($playerresult as $row){\n $this1 = array(\n 'playername' => $row->Player,\n \n );\n $lists[] = $this1; \n }\n $this->data['playerdropdown'] = $lists;\n }", "function build_table_drop_down() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'step', 'text' => 'Step');\n\t$output[] = array('id' => 'task_name', 'text' => 'Task Name');\n\t$output[] = array('id' => 'description', 'text' => 'Task Description');\n\t$output[] = array('id' => 'mfg', 'text' => 'Mfg');\n\t$output[] = array('id' => 'qa', 'text' => 'QA');\n\t$output[] = array('id' => 'complete', 'text' => 'Complete');\n\t$output[] = array('id' => 'data_entry', 'text' => 'Data Entry Req');\n\treturn $output;\n }", "function arrayToMenu($array, $name, $selected='', $multiple=false, $size='', $blank=false, $javascript='', $id='')\r\n\t{\r\n\t\t$menu = '<select '.$javascript.' name=\"'.$name.'\"';\r\n\r\n\t\t//If set to null, dont include id. if unset, set id to $name.\r\n\t\tif ($id!=='') {$menu .= ' id=\"'.(empty($id)?$name:$id).'\"';}\r\n\r\n\t\tif ($multiple===true) {\r\n\t\t\t$menu .= ' multiple';\r\n\t\t} \r\n\t\t\r\n\t\tif ($size!='') {\r\n\t\t\t$menu .= ' size=\"'.$size.'\"';\r\n\t\t}\r\n\t\t \r\n\t\t$menu .= '>'; \r\n\t\t\r\n\t\tif ($blank==true) {\r\n\t\t\t $menu .= '<option value=\"\" selected>-----</option>';\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\r\n\t\t\t$menu .= '<option value=\"'.$key.'\"';\r\n\t\t\t\r\n\t\t\tif (is_array($selected)? in_array($key, $selected) : $key==$selected) {\r\n\t\t\t\t$menu .= ' selected';\r\n\t\t\t}\r\n\t\t\t$menu .= '>'.$value.'</option>';\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t$menu .= '</select>'; \r\n\t\r\n\t\treturn $menu;\r\n\t\r\n\t}", "private function _output_options_select($arr) {\n\t\t$output = '';\n\t\tforeach ($arr as $val => $opt) :\n\t\t\t$output .= '\n\t\t\t\t\t\t<option value=\"' . $val . '\">' . $opt . '</option>';\n\t\tendforeach;\n\t\treturn $output;\n\t}", "protected function buildMenuArray() {}", "public function get_dropdown_list() {\n /* convert things like &gt; to > etc */\n foreach ($this->allanswers as $key => $value) {\n $this->allanswers[$key] = htmlspecialchars_decode($value);\n }\n // Make the key and value the same in the array.\n $selectoptions = array_combine($this->allanswers, $this->allanswers);\n return $selectoptions;\n }", "function populate_list_array($objname, $array_list, $value_array, $display_array, $defaultvalue=-1,$disable=false){\nGLOBAL $g_obj_select_default_text;\n?>\t\n<select name=\"<?php echo $objname; ?>\" <?php if ($disable == true){?> disabled=\"true\"<?php } ?> >\n\t<option selected=\"selected\" value=\"-1\"><?php echo $g_obj_select_default_text ?></option>\n\t<?php foreach ($array_list as $value) { ?><option <?php if( $defaultvalue == $value[$value_array]){ ?> selected=\"selected\"<?php } ?> value=\"<?php echo $value[$value_array]; ?>\"><?php echo $value[$display_array]; ?></option>\n\t<?php } //--end for ?>\n\n</select>\n\t\n<?php }", "function get_select_options($select_data_array, $value_field, $display_field, $selected, $show_instr='Y', $instr_txt='Select')\n{\t\n\t$drop_HTML = \"\";\n\t#Determine whether to show the instruction option\n\tif($show_instr == 'Y'){\n\t\t$drop_HTML = \"<option value='' \";\n\t\t# Select by default if there is no selected option\n\t\tif($selected == '')\n\t\t{\n\t\t\t$drop_HTML .= \" selected\";\n\t\t}\n\t\n\t\t$drop_HTML .= \">- \".$instr_txt.\" -</option>\";\n\t}\n\t\n\tforeach($select_data_array AS $data_row)\n\t{\n\t\t$drop_HTML .= \" <option value='\".addslashes($data_row[$value_field]).\"' \";\n\t\t\n\t\t# Show as selected if value matches the passed value\n\t\t#check if passed value is an array\t\t\n if(is_array($selected)){\n \tif(in_array($data_row[$value_field], $selected)) $drop_HTML .= \" selected\";\n \n\t\t}elseif(!is_array($selected)){\n \tif($selected == $data_row[$value_field]) $drop_HTML .= \" selected\";\n }\t\t\n\t\t\t\t\n\t\t$display_array = array();\n\t\t# Display all data given based on whether what is passed is an array\n\t\tif(is_array($display_field))\n\t\t{\n\t\t\t$drop_HTML .= \">\";\n\t\t\t\n\t\t\tforeach($display_field AS $display)\n\t\t\t{\n\t\t\t\tarray_push($display_array, $data_row[$display]);\n\t\t\t}\n\t\t\t\n\t\t\t$drop_HTML .= implode(' - ', $display_array).\"</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$drop_HTML .= \">\".$data_row[$display_field].\"</option>\";\n\t\t}\n\t}\n\t\n\treturn $drop_HTML;\n}", "function get_select_options($select_data_array, $value_field, $display_field, $selected, $show_instr='Y', $instr_txt='Select One')\n{\n $drop_HTML = \"\";\n #Determine whether to show the instruction option\n if($show_instr == 'Y'){\n $drop_HTML = \"<option value='' \";\n # Select by default if there is no selected option\n if($selected == '')\n {\n $drop_HTML .= \" selected\";\n }\n\n $drop_HTML .= \">- \".$instr_txt.\" -</option>\";\n }\n\n foreach($select_data_array AS $data_row)\n {\n $drop_HTML .= \" <option value='\".addslashes($data_row[$value_field]).\"' \";\n\n # Show as selected if value matches the passed value\n #check if passed value is an array\n if(is_array($selected)){\n if(in_array($data_row[$value_field], $selected)) $drop_HTML .= \" selected\";\n\n }elseif(!is_array($selected)){\n if($selected == $data_row[$value_field]) $drop_HTML .= \" selected\";\n }\n\n $display_array = array();\n # Display all data given based on whether what is passed is an array\n if(is_array($display_field))\n {\n $drop_HTML .= \">\";\n\n foreach($display_field AS $display)\n {\n array_push($display_array, $data_row[$display]);\n }\n\n $drop_HTML .= implode(' - ', $display_array).\"</option>\";\n }\n else\n {\n $drop_HTML .= \">\".$data_row[$display_field].\"</option>\";\n }\n }\n\n return $drop_HTML;\n}", "function dropdown($array,$param=NULL) {\n\t\t$name = $param['name'];\n\t\tif (!$param['id']) $param['id'] = $name;\n\t\techo '<select name=\"' . $name . '\" id=\"' . $param['id'] . '\"' . '\" class=\"' . $param['class'] . '\"';\n\t\tif ($param['onchange']) echo ' onchange=\"' . $param['onchange'] . '\"';\n\t\tif ($param['class']) echo ' class=\"' . $param['class'] . '\"';\n\t\techo '>' . \"\\n\";\n\t\tif ( $param['null_option'] !== false ) echo \"\\t\" . '<option value=\"\">' . $param['null_option'] . '</option>';\n\t\tforeach ($array as $value => $option) {\n\t\t\techo \"\\t\" . '<option value=\"' . $value . '\"';\n\t\t\tif ($param['selected_value'] && $param['selected_value'] == $value) echo ' selected ';\n\t\t\techo '>' . $option . '</option>' . \"\\n\";\n\t\t}//foreach\n\t\techo \"</select>\\n\";\n\t\n\t}", "function erp_hr_get_designation_dropdown_raw() {\n $designations = erp_hr_get_designations();\n $dropdown = array( 0 => __( '- Select Designation -', 'wp-erp' ) );\n\n if ( $designations ) {\n foreach ($designations as $key => $designation) {\n $dropdown[$designation->id] = stripslashes( $designation->title );\n }\n }\n\n return $dropdown;\n}", "function erp_hr_get_departments_dropdown_raw($select_label = null ) {\n $departments = erp_hr_get_departments();\n $dropdown = array( 0 => __( '- Select Department -', 'wp-erp' ) );\n\n if ( $select_label ) {\n $dropdown = array( 0 => $select_label );\n }\n\n if ( $departments ) {\n foreach ($departments as $key => $department) {\n $dropdown[$department->id] = stripslashes( $department->title );\n }\n }\n\n return $dropdown;\n}", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "function InputSelectFromArray($List,$VariableName,$default,$autres='')\t{\n\t\t// gestion readonly\n\t\tif($_SESSION[\"readonly\"]==\"true\")\n\t\t\t$cache=\"disabled\";\n\n\t\t// check taille \n\t\tif ($taille > 1)\n\t\t\t$_taille=\"WIDTH='$taille' STYLE='width: \".$taille.\"px'\";\n\t\t\n\t \t$res= \"<select name='\".$VariableName.\"' class=form \".$autres.\">\";\n\t \tforeach($List as $i=>$val){\n\t \t\tif ($default==$i)\n\t\t \t\t$res.= \"<option value='$i' selected>\".$val.\"</option>\";\n\t\t \telse\n\t\t \t\t$res.= \"<option value='$i' >\".$val.\"</option>\";\n\t\t}\n\t\t$res.= \"</select>\";\n\t\treturn $res;\n\t}", "function FillStaticCombo($arrStr,$selectvalue) {\n\t$selectvalue1=\"\";\n\tforeach($arrStr as $k=>$v){\n\t if($selectvalue===$k){\n\t\t echo\"<option value=\".$k.\" selected>\".$v.\"</option>\";\n\t\t $selectvalue1=$selectvalue;\n\t }\n\t else\n\t\t echo\"<option value=\".$k.\" >\".$v.\"</option>\";\n\t}\n return $selectvalue1;\n}", "protected function filterDropdownFields(): array\n {\n return [];\n }", "function select($name = \"txt\", $alttext = \"\", $selecttype = \"array\", $lookup = \"\", $value = \"\", $event = \"\", $cssid = \"\", $readonly = false, $nochoose = true) {\n\n if (isset($_REQUEST[$name])) {\n if ($value == \"\") {\n $value = $_REQUEST[$name];\n }\n }\n $lookuplist = [];\n if ($selecttype == \"array\" || $selecttype == \"multiarray\") {\n\n if (is_array($lookup)) {\n $lookuplist = $lookup;\n } else {\n $lookuplist = explode(\"|\", $lookup);\n }\n } else if ($selecttype == \"sql\" || $selecttype == \"multisql\") {\n $lookuprow = $this->DEB->getRows($lookup, DEB_ARRAY); //format [0] = NAME\n\n\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1]; //make it in the form of array\n }\n }\n //make options for the type of select etc .....\n if ($selecttype == \"multiarray\" || $selecttype == \"multisql\") {\n $options = \"multiple=\\\"multiple\\\"\";\n } else {\n $options = \"\";\n }\n if ($readonly == true) {\n $disabled = \"disabled=\\\"disabled\\\"\";\n } else {\n $disabled = \"\";\n }\n //default text\n if ($alttext == \"\") {\n $alttext = \"Choose\";\n }\n if ($cssid != \"\") {\n $cssid = \"id=\\\"{$cssid}\\\"\";\n } else {\n $cssid = \"\";\n }\n $html = \"<select class=\\\"form-control\\\" $cssid name=\\\"{$name}\\\" $options {$event} $disabled >\";\n\n if (!$nochoose) {\n $html .= \"<option value=\\\"\\\">{$alttext}</option>\";\n }\n\n foreach ($lookuplist as $lid => $option) {\n\n $toption = explode(\",\", $option);\n if (count($toption) != 2) {\n $toption[0] = $lid;\n $toption[1] = $option;\n }\n\n $option = $toption;\n\n if (trim($value) == trim($option[0])) {\n $html .= \"<option selected=\\\"selected\\\" value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n } else {\n $html .= \"<option value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n }\n }\n $html .= \"</select>\";\n return $html;\n }", "function dropDown($array,$multi,$size,$name,$result)\r\n{\r\n /**\r\n *Format the select option\r\n */\r\n echo \"<select name=\\\"$name\";\r\n \r\n if ($multi == 1)\r\n {\r\n echo \"[]\\\" size=\\\"$size\\\" multiple=\\\"multiple\\\">\";\r\n }\r\n else\r\n {\r\n echo \"\\\">\\n\";\r\n }\r\n \r\n if($multi == 0)\r\n {\r\n /**\r\n * Loop through non-multi array.\r\n * */\r\n foreach($array as $field => $value)\r\n {\r\n echo \"<option value=\\\"$value\\\"\";\r\n if($value == $result[$name]){echo \" selected=\\\"selected\\\" \";}\r\n echo \">$field</option>\\n\";\r\n } \r\n }\r\n else\r\n {\r\n /**\r\n * Loop through a multi-array\r\n * */\r\n \r\n ## Save the current value\r\n $value_count = $result[$name];\r\n ## SOME SELECT ALLS = -1, SO NEED TO OFFSET THAT\r\n if ($value_count == -1){ $value_count = max($array);}\r\n \r\n foreach($array as $field => $value)\r\n {\r\n echo \"<option value=\\\"$value\\\"\";\r\n if($value == $value_count)\r\n {\r\n echo \" selected=\\\"selected\\\" \";\r\n $value_count -= $value_count;\r\n }\r\n echo \">$field</option>\\n\";\r\n }\r\n }\r\n echo \"</select>\\n\";\r\n \r\n}", "function get_dropdown_array($value){\n $result = array();\n $array_keys_values = $this->db->query('select id, '.$value.' from purchase_transaction order by id asc');\n $result[0]=\"-- Pilih Urutan id --\";\n foreach ($array_keys_values->result() as $row)\n {\n $result[$row->id]= $row->$value;\n }\n return $result;\n }", "public function _get_picker_dropdown_choices() {\n\t\t$this->load_data();\n\t\t$result = array();\n\t\tforeach ( $this->data as $unique_key => $item ) {\n\t\t\t$result[ $unique_key ] = $item['label'];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function build()\n {\n self::$options = [];\n foreach( $this->rawOptions as $option ) {\n if( @self::$options[ $option[ 'key' ] ] == null ) {\n if( ( bool ) $option[ 'array' ] ) {\n self::$options[ $option[ 'key' ] ] = [ $option[ 'value' ] ];\n } else {\n self::$options[ $option[ 'key' ] ] = $option[ 'value' ];\n } \n } else {\n // if value has yet been saved, then well consider it as an array\n if( ! is_array( self::$options[ $option[ 'key' ] ] ) ) {\n $temp = self::$options[ $option[ 'key' ] ];\n unset( self::$options[ $option[ 'key' ] ] );\n self::$options[ $option[ 'key' ] ] = [ $temp ];\n } else {\n self::$options[ $option[ 'key' ] ][] = $option[ 'value' ];\n }\n } \n }\n }", "protected function buildOptionsList() {\n }", "function build_selection_dropdown() {\n\t$output = array();\n\t$output[] = array('id' => '', 'text' => TEXT_SELECT);\n\t$output[] = array('id' => 'wo_journal_main.id', 'text' => 'Record ID');\n\t$output[] = array('id' => 'wo_journal_main.wo_id', 'text' => 'Work Order Num');\n\t$output[] = array('id' => 'wo_journal_main.wo_title', 'text' => 'Work Order Title');\n\t$output[] = array('id' => 'wo_journal_main.priority', 'text' => 'Priority');\n\t$output[] = array('id' => 'wo_journal_main.sku', 'text' => 'SKU');\n\t$output[] = array('id' => 'wo_journal_main.qty', 'text' => 'Quantity');\n\t$output[] = array('id' => 'wo_journal_main.post_date', 'text' => 'Post Date');\n\t$output[] = array('id' => 'wo_journal_main.closed', 'text' => 'Closed');\n\t$output[] = array('id' => 'wo_journal_main.closed_date', 'text' => 'Closed Date');\n\t$output[] = array('id' => 'wo_journal_main.notes', 'text' => 'Notes');\n\t$output[] = array('id' => 'wo_journal_main.bom_list', 'text' => 'BOM List');\n\t$output[] = array('id' => 'wo_journal_main.ref_specs', 'text' => 'Reference Specs');\n\t$output[] = array('id' => 'wo_journal_main.ref_docs', 'text' => 'Reference Docs');\n\t$output[] = array('id' => 'bar_code', 'text' => 'SKU Bar Code');\n\t$output[] = array('id' => 'image_with_path', 'text' => 'SKU Image');\n\treturn $output;\n }", "function select02($nombreSelect,$arrayOpciones){\n\t$i = '0';\n\t$arrayResultado[$i++] = \"<select name=\\\"$nombreSelect\\\">\";\n\tforeach( $arrayOpciones as $key => $value ){\n\t\tif( $i == '1' ){\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\" selected=\\\"selected\\\">\".$value.\"</option>\";\n\t\t} else {\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\">\".$value.\"</option>\";\n\t\t}\n\t}\n\t$arrayResultado[$i++] = \"</select>\";\n\treturn $arrayResultado;\n/*\nforeach( $arrayResultado as $value){\n\techo $value.\"<br />\\n\";\n}\n*/\n}", "function cmdCustType($name, $caption) {\n $optcust_type = array\n (\n array(\"\", \"\"),\n array(\"End User\", \"1\"),\n array(\"Dealer / Reseller\", \"2\"),\n array(\"Goverment / BUMN\", \"3\"),\n );\n ?>\n <tr>\n <td><?php getCaption($caption); ?> :</td>\n <td>\n <select class=\"easyui-combobox\"\n id=\"<?php echo $name; ?>\"\n name=\"<?php echo $name; ?>\"\n style=\"width:120px;\"\n data-options=\"panelHeight:100,editable:false,width:200\"\n disabled=true\n >\n <?php\n foreach ($optcust_type as $val) {\n echo '<option value=\"' . $val[1] . '\">' . $val[0] . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <?php\n}", "protected function _getSectionArrSelectOption($arr)\n\t{\n\t\t$arrSelectTag = &$arr['arrSelectTag'];\n\t\t$arrStrTitle = &$arr['arrStrTitle'];\n\n\n\t\t$array = &$arr['vars'];\n\t\t$numAll = count($array);\n\t\t$numArr = 1;\n\t\tforeach ($array as $key => $value) {\n\t\t\t$strTitleFS = ($arr['flagFS'] == 'CR')? '['. $arr['strCR'] .']' . $value['strTitle'] : $value['strTitle'];\n\t\t\t$data = array(\n\t\t\t\t'strTitle' => $value['strTitle'],\n\t\t\t\t'strTitleFS' => $strTitleFS,\n\t\t\t\t'flagDebit' => (int) $value['vars']['flagDebit'],\n\t\t\t\t'flagUse' => (is_null($value['vars']['flagUse']))? '' : (int) $value['vars']['flagUse'],\n\t\t\t\t'flagFS' => $arr['flagFS'],\n\t\t\t);\n\n\t\t\t$arrLevel = preg_split(\"/-/\", $value['id']);\n\t\t\t$num = count($arrLevel) - 2;\n\t\t\t$arrLevel = array();\n\t\t\tfor ($i = 0 ; $i < $num; $i++) {\n\t\t\t\t$arrLevel[$i] = '';\n\t\t\t}\n\t\t\t$str = ' ' . join('.', $arrLevel) . ' ';\n\t\t\t$strTitle = $str . $value['strTitle'];\n\t\t\t$strTitleFSTag = $str . $strTitleFS;\n\n\t\t\tif (is_null($value['vars']['flagUse'])) {\n\t\t\t\t$arr['arrSelectTag'][] = array(\n\t\t\t\t\t'strTitle' => $strTitle,\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'flagDisabled' => 1,\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\tif ($value['vars']['flagSortUse'] && $numAll == $numArr) {\n\t\t\t\t\t$arr['arrSelectTag'][] = array(\r\n\t\t\t\t\t\t'strTitle' => $str . '(' . $arr['strTitleParent'] . ')',\r\n\t\t\t\t\t\t'value' => $arr['idTargetParent'] . ',' . $arr['flagFS'],\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$arr['arrStrTitle'][$value['vars']['idTarget']] = $data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$numArr++;\n\n\t\t\tif ($value['child']) {\n\t\t\t\t$dataTemp = $this->_getSectionArrSelectOption(array(\n\t\t\t\t\t'vars' => $array[$key]['child'],\n\t\t\t\t\t'arrSelectTag' => $arr['arrSelectTag'],\n\t\t\t\t\t'arrStrTitle' => $arr['arrStrTitle'],\n\t\t\t\t\t'flagBS' => $arr['flagBS'],\n\t\t\t\t\t'flagFS' => $arr['flagFS'],\n\t\t\t\t\t'strCR' => $arr['strCR'],\n\t\t\t\t\t'strTitleParent' => $value['strTitle'],\n\t\t\t\t\t'idTargetParent' => $value['vars']['idTarget'],\n\t\t\t\t));\n\t\t\t\t$array[$key]['child'] = $dataTemp['vars'];\n\t\t\t\t$arrSelectTag = $dataTemp['arrSelectTag'];\n\t\t\t\t$arrStrTitle = $dataTemp['arrStrTitle'];\n\t\t\t}\n\t\t}\n\n\t\treturn $arr;\n\t}", "static function html_select(array $input,$name,$sled=''){\n\t\t$ret='';\n\t\t\t$ret.='<select name=\"'.$name.'\">';\n\t\tforeach($input as $k=>$v){\n\t\t\t$tmp_def = $sled == $k ? 'selected=\"selected\"':'';\n\t\t\t$ret.='<option value=\"'.$k.'\" '.$tmp_def.'>'.$v.'</option>';\n\n\t\t}\n\t\t$ret.='</select>';\n\t\treturn $ret;\n\t}", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "function form_select($name, $array, $to_array='', $start='', $same='0', $extra='', $size='', $top='', $override = NULL, $id = NULL, $disabled = NULL, $strict=NULL) {\n\n\t$html = '';\n\n\tif ($size AND count($array) < $size) {\n\t\t$size = count($array) + intval($extra) + 1;\n\t}\n\n\tif ($to_array != '') {\n\t\t$name = $to_array . \"[\" . $name . \"]\";\n\t}\n\n\tif ($size) {\n\t\t$name = $name . \"[]\";\n\t}\n\n\t// don't show two rows if only 1, show 3 if two.\n\tif ($size == 1) {\n\t\tunset($size);\n\t} elseif ($size == 2) {\n\t\t$size = 3;\n\t}\n\n\tif (!$id) {\n\t\t$id = $name;\n\t}\n\n\tif ($disabled) {\n\t\t$disabled = \" DISABLED=disabled \";\n\t\t$name = $name.\"_disable\";\n\t}\n\tif ($size) {\n\t\t$html .= \"<select name=\\\"$name\\\" id=\\\"$id\\\" size=\\\"$size\\\" $disabled $top MULTIPLE>\\n\";\n\t} else {\n\t\t$html .= \"<select name=\\\"$name\\\" id=\\\"$id\\\" $disabled $top>\\n\";\n\t}\n\tif ($extra) {\n\t\t$html .= \"<option value=\\\"-----\\\">None Selected</option>\\n\";\n\t}\n\n\tif (is_array($array)) {\n\n\t\tforeach ($array AS $key => $val) {\n\n\t\t\tif (is_array($val)) {\n\t\t\t\tif ($val[0] == 'OPTGROUP') {\n\t\t\t\t\t$html .= \"<optgroup LABEL=\\\"\" . $val[1] . \"\\\">\";\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\tif ($same) {\n\t\t\t\t\t$key = $val;\n\t\t\t\t}\n\n\t\t\t\t$val = html_form_escape($val, $override);\n\t\t\t\t$key = html_form_escape($key, $override);\n\n\t\t\t\tif (is_array($start)) {\n\t\t\t\t\tif (in_array($key, $start, $strict)) {\n\t\t\t\t\t\t$html .= \"<option selected=\\\"selected\\\" value=\\\"$key\\\">$val</option>\\n\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$html .= \"<option value=\\\"$key\\\">$val</option>\\n\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (compare_value($key, $start, $strict)) {\n\t\t\t\t\t\t$html .= \"<option selected=\\\"selected\\\" value=\\\"$key\\\">$val</option>\\n\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$html .= \"<option value=\\\"$key\\\">$val</option>\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$html .= \"</select>\\n\";\n\treturn $html;\n}", "function returnNumbersDropdownArray($numbers_array, $title, $disabled_title, $current_value)\n {\n $root_array=array();\n\n if (is_array($numbers_array) && !empty($title) && !empty($disabled_title))\n {\n foreach ($numbers_array as $value)\n {\n $item_array['value']=$value;\n $item_array['title']=$value; //use $value as option title by default\n\n if ($value==0 && !empty($disabled_title)) //format disabled title when value is 0\n {\n $item_array['title']=$disabled_title;\n }\n\n if ($value>0 && !empty($title)) //format title by adding a specific word to it\n {\n $item_array['title'].=\" $title\";\n\n if ($value==1 && substr($item_array['title'], -1)==\"s\") //remove last \"s\" if needed, so \"1 records\" becomes \"1 record\"\n {\n $item_array['title']=substr($item_array['title'], 0, -1);\n }\n }\n\n if ($value==$current_value) //this value should be selected\n {\n $item_array['selected']=\" selected\";\n }\n else\n {\n $item_array['selected']=\"\";\n }\n\n $root_array[]=$item_array;\n }\n }\n\n return $root_array;\n }", "public function prepareOptions()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\t$query = 'SELECT name FROM options WHERE id_votes =\"'.$this->voteId.'\" ORDER BY id_option ASC ';\r\n\t\t\tif ($result = $mysqli->query($query))\r\n\t\t\t{\r\n\t\t\t\twhile($obj = $result->fetch_object())\r\n\t\t\t\t{\r\n\t\t\t\t\tarray_push($this->optionList,$obj->name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$mysqli->close(); \r\n\t\t}", "function dropDownto()\r\n {\r\n $queryArray = array();\r\n $html = \"\";\r\n\r\n $mysqli = $this->conn;\r\n $query = \"SELECT ID,lakeHostGroupName FROM lakehostgroup ORDER BY lakeHostGroupName ASC\";\r\n $stmt = $mysqli->query($query);\r\n\r\n /*\r\n // Prepared statement, stage 1: prepare\r\n if (!($stmt = $mysqli->prepare(\"SELECT ?, ? FROM ? ORDER BY ?))) {\r\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\r\n }\r\n\r\n // Prepared statement, stage 2: bind and execute\r\n if (!($stmt->bind_param('ssss', , , ,))) {\r\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n if (!$stmt->execute()) {\r\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n */\r\n\r\n if ($stmt->num_rows > 0) {\r\n while ($row = $stmt->fetch_assoc()) {\r\n $queryArrayID = $row['ID'];\r\n $queryArrayField = $row['lakeHostGroupName'];\r\n $queryArray[$queryArrayID] = $queryArrayField;\r\n }\r\n }\r\n $html .= \"<select id= groupID required>\";\r\n foreach ($queryArray as $key => $value) {\r\n $html .= \"<option value=$key>$value</option>\\n\";\r\n }\r\n return $html;\r\n }", "function arrayToSelect( $options, $selected = '', $optgroup = NULL, $blank ){\n\tif ( $blank )\n\t\techo '<option value=\"\">- - ' . __( 'Select' ) . ' - -</option>';\n\tforeach ( $options as $value ) {\n\t\tif ( is_object( $value ) ){\n\t\t\t$optValue = $value->title;\n\t\t} else {\n\t\t\t$optValue = $value;\n\t\t}\n\t\tif ( $selected == $optValue ){\n\t\t\t$set = 'selected=\"selected\"';\n\t\t} else {\n\t\t\t$set = '';\n\t\t}\n\t\t$returnStatement .= '<option value=\"' . $optValue . '\" ' . $set . '>' . $optValue . '</option>';\n\t}\n\treturn $returnStatement;\n}", "function CreateOptionsFromArray($arr, $sel = false) {\n\t$options = \"\";\n\tforeach ($arr as $id => $val) {\n\t\tif ($sel !== false && strval($sel) == strval($id)) {\n\t\t\t// this is the default row\n\t\t\t$options .= '<option value=\"' . $id . '\" selected=\"selected\">' . $val . '</option>';\n\t\t} else {\n\t\t\t// just another row\n\t\t\t$options .= '<option value=\"' . $id . '\">' . $val . '</option>';\n\t\t}\n\t}\n\n\treturn $options;\n}", "function get_dropdown_array($value){\n $result = array();\n $array_keys_values = $this->db->query('select Kode, '.$value.' from karyawan order by Kode asc');\n $result[0]=\"-- Pilih Urutan Kode --\";\n foreach ($array_keys_values->result() as $row)\n {\n $result[$row->Kode]= $row->$value;\n }\n return $result;\n }", "function listField($label, $name, $formName, $array){\n \n echo ucwords($label) . \"&nbsp\"; \n \n $size = count($array);\n \n $list = '<select name=\"';\n $list .= $name;\n $list .= '\" form=\"';\n $list .= $formName;\n $list .= '\">';\n \n echo $list;\n \n $i = 0;\n \n for ($i; $i < $size; $i++)\n {\n $option = '<option value=\"';\n $option .= $array[$i];\n $option .= '\">';\n $option .= $array[$i];\n $option .= '</option>';\n \n echo $option;\n }\n \n echo '</select><br>';\n \n\n // <select name=\"company\" form=\"userInput\">\n // <option value=\"Not Applicable\">Not Applicable</option>\n // </select>\n \n}", "public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n\t\t$options['optRegion'] = $table->getRegion();\n\n // elements\n\t\t$result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n\t\t\t'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\n return $result;\n }", "function select_list_from_array($name, $data_array, $default_value = \"\", $allow_empty = FALSE, $class = \"\", $id = \"\", $select_message = 'Select an option') {\n $select_object = new html_classes\\select($name);\n $select_object->set_attrib(\"class\", $class, TRUE);\n $select_object->set_attrib(\"id\", $id);\n\n if ($allow_empty) {\n $select_object->append_option(\"\", $select_message);\n }\n\n foreach ($data_array as $value => $label) {\n $select_object->append_option($value, $label, (($value === $default_value) ? TRUE : FALSE));\n }\n return $select_object;\n}", "function select01($nombreSelect,$arrayOpciones){\n\t$i = '0';\n\t$arrayResultado[$i++] = \"<select name=\\\"$nombreSelect\\\">\";\n\tforeach( $arrayOpciones as $value ){\n\t\tif( $i == '1' ){\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$value.\"\\\" selected=\\\"selected\\\">\".$value.\"</option>\";\n\t\t} else {\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$value.\"\\\">\".$value.\"</option>\";\n\t\t}\n\t}\n\t$arrayResultado[$i++] = \"</select>\";\n\treturn $arrayResultado;\n/*\nforeach( $arrayResultado as $value){\n\techo $value.\"<br />\\n\";\n}\n*/\n}", "function populateLocationDropdown($locations)\r\n{\r\n $result=\"\";\r\n foreach ($locations as $loc)\r\n {\r\n $result .= '<li value=\"' . $loc->getId() . '\" name=\"' . $loc->getBuilding() . '.' . $loc->getFloor() . '.' . $loc->getRoom() . '\"><a href=\"#\">' . $loc->getBuilding() . '.' . $loc->getFloor() . '.' . $loc->getRoom() . '</a></li>';\r\n }\r\n return $result;\r\n}", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "function setGoodArrayAndGoodMysql ($array){\n $connect = $GLOBALS['connect'];\n $kode = $GLOBALS['kode'];\n $array = array_values ($array);\n $array = array_values ($array[0]);\n \n foreach ($array as $val)\n $data[] = mysqli_real_escape_string ( $connect , htmlspecialchars ( htmlentities ( strip_tags (trim ( $val ) ) ) ) );\n \n array_push ($data,$kode);\n return $data;\n}", "function listadoregiones() {\n $query8 = \"SELECT * FROM intranet_roadmap_regiones\";\n $result8 = (array) json_decode(miBusquedaSQL($query8), true) ;\n foreach ($result8 as $pr8) {\n $proyectos .= '<option value=\"'.$pr8['id_region'].'\">'.$pr8['nombre_region'].'</option> \n';\n }\n return $proyectos;\n\n}", "function drop_down()\n\t{\n\t\t$args = func_get_args();\n\n\t\tif(count($args) == 2)\n\t\t{\n\t\t\tlist($key, $value) = $args;\n\t\t}\n\t\telse {\n\t\t\t$key = $this->primary_key;\n\t\t\t$value = $args[0];\n\t\t}\n\n\t\t$this->trigger('before_dropdown', array($key, $value));\n\n\t\t$result = $this->db->select(array($key, $value))\n\t\t\t\t\t\t ->get($this->_table)\n\t\t\t\t\t\t ->result();\n\n\t\t$options = array();\n\n\t\tforeach($result as $row) \n\t\t{\n\t\t\t$options[$row->{$key}] = $row->{$value};\n\t\t}\n\n\n\t\t$options = $this->trigger('after_dropdown', $options);\n\n\t\treturn $options;\n\t}", "public function toOptionArray(){\n $options = array();\n $table = 'cms_block';\n $fields = Mage::helper('connector')->getFields($table);\n \n for ($i = 0; $i < sizeof($fields); $i++){\n $options[] = array(\n 'label' => $fields[$i],\n 'value' => $fields[$i]\n );\n }\n return $options;\n }", "protected function createUserAndGroupListForSelectOptions() {}", "function bi_options_column($arr = array()){\r\n\t$arr_option = bi_options(array(\r\n\t\t\"chartBottomMargin\" => \"25\",\r\n\t\t\"chartTopMargin\" => \"50\",\r\n\t\t\"showLabels\" => \"1\",\r\n\t\t\"showLegend\" => \"1\",\r\n\t\t\"showValues\" => \"1\",\r\n\t\t\"exportEnabled\" => \"1\"\r\n\t));\r\n\tforeach($arr as $i => $val){\r\n\t\t$arr_option[$i] = $val;\r\n\t}\r\n\treturn $arr_option;\r\n}", "public function CreateSelectArray()\n {\n\t\t//Make the array relative to today.... ill do later.\n\t\t$this->TodayDate = \"\";\n\t\t$this->TodaysDate = $this->GetTodaysDate();\t \t\n\t\t$days = 0;\t\t\n \n\t\t$LISTofDATES = [];\n\t\t\n\t\tfor($ya = 2020; $ya < 2040; $ya++) {\n\t\t\t$year = \"\".$ya.\"\";\n\t\t\t$LISTofDATES[$year] = [ \"January\" => 0, \"February\" => 0, \"March\" => 0, \"April\" => 0, \"May\" => 0, \"June\" => 0, \"July\" => 0, \"August\" => 0, \"September\" => 0, \"October\" => 0, \"November\" => 0, \"December\" => 0 ];\t \n\t\t}\n\n\t\tforeach ( $LISTofDATES as $Year => $Months )\n\t\t{\t\t\t\n\t\t\tfor( $Month = 1; $Month <= 12; $Month++ )\n\t\t\t{\n\t\t\t\tif ( $Month == 1 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['January'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 2 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['February'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 3 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['March'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 4 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['April'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 5 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['May'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 6 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['June'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 7 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['July'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 8 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['August'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 9 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['September'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 10 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['October'] = $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 11 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['November']= $days;\n\t\t\t\t}\n\t\t\t\tif ( $Month == 12 )\n\t\t\t\t{\n\t\t\t\t\t$days = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);\n\t\t\t\t\t$LISTofDATES[$Year]['December'] = $days;\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\t \n\t\t}//For each Year done\t\t\n\t\t/*Should have a fully populated array of days for each month in 2 years*/\t\t\n\t\treturn json_encode($LISTofDATES);\t\t\t\t\n }", "function select_convert($arr) {\n\t$result = array();\n\tforeach($arr as $k => $v) {\n\t\t$result[] = array(\"fid\" => $k, \"fcaption\" => $v);\n\t}\n\treturn $result;\n}", "function jdgenericlist( $arr, $name, $attribs = null, $key = 'value', $text = 'text', $selected = NULL, $idtag = false, $translate = false )\n {\n if ( is_array( $arr ) ) {\n reset( $arr );\n }\n\n if (is_array($attribs)) {\n $attribs = JArrayHelper::toString($attribs);\n }\n\n // $id = $name;\n\n if ( $idtag ) {\n $id = $name; \n }\n\n $id = str_replace('[','',$id);\n $id = str_replace(']','',$id);\n\n $html = '<select name=\"'. $name .'\" id=\"'. $id .'\" '. $attribs .'>';\n $html .= jdoptions( $arr, $key, $text, $selected, $translate );\n $html .= '</select>';\n\n return $html;\n }", "function getDropDown() ;", "public function toOptionArray(){\n\t\t$data = array('delhi'=>'Delhi','mumbai'=>'Mumbai','pune'=>'Pune','chennai'=>'Chennai');\n\t\treturn $data;\n\t}", "function prepSelected($data){\n\t\n\t$current = 0;\n\t$count = count($data);\n\t\n\t$placeholders = ''; $selected = array(); $i = 0;\n\t$keys = array_keys($data); \n\t\n\tforeach($keys as $item){\n\t\tprint_r($data);\n\t\t\n\t\tswitch($item){\n\t\t\tcase $data[$i] == $keys[$i] : array_push($selected, $item);\n\t\t\tbreak;\n\t\t}\n\t\t$i++;\n\t}\n\tprint_r($selected);\n\t\t\n\t//While there are selected items\n\twhile($current < $count){\n\t\t//create the keys\t\n\t\tif($count == 1) { \n\t\t\t$keys .= $selected[$current];\n\t\t} else {\n\t\t\t$keys .= $selected[$current].',';\n\t\t} \t\n\t\t//create the placeholders\t\n\t\tif($count == 1) { \n\t\t\t$placeholders .= '?';\n\t\t} else {\n\t\t\t$placeholders .= '?,';\n\t\t} \t\n\t\t$current++; \n\t}\n\tif($count > 1){\n\t\t$keys = explode(',', $keys);\n\t\t$trash = array_pop($keys);\n\t\t$keys = implode(',', $keys);\n\t\t\t\n\t\t$placeholders = explode(',', $placeholders);\n\t\t$trash = array_pop($placeholders);\n\t\t$placeholders = implode(',', $placeholders);\n\t\t\t\n\t}\n\t\n\n\t\n\treturn $sql_vals = array($keys, $placeholders);\n}", "public function convertSelect(array $conjugation){\n \n }", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "protected function _prepareArrayRow(DataObject $row): void\n {\n $options = [];\n $categories = $row->getCategories();\n if ($categories && count($categories) > 0) {\n foreach ($categories as $category) {\n $options['option_' . $this->getCategoriesRenderer()->calcOptionHash($category)] = 'selected=\"selected\"';\n }\n }\n $row->setData('option_extra_attrs', $options);\n }", "function displayConfig($arrayType, $type, $idName, $arrayOption = null) {\n $str = \"<select size='1' class='cbo' name='$idName' id='$idName'><option value=''>-- \" . $arrayOption[\"firstText\"] . \" --</option>\";\n if (is_array($arrayType))\n foreach ($arrayType as $key => $value) {\n $str .= \"<option value='\" . $key . \"' \" . (($type == $key) ? \"selected\" : \"\") . \">\" . $value . \"</option>\";\n }\n $str .= \"</select>\";\n return $str;\n }", "function create_dropdown_options($userID) {\n $options = [];\n foreach (get_users_galleries($userID) as $gallery) {\n array_push($options, create_element(\"option\", true, [\n \"value\" => $gallery[\"id\"],\n \"contents\" => $gallery[\"title\"]\n ]));\n }\n return $options;\n}", "function awm_select_options()\n {\n return array(\n 'options' => array(\n 'label' => __('Options', 'extend-wp'),\n 'case' => 'repeater',\n 'include' => array(\n 'option' => array(\n 'label' => __('Value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'label' => array(\n 'label' => __('Label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n ),\n ),\n );\n }", "function getNameOptions(){\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n \n // Select some fields\n //$query->select('DISTINCT name');\n $query->select('name');\n // From the hello table\n $query->from('#__helloworld_message');\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList();\n\t\t\t\n\t\t\tforeach($result as $item){\n\t\t\t\t$name = $item->name;\n\t\t\t\t$filter_name_options[] = JHTML::_('select.option', $name , $name);\n\t\t\t\t}\n\t\t\treturn $filter_name_options;\n\t\t\t\n\t\t\t}", "public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n $options['optRegion'] = $table->getRegion();\n\n // elements\n $result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n 'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\n return $result;\n }", "function get_multiselect_from_table ($tpl,$table,\n $nom_select,\n $classe_select,\n $extra_attrs,\n $value_option,$texte_option,\n $option_tous,$texte_tous,\n $values_selected,\n $size=10) {\n global $CFG;\n\n $modele=<<<EOT\n<!-- START BLOCK : select -->\n<select\n name=\"{nom_select}[]\" id=\"{nom_select}\" multiple=\"multiple\" size=\"$size\"\n class=\"{classe_select}\"\n {extra_attrs}>\n <!-- START BLOCK : option_neutre -->\n <option value=\"{value_neutre}\">{texte_neutre}</option>\n <!-- END BLOCK : option_neutre -->\n <!-- START BLOCK : option -->\n <option value=\"{value_option}\" {selected}>{texte_option}</option>\n <!-- END BLOCK : option -->\n</select>\n<!-- END BLOCK : select -->\n\nEOT;\n $tmptpl= new SubTemplatePower($modele,T_BYVAR); //cr�er une instance\n // a le meme chemin que le template porteur si existe\n if (!$tpl) $tmptpl->prepare($CFG->chemin);\n else $tmptpl->prepare($tpl->chemin);\n $tmptpl->newBlock(\"select\");\n $tmptpl->assign(\"nom_select\",$nom_select);\n $tmptpl->assign(\"classe_select\",$classe_select?$classe_select:'saisie');\n $tmptpl->assign(\"extra_attrs\",$extra_attrs?$extra_attrs:'');\n if ($option_tous) { // item sans valeur au d�but ?\n $tmptpl->newBlock(\"option_neutre\");\n $tmptpl->assign(\"value_neutre\",$option_tous);\n $tmptpl->assign(\"texte_neutre\",$texte_tous);\n }\n if ($table)\n foreach($table as $option) {\n $tmptpl->newBlock(\"option\");\n $tmptpl->assign(\"value_option\",$option->$value_option);\n $tmptpl->assign(\"texte_option\",$option->$texte_option);\n // print ($values_selected[$option->$value_option]);\n $tmptpl->setSelected (!empty($values_selected[$option->$value_option]));\n }\n return $tmptpl->getOutputContent();\n}", "public function getInput()\n {\n $result = array();\n $table = new Application_Model_DbOptions();\n $options = array();\n $options['optRegion'] = $table->getRegion();\n\n // elements\n $result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n 'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\n return $result;\n }", "function truethemes_site_option(){\n\t\t//this values contains the theme layout array.\n\t\t//use print_r to see the multi-dimension array key and values.\n\t\t$option_template_items = get_option('of_template');\n\n\t\t$op_count = count($option_template_items);\n\t\t\n\t\t//set empty site option name array container.\n\t\t$site_option_name = array();\n\t\t\n\t\tfor($index = 0; $index < $op_count; $index ++){\n\t\t\t\n\t\t\t//we only add in theme option name which is the id array key\n\t\t\tif(!empty($option_template_items[$index]['id'])){\n\t\t\t$site_option_name[] = $option_template_items[$index]['id'];\n\t\t\t}\n\t\t\t \t\t\t\n\t\t}\n\n\t\t//print_r($site_option_name); //to see array of site option name.\n\t\t\n\t\t//assign for use in set_all();\n $this->site_option_name = $site_option_name;\n \n\t\t}", "function prepareParamsReverse($data){\r\n\t$param_info = $this->getParamInfo();\r\n\t$param_ids = array();\r\n\tforeach($param_info as $p_i){\r\n\t\t$param_ids[$p_i['id']] = $p_i['param'];\r\n\t}\r\n\t$new_params = array();\r\n\tforeach($data as $k=>$v){\r\n\t\tif(isset($param_ids[$k])){\r\n\t\t#\t$new_params[$param_ids[$k]] = $v;//this is the text value\r\n\t\t\t$new_params[$param_ids[$k]][0] = $v[0];//this is the text value\r\n\t\t\t$new_params[$param_ids[$k]][1] = $v[1];//this is the option value\r\n\t\t}\r\n\t}\r\n\treturn $new_params;\r\n}", "public function build_initial_data()\n\t{\n $initial_data = '<?php\n\n';\n $data_string = '';\n\n foreach($this->selected_attribute as $key => $value)\n {\n if($this->input->post(\"input_type_$key\")=='date')\n {\n $default_value = '0000-00-00';\n }\n else\n {\n $default_value = '';\n }\n\n $data_string .= \"'$value'=>'$default_value',\";\n }\n\n //remove the first and last single quote and the last comma in the array\n\n if(!empty($data_string))\n {\n $data_string = rtrim($data_string,',');\n }\n\n $initial_data .= '$'.$this->object_name.'_records = array('.$data_string.');'. \"\\n\";\n\n $initial_data .= '$'.$this->object_name.'_records = (object)$'.$this->object_name.'_records;';\n\n return $initial_data;\n\n\t}", "public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n\t\t$options['optRegion'] = $table->getRegion();\n\n // elements\n\t\t$result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n\t\t\t'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\t\t\n\t\t$options['optMatStage'] = $table->getMaturityStage();\n\t\t$result['src_matstage_code'] = array(\n 'type' => 'select',\n 'name' => 'src_matstage_code',\n 'value' => '',\n 'options' => $options['optMatStage'],\n 'ext' => '',\n\t\t\t'style' => 'width:200px;'\n );\n\n return $result;\n }", "function payroll_combo_cell($name, $selected_id, $array, $submit_on_change = false) {\n echo \"<td>\";\n //echo payroll_combobox($name, $selected_id, $array);\n echo array_selector($name, $selected_id, $array, array(\n 'select_submit' => $submit_on_change\n ));\n echo \"</td>\\n\";\n}", "public function autocompleteSelect($filter = '') {\n $events = $this->findAll(NULL, '*', 'event_name ASC');\n $result = array();\n foreach($events as $key=>$event){\n $result[$key]['id'] = $event->event_slug;\n $result[$key]['name'] = $event->event_name.' - '.strtoupper($event->event_code);\n $result[$key]['url'] = '';\n }\n \n return $result;\n }", "function buildVehiclesSelect($vehicles)\n{\n $prodList = '<select name=\"invId\" id=\"invId\">';\n $prodList .= \"<option>Choose a Vehicle</option>\";\n foreach ($vehicles as $vehicle) {\n $prodList .= \"<option value='$vehicle[invId]'>$vehicle[invMake] $vehicle[invModel]</option>\";\n }\n $prodList .= '</select>';\n return $prodList;\n}", "public function build()\n\t{\n\t\tparent::build();\n\n\t\t$options = $this->suppliedOptions;\n\n\t\t$dataOptions = $options['options'];\n\n\t\t// Check if function\n\t\tif(\\is_callable($dataOptions)){\n\t\t\t$dataOptions = \\call_user_func($dataOptions);\n\t\t}\n\n\t\t$options['options'] = array();\n\n\t\t//iterate over the options to create the options assoc array\n\t\tforeach ($dataOptions as $val => $text)\n\t\t{\n\t\t\t$options['options'][] = array(\n\t\t\t\t'id' => is_numeric($val) && (!array_key_exists('enum_numeric_keys', $options) || $options['enum_numeric_keys'] == false) ? $text : $val,\n\t\t\t\t'text' => $text,\n\t\t\t);\n\t\t}\n\n\t\t$this->suppliedOptions = $options;\n\t}", "function optionsMakerWithSelected($optArray,$optName){\n\t\t$optionsString = '';\n\t\n\t\tforeach($optArray as $arr){\n\t\t\t$selectedText = '';\n\t\t\tif ( $_GET[$optName]== $arr->value){\n\t\t\t\t$selectedText = 'selected';\n\t\t\t}\n\t\t\t $optionsString = $optionsString . '<option ' .$selectedText. ' value=\"' .$arr->value. '\" class=\"' .$arr->className. '\">' .$arr->label. '</option>';\n\t\t}\n\t\treturn $optionsString;\n\t}", "private function _fillAdditionalTemplateData()\n {\n $departments = ['' => trans('labels.please_select')];\n foreach (Department::with('translations')->get() as $department) {\n $departments[$department->id] = $department->name;\n }\n $this->data('departments', $departments);\n }", "public function getArrayParaSelect()\n {\n return $this->model()::pluck('nome', 'id')->all();\n }", "public static function getOptions(){\n\t\t$results = DB::select('id', DB::expr('CONCAT(first, \" \", last) as `name`'))->from('employees')->order_by('name')->execute()->as_array();\n\t\t//return $options->as_array();\n\n\t\t$options = array();\n\t\tforeach($results as $result){\n\t\t\t$options[$result['id']] = $result['name']; \n\t\t}\n\t\t\n\t\treturn $options;\n\n\t}", "function addAllOptionToDropDownList (array $fieldData)\n {\n array_unshift ($fieldData['options'], ['id' => '', $fieldData['showNodes'][0] => trans ('HCTranslations::core.all')]);\n\n return $fieldData;\n }", "private function prepareContentSelectBox() {\r\n\t\t$content = array();\r\n\t\tforeach ($this->typesOfContent as $type) {\r\n\t\t\t$data = $this->db->table($type[\"table\"])->fetchPairs(\"id\", \"title\");\r\n\t\t\tforeach ($data as $key => $value) {\r\n\t\t\t\tif ($value == \"ROOT\") {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$content[\"$type[table]:$key\"] = \"$type[title] - $value\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $content;\r\n\t}", "protected function renderArray() {}", "private function getSelectOptions() {\n $result = \"\";\n if($this->pleaseSelectEnabled) {\n $result .= '<option value=\"null\"> -- Please Select --</option>';\n }\n foreach($this->itemList as $key => $val) {\n $selectedText = \"\";\n if(in_array($key, $this->selectedItems)) {\n $selectedText = 'selected=\"selected\"';\n }\n $result .= '<option value=\"'.$key.'\" '.$selectedText.'>'.$val.'</option>'.\"\\n \\t\";\n }\n return $result;\n }", "public function llenarCombo()\n {\n\n \n \t$area_destino = $_POST[\"dir\"];\n\n \t$options=\"\";\n \t\n \t$deptos = $this ->Modelo_direccion->obtenerCorreoDepto($area_destino);\n\n \tforeach ($deptos as $row){\n \t\t$options= '\n \t\t<option value='.$row->email.'>'.$row->email.'</option>\n \t\t'; \n \t\techo $options; \n \t}\n \t\n\n }", "public function toOptionArray() {\n// $arr = array(1=>'Спиди калкулатор',\n// 2=>'Фиксирана цена',\n// 3=>'Спиди калкулатор + надбавка за обработка');\n// 4=>'Цена от файл');\n \n $arr = array(1=>Mage::helper('core')->__('speedy calculator'),\n 2=>Mage::helper('core')->__('fixed price'),\n 3=>Mage::helper('core')->__('speedy_calc_handling'),\n 4=>Mage::helper('core')->__('table_rate'));\n \n $options = array();\n\n foreach ($arr as $key=>$value) {\n $options[] = array('value' => $key, 'label' => $value);\n }\n\n return $options;\n }", "public function dropdownOption(): array\n {\n return [\n 'icon' => 'image',\n 'text' => $this->model->filename(),\n ] + parent::dropdownOption();\n }", "function dropDown($cols){\n $form = \"<option value=''> --Select--</option>\" . PHP_EOL;\n foreach($cols as $col)\n {\n $form .= \"<option value='\" . $col . \"'>\" . $col . \"</option>\";\n }// End of Foreach\n return $form;\n}", "function options_form() {\n return array(\n );\n }", "public function wizardArray() {}", "public static function toSelectArray(): array\n {\n $array = self::toArray();\n $selectArray = [];\n\n foreach ($array as $key => $value) {\n $selectArray[$value] = static::getDescription($value);\n }\n\n return $selectArray;\n }", "function getClientsDropdown(){\n\t\t $data = array();\n\t\t $this->db->from('company');\n\t\t $this->db->where('client',1);\n\t\t $this->db->order_by('comp','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->comp]=$row->comp;\n\t\t }\n\t\t return $data;\n\t }", "function getServiceTypesTree_optionItems($array, $current_servicetype_id)\n {\n if (count($array) == 0)\n return '';\n foreach ($array as $value) {\n\n $level_lines = '';\n for ($i = 0; $i < $value['level']; $i++)\n $level_lines .= ' - ';\n if ($current_servicetype_id == $value['id']) {\n $selected = \" selected \";\n } else {\n $selected = \"\";\n }\n $rs .= '<option value=\"' . $value['id'] . '\" ' . $selected . '>' . str_repeat(' . ', $value['level']) . $value['name'] . '</option>';\n $rs .= $this->getServiceTypesTree_optionItems($value['child'], $current_servicetype_id);\n }\n return $rs;\n }", "public function prepareData() {\r\n $sections = GearSection::getAll($this->id_shop);\r\n $this->smarty->assign('sections', $sections);\r\n $data = array();\r\n foreach($sections as $section) {\r\n $opts = GearOption::getBySection($section->id, $this->id_shop);\r\n $std = new stdClass();\r\n $std->id = $section->id;\r\n $std->name = $section->name;\r\n $std->label = $section->label;\r\n $std->options = $opts;\r\n array_push($data, $std);\r\n }\r\n \r\n if ($this->imported) { // generate css after import\r\n require_once 'classes/FrontStyle.php';\r\n FrontStyle::generateGearCss($data);\r\n }\r\n \r\n return $data;\r\n }", "public function dropdown_tree() {\n $args = func_get_args();\n list($key, $value, $parent) = $args;\n\n $result = $this->db->select(array($key, $value, $parent))->get($this->_table())->result();\n\n $options = array();\n foreach ($result as $row) {\n $options[] = array(\n 'id'=>$row->{$key},\n 'name'=>$row->{$value},\n 'parent'=>$row->{$parent},\n );\n }\n return $options;\n }", "public function populateSuburbDropdown() {\n\n $qry = $this->db->prepare('SELECT DISTINCT SUBURB FROM n8598177.items;');\n $qry->execute();\n\n echo('\n <select name=\"search-suburb\" class=\"suburb-select-box\">\n <option disabled selected value=\"\">Suburb...</option>\n ');\n foreach ($qry as $hotspot) {\n echo '<option value=\"' . $hotspot['SUBURB'] . '\">' . $hotspot['SUBURB'] . '</option>';\n }\n echo '</select>';\n }", "function drawDropDownCustom($options)\n\t{\n\t\t$controlName=$options['controlName'];\n\t\t$orgValue=$options['orgValue'];\n\t\t$items=$options['items']; \n\t\t$valueColumnName=$options['valueColumnName'];\n\t\t$titleColumnName=$options['titleColumnName'];\n\t\t$levelColumnName=$options['levelColumnName'];\n\t\t$hasChildColumnName=$options['hasChildColumnName'];\n\t\t$groupNameColumnName=$options['groupNameColumnName'];\n\t\t$groupIdColumnName=$options['groupIdColumnName'];\n\t\t$defaultValue=$options['defaultValue'];\n\t\t$defaultTitle=$options['defaultTitle'];\n\t\t$moreAttributes=$options['attributes'];\n\t\t$useKeyAsKeyAndValueAsValue=$options['useKeyAsKeyAndValueAsValue'];\n\t\t\n\t\tif (is_string($items))\n\t\t\t$items=cmfcMySql::getRowsCustom($items);\n\n\t\t\t\n\t\tif ($options['selectType']=='multiSelect') {\n\t\t\t$moreAttributes['multiple']='multiple';\n\t\t\t$controlName.='[]';\n\t\t}\n\t\t\n\t\t/*\n\t\techo '<pre style=\"direction:ltr\">';\n\t\tprint_r($items);\n\t\techo \"</pre>\";\n\t\t*/\n\t\t$moreAttributesStr=cmfcHtml::attributesToHtml($moreAttributes);\n\t\t\n\t\t$lastGroupName='';\n\t\t$firstRow=true;\n\n\t\t$html=sprintf('<select name=\"%s\" %s >'.\"\\n\", $controlName, $moreAttributesStr);\n\t\tif (!is_null($defaultValue)) {\n\t\t\tif ($options['disabledDefaultValue']==true) {\n\t\t\t\t$disabledHtml='disabled=\"disabled\"';\n\t\t\t} else {\n\t\t\t\t$disabledHtml='';\n\t\t\t}\n\t\t\t$html.=sprintf('<option value=\"%s\" %s>%s</option>'.\"\\n\",$defaultValue,$disabledHtml, $defaultTitle);\n\t\t}\n\t\t//$i = 0; //count the number of selected orgValues\n\t\t\n\t\tif (!is_array($orgValue))\n\t\t\t$orgValues[] = $orgValue;\n\t\telse\n\t\t\t$orgValues = $orgValue;\n\t\t\t\n\t\tif(is_array($items)) // added by babak\n\t\tforeach ($items as $key=>$item) {\n\t\t\tif (is_array($item)) {\n\t\t\t\t$title=$item[$titleColumnName];\n\t\t\t\t$value=$item[$valueColumnName];\n\t\t\t} elseif (is_integer($key) and !$useKeyAsKeyAndValueAsValue) {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$item;\n\t\t\t} else {\n\t\t\t\t$title=$item;\n\t\t\t\t$value=$key;\n\t\t\t}\n\n\t\t\tif (!empty($groupNameColumnName) && ($options['interface']['group'] or !isset($options['interface']['group']))) {\n\t\t\t\t$groupName=$item[$groupNameColumnName];\n\t\t\t\t$groupId=$item[$groupIdColumnName];\n\t\t\t\t\n\t\t\t\tif ($lastGroupName==$groupName) {$groupChanged=false;} else {$groupChanged=true;}\n\t\t\t\t//echo \"[$lastGroupName:$groupName]\";\n\t\t\t\tif ($groupChanged==true) {\n\t\t\t\t\tif (!$firstRow) { $html.=\"</optgroup>\\n\"; }\n\t\t\t\t\t$html.=sprintf('<optgroup label=\"%s\" title=\"%s\">'.\"\\n\",$groupName, $groupId);\n\t\t\t\t\t$lastGroupName=$groupName;\n\t\t\t\t}\n\t\t\t\t$groupChanged=false;\n\t\t\t}\n\t\t\t$selected='';\n\t\t\tif (in_array($value,$orgValues)) {\n\t\t\t\t$selected='selected=\"selected\"';\n\t\t\t\t//$i++;\n\t\t\t} else {\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t\n\t\t\t$itemAttributes=array();\n\t\t\t#--(Begin)-->indent items to show them as a tree (hierarchical items)\n\t\t\tif (!empty($levelColumnName)) {\n\t\t\t\tif (empty($firstLevelNumber))\n\t\t\t\t\t$firstLevelNumber=$item[$levelColumnName];\n\t\t\t\t\t\n\t\t\t\t$depth=$item[$levelColumnName]-$firstLevelNumber;\n\t\t\t\tif (!isset($options['interface']['itemIndent'])) $options['interface']['itemIndent']=20;\n\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\tif (!$options['interface']['isIe'])\t {\n\t\t\t\t\t$itemIndent=intval($options['interface']['itemIndent']);\n\t\t\t\t\tif ($options['interface']['direction']=='rightToLeft')\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-right:'.($itemIndent*$depth).'px;';\n\t\t\t\t\telse\n\t\t\t\t\t\t$itemAttributes['style'].=';padding-left:'.($itemIndent*$depth).'px;';\n\t\t\t\t} else {\n\t\t\t\t\t$itemIndent=round($itemIndent/2)*$depth;\n\t\t\t\t\t$title=str_repeat('&nbsp;',$itemIndent).$title;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset($options['isParentsSelectable'])) {\n\t\t\t\t\t$item['isParentsSelectable'] = $options['isParentsSelectable'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($item[$hasChildColumnName]) {\n\t\t\t\t\t$itemAttributes['style'].=';font-weight:bold';\n\t\t\t\t\tif ($options['isParentsSelectable']!=true)\n\t\t\t\t\t\t$itemAttributes['disabled']=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#--(End)-->indent items to show them as a tree (hierarchical items)\n\t\t\t$itemAttributes=cmfcHtml::attributesToHtml($itemAttributes);\n\t\t\t\n\t\t\t$html.=sprintf('<option value=\"%s\" %s %s>%s</option>'.\"\\n\",\n\t\t\t\t\t\t\t$value, $selected, $itemAttributes,$title);\n\t\t\t$firstRow=false;\n\t\t}\n\t\tif (isset($groupName)) $html.=\"</optgroup>\\n\";\n\t\t$html.=\"</select>\\n\";\n\t\treturn $html;\n\t}", "function dropdown_ijin() {\n $result = $this->db->get('tbl_ijin');\n\n // bikin array\n // please select berikut ini merupakan tambahan saja agar saat pertama\n // diload akan ditampilkan text please select.\n $dd[''] = 'Please Select';\n if ($result->num_rows() > 0) {\n foreach ($result->result() as $row) {\n // tentukan value (sebelah kiri) dan labelnya (sebelah kanan)\n $dd[$row->id_ijin] = $row->nomor . \"/KODE KANTOR/\" . $row->id_seksi . \"/\" . $row->tahun;\n }\n }\n return $dd;\n }", "function getTransDropDown(){\n\t\t $data = array();\n\t $this->db->select('*');\n\t\t\t$this->db->from('segment_name');\n\t\t\t$this->db->where('segment_type_id',6);\n\t\t\t $Q = $this->db->get();\n\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t\t {\n\t $data[$row['id']] = $row['segment_name'];\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t }" ]
[ "0.67639107", "0.65232074", "0.6519679", "0.6334738", "0.6274717", "0.6206159", "0.618178", "0.6088956", "0.60825145", "0.6056119", "0.6038832", "0.60318935", "0.60283273", "0.599329", "0.598511", "0.5963232", "0.5948729", "0.5947924", "0.591775", "0.5911445", "0.5903783", "0.58998823", "0.5895064", "0.58914036", "0.5888592", "0.587078", "0.58680415", "0.5849256", "0.5841977", "0.5816483", "0.580109", "0.5793287", "0.5791446", "0.57872623", "0.57862103", "0.57740384", "0.5770587", "0.5755446", "0.57463115", "0.5746167", "0.5734177", "0.5733338", "0.57089037", "0.5708607", "0.56934106", "0.5688002", "0.5684112", "0.56777686", "0.5674307", "0.56730783", "0.5663636", "0.56570995", "0.5647641", "0.56461805", "0.56434464", "0.5642885", "0.56351584", "0.5625939", "0.5623904", "0.5620238", "0.56198627", "0.56178194", "0.56152606", "0.5606221", "0.55942714", "0.55875164", "0.5587036", "0.5586373", "0.5585594", "0.55787414", "0.55783623", "0.5576944", "0.5570941", "0.5570274", "0.55669034", "0.55574054", "0.5548453", "0.5546216", "0.55448425", "0.5544771", "0.5541818", "0.55403024", "0.55396426", "0.55384964", "0.55382353", "0.5528945", "0.55286473", "0.5523452", "0.5519838", "0.55156976", "0.55107176", "0.5505265", "0.54867595", "0.54866916", "0.5486432", "0.54853016", "0.54848796", "0.54797125", "0.5473502", "0.5462927", "0.54618305" ]
0.0
-1
Run the database seeds.
public function run() { $follower=new Follower(); $follower->idSeguidor = 2; $follower->idSeguido = 1; $follower->save(); $follower=new Follower(); $follower->idSeguidor = 3; $follower->idSeguido = 1; $follower->save(); $follower=new Follower(); $follower->idSeguidor = 1; $follower->idSeguido = 2; $follower->save(); $follower=new Follower(); $follower->idSeguidor = 3; $follower->idSeguido = 2; $follower->save(); $follower=new Follower(); $follower->idSeguidor = 1; $follower->idSeguido = 3; $follower->save(); }
{ "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
process_vb_data, get the VB data to save it in the ra_group_product table
public function process_vb_data ($feed) { print $feed; exit; //Read the data sent from VB $xml_vb = simplexml_load_string($feed); $task_id = $xml_vb->attributes()->task_id; //Create return xml string $xml = array(); $xml[] = '<?xml version="1.0" encoding="UTF-8"?>'; $xml[] = '<ra_group_products task_id="' . $task_id . '">'; $c = count($xml_vb->ra_group_product); foreach($xml_vb->ra_group_product as $ra_group_product) { $c--; try { //Get the master sku to search the corresponding sku in atomv2 database $master_sku = $ra_group_product->master_sku; $master_sku = strtoupper($master_sku); $sku = $this->sku_mapping_service->get_local_sku($master_sku); $fail_reason = ""; if ($master_sku == "" || $master_sku == null) $fail_reason .= "No master SKU mapped, "; if ($sku == "" || $sku == null) $fail_reason .= "SKU not specified, "; if ($fail_reason == "") { $is_delete = $ra_group_product->is_delete; //Get the external (VB) ra_group_id to search the corresponding row in atomv2 database if($ra_group_product_ext_atomv2 = $this->get_dao()->get(array("ra_group_id"=>$ra_group_product->ra_group_id, "sku"=>$sku))) { $id = $ra_group_product->ra_group_id; } //if id exists, update if ($id != "" && $id != null) { if ($is_delete) { $d_where["ra_group_id"] = $id; $d_where["sku"] = $sku; $this->get_dao()->q_delete($d_where); $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>5</status>'; //updated $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } else { //Update the AtomV2 ra_group_product extend data $where = array("ra_group_id"=>$id, "sku"=>$sku); $new_ra_group_products_obj = array(); $new_ra_group_products_obj["name"] = $ra_group_product->name; $this->get_dao()->q_update($where, $new_ra_group_products_obj); $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>5</status>'; //updated $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } } //if not exists, insert else { $new_ra_group_products_obj = array(); $new_ra_group_products_obj = $this->get_dao()->get(); $new_ra_group_products_obj->set_ra_group_id($ra_group_product->ra_group_id); $new_ra_group_products_obj->set_sku($sku); $new_ra_group_products_obj->set_name($ra_group_product->name); $this->get_dao()->insert($new_ra_group_products_obj); $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>5</status>'; //updated $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } } elseif ($sku == "" || $sku == null) { //if the master_sku is not found in atomv2, we have to store that sku in an xml string to send it to VB $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>2</status>'; //sku not found $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } else { $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>3</status>'; //not updated $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } } catch(Exception $e) { $xml[] = '<ra_group_product>'; $xml[] = '<id>' . $ra_group_product->ra_group_id . '</id>'; $xml[] = '<sku>' . $ra_group_product->sku . '</sku>'; $xml[] = '<master_sku>' . $ra_group_product->master_sku . '</master_sku>'; $xml[] = '<status>4</status>'; //error $xml[] = '<is_error>' . $ra_group_product->is_error . '</is_error>'; $xml[] = '</ra_group_product>'; } } $xml[] = '</ra_group_products>'; $return_feed = implode("\n", $xml); return $return_feed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processVbData ($feed)\n\t{\n\t\t//print $feed; exit;\n\t\t//Read the data sent from VB\n\t\t$xml_vb = simplexml_load_string($feed);\n\n\t\t$task_id = $xml_vb->attributes()->task_id;\n\n\t\t//Create return xml string\n\t\t$xml = array();\n\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n\t\t$xml[] = '<ra_prod_cats task_id=\"' . $task_id . '\">';\n\n\t\tforeach($xml_vb->ra_prod_cat as $ra_prod_cat)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif($ra_prod_cat_obj =$this->getDao('RaProdCat')->get(['ss_cat_id'=>$ra_prod_cat->ss_cat_id]))\n\t\t\t\t{\n\t\t\t\t\t//Update the AtomV2 ra_prod_cat data\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId1($ra_prod_cat->rcm_ss_cat_id_1);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId2($ra_prod_cat->rcm_ss_cat_id_2);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId3($ra_prod_cat->rcm_ss_cat_id_3);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId4($ra_prod_cat->rcm_ss_cat_id_4);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId5($ra_prod_cat->rcm_ss_cat_id_5);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId6($ra_prod_cat->rcm_ss_cat_id_6);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId7($ra_prod_cat->rcm_ss_cat_id_7);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId8($ra_prod_cat->rcm_ss_cat_id_8);\n\t\t\t\t\t$ra_prod_cat_obj->setWarrantyCat($ra_prod_cat->warranty_cat);\n\t\t\t\t\t$ra_prod_cat_obj->setStatus($ra_prod_cat->status);\n\n\t\t\t\t\t$this->getDao('RaProdCat')->update($ra_prod_cat_obj);\n\n\t\t\t\t\t$reason = 'update';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//insert ra_prod_cat\n\t\t\t\t\t$ra_prod_cat_obj = new \\RaProdCatVo();//$this->getDao()->get();\n\t\t\t\t\t$ra_prod_cat_obj->setSsCatId($ra_prod_cat->ss_cat_id);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId1($ra_prod_cat->rcm_ss_cat_id_1);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId2($ra_prod_cat->rcm_ss_cat_id_2);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId3($ra_prod_cat->rcm_ss_cat_id_3);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId4($ra_prod_cat->rcm_ss_cat_id_4);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId5($ra_prod_cat->rcm_ss_cat_id_5);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId6($ra_prod_cat->rcm_ss_cat_id_6);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId7($ra_prod_cat->rcm_ss_cat_id_7);\n\t\t\t\t\t$ra_prod_cat_obj->setRcmSsCatId8($ra_prod_cat->rcm_ss_cat_id_8);\n\t\t\t\t\t$ra_prod_cat_obj->setWarrantyCat($ra_prod_cat->warranty_cat);\n\t\t\t\t\t$ra_prod_cat_obj->setStatus($ra_prod_cat->status);\n\n\t\t\t\t\t$this->getDao('RaProdCat')->insert($ra_prod_cat_obj);\n\n\t\t\t\t\t$reason = 'insert';\n\t\t\t\t}\n\n\n\t\t\t\t$xml[] = '<ra_prod_cat>';\n\t\t\t\t$xml[] = '<ss_cat_id>' . $ra_prod_cat->ss_cat_id . '</ss_cat_id>';\n\t\t\t\t$xml[] = '<status>5</status>'; //updated\n\t\t\t\t$xml[] = '<is_error>' . $ra_prod_cat->is_error . '</is_error>';\n\t\t\t\t$xml[] = '<reason>'.$reason.'</reason>';\n\t\t\t\t$xml[] = '</ra_prod_cat>';\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$xml[] = '<ra_prod_cat>';\n\t\t\t\t$xml[] = '<ss_cat_id>' . $ra_prod_cat->ss_cat_id . '</ss_cat_id>';\n\t\t\t\t$xml[] = '<status>4</status>'; //error\n\t\t\t\t$xml[] = '<is_error>' . $ra_prod_cat->is_error . '</is_error>';\n\t\t\t\t$xml[] = '<reason>' . $e->getMessage() . '</reason>';\n\t\t\t\t$xml[] = '</ra_prod_cat>';\n\t\t\t}\n\t\t }\n\n\t\t$xml[] = '</ra_prod_cats>';\n\n\n\t\t$return_feed = implode(\"\", $xml);\n\n\t\treturn $return_feed;\n\t}", "function insertPB()\n {\n\n $productos = $this->Import_model->get_productos();\n\n $valores = array();\n\n foreach ($productos as $key => $producto) {\n\n $detalle_pivote = $this->Import_model->get_detalle_pivote($producto->codigo_producto);\n\n $this->crearPresentacion($producto->id_entidad, $detalle_pivote);\n //$this->Import_model->insertProductoBodega($producto->id_entidad);\n //$this->Import_model->insertCategoriaProducto($producto->id_entidad, $producto->id_familia, $producto->id_grupo );\n\n }\n }", "public function getProcessRecord() {\n\t\t$db = JFactory::getDBO();\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t$csv_fields = JRequest::getVar('csv_fields');\n\t\t$template = JRequest::getVar('template');\n\t\t\n\t\tif (!$template->overwrite_existing_data) {\n\t\t $csvilog->AddMessage('debug', str_ireplace('{product_sku}', $this->product_sku, JText::_('DATA_EXISTS_PRODUCT_SKU')));\n\t\t $csvilog->AddStats('skipped', str_ireplace('{product_sku}', $this->product_sku, JText::_('DATA_EXISTS_PRODUCT_SKU')), true);\n\t\t}\n\t\telse {\n\t\t\tif (empty($this->product_sku) && empty($this->product_id)) {\n\t\t\t\t$csvilog->AddStats('incorrect', JText::_('DEBUG_NO_SKU'), true);\n\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_NO_SKU_OR_ID'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_PROCESS_SKU').$this->record_identity);\n\t\t\t}\n\t\t\t\n\t\t\t$csvilog->AddMessage('debug', JText::_('DEBUG_NORMAL_UPLOAD_EXPERT'));\n\t\t \n\t\t\t/* Load the tables that will contain the data */\n\t\t\t$this->getTables();\n\t\t\t\n\t\t\tif (!isset($this->product_id) && $template->ignore_non_exist) {\n\t\t\t\t/* Do nothing for new products when user chooses to ignore new products */\n\t\t\t\t$csvilog->AddStats('skipped', str_ireplace('{product_sku}', $this->record_identity, JText::_('DATA_EXISTS_IGNORE_NEW')), true);\n\t\t\t}\n\t\t\t/* User wants to add or update the product */\n\t\t\telse {\n\t\t\t\t/* Process product info */\n\t\t\t\tif (!$this->ProductQuery()) {\n\t\t\t\t\t$csvilog->AddStats('incorrect', str_ireplace('{product_sku}', $this->product_sku, JText::_('NO_UPDATE_PRODUCT_SKU')), true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Now that all is done, we need to clean the table objects */\n\t\t\t$this->getCleanTables();\n\t\t}\n\t}", "public function getUpdateProductData();", "public function processVbData($feed)\n {\n //Read the data sent from VB\n $xml_vb = simplexml_load_string($feed);\n unset($feed);\n $task_id = $xml_vb->attributes()->task_id;\n\n //Create return xml string\n $xml = array();\n $xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml[] = '<categories task_id=\"'.$task_id.'\">';\n $error_message = '';\n foreach ($xml_vb->category as $category) {\n try {\n $cat_ext_obj = $this->getDao('CategoryExtend')->get(['cat_id' => (string) $category->cat_id, 'lang_id' => (string) $category->lang_id]);\n\n $reason = 'insert_or_update';\n if ($cat_ext_obj) {\n //we need to check the stop_sync_name value to stop the update when needed (only for update)\n $stop_sync_name = $cat_ext_obj->getStopSyncName();\n if ($stop_sync_name != 1)\n {\n $this->getService('Category')->updateCategoryExtend($cat_ext_obj, $category);\n $this->getDao('CategoryExtend')->update($cat_ext_obj);\n }\n else\n {\n $reason = 'stop_sync_name';\n }\n } else {\n $cat_ext_obj = $this->getService('Category')->createNewCategoryExtend((string) $category->cat_id, $category);\n $this->getDao('CategoryExtend')->insert($cat_ext_obj);\n }\n\n\n $xml[] = '<category>';\n $xml[] = '<id>'.$category->cat_id.'</id>';\n $xml[] = '<lang_id>'.$category->lang_id.'</lang_id>';\n $xml[] = '<status>5</status>'; //insert\n $xml[] = '<is_error>'.$category->is_error.'</is_error>';\n $xml[] = '<reason>'.$reason.'</reason>';\n $xml[] = '</category>';\n\n } catch (Exception $e) {\n $xml[] = '<category>';\n $xml[] = '<id>'.$category->cat_id.'</id>';\n $xml[] = '<lang_id>'.$category->lang_id.'</lang_id>';\n $xml[] = '<status>4</status>'; //error\n $xml[] = '<is_error>'.$category->is_error.'</is_error>';\n $xml[] = '<reason>'.$e->getMessage().'</reason>';\n $xml[] = '</category>';\n $error_message .= $category->cat_id .'-'. $category->lang_id .'-'. $category->is_error .'-'. $e->getMessage().\"\\r\\n\";\n }\n }\n\n $xml[] = '</categories>';\n\n $return_feed = implode(\"\", $xml);\n\n if ($error_message) {\n mail('[email protected]', 'CategoryExtend Transfer Failed', \"Error Message :\".$error_message);\n }\n unset($xml);\n unset($xml_vb);\n return $return_feed;\n }", "public function doProcessData() {}", "public static function saveGroup() { \n $result = array();\n $saved = lC_Product_variants_Admin::save($_GET['pvid'], $_GET);\n if ($saved) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function upload()\n {\n JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n $params = JComponentHelper::getParams('com_vmimport');\n // Get some data from the request\n $file = JRequest::getVar('Filedata', '', 'files');\n //var_dump($file);\n \n // The request is valid\n $err = null;\n require_once JPATH_ADMINISTRATOR. '/components/com_media/helpers/media.php';\n if (!MediaHelper::canUpload($file, $err)) {\n // The file can't be upload\n JError::raiseNotice(100, JText::_($err));\n return false;\n }\n\n //Upload\n \n $file['filepath'] = JPath::clean(implode(DIRECTORY_SEPARATOR, array(JPATH_ROOT.'/'.$params->get('upload_path', 'tmp'), $file['name']) ));\n if (!JFile::upload($file['tmp_name'], $file['filepath'])) {\n // Error in upload\n JError::raiseWarning(100, JText::_('COM_VMIMPORT_ERROR_UNABLE_TO_UPLOAD_FILE'));\n return false;\n } \n\n //Process data \n //echo 'start process <br/>';\n $productSeparator = 'EndOfProduct'; \n $priceTableKey = 'Price Table';\n require_once JPATH_COMPONENT.'/helpers/vmimport.php';\n //$keys = array('Product ID','Product Name','VM Categories','Product Category','Image File');\n if (($handle = fopen($file['filepath'], \"r\")) !== FALSE) {\n \n $productList = array();\n $product = new stdClass();\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) { \n if($data[0]==$productSeparator) {\n $product->product_desc = VmimportHelper::formatDescription($descRows,$priceTable); \n $product->product_name = str_replace( '\"' , \"\", $product->product_name) ;\n $productList[] = $product;\n \n //Init new Product\n $product = new stdClass(); \n $descRows = array();\n $endDescription = false;\n $priceTable = array();\n $startPriceTable = false;\n }else {\n switch ($data[0]) {\n case 'Product ID':\n $product->virtuemart_product_id = trim($data[1]);\n break;\n case 'Product Name':\n $product->product_name = trim($data[1]);\n $product->product_alias = trim($data[1]); \n break;\n case 'Rate':\n if(!empty($data[1])) { \n $product->product_name .= \"|From \" . trim($data[1]);\n\t\t\t\t\t\t\t\t$product->raten = trim($data[1]);\n }\n break;\n case 'VM Categories':\n $product->categories = trim($data[1]);\n break;\n case 'Image File':\n $endDescription = true;\n $product->imageFile = trim($data[1]);\n break; \n case 'Price Table':\n $startPriceTable = true;\n break; \n default:\n if(!$endDescription) { \n $descRows[] = array_slice($data, 0, 2) ; \n }else if($startPriceTable) {\n $priceTable[]= $data;\n }\n break;\n }\n \n }\n \n }\n fclose($handle);\n }\n //var_dump($productList);\n \n //Import to database\n //echo 'start importing <br/>';\n $model = $this->getModel('import');\n $model->importData($productList);\n \n $msg = \"Import successfully\" ;\n $this->setRedirect( 'index.php?option=com_vmimport' , $msg);\n // echo 'upload validated'; die();\n }", "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 }", "public function get_vb_data ($vars = array());", "function processData() ;", "public function setModuleData(){\n\t\t/* variable initialization */\n\t\t$this->_strSchemaName\t.= \"_\".$this->getCompanyCode();\n\t\t$intRespone\t\t\t\t= \"\";\n\t\t\n\t\t/* Setting the Pokicy filed */\n\t\tif((isset($this->_strDataSet['policy'])) && (!empty($this->_strDataSet['policy']))){\n\t\t\t/* Iterating the loop */\n\t\t\tforeach($this->_strDataSet['policy'] as $strPlicyKey => $strPolicyValue){\n\t\t\t\t/* Decoding the value */\n\t\t\t\t$this->_strDataSet['policy'][$strPlicyKey]\t= getDecyptionValue($strPolicyValue);\n\t\t\t}\n\t\t\t/* Imploding the value */\n\t\t\t$this->_strDataSet['policy']\t\t= implode(\",\",$this->_strDataSet['policy']);\n\t\t}else{\n\t\t\t/* Setting the value */\n\t\t\t$this->_strDataSet['policy']\t= \"\";\n\t\t}\n\t\t\n\t\t/* Set the operation filter array */\n\t\t$strEventFilterArr \t= array(\n\t\t\t\t\t\t\t\t\t\t'table' \t=> $this->_strSchemaName,\n\t\t\t\t\t\t\t\t\t\t'data' \t\t=> $this->_strDataSet,\n\t\t\t\t\t\t\t\t\t\t'where' \t=> array('id' => $this->_strDataSet['foreign']),\n\t\t\t\t\t\t\t\t\t);\n\t\t/* removed unwanted variables */\n\t\tunset($strEventFilterArr['data']['foreign']);\n\t\t\n\t\t/* Perfomaning the addition operation */\n\t\tif($this->_strDataSet['foreign'] == 0){\n\t\t\t/* add new records */\n\t\t\t$intResultStatus = $this->_objDataOperation->setDataInTable($strEventFilterArr);\n\t\t/* Perfomaning the update operation */\n\t\t}else{\n\t\t\t/* update the existing records */\n\t\t\t$intResultStatus = $this->_objDataOperation->setUpdateData($strEventFilterArr);\n\t\t}\n\t\t/* removed used variables */\n\t\tunset($strResultArr);\n\t\t\n\t\t/* return the operation status */\n\t\treturn $intResultStatus;\n\t}", "public function fetch_all_product_and_marketSelection_data() {\r\n \r\n $dataHelpers = array();\r\n if (!empty($this->settingVars->pageArray[$this->settingVars->pageName][\"DH\"]))\r\n $dataHelpers = explode(\"-\", $this->settingVars->pageArray[$this->settingVars->pageName][\"DH\"]); //COLLECT REQUIRED PRODUCT FILTERS DATA FROM PROJECT SETTING \r\n\r\n if (!empty($dataHelpers)) {\r\n\r\n $selectPart = $resultData = $helperTables = $helperLinks = $tagNames = $includeIdInLabels = $groupByPart = array();\r\n $filterDataProductInlineConfig = $dataProductInlineFields = [];\r\n \r\n foreach ($dataHelpers as $key => $account) {\r\n if($account != \"\")\r\n {\r\n //IN RARE CASES WE NEED TO ADD ADITIONAL FIELDS IN GROUP BY CLUAUSE AND ALSO AS LABEL WITH THE ORIGINAL ACCOUNT\r\n //E.G: FOR RUBICON LCL - SKU DATA HELPER IS SHOWN AS 'SKU #UPC'\r\n //IN ABOVE CASE WE SEND DH VALUE = F1#F2 [ASSUMING F1 AND F2 ARE SKU AND UPC'S INDEX IN DATAARRAY]\r\n $combineAccounts = explode(\"#\", $account);\r\n \r\n foreach ($combineAccounts as $accountKey => $singleAccount) {\r\n $tempId = key_exists('ID', $this->settingVars->dataArray[$singleAccount]) ? $this->settingVars->dataArray[$singleAccount]['ID'] : \"\";\r\n if ($tempId != \"\") {\r\n $selectPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $tempId . \" AS \" . $this->settingVars->dataArray[$singleAccount]['ID_ALIASE'];\r\n $groupByPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $this->settingVars->dataArray[$singleAccount]['ID_ALIASE'];\r\n\r\n /*[START] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n $filterDataProductInlineConfig[] = $tempId . \" AS \" . $this->settingVars->dataArray[$singleAccount]['ID_ALIASE_WITH_TABLE'];\r\n $dataProductInlineFields[] = $tempId;\r\n /*[END] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n }\r\n \r\n $tempName = $this->settingVars->dataArray[$singleAccount]['NAME'];\r\n $selectPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $tempName . \" AS \" . $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n $groupByPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n\r\n /*[START] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n $filterDataProductInlineConfig[] = $tempName . \" AS \" . $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n $dataProductInlineFields[] = $tempName;\r\n /*[END] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n }\r\n \r\n $helperTables[$this->settingVars->dataArray[$combineAccounts[0]]['TYPE']] = $this->settingVars->dataArray[$combineAccounts[0]]['tablename'];\r\n $helperLinks[$this->settingVars->dataArray[$combineAccounts[0]]['TYPE']] = $this->settingVars->dataArray[$combineAccounts[0]]['link'];\r\n \r\n //datahelper\\Product_And_Market_Filter_DataCollector::collect_Filter_Data($selectPart, $groupByPart, $tagName, $helperTableName, $helperLink, $this->jsonOutput, $includeIdInLabel, $account);\r\n }\r\n }\r\n\r\n if(isset($this->queryVars->projectConfiguration) && isset($this->queryVars->projectConfiguration['has_product_market_filter_disp_type']) && $this->queryVars->projectConfiguration['has_product_market_filter_disp_type']==1 && count($filterDataProductInlineConfig) >0){\r\n $this->settingVars->filterDataProductInlineConfig = $filterDataProductInlineConfig;\r\n $this->settingVars->dataProductInlineFields = $dataProductInlineFields;\r\n }\r\n \r\n if(is_array($selectPart) && !empty($selectPart)){\r\n foreach ($selectPart as $type => $sPart) {\r\n $resultData[$type] = datahelper\\Product_And_Market_Filter_DataCollector::collect_Filter_Query_Data($sPart, $groupByPart[$type], $helperTables[$type], $helperLinks[$type]);\r\n }\r\n $redisCache = new utils\\RedisCache($this->queryVars);\r\n $redisCache->requestHash = 'productAndMarketFilterData';\r\n $redisCache->setDataForStaticHash($selectPart);\r\n }\r\n\r\n foreach ($dataHelpers as $key => $account) {\r\n if($account != \"\")\r\n {\r\n $combineAccounts = explode(\"#\", $account);\r\n\r\n $tagNameAccountName = $this->settingVars->dataArray[$combineAccounts[0]]['NAME'];\r\n\r\n //IF 'NAME' FIELD CONTAINS SOME SYMBOLS THAT CAN'T PASS AS A VALID XML TAG , WE USE 'NAME_ALIASE' INSTEAD AS XML TAG\r\n //AND FOR THAT PARTICULAR REASON, WE ALWAYS SET 'NAME_ALIASE' SO THAT IT IS A VALID XML TAG\r\n $tagName = preg_match('/(,|\\)|\\()|\\./', $tagNameAccountName) == 1 ? $this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE'] : strtoupper($tagNameAccountName);\r\n\r\n if (isset($this->settingVars->dataArray[$combineAccounts[0]]['use_alias_as_tag']))\r\n {\r\n $tagName = ($this->settingVars->dataArray[$combineAccounts[0]]['use_alias_as_tag']) ? strtoupper($this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE']) : $tagName;\r\n \r\n if(isset($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']) && !empty($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']))\r\n $tagName .= \"_\". $this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE'];\r\n }\r\n\r\n $includeIdInLabel = false;\r\n if (isset($this->settingVars->dataArray[$combineAccounts[0]]['include_id_in_label']))\r\n $includeIdInLabel = ($this->settingVars->dataArray[$combineAccounts[0]]['include_id_in_label']) ? true : false;\r\n\r\n $tempId = key_exists('ID', $this->settingVars->dataArray[$combineAccounts[0]]) ? $this->settingVars->dataArray[$combineAccounts[0]]['ID'] : \"\";\r\n \r\n $nameAliase = $this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE'];\r\n $idAliase = isset($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']) ? $this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE'] : \"\";\r\n\r\n $type = $this->settingVars->dataArray[$combineAccounts[0]]['TYPE'];\r\n\r\n if( !isset($this->jsonOutput['filters']) || !array_key_exists($tagName, $this->jsonOutput['filters']) )\r\n datahelper\\Product_And_Market_Filter_DataCollector::getFilterData( $nameAliase, $idAliase, $tempId, $resultData[$type], $tagName , $this->jsonOutput, $includeIdInLabel, $account);\r\n }\r\n }\r\n\r\n // NOTE: THIS IS FOR FETCHING PRODUCT AND MARKET WHEN USER CLICKS TAB. \r\n // TO FETCH TAB DATA SERVER BASED. TO AVOID BROWSER HANG. \r\n // WE FACE ISSUE IN MJN AS MANY FILTERS ENABLED FOR ITS PROJECTS\r\n if ($this->settingVars->fetchProductAndMarketFilterOnTabClick) {\r\n $redisCache = new utils\\RedisCache($this->queryVars);\r\n $redisCache->requestHash = 'productAndMarketFilterTabData';\r\n $redisCache->setDataForStaticHash($this->jsonOutput['filters']);\r\n }\r\n }\r\n }", "function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \n\t $value = $bmtProducts[$pid];\n\t \n\t \t$file = 'people.log';\n\t\t$person = \"\".json_encode($data).\"\\n\";\n\n\t\tfile_put_contents($file, $person, FILE_APPEND | LOCK_EX);\n\t\t\n\t\t/** get member info by session ID **/\n\t\t$rows = getMemberInfoBySessionId($sessionId);\n\t\taddPoints($data, $rows, $value);\n\n\t\t\n\t}", "public static function getFormData() {\n $result = lC_Product_variants_Admin::getFormData($_GET['pvid']);\n if (!isset($result['rpcStatus'])) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "function fn_warehouses_get_product_data_post(&$product_data, $auth, $preview, $lang_code)\n{\n if (empty($product_data['product_id'])) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_data['product_id']);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n if (AREA == 'C') {\n /** @var \\Tygh\\Location\\Manager $manager */\n $manager = Tygh::$app['location'];\n $destination_id = $manager->getDestinationId();\n\n $product_data['amount'] = $product_stock->getAmountForDestination($destination_id);\n } else {\n $product_data['amount'] = $product_stock->getAmount();\n }\n}", "function handle(&$params){\r\n $this->app =& Dataface_Application::getInstance(); // reference to Dataface_Application object\r\n\t //$this->app =& Dataface_RecordGrid::getInstance(); \r\n // Custom query\r\n $result = mysqli_query($this->app->db(),\"select inventoryreq.*,workref.RefID,inventory_parts.invreq_id,inventory_parts.part_id, \r\n\t\twarehouse_inv.1111XXXXPN,warehouse_inv.DESCRIPTION,warehouse_inv.QTY,employee.EmployeeName,inventory_parts.kitted FROM inventoryreq \r\n\t\tLEFT JOIN workref ON inventoryreq.WO=workref.ID \r\n\t\tLEFT JOIN inventory_parts ON inventoryreq.ID=inventory_parts.invreq_id \r\n\t\tLEFT JOIN employee ON inventoryreq.ReqBy=employee.idEmployee \r\n\t\tLEFT JOIN warehouse_inv ON inventory_parts.part_id=warehouse_inv.ID \r\n\t\tORDER BY ID ASC\");\r\n $body = \"<br /><br />\";\r\n \r\n\r\n\t\tDataface_JavascriptTool::getInstance()\r\n\t\t ->import('editable_nav.js');\r\n\t \r\n\t\t \r\n\t\t \r\n\t /*currID = $record->val('ID');\r\n\t\t$currVal = $record->val('Quantity');\r\n\t\t$out = array();\r\n\t\t$out[] = ' <input type=\"button\" value=\"–\" class=\"qtyminus\" field=\"'.$currID.'\" style=\"font-weight: bold;\" /><input type=\"text\" class=\"status-drop-down\" \r\n\t\t data-record-id=\"'.htmlspecialchars($record->getId()).'\" name=\"'.$currID.'\" value=\"'.$currVal.'\" size=\"4\">';\r\n\r\n\t\t \r\n\t\t \r\n\t\t$out[] = '<input type=\"button\" value=\"+\" class=\"qtyplus\" field=\"'.$currID.'\" style=\"font-weight: bold;\" />';\r\n\t\treturn implode(\"\\n\", $out);\r\n\t\t\r\n\t\t\r\n*/\r\n\r\n \r\n if(!$result)\r\n {\r\n // Error handling\r\n $body .= \"MySQL Error ...\";\r\n }else\r\n {\r\n while($row = mysqli_fetch_assoc($result)) // Fetch all rows\r\n {\r\n // Maybe do something with the single rows\r\n\t\t\t\t\r\n $row['<input type=\"text\" class=\"barcodee\" name=\"'.$row['part_id'].'\">'] = '<input type=\"text\" class=\"barcodee\" name=\"'.$row['part_id'].'\">';\r\n $data[] = $row; // Add singe row to the data\r\n }\r\n mysqli_free_result($result); // Frees the result after finnished using it\r\n\r\n $grid = new Dataface_RecordGrid($data, // Create new RecordGrid with the data\r\n array('<input type=\"text\" class=\"barcodee\" name=\"barcodee\">', 'invreq_id', 'RefID', 'part_id', '1111XXXXPN', 'DESCRIPTION', 'QTY', 'EmployeeName', 'kitted'), \r\n //Order and selection of the colums\r\n null); // No other labels defined -> it uses keys of the associative array\r\n \r\n $body .= $grid->toHTML(); // Get the HTML of the RecordGrid\r\n }\r\n\r\n // Shows the content (RecordGrid or error message) in the Main Template\r\n df_display(array('body' => $body), 'Dataface_Main_Template.html');\r\n }", "public function saveData()\n {\n $newSku = $this->_entityModel->getNewSku();\n while ($bunch = $this->_entityModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->_entityModel->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n\n if (version_compare($this->_entityModel->getProductMetadata()->getVersion(), '2.2.0', '>=')) {\n $rowSku = strtolower($rowData[ImportProduct::COL_SKU]);\n } else {\n $rowSku = $rowData[ImportProduct::COL_SKU];\n }\n $productData = $newSku[$rowSku];\n $this->parseOptions($rowData, $productData[$this->getProductEntityLinkField()]);\n }\n if (!empty($this->cachedOptions['sample']) || !empty($this->cachedOptions['link'])) {\n $this->saveOptions();\n $this->clear();\n }\n }\n return $this;\n }", "function _storeHellaspayInternalData($method, $hellaspay_data, $virtuemart_order_id) {\r\n\r\n\t\t// get all know columns of the table\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$query = 'SHOW COLUMNS FROM `' . $this->_tablename . '` ';\r\n\t\t$db->setQuery($query);\r\n\t\t$columns = $db->loadColumn(0);\r\n\t\t$post_msg = '';\r\n\t\tforeach ($hellaspay_data as $key => $value) {\r\n\t\t\t$post_msg .= $key . \"=\" . $value . \"<br />\";\r\n\t\t\t$table_key = 'hellaspay_response_' . $key;\r\n\t\t\tif (in_array($table_key, $columns)) {\r\n\t\t\t\t$response_fields[$table_key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//$response_fields[$this->_tablepkey] = $this->_getTablepkeyValue($virtuemart_order_id);\r\n\t\t$response_fields['payment_name'] = $this->renderPluginName($method);\r\n\t\t$response_fields['hellaspayresponse_raw'] = $post_msg;\r\n\t\t$return_context = $hellaspay_data['custom'];\r\n\t\t$response_fields['order_number'] = $hellaspay_data['invoice'];\r\n\t\t$response_fields['virtuemart_order_id'] = $virtuemart_order_id;\r\n\t\t//$preload=true preload the data here too preserve not updated data\r\n\t\t$this->storePSPluginInternalData($response_fields, 'virtuemart_order_id', true);\r\n\t}", "public function synchronizePrestashopToGestimum(){\n\t\t$products = $this->getProductsFromPrestashop();\n\t\t\n\t\t// stored procedure fields.\n\t\t$idProduct = 'NULL';\n\t\t$idSupplier = 'NULL';\n\t\t$idManufacturer = 'NULL';\n\t\t$idManufacturer = 'NULL';\n\t\t$idCategoryDefault = '0';\n\t\t$idShopDefault = 'NULL';\n\t\t$idTaxRulesGroup = 'NULL';\n\t\t$onSale = 'NULL';\n\t\t$onlineOnly = 'NULL';\n\t\t$ean13 = 'NULL';\n\t\t$upc = 'NULL';\n\t\t$ecotax = 'NULL';\n\t\t$quantity = 'NULL';\n\t\t$minimalQuantit = '0';\n\t\t$price = 'NULL';\n\t\t$wholesalePrice = 'NULL';\n\t\t$unity = 'NULL';\n\t\t$unitPriceRatio = 'NULL';\n\t\t$additionalShippingCost = 'NULL';\n\t\t$reference;\n\t\t$supplierReference = 'NULL';\n\t\t$location = 'NULL';\n\t\t$width = '0';\n\t\t$height = '0';\n\t\t$depth = 'NULL';\n\t\t$weight = '0';\n\t\t$outOfStock = 'NULL';\n\t\t$quantityDiscount = 'NULL';\n\t\t$customizable = 'NULL';\n\t\t$uploadableFiles = 'NULL';\n\t\t$textFields = 'NULL';\n\t\t$active = 'NULL';\n\t\t$availableForOrder = 'NULL';\n\t\t$availableDate = 'NULL';\n\t\t$condition = 'NULL';\n\t\t$showPrice = 'NULL';\n\t\t$indexed = 'NULL';\n\t\t$visibility = 'NULL';\n\t\t$cacheIsPack = 'NULL';\n\t\t$cacheHasAttachments = 'NULL';\n\t\t$isVirtual = 'NULL';\n\t\t$cacheDefaultAttribute = 'NULL';\n\t\t$dateAdd = 'NULL';\n\t\t$dateUpd = NULL;\n\t\t$advancedStockManagement = 'NULL';\n\t\t$productOptionValues = array();\n\t\t$categories = 'NULL';\n\n\t\tforeach ($products as $idProduct => $productArray) {\n\t\t\tforeach ($productArray as $attribute => $value) {\n\t\t\t\tswitch ($attribute) {\n\t\t\t\t\tcase 'id':\n\t\t\t\t\t\t$idProduct = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'id_supplier':\n\t\t\t\t\t\tif($value) $idSupplier = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'id_manufacturer':\n\t\t\t\t\t\tif ($value) $idManufacturer = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'id_category_default':\n\t\t\t\t\t\tif( $value) $idCategoryDefault = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'id_shop_default':\n\t\t\t\t\t\t$idShopDefault = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'id_tax_rules_group':\n\t\t\t\t\t\t$idTaxRulesGroup = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'on_sale':\n\t\t\t\t\t\t$onSale = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'online_only':\n\t\t\t\t\t\t$onlineOnly = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ean13':\n\t\t\t\t\t\tif($value) $ean13 = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'upc':\n\t\t\t\t\t\tif($value) $upc = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ecotax':\n\t\t\t\t\t\t$ecotax = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'quantity':\n\t\t\t\t\t\t$quantity = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'minimal_quantity':\n\t\t\t\t\t\t$minimalQuantity = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'price':\n\t\t\t\t\t\t$price = (int)$value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'wholesale_price':\n\t\t\t\t\t\t$wholesalePrice = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'unity':\n\t\t\t\t\t\tif($value) $unity= (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'unit_price_ratio':\n\t\t\t\t\t\t$unitPriceRatio = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'additional_shipping_cost':\n\t\t\t\t\t\tif($value) $additionalShippingCost = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'reference':\n\t\t\t\t\t\t$reference = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'supplier_reference':\n\t\t\t\t\t\tif($value) $supplierReference = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'location':\n\t\t\t\t\t\tif($value) $location = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'width':\n\t\t\t\t\t\t$width = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'height':\n\t\t\t\t\t\t$height = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'depth':\n\t\t\t\t\t\t$depth = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'weight':\n\t\t\t\t\t\t$weight = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'out_of_stock':\n\t\t\t\t\t\t$outOfStock = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'quantity_discount':\n\t\t\t\t\t\t$quantityDiscount = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'customizable':\n\t\t\t\t\t\t$customizable = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'uploadable_files':\n\t\t\t\t\t\t$uploadableFiles = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'text_fields':\n\t\t\t\t\t\t$textFields = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'active':\n\t\t\t\t\t\t$active = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'available_for_order':\n\t\t\t\t\t\t$availableForOrder = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'available_date':\n\t\t\t\t\t\t$availableDate = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'condition':\n\t\t\t\t\t\t$condition = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'show_price':\n\t\t\t\t\t\t$showPrice = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'indexed':\n\t\t\t\t\t\t$indexed = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'visibility':\n\t\t\t\t\t\t$visibility = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cache_is_pack':\n\t\t\t\t\t\t$cacheIsPack = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cache_has_attachments':\n\t\t\t\t\t\t$cacheHasAttachments = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'is_virtual':\n\t\t\t\t\t\t$isVirtual = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cache_default_attribute':\n\t\t\t\t\t\tif($value) $cacheDefaultAttribute = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'date_add':\n\t\t\t\t\t\t$dateAdd = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'date_upd':\n\t\t\t\t\t\t$dateUpd = (string) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'advanced_stock_management':\n\t\t\t\t\t\t$advancedStockManagement = (int) $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'product_option_values':\n\t\t\t\t\t\t$productOptionValues = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'categories':\n\t\t\t\t\t\t$categories = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($reference == '') {\n\t\t\t\tthrow new ProductWithoutReferenceException(\"Merci de donner une référence valide à votre produit\", 1);\n\t\t\t}\n\n\t\t\tif(sizeof($productOptionValues) == 0){\n\t\t\t\t// The product has no declension (option value)\n\t\t\t\t$productOptionValues[] = '';\n\t\t\t}\n\t\t\t$originInt = (int) $this->origin;\n\t\t\t\n\t\t\t$dateUpd = new DateTime($dateUpd);\n\t\t\t$dateUpd = $dateUpd->format('Y-m-d H:i:s');\n\n\t\t\tforeach ($productOptionValues as $key => $declension) {\n\n\t\t\t\t$IdDeclinaison = substr(strtoupper(str_replace(' ','',$key)),-5);\n\t\t\t\t$CodeArticle = $reference . $IdDeclinaison;\n\n\t\t\t\tif (Constants::existsInDB(\n\t\t\t\t\tProductsConstants::getSelectARTCODEString($this->origin, $idProduct, $IdDeclinaison),\n\t\t\t\t\t$this->sqlServerConnection\n\t\t\t\t\t)){\n\t\t\t\t\t$updateProductSqlQuery = ProductsConstants::getProductUpdatingString(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$productArray['name'],\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$declension,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$minimalQuantit,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$weight,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$height,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dateUpd,\n\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$IdDeclinaison,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$CodeArticle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$this->origin,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$idProduct,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$categories);\n\t\t\t\t\todbc_exec($this->sqlServerConnection, $updateProductSqlQuery) or die (\"<p>\" . odbc_errormsg() . \"</p>\");\t\n\t\t\t\t}\n\t\t\t\telseif (Constants::existsInDB(\n\t\t\t\t\tProductsConstants::getSelectArticleByPrestashopReference($reference),\n\t\t\t\t\t$this->sqlServerConnection\n\t\t\t\t\t)) {\n\t\t\t\t\t$updateProductSqlQuery = ProductsConstants::getProductUpdatingByReferenceString($productArray['name'],\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$declension,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$minimalQuantit,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$weight,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$height,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dateUpd,\n\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$IdDeclinaison,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$CodeArticle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$this->origin,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$idProduct,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$categories,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t$reference);\n\t\t\t\todbc_exec($this->sqlServerConnection, $updateProductSqlQuery) or die (\"<p>\" . odbc_errormsg() . \"</p>\");\n\t\t\t\t}else{\n\t\t\t\t\t$insertProductQuery = ProductsConstants::getProductInsertingString(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$CodeArticle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$productArray['name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$declension,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$reference,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$minimalQuantit,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$weight,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dateUpd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$idCategoryDefault,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$idProduct,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$IdDeclinaison,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->origin,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$categories);\n\t\t\t\t\todbc_exec($this->sqlServerConnection, $insertProductQuery) or die (\"<p>\" . odbc_errormsg() . \"</p>\");\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}", "public function save($data)\n {\n /* Prices */\n $data['price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['price_low']);\n $data['special_price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['special_price_low']);\n\n /* Attributes */\n $attributes = array();\n foreach ($data['attributes']['title'] as $key => $title) {\n $attributes[] = array(\n 'title' => str_replace('\"', '\\\"', $title),\n 'value' => str_replace('\"', '\\\"', $data['attributes']['value'][$key]),\n 'is_variation' => ($data['attributes']['is_variation'][$key] === 'on')\n );\n }\n\n $data['attributes'] = $attributes;\n\n /* Variations */\n if (!empty($data['variations'])) {\n $variations = array();\n foreach ($data['variations']['name'] as $key => $name) {\n $variations[] = array(\n 'name' => str_replace('\"', '\\\"', $name),\n 'available_quantity' => $data['variations']['available_quantity'][$key],\n 'price' => $data['variations']['price'][$key],\n 'special_price' => $data['variations']['special_price'][$key],\n 'advertised' => $data['variations']['advertised'][$key],\n 'final_price' => $data['variations']['final_price'][$key],\n 'image' => $data['variations']['image'][$key]\n );\n }\n\n $data['variations'] = $variations;\n }\n \n $data['short_description'] = str_replace('\"', '\\\"', $data['short_description']);\n $data['description'] = str_replace('\"', '\\\"', $data['description']);\n $data['short_description'] = str_replace(PHP_EOL, '<br />', $data['short_description']);\n $data['description'] = str_replace(PHP_EOL, '<br />', $data['description']);\n \n $productId = $data['product_id'];\n $dataJson = str_replace(\"'\", \"\\'\", json_encode($data));\n \n $query = \"UPDATE products SET processed_data = '{$dataJson}', last_status_change = NOW() WHERE id = {$productId}\";\n $this->query($query);\n\n $errors = $this->getLastError();\n if ($errors) {\n die($errors);\n }\n \n return $this;\n }", "function getprodproclist($bid)\r\n\t{\r\n\t\t$sql = \"select p.product_name as product,p.product_id,(pl.qty*o.quantity) as qty \r\nfrom proforma_invoices i \r\njoin king_orders o on o.id=i.order_id \r\njoin m_product_deal_link pl on pl.itemid=o.itemid \r\njoin m_product_info p on p.product_id=pl.product_id \r\njoin (select distinct p_invoice_no from shipment_batch_process_invoice_link where batch_id = ? and packed=0) as h on h.p_invoice_no = i.p_invoice_no\r\nwhere i.invoice_status=1 \r\norder by p.product_name asc \r\n\t\t\";\r\n\t\t$raw=$this->db->query($sql,$bid)->result_array();\r\n\t\t$prods=array();\r\n\t\t$pids=array();\r\n\t\tforeach($raw as $r)\r\n\t\t{\r\n\t\t\tif(!isset($prods[$r['product_id']]))\r\n\t\t\t\t$prods[$r['product_id']]=array(\"product_id\"=>$r['product_id'],\"product\"=>$r['product'],\"qty\"=>0,\"location\"=>\"\");\r\n\t\t\t$prods[$r['product_id']]['qty']+=$r['qty'];\r\n\t\t\t$pids[]=$r['product_id'];\r\n\t\t}\r\n\t\t$pids=array_unique($pids);\r\n\t\t$raw_locs=$this->db->query(\"select s.mrp,s.product_id,rb.rack_name,rb.bin_name from t_stock_info s join m_rack_bin_info rb on rb.id=s.rack_bin_id where s.product_id in ('\".implode(\"','\",$pids).\"') order by s.stock_id asc\")->result_array();\r\n\t\t$ret=array();\r\n\t\tforeach($prods as $i=>$p)\r\n\t\t{\r\n\t\t\t$q=$p['qty'];\r\n\t\t\t$locations=array();\r\n\t\t\t$mrps=array();\r\n\t\t\tforeach($raw_locs as $s)\r\n\t\t\t{\r\n\t\t\t\tif($s['product_id']!=$i)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t$q-=$s['available_qty'];\r\n\t\t\t\t$locations[]=$s['rack_name'].$s['bin_name'];\r\n\t\t\t\t$mrps[]=\"Rs \".$s['mrp'];\r\n\t\t\t\tif($q<=0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$prods[$i]['location']=$loc=implode(\", \",array_unique($locations));\r\n\t\t\t$prods[$i]['mrp']=implode(\", \",array_unique($mrps));\r\n\t\t\t$assoc_loc=$loc.substr($p['product'],0,10).rand(110,9999);\r\n\t\t\t$ret[$assoc_loc]=$prods[$i];\r\n\t\t}\r\n\t\tksort($ret);\r\n\t\treturn $ret;\r\n\t}", "public static function update_product_details($data)\n {\n try{\n \n $session = Yii::$app->session;\n foreach($data as $key=>$val) \n {\n \n if($key == 'life_tax_details')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n if($key == 'exact_location')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $insertdata[$key] = $$key;\n\n }\n\n $capacity = $insertdata['capacity'];\n $insertdata['capacity'] = $insertdata['capacity'].' '.$insertdata['capacity_metric']; \n unset($insertdata['capacity_metric']);\n\n if(!isset($model_other)) $insertdata['model_other']=''; \n \n \n //save equipment current location to productloaction array\n $productlocation = array();\n $current_location_keys = ['latitude','longitude','city','state','country','google_place_id','location_type']; \n foreach($current_location_keys as $key)\n {\n if($key == 'location_type')\n {\n $location[$key] = 1;\n }\n else\n {\n $location[$key] = $insertdata[$key];\n unset($insertdata[$key]);\n }\n }\n $productlocation[] = $location;\n unset($insertdata['street']);\n unset($insertdata['route']);\n unset($insertdata['zipcode']);\n\n //save equipment serving location to productloaction array\n if(isset($insertdata['exact_location']))\n {\n $exact_locations = explode(',',$insertdata['exact_location']);\n foreach($exact_locations as $exact_location)\n {\n $get_url_data=file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\".urlencode($exact_location).\"&sensor=false\");\n $url_data=(array)json_decode($get_url_data);\n $url_data=$url_data['results'];\n $components=array_reverse($url_data[0]->address_components);\n $country\t=@$components[0]->long_name;\n $state\t\t=@$components[1]->long_name;\n $city\t\t=@$components[2]->long_name;\n $place_id=$url_data[0]->place_id;\n $lat=$url_data[0]->geometry->location->lat;\n $lng=$url_data[0]->geometry->location->lng;\n $location['latitude'] = $lat;\n $location['longitude'] = $lng;\n $location['city'] = $city;\n $location['state'] = $state;\n $location['country'] = $country;\n $location['google_place_id'] = $place_id;\n $location['location_type'] = 2;\n $productlocation[] = $location;\n }\n }\n unset($insertdata['exact_location']);\n unset($insertdata['_csrf']);\n //unset($insertdata['product_type_check']);\n \n $product_id = $insertdata['product_id'];\n unset($insertdata['product_id']); \n\n\n //get current user id\n //$insertdata['user_id']=Yii::$app->user->getId(); \n $insertdata['updated_by'] = Yii::$app->user->id;\n $insertdata['date_updated'] = date('Y-m-d H:i:s');\n \n //insert data into database core_prodcuts table and get inserted product id\n Yii::$app->db->createCommand()->update('core_products', $insertdata,\"product_id = $product_id\")->execute();\n \n \n Yii::$app->db->createCommand()->delete('core_product_locations', \"product_id = $product_id\")->execute();\n \n //save product current and serving locations using product id \n foreach($productlocation as $location)\n {\n $location['product_id'] = $product_id;\n Yii::$app->db->createCommand()->insert('core_product_locations', $location)->execute();\n }\n\n //get category name by id to get full path of the images & load charts upload for product\n $category_id = $insertdata['category_id'];\n $category_names = Productcategory::select_fields_by_category_id($category_id);\n $category_name= str_replace(' ', '_', $category_names[0]['category_name']);\n\n //save product images\n if(is_array($session->get('product_images')))\n {\n $product_images = $session->get('product_images');\n $original_image_name=$session->get('product_images_names');\n foreach($product_images as $index=>$product_image)\n {\n $images_data['product_id'] = $product_id;\n $images_data['image_name'] = $original_image_name[$index];\n $images_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$product_image;\n $images_data['image_type'] = 1;\n $images_data['image_status'] = 1;\n \n //insert image details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $images_data)->execute();\n\n }\n $session->remove('product_images');\n $session->remove('product_images_names');\n }\n //save product load_charts\n if(is_array($session->get('product_loadcharts')))\n {\n $product_load_charts = $session->get('product_loadcharts');\n $original_load_chart_name=$session->get('product_loadcharts_names');\n foreach($product_load_charts as $index=>$load_chart)\n {\n $load_charts_data['product_id'] = $product_id;\n $load_charts_data['image_name'] = $original_load_chart_name[$index];\n $load_charts_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$load_chart;\n $load_charts_data['image_type'] = 2;\n $load_charts_data['image_status'] = 1;\n //insert load_charts details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $load_charts_data)->execute();\n }\n $session->remove('product_loadcharts');\n $session->remove('product_loadcharts_names');\n }\n\n $response ['status'] = 200;\n $response ['message'] = \"Product updated successfully\";\n\n \n /*//get current user email\n $email = User::select_user_email_by_id();\n $subject=\"Big Equipments India | Registration Of Equipment\";\n //get what message to send after creating product\n $message = Mail_settings::get_product_add_message($manual_product_code,$product_id);\n \n //send email to current user\n Mail_settings::send_email_notification($email,$subject,$message);*/\n\n return $response;\n \n } catch (ErrorException $ex) {\n Yii::warning('Error while updating new product.');\n Yii::warning($ex->getMessage());\n \n $response ['status'] = 400;\n $response ['message'] = \"Error while updating product details\";\n return $response;\n }\n \n }", "public function processData() {\n\t\t$GLOBALS['TCA'] = \\BusyNoggin\\BnBackend\\BackendLibrary::removeExcludeFields($GLOBALS['TCA']);\n\t}", "public function processData() {}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function process($data)\n {\n // Delete previous entries\n $this->deleteWhere('serial_number=?', $this->serial_number);\n \n // Translate printer strings to db fields\n $translate = array(\n 'Channel: ' => 'channel',\n 'Model: ' => 'model',\n 'Port State: ' => 'port_state',\n 'Port Address: ' => 'port_address',\n 'Driver Version: ' => 'driver_version',\n 'Firmware Version: ' => 'firmware_version',\n 'Flash Version: ' => 'flash_version');\n\n //clear any previous data we had\n foreach ($translate as $search => $field) {\n $this->$field = '';\n }\n // Parse data\n foreach (explode(\"\\n\", $data) as $line) {\n // Translate standard entries\n foreach ($translate as $search => $field) {\n if (strpos($line, $search) === 0) {\n $value = substr($line, strlen($search));\n \n $this->$field = $value;\n\n # Check if this is the last field\n if ($field == 'flash_version') {\n $this->id = '';\n $this->save();\n }\n break;\n }\n }\n } //end foreach explode lines\n \n }", "private function process_input()\n\t{\n\t//\t$report_end_datetime = OurTime::js_to_datetime($this->f_report_end, 1);\n\t\t\n\t\t$this->m_product_info_arr = DB::get_all_rows_fq ('\n\t\t\tSELECT products.*\n\t\t\tFROM products\n\t\t');\n\t\t\n\t\t//TESTING: show how many rows we got:\n\t\t//echo count($this->m_obj_info_arr);*/\n\n\t}", "protected function _getProductData() {\n\n\n $cat_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($cat_id);\n $data['event'] = 'product';\n\n $finalPrice = $this->getFinalPriceDiscount();\n if($finalPrice):\n $google_tag_params = array();\n $google_tag_params['ecomm_prodid'] = $this->getProduct()->getSku();\n $google_tag_params['name'] = $this->getProduct()->getName();\n $google_tag_params['brand'] = $this->getProduct()->getBrand();\n $google_tag_params['ecomm_pagetype'] = 'product';\n $google_tag_params['ecomm_category'] = $category->getName();\n $google_tag_params['ecomm_totalvalue'] = (float)$this->formatNumber($finalPrice);\n \n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_name\" => $this->getProduct()->getName(),\n \"content_ids\" => [$this->getProduct()->getSku()],\n \"content_category\" => $category->getName(),\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($finalPrice),\n \"currency\" => \"BRL\"\n );\n $this->createFacebookRequest(\"ViewContent\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n endif;\n\n return $data;\n }", "public function parse()\n {\n $tblProductdata = new Tblproductdata();\n if (isset($this->product['Product Name'])) {\n $tblProductdata->setStrproductname($this->product['Product Name']);\n }\n if (isset($this->product['Product Description'])) {\n $tblProductdata->setStrproductdesc($this->product['Product Description']);\n }\n if (isset($this->product['Product Code'])) {\n $tblProductdata->setStrproductcode($this->product['Product Code']);\n }\n $tblProductdata->setDtmadded(new \\DateTime);\n if (isset($this->product['Discontinued'])\n && $this->product['Discontinued'] == strtolower('yes')\n ) {\n $tblProductdata->setDtmdiscontinued(new \\DateTime);\n }\n $tblProductdata->setStmtimestamp(\n new \\DateTime('@' . strtotime('now'))\n );\n if (isset($this->product['Stock'])) {\n $tblProductdata->setIntstocklevel($this->product['Stock']);\n }\n if (isset($this->product['Discontinued'])) {\n $tblProductdata->setDecPrice($this->product['Cost in GBP']);\n }\n return $tblProductdata;\n }", "protected function process()\n {\n\n // load the SKU from the column\n $sku = $this->getValue($this->getSkuColumnName());\n\n // query whether or not the product has already been processed\n if ($this->hasBeenProcessed($sku)) {\n return;\n }\n\n // try to load it and map the entity ID of the product with the passed SKU otherwise\n if ($product = $this->loadProduct($sku)) {\n $this->addSkuPkMapping($product);\n } else {\n // initialize the error message\n $message = sprintf('Can\\'t load product with SKU \"%s\"', $sku);\n // load the subject\n $subject = $this->getSubject();\n // query whether or not strict mode has been enabled\n if (!$subject->isStrictMode()) {\n $subject->getSystemLogger()->warning($subject->appendExceptionSuffix($message));\n\n $this->getSubject()->mergeStatus(\n array(\n RegistryKeys::NO_STRICT_VALIDATIONS => array(\n basename($this->getSubject()->getFilename()) => array(\n $this->getSubject()->getLineNumber() => array(\n $this->getSkuColumnName() => $message\n )\n )\n )\n )\n );\n } else {\n throw new \\Exception($message);\n }\n }\n }", "function get_store_data()\n\t{\n\t\t// fetch data from db\n\t\t$_data = index_array($this->db_fetch('client_data', array('where' => array('key' => 'product'))), 'type', TRUE);\n\t\t// split data\n\t\tforeach($_data as $type => $vals)\n\t\t{\n\t\t\t$pos = array();\n\t\t\tforeach($vals as $id => $val)\n\t\t\t{\n\t\t\t\tif( !isset($tags) || !in_array($val['tag'], $tags) )\n\t\t\t\t{\n\t\t\t\t\t// check for position taken\n\t\t\t\t\twhile(in_array($val['position'], $pos))\n\t\t\t\t\t{\n\t\t\t\t\t\t++$val['position'];\n\t\t\t\t\t}\n\t\t\t\t\t// save pos to array\n\t\t\t\t\t$pos[] = $val['position'];\n\t\t\t\t\t//\n\t\t\t\t\t$output[$type][$val['position']] = $val;\n\t\t\t\t\t//\n\t\t\t\t\t$tags[] = $val['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort array\n\t\t\tksort($output[$type]);\n\t\t}\n\t\t// return output\n\t\treturn $output;\n\t}", "public function actionAjaxdata()\n\t{\n\t\t$inputCompanyid = Yii::$app->user->identity->input_company_id;\n\t\t$managerId = Yii::$app->user->identity->id;\n\t\t$activityId = 5;\n\t\t$step = 1;\n\t\t$produtArray = $productValues = array();\n\t\tif(isset($_REQUEST)) {\n\t\t\t$channelPartner = $_REQUEST['channel_partner'];\n\t\t\t$productId = $_REQUEST['product'];\n\t\t\t$tableArray = $tablesArray = array();\n\t\t\t$produtsQuery = 'SELECT fb.label,fb.product_id,pr.product_name\n\t\t\t\t\tFROM form_builder fb\n\t\t\t\t\tINNER JOIN form_builder_activities fa ON fb.form_builder_activity_id = fa.form_builder_activity_id\n\t\t\t\t\tINNER JOIN products pr on pr.id = fb.product_id\n\t\t\t\t\tWHERE fa.company_id ='.$inputCompanyid.'\n\t\t\t\t\t\t\tAND fa.activity_id = '.$activityId.'\n\t\t\t\t\t\t\t\t\tAND fb.step ='.$step;\n\t\t\t$productLables = Yii::$app->db->createCommand($produtsQuery)->queryAll();\n\t\t\tif(!empty($productLables)) {\n\t\t\t\tforeach($productLables as $label) {\n\t\t\t\t\t$produtArray[$label['product_id']][] = $label['label'];\n\t\t\t\t\t$produtArray[$label['product_id']]['name'] = $label['product_name'];\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//echo '<pre>';print_r($produtArray);\n\n\t\t\t$wherConditon = '';\n\t\t\tif($productId != '') {\n\t\t\t\t$wherConditon = 'AND cht.product_id ='.$productId;\n\t\t\t}\n\t\t\t$dataQuery = 'SELECT DISTINCT cht.product_id AS product_id, IF(cht.liquidation_status is null or cht.liquidation_status = \"\", \"--\",cht.liquidation_status) as liquidation_status,IF(cht.demand_volume is null or cht.demand_volume = \"\", \"--\",cht.demand_volume) as demand_volume ,\n\t\t\t\t\tIF(cht.season_progress is null or cht.season_progress = \"\", \"--\",cht.season_progress) as season_progress,IF(cht.collection_value_four is null or cht.collection_value_four = \"\", \"--\",cht.collection_value_four) as collection_value_four,\n\t\t\t\t\tp.product_name,IF(cht.collection_value_five is null or cht.collection_value_five = \"\", \"--\",cht.collection_value_five) as collection_value_five, cht.updated_date AS updated_date, ms.product_name AS product_name, u.first_name AS fieldforce_name\n\t\t\t\t\tFROM plan_cards p\n\t\t\t\t\tINNER JOIN users u ON u.id = p.assign_to\n\t\t\t\t\tINNER JOIN channel_card_tracking_info cht ON cht.plan_card_id = p.id\n\t\t\t\t\tINNER JOIN products ms ON cht.product_id = ms.id\n\t\t\t\t\tWHERE (p.card_type=\"Channel Card\") AND (p.status=\"submitted\")\n\t\t\t\t\tAND (u.input_company_id = '.$inputCompanyid.') AND (p.channel_partner=\"'.$channelPartner.'\")'.$wherConditon.' GROUP BY cht.updated_date,product_id ORDER BY cht.updated_date DESC';\n\t\t\t$productsres = Yii::$app->db->createCommand($dataQuery)->queryAll();\n\t\t\tif(!empty($productsres)) {\n\t\t\t\tforeach($productsres as $produtdata) {\n\t\t\t\t\t$productValues[$produtdata['product_id']][] = $produtdata;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//echo '<pre>';print_r($productValues);exit;\n\t\t\tif(!empty($productValues)) {\n\t\t\t\tforeach($productValues as $key => $productId) {\n\t\t\t\t\tif(in_array($key,array_keys($produtArray))) {\n\t\t\t\t\t\t//echo '<pre>'; print_r($produtArray);exit;\n\t\t\t\t\t\t$table = '<div class=\"table_section table_cols \" ><h3>'.$produtArray[$key]['name'].'</h3><div class =\"table-responsive\"><table class=\"table table-striped table-bordered\">\n\t\t\t\t\t\t\t\t<thead><tr>\n\t\t\t\t\t\t\t\t<th>Submit date</th>';\n\t\t\t\t\t\tif(isset($produtArray[$key][0])) {\n\t\t\t\t\t\t\tif($produtArray[$key][0] != '') {\n\t\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][0])?$produtArray[$key][0]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($produtArray[$key][1])) {\n\t\t\t\t\t\t\tif($produtArray[$key][1] != '') {\n\t\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][1])?$produtArray[$key][1]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($produtArray[$key][2])) {\n\t\t\t\t\t\t\tif($produtArray[$key][2] != '') {\n\t\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][2])?$produtArray[$key][2]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($produtArray[$key][3])) {\n\t\t\t\t\t\t\tif($produtArray[$key][3] != '') {\n\t\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][3])?$produtArray[$key][3]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($produtArray[$key][4])) {\n\t\t\t\t\t\t\tif($produtArray[$key][4] != '') {\n\t\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][4])?$produtArray[$key][4]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* $table .= '<th>'.(isset($produtArray[$key][1])?$produtArray[$key][1]:\"--\").'</th>\n\t\t\t\t\t\t <th>'.(isset($produtArray[$key][2])?$produtArray[$key][2]:\"--\").'</th>';\n\t\t\t\t\t\t if(isset($produtArray[$key][3]) || $produtArray[$key][3] != '') {\n\t\t\t\t\t\t\t$table .= 'sss<th>'.(isset($produtArray[$key][3])?$produtArray[$key][3]:\"--\").'</th>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$table .= '<th>'.(isset($produtArray[$key][4])?$produtArray[$key][4]:\"--\").'</th> */\n\t\t\t\t\t\t$table .= '<th>Field Force</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>';\n\t\t\t\t\t\tforeach($productId as $val) {\n\t\t\t\t\t\t\t$table .= '\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>'.date('d/m/Y',strtotime($val['updated_date'])).'</td>';\n\t\t\t\t\t\t\tif(isset($produtArray[$key][0])) {\n\t\t\t\t\t\t\t\tif($produtArray[$key][0] != '') {\n\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['liquidation_status'].'</td>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(isset($produtArray[$key][1])) {\n\t\t\t\t\t\t\t\t\tif($produtArray[$key][1] != '') {\n\t\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['demand_volume'].'</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(isset($produtArray[$key][2])) {\n\t\t\t\t\t\t\t\t\tif($produtArray[$key][2] != '') {\n\t\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['season_progress'].'</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(isset($produtArray[$key][3])) {\n\t\t\t\t\t\t\t\t\tif($produtArray[$key][3] != '') {\n\t\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['collection_value_four'].'</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(isset($produtArray[$key][4])) {\n\t\t\t\t\t\t\t\t\tif($produtArray[$key][4] != '') {\n\t\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['collection_value_five'].'</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$table .= '<td>'.$val['fieldforce_name'].'</td></tr>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$table .= '</tbody></table></div></div>';\n\t\t\t\t\t\t\t\t$tablesArray[] = $table;\n\t\t\t\t\t\t\t}\n\n\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//print_r($tablesArray);\n\t\t\t\t\treturn json_encode($tablesArray);\n\n\t\t\t\t}\n\t\t\t}", "function postProcess($data) {\r\n if ($data) {\r\n foreach ($data as $key => $entry) {\r\n // is it in use?\r\n $inUse = $this->Event->checkEvaluationToolInUse('3',$entry['Survey']['id']) ;\r\n\r\n // Put in the custom inUse column\r\n $data[$key]['!Custom']['inUse'] = $inUse ? \"Yes\" : \"No\";\r\n\r\n // Decide whether the course is release or not ->\r\n // (from the events controller postProcess function)\r\n $releaseDate = strtotime($entry[\"Survey\"][\"release_date_begin\"]);\r\n $endDate = strtotime($entry[\"Survey\"][\"release_date_end\"]);\r\n $timeNow = strtotime($entry[0][\"now()\"]);\r\n\r\n if (!$releaseDate) $releaseDate = 0;\r\n if (!$endDate) $endDate = 0;\r\n\r\n $isReleased = \"\";\r\n if ($timeNow < $releaseDate) {\r\n $isReleased = \"Not Yet Open\";\r\n } else if ($timeNow > $endDate) {\r\n $isReleased = \"Already Closed\";\r\n } else {\r\n $isReleased = \"Open Now\";\r\n }\r\n\r\n // Put in the custom isReleased string\r\n $data[$key]['!Custom']['isReleased'] = $isReleased;\r\n }\r\n }\r\n // Return the processed data back\r\n return $data;\r\n }", "private static function data_form(){\n\t\t\t\n\t\t\t\n\t\t\t$data_form = array();\n\t\t\t\n\t\t\tif(isset($_POST['v_super_pay'])){\n\t\t\t\t\n\t\t\t\t$data_form['vehicle_type'] = $_POST['v_type'];\n\t\t\t\t$data_form['service_package'] = $_POST['s_package'];\n\t\t\t\t$data_form['service_type'] = $_POST['service_type'];\n\t\t\t\t$data_form['car_re'] = $_POST['car_reg'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset( $_POST['extras'])){\n\t\t\t\t\t\n\t\t\t\t\t$data_form['extra'] = $_POST['extras'];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$v_price = 0;\n\t\t\t\t\t$s_price = 0;\n\t\t\t\t\t$s_pack_price = 0;\n\t\t\t\t\t$ex_s_price = 0;\n\t\t\t\t\n\t\t\t\t\n\t\t\tif($data_form['vehicle_type'] == 'sedan'){\n\t\t\t\t\n\t\t\t\t$v_price = 150;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'hatchback'){\n\t\t\t\t\n\t\t\t\t$v_price = 175;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'suv'){\n\t\t\t\t\n\t\t\t\t$v_price = 190;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t}else if($data_form['vehicle_type'] == 'minibus'){\n\t\t\t\t\n\t\t\t\t$v_price = 250;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t}else if($data_form['vehicle_type'] == 'truck'){\n\t\t\t\t\n\t\t\t\t$v_price = 260;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t}else if($data_form['vehicle_type'] == 'motorbike'){\n\t\t\t\t\n\t\t\t\t$v_price = 130;\n\t\t\t\t$data_form['v_price'] = $v_price;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}// End of first if group\n\t\t\t\t\n\t\t\t\tif($data_form['service_package'] == 'standard'){\n\t\t\t\t\t\n\t\t\t\t\t$s_pack_price = 280;\n\t\t\t\t\t$data_form['s_pack'] = $s_pack_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t$s_pack_price = 320;\n\t\t\t\t\t$data_form['s_pack'] = $s_pack_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}// End of second if group\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($data_form['service_type'] == 'ineterio'){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 30;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else if($data_form['service_type'] == 'exterior'){\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 40;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$s_price = 65;\n\t\t\t\t\t$data_form['s_type'] = $s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}// End of third if group\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset($data_form['extra'])){\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$ex_s_price = 200;\n\t\t\t\t\t$data_form['extra_price'] = $ex_s_price;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$total = $v_price + $s_price + $s_pack_price+$ex_s_price;\n\t\t\t\t\t\n\t\t\t\t\t$data_form['total'] = $total;\n\t\t\t\t\techo json_encode(($data_form));exit;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t}else if(isset($_POST['info_request'])){\n\t\t\t\t\n\t\t\t\t$data_form['user_name'] = $_POST['client_cname'];\n\t\t\t\t$data_form['user_email'] = $_POST['client_cmail'];\n\t\t\t\t$data_form['user_tel'] = $_POST['client_cmobile'];\n\t\t\t\t$data_form['user_subject'] = $_POST['client_csubject'];\n\t\t\t\t$data_form['user_message'] = $_POST['client_cmessage'];\n\t\t\t\t$data_form['information_data'] = true;\n\t\t\t\t\n\t\t\t\treturn $data_form;\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}else if(isset($_POST['quote_request'])){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$data_form['client_qname'] = $_POST['quote_client_name'];\n\t\t\t\t$data_form['client_qsname'] = $_POST['quote_client_sname'];\n\t\t\t\t$data_form['user_email'] = $_POST['quote_client_mail'];\n\t\t\t\t$data_form['client_qtel'] = $_POST['quote_client_mobile'];\n\t\t\t\t$data_form['sub_date'] = date('Y-m-d');\n\t\t\t\t$data_form['sub_type'] = $_POST['subscription_type'];\n\t\t\t\t$data_form['sub_fee'] = $_POST['quote_client_fee'];\n\t\t\t\t$data_form['account_hold'] = $_POST['quote_client_c_name'];\n\t\t\t\t$data_form['account_num'] = $_POST['quote_client_c_number'];\n\t\t\t\t$data_form['account_cvv'] = $_POST['quote_client_c_vv'];\n\t\t\t\t$data_form['database_save'] = true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $data_form;\n\t\t\t\t\n\t\t}else {\n\t\t\t\n\t\t\t\n\t\t\t\tunset($data_form);\n\t\t\t\treturn $data_form ='No form has been submitted';\n\t\t\t\n\t\t\t\n\t}// End of outer if else statement\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "function SqlPriceControlCall($aData) {\n \n\t// error\n\t$sError = \"(pi.price=0 or pi.id_provider=0 or pi.id_provider is null or pi.code='' or pi.pref='' or pi.pref is null or pi.is_code_ok=0) \";\n\t// stock exist and not error\n\tif (Language::getConstant('price_control:ignore_load_empty_stock',0))\n\t $sStockExist =\" and CONVERT(replace(replace(replace(replace(replace(replace(replace(replace(replace(pi.stock,'>',''),'<',''),'+',''),'++',''),'+++',''),'есть','1'),'X',''),'XX',''),'XXX',''), SIGNED) > 0 \";\n\n\t$sWhere = \" and (\".$sError.$sStockExist.\") \";\n\t// end work\n\t$sWhere .= \" and (pq.is_processed=2 or pq.is_processed=3) \";\n\t\n\t$sWhere.=$aData['where'];\n\n\t/*if ($aData['id']) {\n\t\t$sWhere.=\" and b.id='{$aData['id']}'\";\n\t}*/\n\t$sGroup = \" group by pi.id\";\n\n\t$sSql=\"select pi.*, pq.file_name_original, pq.file_path, pq.post_date as pq_post_date, pq.sum_all as pq_sum_all,\n\t\t\tpq.sum_errors as pq_sum_errors, u.login as login_provider, pp.name as name_price_profile,\n\t\t\tpq.is_processed as pq_is_processed, pq.source as pq_source, u2.login as login_provider_buffer,\n\t\t\tcu.symbol as currency_provider, up.name as name_store,\n\t c.id_tof\n\t\t\tfrom price_import as pi\n\t\t\tinner join price_queue pq on pq.id = pi.id_price_queue\n\t\t\tinner join user u on u.id = pq.id_user_provider \n\t\t\tinner join price_profile pp on pp.id = pq.id_price_profile\n\t\t\tinner join user u2 on u2.id = pi.id_provider\n\t\t\tinner join user_provider up on up.id_user = u2.id\n\t\t\tinner join currency as cu on cu.id = up.id_currency\n\t\t\tleft join cat c on c.pref = pi.pref\n\t\t\twhere 1=1\n\t\t\t\t\".$sWhere.$sGroup;\n\n\treturn $sSql;\n}", "public static function insert_new_product_details($data)\n {\n try{\n \n $session = Yii::$app->session;\n foreach($data as $key=>$val) \n {\n if($key == 'hire_price' || $key == 'sale_price'){\n if($val != '')\n {\n $val=str_replace(',', '', $val );\n if (strpos($val, '.') !== false) {\n $val=substr($val,0,strpos($val, '.')+3);\n }\n }\n else\n {\n $val = 0;\n }\n }\n if($key == 'life_tax_details')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n if($key == 'exact_location')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $insertdata[$key] = $$key;\n\n }\n \n if($insertdata['hire_price_range'] == 'crore')\n {\n \n $insertdata['hire_price'] = $insertdata['hire_price'] * 10000000;\n }\n else if($insertdata['hire_price_range'] == 'lack')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 100000;\n }\n else if($insertdata['hire_price_range'] == 'thousand')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 1000;\n }\n else if($insertdata['hire_price_range'] == 'por')\n {\n $insertdata['hire_price'] = -1;\n }\n \n if($insertdata['sale_price_range'] == 'crore')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 10000000;\n }\n else if($insertdata['sale_price_range'] == 'lack')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 100000;\n }\n else if($insertdata['sale_price_range'] == 'thousand')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 1000;\n }\n else if($insertdata['sale_price_range'] == 'por')\n {\n $insertdata['sale_price'] = -1;\n }\n \n unset($insertdata['hire_price_range']);\n unset($insertdata['sale_price_range']);\n \n\n $capacity = $insertdata['capacity'];\n $insertdata['capacity'] = $insertdata['capacity'].' '.$insertdata['capacity_metric']; \n unset($insertdata['capacity_metric']);\n\n if(!isset($model_other)) $insertdata['model_other']=''; \n $insertdata['product_status'] = 0; //update this when control panel complete\n\n $remove_keys = ['email','user_name','phone_number','password','regrepassword','company_name','designation','company_email','address','otp'];\n foreach($remove_keys as $removekey) unset($insertdata[$removekey]);\n\n //save equipment current location to productloaction array\n $productlocation = array();\n $current_location_keys = ['latitude','longitude','city','state','country','google_place_id','location_type']; \n foreach($current_location_keys as $key)\n {\n if($key == 'location_type')\n {\n $location[$key] = 1;\n }\n else\n {\n $location[$key] = $insertdata[$key];\n unset($insertdata[$key]);\n }\n }\n $productlocation[] = $location;\n unset($insertdata['street']);\n unset($insertdata['route']);\n unset($insertdata['zipcode']);\n\n //save equipment serving location to productloaction array\n if(isset($insertdata['exact_location']))\n {\n $exact_locations = explode(',',$insertdata['exact_location']);\n foreach($exact_locations as $exact_location)\n {\n $get_url_data=file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\".urlencode($exact_location).\"&sensor=false\");\n $url_data=(array)json_decode($get_url_data);\n $url_data=$url_data['results'];\n $components=array_reverse($url_data[0]->address_components);\n $country\t=@$components[0]->long_name;\n $state\t\t=@$components[1]->long_name;\n $city\t\t=@$components[2]->long_name;\n $place_id=$url_data[0]->place_id;\n $lat=$url_data[0]->geometry->location->lat;\n $lng=$url_data[0]->geometry->location->lng;\n $location['latitude'] = $lat;\n $location['longitude'] = $lng;\n $location['city'] = $city;\n $location['state'] = $state;\n $location['country'] = $country;\n $location['google_place_id'] = $place_id;\n $location['location_type'] = 2;\n $productlocation[] = $location;\n }\n }\n unset($insertdata['exact_location']);\n unset($insertdata['_csrf']);\n unset($insertdata['product_type_check']);\n \n if ($insertdata['length'] == \"\"){ \n $insertdata['length'] =0; \n } \n if ($insertdata['width'] == \"\"){\n $insertdata['width'] =0; \n } \n if ($insertdata['height'] == \"\"){ \n $insertdata['height'] =0; \n } \n $insertdata['dimensions'] = $insertdata['length'].'x'.$insertdata['width'].'x'.$insertdata['height']; \n unset($insertdata['length']); \n unset($insertdata['width']); \n unset($insertdata['height']);\n \n //update amount if package type is free\n if($data['package_type'] != 2) { $data['package_amount'] = 0; }\n \n\n\n //get current user id\n $insertdata['user_id']=Yii::$app->user->getId(); \n \n $insertdata['updated_by'] = Yii::$app->user->id;\n $insertdata['date_updated'] = date('Y-m-d H:i:s');\n \n //insert data into database core_prodcuts table and get inserted product id\n Yii::$app->db->createCommand()->insert('core_products', $insertdata)->execute();\n $product_id = Yii::$app->db->getLastInsertID();\n\n $session->set('current_product_id', $product_id);\n\n //generate unique code for product and update\n //new logic start\n $categories = array('1'=>'C','2'=>'D','3'=>'E','4'=>'G','5'=>'P');//C-crane,D-dumper,E-excavator,G-generator,P-piling rigs\n $manual_product_code = $categories[$insertdata['category_id']];\n \n $subcategorycode = Productsubcategory::get_sub_category_code_by_id($insertdata['sub_category_id']);\n $manual_product_code .= $subcategorycode;\n \n if(strlen($capacity)>4)\n $manual_product_code .= substr($capacity, 0,4);\n else if(strlen($capacity)<=4)\n $manual_product_code .= str_pad($capacity, 4, '0', STR_PAD_LEFT);\n \n $producttype = array('0'=>'H','1'=>'S','2'=>'B'); //H-hire,S-sale,B-both\n $manual_product_code .=$producttype[$insertdata['product_type']];\n \n $manual_product_code .= strtoupper(str_pad(dechex($product_id), 5, '0', STR_PAD_LEFT));\n \n \n //new logic end\n Yii::$app->db->createCommand()->update('core_products', ['manual_product_code' => $manual_product_code], \"product_id = '$product_id'\")->execute();\n\n\n //save product current and serving locations using product id \n foreach($productlocation as $location)\n {\n $location['product_id'] = $product_id;\n Yii::$app->db->createCommand()->insert('core_product_locations', $location)->execute();\n }\n\n //get category name by id to get full path of the images & load charts upload for product\n $category_id = $insertdata['category_id'];\n $category_names = Productcategory::select_fields_by_category_id($category_id);\n $category_name= str_replace(' ', '_', $category_names[0]['category_name']);\n\n //save product images\n if(is_array($session->get('product_images')))\n {\n $product_images = $session->get('product_images');\n $original_image_name=$session->get('product_images_names');\n foreach($product_images as $index=>$product_image)\n {\n $images_data['product_id'] = $product_id;\n $images_data['image_name'] = $original_image_name[$index];\n $images_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$product_image;\n $images_data['image_type'] = 1;\n $images_data['image_status'] = 1;\n \n //insert image details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $images_data)->execute();\n\n }\n $session->remove('product_images');\n $session->remove('product_images_names');\n }\n //save product load_charts\n if(is_array($session->get('product_loadcharts')))\n {\n $product_load_charts = $session->get('product_loadcharts');\n $original_load_chart_name=$session->get('product_loadcharts_names');\n foreach($product_load_charts as $index=>$load_chart)\n {\n $load_charts_data['product_id'] = $product_id;\n $load_charts_data['image_name'] = $original_load_chart_name[$index];\n $load_charts_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$load_chart;\n $load_charts_data['image_type'] = 2;\n $load_charts_data['image_status'] = 1;\n //insert load_charts details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $load_charts_data)->execute();\n }\n $session->remove('product_loadcharts');\n $session->remove('product_loadcharts_names');\n }\n\n $response ['status'] = 200;\n $response ['message'] = \"Product added successfully\";\n\n \n /*//get current user email\n $email = User::select_user_email_by_id();\n $subject=\"Big Equipments India | Registration Of Equipment\";\n //get what message to send after creating product\n $message = Mail_settings::get_product_add_message($manual_product_code,$product_id);\n \n //send email to current user\n Mail_settings::send_email_notification($email,$subject,$message);*/\n\n return json_encode($response);\n \n } catch (ErrorException $ex) {\n Yii::warning('Error while adding new product.');\n Yii::warning($ex->getMessage());\n }\n \n }", "public function process($product_id, $css_select,$css_option,$id_select)\n\t{\n\t\t$css_select = $css_select . ' eav_oi_select';\n\t\t$css_option = $css_option . '';\n\t\t$id_select = $id_select . '';\n\n\n\t\t//\n\t\t// Get a list of variances that are disabled\n\t\t//\n\t\t$disabled = $this->_get_disable_variances($product_id);\n\n\n\n\n\t\t//\n\t\t// Get the template values\n\t\t//\n\t\t$options = $this->_get_template_values($product_id);\n\n\n\n\n\n\t\t//var_dump($options);die;\n\n\t\tforeach($options as $key =>$option)\n\t\t{\n\t\t\t\n\n\t\t\t$option = (array) $option;\t\n\n\n\t\t\t$options[$key] = \n\t\t\t[ \n\t\t\t\t'attribute'\t\t=> strtolower($option['e_label']),\n\t\t\t\t'label'\t\t\t=> $option['e_label'],\n\t\t\t\t'value'\t\t\t=> '',\n\t\t\t\t'values'\t\t=> [],\n\t\t\t\t'select_start' \t=> \"<select class='{$css_select}' data-option-id='{$option['id']}' id='{$id_select}' name='form_eav_{$option['id']}'>\",\n\t\t\t\t'select_end' \t=> \"</select>\",\n\t\t\t\t'count'\t\t\t=> 0,\n\t\t\t\t'hidden'\t\t=> '',\n\t\t\t\t'is_hidden'\t\t=> false,\n\t\t\t\t'disabled'\t\t=> '',\n\t\t\t];\n\n\n\t\t\t$this->db\n\t\t\t\t\t->select('e_value,e_label')\n\t\t\t\t\t->distinct()\n\t\t\t\t\t->where('e_product',$product_id)\n\t\t\t\t\t->where('e_variance !=', 'NULL')\n\t\t\t\t\t->where('e_label',$option['e_label']);\n\n\t\t\tif(count($disabled)>0)\n\t\t\t{\n\t\t\t\t$this->db->where_not_in('e_variance', $disabled);\n\t\t\t}\n\n\n\t\t\t$theoptions = $this->db->get('nct_e_attributes')->result();\n\n\n\t\t\t//var_dump($theoptions);die;\n\n\t\t\t//note the number of options\n\t\t\t$options[$key]['count'] = count($theoptions);\t\t\t\t\n\n\t\t\tforeach($theoptions as $somekey => $aoption)\n\t\t\t{\n\t\t\t\t$aoption = (array) $aoption;\n\n\t\t\t\t//if we see a blank value lets skip as if it doesnt exist!\n\t\t\t\t/*\n\t\t\t\tif(trim($aoption['e_value']) =='')\n\t\t\t\t{\n\t\t\t\t\tunset($theoptions[$somekey]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t$a = []; \n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($options[$key]['count'] == 1)\n\t\t\t\t{\n\t\t\t\t\t$options[$key]['hidden'] = \"<input type='hidden' name='form_eav_{$option['id']}' value='{$aoption['e_value']}'>\";\n\t\t\t\t\t$options[$key]['value'] = $aoption['e_value'];\n\t\t\t\t\t$options[$key]['select_start'] = '';\n\t\t\t\t\t$options[$key]['select_end'] = '';\n\t\t\t\t\t$options[$key]['label'] = '';\n\t\t\t\t\t$options[$key]['disabled'] = '';\n\t\t\t\t\t$options[$key]['is_hidden'] = true;\n\t\t\t\t\t$a['option'] = '';\n\t\t\t\t}\n\n\t\t\t\tif($options[$key]['count'] > 1)\n\t\t\t\t{\n\t\t\t\t\t$a['option'] = \"<option class='{$css_option}' value='{$aoption['e_value']}' {$options[$key]['disabled']} >{$aoption['e_value']}</option>\";\n\t\t\t\t}\n\n\t\t\t\t$options[$key]['values'][] = $a;\n\t\t\t}\n\t\t}\n\n\t\treturn $options;\n\t}", "public function allFieldsInVirtual()\n {\n //Data\n $productData = $this->loadData('virtual_product', null, array('general_name', 'general_sku'));\n $productSearch = $this->loadData('product_search', array('product_sku' => $productData['general_sku']));\n //Steps\n $this->productHelper()->createProduct($productData, 'virtual');\n //Verifying\n $this->assertMessagePresent('success', 'success_saved_product');\n //Steps\n $this->productHelper()->openProduct($productSearch);\n //Verifying\n $this->productHelper()->verifyProductInfo($productData);\n }", "private function _handle_post()\n {\n $product_service = $this->getServiceLocator()->get('product');\n $sku_service = $this->getServiceLocator()->get('sku');\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost()->toArray();\n $files = $this->getRequest()->getFiles()->toArray();\n $data = array_merge_recursive($data, $files);\n $json_image_data = [];\n\n $task = $data['task'];\n unset($data['task']);\n\n // Perform action based on task\n switch ($task)\n {\n // Saves and updates a product's general information\n case 'create_update':\n\n // Validate form\n $this->create_update_form->setData($data);\n\n if ($this->create_update_form->isValid())\n {\n // Collect data and save\n $valid_data = $this->create_update_form->getData();\n $this->product = $product_service->save($valid_data, $this->product_id);\n EntityManagerSingleton::getInstance()->flush();\n\n // Refresh the page\n return $this->redirect()->toUrl($_SERVER['REDIRECT_URL'] . '?id=' . $this->product->getId());\n }\n break;\n\n // Get option values from option to popuplate sku option value select box\n case 'fetch_option_values':\n\n $option = EntityManagerSingleton::getInstance()->getRepository('Library\\Model\\Product\\Option')->findOneById($data['option_id']);\n $option_value_set = [];\n if (!is_null($option))\n {\n $option_value_rels = $option->getOptionOptionValues();\n if (count($option_value_rels) > 0)\n {\n foreach ($option_value_rels as $option_value_rel)\n {\n $option_value_set[$option_value_rel->getOptionValue()->getId()] = $option_value_rel->getOptionValue()->getName();\n }\n }\n }\n\n return ['error' => false, 'option_values' => $option_value_set];\n break;\n\n // Saves additional photos to product\n case 'add_additional_photos':\n\n $product_id = $data['product_id'];\n unset($data['product_id']);\n\n if (empty($product_id))\n {\n throw new \\Exception(\"A product must first be created before adding additional images to it.\");\n }\n\n // Validate form\n $this->add_images_form->setData(['image' => $data]);\n\n if ($this->add_images_form->isValid())\n {\n // Collect data and save\n $valid_data = $this->add_images_form->getData();\n $this->product = $product_service->addAdditionalImages($valid_data, $product_id);\n }\n\n // Save database changes\n EntityManagerSingleton::getInstance()->flush();\n $image_path = Settings::get('image_path');\n\n // Get additional images to send back to javascript\n $additional_image_rels = $this->product->getProductImages();\n if (count($additional_image_rels) > 0)\n {\n $json_image_data = [];\n foreach ($additional_image_rels as $additional_image_rel)\n {\n $json_image_data[] = [\n 'rel_id' => $additional_image_rel->getId(),\n 'url' => $image_path . '/product_images/' . $additional_image_rel->getImage()->getUrl(),\n 'alt' => $additional_image_rel->getImage()->getAlt(),\n 'title' => $additional_image_rel->getImage()->getTitle(),\n 'sort_order' => $additional_image_rel->getSortOrder()\n ];\n }\n }\n\n // Send info to javascript\n return ['error' => false, 'images' => $json_image_data];\n break;\n\n // Add a video to a product\n case 'add_additional_video':\n\n $product_video = $product_service->addAdditionalVideo($data, $this->product);\n EntityManagerSingleton::getInstance()->flush();\n\n $video_code = <<< EOD\n <div data-rel-id='{$product_video->getId()}' class=\"multi_video inline\">\n {$product_video->getVideo()->getEmbedCode(100, 80)}<br/>\n <a class='remove_video' href=''>[Remove]</a>\n </div>\nEOD;\n\n return ['error' => false, 'video_code' => $video_code];\n break;\n\n // Removes an additional photo\n case 'remove_additional_photo':\n\n $product_service->deleteByIds([$data['rel_id']], new ProductImage());\n EntityManagerSingleton::getInstance()->flush();\n\n return ['error' => false];\n break;\n\n // Removes an additional photo\n case 'remove_additional_video':\n\n $product_service->deleteByIds([$data['rel_id']], new ProductVideo());\n EntityManagerSingleton::getInstance()->flush();\n\n return ['error' => false];\n break;\n\n // Update skus\n case 'update_skus':\n\n // Find product\n $refresh_page = $sku_service->saveToProduct($data, $this->product_id);\n EntityManagerSingleton::getInstance()->flush();\n\n $refresh = $refresh_page == SkuService::FLAG_DONT_REFRESH_PAGE ? false : true;\n\n return ['error' => false, 'refresh' => $refresh];\n break;\n\n // Upload images for products before saving\n case 'upload_images':\n $image_service = $this->getServiceLocator()->get('image');\n $images = $image_service->save($files);\n EntityManagerSingleton::getInstance()->flush();\n\n // Return an array of the image ids and urls\n $image_info = [];\n if (count($images) > 0)\n {\n foreach ($images as $image)\n {\n $image_info[$image->getId()] = $image->getUrl();\n }\n }\n\n return ['error' => false, 'images' => $image_info];\n break;\n\n // Get information to add new sku\n case 'get_new_sku_info':\n\n // Get options\n $options = EntityManagerSingleton::getInstance()->getRepository('Library\\Model\\Product\\Option')->findBy(['id' => $data['options']]);\n $option_values = [];\n if (count($options) > 0)\n {\n foreach ($options as $option)\n {\n if ($option instanceof Option)\n {\n $option_values[$option->getId()][$option->getName()] = [];\n $option_value_rels = $option->getOptionOptionValues();\n foreach ($option_value_rels as $option_value_rel)\n {\n $option_id = $option->getId();\n $option_name = $option->getName();\n\n $option_values[$option_id][$option_name][$option_value_rel->getOptionValue()->getId()] = $option_value_rel->getOptionValue()->getName();\n }\n }\n }\n }\n\n // Get product statuses\n $statuses = [];\n $product_statuses = EntityManagerSingleton::getInstance()->getRepository('Library\\Model\\Product\\Status')->findAll();\n if (count($product_statuses) > 0)\n {\n foreach ($product_statuses as $product_status)\n {\n $statuses[$product_status->getId()] = $product_status->getName();\n }\n }\n\n // Create HTML to render to screen\n $print_sku_dialog = $this->getServiceLocator()->get('viewhelpermanager')->get('print_sku_dialog');\n $sku_dialog = $print_sku_dialog(null, $options, $statuses);\n\n return ['error' => false, 'sku_dialog_html' => $sku_dialog];\n break;\n\n // Add a new option value to the option\n case 'add_new_option_value':\n\n $new_value_name = trim($data['value_name']);\n $option = EntityManagerSingleton::getInstance()->getRepository('Library\\Model\\Product\\Option')->findOneById($data['option_id']);\n\n if (!($option instanceof Option))\n {\n throw new \\Exception(\"The option that you're adding a new value to has been removed from the database.\");\n }\n\n // Get option values\n $option_option_values = $option->getOptionOptionValues();\n $option_value = null;\n\n foreach ($option_option_values as $option_option_value)\n {\n if (strtolower($option_option_value->getOptionValue()->getName()) == strtolower($new_value_name))\n {\n $option_value = $option_option_value->getOptionValue();\n break;\n }\n }\n\n // Search for the value by name\n if (!($option_value instanceof OptionValue))\n {\n $is_new = true;\n $option_value = new OptionValue();\n $option_value->setName($new_value_name);\n EntityManagerSingleton::getInstance()->persist($option_value);\n\n // Create a new Option Option Value relationship\n $option_option_value = new OptionOptionValue();\n $option_option_value->setOption($option);\n $option_option_value->setOptionValue($option_value);\n EntityManagerSingleton::getInstance()->persist($option_option_value);\n }\n else\n {\n $is_new = false;\n }\n\n EntityManagerSingleton::getInstance()->flush();\n\n // Send the option value ID back to javascript\n return ['error' => false, 'option_value_id' => $option_value->getId(),\n 'option_value_name' => $option_value->getName(), 'is_new' => $is_new];\n\n break;\n }\n }\n\n return null;\n }", "private function getDataFromVk()\n\t{\n\t\t$apiHelper = new Api\\ApiHelper($this->exportId);\n\t\t$data = false;\n\t\t\n\t\tswitch ($this->type)\n\t\t{\n\t\t\tcase 'ALBUMS':\n\t\t\t\t$data = $apiHelper->getALbumsFromVk($this->getVkGroupId());\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'PRODUCTS':\n\t\t\t\t$data = $apiHelper->getProductsFromVk($this->getVkGroupId());\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function m_brandResults()\n\t{\n\t\t\n\t\tif(empty($this->request['mode']))\n\t\t{\n\t\t\t$this->request['mode']=\"\";\n\t\t}\n\t\n\t\t\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_BRAND_FILE\",$this->brandTemplate);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_GRAPHICSURL\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CURRENCY\",CONST_CURRENCY);\t\n\t\t\n\t\t#SETTING TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_BRAND_FILE\",\"TPL_MAINPRODUCT_BLK\",\"mainproduct_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAINPRODUCT_BLK\",\"TPL_PRODUCT_BLK\",\"product_blk\");\n\t\t#INTIALIZING \n\t\t$this->ObTpl->set_var(\"mainproduct_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"product_blk\",\"\");\n\t\t#********************************************************************\n\t\t\n\t\t\t\t\n\t\t\n\t\n\t\t\n\t\t#TO QUERY PRODUCT TABLE\n\t\t $this->obDb->query = \"SELECT * FROM \".PRODUCTS.\" as p, \".FUSIONS.\" as f WHERE \";\n\t\t $this->obDb->query .=\"(p.iVendorid_FK = '\".$this->request['mode'].\"' and f.iState = '1' and p.iProdid_PK = f.iSubId_FK and f.vtype = 'product' ) group by p.iProdid_PK\";\n\t\t $row_product = $this->obDb->fetchQuery();\n\t\t $prodCount=$this->obDb->record_count;\n\t\n\t\t\n\t\t$this->totalRecords+=$prodCount;\n\t\tif($prodCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$prodCount;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ONSALE\",\"\");\n\t\t\t\tif($row_product[$i]->iSale ==1)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ONSALE\",\"On Sale\");\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$productUrl=SITE_URL.\"ecom/index.php?action=ecom.pdetails&mode=\".$row_product[$i]->vSeoTitle;\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRODUCTURL\",$this->libFunc->m_safeUrl($productUrl));\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$this->libFunc->m_displayContent($row_product[$i]->iProdid_PK));\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($row_product[$i]->vTitle));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_DESC\",$this->libFunc->m_displayContent($row_product[$i]->tShortDescription));\n\n\t\t\t\t##OVERALL PRODUCT STAR RANKING\t\n\t\t\t\t\t$this->obDb->query = \"SELECT SUM(vRank) as total, COUNT(iItemid_FK) as reviewcount FROM \".REVIEWS.\" WHERE iItemid_FK ='\".$row_product[$i]->iProdid_PK.\"'\";\n\t\t\t\t\t$OverallReviewRating = $this->obDb->fetchQuery();\n\t\t\t\t\t$ReviewRating = $OverallReviewRating[0]->total / $OverallReviewRating[0]->reviewcount;\n\t\t\t\t\t$ReviewRating = number_format($ReviewRating , 0, '.', '');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_REVIEWCOUNT\", $OverallReviewRating[0]->reviewcount.\" reviews\");\t\t\t\n\t\t\t\t\tswitch ($ReviewRating)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating0\\\" />Rating: 0/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"1\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating1\\\" />Rating: 1/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"2\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating2\\\" />Rating: 2/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"3\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating3\\\" />Rating: 3/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"4\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating4\\\" />Rating: 4/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"5\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating5\\\" />Rating: 5/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"6\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating6\\\" />Rating: 6/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"7\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating7\\\" />Rating: 7/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"8\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating8\\\" />Rating: 8/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"9\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating9\\\" />Rating: 9/10</p>\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"10\":\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OVERALLRANK\", \"<p class=\\\"review rating10\\\" />Rating: 10/10</p>\");\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($row_product[$i]->iTaxable==1)\n\t\t\t\t{\n\t\t\t\t\t#GETTING VAT PRICE\n\t\t\t\t\t$vatPercent=$this->libFunc->m_vatCalculate();\n\t\t\t\t\t$vatPrice=number_format((($vatPercent*$row_product[$i]->fPrice)/100+$row_product[$i]->fPrice),2);\n\t\t\t\t\tif(INC_VAT_FLAG == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (INC_VAT==1) {\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICEMAIN\",number_format($row_product[0]->fPrice,2).\" (\".CONST_CURRENCY.$vatPrice.\" inc. \".VAT_TAX_TEXT.\")\");\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$this->libFunc->m_displayContent($row_product[$i]->fPrice).\" (\".CONST_CURRENCY.$vatPrice.\" inc. \".VAT_TAX_TEXT.\")\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICEMAIN\",$vatPrice.\" inc. \".VAT_TAX_TEXT);\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$vatPrice.\" inc. \".VAT_TAX_TEXT);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (INC_VAT==1) {\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICEMAIN\",number_format($row_product[0]->fPrice,2).\" (\".CONST_CURRENCY.$vatPrice.\")\");\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$this->libFunc->m_displayContent($row_product[$i]->fPrice).\" (\".CONST_CURRENCY.$vatPrice.\")\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICEMAIN\",$vatPrice);\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$vatPrice);\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PRICE\",$this->libFunc->m_displayContent($row_product[$i]->fPrice));\n\t\t\t\t}\n\n\t\t\t\tif(!empty($row_product[$i]->vImage1))\n\t\t\t\t{\n\t\t\t\t\t$img=$this->libFunc->m_checkFile($row_product[$i]->vImage1,\"product\",$this->libFunc->m_displayContent($row_product[$i]->vTitle));\n\t\t\t\t\tif($img)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMG\",$img);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMG\",MSG_NOIMG);\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$this->ObTpl->set_var(\"TPL_VAR_IMG\",MSG_NOIMG);\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"product_blk\",\"TPL_PRODUCT_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->parse(\"mainproduct_blk\",\"TPL_MAINPRODUCT_BLK\",true);\n\t\t}\n\t\t\n\t\tif($this->totalRecords==0)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOTALRECORDS\",MSG_NO_SEARCHRESULT);\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOTALRECORDS\",$this->totalRecords.\" Records Found\");\t\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_BRAND_FILE\"));\n\t}", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "function phpkd_vblvb_build()\n{\n\trequire_once(DIR . '/includes/adminfunctions_options.php');\n\n\tglobal $vbulletin;\n\n\t$vbulletin->phpkd_vblvb = array();\n\t$settings = $vbulletin->db->query_read(\"SELECT varname, value, datatype FROM \" . TABLE_PREFIX . \"phpkd_vblvb_setting\");\n\n\twhile ($setting = $vbulletin->db->fetch_array($settings))\n\t{\n\t\t$vbulletin->phpkd_vblvb[\"$setting[varname]\"] = phpkd_vblvb_validate_value($setting['value'], $setting['datatype'], true, false);\n\t}\n\n\tbuild_datastore('phpkd_vblvb', serialize($vbulletin->phpkd_vblvb), 1);\n\n\treturn $vbulletin->phpkd_vblvb;\n}", "public function getProductsByBrowse()\n {\n $collection = new AjaxModel();\n $products = $this->checkCategoryType();\n if($_POST['stock'] == 'true') {\n $allProducts = $collection->getProductsInStock($products);\n } else {\n $allProducts = $collection->getProductsByCategory($products);\n }\n\n foreach ($allProducts as $item) {\n //colon delimiter for each cell, bar delimiter for each row\n echo $item[0].\":\".$item[1].\":\".$item[2].\":\".$item[3].\"|\";\n }\n }", "public function getProductSaveInfo($product, $data) {\n $product->setColor ( $data [11] );\n $product->setCost ( $data [12] );\n $product->setCountry ( $data [13] );\n $product->setCountryOfManufacture ( $data [14] );\n $product->setCreatedAt ( $data [15] );\n $product->setDescription ( $data [20] );\n $product->setEnableGooglecheckout ( $data [21] );\n $product->setGallery ( $data [22] );\n $product->setGiftMessageAvailable ( $data [23] );\n $product->setHasOptions ( $data [24] );\n $product->setHostemail ( $data [25] );\n $product->setHouserule ( $data [26] );\n $product->setImage ( $data [27] );\n $product->setImageLabel ( $data [28] );\n $product->setMediaGallery ( $data [30] );\n $product->setMinimalPrice ( $data [34] );\n $product->setMsrp ( $data [35] );\n $product->setMsrpDisplayActualPriceType ( $data [36] );\n $product->setMsrpEnabled ( $data [37] );\n $product->setName ( $data [38] );\n $product->setNewsFromDate ( strtotime ( $data [39] ) );\n $product->setNewsToDate ( '' );\n if (isset ( $data [41] )) {\n $product->setOptionsContainer ( $data [41] );\n }\n if (isset ( $data [43] )) {\n $product->setPrice ( $data [43] );\n }\n if (isset ( $data [44] )) {\n $product->setPrivacy ( $data [44] );\n }\n if (isset ( $data [45] )) {\n $product->setPropertyadd ( $data [45] );\n }\n if (isset ( $data [46] )) {\n $product->setPropertytype ( $data [46] );\n }\n if (isset ( $data [47] )) {\n $product->setPropertyWebsite ( $data [47] );\n }\n if (isset ( $data [48] )) {\n $product->setRequiredOptions ( $data [48] );\n }\n if (isset ( $data [49] )) {\n $product->setShortDescription ( $data [49] );\n }\n if (isset ( $data [50] )) {\n $product->setSmallImage ( $data [50] );\n }\n if (isset ( $data [51] )) {\n $product->setSmallImageLabel ( $data [51] );\n }\n if (isset ( $data [52] )) {\n $product->setSpecialFromDate ( $data [52] );\n }\n if (isset ( $data [53] )) {\n $product->setSpecialPrice ( $data [53] );\n }\n if (isset ( $data [54] )) {\n $product->setSpecialToDate ( $data [54] );\n }\n if (isset ( $data [55] )) {\n $product->setStatus ( $data [55] );\n }\n if (isset ( $data [56] )) {\n $product->setTaxClassId ( $data [56] );\n }\n if (isset ( $data [57] )) {\n $product->setThumbnail ( $data [57] );\n } \n return $product;\n }", "public function processingDataUploadProv($file, $timestamp){\n $counter = 0; \n $x = sizeof($file) - 2;\n $ref = $file[$x];\n $ref_zpdrb = explode(\",\", $ref);\n $zpdrb_b = $ref_zpdrb[7];\n $zpdrb_k = $ref_zpdrb[8];\n foreach($file as $data){\n if ($counter !=0){\n $modelnew = new PdrbProv;\n $hasil = explode(\",\",$data);\n $share_b = PdrbProv::getDistPerB($zpdrb_b, $hasil[7]);\n $share_k = PdrbProv::getDistPerK($zpdrb_k, $hasil[8]);\n $ind_imp = PdrbProv::getIndImp($hasil[7], $hasil[8]);\n $modelnew->id_prov = $hasil[0];\n $modelnew->id_pdrb = $hasil[1];\n $modelnew->tahun_dasar = $hasil[2];\n $modelnew->tahun = $hasil[3];\n $modelnew->triwulan = $hasil[4];\n $modelnew->putaran = $hasil[5];\n $modelnew->revisi = $hasil[6];\n $modelnew->pdrb_b = $hasil[7];\n $modelnew->pdrb_k = $hasil[8];\n $modelnew->share_b = $share_b;\n $modelnew->share_k = $share_k;\n $modelnew->implisit = $ind_imp;\n $ref_q = PdrbProv::getReferensiQ($hasil[0], $hasil[3], $hasil[4]);\n $ref_y = PdrbProv::getReferensiY($hasil[0], $hasil[3], $hasil[4]);\n $ref_c_0 = PdrbProv::getReferensiC($hasil[0], $hasil[3]-1, $hasil[4]);\n $ref_c = PdrbProv::getReferensiC($hasil[0], $hasil[3], $hasil[4]-1);\n \n if ($ref_q){\n $laju_p_q = PdrbProv::getLajuPQ($hasil[0], $hasil[1], $ref_q, (float)$hasil[8]);\n $laju_imp_q = PdrbProv::getLajuImpQ($hasil[0], $hasil[1], $ref_q, $ind_imp); \n $modelnew->laju_p_q = $laju_p_q;\n $modelnew->laju_imp_q = $laju_imp_q;\n } \n if($ref_y){\n \n $laju_p_y = PdrbProv::getLajuPY($hasil[0], $hasil[1], $ref_y, (float)$hasil[8]);\n $laju_imp_y = PdrbProv::getLajuImpY($hasil[0], $hasil[1], $ref_y, $ind_imp);\n $modelnew->laju_p_y = $laju_p_y;\n $modelnew->laju_imp_y = $laju_p_y;\n }\n if($ref_q && $ref_y){\n if($hasil[4]>1){\n $laju_p_c = PdrbProv::getLajuPC($hasil[0], $hasil[1], $ref_c, $ref_c_0, (float)$hasil[8], $hasil[4]);\n $laju_imp_c = PdrbProv::getLajuImpC($hasil[0], $hasil[1], $ref_c, $ref_c_0, $ind_imp, $hasil[4]);\n } else {\n $laju_p_c = $laju_p_y;\n $laju_imp_c = $laju_imp_y;\n }\n $modelnew->laju_p_c = $laju_p_c;\n $modelnew->laju_imp_c = $laju_imp_c;\n }\n if($model->triwulan == 1){\n if($model->laju_p_y){\n $modelnew->laju_p_c = $model->laju_p_y;\n }\n }\n if($hasil[0] == '0100'){\n $total_adhb = PdrbProv::getTotalADHBProv($hasil[1], $hasil[3], $hasil[4]);\n $total_adhk = PdrbProv::getTotalADHKProv($hasil[1], $hasil[3], $hasil[4]);\n if($hasil[7] == 0 ||$hasil[7] == null){\n $modelnew->diskrepansi_b = null;\n } else {\n $diskrepansi_b = ((float)$total_adhb / (float)$hasil[7] *100) - 100;\n $modelnew->diskrepansi_b = $diskrepansi_b;\n }\n if($hasil[8] != 0 || $hasil[8] != null){\n $modelnew->diskrepansi_k = null;\n } else{\n $diskrepansi_k = ((float)$total_adhk / (float)$hasil[8] *100)- 100;\n $modelnew->diskrepansi_k = $diskrepansi_k;\n }\n } else if ($hasil[0] != '0100') {\n $modelnew->diskrepansi_b = null;\n $modelnew->diskrepansi_k = null;\n }\n \n if($hasil[1] === 'ZPDRB' || $hasil[1] === 'ZPDRBTP'){\n if ( abs($modelnew->diskrepansi_b) > 2 \n || abs($modelnew->diskrepansi_k) > 2 \n || abs($modelnew->share_b) > 10 \n || abs($modelnew->share_k) > 10 \n || abs($modelnew->laju_p_q) > 10 \n || abs($modelnew->laju_imp_q) > 10){\n $modelnew->flag = 1;\n $modelnew->status = \"rekon\";\n } else {\n $modelnew->flag = 0;\n }\n }\n else if($hasil[1] !== 'ZPDRB' || $hasil[1] !== 'ZPDRBTP'){\n if ( abs($modelnew->diskrepansi_b) > 5 \n || abs($modelnew->diskrepansi_k) > 5\n || abs($modelnew->share_b) > 10 \n || abs($modelnew->share_k) > 10 \n || abs($modelnew->laju_p_q) > 10 \n || abs($modelnew->laju_imp_q) > 10){\n $modelnew->flag = 1;\n $modelnew->status = \"rekon\";\n } else {\n $modelnew->flag = 0;\n }\n }\n if ($timestamp){\n $modelnew->timestamp= $timestamp;\n }\n $modelnew->save();\n }\n $counter++;\n }\n }", "public function execute()\n {\n \n $session = $this->_objectManager->get('Magento\\Customer\\Model\\Session');\n $storeId=$session->getTestKey();\n $jsHelper = $this->_objectManager->get('Magento\\Backend\\Helper\\Js');\n $data=$this->getRequest()->getPost()->toarray();\n $entityIds=$jsHelper->decodeGridSerializedInput($data['links']['newproduct']);\n if (!is_array($entityIds) || empty($entityIds)) {\n $this->messageManager->addError(__('Please select product(s).'));\n $this->_redirect('*/*/new');\n } else {\n /**display the selected product and save it in database in custom_product_collection table **/\n $records=$this->_collection->getData();\n $entityId_str= implode(\",\", $entityIds);\n $all_store=$this->_objectManager->create('\\Magento\\Store\\Api\\StoreRepositoryInterface')->getList();\n \n $customcollection= $this->_objectManager->get('Magebees\\Newproduct\\Model\\Customcollection')->getCollection()->getData();\n foreach ($all_store as $store) {\n $store_id=$store->getId();\n $store_ids[]=$store_id;\n }\n \n if ($customcollection) {\n foreach ($customcollection as $custom) {\n $custom_storeids[]=$custom['store_id'];\n }\n if (in_array($storeId, $custom_storeids)) {\n if ($storeId==0) {\n foreach ($all_store as $store) {\n $store_id=$store->getId();\n foreach ($customcollection as $custom) {\n if ($custom['store_id']==$store_id) {\n $id=$custom['id'];\n $entity= explode(\",\", $entityId_str);\n $custom_entity= explode(\",\", $custom['entity_id']);\n $result = array_unique(array_merge($entity, $custom_entity));\n $new_entityId= implode(\",\", $result);\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $new_entityId);\n $data->setData('store_id', $store_id);\n $data->setData('id', $id);\n $data->save();\n }\n }\n if (!in_array($store_id, $custom_storeids)) {\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $entityId_str);\n $data->setData('store_id', $store_id);\n $data->save();\n }\n }\n } else {\n $store_arr=[0,$storeId];\n foreach ($store_arr as $store) {\n foreach ($customcollection as $custom) {\n if ($custom['store_id']==$store) {\n $id=$custom['id'];\n if ($store==0) {\n $entity= explode(\",\", $entityId_str);\n $custom_entity= explode(\",\", $custom['entity_id']);\n $result = array_unique(array_merge($entity, $custom_entity));\n $new_entityId= implode(\",\", $result);\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $new_entityId);\n $data->setData('store_id', $store);\n $data->setData('id', $id);\n $data->save();\n } else {\n $new_entityId=$entityId_str.\",\".$custom['entity_id'];\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $new_entityId);\n $data->setData('store_id', $store);\n $data->setData('id', $id);\n $data->save();\n }\n }\n }\n }\n }\n } else {\n if ($storeId==0) {\n foreach ($all_store as $store) {\n $store_id=$store->getId();\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $entityId_str);\n $data->setData('store_id', $store_id);\n $data->save();\n }\n } else {\n $store_arr=[0,$storeId];\n foreach ($store_arr as $store) {\n foreach ($customcollection as $custom) {\n if ($custom['store_id']==$store) {\n $id=$custom['id'];\n if ($store==0) {\n $entity= explode(\",\", $entityId_str);\n $custom_entity= explode(\",\", $custom['entity_id']);\n $result = array_unique(array_merge($entity, $custom_entity));\n $new_entityId= implode(\",\", $result);\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $new_entityId);\n $data->setData('store_id', $store);\n $data->setData('id', $id);\n $data->save();\n }\n }\n }\n if (!in_array($store, $custom_storeids)) {\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $entityId_str);\n $data->setData('store_id', $store);\n $data->save();\n }\n }\n }\n }\n } else {\n if ($storeId==0) {\n foreach ($all_store as $store) {\n $store_id=$store->getId();\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $entityId_str);\n $data->setData('store_id', $store_id);\n $data->save();\n }\n } else {\n $store_arr=[0,$storeId];\n foreach ($store_arr as $store) {\n $data=$this->_objectManager->create('Magebees\\Newproduct\\Model\\Customcollection');\n $data->setData('entity_id', $entityId_str);\n $data->setData('store_id', $store);\n $data->save();\n }\n }\n }\n \n $this->_redirect('*/*/');\n }\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function processSave() {\n\t\t\t//set == 0 for edit existing product\n\t\t\t//when produc has been added then by deafult its not active\n\t\t\tglobal $currentIndex;\n\t\t\t$currentindex = $currentIndex;\n\t\t\t\n\t\t\t$is_proceess = Tools::getValue('set');\n\t\t\t\n\t\t\t$product_name = Tools::getValue('product_name');\n\t\t\t$product_price = Tools::getValue('product_price');\n\t\t\t$product_quantity = Tools::getValue('product_quantity');\n\t\t\t$product_description = Tools::getValue('product_description');\n\t\t\t$product_category = Tools::getValue('product_category');\n\t\t\t$short_description = Tools::getValue('short_description');\n\t\t\t\n\t\t\tif($product_name=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product name is requried field.');\n\t\t\t} else {\n\t\t\t\t$is_valid_name = Validate::isGenericName($product_name);\n\t\t\t\tif(!$is_valid_name) {\n\t\t\t\t\t$this->errors[] = Tools::displayError($this->l('Product name must not have Invalid characters <>;=#{}'));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($product_price=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product price is requried field.');\n\t\t\t} else {\n\t\t\t\tif(!is_numeric($product_price)) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product price is should be numeric.');\n\t\t\t\t} else if($product_price<=0) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product price is should be greater than 0.');\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif($product_quantity=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product quantity requried field.');\n\t\t\t} else {\n\t\t\t\t$product_quantity = (int)$product_quantity;\n\t\t\t\tif(!is_int($product_quantity)) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product quantity should be integer.'.$product_quantity);\n\t\t\t\t} else if($product_quantity<=0) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product quantity should be greater than 0.');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($product_category == false){\n\t\t\t\t$this->errors[] = Tools::displayError('Please select atleast one category.');\n\t\t\t}\n\t\t\t\n\t\t\tif($is_proceess==1) {\n\t\t\t\tif (empty($this->errors)) {\n\t\t\t\t\t$customer_id = Tools::getValue('shop_customer');\n\t\t\t\t\t$obj_seller_product = new SellerProductDetail();\n\t\t\t\t\t$obj_mp_shop = new MarketplaceShop();\n\t\t\t\t\t$marketplace_shop = $obj_mp_shop->getMarketPlaceShopInfoByCustomerId($customer_id);\n\t\t\t\t\t\n\t\t\t\t\t$id_shop = $marketplace_shop['id'];\n\t\t\t\t\t$id_seller = MarketplaceShop::findMpSellerIdByShopId($id_shop);\n\t\t\t\t\t\n\t\t\t\t\t$obj_seller_product->id_seller = $id_seller;\n\t\t\t\t\t$obj_seller_product->price = $product_price;\n\t\t\t\t\t$obj_seller_product->quantity = $product_quantity;\n\t\t\t\t\t$obj_seller_product->product_name = $product_name;\n\t\t\t\t\t$obj_seller_product->description = $product_description;\n\t\t\t\t\t$obj_seller_product->short_description = $short_description;\n\t\t\t\t\t$obj_seller_product->id_category = $product_category[0];\n\t\t\t\t\t$obj_seller_product->ps_id_shop = $this->context->shop->id;\n\t\t\t\t\t$obj_seller_product->id_shop = $id_shop;\n\t\t\t\t\t$obj_seller_product->save();\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t$seller_product_id = $obj_seller_product->id;\n\t\t\t\t\t\n\t\t\t\t\t//Add into category table\n\t\t\t\t\t$obj_seller_product_category = new SellerProductCategory();\n\t\t\t\t\t$obj_seller_product_category->id_seller_product = $seller_product_id;\n\t\t\t\t\t$obj_seller_product_category->is_default = 1;\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($product_category as $p_category){\n\t\t\t\t\t\t$obj_seller_product_category->id_category = $p_category;\n\t\t\t\t\t\tif($i != 0)\n\t\t\t\t\t\t\t$obj_seller_product_category->is_default = 0;\n\t\t\t\t\t\t$obj_seller_product_category->add();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//Close\n\t\t\t\t\t\n\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\n\t\t\t\t\tif(isset($_FILES['product_image'])) {\n\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t$characters= \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t$u_id= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($p=0;$p<$length;$p++) {\n\t\t\t\t\t\t\t$u_id= $u_id.$characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES['product_image']['size']>0) {\n\t\t\t\t\t\t\t$result1 = Db::getInstance()->insert(\n\t\t\t\t\t\t\t\t\t\t\t\t'marketplace_product_image', array(\n\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' => (int) $seller_product_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' => pSQL($u_id)\n\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t$image_name = $u_id . \".jpg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"],$address.$image_name);\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\tif(isset($_FILES['images'])) {\n\t\t\t\t\t\t$other_images = $_FILES[\"images\"]['tmp_name'];\n\t\t\t\t\t\t$count = count($other_images);\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t$u_other_id = \"\";\n\t\t\t\t\t\tfor ($p = 0; $p < $length; $p++) {\n\t\t\t\t\t\t\t$u_other_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$result2 = Db::getInstance()->insert('marketplace_product_image', array(\n\t\t\t\t\t\t\t'seller_product_id' => (int) $seller_product_id,\n\t\t\t\t\t\t\t'seller_product_image_id' => pSQL($u_other_id)\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$image_name = $u_other_id . \".jpg\";\n\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\tmove_uploaded_file($other_images[$i], $address . $image_name);\n\t\t\t\t\t}\n\t\t\t\t\tHook::exec('actionAddproductExtrafield', array('marketplace_product_id' => $seller_product_id));\n\t\t\t\t\tTools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token);\n\t\t\t\t} else {\n\t\t\t\t\t$this->display = 'add';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (empty($this->errors)) {\n\t\t\t\t\t$id = Tools::getValue('market_place_product_id');\n\t\t\t\t\t$obj_seller_product = new SellerProductDetail($id);\n\t\t\t\t\t\n\t\t\t\t\t$obj_seller_product->price = $product_price;\n\t\t\t\t\t$obj_seller_product->quantity = $product_quantity;\n\t\t\t\t\t$obj_seller_product->product_name = $product_name;\n\t\t\t\t\t$obj_seller_product->description = $product_description;\n\t\t\t\t\t$obj_seller_product->short_description = $short_description;\n\t\t\t\t\t$obj_seller_product->id_category = $product_category[0];\n\t\t\t\t\t//save category\n\t\t\t\t\t$obj_seller_product->save();\n\n\t\t\t\t\t//Update new categories\n\t\t\t\t\tDb::getInstance()->delete('marketplace_seller_product_category','id_seller_product = '.$id); //Delete previous\n\t\t\t\t\t//Add new category into table\n\t\t\t\t\t$obj_seller_product_category = new SellerProductCategory();\n\t\t\t\t\t$obj_seller_product_category->id_seller_product = $id;\n\t\t\t\t\t$obj_seller_product_category->is_default = 1;\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($product_category as $p_category){\n\t\t\t\t\t\t$obj_seller_product_category->id_category = $p_category;\n\t\t\t\t\t\tif($i != 0)\n\t\t\t\t\t\t\t$obj_seller_product_category->is_default = 0;\n\t\t\t\t\t\t$obj_seller_product_category->add();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//Update Close\n\t\t\t\t\t\n\t\t\t\t\t$is_active = $obj_seller_product->active;\n\t\t\t\t\t\n\t\t\t\t\tif($is_active == 1){\n\t\t\t\t\t\t$obj_mpshop_pro = new MarketplaceShopProduct();\n\t\t\t\t\t\t$product_deatil = $obj_mpshop_pro->findMainProductIdByMppId($id);\n\t\t\t\t\t\t$main_product_id = $product_deatil['id_product'];\n\t\t\t\t\t\tif(isset($_FILES['product_image']) && $_FILES['product_image'][\"tmp_name\"]!='') {\n\t\t\t\t\t\t\t$seller_product_image=$_FILES['product_image'];\n\t\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t\t$u_id = \"\"; \n\t\t\t\t\t\t\tfor ($p =0;$p<$length;$p++) {\n\t\t\t\t\t\t\t\t$u_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$image_name =$u_id.\".jpg\";\n\t\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (move_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"], $address.$image_name)) {\n\t\t\t\t\t\t\t\t$insert = Db::getInstance()->insert('marketplace_product_image',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' =>(int)$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' =>pSQL($u_id),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'active' =>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$image_dir = '../modules/marketplace/img/product_img';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$is_update = $obj_seller_product->updatePsProductByMarketplaceProduct($id, $image_dir,1,$main_product_id);\n\t\t\t\t\t}\n\t\t\t\t\telse if($is_active == 0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($_FILES['product_image']) && $_FILES['product_image'][\"tmp_name\"]!='') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$seller_product_image=$_FILES['product_image'];\n\t\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t\t$u_id = \"\"; \n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tfor ($p =0;$p<$length;$p++) {\n\t\t\t\t\t\t\t\t\t$u_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$image_name =$u_id.\".jpg\";\n\t\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$result1=Db::getInstance()->insert('marketplace_product_image', array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' =>(int)$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' =>pSQL($u_id)\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\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"],$address.$image_name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tHook::exec('actionUpdateproductExtrafield', array('marketplace_product_id' =>Tools::getValue('market_place_product_id')));\n\t\t\t\t\tTools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token);\n\t\t\t\t} else {\n\t\t\t\t\t$this->display = 'edit';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function ProductGroupEdit()\n {\n // loading the prototypes of form fields\n loadCoreFile('html_form.php');\n\n // getting the list of attributes to show\n $settings = modApiFunc('Settings', 'getParamListByGroup',\n 'PRODUCT_GROUP_EDIT', SETTINGS_WITH_DESCRIPTION);\n $this -> _attrs = array('ID' => 'YES');\n if (is_array($settings))\n foreach($settings as $v)\n {\n if ($v['param_name'] == 'CTL_PGE_TABULATION')\n $this -> _tabbing = $v['param_current_value'];\n elseif ($v['param_current_value'] == 'YES')\n $this -> _attrs[$v['param_name']] = 'YES';\n }\n\n // initializing the template filler\n $this -> mTmplFiller = new TmplFiller();\n\n // filling the headermap\n $this -> _headermap = array(\n 'ID' => 'PRD_ID_NAME',\n 'CTL_PGE_NAME' => 'PRD_NAME_NAME',\n 'CTL_PGE_SALEPRC' => 'PRD_SALEPRC_NAME',\n 'CTL_PGE_LISTPRC' => 'PRD_LISTPRC_NAME',\n 'CTL_PGE_QUINSTOCK' => 'PRD_QUINSTOCK_NAME',\n 'CTL_PGE_LOWLEV' => 'PRD_LOWLEV_NAME',\n 'CTL_PGE_SKU' => 'PRD_SKU_NAME',\n 'CTL_PGE_QUINORDER' => 'PRD_QUINORDER_NAME',\n 'CTL_PGE_AVAIL' => 'PRD_AVAIL_NAME',\n 'CTL_PGE_TAXCLASS' => 'PRD_TAX_CLASS_NAME',\n 'CTL_PGE_MANUFACTURER' => 'PRD_MANUFACTURER_NAME',\n 'CTL_PGE_SHIPPRC' => 'PRD_SHIPPRC_NAME',\n 'CTL_PGE_HANDPRC' => 'PRD_HANDRC_NAME',\n 'CTL_PGE_WEIGHT' => 'PRD_WEIGHT_NAME',\n 'CTL_PGE_FREESHIP' => 'PRD_FREESHIP_NAME',\n 'CTL_PGE_NEEDSHIP' => 'PRD_NEEDSHIP_NAME',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'PRD_CUSTOMER_REVIEWS_NAME'\n );\n\n // filling the attribute map\n $this -> _attrmap = array(\n 'ID' => 'ID',\n 'CTL_PGE_NAME' => 'Name',\n 'CTL_PGE_SALEPRC' => 'SalePrice',\n 'CTL_PGE_LISTPRC' => 'ListPrice',\n 'CTL_PGE_QUINSTOCK' => 'QuantityInStock',\n 'CTL_PGE_LOWLEV' => 'LowStockLevel',\n 'CTL_PGE_SKU' => 'SKU',\n 'CTL_PGE_QUINORDER' => 'MinQuantity',\n 'CTL_PGE_AVAIL' => 'Available',\n 'CTL_PGE_TAXCLASS' => 'TaxClass',\n 'CTL_PGE_MANUFACTURER' => 'Manufacturer',\n 'CTL_PGE_SHIPPRC' => 'PerItemShippingCost',\n 'CTL_PGE_HANDPRC' => 'PerItemHandlingCost',\n 'CTL_PGE_WEIGHT' => 'Weight',\n 'CTL_PGE_FREESHIP' => 'FreeShipping',\n 'CTL_PGE_NEEDSHIP' => 'NeedShipping',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'CustomerReviews'\n );\n }", "public static function getProductFormData() {\n $result = lC_Products_Admin::getProductFormData($_GET['pid']);\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n\n echo json_encode($result);\n }", "abstract protected function prepareVendorProductData(int $vendorProductId);", "abstract protected function prepareVendorProductData(int $vendorProductId);", "public function bajaRecordFromProcedure($store_call = \"\"){\n $xuuid = $this->generateUuid(); //id de transaccion unico a guardar en cada tabla \n $store_call = str_replace(\":data\", \"data\", str_replace(\"xuuid\", $xuuid, $store_call));\n return $this->exeProcedure($store_call);\n\t}", "public function attachProductData($data) {\n\t\t\n\t\tif (isset($data['CartItem'])) {\n\t\t\t\n\t\t\t$productIDs = Set::extract('CartItem.{n}.product_id', $data);\n\t\t\t$conditionsForProduct = array(\n\t\t\t\t\t// Product Data\t\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Product.visible' =>true,\n\t\t\t\t\t\t'Product.id' \t =>$productIDs,\n\t\t\t\t\t),\n\t\t\t\t\t'contain' => array(\n\t\t\t\t\t\t'ProductImage'=>array(\n\t\t\t\t\t\t 'fields' => array('filename'),\n\t\t\t\t\t\t 'order'=>array(\n\t\t\t\t\t\t\t\t'ProductImage.cover DESC')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\t'Variant' => array(\n\t\t\t\t\t\t\t'order'=>'Variant.order ASC',\n\t\t\t\t\t\t\t'VariantOption' => array(\n\t\t\t\t\t\t\t\t'fields' => array('id', 'value', 'field', 'variant_id'),\n\t\t\t\t\t\t\t\t'order' => 'VariantOption.order ASC',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\t'ProductsInGroup'=>array(\n\t\t\t\t\t\t 'fields' => array(\n\t\t\t\t\t\t\t\t'id',\n\t\t\t\t\t\t\t\t'product_id'),\n\t\t\t\t\t\t \n\t\t\t\t\t\t 'ProductGroup'=>array(\n\t\t\t\t\t\t\t 'fields' => array(\n\t\t\t\t\t\t\t\t\t'id', \n\t\t\t\t\t\t\t\t\t'title', 'handle',\n\t\t\t\t\t\t\t\t\t'description', 'visible_product_count',\n\t\t\t\t\t\t\t\t\t'url', 'vendor_count'),\n\t\t\t\t\t\t )\n\t\t\t\t\t )\n\t\t\t\t ),\n\t\t\t\t\t'link' => array('Vendor'=>array('fields'=>array('id', 'title'))),\n\t\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * $products is in the form of {n}=>array(Product, ProductImage, ProductsInGroup=>array(ProductGroup))\n\t\t\t **/\n\t\t\t$products = $this->Product->find('all', $conditionsForProduct);\n\t\t\t\n\t\t\t$originalIndex = array_keys($data['CartItem']);\n\t\t\t\n\t\t\t// then we use product_id as the index in $products to facilitate the insertion\n\t\t\t$products = Set::combine($products, '{n}.Product.id', '{n}');\n\t\t\t\n\t\t\t// now we insert the Product data\n\t\t\tforeach($data['CartItem'] as $id=>$item) {\n\t\t\t\t$product_id = $item['product_id'];\n\t\t\t\tif (!empty($products[$product_id])) {\n\t\t\t\t\t$data['CartItem'][$id]['Product'] = $products[$product_id]['Product'];\n\t\t\t\t\t$data['CartItem'][$id]['ProductImage'] = $products[$product_id]['ProductImage'];\n\t\t\t\t\t$data['CartItem'][$id]['ProductsInGroup'] = $products[$product_id]['ProductsInGroup'];\n\t\t\t\t\t$data['CartItem'][$id]['Variant']\t= $products[$product_id]['Variant'];\n\t\t\t\t\t$data['CartItem'][$id]['Vendor']\t= $products[$product_id]['Vendor'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// now we put the original index back\n\t\t\t$cartItems = array_values($data['CartItem']);\n\t\t\t$data['CartItem'] = array_combine($originalIndex, $cartItems);\n\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function run()\n {\n\n foreach ($this->array_data() as $arr) {\n\n $data = [\n 'sku' => $arr['sku'],\n 'parent_sku' => $arr['parent_sku'],\n 'active' => $arr['active'],\n 'condition' => $arr['condition'],\n 'name' => $arr['name'],\n 'description' => $arr['description'],\n 'availability_when_no_to_manage_stock' => $arr['availability_when_no_to_manage_stock'],\n 'manage_inventory' => $arr['manage_inventory'],\n 'quantity' => $arr['quantity'],\n 'availability_two_products_in_stock' => $arr['availability_two_products_in_stock'],\n 'availability_when_end_products_in_stock' => $arr['availability_when_end_products_in_stock'],\n 'price_cost' => $arr['price_cost'],\n 'price_for_sale' => $arr['price_for_sale'],\n 'promotional_price' => $arr['promotional_price'],\n 'category_level_1' => $arr['category_level_1'],\n 'category_level_2' => $arr['category_level_2'],\n 'category_level_3' => $arr['category_level_3'],\n 'brand' => $arr['brand'],\n 'peso_kg' => $arr['peso_kg'],\n 'height_cm' => $arr['height_cm'],\n 'width_cm' => $arr['width_cm'],\n 'length_cm' => $arr['length_cm'],\n 'link_to_the_main_photo' => $arr['link_to_the_main_photo'],\n 'link_to_additional_photo_1' => $arr['link_to_additional_photo_1'],\n 'link_to_additional_photo_2' => $arr['link_to_additional_photo_2'],\n 'link_to_additional_photo_3' => $arr['link_to_additional_photo_3'],\n 'url_old_product' => $arr['url_old_product'],\n 'video_link_on_youtube' => $arr['video_link_on_youtube'],\n 'size_of_tenis' => $arr['size_of_tenis'],\n 'product_with_a_color' => $arr['product_with_a_color'],\n 'helmet_size' => $arr['helmet_size'],\n 'size_of_calca' => $arr['size_of_calca'],\n 'product_with_two_colors' => $arr['product_with_two_colors'],\n 'voltage' => $arr['voltage'],\n 'shirt_size' => $arr['shirt_size'],\n 'ring_alliance_size' => $arr['ring_alliance_size'],\n 'genre' => $arr['genre'],\n\n ];\n\n if (ModelExcel::where('sku', '=', $arr['sku'])->count()) {\n $permission = ModelExcel::where('sku', '=', $arr['sku'])->first();\n $permission->update($data);\n } else {\n ModelExcel::create($data);\n }\n\n }\n\n }", "protected function process()\n {\n\n // query whether or not we've found a configurable product\n if ($this->getValue(ColumnKeys::PRODUCT_TYPE) !== ProductTypes::CONFIGURABLE) {\n return;\n }\n\n // query whether or not, we've configurables\n if ($configurableVariations = $this->getValue(ColumnKeys::CONFIGURABLE_VARIATIONS)) {\n // load the variation labels, if available\n $configurableVariationLabels = $this->getValue(ColumnKeys::CONFIGURABLE_VARIATION_LABELS);\n\n // create an array with the variation labels (attribute code as key)\n $varLabels = array();\n\n // explode the variations labels\n if ($variationLabels = $this->explode($configurableVariationLabels)) {\n foreach ($variationLabels as $variationLabel) {\n if (strstr($variationLabel, '=')) {\n list ($key, $value) = $this->explode($variationLabel, '=');\n $varLabels[$key] = $value;\n }\n }\n }\n\n // load the variation positions, if available\n $configurableVariationsPosition = $this->getValue(ColumnKeys::CONFIGURABLE_VARIATIONS_POSITION);\n\n // create an array with the variation labels (attribute code as key)\n $varPositions = array();\n\n // explode the variations labels\n if ($variationPositions = $this->explode($configurableVariationsPosition)) {\n foreach ($variationPositions as $variationPosition) {\n if (strstr($variationPosition, '=')) {\n list ($key, $value) = $this->explode($variationPosition, '=');\n $varPositions[$key] = $value;\n }\n }\n }\n\n // intialize the array for the variations\n $artefacts = array();\n\n // load the parent SKU, the store view code and the attribute set code from the row\n $parentSku = $this->getValue(ColumnKeys::SKU);\n $storeViewCode = $this->getValue(ColumnKeys::STORE_VIEW_CODE);\n $attributeSetCode = $this->getValue(ColumnKeys::ATTRIBUTE_SET_CODE);\n\n // iterate over all variations and import them, e. g. the complete value will look like\n // sku=sku-0-black-55 cm,color=Black,size=55 cm| \\\n // sku=sku-01-black-xs,color=Black,size=XS| \\\n // sku=sku-02-blue-xs,color=Blue,size=XS| \\\n // sku=02-blue-55 cm,color=Blue,size=55 cm\n foreach ($this->explode($configurableVariations, '|') as $variation) {\n // explode the SKU and the configurable attribute values, e. g.\n // sku=sku-0-black-55 cm,color=Black,size=55 cm\n $explodedVariation = $this->explode($variation);\n\n // explode the variations child SKU\n list (, $childSku) = $this->explode(array_shift($explodedVariation), '=');\n\n // iterate over the configurable attribute configuration\n foreach ($explodedVariation as $option) {\n // explode the attributes option code and value\n list ($optionCode, $optionValue) = $this->explode($option, '=');\n\n // load the apropriate variation label\n $varLabel = '';\n if (isset($varLabels[$optionCode])) {\n $varLabel = $varLabels[$optionCode];\n }\n\n // load the apropriate variation position\n $varPosition = null;\n if (isset($varPositions[$optionCode])) {\n $varPosition = $varPositions[$optionCode];\n }\n\n // initialize the product variation itself\n $variation = $this->newArtefact(\n array(\n ColumnKeys::STORE_VIEW_CODE => $storeViewCode,\n ColumnKeys::ATTRIBUTE_SET_CODE => $attributeSetCode,\n ColumnKeys::VARIANT_PARENT_SKU => $parentSku,\n ColumnKeys::VARIANT_CHILD_SKU => $childSku,\n ColumnKeys::VARIANT_ATTRIBUTE_CODE => $optionCode,\n ColumnKeys::VARIANT_OPTION_VALUE => $optionValue,\n ColumnKeys::VARIANT_VARIATION_LABEL => $varLabel,\n ColumnKeys::VARIANT_VARIATION_POSITION => $varPosition\n ),\n array(\n ColumnKeys::STORE_VIEW_CODE => ColumnKeys::STORE_VIEW_CODE,\n ColumnKeys::ATTRIBUTE_SET_CODE => ColumnKeys::ATTRIBUTE_SET_CODE,\n ColumnKeys::VARIANT_PARENT_SKU => ColumnKeys::SKU,\n ColumnKeys::VARIANT_CHILD_SKU => ColumnKeys::CONFIGURABLE_VARIATIONS,\n ColumnKeys::VARIANT_ATTRIBUTE_CODE => ColumnKeys::CONFIGURABLE_VARIATIONS,\n ColumnKeys::VARIANT_OPTION_VALUE => ColumnKeys::CONFIGURABLE_VARIATIONS,\n ColumnKeys::VARIANT_VARIATION_LABEL => ColumnKeys::CONFIGURABLE_VARIATION_LABELS,\n ColumnKeys::VARIANT_VARIATION_POSITION => ColumnKeys::CONFIGURABLE_VARIATIONS_POSITION\n )\n );\n\n // append the product variation\n $artefacts[] = $variation;\n }\n }\n\n // append the variations to the subject\n $this->addArtefacts($artefacts);\n }\n }", "private function _getProcessVars($data)\n{\n\tJModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/models');\n\tJTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/tables');\n\tTienda::load('TiendaHelperCarts', 'helpers.carts');\n\tTienda::load('TiendaHelperCurrency', 'helpers.currency');\n\tTienda::load('TiendaHelperBase', 'helpers._base');\n\t$items = TiendaHelperCarts::getProductsInfo();\n\t$orderTable = JTable::getInstance('Orders', 'TiendaTable');\n\nforeach ($items as $item)\n{\n\t$orderTable->addItem($item);\n}\n\n\t$items = $orderTable->getItems();\n\t$orderTable->calculateTotals();\n\t$amount = $orderTable->order_total;\n\t$currency = TiendaHelperCurrency::getCurrentCurrency();\n\t$currency = TiendaHelperCurrency::load($currency);\n\t$currency_code = $currency->currency_code;\n\t$jinput = JFactory::getApplication()->input;\n\t$component = $jinput->getCmd('option'); \t\n\t$xml = JFactory::getXML(JPATH_SITE.'/administrator/components/com_tienda/manifest.xml');\n\t$comversion=(string)$xml->version;\t\n\t$paymillxml = JFactory::getXML(JPATH_SITE.'/plugins/tienda/payment_paymill/payment_paymill.xml');\t\n\t$pluginversion=(string)$paymillxml->version;\t\n\t$source = $pluginversion.'_'.$component.'_'.$comversion; \n\t$order_id = $data[\"order_id\"];\n\t$params = array(\n\t\t\t'amount' => ($amount * 100), // Amount *100\n\t\t\t'currency' => $currency_code , // ISO 4217\n\t\t\t'token' => $data['token'],\n\t\t\t'description' => 'Order Id: '.$order_id,\n\t\t\t'source' => $source\n\t\t\t);\n\n\treturn $params;\n}", "public function addData()\r\n {\r\n\r\n $this->datecreated = time();\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'stat_productstock (\r\n p_barcode,\r\n sd_value,\r\n sd_month,\r\n sd_year,\r\n day_1,\r\n day_2,\r\n day_3,\r\n day_4,\r\n day_5,\r\n day_6,\r\n day_7,\r\n day_8,\r\n day_9,\r\n day_10,\r\n day_11,\r\n day_12,\r\n day_13,\r\n day_14,\r\n day_15,\r\n day_16,\r\n day_17,\r\n day_18,\r\n day_19,\r\n day_20,\r\n day_21,\r\n day_22,\r\n day_23,\r\n day_24,\r\n day_25,\r\n day_26,\r\n day_27,\r\n day_28,\r\n day_29,\r\n day_30,\r\n day_31,\r\n sd_datecreated,\r\n sd_datemodified\r\n )\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n $rowCount = $this->db3->query($sql, array(\r\n (string)$this->pbarcode,\r\n (string)$this->value,\r\n (int)$this->month,\r\n (int)$this->year,\r\n (string)$this->day_1,\r\n (string)$this->day_2,\r\n (string)$this->day_3,\r\n (string)$this->day_4,\r\n (string)$this->day_5,\r\n (string)$this->day_6,\r\n (string)$this->day_7,\r\n (string)$this->day_8,\r\n (string)$this->day_9,\r\n (string)$this->day_10,\r\n (string)$this->day_11,\r\n (string)$this->day_12,\r\n (string)$this->day_13,\r\n (string)$this->day_14,\r\n (string)$this->day_15,\r\n (string)$this->day_16,\r\n (string)$this->day_17,\r\n (string)$this->day_18,\r\n (string)$this->day_19,\r\n (string)$this->day_20,\r\n (string)$this->day_21,\r\n (string)$this->day_22,\r\n (string)$this->day_23,\r\n (string)$this->day_24,\r\n (string)$this->day_25,\r\n (string)$this->day_26,\r\n (string)$this->day_27,\r\n (string)$this->day_28,\r\n (string)$this->day_29,\r\n (string)$this->day_30,\r\n (string)$this->day_31,\r\n (int)$this->datecreated,\r\n (int)$this->datemodified\r\n ))->rowCount();\r\n\r\n $this->id = $this->db3->lastInsertId();\r\n return $this->id;\r\n }", "function key_tag_process($data)\n\t {\n\t $key_tag_arr = $this->get_keyphrases($data);\n\t \n\t $cate_data_arr = $this->get_keytagid_data($key_tag_arr);\n\t $this->key_tagid_db_save(array('key_id'=>$cate_data_arr,'node_id'=>$data['nId']));\n\t \n\t $key_id_arr = $this->get_tagid_from_cate($cate_data_arr);\n\t $this->key_tag_frequence_update($key_id_arr);\n\t \n\t return $key_tag_arr;\n\t }", "public function send_vb_data_to_atomv2 ($vars = array());", "function dbInstall($data) {\r\n/*\r\nproducts - Products\r\nproduct_categories - Categories\r\nshopping_list_items - Shopping List\r\n*/\r\n $data = <<<EOD\r\n\r\n products: ID int(10) unsigned NOT NULL auto_increment\r\n products: TITLE varchar(255) NOT NULL DEFAULT ''\r\n products: CATEGORY_ID int(10) NOT NULL DEFAULT '0'\r\n products: IMAGE varchar(70) NOT NULL DEFAULT ''\r\n products: WILL_EXPIRE int(3) NOT NULL DEFAULT '0'\r\n products: EXPIRE_DATE date\r\n products: EXPIRE_DEFAULT int(10) NOT NULL DEFAULT '0'\r\n products: UPDATED datetime\r\n products: QTY int(10) NOT NULL DEFAULT '0'\r\n products: MIN_QTY int(10) NOT NULL DEFAULT '0'\r\n products: DETAILS text\r\n products: DEFAULT_PRICE float DEFAULT '0' NOT NULL\r\n\r\n product_categories: ID int(10) unsigned NOT NULL auto_increment\r\n product_categories: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_categories: PRIORITY int(10) NOT NULL DEFAULT '0'\r\n product_categories: PARENT_ID int(10) NOT NULL DEFAULT '0'\r\n product_categories: SUB_LIST text\r\n product_categories: PARENT_LIST text\r\n\r\n shopping_list_items: ID int(10) unsigned NOT NULL auto_increment\r\n shopping_list_items: TITLE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n shopping_list_items: PRICE float DEFAULT '0' NOT NULL\r\n shopping_list_items: CODE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: IN_CART int(3) NOT NULL DEFAULT '0'\r\n\r\n product_log: ID int(10) unsigned NOT NULL auto_increment\r\n product_log: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_log: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: CODE_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: QTY int(10) NOT NULL DEFAULT '0'\r\n product_log: ACTION char(10) NOT NULL DEFAULT ''\r\n product_log: UPDATED datetime\r\n\r\n product_codes: ID int(10) unsigned NOT NULL auto_increment\r\n product_codes: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: CODE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n\r\n\r\nEOD;\r\n parent::dbInstall($data);\r\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function updateUserProductByProId($array_product = array()){\n \t\t global $myuser, $admin_id, $arrayBranch, $array_unit, $class_import_export;\n if($this->check_id()){\n if(empty($array_product)) return array();\n $row_product = $this->checkProId();\n $des_logs = '';\n if(!empty($row_product)){\n $array_update = array(); // mảng tên trường và value khi update vào bảng user_products\n $array_datas = array(); // mảng tên trường và value khi update vào bảng datas\n $new_name = '';\n $unit_parent = 0;\n $unit = 0;\n $specifi = 0;\n $set_log_delete = '';\n $usp_sale_money = 0;\n $active = 1;\n $usp_wholesale = 0;\n foreach($array_product as $column => $value){\n $check_col = $this->CheckExitColumn(USER_PRODUCTS,$column); // check tên trường tồn tại trong bang user_product\n if(empty($check_col)) return array();\n if(strstr($check_col['Type'],'int') !== false){ // check kiểu dữ liệu của trường\n if(trim($check_col['Field']) != 'usp_active'){ // kiểm tra tên trường . nếu khác trường usp_active thì giá trị phải lớn hơn 0\n if((int)$value <= 0) return array();\n }\n }\n if(strstr($check_col['Type'],'varchar') !== false){ // check kiểu dữ liệu của trường\n if(trim($value) == '') return array();\n $value = $value;\n }\n $array_update[] = $column . \" = '\" . $value .\"'\";\n switch($column){\n case 'usp_pro_name':\n $array_datas[] = \"dat_name = '\" . $value . \"'\";\n $new_name = $value;\n $des_logs .= \"\\n Sửa tên thuốc từ: <b>\". $row_product['usp_pro_name'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_unit_import':\n $array_datas[] = \"dat_unit_import = \" . $value;\n $unit_parent = $value;\n $des_logs .= \"\\n Sửa đơn vị nhập từ: <b>\". $array_unit[$row_product['usp_unit_import']] .\"</b> sang <b>\". $array_unit[$value] .\"</b>\";\n break;\n case 'usp_unit':\n $array_datas[] = \"dat_unit = \" . $value;\n $unit = $value;\n $des_logs .= \"\\n Sửa đơn vị bán từ: <b>\". $array_unit[$row_product['usp_unit']] .\"</b> sang <b>\". $array_unit[$value] .\"</b>\";\n break;\n case 'usp_specifi':\n $array_datas[] = \"dat_specifi = \" . $value;\n $specifi = $value;\n $des_logs .= \"\\n Sửa đơn vị bán từ: <b>\". $row_product['usp_specifi'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_sale_money':\n $usp_sale_money = $value;\n $des_logs .= \"\\n Sửa tiền hoa hồng từ: <b>\". $row_product['usp_sale_money'] .\"</b> sang <b>\". $value .\"</b>\";\n break;\n case 'usp_wholesale':\n $usp_wholesale = $value;\n $des_logs .= \"\\n Cập nhật giá bán buôn: <b>\". $value .\"</b>\";\n break;\n case 'usp_active':\n if($value == 0){\n $active = 0;\n $set_log_delete = ',usp_last_delete = '. time();\n $des_logs .= \"\\n Chuyển sản phẩm sang ngừng bán\";\n }else{\n $set_log_delete = ',usp_last_delete = '. time();\n $des_logs .= \"\\n Khôi phục sản phẩm để bán\";\n }\n break;\n }\n }\n //gán thông tin sản phẩm vào chính người sửa luôn\n\t\t\t\t\t $array_update[] = \"usp_use_child_id = \" . $this->use_id;\n \n $str_col_val = implode(', ',$array_update);\n $sql_update = \"UPDATE \" . USER_PRODUCTS . \" SET \". $str_col_val . $set_log_delete . \"\n WHERE usp_id = \" . $this->id . \"\n AND usp_branch_id = \" . $this->branch_id . \"\n AND usp_use_parent_id = \" . $this->admim_id;\n //kiem tra xem co quyen edit khong\n if(isset($_SERVER) && ($_SERVER['REMOTE_ADDR'] == '14.177.216.14' || $_SERVER['SERVER_NAME'] == 'localhost')){\n file_put_contents('../logs/logsupdate.cfn', $sql_update);\n }\n $db_ex = new db_execute($sql_update);\n \n // ghi logs \n logsAddEditData($row_product['usp_dat_id'],$new_name,$row_product['usp_id'],$unit_parent,$unit,$admin_id,$myuser->u_id, $specifi);\n \n // ghi log hành động\n $data_action = array(\n 'file' => json_encode(debug_backtrace()),\n 'action' => 'edit',\n 'des' => $des_logs,\n 'pro_id' => $this->id\n );\n\n log_action($data_action);\n \n // nếu chưa active dùng chung thì update luôn vào bảng data tên và đơn vị tính\n $dat_id = $row_product['usp_dat_id']; \n if($row_product['usp_dat_active'] == 0 && !empty($array_datas)){\n $str_col_data = implode(', ',$array_datas);\n $db_update_datas = new db_execute(\"UPDATE datas SET \" . $str_col_data . \" WHERE dat_id = \" . $dat_id);\n unset($db_update_datas);\n }\n \n // kiểm tra để cập nhật cho tất cả các sản phẩm của các chi nhánh cùng người chủ này quản lý cũng thay đổi luôn\n /*\n if(count($arrayBranch) > 1){\n $db_update = new db_execute(\"UPDATE \" . USER_PRODUCTS . \" SET \" . $str_col_val . \"\n WHERE usp_use_parent_id = \" . $this->admim_id . \"\n AND usp_id <> \" . $this->id . \" AND usp_dat_id = \" . $dat_id);\n unset($db_update);\n }\n */\n \n // nếu khách hàng thay đổi đơn vị bán thì\n //- xóa lịch sử nhập kho\n //- reset số tồn kho = 0\n if(($row_product['usp_unit'] > 0 && $unit > 0 && $unit != $row_product['usp_unit']) || $active == 0){\n $this->delete_reset_stock(array('pro_id' => $this->id));\n }\n \n //nếu là khôi phục thì update lại thông tin giá nhập giá bán\n if($active == 1){\n $import_last = $class_import_export->import_get_last_stocks(array('pro_id' => $this->id, 'quantity' => 1));\n \n $pr_im = isset($import_last['uss_price_import'])? $import_last['uss_price_import'] : 0;\n $pr_ex = isset($import_last['uss_price_out'])? $import_last['uss_price_out'] : 0;\n \n $db_update = new db_execute(\"UPDATE \" . USER_PRODUCTS . \"\n SET usp_price_import = \" . doubleval($pr_im) . \", usp_price = \" . doubleval($pr_ex) . \"\n WHERE usp_id = \" . $this->id);\n unset($db_update);\n }\n \n return $this->checkProId();\n }\n }\n return array();\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}", "private function product_batch()\n\t{\n\t\t// add call to trigger datagrab here\n\t\t//file_get_contents(ee()->config->item('base_url') . '?ACT=25&id=9');\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\t\t$update_count = ee()->sync_db->count_all_results('products');\n\n\t\tif($update_count > 0)\n\t\t{\t\n\t\t\t// create curl resource \n\t $ch = curl_init(); \n\n\t // set url \n\t curl_setopt($ch, CURLOPT_URL, ee()->config->item('base_url') . '?ACT=25&id=' . ee()->config->item('integration_product_import_id')); \n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); \n\t curl_setopt($ch, CURLOPT_TIMEOUT, 300); \n\t curl_exec($ch); \n\t curl_close($ch);\n \t}\n\t}", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "public function modifyVegData()\n\t{\n\t\tif('A' != $this->Session->read('UserType'))\n\t\t{\n\t\t\t$this->Session->setFlash(__('You do not have permissions to access this page !'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->VegSample->recursive = 0;\n\t\t\t$startDate = $this->request->params['pass']['0'];\n\t\t\t$endDate = $this->request->params['pass']['1'];\n\t\t\t$this->set('VegSample', $this->VegSample->getVegData($startDate,$endDate));\n\t\t\t$this->set('startDate', $startDate);\n\t\t\t$this->set('endDate',$endDate);\n\t\t}\n\t}", "function uploadShopProduct(){\t\n\n $inputFileName = $_FILES['xlsFile']['tmp_name'];\n\n // Read your Excel workbook\n\n try {\n\n $inputFileType = PHPExcel_IOFactory::identify($inputFileName);\n\n $objReader = PHPExcel_IOFactory::createReader($inputFileType);\n\n $objPHPExcel = $objReader->load($inputFileName);\n\n } catch (Exception $e) {\n\n die('Error loading file \"' . pathinfo($inputFileName, PATHINFO_BASENAME)\n\n . '\": ' . $e->getMessage());\n\n }\n\n\n\n $sheet = $objPHPExcel->getSheet(0);\n\n $highestRow = $sheet->getHighestRow();\n\n $highestColumn = $sheet->getHighestColumn();\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\n\n\n $headingFlg = 0;\n\n $headChkColumn = 0;\n\n $headingData = array();\n\n $dataCounter = 0;\n\n for ( $row = 2; $row <= $highestRow; $row++ )\n\n {\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$fileData = $sheet->rangeToArray( 'A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE );\n\t\t\t\t\t\t\t\n\n/*\n\n$pname = $fileData[0][1];\n\n\t\t\tFor MyStore work Start\n\n\n\n*/\n\n\n$pname = $fileData[0][1];\n$sqlproddup = \"select * from ketechprod where pname = '\".addslashes($pname).\"'\";\n$resultadP = mysql_query( $sqlproddup );\n/*echo $sqlproddup;\necho \"<hr/>\";*/\n\n\n$total = mysql_num_rows( $resultadP );\n\nif( $total > 0 ) {\n\n$rowadP = mysql_fetch_array( $resultadP );\n\n/*echo \"<hr/>\";\necho \"<pre>\";\nprint_r( $rowadP );*/\n\n$p_id = $rowadP['id'];\n\n$vpArray['pid'] = \t $rowadP['id'];\n\n$vpArray['b_cat'] = \t $rowadP['pcategory'];\n\n$vpArray['p_cat'] = \t $rowadP['p_parent_cat'];\n\n$vpArray['sub_cat_text'] = \t$rowadP['sub_cat_text'];\n\n\n$ART_NO = $fileData[0][0];\n\n$SUPPL_NO = $fileData[0][2];\n\n$SUPPL_NAME = $fileData[0][3];\n\n$SUPPL_ART_NO = $fileData[0][4];\n\n$BUYER_UID = $fileData[0][5];\n\n$CONT_BUY_UNIT = $fileData[0][6];\n\n$ART_GRP_NO = $fileData[0][7];\n\n$ART_GRP_DESCR = $fileData[0][8];\n\n$ART_GRP_SUB_NO = $fileData[0][9];\n\n$ART_GRP_SUB_DESCR = $fileData[0][10];\n\n$DEPT_NO\t = $fileData[0][11];\n\n$DEPT_DESCR = $fileData[0][12];\n\n$SELL_PR\t = $fileData[0][13];\n\n$SELL_VAT = $fileData[0][14];\n\n$SPAT\t = $fileData[0][15];\n\n$MRP_PRICE = $fileData[0][16];\n\n$VAT_MY = $fileData[0][17];\n\n$BUY_VAT_NO = $fileData[0][18];\n\n$BUY_VAT_PERC = $fileData[0][19];\n\n$Offer_No = $fileData[0][20];\n\n$DMS = $fileData[0][21];\n\n$stock = $fileData[0][22];\n\n$ON_ORDER = $fileData[0][23];\n\n$LAST_DELDAY = $fileData[0][24];\n\n$LAST_SALEDAY = $fileData[0][25];\n\n$MFG_Date = $fileData[0][26];\n\n$Exp_Date = $fileData[0][27];\n\n$ART_STATUS = $fileData[0][28];\n\n$STORE = $fileData[0][29];\n\n\n\n\n\n$vpArray['vid'] = \t$_SESSION['vid'];\n\n$vpArray['baseprice'] = \t$MRP_PRICE;\n\n$vpArray['sellprice'] = \t$MRP_PRICE;\n\n$vpArray['modify_baseprice'] = \t0;\n\n$vpArray['modify_sellprice'] = \t0;\n\n$vpArray['admin_approval'] = \t1;\n\n$vpArray['f_product'] = \t0;\n\n$vpArray['mpq_fp'] = \t1;\n\n$vpArray['stock'] = \t$stock;\n\n$vpArray['status'] = \t0;\n\n$vpArray['max_buy_limit'] = \t100;\n\n$vpArray['ART_NO'] = \t$ART_NO;\n\n$vpArray['SUPPL_NO'] = \t$SUPPL_NO;\n\n$vpArray['SUPPL_NAME'] = \t$SUPPL_NAME;\n\n$vpArray['SUPPL_ART_NO'] = \t$SUPPL_ART_NO;\n\n$vpArray['BUYER_UID'] = \t$BUYER_UID;\n\n$vpArray['CONT_BUY_UNIT'] = \t$CONT_BUY_UNIT;\n\n$vpArray['ART_GRP_NO'] = \t$ART_GRP_NO;\n\n$vpArray['ART_GRP_DESCR'] = \t$ART_GRP_DESCR;\n\n$vpArray['ART_GRP_SUB_NO'] = \t$ART_GRP_SUB_NO;\n\n$vpArray['ART_GRP_SUB_DESCR'] = \t$ART_GRP_SUB_DESCR;\n\n$vpArray['DEPT_NO'] = \t$DEPT_NO;\n\n$vpArray['DEPT_DESCR'] = \t$DEPT_DESCR;\n\n$vpArray['SELL_PR'] = \t$SELL_PR;\n\n$vpArray['SELL_VAT'] = \t$SELL_VAT;\n\n$vpArray['SPAT'] = \t$SPAT;\n\n$vpArray['MRP_PRICE'] = \t$MRP_PRICE;\n\n$vpArray['VAT_MY'] = \t$VAT_MY;\n\n$vpArray['BUY_VAT_NO'] = \t$BUY_VAT_NO;\n\n$vpArray['BUY_VAT_PERC'] = \t$BUY_VAT_PERC;\n\n$vpArray['Offer_No'] = \t$Offer_No;\n\n$vpArray['DMS'] = \t$DMS;\n\n$vpArray['ON_ORDER'] = \t$ON_ORDER;\n\n$vpArray['LAST_DELDAY'] = \t$LAST_DELDAY;\n\n$vpArray['LAST_SALEDAY'] = \t$LAST_SALEDAY;\n\n$vpArray['MFG_Date'] = \t$MFG_Date;\n\n$vpArray['Exp_Date'] = \t$Exp_Date;\n\n$vpArray['ART_STATUS'] = \t$ART_STATUS;\n\n$vpArray['STORE'] = \t$STORE;\n\n$vpK = array();\n\n$vpV = array();\n\nforeach( $vpArray as $vpArrayK => $vpArrayV )\n\n{\n\n\t$vpK[] = $vpArrayK;\n\n\t$vpV[] = \"'\".addslashes($vpArrayV).\"'\";\n\t\n\t$vpupdate[] = $vpArrayK.\" = '\".addslashes($vpArrayV).\"'\";\n\n\n\n}\n\n\n\n$queryk =implode(\",\",$vpK);\n\n$queryv = implode(\",\",$vpV);\n\n$queryupdate = implode(\",\",$vpupdate);\n\n\n\t\t\t\t\t\t\t$sqlcatdup = \"select * from ketechvp_\".$_SESSION['vid'].\" where pid = '\".$p_id.\"'\";\n\n\t\t\t\t\t\t\t$result = mysql_query( $sqlcatdup );\n\n\t\t\t\t\t\t\t$total = mysql_num_rows( $result );\n\n\t\t\t\t\t\t\tif( $total > 0 )\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$sqlVprodU = \"update ketechvp_\".$_SESSION['vid'].\" SET \".$queryupdate.\" where pid = \".$p_id.\"\";\n\t\t\t\t\t\t\t\t/*echo $sqlVprodU;\n\t\t\t\t\t\t\t\techo \"<hr/>\";*/\n\t\t\t\t\t\t\t\tmysql_query( $sqlVprodU );\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}else\n\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\n\n\n\n/*echo $queryk;\n\necho \"<hr/>\";\n\necho $queryv;\n\necho \"<pre>\";*/\n\n/*echo count( $vpArray );\n\nprint_r( $vpV );*/\n\n\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t//insert parent cat\n\n\t\t\t\t\t\t\t\t/*$sqlVprod = \"insert into ketechvp_clone( pid,b_cat,p_cat,sub_cat_text,baseprice,sellprice,modify_baseprice,modify_sellprice,admin_approval,stock,status,ART_NO,SUPPL_NO,SUPPL_NAME,SUPPL_ART_NO,BUYER_UID,CONT_BUY_UNIT,ART_GRP_NO,ART_GRP_DESCR,ART_GRP_SUB_NO,ART_GRP_SUB_DESCR,DEPT_NO,DEPT_DESCR,SELL_PR,SELL_VAT,SPAT,MRP_PRICE,VAT_MY,BUY_VAT_NO,BUY_VAT_PERC,Offer_No,DMS,ON_ORDER,LAST_DELDAY,LAST_SALEDAY,MFG_Date,Exp_Date,ART_STATUS,STORE)values(\".$p_id.\",'\".$Ccat_id.\"','\".$pcat_id.\"','*\".$Ccat_id.\"*',\".$MRP_PRICE.\",\".$MRP_PRICE.\",'0','0',1,'\".$stock.\"',1,'\".$ART_NO.\"','\".$SUPPL_NO.\"','\".$SUPPL_NAME.\"','\".$BUYER_UID.\"','\".$CONT_BUY_UNIT.\"','\".$ART_GRP_NO.\"','\".$ART_GRP_DESCR.\"','\".$ART_GRP_SUB_NO.\"','\".$ART_GRP_SUB_DESCR.\"','\".$DEPT_NO.\"','\".$DEPT_DESCR.\"','\".$SELL_PR.\"','\".$SELL_VAT.\"','\".$SPAT.\"','\".$MRP_PRICE.\"','\".$VAT_MY.\"','\".$BUY_VAT_NO.\"','\".$BUY_VAT_PERC.\"','\".$Offer_No.\"','\".$DMS.\"','\".$ON_ORDER.\"','\".$LAST_DELDAY.\"','\".$LAST_SALEDAY.\"','\".$MFG_Date.\"','\".$Exp_Date.\"','\".$ART_STATUS.\"','\".$STORE.\"')\";*/\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t$sqlVprod = \"insert into ketechvp_\".$_SESSION['vid'].\"(\".$queryk.\")values(\".$queryv.\")\";\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t/*echo $sqlVprod;\n\n\t\t\t\t\t\t\t\techo \"<hr/>\".$dataCounter;\t*/\n\n\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\t$resultest\t= mysql_query( $sqlVprod );\n\n\t\t\t\t\t\t\t\tif( !$resultest ){\n\n\t\t\t\t\t\t\t\t\t\t\t/*echo $sqlVprod;\n\n\t\t\t\t\t\t\t\t\t\t\techo \"<hr/>\";\t*/\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//$p_id = mysql_insert_id();\n\n\t\t\t\t\t\t\t //$pcat_id = mysql_insert_id();\n\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\t\n\n\t\t\t\t\t\t\t/*echo \"<pre>\";\n\n\t\t\t\t\t\t\tprint_r( $fileData );*/\n\n\t\t\t\t\t\t\t//die();\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*echo \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'].\"&vid=\".$_SESSION['vid'].\"\";\n\n\t\t\t\t\t\t\techo \"<hr/>\";*/\n\n\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\tif( $dataCounter > 60 )\n\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t //die();\n\n\t\t\t\t\t\t\t\t } \n\n\t\t\t\t\t\t\t\n\n }else{\n\t\t\t\t\t\t\t\t/*echo $pname;\n\t\t\t\t\t\t\t\techo \"<br/>\";*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n}\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\theader( \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'].\"&vid=\".$_SESSION['vid'].\"\" );\n}", "protected function process()\n {\n\n // initialize the store view code\n $this->getSubject()->prepareStoreViewCode();\n\n // load the PK\n $pk = $this->getValue($this->getPrimaryKeyColumnName());\n\n // load the store view - if no store view has been set, we assume the admin\n // store view, which will contain the default (fallback) attribute values\n $storeViewCode = $this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN);\n\n // query whether or not the row has already been processed\n if ($this->storeViewHasBeenProcessed($pk, $storeViewCode)) {\n // log a message\n $this->getSystemLogger()->warning(\n $this->getSubject()->appendExceptionSuffix(\n sprintf(\n 'Attributes for %s \"%s\" + store view code \"%s\" has already been processed',\n $this->getPrimaryKeyColumnName(),\n $pk,\n $storeViewCode\n )\n )\n );\n\n // return immediately\n return;\n }\n\n // load the store ID, use the admin store if NO store view code has been set\n $storeId = $this->getSubject()->getRowStoreId(StoreViewCodes::ADMIN);\n\n // load the image attribute\n $attribute = $this->getEavAttributeByAttributeCode('image');\n\n // remove the image if one exists\n if ($value = $this->loadVarcharAttribute($pk, $attribute[MemberNames::ATTRIBUTE_ID], $storeId)) {\n $this->deleteVarcharAttribute(array(MemberNames::VALUE_ID => $value[MemberNames::VALUE_ID]));\n }\n }", "function ProductQuery() {\n\t $csvilog = JRequest::getVar('csvilog');\n\t \n\t /* Bind the initial data */\n\t $this->_vm_product->bind($this);\n\t \n\t /* Set some initial values */\n\t /* Set the modified date as we are modifying the product */\n\t $this->_vm_product->mdate = time();\n\t \n\t /* We have a succesful save, get the product_id */\n\t if ($this->_vm_product->store()) {\n\t\t $csvilog->AddMessage('debug', JText::_('DEBUG_STORE_PRODUCT'), true);\n\t\t if (substr($this->_vm_product->_db->getQuery(), 0, strpos($this->_vm_product->_db->getQuery(),' ')) == 'UPDATE') {\n\t\t\t $langtype = 'UPDATE_PRODUCT_SKU';\n\t\t\t $sqltype = 'updated';\n\t\t }\n\t\t else {\n\t\t\t $langtype = 'ADD_PRODUCT_SKU';\n\t\t\t $sqltype = 'added';\n\t\t }\n\t\t $csvilog->AddStats($sqltype, str_ireplace('{product_sku}', $this->record_identity, JText::_($langtype)), true);\n\t\t return true;\n\t }\n\t else {\n\t\t $csvilog->AddMessage('debug', JText::_('DEBUG_STORE_PRODUCT'), true);\n\t\t return false;\n\t }\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 updateAndProcess($data){\n if(is_array($data)){\n foreach($data as $k => $v) {\n if ( $v == \"\") {\n $data[$k] = NULL;\n }\n }\n if(!is_null($data['gridref'])) {\n $data = $this->_processFindspot($data);\n }\n }\n if(array_key_exists('csrf', $data)){\n unset($data['csrf']);\n }\n if(array_key_exists('landownername', $data)){\n unset($data['landownername']);\n }\n if(array_key_exists('parishID', $data) && !is_null($data['parishID'])){\n $parishes = new OsParishes();\n $data['parish'] = $parishes->fetchRow($parishes->select()->where('osID = ?', $data['parishID']))->label;\n }\n if(array_key_exists('countyID', $data) && !is_null($data['countyID'])){\n $counties = new OsCounties();\n $data['county'] = $counties->fetchRow($counties->select()->where('osID = ?', $data['countyID']))->label;\n }\n\n if(array_key_exists('districtID', $data) && !is_null($data['districtID'])){\n $district = new OsDistricts();\n $data['district'] = $district->fetchRow($district->select()->where('osID = ?', $data['districtID']))->label;\n }\n return $data;\n }", "public function controller_processReceivedData() {\n // validate received form data\n // update data model\n }", "function process_data($data) {\n // Implement in children classes\n }", "private function commonStoreUpdate(array $raw_data){\n (!$logo_id = array_deep_search( $raw_data, 'logo_id')) ? : $modified_data['logo_id'] = (int)$logo_id;\n (!$city_id = array_deep_search( $raw_data, 'city_id')) ? : $modified_data['city_id'] = (int)$city_id;\n (!$region_id = array_deep_search( $raw_data, 'region_id')) ? : $modified_data['region_id'] = (int)$region_id;\n (!$town_id = array_deep_search( $raw_data, 'town_id')) ? : $modified_data['town_id'] = (int)$town_id;\n (!$postcode_id = array_deep_search( $raw_data, 'postcode_id')) ? : $modified_data['postcode_id'] = (int)$postcode_id;\n (!$industry_id = array_deep_search( $raw_data, 'industry_id')) ? : $modified_data['industry_id'] = (int)$industry_id;\n (!$business_type_ids = array_deep_search( $raw_data, 'business_type_ids')) ? : $modified_data['business_type_ids'] = array_map( 'intval', $business_type_ids);\n $is_active = array_deep_search($raw_data, 'is_active');\n if ( $is_active ) {\n $modified_data['is_active'] = (\"false\" !== $is_active) ? TRUE : FALSE;\n }//if ( $is_active )\n (!$business_name = array_deep_search( $raw_data, 'business_name')) ? : $modified_data['business_name'] = (string)$business_name;\n (!$trading_name = array_deep_search( $raw_data, 'trading_name')) ? : $modified_data['trading_name'] = (string)$trading_name;\n (!$bank_account_number = array_deep_search( $raw_data, 'bank_account_number')) ? : $modified_data['bank_account_number'] = (string)$bank_account_number;\n (!$address1 = array_deep_search( $raw_data, 'address1')) ? : $modified_data['address1'] = (string)$address1;\n (!$address2 = array_deep_search( $raw_data, 'address2')) ? : $modified_data['address2'] = (string)$address2;\n (!$phone = array_deep_search( $raw_data, 'phone')) ? : $modified_data['phone'] = (string)$phone;\n (!$website = array_deep_search( $raw_data, 'website')) ? : $modified_data['website'] = (string)$website;\n (!$business_email = array_deep_search( $raw_data, 'business_email')) ? : $modified_data['business_email'] = (string)$business_email;\n (!$contact_name = array_deep_search( $raw_data, 'contact_name')) ? : $modified_data['contact_name'] = (string)$contact_name;\n (!$contact_mobile = array_deep_search( $raw_data, 'contact_mobile')) ? : $modified_data['contact_mobile'] = (string)$contact_mobile;\n $is_featured = array_deep_search($raw_data, 'is_featured');\n if ( $is_featured ) {\n $modified_data['is_featured'] = (\"false\" !== $is_featured) ? TRUE : FALSE;\n }//if ( $is_featured )\n $is_display = array_deep_search($raw_data, 'is_display');\n if ( $is_display ) {\n $modified_data['is_display'] = (\"false\" !== $is_display) ? TRUE : FALSE;\n }//if ( $is_display )\n (!$available_hours_mon = array_deep_search( $raw_data, 'available_hours_mon')) ? : $modified_data['available_hours_mon'] = (string)$available_hours_mon;\n (!$available_hours_tue = array_deep_search( $raw_data, 'available_hours_tue')) ? : $modified_data['available_hours_tue'] = (string)$available_hours_tue;\n (!$available_hours_wed = array_deep_search( $raw_data, 'available_hours_wed')) ? : $modified_data['available_hours_wed'] = (string)$available_hours_wed;\n (!$available_hours_thu = array_deep_search( $raw_data, 'available_hours_thu')) ? : $modified_data['available_hours_thu'] = (string)$available_hours_thu;\n (!$available_hours_fri = array_deep_search( $raw_data, 'available_hours_fri')) ? : $modified_data['available_hours_fri'] = (string)$available_hours_fri;\n (!$available_hours_sat = array_deep_search( $raw_data, 'available_hours_sat')) ? : $modified_data['available_hours_sat'] = (string)$available_hours_sat;\n (!$available_hours_sun = array_deep_search( $raw_data, 'available_hours_sun')) ? : $modified_data['available_hours_sun'] = (string)$available_hours_sun;\n return $modified_data;\n }", "public function run()\n {\n $product_variance = array (\n array(\n 'pvProductId' => 'PROD0001',\n\t\t\t\t'pvVarianceId' => 'VAR0001',\n\t\t\t\t'pvCost' => 500.00,\n 'pvThreshold' => 10,\n\t\t\t\t'pvIsActive' => 1,\n ),\n array(\n 'pvProductId' => 'PROD0001',\n\t\t\t\t'pvVarianceId' => 'VAR0002',\n\t\t\t\t'pvCost' => 250.00,\n 'pvThreshold' => 10,\n\t\t\t\t'pvIsActive' => 1,\n ),\n array(\n 'pvProductId' => 'PROD0002',\n 'pvVarianceId' => 'VAR0003',\n 'pvCost' => 300.00,\n 'pvThreshold' => 10,\n 'pvIsActive' => 1,\n ),\n array(\n 'pvProductId' => 'PROD0002',\n 'pvVarianceId' => 'VAR0004',\n 'pvCost' => 500.00,\n 'pvThreshold' => 10,\n 'pvIsActive' => 1,\n ),\n array(\n 'pvProductId' => 'PROD0002',\n 'pvVarianceId' => 'VAR0005',\n 'pvCost' => 600.87,\n 'pvThreshold' => 10,\n 'pvIsActive' => 1,\n ),\n array(\n 'pvProductId' => 'PROD0002',\n 'pvVarianceId' => 'VAR0006',\n 'pvCost' => 600.75,\n 'pvThreshold' => 10,\n 'pvIsActive' => 1,\n ),\n );\n DB::table('product_variance')->insert($product_variance);\n }", "public function modifierBouteilleCatalogue($data){\n\t\t$requete =\"UPDATE vino__bouteille\n\t\tSET fk__vino__type_id = $data->type\" ;\n\n\t\t//Initialise un tableau pour inserer des erreurs\n\t\t$erreur = array();\n\n\t\t//Verification du nom\n\t\tif($data->nom == \"\" ){\n\t\t\t$erreur[\"nom\"] = true;\n\t\t}else{\n\t\t\t//Permet de construire la requete\n\t\t\t$requete .= \", nom = '\" .utf8_encode($data->nom) .\"'\";\n\t\t}\n\n\t\t//Verification du code de la SAQ ne doit pas etre vide contenir que des chiffres\n\t\t$regExp = \"/^\\d+$/i\";\n\t\tif($data->code_saq == \"\" || !preg_match($regExp, $data->code_saq)){\n\t\t\t$erreur[\"code_saq\"] = true;\n\t\t}else{\n\t\t\t//Permet de construire la requete\n\t\t\t$requete .= \", code_saq = '\" . $data->code_saq .\"'\";\n\t\t}\n\t\t\n\n\t\t//Verification bon format de pays\n\t\t$regExp = \"/^[ÉÈÀéèàa-zA-Z-]+$/i\";\n\t\tif($data->pays == \"\" || !preg_match($regExp, $data->pays)){\n\t\t\t$erreur[\"pays\"] = true;\n\t\t}else{\n\t\t\t$requete .= \", pays = '\" . utf8_encode($data->pays) .\"'\";\n\t\t}\n\n\t\t//Verification prix\n\t\t$regExp = \"/^[1-9]\\d*(\\.\\d{1,2})?$/i\";\n\t\tif($data->prix !== \"\"){\n\t\t\t//Permet de construire la requete\n\t\t\t$requete .= \", prix_saq = \" . $data->prix ;\n\t\t\tif(!preg_match($regExp, $data->prix)){\n\t\t\t\t$erreur[\"prix\"] = true;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t//Verification du code de la SAQ ne doit pas etre vide contenir que des chiffres\n\t\tif($data->format == \"\" ){\n\t\t\t$erreur[\"format\"] = true;\n\t\t}else{\n\t\t\t//Permet de construire la requete\n\t\t\t$requete .= \", format = '\" . utf8_encode($data->format) .\"'\";\n\t\t}\n\n\n\t\t//Verification du millesime\n\t\tif($data->description !== \"\"){\n\t\t\t//Permet de construire la requete\n\t\t\t$requete .= \", description = '\".utf8_encode($data->description) . \"'\";\n\t\t}\n\n\t\t//Permet de construire la requete\n\t\t$requete .= \" WHERE id = \" . $data->id;\n\n\t\t//Verifie si il y a des erreurs\n\t\tif(count($erreur) == 0){\n\t\t\t$res = $this->_db->query($requete);\n\t\t}else{\n\t\t\t//Si contient erreur envoie quelle sont les erreurs\n\t\t\t$res = $erreur;\n\n\t\t}\n \n\t\treturn $res;\n\t}", "public function generateAjax(&$objModule)\n\t{\n\t\t$this->formSubmit = (($objModule instanceof ContentElement) ? 'cte' : 'fmd') . $objModule->id . '_product_' . ($this->pid ? $this->pid : $this->id);\n\t\t$this->validateVariant();\n\n\t\t$arrOptions = array();\n\t\t$arrToGenerate = array();\n\n\t\tforeach ($this->getProductAndVariantAttributes() as $attribute)\n\t\t{\n\t\t\t$arrData = $GLOBALS['TL_DCA']['tl_iso_products']['fields'][$attribute];\n\n\t\t\tif ($arrData['attributes']['variant_option'] || $arrData['attributes']['ajax_option'])\n\t\t\t{\n\t\t\t\t$arrOptions[] = array_merge($arrData, array\n\t\t\t\t(\n\t\t\t\t\t'id'\t=> ('ctrl_' . $attribute . '_' . $this->formSubmit),\n\t\t\t\t\t'name'\t=> $attribute,\n\t\t\t\t\t'html'\t=> $this->generateProductOptionWidget($attribute, true),\n\t\t\t\t));\n\t\t\t}\n\t\t\telseif (in_array($attribute, $this->arrVariantAttributes))\n\t\t\t{\n\t\t\t\t$arrToGenerate[] = $attribute;\n\t\t\t}\n\t\t}\n\n\t\tforeach($arrToGenerate as $attribute)\n\t\t{\n\t\t\t$arrData = $GLOBALS['TL_DCA']['tl_iso_products']['fields'][$attribute];\n\n\t\t\tif ($arrData['inputType'] == 'mediaManager')\n\t\t\t{\n\t\t\t\t$objGallery = $this->$attribute;\n\n\t\t\t\tforeach ((array) $this->Isotope->Config->imageSizes as $size)\n\t\t\t\t{\n\t\t\t\t\t$arrOptions[] = array_merge($arrData, array\n\t\t\t\t\t(\n\t\t\t\t\t\t'id'\t=> ($this->formSubmit . '_' . $attribute . '_' . $size['name'] . 'size'),\n\t\t\t\t\t\t'name'\t=> $attribute,\n\t\t\t\t\t\t'html'\t=> $objGallery->generateMainImage($size['name']),\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$arrOptions[] = array_merge($arrData, array\n\t\t\t\t(\n\t\t\t\t\t'id' => ($this->formSubmit . '_' . $attribute . '_gallery'),\n\t\t\t\t\t'name'\t=> $attribute,\n\t\t\t\t\t'html' => $objGallery->generateGallery(),\n\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$arrOptions[] = array_merge($arrData, array\n\t\t\t\t(\n\t\t\t\t\t'id' => ($this->formSubmit . '_' . $attribute),\n\t\t\t\t\t'name'\t=> $attribute,\n\t\t\t\t\t'html' => $this->generateAttribute($attribute, $this->$attribute),\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t// !HOOK: alter product data before ajax output\n\t\tif (isset($GLOBALS['ISO_HOOKS']['generateAjaxProduct']) && is_array($GLOBALS['ISO_HOOKS']['generateAjaxProduct']))\n\t\t{\n\t\t\tforeach ($GLOBALS['ISO_HOOKS']['generateAjaxProduct'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrOptions = $this->$callback[0]->$callback[1]($arrOptions, $this);\n\t\t\t}\n\t\t}\n\n\t\treturn $arrOptions;\n\t}", "public function RunDataProcess()\n {\n // TODO: Implement RunDataProcess() method.\n }", "public static function getEntryFormData() {\n $result = lC_Product_variants_Admin::getEntryFormData($_GET['pveid']);\n if (!isset($result['rpcStatus'])) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function handle()\n {\n $products = ContactLenses::distinct('id')->get();\n foreach($products as $product){\n\n if($product->id == \"id\" || $product->id == null)\n continue;\n\n $nSession = (object) $this->sessionTpl;\n\n $nSession->id = $product->id;\n $nSession->title = $product->title;\n $nSession->description = $product->description;\n $nSession->price = $product->price;\n $nSession->sale_price = $product->sale_price;\n $nSession->sale_price_effective_date = $product->sale_price_effective_date;\n $nSession->link = $product->link;\n $nSession->condition = $product->condition;\n $nSession->product_type = $product->product_type;\n $nSession->brand = $product->brand;\n $nSession->gtin = $product->gtin;\n $nSession->image_link = $product->image_link;\n $nSession->google_product_category = $product->google_product_category;\n $nSession->shipping = $product->shipping;\n $nSession->availability = $product->availability;\n $nSession->material = $product->material;\n $nSession->color = $product->color;\n $nSession->size = $product->size;\n $nSession->age_group = $product->age_group;\n $nSession->gender = $product->gender;\n\n $nSession->promosticker = $product->custom_label_0;\n $nSession->export_type = $product->catalog_version;\n\n $nSession = (array) $nSession;\n $exportProducts = new ExportProducts();\n foreach(array_keys($nSession) as $key){\n if(in_array($key, $this->availableFields)) {\n $exportProducts->$key = $nSession[$key];\n }\n }\n $exportProducts->save();\n }\n\n return;\n }", "public function processingDataUpdateProv($prov, $tahun, $triwulan, $waktu){\n $array_model = PdrbProv::find()->where(['id_prov' => $prov, 'tahun'=>$tahun, 'triwulan'=> $triwulan, 'timestamp'=>$waktu])->all();\n foreach($array_model as $model){\n $ref_q = PdrbProv::getReferensiQ($model->id_prov, $model->tahun, $model->triwulan);\n $ref_y = PdrbProv::getReferensiY($model->id_prov, $model->tahun, $model->triwulan);\n $ref_c_0 = PdrbProv::getReferensiC($model->id_prov, $model->tahun-1, $model->triwulan);\n $ref_c = PdrbProv::getReferensiC($model->id_prov, $model->tahun, $model->triwulan-1);\n if ($ref_q){\n $laju_p_q = PdrbProv::getLajuPQ($model->id_prov, $model->id_pdrb, $ref_q, $model->pdrb_k);\n $laju_imp_q = PdrbProv::getLajuImpQ($model->id_prov, $model->id_pdrb, $ref_q, $model->implisit);\n $model->laju_p_q = $laju_p_q;\n $model->laju_imp_q = $laju_imp_q; \n }\n if($ref_q && $ref_y && $ref_c_0){\n $laju_p_c = PdrbProv::getLajuPC($model->id_prov, $model->id_pdrb, $ref_c, $ref_c_0, $model->pdrb_k, $model->triwulan);\n $laju_imp_c = PdrbProv::getLajuImpC($model->id_prov, $model->id_pdrb, $ref_c, $ref_c_0, $model->implisit, $model->triwulan);\n $model->laju_p_c = $laju_p_c;\n $model->laju_imp_c = $laju_imp_c;\n }\n if($ref_y){\n $laju_p_y = PdrbProv::getLajuPY($model->id_prov, $model->id_pdrb, $ref_y, $model->pdrb_k);\n $laju_imp_y = PdrbProv::getLajuImpY($model->id_prov, $model->id_pdrb, $ref_y, $model->implisit);\n $model->laju_p_y = $laju_p_y;\n $model->laju_imp_y = $laju_imp_y;\n }\n if($model->triwulan == 1){\n $model->laju_p_c = $model->laju_p_y;\n }\n if($model->id_prov == '0100'){\n $total_adhb = PdrbProv::getTotalADHBProv($model->id_pdrb, $model->tahun, $model->triwulan);\n $total_adhk = PdrbProv::getTotalADHKProv($model->id_pdrb, $model->tahun, $model->triwulan);\n if($model->pdrb_b != 0 || $model->pdrb_b != null){\n $diskrepansi_b = ( (float)$total_adhb / (float)$model->pdrb_b *100) - 100;\n $model->diskrepansi_b = $diskrepansi_b;\n } else {\n $model->diskrepansi_b = null;\n }\n if($model->pdrb_k != 0 || $model->pdrb_k != null){\n $diskrepansi_k = ((float)$total_adhk/ (float)$model->pdrb_k *100)- 100;\n $model->diskrepansi_k = $diskrepansi_k;\n } else{\n $model->diskrepansi_k = null;\n }\n } else if ($model->id_pdrb != '0100') {\n $model->diskrepansi_b = null;\n $model->diskrepansi_k = null;\n }\n if($model->id_pdrb === 'ZPDRB' || $model->id_pdrb === 'ZPDRBTP'){\n if ( abs($model->diskrepansi_b) > 2 \n || abs($model->diskrepansi_k) > 2 \n || abs($model->share_b) > 10 \n || abs($model->share_k) > 10 \n || abs($model->laju_p_q) > 10 \n || abs($model->laju_imp_q) > 10){\n $model->flag = 1;\n $model->status = \"rekon\";\n } else {\n $model->flag = 0;\n }\n }\n else if($model->id_pdrb !== 'ZPDRB' || $model->id_pdrb !== 'ZPDRBTP'){\n if ( abs($model->diskrepansi_b) > 5 \n || abs($model->diskrepansi_k) > 5 \n || abs($model->share_b) > 10 \n || abs($model->share_k) > 10 \n || abs($model->laju_p_q) > 10 \n || abs($model->laju_imp_q) > 10){\n $model->flag = 1;\n $model->status = \"rekon\";\n } else {\n $model->flag = 0;\n }\n }\n $model->save($runValidation = false);\n }\n }", "function insertOrdersProductPreProc(&$params, &$reference) {\n\n error_log(\"insertOrdersProductPreProc - begin\");\n\n $order_id = $params['insertArray']['orders_id'];\n $cart_product_item = $params['value'];\n $product_id = $cart_product_item['products_id'];\n $variant_id = $cart_product_item['variant_id'];\n\n\n // Get variant's details from the db\n $qry_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n 'v.variant_price, v.variant_sku',\n 'tx_msvariants_domain_model_variants v',\n 'v.variant_id='.$variant_id.' and v.product_id='.$product_id\n );\n\n if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_res) != 1) {\n // TODO this should never happen - raise exception?\n return;\n }\n\n $variant_data = $GLOBALS ['TYPO3_DB']->sql_fetch_assoc($qry_res);\n\n // Insert variant details about the order into the db\n $insert_array = array(\n 'order_id' => $order_id,\n 'product_id' => $product_id,\n 'variant_id' => $variant_id,\n 'price' => $variant_data['variant_price'],\n 'quantity' => $cart_product_item['qty'],\n 'sku' => $variant_data['variant_sku']\n );\n\n // TODO should we insert here the following logic:\n // - check if after the order the variants gets out of stock\n // - if such is the case, notify adming about this event\n // - and disable product variant! (ohh... that's new - we should do this in product detail script)\n $this->updateQtyInVariant($variant_id, $cart_product_item['qty']);\n\n $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n 'tx_msvariants_domain_model_variantsorders', $insert_array\n );\n\n // Insert variant attributes details about the order into the db\n $qry_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n 'va.attribute_id, va.option_id, va.option_value_id',\n 'tx_msvariants_domain_model_variantsattributes va',\n 'va.variant_id='.$variant_id.' and va.product_id='.$product_id\n );\n\n if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_res) <= 0) {\n // TODO this should never happen - raise exception?\n return;\n }\n\n while (($row = $GLOBALS ['TYPO3_DB']->sql_fetch_assoc($qry_res)) != false) {\n\n $row['option_name'] = mslib_fe::getRealNameOptions($row['option_id']);\n $row['option_value_name'] = mslib_fe::getNameOptions($row['option_value_id']);\n\n $insert_array = array(\n 'order_id' => $order_id,\n 'product_id' => $product_id,\n 'variant_id' => $variant_id,\n 'attribute_id' => $row['attribute_id'],\n 'option_id' => $row['option_id'],\n 'option_value_id' => $row['option_value_id'],\n 'option_name' => $row['option_name'],\n 'option_value_name' => $row['option_value_name']\n );\n\n $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n 'tx_msvariants_domain_model_variantsattributesorders', $insert_array\n );\n\n } // while\n\n error_log(\"insertOrdersProductPreProc - end\");\n\n\n }", "public function getProcessData()\n {\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "protected function _prepareForm()\n {\n\t\t$product = Mage::registry('webfrontstore_product_data');\n\t\tif ($product) {\n\t\t\t$form = new Varien_Data_Form();\n\t\t\t$fieldset = $form->addFieldset('webfrontstore_status', array('legend'=> Mage::helper('webfrontstore_helpers')->__('Group/Version Information')));\n\t\t\t$fieldset->addField('groupid', 'text', array(\n\t\t\t\t'label' => Mage::helper('webfrontstore_helpers')->__('GroupId/Version'),\n\t\t\t\t'class' => '',\n\t\t\t\t'value' => $product->getGroupid(),\n\t\t\t\t'required' => false,\n\t\t\t\t'name' => 'groupid',\n\t\t\t\t'note' => Mage::helper('webfrontstore_helpers')->__('If Product have multiple versions then enter the version or group id otherwise left blank.'),\n\n\t\t\t));\n\t\t\t$this->setForm($form);\n\t\t}\n\t\treturn $this;\n }", "function getFormWithdataByFormDataIDAndUserID($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $CustomerID = is_require($post, 'CustomerID');\n $UserID = is_require($post, 'UserID');\n $FormDataID = is_require($post, 'FormDataID');\n //$OrgID = $post['OrgID'];\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n /******************** userData start *******************/\n $sql = \"SELECT S.OrgID, UA.UserTypeID FROM \n SCP_Staff AS S \n INNER JOIN SCP_UserAccess AS UA ON UA.UserID='$UserID'\n WHERE S.UserID='$UserID'\";\n $resultset = mysql_query($sql);\n $accessRow = mysql_fetch_assoc($resultset); \n $OrgID = $accessRow['OrgID'];\n $UserTypeID = $accessRow['UserTypeID'];\n /******************** userData end *******************/ \n /******************** userformData start *******************/\n $sql1 = \"SELECT * FROM SCP_OrgFormBuilderDataAction WHERE CustomerID='$CustomerID' AND FormDataID='$FormDataID'\";\n $resultset1 = mysql_query($sql1);\n $rowData = mysql_fetch_assoc($resultset1); \n /******************** userformData end *******************/ \n //print_r($arrFormValueData); die();\n $result = mysql_query(\"call getFormWithdataByFormDataIDAndUserID('\".$OrgID.\"','\".$UserTypeID.\"','\".$FormDataID.\"');\");\n //CHECK FOR ERROR \n if (!$result) die('Invalid query: ' . mysql_error());\n $row = mysql_fetch_assoc($result);\n mysql_close($con); //close the connection\n\n if(!empty($rowData)) {\n $arrFormValueData = unserialize($rowData['FormValueData']);\n $jsonData = json_decode($row['FormDataJson']);\n $filterAllForms = array();\n foreach ($jsonData as $key => $value) {\n $array['component'] = $value->component;\n $array['editable'] = $value->editable;\n $array['index'] = $value->index;\n $array['label'] = $value->label;\n $array['value'] = $arrFormValueData->$key;\n $array['description'] = $value->description;\n $array['placeholder'] = $value->placeholder;\n $array['options'] = $value->options;\n $array['required'] = $value->required;\n $filterAllForms[] = $array;\n }\n $row['FormDataJson'] = json_encode($filterAllForms);\n }\n $filterFormWithData = $row;\n //print_r($filterFormWithData); die(); \n if($filterFormWithData) {\n $data['ResponseData'] = $filterFormWithData;\n $data['Message'] = \"Get form data successfully.\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Success\";\n $data['StatusCode'] = \"1\";\n } else {\n $data['ResponseData'] = \"\";\n $data['Message'] = \"Error\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Failed\";\n $data['StatusCode'] = \"0\";\n }\n print json_encode($data);\n}", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "private function saveCoreData($rawData){ \n $arr=[];\n $rawData=(array)$rawData[\"data\"];\n \n foreach ($this->keys as $key => $value) {\n $value = (array)$value;\n //textarray\n if($value[\"type\"]==\"textarray\"){\n //loop through the size\n $types = explode(\"~\",$value[\"subtype\"]);\n for ($i=0; $i<$value[\"size\"]; $i++){\n $row=[];\n $row[\"name\"] = $key . \"_\" . $i;\n $row[\"type\"] = (isset($types[$i])? $types[$i] : $types[0]);\n \n if(!is_array($rawData[$key])){\n $rawData[$key] = explode(\",\",$rawData[$key] );\n }\n if(!isset($rawData[$key][$i]))\n $rawData[$key][$i]=null;\n \n $type=\"\";\n if(isset($types[$i]))\n $type=$types[$i];\n else\n $type=$types[0];\n \n// var_dump($rawData[$key][$i]);\n// echo $type . \"</br>\";\n \n $arr[$row[\"name\"]]= $this->getVal($rawData[$key][$i], $type);\n }\n }\n else{\n if(!isset($rawData[$key]))\n $rawData[$key]=null;\n \n \n $arr[$key]= $this->getVal($rawData[$key], $this->keys[$key][\"type\"]);\n }\n }\n \n return $arr;\n \n }", "function process($raw_data) {\n // but we also might want to confirm, and if so we use a private name\n $res = array();\n if ($this->bConfirm) {\n $res['_password_confirm_' . $this->sBasename] = array(\n 'base' => $raw_data[$this->sBasename]['base'],\n 'confirm' => $raw_data[$this->sBasename]['confirm'], \n );\n $res[$this->sBasename] = $raw_data[$this->sBasename]['base'];\n } else {\n $res[$this->sBasename] = $raw_data[$this->sName];\n }\n return $res;\n }", "function _submit_biz_data()\n {\n\t$data = $this->_get_data_from_post('business');\n\t//$this->debug($_FILES);\n\tif ($_FILES['photo']['name'] != NULL) {\n\t $data['logo'] = Modules::run('upload_manager/upload', 'photo', 'biz');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data, 'mdl_marketers_info');\n\t //Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data, 'mdl_marketers_info');\n\t //redirect('login');\n\t}\n }", "public function product_application_post()\n {\n $final_array = [];\n $language_code = $this->language_code;\n\n $application_data = $this->Application->fetch();\n\n foreach ($application_data as $application) {\n $response = get_sg_data(\"{$application['language_code']}/applications/{$application['application_id']}/products\");\n $response = json_decode($response, true);\n $language = $application['language_code'];\n \n $response = array_map(\n function ($data) use ($application) {\n $product_data = $this->UtilModel->selectQuery(\n \"id\",\n \"products\",\n [\"single_row\" => true, \"where\" => ['product_id' => $data['id']]]\n );\n $data['application_id'] = $application['id'];\n $data['product_id'] = $product_data['id'];\n $data['primary_application_id'] = $application['application_id'];\n $data['primary_product_id'] = $data['id'];\n $data['created_at'] = $this->datetime;\n $data['updated_at'] = $this->datetime;\n unset($data['id']);\n unset($data['title']);\n unset($data['subTitle']);\n unset($data['image']);\n return $data;\n }, $response\n );\n\n $final_array = array_merge($final_array, $response);\n }\n\n foreach ($final_array as $data) {\n $this->ProductApplication->batch_data[] = $data;\n }\n\n $this->ProductApplication->batch_save();\n\n pd($final_array);\n\n }", "public function ajax_datagrid($type) {\n $data = Input::all();\n $productsActilead = UserActivity::UserActivitySaved($data,'View','Products');\n $data['SearchStock']=!empty($data['SearchStock'])?$data['SearchStock']:'';\n $data['SearchDynamicFields']=!empty($data['SearchDynamicFields'])?$data['SearchDynamicFields']:'';\n $CompanyID = User::get_companyID();\n $data['iDisplayStart'] +=1;\n $columns = ['ProductID','title','Name','Code','BuyingPrice','Amount','Quantity','updated_at','Active','Description','Note','AppliedTo','LowStockLevel','ItemTypeID'];\n $sort_column = $columns[$data['iSortCol_0']];\n if($data['AppliedTo'] == ''){\n $data['AppliedTo'] = 'null';\n }\n\n $query = \"call prc_getProducts (\".$CompanyID.\", '\".$data['Name'].\"','\".$data['Code'].\"','\".$data['Active'].\"',\".$data['AppliedTo'].\", \".( ceil($data['iDisplayStart']/$data['iDisplayLength']) ).\" ,\".$data['iDisplayLength'].\",'\".$sort_column.\"','\".$data['sSortDir_0'].\"','\".$data['ItemTypeID'].\"'\";\n $Type = Product::DYNAMIC_TYPE;\n $DynamicFields = $this->getDynamicFields($CompanyID,$Type);\n\n if(isset($data['Export']) && $data['Export'] == 1) {\n $export_type['type'] = $type;\n $UserActilead = UserActivity::UserActivitySaved($export_type,'Export','Products');\n $excel_data = DB::connection('sqlsrv2')->select($query.',1,\"'.$data['SearchStock'].'\",\"'.$data['SearchDynamicFields'].'\")');\n if($DynamicFields['totalfields'] > 0){\n foreach ($excel_data as $key => $value) {\n foreach ($DynamicFields['fields'] as $field) {\n $DynamicFieldsID = $field->DynamicFieldsID;\n $DynamicFieldsValues = DynamicFieldsValue::getDynamicColumnValuesByProductID($DynamicFieldsID,$excel_data[$key]->ProductID);\n $FieldName = $field->FieldName;\n if($DynamicFieldsValues->count() > 0){\n foreach ($DynamicFieldsValues as $DynamicFieldsValue) {\n $excel_data[$key]->$FieldName = $DynamicFieldsValue->FieldValue;\n }\n } else {\n $excel_data[$key]->$FieldName = \"\";\n }\n }\n unset($excel_data[$key]->ProductID);\n }\n }\n $excel_data = json_decode(json_encode($excel_data),true);\n if($type=='csv'){\n $file_path = CompanyConfiguration::get('UPLOAD_PATH') .'/Item.csv';\n $NeonExcel = new NeonExcelIO($file_path);\n $NeonExcel->download_csv($excel_data);\n }elseif($type=='xlsx'){\n $file_path = CompanyConfiguration::get('UPLOAD_PATH') .'/Item.xls';\n $NeonExcel = new NeonExcelIO($file_path);\n $NeonExcel->download_excel($excel_data);\n }\n /*Excel::create('Item', function ($excel) use ($excel_data) {\n $excel->sheet('Item', function ($sheet) use ($excel_data) {\n $sheet->fromArray($excel_data);\n });\n })->download('xls');*/\n }\n $query .=',0,\"'.$data['SearchStock'].'\",\"'.$data['SearchDynamicFields'].'\")';\n $data = DataTableSql::of($query,'sqlsrv2')->make(false);\n\n if($DynamicFields['totalfields'] > 0){\n for($i=0;$i<count($data['aaData']);$i++) {\n foreach ($DynamicFields['fields'] as $field) {\n $DynamicFieldsID = $field->DynamicFieldsID;\n $DynamicFieldsValues = DynamicFieldsValue::getDynamicColumnValuesByProductID($DynamicFieldsID,$data['aaData'][$i][0]);\n\n if($DynamicFieldsValues->count() > 0){\n foreach ($DynamicFieldsValues as $DynamicFieldsValue) {\n $data['aaData'][$i]['DynamicFields'][$field->DynamicFieldsID] = $DynamicFieldsValue->FieldValue;\n }\n } else {\n $data['aaData'][$i]['DynamicFields'][$field->DynamicFieldsID] = \"\";\n }\n }\n }\n }\n return Response::json($data);\n// return DataTableSql::of($query,'sqlsrv2')->make();\n }", "public function addUpdateProduct(RexToBddController $rexToBddController) {\n\n $veloVitaTxt = file_get_contents( veloVitaApiuUrl);\n $veloVitaArrayBefore = explode( PHP_EOL, $veloVitaTxt);\n $iZero = array_values(explode('|', $veloVitaArrayBefore[0]));\n\n foreach ($veloVitaArrayBefore as $value) {\n if (substr_count($value, '|') == 14) {\n $explodedArray = explode('|', $value);\n $veloVitaArray[] = array_combine( $iZero, $explodedArray );\n }\n }\n unset($veloVitaArray[0]);\n\n $today = new \\DateTime();\n $today = $today->format('Y-m-d H:i:s');\n $matchingForRex = \"\";\n $brands = [];\n foreach ($veloVitaArray as $product) {\n if ($product['BRAND'] != '') {\n $brands[] = $product['BRAND'];\n }\n\n $supplier = \"Velo Vita\";\n $supplierCode = \"VV\";\n\n $matchingForRex .= \"\n <Product>\n <ShortDescription>\".$this->xmlEscape($product['Description']).\"</ShortDescription>\n <SupplierSKU>\".$this->xmlEscape($product['Model No']).\"</SupplierSKU>\n <ManufacturerSKU>\".$this->xmlEscape($product['EAN']).\"</ManufacturerSKU>\n <ProductType>\".$this->xmlEscape($category).\"</ProductType>\n <Supplier>\".$this->xmlEscape($supplier).\"</Supplier>\n <SupplierCode>\".$this->xmlEscape($supplierCode).\"</SupplierCode>\n <Brand>\".$this->xmlEscape($product['BRAND']).\"</Brand>\n <SupplierBuy>\".$this->adjustDecimal($product['WSALE']).\"</SupplierBuy>\n <POSPrice>\".$this->adjustDecimal($product['F_RETAIL']).\"</POSPrice>\n <WebPrice>\".$this->adjustDecimal($product['F_RETAIL']).\"</WebPrice>\n <LastUpdated>\".$this->xmlEscape($today).\"</LastUpdated>\n </Product>\";\n }\n\n (new RexSoapController)->addBrands($brands);\n $rexToBddController->rexToBddBrands($brands);\n $rexRequest = (new RexSoapController)->addProducts($matchingForRex);\n $rexRequest = preg_replace(\"/(<\\/?)(\\w+):([^>]*>)/\", \"$1$2$3\", $rexRequest->getContent());\n $xml = new \\SimpleXMLElement($rexRequest);\n $body = $xml->xpath('//soapBody')[0];\n $array = json_decode(json_encode((array)$body), TRUE);\n\n return $array['SaveProductsResponse']['SaveProductsResult']['Response'];\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}", "protected function loadFormData() \n {\n\t\t\techo '<br/> **************************************************************';\n\t\t echo '<br/> model VISTA -> funcion loadFormData\t\t\t\t ';\n\t\t echo '<br/> ************************************************************** <br/>';\n //Compruebe la sesión de datos de formularios previamente introducidos.\n $data = JFactory::getApplication()->getUserState('com_codigorecibo.edit.vista.data', array());\n if (empty($data)) \n {\n $data = $this->getItem();\n echo '///////////////////////////////////////////////////////////////////';\n echo '<br/>DENTRO model vista -> data en funcion loadFormData '.$data;\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n echo '/////////////////////////////////////////////////////////////////////';\n // Prime some default values.\n //getstate cojo el id del registro indicando la vista en la que estoy\n\t\t\t\t\t\t\t\t\t//~ if ($this->getState('vista.id') == 0) \n\t\t\t\t\t\t\t\t\t//~ {\n\t\t\t\t\t\t\t\t\t\t//~ $id = $this->getState('vista.id');\n\t\t\t\t\t\t\t\t\t\t//~ echo '<br/> estado Model Vista --> funcion load --> '.$estado;\n\t\t\t\t\t\t\t\t\t\t//~ \n\t\t\t\t\t\t\t\t\t//~ }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n }\n //data = los datos del registro\n $view = $_GET['view'];\n $layout =$_GET['layout'];\n echo '<br/>DEVUELVE = '.$view.'--'.$layout.' ------- model vista -> data en funcion loadFormData '.$data;\n //~ echo '<pre>';\n //~ print_r($this);\n //~ echo '</pre>';\n \n return $data;\n }", "public function loadStockData(){\n if (JeproshopTools::isLoadedObject($this, 'product_id')){\n // By default, the product quantity correspond to the available quantity to sell in the current shop\n $this->quantity = JeproshopStockAvailableModelStockAvailable::getQuantityAvailableByProduct($this->product_id, 0);\n $this->out_of_stock = JeproshopStockAvailableModelStockAvailable::outOfStock($this->product_id);\n $this->depends_on_stock = JeproshopStockAvailableModelStockAvailable::dependsOnStock($this->product_id);\n if (JeproshopContext::getContext()->shop->getShopContext() == JeproshopShopModelShop::CONTEXT_GROUP && JeproshopContext::getContext()->shop->getContextShopGroup()->share_stock == 1){\n $this->advanced_stock_management = $this->useAdvancedStockManagement();\n }\n }\n }", "public function transferWarehouseProductToMagentoStockItem();" ]
[ "0.5839891", "0.5706544", "0.568808", "0.563969", "0.5520001", "0.54985833", "0.5443457", "0.5417065", "0.53986895", "0.5354572", "0.5347832", "0.53006446", "0.52670217", "0.5250371", "0.52405167", "0.52275676", "0.52121246", "0.5193366", "0.5173578", "0.51589", "0.51460457", "0.51302195", "0.51262236", "0.5114744", "0.5095838", "0.50671756", "0.50571805", "0.5055636", "0.50508755", "0.5050815", "0.50476295", "0.50364697", "0.5026368", "0.50228906", "0.50198525", "0.50121903", "0.5006393", "0.50027746", "0.49999854", "0.49916464", "0.49878043", "0.49834538", "0.49684778", "0.49566966", "0.49487895", "0.49476728", "0.4930234", "0.49288115", "0.49244258", "0.49237686", "0.49198583", "0.49145067", "0.49144349", "0.49144349", "0.49103993", "0.49047175", "0.49034435", "0.4892822", "0.48811454", "0.48804575", "0.48755515", "0.48641914", "0.48605904", "0.48596534", "0.48593545", "0.48516908", "0.48413947", "0.48374498", "0.48229676", "0.4821056", "0.4815267", "0.48108023", "0.48102966", "0.48062098", "0.48039553", "0.47827393", "0.47825554", "0.4781319", "0.47809145", "0.47801828", "0.47701308", "0.47698313", "0.4768834", "0.47579008", "0.47501692", "0.47500482", "0.47484896", "0.47454372", "0.473927", "0.47348532", "0.472507", "0.472001", "0.47182798", "0.47174788", "0.47146726", "0.47130385", "0.47076136", "0.47073263", "0.4703124", "0.4698122" ]
0.653533
0
List of Laravel model events that should be recorded public static $logModelEvents = ['created','updated'];
public static function bootLogsModelEvents() { if (property_exists(self::class, 'logModelEvents')) { foreach (self::$logModelEvents as $eventName) { static::$eventName(function ($model) use ($eventName) { $description = $eventName; if ($eventName == 'updating' || $eventName == 'updated') { if ($dirty = $model->getDirty()) { $changed = []; foreach ($dirty as $key => $value) { if (!self::shouldHideKey($key)) { if (self::shouldSanitizeKey($key)) { $changed[] = "'$key': ***"; } else { $changed[] = "'$key': [" . ($model->original[$key] ?? '-') . "]→[$value]"; } } } if ($changed) { $description .= ':' . implode(', ', $changed); } } } $model->logModelEvent($description); }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function getModelEventsToRecord()\n {\n if (isset(static::$modelEventsToRecord)) {\n return static::$modelEventsToRecord;\n }\n\n return ['created', 'updated', 'deleted'];\n }", "protected static function recordableEvents()\n {\n if (isset(static::$recordableEvents)) {\n return static::$recordableEvents;\n }\n\n return ['created', 'updated', 'deleted'];\n }", "protected static function getHasAuditColumnModelEvents()\n {\n if (isset(static::$auditColumnEvents)) {\n return static::$auditColumnEvents;\n }\n\n return collect([\n 'creating',\n 'updating',\n 'deleting',\n ]);\n }", "public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }", "public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }", "public function getModelEvents();", "public function getCompatibleEvents()\n {\n return [\n TaskLinkModel::EVENT_CREATE_UPDATE\n ];\n }", "protected static function getRecordActivityEvents() {\n if (isset(static::$recordEvents)) {\n return static::$recordEvents;\n }\n\n //events by default if recordEvents is not set\n return [\n 'updating',\n// 'deleted',\n ];\n }", "function Logging_model()\r\n {\r\n parent::Model();\r\n }", "public function model()\n {\n return ActivityLog::class;\n }", "public function model()\n {\n return 'App\\Log';\n }", "public function broadcastOn()\n {\n return ['RecordChanges'];\n }", "public function boot()\n {\n parent::boot();\n\n //INI eventos de eloquent para registrar actividad de los modelos\n Event::listen('eloquent.created: *', function($model){\n $arr_class = array(\"Logdb\",\"Loginout\");\n $class = class_basename($model);\n if(in_array($class, $arr_class) || empty(isset(auth()->user()->id)))\n return null;\n $log = Logdb::record('created', $class); \n });\n Event::listen('eloquent.updated: *', function($model){\n $arr_class = array(\"Logdb\",\"Loginout\");\n $class = class_basename($model);\n if(in_array($class, $arr_class) || empty(isset(auth()->user()->id)))\n return null;\n $log = Logdb::record('updated', $class); \n });\n Event::listen('eloquent.deleted: *', function($model){\n $arr_class = array(\"Logdb\",\"Loginout\");\n $class = class_basename($model);\n if(in_array($class, $arr_class) || empty(isset(auth()->user()->id)))\n return null;\n $log = Logdb::record('deleted', $class); \n });\n Event::listen('eloquent.restored: *', function($model){\n $arr_class = array(\"Logdb\",\"Loginout\");\n $class = class_basename($model);\n if(in_array($class, $arr_class) || empty(isset(auth()->user()->id)))\n return null;\n $log = Logdb::record('restored', $class); \n });\n //FIN eventos de eloquent para registrar actividad de los modelos\n }", "public static function events($models, $events = array(), $options = array()) {\n\t\t$logmodel = '\\\\'.get_called_class();\n\t\tif (empty($events)) {\n\t\t\t$events = array('create','update','delete');\n\t\t}\n\t\tif (in_array('save',$events)) {\n\t\t\tforeach ($events as $i => $v) {\n\t\t\t\tif ($v == 'save') {\n\t\t\t\t\tunset($events[$i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$events[] = 'create';\n\t\t\t$events[] = 'update';\n\t\t}\n\t\tforeach ($models as $model) {\n\t\t\tforeach ($events as $event) {\n\t\t\t\t$filter = $event;\n\t\t\t\tif ($event == 'create' || $event == 'update') {\n\t\t\t\t\t$filter = 'save';\n\t\t\t\t\tif ($event == 'create' && in_array('update', $events)) {\n\t\t\t\t\t\tcontinue; // so save filter is only added once.\n\t\t\t\t\t}\n\t\t\t\t} elseif($event == 'read') {\n\t\t\t\t\t$filter = 'find';\n\t\t\t\t}\n\n\t\t\t\t$model::applyFilter($filter, function($self, $params, $chain) use ($logmodel, $events) {\n\t\t\t\t\t$filteredMethod = $chain->method();\n\t\t\t\t\t$action = (isset($params['record']->id)) ? 'update' : 'create';\n\t\t\t\t\t$result = $chain->next($self, $params, $chain);\n\t\t\t\t\tswitch ($filteredMethod) {\n\t\t\t\t\t\tcase 'find' :\n\t\t\t\t\t\t\tif ($params['type'] != 'first') {\n\t\t\t\t\t\t\t\treturn $result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$action = 'read';\n\t\t\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t\t\t$pk = $result->id;\n\t\t\t\t\t\t\t\t$title = $result->{$self::meta('title')};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'save' :\n\t\t\t\t\t\t\tif (!in_array($action, $events)) {\n\t\t\t\t\t\t\t\treturn $result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$pk = $params['record']->id;\n\t\t\t\t\t\t\t$title = $params['record']->{$self::meta('title')};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$action = $filteredMethod;\n\t\t\t\t\t\t\t$pk = $params['record']->id;\n\t\t\t\t\t\t\t$title = $params['record']->{$self::meta('title')};\n\t\t\t\t\t}\n\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t$logData = array(\n\t\t\t\t\t\t\t'model' => $self::invokeMethod('_name'),\n\t\t\t\t\t\t\t'action' => $action,\n\t\t\t\t\t\t\t'pk' => $pk,\n\t\t\t\t\t\t\t'title' => $title\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$logmodel::create($logData)->save();\n\t\t\t\t\t}\n\t\t\t\t\treturn $result;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "public function definition(): array\n {\n return [\n 'message' => new CustomEventMessage(new TestModel(), 'testEvent')\n ];\n }", "public static function bootHistoryTrait() {\n// parent::boot();\n\n foreach (static::getRecordActivityEvents() as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n try {\n $modelRevisionObj = self::getRevisionObject($model);\n \n $diff = static::getDiff($model);\n\n if (!$diff['before'] && !$diff['after']) {\n return true;\n }\n\n $relations = $model->getRelations();\n \n foreach ($diff['before'] as $key => $value) {\n\n if (static::isRelated($key)) {\n $relatedModel = static::getRelatedModel($model, $key);\n \n //check related model need to be logged\n if(!$relatedModel)\n continue;\n \n //load related model and get old value\n $relatedModelObj = new $relatedModel;\n $relModel = $relatedModelObj::find($value);\n\n $relations = static::getRelatedModelRelations($model, $key);\n\n $modelBefore = $relModel->load($relations);\n\n //get new value\n $relModel = $relatedModelObj::find($diff['after'][$key]);\n $modelAfter = $relModel->load($relations);\n\n $accessColumnValue = static::getRelatedModelColumn($model, $key);\n\n $row['old_value'] = array_get($modelBefore->toArray(), $accessColumnValue);\n $row['new_value'] = array_get($modelAfter->toArray(), $accessColumnValue);\n } else {\n $row['old_value'] = $value;\n $row['new_value'] = $diff['after'][$key];\n }\n\n $mutator = 'get' . studly_case($key) . 'Attribute';\n \n if (method_exists($model, $mutator)) {\n $key = $model->$mutator($key);\n }\n \n $row['column'] = $key;\n\n $foreign_key = $model->foreign_key;\n// \n// //set history relation col to appropriate value\n $row['revisionable_id'] = $model->$foreign_key;\n $row['user_id'] = \\Auth::user()->id;\n\n $modelRevisionObj::create($row);\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n });\n \n return true;\n }\n }", "public function trackModel(TrackModelRequest $request)\n {\n $model = $request->input('model');\n $revisions = Revision::where(['revisionable_type' => $model])\n ->orderBy('created_at','desv')->get();\n\n $result = [];\n $lastDate = '';\n foreach ($revisions as $revision) {\n $date = $revision->created_at->toDateString();\n if ($lastDate != $date) {\n $result[] = [\n 'time' => $revision->created_at->toDateString(),\n 'type' => 'time-label'\n ];\n }\n $result[] = [\n 'time' => $revision->created_at->toTimeString(),\n 'icon' => 'fa-user',\n 'iconBackground' => $this->getIconBackground($revision),\n 'header' => $this->getMessage($revision)\n\n ];\n $lastDate = $date;\n }\n\n return $result;\n\n\n }", "public function events() {\n return array_merge(parent::events(), array(\n 'onBeforeSave' => 'beforeSave',\n 'onAfterSave' => 'afterSave',\n 'onBeforeDelete' => 'beforeDelete',\n 'onAfterDelete' => 'afterDelete',\n 'onBeforeFind' => 'beforeFind',\n 'onAfterFind' => 'afterFind',\n ));\n }", "function userLogs() { \n $model = config('app.AuditTrails');\n return new $model;\n }", "protected function _getLog() {\n return $this->_model;\n }", "public function logging()\n\t{\n\t\treturn $this->neoeloquent->logging();\n\t}", "public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }", "public function events()\n {\n return [Controller::EVENT_AFTER_ACTION => 'afterAction'];\n }", "public function eventLog() {\n\t\treturn $this->_eventLog;\n\t}", "public function boot()\n {\n parent::boot();\n\n // $request = request();\n // dd($request);\n\n //INI eventos de eloquent para registrar actividad de los modelos\n Event::listen('eloquent.created: *', function($model){\n $class = class_basename($model);\n if($class=='Activity' || empty(isset(auth()->user()->id)))\n return null;\n $log = Activity::record('created', $class); \n });\n Event::listen('eloquent.updated: *', function($model){\n $class = class_basename($model);\n if($class=='Activity' || empty(isset(auth()->user()->id)))\n return null;\n $log = Activity::record('updated', $class); \n });\n Event::listen('eloquent.deleted: *', function($model){\n $class = class_basename($model);\n if($class=='Activity' || empty(isset(auth()->user()->id)))\n return null;\n $log = Activity::record('deleted', $class); \n });\n Event::listen('eloquent.restored: *', function($model){\n $class = class_basename($model);\n if($class=='Activity' || empty(isset(auth()->user()->id)))\n return null;\n $log = Activity::record('restored', $class); \n });\n //FIN eventos de eloquent para registrar actividad de los modelos\n\n\n }", "public function logs() {\n return $this->hasMany('EAMES\\Models\\Log');\n }", "public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }", "public function eventsLog()\n\t{\n\t\tif ($this->_eventsLog === false) {\n\t\t\t$this->_eventsLog = self::mergeHandlers($this->events());\n\t\t}\n\t\treturn $this->_eventsLog;\n\t}", "public function getObservableEvents()\n {\n return array_merge(\n [\n 'creating', 'created', 'updating', 'updated',\n 'deleting', 'deleted', 'saving', 'saved',\n 'fetching', 'fetched'\n ],\n $this->observables\n );\n }", "public function getCompatibleEvents()\r\n {\r\n return array(\r\n TaskModel::EVENT_DAILY_CRONJOB,\r\n );\r\n }", "public function events()\n {\n return [\n ActiveRecord::EVENT_BEFORE_VALIDATE => 'beforeValidate',\n ];\n }", "public function logs()\n {\n return $this->hasMany('App\\Model\\Log');\n }", "public function events()\n {\n return $this->events;\n }", "public function events()\n {\n return $this->events;\n }", "protected static function getActivitiesToRecord()\n {\n return ['created'];\n }", "protected static function getActivitiesToRecord()\n {\n return ['created'];\n }", "public function getLoggableAttributes(): array\n {\n return [];\n }", "function model()\n {\n return \\App\\Http\\Model\\MoneyLog::class;\n }", "public function model()\n {\n return GuangDianHelpLog::class;\n }", "public function getObservableEvents()\n {\n return array_merge(\n [\n 'retrieved', 'creating', 'created', 'updating', 'updated',\n 'saving', 'saved', 'restoring', 'restored', 'replicating',\n 'deleting', 'deleted', 'forceDeleted',\n ],\n static::getRelationshipObservables(),\n $this->observables,\n );\n }", "protected static function boot()\n {\n parent::boot();\n\n static::created(function($model)\n {\n //dd($model);\n });\n\n static::updated(function($model)\n {\n //dd($model);\n });\n\n\n }", "public function getCompatibleEvents()\n {\n return array(\n TaskModel::EVENT_MOVE_COLUMN,\n );\n }", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "public function behaviors()\n {\n return [\n 'timestamp' => [\n 'class' => 'yii\\behaviors\\TimestampBehavior',\n 'attributes' => [\n ActiveRecord::EVENT_BEFORE_INSERT => ['createdAt', 'updatedAt'],\n ActiveRecord::EVENT_BEFORE_UPDATE => ['updatedAt'],\n ]\n ]\n ];\n }", "public function authEventLogs()\n {\n return $this->hasMany('App\\AuthEventLog');\n }", "public function logBeforeSave($event)\n {\n $logAttributes = $this->logAttributes;\n\n $this->_to_save_log = false;\n foreach ($logAttributes as $key => $val) {\n if (is_int($key)) {\n // Значения - это имена атрибутов\n $aName = $val;\n $aValue = $this->owner->getAttribute($aName);\n } elseif ($val instanceof \\Closure) {\n // Ключ - имя атрибута, значение - вычисляемое\n $aName = $key;\n $aValue = call_user_func($val, $this->owner);\n } else {\n $aName = $key;\n $aValue = $val;\n }\n\n if ($this->owner->hasAttribute($aName)) {\n if ($aName === $this->timeField) {\n continue;\n } elseif ($this->owner->getOldAttribute($aName) != $aValue) {\n $this->_to_save_attributes[$aName] = $aValue;\n $this->_to_save_log = true;\n $this->_changed_attributes[] = $aName;\n } else {\n $this->_to_save_attributes[$aName] = $aValue;\n }\n } else {\n $this->_to_save_attributes[$aName] = $aValue;\n }\n\n if ($this->owner->hasHiddenAttribute($aName)) {\n $ahValue = $this->owner->getHiddenAttribute($aName);\n\n (($ahValue === null) || ($ahValue->getAttributes() === null))\n ? $ahoValue = null\n : $ahoValue = json_encode($this->owner->getHiddenAttribute($aName)->prepareSaveJsonB());\n\n if ($aName === $this->timeField) {\n continue;\n } elseif ($this->owner->getOldAttribute($aName) != $ahoValue) {\n $this->_to_save_attributes[$aName] = $ahValue;\n $this->_to_save_log = true;\n $this->_changed_attributes[] = $aName;\n } else {\n $this->_to_save_attributes[$aName] = $ahValue;\n }\n }\n }\n\n if ($this->_to_save_log) {\n $time = static::returnTimeStamp();\n $this->owner->{$this->timeField} = $time;\n $this->_to_save_attributes[$this->timeField] = $time;\n } else {\n return true;\n }\n\n // Check current version of the record before update\n if (isset($this->versionField)) {\n if ($event->name === 'beforeUpdate') {\n $row = $this->owner->find()->where($this->owner->getPrimaryKey(true))->select($this->versionField)->asArray()->one();\n if (isset($row[$this->versionField]) && (string)$row[$this->versionField] !== (string)$this->owner->getAttribute($this->versionField)) {\n throw new StaleObjectException('The object being updated is outdated.');\n }\n }\n $this->setNewVersion();\n }\n $this->_to_save_attributes[$this->versionField] = $this->owner->{$this->versionField};\n\n return true;\n }", "public function implementedEvents(): array\n {\n $eventMap = [\n 'Model.beforeMarshal' => 'beforeMarshal',\n 'Model.beforeFind' => 'beforeFind',\n 'Model.beforeSave' => 'beforeSave',\n 'Model.afterSave' => 'afterSave',\n 'Model.afterSaveCommit' => 'afterSaveCommit',\n 'Model.beforeDelete' => 'beforeDelete',\n 'Model.afterDelete' => 'afterDelete',\n 'Model.afterDeleteCommit' => 'afterDeleteCommit',\n 'Model.beforeRules' => 'beforeRules',\n 'Model.afterRules' => 'afterRules',\n ];\n $events = [];\n\n foreach ($eventMap as $event => $method) {\n if (!method_exists($this, $method)) {\n continue;\n }\n $events[$event] = $method;\n }\n\n return $events;\n }", "public function __construct($model)\n {\n\n\n if(!env('ADMIN_LOG','true')){\n return true;\n }\n\n $controllerModel = new Controller();\n $method = $controllerModel->getCurrentAction();\n\n\n $controller = \\Route::current()->getName();\n\n if($model->adminLogTabel){\n $controller = $model->adminLogTabel;\n }\n\n $action = $method['method'];\n\n\n $adminLogData = $model->adminLogData;\n $adminLogName = $model->adminLogName;\n\n\n if(empty($adminLogData) || !$adminLogName ){\n if($model->adminLogMsg){\n $controllerModel->setEventAdminLog($controller,$model->adminLogMsg);\n return true;\n }else{\n return false;\n }\n }\n;\n $str = '';\n if($action == 'del'){\n $str.=('删除了'.$adminLogData['admin_log_name'].':('.$model[$adminLogName].')');\n $controllerModel->setEventAdminLog($controller,$str);\n return true;\n }\n\n $param = Input::get('param');\n\n if(empty($param)){\n return false;\n }\n\n if(empty($model['original'])){\n\n $str.=('新增'.$adminLogData['admin_log_name'].':('.$model['attributes'][$adminLogName].')<br>');\n\n if($model->adminLogMsg){\n $str.= $model->adminLogMsg;\n }\n\n $controllerModel->setEventAdminLog($controller,$str);\n return true;\n }\n\n $data = $model->toArray();\n\n if(!$data){\n return false;\n }\n $messages = array_diff_assoc($model['original'], $model['attributes']);\n\n\n if($messages){\n foreach($messages as $key=>$val){\n if(isset($adminLogData[$key])){\n if(is_array($val)){\n if( !isset($param[$key])){\n continue;\n }\n $str.=('修改了['.$model[$adminLogName].'] '.$adminLogData['admin_log_name'].$adminLogData[$key].'<br>');\n }else{\n if(is_array($adminLogData[$key])){\n $name = $adminLogData[$key]['name'];\n $nameKey = $adminLogData[$key]['val'][$model['original'][$key]];\n $paramKey= $adminLogData[$key]['val'][$model['attributes'][$key]];\n }else{\n $name = $adminLogData[$key];\n $nameKey = $model['original'][$key];\n $paramKey = $model['attributes'][$key];\n }\n $str.=('将['.$model[$adminLogName].'] '.$adminLogData['admin_log_name'].$name.'('.$nameKey.')'.'修改为:('.$paramKey.')<br>');\n }\n }\n }\n }\n if($model->adminLogMsg){\n $str.= $model->adminLogMsg;\n }\n\n if(!$str){\n return false;\n }\n\n $controllerModel->setEventAdminLog($controller,$str);\n return true;\n }", "protected static function getAuditableEvents()\n {\n if (isset(static::$auditableEvents)) {\n return static::$auditableEvents;\n }\n\n return Config::get('auditing.events');\n }", "public function onAfterSave($event)\r\n {\r\n \tif($this->logTableHistory && get_class($this->mLogHistory)==='Loghistory' )\r\n \t\tif($this->mLogHistory->isDifferences($this->attributes,array('create_by','create_dt','update_by','update_dt')))\r\n \t\t\t$this->mLogHistory->saveDifferences();\r\n }", "public function behaviors()\n {\n return [\n 'timestamp' => [\n 'class' => '\\yii\\behaviors\\TimestampBehavior',\n 'attributes' => [\n ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],\n ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],\n ],\n 'value' => new Expression('NOW()'),\n ],\n ];\n }", "public function logs()\n {\n return $this->hasMany('App\\Log');\n }", "public static function getEntityTypeEvents() {\n $event = ['onEntityTypeEvent', 100];\n $events[EntityTypeEvents::CREATE][] = $event;\n $events[EntityTypeEvents::UPDATE][] = $event;\n $events[EntityTypeEvents::DELETE][] = $event;\n return $events;\n }", "protected function makeChangeModel()\n {\n return new Change([\n 'recorded_at' => Carbon::now(),\n ]);\n }", "public function listLogs(): array\n {\n return [];\n }", "public static function getEvents()\n {\n $events = parent::getEvents();\n $events[] = self::ON_FIRST_LOGIN;\n $events[] = self::ON_LOGIN;\n $events[] = self::ON_LOGOUT;\n $events[] = self::ON_PASSWORD_CHANGE;\n\n return $events;\n }", "public function setRecordLog() {\n \t$msg = '';\n \t$defaultFilterFields = array( 'id', 'modify_user_id' ,'modify_time', 'create_user_id', 'create_time','check_user_id','check_time');\n \t$addFilterFields = !empty($this->filterFields) ? $this->filterFields : array();\n \t$filterFields = array_merge($defaultFilterFields,$addFilterFields);\n \tforeach ( $this->getAttributes() as $key => $val ) {\n \t\tif ( ! $this->getIsNewRecord() && $val == $this->beforeSaveInfo[$key] ) {\n \t\t\tcontinue;\n \t\t}\n// \t\t$label = $this->getAttributeLabel($key);\n $label = get_class($this) . ':'.$key; //by shenll\n \t\tif (in_array($key, $filterFields)) {\n \t\t\tcontinue;\n \t\t}else {\n \t\t\tif ( $this->getIsNewRecord() ) {\n \t\t\t\t$msg .= MHelper::formatInsertFieldLog($label, $val);\n \t\t\t} else {\n \t\t\t\t$msg .= MHelper::formatUpdateFieldLog($label, $this->beforeSaveInfo[$key], $val);\n \t\t\t}\n \t\t}\n \t}\n //\treturn $msg;\n \t$this->addLogMsg($msg);\n }", "public function getNotificationsCollection()\n {\n return Mage::getModel('kdcatalogupdates/log')->getCollection();\n }", "public function events()\n {\n return [Controller::EVENT_BEFORE_ACTION => 'beforeAction'];\n }", "public function events()\n {\n return [Controller::EVENT_BEFORE_ACTION => 'beforeAction'];\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents() { return $this->_events; }", "public function logs()\n {\n return $this->hasMany(Log::class);\n }", "function getEvents() {\n return [];\n }", "public function behaviors() \r\n {\r\n return [\r\n TimestampBehavior::className(),\r\n ];\r\n }", "public function getLog()\n\t{\n\t\t$models = CWizardLog::model()->forSession($this->session)->findAll();\n\t\tfor ($log = array(); list(, $model) = each($models);\n\t\t $log[$model->action_id] = $model) ;\n\t\tif (!count($log))\n\t\t\t$log = array(new CWizardLog);\n\t\treturn $log;\n\t}", "public function created($model)\n {\n }", "public function getEvents()\n {\n //\n\n return Event::all();\n }", "public static function __events () {\n \n }", "function index() {\n\t// and it would behave as a normal model\n\t$logs = $this->LoginLog->findAll();\n\t$this->set('logs', $logs);\n\t}", "public function afterSave(Model $model, $created) {\n if ($created && !$this->_shouldProcess('create', $model)) {\n return;\n }\n\n if (!$created && !$this->_shouldProcess('update', $model)) {\n return;\n }\n\n $audit = [$model->alias => $this->_getModelData($model)];\n\n\n\n\n\n $audit[$model->alias][$model->primaryKey] = $model->id;\n $source = $this->_getSource($model);\n\n $data = [\n 'Audit' => [\n 'event' => $created ? 'CREATE' : 'EDIT',\n 'model' => $model->alias,\n 'entity_id' => $model->id,\n 'json_object' => json_encode($audit),\n 'source_id' => $source['id'],\n 'source_ip' => $source['ip'],\n 'source_url' => $source['url'],\n 'description' => $source['description'],\n 'user_id' => $this->getCurrentUser()\n ]\n ];\n\n $updates = [];\n foreach ($audit[$model->alias] as $property => $value) {\n // Don't create delta for new records\n if ($created) {\n continue;\n }\n\n // Don't create delta for virtual fields\n if ($model->hasMethod('isVirtualField') && $model->isVirtualField($property)) {\n continue;\n }\n\n // Don't create fields for those that are ignored\n if (in_array($property, $this->settings[$model->alias]['ignore'])) {\n continue;\n }\n\n // Don't create delta for new values\n if (!array_key_exists($property, $this->_original[$model->alias])) {\n continue;\n }\n\n // Don't create delta for unchanged values\n if ($this->_original[$model->alias][$property] == $value) {\n continue;\n }\n\n $delta = [\n 'AuditDelta' => [\n 'property_name' => $property,\n 'old_value' => $this->_original[$model->alias][$property],\n 'new_value' => $value\n ]\n ];\n\n array_push($updates, $delta);\n }\n\n $audit = ClassRegistry::init('AuditLog.Audit');\n\n if ($created || count($updates)) {\n\n $audit->create();\n $audit->save($data);\n if ($created && $model->hasMethod('afterAuditCreate')) {\n $model->afterAuditCreate($model);\n }\n\n if (!$created && $model->hasMethod('afterAuditUpdate')) {\n $model->afterAuditUpdate($model, $this->_original, $updates, $audit->id);\n }\n }\n\n foreach ($updates as $delta) {\n $delta['AuditDelta']['audit_id'] = $audit->id;\n $audit->AuditDelta->create();\n $audit->AuditDelta->save($delta);\n if (!$created && $model->hasMethod('afterAuditProperty')) {\n $model->afterAuditProperty(\n $model, $delta['AuditDelta']['property_name'], $this->_original[$model->alias][$delta['AuditDelta']['property_name']], $delta['AuditDelta']['new_value']\n );\n }\n }\n\n if (!empty($this->_original[$model->alias])) {\n unset($this->_original[$model->alias]);\n }\n\n return true;\n }", "public function getEvents()\n\t{\n\t\treturn $this->events;\n\t}", "public function behaviors()\n {\n return [\n TimestampBehavior::className(),\n ];\n }", "public function behaviors()\n {\n return [\n TimestampBehavior::className(),\n ];\n }", "public function behaviors()\n {\n return [\n TimestampBehavior::className(),\n ];\n }", "public function behaviors()\n {\n return [\n TimestampBehavior::className(),\n ];\n }", "public function getEventNameAllowableValues()\n {\n return [\n self::EVENT_NAME_EMAIL_RECEIVED,\n self::EVENT_NAME_NEW_EMAIL,\n self::EVENT_NAME_NEW_CONTACT,\n self::EVENT_NAME_NEW_ATTACHMENT,\n self::EVENT_NAME_EMAIL_OPENED,\n self::EVENT_NAME_EMAIL_READ,\n self::EVENT_NAME_DELIVERY_STATUS,\n self::EVENT_NAME_BOUNCE,\n self::EVENT_NAME_BOUNCE_RECIPIENT,\n self::EVENT_NAME_NEW_SMS,\n ];\n }", "public function behaviors()\n\t{\n\t return array(\n\t // Classname => path to Class\n\t 'ActiveRecordLogableBehavior'=>\n\t 'application.behaviors.ActiveRecordLogableBehavior',\n\t );\n\t}", "public function getLogs()\n {\n return $this->Logs;\n }", "public function getEvents() {\n return $this->_events;\n }", "public function behaviors()\n {\n return [\n 'class' => TimestampBehavior::className(),\n ];\n }", "public function behaviors()\n\t\t{\n\t\t\treturn [\n\t\t\t\t\t// This set the create_at and updated_at by create, and \n\t\t\t\t\t// update_at by update, with the date time / timestamp\n\t\t\t\t\t[\n\t\t\t\t\t\t'class' => TimestampBehavior::className(),\n\t\t\t\t\t\t'createdAtAttribute' => 'created_at',\n\t\t\t\t\t\t'updatedAtAttribute' => 'updated_at',\n\t\t\t\t\t\t'value' => new Expression('NOW()'),\n\t\t\t\t\t],\n\t\t\t ];\n\t\t}", "public function behaviors()\n {\n\n return [\n 'timestamp' => [\n 'class' => TimestampBehavior::className(),\n 'attributes' => [\n ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],\n ActiveRecord::EVENT_BEFORE_UPDATE => 'updated',\n ],\n 'value' => function(){ return date('Y-m-d H:i:s'); /* MySql DATETIME */},\n ],\n 'autouserid' => [\n 'class' => BlameableBehavior::className(),\n 'attributes' => [\n ActiveRecord::EVENT_BEFORE_INSERT => ['user_id'],\n ],\n ],\n ];\n }", "protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}", "protected static function bootUserLogger()\n {\n// parent::boot();\n\n static::creating(function ($model) {\n $user = Auth::user();\n\n if($user)\n $model->created_by = $user->id;\n });\n\n static::updating(function ($model) {\n $user = Auth::user();\n\n if($user)\n $model->updated_by = $user->id;\n });\n }", "public function getLogs() {\n return $this->Logs;\n }", "public function messages() {\n return $this->get_from_model(__FUNCTION__);\n }", "public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }", "public function behaviors(){\n return [\n [\n 'class' => TimestampBehavior::className(),\n //'createdAtAttribute' => 'create_time',\n //'updatedAtAttribute' => 'update_time',\n // 'value' => new Expression('NOW()'),\n ],\n [\n 'class' => BlameableBehavior::className(),\n //'createdByAttribute' => 'author_id',\n //'updatedByAttribute' => 'updater_id',\n ]\n ];\n }", "public function getEvents()\n {\n return $this->_events;\n }", "public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n// Events::preUpdate,\n ];\n\n }", "public static function boot()\n {\n parent::boot();\n\n // log customer creation\n self::created(function($model){\n UserLog::log($model->id, UserLogEvent::EVENT_CUSTOMER_ADDED, $model->id);\n });\n }", "public function logs()\n {\n return $this->hasMany('App\\JobHunt\\VacancyLog');\n }" ]
[ "0.75341773", "0.6896052", "0.6525554", "0.6388823", "0.6388823", "0.6228684", "0.621511", "0.61946315", "0.61371857", "0.6107221", "0.6067984", "0.60408044", "0.59189606", "0.58752406", "0.58464116", "0.5836131", "0.57916987", "0.577985", "0.5735789", "0.5732192", "0.5731368", "0.57241756", "0.57175", "0.57163686", "0.5681277", "0.5673092", "0.566659", "0.56623596", "0.5661321", "0.55972344", "0.55910176", "0.5549668", "0.5531194", "0.5531194", "0.5526925", "0.5526925", "0.5524644", "0.5522443", "0.5480942", "0.5472142", "0.54600155", "0.5441764", "0.54271203", "0.54203206", "0.5396588", "0.5386033", "0.53802866", "0.53572476", "0.5348647", "0.5347149", "0.5342335", "0.53381914", "0.53375685", "0.53342927", "0.5329885", "0.5320486", "0.5308872", "0.5294945", "0.5289127", "0.5289127", "0.5287679", "0.5287679", "0.5287679", "0.5287679", "0.5287679", "0.5287679", "0.5287679", "0.5287679", "0.5250798", "0.524197", "0.5239218", "0.52227473", "0.52169687", "0.52162015", "0.5208453", "0.52025336", "0.51982224", "0.51975816", "0.51964116", "0.5188675", "0.5188675", "0.5188675", "0.5188675", "0.51847315", "0.5180374", "0.5178946", "0.51780444", "0.517754", "0.5177219", "0.5170369", "0.5164106", "0.51548564", "0.5149583", "0.51461995", "0.5144925", "0.5134743", "0.512646", "0.51113945", "0.5098759", "0.5097922" ]
0.76568913
0
INSERTAR UNA NUEVA DEPENDENCIA
function insertDependence($data) { $this->db->insert('dependence', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "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($tarConvenio);", "function pruebaInsertarInterfaz() { // ---> prueba unitaria de la funcion Insertar interfaz \n $test = $this->insertarInterfaz(); //el metodo post para prueba esta en el archio interface.js en el la funcion para insertar interfaaz\n $expected_result = \"true\";\n $test_name = 'comprobar si inserta o no una interfaz en la BD';\n $this->unit->run($test, $expected_result, $test_name);\n echo $this->unit->report();\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($cotizacion);", "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($contenido);", "public function insert($actividades_fuera);", "public function insert($producto);", "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 }", "function ajouter_article($nom,$prix,$quantite,$description,$type){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO article(id_article, nom_article, prix_article, quantite_article, description_article,type_article) VALUES (:id_article, :nom_article, :prix_article,:quantite_article, :description_article,:type_article)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_article'=>'',\r\n\t\t'nom_article'=>$nom,\r\n\t\t'prix_article'=>$prix,\r\n\t\t'quantite_article'=>$quantite,\r\n\t\t'description_article'=>$description,\r\n\t\t'type_article'=>$type));\r\n\r\n}", "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 insert($usuario_has_hojaruta);", "function registra_noleggio($payload, $conn)\n {\n $restituita = 'N';\n $targa = $payload['targa'];\n $cf = $payload['cf'];\n $inizio = $payload['inizio'];\n $fine = $payload['fine'];\n $stmt = $conn->prepare('INSERT INTO noleggi(targa,cf, inizio, fine, restituita) VALUES (?,?,?,?,?)');\n if(!$stmt)\n echo $conn->error;\n $stmt->bind_param(\"sssss\", $targa, $cf, $inizio, $fine, $restituita);\n $stmt->execute();\n echo 'noleggio è stato inserito';\n }", "function ajouter_commande($date,$id_client,$prix_commande){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO commande(id_commande, date_commande, client_id, prix_commande) VALUES (:id_commande, :date_commande, :client_id, :prix_commande)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_commande'=>'',\r\n\t\t'date_commande'=>$date,\r\n\t\t'client_id'=>$id_client,\r\n\t\t'prix_commande'=>$prix_commande));\r\n\r\n}", "public static function Nueva_Cotizacion_2($version, $elaboracion, $solicitud, $dias, $numero, $condiciones, $id_cliente, $id_cliente_facturar, \n $muestreado, $prioridad, $tipo_muestreo, $subtotal, $descuento, $impuesto, $total, $id_usuario, $estado, $observaciones, $logistica, $descuento_logistica, $cedula_no, $cliente_no, $empresa_no, $direccion_no, $telefonos_no, $cantidad_logistica)\n {\n // Sentencia INSERT\n $comando = \"INSERT INTO cotizaciones (version, fecha_elaboracion, fecha_solicitud, dias_vigencia, num_cotizacion, id_condiciones, id_cliente, \n id_cliente_factura, muestreado_por, prioridad, tipo_muestreo, descuento, subtotal, impuesto, \n total, id_usuario, estado, impreso, enviado, razon_perdida, observaciones, logistica, descuento_logistica, cedula_no, cliente_no, empresa_no, direccion_no, telefonos_no, cantidad_logistica) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,'',?,?,?,?,?,?,?,?,?)\";\n\n // Preparar la sentencia\n $sentencia = Database::getInstance()->getDb()->prepare($comando);\n\n return $sentencia->execute(\n array(\n $version,\n $elaboracion,\n $solicitud,\n $dias,\n $numero,\n $condiciones,\n $id_cliente_facturar,\n $id_cliente,\n $muestreado,\n $prioridad,\n $tipo_muestreo,\n $descuento,\n $subtotal,\n $impuesto,\n $total,\n $id_usuario,\n $estado,\n $observaciones,\n $logistica,\n $descuento_logistica,\n $cedula_no,\n $cliente_no,\n $empresa_no,\n $direccion_no,\n $telefonos_no, \n $cantidad_logistica\n )\n );\n\n }", "public function insertarDatosSQL(){\n $this->comentario->insertarComentario(\n \t$this->idUser,\n \t$this->date,\n \t$this->comentarioText,\n \t$this->producto);\n }", "function insert($tabla, $campos, $valores){\n #se forma la instruccion SQL\n $q = 'INSERT INTO '.$tabla.' ('.$campos.') VALUES ('.$valores.')';\necho $q;\n $resultado = $this->consulta($q);\n \n if($resultado) return true;\n else return false;\n}", "protected function fijarSentenciaInsert(){}", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "public function catalogoInsert($genero, $servicio, $categoria, $descripcion, $detalle, $foto, $precio)\n {\n $sql = \"INSERT INTO catalogo (cod_genero,cod_servicio,cod_categoria,descripcion,detalle,foto,precio)\n VALUES ('$genero','$servicio','$categoria','$descripcion','$detalle','$foto','$precio')\";\n\n if (mysqli_query($this->open(), $sql)) {\n echo \"<script> alert('Registrado Correctamente') </script>\";\n } else {\n echo \"<script> alert('Error de Registro')\";\n }\n\n $this->catalogoSelect();\n }", "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}", "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 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($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function insert($otros_votos);", "function company_insert($table, $data) {\n\n global $devel, $tablas, $I;\n\n if (!$data) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para INSERT en $table\");\n }\n\n $VALUES = values($data);\n $FIELDS = fields($data);\n\n $query = \"INSERT INTO `$table` ($FIELDS) VALUES ($VALUES)\";\n sql($query, $table, 'INSERT');\n $I++;\n}", "public function insertar($idordencompra, $nrofactura, $idproveedor, $idpersonal, $idsucursal, $idformapago, $idtipodoc, $iddeposito, \n $fecha_hora, $obs, $monto_compra, $idmercaderia, $cantidad, $precio, $total_exenta, $total_iva5, $total_iva10, $liq_iva5, $liq_iva10, $cuota){\n\n $sql = \"INSERT INTO compras (idordencompra, nrofactura, idproveedor, idpersonal, idsucursal, idformapago, idtipodocumento, iddeposito, fecha, obs, monto, cuotas, estado) \n VALUES ('$idordencompra', '$nrofactura', '$idproveedor', '$idpersonal', '$idsucursal', '$idformapago', '$idtipodoc', '$iddeposito', '$fecha_hora', '$obs', '$monto_compra', '$cuota', '1')\";\n \n $idcompranew = ejecutarConsulta_retornarID($sql);\n\n $num_elementos=0;\n $sw=true;\n\n while($num_elementos < count($idmercaderia)){\n\n $sql_detalle = \"INSERT INTO compras_detalle (idcompra, idmercaderia, cantidad, precio) \n VALUES ('$idcompranew', '$idmercaderia[$num_elementos]', '$cantidad[$num_elementos]', '$precio[$num_elementos]')\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n\n $num_elementos =$num_elementos + 1;\n }\n\n //aca realimazamos la insercion en la tabla libro compras\n\n $sql2 = \"INSERT INTO libro_compras (idcompra, idproveedor, fecha, montoexenta, montoiva5, montoiva10, grabiva5, grabiva10, montopagado) \n VALUES ('$idcompranew', '$idproveedor', '$fecha_hora', '$total_exenta', '$total_iva5', '$total_iva10', '$liq_iva5', '$liq_iva10', '$monto_compra')\";\n\n ejecutarConsulta($sql2);\n\n //aca realizamos la insercion en la tabla cuentas a pagar \n\n if($idformapago == 1){\n $formaPago = 'CONTADO';\n }else{\n $formaPago = 'CREDITO';\n }\n\n $monto_cuota = $monto_compra / $cuota;\n\n $fecha = strtotime($fecha_hora);\n $fecha = date('Y-m-d H:i:s', $fecha);\n $cont = 0;\n\n for ($i=1; $i <= $cuota ; $i++) { \n\n if($i >= 2){\n $cont = $cont + 1;\n $fecha = date(\"Y-m-d H:i:s\", strtotime($fecha_hora. \"+ {$cont} month\"));\n }\n\n if($cuota == 1){\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago;\n }else{\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago .\" \". $cuota .\" MESES\";\n }\n\n $sql3 = \"INSERT INTO cuentas_a_pagar (idcompra, idproveedor, nrofactura, idnotacredidebi, totalcuota, nrocuota, montocuota, fechavto, obs, estado) \n VALUES ('$idcompranew', '$idproveedor', '$nrofactura', '0', '$cuota', '$i', '$monto_cuota', '$fecha','$concepto', '1')\";\n\n ejecutarConsulta($sql3);\n\n }\n\n $sql4 = \"UPDATE orden_compras SET estado = '2' WHERE idordencompra = '$idordencompra'\";\n ejecutarConsulta($sql4);\n\n return $sw;\n\n }", "public function inserir()\n {\n }", "private function InsertarDetNC($con,$obj_con,$por_iva ,$detFact, $idCab) {\n $valSinImp = 0;\n $val_iva12 = 0;\n $vet_iva12 = 0;\n $val_iva0 = 0;//Valor de Iva\n $vet_iva0 = 0;//Venta total con Iva\n $VAL_IVA=0;//Calculo de Iva Genrado\n //TIP_NOF,NUM_NOF,FEC_VTA,COD_ART,NOM_ART,CAN_DES,P_VENTA,T_VENTA,VAL_DES,I_M_IVA,VAL_IVA\n for ($i = 0; $i < sizeof($detFact); $i++) {\n $valSinImp = floatval($detFact[$i]['T_VENTA']) - floatval($detFact[$i]['VAL_DES']);\n if ($detFact[$i]['I_M_IVA'] == '1') {\n //$val_iva12 = $val_iva12 + floatval($detFact[$i]['VAL_IVA']);\n //MOdificacion por que iva no cuadra con los totales\n $VAL_IVA=(floatval($detFact[$i]['CAN_DEV'])*floatval($detFact[$i]['P_VENTA'])* (floatval($por_iva)/100));\n $val_iva12 = $val_iva12 + $VAL_IVA;\n $vet_iva12 = $vet_iva12 + $valSinImp;\n } else {\n $VAL_IVA=0;//Cuando el Valor del Iva es 0\n $val_iva0 = 0;\n $vet_iva0 = $vet_iva0 + $valSinImp;\n }\n \n $sql = \"INSERT INTO \" . $obj_con->BdIntermedio . \".NubeDetalleNotaCredito\n (CodigoPrincipal,CodigoAuxiliar,Descripcion,Cantidad,PrecioUnitario,Descuento,PrecioTotalSinImpuesto,IdNotaCredito) VALUES (\n '\" . $detFact[$i]['COD_ART'] . \"', \n '1',\n '\" . $detFact[$i]['NOM_ART'] . \"', \n '\" . $detFact[$i]['CAN_DEV'] . \"',\n '\" . $detFact[$i]['P_VENTA'] . \"',\n '\" . $detFact[$i]['VAL_DES'] . \"',\n '$valSinImp',\n '$idCab')\";\n\n \n $command = $con->prepare($sql);\n $command->execute();\n $idDet = $con->insert_id;\n //Inserta el IVA de cada Item devuelto\n if ($detFact[$i]['I_M_IVA'] == '1') {//Verifico si el ITEM tiene Impuesto\n //Segun Datos Sri\n $this->InsertarDetImpNC($con,$obj_con, $idDet, '2', $por_iva, $valSinImp, $VAL_IVA); //12%\n } else {//Caso Contrario no Genera Impuesto\n $this->InsertarDetImpNC($con,$obj_con, $idDet, '2', '0', $valSinImp, $VAL_IVA); //0%\n }\n }\n //Inserta el Total del Iva Acumulado en el detalle\n //Insertar Datos de Iva 0%\n If ($vet_iva0 > 0) {\n $this->InsertarNcImpuesto($con,$obj_con, $idCab, '2','0', $vet_iva0, $val_iva0);\n }\n //Inserta Datos de Iva 12\n If ($vet_iva12 > 0) {\n $this->InsertarNcImpuesto($con,$obj_con, $idCab, '2', $por_iva, $vet_iva12, $val_iva12);\n }\n }", "public function insert($cbtRekapNilai);", "function insertar($bd);", "public function insert($permiso);", "public function insert($fisicasuelo);", "function addPedido($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria)\n {\n\n //si está seteada, quiere decir que hay una imagen en la carpeta temporal de php.\n if (isset($imagen[\"fileTemp\"])) {\n move_uploaded_file($imagen[\"fileTemp\"], $imagen[\"filePath\"]);\n $imagen = $imagen[\"filePath\"];\n } else {\n $imagen = null;\n }\n\n $sentencia = $this->db->prepare(\"INSERT INTO pedido(usuario_asignado, nombre, apellido, ubicacion, telefono, foto, clase_vehiculo ,franja_horaria) VALUES(?,?,?,?,?,?,?,?)\");\n $sentencia->execute(array($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria));\n }", "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 }", "function insertarUsuariostribia($refparticipantes,$cantidadaciertos,$intento,$refestados,$refpremios,$puntobonusa,$aciertobonusa,$puntobonusb,$aciertobonusb) {\r\n$sql = \"insert into dbusuariostribia(idusuariotribia,refparticipantes,cantidadaciertos,intento,refestados,refpremios,puntobonusa,aciertobonusa,puntobonusb,aciertobonusb)\r\nvalues ('',\".$refparticipantes.\",\".$cantidadaciertos.\",\".$intento.\",\".$refestados.\",\".$refpremios.\",\".$puntobonusa.\",\".$aciertobonusa.\",\".$puntobonusb.\",\".$aciertobonusb.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "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 insertarExportacioncontenedores($refexportaciones,$contenedor,$tara,$precinto) {\r\n$sql = \"insert into dbexportacioncontenedores(idexportacioncontenedor,refexportaciones,contenedor,tara,precinto)\r\nvalues ('',\".$refexportaciones.\",'\".($contenedor).\"',\".$tara.\",'\".($precinto).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "public function insertar($objeto){\r\n\t}", "function constitueCommande($idProd,$idCommande,$qteProd){\n require(\"./modele/connexionBD.php\");\n $sql_ajt = \"INSERT INTO `constitue`(`idProduit`, `idCommande`, `qteProduit`) \n VALUES (:idp,:idc,:qteP);\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':idc', $idCommande);\n $statement->bindParam(':idp', $idProd);\n $statement->bindParam(':qteP', $qteProd);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n\n}", "public function insert($nu_pcp_op, $qtd_produzir, $qtd_produto,$dt_emissao, $ds_produto, $co_int_produto, $nu_lote, $nu_comprimento, $nu_largura, $nu_espessura,$corte_espessura, $co_pcp_ac, $tp_produto, $no_cor,$fator)\r\n\t{\r\n\t\t$row = $this->getMedidaCorte($co_pcp_ac, $co_int_produto);\r\n\t\t$sql = \"INSERT INTO tb_pcp_etiqueta (\r\n\t\t\t\t\tnu_pcp_op\r\n\t\t\t\t,\tqtd_produzir\r\n\t\t\t\t,\tqtd_produto\r\n\t\t\t\t,\tdt_emissao\r\n\t\t\t\t,\tds_produto\r\n\t\t\t\t,\tco_int_produto\r\n\t\t\t\t,\tnu_lote\r\n\t\t\t\t,\tnu_comprimento\r\n\t\t\t\t,\tnu_largura\r\n\t\t\t\t,\tcorte_nu_comprimento\r\n\t\t\t\t,\tcorte_nu_largura\r\n\t\t\t\t,\tcorte_nu_espessura\r\n\t\t\t\t,\tnu_espessura\r\n\t\t\t\t,\tco_pcp_ac\r\n\t\t\t\t,\ttp_produto\r\n\t\t\t\t,\tno_cor\r\n\t\t\t\t,\tnu_fator_multiplicador)\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'\".addslashes($nu_pcp_op).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produzir).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produto).\"'\r\n\t\t\t\t, '\".addslashes($dt_emissao).\"'\r\n\t\t\t\t, '\".addslashes($ds_produto).\"'\r\n\t\t\t\t, '\".addslashes($co_int_produto).\"'\r\n\t\t\t\t, '\".addslashes($nu_lote).\"'\r\n\t\t\t\t, '\".addslashes($nu_comprimento).\"'\r\n\t\t\t\t, '\".addslashes($nu_largura).\"'\r\n\t\t\t\t, '\".addslashes($row[0]).\"'\r\n\t\t\t\t, '\".addslashes($row[1]).\"'\r\n\t\t\t\t, '\".addslashes($corte_espessura).\"'\r\n\t\t\t\t, '\".addslashes($nu_espessura).\"'\r\n\t\t\t\t, \".$co_pcp_ac.\"\r\n\t\t\t\t, '\".addslashes($tp_produto).\"'\r\n\t\t\t\t, '\".addslashes($no_cor).\"'\r\n\t\t\t\t, '\".addslashes($fator).\"')\";\r\n\t\tmysql_query($sql,$this->conexaoERP);\r\n\t}", "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 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($titulos){\n// $id=$titulos->getId();\n$descripcion=$titulos->getDescripcion();\n$universidad_id=$titulos->getUniversidad_id();\n$docente_id=$titulos->getDocente_id()->getId();\n\n try {\n $sql= \"INSERT INTO `titulos`( `descripcion`, `universidad`, `docente_id`)\"\n .\"VALUES ('$descripcion','$universidad_id','$docente_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "static public function mdlAgregarInventario($tabla,$datos)\n\t{\n\t\t$stmt = conexion::conectar()->prepare(\"INSERT INTO $tabla(id_producto,id_almacen,existencia) VALUES (:id_producto,:id_almacen,:existencia)\");\n\n\t\t$stmt -> bindParam(\":id_producto\", $datos[\"id_producto\"], PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":id_almacen\",$datos[\"id_almacen\"],PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":existencia\",$datos[\"cantidad\"],PDO::PARAM_STR);\n\t\t\n\t\tif ($stmt->execute())\n\t\t{\n\t\t\treturn \"ok\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"error\";\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt=null;\n\t}", "public function insert($detalleexistenciabodega){\n $idDetalleExistencia=$detalleexistenciabodega->getIdDetalleExistencia();\n$unidadesExistencia=$detalleexistenciabodega->getUnidadesExistencia();\n$descipcionExistenciaBodega=$detalleexistenciabodega->getDescipcionExistenciaBodega();\n$fechaModificacionExistenciaBodega=$detalleexistenciabodega->getFechaModificacionExistenciaBodega();\n\n try {\n $sql= \"INSERT INTO `detalleexistenciabodega`( `idDetalleExistencia`, `unidadesExistencia`, `descipcionExistenciaBodega`, `fechaModificacionExistenciaBodega`)\"\n .\"VALUES ('$idDetalleExistencia','$unidadesExistencia','$descipcionExistenciaBodega','$fechaModificacionExistenciaBodega')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "function insertarFase(){\n global $conexion, $data;\n $title = '{\"en\": \"'.$data[\"title\"].'\", \"es\":\"'.$data[\"title\"].'\"}';\n $description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $start_date = $data[\"start_date\"];\n $end_date = $data[\"end_date\"];\n $procces_id = $data[\"proceso_id\"];\n $created_at = $data[\"created_at\"];\n $updated_at = $data[\"updated_at\"];\n $active = $data[\"active\"];\n $position = $data[\"position\"];\n $resultado = pg_query($conexion, \"INSERT INTO decidim_participatory_process_steps (title, description, start_date, end_date, decidim_participatory_process_id, created_at, updated_at, active, position) VALUES ('$title', '$description', '$start_date', '$end_date', '$procces_id', '$created_at', '$updated_at', '$active', '$position') RETURNING id \");\n validarErrorPG($resultado);\n }", "function creer_membre($num_licence, $nom, $prenom, $date_naissance, $mdp) {\n static $query = null;\n\n if ($query == null) {\n $query = connectDB()->prepare(\"INSERT INTO t_membres(num_licence, nom, prenom, date_naissance, mdp) \n VALUES (:num_licence, :nom, :prenom, :date_naissance, :mdp)\");\n }\n\n $query->execute([\n \"num_licence\" => $num_licence,\n \"nom\" => $nom,\n \"prenom\" => $prenom,\n \"date_naissance\" => $date_naissance,\n \"mdp\" => sha1($mdp)\n ]);\n}", "function inserisci_provincia($nome_provincia=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_provincia= sistemaTesto($nome_provincia);\n\t$q=\"INSERT INTO provincia (id_provincia, nome) VALUES (null,'$nome_provincia')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "function uf_insert_cargos($as_codemp,$as_newcodcar,$as_dencar,$as_codestpro,$as_spgcuenta,$as_porcar,$as_estlibcom,$as_formula)\r\n\t{\r\n\t\t$lb_valido=true;\r\n\t\t$ls_sql=\"INSERT INTO tepuy_cargos(codemp, codcar, dencar, codestpro, spg_cuenta, porcar, estlibcom, formula)\".\r\n\t\t\t\t\" VALUES ('\".$as_codemp.\"','\".$as_newcodcar.\"','\".$as_dencar.\"','\".$as_codestpro.\"','\".$as_spgcuenta.\"',\".\r\n\t\t\t\t\" \".$as_porcar.\",'\".$as_estlibcom.\"','\".$as_formula.\"')\";\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{\r\n\t\t\t$this->io_msg->message(\"CLASE->release MÉTODO->uf_insert_cargos ERROR->\".$this->io_function->uf_convertirmsg($this->io_sql->message));\r\n\t\t\t$lb_valido=false;\r\n\t\t}\r\n\t\treturn $lb_valido;\r\n\r\n\t}", "public function inserirPartida(){\n $usuari = $_POST[\"usuari\"];\n $ingame = $_POST[\"ingame\"];\n $codiTorneig = $_POST[\"torneig\"];\n\n $sql = \"INSERT INTO partida(idTorneo,participant,ingame)\n VALUES('$codiTorneig','$usuari','$ingame')\";\n\n $this->db->query($sql);\n $num_files = $this->db->affected_rows();\n\n return $num_files;\n }", "public function agregarVersion($datos){\n if(!$this->db->insert('versions',$datos)){\n return false;\n }\n return true;\n }", "public function insert($datos){\r\n try{\r\n $query = $this->db->connect()->prepare('INSERT INTO PRODUCTO (ID_PRODUCTO, NOMBRE, DESCRIPCION, PRECIO, FOTO, STOCK, CATEGORIA) VALUES(:id_producto, :nombre, :descripcion,:precio, :foto, :stock, :categoria)');\r\n $query->execute(['id_producto' => $datos['id_producto'], 'nombre' => $datos['nombre'], 'descripcion' => $datos['descripcion'], 'precio' => $datos['precio'], 'foto' => $datos['foto'], 'stock' => $datos['stock'], 'categoria' => $datos['categoria']]);\r\n return true;\r\n }catch(PDOException $e){\r\n //echo $e->getMessage();\r\n //echo \"Ya existe esa matrícula\";\r\n return false;\r\n }\r\n \r\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 }", "function inserisci_comune($nome_comune=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_comune= sistemaTesto($nome_comune);\n\t$q=\"INSERT INTO comune (id_comune, nome) VALUES (null,'$nome_comune')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "function CreaAssistito($nome, $cognome, $telefono, $codiceFisc, $indirizzo, $comune, $email, $descrzione, $categoria){\n\t\t$query = \"INSERT INTO assistiti (Nome, Cognome, Telefono, CodiceFiscale, Indirizzo, Comune, Email, Descrizione, Categoria) VALUES('$nome', '$cognome', '$telefono', '$codiceFisc', '$indirizzo', '$comune', '$email' , '$descrizione', $categoria)\";\n\t\tif(!$mysqli -> query($query)){\n\t\t\tdie($mysqli->error);\n\t\t}\n\t}", "function insertarAgenciareferentes($refagencias,$refreferentes) {\r\n$sql = \"insert into dbagenciareferentes(idagenciareferente,refagencias,refreferentes)\r\nvalues ('',\".$refagencias.\",\".$refreferentes.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\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}", "function insertarRelacionProceso(){\n\n $this->objFunc=$this->create('MODObligacionPago');\n if($this->objParam->insertar('id_relacion_proceso_pago')){\n $this->res=$this->objFunc->insertarRelacionProceso($this->objParam);\n } else{\n $this->res=$this->objFunc->modificarRelacionProceso($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "function insert_motif(Motif $motif_object) {\n $connexion = get_connexion();\n $sql = \"INSERT INTO motif (id_motif, libelle_motif) VALUES (:id_motif, :libelle_motif)\";\n try {\n $sth = $connexion->prepare($sql);\n $sth->execute(\n array(\n \":id_motif\" => $motif_object->get_id_motif(),\n \":libelle_motif\" => $motif_object->get_libelle_motif(),\n ));\n } catch (PDOException $e) {\n throw new Exception(\"Erreur lors de la requête SQL : \" . $e->getMessage());\n }\n $nb = $sth->rowcount();\n return $nb; // Retourne le nombre d'insertion\n}", "public function insert($aluno) {\n\t}", "public function insertarProductoCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto_comprar(id_cliente, id_producto,nombre,precio,compro,fecha)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "public function inserCompte()\n {\n $username = \"Numherit\";\n $userId = 1;\n $token = $this->utils->getToken($userId);\n\n $nom = $this->utils->securite_xss($_POST['nom']);\n $prenom = $this->utils->securite_xss($_POST['prenom']);\n $adresse = $this->utils->securite_xss($_POST['adresse']);\n $email = $this->utils->securite_xss($_POST['email']);\n $password = $this->utils->generation_code(12);\n $dateNaissance = $this->utils->securite_xss($_POST['datenaiss']);\n $typePiece = $this->utils->securite_xss($_POST['typepiece']);\n $numPiece = $this->utils->securite_xss($_POST['piece']);\n $dateDeliv = $this->utils->securite_xss($_POST['datedelivrancepiece']);\n $telephone = trim(str_replace(\"+\", \"00\", $this->utils->securite_xss($_POST['phone'])));\n $sexe = $this->utils->securite_xss($_POST['sexe']);\n $user_creation = $this->userConnecter->rowid;\n $agence = $this->userConnecter->fk_agence;\n $response = $this->api_numherit->creerCompte($username, $token, $nom, $prenom, $adresse, $email, $password, $dateNaissance, $telephone, $user_creation, $agence, $sexe, $typePiece, $numPiece, $dateDeliv);\n\n $tab = json_decode($response);\n if (is_object($tab)) {\n if ($tab->{'statusCode'} == '000') {\n @$num_transac = $this->utils->generation_numTransaction();\n @$idcompte = $this->utils->getCarteTelephone($telephone);\n @$this->utils->SaveTransaction($num_transac, $service = ID_SERVICE_CREATION_COMPTE, $montant = 0, $idcompte, $user_creation, $statut = 0, 'SUCCESS: CREATION COMPTE', $frais = 0, $agence, 0);\n $true = 'bon';\n $this->utils->log_journal('Creation compte', 'Client:' . $nom . ' ' . $prenom . ' Agence:' . $agence, 'succes', 1, $user_creation);\n $this->rediriger('compte', 'compte/' . base64_encode($true));\n } else {\n $this->utils->log_journal('Creation compte', 'Client:' . $nom . ' ' . $prenom . ' Agence:' . $agence, 'echec', 1, $user_creation);\n $this->rediriger('compte', 'compte/' . base64_encode($tab->{'statusMessage'}));\n }\n }\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 EnregistrerNouvelleCategorie($nom) {\n global $mysql;\n $nom = $mysql->quote($nom);\n $requete = \"INSERT INTO \" . DB_PREFIX . \"CATEGORIES (NOM) values($nom)\";\n requete ( $requete );\n}", "public function insert_inmueble($dni,$n_inmu,$t_inmu,$dist,$direc,$num,$superf,$habit,$banio,$cochera,$descrip,$precio,$url,$tipo_oper,$name_t_cont,$contrato,$tipos){\n\t\t\t $sql=\"CALL spRegistrarInmueble(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t\t\t$rs=$this->con->prepare($sql);\n\t\t\t\t$rs->execute(array($dni,$n_inmu,$t_inmu,$dist,$direc,$num,$superf,$habit,$banio,$cochera,$descrip,$precio,$url,$tipo_oper,$name_t_cont,$contrato,$tipos));\n\t\t}", "function add_article($bdd, $articles) {\n $req = $bdd->prepare('INSERT INTO articles(name, description, price, poids, image, stock, for_sale, Categories_id) \n VALUES(:name, :description, :price, :poids, :image, :stock, :for_sale, :Categories_id)');\n $req->execute(array(\n 'name' => $articles[0],\n 'description' => $articles[1],\n 'price' => $articles[2],\n 'poids' => $articles[3],\n 'image' => $articles[4],\n 'stock' => $articles[5],\n 'for_sale' => $articles[6],\n 'Categories_id' => $articles[7]\n ));\n\n echo \"L'article \".$articles[0].\" a bien été ajouté !\";\n}", "Function donneefournisseurs()\r\n {\r\n echo \"copie des données de la table fournisseurs\";\r\n $req=\"INSERT INTO `\".Valorisation::$anneenouvelle.\"`.`fournisseurs` SELECT * FROM `\".Valorisation::$anneeancienne.\"`.`fournisseurs`\";\r\n Valorisation::$bddnew->query($req); \r\n }", "static public function mdlIngresarAutoconsumo($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_usuario,codigo , descripcion, productos, total, fecha_emision) VALUES (:id_usuario, :codigo, :descripcion, :productos, :total, :fecha_emision)\");\n\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":descripcion\", $datos[\"descripcion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":productos\", $datos[\"productos\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":total\", $datos[\"total\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_emision\", $datos[\"fecha_emision\"], PDO::PARAM_STR);\n\t\n\t\t\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn $stmt->errorInfo();\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function newProducto($producto)\n{\n\t$con = getDBConnection();\n\t$stmt = $con->prepare(\"INSERT INTO productos (nombre, descripcion, precio) VALUES (:nombre, :descripcion, :precio)\");\n\t$stmt->bindParam(':nombre', $producto->nombre);\n\t$stmt->bindParam(':descripcion', $producto->descripcion);\n\t$stmt->bindParam(':precio', $producto->precio);\n\t$stmt->execute();\n}", "function 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}", "public function setcomida($nom,$des,$pre){\r\n\t\t if (!($insertar = $this->db->prepare(\"INSERT INTO comidas(`id_com`,`com_nom`,`com_des`,`com_pre`) VALUES (null,?,?,?)\"))) {\r\n\t\t\t\techo \"Falló la preparación: (\" . $mysqli->errno . \") \" . $mysqli->error;\r\n\t\t\t}\r\n\t\t\tif (!$insertar->bind_param(\"ssd\", $nom,$des,$pre)) {\r\n\t\t\t\techo \"Falló la vinculación de parámetros: (\" . $insertar->errno . \") \" . $insertar->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$insertar->execute()) {\r\n\t\t\t\techo \"Falló la ejecución: (\" . $insertar->errno . \") \" . $insertar->error;\r\n\t\t\t}\r\n\t\t\tif ($insertar) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t \r\n\t\t\t\treturn \"error a guardar los datos\".mysqli_error($this->db=Conectar::conexion());\r\n\t\t\t}\r\n\t\t}", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "public function inser_pro($id_proposito,$nombre,$descripcion,$observacion_final,$activo_pro) {\r\n $data = array(\r\n 'id_proposito' => $id_proposito,\r\n 'nombre' => $nombre,\r\n 'descripcion ' => $descripcion,\r\n 'observacion_final'=> $observacion_final,\r\n 'activo_pro' => $activo_pro\r\n \r\n ); \r\n return $this->db->insert('proposito', $data);\r\n }", "function ajoutPanierBd($idProd, $qteProd, $idUser)\n{\n require(\"./modele/connexionBD.php\");\n $sql_ajt = \"INSERT INTO `panier`(`idPanier`, `nbProduits`, `idUtilisateur`, `idProduit`) VALUES \n (null,:qteProd,:idUser,:idProd)\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':qteProd', $qteProd);\n $statement->bindParam(':idUser', $idUser);\n $statement->bindParam(':idProd', $idProd);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n return true;\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n}", "public function insert($cbtSoalSiswa);", "function createPreke($pavadinimas, $aprasymas, $kaina, $nuolaida, $pozicija, $kiekis, $ar_rodyti) {\n $manoSQL = \"INSERT INTO prekes VALUES (NULL, '$pavadinimas', '$aprasymas', '$kaina', '$nuolaida', '$pozicija', '$kiekis', $ar_rodyti)\";\n $result = mysqli_query(getPrisijungimas(), $manoSQL);\n if ($result == false) {\n echo \"KLAIDA, nepavyko issaugoti prekes <br />\";\n }\n}", "function insert() {\n\t \t$sql = \"INSERT INTO evs_database.evs_key_component (kcp_key_component_detail_en, kcp_key_component_detail_th, kcp_cpn_id)\n\t \t\t\tVALUES(?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id));\n\t\n\t }", "function insertarPagosFacturas($refpago,$reffactura,$refestatu) { \r\n$sql = \"insert into dbpagosfacturas(idpagofactura,refpago,reffactura,refestatu) \r\nvalues ('',\".$refpago.\",\".$reffactura.\",\".$refestatu.\")\"; \r\n$res = $this->query($sql,1); \r\nreturn $res; \r\n}", "function fn_divido_install()\n{\n fn_divido_uninstall();\n\n db_query(\"INSERT INTO ?:payment_processors ?e\", array (\n 'processor' => 'Divido',\n 'processor_script' => 'divido.php',\n 'processor_template' => 'addons/divido/views/orders/components/payments/divido.tpl',\n 'admin_template' => 'divido.tpl',\n 'callback' => 'Y',\n 'type' => 'P'\n ));\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 }", "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 add_tamanhos_produto($params)\n {\n $this->db->insert('tamanhos_produtos',$params);\n return $this->db->insert_id();\n }", "static public function mdlIngresarTipoPrueb($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(titulo, cantidad, idAdmision) VALUES (:titulo, :cantidad, :idAdmision)\");\n\n\t\t$stmt->bindParam(\":titulo\", $datos[\"titulo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cantidad\", $datos[\"cantidad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":idAdmision\", $datos[\"idAdmision\"], PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function insertProduit($db,$model,$produitEvident,$marque,$descriptif,$prix){\n\n $sql=\"INSERT INTO produits (modele,produit_evident,marque,descriptif,prix) VALUES ('$model','$produitEvident','$marque','$descriptif','$prix');\";\n $request = mysqli_query($db,$sql) or die(mysqli_error($db));\n // si le produit est bien inséré, on renvoie son ID\n return ($request)? mysqli_insert_id($db) :false;\n}", "public function insertar($idproveedor, $idusuario, $tipo_comprobante, $serie_comprobante, $num_comprobante, $fecha_hora, $impuesto, $total_compra, $idarticulo, $cantidad, $precio_compra, $precio_venta)\n {\n $sql = \"INSERT INTO ingreso(idproveedor,idusuario,tipo_comprobante,serie_comprobante,num_comprobante,fecha_hora,impuesto,total_compra,estado)\" .\n \" VALUES('$idproveedor','$idusuario','$tipo_comprobante','$serie_comprobante','$num_comprobante','$fecha_hora','$impuesto','$total_compra','ACEPTADO');\";\n// return ejecutarConsulta($sql);\n $idIngreso = ejecutarConsulta_retornarID($sql);\n $num_elementos = 0;\n $sw = true;\n while ($num_elementos < count($idarticulo)) {\n $sql_detalle = \"INSERT INTO detalle_ingreso(idIngreso, idarticulo,cantidad,precio_compra,precio_venta)\"\n . \" VALUES('$idIngreso', '$idarticulo[$num_elementos]','$cantidad[$num_elementos]','$precio_compra[$num_elementos]','$precio_venta[$num_elementos]');\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n $num_elementos++;\n }\n return $sw;\n }", "function insertarProceso(){\n global $conexion, $data;\n $slug = $data[\"slug\"];\n $hashtag = $data[\"hashtag\"];\n $dec_org_id = $data[\"decidim_organization_id\"];\n $created_at = $data[\"created_at\"];\n $updated_at = $data[\"updated_at\"];\n $title = '{\"en\": \"'.$data[\"title\"].'\", \"es\":\"'.$data[\"title\"].'\"}';\n $subtitle = '{\"en\": \"'.$data[\"subtitle\"].'\", \"es\":\"'.$data[\"subtitle\"].'\"}';\n $sh_description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $hero_image = $data[\"hero_image\"];\n $banner_image = $data[\"banner_image\"];\n $promoted = true;\n $published_at = $data[\"published_at\"];\n $developer_group= '{\"en\": \"'.$data[\"developer_group\"].'\", \"es\":\"'.$data[\"developer_group\"].'\"}';\n $end_date = $data[\"end_date\"];\n $meta_scope = '{\"en\": \"'.$data[\"meta_scope\"].'\", \"es\":\"'.$data[\"meta_scope\"].'\"}';\n $local_area = '{\"en\": \"'.$data[\"local_area\"].'\", \"es\":\"'.$data[\"local_area\"].'\"}';\n $target = '{\"en\": \"'.$data[\"target\"].'\", \"es\":\"'.$data[\"target\"].'\"}';\n $par_scope = '{\"en\": \"'.$data[\"participatory_scope\"].'\", \"es\":\"'.$data[\"participatory_scope\"].'\"}';\n $par_structure = '{\"en\": \"'.$data[\"participatory_structure\"].'\", \"es\":\"'.$data[\"participatory_structure\"].'\"}';\n $dec_scope_id = (int)$data[\"decidim_scope_id\"];\n $pro_group_id = (int)$data[\"decidim_participatory_process_group_id\"];\n $show_statistics= true;\n $announcement = null;\n $scopes_enabled = false;\n $start_date = $data[\"start_date\"];\n $private_space = false;\n $reference = $data[\"reference\"];\n $resultado = pg_query($conexion, \"INSERT INTO decidim_participatory_processes (slug, hashtag, decidim_organization_id, created_at, updated_at, title, subtitle, short_description, description, hero_image, banner_image, promoted, published_at, developer_group, end_date, meta_scope, local_area, target, participatory_scope, participatory_structure, decidim_scope_id, decidim_participatory_process_group_id, show_statistics, announcement, scopes_enabled, start_date, private_space, reference) VALUES ('$slug', '$hashtag', '$dec_org_id', '$created_at', '$updated_at', '$title', '$subtitle', '$sh_description', '$description', '$hero_image', '$banner_image', '$promoted', '$published_at', '$developer_group', '$end_date', '$meta_scope', '$local_area', '$target', '$par_scope', '$par_structure', '$dec_scope_id', '$pro_group_id', true, null, false, '$start_date', false, '$reference') RETURNING id, slug \");\n validarErrorPG($resultado);\n }", "public function run() {\n\t\t\\DB::statement(\" INSERT INTO efectores.tipo_efector(id_tipo_efector,sigla,descripcion)\n(\n\tSELECT *\n\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012\\$',\n\t 'SELECT id_tipo_efector,sigla,descripcion\n\t\t FROM efectores.tipo_efector')\n\t AS migracion(id_tipo_efector integer,\n sigla character varying(4),\n descripcion character varying(50))\n);\");\n\t}", "public static function inserirProdutoCarrinho(){\n if(isset($_SESSION['user'])){\n //USUARIO LOGADO COM CARRINHO\n if(isset($_SESSION['user']['carrinhoId'])){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"UPDATE carrinhos SET produto_id=:idp, quantidade=:qnt, idCliente=:idC WHERE id=:id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n\n //USUARIO LOGADO SEM CARRINHO\n }else{\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"INSERT INTO carrinhos(produto_id,quantidade,idCliente) VALUES (:prodId, :qnt, :idCliente)\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$produto['produto_id']);\n $stmt->bindValue(2,self::$produto['quantidade']);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->execute();\n if($stmt->rowCount()){\n return true;\n }throw new \\Exception(\"Nao Foi Possivel adicionar produto ao carrinho\");\n }\n\n //USUARIO NAO LOGADO\n }else{\n //USUARIO NAO LOGADO COM CARRINHO\n if(isset($_SESSION['carrinho'])){\n $expPro = explode(';',$_SESSION['carrinho']['produto_id']);\n $expQuant = explode(';',$_SESSION['carrinho']['quantidade']);\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $_SESSION['carrinho'] = array('produto_id'=>$impPro,'quantidade'=>$impQuant);\n return true;\n //USUARIO NAO LOGADO SEM CARRINHO\n }else{\n $_SESSION['carrinho'] = array('produto_id'=>self::$produto['produto_id'],'quantidade'=>self::$produto['quantidade']);\n return true;\n \n }\n \n }\n }", "static public function mdlIngresarproyecto($tabla, $datos){\n\t\t\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla (id_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, codigo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,nombreproyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t,fecha ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (:id_programacion_anual\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :id_entes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :codigo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :nombreproyecto\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :tipo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :id_usuario\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :fecha\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\");\n\n\t\t$stmt->bindParam(\":id_programacion_anual\", $datos[\"id_programacion_anual\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_entes\", $datos[\"id_entes\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombreproyecto\", $datos[\"nombreproyecto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo\", $datos[\"tipo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha\", $datos[\"fecha\"], PDO::PARAM_STR);\n\n//var_dump($datos);\n//exit($datos);\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\t$arr=$stmt->errorInfo();\n\t\t\treturn $arr[2];\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function insertardatos($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/datos.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "public function insert($cargo){\n $id=$cargo->getId();\n$fecha_ingreso=$cargo->getFecha_ingreso();\n$empresa_idempresa=$cargo->getEmpresa_idempresa()->getIdempresa();\n$area_empresa_idarea_emp=$cargo->getArea_empresa_idarea_emp()->getIdarea_emp();\n$cargo_empreso_idcargo=$cargo->getCargo_empreso_idcargo()->getIdcargo();\n$puesto_idpuesto=$cargo->getPuesto_idpuesto()->getIdpuesto();\n\n try {\n $sql= \"INSERT INTO `cargo`( `id`, `fecha_ingreso`, `empresa_idempresa`, `area_empresa_idarea_emp`, `cargo_empreso_idcargo`, `puesto_idpuesto`)\"\n .\"VALUES ('$id','$fecha_ingreso','$empresa_idempresa','$area_empresa_idarea_emp','$cargo_empreso_idcargo','$puesto_idpuesto')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "function insertProduct($cantidad, $modelo, $marca, $linea, $tipo, $garantiaEnMeses, $calle)\n {\n $cantidad = strtoupper($cantidad);\n $modelo = strtoupper($modelo);\n $marca = strtoupper($marca);\n $linea = strtoupper($linea);\n $tipo = strtoupper($tipo);\n $garantiaEnMeses = strtoupper($garantiaEnMeses);\n $calle = strtoupper($calle);\n $query = $this->db->query(\"call insertProduct('$cantidad', '$modelo', '$marca', '$linea', '$tipo', '$garantiaEnMeses', '$calle');\");\n }", "public function createArticleOrd(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"INSERT INTO articolo SET id_ordine=:ultimo_ord, nome_articolo=:articolo, quantita = 1, taglia=:taglia\";\n $stmt1 = $this->conn->prepare($query1);\n $this->ultimo_ord=htmlspecialchars(($this->ultimo_ord));\n $this->articolo=htmlspecialchars(strip_tags($this->articolo));\n $this->quantita=htmlspecialchars(strip_tags($this->quantita));\n $this->quantita=htmlspecialchars(strip_tags($this->taglia));\n\n $stmt1->bindParam(\":ultimo_ord\", $this->ultimo_ord);\n $stmt1->bindParam(\":articolo\", $this->articolo);\n $stmt1->bindParam(\":taglia\", $this->taglia);\n $stmt1->execute();\n\n if($stmt1){\n return true;\n }\n else\n return false;\n }", "public function ajouter_etat($libelle, $decote){\n $ajouter_etat = $this->base_de_donnee->prepare('INSERT INTO classe (libelle, etat) \n values (?, ?) ');\n\n $ajouter_etat->bindValue(1, $libelle, PDO::PARAM_STR);\n $ajouter_etat->bindValue(2, $etat, PDO::PARAM_STR);\n $ajouter_etat->execute(); \n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\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 }" ]
[ "0.6481965", "0.6276919", "0.6164597", "0.61160046", "0.61150014", "0.6109523", "0.61035895", "0.60233164", "0.6018255", "0.6008726", "0.59815973", "0.5975209", "0.5961618", "0.59491414", "0.5937328", "0.5903848", "0.59028924", "0.5895484", "0.58858943", "0.5867154", "0.5866178", "0.5854403", "0.58496547", "0.58482325", "0.58473676", "0.5833935", "0.58223313", "0.5821778", "0.5816686", "0.57971716", "0.57835144", "0.5764601", "0.5761009", "0.5745454", "0.57454264", "0.5737623", "0.57274896", "0.5723877", "0.570818", "0.5693858", "0.56871176", "0.5686524", "0.56805485", "0.5673009", "0.56708705", "0.5662278", "0.5661935", "0.56568277", "0.5653603", "0.56498885", "0.5645805", "0.5643245", "0.5633162", "0.56324804", "0.56308967", "0.56295174", "0.56292313", "0.5625186", "0.5618294", "0.56141347", "0.56069916", "0.56055075", "0.56038266", "0.5603485", "0.56000483", "0.55998313", "0.55966634", "0.5594035", "0.5585519", "0.5584933", "0.55758864", "0.557476", "0.55703783", "0.5569844", "0.5567355", "0.55580956", "0.5555173", "0.5552496", "0.5550891", "0.55491", "0.55486107", "0.5545734", "0.55439115", "0.5541866", "0.5538837", "0.55371505", "0.5536745", "0.55364794", "0.5527433", "0.55266404", "0.55205584", "0.5515249", "0.5512584", "0.5511951", "0.5506965", "0.55034566", "0.55025315", "0.55000854", "0.5499757", "0.5499037" ]
0.6092713
7
OBTENGO EL NOMBRE DE UNA DEPENDENCIA POR SU ID
function getDependenceNameById($dependence_id) { $query = $this->db->get_where('dependence', array('id'=>$dependence_id)); return $query->row()->name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTotalDependency($id, $idDependencia)\n {\n $cont=0; \n for ($i = 1; $i <= $id; $i++){\n $consult=\"select * from division where id=\".$i.\" and id_dependency=\".$idDependencia.\"\";\n $dependencia[]=self::model()->findBySql($consult);\n }\n foreach($dependencia as $value){\n if ($value!=null){ ++$cont;}\n }\n return $cont;\n }", "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}", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "function consec_productobyID($id) {\n $sql = \"\n SELECT\n COUNT(idusuario)\n FROM vendedor\n WHERE idusuario=?;\";\n //$sql = $this->db->query($sql, array($id));\n \n //return $sql->simple_query(); //->total_cortes;\n }", "public function getId_producto()\n {\n return $this->id_producto;\n }", "final function __construct($id)\r\n\t{\r\n\t\tparent::__construct($id);\r\n\t\t$this->_transaccion_abierta = false;\r\n\t\t// Cargo las dependencias\r\n\t\tforeach( $this->_lista_dependencias as $dep){\r\n\t\t\t$this->cargar_dependencia($dep);\r\n\t\t\t$this->_dependencias[$dep]->set_controlador($this, $dep);\r\n\t\t\t$this->dep($dep)->inicializar();\r\n\t\t}\t\t\r\n\t}", "public function getIdContratoFinanceiroNota()\n {\n return $this->id_contrato_financeiro_nota;\n }", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "public function setIdWithDependency($id, $em) {\n $oldId = $this->getId();\n $this->setId($id);\n if ($id == 1){\n $this->setPartenaireId(1);\n }\n $tasksWithThatClientId = $em->getRepository('maindbBundle:Tachesimple')->findBy(Array('clientId' => $oldId));\n foreach ($tasksWithThatClientId as $task) {\n $task->setClientId($id);\n $em->persist($task);\n $em->flush();\n }\n $em->persist($this);\n $metadata = $em->getClassMetaData(get_class($this));\n $metadata->setIdGeneratorType(\\Doctrine\\ORM\\Mapping\\ClassMetadata::GENERATOR_TYPE_NONE);\n $em->flush();\n }", "public function getIddefActividad0()\n {\n return $this->hasOne(RelProductoActividad::className(), ['iddef_actividad' => 'iddef_actividad']);\n }", "function getCompteUSer($ID){\n if (intval($ID)) {\n $data = getCompteID($ID);\n require('modification.php');\n //require('Liste-Compte.php');\n }\n else{\n throw new Exception(\"l'ID doit etre un Entier\");\n \n }\n }", "public function getIdContrato()\n {\n return $this->id_contrato;\n }", "public function getIdProduto()\n\t\t{\n\t\t\treturn $this -> idproduto;\n\t\t}", "function buscarPorId($id) {\r\n \r\n }", "function getId_dl()\n {\n if (!isset($this->iid_dl) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_dl;\n }", "function get_entrada_pr_pedido_id($id){\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.pr_pedido_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getId_carrera(){\n\t\treturn $this->id_carrera;\n\t}", "public function getId()\n {\n \treturn $this->id_actadocumentacion;\n }", "public function getVersiondId() {}", "public function DetallesComprasPorId()\n\t{\n\t\tif(base64_decode($_GET['tipoentrada'])==\"PRODUCTO\"){\n\n\t\t\tself::SetNames();\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria LEFT JOIN productos ON detallecompras.codproducto = productos.codproducto WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t} else {\n\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN ingredientes ON detallecompras.codproducto = ingredientes.codingrediente WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\n\t\t}\n\t}", "function buscar_id($id_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tlibro\n\t\t\t\tWHERE id_libro='$id_libro'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('libroClass.php');\n\t\t\t$libro = new Libro($resultado[0]['id_libro'], $resultado[0]['nombre_libro'], $resultado[0]['paginas_libro'], $resultado[0]['codigo_libro'], $resultado[0]['version_libro'], $resultado[0]['id_editorial'], $resultado[0]['id_estado_libro']);\n\t\t\t//Regreso los productos\n\t\t\treturn $libro;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function deleteArticulo( $id ){\n $sql = \"UPDATE `articulo` SET `activo`= 0 WHERE `id`= $id\";\n ejecutarConsulta($sql);\n }", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function consultar_dependencia($tabla,$filtro){\n $id = new MongoDB\\BSON\\ObjectId($filtro);\n $res = $this->mongo_db->where(array('eliminado'=>false,'id_modulo_vista'=>$id))->get($tabla);\n return count($res);\n }", "function get_producto_id_by_id($id) {\n\t\t$ef = new Producto_numeracion();\n\t\t//Buscar en la base de datos\n\t\t$ef->get_by_id($id);\n\t\tif ($ef->c_rows > 0) {\n\t\t\treturn $ef->cproducto_id;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getId_produto()\n {\n return $this->id_produto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "function evt__1__salida()\n\t{\n\t\t$this->dep('dependencias')->limpiar_seleccion();\n\t}", "public function getIdreferencia() {\n return $this->idreferencia;\n }", "public function getDependenciaProgresion($id){\n\n\t\t$dt = new \\DateTime();\t\t\t\n\t\t$year = $dt->format('Y');\n\n\t\t$metas = M4::where('id_provincia' , $id)->get()[0];\n\n\t\t$periodos = CA::where('id_provincia' , $id)\n\t\t\t\t\t->where(DB::raw('substring(periodo::text,1,4)::integer'), '=', $year)\n\t\t\t\t\t->orderBy('periodo')\n\t\t\t\t\t->get();\n\t\tforeach ($periodos as $periodo){\n\t\t\t$chart[0]['name'] = 'Dependencias Sanitarias';\n\t\t\t$chart[0]['data'][] = (real)$periodo->dependencia_sanitaria;\n\t\t\t$meses[] = $periodo->periodo;\n\t\t}\n\n\t\t$meses = $this->getFormatMeses($meses);\n\n\t\t$data = [\n\t\t\t'page_title' => 'Evolución de dependencias sanitarias',\n\t\t\t'series' => json_encode($chart),\n\t\t\t'categorias' => json_encode($meses),\n\t\t\t'metas' => $metas,\n\t\t\t'back' => 'ca-provincia-form/ca-16-dependencia/ca-16-dependencia-progresion'\n\t\t];\n\n\t\treturn view('compromiso-anual.dependencia-progreso' , $data);\n\t}", "abstract public function getId();", "private function distribuidores_after_save($id='') {\n\t\t$tabla = \"distribuidores_usuarios\"; $key=\"id_distribuidor\"; \n\t\t$dataupdte[\"estado_epedidos\"] = \"0\";\n\t\t$this->Global_model->update_data($tabla,$dataupdte,array($key=>$id));\t\n\t\t\n\t}", "public function getContrato_id() {\n return $this->contrato_id;\n }", "public function idDefinitivo($tipo,$id){\n $iddef=0;\n $objA=new admonDAO(); //direcionador =1 mandar a admon\n $objM=new medicoDAO(); //direcionar=2 mandar a medico\n $objP=new pacienteDAO(); //direccionar=3 mandar a paciente\n $resul1=$objA->readOneById($id); //error en datos\n $resul2=$objM->readOneById($id);\n $resul3=$objP->readOneById($id);\n \n if($tipo==1){\n for($i=0;$i<count($resul1);$i++){\n $iddef=$resul1[$i]['id_admon'];\n }\n }\n if($tipo==2){\n for($i=0;$i<count($resul2);$i++){\n $iddef=$resul2[$i]['id_medico'];\n }\n }\n if($tipo==3){\n for($i=0;$i<count($resul3);$i++){\n $iddef=$resul3[$i]['id_paciente'];\n }\n }\n \n return $iddef;\n }", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function buscaPorId($id){\n \n \t\t\t/* Primeiro cria a query do MySQL */\n \t\t\t$id_query = \"SELECT * FROM atendimentocliente WHERE idChamada = \".$id;\n\n \t\t\t/* Envia a query para o banco de dados e verifica se funcionou */\n \t\t\t$result = mysqli_query($this->conexao, $id_query)\n \t\t\tor die(\"Erro ao listar produtos por ID: \" . mysql_error() );\n\n \t\t\t/* Cria variável de retorno e inicializa com NULL */\n \t\t\t$retorno = null;\n\n \t\t\t/* Se encontrou algo, pega todos os campos do resultado obtido */\n \t\t\tif( $row = mysqli_fetch_array($result, MYSQLI_ASSOC) ){\n \t\t\t\t//Cria nova instância da classe produto\n \t\t\t\t $retorno = new Atendimentocliente();\n \t\t\t\t//Preenche todos os campos do novo objeto\n\t\t\t\t $retorno->idChamada = $row[\"idChamada\"]; \n \t\t\t\t $retorno->atendeu = $row[\"atendeu\"];\n\t\t\t\t $retorno->refProduto = $row[\"refProduto\"];\n\t\t\t\t $retorno->motivoPlano = $row[\"motivoPlano\"];\n\t\t\t\t $retorno->dataVencimento = $row[\"dataVencimento\"];\n\t\t\t\t $retorno->debitoAutomatico = $row[\"debitoAutomatico\"];\n\t\t\t\t $retorno->debitoOfertado= $row[\"debitoOfertado\"];\n\t\t\t\t $retorno->observacao = $row[\"observacao\"];\n\t\t\t\t $retorno->dataChamada = $row[\"dataChamada\"];\n\t\t\t\t $retorno->idVendaServico= $row[\"idVendaServico\"];\n\t\t\t\t $retorno->notaAtendimento = $row[\"notaAtendimento\"];\n\t\t\t\t $retorno->FoiNaoConformidade= $row[\"FoiNaoConformidade\"];\n\t\t\t\t\n\t\t\t\t \n\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\treturn $retorno;\n\n\t\t }", "function construir_id_def_base($nombre_fuente)\n\t{\n\t\treturn $this->get_instancia()->get_id().' '.$this->get_id().' '.$nombre_fuente;\n\t}", "public function ComprasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN mediospagos ON compras.formacompra = mediospagos.codmediopago WHERE compras.codcompra = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getId() {}", "public function getId() {}", "function add_adjunto_producto($id,$archivo){\n\t\t$this->db->set('Imagen', $archivo);\n\t\t$this->db->where('Id_platillo',$id);\n\t\t$this->db->update('jam_platillo',$data);\n\t}", "public function getId() ;", "public function obtenerIDPrimerPagoElectronico(){\n $criteria = new CDbCriteria;\n $criteria->condition = 'id_pedido = '.$this->id_pedido;\n $registrosCarro = PagosElectronicos::model()->findAll($criteria);\n\n if (sizeof($registrosCarro) > 0)\n return $registrosCarro[0]->id;\n return 0;\n }", "public function getIddefActividad()\n {\n return $this->hasOne(RelActividadRestriccion::className(), ['iddef_actividad' => 'iddef_actividad']);\n }", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "function obtenerServicioID($descripcion){\n\n\t $query = $this->db->get('servicio');\n\t \n\t if($query-> num_rows() > 0){\n\t $row = $query->row($descripcion);\n\t\tif (isset($row))\n\t\t\t{\n \treturn $row->id;\n\t\t\t} \n\t }\n\t else return false ;\n\t}", "public function getIdComentario()\n {\n return $this->id_comentario;\n }", "public function GetIdObsAluno()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"observacoes_ibfk_1\");\n\t}", "function imprimir_comprobante_detalle($id) {\n $sql = \"SELECT\n\t\t prosic_tipo_comprobante.nombre_tipo_comprobante\n\t\t , prosic_tipo_comprobante.sunat_tipo_comprobante\n\t\t , prosic_detalle_comprobante.ser_doc_comprobante\n\t\t , prosic_detalle_comprobante.nro_doc_comprobante\n\t\t , prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t , prosic_moneda.codigo_moneda\n\t\t , prosic_plan_contable.cuenta_plan_contable\n\t\t , prosic_plan_contable.descripcion_plan_contable\n\t\t , prosic_detalle_comprobante.cargar_abonar\n\t\t , prosic_detalle_comprobante.importe_dolares\n\t\t , prosic_detalle_comprobante.importe_soles\n\t\t\t\t , prosic_anexo.descripcion_anexo\n\t\t\t\t , prosic_anexo.codigo_anexo\n\t\tFROM\n\t\t prosic_detalle_comprobante\n\t\t INNER JOIN prosic_plan_contable ON (prosic_detalle_comprobante.id_plan_contable = prosic_plan_contable.id_plan_contable)\n\t\t INNER JOIN prosic_tipo_comprobante \tON (prosic_detalle_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n\t\t INNER JOIN prosic_moneda \t\t\tON (prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda)\n\t\t\tLEFT JOIN prosic_anexo \t\t\tON (prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo)\n\t\t WHERE prosic_detalle_comprobante.id_comprobante=\" . $id.\" and prosic_detalle_comprobante.tipo_digito='D' \n\t\t\t ORDER BY cargar_abonar desc, cuenta_plan_contable, ser_doc_comprobante, nro_doc_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n $datos = array();\n while ($fila = mysql_fetch_array($result, MYSQL_ASSOC)) {\n $datos[] = $fila;\n }\n return $datos;\n }", "function _ConsultarConsejosPorPrueba($id)\n\t\t{\n\t\t\tR::begin();\n\t\t\t try{\n\t\t\t \t$query = '\n\t\t\t \t\tSELECT \n\t\t\t \t\tcon.id,\n\t\t\t\t\t\tcon.Resultado,\n\t\t\t\t\t\tcon.consejo as Consejo,\n\t\t\t\t\t\tpru.id as \"id_prueba\",\n\t\t\t\t\t\tpru.nm_prueba\n\t\t\t \t\tFROM sgconsejos con \n\t\t\t \t\tLEFT JOIN sgtipospruebas pru ON con.id_tipo_prueba= pru.id \n\t\t\t \t\twhere con.id_tipo_prueba= ? ORDER BY con.id ASC\n\t\t\t \t';\n\t\t\t $consejos = R::getAll($query,[$id]);\n\t\t\t R::commit();\n\t\t\t }\n\t\t\t catch(Exception $e) {\n\t\t\t $consejos = R::rollback();\n\t\t\t }\n\t\t\tR::close();\n\t\t\treturn $consejos;\n\t\t}", "function id_articulo($id){\n return (int)limpiarDatos($id);\n}", "public function traerPorVehiculo($id)\n {\n }", "function Cuerpo($acceso,$id_contrato)\n\t{\n\t\t//echo \"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT tarifa_ser FROM vista_tarifa where id_serv='BM00001'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$costo_inst=utf8_decode(trim($row['tarifa_ser']));\n\t\t}\n\t\t//echo \"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\");\n\t\t$acceso->objeto->ejecutarSql(\"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\");\n\t\tif($row=row($acceso)){\n\t\t\n\t\t\t$observacion=utf8_decode(trim($row['observacion']));\n\t\t\t$costo_contrato=utf8_decode(trim($row['costo_contrato']));\n\t\t\t$tipo_cliente=utf8_decode(trim($row['tipo_cliente']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombrecli']));\n\t\t\t$apellidocli=utf8_decode(trim($row['apellido']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombre']));\n\t\t\t$etiqueta=utf8_decode(trim($row['etiqueta']));\n\t\t\t$cedulacli=utf8_decode(trim($row['cedula']));\n\t\t\t\n\t\t\t$fecha=formatofecha(trim($row[\"fecha_contrato\"]));\n\t\t\t$fecha_nac=formatofecha(trim($row[\"fecha_nac\"]));\n\t\t\t\n\t\t\t\n\t\t\t$nro_contrato=trim($row['nro_contrato']);\n\t\t\t$id_contrato=trim($row['id_contrato']);\n\t\t\n\t\t\n\t\t\t$puntos=utf8_decode(trim($row['puntos']));\n\t\t\t$deuda=utf8_decode(trim($row['deuda']));\n\t\t\tif($deuda==\"\"){\n\t\t\t\t$deuda=0;\n\t\t\t}\n\t\t\t\n\t\t\t$deuda=number_format($deuda, 2, ',', '.');\n\t\t\t$nombre_zona=utf8_decode(trim($row['nombre_zona']));\n\t\t\t$nombre_sector=utf8_decode(trim($row['nombre_sector']));\n\t\t\t$nombre_calle=utf8_decode(trim($row['nombre_calle']));\n\t\t\t$numero_casa=utf8_decode(trim($row['numero_casa']));\n\t\t\t$telefono=utf8_decode(trim($row['telefono']));\n\t\t\t$telf_casa=utf8_decode(trim($row['telf_casa']));\n\t\t\t$telf_adic=utf8_decode(trim($row['telf_adic']));\n\t\t\t$email=utf8_decode(trim($row['email']));\n\t\t\t$direc_adicional=utf8_decode(trim($row['direc_adicional']));\n\t\t\t$id_persona=utf8_decode(trim($row['id_persona']));\n\t\t\t$postel=utf8_decode(trim($row['postel']));\n\t\t\t$taps=utf8_decode(trim($row['taps']));\n\t\t\t$pto=utf8_decode(trim($row['pto']));\n\t\t\t$edificio=utf8_decode(trim($row['edificio']));\n\t\t\t$numero_piso=utf8_decode(trim($row['numero_piso']));\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre,apellido FROM persona where id_persona='$id_persona' LIMIT 1 offset 0 \");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$vendedor=utf8_decode(trim($row['nombre'])).\" \".utf8_decode(trim($row['apellido']));\n\t\t\t\n\t\t}\n\n\t\tif($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}\n\t\t\n\t\t\n\t\t$this->Ln();\t\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetXY(10,35);\t\t\n\t\t$this->Cell(195,10,\"Abonado: $nro_contrato\",\"0\",0,\"R\");\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->SetXY(40,50);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA JURIDICA.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Razón Social.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Actividad.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Telef.\",\"1\",0,\"J\");\n\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Representante Legal\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cargo en la Empresa.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA NATURAL.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: $nombrecli $apellidocli\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: $fecha_nac\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ingreso Mensual: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Deposito en Garantia: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Tipo Vivienda: Propia ___ Alquilado ___ Canon Mensual: ____\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(65,6,\"Vencimiento del Contrato: / / \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DATOS DEL CONYUGUE.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Ingreso Mensual.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DOMICILIO DEL SERVICIO\",\"1\",0,\"C\");\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Apellidos: $apellidocli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Vendedor: $vendedor\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Suscriptor Nº: $nro_contrato\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha: $fecha\",\"1\",0,\"J\");*/\n\t\t\t\t\n\t\n\t\t/*if($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}*/\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I. $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Ocupación: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Grupo Familiar Nº:\",\"1\",0,\"J\");\n\t\tif($fecha_nac=='11/11/1111'){\n\t\t\t$fecha_nac='';\n\t\t}\n\t\t$this->Cell(65,6,\"Fecha de Nacimiento : $fecha_nac\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"DOMICILIO DE SERVICIO\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb o Sector: $nombre_sector\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Calle n°: \",\"1\",0,\"J\");\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Avenida o Calle: $nombre_calle\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Vereda : \",\"1\",0,\"J\");\t\t\n\t\t\n\t\tif($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Piso:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"N° de Casa o Apto: $numero_casa $apto\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Referencia o Zona: $nombre_zona N°Poste:$postel\",\"1\",0,\"J\");\n\t\t//$this->Cell(65,6,\"N° de Poste: $postel\",\"0\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ruta Cuenta: \",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Zona: $nombre_zona\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Manzana: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb.: $nombre_sector\",\"1\",0,\"J\");*/\n\t\t\n\t\t/*if($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Cell(97,6,\"Apto.: $apto\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cod. Postal: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t//Rect( float x, float y, float w, float h [, string style])\n\t\t$this->Cell(98,6,\"Vivienda Alquilada: SI ____ NO ____\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha de Vencimineto de Alquiler: \",\"1\",0,\"J\");\n\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Proveedor de Internet: \",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\");\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"SERVICIOS \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,6,\"CANT.\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"P. UNITARIO \",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"P. TOTAL \",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Instalación Principal\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"1\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Tomas Adicionales\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Cable Coaxial\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Conectores\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Espliter\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\" \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(60,5,\"TOTAL A PAGAR BS\",\"1\",0,\"R\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"FECHA ESTIMADA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"HORA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"TOTAL A\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"$costo_contrato\",\"LRT\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"DE INSTALACION\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"SUGERIDA\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"PAGAR Bs.\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"\",\"LRB\",0,\"C\");*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PROGRAMACIÓN\",\"1\",0,\"C\");\t\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Descripción.\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Descripción\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Familiar Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Extendido Bs \",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Adulto Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Comercial I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Monto de Contrato: Bs. $costo_inst\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Firma del Abonado:_________________________ \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Puntos Adicionales:_________________________\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Costo Punto Adicional:_______________________\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Tiempo de Instalación:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Total a Cancelar Mensual:\",\"1\",0,\"J\");\n\t\t$this->Cell(30,6,\"Total:\",\"1\",0,\"J\");\n\t\t$this->Cell(35,6,\"Contrato:\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Observaciones.\",\"1\",0,\"J\");\n\t\t\t\t\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"$observacion\",\"1\",0,\"J\");*/\n\t\t\n\t/*\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"RECIBO DE PAGO\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"*EL PRECIO INCLUYE EL IMPUESTO DE LEY\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Efectivo\",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"Cheque\",\"1\",0,\"C\");\n\t\t$this->Cell(65,6,\"Cargo Cta. Cte.\",\"1\",0,\"C\");\n\t\t$this->Cell(60,6,\"Tarjeta de Credito:\",\"1\",0,\"C\");\n\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Bs. $costo_contrato\",\"1\",0,\"L\");\n\t\t$this->Cell(35,6,\"Nº.\",\"1\",0,\"L\");\n\t\t$this->Cell(65,6,\"Cta. Nº Bco.\",\"1\",0,\"L\");\n\t\t$this->Cell(60,6,\"Nombre:\",\"1\",0,\"L\");\n\t\t\n\t\n\t\t\n\t\t\n\t\t$this->Ln(15);\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Nota:\",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"En caso de que el televisor no acepte la señal de todos los canales del cable, es posible que amerite la instalación de un amplificador de sintonia, el cual deberá ser adquirido por el SUSCRIPTOR\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Atención: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"La Empresa. No autoriza el retiro de televisores y/o VHS por el personal de la empresa. El SUSCRIPTOR conoce y acepta las condiciones del contrato del servicio que apacen al dorso del presente\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Aviso: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"Se le informa a todos los suscriptores y publico en general de acuerdo a la Ley Orgánica de Telecomunicaciones, en el Artículo 189, Literal 2: será penado con prisión de uno (1) a cuatro (4) años, el que utilizando equipos o tecnologías de cualquier tipo, proporciones a un tercero el acceso o disfrute en forma fraudulenta o indebida de un serbicio o facilidad de telecomunicaciones \",\"0\",\"J\");\n\t\t\n\t\t\n\t\t\n\t\t$this->Ln(10);\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,5,\"________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"_________________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"__________________________\",\"0\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Firma del Vendedor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Nombre y Apellido del Suscriptor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Firma del Suscriptor\",\"0\",0,\"C\");*/\n\t\t\n\t\t/*$this->Ln(4);\n\t\t\n\t\t$this->SetDrawColor(76,136,206);\n\t\t$this->SetLineWidth(.4);\n\t\t$this->SetFont('times','I',12);\n\t\t$this->SetX(10);\n\t\t$this->MultiCell(195,5,'Av. Perimetral, Centro Comercial Residencial Central. P.B. Local Nº 07. Cúa, Edo. Miranda.\[email protected] / [email protected]',\"TB\",\"C\");*/\n\t\t\n\t\t//$this->clausulas();\n\t\t\n\t\treturn $cad;\n\t}", "public function determineId() {}", "abstract function getId();", "function getDatosId_dl()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_dl'));\n $oDatosCampo->setEtiqueta(_(\"id_dl\"));\n $oDatosCampo->setTipo('texto');\n return $oDatosCampo;\n }", "function action_deleteClient($id)\n{\n $tabFiche = getFiches(\"obj_id\", \"asc\", array(\"obj_id_vendeur\" => $id));\n if (sizeof($tabFiche) == 0) {\n $tabFiche = getFiches(\"obj_id\", \"asc\", array(\"obj_id_acheteur\" => $id));\n if (sizeof($tabFiche) == 0) {\n return deleteClient($id);\n } else {\n return \"Suppresion impossible, il reste des fiches achats reliées à ce client.\";\n }\n } else {\n return \"Suppresion impossible, il reste des fiches ventes reliées à ce client.\";\n }\n}", "public function getClivres_id($clivres_id=null)\n {\n if ($clivres_id != null && is_array($this->livres) && count($this->livres)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE clivres_id = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$clivres_id]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId($d['id']);\n$this->setTitre($d['titre']);\n$this->setDescription($d['description']);\n$this->setDate($d['date']);\n$this->setClivres_id($d['clivres_id']);\n$this->setAuteur($d['auteur']);\n$this->setPhoto($d['photo']);\n$this->setChemin($d['chemin']);\n$this->livres =$data; \n return $this;\n }\n \n } else {\n return $this->clivres_id;\n }\n \n }", "public function id_tarjeta();", "public function verRequisitos($id){\n $atr=array();\n $sql = \"SELECT id,nombre,tipo,vigencia,estatus,orden\n FROM mos_requisitos \n WHERE id =$id\"; \n $this->operacion($sql, $atr);\n return $this->dbl->data[0];\n }", "function imprimir_cabecera_comprobante($id) {\n $sql = \"SELECT\n\t\t\t\t prosic_comprobante.id_comprobante\n\t\t\t\t , prosic_comprobante.codigo_comprobante\n\t\t\t\t , prosic_comprobante.emision_comprobante\n\t\t\t\t , prosic_comprobante.serie_comprobante\n\t\t\t\t , prosic_comprobante.nro_comprobante\n\t\t\t\t , prosic_comprobante.total_comprobante\n\t\t\t\t , prosic_comprobante.glosa_comprobante\n\t\t\t\t\t, prosic_comprobante.tipo_cambio_comprobante\n\t\t\t\t , prosic_anexo.descripcion_anexo\n\t\t\t\t , prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_comprobante.id_moneda\n\t\t\t\t , prosic_moneda.nombre_moneda\n\t\t\t\t , prosic_tipo_comprobante.nombre_tipo_comprobante\n\t\t\t\t\t, prosic_tipo_comprobante.codigo_tipo_comprobante\n\t\t\t\t , prosic_local.id_empresa\n\t\t\t\t , prosic_empresa.nombre_empresa\n\t\t\t\t , prosic_empresa.ruc_empresa\n\t\t\t\t , prosic_local.direccion_local\n\t\t\t\t\t, prosic_comprobante.id_subdiario\n\t\t\t\t\t, prosic_subdiario.nombre_subdiario\n\t\t\t\t\t, prosic_banco.nombre_banco\n\t\t\t\t\t, prosic_banco.nro_cuenta_banco\n\t\t\tFROM prosic_comprobante\n\t\t\tINNER JOIN prosic_anexo \t\t\tON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n\t\t\tINNER JOIN prosic_moneda \t\t\tON (prosic_comprobante.id_moneda = prosic_moneda.id_moneda)\n\t\t\tINNER JOIN prosic_tipo_comprobante \tON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n\t\t\tINNER JOIN prosic_local \t\t\tON (prosic_comprobante.id_local = prosic_local.id_local)\n\t\t\tINNER JOIN prosic_empresa \t\t\tON (prosic_local.id_empresa = prosic_empresa.id_empresa)\n\t\t\tINNER JOIN prosic_subdiario\t\t\tON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n\t\t\tLEFT JOIN prosic_banco ON (prosic_comprobante.cuenta_banco = prosic_banco.id_plan_contable)\n\t\t\tWHERE prosic_comprobante.id_comprobante=\" . $id;\n $result = $this->Consulta_Mysql($sql);\n $row = mysql_fetch_assoc($result);\n return $row;\n }", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "static public function ctrEliminarProductoInventario($id){\n \n\t\t$tabla = \"inventario\";\n\n\t\t$respuesta = ModeloInventario::mdlEliminarProductoInventario($tabla, $id);\n\n\t\treturn $respuesta;\n\n\n\t\t}", "public function getId ();", "private function obtenerNuevoID()\n\t{\n\t\t$query = $this->db->select('MAX(CPRODUCTOFS) as id')\n\t\t\t->from('MPRODUCTOCLIENTE')\n\t\t\t->get();\n\t\tif (!$query) {\n\t\t\tthrow new Exception('Error al encontrar el Código de producto');\n\t\t}\n\t\treturn intval($query->row()->id) + 1;\n\t}", "public static function ComprobarAccesoGenerarContrato($id_inmueble,$id_cliente)\n\t{\t\t\n\t\trequire_once(PATHINCLUDE_FRAMEWORK_MODELOS.'Inmuebles.class.php');\n\t\t// Datos inmueble\n\t\t$inmueble = new ModelInmuebles();\n\t\t$inmueble->SetDataObject($id_inmueble);\n\t\t// Si no está en venta\n\t\tif($inmueble->precio_compra==0)\n\t\t\treturn -1;\n\t\t// Si no tiene ficha de encargo\n\t\trequire_once(PATHINCLUDE_FRAMEWORK_MODELOS.'FichasEncargoCliente.class.php');\n\t\t// Datos de fichas de encargo\n\t\t$ficha_encargo = new ModelFichasEncargoCliente();\n\t\t$fichas_encargo_obtenidas=$ficha_encargo->ObtenerFichasInmuebleCliente($id_inmueble,$id_cliente);\n\t\t$num_fichas_encargo=$fichas_encargo_obtenidas->RecordCount();\n\t\tif($num_fichas_encargo==0)\n\t\t\treturn -2;\n\t\t\n\t\treturn 1;\n\t}", "public function DetalleProductosPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function getConferenciaPorRecebimento($idRecebimento)\n {\n $sql = '\n SELECT NF.NUM_NOTA_FISCAL, NF.DAT_EMISSAO, NF.COD_SERIE_NOTA_FISCAL, NFI.COD_PRODUTO, P.DSC_PRODUTO, NFI.DSC_GRADE, RC.DTH_CONFERENCIA, \n CASE WHEN RC.COD_NOTA_FISCAL = NFI.COD_NOTA_FISCAL THEN (NFI.QTD_ITEM + RC.QTD_DIVERGENCIA) ELSE NFI.QTD_ITEM END QTD_CONFERIDA,\n CASE WHEN RC.COD_NOTA_FISCAL = NFI.COD_NOTA_FISCAL THEN 0 ELSE 0 END QTD_AVARIA, -- pending\n CASE WHEN RC.COD_NOTA_FISCAL = NFI.COD_NOTA_FISCAL THEN RC.QTD_DIVERGENCIA ELSE 0 END QTD_DIVERGENCIA,\n CASE WHEN RC.COD_NOTA_FISCAL = NFI.COD_NOTA_FISCAL THEN MDR.DSC_MOTIVO_DIVER_RECEB ELSE \\'\\' END DSC_MOTIVO_DIVER_RECEB\n FROM RECEBIMENTO R\n INNER JOIN NOTA_FISCAL NF ON (NF.COD_RECEBIMENTO = R.COD_RECEBIMENTO)\n INNER JOIN NOTA_FISCAL_ITEM NFI ON (NFI.COD_NOTA_FISCAL = NF.COD_NOTA_FISCAL)\n INNER JOIN PRODUTO P on (P.COD_PRODUTO = NFI.COD_PRODUTO AND P.DSC_GRADE = NFI.DSC_GRADE)\n INNER JOIN ORDEM_SERVICO OS ON (OS.COD_RECEBIMENTO = R.COD_RECEBIMENTO)\n INNER JOIN RECEBIMENTO_CONFERENCIA RC ON (RC.COD_OS = OS.COD_OS)\n LEFT JOIN MOTIVO_DIVER_RECEB MDR ON (MDR.COD_MOTIVO_DIVER_RECEB = RC.COD_MOTIVO_DIVER_RECEB)\n WHERE R.COD_RECEBIMENTO = ' . $idRecebimento . '\n AND NF.COD_STATUS != ' . NotaFiscalEntity::STATUS_CANCELADA . '\n AND RC.COD_PRODUTO = NFI.COD_PRODUTO\n AND RC.DSC_GRADE = NFI.DSC_GRADE\n ORDER BY NF.NUM_NOTA_FISCAL, NFI.COD_PRODUTO, RC.DTH_CONFERENCIA DESC';\n\n return $this->getEntityManager()->getConnection()->query($sql)->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function AbonosCreditosId() \n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, ventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.codventa as codigo, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (clientes INNER JOIN ventas ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa WHERE abonoscreditos.codabono = ? AND clientes.cedcliente = ? AND ventas.codventa = ? AND ventas.tipopagove ='CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET['codabono'])));\n\t$stmt->bindValue(2, trim(base64_decode($_GET['cedcliente'])));\n\t$stmt->bindValue(3, trim(base64_decode($_GET['codventa'])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public static function eliminarServicioOProducto($id) { \n error_reporting(0); \n $masinfo=\"<masinfo>\";\n $con = @mysqli_connect($GLOBALS['DIRECCION_BD'], $GLOBALS['USUARIO_BD'], $GLOBALS['CONTRASENA_BD'], $GLOBALS['NOMBRE_BD']); \n // Check connection\n if (mysqli_connect_errno() || !$con) {\n //Mensaje de fallo de conexion a bd \n $mensajeRespuesta= FuncionesComunes::obtenerMensaje('db0003');\n } else {\n\n if(count($id)>1)\n $sql = \"DELETE FROM serviciosyproductos WHERE id IN ((\".$id[1].\")\";\n else\n $sql = \"DELETE FROM serviciosyproductos WHERE id IN ((\".$id[0].\")\";\n //$sqlAND=\"\";\n \n \n for ($i=2;$i<count($id);$i++){\n //$sqlAND.=\" AND id='\".$id[$i].\"'\";\n $sql.= \",(\".$id[$i].\")\";\n }\n $sql.=\")\";\n $masinfo.=$sql.\":-:\".count($id).\":-:[0]\".$id[0].\":-:[1]\";\n $result = mysqli_query($con, $sql);\n //$serviciosproductos= array();\n \n if ($result) { \n //Mensaje de operacion exitosa\n $mensajeRespuesta= FuncionesComunes::obtenerMensaje('db0007'); \n } else {\n //Mensaje de que no hay registros en la tabla\n $mensajeRespuesta= FuncionesComunes::obtenerMensaje('db0008');\n }\n }\n if ($con) {\n mysqli_close($con);\n } \n $masinfo.=\"</masinfo>\";\n $respuesta = \"<respuesta>\" . $mensajeRespuesta . \"</respuesta>\";\n $xmlrespuesta = new SimpleXMLElement($respuesta);\n //return $respuesta;\n return $xmlrespuesta->asXML();\n }", "public function obtenerId() {}", "public function getIdfa();", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "function getId_asignatura()\n {\n if (!isset($this->iid_asignatura) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_asignatura;\n }", "function setIdComentaire($idCommentaire) {\n $this->idCommentaire = $idCommentaire;\n }", "function getRequiredModules($id){\n\t$sqlx = \"SELECT id_module, GROUP_CONCAT(id_required) AS id_required FROM module_deps WHERE id_module='\".$this->quoteInput($id).\"' GROUP BY id_module;\";\n\terror_log('Info from getRequiredModules: '.$id.\"...\".$sqlx);\n\t$result = array();\n\t$myresult = $this->conn->query($sqlx);\n\twhile($row = $myresult->fetch_assoc()) {\n\t\t$result[] = $row['id_required'];\n\t}\n\treturn $result[0];\n}", "public function getDEPENDENCIA()\r\n {\r\n return $this->DEPENDENCIA;\r\n }", "public function conseguirId (){\n $query = $this->db->query (\"SELECT * FROM acceso WHERE id_acceso = '{$this->id_acceso}'\");\n if ($query->num_rows === 1)\n {\n $this->datos= $query->fetch_assoc();\n \n }\n return $this->datos;\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "function get_entrada_pr_factura_id($id,$auth){\n\t\tif($auth==0){\n\t\t\t$validacion=\"and prf.usuario_validador_id=0 \";\n\t\t} else {\n\t\t\t$validacion=\" and prf.usuario_validador_id>0 \";\n\t\t}\n\t\t\t\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, ( prf.monto_total - prf.descuento ) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.id='$id' $validacion\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, prf.descuento, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getFundacion_idFundacion(){\n return $this->Fundacion_idFundacion;\n }", "function getId();", "static public function mdlEliminarProductoInventario( $tabla, $id){\n\ntry{\n\n \t\t$conn = Conexion::conectar();\n\t\t\n\t\t$conn->beginTransaction();\n \n\n\n\n \t\t$stmt = $conn->prepare(\"UPDATE $tabla SET sincronizado = 0,estado = 0 WHERE id = :id\");\n \n$stmt -> bindParam(\":id\" , $id, PDO::PARAM_INT);\n \t\t\n \t\t\n\t\t$stmt->execute();\n\t\n\n\t\t//UNA VEZ QUE INSERTAMOS EL PRODUCTO , TERMINAMOS INSERTANDO LAS TRANSACCIONES\n\n\t\t$conn->commit();\n \t\t\t//echo'<script>console.log(\"AQUI:'.$lastID.'\");</script>';\n \t\t\treturn \"ok\";\n\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\n\n}\ncatch(Exception $e) {\n \n $conn->rollBack();\n return ($e->getMessage());\n}\n\n\n\n\n\n \t}", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function countlineafactura($id)\n {\n $sql = \"SELECT COUNT(*) as totallinea FROM ventas_detalles VD\n INNER JOIN productos P \n ON VD.IDPROD = P.REFERENCIA\n WHERE VD.IDVENTA ='$id'\";\n return ejecutarConsulta($sql);\n }", "public function actionCreateDatos($id) {\n $traza = Traza::VerificarTraza($id); // verifica el guardado de la traza\n if ($traza != 2) {\n Generico::renderTraza($id); //renderiza a la traza\n }\n\n $model = Beneficiario::model()->findByPk($id);\n $estado = new Tblestado;\n $municipio = new Tblmunicipio;\n $parroquia = new Tblparroquia;\n $faovPromedio = ConsultaOracle::getFaov($id, 1); //consulta la funcion faov por id de persona, para mostrar el calculo de promedio\n $faovMensual = ConsultaOracle::getFaov($id, 2); //consulta la funcion faov por id de persona, para mostrar el calculo de ingreso mesual\n $model->ingreso_mensual = ($faovMensual) ? $faovMensual : '0.00';\n $model->ingreso_promedio_faov = ($faovPromedio) ? $faovPromedio : '0.00';\n\n// $consulta = UnidadFamiliar::model()->findByAttributes(array('beneficiario_id' => $id)); // consulta a Unidad Familiar por el id_beneficiario \n//\n// $sqlIngreso = \"select sum(ingreso_mensual) as ingreso from grupo_familiar where unidad_familiar_id=\".$consulta->id_unidad_familiar.\"\"; //consulta que suma cuanto es el ingreso de grupo familiar por id_beneficiario\n// $rowingreso = Yii::app()->db->createCommand($sqlIngreso)->queryRow();\n//// echo '<pre>'; var_dump($rowingreso); die(); \n// $consulta->ingreso_total_familiar=$rowingreso['ingreso']; //insert para unidad familiar ingreso_total_familiar\n// \n// $sqlFaov = \"select count(*) as faov from grupo_familiar where unidad_familiar_id=\".$consulta->id_unidad_familiar.\"\"; //consulta que suma cuantos cotizan en faov del grupo familiar por id_beneficiario\n// $rowFaov = Yii::app()->db->createCommand($sqlFaov)->queryRow();\n// \n// $consulta->total_personas_cotizando=$rowFaov['faov']; //insert para unidad familiar total de personas cotizando\n\n\n if (isset($_POST['Beneficiario']['parroquia_id'])) {\n $model->cedula = 'campo';\n $model->attributes = $_POST['Beneficiario'];\n $model->parroquia_id = $_POST['Beneficiario']['parroquia_id'];\n $model->urban_barrio = $_POST['Beneficiario']['urban_barrio'];\n $model->av_call_esq_carr = $_POST['Beneficiario']['av_call_esq_carr'];\n $model->zona = $_POST['Beneficiario']['zona'];\n $model->condicion_trabajo_id = $_POST['Beneficiario']['condicion_trabajo_id'];\n $model->fuente_ingreso_id = $_POST['Beneficiario']['fuente_ingreso_id'];\n $model->condicion_laboral = $_POST['Beneficiario']['condicion_laboral'];\n $model->sector_trabajo_id = $_POST['Beneficiario']['sector_trabajo_id'];\n $model->nombre_empresa = $_POST['Beneficiario']['nombre_empresa'];\n $model->direccion_empresa = $_POST['Beneficiario']['direccion_empresa'];\n $model->telefono_trabajo = $_POST['Beneficiario']['telefono_trabajo'];\n $model->gen_cargo_id = $_POST['Beneficiario']['gen_cargo_id'];\n $model->observacion = $_POST['Beneficiario']['observacion'];\n $model->estatus_beneficiario_id = 222;\n $model->usuario_id_actualizacion = Yii::app()->user->id;\n\n\n if ($model->save()) {\n\n $IdBeneficiarioTmp = $model->beneficiario_temporal_id;\n $n = BeneficiarioTemporal::model()->updateByPk($IdBeneficiarioTmp, array(\n 'estatus' => 79,\n 'usuario_id_actualizacion' => Yii::app()->user->id,\n 'fecha_actualizacion' => 'now()'\n ));\n\n $idtraza = Traza::ObtenerIdTraza($model->id_beneficiario); // pemite la busqueda de la id de la traza \n $delete = Traza::model()->findByPk($idtraza)->delete();\n\n $this->redirect(array('admin'));\n Yii::app()->end();\n }\n }\n\n $this->render('createDatos', array(\n 'model' => $model, 'municipio' => $municipio, 'estado' => $estado, 'parroquia' => $parroquia,\n ));\n }", "public function verDocumentoFuenteSinArchivo($id){\r\n $atr=array();\r\n $sql = \"SELECT \r\n doc_fisico\r\n ,contentType\r\n ,Codigo_doc\r\n ,nombre_doc\r\n ,version\r\n ,IDDoc\r\n ,formulario\r\n FROM mos_documentos \r\n WHERE IDDoc = $id \"; \r\n //echo $sql;\r\n $this->operacion($sql, $atr);\r\n return $this->dbl->data[0];\r\n }", "public function selectVersion2($id = '',$serie = '',$numero = '',$fecha_de_emision_desde = '',$fecha_de_emision_hasta = '',$cliente_id = '',$tipo_documento_id = '',$com_adjuntos = '',$anulado = '',$inicio = FALSE,$limite = FALSE, $empresa_id = ''){\n \n if($id != ''){\n $sql = \"SELECT com.fecha_de_emision fecha_sunat, \"\n . \" DATE_FORMAT(fecha_de_emision, '%d-%m-%Y') AS fecha_de_emision, \"\n . \" DATE_FORMAT(fecha_de_vencimiento, '%d-%m-%Y') AS fecha_de_vencimiento, \"\n . \" DATE_FORMAT(fecha_de_baja, '%d-%m-%Y') AS fecha_de_baja, \"\n . \" epr.ruc empresa_ruc, \"\n . \" epr.empresa empresa, \"\n . \" epr.descripcion1 descripcion1, \"\n . \" com.id comprobante_id, \"\n . \" com.empresa_id empresa_id, \"\n . \" com.tipo_documento_id tipo_documento_id, \"\n . \" com.serie serie, \"\n . \" com.numero numero, \"\n . \" com.total_a_pagar total_a_pagar, \"\n . \" com.total_gravada total_gravada, \"\n . \" com.total_exonerada total_exonerada, \"\n . \" com.total_inafecta total_inafecta, \"\n . \" com.total_igv total_igv, \"\n . \" com.total_gratuita total_gratuita, \"\n . \" com.total_otros_cargos total_otros_cargos, \"\n . \" com.detraccion detraccion, \"\n . \" com.operacion_cancelada operacion_cancelada, \"\n . \" com.operacion_gratuita operacion_gratuita, \"\n . \" com.porcentaje_de_detraccion porcentaje_de_detraccion, \"\n . \" com.total_detraccion total_detraccion, \"\n . \" com.cliente_id cliente_id, \"\n . \" com.tipo_nota_codigo tipo_nota_codigo, \"\n . \" com.moneda_id moneda_id, \"\n . \" com.tipo_de_cambio tipo_de_cambio, \"\n . \" com.observaciones observaciones, \" \n . \" com.enviado_cliente enviado_cliente, \"\n . \" com.enviado_equipo enviado_equipo, \" \n . \" cli.ruc cliente_ruc, \"\n . \" cli.tipo_cliente_id tipo_cliente_id, \"\n . \" cli.nombres cli_nombres, \"\n . \" cli.razon_social cli_razon_social, \"\n . \" cli.razon_social_sunat cli_razon_social_sunat, \"\n . \" cli.domicilio1 cli_domicilio1, \"\n . \" cli.email cli_email, \" \n . \" tpc.codigo tipo_cliente_codigo, \" \n . \" tdc.codigo tipo_documento_codigo, \"\n . \" tdc.tipo_documento tipo_documento, \"\n . \" eaa.id eee_id, \"\n . \" eaa.codigo codigo, \"\n . \" eaa.descripcion elemento_adicional_descripcion, \"\n . \" mon.moneda moneda, \"\n . \" mon.abrstandar abrstandar, \"\n . \" mon.simbolo simbolo\"\n . \" FROM comprobantes com \"\n . \" JOIN clientes cli ON com.cliente_id = cli.id \"\n . \" JOIN tipo_clientes tpc ON tpc.id = cli.tipo_cliente_id \"\n . \" JOIN monedas mon ON com.moneda_id = mon.id \"\n . \" JOIN tipo_documentos tdc ON com.tipo_documento_id = tdc.id \"\n . \" JOIN tipo_pagos tpp ON com.tipo_pago_id = tpp.id \"\n . \" JOIN empresas epr ON com.empresa_id = epr.id \"\n . \" LEFT JOIN elemento_adicionales eaa ON com.elemento_adicional_id = eaa.id \"\n . \" WHERE com.id = \".$id.\" AND eliminado=0 AND com.fecha_delete IS NULL\";\n \n //echo $sql;exit;\n $query = $this->db->query($sql); \n //var_dump($query->row_array());exit;\n return $query->row_array();\n }\n \n $where = '';$limit = '';\n if($serie != ''){$where.= ' AND serie = \"'.$serie.'\"';}\n if($numero != ''){$where.= ' AND numero = \"'.$numero.'\"';}\n if(($fecha_de_emision_desde != '') && ($fecha_de_emision_hasta != '')){$where.= \" AND fecha_de_emision BETWEEN '\" . $fecha_de_emision_desde . \"' AND '\" . $fecha_de_emision_hasta .\"'\";}\n if($cliente_id != ''){$where.= ' AND cliente_id = '.$cliente_id;}\n if($tipo_documento_id != ''){$where.= ' AND tipo_documento_id = '.$tipo_documento_id;}\n if($tipo_documento_id != ''){$where.= ' AND tipo_documento_id = '.$tipo_documento_id;}\n if($com_adjuntos != ''){$where.= ' AND tipo_documento_id IN(1,3)';}\n if($anulado != ''){$where.= ' AND anulado ='.$anulado;}\n if($empresa_id != ''){$where.= ' AND com.empresa_id ='.$empresa_id;}\n if($inicio !== FALSE && $limite !== FALSE){$limit.= ' LIMIT '.$inicio.','.$limite;} \n \n $sql = \"SELECT com.fecha_de_emision fecha_sunat, \"\n . \" DATE_FORMAT(fecha_de_emision, '%d-%m-%Y') AS fecha_de_emision, \"\n . \" DATE_FORMAT(fecha_de_vencimiento, '%d-%m-%Y') AS fecha_de_vencimiento, \"\n . \" DATE_FORMAT(fecha_de_baja, '%d-%m-%Y') AS fecha_de_baja, \"\n . \" epr.ruc empresa_ruc, \"\n . \" epr.empresa empresa, \"\n . \" epr.descripcion1 descripcion1, \"\n . \" com.id comprobante_id, \"\n . \" com.empresa_id empresa_id, \"\n . \" com.tipo_documento_id tipo_documento_id, \"\n . \" com.serie serie, \"\n . \" com.numero numero, \"\n . \" com.total_a_pagar total_a_pagar, \"\n . \" com.total_gravada total_gravada, \"\n . \" com.total_exonerada total_exonerada, \"\n . \" com.total_inafecta total_inafecta, \"\n . \" com.total_igv total_igv, \"\n . \" com.total_gratuita total_gratuita, \"\n . \" com.total_otros_cargos total_otros_cargos, \"\n . \" com.detraccion detraccion, \"\n . \" com.operacion_cancelada operacion_cancelada, \"\n . \" com.operacion_gratuita operacion_gratuita, \"\n . \" com.porcentaje_de_detraccion porcentaje_de_detraccion, \"\n . \" com.total_detraccion total_detraccion, \"\n . \" com.cliente_id cliente_id, \"\n . \" com.tipo_nota_codigo tipo_nota_codigo, \"\n . \" com.moneda_id moneda_id, \"\n . \" com.tipo_de_cambio tipo_de_cambio, \"\n . \" com.observaciones observaciones, \"\n . \" com.anulado anulado, \"\n . \" com.enviado_sunat enviado_sunat, \"\n . \" com.estado_sunat estado_sunat, \"\n . \" com.enviado_cliente enviado_cliente, \"\n . \" com.enviado_equipo enviado_equipo, \" \n . \" cli.ruc cliente_ruc, \"\n . \" cli.tipo_cliente_id tipo_cliente_id, \"\n . \" cli.nombres cli_nombres, \"\n . \" cli.razon_social cli_razon_social, \"\n . \" cli.razon_social razon_social, \"\n . \" cli.razon_social_sunat cli_razon_social_sunat, \"\n . \" cli.domicilio1 cli_domicilio1, \"\n . \" cli.email cli_email, \" \n . \" tpc.codigo tipo_cliente_codigo, \" \n . \" tdc.codigo tipo_documento_codigo, \"\n . \" tdc.tipo_documento tipo_documento, \"\n . \" eaa.id eee_id, \"\n . \" eaa.codigo codigo, \"\n . \" eaa.descripcion elemento_adicional_descripcion, \"\n . \" mon.moneda moneda, \"\n . \" mon.abrstandar abrstandar, \"\n . \" mon.simbolo simbolo\"\n . \" FROM comprobantes com \"\n . \" JOIN clientes cli ON com.cliente_id = cli.id \"\n . \" JOIN tipo_clientes tpc ON tpc.id = cli.tipo_cliente_id \"\n . \" JOIN monedas mon ON com.moneda_id = mon.id \"\n . \" JOIN tipo_documentos tdc ON com.tipo_documento_id = tdc.id \"\n . \" JOIN tipo_pagos tpp ON com.tipo_pago_id = tpp.id \"\n . \" JOIN empresas epr ON com.empresa_id = epr.id \"\n . \" LEFT JOIN elemento_adicionales eaa ON com.elemento_adicional_id = eaa.id \" \n . \" WHERE 1=1 AND eliminado=0 AND com.fecha_delete IS NULL \".$where.\" ORDER BY comprobante_id DESC\".$limit;\n //echo $sql;\n $query = $this->db->query($sql);\n //var_dump($query->result_array());exit;\n return $query->result_array(); \n }", "function adicionarNotaCredito($id, $datos = array()) {\n global $textos, $sql, $configuracion, $sesion_configuracionGlobal;\n\n if (!isset($id) || (isset($id) && !$sql->existeItem('facturas_venta', 'id', $id))) {\n $respuesta = array();\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('NO_HA_SELECCIONADO_ITEM');\n\n Servidor::enviarJSON($respuesta);\n return false;\n \n }\n \n $objeto = new FacturaVenta($id);\n $destino = '/ajax/facturas_venta/adicionarNotaCredito';\n\n if (empty($datos)) {\n $respuesta = array();\n\n $codigo = HTML::campoOculto('procesar', 'true');\n $codigo .= HTML::campoOculto('id', $id);\n $codigo .= HTML::campoOculto('datos[dialogo]', '', 'idDialogo');\n $codigo .= HTML::campoOculto('datos[id_factura]', $id, '');\n\n \n $codigo1 = HTML::parrafo($textos->id('CANTIDAD_DINERO_NOTA') . ': ' . HTML::campoTexto('datos[monto_nota]', 10, 15, '', 'flotanteDerecha campoObligatorio2 campoDinero soloNumeros', 'campoMontoNota'), 'negrilla margenSuperiorDoble bordeInferior espacioInferior15 margenDerechaTriple');\n $codigo1 .= HTML::parrafo($textos->id('CANTIDAD_IVA_NOTA') . ': ' . HTML::campoTexto('datos[iva_nota]', 10, 15, '', 'flotanteDerecha campoObligatorio2 campoDinero soloNumeros', 'campoIvaNota'), 'negrilla margenSuperiorDoble bordeInferior espacioInferior15 margenDerechaTriple');\n $codigo1 .= HTML::parrafo($textos->id('CANTIDAD_TOTAL_NOTA') . ': ' . HTML::campoTexto('datos[total_nota]', 10, 15, '', 'flotanteDerecha campoObligatorio2 campoDinero letraNegra', 'campoTotalNota', array('disabled' => 'disabled')), 'negrilla margenSuperiorDoble bordeInferior espacioInferior15 margenDerechaTriple');\n $codigo1 .= HTML::parrafo($textos->id('AFECTAR_CANTIDADES_INVENTARIO') . HTML::campoChequeo('datos[inventario_modificado]', false, 'chkModInventario margenIzquierda', 'chkModInventario'), 'negrilla margenSuperior');\n\n\n $codigo2 = HTML::parrafo($textos->id('CONCEPTO_NOTA'), 'negrilla margenSuperior');\n $codigo2 .= HTML::areaTexto('datos[concepto_nota]', 4, 50, '', 'txtAreaConceptoNotaC campoObligatorio', 'txtAreaConceptoNotaC');\n $codigo2 .= HTML::parrafo($textos->id('FECHA_NOTA') . HTML::campoTexto('datos[fecha_nota]', 12, 12, '', 'fechaAntigua campoCalendario', '', array('ayuda' => $textos->id('SELECCIONE_FECHA_NOTA'))), 'negrilla margenSuperior');\n\n //verificar el identificador escogido para los articulos en la configuracion global y usarlo para mostrar los datos\n $idPrincipalArticulo = (string)$sesion_configuracionGlobal->idPrincipalArticulo;\n $arrayIdArticulo = array('id' => $textos->id('ID_AUTOMATICO'), 'codigo_oem' => $textos->id('CODIGO_OEM'), 'plu_interno' => $textos->id('PLU')); \n \n\n $datosTabla = array(\n HTML::frase($textos->id($arrayIdArticulo[$idPrincipalArticulo]), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('ARTICULO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('CANTIDAD'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('CANTIDAD_A_MODIFICAR'), 'negrilla margenIzquierdaDoble'),\n );\n\n\n $listaArticulos = array();\n /**\n * Recorro el listado de articulos, y voy creando objetos en vivo para agregar al arreglo de objetos\n * para ver el listado exacto de los articulos que se cargan ver la clase FacturaVenta \n */\n foreach ($objeto->listaArticulos as $article) {\n //declaro un nuevo objeto vacio para poder armar la tabla\n $object = new stdClass();\n \n $object->plu = $article->$idPrincipalArticulo;\n $object->articulo = $article->articulo;\n $object->cantidad = $article->cantidad;\n \n \n $idReg = (int) $article->id ;\n\n if (strlen($object->articulo) > 60) {\n $object->articulo = substr($object->articulo, 0, 60) . '.';\n }\n /**\n *Aqui se añade un campo de texto que contiene la cantidad de cada uno de los articulos\n * notese que en \"valor\" se concatena la cantidad del articulo, estos datos son usados \n * en el metodo encargado de hacer el registro\n */\n $datosArticulo = $object->cantidad . '_' . (int)$article->idArticulo . '_' . (int)$article->idBodega;\n $object->nuevaCantidad = HTML::campoTexto('datos[nueva_cantidad][' . $datosArticulo . ']', 5, 10, $object->cantidad, 'margenIzquierdaDoble rangoNumeros', $idReg, array(\"rango\" => \"1-\".$object->cantidad.\"\"));\n $listaArticulos[] = $object;\n }\n\n\n $idTabla = 'tablaListaArticulosConsulta';\n $clasesColumnas = array('', '', '', '', '');\n $clasesFilas = array('centrado', 'centrado', 'centrado', 'centrado', 'centrado', 'centrado');\n $opciones = array('cellpadding' => '5', 'cellspacing' => '5', 'border' => '1');\n $clase = 'tablaListaArticulosConsulta';\n \n $contenedorListaArticles = HTML::tabla($datosTabla, $listaArticulos, $clase, $idTabla, $clasesColumnas, $clasesFilas, $opciones);\n\n\n\n $contenedor1 = HTML::contenedor($codigo1, 'contenedorIzquierdo margenInferiorDoble');\n $contenedor2 = HTML::contenedor($codigo2, 'contenedorDerecho margenInferiorDoble');\n $contenedor3 = HTML::contenedor($contenedorListaArticles, 'contenedorListadoArticulos oculto', 'contenedorListaArticulosNotaC');\n\n\n $codigo .= $contenedor1 . $contenedor2 . $contenedor3;\n $codigo .= HTML::parrafo(HTML::boton('chequeo', $textos->id('ACEPTAR'), ' margenSuperiorTriple', 'botonOk', 'botonOk'), 'margenSuperiorTriple');\n $codigo .= HTML::parrafo($textos->id('NOTA_CREDITO_ADICIONADA_A_FACTURA'), 'textoExitoso', 'textoExitoso');\n $codigo1 = HTML::forma($destino, $codigo, 'P');\n\n\n $respuesta['generar'] = true;\n $respuesta['cargarJs'] = true;\n $respuesta['archivoJs'] = $configuracion['SERVIDOR']['media'] . $configuracion['RUTAS']['javascript'] . '/modulos/facturas_venta/funcionesNotaCredito.js';\n $respuesta['codigo'] = $codigo1;\n $respuesta['titulo'] = HTML::parrafo($textos->id('INGRESAR_NOTA_CREDITO'), 'letraBlanca negrilla subtitulo');\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['ancho'] = 800;\n $respuesta['alto'] = 570;\n \n } else {\n \n $objeto = new NotaCreditoCliente($id);\n\n $respuesta['error'] = true;\n\n if (empty($datos['monto_nota'])) {\n $respuesta['mensaje'] = $textos->id('ERROR_FALTA_MONTO_NOTA');\n \n } elseif (empty($datos['iva_nota'])) {\n $respuesta['mensaje'] = $textos->id('ERROR_FALTA_IVA_NOTA');\n \n } elseif (empty($datos['concepto_nota'])) {\n $respuesta['mensaje'] = $textos->id('ERROR_FALTA_CONCEPTO_NOTA');\n \n } else {\n $idItem = $objeto->adicionar($datos);\n \n if ($idItem) {\n $respuesta['error'] = false;\n $respuesta['accion'] = 'insertar';\n $respuesta['insertarAjax'] = true;\n $respuesta['mostrarNotificacionDinamica'] = true;\n\n \n if ($datos['dialogo'] != '') {\n $respuesta['ventanaDialogo'] = $datos['dialogo'];\n \n }\n \n } else {\n $respuesta['mensaje'] = $textos->id('ERROR_DESCONOCIDO');\n \n }\n }\n }\n\n Servidor::enviarJSON($respuesta);\n \n}", "public function getNominaCuP($id)\n { \n $result=$this->adapter->query('update n_conceptos a \n inner join n_conceptos_tn b on b.idConc=a.id\n inner join n_nomina c on c.idTnom=b.idTnom\n set b.periodo = case when a.perAuto>b.periodo then b.periodo+1 else 1 end \n where a.perAuto>1 and c.id='.$id ,Adapter::QUERY_MODE_EXECUTE);\n }", "public function crud2Cliente($id){\n if(isset($_GET['Funcion'])){\n $funcion=$_GET['Funcion'];\n }else{\n $funcion=1;\n }\n if (!empty($id)) {\n\t\t\tif ($funcion==1) {\n //en esta linea validamos si existe el id y mandamos los datos a la vista para cargarlos por el formulario de ingreso\n\t\t\t\t\tif (!empty($this->mod_cli->loaddatosupdateCliente($id))) {\n\t\t\t\t\t\t\t$datos=$this->mod_cli->loaddatosupdateCliente($id);\n\t\t\t\t\t\t\t// print_r($datos);\n require_once \"views/Clientes/cliente/Frm_Clientes_Crud.php\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>alert(\"Error cargando datos del id['.$id.']\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t\t}\n\t\t\t}else if($funcion==2){\n\t\t\t\tif ($this->mod_cli->Insert_Update_Cliente(3,$id,'','','','','','','','','','','')) {\n\t\t\t\t\t\t\techo '<script>alert(\"eleminado el id['.$id.'] con exito\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>alert(\"Error al eliminar el id['.$id.']\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}else{\n\t\t\techo '<script>alert(\"No se enviaron datos\");</script>';\n\t\t\t$this->loadCliente();\n }\n }", "function getId_Producto(){\r\n\t\treturn $this->nId_Producto;\r\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "public function ProductosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}" ]
[ "0.58621323", "0.58474946", "0.57772523", "0.5738539", "0.5695178", "0.5693606", "0.56846595", "0.56731635", "0.5656044", "0.5640587", "0.5632214", "0.5615848", "0.56115896", "0.56080186", "0.5607772", "0.56063247", "0.55942893", "0.5565586", "0.55648434", "0.5553695", "0.55428237", "0.5533189", "0.55230105", "0.5500716", "0.5490293", "0.5463442", "0.54556257", "0.54529417", "0.5443916", "0.5443916", "0.5435629", "0.54279417", "0.54193175", "0.5417473", "0.5417317", "0.5414915", "0.5411921", "0.5401818", "0.540108", "0.53935415", "0.5392115", "0.5388702", "0.5388702", "0.53874147", "0.5376586", "0.53687525", "0.5366976", "0.53653497", "0.53649104", "0.53608483", "0.5355909", "0.5351221", "0.5347648", "0.53457654", "0.5345477", "0.5343971", "0.5343868", "0.53370446", "0.5335052", "0.5334761", "0.53347385", "0.53289676", "0.5324309", "0.53208965", "0.5317716", "0.53160125", "0.53137445", "0.53092575", "0.5304054", "0.530081", "0.5300631", "0.52912945", "0.5287", "0.52850974", "0.52838004", "0.52832764", "0.5278219", "0.5272898", "0.5270258", "0.5266612", "0.526353", "0.5262646", "0.5262646", "0.5262646", "0.52578056", "0.5256827", "0.52528465", "0.5245562", "0.52413917", "0.5232174", "0.52265817", "0.52259874", "0.52234125", "0.5223022", "0.5210678", "0.5209191", "0.5205652", "0.52013224", "0.52013224", "0.52013224", "0.5195738" ]
0.0
-1
OBTENGO UNA DEPENDENCE POR SU ID
function getDependenceById($dependence_id) { $query = $this->db->get_where('dependence', array('id'=>$dependence_id)); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final function __construct($id)\r\n\t{\r\n\t\tparent::__construct($id);\r\n\t\t$this->_transaccion_abierta = false;\r\n\t\t// Cargo las dependencias\r\n\t\tforeach( $this->_lista_dependencias as $dep){\r\n\t\t\t$this->cargar_dependencia($dep);\r\n\t\t\t$this->_dependencias[$dep]->set_controlador($this, $dep);\r\n\t\t\t$this->dep($dep)->inicializar();\r\n\t\t}\t\t\r\n\t}", "function buscarPorId($id) {\r\n \r\n }", "public function setIdWithDependency($id, $em) {\n $oldId = $this->getId();\n $this->setId($id);\n if ($id == 1){\n $this->setPartenaireId(1);\n }\n $tasksWithThatClientId = $em->getRepository('maindbBundle:Tachesimple')->findBy(Array('clientId' => $oldId));\n foreach ($tasksWithThatClientId as $task) {\n $task->setClientId($id);\n $em->persist($task);\n $em->flush();\n }\n $em->persist($this);\n $metadata = $em->getClassMetaData(get_class($this));\n $metadata->setIdGeneratorType(\\Doctrine\\ORM\\Mapping\\ClassMetadata::GENERATOR_TYPE_NONE);\n $em->flush();\n }", "function evt__1__salida()\n\t{\n\t\t$this->dep('dependencias')->limpiar_seleccion();\n\t}", "public static function getTotalDependency($id, $idDependencia)\n {\n $cont=0; \n for ($i = 1; $i <= $id; $i++){\n $consult=\"select * from division where id=\".$i.\" and id_dependency=\".$idDependencia.\"\";\n $dependencia[]=self::model()->findBySql($consult);\n }\n foreach($dependencia as $value){\n if ($value!=null){ ++$cont;}\n }\n return $cont;\n }", "function deleteArticulo( $id ){\n $sql = \"UPDATE `articulo` SET `activo`= 0 WHERE `id`= $id\";\n ejecutarConsulta($sql);\n }", "function make_remove($id){\n\t\tfor ($i=0;$i<count($this->table_names_modify);$i++){\n\t\t\t$this->modify_all_id_service($id,$this->table_names_modify[$i]);\n\t\t}\n\t\t//borramos todos aquellos registros en los que hay un id_user;\t\t\n\t\tfor ($i=0;$i<count($this->table_names_delete);$i++){\n\t\t\t$this->delete_all_id_service($id,$this->table_names_delete[$i]);\n\t\t}\n\t\n\t}", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "private function distribuidores_after_save($id='') {\n\t\t$tabla = \"distribuidores_usuarios\"; $key=\"id_distribuidor\"; \n\t\t$dataupdte[\"estado_epedidos\"] = \"0\";\n\t\t$this->Global_model->update_data($tabla,$dataupdte,array($key=>$id));\t\n\t\t\n\t}", "public function personaYCargo($id)\n {\n\n }", "public function traerPorVehiculo($id)\n {\n }", "abstract public function getId();", "function logDependency($id, $tbl) {\n if (!isset($this->dependency_log[$id])) $this->dependency_log[$id] = array();\n if (!in_array($tbl, $this->dependency_log[$id])) {\n $this->dependency_log[$id][] = $tbl;\n }\n }", "public function suprimerId($id)\n {\n }", "abstract function getId();", "public function requireById($id);", "public function atualizar($id)\n {\n }", "function getCompteUSer($ID){\n if (intval($ID)) {\n $data = getCompteID($ID);\n require('modification.php');\n //require('Liste-Compte.php');\n }\n else{\n throw new Exception(\"l'ID doit etre un Entier\");\n \n }\n }", "abstract public function buildDependency();", "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 test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function addDependenceObject($ident, Shared $object);", "public function hook_after_add($id) {\n\n }", "public function updateDependencies()\n {\n $db = Codeli::getInstance()->getDB();\n $db->query(\"DELETE FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n if (count($this->dependencies) < 1)\n {\n return;\n }\n\n $values = array();\n foreach ($this->dependencies as $dep => $data)\n {\n $values[] = \" ('$this->guid', '$dep') \";\n }\n\n $sql = \"INSERT INTO \" . SystemTables::MODULE_DEPENDENCY . \" (guid, dependencyGuid) VALUES \" . implode(\",\", $values);\n return $db->query($sql);\n }", "public function getVersiondId() {}", "public function ver($id)\n {\n //\n }", "function getId();", "function dolibarr_regler_facture($id_transaction) {\n\tspip_log(\"regler_facture_dolibarr $id_transaction 1\",'dolibarr' . _LOG_DEBUG);\n\t$transaction = sql_fetsel('*','spip_transactions','id_transaction='.intval($id_transaction));\n\tif(!$transaction or !$id_facture = $transaction['id_facture']) {\n\t\treturn false;\n\t}\n\tspip_log(\"regler_facture_dolibarr $id_transaction fact #$id_facture 2\",'dolibarr' . _LOG_DEBUG);\n\n\t$facture = sql_fetsel('*','spip_factures','id_facture='.intval($id_facture));\n\tif ($facture['no_comptable']) {\n\t\t$factref = $facture['no_comptable'];\n\t\tspip_log(\"regler_facture_dolibarr $id_transaction fact #$id_facture Ref $factref 3\",'dolibarr' . _LOG_DEBUG);\n\n\t\t$facture_doli = dolibarr_recuperer_facture(null, $factref);\n\t\tif (!$facture_doli) {\n\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction ECHEC dolibarr_recuperer_facture\",'dolibarr' . _LOG_ERREUR);\n\t\t}\n\t\telseif (!$factid = $facture_doli->id) {\n\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction ECHEC dolibarr_recuperer_facture pas de factid\",'dolibarr' . _LOG_ERREUR);\n\t\t\tspip_log($facture_doli,'dolibarr' . _LOG_ERREUR);\n\t\t}\n\t\telse {\n\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction 4\",'dolibarr' . _LOG_DEBUG);\n\t\t\t$fact_paye = $facture_doli->paye;\n\t\t\tif ($fact_paye) {\n\t\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction Facture DOLI $factref/#$factid DEJA PAYEE\",'dolibarr' . _LOG_DEBUG);\n\t\t\t}\n\t\t\telseif ($transaction['reglee'] !== 'oui') {\n\t\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction reglee!=oui\",'dolibarr' . _LOG_DEBUG);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// marquer la facture comme payee dans dolibarr (sauf si montant nul, doli ne sait pas faire)\n\t\t\telse {\n\t\t\t\tspip_log(\"regler_facture_dolibarr $id_transaction 5\",'dolibarr' . _LOG_DEBUG);\n\t\t\t\t$libelle = _T('bank:titre_transaction').' #'.$transaction['id_transaction']; //.' | '.$transaction['mode'].' '.$transaction['autorisation_id'];\n\t\t\t\t$paiement = array(\n\t\t\t\t\t\t'date_paiement' => $transaction['date_paiement'],\n\t\t\t\t\t\t'montant' => $facture['montant_regle'],\n\t\t\t\t\t\t'type_paiement' => _DOLIBARR_TYPE_PAIEMENT_CB,\n\t\t\t\t\t\t'id_bank' => _DOLIBARR_ID_BANK_PAIEMENT, /* Banque par defaut */\n\t\t\t\t\t\t'libelle' => trim($libelle),\n\t\t\t\t);\n\n\t\t\t\tif (strncmp($transaction['mode'],'cheque',6) == 0) {\n\t\t\t\t\t$paiement['type_paiement'] = _DOLIBARR_TYPE_PAIEMENT_CHEQUE;\n\t\t\t\t}\n\t\t\t\tif (strncmp($transaction['mode'],'virement',8) == 0) {\n\t\t\t\t\t$paiement['type_paiement'] = _DOLIBARR_TYPE_PAIEMENT_VIREMENT;\n\t\t\t\t}\n\t\t\t\t// un id_bank specifique pour ce presta ?\n\t\t\t\t$presta = explode('/', $transaction['mode']);\n\t\t\t\t$presta = reset($presta);\n\t\t\t\tif (substr($presta, -5) === '_test') {\n\t\t\t\t\t$presta = substr($presta, 0, -5);\n\t\t\t\t}\n\t\t\t\t$constant_id_bank = '_DOLIBARR_ID_BANK_PAIEMENT_' . strtoupper($presta);\n\t\t\t\tif (defined($constant_id_bank)) {\n\t\t\t\t\t$paiement['id_bank'] = constant($constant_id_bank); /* id Compte Banque Specifique pour ce presta */\n\t\t\t\t}\n\t\t\t\t//spip_log(\"paiement $factid presta $presta \".json_encode($paiement),'dolibarr');\n\t\t\t\t$id_paiement = dolibarr_facture_payer($factid, $paiement);\n\t\t\t\tspip_log(\"paiement $factid : $id_paiement\",'dolibarr');\n\n\n\t\t\t\tif ($facture['parrain'] == 'dolibarr' && defined('_DOLIBARR_EMAIL_NOTIF_REGLEMENT_FACTURE')) {\n\t\t\t\t\t$sujet = \"Reglement CB Facture Dolibarr $factref\";\n\t\t\t\t\t$url= generer_url_public('facture',\"id_facture=$id_facture&hash=\".md5($facture['details']),false,false);\n\t\t\t\t\t$url_fac_doli = false;\n\t\t\t\t\tif (defined('_DOLIBARR_PUBLIC_URL')) {\n\t\t\t\t\t\t$url_fac_doli = _DOLIBARR_PUBLIC_URL . \"compta/facture/card.php?facid=$factid\";\n\t\t\t\t\t}\n\t\t\t\t\t$texte =\n\t\t\t\t\t\t\"<html>\n<body>\n<p><a href='$url'>$url</a></p>\"\n. ($url_fac_doli ? \"<p><a href='$url_fac_doli'>$url_fac_doli</a></p>\" : '')\n.\"<div>\" . $facture['client'] . \"<br /></div>\"\n.$facture['details'].\"\n</body>\n</html>\";\n\n\t\t\t\t\t$envoyer_mail = charger_fonction('envoyer_mail','inc');\n\t\t\t\t\t$envoyer_mail(_DOLIBARR_EMAIL_NOTIF_REGLEMENT_FACTURE, $sujet, $texte);\n\t\t\t\t\t//include_spip('inc/notifications');\n\t\t\t\t\t//notifications_envoyer_mails(, $texte, $sujet);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdolibarr_pdfiser_facture($facture['no_comptable']);\n\n\t\t\t// et on envoie un mail de confirm au client de la facture pour qu'il ait une trace\n\t\t\tif ($transaction['contenu'] and $infos = json_decode($transaction['contenu'], true)) {\n\t\t\t\t$email = $infos['email'];\n\n\t\t\t\t$contexte = array_merge($infos, array('id_transaction' => $id_transaction));\n\t\t\t\t$texte = recuperer_fond('notifications/email_reglement_dolibarr', $contexte);\n\n\t\t\t\tinclude_spip('inc/config');\n\t\t\t\t$from = lire_config('bank/email_from_ticket_admin', $GLOBALS['meta']['email_webmaster']);\n\n\t\t\t\tinclude_spip(\"inc/notifications\");\n\t\t\t\tnotifications_envoyer_mails($email, $texte, '', $from);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function cargar_registro_venta_id($id) {\n return true;\n }", "public static function vaccinChangeId($args) {\n // on affiche le formulaire et on demande les doses à changer \n $results = ModelVaccin::getAll();\n // ----- Construction chemin de la vue\n include 'config.php';\n $vue = $root . '/app/view/gestion des vaccins/viewChange.php';\n require ($vue); \n }", "public function rechercherId($id)\n {\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "function unlinkDependencies($module, $id) {\n\t\tglobal $log;\n\n\t\t//Deleting Contact related Potentials.\n\t\t$pot_q = 'SELECT vtiger_crmentity.crmid FROM vtiger_crmentity\n\t\t\tINNER JOIN vtiger_potential ON vtiger_crmentity.crmid=vtiger_potential.potentialid\n\t\t\tLEFT JOIN vtiger_account ON vtiger_account.accountid=vtiger_potential.related_to\n\t\t\tWHERE vtiger_crmentity.deleted=0 AND vtiger_potential.related_to=?';\n\t\t$pot_res = $this->db->pquery($pot_q, array($id));\n\t\t$pot_ids_list = array();\n\t\tfor($k=0;$k < $this->db->num_rows($pot_res);$k++)\n\t\t{\n\t\t\t$pot_id = $this->db->query_result($pot_res,$k,\"crmid\");\n\t\t\t$pot_ids_list[] = $pot_id;\n\t\t\t$sql = 'UPDATE vtiger_crmentity SET deleted = 1 WHERE crmid = ?';\n\t\t\t$this->db->pquery($sql, array($pot_id));\n\t\t}\n\t\t//Backup deleted Contact related Potentials.\n\t\t$params = array($id, RB_RECORD_UPDATED, 'vtiger_crmentity', 'deleted', 'crmid', implode(\",\", $pot_ids_list));\n\t\t$this->db->pquery('INSERT INTO vtiger_relatedlists_rb VALUES(?,?,?,?,?,?)', $params);\n\n\t\t//Backup Contact-Trouble Tickets Relation\n\t\t$tkt_q = 'SELECT ticketid FROM vtiger_troubletickets WHERE contact_id=?';\n\t\t$tkt_res = $this->db->pquery($tkt_q, array($id));\n\t\tif ($this->db->num_rows($tkt_res) > 0) {\n\t\t\t$tkt_ids_list = array();\n\t\t\tfor($k=0;$k < $this->db->num_rows($tkt_res);$k++)\n\t\t\t{\n\t\t\t\t$tkt_ids_list[] = $this->db->query_result($tkt_res,$k,\"ticketid\");\n\t\t\t}\n\t\t\t$params = array($id, RB_RECORD_UPDATED, 'vtiger_troubletickets', 'contact_id', 'ticketid', implode(\",\", $tkt_ids_list));\n\t\t\t$this->db->pquery('INSERT INTO vtiger_relatedlists_rb VALUES (?,?,?,?,?,?)', $params);\n\t\t}\n\t\t//removing the relationship of contacts with Trouble Tickets\n\t\t$this->db->pquery('UPDATE vtiger_troubletickets SET contact_id=0 WHERE contact_id=?', array($id));\n\n\t\t//Backup Contact-PurchaseOrder Relation\n\t\t$po_q = 'SELECT purchaseorderid FROM vtiger_purchaseorder WHERE contactid=?';\n\t\t$po_res = $this->db->pquery($po_q, array($id));\n\t\tif ($this->db->num_rows($po_res) > 0) {\n\t\t\t$po_ids_list = array();\n\t\t\tfor($k=0;$k < $this->db->num_rows($po_res);$k++)\n\t\t\t{\n\t\t\t\t$po_ids_list[] = $this->db->query_result($po_res,$k,\"purchaseorderid\");\n\t\t\t}\n\t\t\t$params = array($id, RB_RECORD_UPDATED, 'vtiger_purchaseorder', 'contactid', 'purchaseorderid', implode(\",\", $po_ids_list));\n\t\t\t$this->db->pquery('INSERT INTO vtiger_relatedlists_rb VALUES (?,?,?,?,?,?)', $params);\n\t\t}\n\t\t//removing the relationship of contacts with PurchaseOrder\n\t\t$this->db->pquery('UPDATE vtiger_purchaseorder SET contactid=0 WHERE contactid=?', array($id));\n\n\t\t//Backup Contact-SalesOrder Relation\n\t\t$so_q = 'SELECT salesorderid FROM vtiger_salesorder WHERE contactid=?';\n\t\t$so_res = $this->db->pquery($so_q, array($id));\n\t\tif ($this->db->num_rows($so_res) > 0) {\n\t\t\t$so_ids_list = array();\n\t\t\tfor($k=0;$k < $this->db->num_rows($so_res);$k++)\n\t\t\t{\n\t\t\t\t$so_ids_list[] = $this->db->query_result($so_res,$k,\"salesorderid\");\n\t\t\t}\n\t\t\t$params = array($id, RB_RECORD_UPDATED, 'vtiger_salesorder', 'contactid', 'salesorderid', implode(\",\", $so_ids_list));\n\t\t\t$this->db->pquery('INSERT INTO vtiger_relatedlists_rb VALUES (?,?,?,?,?,?)', $params);\n\t\t}\n\t\t//removing the relationship of contacts with SalesOrder\n\t\t$this->db->pquery('UPDATE vtiger_salesorder SET contactid=0 WHERE contactid=?', array($id));\n\n\t\t//Backup Contact-Quotes Relation\n\t\t$quo_q = 'SELECT quoteid FROM vtiger_quotes WHERE contactid=?';\n\t\t$quo_res = $this->db->pquery($quo_q, array($id));\n\t\tif ($this->db->num_rows($quo_res) > 0) {\n\t\t\t$quo_ids_list = array();\n\t\t\tfor($k=0;$k < $this->db->num_rows($quo_res);$k++)\n\t\t\t{\n\t\t\t\t$quo_ids_list[] = $this->db->query_result($quo_res,$k,\"quoteid\");\n\t\t\t}\n\t\t\t$params = array($id, RB_RECORD_UPDATED, 'vtiger_quotes', 'contactid', 'quoteid', implode(\",\", $quo_ids_list));\n\t\t\t$this->db->pquery('INSERT INTO vtiger_relatedlists_rb VALUES (?,?,?,?,?,?)', $params);\n\t\t}\n\t\t//removing the relationship of contacts with Quotes\n\t\t$this->db->pquery('UPDATE vtiger_quotes SET contactid=0 WHERE contactid=?', array($id));\n\t\t//remove the portal info the contact\n\t\t$this->db->pquery('DELETE FROM vtiger_portalinfo WHERE id = ?', array($id));\n\t\t$this->db->pquery('UPDATE vtiger_customerdetails SET portal=0,support_start_date=NULL,support_end_date=NULl WHERE customerid=?', array($id));\n\t\tparent::unlinkDependencies($module, $id);\n\t}", "function getDependency();", "public function load_data($id=null){\r\n \t//$this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \t//$data=$this->Apimodel->getSub($id);//submiss,soal\r\n\t \t// $data['problem']=$this->Apimodel->getProblem();\r\n\t \t$ids = $this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \techo('<pre>');\r\n\t\tprint_r($ids);\r\n\t\techo('</pre>');\r\n\r\n\r\n\t}", "function setIdComentaire($idCommentaire) {\n $this->idCommentaire = $idCommentaire;\n }", "function buscar_id($id_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tlibro\n\t\t\t\tWHERE id_libro='$id_libro'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('libroClass.php');\n\t\t\t$libro = new Libro($resultado[0]['id_libro'], $resultado[0]['nombre_libro'], $resultado[0]['paginas_libro'], $resultado[0]['codigo_libro'], $resultado[0]['version_libro'], $resultado[0]['id_editorial'], $resultado[0]['id_estado_libro']);\n\t\t\t//Regreso los productos\n\t\t\treturn $libro;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "function setId_dl($iid_dl = '')\n {\n $this->iid_dl = $iid_dl;\n }", "public function setId()\n\t{\n\t}", "function consec_productobyID($id) {\n $sql = \"\n SELECT\n COUNT(idusuario)\n FROM vendedor\n WHERE idusuario=?;\";\n //$sql = $this->db->query($sql, array($id));\n \n //return $sql->simple_query(); //->total_cortes;\n }", "public static function TraerUnProducto($idParametro) \n\t{\t\n\n\n\t\t$objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n\t\t$consulta =$objetoAccesoDato->RetornarConsulta(\"SELECT * FROM productos WHERE idProd=:idProd\");\n\t\t//$consulta =$objetoAccesoDato->RetornarConsulta(\"CALL TraerUnaPersona(:id)\");\n\t\t$consulta->bindValue(':idProd', $idParametro, PDO::PARAM_INT);\n\t\t$consulta->execute();\n\t\t$productoBuscado= $consulta->fetchObject('producto');\n\t\treturn $productoBuscado;\t\n\t\t\t\t\t\n\t}", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public static function TraerUnProducto($idParametro) \n\t{\t\n\n\n\t\t$objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n\t\t$consulta =$objetoAccesoDato->RetornarConsulta(\"select * from local_producto where id_prod =:id\");\n\t//$consulta =$objetoAccesoDato->RetornarConsulta(\"CALL TraerUnaPersona(:id)\");\n\t\t$consulta->bindValue(':id', $idParametro, PDO::PARAM_INT);\n\t\t$consulta->execute();\n\t\t$personaBuscada= $consulta->fetchObject('local_producto');\n\t\treturn $personaBuscada;\t\n\t\t\t\t\t\n\t}", "public function hook_after_add($id)\n\t{\n\t\t//Your code here\n\n\t}", "public function hook_after_add($id) { \n\t //Your code here\n\n\t }", "public function hook_after_add($id) { \n\t //Your code here\n\n\t }", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "public function getNominaCuP($id)\n { \n $result=$this->adapter->query('update n_conceptos a \n inner join n_conceptos_tn b on b.idConc=a.id\n inner join n_nomina c on c.idTnom=b.idTnom\n set b.periodo = case when a.perAuto>b.periodo then b.periodo+1 else 1 end \n where a.perAuto>1 and c.id='.$id ,Adapter::QUERY_MODE_EXECUTE);\n }", "public function idDefinitivo($tipo,$id){\n $iddef=0;\n $objA=new admonDAO(); //direcionador =1 mandar a admon\n $objM=new medicoDAO(); //direcionar=2 mandar a medico\n $objP=new pacienteDAO(); //direccionar=3 mandar a paciente\n $resul1=$objA->readOneById($id); //error en datos\n $resul2=$objM->readOneById($id);\n $resul3=$objP->readOneById($id);\n \n if($tipo==1){\n for($i=0;$i<count($resul1);$i++){\n $iddef=$resul1[$i]['id_admon'];\n }\n }\n if($tipo==2){\n for($i=0;$i<count($resul2);$i++){\n $iddef=$resul2[$i]['id_medico'];\n }\n }\n if($tipo==3){\n for($i=0;$i<count($resul3);$i++){\n $iddef=$resul3[$i]['id_paciente'];\n }\n }\n \n return $iddef;\n }", "function deplacer_tache($id_tache, $id_dossier_destination)\r\n{\r\n\tglobal $objet;\r\n\t////\tAccès en écriture à la tache et au dossier de destination\r\n\tif(droit_acces($objet[\"tache\"],$id_tache)>=2 && droit_acces($objet[\"tache_dossier\"],$id_dossier_destination)>=2)\r\n\t{\r\n\t\t////\tSi on deplace à la racine, on donne les droits d'accès de l'ancien dossier\r\n\t\tracine_copie_droits_acces($objet[\"tache\"], $id_tache, $objet[\"tache_dossier\"], $id_dossier_destination);\r\n\t\t////\tOn déplace la tache\r\n\t\tdb_query(\"UPDATE gt_tache SET id_dossier=\".db_format($id_dossier_destination).\" WHERE id_tache=\".db_format($id_tache));\r\n\t}\r\n\t////\tLogs\r\n\tadd_logs(\"modif\", $objet[\"tache\"], $id_tache);\r\n}", "function deplacer_tache_dossier($id_dossier, $id_dossier_destination)\r\n{\r\n\tglobal $objet;\r\n\t////\tAccès total au dossier en question & accès en écriture au dossier destination & controle du déplacement du dossier\r\n\tif(droit_acces($objet[\"tache_dossier\"],$id_dossier)==3 && droit_acces($objet[\"tache_dossier\"],$id_dossier_destination)>=2 && controle_deplacement_dossier($objet[\"tache_dossier\"],$id_dossier,$id_dossier_destination)==1) {\r\n\t\tdb_query(\"UPDATE gt_tache_dossier SET id_dossier_parent=\".db_format($id_dossier_destination).\" WHERE id_dossier=\".db_format($id_dossier));\r\n\t}\r\n\t////\tLogs\r\n\tadd_logs(\"modif\", $objet[\"tache_dossier\"], $id_dossier);\r\n}", "function construir_id_def_base($nombre_fuente)\n\t{\n\t\treturn $this->get_instancia()->get_id().' '.$this->get_id().' '.$nombre_fuente;\n\t}", "public function borrarIdCtr($id){\n\n // este require debe estar aca para que el archivo de ajax lo reconozca\n require_once \"../modelo/modelo.php\";\n\n $respuestaMdl = Modelo::borrarIdMdl($id, \"notas_2\");\n\n if($respuestaMdl == \"exito\"){\n return \"nota borrada con exito\";\n }else{\n return \"error desde el controlador (el modelo no dijo error)\";\n }\n\n }", "public function getIdfa();", "public function determineId() {}", "public function iloscMinus($id)\n\t\t{\n\t\t\t$data = array();\n\t\t\t\tif($id === NULL || $id === \"\")\n\t\t\t\t\t$data['error'] = 'Nieokreślone ID!';\n\t\t\t\telse\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$stmt2 = $this->pdo->prepare('SELECT IdTowar, ilosc FROM `koszyk` where IdTowar=:id');\n\t\t\t\t\t\t$stmt2 -> bindValue(':id',$id,PDO::PARAM_INT);\n\t\t\t\t\t\t$ilosc = $stmt2 -> execute();\n\t\t\t\t\t\t$data = $stmt2 -> fetchAll();\n\t\t\t\t\t\tforeach($data as $result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ilosc = $result['ilosc'];\n\t\t\t\t\t\t\t$idt = $result['IdTowar'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ilosc>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo $id.'<br>towary: ';\n\t\t\t\t\t\t\tvar_dump($_COOKIE['idtowary']);\n\t\t\t\t\t\t\t$stmt = $this->pdo->prepare('UPDATE koszyk SET ilosc=ilosc-1 WHERE IdTowar=:id');\n\t\t\t\t\t\t\t$stmt -> bindValue(':id',$id,PDO::PARAM_INT);\n\t\t\t\t\t\t\t$wynik_zapytania = $stmt -> execute();\n\n\t\t\t\t\t\t\t$stmt2 = $this->pdo->prepare(\"update towar set towar.StanMagazynowyDysponowany = towar.StanMagazynowyDysponowany+1 where IdTowar = $idt\");\n\t\t\t\t\t\t\t$stmt2 -> execute();\n\n\t\t\t\t\t\t\t$cookie2 = $_COOKIE['idtowary'];\n\t\t\t\t\t\t\t$cookie2 = stripslashes($cookie2);\n\t\t\t\t\t\t\t$ids = json_decode($cookie2, true);\n\n\t\t\t\t\t\t\tif(($k = array_search($idt, $ids)) === false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// echo 'nie ma';\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 //echo 'jest';\n\t\t\t\t\t\t\t $indeks = array_search($idt, $ids);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$cookie = $_COOKIE['ilosci'];\n\t\t\t\t\t\t\t$cookie = stripslashes($cookie);\n\t\t\t\t\t\t\t$quantity = json_decode($cookie, true);\n\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tif(($k = array_search($idt, $ids)) === false){}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<br>ilosci ';\n\t\t\t\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\t\t\t\t$ilosc=$ilosc-1;\n\t\t\t\t\t\t\t $quantity[$indeks]=$ilosc;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dane = json_encode($quantity);\n\t\t\t\t\t\t\tsetcookie('ilosci', $dane,time()+60*60*24*30,'/');\n\t\t\t\t\t\t\t$_COOKIE['ilosci'] = $dane;\n\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(\\PDOException $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['error'] =$data['error'].'<br> Błąd wykonywania operacji usunięcia';\n\t\t\t\t\t}\n\t\t\t\t\t/*var_dump($_COOKIE['idtowary']);\n\t\t\t\t\techo '<br>';\n\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\techo '<br>';*/\n\t\t\t\treturn $data;\n\n\t\t}", "function getId_dl()\n {\n if (!isset($this->iid_dl) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_dl;\n }", "function add_adjunto_producto($id,$archivo){\n\t\t$this->db->set('Imagen', $archivo);\n\t\t$this->db->where('Id_platillo',$id);\n\t\t$this->db->update('jam_platillo',$data);\n\t}", "public function intGetNewId() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement retrieval of a \".\n \"new numeric identifier as a descrite function. It may not be \" .\n \"applicable.\"\n , debug_backtrace()\n );\n }", "public function setIdAtelier($valeur){\n $this->idAtelier = $valeur;\n }", "function DelArtikelAuftrag($id)\n {\n\n\n }", "static public function mdlEliminarProductoInventario( $tabla, $id){\n\ntry{\n\n \t\t$conn = Conexion::conectar();\n\t\t\n\t\t$conn->beginTransaction();\n \n\n\n\n \t\t$stmt = $conn->prepare(\"UPDATE $tabla SET sincronizado = 0,estado = 0 WHERE id = :id\");\n \n$stmt -> bindParam(\":id\" , $id, PDO::PARAM_INT);\n \t\t\n \t\t\n\t\t$stmt->execute();\n\t\n\n\t\t//UNA VEZ QUE INSERTAMOS EL PRODUCTO , TERMINAMOS INSERTANDO LAS TRANSACCIONES\n\n\t\t$conn->commit();\n \t\t\t//echo'<script>console.log(\"AQUI:'.$lastID.'\");</script>';\n \t\t\treturn \"ok\";\n\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\n\n}\ncatch(Exception $e) {\n \n $conn->rollBack();\n return ($e->getMessage());\n}\n\n\n\n\n\n \t}", "function action_deleteClient($id)\n{\n $tabFiche = getFiches(\"obj_id\", \"asc\", array(\"obj_id_vendeur\" => $id));\n if (sizeof($tabFiche) == 0) {\n $tabFiche = getFiches(\"obj_id\", \"asc\", array(\"obj_id_acheteur\" => $id));\n if (sizeof($tabFiche) == 0) {\n return deleteClient($id);\n } else {\n return \"Suppresion impossible, il reste des fiches achats reliées à ce client.\";\n }\n } else {\n return \"Suppresion impossible, il reste des fiches ventes reliées à ce client.\";\n }\n}", "public function getIdOnly();", "public function getId() {}", "public function getId() {}", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "function id_articulo($id){\n return (int)limpiarDatos($id);\n}", "function seleccionar_ef($id)\n\t{\n\t\t$id_interno = $this->get_tabla()->get_id_fila_condicion(array($this->campo_clave=>$id));\n\t\tif (count($id_interno) == 1) {\n\t\t\t$this->evt__efs_lista__seleccion(current($id_interno));\n\t\t} else {\n\t\t\tthrow new toba_error(\"No se encontro el ef $id.\");\n\t\t}\n\t}", "function run_ongkoskirim_id() {\n\n\t$plugin = new Ongkoskirim_Id();\n\t$plugin->run();\n\n}", "function modificar_dependencia($anterior, $nuevo)\n\t{\n\t\t//Este cambio se le notifica a las pantallas\n\t\t$this->get_entidad()->tabla('pantallas')->cambiar_id_dependencia($anterior, $nuevo);\n\t}", "function autoriser_commande_dist($faire, $quoi, $id, $qui, $options) {\r\n\treturn\r\n\t\t$qui['id_auteur'] == sql_getfetsel('id_auteur', 'spip_commandes', 'id_commande = '.sql_quote($id)) OR \r\n\t\t\t( $qui['statut'] == '0minirezo'\r\n\t\t\t AND !$qui['restreint'] );\r\n}", "function deactivate_ongkoskirim_id() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-ongkoskirim-id-deactivator.php';\n\tOngkoskirim_Id_Deactivator::deactivate();\n}", "public function hook_after_add($id) { \n\t \\DB::table('purchase_invoice_items')\n\t\t\t->where('id_purchase_invoice',null)\n\t\t\t->update(['id_purchase_invoice'=>$id]);\n\t }", "private function computeId(): void\n {\n /** @noinspection JsonEncodingApiUsageInspection */\n $this->id = md5(\n json_encode(\n [\n $this->simulation->id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n collect($this->findByTags)->map(fn($t) => strtolower($t))->sort()->toArray(),\n $this->searchMode\n ]\n )\n );\n }", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "public function setId_recette($id) {\n\n\t\t$id = (int) $id;\n\n \tif ($id>0) {\n\n \t\t$this->_id_recette = $id;\n\n \t}\n\n\t}", "public function\teliminarVoceroDependienteDeVoceria($id,$elimina)\n\t\t{\n\t\tif($elimina==0)\n\t\t\t$elimina=1;\n\t\telse\n\t\t\t$elimina=0;\t\n\t\t$sql=\"UPDATE vocero \n\t\tSET vocero.eliminado='$elimina',vocero.estatus='0' \n\t\tWHERE vocero.id_voceria='$id';\";\n\t\t$res=Conectar::conexion()->query($sql);\n\t\treturn $res;\n\t\t}", "public function crud2Cliente($id){\n if(isset($_GET['Funcion'])){\n $funcion=$_GET['Funcion'];\n }else{\n $funcion=1;\n }\n if (!empty($id)) {\n\t\t\tif ($funcion==1) {\n //en esta linea validamos si existe el id y mandamos los datos a la vista para cargarlos por el formulario de ingreso\n\t\t\t\t\tif (!empty($this->mod_cli->loaddatosupdateCliente($id))) {\n\t\t\t\t\t\t\t$datos=$this->mod_cli->loaddatosupdateCliente($id);\n\t\t\t\t\t\t\t// print_r($datos);\n require_once \"views/Clientes/cliente/Frm_Clientes_Crud.php\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>alert(\"Error cargando datos del id['.$id.']\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t\t}\n\t\t\t}else if($funcion==2){\n\t\t\t\tif ($this->mod_cli->Insert_Update_Cliente(3,$id,'','','','','','','','','','','')) {\n\t\t\t\t\t\t\techo '<script>alert(\"eleminado el id['.$id.'] con exito\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>alert(\"Error al eliminar el id['.$id.']\");</script>';\n\t\t\t\t\t\t\t$this->loadCliente();\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}else{\n\t\t\techo '<script>alert(\"No se enviaron datos\");</script>';\n\t\t\t$this->loadCliente();\n }\n }", "public function getId() ;", "public function deletaCliente($id) {\n }", "public function setId($id){ $this->id=$id;}", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "public function getIddefActividad0()\n {\n return $this->hasOne(RelProductoActividad::className(), ['iddef_actividad' => 'iddef_actividad']);\n }", "function Activar($id) {\n $fecha=date(\"Y-m-d H:i:s\");\n $query=\"UPDATE \".self::$table.\" SET activa='si', fechamodificacion='$fecha' WHERE id=$id\";\n return DBManager::execute($query);\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 id_tarjeta();", "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 }" ]
[ "0.5879079", "0.5643255", "0.5616351", "0.55740327", "0.549171", "0.54719406", "0.53944963", "0.5345596", "0.5345596", "0.5345596", "0.5325813", "0.530464", "0.530114", "0.5275039", "0.5268493", "0.52453", "0.5237646", "0.5231721", "0.52023035", "0.51460886", "0.5140303", "0.5107931", "0.51070875", "0.5104775", "0.51037574", "0.5092883", "0.5079831", "0.50787723", "0.5073839", "0.50729775", "0.50696546", "0.5051118", "0.5046132", "0.5045704", "0.5045704", "0.5045704", "0.5043996", "0.50424296", "0.50394964", "0.5038142", "0.50273705", "0.5016583", "0.50121146", "0.4991759", "0.49672875", "0.4962501", "0.49604443", "0.49588665", "0.49544933", "0.49544248", "0.49544248", "0.49420393", "0.49408227", "0.49385095", "0.49365833", "0.4930523", "0.49280193", "0.4927444", "0.4924579", "0.490473", "0.49033397", "0.48986346", "0.48897132", "0.4888683", "0.48841906", "0.48699856", "0.4865074", "0.48638967", "0.48556632", "0.48500624", "0.48500624", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48494923", "0.48475617", "0.48443398", "0.48346442", "0.48277578", "0.4826371", "0.48262033", "0.48239028", "0.48186642", "0.4816597", "0.4815766", "0.48083803", "0.48057044", "0.47894442", "0.47877932", "0.4782679", "0.47800285", "0.47793922", "0.47743303", "0.4767963", "0.4764934", "0.4764928" ]
0.0
-1
VERIFICA POR NOMBRE QUE UNA DEPENDENCIA NO EXISTA
function noExistDependence($dependence_name) { $query = $this->db->get_where('dependence', array('name'=>$dependence_name)); return $query->num_rows() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function has_dependents(){\n\t\treturn false;\n\t}", "public function has_dependencies(): bool;", "function cumple_dependencias()\n\t{\n\t\treturn count($this->get_dependencias_faltantes()) > 0;\n\t}", "public function dependencyExist(): bool\n {\n if ($this->dependencyExist !== null) {\n return $this->dependencyExist;\n }\n\n $this->dependencyExist = (bool)$this->getPqrForm()->getRow('sys_dependencia');\n\n return $this->dependencyExist;\n }", "public function isDependant();", "public function check_if_has_dependency() {\n $res = true;\n\n foreach ( $this->depends_on as $class ) {\n if ( ! class_exists( $class['name'] ) ) {\n $this->dependency_error[] = $class['notice'];\n $res = false;\n $this->dependency_not_found = true;\n }\n }\n\n return $res;\n }", "public function checkImportPrerequisites() {}", "function get_dependencies();", "private function checkDependencies() {\n return true;\n }", "public function has_active_dependencies(): bool;", "public function has_inactive_dependencies(): bool;", "private function missingDependencies() {\n }", "public function check_for_dependents()\n\t{\n\t\t$query = \"SELECT * FROM \" . cms_db_prefix() . \"module_deps WHERE parent_module = ?\";\n\t\t$row = cms_db()->GetRow($query, array($this->get_name()));\n\n\t\tif ($row)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public static function dependencies($package = NULL) {\n\n // install dependancies and check if installed before\n // \n \n if(!is_null($package)) {\n echo \"hello dependency\";\n }\n }", "public function has_no_active_dependencies(): bool;", "public function has_no_inactive_dependencies(): bool;", "public function hasDependencyErrors() {}", "public function getDependencies() {}", "public static function dependsOn(): iterable;", "abstract public function buildDependency();", "public function needsToBeInstalledWithAllDependencies(): bool\n {\n return false;\n }", "public static function checkDependencies() {\n\t\treturn true;\n\t}", "public function updateDependencies()\n {\n $db = Codeli::getInstance()->getDB();\n $db->query(\"DELETE FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n if (count($this->dependencies) < 1)\n {\n return;\n }\n\n $values = array();\n foreach ($this->dependencies as $dep => $data)\n {\n $values[] = \" ('$this->guid', '$dep') \";\n }\n\n $sql = \"INSERT INTO \" . SystemTables::MODULE_DEPENDENCY . \" (guid, dependencyGuid) VALUES \" . implode(\",\", $values);\n return $db->query($sql);\n }", "private function is_automatic_install( &$dependency ) {\n\t\t$is_required = $this->is_required( $dependency );\n\t\treturn ! $is_required || ( $is_required && ! self::$automatic_install_required );\n\t}", "public static function installToolEnableFileExists() {}", "function dependencias() { // se construye la sentencia de busqueda de la tupla\n //Variable que almacena las dependencias\n $dependencias = null;//inicializamos la variable a null\n //Variable que almacena la consulta sql\n\t\t$sql = \"SELECT NombreTrabajo, QA.LoginEvaluador, LoginEvaluado, AliasEvaluado FROM ASIGNAC_QA QA, ENTREGA E, TRABAJO T WHERE QA.LoginEvaluador = '$this->login' AND QA.LoginEvaluador = E.login AND QA.IdTrabajo = T.IdTrabajo\";//se construye la sentencia sql\n //Variable que almacena el resultado de la query\n $resultado = $this->mysqli->query( $sql );//se ejecuta la query\n //Si el numero de columnas que devuelve es mayor o igual a 1 pasamos las dependencias de todas las tablas que depende\n if ( $resultado->num_rows >= 1 ) {\n $dependencias = $resultado;//le pasamos a la variable dependencias todas las tablas de las que depende\n }\n \n return $dependencias;\n\t}", "private function determineMissingDependencies(): array\n {\n $depBuilder = $this->testDetails->getDependencyBuilder();\n file_put_contents($this->path.'/dep_builder', serialize($depBuilder));\n file_put_contents($this->path.'/dep_runner.php', '<?php\n\nrequire __DIR__.\"/vendor/autoload.php\";\n$depBuilder = unserialize(file_get_contents(\"dep_builder\"));\n$missingDependencies = array_merge(\n $depBuilder->getMissingDependencies(),\n $depBuilder->getMissingDevDependencies()\n);\necho json_encode($missingDependencies);\n ');\n\n $process = MakerTestProcess::create('php dep_runner.php', $this->path)->run();\n $data = json_decode($process->getOutput(), true, 512, \\JSON_THROW_ON_ERROR);\n\n unlink($this->path.'/dep_builder');\n unlink($this->path.'/dep_runner.php');\n\n return array_merge($data, $this->testDetails->getExtraDependencies());\n }", "public static function require_elis_dependencies() {\n global $CFG;\n if (file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n require_once($CFG->dirroot.'/elis/program/lib/setup.php');\n require_once(elispm::lib('data/curriculum.class.php'));\n require_once(elispm::lib('data/track.class.php'));\n require_once(dirname(__FILE__).'/../../importplugins/version1elis/version1elis.class.php');\n return true;\n } else {\n return false;\n }\n }", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "public function getDependencies(){ return array(); }", "public function getDependencies(): array;", "function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}", "public function hasSubdependencies(): bool;", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "function getDependency();", "private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "public function hasDependent()\n {\n return (1 == $this->_hasDependent);\n }", "function getDepends() {\n return $this->depends;\n }", "function rtasset_admin_notice_dependency_not_installed() {\n\tif ( ! rtasset_is_plugin_installed( 'rtbiz' ) ) {\n\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t?>\n\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t<p>\n\t\t\t\t<b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( esc_attr( $path ) . ' plugin is not found on this site. Please install & activate it in order to use this plugin.', RT_ASSET_TEXT_DOMAIN ); ?>\n\t\t\t</p>\n\t\t</div>\n\t<?php\n\t} else {\n\t\tif ( rtasset_is_plugin_installed( 'rtbiz' ) && ! rtasset_is_plugin_active( 'rtbiz' ) ) {\n\t\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t\t$nonce = wp_create_nonce( 'rtasset_activate_plugin_' . $path );\n\t\t\t?>\n\t\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t\t<p><b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( 'Click' ) ?>\n\t\t\t\t\t<a href=\"#\" onclick=\"activate_rtasset_plugin('<?php echo esc_attr( $path ); ?>','rtasset_activate_plugin','<?php echo esc_attr( $nonce ); ?>')\">here</a> <?php _e( 'to activate rtBiz.', 'rtbiz' ) ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n}", "public function hasInstall();", "function remove_dependents() {\n\t\t/** todo\n\t\tforeach($this->has_many_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\n\t\t}\n\n\t\tforeach($this->has_one_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function getDependencies();", "function problematicDependencies() {\n foreach ($this->dependency_log as $id => $tbls) {\n if (count($tbls) > 1) return count($tbls);\n }\n return 0;\n }", "private function load_dependencies() {\n //require_once( $this->inc . 'class-best-faq-admin.php' );\n require_once( $this->inc . 'best-faq-shortcode.php' );\n }", "public function get_dependencies()\n\t{\n\t\treturn array();\n\t}", "public function check_dependencies() {\n\n $dependencies = [];\n\n /**\n * Sample plugin dependency\n *\n * Depends on ACF plugin active\n */\n// if ( ! class_exists( 'acf' ) ) {\n// $dependencies[] = [\n// 'type' => 'error',\n// 'message' => $this->name . ' ' . __( 'requires ACF PRO plugin activated', 'goapostas' )\n// ];\n// }\n\n /**\n * Depends on ACF plugin active\n */\n if ( false === version_compare( PHP_VERSION, '7.0.0', '>=' ) ) {\n $dependencies[] = [\n 'type' => 'error',\n 'message' => $this->name . ' ' . __( 'requires PHP 7.0.0 or higher. Your PHP version is ' . PHP_VERSION, 'goapostas' )\n ];\n }\n\n if ( ! empty( $dependencies ) ) {\n $this->show_admin_notices( $dependencies );\n\n return false;\n }\n\n return true;\n }", "public function hasDependencies(): bool\n {\n return (bool) $this->getDependencies();\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'MShopAddTypeDataDefault' );\n\t}", "public function get_script_depends() {\n\t\treturn [ 'elementor-hello-world' ];\n\t}", "public function isDependancy_simple() {\n\t\t$this->getDependancy_simple();\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'OrderRenameTables', 'OrderServiceAttributeAddPrimaryKey' );\n\t}", "public function verify_dependencies()\n {\n $verifier = new DependencyVerifier(Package::get(static::context()));\n $success = $verifier->is_removable();\n \n $this->add_message(self::TYPE_NORMAL, $verifier->get_logger()->render());\n \n if (! $success)\n {\n return $this->failed(Translation::get('PackageDependenciesFailed'));\n }\n else\n {\n $this->add_message(self::TYPE_NORMAL, Translation::get('PackageDependenciesVerified'));\n return true;\n }\n }", "public function checkDependencies() {\n if ((float) t3lib_extMgm::getExtensionVersion('extension_builder') < 2) {\n throw new Tx_Clitools_Exception_Dependency('This generator depends on extension_builder 2 higher');\n }\n }", "public function hasDependency(string $name): bool;", "public function getAllExistingRequirements() {\n\t\t$existingRequirements = array();\n\t\t$existingPackages = array();\n\t\tif ($this->package !== null) {\n\t\t\t$sql = \"SELECT\t\tpackage.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName\n\t\t\t\tFROM\t\twcf\".WCF_N.\"_package_requirement requirement\n\t\t\t\tLEFT JOIN\twcf\".WCF_N.\"_package package\n\t\t\t\tON\t\t(package.packageID = requirement.requirement)\n\t\t\t\tWHERE\t\trequirement.packageID = \".$this->package->getPackageID();\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$existingRequirements[$row['package']] = $row;\n\t\t\t}\n\t\t}\n\n\t\t// build sql\n\t\t$packageNames = '';\n\t\t$requirements = $this->getRequirements();\n\t\tforeach ($requirements as $requirement) {\n\t\t\tif (isset($existingRequirements[$requirement['name']])) {\n\t\t\t\t$existingPackages[$requirement['name']] = array();\n\t\t\t\t$existingPackages[$requirement['name']][$existingRequirements[$requirement['name']]['packageID']] = $existingRequirements[$requirement['name']];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!empty($packageNames)) $packageNames .= ',';\n\t\t\t\t$packageNames .= \"'\".escapeString($requirement['name']).\"'\";\n\t\t\t}\n\t\t}\n\t\n\t\t// check whether the required packages do already exist\n\t\tif (!empty($packageNames)) {\n\t\t\t$sql = \"SELECT \tpackage.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName\n\t\t\t\tFROM\twcf\".WCF_N.\"_package package\n\t\t\t\tWHERE\tpackage.package IN (\".$packageNames.\")\";\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t// check required package version\n\t\t\t\tif (isset($requirements[$row['package']]['minversion']) && Package::compareVersion($row['packageVersion'], $requirements[$row['package']]['minversion']) == -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!isset($existingPackages[$row['package']])) {\n\t\t\t\t\t$existingPackages[$row['package']] = array();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$existingPackages[$row['package']][$row['packageID']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $existingPackages;\n\t}", "public function existenceCheck() {\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\t$jobs = array();\n\t\t$this->out(sprintf(__('* %d records to process'), count($packages)));\n\t\tforeach ($packages as $package) {\n\t\t\t$jobs[] = new PackageExistsJob($package);\n\t\t}\n\n\t\tif (!empty($jobs)) {\n\t\t\t$this->CakeDjjob->bulkEnqueue($jobs, 'default');\n\t\t}\n\n\t\t$this->out(sprintf(__('* Enqueued %d jobs'), count($jobs)));\n\t}", "function wds_acf_blocks_dependency_check() {\n\t$asset_file = plugin_dir_path( dirname( __FILE__ ) ) . 'build/index.asset.php';\n\n\tif ( file_exists( $asset_file ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"notice notice-error\">\n\t\t<p>\n\t\t\t<?php\n\t\t\tesc_html_e(\n\t\t\t\t'Whoops! You need to run `npm install` in the terminal for the WDS ACF Blocks plugin to work first.',\n\t\t\t\t'wds-acf-blocks'\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t</div>\n\t<?php\n}", "protected function _isDependence($name) {\r\n \treturn array_key_exists($name, $this->_dependenciesMap);\r\n }", "public function _getExistNeeded()\n\t{\n\t\t$need = 0;\n\t\t\n\t\tif( $this->_getExist()){\n\t\t\t\n\t\t\t$step = $this->Session->read('Wizard.step');\n\t\t\t\n\t\t\tif( $step > 1 ){\n\n\t\t\t\t$need = $this->loadNeeded();\n\n\t\t\t\tif( empty( $need ) ){\n\t\t\t\t\t$this->_processPrevious();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$path = $this->Session->read('Wizard.configuration.need');\n\n\t\t\t\t$keys = explode( '.', $path );\n\t\t\t\t\n\t\t\t\tif(isset($keys[0]) && isset($keys[1])){\n\t\t\t\t\t$model \t= $keys[0];\n\t\t\t\t\t$key \t= $keys[1];\n\t\t\t\t\t\n\t\t\t\t\t$model = TableRegistry::get($model);\n\n\t\t\t\t\t$query = $model->find('all')\n\t\t\t\t\t\t\t\t ->select([$key])\n\t\t\t\t\t\t\t\t ->where([$key=>$need])\n\t\t\t\t\t\t\t\t ->first();\n\n\t\t\t\t\tif( empty( $query ) ){\n\t\t\t\t\t\t$this->_processPrevious();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $need;\n\t}", "function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM services WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service (\". $this->id .\") does not exist - possibly the service has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\t\treturn 1;\n\t}", "public function getAllowMissingDependencies() : bool\n {\n return $this->allowMissingDependencies;\n }", "public function loadRequirements()\n {\n }", "public function autoloadFilesAreBuildCorrectlyDataProvider() {}", "function dependencias2() { // se construye la sentencia de busqueda de la tupla\n //Variable que almacena las dependencias\n $dependencias2 = null;//inicializamos la variable a null\n //Variable que almacena la sentencia sql\n\t\t$sql = \"SELECT NombreTrabajo, QA.LoginEvaluador, LoginEvaluado, AliasEvaluado FROM ASIGNAC_QA QA, ENTREGA E, TRABAJO T WHERE QA.LoginEvaluado = '$this->login' AND QA.LoginEvaluado = E.login AND QA.IdTrabajo = T.IdTrabajo\";//se construye la sentencia sql\n $resultado = $this->mysqli->query( $sql );//se ejecuta la query\n //miramos si el número de tuplas es mayor o igual que uno\n if ( $resultado->num_rows >= 1 ) {\n $dependencias2 = $resultado;//le pasamos a la variable dependencias2 todas las tablas de las que depende\n }\n \n return $dependencias2;\n\t}", "public function getDependencies(): array\r\n {\r\n return [\r\n ];\r\n }", "public function creer_arbre_dependance_from_FullConf() {\n\t\t$dependance = array ();\n\t\tforeach ( $this->getArbreMoniteurs () as $liste_moniteurs_machine ) {\n\t\t\tforeach ( $liste_moniteurs_machine as $moniteur ) {\n\t\t\t\tif (isset ( $moniteur [\"entitySnapshot_properties\"] [\"_ownerID\"] )) {\n\t\t\t\t\t$dependance [$moniteur [\"entitySnapshot_properties\"] [\"_ownerID\"] . \" \" . $moniteur [\"entitySnapshot_properties\"] [\"_id\"]] = $moniteur [\"entitySnapshot_properties\"] [\"_name\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->setDependance ( $dependance );\n\t\t\n\t\treturn $this->onDebug ( $this->getDependance (), 2 );\n\t}", "public function getDependencies()\n {\n $result = array();\n $this->_completeDependencies(\n $this->findNode('/p:package/p:dependencies/p:required'),\n $result,\n 'no'\n );\n $this->_completeDependencies(\n $this->findNode('/p:package/p:dependencies/p:optional'),\n $result,\n 'yes'\n );\n return $result;\n }", "public function getPostDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop', 'OrderAlterForeignKeyContraintsOnDelete' );\n\t}", "public function getDependencies()\n {\n return [LoadProductData::class, LoadCategoryData::class];\n }", "protected function dependenciesComplete() {\n foreach ($this->dependencies as $dependency) {\n $migration = MigrationBase::getInstance($dependency);\n if (!$migration->isComplete()) {\n return FALSE;\n }\n }\n return TRUE;\n }", "public function getDependencies()\n {\n return null;\n }", "public function active_dependencies(): Collection;", "public function getExistingRequirements() {\n\t\t// build sql\n\t\t$packageNames = '';\n\t\tforeach ($this->requirements as $requirement) {\n\t\t\tif (!empty($packageNames)) $packageNames .= ',';\n\t\t\t$packageNames .= \"'\".escapeString($requirement['name']).\"'\";\n\t\t}\n\t\n\t\t// check whether the required packages do already exist\n\t\t$existingPackages = array();\n\t\tif (!empty($packageNames)) {\n\t\t\t$sql = \"SELECT \t*\n\t\t\t\tFROM\twcf\".WCF_N.\"_package\n\t\t\t\tWHERE\tpackage IN (\".$packageNames.\")\";\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\tif (!isset($existingPackages[$row['package']])) {\n\t\t\t\t\t$existingPackages[$row['package']] = array();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$existingPackages[$row['package']][$row['packageVersion']] = $row;\n\t\t\t}\n\t\t\t\n\t\t\t// sort multiple packages by version number\n\t\t\tforeach ($existingPackages as $packageName => $instances) {\n\t\t\t\tuksort($instances, array('Package', 'compareVersion'));\n\t\t\t\t\n\t\t\t\t// get package with highest version number (get last package)\n\t\t\t\t$existingPackages[$packageName] = array_pop($instances);\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $existingPackages;\n\t}", "public function contains_dependency(string $basename): bool;", "public function getDependencies()\n {\n return [];\n }", "protected function validateElasticaDependency()\n {\n if (!class_exists('\\Elastica\\Index')) {\n\n throw new RegistryException(\n RegistryException::MISSING_DEPENDENCY_TEXT,\n RegistryException::MISSING_DEPENDENCY_CODE\n );\n }\n }", "public function getDependency() {}", "public function getDependency() {}", "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 }", "private function is_automatic_activate( &$dependency ) {\n\t\t $is_required = $this->is_required( $dependency );\n\t\t return ! $is_required || ( $is_required && ! self::$automatic_activate_required );\n\t}", "public function getDependency() {\r\n\t\r\n\t}", "public function find_required_packages() {\n\tif ($this->required === null) {\n\t\tif (debby\\VERBOSE) {\n\t\t\tdebby\\debby::log('Checking '.$this->get_name().' for required packages');\n\t\t}\n\t\t\n\t\tif (file_exists($this->path.'composer.json') === false) {\n\t\t\t$e = new exception('can not find composer.json in the path');\n\t\t\t$e->stop();\n\t\t}\n\t\t\n\t\t$composer_json = file_get_contents($this->path.'composer.json');\n\t\t$composer_json = json_decode($composer_json, true);\n\t\tif (empty($composer_json['require'])) {\n\t\t\t$e = new exception('there are no required packages to check');\n\t\t\t$e->stop();\n\t\t}\n\t\t\n\t\t$this->required = [];\n\t\tforeach ($composer_json['require'] as $package_name => $required_version) {\n\t\t\t// skip platform packages like 'ext-curl'\n\t\t\tif (strpos($package_name, '/') === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$package = $this->get_package_by_name($package_name);\n\t\t\t$package->mark_required($required_version);\n\t\t\t\n\t\t\t$this->required[$package->get_name()] = $package;\n\t\t}\n\t}\n\t\n\treturn array_values($this->required);\n}", "public function getDependencies()\n {\n return array( ProjetFixtures::class,\n DevisFixture::class,\n );\n }", "function get_dependencias()\n\t{\n\t\t$path_ini = $this->get_dir().'/proyecto.ini';\n\t\t$contenido = file_get_contents($path_ini);\n\t\t$matches = array();\n\t\tpreg_match_all('#^dependencias\\s*=\\s*(.*)$#im', $contenido, $matches);\n\t\tif (empty($matches[1])) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn explode(',', $matches[1][0]);\n\t\t}\n\t}", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "function opcion__compilar()\n\t{\n\t\t$this->get_proyecto()->compilar();\n\t}", "public function verif_fase(){ \n if($this->input->is_ajax_request()){\n $post = $this->input->post();\n $id_f = $post['id_f'];\n\n $nro=$this->model_componente->componentes_nro($id_f);\n\n if($nro == 0){\n echo \"true\"; ///// La fase no tiene dependencias\n }\n else{\n echo \"false\";; //// La fase tiene dependencias\n } \n }else{\n show_404();\n }\n }", "public function get_script_depends() {\n\t\treturn array( 'uikit', 'swiper' );\n\t}", "public static function check_dependencies() {\n\t\tif ( ! self::check_php() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_php_notice' ) );\n\t\t\tadd_action( 'admin_init', array( __CLASS__, 'deactivate_self' ) );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! self::check_wp() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_wp_notice' ) );\n\t\t\tadd_filter( 'plugin_action_links_' . JOB_MANAGER_PLUGIN_BASENAME, array( 'WP_Job_Manager_Dependency_Checker', 'wp_version_plugin_action_notice' ) );\n\t\t}\n\n\t\treturn true;\n\t}", "public static function getDependencies()\n {\n return [];\n }", "public static function getDependencies()\n {\n return [];\n }", "public static function are_behat_dependencies_installed() {\n if (!is_dir(__DIR__ . '/../../../vendor/behat')) {\n return false;\n }\n return true;\n }", "public function gp_build_check_depend_qry($arr_depended_table, $v_column_name)\n {\n \n \n $sql_check_depend = '';\n \n if(DATABASE_TYPE == 'MSSQL')\n {\n $sql_check_depend = '(Select Sum(build_check_depend_qry.C_COUNT) COUNT_DEPEND From (';\n $i = 0;\n foreach ($arr_depended_table as $table => $foreign_key)\n {\n $sql_check_depend .= ($i == 0) ? '' : ' UNION ALL';\n $sql_check_depend .= \" Select Count(*) C_COUNT From $table Where $foreign_key=$v_column_name\";\n $i++;\n }\n $sql_check_depend .= ') build_check_depend_qry)as COUNT_DEPEND';\n }\n else if(DATABASE_TYPE == 'MYSQL')\n {\n \n foreach ($arr_depended_table as $table => $foreign_key)\n {\n if($sql_check_depend == '')\n {\n $sql_check_depend .= \"( (Select Count(*) C_COUNT From $table Where $foreign_key=$v_column_name)\";\n }\n else\n {\n $sql_check_depend .= \" + (Select Count(*) C_COUNT From $table Where $foreign_key=$v_column_name)\";\n }\n } \n $sql_check_depend .= \") as COUNT_DEPEND \";\n }\n \n return $sql_check_depend;\n }", "function maneja_perfiles_produccion()\n\t{\n\t\treturn $this->get_instalacion()->es_produccion() && $this->instancia->get_proyecto_usar_perfiles_propios($this->identificador);\n\t}", "function insta_f_install(){\n}", "public function isDependant() {\n return $this->isDependant;\n }", "public function requirements($phase) {\n $requirements = [];\n\n // Test WinCache.\n $wincache_enabled = \\Drupal\\wincachedrupal\\WincacheWrapper::wincachedrupal_enabled();\n\n $wincache_version = phpversion('wincache');\n\n $link = Link::fromTextAndUrl('Official WinCache Extension Documentation',\n Url::fromUri('http://php.net/manual/en/book.wincache.php'))->toString();\n\n $wincache_description = $this->t(\n 'The wincachedrupal module needs the wincache extension<br/>see: @link.',\n ['@link' => $link]\n );\n\n $requirements['wincache'] = [\n 'title' => $this->t('WinCache version'),\n 'value' => $wincache_enabled ? $wincache_version : $this->t('Not available'),\n 'severity' => $wincache_enabled ? REQUIREMENT_OK : REQUIREMENT_ERROR,\n 'description' => $wincache_description,\n ];\n\n $comenabled = extension_loaded('com_dotnet');\n if (!$comenabled) {\n $requirements['wincache_comenabled'] = [\n 'title' => $this->t('WinCache com_dotnet enabled'),\n 'value' => $this->t('No'),\n 'severity' => REQUIREMENT_WARNING,\n 'description' => $this->t('.Net performance optimizations not available. The COM DOTNET extension is not loaded. Add extension=com_dotnet.dll to your php.ini file.'),\n ];\n }\n\n // The first step is to enable COM, then make the NetPhp binary available.\n if ($comenabled) {\n\n $netphp = \\Drupal::service('netphp');\n\n $netphp_support = $netphp->hasNetPhpSupport();\n $netphp_version = FALSE;\n if ($netphp_support === TRUE) {\n $netphp_version = $netphp->getRuntime()->GetStringVersion() . ' | ' . $netphp->getRuntime()->GetRuntimeVersion()->GetJson();\n }\n $requirements['wincache_netphp'] = [\n 'title' => $this->t('WinCache NetPhp version'),\n 'value' => $netphp_support === TRUE ? $this->t('The NetPhp service is up and running.') : $this->t('.Net based performance optimizations are not available. Either the NetPhp to start or you have not deployed it yet. See the Readme.md file for setup instructions.'),\n 'severity' => $netphp_support === TRUE ? REQUIREMENT_OK : REQUIREMENT_WARNING,\n 'description' => $netphp_support === TRUE ? $netphp_version : $netphp_support,\n ];\n\n // Asset optimizations need the AjaxMin library.\n $ajaxmin_support = $netphp->hasAjaxMinSupport();\n $requirements['wincache_ajaxmin'] = [\n 'title' => $this->t('Wincache AjaxMin asset optimization'),\n 'value' => $ajaxmin_support === TRUE ? $this->t('Asset optimization enabled using the AjaxMin library.') : $this->t('AjaxMin assset optimizations not available.'),\n 'severity' => $ajaxmin_support === TRUE ? REQUIREMENT_OK : REQUIREMENT_WARNING,\n 'description' => $ajaxmin_support === TRUE ? NULL : $ajaxmin_support,\n ];\n }\n\n if ($wincache_enabled) {\n\n $formatter = \\Drupal::service('date.formatter');\n\n $ucache_meminfo = \\Drupal\\wincachedrupal\\WincacheWrapper::wincachedrupal_ucache_meminfo();\n $cache = \\Drupal\\wincachedrupal\\WincacheWrapper::wincachedrupal_ucache_info();\n\n $requirements['wincache_ucache'] = [\n 'title' => $this->t('WinCache user cache'),\n 'value' => $this->t('Enabled. Memory total: @total. Used @used%.', [\n '@total' => format_size($ucache_meminfo['memory_total']),\n '@used' => round(100 - (($ucache_meminfo['memory_free'] / $ucache_meminfo['memory_total']) * 100), 2),\n ]),\n 'severity' => REQUIREMENT_OK,\n ];\n\n $requirements['wincache_ucache']['description'] = $this->t('WinCache has been running for @duration. Currently caching @num_entries entries. Hit rate @hitrate%.',\n [\n '@duration' => $formatter->formatInterval($cache['total_cache_uptime']),\n '@num_entries' => $cache['total_item_count'],\n '@hitrate' => round(($cache['total_hit_count'] / ($cache['total_hit_count'] + $cache['total_miss_count'])) * 100, 2) ,\n ]\n );\n }\n\n if ($phase == 'runtime' && $wincache_enabled) {\n\n $options = ini_get_all('wincache', TRUE);\n /*\n * 1.3.7.2 What's new:\n * If you disable the WinCache opcache in the php.ini\n * (wincache.ocenabled=0), you should no longer see a shared memory\n * mapping for the opcache. Also, you won't be able to turn it on in\n * either a .user.ini or in a php script.\n */\n if (version_compare($wincache_version, '1.3.7.2', '<')) {\n if ($options['wincache.ocenabled']['local_value'] == 0) {\n $ocachesize = $options['wincache.ocachesize']['local_value'];\n $requirements['wincache_oc_size'] = [\n 'title' => $this->t('Wincache opcode cache size'),\n 'value' => $this->t('Opcode caching is disabled and current cache size is @sizeMb', ['@size' => $ocachesize]),\n 'severity' => ($ocachesize > 15) ? REQUIREMENT_ERROR : REQUIREMENT_OK,\n 'description' => $this->t('When opcode caching is disabled, reduce memory pressure on the server by setting wincache.ocachesize to the minimum value allowed (15Mb).'),\n ];\n }\n }\n /*\n * Zend OPCACHE is UNSTABLE on Windows and.... no one cares.\n * Is this a windows server?\n * Probably yes, because this is the WincacheDriver!\n */\n $is_windows = strncasecmp(PHP_OS, 'WIN', 3) == 0;\n if ($is_windows) {\n if (version_compare(PHP_VERSION, '7.0.0') < 0) {\n /*\n * Make sure that in versions prior to PHP 7 wincache\n * is in charge of Opcode Caching.\n */\n if (function_exists('wincache_ocache_meminfo')) {\n $opcode_ok = $options['wincache.ocenabled']['local_value'] == 1;\n $requirements['wincache_oc'] = [\n 'title' => $this->t('Wincache Opcode cache'),\n 'value' => $opcode_ok ? $this->t('Opcode cache is being handled by Wincache.') : $this->t('The Wincache Opcode cache should be enabled. Do not rely on ZEND_OPCACHE, it is unstable on windows platforms for PHP < 7.'),\n 'severity' => $opcode_ok ? REQUIREMENT_OK : REQUIREMENT_ERROR,\n ];\n }\n }\n /*\n * Why is there a wincache.apppoolid setting?\n * A: For debugging purposes only. It should never be explicitly set\n * in production environments.\n * Q: Has WinCache been tested with custom application pool identities?\n * e.g. NetworkService, LocalSystem, LocalService, or \"Custom account\"\n * in the App Pool | Advanced Settings | Application Pool Identity\n * dialog of inetmgr.exe\n * A: No, it has not. It's very possible that it won't work for\n * anything other than ApplicationPoolIdentity.\n * Q: What happens when wincache.apppoolid is not set?\n * A: When IIS launches php-cgi.exe, it adds an environment variable\n * (APP_POOL_ID), and that's what wincache will use if the apppoolid\n * setting is not set. The variable will contain the account name under\n * the IIS APPPOOL domain to use for the app pool.\n */\n $apppool_ok = empty($options['wincache.apppoolid']['local_value']);\n if (!$apppool_ok) {\n $requirements['wincache_apppoolid'] = [\n 'title' => $this->t('Wincache wincache.apppoolid ini setting'),\n 'value' => $this->t('wincache.apppoolid should never be used in production environments!'),\n 'severity' => REQUIREMENT_WARNING,\n ];\n }\n }\n }\n\n return $requirements;\n }", "protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)\r\n\t{\r\n\t\treturn false;\r\n\t}", "protected function _alreadyInstalled()\r\n\t{\r\n\t\t$select\t\t= $this->_db->select()->from('Cron_Jobs', array('id'))->where('name = ?', $this->_name);\r\n\t\t$results\t= $this->_db->fetchAll($select);\r\n\t\t\r\n\t\tif(count($results)) {\r\n\t\t\tthrow new Exception('Cron job ' . $this->_name . 'is already installed');\r\n\t\t}\r\n\t}" ]
[ "0.66179436", "0.647935", "0.6430712", "0.63491136", "0.6294501", "0.61362946", "0.6070822", "0.6025547", "0.60139084", "0.6010748", "0.5917012", "0.5887242", "0.58806574", "0.5841174", "0.5825609", "0.58082557", "0.5762216", "0.5746142", "0.57455945", "0.5720548", "0.5712699", "0.5697195", "0.5686216", "0.56626534", "0.5659375", "0.5635018", "0.5633253", "0.5633219", "0.56254303", "0.5623068", "0.5621559", "0.55718255", "0.5566026", "0.55532646", "0.55532646", "0.55098385", "0.5498622", "0.5485931", "0.54856074", "0.5483753", "0.54735464", "0.5457509", "0.5457043", "0.54514134", "0.5451216", "0.543777", "0.5422675", "0.54172915", "0.53666604", "0.53628546", "0.53516734", "0.5338005", "0.53345835", "0.5332959", "0.53182805", "0.5299692", "0.5270968", "0.5264171", "0.5261075", "0.52597183", "0.52517027", "0.52503616", "0.52487326", "0.5228986", "0.5226704", "0.5226615", "0.5217688", "0.5212502", "0.5205959", "0.52033186", "0.518318", "0.51812434", "0.5179387", "0.51764053", "0.51595455", "0.51587385", "0.51553404", "0.5153861", "0.5153861", "0.5148597", "0.51304674", "0.51290774", "0.51270735", "0.5124216", "0.5122513", "0.5116407", "0.51136863", "0.5103235", "0.5093091", "0.50807333", "0.5077655", "0.5077655", "0.5070519", "0.50657505", "0.5064793", "0.50619686", "0.50611454", "0.50575167", "0.50466746", "0.50359684" ]
0.5683528
23
DEVUELVE TODAS LAS DEPENDENCIAS
function getAllDependences() { $query = $this->db->get('dependence'); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_dependencies() {\n //require_once( $this->inc . 'class-best-faq-admin.php' );\n require_once( $this->inc . 'best-faq-shortcode.php' );\n }", "function get_dependencies();", "private function load_dependencies() {\n\n\t\t//For CHAOS lib\n\t\tset_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ .\"/lib/chaos-client/src/\");\n\t\trequire(\"CaseSensitiveAutoload.php\");\n\t\tspl_autoload_extensions(\".php\");\n\t\tspl_autoload_register(\"CaseSensitiveAutoload\");\n\n\t\trequire(\"wpportalclient.php\");\n\t\trequire(\"wpchaosobject.php\");\n\t\trequire(\"widgets/chaoswidget.php\");\n\t\trequire(\"widgets/attribute.php\");\n\t\trequire(\"widgets/multiattribute.php\");\n\t}", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "private function missingDependencies() {\n }", "public function getDependencies(){ return array(); }", "private function load_dependencies() {\n\t\t/**\n\t\t * Admin related fucntions.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-admin.php';\n\n\t\t/**\n\t\t * Frontend related fucntions.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-public.php';\n\t}", "public function dependencies() {\n\t\tif ($customPath = $this->params['custom']) {\n\t\t\t$this->_paths = [$customPath];\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = [CakePlugin::path($this->params['plugin'])];\n\t\t} else {\n\t\t\t$this->_paths = [APP];\n\t\t}\n\n\t\t$this->_findFiles('php');\n\t\tforeach ($this->_files as $file) {\n\t\t\t$this->out(sprintf('Updating %s...', $file), 1, Shell::VERBOSE);\n\n\t\t\t$this->_correctFile($file);\n\n\t\t\t$this->out(sprintf('Done updating %s', $file), 1, Shell::VERBOSE);\n\t\t}\n\t}", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "public function autoloadDevFilesAreBuildCorrectlyDataProvider() {}", "private function load_dependencies() {\n /**\n * \"BEHIND THE SCENCE\" CLASSES\n * Note: usually the admin and public do not directly use them, they are\n * necessary for the plugin (eg. i18n)\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';\n\n /* ADMIN */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-api.php';\n\n /* PUBLIC */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-public.php';\n }", "public function getDependencies() {}", "protected function composerRequireDev() :string\n {\n $require = [\n \"engage-php/luminary:0.*\",\n \"squizlabs/php_codesniffer:3.*\",\n \"fzaninotto/faker:~1.4\",\n \"phpunit/phpunit:~6.0\",\n \"mockery/mockery:~0.9\"\n ];\n\n return \" --require-dev=\" . implode(\" --require-dev=\", $require);\n }", "public function getDependencies(): array;", "protected function RequireLibs()\n {\n\n }", "public function mergeDependencies()\n {\n $this->dependencies = array_merge($this->dependencies, $this->commonDependencies);\n }", "private function determineMissingDependencies(): array\n {\n $depBuilder = $this->testDetails->getDependencyBuilder();\n file_put_contents($this->path.'/dep_builder', serialize($depBuilder));\n file_put_contents($this->path.'/dep_runner.php', '<?php\n\nrequire __DIR__.\"/vendor/autoload.php\";\n$depBuilder = unserialize(file_get_contents(\"dep_builder\"));\n$missingDependencies = array_merge(\n $depBuilder->getMissingDependencies(),\n $depBuilder->getMissingDevDependencies()\n);\necho json_encode($missingDependencies);\n ');\n\n $process = MakerTestProcess::create('php dep_runner.php', $this->path)->run();\n $data = json_decode($process->getOutput(), true, 512, \\JSON_THROW_ON_ERROR);\n\n unlink($this->path.'/dep_builder');\n unlink($this->path.'/dep_runner.php');\n\n return array_merge($data, $this->testDetails->getExtraDependencies());\n }", "private function load_dependencies() {\n\n\t\t$this->loader = new Loader();\n\t\t$TSB_hooks_loader = new Init_Functions();\n\t\t$this->loader->add_action( 'init', $TSB_hooks_loader, 'app_output_buffer' );\n\n//\t\t$this->loader->add_action( 'init', \t$TSB_hooks_loader, 'remove_admin_bar' );\n\n\t}", "function require_dependencies() {\n global $CFG;\n\n //needed to define CURMAN_DIRLOCATION\n require_once($CFG->dirroot . '/curriculum/config.php');\n\n //needed for constants that define db tables\n require_once($CFG->dirroot.'/curriculum/lib/cmclass.class.php');\n\n //make sure we have access to the context library\n require_once($CFG->dirroot.'/curriculum/lib/contexts.php');\n }", "protected function loadDependencies()\n {\n // See: https://github.com/concrete5/concrete5-5.7.0/issues/360\n $filesystem = new Filesystem();\n $filesystem->getRequire(__DIR__ . '/vendor/autoload.php');\n }", "protected function resolvePackageDependencies() {}", "private function load_dependencies()\n\t{\n\t\t$dependencies = [\n\t\t\t'Routing',\n\t\t\t'Loader',\n\t\t\t'Base',\n\t\t];\n\n\t\tforeach($dependencies as $file)\n\t\t{\n\t\t\trequire_once plugin_dir_path(__FILE__) . $file . '.php';\n\t\t}\n\t}", "private function dc_load_dependencies() {\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'includes/dc_class_loader_dorancafe.php';\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'admin/dc_class_admin_dorancafe.php';\n\t\t// public class and functions\n\t\trequire_once DORANCAFE_PATH . 'public/dc_class_public_dorancafe.php';\n\n\t\t$this->loader = new Dorancafe_Loader();\n\t}", "public function getComposerDependencies(): array;", "public function getDevDependencies()\n {\n return isset($this->composerJson['require-dev']) ? array_keys($this->composerJson['require-dev']) : [];\n }", "public function get_dependencies()\n\t{\n\t\treturn array();\n\t}", "protected function sortAvailablePackagesByDependencies() {}", "function dev_missing_dependencies() { ?>\n\t<div class=\"error\">\n <p><?php printf( __( 'Awesome Support dependencies are missing. The plugin can’t be loaded properly. Please run %s before anything else. If you don’t know what this is you should <a href=\"%s\" class=\"thickbox\">install the production version</a> of this plugin instead.', 'awesome-support' ), '<a href=\"https://getcomposer.org/doc/00-intro.md#using-composer\" target=\"_blank\"><code>composer install</code></a>', esc_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'awesome-support', 'TB_iframe' => 'true', 'width' => '772', 'height' => '935' ), admin_url( 'plugin-install.php' ) ) ) ); ?></p>\n </div>\n<?php }", "function ajan_core_get_js_dependencies() {\n\treturn apply_filters( 'ajan_core_get_js_dependencies', array( 'jquery' ) );\n}", "private function dld_load_dependencies()\n {\n require_once plugin_dir_path(__FILE__) . '../woocommerce-delivery-schedular/admin/settings-data.php';\n require_once plugin_dir_path(__FILE__) . 'class-custom-delivery-date-admin-settings.php';\n }", "public function getComposerRequires(): array;", "static public function depends_on()\n {\n return [\n '\\phpbb\\db\\migration\\data\\v31x\\v314',\n '\\oxcom\\phpbbch\\migrations\\add_module',\n ];\n }", "private function checkDependencies() {\n return true;\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'chat',\n 'mysql',\n ),\n 'recommends' => array(\n ),\n 'conflicts_with' => array()\n );\n }", "function csstools_depends()\n{\n return array('filesystem', 'http', 'image');\n}", "protected function assets()\n {\n $output = [];\n if (!file_exists($this->config['build'] . 'node_modules')) {\n putenv('PATH=' . trim(shell_exec('echo $PATH')) . ':' . dirname(MODX_BASE_PATH) . '/');\n if (file_exists($this->config['build'] . 'package.json')) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Trying to install or update nodejs dependencies');\n $output = [\n shell_exec('cd ' . $this->config['build'] . ' && npm config set scripts-prepend-node-path true && npm install'),\n ];\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = array_merge($output, [\n shell_exec('cd ' . $this->config['build'] . ' && npm link gulp'),\n shell_exec('cd ' . $this->config['build'] . ' && gulp copy'),\n ]);\n }\n if ($output) {\n $this->modx->log(xPDO::LOG_LEVEL_INFO, implode(\"\\n\", array_map('trim', $output)));\n }\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = shell_exec('cd ' . $this->config['build'] . ' && gulp default 2>&1');\n $this->modx->log(xPDO::LOG_LEVEL_INFO, 'Compile scripts and styles ' . trim($output));\n }\n }", "public static function dependencies($package = NULL) {\n\n // install dependancies and check if installed before\n // \n \n if(!is_null($package)) {\n echo \"hello dependency\";\n }\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'JavaScript enabled',\n 'points',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function getDependencies();", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "public function getDependencies(): array\r\n {\r\n return [\r\n ];\r\n }", "private function initDependencies()\n {\n // == HTML ==========================================================\n $this->di->mapService('core.html.factory', '\\Core\\Html\\HtmlFactory');\n\n // == AJAX ==========================================================\n $this->di->mapService('core.ajax', '\\Core\\Ajax\\Ajax');\n }", "public function render_dependencies(): string;", "public function get_script_depends() {\n\t\treturn array( 'uikit', 'swiper' );\n\t}", "public function getDependencies()\n {\n return [\n 'Chaplean\\Bundle\\CmsBundle\\DataFixtures\\Liip\\DefaultData\\LoadFileExtensionImageData'\n ];\n }", "protected function requireVitals()\n {\n require_once __DIR__ . '/Libs/Core.php';\n require_once __DIR__ . '/Libs/Autoloader.php';\n\n require_once __DIR__ . '/helpers.php';\n // Require vital Alpaca parts \n //Core::requireVitals();\n // Require others, like files user has configured to be loaded (app/helper.php...)\n //Core::requireExtras();\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'iotds',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "protected function composerAutoloadDev() :void\n {\n $file = app_path('composer.json');\n $contents = Storage::get($file);\n\n $json = json_decode($contents, true);\n $json['autoload-dev'] = [\n 'classmap' => [\n 'tests/'\n ]\n ];\n $json = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n Storage::put($file, $json);\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'wiki',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_script_depends() {\n\t\treturn [ \n\t\t\t'owl-carousel',\n\t\t\t'widgetkit-main',\n\t\t ];\n\t}", "public static function require_elis_dependencies() {\n global $CFG;\n if (file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n require_once($CFG->dirroot.'/elis/program/lib/setup.php');\n require_once(elispm::lib('data/curriculum.class.php'));\n require_once(elispm::lib('data/track.class.php'));\n require_once(dirname(__FILE__).'/../../importplugins/version1elis/version1elis.class.php');\n return true;\n } else {\n return false;\n }\n }", "public static function dependsOn(): iterable;", "private function addRequirePackages()\n {\n $devPackages = [\n \"orangehill/iseed:*\",\n \"barryvdh/laravel-debugbar:*\",\n \"barryvdh/laravel-ide-helper:*\",\n \"laravel/dusk:*\",\n \"mediactive-digital/laravel:*\",\n \"mediactive-digital/migrations-generator:*\"\n ];\n $this->doCommand(\"composer require \" . implode(' ', $devPackages) . \" --dev\");\n\n if ($this->hasOption('theme')) {\n $this->doCommand('composer require ' . $this->option('theme').'');\n }\n }", "public function get_script_depends() {\r\n\t\treturn [ \r\n\t\t\t'owl-carousel',\r\n\t\t\t'widgetkit-main',\r\n\t\t ];\r\n\t}", "public function get_dependencies()\n {\n return array(\n 'requires' => array(\n 'Conversr',\n ),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "function getDependencies()\n {\n return array(\n 'Shuffle\\CardBundle\\DataFixtures\\ORM\\LoadDeckData',\n );\n }", "public function set_up_dependencies () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\t\tadd_action('admin_enqueue_scripts', array($this, 'enqueue_dependencies'));\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-soisy-pagamento-rateale-loader.php';\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-soisy-pagamento-rateale-i18n.php';\n /**\n * The class responsible for defining settings\n * of the plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-soisy-pagamento-rateale-gateway-settings.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-soisy-pagamento-rateale-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-soisy-pagamento-rateale-public.php';\n\t\t\n\t\t\n\t\t$this->loader = new Soisy_Pagamento_Rateale_Loader();\n\n\t}", "public function getDependencies(): array\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n // third party\n Adapter::class => AdapterServiceFactory::class,\n CorsMiddleware::class => Middleware\\CorsMiddlewareFactory::class,\n // Handler\n Handler\\AuthorizationTokenHandler::class => Handler\\AuthorizationTokenFactory::class,\n Handler\\ObtainCalcResultHandler::class => Handler\\ObtainCalcResultFactory::class,\n Handler\\StoreCalcResultHandler::class => Handler\\StoreCalcResultFactory::class,\n // Service\n Service\\PreserveNumberOfResultsService::class => Service\\PreserveNumberOfResultsFactory::class,\n Service\\CalcResultExtractingService::class => Service\\CalcResultExtractingFactory::class,\n // Repository\n Repository\\CalcResultsRepository::class => Repository\\CalcResultsFactory::class,\n ],\n ];\n }", "public function customize_preview_enqueue_deps()\n {\n }", "public static function has_dependents(){\n\t\treturn false;\n\t}", "public function needsToBeInstalledWithAllDependencies(): bool\n {\n return false;\n }", "public function getDependencies()\n {\n return [\n 'Elcodi\\Bundle\\StoreBundle\\DataFixtures\\ORM\\StoreData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\PrintSideData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductColorsData',\n ];\n }", "function um_messaging_dependencies() {\r\n echo '<div class=\"error\"><p>' . UM()->dependencies()->compare_versions( um_messaging_requires, um_messaging_version, 'messaging', um_messaging_extension ) . '</p></div>';\r\n }", "public function getDependencies(): array\n {\n return ['Dravencms\\Model\\Locale\\Fixtures\\CurrencyFixtures', 'Dravencms\\Model\\Location\\Fixtures\\CountryFixtures'];\n }", "private function load_dependencies() {\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-ttr66-loader.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-ttr66-admin.php';\n\t\t$this->loader = new TTR66_Loader();\n\t}", "public function getDependencies()\n {\n return [LoadProductData::class, LoadCategoryData::class];\n }", "public function getDependencies()\n {\n return [\n 'Elcodi\\Bundle\\StoreBundle\\DataFixtures\\ORM\\StoreData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductSizeData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductData',\n ];\n }", "function CIR_WorkaroundForMissingModulesDep()\n{\n\techo('\n\t[ -d \"/lib/modules/$(uname -r)\" ] || mkdir \"/lib/modules/$(uname -r)\"\n\t[ -f \"/lib/modules/$(uname -r)/modules.dep\" ] || cat /lib/modules/*/modules.dep > \"/lib/modules/$(uname -r)/modules.dep\";\n\t');\n}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getModuleDependencies()\n {\n // See open bug (https://github.com/omeka/omeka-s/issues/868)\n // return ['ZfcTwig'];\n return [];\n }", "private function load_dependencies() {\n\t\t// Load the views file.\n\t\trequire_once( dirname( __FILE__ ) . '/views-user-profile.php' );\n\n\t}", "function membership_stripe_load_dependencies() {\r\n\t\tinclude_once 'includes/class-ms-gateway-stripecheckout.php';\r\n\t\tinclude_once 'includes/class-ms-gateway-stripecheckout-api.php';\r\n\t\tinclude_once 'includes/view/class-ms-gateway-stripecheckout-view-button.php';\r\n\t\tinclude_once 'includes/view/class-ms-gateway-stripecheckout-view-settings.php';\r\n\t}", "public function getDependencies()\n {\n return [];\n }", "public function getDependencies()\n {\n return array( ProjetFixtures::class,\n DevisFixture::class,\n );\n }", "public function active_dependencies(): Collection;", "function wp_default_packages_vendor($scripts)\n {\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n ],\n ];\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'includes/class-facebook-stats-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'includes/class-facebook-stats-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'admin/class-facebook-stats-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'public/class-facebook-stats-public.php';\n\n\t\t$this->loader = new Facebook_Stats_Loader();\n\n\t}", "public function has_dependencies(): bool;", "private function _require()\n {\n }", "private function load_dependencies() {\n\t\t// Public.\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-api.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-assets.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-blocks.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-collection.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-manager.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-post-type.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-settings.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-shortcode.php' );\n\n\t\t// Admin.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( WPRMPRC_DIR . 'includes/admin/class-wprmprc-manage.php' );\n\t\t}\n\t}", "public function has_active_dependencies(): bool;", "public function getDependencies()\n {\n return array(\n new ModuleDependency('files'),\n new ModuleDependency('user'),\n new ModuleDependency('db'),\n new ModuleDependency('orm'),\n new ModuleDependency('scriptcollector'),\n new ModuleDependency('search'),\n new ModuleDependency('word')\n );\n }", "private static function get_dependencies() {\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\t$ret = array(\r\n\t\t\t\tself::EFFECTS_CORE => array(),\r\n\t\t\t\tself::EFFECTS_BLIND => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_BOUNCE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_CLIP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_DROP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_EXPLODE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FADE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FOLD => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_HIGHLIGHT => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_PULSATE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SCALE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SHAKE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SLIDE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_TRANSFER => array(self::EFFECTS_CORE),\r\n\t\t\t\t\r\n\t\t\t\t/* Widgets constants */\r\n\t\t\t\tself::WIDGET_ACCORDION => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_BUTTON => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_DIALOG => array(self::WIDGET_BUTTON, self::FEATURE_MOUSE, self::FEATURE_POSITION, self::FEATURE_DRAGGABLE, self::FEATURE_RESIZABLE),\r\n\t\t\t\tself::WIDGET_PROGRESSBAR => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_SLIDER => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::WIDGET_TABS => array(self::CORE, self::CORE_WIDGET),\r\n\t\t\t\tself::WIDGET_AUTOCOMPLETE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_POSITION),\r\n\t\t\t\t\r\n\t\t\t\t/* Feature constants */\r\n\t\t\t\tself::FEATURE_DRAGGABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_DROPPABLE => array(self::FEATURE_DRAGGABLE),\r\n\t\t\t\tself::FEATURE_RESIZABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_SELECTABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\tself::FEATURE_SORTABLE => array(self::CORE, self::CORE_WIDGET, self::FEATURE_MOUSE),\r\n\t\t\t\t// 1.8 stuff\r\n\t\t\t\tself::FEATURE_MOUSE => array(self::CORE_WIDGET),\r\n\t\t\t\tself::FEATURE_POSITION => array(),\r\n\t\t\t\t\r\n\t\t\t\tself::CORE_WIDGET => array(),\r\n\t\t\t\tself::CORE => array(),\t\t\t\r\n\t\t\t);\r\n\t\t\tif (self::is_version_1_10_or_higher()) {\r\n\t\t\t\t$ret[self::WIDGET_AUTOCOMPLETE][] = self::WIDGET_MENU;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\telse {\r\n\t\t\t// Version 1.7\r\n\t\t\t$ret = array(\r\n\t\t\t\tself::EFFECTS_CORE => array(),\r\n\t\t\t\tself::EFFECTS_BLIND => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_BOUNCE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_CLIP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_DROP => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_EXPLODE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FADE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_FOLD => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_HIGHLIGHT => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_PULSATE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SCALE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SHAKE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_SLIDE => array(self::EFFECTS_CORE),\r\n\t\t\t\tself::EFFECTS_TRANSFER => array(self::EFFECTS_CORE),\r\n\t\t\t\t\r\n\t\t\t\t/* Widgets constants */\r\n\t\t\t\tself::WIDGET_ACCORDION => array(self::CORE),\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(self::CORE),\r\n\t\t\t\tself::WIDGET_DIALOG => array(self::CORE, self::FEATURE_DRAGGABLE, self::FEATURE_RESIZABLE),\r\n\t\t\t\tself::WIDGET_PROGRESSBAR => array(self::CORE),\r\n\t\t\t\tself::WIDGET_SLIDER => array(self::CORE),\r\n\t\t\t\tself::WIDGET_TABS => array(self::CORE),\r\n\t\t\t\tself::WIDGET_AUTOCOMPLETE => array(),\r\n\t\t\t\t\r\n\t\t\t\t/* Feature constants */\r\n\t\t\t\tself::FEATURE_DRAGGABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_DROPPABLE => array(self::FEATURE_DRAGGABLE),\r\n\t\t\t\tself::FEATURE_RESIZABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_SELECTABLE => array(self::CORE),\r\n\t\t\t\tself::FEATURE_SORTABLE => array(self::CORE),\r\n\t\t\t\t\r\n\t\t\t\tself::CORE => array(),\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public static function getDependencies()\n {\n return [];\n }", "public static function getDependencies()\n {\n return [];\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "public function get_dependencies()\n {\n return array(\n 'requires' => array(),\n 'recommends' => array(),\n 'conflicts_with' => array()\n );\n }", "function gsn_web_services_require_files() {\n\t$abspath = dirname( __FILE__ );\n\trequire_once $abspath . '/classes/gsn-apiclient.php';\n\trequire_once $abspath . '/classes/gsn-plugin-base.php';\n\trequire_once $abspath . '/classes/gsn-web-services.php';\n}", "public function autoloadFilesAreBuildCorrectlyDataProvider() {}", "private function receiveDependecies()\n {\n $dependencyReceiver = new ConsoleDependencyReceiver($this);\n $dependencyReceiver->buildWithAllDependencies();\n }", "public function checkImportPrerequisites() {}", "function um_recaptcha_dependencies() {\r\n echo '<div class=\"error\"><p>' . UM()->dependencies()->compare_versions( um_recaptcha_requires, um_recaptcha_version, 'recaptcha', um_recaptcha_extension ) . '</p></div>';\r\n }", "function getDependency();", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "private function checkOptimizers() {\n\t\tforeach($this->optimizers as $optimizer => $path) {\n\t\t\t$finder = new Symfony\\Component\\Process\\ExecutableFinder();\n\t\t\t$exec = $finder->find($optimizer, '', $this->optimizersExtraPaths);\n\t\t\t$this->optimizers[$optimizer] = $exec;\n\t\t}\n\t}", "function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}", "private function load_dependencies() {\n\n\t\t$this->loader = new Service_Tracker_Loader();\n\n\t}" ]
[ "0.6589734", "0.6571747", "0.6334228", "0.62454414", "0.6186806", "0.60964495", "0.60809416", "0.60755384", "0.6044933", "0.6040495", "0.6038151", "0.600188", "0.5986961", "0.5986488", "0.5920155", "0.58539146", "0.58063155", "0.57943135", "0.578357", "0.5773794", "0.5757515", "0.57427955", "0.5726973", "0.5720982", "0.570976", "0.5709376", "0.56969374", "0.56967723", "0.5673803", "0.56536263", "0.5652723", "0.5636989", "0.5630016", "0.5627831", "0.56228113", "0.56128395", "0.5608123", "0.560138", "0.55825025", "0.5578774", "0.557359", "0.557347", "0.5571324", "0.555963", "0.55403477", "0.55329293", "0.5523463", "0.55200016", "0.55162317", "0.54835695", "0.5470475", "0.5466411", "0.54524595", "0.5445395", "0.5439938", "0.54294837", "0.5429028", "0.54273534", "0.5416803", "0.5414271", "0.54098064", "0.54017687", "0.53967875", "0.53931594", "0.5376295", "0.5372856", "0.5369139", "0.5367434", "0.53640634", "0.53581715", "0.53581715", "0.5357768", "0.53548336", "0.5353615", "0.53522575", "0.5346667", "0.5345588", "0.5338244", "0.53323895", "0.5332236", "0.5329821", "0.5319908", "0.53196174", "0.5317199", "0.5315828", "0.5309696", "0.5302505", "0.5302505", "0.52990526", "0.52990526", "0.52990526", "0.52979153", "0.5297469", "0.52971375", "0.5294642", "0.5286428", "0.5283517", "0.52824485", "0.5280492", "0.52793396", "0.5274749" ]
0.0
-1
DADO UN URL OBTENGO LA DEPENDENCIA
function getDependenceBySlug($slug) { $query = $this->db->get_where('dependence', array('slug'=>$slug)); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jc_url() {\n\n}", "abstract public function getUrl();", "public function url();", "public function url();", "public function url();", "private function Get_URL()\n {\n $url = $this->CURL->GET_SERVER_URL();\n $download_url = $url.\"/application/download/download.php\";\n $view_url = $url.\"/application/pdf/view.php\";\n $this->DOWNLOAD_URL = $download_url;\n $this->VIEW_URL = $view_url;\n }", "public function getBancoUrl()\t{\n\t\treturn 'https://geraboleto.sicoobnet.com.br/geradorBoleto/GerarBoleto.do';\n\t}", "function get_url()\n {\n }", "public function getURL ();", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "function getUrl();", "function urls_geodiv_dist($i, $entite, $args='', $ancre='') {\n\t$contexte = $GLOBALS['contexte']; // recuperer aussi les &debut_xx\n\n\tif (is_numeric($i))\n\t\treturn _generer_url_geodiv($entite, $i, $args, $ancre);\n\n\t// traiter les injections du type domaine.org/spip.php/cestnimportequoi/ou/encore/plus/rubrique23\n\tif ($GLOBALS['profondeur_url']>0 AND $entite=='sommaire'){\n\t\treturn array(array(),'404');\n\t}\n\t$url = $i;\n\n\t// Decoder l'url html, page ou standard\n\t$objets = 'article|breve|rubrique|mot|auteur|site|syndic|media|cat|tag|collection|album';\n\tif (preg_match(\n\t',^(?:[^?]*/)?('.$objets.')([0-9]+)(?:\\.html)?([?&].*)?$,', $url, $regs)\n\tOR preg_match(\n\t',^(?:[^?]*/)?('.$objets.')\\.php3?[?]id_\\1=([0-9]+)([?&].*)?$,', $url, $regs)\n\tOR preg_match(\n\t',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$objets.')([0-9]+)(&.*)?$,', $url, $regs)) {\n\t\tswitch ($regs[1]){\n\t\t\tcase 'media':\n\t\t\t\t$regs[1] = 'article';\n\t\t\t\tbreak;\n\t\t\tcase 'cat':\n\t\t\t\t$regs[1] = 'rubrique';\n\t\t\t\tbreak;\n\t\t\tcase 'tag':\n\t\t\t\t$regs[1] = 'mot';\n\t\t\t\tbreak;\n\t\t\tcase 'album':\n\t\t\t\t$regs[1] = 'collection';\n\t\t\t\tbreak;\n\t\t}\n\t\t$type = preg_replace(',s$,', '', table_objet($regs[1]));\n\t\t$_id = id_table_objet($regs[1]);\n\t\t$id_objet = $regs[2];\n\t\t$suite = $regs[3];\n\t\t$contexte[$_id] = $id_objet;\n\t\tif ($type == 'syndic') $type = 'site';\n\t\treturn array($contexte, $type, null, $type);\n\t}\n\n}", "public function getURL();", "public function getURL();", "function getUrl($modulo, $controlador, $funcion, $parametros = false, $pagina = false){\n\n\t\tif($pagina == false){\n\t\t\t$pagina = \"index\";\n\t\t}\n\n\t\t$url = $pagina.\".php?modulo=$modulo&controlador=$controlador&funcion=$funcion\";\n\n\t\tif($parametros!=false){\n\t\t\tforeach ($parametros as $columna => $valor) {\n\n\t\t\t\t\t$url.=\"&\".$columna.\"=\".$valor.\"\";\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $url;\n\t}", "public function urlUret3(){\n //generateUrl de olan name php bin/console debug:router ile bulduk\n //page den sonra olan kisimlari ekleyerek ne aradimizi netlestirmis olduk\n // 3. parametre olarak \"UrlGeneratorInterface\" bize verecegi URL turunu belirleyebiliyoruz\n $url=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n ]);\n\n\n $fullurl=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n 'category'=>'health',\n 'age'=>25,\n 'height'=>170\n ],UrlGeneratorInterface::RELATIVE_PATH);\n\n\n return new JsonResponse([\"Generate URL\"=>$url , \"Full URL: \"=> $fullurl]);\n }", "function enlaceInicio(){\n if($_SERVER['HTTPS']){\n\t echo 'httpt://' . $_SERVER['SERVER_NAME'];\n\t}else{\n\t echo 'http://' . $_SERVER['SERVER_NAME'];\n\t}\n }", "public function get_url()\n {\n }", "public abstract function getURL();", "function turl_ffull_url()\n{\n\t//$GLOBALS[\"content\"].=$_SERVER[\"SERVER_PORT\"];\n\t\n\tif ($_SERVER[\"SERVER_PORT\"]==443)\n\t{\n\t\t$full_url=\"https://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t}\n\telse\n\t{\n\t\t//$full_url=\"http://\".$_SERVER['HTTP_HOST'].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER['REQUEST_URI'];\n\t\t$full_url=\"http://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t}\n\t\n\t//$GLOBALS[\"content\"].=$full_url;\n\t\n\tpj_deb_flog3(__LINE__, __FILE__, $full_url, \"tuti\");\n\t\n\treturn $full_url;\n}", "public function getAproposUrl(){\n // return \"chanson.php/\".$id; \n return $this->rootUrl().\"apropos\"; \n }", "function ruta($url){\n\t$host = $_SERVER['HTTP_HOST'];\n\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t$extra = $url;\n\n\t$tipo = 'http';\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n \t$tipo = 'https';\n\t}\n\n\treturn $tipo . \"://\" . $host . $uri . \"/\" . $url; \n}", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "private function verificaShortUrl() {\n FormataLink::verificaMiniUrl(\"fwk_link_encurtado\");\n }", "public function url(): string;", "function fct_decode_lien_url ($urlpage) {\nglobal $url_parlante;\n\t// recupere ligne de produits et criteres (separes par _)\n\t$pos = strpos($urlpage, \"_\");\n\tif ($pos === false) {\n\t\t$gauche = $urlpage;\n\t} else {\n\t\t$gauche= substr($urlpage,0,$pos);\n\t\t$droite = substr($urlpage,$pos+1);\n\t\tif (substr($droite,-5) == \".html\") $droite = substr($droite,0,-5);\n\t}\n\t// remplace libelles criteres par ref et code critere (ex: tho = 00801)\n\tif (isset($droite)) {\n\t\t$paramd = explode(\"_\", $droite);\n\t\tforeach ($paramd as $libelle) {\t\n//echo \"url\";print_r($libelle);\n\n\t\t\t$code_paire = array_search($libelle, $url_parlante);\n//echo \"code $code_paire - \";\n\t\t\tif ($code_paire === false) $code_paire = $libelle;\n\t\t\t$pos = strpos($code_paire,\"~\"); \n\t\t\t$couple = explode(\"~\",$code_paire);\n\t\t\t$_GET[$couple[0]] = $couple[1]; \n\t\t}\n\t}\n}", "function getScriptUrl() ;", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function construitUrl()\n {\n //Site de l'API Paypal\n $urlPaypal = \"https://api-3t.sandbox.paypal.com/nvp?\";\n //Version de l'API de paypal\n $version = \"204.0\";\n //Compte Utilisateur du vendeur\n $user = \"test.seller_api1.yopmail.com\";\n //Mot de passe pour acceder à l'API\n $pass = \"CMASHX59W3RDVVKE\";\n //Signature de l'API\n $signature = \"AFcWxV21C7fd0v3bYYYRCpSSRl31AD3ZWGs6j9kywv41tSL0XrUzyrSf\";\n //Concaténation pour avoir l'url de base\n $urlPaypal = $urlPaypal.'VERSION='.$version.'&USER='.$user.'&PWD='.$pass.'&SIGNATURE='.$signature;\n\n return $urlPaypal;\n }", "function resources_url($filename = NULL)\n {\n return 'https://resources.crud4.com/v1/' . $filename;\n //return site_url('resources/' . $param);\n }", "abstract protected function getElisServiceUrl();", "public function get_url();", "private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}", "public function getUrl() {\r\n\t}", "function short($urlf){\r\n\t\r\n$url = file_get_contents(\"http://migre.me/api.txt?url=$urlf\");\r\necho $url;\r\n}", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "function myFunction(){\n\t\t\t\techo \"le site \" . MON_URL . \" c'est de la balle !\";\n\t\t\t}", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "private function _generateApiUrl() {\n $this->_detectUserLanguage();\n echo '<script type=\"text/javascript\" src=\"' . self::$apiUrl . '?hl=' . $this->defaultLanguage . '\"></script>';\n }", "abstract public function get_url_update();", "protected function prepareUrl()\n {\n return 'http://'.$this->_host.'/service/v'.$this->_apiVersion.'/rest.php';\n }", "function base_url($url = NULL){\n\t\tif ($url != NULL)\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/'.$url;\n\t\t}\n\t\telse\t\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/';\n\t\t}\n\t\t\n\t\treturn $baseurl;\n\t}", "public static function obtenerRuta()\n {\n return \"http://localhost/frontend/\";\n }", "protected function getUrl() {\r\n $url = \\Nette\\Utils\\Strings::endsWith($this->url, \"/\") ? $this->url : $this->url . \"/\"; \r\n $script = \\Nette\\Utils\\Strings::startsWith($this->script, \"/\") ? $this->script : \"/\" . $this->script; \r\n \r\n return $url . $script;\r\n }", "function bu($url='')\n{\n static $baseUrl;\n $baseUrl=Yii::app()->request->baseUrl;\n $baseUrl .= $baseUrl.'/'.ltrim($url,'/');\n if(param('root_control'))\n {\n $baseUrl = \"/\" . param('root_control') . $baseUrl;\n }\n return $baseUrl; \n}", "function wp_get_http($url, $file_path = \\false, $red = 1)\n {\n }", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "function __construct()\n {\n parent::__construct(); //kutsume tööle http konstruktor\n //loome põhilingi\n $this->baseUrl = $this->protocol . HTTP_HOST . SCRIPT_NAME;\n }", "public static function descargar($url) {\n if(!\\foxtrot::esCli()) echo json_encode([\n 'd'=>$url\n ]);\n \\foxtrot::detener();\n }", "function calculer_url ($ref, $texte='', $pour='url', $connect='', $echappe_typo = true) {\n\t$r = traiter_lien_implicite($ref, $texte, $pour, $connect, $echappe_typo);\n\t$r = ($r ? $r : traiter_lien_explicite($ref, $texte, $pour, $connect, $echappe_typo));\n\treturn $r;\n}", "public function testDemoteAutomatchUrlUsingGET()\n {\n }", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "public function getScriptUrl() {}", "function includes_url($path = '', $scheme = \\null)\n {\n }", "public function generate_url()\n {\n }", "private static function loadUrl(){\n\n $uri = $_SERVER['REQUEST_URI'];\n\n if (ENCRYPTURL == '1')\n $uri = CR::decrypt($uri);\n\n BASEDIR == '/' || $uri = str_replace(BASEDIR,'', $uri);\n $uri = explode('/', $uri);\n\n array_walk($uri, function(&$item){\n strpos($item, '?') == false ||\n $item = substr($item, 0, strpos($item, '?'));\n });\n\n return $uri;\n }", "public function GetFetchURL();", "abstract public function get_url_read();", "function getJAVA($url) {\r\n // inisialisasi CURL\r\n $ip = $url;\r\n $data = curl_init();\r\n// $ip = $getRow['ipAddr'] . '' . $url;\r\n//\techo $ip;\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 json_decode($hasil);\r\n}", "#[Pure]\n public function getRequestUrl() {}", "abstract protected function getMethodUrl(): string;", "public function request($url);", "function skarla_url($url)\n{\n return url(\"skarla/{$url}\");\n}", "public function getUrl( $file );", "function bank_url_api_retour($config, $action, $args = \"\"){\n\tstatic $is_api = null;\n\tif (is_null($is_api)){\n\t\t$is_api = false;\n\t\tif (file_exists($f = _DIR_RACINE . \".htaccess\")){\n\t\t\tlire_fichier($f, $contenu);\n\t\t\tif (($p = strpos($contenu, 'spip.php?action=api_$'))!==false){\n\t\t\t\t$p_ligne = strrpos(substr($contenu, 0, $p), \"\\n\");\n\t\t\t\t$ligne = substr($contenu, $p_ligne, $p-$p_ligne);\n\t\t\t\t$ligne = ltrim($ligne);\n\t\t\t\tif ($ligne[0]!==\"#\" and strpos($ligne, \"RewriteRule\") === 0){\n\t\t\t\t\t$is_api = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$presta = $config['presta'] . \"-\" . bank_config_id($config);\n\tif ($is_api){\n\t\treturn generer_url_public('', $args, false, false, \"bank.api/$presta/$action/\");\n\t} else {\n\t\t$args = (strlen($args) ? \"&\" : \"\") . $args;\n\t\t$args = \"bankp=\" . $presta . $args;\n\t\treturn generer_url_action('bank_' . $action, $args, true, true);\n\t}\n}", "public function get($url);", "public function getBaseUrl() {}", "public static function get_baseurl()\n {\n }", "protected function initiateUrl()\n\t{\n\t\t// base url\n\t\tif($this->app->config->has('app.url'))\n\t\t\t$this->setBase($this->app->config->get('app.url'));\n\n\t\t// asset url\n\t\tif($this->app->config->has('asset.url'))\n\t\t\t$this->setAsset($this->app->config->get('asset.url'));\n\t}", "public function fetch($url);", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "function writeUrl() {\n\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "function skarla_url($url) {\n return url(\"skarla/{$url}\");\n}", "function bu($url=null) \n{\n static $baseUrl;\n if ($baseUrl===null)\n $baseUrl=Yii::app()->getRequest()->getBaseUrl();\n return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');\n}", "private function setUrls() {\n\t\t$this->url = ($this->env === 'DEVELOPMENT') ? 'https://test.sagepay.com/gateway/service/direct3dcallback.vsp' : 'https://live.sagepay.com/gateway/service/direct3dcallback.vsp';\n\t}", "function returnbaseurl()\n{\n return \"http://audio.qu.tu-berlin.de/amtoolbox\";\n}", "function getUrl( $module, $controller, $function, $parametros=false, $pagina=false ){\n \n if($pagina==false){\n $pagina=\"index\";\n }\n \n $url = \"$pagina.php?module=$module&controller=$controller&function=$function\";//Recibe parametros por metodo GET\n \n //Se almacena en un array los parametros requeridos, por ejemplo departamento_id = 1 y ciudad_id = 2 etc...\n if ($parametros!=false) {\n foreach ($parametros as $key => $value) {\n $url.=\"&$key=$value\";\n }\n }\n\n return $url;\n}", "protected function determineScriptUrl() {}", "public function testGetURL()\n {\n $pagSeguroController = new PagSeguroController();\n\n $url = $pagSeguroController->getURL('/teste');\n\n if($pagSeguroController::MODE == 'development') {\n $this->assertEquals('https://ws.sandbox.pagseguro.uol.com.br/teste', $url);\n } else {\n $this->assertEquals('https://ws.pagseguro.uol.com.br/', $url);\n }\n }", "protected function determineScriptUrl() {}", "protected function determineScriptUrl() {}", "function bacaHTML($url) {\r\n $ip = $url;\r\n $data = curl_init();\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}", "function getUrlExcluidas() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT * FROM reporte.url_excluidas(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->objetivo_id).\", '\".\n\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$row = $res->fetchRow();\n\t\t$dom = new DomDocument();\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$dom->loadXML($row[\"url_excluidas\"]);\n\t\t$xpath = new DOMXpath($dom);\n\t\tunset($row[\"url_excluidas\"]);\n\n\t\t$conf_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo')->item(0);\n\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif ($xpath->query('//paso/excluye')->length == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t// CARGA DEL TEMPLATE Y LIMPIEZA DE BLOQUES\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'descripcion_url_excluidas.tpl');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_NOMBRE', 'bloque_nombre');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_EXCLUIDA', 'bloque_excluida');\n\n\t\t$linea = 0;\n\t\tif ($conf_pasos->length > 0) {\n\t\t\tforeach ($conf_pasos as $conf_paso) {\n\t\t\t\tforeach ($xpath->query('excluye', $conf_paso) as $id => $excluida) {\n\t\t\t\t\t$T->setVar('bloque_nombre', '');\n\t\t\t\t\tif ($id == 0) {\n\t\t\t\t\t\t$T->setVar('__idPaso', $conf_paso->getAttribute('nombre'));\n\t\t\t\t\t\t$T->setVar('__rowSpan', $xpath->query('excluye', $conf_paso)->length);\n\t\t\t\t\t\t$T->parse('bloque_nombre', 'BLOQUE_NOMBRE', false);\n\t\t\t\t\t}\n\t\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\t\t\t\t\t$T->setVar('__url', $excluida->getAttribute('url'));\n\t\t\t\t\t$T->parse('bloque_excluida', 'BLOQUE_EXCLUIDA', true);\n\t\t\t\t\t$linea++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}", "public function getConnexionURL(){\n return $this->rootUrl().\"connexion\";\n }", "function url_para($pagina){\n return vazio($pagina) ? URL : URL.\"index.php/\".$pagina;\n }" ]
[ "0.58038384", "0.58000225", "0.57319236", "0.57319236", "0.57319236", "0.5729183", "0.5720145", "0.5717459", "0.57100016", "0.5687298", "0.56712353", "0.565993", "0.5645743", "0.5645743", "0.5589236", "0.5580399", "0.5569577", "0.5557956", "0.5556938", "0.5556755", "0.5554417", "0.5542809", "0.5533163", "0.55266196", "0.5525093", "0.5517063", "0.5511963", "0.549918", "0.549918", "0.549918", "0.549918", "0.549918", "0.549918", "0.549918", "0.549918", "0.549113", "0.5487015", "0.5484204", "0.5483669", "0.5470354", "0.5469955", "0.5463514", "0.5454918", "0.54330945", "0.5420655", "0.5420655", "0.5420655", "0.54055625", "0.5403148", "0.53908086", "0.5384279", "0.53747934", "0.53574044", "0.53281915", "0.5323939", "0.5323393", "0.53221166", "0.5321675", "0.53205115", "0.530045", "0.5279928", "0.5279928", "0.5279928", "0.5279928", "0.5279928", "0.5279928", "0.5279928", "0.5279928", "0.5277484", "0.5260992", "0.52595854", "0.525491", "0.52531505", "0.5238452", "0.5238151", "0.52305263", "0.5225248", "0.5218039", "0.5204192", "0.51998234", "0.51945376", "0.51922846", "0.5190201", "0.51901907", "0.51878273", "0.51832414", "0.5181306", "0.51811737", "0.5163016", "0.51596355", "0.5159582", "0.5157469", "0.51567954", "0.5156453", "0.51555", "0.5153036", "0.5153036", "0.51527953", "0.5150047", "0.51494753", "0.5147912" ]
0.0
-1
VERIFICA QUE NO ESTE DUPLICADO UNA DEPENDENCIA
function isNotDuplicateDependence($dependence_id, $name) { $query = $this->db->get_where('dependence', array('id !='=>$dependence_id, 'name =' => $name)); return $query->num_rows() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateDependencies()\n {\n $db = Codeli::getInstance()->getDB();\n $db->query(\"DELETE FROM \" . SystemTables::MODULE_DEPENDENCY . \" WHERE guid='::guid'\", array(\"::guid\" => $this->guid));\n\n if (count($this->dependencies) < 1)\n {\n return;\n }\n\n $values = array();\n foreach ($this->dependencies as $dep => $data)\n {\n $values[] = \" ('$this->guid', '$dep') \";\n }\n\n $sql = \"INSERT INTO \" . SystemTables::MODULE_DEPENDENCY . \" (guid, dependencyGuid) VALUES \" . implode(\",\", $values);\n return $db->query($sql);\n }", "public static function has_dependents(){\n\t\treturn false;\n\t}", "function cumple_dependencias()\n\t{\n\t\treturn count($this->get_dependencias_faltantes()) > 0;\n\t}", "private function missingDependencies() {\n }", "private function checkDependencies() {\n return true;\n }", "function remove_dependents() {\n\t\t/** todo\n\t\tforeach($this->has_many_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\n\t\t}\n\n\t\tforeach($this->has_one_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function dependencyExist(): bool\n {\n if ($this->dependencyExist !== null) {\n return $this->dependencyExist;\n }\n\n $this->dependencyExist = (bool)$this->getPqrForm()->getRow('sys_dependencia');\n\n return $this->dependencyExist;\n }", "public function resolveCopy() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 1) {\r\n\t\t\t$this->status = self::MISSING;\t\t\t\r\n\t\t}\r\n\t}", "public function has_dependencies(): bool;", "public function isDependant();", "function wp_dependencies_unique_hosts()\n {\n }", "public function needsReprocessing() {}", "function comprobarProductoDuplicado() {\n\t\tif($this->id_nombre_producto == NULL) {\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"));\n\t\t} else {\t\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and id_nombre_producto<>%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"),\n\t\t\t\t$this->makeValue($this->id_nombre_producto, \"int\"));\n\t\t}\n\t\t$this->setConsulta($consulta);\n\t\t$this->ejecutarConsulta();\n\t\tif($this->getNumeroFilas() == 0) {\n\t\t\treturn false;\t\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function has_no_inactive_dependencies(): bool;", "public function has_no_active_dependencies(): bool;", "function noExistDependence($dependence_name)\n\t{\n\t\t$query = $this->db->get_where('dependence', array('name'=>$dependence_name));\n\t\treturn $query->num_rows() == 0;\n\t}", "public function checkImportPrerequisites() {}", "public function has_inactive_dependencies(): bool;", "public function hasDependencyErrors() {}", "function problematicDependencies() {\n foreach ($this->dependency_log as $id => $tbls) {\n if (count($tbls) > 1) return count($tbls);\n }\n return 0;\n }", "public static function checkDependencies() {\n\t\treturn true;\n\t}", "public function check_if_has_dependency() {\n $res = true;\n\n foreach ( $this->depends_on as $class ) {\n if ( ! class_exists( $class['name'] ) ) {\n $this->dependency_error[] = $class['notice'];\n $res = false;\n $this->dependency_not_found = true;\n }\n }\n\n return $res;\n }", "public function check_duplicate()\n {\n }", "function unsinstall()\n\t\t{\n\t\t}", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "abstract public function buildDependency();", "public function isDependancy_simple() {\n\t\t$this->getDependancy_simple();\n\t}", "protected function _preupdate() {\n }", "function rtasset_admin_notice_dependency_not_installed() {\n\tif ( ! rtasset_is_plugin_installed( 'rtbiz' ) ) {\n\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t?>\n\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t<p>\n\t\t\t\t<b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( esc_attr( $path ) . ' plugin is not found on this site. Please install & activate it in order to use this plugin.', RT_ASSET_TEXT_DOMAIN ); ?>\n\t\t\t</p>\n\t\t</div>\n\t<?php\n\t} else {\n\t\tif ( rtasset_is_plugin_installed( 'rtbiz' ) && ! rtasset_is_plugin_active( 'rtbiz' ) ) {\n\t\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t\t$nonce = wp_create_nonce( 'rtasset_activate_plugin_' . $path );\n\t\t\t?>\n\t\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t\t<p><b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( 'Click' ) ?>\n\t\t\t\t\t<a href=\"#\" onclick=\"activate_rtasset_plugin('<?php echo esc_attr( $path ); ?>','rtasset_activate_plugin','<?php echo esc_attr( $nonce ); ?>')\">here</a> <?php _e( 'to activate rtBiz.', 'rtbiz' ) ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n}", "public function mergeDependencies()\n {\n $this->dependencies = array_merge($this->dependencies, $this->commonDependencies);\n }", "public function testUpdateConflict() {\n\t\tself::$sag->put(\"foo\", self::$temp);\n\t}", "protected function _isDependence($name) {\r\n \treturn array_key_exists($name, $this->_dependenciesMap);\r\n }", "function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}", "protected function _alreadyInstalled()\r\n\t{\r\n\t\t$select\t\t= $this->_db->select()->from('Cron_Jobs', array('id'))->where('name = ?', $this->_name);\r\n\t\t$results\t= $this->_db->fetchAll($select);\r\n\t\t\r\n\t\tif(count($results)) {\r\n\t\t\tthrow new Exception('Cron job ' . $this->_name . 'is already installed');\r\n\t\t}\r\n\t}", "function guardarReclamo()\n\t\t{\n\t\t}", "public function isAlreadyInstalled() {\n\t\t// is not a unique package and can be\n\t\t// installed as many times as you want\n\t\tif ($this->packageInfo['isUnique'] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t// this package may only be installed\n\t\t// once (e. g. library package)\n\t\telse {\n\t\t\treturn (count($this->getDuplicates()) != 0);\n\t\t}\n\t}", "private function is_automatic_install( &$dependency ) {\n\t\t$is_required = $this->is_required( $dependency );\n\t\treturn ! $is_required || ( $is_required && ! self::$automatic_install_required );\n\t}", "public function has_active_dependencies(): bool;", "private function determineMissingDependencies(): array\n {\n $depBuilder = $this->testDetails->getDependencyBuilder();\n file_put_contents($this->path.'/dep_builder', serialize($depBuilder));\n file_put_contents($this->path.'/dep_runner.php', '<?php\n\nrequire __DIR__.\"/vendor/autoload.php\";\n$depBuilder = unserialize(file_get_contents(\"dep_builder\"));\n$missingDependencies = array_merge(\n $depBuilder->getMissingDependencies(),\n $depBuilder->getMissingDevDependencies()\n);\necho json_encode($missingDependencies);\n ');\n\n $process = MakerTestProcess::create('php dep_runner.php', $this->path)->run();\n $data = json_decode($process->getOutput(), true, 512, \\JSON_THROW_ON_ERROR);\n\n unlink($this->path.'/dep_builder');\n unlink($this->path.'/dep_runner.php');\n\n return array_merge($data, $this->testDetails->getExtraDependencies());\n }", "public function checkDependencies() {\n if ((float) t3lib_extMgm::getExtensionVersion('extension_builder') < 2) {\n throw new Tx_Clitools_Exception_Dependency('This generator depends on extension_builder 2 higher');\n }\n }", "public function complete(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"DELETE FROM \" . $this->table_name . \"\n WHERE id_ordine=?\";\n $stmt1 = $this->conn->prepare($query1);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt1->bindParam(1, $this->id_ordine);\n $stmt1->execute();\n if($stmt1){\n $query2 = \"UPDATE articolo set id_ordine = NULL \n WHERE id_ordine=?\";\n\n $stmt2 = $this->conn->prepare($query2);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt2->bindParam(1, $this->id_ordine);\n $stmt2->execute();\n\n if($stmt2){\n\n $query3 = \"SET foreign_key_checks = 1\";\n $stmt3 = $this->conn->prepare($query3);\n $stmt3->execute();\n if($stmt3)\n return true;\n }\n }\n else\n return false;\n }", "function wds_acf_blocks_dependency_check() {\n\t$asset_file = plugin_dir_path( dirname( __FILE__ ) ) . 'build/index.asset.php';\n\n\tif ( file_exists( $asset_file ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"notice notice-error\">\n\t\t<p>\n\t\t\t<?php\n\t\t\tesc_html_e(\n\t\t\t\t'Whoops! You need to run `npm install` in the terminal for the WDS ACF Blocks plugin to work first.',\n\t\t\t\t'wds-acf-blocks'\n\t\t\t);\n\t\t\t?>\n\t\t</p>\n\t</div>\n\t<?php\n}", "public function getPostDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop', 'OrderAlterForeignKeyContraintsOnDelete' );\n\t}", "private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "function dependencias2() { // se construye la sentencia de busqueda de la tupla\n //Variable que almacena las dependencias\n $dependencias2 = null;//inicializamos la variable a null\n //Variable que almacena la sentencia sql\n\t\t$sql = \"SELECT NombreTrabajo, QA.LoginEvaluador, LoginEvaluado, AliasEvaluado FROM ASIGNAC_QA QA, ENTREGA E, TRABAJO T WHERE QA.LoginEvaluado = '$this->login' AND QA.LoginEvaluado = E.login AND QA.IdTrabajo = T.IdTrabajo\";//se construye la sentencia sql\n $resultado = $this->mysqli->query( $sql );//se ejecuta la query\n //miramos si el número de tuplas es mayor o igual que uno\n if ( $resultado->num_rows >= 1 ) {\n $dependencias2 = $resultado;//le pasamos a la variable dependencias2 todas las tablas de las que depende\n }\n \n return $dependencias2;\n\t}", "public function needsToBeInstalledWithAllDependencies(): bool\n {\n return false;\n }", "public static function installToolEnableFileExists() {}", "public function hasSubdependencies(): bool;", "protected function dependenciesComplete() {\n foreach ($this->dependencies as $dependency) {\n $migration = MigrationBase::getInstance($dependency);\n if (!$migration->isComplete()) {\n return FALSE;\n }\n }\n return TRUE;\n }", "function opcion__compilar()\n\t{\n\t\t$this->get_proyecto()->compilar();\n\t}", "protected function _checkForDupe()\n\t{\n\t\t$this->_oldPre = $this->_pdo->queryOneRow(sprintf('SELECT category, size FROM predb WHERE title = %s', $this->_pdo->escapeString($this->_curPre['title'])));\n\t\tif ($this->_oldPre === false) {\n\t\t\t$this->_insertNewPre();\n\t\t} else {\n\t\t\t$this->_updatePre();\n\t\t}\n\t\t$this->_resetPreVariables();\n\t}", "private function load_dependencies() {\n //require_once( $this->inc . 'class-best-faq-admin.php' );\n require_once( $this->inc . 'best-faq-shortcode.php' );\n }", "abstract protected function _regenerate();", "function evt__1__salida()\n\t{\n\t\t$this->dep('dependencias')->limpiar_seleccion();\n\t}", "function needsExecution() ;", "function complete_version_removal() { return ''; }", "function modificar_dependencia($anterior, $nuevo)\n\t{\n\t\t//Este cambio se le notifica a las pantallas\n\t\t$this->get_entidad()->tabla('pantallas')->cambiar_id_dependencia($anterior, $nuevo);\n\t}", "public function autoloadFilesAreBuildCorrectlyDataProvider() {}", "function get_dependencies();", "protected function install(){ return true;}", "public function check_for_dependents()\n\t{\n\t\t$query = \"SELECT * FROM \" . cms_db_prefix() . \"module_deps WHERE parent_module = ?\";\n\t\t$row = cms_db()->GetRow($query, array($this->get_name()));\n\n\t\tif ($row)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public static function check_dependencies() {\n\t\tif ( ! self::check_php() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_php_notice' ) );\n\t\t\tadd_action( 'admin_init', array( __CLASS__, 'deactivate_self' ) );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! self::check_wp() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_wp_notice' ) );\n\t\t\tadd_filter( 'plugin_action_links_' . JOB_MANAGER_PLUGIN_BASENAME, array( 'WP_Job_Manager_Dependency_Checker', 'wp_version_plugin_action_notice' ) );\n\t\t}\n\n\t\treturn true;\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'OrderRenameTables', 'OrderServiceAttributeAddPrimaryKey' );\n\t}", "function dependencias() { // se construye la sentencia de busqueda de la tupla\n //Variable que almacena las dependencias\n $dependencias = null;//inicializamos la variable a null\n //Variable que almacena la consulta sql\n\t\t$sql = \"SELECT NombreTrabajo, QA.LoginEvaluador, LoginEvaluado, AliasEvaluado FROM ASIGNAC_QA QA, ENTREGA E, TRABAJO T WHERE QA.LoginEvaluador = '$this->login' AND QA.LoginEvaluador = E.login AND QA.IdTrabajo = T.IdTrabajo\";//se construye la sentencia sql\n //Variable que almacena el resultado de la query\n $resultado = $this->mysqli->query( $sql );//se ejecuta la query\n //Si el numero de columnas que devuelve es mayor o igual a 1 pasamos las dependencias de todas las tablas que depende\n if ( $resultado->num_rows >= 1 ) {\n $dependencias = $resultado;//le pasamos a la variable dependencias todas las tablas de las que depende\n }\n \n return $dependencias;\n\t}", "public function verify_dependencies()\n {\n $verifier = new DependencyVerifier(Package::get(static::context()));\n $success = $verifier->is_removable();\n \n $this->add_message(self::TYPE_NORMAL, $verifier->get_logger()->render());\n \n if (! $success)\n {\n return $this->failed(Translation::get('PackageDependenciesFailed'));\n }\n else\n {\n $this->add_message(self::TYPE_NORMAL, Translation::get('PackageDependenciesVerified'));\n return true;\n }\n }", "public function checkOptimizeNeeded() {\n\t\t$this->isOptimizeNeeded = true;\n\t}", "private function _require()\n {\n }", "public function getAllowMissingDependencies() : bool\n {\n return $this->allowMissingDependencies;\n }", "function installer_champs_extras($champs, $nom_meta_base_version, $version_cible) {\r\n\t$current_version = 0.0;\r\n\tif ((!isset($GLOBALS['meta'][$nom_meta_base_version]))\r\n\t|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){\r\n\t\t// cas d'une installation\r\n\t\tif ($current_version==0.0){\r\n\t\t\tcreer_champs_extras($champs);\r\n\t\t\tecrire_meta($nom_meta_base_version,$current_version=$version_cible,'non');\r\n\t\t}\r\n\t}\t\r\n}", "function layout_builder_post_update_layout_builder_dependency_change() {\n // Empty post-update hook.\n}", "public static function dependencies($package = NULL) {\n\n // install dependancies and check if installed before\n // \n \n if(!is_null($package)) {\n echo \"hello dependency\";\n }\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "function insta_f_install(){\n}", "public function check_dependencies() {\n\n $dependencies = [];\n\n /**\n * Sample plugin dependency\n *\n * Depends on ACF plugin active\n */\n// if ( ! class_exists( 'acf' ) ) {\n// $dependencies[] = [\n// 'type' => 'error',\n// 'message' => $this->name . ' ' . __( 'requires ACF PRO plugin activated', 'goapostas' )\n// ];\n// }\n\n /**\n * Depends on ACF plugin active\n */\n if ( false === version_compare( PHP_VERSION, '7.0.0', '>=' ) ) {\n $dependencies[] = [\n 'type' => 'error',\n 'message' => $this->name . ' ' . __( 'requires PHP 7.0.0 or higher. Your PHP version is ' . PHP_VERSION, 'goapostas' )\n ];\n }\n\n if ( ! empty( $dependencies ) ) {\n $this->show_admin_notices( $dependencies );\n\n return false;\n }\n\n return true;\n }", "protected static function check_dependencies_are_the_same ($new_meta, $existing_meta) {\n\t\treturn\n\t\t\t$new_meta['package'] == $existing_meta['package'] &&\n\t\t\t$new_meta['category'] == $existing_meta['category'];\n\t}", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "function existeLetra(/*>>> Completar parámetros <<<*/ ){\n \n /*>>> Completar cuerpo de la función <<<*/\n\n}", "public function do_not_blame_cdi() {\r\n $this->IDIOT = TRUE;\r\n $this->error( \"No sanity checking on files\", 0 );\r\n return;\r\n }", "protected function loadDependency($bundle, &$result)\n {\n $am = $this->getAssetManager();\n foreach ($bundle->depends as $name) {\n if (!isset($result[$name])) {\n $dependencyBundle = $am->getBundle($name);\n $result[$name] = false;\n $this->loadDependency($dependencyBundle, $result);\n $result[$name] = $dependencyBundle;\n } elseif ($result[$name] === false) {\n throw new Exception(\"A circular dependency is detected for bundle '{$name}': \".$this->composeCircularDependencyTrace($name, $result).'.');\n }\n }\n }", "public function dependencies() {\n\t\tif ($customPath = $this->params['custom']) {\n\t\t\t$this->_paths = [$customPath];\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = [CakePlugin::path($this->params['plugin'])];\n\t\t} else {\n\t\t\t$this->_paths = [APP];\n\t\t}\n\n\t\t$this->_findFiles('php');\n\t\tforeach ($this->_files as $file) {\n\t\t\t$this->out(sprintf('Updating %s...', $file), 1, Shell::VERBOSE);\n\n\t\t\t$this->_correctFile($file);\n\n\t\t\t$this->out(sprintf('Done updating %s', $file), 1, Shell::VERBOSE);\n\t\t}\n\t}", "function avoid_duplicate_version($link, $data, $app_id, $app_version_id, $hash) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"SELECT\" // Colorize: green\n . \" hash\" // Colorize: green\n . \" FROM \" . DB_TABLE_APP_VERSIONS // Colorize: green\n . \" WHERE app_id = '\" . $link->real_escape_string($app_id) . \"'\" // Colorize: green\n . \" AND completed = '1'\" // Colorize: green\n . \" ORDER BY version DESC\" // Colorize: green\n . \" LIMIT 1\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n if ($result->num_rows == 1) // Colorize: green\n { // Colorize: green\n $version_hash = $result->fetch_row()[0]; // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n if ($version_hash == $hash) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"DELETE FROM \" . DB_TABLE_APP_FILES // Colorize: green\n . \" WHERE app_version_id = '\" . $link->real_escape_string($app_version_id) . \"'\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"DELETE FROM \" . DB_TABLE_APP_VERSIONS // Colorize: green\n . \" WHERE id = '\" . $link->real_escape_string($app_version_id) . \"'\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return false; // Colorize: green\n } // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return true; // Colorize: green\n }", "public function creer_arbre_dependance_from_FullConf() {\n\t\t$dependance = array ();\n\t\tforeach ( $this->getArbreMoniteurs () as $liste_moniteurs_machine ) {\n\t\t\tforeach ( $liste_moniteurs_machine as $moniteur ) {\n\t\t\t\tif (isset ( $moniteur [\"entitySnapshot_properties\"] [\"_ownerID\"] )) {\n\t\t\t\t\t$dependance [$moniteur [\"entitySnapshot_properties\"] [\"_ownerID\"] . \" \" . $moniteur [\"entitySnapshot_properties\"] [\"_id\"]] = $moniteur [\"entitySnapshot_properties\"] [\"_name\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->setDependance ( $dependance );\n\t\t\n\t\treturn $this->onDebug ( $this->getDependance (), 2 );\n\t}", "protected function setWarningsExist() {}", "function _compatibility_monitor__hash( $dependency_name, $dependency_hash, $dependent_name, $tested_dependency_hash ) {\n\t\tif ( $dependency_hash !== $tested_dependency_hash )\n\t\t\ttrigger_error( $dependency_name . ' ' . ' has not been tested with ' . $dependent_name . ' (' . $dependency_hash . ' => ' . $tested_dependency_hash . ').' );\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'MShopAddTypeDataDefault' );\n\t}", "public function mergeUnique() {}", "public function preInstall()\n {\n }", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "private function getExistProductRecount() {\n return false;\n }", "public function __addRequire($v)\n{\n\tif(!in_array($v,$this->__extrafiles)) $this->__extrafiles[] = $v;\n}", "function distribuir(){\r\n\t\t$fPesq = new fachada_pesquisador();\r\n\t\t$fAtend = new fachada_atendimento();\r\n\t\t$fSelecao = new fachada_selecao();\r\n\t\t$fOferta = new fachada_oferta();\r\n\t\t$fMax = new fachada_maxbolsa();\r\n\t\t$ano = $_SESSION['sAno'];\r\n\t\t$tpSelecao = $_SESSION['sEdital'];\r\n\t\t// retorna um vetor com as bolsas ofertadas em um edital em determinado ano. (cod,codTipoEdital,codTipoBolsa,ano,prioridade,qtd)\r\n\t\t$vetOfertaBolsas = $fOferta->getOfertasAnoEdital($ano,$tpSelecao);\r\n\t\t$ofertaBolsasGeral = array();\r\n\t\t$qtdOfertaBolsasCapital = 0;\r\n\t\t$qtdOfertaBolsasAF = 0;\r\n\t\t$qtdOfertaBolsasInterior = 0;\r\n\t\t$qtdOfertaBolsasPIBITI = 0;\r\n\t\t\r\n\t\tfor($i=0;$i<count($vetOfertaBolsas);$i++){\r\n\t\t\t// Soma as quantidades de bolsas ofertadas do 1 - CNPq, 2 - UFPA e 3- FAPESPA e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 1) OR ($vetOfertaBolsas[$i]->getPrioridade() == 2) OR ($vetOfertaBolsas[$i]->getPrioridade() == 3) ){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Capital\r\n\t\t\t\t$qtdOfertaBolsasCapital += $vetOfertaBolsas[$i]->getQtd();\r\n\t\t\t}\r\n\t\t\t// Soma as quantidades de bolsas ofertadas do 4 - CNPq AF e 5 - UFPA AF e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 4) OR ($vetOfertaBolsas[$i]->getPrioridade() == 5) ){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital AF\r\n\t\t\t\t$qtdOfertaBolsasAF += $vetOfertaBolsas[$i]->getQtd();\t\t\r\n\t\t\t}\r\n\t\t\t// Soma a quantidade de bolsas ofertadas do 6 - Interior e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 6)){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Interior\r\n\t\t\t\t$qtdOfertaBolsasInterior += $vetOfertaBolsas[$i]->getQtd();\t\r\n\t\t\t\t}\r\n\t\t\t// Soma a quantidade de bolsas ofertadas do 7 - PIBITI e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 7)){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Interior\r\n\t\t\t\t$qtdOfertaBolsasPIBITI += $vetOfertaBolsas[$i]->getQtd();\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t} //Fim do FOR\r\n\t\t\r\n\t\t// retorna um vetor com a quantidade m�xima que um pesquisador pode receber de acordo com a pontua��o m�nima. (cod,ponto,qtd,tpselecao,ano)\r\n\t\t$vetMax = $fMax->getMaxbolsaSelecao(); \r\n\r\n\t\t$oferta\t = 0;\r\n\t\t$vetAtend = array();\r\n\t\tif($vetMax and $vetOfertaBolsas ){\r\n\t\t\t$maxqtd = $vetMax[0]->getQtd();\r\n\t\t\tfor($i=0;$i<count($vetOfertaBolsas);$i++){\r\n\t\t\t\t$oferta \t= $oferta + $vetOfertaBolsas[$i]->getQtd(); //Soma das quantidades de bolsas ofertadas em um edital\r\n\t\t\t}\r\n\t\t\t$fSelecao->zeraNumBolsaAtend(); //zera o numero de bolsas atendidas,caso esteja redistribuindo\r\n\t\t\t$fAtend->deletaTodosAt();\t\t //deleta os atendimentos,caso esteja redistribuindo\r\n\t\t\tif($tpSelecao==1){\t\t//problema: considera q os pedidos s�o menores q o disponivel\r\n\t\t\t\t$vetProd = $fPesq->getClassificadosProd(); // retorna os pesquisadores de produtividade inscritos e ativos(nome,id,numBolsa,numBolsaAtend,unidade)\r\n\t\t\t\t\r\n\t\t\t\twhile($l = array_shift($vetProd )){ \r\n\t\t\t\t\t// Retorna um vetor com o(s) tipo(s) de bolsas e quantidade solicitadas pelo pesquisador: tipoConjBolsasSolic,qtdBolsaTipoSolic\r\n\t\t\t\t\t$vTipoBolsasSolicitadas = $fSelecao->getTipoBolsasSolicitadasAno($l[id]);\r\n\t\t\t\t\t$max = $maxqtd; // quantidade m�xima que um pesquisador poder� receber\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($l[numBolsa]>$max){ // se o n�mero de bolsas solicitadas for maior que o n�mero m�ximo de bolsas permitido a um pesquisador\r\n\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($max,$l[id]); // seta no banco de dados o numero de bolsas atendidas igual ao n�mero m�ximo de bolsas permitidas\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// Caso o pesquisador tenha solicitado um tipo de bolsa\r\n\t\t\t\t\t\t\tif (count($vTipoBolsasSolicitadas)==1){\r\n\t\t\t\t\t\t\t\t$vEditalBolsaSolicitada = array_shift($vTipoBolsasSolicitadas);\r\n\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile ($flagProximaBolsa==1){\r\n\t\t\t\t\t\t\t\t\tswitch($vEditalBolsaSolicitada[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\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// Verifica se o n�mero de bolsas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa],$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim cnpq\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\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\tif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>=$l[numBolsa]){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\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\tif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>=$l[numBolsa]){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital if($qtdOfertaBolsasCapital >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\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// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim CNPq AF\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\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// Verifica se o n�mero de bolas UFPA AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim CNPq AF\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF if($qtdOfertaBolsasAF >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\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// Verifica se o n�mero de bolas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim Interior\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital INTERIOR if($qtdOfertaBolsasINTERIOR >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\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// Verifica se o n�mero de bolsas PIBITI CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim PIBITI\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI if($qtdOfertaBolsasPIBITI >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t} //Fim while ($flagProximaBolsa=1)\t\r\n\t\t\t\t\t\t\t}// Fim count($vTipoBolsasSolicitadas)==1)\r\n\t\t\t\t\t\t\telseif (count($vTipoBolsasSolicitadas)==2){\r\n\t\t\t\t\t\t\t\t$qtdBolsasSolic = 1;\r\n\t\t\t\t\t\t\t\t// Caso o pesquisador j� tenha recebido alguma bolsa durante a distribui��o atual de bolsas\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile($bolsaSolic = array_shift($vTipoBolsasSolicitadas)){\r\n\t\t\t\t\t\t\t\t\tswitch($bolsaSolic[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq af\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa af\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t}// while\r\n\t\t\t\t\t\t\t} // elseif (count($vTipoBolsasSolicitadas)==2)\r\n\t\t\t\t\t\t} // Fim do else ($l[numBolsa]>$max)\r\n\t\t\t\t}//FIM DO WHILE DE ARRAY DE PESQUISADORES DE PRODUTIVIDADE\r\n\t\t\t}// fim do if $tpSelecao==1\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$vetPesqPontos = $fPesq->getClassificadosPonto(); //retorna a rela��o de pesquisadores por ordem de pontua��o.\r\n\t\t\t\r\n\t\t\t// INICIO DA ORDENA��O DO VETOR DE PONTUA��O\r\n\t\t\t\r\n\t\t\tforeach($vetPesqPontos as &$vetor){\r\n \t\t\t$anoNota = $_SESSION['sAno']-1;\r\n\t\t\t\t\r\n\t\t\t\tif ($this->getSelecaoNotaPesq($vetor[id],$anoNota)){\r\n\t\t\t\t\t$notaPesquisador = $this->getSelecaoNotaPesq($vetor[id],$anoNota);\r\n\t\t\t\t}\r\n\t\t\t\telse $notaPesquisador = 0;\r\n\t\t\t\t$vetor[ponto] = $vetor[ponto] + ($notaPesquisador*0.025*$vetor[ponto]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ($vetPesqPontos as $chave => $linha) { \r\n\t\t\t\t$nome[$chave] = $linha['nome']; \r\n\t\t\t\t$id[$chave] = $linha['id']; \r\n\t\t\t\t$numBolsa[$chave] = $linha['numBolsa']; \r\n\t\t\t\t$unidade[$chave] = $linha['unidade']; \r\n\t\t\t\t$ponto[$chave] = $linha['ponto']; \r\n\t\t\t} \r\n\r\n\t\t\tarray_multisort($ponto, SORT_DESC, $nome, SORT_ASC, $vetPesqPontos);\r\n\t\t\t// FIM DA ORDENA��O DO VETOR DE PONTUA��O\r\n\r\n\t\t\t//foreach ($vetPesqPontos as $vetor) { \r\n\t\t\t//\techo \"O nome do pesquisadador (ID: \".$vetor[id].\") � \".$vetor[nome].\", sua pontua��o � \".$vetor[ponto].\"<br>\";\r\n\t\t\t//}\r\n\r\n\t\t\twhile($l = array_shift($vetPesqPontos)){\r\n\t\t\t\t$valorAtendido = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//verifica se ainda h� bolsa para distribuir\r\n\t\t\t\tif (($qtdOfertaBolsasCapital > 0) || ($qtdOfertaBolsasAF > 0) || ($qtdOfertaBolsasInterior > 0) || ($qtdOfertaBolsasPIBITI > 0)){\r\n\t\r\n\t\t\t\t\t$vBolsasAtivasPesq = $this->getBolsaAtivaPesqAno($l[id],2014); //verifica se determinado pesquisador possui bolsa em vigor\r\n\t\t\t\t\tif($vBolsasAtivasPesq){\r\n\t\t\t\t\t\t$numbolAtivas = count($vBolsasAtivasPesq); // quantidade de bolsas ativas de um pesquisador\r\n\t\t\t\t\t} else $numbolAtivas = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$ponto = $l[ponto]; // pontua��o do pesquisador\r\n\t\t\t\t\t$maxBolsaPorPontuacao = 0;\r\n\t\t\t\t\t// verfica a quantidade m�xima que o pesquisador poder� receber comparando as pontua��es m�nima e m�xima. \r\n\t\t\t\t\t//Por exemplo, pontua��o > 300 pontos -> $max=2; pontua��o > 0 pontos -> $max=1;\r\n\t\t\t\t\tfor ($i=0;$i<count($vetMax);$i++){\r\n\t\t\t\t\t\tif($ponto >= $vetMax[$i]->getPonto()){\r\n\t\t\t\t\t\t\t$maxBolsaPorPontuacao = $vetMax[$i]->getQtd();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Caso a soma da quantidade m�xima de bolsas permitidas com o n�mero de bolsas ativas de um pesquisador exceda 2\r\n\t\t\t\t\t$BolsasPesqPodeReceber = $maxBolsaPorPontuacao;\r\n\t\t\t\t\twhile(($BolsasPesqPodeReceber+$numbolAtivas)>2){\r\n\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Quantidade de bolsas que o pesquisador pode receber\t\t\t\t\r\n\t\t\t\t\tif($BolsasPesqPodeReceber>$l[numBolsa]){\r\n\t\t\t\t\t\t$BolsasPesqPodeReceber = $l[numBolsa];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Retorna um vetor com o(s) tipo(s) de bolsas e quantidade solicitadas pelo pesquisador: tipoSubEdital,qtdBolsa\r\n\t\t\t\t\t$vTipoBolsasSolicitadas = $fSelecao->getTipoBolsasSolicitadasAno($l[id]);\r\n\r\n\t\t\t\t\t\t// Caso o pesquisador tenha solicitado um tipo de bolsa\r\n\t\t\t\t\t\t\tif (count($vTipoBolsasSolicitadas)==1){\r\n\t\t\t\t\t\t\t\t$vEditalBolsaSolicitada = array_shift($vTipoBolsasSolicitadas);\r\n\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile ($flagProximaBolsa==1){\r\n\r\n\t\t\t\t\t\t\t\t\tswitch($vEditalBolsaSolicitada[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber,$l[id]);\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim cnpq\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim fapespa\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} // fim subedital Capital if($qtdOfertaBolsasCapital >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim CNPq AF\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim UFPA AF\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF if($qtdOfertaBolsasAF >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas Interior suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim Interior\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior if($qtdOfertaBolsasInterior >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas PIBITI\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas PIBITI suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 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} // Fim PIBITI\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI if($qtdOfertaBolsasPIBITI >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t} //Fim while ($flagProximaBolsa=1)\t\r\n\t\t\t\t\t\t\t}// Fim count($vTipoBolsasSolicitadas)==1)\r\n\t\t\t\t\t\t\telseif (count($vTipoBolsasSolicitadas)==2){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$qtdBolsasSolic = 1;\r\n\t\t\t\t\t\t\t\t// Caso o pesquisador j� tenha recebido alguma bolsa durante a distribui��o atual de bolsas\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile($bolsaSolic = array_shift($vTipoBolsasSolicitadas)){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tswitch($bolsaSolic[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\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// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq af\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa af\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas PIBITI\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t}// while\r\n\t\t\t\t\t\t\t} // elseif (count($vTipoBolsasSolicitadas)==2)\r\n\t\t\t\t}//if (($qtdOfertaBolsasCapital) OR ($qtdOfertaBolsasAF) OR ($qtdOfertaBolsasInterior))\r\n\t\t\t}//fim while naum producao\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} //fim if($vetMax and $vetOfertaBolsas )\r\n\t}", "function spr_section_exclude_install() {\n// note: TINYINT(1) DEFAULT 0 = BOOLEAN DEFAULT FALSE\nglobal $spr_exclude_db_debug;\n\n\tif (spr_section_exclude_installed())\n\t\treturn TRUE;\n\telse {\n\t\tcreate_article_position();\n\t\treturn safe_query(\"ALTER TABLE \".safe_pfx(\"txp_section\").\" ADD spr_exclude TINYINT(1) DEFAULT 0 NOT NULL;\",$spr_exclude_db_debug);\n\t}\n}", "public function getDependencies(){ return array(); }", "public function hasForce(){\n return $this->_has(2);\n }", "function ingresar_distribucion($iddoc, $datos, $iddistribucion = 0)\n{\n /*\n * $iddoc = iddocumento de la tabla documento\n * $datos\n * ['origen'] ---> iddependencia_cargo ó iddatos_ejecutor\n * ['tipo_origen'] ---> 1,funcionario; 2,ejecutor\n * ['destino']\t ---> iddependencia_cargo ó dependencia#, ó iddatos_ejecutor\n * ['tipo_destino'] ---> 1,funcionario;2,ejecutor\n * ['estado_distribucion'] ---> 0,Pediente; 1,Por Distribuir; 2,En distribucion; 3,Finalizado\n * ['estado_recogida'] ---> 0, No; 1, Si\n * $iddistribucion = si se desea ingresar la distribucion que una llave especifica, se usa para migrar viejas distribuciones a la nueva distribucion\n */\n\n //--------------------------------------------------------\n //OBTENER RUTA_ORIGEN\n $idft_ruta_distribucion_origen = 0;\n if ($datos['tipo_origen'] == 1) {\n $idft_ruta_distribucion_origen = obtener_ruta_distribucion($datos['origen']);\n }\n //OBTENER MENSAJERO_RUTA_ORIGEN\n $iddependencia_cargo_mensajero_origen = 0;\n if ($idft_ruta_distribucion_origen) {\n $iddependencia_cargo_mensajero_origen = obtener_mensajero_ruta_distribucion($idft_ruta_distribucion_origen);\n }\n\n //---------------------------------------------------------------\n //ESTADO RECOGIDA\n $estado_recogida = 0;\n //Si el origen es externo es decir iddatos_ejecutor\n if ($datos['tipo_origen'] == 2) {\n $estado_recogida = 1;\n }\n\n //Si no se requiere recogida se almacena 1 para simular que ya fue realizada\n if (@$datos['estado_recogida']) {\n $estado_recogida = 1;\n }\n\n //ESTADO_DISTRIBUCION\n $estado_distribucion = 0;\n if (@$datos['estado_distribucion']) {\n $estado_distribucion = $datos['estado_distribucion'];\n }\n\n //--------------------------------------------------------\n //ORGANIZAR DESTINOS DEPENDENCIA - ROLES\n $destinos = array();\n $es_dependencia = 0;\n if ($datos['destino'][(strlen($datos['destino']) - 1)] == '#') {\n $es_dependencia = 1;\n }\n if ($es_dependencia) {\n $destinos = obtener_funcionarios_dependencia_destino($datos['destino']);\n } else {\n $destinos[] = $datos['destino'];\n }\n\n $distribuciones = array();\n\n for ($j = 0; $j < count($destinos); $j++) {\n\n //NUMERO DE DISTRIBUCION\n $numero_distribucion = obtener_numero_distribucion($iddoc);\n\n //OBTENER RUTA_DESTINO\n $idft_ruta_distribucion_destino = 0;\n if ($datos['tipo_destino'] == 1) {\n $idft_ruta_distribucion_destino = obtener_ruta_distribucion($destinos[$j]);\n }\n //OBTENER MENSAJERO_RUTA_DESTINO\n $iddependencia_cargo_mensajero_destino = 0;\n if ($idft_ruta_distribucion_destino) {\n $iddependencia_cargo_mensajero_destino = obtener_mensajero_ruta_distribucion($idft_ruta_distribucion_destino);\n }\n\n $Documento = new Documento($iddoc);\n\n $camposDistribucion = [\n 'origen' => $datos['origen'],\n 'tipo_origen' => $datos['tipo_origen'],\n 'ruta_origen' => $idft_ruta_distribucion_origen,\n 'mensajero_origen' => $iddependencia_cargo_mensajero_origen,\n 'destino' => $destinos[$j],\n 'tipo_destino' => $datos['tipo_destino'],\n 'ruta_destino' => $idft_ruta_distribucion_destino,\n 'mensajero_destino' => $iddependencia_cargo_mensajero_destino,\n 'numero_distribucion' => $numero_distribucion,\n 'estado_distribucion' => $estado_distribucion,\n 'estado_recogida' => $estado_recogida,\n 'documento_iddocumento' => $iddoc,\n 'fecha_creacion' => date('Y-m-d H:i:s'),\n 'sede_origen' => $Documento->ventanilla_radicacion,\n 'sede_destino' => $Documento->ventanilla_radicacion,\n ];\n\n if ($iddistribucion) {\n $camposDistribucion = array_merge($camposDistribucion, [\"iddistribucion\" => $iddistribucion]);\n }\n $nuevaDistribucion = Distribucion::newRecord($camposDistribucion);\n $distribuciones[] = $nuevaDistribucion;\n }\n return $distribuciones;\n}", "function moduleCompleteClientInstallation() {\n\tsetDefaultOverrideOptions();\n\t\n\tsetBuildUpdateConfigFlag($_POST['SERIALNO'], 'yes', 'build');\n}", "protected function _fcpoMarkOrderAsProblematic() {\n $this->_blOrderHasProblems = true;\n }", "public function deleteAllDependents() {\n\t\t$this->dependents = array();\n\t}", "public function hasDependent()\n {\n return (1 == $this->_hasDependent);\n }" ]
[ "0.6003426", "0.59442866", "0.58935016", "0.5843761", "0.5751475", "0.57499796", "0.56985253", "0.56855065", "0.5621191", "0.56106", "0.5591915", "0.55451703", "0.5499492", "0.54337764", "0.54262614", "0.5422188", "0.54003894", "0.53665113", "0.5336218", "0.53199375", "0.53174204", "0.5251192", "0.52227825", "0.52107507", "0.52030927", "0.5187273", "0.5176579", "0.5164096", "0.5145528", "0.51406765", "0.5131931", "0.51101965", "0.5094241", "0.50840485", "0.5073129", "0.50711095", "0.5068371", "0.5055287", "0.50240165", "0.500378", "0.49989545", "0.4989073", "0.49763945", "0.49635082", "0.4941986", "0.49419528", "0.49379504", "0.49378884", "0.4923447", "0.49062917", "0.48971766", "0.48950636", "0.48937118", "0.48929563", "0.48851186", "0.4882986", "0.48804495", "0.4877209", "0.4875719", "0.486905", "0.4865659", "0.4864731", "0.48641285", "0.48639446", "0.4860379", "0.48571858", "0.48542717", "0.4852157", "0.48521078", "0.48394826", "0.48360744", "0.48339158", "0.48339158", "0.4832772", "0.48319364", "0.48303574", "0.48231277", "0.48199126", "0.48125452", "0.48113528", "0.4811025", "0.4810408", "0.47935745", "0.47919086", "0.4788591", "0.4786368", "0.4784529", "0.4780656", "0.4774265", "0.47713888", "0.47692418", "0.47647226", "0.47598225", "0.47593075", "0.47528616", "0.47432786", "0.47411573", "0.473689", "0.473628", "0.4731751" ]
0.5491811
13
/ Query a time server (C) 19990929, Ralf D. Kloth (QRQ.software)
function query_time_server($timeserver, $socket) { $fp = fsockopen($timeserver, $socket, $err, $errstr, 5); # parameters: server, socket, error code, error text, timeout if ($fp) { fputs($fp, "\n"); $timevalue = fread($fp, 49); fclose($fp); # close the connection } else { $timevalue = " "; } $ret = []; $ret[] = $timevalue; $ret[] = $err; # error code $ret[] = $errstr; # error text return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveServerTime(){\n //http://www.thetvdb.com/api/Updates.php?type=none\n\t \n\t if(!$this->t_mirrors){\n\t\t$this->retrieveMirrors;\n\t }\n\t \n $url = $this->t_mirrors[0].'/api/Updates.php?type=none';\n \n //$xmlStr=$this->curl_get_file_contents($url);\n\t $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $xmlStr = curl_exec($c);\n curl_close($c);\n \n $xmlServerTime = new SimpleXMLElement($xmlStr);\n return $xmlServerTime->Time;\n }", "public function getServerHour(){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT DATE_FORMAT(NOW(), '%k:%i:%s') AS hora\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch()[0]; //respuesta\n\t}", "function serverTime() {\n\t\tdate_default_timezone_set('Europe/Oslo');\n\t\treturn \"Server time is: \".date(\"H:i:s\");\n\t}", "public function setServerTime();", "function timequery() {\n static $querytime_begin;\n list($usec, $sec) = explode(' ', microtime());\n\n if (!isset($querytime_begin)) {\n $querytime_begin = ((float) $usec + (float) $sec);\n } else {\n $querytime = (((float) $usec + (float) $sec)) - $querytime_begin;\n echo sprintf('<br />La consulta tardó %01.5f segundos.- <br />', $querytime);\n }\n}", "public function getQuery($time);", "public function servertime() {\n\t\tif(is_null($this->sync))\n\t\t\t$this->synchronize();\n\t\treturn (int) (microtime(true) * 1000) + $this->sync;\n\t}", "public function time($number = '')\n\t{\n\t\tif (empty($number) || $number == \"?\")\n\t\t{\n\t\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" time ?\");\n\t\t}\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" time \".((string) $number));\n\t}", "public function query_trading_clock(){\n\t\t$response = $this->execute($this->query_clock_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in connecting to server\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "function getRecordTime() {\n\treturn db_query(\"SELECT recordtime FROM RecordTime\");\n}", "public function updateNewTimeClient() {\n\t\treturn $this->Db->query(\"UPDATE `yp_sessions` \n\t\t\tSET `last_time` = {$this->Request->time} \n\t\t\tWHERE `hash` = '{$this->_thisClientHash()}'\");\n\t}", "function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}", "function GetLocationTimeFromServer($intLocationID, $servertime,$path){\n\n\t$jsonurl = API.$path.\"/api/getlocationtime_daylightsaving.php?intLocationID=\".$intLocationID.\"&server_time=\".urlencode($servertime);\n\t$json = @file_get_contents($jsonurl,0,null,null); \n\t$datetimenow= json_decode($json);\n\t$datetimenowk1 = $datetimenow->servertolocation_datetime; \n\t$ldatetitme = date('Y-m-d H:i:s',strtotime($datetimenowk1));\n\treturn $ldatetitme;\n}", "function get_remote_time($location, $switch){\n//get_remote_time use a remote database (from http://twiki.org) to provide remote local time; the database is up to date.\n//to use this service without buying an api is necessary to trick the file get operation by identify as Mozilla; curl will do this trick... ;-) \n\n//format: \tget_remote_time(\"Region/City\", switch);\n//examples:\n//\t\t\tget_remote_time(\"Europe/Bucharest\", 5);\n//\t\t\tget_remote_time(\"Europe/London\", 4);\n//\t\t\tget_remote_time(\"America/Toronto\", 7);\n\n//switches:\n//\t\t\t0 return current remote location day in week (ex: Sun for Sunday)\n//\t\t\t1 return current remote location day in a month (ex: 27)\n//\t\t\t2 return current remote location month (ex: May)\n//\t\t\t3 return current remote location year (ex: 2012)\n//\t\t\t4 return current remote location time (23:20:12 - HH:MM:SS)\n//\t\t\t5 return current remote location time shift related to GMT(+4:00 for GMT+4:00)\n//\t\t\t6 return current remote location zone abbreviation (ex: EEST stands for EEST – Eastern European Summer Time)\n//\t\t\t7 return remote location unprocessed string (ex: \"Sun, 13 May 2012, 16:57:10 -0400 (EDT)\" for America/Toronto)\n\n\t$link = \"http://twiki.org/cgi-bin/xtra/tzdate?tz=\".$location;\n\t$string = str_between(g_file($link), \"<!--tzdate:date-->\", \"<!--/tzdate:date-->\");\n\tif ($switch < 7) {\n\t $stk = explode(\" \",$string);\n\t $stk[0] = trim($stk[0], ',');\n\t $stk[5] = substr($stk[5],0,3).\":\".substr($stk[5],3);\n\t $stk[6] = trim($stk[6], '(,)');\n\treturn $stk[$switch];\n\t}\n\treturn $string;\n}", "public function getServerTime(Classes\\GetServerTimeRequest $arg) {\n\t\treturn $this->makeSoapCall(\"getServerTime\", $arg);\n\t}", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "public function getQueryTime()\n {\n return $this->query_time;\n }", "public function time() {\n return $this->returnCommand(['TIME'], null, null, ResponseParser::PARSE_TIME);\n }", "function getSimilarTime($obj, $socket_id, $channel_id, $_DATA)\n {\n $dp=$this->dp;\n \n $start = $_DATA['start'];\n $stop = $_DATA['stop'];\n $isin = $_DATA['isin'];\n $fdate = $_DATA['fdate'];\n\n\t$q=\"SELECT OASIS_TIME\"\n \t\t\t.\t\" FROM imk_IT WHERE TRADE_DATE='$fdate' AND SECURITY_ISIN='$isin' AND OASIS_TIME >= \\\"$start\\\" ORDER BY ORDER_ID,OASIS_TIME LIMIT 0,1\" ;\n\n\t$dp->setQuery($q);\n\t$js_start=$dp->loadResult();\n\tif ($dp->getErrorNum()){\n \t$obj->write($socket_id, $channel_id, $dp->stderr());\n\t\treturn;\n\t\t}\n\t\n\t$q=\"SELECT OASIS_TIME\"\n \t\t\t.\t\" FROM imk_IT WHERE TRADE_DATE='$fdate' AND SECURITY_ISIN='$isin' AND OASIS_TIME >= \\\"$stop\\\" ORDER BY ORDER_ID,OASIS_TIME LIMIT 0,1\" ;\n \t\n\t$dp->setQuery($q);\n\t$js_stop=$dp->loadResult();\n\tif ($dp->getErrorNum()){\n \t$obj->write($socket_id, $channel_id, $dp->stderr());\t\t\n\t\treturn;\n\t\t}\n\t\t\t\n $script .= \"custom_start='\".$js_start.\"';\";\n $script .= \"custom_end='\".$js_stop.\"';\";\n \n $obj->write($socket_id, $channel_id, $script);\n }", "function timnsx($ten)\r\n\t{\r\n\t\t$arr = array(\":T\"=> $ten);\r\n\t\t$sql =\"select * from SANPHAM where nsx like :T \";\r\n\t\t\r\n\t\treturn $this->query($sql, $arr);\t\r\n\t}", "function getFechaServer() {\n\t\t$fecha_actual=date('Y').'-'.date('m').'-'.date('d');\n\t\t$hora_actual=date('H').':'.date('i').':'.date('s');\n\n\t\tprint $fecha_actual.'|'.$hora_actual;\n\t}", "function mysqlTime()\r\n {\r\n $hour = $this->addZero( $this->hour() );\r\n $minute = $this->addZero( $this->minute() );\r\n $second = $this->addZero( $this->second() );\r\n\r\n return $hour . \":\" . $minute . \":\" . $second;\r\n }", "public function getQueryTime()\n {\n return $this->queryTime;\n }", "public function getQueryTime()\n {\n return $this->queryTime;\n }", "public function getServerTimestamp();", "function Sytem_Time(){\r\n\r\n// system date and time\r\n\t\t\t$query1=\"Select NOW();\";\r\n\t\t\t$result = mysql_query($query1) or die (mysql_error());\r\n\t\t\t$num1 = mysql_num_rows($result);\r\n\t\t\t\r\n\t\t\tfor($i=0; $i<$num1; $i++) {\r\n\t\t\r\n\t\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t\t$datePosted = $row[$i];\r\n\t\t\t}\r\n\t\t\t// end system date\r\n\treturn $datePosted;\r\n}", "public function return_queryDateTimeStamp(){\n\n //$ts = date(\"Y-m-d H:i:s\", time());\n\n return date(\"Y-m-d H:i:s\", time());\n\n }", "function query_info($ip=NULL) {\r\n\tif (!$ip) $ip = $this->ipaddr();\r\n\tif (!$ip) return FALSE;\r\n\t$start = $this->_getmicrotime();\r\n\t$res = $this->_sendquery($ip, 'getstatus');\r\n\t$end = $this->_getmicrotime();\r\n\tif (!$res) return FALSE;\r\n\t$this->data = array();\t\t\t\t\t// query_info always resets the data array (so call this before other queries)\r\n\t$code = '';\r\n\tif ($this->raw != '') {\r\n\t\t$this->data['ping'] = ceil(($end - $start) * 1000);\t// return the time (ms) it took for the packet to return (ping)\r\n\t\t$this->data['ipport'] = $ip;\r\n\t\tlist($this->data['ip'], $this->data['port']) = explode(':', $this->data['ipport']);\r\n\r\n\t\t$this->raw = substr($this->raw, 18);\t\t// strip off response header bytes\r\n\t\t$code = $this->_getchar();\t\t\t// get EOT character: 0x0A\r\n\t\t$this->_getchar();\t\t\t\t// clear trailing slash \\\r\n\t\t$block = \"\";\r\n\r\n\t\t$pos = strpos($this->raw, $code);\t\t// extract the status block from the raw input (0x0A . . . 0x0A)\r\n\t\t$block = substr($this->raw, 0, $pos);\r\n\t\t$block = str_replace(\"\\\\\", \"\\0\", $block);\t// replace \\ with nulls to make parsing in a loop easier\r\n\t\t$this->raw = substr($this->raw, $pos+1);\t// cut the status block out of our raw buffer\r\n\r\n\t\t$old = $this->raw;\r\n\t\t$this->raw = $block . \"\\0\";\r\n\t\twhile ($this->raw != '') {\r\n\t\t\t$key = $this->_getnullstr();\r\n\t\t\t$value = $this->_getnullstr();\r\n\t\t\t$key = str_replace(' ', '_', $key);\t// do not allow spaces in key names\r\n\t\t\t$this->data[strtolower($key)] = $value;\r\n#\t\t\tif ($key{0} == '.') {\t\t\t// some keys have a leading dot. record a 2nd key w/o the dot.\r\n#\t\t\t\t$key = substr($key, 1);\r\n#\t\t\t\t$this->data[strtolower($key)] = $value;\r\n#\t\t\t}\r\n\r\n\t\t\tif ($key == 'sv_maxclients') $this->data['maxplayers'] = $value;\r\n\t\t\tif ($key == 'sv_hostname') $this->data['name'] = $value;\r\n\t\t}\r\n\t\t$this->raw = $old;\r\n\t\t// gather player information ...\r\n\t\tif ($this->raw != '') {\r\n\t\t\t$this->raw = substr($this->raw, 0, -1);\t\t// ignore trailing newline (0x0A)\r\n\t\t\t$plrs = explode(chr(0x0A), $this->raw);\r\n\t\t\t$this->raw = '';\r\n\t\t\t$this->data['players'] = array();\r\n\t\t\tforeach ($plrs as $p) {\r\n\t\t\t\tlist($kills, $ping, $name) = explode(\" \", $p, 3);\r\n\t\t\t\t$this->data['players'][] = array(\r\n\t\t\t\t\t'name'\t=> substr($name, 1, -1),\t// ignore surrounding quotes\r\n\t\t\t\t\t'kills' => $kills,\r\n\t\t\t\t\t'ping'\t=> $ping\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->data;\r\n\t}\r\n\treturn FALSE;\r\n}", "public function getQueryTime()\n {\n return $this->result->getQueryTime();\n }", "public function getAnswerTime();", "public function time()\n {\n return $this->client->publicRequest('GET', '/api/v3/time');\n }", "function query_info()\r\n\t\t{\r\n\t\t\techo \"<u>Your Previous Query Consisted of:</u><br>\";\r\n\t\t\techo \"SQL = '\".$this->last_query[\"sql\"].\"'<br>\";\r\n\t\t\t$temp = ($this->last_query[\"end_time\"] - $this->last_query[\"start_time\"]);\r\n\t\t\t$temp *= 1000;\r\n\t\t\t$temp = number_format($temp, 3);\r\n\t\t\techo \"Time Elapsed: \".$temp.\"(ms)<br>\";\r\n\t\t\techo \"Number of Records: \".$this->numrows.\"<br>\";\r\n\t\t\techo \"Number of Rows Affected: \".$this->affected_rows;\r\n\t\t}", "function DBQueryDateTimeSlice($o_cassandra,$imei,$dateminute1,$dateminute2)\r\n{\r\n/* same hour */\t\r\nif (substr($dateminute1,0,13) == substr($dateminute2,0,13))\r\n{\r\n$date = substr($dateminute1,0,10);\r\n$HH = substr($dateminute1,11,2);\r\n$MM1 = substr($dateminute1,14,2);\r\n$MM2= substr($dateminute2,14,2);\r\n//echo \"date = $date\\n hh = $HH\\n mm1 = $MM1 \\n mm2 = $MM2\\n\";\r\n$s_cql = \"SELECT * FROM full_data\r\nwhere\r\nimeih = '$imei@$date@$HH'\r\nand\r\ndtime >= '$date $HH:$MM1:00'\r\nand\r\ndtime < '$date $HH:$MM2:00'\r\n;\";\r\n$st_results = $o_cassandra->query($s_cql);// Launch the query\r\nreturn $st_results;\r\n}\r\n/* same day */\r\nelseif (substr($dateminute1,0,10) == substr($dateminute2,0,10))\r\n{\r\n$date = substr($dateminute1,0,10);\r\n$HH1 = substr($dateminute1,11,2);\r\n$HH2 = substr($dateminute2,11,2);\r\n$MM1 = substr($dateminute1,14,2);\r\n$MM2 = substr($dateminute2,14,2);\r\n//echo \"date = $date\\n hh1 = $HH1\\n hh2 = $HH2\\n mm1 = $MM1 \\n mm2 = $MM2\\n\";\r\n$s_cql1 = \"SELECT * FROM full_data\r\nwhere\r\nimeih = '$imei@$date@$HH1'\r\nand\r\ndtime >= '$date $HH1:$MM1:00'\r\nand\r\ndtime <= '$date $HH1:59:59'\r\n;\";\r\n$st_results1 = $o_cassandra->query($s_cql1);// Launch the query\r\n$st_results = $st_results1;\r\n//echo \"done 1\\n\";\r\nif ($HH2 - $HH1 > 1)\r\n{\r\n$imeih_list = \"(\";\r\nfor($i=$HH1+1;$i<$HH2;$i++)\r\n{\r\n$hour = ($i < 10)?'0'.$i:$i;\r\n$imeih_list .= \"'\".$imei.'@'.$date.'@'.$hour.\"',\";\r\n}\r\n$imeih_list = substr($imeih_list,0,-1) . \")\";\r\n//echo \"imeih_list = $imeih_list\\n\";\r\n$s_cql2 = \"SELECT * FROM full_data\r\nwhere\r\nimeih IN $imeih_list\r\n;\";\r\n$st_results2 = $o_cassandra->query($s_cql2);// Launch the query\r\n$st_results = array_merge($st_results, $st_results2);\r\n//echo \"done 2\\n\";\r\n}\r\n$s_cql3 = \"SELECT * FROM full_data\r\nwhere\r\nimeih = '$imei@$date@$HH2'\r\nand\r\ndtime >= '$date $HH2:00:00'\r\nand\r\ndtime <= '$date $HH2:$MM2:59'\r\n;\";\r\n$st_results3 = $o_cassandra->query($s_cql3);// Launch the query\r\n$st_results = array_merge($st_results, $st_results3);\r\nreturn $st_results;\r\n}\r\n/* same month */\r\nelseif (substr($dateminute1,0,7) == substr($dateminute2,0,7))\r\n{\r\n$date = substr($dateminute1,0,10);\r\n$HH1 = substr($dateminute1,11,2);\r\n$HH2 = substr($dateminute2,11,2);\r\n$MM1 = substr($dateminute1,14,2);\r\n$MM2 = substr($dateminute2,14,2);\r\n//echo \"date = $date\\n hh1 = $HH1\\n hh2 = $HH2\\n mm1 = $MM1 \\n mm2 = $MM2\\n\";\r\n$s_cql1 = \"SELECT * FROM full_data\r\nwhere\r\nimeih = '$imei@$date@$HH1'\r\nand\r\ndtime >= '$date $HH1:$MM1:00'\r\nand\r\ndtime <= '$date $HH1:59:59'\r\n;\";\r\n$st_results1 = $o_cassandra->query($s_cql1);// Launch the query\r\n$st_results = $st_results1;\r\n//echo \"done 1\\n\";\r\n}\r\n}", "function query_time_function($user_key,$search_query,$mysqli)\n{\n\t//$mysqli->query($query)or die($mysqli->error.__LINE__);;//_LINE current code row numbers\n\t$query=\"SELECT * FROM query_record \n\t\t\tWHERE user_id ='$user_key' AND query='$search_query' \n\t\t\tORDER BY `query_record`.`time` DESC \n\t\t\tLIMIT 0 , 1\";\n\t$result = $mysqli->query($query);\n\t$row1=$result->fetch_array();\n\t//echo $row1['time'].\"使用者時間\\n\";\n\treturn $row1['time'];\n}", "function fetchUserTime () {\n\t\t$this->conf['currTime'] = time(); // Current time for several Items like month, week, day and list\n\t\t$y = (!empty($this->piVars['year']) AND is_numeric($this->piVars['year']) ) ? $this->piVars['year']:strftime('%Y', $this->conf['currTime']);\n\t\t$m = (!empty($this->piVars['month']) AND is_numeric($this->piVars['month']) ) ? $this->piVars['month']:strftime('%m', $this->conf['currTime']);\n\t\t$d = (!empty($this->piVars['day']) AND is_numeric($this->piVars['day']) ) ? $this->piVars['day']:strftime('%d', $this->conf['currTime']);\n\t\t$this->conf['currTime'] = strtotime( $y.'-'.$m.'-'.$d);\n\t\treturn;\n\t}", "function time_now() {\n return date(\"H:i:s\");\n}", "function getServerInfo();", "function ping($host, $port, $timeout) {\r\n $tB = microtime(true);\r\n $fP = fSockOpen($host, $port, $errno, $errstr, $timeout);\r\n if (!$fP) { return \"down\"; }\r\n $tA = microtime(true);\r\n return round((($tA - $tB) * 1000), 0).\" ms\";\r\n}", "function logintimelist1($time1,$time2)\r\n\t{\r\n\t\tif($time1==0 or $time2==0)\r\n\t\t{\r\n\t\t\t$q=array();\r\n\t\t}else{\r\n\t\t\t$time1=strtotime($time1.\" 00:00:00\");\r\n\t\t\t$time2=strtotime($time2.\" 23:59:59\");\r\n\t\t\t$q=array(\r\n\t\t\t\t\"downtime\"=>array('$gt'=>$time1,'$lt'=>$time2),\r\n\t\t\t\t);\r\n\t\t}\r\n//\t\tprint_r( $q);\r\n\t\t$user_online_count=$this->phpmongo->find(\"user_info\",$q,array(\"downtime\"=>1));\r\n\t\t$tmp=array();\r\n\t\tforeach($user_online_count as $value)\r\n\t\t{\r\n\t\t\t$t=date(\"Y-m-d\",$value[\"downtime\"]);\r\n\t\t\tif(isset($tmp[$t])==false)$tmp[$t]=0;\r\n\t\t\t$tmp[$t]+=1;\r\n\t\t}\r\n//\t\tprint_r($tmp);\r\n\t\treturn $tmp;\r\n\t}", "public function uptime() : int;", "function mysql_time($tiempo = 'now'){\r\n return date( 'H:i:s',strtotime($tiempo) );\r\n}", "function getsystime() {\n\n return date('Y-m-d H:i:s');\n\n}", "function updateTime($abrv){\n\t$time = time();\n\t$sql = \"UPDATE updated set $abrv='$time' where ID='0'\";\n db_query($sql, \"update the time record\");\n}", "function PiG()\n\t{\n\t\tif(isset($_GET[\"maintainTime\"]))\n\t\t{\n\t\t\t$this->maintainTime = $_GET[\"maintainTime\"];\n\t\t}\n\t\t$this->time = time();\n\t\t\n\t\t$this->Poll();\n\t}", "public function processTime()\n {\n $timeCalculator = new Time(self::$_query);\n $data = $timeCalculator->processQuery();\n\n return $data;\n }", "public static function times( $time ){\n\t\t$txt = date(\"H:i:s\") . \" Remote IP: [\".$_SERVER['REMOTE_ADDR'] . \"]:\\t[\" . \" time: \" . round( ( $time ), 3).\"s ]\\t\\tRequserURI: \".$_SERVER['REQUEST_URI'];\n\t\tself::_doWrite( self::getFileName( self::TMP_DIR . date('Y-m-d_') . self::FILE_TIMES ), $txt );\n\t}", "function cSsql_get_report_times_gala($gala, $since_time)\r\n{\r\n global $sqlconf;\r\n \r\n $gala = mysql_escape_string($gala);\r\n $query = \"SELECT id, sys, pos, moon, time\r\n FROM `\".$sqlconf['report_table'].\"`\r\n WHERE (`gala` = '$gala' AND `time` >= $since_time)\r\n ORDER BY sys ASC, pos ASC, moon ASC, time DESC\";\r\n $sql = mysql_query($query);\r\n \r\n $result = false;\r\n if (!cSsql_write_error($sql))\r\n {\r\n $result = Array();\r\n while ($report = mysql_fetch_array($sql, MYSQL_ASSOC)) \r\n {\r\n $info['time'] = $report['time'];\r\n $info['id'] = $report['id'];\r\n \r\n $result[$report['sys']]\r\n [$report['pos']][$report['moon']][] = $info;\r\n }\r\n }\r\n return $result;\r\n}", "function QuerySchedule($query, $connection, $in){\n\t$result = mysqli_query($connection, $query) or die(mysqli_error($connection));\n\twhile($row = mysqli_fetch_array($result)){\n\t\t$output = $row[$in];\n\t}\n\treturn $output;\n}", "public function display_option_server_min_seconds() {\n $min_seconds = $this->options['server_min_seconds'];\n $this->display_input_text_field('server_min_seconds', $min_seconds);\n?>\nThe number of seconds that must pass since the previous request to clear the cache before the next one is accepted.\n<?php\n }", "public function timeHi();", "function setMySQLTime( $value )\r\n {\r\n if ( preg_match( \"/([0-9]{2}):([0-9]{2}):([0-9]{2})/\", $value, $valueArray ) )\r\n {\r\n $this->setSecondsElapsedHMS( $valueArray[1], $valueArray[2], $valueArray[3] );\r\n }\r\n else\r\n {\r\n print( \"<b>Error:</b> eZTime::setMySQLTime() received wrong MySQL time format.\" );\r\n }\r\n }", "public function getSvrTime()\n {\n return $this->get(self::_SVR_TIME);\n }", "public function requestTime($int=null)\n {\n if (!is_null($int)) {\n $this->_array[\"request_time\"] = (int) $int;\n }\n\n return $this->_array[\"request_time\"];\n }", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "function query() {}", "private function time($float = false)\r\n {\r\n return $float ? Input::server('REQUEST_TIME_FLOAT') : Input::server('REQUEST_TIME');\r\n }", "public function displaynow()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" displaynow ? ?\");\n\t}", "function get_time($date, $method='h:i A')\n {\n if ($this->offset_set == 0)\n {\n \t// Save redoing this code for each call, only do once per page load\n \t\n\t\t\t$this->offset = $this->get_time_offset();\n\t\t\t\n\t\t\t$this->offset_set = 1;\n }\n \n return gmdate($method, ($date + $this->offset) );\n }", "function query($query_string)\n\t{\n\t\t$starttime = $starttime = explode(' ', microtime());\n\t\t$starttime = $starttime[1] + $starttime[0];\t\n\t\t\n\t\t$result = mysql_query($query_string, $this->conn) or $this->error(mysql_error(), __LINE__, __FILE__, $query_string);\n\t\t\n\t\t$endtime = explode(' ',microtime());\n\t\t$endtime = $endtime[1] + $endtime[0];\n\t\t$totaltime = $endtime - $starttime;\n\t\t\n\t\t$this->runtimes += $totaltime;\n\t\t$this->queries++;\n\t\t$this->query_debug .= round($totaltime, 5).': '.$query_string.'<br>';\n\t\t\n\t\treturn $result;\n\t}", "public function timeMid();", "public function get_starttime()\n {\n }", "function Time($time){\r\n\r\n\t}", "function iamhere(){\nglobal $XUSER, $SERVER, $ROOMS;\nDoQuery(\"DELETE FROM $SERVER[TBL_PREFIX]online WHERE username='$XUSER[NAME]'\");\ncleanOnline();\nDoQuery(\"INSERT INTO $SERVER[TBL_PREFIX]online VALUES('0','$XUSER[NAME]','$XUSER[IP]','$ROOMS[IN_ROOM_NAME]','$SERVER[CURRENT_TIME]')\");\n$time = time();\nif($ROOMS['TIME'] != 0){\nDoQuery(\"UPDATE $SERVER[TBL_PREFIX]rooms SET time='$time' WHERE name='$ROOMS[IN_ROOM_NAME]'\");\n}\nif($XUSER['TIME'] != 0){\nDoQuery(\"UPDATE $SERVER[TBL_PREFIX]users SET time='$time' WHERE username='$XUSER[NAME]'\");\n}\ncleanusers();\n}", "public function aim_onlinetime()\r\n\t{\r\n\t\t$s = time() - $this->core->user['timer'];\r\n\t\t$d = intval($s / 86400);\r\n\t\t$s -= $d * 86400;\r\n\t\t$h = intval($s / 3600);\r\n\t\t$s -= $h * 3600;\r\n\t\t$m = intval($s / 60);\r\n\t\t$s -= $m * 60;\r\n\t\treturn array('days' => $d, 'hours' => $h, 'mins' => $m, 'secs' => $s);\r\n\t}", "function Sql_DB_Info_Set_Time($table)\n {\n //We need it here!\n if (empty($table)) { $table=$this->SqlTableName($table); }\n $query=$this->Sql_DB_Info_Set_Time_Query($table);\n \n $result=$this->DB_Query($query);\n \n return $this->MyMod_Data_Files_MTime();\n }", "public function getEndpoint(): string\n {\n return 'game_time';\n }", "public function time()\n {\n return $this->_requestTime;\n }", "public function actionGetTime()\n {\n $post = \\Yii::$app->request->post('dataq');\n\n // header('Content-type: application/json');\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n $item['res'] = $post['id'].' - It is ok!';\n $res = print_r($item, true);\n echo json_encode($res);\n }", "public function getTimes(){\n\t\t$tbl=$this->session->userdata('prefix').'flighttime';\n\t\t// get the db tables list\n\t\t$tableList=getTables(); // define in custom helper\n\t\t// check if the tbl exist in db \n\t\tif(in_array($tbl, $tableList)){\n\t\t// get the flight times from db\n\t\t\t$times=$this->Common_model->select($tbl);\n\t\t\t//$time= $times[0]->flight_time;\n\t\t\t/*echo date('m/d', $time);\n\t\t\techo $time;\n\t\t\techo date('Y-m-d h:m', strtotime($time));*/\n\t\t\tif($times){\n\t\t\t\techo 'OK::Flight times fetched::success::'.json_encode($times);\n\t\t\t} else {\n\t\t\t\techo 'OK::No Record::error';\n\t\t\t}// end of else\n\t\t} // end of if\n\t}", "public function time()\n {\n $query = \"CALL time();\";\n $result = $this->db->query($query);\n if ($result->num_rows() > 0)\n return $result->result_array();\n else\n return false;\n }", "function get_last_available_with_time($time){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$limit=1&$order=:id%20DESC&time=' . $time );\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n if(isset(json_decode($result)[0]))\r\n return json_decode($result)[0];\r\n else return NULL;\r\n}", "function getHtmlTime(){\r\n\treturn('P&aacute;gina generada en <b>'.(time() - $_SERVER['REQUEST_TIME']) .'</b> segundos');\r\n}", "public function getTime();", "public function getTime();", "function timer()\n {\n return hrtime(true);\n }", "public function lookuptime() {\n return $this->info['namelookup_time'];\n }", "public function timeCheck(&$online, &$deviceinfo)\n {\n $db = new db_mssql($GLOBALS['db_host'], $GLOBALS['db_dbms'], $GLOBALS['db_user'], $GLOBALS['db_pass']);\n $uid = $_SESSION['uid'];\n $pass = $_SESSION['pass'];\n $sql = \"select user_id from sys_user where user_id = $uid and login_pass = '$pass' and valid = 1\";\n $user_data = $db->query($sql);\n if (empty($user_data)) {\n session_unset();\n return;\n }\n\n $changed = false;\n if (($online['last_stamp'] + 5) <= time()) {\n $online['last_stamp'] = time();\n $offline_timeout = $GLOBALS['GLOBAL_DEVICE_OFFLINE_TIMEOUT']; // ADD BY TOUYARA z.device_no z.device_sim d.device_sim z.install_time itime,\n $sql = \"select z.device_no d_no,z.device_sim d_sim,z.install_time in_time, z.group_id gid, z.group_name gtxt, z.protocol_id pid, z.object_id n, ds.gps_time t, ds.rcv_time ts,\n\t\t\t\t\tcase when datediff(ss,ds.rcv_time,getdate()) < $offline_timeout then 1\n\t\t\t\t\twhen z.online = 1 then 1\n\t\t\t\t\telse 0 end [on], z.object_kind i, z.object_flag c,\n\t\t\t\t\tisnull(ds.lng, 0) x, isnull(ds.lat, 0) y, isnull(ds.angle, 0) d,\n\t\t\t\t\tcase when datediff(ss, z.ex, getdate()) > 0 then -1\n\t\t\t\t\twhen ds.gps_time is null then 0\n\t\t\t\t\twhen ds.rcv_time is null then 0\n\t\t\t\t\telse round(ds.speed/1,0)\n\t\t\t\t\tend s, isnull(ds.valid, 0) v,z.dtype_id dt, isnull(ds.sta_table,'') e, isnull(ds.sta_table,'') st, isnull(ds.ios_table, '') q,isnull(ds.ios_table, '') io,\n\t\t\t\t\tcount(a.alarm_time) a, isnull(dr.job_number,'') jb, isnull(dr.driver_name,'') dn ,z.ex\n\t\t\t\t\t--s.mil_maintenance_enable mile,s.mil_maintenance_value milv,s.mil_maintenance_name miln,s.mil_maintenance_last mill,\n\t\t\t\t\t--s.eng_maintenance_enable enge,s.eng_maintenance_value engv,s.eng_maintenance_name engn,s.eng_maintenance_last engl,\n\t\t\t\t\t--s.day_maintenance_enable daye,s.day_maintenance_value dayv,s.day_maintenance_name dayn,s.day_maintenance_last dayl\n\t\t\t\tfrom (\n\t\t\t\t\tselect d.device_no,d.device_sim,d.install_time, o.object_id, d.dtype_id, o.group_id, g.group_name, t.protocol_id,\n\t\t\t\t\td.online, d.last_stamp ex, o.object_kind, o.object_flag, o.userdef_flag, o.time_zone, t.can_alarm\n\t\t\t\t\tfrom cfg_device d, cfg_object o, cfg_group g, sys_device_type t\n\t\t\t\t\twhere d.object_id = o.object_id and o.group_id = g.group_id\n\t\t\t\t\t\tand d.dtype_id = t.dtype_id\n\t\t\t\t) z\n\t\t\t\tleft join cfg_device_state ds on ds.device_no = z.device_no\n\t\t\t\tleft join dat_alarm a on z.can_alarm = 1 and z.device_no = a.device_no\n\t\t\t\t\tand a.alarm_time between dateadd(hour, -1, getdate()) and getdate()\n\t\t\t\t\tand a.finish_time is null\n\t\t\t\tleft join dat_rfid_last rl on ds.device_no = rl.device_no\n\t\t\t\tleft join cfg_driver dr on rl.rfid = dr.rfid\n\t\t\t\tleft join cfg_services s on z.object_id = s.object_id\n\t\t\t\tgroup by z.group_id, z.group_name, z.protocol_id, z.object_id,\n\t\t\t\t\tz.online, z.object_kind, z.object_flag, z.ex,z.dtype_id,\n\t\t\t\t\tds.gps_time, ds.rcv_time, ds.lng, ds.lat, ds.angle, ds.speed, ds.valid, ds.sta_table, ds.ios_table, dr.job_number, dr.driver_name, z.device_no,z.device_sim,z.install_time\n\t\t\t\t\t--s.mil_maintenance_enable,s.mil_maintenance_value,s.mil_maintenance_name,s.mil_maintenance_last,\n\t\t\t\t\t--s.eng_maintenance_enable,s.eng_maintenance_value,s.eng_maintenance_name,s.eng_maintenance_last,\n\t\t\t\t\t--s.day_maintenance_enable,s.day_maintenance_value,s.day_maintenance_name,s.day_maintenance_last\n\t\t\t\torder by gtxt, c\";\n $data = $db->query($sql);\n if (!empty($data)) {\n $deviceinfo = array();\n foreach ($data as $row) {\n if ($row != null) {\n $objid = trim($row['n']);\n //Expired\n if ($row['s'] < 0) {\n $row['x'] = 0;\n $row['y'] = 0;\n $row['on'] = 0;\n $row['v'] = 0;\n $row['e'] = '';\n $row['q'] = '';\n $row['a'] = 0;\n }\n $deviceinfo[$objid] = $row;\n }\n }\n $changed = true;\n }\n }\n return $changed;\n }", "function get_schedule($usrid){\r\n\t\r\n}", "public function query($query, $time = 0)\n\t{\n\t\t$this->queries[] = compact('query', 'time');\n\t}", "function proxy_set($host,$status,$timex=0){\n\tglobal $DB_proxypool;\n\t$time_current=date('Y-m-d H:i:s');\n\t$sql=\"update proxypool set status='$status',timex='$timex' ,updatetime='$time_current' where host='$host'\";\n\t//echo $sql.\"\\n\";\n\t$DB_proxypool->query($sql);\n\n}", "public function GetSystemTime() {\r\n return $this->_client->doGetSystemTime(\r\n self::COUNTRY_CODE, $this->_config['allegro_key']\r\n );\r\n }", "function getTitle($network, $time){\n global $con;\n try {\n $sql = \"SELECT * FROM `titles` WHERE network = :network AND time = :time\";\n $sql = $con->prepare($sql);\n $time = convertTime($time);\n $time = $time . \":00\";\n $sql->bindParam(\":time\", $time);\n $sql->bindParam(\":network\", $network);\n $sql->execute();\n return $sql->fetchAll();\n } catch (PDOException $e) {\n echo $e;\n }\n}", "function devlyQueries() {\n\t\n\techo 'ran ' . get_num_queries() . ' queries in ' . timer_stop(1) . ' seconds';\n\t\n}", "public static function getCurrentDateAndTime() {\n\t\tif(qsys::getSiteLocation() == 'online') {\n\t\t\t$currentDateTimeOnServer = qdat::getCurrentDateAndTimeOnCurrentComputer();\n\t\t\t$currentAbsoluteSeconds = qdat::getAbsoluteSeconds($currentDateTimeOnServer);\n\t\t\t$adjustedCurrentAbsoluteSeconds = $currentAbsoluteSeconds + (Config::getServerOffsetInHours() * -1 * 3600);\n\t\t\treturn qdat::convertAbsoluteSecondsToDateTime($adjustedCurrentAbsoluteSeconds);\n\t\t} else {\n\t\t\treturn qdat::getCurrentDateAndTimeOnCurrentComputer();\n\t\t}\n\t}", "private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }", "protected function get_time() {\n// Format is ddhhmmZ where dd = day, hh = hours, mm = minutes in UTC time.\n if (preg_match('#^([0-9]{2})([0-9]{2})([0-9]{2})Z$#',$this->current_group_text,$pieces)) {\n\n// date_default_timezone_set('UTC');\n $month_start = date('m',$this->timestamp);\n $year_start = date('Y',$this->timestamp);\n\n $hour = $pieces[2];\n $minute = $pieces[3];\n $day = $pieces[1];\n\n $this->wxInfo['ITEMS'][$this->tend]['CODE_TIME'] = $this->current_group_text;\n// $this->wxInfo['ITEMS'][$this->tend]['DATE_DAY'] = $pieces[1];\n// $this->wxInfo['ITEMS'][$this->tend]['DATE_TIME'] = $pieces[2].':'.$pieces[3];\n\n $this->wxInfo['ITEMS'][$this->tend]['DATE_TIMESTAMP'] = mktime( $hour, $minute, 0, $month_start, $day, $year_start);\n\n $this->current_ptr++;\n }\n $this->current_group++;\n }", "function time()\n{\n return \\Genesis\\SQLExtension\\Tests\\Context\\SQLHandlerTest::TYPE_STRING_TIME;\n}", "function getTimer(){\r\n global $pdo;\r\n\t\t$select = $pdo->prepare(\"SELECT * FROM manage_timers\");\r\n\t\tif(!($res = $select->execute())){\r\n\t\t\t$this->setError($select);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$time_config = array();\r\n\t\twhile($row = $select->fetch(PDO::FETCH_ASSOC)){\r\n\t\t\t$time_config[$row['urgency']] = $row;\r\n\t\t}\r\n\t\treturn $time_config;\r\n\t}", "function interact($socket)\n{\n\t$rec = \"\";\n\tsocket_recv($socket, $rec, 2048, 0);\n\t$parts = split(',',$rec);\n\t$cnx = mysql_connect('bigperl.cqhgvggnarsv.us-east-2.rds.amazonaws.com', 'root', 'bigperlroot');\n\t/*\n\tArray\n\t(\n\t [0] => 0908242216\n\t [1] => 0033663282263\n\t [2] => GPRMC\n\t [3] => 212442.000\n\t [4] => A\n\t [5] => 4849.0475\n\t [6] => N\n\t [7] => 00219.4763\n\t [8] => E\n\t [9] => 2.29\n\t [10] =>\n\t [11] => 220809\n\t [12] =>\n\t [13] =>\n\t [14] => A*70\n\t [15] => L\n\t [16] => imei:359587017313647\n\t [17] => 101Q\n\t [18] =>\n\n\t)\n\t*/\n\n\n\t$trackerdate \t\t\t= mysql_real_escape_string($parts[0]);\n\t$phone \t\t\t\t= mysql_real_escape_string($parts[1]);\n\t$gprmc \t\t\t\t= mysql_real_escape_string($parts[2]);\n\t$satelliteDerivedTime \t\t= mysql_real_escape_string($parts[3]);\n\t$satelliteFixStatus \t\t= mysql_real_escape_string($parts[4]);\n\t$latitudeDecimalDegrees \t= mysql_real_escape_string($parts[5]);\n\t$latitudeHemisphere \t\t= mysql_real_escape_string($parts[6]);\n\t$longitudeDecimalDegrees \t= mysql_real_escape_string($parts[7]);\n\t$longitudeHemisphere \t\t= mysql_real_escape_string($parts[8]);\n\t$speed \t\t\t\t= mysql_real_escape_string($parts[9]);\n\t$bearing \t\t\t= mysql_real_escape_string($parts[10]);\n\t$utcDate \t\t\t= mysql_real_escape_string($parts[11]);\n\t// = $parts[12];\n\t// = $parts[13];\n\t$checksum \t\t\t= mysql_real_escape_string($parts[14]);\n\t$gpsSignalIndicator \t\t= mysql_real_escape_string($parts[15]);\n\tif(ereg(\"imei\",$parts[16]))\n\t{\n\t\t$imei \t\t\t\t= mysql_real_escape_string($parts[16]);\n\t\t$other \t\t\t\t= mysql_real_escape_string($parts[17].' '.$parts[18]);\n\t}\n\telse\n\t{\n\t\t$imei \t\t\t\t= mysql_real_escape_string($parts[17]);\n\t\t$other \t\t\t\t= mysql_real_escape_string($parts[18].' '.$parts[19]);\n\t}\n\t\n\t$imei = substr($imei,5);\n\n\tmysql_select_db('bigperldb', $cnx);\n\tif($gpsSignalIndicator != 'L')\n\t\tmysql_query(\"INSERT INTO gprmc (date, imei, phone, trackerdate, satelliteDerivedTime, satelliteFixStatus, latitudeDecimalDegrees, latitudeHemisphere, longitudeDecimalDegrees, longitudeHemisphere, speed, Bearing, utcDate, Checksum, gpsSignalIndicator, other) VALUES (now(), '$imei', '$phone', '$trackerdate', '$satelliteDerivedTime', '$satelliteFixStatus', '$latitudeDecimalDegrees', '$latitudeHemisphere', '$longitudeDecimalDegrees', '$longitudeHemisphere', '$speed', '$bearing', '$utcDate', '$checksum', '$gpsSignalIndicator', '$other')\", $cnx);\n\tmysql_close($cnx);\n}", "public function getStartTime();", "public function getStartTime();", "public function getStartTime();", "public function getStartTime();", "protected static function _time()\n\t{\n\t\treturn time();\n\t}", "function getRemoteFileModifyTime($uri,$timeout=null)\n\t{\n\t $uri = parse_url($uri);\n\t $handle = @fsockopen($uri['host'],80);\n\t if (!is_null($timeout)) stream_set_timeout($handle,$timeout);\n\t if(!$handle)\n\t\t return 0;\n\t fputs($handle,\"GET $uri[path] HTTP/1.1\\r\\nHost: $uri[host]\\r\\n\\r\\n\");\n\t $result = 0;\n\t while(!feof($handle))\n\t {\n\t\t $line = fgets($handle,1024);\n\t\t if(!trim($line))\n\t\t break;\n\t\t $col = strpos($line,':');\n\t\t if($col !== false)\n\t\t {\n\t\t $header = trim(substr($line,0,$col));\n\t\t $value = trim(substr($line,$col+1));\n\t\t if(strtolower($header) == 'last-modified')\n\t\t {\n\t\t $result = strtotime($value);\n\t\t break;\n\t\t }\n\t\t }\n\t }\n\t fclose($handle);\n\t return $result;\n\t}" ]
[ "0.6596131", "0.64093447", "0.6295277", "0.62776715", "0.62247115", "0.6191721", "0.60731685", "0.5970149", "0.5952864", "0.5924523", "0.5846608", "0.58172303", "0.5806068", "0.5734254", "0.5654907", "0.5619656", "0.5562991", "0.5517565", "0.55126476", "0.5507908", "0.5472556", "0.54536813", "0.54518056", "0.54518056", "0.5447174", "0.5445296", "0.5428423", "0.54206157", "0.5406099", "0.5399998", "0.5392069", "0.5364867", "0.5343341", "0.5319876", "0.53184736", "0.5316896", "0.5312806", "0.5309522", "0.53078914", "0.5261965", "0.52604693", "0.5256471", "0.52305156", "0.5225463", "0.522494", "0.52242297", "0.52111626", "0.5204351", "0.5181761", "0.51727724", "0.5169736", "0.5165943", "0.5143404", "0.5131264", "0.5131264", "0.5131264", "0.5131264", "0.5131264", "0.5131264", "0.51174515", "0.51129544", "0.5109039", "0.5097012", "0.50945675", "0.5093355", "0.50930315", "0.5087039", "0.5083546", "0.50794953", "0.50756514", "0.50711685", "0.50685024", "0.50651324", "0.5061803", "0.5059568", "0.5048801", "0.5041542", "0.5041448", "0.5041448", "0.50355875", "0.50286746", "0.5024032", "0.5019351", "0.5014014", "0.50102973", "0.5007824", "0.5006972", "0.50019807", "0.49971792", "0.49966484", "0.49937373", "0.49928334", "0.4989021", "0.49877957", "0.49817392", "0.49817392", "0.49817392", "0.49817392", "0.49747106", "0.4970134" ]
0.7619637
0
If we didn't receive the command NTP ...
function doNTP($text = null) { if (strtolower($this->input) != "ntp") { $this->ntp_message = $this->ntp_response; $this->response = $this->ntp_response; return; } // "None" agent command received. if ($this->agent_input == null) { $token_thing = new Tokenlimiter($this->thing, "ntp"); $dev_overide = null; if ( $token_thing->thing_report["token"] == "ntp" or $dev_overide == true ) { // From example $timeserver = "ntp.pads.ufrj.br"; // Dev neither of these two are working. $timeserver = "time.nrc.ca"; $timeserver = "time.chu.nrc.ca"; // This is an older protocol version. $timeserver = "time4.nrc.ca"; $timercvd = $this->query_time_server($timeserver, 37); $this->time_zone = "America/Vancouver"; //if no error from query_time_server if (!$timercvd[1]) { $timevalue = bin2hex($timercvd[0]); $timevalue = abs( HexDec("7fffffff") - HexDec($timevalue) - HexDec("7fffffff") ); $tmestamp = $timevalue - 2208988800; # convert to UNIX epoch time stamp $epoch = $tmestamp; // $datum = date("Y-m-d H:i:s",$tmestamp - date("Z",$tmestamp)); /* incl time zone offset */ // $d = date("Y-m-d H:i:s",$tmestamp - date("Z",$tmestamp)); /* incl time zone offset */ //$datum = $dt = new \DateTime($tmestamp, new \DateTimeZone("UTC")); $datum = new \DateTime("@$epoch", new \DateTimeZone("UTC")); //$datum->setTimezone($tz); // $dt = new \DateTime($prediction['date'], new \DateTimeZone("UTC")); $datum->setTimezone(new \DateTimeZone($this->time_zone)); $m = "Time check from time server " . $timeserver . ". "; $m = "In the timezone " . $this->time_zone . ", it is " . $datum->format("l") . " " . $datum->format("d/m/Y, H:i:s") . ". "; } else { $m = "Unfortunately, the time server $timeserver could not be reached at this time. "; $m .= "$timercvd[1] $timercvd[2].\n"; } $this->response = $m; // Bear goes back to sleep. $this->bear_message = $this->response; } } else { $this->bear_message = $this->agent_input; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_cntdwn_msg()\n{\n $current = new DateTime();\n $current->Sub(new Dateinterval(\"PT1H\"));\n\t$sqldate = $current->format(\"Y-m-d H:i:s\");\n $ipAddress = false;\n $stopparam = new TempPredictionStopParam($this->connector);\n $stopparam->build_id = $this->stopBuild->build_id;\n $send_count = 0;\n\n\n // Get IP to send message to - either last GPRS address in last hour or hard coded UDP receiver\n if ( $this->display_type == \"B\" )\n {\n $gprsStatus = new UnitStatus($this->connector);\n $gprsStatus->build_id = $this->stopBuild->build_id;\n $status = $gprsStatus->load(false, \" and message_time > '$sqldate'\");\n $status = $gprsStatus->load();\n if ( $status )\n {\n $ipAddress = $gprsStatus->ip_address;\n $connectTime = $gprsStatus->message_time;\n }\n }\n else\n {\n $stopparam->param_desc = \"ipAddress\";\n $status = $stopparam->load();\n if ( $status )\n {\n $ipAddress = $stopparam->ipAddress;\n $connectTime = $current->format(\"Y-m-d H:i:s\");\n }\n }\n\n if ( !$ipAddress )\n {\n $this->text .= \" - no current ip address for \".$this->stopBuild->build_code.\"\\n\";\n\t return false;\n }\n\n // Dont send if ip address has been assigned to unit more recently\n\tif ( $this->display_type == \"B\" ) \n {\n $gprsStatusDup = new UnitStatus($this->connector);\n $gprsStatusDup->ip_address = $ipAddress;\n $status = $gprsStatusDup->count(array(\"ip_address\"), \" and build_id != \".$this->stopBuild->build_id.\" AND message_time > '\".$connectTime.\"'\");\n //echo \" build_id != \".$this->stopBuild->build_id.\" AND message_time > '\".$connectTime.\"'\\n\";\n if ( $gprsStatusDup->selectCount > 0 )\n {\n $this->text .= \" sedncntdown: \".$this->stopBuild->build_code.\" ip $ipAddress / $connectTime is in use by another unit\";\n return false;\n }\n }\n\n\t$delivery = new PredictionDelivery($this->connector);\n\t$delivery->messageType = 0;\n\t$delivery->addressId = $this->stopBuild->build_code;\n\t$delivery->serviceCode = $this->service_code;\n\t$delivery->bay_no = $this->bay_no;\n\n\t$l_vehicle_code = $this->vehicle->vehicle_code;\n\t$l_build_code = $this->vehicleBuild->build_code;\n\t$l_build_id = $this->vehicleBuild->build_id;\n\n \n\n // Send unitId of 0 if ( $this is an autoroute\n\t// || $if ( $this is a CONT && $the vehicle is already expected at the stop for a REAL route.\n if ( $l_vehicle_code == \"AUT\" || $this->sch_rtpi_last_sent == \"P\" ) \n\t\t\t$delivery->unitId = 0;\n\telse\n {\n if ( !$this->vehicleBuild->build_code )\n {\n\t\t $this->text .= \"\tsend_cntdwn_msg: Failed to get build_code for vehicle_id \". $this->vehicle->vehice_code;\n\t\t\treturn false;\n }\n\t\telse \n {\n $delivery->unitId = $this->vehicleBuild->build_code;\n\t\t}\n\t}\n\n\t$delivery->journeyId = $this->pub_ttb_id;\n\n if ( $this->predictionParameters->countdown_dep_arr == \"A\" ) \n $time_string = $this->eta_last_sent;\n else\n $time_string = $this->etd_last_sent;\n\n $countdown_time_dt = DateTime::createFromFormat(\"Y-m-d H:i:s\", $time_string);\n\t$delivery->countdownTime = $countdown_time_dt->getTimestamp();\n\n\n $stopparam->param_desc = \"countdownMsgType\";\n\t$countdownType = 470;\n if ( $stopparam->load() && $stopparam->param_value )\n $countdownType = $stopparam->param_value;\n\n $stopparam->param_desc = \"destinationType\";\n\t$destinationColumn = \"dest_short1\";\n if ( $stopparam->load() && $stopparam->param_value )\n {\n if ( $stopparam->param_value == \"DEST50\" )\n $destinationColumn = \"dest_long\";\n }\n\n $destination = new Destination($this->connector);\n $destination->dest_id = $this->dest_id;\n if ( !$destination->load() )\n {\n $this->text .= \" Unable to fetch destination for id $this->dest_id\";\n }\n if ( !$destination->dest_short1 && $destination->dest_long ) $destination->dest_short1 = $destination->dest_long;\n if ( !$destination->dest_short1 && $destination->terminal_text ) $destination->dest_short1 = $destination->terminal_text;\n if ( !$destination->dest_long && $destination->dest_short1 ) $destination->dest_long = $destination->dest_short1;\n \n $destinationText = $destination->$destinationColumn;\n if ( $countdownType == 450 )\n $destinationText = substr($destinationText, 0, 15);\n\n $delivery->cntdwn_msg_ver = $countdownType;\n\n // Get vehicle and operator details\n $delivery->wheelchairAccess = 0;\n $delivery->operatorId = 0;\n if ( $this->vehicle->vehicle_id != 0 && $this->vehicle->vehicle_code != \"AUT\" )\n {\n // We have a rela vehicle tracking the prediction trip, get missing vehicle and operator details\n // so we can get operator loc_prefix - not sure why?\n if ( !$this->vehicle->load() )\n {\n $this->text .= \" Cant load vehicle for prediction\";\n return false;\n }\n\n $operator = new Operator($this->connector);\n $operator->operator_id = $this->vehicle->operator_id;\n if ( !$operator->load() )\n {\n $this->text .= \" Cant load operator for prediction\";\n return false;\n }\n $delivery->wheelchairAccess = $this->vehicle->wheelchair_access;\n $delivery->operatorId = $operator->loc_prefix;\n }\n\n\t// Get whether || $not an acknowledgment is currently required for\n\t// countdown messages.\n //echo \"TODO ackreqd\\n\";\n\t//$l_ack_reqd = $get_ack_reqd(450);\n\n $now = new DateTime();\n $delivery->id = 0;\n $delivery->messageType = $countdownType;\n $delivery->journey_fact_id = $this->journey_fact_id;\n $delivery->sequence = $this->sequencsequence;\n $delivery->send_time = $now->format(\"Y-m-d H:i:s\"); \n $delivery->pred_type = \"C\";\n $delivery->display_mode = $this->predictionParameters->countdown_dep_arr;\n $delivery->rtpi_eta_sent = $this->rtpi_eta_sent;\n $delivery->rtpi_etd_sent = $this->rtpi_etd_sent;\n $delivery->pub_eta_sent = $this->pub_eta_sent;\n $delivery->pub_eta_sent = $this->pub_etd_sent;\n $delivery->prediction = $time_string;\n\n \t$this->setOutboundQueue();\n\n\t$this->text = $this->text. \": >>> \".\n\t\t\t$ipAddress. \" \". \n\t\t\t\t$this->sch_rtpi_last_sent. \" \". \n\t\t\t\t$delivery->serviceCode. \" \". \n\t\t\t\tsubstr($destinationText, 0, 15). \" \".\n\t\t\t\tsubstr($time_string,11,8);\n\n\t//$m_status = $set_c_countdown_message();\n\tif ( true )\n {\n\t\t\tswitch($this->display_type)\n {\n\t\t\t\tcase \"U\" :\n\t\t\t\t\t//$m_status = $message_to_queue(m_external_sys_id,w_ip_address,LENGTH(w_ip_address),0,w_stop_build,l_ack_reqd)\n break;\n \t \tcase \"B\" :\n $junk1 = 0;\n $terminatingZero = 0;\n $send_count++;\n $destlen=strlen($destinationText);\n // I RL T\n if ( $delivery->messageType == 518 )\n {\n $msg = pack(\"A3Sa18SSSSSIA6SIIiCa10A${destlen}I\",\n \"PHP \",\n 3, // message type\n\n $ipAddress, // destination\n 1, // repeats\n $destlen + 48, // message length\n 0, // portNumber\n\n $delivery->messageType,\n $junk1,\n $delivery->addressId,\n substr($delivery->serviceCode, 0, 6),\n $delivery->operatorId,\n $delivery->unitId,\n $delivery->journeyId,\n $delivery->countdownTime,\n $delivery->wheelchairAccess,\n $delivery->bay_no,\n $destinationText,\n $terminatingZero\n );\n }\n else\n $msg = pack(\"A3Sa18SSSSSIA6SIIiCA${destlen}I\",\n \"PHP \",\n 3, // message type\n\n $ipAddress, // destination\n 1, // repeats\n $destlen + 38, // message length\n 0, // portNumber\n\n $delivery->messageType,\n $junk1,\n $delivery->addressId,\n substr($delivery->serviceCode, 0, 6),\n $delivery->operatorId,\n $delivery->unitId,\n $delivery->journeyId,\n $delivery->countdownTime,\n $delivery->wheelchairAccess,\n $destinationText,\n $terminatingZero\n );\necho \" Tid $delivery->bay_no, $delivery->messageType, $delivery->addressId, $delivery->serviceCode, $delivery->operatorId, $delivery->unitId, $delivery->journeyId, $delivery->countdownTime, $delivery->wheelchairAccess, $destinationText\\n\";\n if ( $this->outboundQueue )\n {\n if (!msg_send ($this->outboundQueue, 1, $msg ) )\n {\n $this->text .= \"Failed to send event to route tracker message queue\";\n echo $this->text.\"\\n\";\n }\n }\n\t\t\t}\n\t}\n\n if ( $send_count == 0 ) \n {\n $this->text = $this->text. \" UNSENT OUT OF DATE\";\n }\n\n //echo \"sent $send_count <BR>\";\n\treturn $send_count;\n\n}", "private function detectServerRepair()\n {\n $h = date(\"H\", time());\n if ($h == \"03\") {\n Log::write(\"Server Repair Time,\", 2, \"spider\");\n sleep(3600);\n }\n }", "function etherpadlite_cron () {\n return true;\n}", "private function checkStatus()\n {\n $res = $this->parseBoolean(\n json_encode($this->getStatus()[\"timed_out\"])\n );\n\n if ($this->getStatus() == null)\n $this->setOnline(false);\n else if ($res)\n $this->setOnline(false);\n else\n $this->setOnline(true);\n }", "private function refresh() {\r\n\r\n // try & catch wär zwar besser, funktioniert aber bei fsockopen leider nicht.. deshalb das unschöne @\r\n $this->socket = @fsockopen($this->ts3_host, $this->ts3_query, $errno, $errstr, $this->socket_timeout);\r\n\r\n if ($errno > 0 && $errstr != '') {\r\n $this->errors[] = 'fsockopen connect error: ' . $errno;\r\n return false;\r\n }\r\n\r\n if (!is_resource($this->socket)) {\r\n $this->errors[] = 'socket recource not exists';\r\n return false;\r\n }\r\n\r\n stream_set_timeout($this->socket, $this->socket_timeout);\r\n\r\n if (!empty($this->serverlogin) && !$this->sendCmd('login', $this->serverlogin['login'] . ' ' . $this->serverlogin['password'])) {\r\n $this->errors[] = 'serverlogin as \"' . $this->serverlogin['login'] . '\" failed';\r\n return false;\r\n }\r\n\r\n if (!$this->sendCmd(\"use \" . ( $this->ts3_sid ? \"sid=\" . $this->ts3_sid : \"port=\" . $this->ts3_port ))) {\r\n $this->errors[] = 'server select by ' . ( $this->ts3_sid ? \"ID \" . $this->ts3_sid : \"UDP Port \" . $this->ts3_port ) . ' failed';\r\n return false;\r\n }\r\n\r\n if (!$sinfo = $this->sendCmd('serverinfo')) {\r\n return false;\r\n }\r\n else {\r\n $this->sinfo = $this->splitInfo($sinfo);\r\n $this->sinfo['cachetime'] = time();\r\n\r\n if (substr($this->sinfo['virtualserver_version'], strpos($this->sinfo['virtualserver_version'], 'Build:') + 8, -1) < 11239) { // beta23 build is required\r\n $this->errors[] = 'your TS3Server build is to low..';\r\n return false;\r\n }\r\n }\r\n\r\n if (!$clist = $this->sendCmd('channellist', '-topic -flags -voice -limits')) {\r\n return false;\r\n }\r\n else {\r\n $clist = $this->splitInfo2($clist);\r\n foreach ($clist as $var) {\r\n $this->clist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!$plist = $this->sendCmd('clientlist', '-away -voice -groups')) {\r\n $this->errors[] = 'playerlist not readable';\r\n return false;\r\n }\r\n else {\r\n $plist = $this->splitInfo2($plist);\r\n foreach ($plist as $var) {\r\n if (strpos($var, 'client_type=0') !== FALSE) {\r\n $this->plist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!empty($this->plist)) {\r\n foreach ($this->plist as $key => $var) {\r\n $temp = '';\r\n if (strpos($var['client_servergroups'], ',') !== FALSE) {\r\n $temp = explode(',', $var['client_servergroups']);\r\n }\r\n else {\r\n $temp[0] = $var['client_servergroups'];\r\n }\r\n $t = '0';\r\n foreach ($temp as $t_var) {\r\n if ($t_var == '6') {\r\n $t = '1';\r\n }\r\n }\r\n if ($t == '1') {\r\n $this->plist[$key]['s_admin'] = '1';\r\n }\r\n else {\r\n $this->plist[$key]['s_admin'] = '0';\r\n }\r\n }\r\n\r\n usort($this->plist, array($this, \"cmp2\"));\r\n usort($this->plist, array($this, \"cmp1\"));\r\n }\r\n }\r\n\r\n fputs($this->socket, \"quit\\n\");\r\n\r\n $this->close();\r\n\r\n return true;\r\n }", "function should_send($trip_type)\n{\n\n // --------------------------------------------------------------------\n\t// Is the sign not enabled?\n // --------------------------------------------------------------------\n if ( $this->predictionParameters->disabled == \"X\" ) \n {\n $this->text = $this->text. \"DIS\";\n\t\treturn false;\n }\n\n // --------------------------------------------------------------------\n // Surtronic communications protocol displays (TCP)\n // --------------------------------------------------------------------\n if ( $this->display_type == \"S\" ) \n {\n // Is the Surtronic sign registered && $ready?\n $sql = \n \"SELECT update_status, channel_number\n INTO l_update_status, l_channel\n FROM unit_status_sign\n WHERE build_id = \". $this->predictionParameters->build_id; \n $row = $this->connector->fetch1($sql);\n if ( $this->connector->errorCode != 0 || $row[\"channel_number\"] || $row[\"update_status\"] != \"T\" )\n {\n $this->text = $this->text. \"NOT_REGISTERED\";\n return false;\n }\n }\n\n // --------------------------------------------------------------------\n\t// Is the arrival unsuitable for the delivery mode\n // --------------------------------------------------------------------\n\tif ( $this->predictionParameters->delivery_mode && $this->predictionParameters->delivery_mode != \"RCA\" ) {\n\t\t$l_delivery_code = substr($trip_type, 0, 1);\n\t\tif ( !strstr($this->predictionParameters->delivery_mode, $l_delivery_code) ) {\n $this->text = $this->text. \"DIS\";\n return false;\n\t\t}\n\t}\n\n $currtime = new Datetime();\n $eta_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->eta_last_sent);\n $etd_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->etd_last_sent);\n\n // --------------------------------------------------------------------\n\t// Is arrival time is within echo window || $has passed\n // --------------------------------_------------------------------------\n if ( $this->predictionParameters->countdown_dep_arr == \"A\" ) {\n\t $l_comp_secs = $eta_last_sent->getTimestamp() - $currtime->getTimestamp();\n } else {\n\t $l_comp_secs = $etd_last_sent->getTimestamp() - $currtime->getTimestamp();\n }\n\n //echo \"HC WIN \";\n $this->predictionParameters->display_window = 7200;\n\tif ( $l_comp_secs > $this->predictionParameters->display_window || $l_comp_secs < -60 ) {\n if ( $l_comp_secs < -60 ) \n {\n $this->text = $this->text. \" ASSUME COUNTED_DOWN\";\n $w_display_line = true;\n return false;\n } else {\n if ( $l_comp_secs < -60 ) {\n $w_display_line = false;\n }\n\t\t $this->text = $this->text. \"WIN\". $l_comp_secs . \"/\". $this->predictionParameters->display_window;\n\t\t return false;\n }\n\t}\n\n // --------------------------------------------------------------------\n\t// Has vehicle already arrived/departed, if ( $so clear it down\n // --------------------------------------------------------------------\n if ( \n ( $this->predictionParameters->countdown_dep_arr == \"A\" && $this->arrival_status == \"A\" ) ||\n ( $this->predictionParameters->countdown_dep_arr == \"D\" && $this->departure_status == \"A\" ) \n ) {\n $this->text = $this->text. \" Already there Force Clear\";\n return false;\n }\n\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->build_id = $this->stopBuild->build_id;\n\n // --------------------------------------------------------------------\n\t// Does sign already have enough arrivals\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRS\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MA\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS\";\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// Does sign already have enough arrivals for this destination\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRSPERDEST\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MAD\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS_FOR_RT_DEST\";\n $w_display_line = false;\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// As the bus stop is only able to handle one set of RTPI info \n\t// if ( $this arrival is the second || $more arrival of this vehicle at the\n // sign ) convert it to show published time\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction(\"DUPVEH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n $this->text = $this->text. \" DUPV->P\";\n $this->vehicle->vehicle_code = \"AUT\";\n $this->vehicle->vehicle_id = 0;\n }\n\n\t// ------------------------------------------------------------------------\n // Ensure arrival \n\t// For sequence/autoroute countdowns ensure resent every 5 minutes\n\t// ------------------------------------------------------------------------\n\tif ( $this->time_last_sent ) {\n if ( $this->sch_rtpi_last_sent != $this->initialValues->sch_rtpi_last_sent ) {\n $this->text = $this->text. \" \". $this->initialValues->sch_rtpi_last_sent. \"->\". $this->sch_rtpi_last_sent;\n } else {\n\t if ( $trip_type == \"AUT\" ) {\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 180;\n if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" $l_sincelast_int $l_at_least_every PFRC\";\n } else {\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\t\t $this->text = $this->text. \" AUTlast \". $this->time_last_sent;\n $w_display_line = false;\n return false;\n\t\t }\n } else {\n // --------------------------------------------------------------------\n\t // Does prediction deviate enough from previous prediction\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"HASCHANGEDENOUGH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n // Force every x seconds\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 120;\n if ($this->display_type == \"S\" ) {\n $this->text = $this->text. \" SNO_CHANGE\";;\n return false;;\n } else {\n\t\t if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" FRC\";\n } else {\n $this->text = $this->text. \" NO_CHANGE\";\n return false;\n }\n }\n } else {\n $this->text = $this->text. \" \";\n }\n \n //this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) \n\t\t //$this->text = $this->text. \" RTPlast \", UtilityDateTime::dateExtract($this->time_last_sent, \"hour to second\")\n //return false\n\t }\n }\n\t}\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->build_id = $this->build_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\n\treturn 1;\n}", "protected function Ping()\n\t{\n\t\theader(BITS_HEADER_ACK);\n\t}", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "function is_ok_smtp ($cmd = \"\"){\n\t\tif(empty($cmd))\t\t\t\t{ return false; }\n\t\tif (ereg (\"^220\", $cmd))\t{ return true; }\n\t\tif (ereg (\"^250\", $cmd))\t{ return true; }\n\t\treturn false;\n\t}", "private function onPing()\n {\n $this->send($this->replyEvent());\n }", "function get_remote_time($location, $switch){\n//get_remote_time use a remote database (from http://twiki.org) to provide remote local time; the database is up to date.\n//to use this service without buying an api is necessary to trick the file get operation by identify as Mozilla; curl will do this trick... ;-) \n\n//format: \tget_remote_time(\"Region/City\", switch);\n//examples:\n//\t\t\tget_remote_time(\"Europe/Bucharest\", 5);\n//\t\t\tget_remote_time(\"Europe/London\", 4);\n//\t\t\tget_remote_time(\"America/Toronto\", 7);\n\n//switches:\n//\t\t\t0 return current remote location day in week (ex: Sun for Sunday)\n//\t\t\t1 return current remote location day in a month (ex: 27)\n//\t\t\t2 return current remote location month (ex: May)\n//\t\t\t3 return current remote location year (ex: 2012)\n//\t\t\t4 return current remote location time (23:20:12 - HH:MM:SS)\n//\t\t\t5 return current remote location time shift related to GMT(+4:00 for GMT+4:00)\n//\t\t\t6 return current remote location zone abbreviation (ex: EEST stands for EEST – Eastern European Summer Time)\n//\t\t\t7 return remote location unprocessed string (ex: \"Sun, 13 May 2012, 16:57:10 -0400 (EDT)\" for America/Toronto)\n\n\t$link = \"http://twiki.org/cgi-bin/xtra/tzdate?tz=\".$location;\n\t$string = str_between(g_file($link), \"<!--tzdate:date-->\", \"<!--/tzdate:date-->\");\n\tif ($switch < 7) {\n\t $stk = explode(\" \",$string);\n\t $stk[0] = trim($stk[0], ',');\n\t $stk[5] = substr($stk[5],0,3).\":\".substr($stk[5],3);\n\t $stk[6] = trim($stk[6], '(,)');\n\treturn $stk[$switch];\n\t}\n\treturn $string;\n}", "function _check_timeout($fp)\n\t{\n\t\tif ($this->read_timeout > 0) {\n\t\t\t$fp_status = socket_get_status($fp);\n\t\t\tif ($fp_status[\"timed_out\"]) {\n\t\t\t\t$this->timed_out = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function hasServerTvBroadcastTime()\n {\n return $this->server_tv_broadcast_time !== null;\n }", "public function isInTimeout();", "function wp_refresh_heartbeat_nonces($response)\n {\n }", "function timeoutHeartBeat()\n {\n if (3 == mt_rand(1, 7) && FALSE !== ($env = $this->getEnvironment())) {\n $env->tell($this->mChat[mt_rand(0, sizeof($this->mChat) - 1)]);\n }\n\n DpNpc::timeoutHeartBeat();\n }", "function generic_ping($post_id = 0)\n {\n }", "public function getTimeEnabled()\n {\n return !empty($_GET['t']) ? $_GET['t'] : false;\n }", "function sub_cycle_event_func_wptc($request_type = null) {\r\n\r\n\t$options = WPTC_Factory::get('config');\r\n\r\n\twptc_reset_restore_if_long_time_no_ping();\r\n\r\n\t$tt = time();\r\n\t$usertime_full_stamp = $options->cnvt_UTC_to_usrTime($tt);\r\n\t$usertime_full = date('j M, g:ia', $usertime_full_stamp);\r\n\r\n\t$cur_time = date('Y-m-d H:i:s');\r\n\r\n\t$options->set_option('last_cron_triggered_time', $usertime_full);\r\n\t$first_backup_started_atleast_once = $options->get_option('first_backup_started_atleast_once');\r\n\r\n\r\n\tif (is_any_ongoing_wptc_restore_process() || is_any_ongoing_wptc_backup_process() || is_any_other_wptc_process_going_on() || !$options->get_option('default_repo') || !$options->get_option('main_account_email') || !$options->get_option('is_user_logged_in')) {\r\n\r\n\t\tif (is_any_ongoing_wptc_restore_process()) {\r\n\t\t\t$options->set_option('recent_restore_ping', time());\r\n\t\t\tsend_response_wptc('declined_restore_in_progress', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t} else if (is_any_ongoing_wptc_backup_process()) {\r\n\t\t\t$options->set_option('recent_backup_ping', time());\r\n\t\t\twptc_set_backup_in_progress_server(true);\r\n\t\t\tsend_response_wptc('declined_backup_in_progress_and_retried', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t} else if (is_any_other_wptc_process_going_on()) {\r\n\t\t\t// do_action('init_staging_wptc_h', time());\r\n\t\t\tsend_response_wptc('declined_staging_processes_in_progress', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t} else if(!$options->get_option('default_repo')) {\r\n\t\t\tsend_response_wptc('declined_default_repo_empty', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t} else if(!$options->get_option('main_account_email')) {\r\n\t\t\tsend_response_wptc('declined_main_account_email_empty', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t} else if(!$options->get_option('is_user_logged_in')) {\r\n\t\t\tsend_response_wptc('declined_user_logged_out', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\t$first_backup_started_but_not_completed = $options->get_option('starting_first_backup'); // true first backup started but not completed\r\n\r\n\t$timestamp_plus_secs = time() + ADVANCED_SECONDS_FOR_TIME_CALCULATION;\r\n\t$usertime = $options->get_wptc_user_today_date_time('Y-m-d', $timestamp_plus_secs);\r\n\t$wptc_today_main_cycle = $options->get_option('wptc_today_main_cycle');\r\n\r\n\tstorage_quota_check_wptc();\r\n\r\n\tif ($wptc_today_main_cycle == $usertime && !$first_backup_started_but_not_completed) {\r\n\r\n\t\tif( !apply_filters('validate_auto_backup_wptc', true) ){\r\n\r\n\t\t\twptc_log('', \"--------missed_backup_3--------\");\r\n\r\n\t\t\tsend_response_wptc('Scheduled backup is completed ', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t}\r\n\r\n\t\tdo_action('start_auto_backup_wptc', time());\r\n\r\n\t} else {\r\n\r\n\t\tif ($wptc_today_main_cycle == $usertime) {\r\n\r\n\t\t\twptc_log('', \"--------missed_backup_4--------\");\r\n\r\n\t\t\tsend_response_wptc('Scheduled backup is completed', WPTC_DEFAULT_CRON_TYPE);\r\n\t\t}\r\n\r\n\t\twptc_main_cycle();\r\n\t}\r\n}", "public function retrieveServerTime(){\n //http://www.thetvdb.com/api/Updates.php?type=none\n\t \n\t if(!$this->t_mirrors){\n\t\t$this->retrieveMirrors;\n\t }\n\t \n $url = $this->t_mirrors[0].'/api/Updates.php?type=none';\n \n //$xmlStr=$this->curl_get_file_contents($url);\n\t $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $xmlStr = curl_exec($c);\n curl_close($c);\n \n $xmlServerTime = new SimpleXMLElement($xmlStr);\n return $xmlServerTime->Time;\n }", "public function ping() {\n\t\t# Stub. Not essential to override.\n\t\treturn true;\n\t}", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "private function _uptime()\n {\n if (CommonFunctions::executeProgram('uptime', '', $buf)) {\n if (preg_match(\"/up (\\d+) days,\\s*(\\d+):(\\d+),/\", $buf, $ar_buf) || preg_match(\"/up (\\d+) day,\\s*(\\d+):(\\d+),/\", $buf, $ar_buf)) {\n $min = $ar_buf[3];\n $hours = $ar_buf[2];\n $days = $ar_buf[1];\n $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);\n }\n }\n }", "function ntp_no_canon() {\n return '';\n}", "protected function _prepare()\n {\n $frac = microtime();\n $fracba = ($frac & 0xff000000) >> 24;\n $fracbb = ($frac & 0x00ff0000) >> 16;\n $fracbc = ($frac & 0x0000ff00) >> 8;\n $fracbd = ($frac & 0x000000ff);\n\n $sec = (time() + 2208988800);\n $secba = ($sec & 0xff000000) >> 24;\n $secbb = ($sec & 0x00ff0000) >> 16;\n $secbc = ($sec & 0x0000ff00) >> 8;\n $secbd = ($sec & 0x000000ff);\n\n // Flags\n $nul = chr(0x00);\n $nulbyte = $nul . $nul . $nul . $nul;\n $ntppacket = chr(0xd9) . $nul . chr(0x0a) . chr(0xfa);\n\n /*\n * Root delay\n *\n * Indicates the total roundtrip delay to the primary reference\n * source at the root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . $nul . chr(0x1c) . chr(0x9b);\n\n /*\n * Clock Dispersion\n *\n * Indicates the maximum error relative to the primary reference source at the\n * root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . chr(0x08) . chr(0xd7) . chr(0xff);\n\n /*\n * ReferenceClockID\n *\n * Identifying the particular reference clock\n */\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at the peer when its latest NTP message\n * was sent. Contanis an integer and a fractional part\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n /*\n * The local time, in timestamp format, at the peer. Contains an integer\n * and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * This is the local time, in timestamp format, when the latest NTP message from\n * the peer arrived. Contanis an integer and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at which the\n * NTP message departed the sender. Contanis an integer\n * and a fractional part.\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n return $ntppacket;\n }", "function om13_wait_for_going_live() {\n\tif (time() < 1365447600 && !is_user_logged_in()) {\n\t\twp_die('Die Website der #om13 ist demnächst verfügbar. Bei Fragen kannst du gern den Twitteraccount <a href=\"https://twitter.com/openmindkonf\">@openmindkonf</a> kontaktieren. Wir freuen uns auf dich!'); // TODO: __\n\t}\n}", "public function test_get_pw_changed_time__0() {\n\t\t$actual = self::$lss->get_pw_changed_time($this->user->ID);\n\t\t$this->assertSame(0, $actual);\n\t}", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "public function ping(): bool\n {\n $ping = $this->send(\"PING\");\n\n if($ping == \"PONG\") {\n return true;\n }\n\n $this->message = trans('clamavfileupload::clamav.not_running');\n ClamavIsNotRunning::dispatch();\n\n return false;\n }", "function get_to_ping($post)\n {\n }", "private function maybe_ping_ud() {\n\n /**\n * May be dismiss notice from UD server\n */\n if( !empty( $_REQUEST[ 'dismiss_ud_notice' ] ) ) {\n $notices = get_option( 'dismissed_ud_notices' );\n if( !is_array( $notices ) ) {\n $notices = array();\n }\n array_push( $notices, $_REQUEST[ 'dismiss_ud_notice' ] );\n $notices = array_unique( $notices );\n update_option( 'dismissed_ud_notices', $notices );\n if( !empty( $_SERVER[ 'HTTP_REFERER' ] ) ) {\n wp_redirect( $_SERVER[ 'HTTP_REFERER' ] );\n } else {\n wp_redirect( admin_url( 'index.php' ) );\n }\n exit;\n }\n\n $cache = true;\n\n $option = sanitize_key( 'ud_ping_' . sanitize_key( $this->slug ) );\n $response = get_option( $option );\n\n if (\n false === $response ||\n empty( $response ) ||\n empty( $response[ 'time' ] ) ||\n ( time() - $response[ 'time' ] ) >= DAY_IN_SECONDS\n ) {\n\n $cache = false;\n\n $detected_products = array();\n\n foreach( $this->get_detected_plugins() as $product ) {\n $detected_products[ $product[ 'product_id' ] ] = array(\n 'version' => $product[ 'product_version' ],\n 'status' => $product[ 'product_status' ],\n 'product_id' => $product[ 'product_id' ],\n );\n }\n\n $response = $this->api->ping( array(\n 'product_id' => $this->slug,\n 'version' => $this->args[ 'version' ],\n 'detected_products' => base64_encode( json_encode( $detected_products ) ),\n ) );\n\n if ( false !== $response && empty( $response[ 'error' ] ) ) {\n update_option( 'ud_ping_' . sanitize_key( $this->slug ), array(\n 'time' => time(),\n 'data' => $response\n ) );\n }\n\n } else {\n if( empty( $response[ 'data' ] ) ) {\n return;\n }\n $response = $response[ 'data' ];\n }\n\n if ( false !== $response && empty( $response[ 'error' ] ) ) {\n\n /**\n * Here we can take care about response.\n *\n * @param string $this->slug ( product_id )\n * @param array $response\n * @param bool $cache got from cache or not\n */\n $this->ping_response = apply_filters( 'ud::ping::response', $response, $this->slug, $cache );\n\n /**\n * Render Admin Notice from UD server.\n */\n if( !empty( $this->ping_response[ 'message' ] ) ) {\n global $_ud_ping_notices;\n\n if( !isset( $_ud_ping_notices ) || !is_array( $_ud_ping_notices ) ) {\n $_ud_ping_notices = array();\n }\n\n $notice = $this->ping_response[ 'message' ];\n\n /** Determine if user has permissions to see plugin notices */\n if ( ! function_exists( 'wp_get_current_user' ) ) {\n require_once( ABSPATH . 'wp-includes/pluggable.php' );\n }\n if( !current_user_can( 'activate_plugins' ) ) {\n return;\n }\n\n /** Determine if notice dismissed */\n $dismissed = get_option( 'dismissed_ud_notices' );\n $dismissed = is_array( $dismissed ) ? $dismissed : array();\n if( in_array( md5( $notice ), $dismissed ) ) {\n return;\n }\n\n if( in_array( $notice, $_ud_ping_notices ) ) {\n return;\n }\n\n array_push( $_ud_ping_notices, $this->ping_response[ 'message' ] );\n\n if( !has_action( 'admin_notices', array( __CLASS__, 'ping_admin_notices' ) ) ) {\n add_action( 'admin_notices', array( __CLASS__, 'ping_admin_notices' ) );\n add_filter( 'ud::ping::response::admin_notice::icon', array( $this, 'get_admin_notice_icon' ) );\n }\n\n }\n\n }\n\n }", "function ifPingable($host, $timeout = 1)\n{\n /* ICMP ping packet with a pre-calculated checksum */\n $package = \"\\x08\\x00\\x7d\\x4b\\x00\\x00\\x00\\x00PingHost\";\n $socket = socket_create(AF_INET, SOCK_RAW, 1);\n socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $timeout, 'usec' => 0));\n socket_connect($socket, $host, null);\n $ts = microtime(true);\n socket_send($socket, $package, strLen($package), 0);\n if (socket_read($socket, 255))\n $result = microtime(true) - $ts;\n else $result = false;\n socket_close($socket);\n return $result;\n}", "public function getLastsend();", "public function check_shutdown() {\r\n\t\t$pending_queries = QueryManager::$pending_queries;\r\n\t\t$shutdown_duration = $this->get_shutdown_duration();\r\n\t\t$live_sockets = 0;\r\n\t\t\r\n\t\tforeach ($this->socket_array as $socket) {\r\n\t\t\tif(!$socket->live_past_shutdown) {\r\n\t\t\t\t$live_sockets++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tif($live_sockets == 0 || $shutdown_duration > 60) {\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function isTimedOut(): bool\n {\n return $this->getCommunicationDisabledUntil() !== 0;\n }", "public function ping()\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, \"http://\".WEMO_IP.\":\".WEMO_PORT);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_VERBOSE, false);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\r\n $result = curl_exec($ch);\r\n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n if($httpcode >= 200 && $httpcode <500){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private function checkIfTimeLeft()\r\n {\r\n if($this->expireDateTime < strtotime(\"now\"))\r\n {\r\n generic::successEncDisplay(\"Emails have been sent out, however, there are a number of emails to be sent, and the server run out of time.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function cron(){\n\t\t$query = 'SELECT `dr`.`device_id` FROM `device_registration` AS `dr` WHERE `http_client` = true;';\n\n\t\tif(!$this->morseduino -> _query($devices, $query, FALSE)){\n\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\treturn FALSE;\n\t\t}\n\t\tunset($query);\n\n\t\tforeach($devices as $dkey => $dvalue){\n\t\t\t$this->_idle_check($dvalue['device_id']);\n\t\t}\n\t\tunset($devices);\n\t\tunset($dkey);\n\t\tunset($dvalue);\n\n\t\treturn TRUE;\n\t}", "public function hasNoopIntervalTime()\n {\n return $this->get(self::NOOPINTERVALTIME) !== null;\n }", "function ping($host, $port, $timeout) {\r\n $tB = microtime(true);\r\n $fP = fSockOpen($host, $port, $errno, $errstr, $timeout);\r\n if (!$fP) { return \"down\"; }\r\n $tA = microtime(true);\r\n return round((($tA - $tB) * 1000), 0).\" ms\";\r\n}", "public function isOtpValid()\n {\n $pdo = static::getDB();\n\n $sql = \"select otp, to_char(otp_last_date, 'YYYY-MM-DD HH24:MI:SS') as otp_last_date from users where email = :email\";\n $result = $pdo->prepare($sql);\n $result->execute([$this->email]);\n\n $result = $result->fetchObject();\n\n $currentTime = strtotime(Extra::getCurrentDateTime());\n $time = strtotime($result->OTP_LAST_DATE);\n\n $diff_in_seconds = ($currentTime - $time);\n\n if($diff_in_seconds > 300){\n return false;\n }\n return $result->OTP;\n }", "function update_right_now_message()\n {\n }", "protected static function checkIfSpecifiedTimePassed()\n {\n $passed = false;\n $specified_time = env('APIMO_TIME_SYNC');\n $now = time();\n $last_sync_time = self::queryLastSyncTimeOnDb();\n if (($now - $specified_time) > $last_sync_time) {\n $passed = true;\n }\n\n return $passed;\n }", "public function ping()\n {\n $this->sendCommand('PING');\n return trim($this->getResponse()) === 'PONG';\n }", "function tbt_ax_timestamp(){\r\n\techo \"ajax response in zweb:\".time();\r\n\t//echo \"slide\";\r\n\tdie();\r\n\r\n\t//\r\n}", "function query_time_server($timeserver, $socket)\n {\n $fp = fsockopen($timeserver, $socket, $err, $errstr, 5);\n # parameters: server, socket, error code, error text, timeout\n if ($fp) {\n fputs($fp, \"\\n\");\n $timevalue = fread($fp, 49);\n fclose($fp); # close the connection\n } else {\n $timevalue = \" \";\n }\n\n $ret = [];\n $ret[] = $timevalue;\n $ret[] = $err; # error code\n $ret[] = $errstr; # error text\n return $ret;\n }", "function send_countdown_if_appropriate($location_code, $trip_type)\n{\n\t$l_counter = 0;\n $do_send = true;\n $m_unit_send_ct = 0;\n $now = new DateTime();\n\n // Analyze the countdown parameters to work out which \n // countdown value is applicable whether to send in hhMM format etc\n // && $return previous values\n $this->get_countdown_values();\n\n if ( $this->should_send ($trip_type) )\n {\n // Reload countdown to check its counted down\n\t if ( true ) //$this->load( array(\"shedule_id\", \"sequence\") ) );\n {\n if ( !$this->counted_down )\n {\n\t\t\t\tswitch ( $this->display_type )\n {\n case \"B\":\n $m_status = $this->send_cntdwn_msg();\n break;\n case \"U\":\n $w_display_line = true;\n $m_status = $this->send_cntdwn_msg();\n break;\n case \"T\" :\n $m_status = $this->send_xmcountdownType($this->predictionParameters[\"countdown_dep_arr\"]);\n break;\n case \"S\" :\n $m_status = $this->send_surtronic_cntdwn_msg($this->predictionParameters[\"countdown_dep_arr\"], $loccode);\n break;\n default:\n // Not bus stop || $bus terminal - Omnistop, RTIG-XML?\n $m_status = 0;\n }\n\t\t\t\tif ( !$m_status ) {\n $this->text = $this->text. \" *FAIL* \";\n\t\t\t\t} else {\n\t\t\t\t\t$l_counter = $l_counter + 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \" Already counted down select failed with status\". m_status.\"\\n\";\n\t\t\t}\n }\n }\n return $l_counter;\n}", "function wp_ajax_nopriv_heartbeat()\n {\n }", "public function isPing()\n {\n return self::STATUS_PING == $this->status;\n }", "public function checkTimeEnd(): bool;", "public function getLastUpdateTime()\n {\n $time = Mage::getStoreConfig(self::XML_GEOIP_UPDATE_DB);\n if (!$time) {\n return false;\n }\n\n return date('F d, Y / h:i', $time);\n }", "public function uptime() : int;", "public function isDeactivatedTemporarily()\n {\n if ($this->isDeactivatedSometime() === false)\n return false;\n \n $invoker = $this->getInvoker();\n $from = $this->_options['from']['name'];\n $until = $this->_options['until']['name'];\n \n return (\n $invoker->$from !== null \n && $invoker->$until !== null\n && strtotime($invoker->$from) < strtotime($invoker->$until)\n )\n ||\n (\n $invoker->$from === null \n && $invoker->$until !== null\n );\n }", "public function hasThreadTs(): bool\n {\n return ! empty($this->threadTS);\n }", "function ping($host)\n{\n exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);\n return $rval === 0;\n}", "private function ping()\n {\n if ($this->project->url) {\n $ch = curl_init($this->project->url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n if (curl_exec($ch)) {\n $info = curl_getinfo($ch);\n curl_close($ch);\n return $info['total_time'];\n }\n\n curl_close($ch);\n return -1;\n }\n return null;\n }", "public function isRemoteCheckRequired()\n {\n if ($this->uid && $this->sessionToken && $this->recheck) {\n if($this->recheck > (new DateTime('NOW'))) {\n return false;\n }\n }\n\n return true;\n }", "public function isDeactivatedSometime()\n {\n $invoker = $this->getInvoker();\n \n return $invoker->{$this->_options['from']['name']} !== null \n || $invoker->{$this->_options['until']['name']} !== null;\n }", "protected function checkSendImmediately($post)\n {\n if (isset($_GET['sendImmediately'])) {\n /** @var CronHandler $cronHandler */\n $cronHandler = new CronHandler();\n $cronHandler->executeCron('hourly');\n // And redirect back to the page\n header('Location: /wp-admin/post.php?post=' .$post->ID . '&action=edit');\n exit;\n }\n }", "public static function getDiscordShouldSend() {\n $db = Database::getInstance();\n $cmd = $db->prepare('SELECT needs_send, last_time FROM discord_webhooks LIMIT 1');\n $cmd->execute();\n \n $row = $cmd->fetch(PDO::FETCH_ASSOC);\n \n if ($row[\"last_time\"] == null) {\n return true;\n }\n \n return $row[\"needs_send\"] ? $row[\"last_time\"] : false;\n }", "public function isTimeout():bool\n {\n if(!$this->lastHeartbeat) return true;\n if(time() - $this->lastHeartbeat > self::TIMEOUT_SEC) \n throw new ClientException(\"Client connection timeouted.Disconnecting...\");\n\n return true;\n }", "public function getIdleDisconnectTime()\n {\n $result = $this->client->GetIdleDisconnectTime();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "private function getTimeCorrection(): int\n\t{\n\t\treturn config('curl-connection.' . $this->service . '.time_correction');\n\t}", "public function wp_cron_scheduled_check()\n {\n }", "public function snooze() {\n\t\tif (self::isAudioRunning()) {\n\t\t\tself::stopRadio();\n\t\t\t$date = date('H:i Y-m-d', strtotime(Flight::get(\"snooze\")));\n\t\t\texec('at '.$date.' -q A -f /srv/www/home.fr/public/conf/aton.txt');\n\t\t\tFlight::json(array('Status' => 'OK', 'Snooze at' => $date));\n\t\t}\n\t\telse\n\t\t\tFlight::json(array('Status' => 'KO', 'Snooze at' => 'Radio was not running'));\n\t}", "static function doCron() {\n\t\t$lc = new DateTime(Preferences::value(\"lastCron\"));\n\t\t$now = new DateTime();\n\t\t\n\t\t$diff = $now->diff($lc, true);\n\t\tif($diff->i >= 1) return true;\n\t\treturn false;\n\t}", "public function ping()\n {\n }", "function awaiting_trigger_check() {\n\t\tif(intval(get_query_var('lepress-teacher-awaiting')) == 1) {\n\t\t\t//WP default header is 404, have to override it\n\t\t\theader(\"HTTP/1.0 200 OK\");\n\t\t\tif(isSet($_GET['w'])) {\n\t\t\t\techo $this->getAwaitingBubble($_GET['w']);\n\t\t\t}\n\t\t\texit;\n\t\t}\n \t}", "public function checkTimestamps()\n {\n return false;\n }", "public function updateLastPing()\n {\n $this->last_ping = Carbon::now();\n $this->save();\n }", "public function timeout();", "private function negotiateTelnetOptions(){\r\n\t\t\r\n\t\t$c = $this->getc();\r\n\t\r\n\t\tif ($c != $this->IAC){\r\n\t\t\t\r\n\t\t\tif (($c == $this->DO) || ($c == $this->DONT)){\r\n\t\t\t\t\r\n\t\t\t\t$opt = $this->getc();\r\n\t\t\t\tfwrite($this->socket, $this->IAC . $this->WONT . $opt);\r\n\t\t\t\t\r\n\t\t\t} else if (($c == $this->WILL) || ($c == $this->WONT)) {\r\n\t\t\t\t\r\n\t\t\t\t$opt = $this->getc(); \r\n\t\t\t\tfwrite($this->socket, $this->IAC . $this->DONT . $opt);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Exception('Error: unknown control character ' . ord($c ));\r\n\t\t\t}\r\n\t\t} else{\r\n\t\t\tthrow new Exception('Error: Something Wicked Happened');\r\n\t\t}\r\n\t\t\r\n\t\treturn self::TELNET_OK;\r\n\t}", "public function switchTZ()\r\n\t{\r\n\t \ttry\r\n\t \t{\r\n\t\t \tself::_switchTimeZone($this->timezone);\r\n\t\t \treturn true;\r\n\t \t}\r\n\t \tcatch(ilTimeZoneException $exc)\r\n\t \t{\r\n\t\t\t// Shouldn't happen since this has been checked during initialisation\r\n\t\t\t$this->log->write(__METHOD__.': Unsupported timezone given: Timzone: '.$this->timezone);\r\n\t \t\treturn false;\r\n\t \t}\r\n\t}", "private static function telnetOp($command)\n {\n self::$ops[] = $command;\n if (empty(self::$telnet_handle)) {\n self::telnetStart();\n }\n\n fwrite(self::$telnet_handle, $command.\"\\n\");\n $response = '';\n $line = '';\n $empty_line_counter = 0;\n do {\n $response .= $line;\n $line = fgets(self::$telnet_handle, 1024); //Read a max of 1KB of data\n if (empty(trim($line))) {\n $empty_line_counter++;\n if ($empty_line_counter > 5) {\n break;\n }\n } else {\n $empty_line_counter = 0;\n }\n } while (trim($line) !== 'END');\n\n //Intentionally doesn't append END\n return trim($response);\n }", "public function getAutoDisconnectTime()\n {\n $result = $this->client->GetAutoDisconnectTime();\n if ($this->errorHandling($result, 'Could not get auto disconnection time from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "function NodeTimeOut()\n\t{\n\t\techo \"\\nEvento de respuesta AnsTestNodeLink lanzado!!!\";\n\t\n\t\t//la func response solo responde al cliente que mando la trama que origino este nodetimeout\n\t\t$this->responseClientFunction( \"clienteNodeTimeOut\", array() );\n\t}", "public function sendPong()\n\t{\n\t\tglobal $log;\n\n\t\t$log->println('Ping/Pong', 'BROWN');\n\t\t$this->send('PONG :tmi.twitch.tv');\n\t}", "function amap_ma_get_timezone_update() {\n $update_timezone = trim(elgg_get_plugin_setting('update_timezone', AMAP_MA_PLUGIN_ID));\n if ($update_timezone === AMAP_MA_GENERAL_YES) {\n return true;\n }\n\n return false;\n}", "abstract public function getLastSyncTimestamp();", "abstract public function getTstamp();", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "static function doPowerRequest() {\n if (!$_POST['inPlugType'] == \"\") {\n if ($_POST['inPlugType'] == \"off\") {\n self::$type = \"shutdown and power-off\";\n } else {\n self::$type = \"restart (reboot)\";\n }\n if (sys_versions::ShowOSPlatformVersion() == 'Windows') {\n $shutdown = \"shutdown -s -f -t 10 -c \\\"Powerplug module for ZPanel requested a shutdown.\\\"\";\n $restart = \"shutdown -r -f -t 10 -c \\\"Powerplug module for ZPanel requested a restart.\\\"\";\n } else {\n $shutdown = ctrl_options::GetOption('zsudo') . \" shutdown -h -t 10\";\n $restart = ctrl_options::GetOption('zsudo') . \" shutdown -r -t 10\";\n }\n if ($_POST['inPlugType'] == \"off\") {\n $command_to_run = $shutdown;\n } else {\n $command_to_run = $restart;\n }\n self::$inprocess = true;\n exec($command_to_run);\n return true;\n }\n }", "public function shouldSendMessage($timeNow, $timeLastCalled);", "function parse_idle_response($response) {\n // check total length\n if (count($response)<16){\n return result_response_parse_error('response length != 16');\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_IDLE && $response[1]!=CMD_SYNCHRONIZE_TIME) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,12);\n $checksum = calc_checksum($response[1],$data);\n if ($checksum!=$response[14]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[15]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array(\n 'cmd' => $response[1],\n 'value' => bytes_to_string($data),\n );\n return result_success_data($rdata);\n}", "public function isOTP(){\n return ($this->auth_type == \"1\");\n }", "function pack_idle($is_loopback){\n $packet = array();\n $packet[] = STX;\n $packet[] = CMD_IDLE;\n $data_str = date(\"YmdHi\",time());\n if ($is_loopback) {\n $data_str = '000000000000';\n }\n $data_bytes = string_to_bytes($data_str);\n $packet = array_merge($packet,$data_bytes);\n $checksum = calc_checksum(CMD_IDLE,$data_bytes);\n $packet[] = $checksum;\n $packet[] = ETX;\n $data = array(\n 'packet' => $packet,\n );\n return result_success_data($data);\n}", "public function ping(){\n http_response_code(200);\n ob_end_flush();\n }", "function getTime($time_command){\n $locations = array('london', 'dubai', 'abuja', 'accra');\n $time_zone = '';\n $time = '';\n\n if (strpos($time_command, 'new_york')) {\n $location = 'new york';\n $time_zone = 'America/New_York';\n date_default_timezone_set($time_zone);\n $time = date(\"g:i:s a\");\n\n echo 'found'; exit();\n }\n\n else{\n $input_arr = explode(' ', $time_command);\n\n //iterate over both arrays to determine if there's any predefined location\n for ($i = 0; $i < sizeof($input_arr); $i++) {\n for ($j = 0; $j < sizeof($locations); $j++) {\n if($input_arr[$i] == $locations[$j]){\n $location = $locations[$j]; //set a predetermined location\n break;\n }\n }\n\n } //end outer for loop\n\n if( isset($location) ){\n switch ($location) {\n case 'london':\n $time_zone = 'Europe/London';\n date_default_timezone_set($time_zone);\n $time = date(\"g:i:s a\");\n break;\n\n case 'dubai':\n $time_zone = 'Asia/Dubai';\n date_default_timezone_set($time_zone);\n $time = date(\"g:i:s a\");\n break;\n\n case 'accra':\n $time_zone = 'Africa/Accra';\n date_default_timezone_set($time_zone);\n $time = date(\"g:i:s a\");\n break;\n } //end switch\n } //end if(isset)\n else { //if only time was asked for then display Nigerian time\n $time_zone = 'Africa/Lagos';\n date_default_timezone_set($time_zone);\n $time = date(\"g:i:s a\");\n $location = 'nigeria';\n }\n\n } //end else\n\n echo 'The time in '.ucfirst($location). ' is: ' .$time; //display current local time\n exit();\n }", "public static function sslRandPoll(): bool {}", "function runcron() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\n\t\t$this->sendPerCycle = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) : 50;\n\t\t$this->useDeferMode = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) : 0;\n\t\t$this->notificationJob = intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['notificationJob']);\n\t\tif(!is_object($LANG) ) {\n\t\t\trequire_once (PATH_typo3.'sysext/lang/lang.php');\n\t\t\t$LANG = t3lib_div::makeInstance('language');\n\t\t\t$L = $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] ? $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] : $this->user_dmailerLang;\n\t\t\t$LANG->init(trim($L));\n\t\t\t$LANG->includeLLFile('EXT:direct_mail/locallang/locallang_mod2-6.xml');\n\t\t}\n\n\t\t$pt = t3lib_div::milliseconds();\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'sys_dmail',\n\t\t\t'scheduled!=0' . \n\t\t\t' AND scheduled < ' . time() .\n\t\t\t' AND scheduled_end = 0' .\n\t\t\t' AND type NOT IN (2,3)' . \n\t\t\tt3lib_BEfunc::deleteClause('sys_dmail'),\n\t\t\t'',\n\t\t\t'scheduled'\n\t\t);\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y'), 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y');\n\n\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\t// format headers for SMTP use\n\t\t\tif ($this->useSmtp) {\n\t\t\t\t// create a new mail object to be used to sending the mass email and notification job\n\t\t\t\tif (!is_a($this->mailObject, 'Mail_smtp') || $this->confSMTP['persist'] == 1) {\n\t\t\t\t\t$this->mailObject = NULL;\n\t\t\t\t\t$this->mailObject =& Mail::factory('smtp', $this->confSMTP);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed');\n\t\t\t$this->dmailer_prepare($row);\n\t\t\t$query_info=unserialize($row['query_info']);\n\t\t\tif (!$row['scheduled_begin']) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'begin');\n\t\t\t}\n\t\t\t$finished = $this->dmailer_masssend_list($query_info,$row['uid']);\n\t\t\tif ($finished) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'end');\n\t\t\t}\n\t\t} else {\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_nothing_to_do'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_nothing_to_do');\n\t\t}\n\n\t\t//closing DB connection\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t\n\t\t$parsetime = t3lib_div::milliseconds()-$pt;\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms', 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms';\n\t}", "public function sendOtp(): bool\n {\n $appName = Yii::$app->name;\n $otp = $this->generateOtp();\n\n return Yii::$app->mailer->compose()\n ->setFrom(Yii::$app->params['mailer.from'])\n ->setTo($this->getEmail())\n ->setSubject(\"OTP confirmations - {$appName}\")\n ->setHtmlBody(\"Hi, <br/> Please use the following OTP <b>{$otp}</b> to verify your email id.\")\n ->queue();\n }", "function wp_schedule_https_detection()\n {\n }", "public static function ping()\n {\n return \"PING\\n\";\n }", "function xtorrent_GetDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)\r\n{\r\n $aflag = [];\r\n $amtime = [];\r\n $artime = [];\r\n $ahtime = [];\r\n $asout = [];\r\n $aflag = [\r\n $gmodem,\r\n $gisdn,\r\n $gdsl,\r\n $gslan,\r\n $gflan\r\n ];\r\n $amtime = [\r\n $size / 6300 / 60,\r\n $size / 7200 / 60,\r\n $size / 86400 / 60,\r\n $size / 1125000 / 60,\r\n $size / 11250000 / 60\r\n ];\r\n $amname = [\r\n 'Modem(56k)',\r\n 'ISDN(64k)',\r\n 'DSL(768k)',\r\n 'LAN(10M)',\r\n 'LAN(100M)'\r\n ];\r\n for($i = 0;$i < 5;$i++)\r\n { \r\n $artime[$i] = ($amtime[$i] % 60);\r\n } \r\n for($i = 0;$i < 5;$i++)\r\n {\r\n $ahtime[$i] = sprintf(' %2.0f', $amtime[$i] / 60);\r\n } \r\n if ($size <= 0)\r\n {\r\n $dltime = 'N/A';\r\n }\r\n else\r\n {\r\n for($i = 0; $i < 5; $i++)\r\n {\r\n if (!$aflag[$i]) $asout[$i] = '';\r\n else\r\n {\r\n if (($amtime[$i] * 60) < 1)\r\n {\r\n $asout[$i] = sprintf(' : %4.2fs', $amtime[$i] * 60);\r\n }\r\n else\r\n {\r\n if ($amtime[$i] < 1)\r\n {\r\n $asout[$i] = sprintf(' : %2.0fs', round($amtime[$i] * 60));\r\n }\r\n else\r\n {\r\n if (0 == $ahtime[$i])\r\n {\r\n $asout[$i] = sprintf(' : %5.1fmin', $amtime[$i]);\r\n }\r\n else\r\n {\r\n $asout[$i] = sprintf(' : %2.0fh%2.0fmin', $ahtime[$i], $artime[$i]);\r\n }\r\n } \r\n } \r\n $asout[$i] = '<b>' . $amname[$i] . '</b>' . $asout[$i];\r\n if ($i < 4)\r\n {\r\n $asout[$i] = $asout[$i] . ' | ';\r\n }\r\n } \r\n } \r\n $dltime = '';\r\n for($i = 0; $i < 5; $i++)\r\n {\r\n $dltime = $dltime . $asout[$i];\r\n } \r\n } \r\n return $dltime;\r\n}", "public static function ping()\n {\n return parent::ping();\n }", "public static function tick() {\n if (function_exists(self::WP_NONCE_TICK_FUNCTION_NAME) === FALSE) {\n $result = FALSE;\n } else {\n $result = call_user_func(self::WP_NONCE_TICK_FUNCTION_NAME);\n }\n\n return $result;\n }", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();" ]
[ "0.5358862", "0.52541333", "0.52417123", "0.52409226", "0.5150787", "0.5086303", "0.5082719", "0.50663257", "0.5056325", "0.5010953", "0.49747655", "0.49531448", "0.49449086", "0.49419537", "0.4931662", "0.49180624", "0.49171072", "0.4916608", "0.4885348", "0.4872519", "0.48656029", "0.48604712", "0.4858124", "0.48470798", "0.484485", "0.48374858", "0.4836784", "0.48162705", "0.4809662", "0.48094246", "0.48061556", "0.4803721", "0.4791262", "0.47904694", "0.47665915", "0.47635818", "0.47626296", "0.47533208", "0.4750075", "0.47424284", "0.474039", "0.47373438", "0.4735915", "0.47296402", "0.46894035", "0.46861973", "0.46803027", "0.4675474", "0.4674211", "0.46633562", "0.46568936", "0.4643877", "0.46392813", "0.46390754", "0.46347383", "0.46287078", "0.4626504", "0.46259752", "0.46189904", "0.46150053", "0.46110696", "0.4600468", "0.45995268", "0.4598934", "0.45989272", "0.45948136", "0.45828035", "0.4575175", "0.4574866", "0.45674875", "0.45643702", "0.45617318", "0.45569268", "0.45562834", "0.45526078", "0.45507658", "0.45439023", "0.45417204", "0.45377392", "0.45366138", "0.45317793", "0.45305973", "0.4528191", "0.45231023", "0.4520279", "0.4516772", "0.45142975", "0.45139226", "0.4513054", "0.45115662", "0.45094863", "0.45023763", "0.44946292", "0.44928905", "0.44907263", "0.44902876", "0.4486168", "0.4486168", "0.4486168", "0.4486168" ]
0.7596663
0
Checks if the form user is the owner of the specified screen ID.
public function validateUserScreenId($attribute, $params) { $user = $this->getUser(); if (!$user || !$user->findScreenById((int) $this->{$attribute})) { $this->addError($attribute, Yii::t('app', 'Invalid screen ID.')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }", "public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }", "public function isOwner($id=''){\n\t\n\tif(empty($id)) $id = $this->id;\n\t \t\n \t$sql=$this->_db->select()->from($this->m_table)->where(\"id=?\",$id)->where(\"user_id =?\",$_SESSION['user_id']);\n \t$rs =$this->_db->fetchCol($sql);\n \t\n \tif(!empty($rs)){\n \t\treturn true;\n \t}\n \treturn false;\n }", "public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "private function check_is_owner($user_id)\n {\n if ($user_id != current_user_id()) {\n show_error(lang('not_authorized'), 403);\n }\n }", "private function _ownedByCurrentUser($id) {\n if (empty($id)) {\n return false;\n }\n $queryResult = $this->Entries->findById($id)->limit(1);\n foreach ($queryResult as $entry) {\n if ($entry['user_id'] === $this->Auth->user('id')) {\n return true;\n }\n }\n return false;\n }", "public function isOwner($user)\n {\n\n if ($this->m_role_created == $user->getId())\n return true;\n else\n return false;\n\n }", "public function isPostOwner($id) {\n $post = Post::where('id','=',$id)->first();\n return ($this->id == $post->user->id);\n }", "public static function isTicketOwner($id)\n {\n if (auth()->check()) {\n if (auth()->user()->id == Ticket::find($id)->user_id) {\n return true;\n }\n }\n }", "function isOwner($facebookID){\n\t\tif($facebookID == $this->fk_member_id){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "protected function owner_matches_current_user()\n {\n }", "public function isOwner()\n\t{\n\t\treturn is_null($this->CreatedBy) || $this->CreatedBy === Yii::app()->user->GUID;\n\t}", "public function isOwner(UserObject $userObject){\n if(is_callable($this->checkOwner)){\n $check = $this->checkOwner;\n return $check($userObject);\n }\n CoreLog::debug('No checkOwner method defined');\n return false;\n }", "private function isFileOwner($id){\n $query = \\Drupal::database()->select('ol_file', 'fr');\n $query->addField('fr', 'user_id');\n $query->condition('fr.id', $id);\n $uid = $query->execute()->fetchField();\n return ($uid == $this->current_user->id());\n }", "function is_session_owner ($session_id, $user_agent, $remote_addr, $ip) {\n\t\t$session_data = $this->get($session_id);\n\t\treturn $session_data ? $this->is_session_owner_internal($session_data, $user_agent, $remote_addr, $ip) : false;\n\t}", "public function isOwner(\\VMB\\UserBundle\\Entity\\User $user = null)\n {\n return $user && $this->getOwner() && $user->getId() == $this->getOwner()->getId();\n }", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "public static function isOwner(): bool\n\t{\n\t\tif(in_array( 'owner', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t\treturn false;\n\t}", "function isOwner( $user, $imagecategory )\r\n {\r\n if ( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT UserID from eZImageCatalogue_Category WHERE ID='$imagecategory'\");\r\n $userID = $res[$db->fieldName(\"UserID\")];\r\n if ( $userID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }", "public function ownerLoggedIn()\n {\n // For now just check session for an email and owner type\n if ( empty($_SESSION['email']) || $_SESSION['type'] != 'owner')\n return false;\n else\n return true;\n\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function ownedBy(User $user) {\n // Check to see if the user id = the user id passed in.\n return $this->user_id == $user->id;\n }", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "public function isOwner();", "public function crud(User $user, Screen $screen)\n {\n return $user->id === $screen->user_id;\n }", "public function isOwner(){\n return (count($this->rooms()) > 0);\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "protected function isBotOwner(User $user, Bot $bot)\n {\n return $user->id == $bot->user_id;\n }", "public function isOwner($id = null)\n {\n if (is_null($row =& $this->fromRow($id))) {\n return false;\n }\n\n if ($this->_isOwner($row) === false) {\n TIP::warning(\"not an owned row ($id)\");\n TIP::notifyError('denied');\n return false;\n }\n\n return true;\n }", "public function isUserOwner($user, $mmobj)\n {\n return $this->mmobjService->isUserOwner($user, $mmobj);\n }", "public function hasOwner()\n {\n return $this->owner !== null;\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isOwnedBy($user)\n {\n if (($entry = $this->getEntry())) {\n return $entry->isOwnedBy($user);\n } else {\n return false;\n }\n }", "public function isOwnedBy($comment, $user) {\n return $this->field('id', array('id' => $comment, 'user_id' => $user)) !== false;\n }", "public function isOwner($id, $login){ \n $q = $this->slcOrdrFild(\"author\", $id);\n return $this->check($q, $login);\n }", "public function ownedBy(User $user){\n\n\t\treturn $this->user_id == $user->id;\n\n\t}", "public function isFromOwner()\n {\n return $this->fromOwner;\n }", "public function ownedBy(User $user)\n {\n return $this->user_id === $user->id;\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "public function isAdminOrOwner($user_id)\n\t{\n\t\t$user = User::model()->findByPk($user_id);\n\t\tif ($user !== null)\n\t\t{\n\t\t\treturn $user->isAdmin() ||\n\t\t\t($user->canCreateAdventure() && $user_id == $this->createdBy)\n\t\t\t;\n\t\t}\n\t\treturn false;\n\t}", "function isBlogOwner( $pUserId=NULL ) {\n\t\t$ret = FALSE;\n\t\tglobal $gBitUser;\n\t\tif( empty( $pUserId ) && $gBitUser->isValid() ) {\n\t\t\t$pUserId = $gBitUser->mUserId;\n\t\t}\n\t\tif( $this->isValid() && ($pUserId == $this->mInfo[\"blog_user_id\"]) ) {\n\t\t\t$ret = 'y';\n\t\t}\n\t\treturn $ret;\n\t}", "protected function isCurrentPageEditableByUser() {\n\n\t\t$title = $this->getTitle();\n\t\t$user = $this->getUser();\n\t\treturn $title->quickUserCan( 'edit', $user )\n\t\t\t&& ( $title->exists() || $title->quickUserCan( 'create', $user ) );\n\t}", "public function ownerOnly(User $user, Load $load)\n {\n \n return ($load->user_id === $user->id);\n }", "public function isOwnedBy(UserInterface $user);", "public function ownedBy(User $user)\n {\n return $this->created_by == $user->id;\n }", "public function isOwnerMessage(int $userID, int $messageID) : bool {\n\t\treturn db()->count(\n\t\t\tself::MESSAGES_TABLE, \n\t\t\t\"WHERE id = ? AND user_id = ?\",\n\t\t\tarray($messageID, $userID)\n\t\t) > 0;\n\t}", "public function isNotOwner($id = null)\n {\n if (is_null($row =& $this->fromRow($id))) {\n return false;\n }\n\n if ($this->_isOwner($row) === true) {\n TIP::warning(\"owned row ($id)\");\n TIP::notifyError('denied');\n return false;\n }\n\n return true;\n }", "public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function isToApiOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } elseif (($this->api === null) || ($this->api->owner_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->api->owner_id);\n }\n }", "public function isOwnerBooking()\n {\n return ($this->getStatus() == 'O');\n }", "public function checkIsMember($user_id) {\n\n // all members and up have records in the aro table\n $aro = $this->findUser($user_id);\n return !empty($aro);\n }", "function check_ownership($id){\n\n $id = (int)$id;\n\n $sql = \"SELECT * FROM recipes WHERE id = '$id'\";\n\n $recipe = $this->select($sql)[0];\n\n if ( $recipe['user_id'] == $_SESSION['user_logged_in'] ) {\n return true;\n }else {\n header(\"Location: /\");\n exit();\n }\n\n }", "private function isCurrentUserValidation($field) {\t\n\t \t\tif (isset($_SESSION[\"id\"])) {\n\t \t\t\tif ($this->integerValidation($field)) {\n\t\t\t \t\tif ($field->getMethod() == \"get\")\n\t\t\t \t\t\t$userId = $_GET[$field->getName()];\n\t\t\t \t\telse\n\t\t\t \t\t\t$userId = $_POST[$field->getName()];\n\t\t\t \t\t\n\t\t\t \t\tif ($_SESSION[\"id\"] == $userId)\n\t\t\t \t\t\treturn true;\n\t\t\t \t\telse\n\t\t\t \t\t\treturn false;\n\t\t \t\t}\n\t\t \t\telse\n\t\t \t\t\treturn false;\n\t \t\t}\n\t \t\telse\n\t \t\t\treturn false;\t\n\t \t}", "public function isOwner(User $userA, User $userB)\n {\n return $userA->uuid === $userB->user_uuid;\n }", "public function getAmOwnerAttribute() {\n\t\t$userId = user('id');\n\t\tif(empty($userId)) { return false; }\n\t\t\n\t\treturn $userId == $this->attributes['user_id'];\n\t}", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "public function isUserWinner() {\n if($this->winnerType == \"player\" && $this->winnerID == CD()->id) {\n return true;\n }\n return false;\n }", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "function isValid( $id_user ) {\n\n\t\treturn true;\n\t}", "public function isOwner($customerId)\n {\n return $customerId == $this->getCustomerId();\n }", "public function isOwner(User $user) : bool\n {\n foreach (config('dan.owners') as $usr) {\n if (fnmatch($usr, $user)) {\n return true;\n }\n }\n\n return false;\n }", "public function edit(User $user, $pc)\n {\n return $pc->owner_id === $user->id || $user->hasRole('admin');\n }", "public function isUserManager($user_id) {\r\n\r\n $query = $this->db->select_sum('id')\r\n ->where('id', $user_id)\r\n ->get(MANAGERS);\r\n\r\n if ($query->num_rows() > 0) {\r\n return ($query->row()->id != 0);\r\n }\r\n return false;\r\n }", "function isOwner() {\n return $this->getIsOwner();\n }", "function current_user_owns_post( $post_id = null ) {\n\t\tif ( null == $post_id ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $current_user;\n\t\t$post = get_post( $post_id, 'OBJECT' );\n\t\treturn ( $post->post_author == $current_user->id );\n\t}", "private static function canAccess($request, $address){\n $currentUser_Account = $request->user;\n $user = $address->get_user();\n return ($user != null && $currentUser_Account->getId() === $user->getId()) || User_Precondition::ownerRequired($request);\n }", "public function isOwner($idacl)\n {\n $owner = $this->_dbTable->isOwner($idacl);\n return $owner->owner;\n }", "public static function ownerOnly(){\n return TRUE;\n }", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "public function GetIsOwnerOfMobidul ($mobidulCode)\n {\n if ( Auth::check() && Auth::user()->admin == true ) {\n return true;\n }\n\n return $this->GetOwnerOfMobidul($mobidulCode) == Auth::id();\n }", "protected function valid()\r\n {\r\n return isset($_SESSION['user']['user_id']) ? true : false;\r\n }", "function acf_is_screen($id = '')\n{\n}", "public function owner(User $user, Task $task)\n {\n return $user->id === $task->user_id;\n }", "public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }", "public function owns($image)\n {\n return $this->id === $image->user_id;\n }", "public function check_owned_form($user_id,$form_id){\n $this->db->select('fd.*')\n ->from('form_details fd')\n ->where('fd.form_id',$form_id)\n ->where('fd.created_by',$user_id);\n $result = $this->db->get();\n //echo $this->db->last_query();exit;\n if($result->num_rows()){\n return 1;\n }\n else{\n return 0;\n }\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function notYou()\n {\n return $this->user_id !== auth()->id();\n }", "public function owns(Model $model)\n {\n return $this->id == $model->user_id;\n }", "function isViewer($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_VIEWER) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false; \n }", "public function checkCurrentUser()\n\t{\n\t\t$user = Zend_Auth::getInstance()->getIdentity();\n\n\t\tif ($this->getUserId() == $user->userId) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$row = $this->getTable()->checkUser($this->_actionId, $user->userId);\n\n\t\treturn $row !== false;\n\t}", "public function isOwner(AccountInterface $account);", "public function show(User $user, Request $request)\n {\n return ($request->owner_id == $user->id || $user->isAdmin());\n }", "private function _checkOwnerShip($targetId, $userRole, $entityId){\n\n $target = 'Users';\n $associationRoute = $this->_getFromKnownRoutes($this->reqController, $userRole); \n if(!$associationRoute){\n $associationRoute = $this->_getAssociationRoute($this->reqController, $target, [], []);\n }\n if(!$associationRoute){\n return true;\n }\n if ($associationRoute == $target) {\n if($targetId == $entityId){\n return true;\n }\n return false;\n\n }elseif ($associationRoute[0] == $target && count($associationRoute) == 1) {\n $direct = true;\n $tableObject = TableRegistry::get($this->reqController);\n $associations = $tableObject->associations();\n $foreignKey = $associations->get($target)->foreignKey();\n $entity = $tableObject->findById($entityId)->where([$foreignKey => $targetId])->first();\n\n } else{\n $direct = false;\n $pathToModel = $this->_decorateRoute($associationRoute);\n $tableObject = TableRegistry::get($this->reqController);\n $entity = $tableObject->findById($entityId)->matching($pathToModel, function($q) use ($targetId, $target){\n return $q->where([$target.'.id' => $targetId]);\n })->first();\n }\n\n //Check Vendor OwnerShip\n if(isset($entity) && $entity){\n return true;\n }\n unset($entity);\n //Check Super Admin OwnerShip\n \n return false;\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function isOwner()\r\n {\r\n return $this->owner;\r\n }", "protected function isCurrentUser($userId)\n {\n if (empty($userId)) {\n return false;\n }\n\n if (!$this->user) {\n return false;\n }\n\n return $this->user->userId == $userId;\n }", "function isFilled( $id_user ) {\n\n\t\treturn true;\n\t}", "function isOwner() {\n if($this->is_owner === null) {\n $company = $this->getCompany();\n $this->is_owner = instance_of($company, 'Company') ? $company->getIsOwner() : false;\n } // if\n return $this->is_owner;\n }", "function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }", "protected function CurrentUserHasEditPermissionToThisUser()\n {\n if (true === $this->IsOwner()) {\n return true;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(\n CmsPermissionAttributeConstants::TABLE_EDITOR_EDIT,\n $this->oTableConf\n )) {\n return false;\n }\n $user = $securityHelper->getUser();\n\n if (null === $user) {\n return false;\n }\n\n if (false === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n // Continue only if we have an ID. If we do not, this is a new record, so the check is not needed.\n if (null !== $this->sId && !empty($this->sId)) {\n $oTargetUser = TdbCmsUser::GetNewInstance();\n $oTargetUser->Load($this->sId);\n // If the target user is an admin, and the current user is not, then we do not grant edit permission.\n if ($oTargetUser->IsAdmin()) {\n return false;\n }\n\n // Also, the user may only edit users that have at least one portal in common.\n $allowedPortals = array_keys($user->getPortals());\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n if (count($portalsOfTargetUser) > 0\n && 0 === count(array_intersect($allowedPortals, $portalsOfTargetUser))) {\n return false;\n }\n }\n }\n\n return true;\n }", "function is_podlove_settings_screen()\n{\n $screen = get_current_screen();\n\n return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings';\n}", "public function iN_CheckPostOwnerStatus($userID, $postID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$checkOwnerStatus = mysqli_query($this->db, \"SELECT post_id, post_owner_id FROM i_posts WHERE post_id = '$postID' AND post_owner_id = '$userID'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($checkOwnerStatus) == 1) {\n\t\t\treturn true;\n\t\t} else {return false;}\n\t}", "function checkAction($id)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('username' => session_get('username'), 'uid' => $id), 1);\n\t\treturn ($check != 0);\n\t}", "private function checkOwnership( $id, $type='post' )\n {\n\n\n if ( current_user_can( 'manage_options' ) ) return true;\n\n\n\n /**\n * @since 2016-07-24\n */\n\n $current_user_id = 0;\n if ( $session_id = in('session_id') ) {\n $current_user_id = user()->check_session_id( $session_id );\n if ( ! $current_user_id ) $this->errorResponse(-50510, \"session_id is wrong.\");\n }\n else if ( $login = is_user_logged_in() ) {\n $user = wp_get_current_user();\n $current_user_id = $user->ID;\n }\n else {\n $this->errorResponse( -50400, \"Please, Login first...\");\n }\n\n /// if ( ! is_user_logged_in() ) $this->errorResponse(-50400, \"Please login\");\n\n\n\n\n\n // Get post/comment user info.\n $user_id = 0;\n if ( $type == 'post' ) {\n $post = get_post( $id );\n if ( empty($post) ) { // if post does not exists, it may be a new post writing.\n $this->errorResponse( -50402, \"Post does not exists\");\n }\n $user_id = $post->post_author;\n }\n else if ( $type == 'comment' ) {\n $comment = get_comment( $id );\n if ( empty( $comment ) ) $this->errorResponse(-50408, \"Comment does not exists\");\n $user_id = $comment->user_id;\n }\n else $this->errorResponse(-50409, 'Wrong Post Type Check');\n\n\n\n\n // compare.\n if ( $current_user_id == $user_id ) {\n // ok\n return true;\n }\n else {\n $this->errorResponse(-50405, \"You are not the owner of the $type no. $id\");\n }\n\n return true;\n }", "public function isMasterOwnedBy(Model $model) : bool {\n return (bool) $this->owners->contains('id', $model->getKey());\n }" ]
[ "0.6760983", "0.66502994", "0.65118855", "0.64314747", "0.6407534", "0.6407061", "0.63521975", "0.6331897", "0.6216127", "0.61890703", "0.61856806", "0.6157196", "0.613505", "0.6103269", "0.61032623", "0.6103158", "0.610174", "0.6098609", "0.6082986", "0.60804224", "0.60755974", "0.6049955", "0.6024966", "0.6022241", "0.60054517", "0.59641623", "0.5962131", "0.59167075", "0.59009796", "0.58911324", "0.5889794", "0.5825965", "0.5823501", "0.58084595", "0.58048624", "0.57873785", "0.5773554", "0.57669246", "0.5746513", "0.5743535", "0.5716294", "0.5712183", "0.5705486", "0.56581557", "0.5655143", "0.5652794", "0.56366295", "0.5619014", "0.5592375", "0.55824095", "0.5582153", "0.55818117", "0.5579332", "0.55685216", "0.5567887", "0.5559856", "0.5559155", "0.5553999", "0.554903", "0.554903", "0.5543028", "0.5537256", "0.553654", "0.55357766", "0.5530373", "0.5529344", "0.5526071", "0.55131453", "0.55077934", "0.55064803", "0.5494511", "0.5491633", "0.54847527", "0.54750407", "0.54679036", "0.54677624", "0.5463069", "0.5455622", "0.5453704", "0.5452947", "0.5449598", "0.5447009", "0.5438209", "0.54350615", "0.5424155", "0.5408231", "0.5396509", "0.5379637", "0.53745085", "0.53726137", "0.5330459", "0.5329694", "0.5328239", "0.5321799", "0.5318356", "0.53170866", "0.5313982", "0.5313164", "0.5307851", "0.5293731", "0.5291979" ]
0.0
-1
Checks if the form user own a specific ScreenComment model.
public function validateReplyTo($attribute, $params) { $user = $this->getUser(); $comment = $user ? $user->findScreenCommentById((int) $this->{$attribute}) : null; if ( !$comment || // comment doesn't exist or can't be accessed !empty($comment->replyTo) // only primary comment can have replies ) { $this->addError($attribute, Yii::t('app', 'Invalid primary comment ID.')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}", "public function isOwnedBy($comment, $user) {\n return $this->field('id', array('id' => $comment, 'user_id' => $user)) !== false;\n }", "public function owns(Model $model)\n {\n return $this->id == $model->user_id;\n }", "public function isUserProfile(Model $model): bool\n {\n return isset($model->{$this->user_id_field}) && !is_null($model->{$this->user_id_field});\n }", "public function ownsComment(Comment $comment)\n {\n return $this->id === $comment->user_id;\n }", "public function comment(User $user, Request $request)\n {\n return $user->isAdmin() || $user->id == $request->owner_id;\n }", "private static function canAccess($request, $address){\n $currentUser_Account = $request->user;\n $user = $address->get_user();\n return ($user != null && $currentUser_Account->getId() === $user->getId()) || User_Precondition::ownerRequired($request);\n }", "public function crud(User $user, Screen $screen)\n {\n return $user->id === $screen->user_id;\n }", "private function __isUserModel($model) {\n\t\tif ($model instanceof Model) {\n\t\t\t$model = $model->alias;\n\t\t}\n\t\treturn ($model === $this->settings[$model]['userModel']);\n\t}", "static function has_edit_screen(): bool { return true; }", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function hasScreen(){\n return $this->_has(12);\n }", "public function isTheCommentFromTheAuthor(): bool\n {\n if ($this->action->equals(Action::SYNCHRONIZE())) {\n return true;\n }\n\n if (null === $this->comment) {\n return false;\n }\n\n return $this->issueAuthor->id() === $this->comment->author()->id();\n }", "public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }", "public function owns(Model $model)\n {\n return $this->id === $model->{$this->getForeignKey()};\n }", "public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "protected function canReply(){\n return $this->canUserModify() &&\n $this->socialQuestion &&\n $this->isActive() &&\n $this->socialQuestion->SocialPermissions->canComment() &&\n !$this->connectObj->Parent->ID;\n }", "public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }", "public function isOwnedBy(UserInterface $user);", "protected function isCurrentPageEditableByUser() {\n\n\t\t$title = $this->getTitle();\n\t\t$user = $this->getUser();\n\t\treturn $title->quickUserCan( 'edit', $user )\n\t\t\t&& ( $title->exists() || $title->quickUserCan( 'create', $user ) );\n\t}", "function isCommentable(){\n\t\tglobal $gBitSystem;\n\t\treturn $gBitSystem->isFeatureActive( 'blog_posts_comments' );\n\t}", "function isSubmittedBy();", "protected function isAuthor() {\n return $this->getSocialUser() &&\n $this->getSocialUser()->ID === (int)$this->connectObj->CreatedBySocialUser->ID;\n }", "public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function hasuser()\n {\n return is_object($this->luser);\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function isMasterOwnedBy(Model $model) : bool {\n return (bool) $this->owners->contains('id', $model->getKey());\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "protected function canCreate(){\n return $this->canUserModify() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_CREATE, $this->getEmptyComment());\n }", "protected function is_current_screen_page() {\n\n\t\tif ( Settings::PAGE_ID !== Framework\\SV_WC_Helper::get_requested_value( 'page' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// assume we are on the Connection tab by default because the link under Marketing doesn't include the tab query arg\n\t\t$tab = Framework\\SV_WC_Helper::get_requested_value( 'tab', 'connection' );\n\n\t\treturn ! empty( $tab ) && $tab === $this->get_id();\n\t}", "public function is($model);", "protected function shouldProcess(Model $model)\n {\n return 'post-comment' === $model->getType() || 'post-review' === $model->getType();\n }", "function acf_is_screen($id = '')\n{\n}", "protected function _userCanViewWidget($widget) {\n $um = UserManager::instance();\n $user = $um->getCurrentUser();\n if ($user) {\n $service = AdminDelegation_Service::getServiceFromWidget($widget);\n if ($service) {\n $usm = new AdminDelegation_UserServiceManager();\n return $usm->isUserGrantedForService($user, $service);\n }\n }\n return false;\n }", "public function isHeadManager()\n {\n return UserHeadManager::find()->andWhere('id=' . $this->user_id)->exists();\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "function is_blog_user($blog_id = 0)\n {\n }", "static function isTrackable()\n {\n if(!Auth::check())\n return true;\n $user = Auth::User();\n if(stristr($user->type, 'Employee') || stristr($user->type, 'Demo'))\n return false;\n return true;\n }", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "public function view(User $user, User $model)\n {\n return $user->id == $model->id;\n }", "public function is_comments_popup()\n {\n }", "protected function owner_matches_current_user()\n {\n }", "private function is_install_screen() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! $screen ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 'update' === $screen->id;\n\t}", "public static function canCommentTicket($ticket)\n\t{\n\t\tif (!auth()->check()) return false;\n\n\t\tif (\\PanicHDMember::canManageTicket($ticket->id)\n or \\PanicHDMember::isTicketOwner($ticket->id)\n or $ticket->commentNotifications()->where('member_id', auth()->user()->id)->count() > 0){\n\n return true;\n\t\t}\n\n return false;\n\t}", "function CheckForEditableFields($ScreenName){\n $Screen = &$this->getScreen($ScreenName);\n //$Screen = &$this->Screens[$ScreenName];\n $nEditableFields = 0;\n foreach($Screen->Fields as $sf){\n if ($sf->isEditable()){\n $nEditableFields += 1;\n }\n }\n if ($nEditableFields > 0){\n return true;\n } else {\n return false;\n }\n }", "public function isOwnedBy($user)\n {\n if (($entry = $this->getEntry())) {\n return $entry->isOwnedBy($user);\n } else {\n return false;\n }\n }", "public function isPostOwner($id) {\n $post = Post::where('id','=',$id)->first();\n return ($this->id == $post->user->id);\n }", "function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1)\n {\n }", "public function check()\t{\n\t\treturn ! is_null($this->user());\n\t}", "public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function editComment(?User $user, $comment): bool\n {\n return $user->id === $comment->user_id;\n }", "function isViewer($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_VIEWER) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false; \n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public function view(User $user, Comment $comment)\n {\n return ($user->hasCapability('comments::show::secret') && $comment->is_secret)\n || (! $comment->is_secret && $user->hasCapability('comments::show'));\n }", "public function view($user, $model)\n {\n if( $user->hasPermissionTo('view ' . static::$key) ) {\n return true;\n }\n\n return $user->id == $model->user_id;\n }", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "public function check()\n\t{\n\t\treturn ! is_null($this->user());\n\t}", "function isCommentModerator($moderatorlist, $userid=0)\r\n\t{\r\n \t$my = JFactory::getUser();\r\n\r\n \t\t/* is $my moderator ? */\r\n \t$ismoderator = JOSC_utils::isModerator($moderatorlist);\r\n \tif ($ismoderator) return true;\r\n\r\n \tif (!$userid || !isset($my->id)) return false;\r\n \t/* is comment userid = to $my userid ? */\r\n \treturn ($my->id==$userid);\r\n\t}", "private function modelCheckHelper(User $user, $action,Model $model=null){\n //Check at the model level\n $source=Source::where('type','model')->where('name',UserGroup::class)->first();\n if($source){\n //$access_string=Source::getTypeKey().':'.$source->id;\n if(!$this->perm->can($user,Source::class,$source->id,$action,$model)){\n return false;\n }\n }\n\n return true;\n }", "public function check()\n {\n $user = $this->user();\n return !empty($user);\n }", "public function ownsSnippet(Snippet $snippet)\n {\n return $this->id == $snippet->user_id;\n }", "public function passes($attribute, $value)\n {\n //check if the comment exist\n $comment = Comment::find($value);\n if (!$comment) {\n return false;\n }\n //check if the comment is viewable\n if (!$comment->isViewable()) {\n return false;\n }\n //getting post owner id\n $postOwnerId = null;\n if ($comment->commentable_type == 'App\\\\Post') {\n $postOwnerId = $comment->commentable->user_id;\n }\n if ($comment->commentable_type == 'App\\\\Photo') {\n $postOwnerId = $comment->commentable->photoable->user_id;\n }\n //check if the post owner is the authenticated user\n if ($postOwnerId == Auth::id()) {\n return true;\n }\n //check if the post owner is friend\n if (!FriendRequest::isFriend($postOwnerId)) {\n return false;\n }\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function isOwner()\n\t{\n\t\treturn is_null($this->CreatedBy) || $this->CreatedBy === Yii::app()->user->GUID;\n\t}", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "public function check()\n {\n return null !== $this->user();\n }", "function is_user_member_of_blog($user_id = 0, $blog_id = 0)\n {\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "public function hasAccessToComment($commentID)\n {\n\n $this->isLoggedIn();\n\n $userid = $this->di->get(\"session\")->get(\"userid\");\n $comment = new Comment();\n $comment->setDb($this->di->get(\"db\"));\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n\n $user->find(\"id\", $userid);\n $comment->find(\"id\", $commentID);\n\n if (($comment->user_id == $userid) || $this->isAdmin()) {\n return true;\n }\n $this->di->get(\"response\")->redirect(\"user\");\n return false;\n }", "public function checkCurrentUser(UserProfile $profile) : bool\n {\n if($this->getProfile()->getId() == $profile->getId()) {\n return true;\n }\n\n return false;\n }", "public function isUserClub()\n\t{\n\t\t$q = new BN_query('rights');\n\t\t$q->addTable('assocs', 'rght_themeid = asso_id');\n\t\t$q->addField('count(*)');\n\t\t$q->addWhere('rght_theme = ' . THEME_ASSOS);\n\t\t$q->addWhere(\"rght_status ='\" . AUTH_MANAGER . \"'\");\n\t\t$q->addWhere('rght_userid =' . Bn::getValue('user_id', -1));\n\t\t$nb = $q->getFirst();\n\t\treturn (Bn::getValue('user_type') == AUTH_ASSO || $nb);\n\t}", "public function isUserManager()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'M');\n\t}", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public static function should_include_photo_column() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = Registrations::get_post_type();\n\n\t\t$pertinent_screen_ids = [\n\t\t\t$post_type,\n\t\t\t'edit-' . $post_type,\n\t\t\t'attachment'\n\t\t];\n\n\t\t$post_statuses = Photo::get_post_statuses_with_photo();\n\n\t\treturn (\n\t\t\t// Screen is known.\n\t\t\t! empty( $screen->id )\n\t\t&&\n\t\t\t// Screen is one that could show the photo column.\n\t\t\tin_array( $screen->id, $pertinent_screen_ids )\n\t\t&&\n\t\t\t// No post status is explicitly requested OR the post status is one that supports photos.\n\t\t\t( empty( $_GET['post_status'] ) || in_array( $_GET['post_status'], $post_statuses ) )\n\t\t);\n\t}", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "function isOwner($facebookID){\n\t\tif($facebookID == $this->fk_member_id){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function view(User $user, Bunch $bunch)\n {\n return $user->id == $bunch->created_by;\n }", "public function isCustomerUser() {\n\t\t\treturn $this->customerid != null && $this->customerid != 0;\n\t\t}", "private function isCurrentUserValidation($field) {\t\n\t \t\tif (isset($_SESSION[\"id\"])) {\n\t \t\t\tif ($this->integerValidation($field)) {\n\t\t\t \t\tif ($field->getMethod() == \"get\")\n\t\t\t \t\t\t$userId = $_GET[$field->getName()];\n\t\t\t \t\telse\n\t\t\t \t\t\t$userId = $_POST[$field->getName()];\n\t\t\t \t\t\n\t\t\t \t\tif ($_SESSION[\"id\"] == $userId)\n\t\t\t \t\t\treturn true;\n\t\t\t \t\telse\n\t\t\t \t\t\treturn false;\n\t\t \t\t}\n\t\t \t\telse\n\t\t \t\t\treturn false;\n\t \t\t}\n\t \t\telse\n\t \t\t\treturn false;\t\n\t \t}", "public function hasUser();", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "function _related_required($object, $model)\r\n\t{\r\n\t\treturn ($this->_count_related($model, $object) == 0) ? FALSE : TRUE;\r\n\t}", "public static function isSharedWithUser($a_usr_id,$a_calendar_id)\r\n\t{\r\n\t\tglobal $ilDB,$rbacreview;\r\n\t\t\r\n\t\t$query = 'SELECT * FROM cal_shared '.\r\n\t\t\t\"WHERE cal_id = \".$ilDB->quote($a_calendar_id ,'integer').\" \";\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$obj_ids[$row->obj_id] = $row->obj_type;\r\n\t\t}\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($a_usr_id);\r\n\t\tforeach($obj_ids as $id => $type)\r\n\t\t{\r\n\t\t\tswitch($type)\r\n\t\t\t{\r\n\t\t\t\tcase self::TYPE_USR:\r\n\t\t\t\t\tif($a_usr_id == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::TYPE_ROLE:\r\n\t\t\t\t\tif(in_array($id,$assigned_roles))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "public function checkCurrentUser()\n\t{\n\t\t$user = Zend_Auth::getInstance()->getIdentity();\n\n\t\tif ($this->getUserId() == $user->userId) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$row = $this->getTable()->checkUser($this->_actionId, $user->userId);\n\n\t\treturn $row !== false;\n\t}", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "function is_podlove_settings_screen()\n{\n $screen = get_current_screen();\n\n return stripos($screen->id, 'podlove') !== false && $screen->id != 'settings_page_podlove-web-player-settings';\n}", "function checkPermissions() {\n \t//If blog owner or super user\n \t$current_user = wp_get_current_user();\n\t\tif(is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function isUserOwner($user, $mmobj)\n {\n return $this->mmobjService->isUserOwner($user, $mmobj);\n }", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "public function authorize()\n {\n// $comment = Comment::find($this->route('comment')); // Get 'comment' route's params.\n// return $comment && $this->user()->can('update', $comment);\n\n return false;\n }", "private function checkEventNotBookedByCreator(){\n $event = Event::find($this->id);\n\n return($event->host != Auth::id());\n }" ]
[ "0.64010966", "0.63686544", "0.60119355", "0.5878308", "0.5874903", "0.56737393", "0.5670553", "0.5595417", "0.5576449", "0.55202824", "0.55171555", "0.5487937", "0.5476937", "0.54594934", "0.54541636", "0.54531336", "0.542957", "0.54160845", "0.5404946", "0.5401371", "0.5374976", "0.53749526", "0.5354289", "0.53471583", "0.5322691", "0.53161234", "0.5278102", "0.52701646", "0.5268955", "0.5261425", "0.52610755", "0.5260206", "0.52448696", "0.52390915", "0.5228559", "0.5227814", "0.52196926", "0.5217914", "0.5211102", "0.5208252", "0.5201466", "0.51894414", "0.51771426", "0.5176964", "0.51648337", "0.5161288", "0.5161143", "0.515663", "0.5154664", "0.5149025", "0.5145995", "0.5141854", "0.5127279", "0.5126048", "0.512598", "0.51259196", "0.5125453", "0.51168334", "0.51168334", "0.51168334", "0.5112382", "0.51107854", "0.5109697", "0.510578", "0.50994873", "0.50981534", "0.50967675", "0.5094677", "0.5092864", "0.50882846", "0.5083476", "0.5083103", "0.5082646", "0.50815386", "0.5076512", "0.5069346", "0.50678784", "0.5065898", "0.5064618", "0.5061822", "0.506146", "0.50510794", "0.5047343", "0.50441664", "0.5043412", "0.50368184", "0.5036487", "0.5027465", "0.5017558", "0.501153", "0.50063187", "0.50055873", "0.50050396", "0.50044835", "0.50005484", "0.4996953", "0.49917307", "0.49877554", "0.49877143", "0.49868447", "0.49845725" ]
0.0
-1
Persists model form and returns the created/updated `ScreenComment` model.
public function save(): ?ScreenComment { if ($this->validate()) { $user = $this->getUser(); $comment = $this->getScreenComment() ?: (new ScreenComment); $isNewRecord = $comment->isNewRecord; $comment->from = $isNewRecord ? $user->email : $comment->from; $comment->message = $this->message; if ( $this->replyTo && ($replyToComment = ScreenComment::findById($this->replyTo)) ) { $comment->screenId = $replyToComment->screenId; $comment->replyTo = $replyToComment->id; $comment->status = ScreenComment::STATUS['PENDING']; $comment->left = 0.0; $comment->top = 0.0; } else { $comment->screenId = $this->screenId; $comment->replyTo = null; $comment->status = $this->status; $comment->left = (float) $this->left; $comment->top = (float) $this->top; } if ($comment->save()) { if ($isNewRecord) { $comment->createNotifications(); } $comment->refresh(); return $comment; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save(): ?ScreenComment\n {\n if ($this->validate()) {\n $comment = new ScreenComment;\n $comment->from = $this->from;\n $comment->message = $this->message;\n $comment->status = ScreenComment::STATUS['PENDING'];\n\n if (\n $this->replyTo &&\n ($replyToComment = ScreenComment::findById($this->replyTo))\n ) {\n $comment->screenId = $replyToComment->screenId;\n $comment->replyTo = $replyToComment->id;\n $comment->left = 0.0;\n $comment->top = 0.0;\n } else {\n $comment->screenId = $this->screenId;\n $comment->replyTo = null;\n $comment->left = (float) $this->left;\n $comment->top = (float) $this->top;\n }\n\n if ($comment->save()) {\n $comment->createNotifications();\n\n $comment->refresh();\n\n return $comment;\n }\n }\n\n return null;\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $comment = Comments::findFirstByid($id);\n if (!$comment) {\n $this->flash->error(\"comment does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n\n if (!$comment->save()) {\n\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"edit\",\n \"params\" => array($comment->id)\n ));\n }\n\n $this->flash->success(\"comment was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n\n }", "public function save()\n\t{\n\t\t// Check for request forgeries.\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view \t= $this->getCurrentView();\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.add' ) )\n\t\t{\n\t\t\t$view->setMessage( 'ACL: Not allowed to add comments', SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$element\t= JRequest::getString( 'element', '' );\n\t\t$group\t\t= JRequest::getString( 'group', SOCIAL_APPS_GROUP_USER );\n\t\t$uid\t\t= JRequest::getInt( 'uid', 0 );\n\t\t$input\t\t= JRequest::getVar( 'input', '' , 'post' , 'none' , JREQUEST_ALLOWRAW );\n\t\t$data\t\t= JRequest::getVar( 'data', array() );\n\t\t$streamid\t= JRequest::getVar( 'streamid', '' );\n\t\t$parent\t\t= JRequest::getInt( 'parent', 0 );\n\n\t\t$compositeElement = $element . '.' . $group;\n\n\t\t$table\t\t= Foundry::table( 'comments' );\n\n\t\t$table->element = $compositeElement;\n\t\t$table->uid = $uid;\n\t\t$table->comment = $input;\n\t\t$table->created_by = Foundry::user()->id;\n\t\t$table->created = Foundry::date()->toSQL();\n\t\t$table->parent = $parent;\n\t\t$table->params = $data;\n\n\t\t$state\t\t= $table->store();\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\tif( $streamid )\n\t\t{\n\t\t\t$stream = Foundry::stream();\n\t\t\t$stream->updateModified( $streamid );\n\t\t}\n\n\t\t// Process mentions for this comment\n\t\tif( isset( $data['mentions']) && !empty( $data[ 'mentions' ] ) )\n\t\t{\n\t\t\tforeach( $data[ 'mentions' ] as $row )\n\t\t\t{\n\t\t\t\t$mention \t\t= (object) $row;\n\n\t\t\t\t$tag \t\t\t= Foundry::table( 'Tag' );\n\t\t\t\t$tag->offset\t= $mention->start;\n\t\t\t\t$tag->length\t= $mention->length;\n\t\t\t\t$tag->type \t\t= $mention->type;\n\n\t\t\t\tif( $tag->type == 'hashtag' )\n\t\t\t\t{\n\t\t\t\t\t$tag->title = $mention->value;\n\t\t\t\t}\n\n\t\t\t\tif( $tag->type == 'entity' )\n\t\t\t\t{\n\t\t\t\t\t$value \t\t\t\t= (object) $mention->value;\n\t\t\t\t\t$tag->item_id \t\t= $value->id;\n\t\t\t\t\t$tag->item_type \t= SOCIAL_TYPE_USER;\n\t\t\t\t}\n\n\t\t\t\t$tag->creator_id \t= Foundry::user()->id;\n\t\t\t\t$tag->creator_type \t= SOCIAL_TYPE_USER;\n\n\t\t\t\t$tag->target_id \t= $table->id;\n\t\t\t\t$tag->target_type \t= 'comments';\n\n\t\t\t\t$tag->store();\n\t\t\t}\n\t\t}\n\n\t\t$dispatcher = Foundry::dispatcher();\n\n\t\t$comments \t= array( &$table );\n\t\t$args \t\t= array( &$comments );\n\n\t\t// @trigger: onPrepareComments\n\t\t$dispatcher->trigger( $group , 'onPrepareComments' , $args );\n\n\t\treturn $view->call( __FUNCTION__, $table );\n\t}", "public function save() {\r\n if ($this->model->getId()) {\r\n return $this->model->update();\r\n }\r\n return $this->create();\r\n }", "public function store()\n {\n if (Validate::commentForm()) {\n $comment = $this->Model->store();\n\n if ($comment) {\n Session::set('comment_added', true);\n }else Session::set('db_error_comment', true);\n }else Session::set('validate_error', true);\n\n Session::set('posted_data', Input::getAll());\n Session::setMany(Validate::getErrors());\n Redirect::to('post/show/' . Input::get('post_id'));\n }", "public function store(StoreCommentRequest $request)\n {\n return auth()->user()->comments()->create($request->validated());\n }", "public function store(Requests\\StoreCommentFormRequest $request) {\n Comment::create($request->all());\n\n return back()->with('message', 'Commentaire en attente de validation');\n }", "public function store(CommentFormRequest $request){\n $input = $request->all();\n $this->comment->store($input, Auth::user());\n return redirect('home');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'required'\n ]);\n\n $request->merge([\n 'first_name' => Auth::user()->first_name,\n 'last_name' => Auth::user()->last_name\n ]);\n\n $comment = Comment::create($request->all());\n\n $room = Room::find($request->get('room_id'));\n $room->comments()->associate($comment);\n $room->save();\n\n Auth::user()->comments()->associate($comment);\n Auth::user()->save();\n\n $comment->user()->associate(Auth::user());\n $comment->room()->associate($room);\n $comment->save();\n\n return redirect()->route('room', ['id' => $room->_id]);\n }", "function saveComment(){\n\t\t$this->layout = 'ajax';\n\t\t$user_id = $_POST['user_id'];\n\t\t$feeds_id = $_POST['business_feeds_id'];\n\t\t$comment = $_POST['comment'];\n\t\t$membership_id = $_POST['membershipPlan'];\n\n\t\t$saveData['user_id'] = $user_id;\n\t\t$saveData['feed_id'] = $feeds_id;\n\t\t$saveData['comment'] = $comment;\n\t\tif($membership_id != 1){\n\t\t\t$saveData['status'] = 1;\n\t\t} else {\n\t\t\t$saveData['status'] = 2;\n\t\t}\n\n\t\t$this->Comment->save($saveData);\n\n\t\t$this->set('comment', $comment);\n\n\t\t$last_id = $this->Comment->id;\n\t\t$commentArr = $this->Comment->find('first', array('conditions'=>array('Comment.id'=>$last_id, 'Comment.status'=>'1')));\n\t\t$this->set('commentArr', $commentArr);\n\t\tif(!empty($commentArr)){\n\t\t$userr_id = $commentArr['Comment']['user_id'];\n\t\t$this->set('userr_id', $userr_id);\n\t\t}\t\n\t\t$this->set('last_id', $last_id);\n\t}", "public function storeAction()\n {\n $comment = new Comment();\n\n $comment->create($_POST);\n\n return redirect('');\n }", "public function save(Identifiable $model);", "public function store() {\r\n //\r\n if (!Sentry::check()) {\r\n $input = Input::except('slug', 'parent_id');\r\n $validation = Validator::make($input, Comment::$rules);\r\n if ($validation->fails()) {\r\n return Redirect::to('artikel/' . Input::get('slug'))->withInput($input)->withErrors($validation);\r\n }\r\n $telo = new Comment();\r\n $telo->fill($input);\r\n $post = Artikel::find(Input::get('post_id'));\r\n $telo->artikel()->associate($post);\r\n if ($telo->save()) {\r\n $root = Comment::find(Input::get('parent_id'));\r\n $telo->makeChildOf($root);\r\n return Redirect::to('artikel/' . Input::get('slug'));\r\n }\r\n } else {\r\n $user = Sentry::getUser();\r\n $input = array(\r\n 'nama' => ucfirst($user->first_name) . ' ' . ucfirst($user->last_name),\r\n 'url' => 'arnosa.net',\r\n 'email' => $user->email,\r\n 'komentar' => strip_tags(Input::get('komentar')),\r\n );\r\n }\r\n $com = new Comment();\r\n $com->fill($input);\r\n $post = Artikel::find(Input::get('post_id'));\r\n $com->artikel()->associate($post);\r\n if ($com->save()) {\r\n if (Input::get('parent_id')) {\r\n $root = Comment::find(Input::get('parent_id'));\r\n $com->makeChildOf($root);\r\n }\r\n return Redirect::route('admin.comments.index');\r\n }\r\n }", "protected function newComment($model)\n {\n $comment=new Comment;\n if(isset($_POST['Comment']))\n {\n $comment->attributes=$_POST['Comment'];\n if(!Yii::app()->user->isGuest)\n\t{\n\t\t$comment->authorName=Yii::app()->user->username;\n\t\t$comment->email=Yii::app()->user->email;\n\t\t$comment->authorId=Yii::app()->user->id;\n\t}\n\telse\n\t{\t //MFM\n\t\t$comment->authorName=$comment->attributes['authorName'];\n\t\t$comment->email=$comment->attributes['email'];\n\t}\n\t$comment->content=$comment->attributes['content'];\n\t$comment->url=$comment->attributes['url'];\n\n if(Yii::app()->user->isGuest && Yii::app()->params['commentNeedApproval'])\n $comment->status=Comment::STATUS_PENDING;\n else\n $comment->status=Comment::STATUS_APPROVED;\n\n $comment->postId=$model->id;\n\n if(isset($_POST['previewComment']))\n $comment->validate();\n else\n if(isset($_POST['submitComment']) && $comment->save())\n {\n if($comment->status==Comment::STATUS_PENDING)\n {\n Yii::app()->user->setFlash('commentSubmittedMessage',Yii::t('lan','Thank you for your comment. Your comment will be posted once it is approved.'));\n $this->refresh();\n }\n else\n $this->redirect(array('show','slug'=>$model->slug,'#'=>'c'.$comment->id));\n }\n }\n return $comment;\n }", "public function store()\n {\n $attrs = $this->validateComment();\n\n Comment::create($attrs);\n\n return redirect('/posts');\n }", "public function commentStore() {\n\t\t$post_id = $_POST['post_id'];\n\t\t$text = $_POST['text'];\n\t\t$comment = new Comment([$post_id, $text]);\n\t\t$comment->save();\n\t}", "public function save($model);", "public function save(Authenticatable $model);", "public function store(Comment $comment)\n {\n // validate incoming data with validation rules\n $this->validate(request(), [\n 'new_reply' => 'required|min:1|max:255'\n ]);\n\n /**\n store the new reply through relationship,\n through this way you don't have to\n provide `comment_id` field inside create() method\n */\n $comment->replies()->create([\n 'user_id' => auth()->id(),\n 'body' => request()->new_reply\n ]);\n\n // redirect to the previous URL\n return redirect()->back();\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$this->commentary->commentary = $input['commentary'];\n\t\t$this->commentary->mid = $input['mid'];\n\t\t$this->commentary->time = $input['time'];\n\t\tif($this->commentary->save()){\n\t\t\t\\Session::flash('notice','Successfully added');\n\t\t\treturn redirect()->back();\n\t\t}\n\t}", "public function store()\n {\n $this->validate([\n 'body' => 'required|min:5'\n ]);\n /* Almacenamos los campos en la DB */\n Comment::create([\n 'body' => $this->body,\n 'user_id' => Auth::user()->id,\n ]);\n $this->default();\n }", "public function save($model) {\n return parent::save($model);\n }", "public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }", "public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }", "public function save() {\n\n return isset($this->id) ? $this->update() : $this->create();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'comment' => ['required'],\n 'film_id' => ['required']\n ]);\n\n $comment = new Comment([\n 'comment' => $request->input('comment'),\n 'film_id' => $request->input('film_id'),\n 'user_id' => Auth::id()\n ]);\n $comment->save();\n\n return $comment;\n }", "public function store(Request $request)\n {\n // return $request->all();\n $comment = new DirectComment;\n $comment->comment = $request->comment;\n $comment->post_id = 1;\n $comment->user_id = Auth::id();\n $comment->save();\n return $comment;\n }", "public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }", "public function takeModel()\n {\n return Comment::class;\n }", "public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }", "public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}", "public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}", "public static function password_model_post_save($model) {\n\t\t$model->destination('edit', 'profile');\n\t\treturn $model;\n\t}", "public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "function plgAfterSave(&$model)\n {\n if(!$this->c->Access->isGuest() || $this->ranAfterSave) return;\n\n $this->ranAfterSave = true; // Run once per request\n\n $data = &$model->data;\n\n $name = $email = '';\n\n $username = Sanitize::getString($data,'username');\n\n $new_user = self::getUser();\n\n if($username == '') {\n\n $username = Sanitize::getString($new_user,'username');\n }\n\n // For guests, keep track of ids of newly submitted forms.\n // Used in media form to allow media submissions and assign them to the same user\n self::setGuestSubmissionsInSession($model);\n\n // Processing for disabled account creation or account creation enabled, but a username was not filled out\n if($username == '')\n {\n switch($model->name) {\n\n case 'Discussion':\n case 'Media':\n case 'Review':\n\n $name = Sanitize::getString($data[$model->name],'name');\n\n $email = Sanitize::getString($data[$model->name],'email');\n break;\n\n case 'Listing':\n\n $name = Sanitize::getString($data,'name');\n\n $email = Sanitize::getString($data,'email');\n break;\n }\n\n self::setUser(0, '', $name, $email);\n }\n else {\n\n $listing_id = $review_id = $discussion_id = $media_id = 0;\n\n $user_id = Sanitize::getInt($data,'user_id');\n\n if($user_id) {\n\n $name = Sanitize::getString($data,'name');\n\n $email = Sanitize::getString($data,'email');\n }\n else {\n\n $user_id = Sanitize::getString($new_user,'user_id');\n\n $name = Sanitize::getString($new_user,'name');\n\n $email = Sanitize::getString($new_user,'email');\n }\n\n switch($model->name)\n {\n case 'Discussion':\n $discussion_id = Sanitize::getInt($data['Discussion'],'discussion_id');\n break;\n\n case 'Listing':\n $listing_id = Sanitize::getInt($data['Listing'],'id');\n break;\n\n case 'Media':\n $media_id = Sanitize::getInt($data['Media'],'media_id');\n break;\n\n case 'Review':\n $review_id = Sanitize::getInt($data['Review'],'id');\n break;\n }\n\n S2App::import('Model','registration','jreviews');\n\n $Registration = ClassRegistry::getClass('RegistrationModel');\n\n $register_data = array(\n 'model'=>$model->name,\n 'Registration'=>array(\n 'session_id'=>session_id(),\n 'user_id'=>$user_id,\n 'name'=>$name,\n 'email'=>$email,\n 'listing_id'=>$listing_id,\n 'review_id'=>$review_id,\n 'discussion_id'=>$discussion_id,\n 'media_id'=>$media_id,\n 'session_time'=>time()\n ));\n\n $Registration->store($register_data);\n\n $user_id == 0 and self::setUser(0, '', $name, $email);\n }\n }", "public function store(StoreComment $request)\n {\n // The incoming request is valid...\n // Retrieve the validated input data...\n $validated = $request->validated();\n\n $this->repository->fillAndSave($validated);\n \n Toastr::success('Comment Successfully Saved :)', 'Success');\n \n return redirect()->back();\n }", "public function store()\n {\n Log::debug(\"STORE MODEL: $this->request\");\n return $this->saveModel();\n }", "public function newComment(CommentFormRequest $form) {\n\n $form->persist(); //Here we call method in what we define our logic in our CommentFormRequest class\n\n return redirect()->back()->with('status', 'Your comment has been created!');// Here we use global redirect() witch return redirect response object with previous location with global back() helper and flashing data to season with with() function\n }", "public function store(Request $request)\n {\n \n $comment = new Comment;\n $comment->comment = $request->comment_content;\n $comment->user()->associate($request->user());\n $commentPic = DB::table('comments')\n ->join('users','comments.user_id','=','users.id')\n ->join('profiles','users.id','=','profiles.user_id')\n ->select('comments.*','profiles.profilepic_path as pic')\n ->get();\n // dd($request);\n $forum = Forum::find($request->forum_id);\n $forum->comments()->save($comment);\n\n /* hualilidefengexian : Testing out the activity log*/\n \n $user = Auth::user()->id;\n\n activity()\n ->performedOn($comment)\n ->causedBy($user)\n ->withProperties(['commented' => $request->comment_content, 'forum_id'=>$forum ->id])\n ->log('Commented on forums');\n\n /* end of testing */\n\n return back();\n\n \n\n //dd(Forum::find($request->forum_id));\n // $comment = new Comment;\n\n // $comment->comment = $request->comment;\n\n // $comment->user()->associate($request->user());\n\n // $forum_post = Forum::find($request->forum_id);\n\n // $forum_post->comments()->save($comment);\n\n // return back();\n }", "public function save()\n {\n return $this->edit($this->id, $this->data);\n }", "public function store(Request $request){\n\n //check if comment has been written\n $this->validate($request, [\n 'user_comment'=>'required'\n ]);\n\n //store the comment\n $comment = new Comment;\n $comment->comment = $request->input('user_comment');\n $comment->user_id = auth()->user()->id;\n $comment->post_id = $request->input('post_id');\n $comment->save();\n return redirect()->back()->with('success', 'Comment added to the post');\n }", "public function actionCreate()\n {\n $model = new Thread();\n $model->user_id = Yii::$app->user->id;\n\n $newCommentModel = new Comment();\n $newCommentModel->user_id = Yii::$app->user->id;\n\n $postData = Yii::$app->request->post();\n if ($model->load($postData) && $res = $model->save()) {\n $newCommentModel->load(Yii::$app->request->post());\n $newCommentModel->thread_id = $model->id;\n $newCommentModel->user_id = Yii::$app->user->id;\n $newCommentModel->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'newCommentModel' => $newCommentModel,\n ]);\n }\n }", "public function saved($model)\n {\n }", "protected function form()\n {\n return Factory::create('comments');\n }", "public static function createComment($model, Request $request)\n {\n try {\n if ($user = auth('web')->user()) {\n if ($user->active) {\n $comment = $model->comments()->create([\n 'comment' => $request->comment,\n 'creatable_id' => auth('web')->user()->id,\n 'creatable_type' => get_class(auth('web')->user()),\n ]);\n } else {\n abort(403, 'You are not permitted to comment on this');\n }\n } else {\n $comment = $model->comments()->create([\n 'comment' => $request->comment,\n 'creatable_id' => auth()->user()->id,\n 'creatable_type' => get_class(auth()->user()),\n ]);\n }\n\n return response()->json([\n 'success' => true,\n 'message' => 'Comment posted',\n 'comment' => new CommentsResource($comment),\n ], 201);\n } catch (\\Exception $e) {\n abort(500, $e->getMessage());\n }\n }", "function save(iEntityComment $entity);", "public function actionCreate() {\n $model = new Comment;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Comment'])) {\n $model->attributes = $_POST['Comment'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function replyStore(CommentRequest $request)\n {\n $reply = new Comment();\n $reply->name = $request->name;\n $reply->email = $request->email;\n $reply->body = $request->body;\n\n $reply->user()->associate($request->user());\n $reply->parent_id = $request->get('comment_id');\n $post = Post::find($request->get('post_id'));\n\n $post->comments()->save($reply);\n return back();\n\n }", "public function store(StoreComment $request)\n {\n Comment::create([\n 'users_id' \t\t => Auth::id(),\n 'body' \t\t => $request['body'],\n 'commentable_id' \t\t=> $request['content_id'],\n 'commentable_type' \t\t=> 'App\\Content',\n ]);\n\n return Redirect::to(URL::previous() . \"#comments\");\n }", "public function store(Request $request)\n {\n $comment = new \\App\\Comment;\n $comment->user_id = \\Auth::user->$id;\n $comment->comment_id = $request->comment_id;\n $comment->content = $request->comment_content;\n \n \n $comment->save();\n return $comment;\n }", "public function saving($model)\n {\n }", "public function store(Request $request)\n\t{\n $data = new fc_comment;\n\t\t$data->id = $request->input(\"id\");\n\t\t$data->blog_id = $request->input(\"blog_id\");\n\t\t$data->user_id = $request->input(\"user_id\");\n $data->comments = $request->input(\"comments\");\n $data->save();\n\t\treturn redirect(\"admin/comments\");\t\n }", "public function saving($model)\n\t{\n\t}", "public function save()\n\t\t{\n\t\treturn isset($this->userguid) ? $this->update() : $this->create();\n\t\t}", "public function createAction()\n\t{\n\t\t$this->_helper->acl->authorizeUser(new Application_Model_Comment(), 'create', 'You are not allowed to create a new comment');\n\n\t\tif ($this->_request->isPost()) {\n\t\t\t$form = $this->getCreateForm();\n\n\t\t\tif (!$form->isValid($_POST)) {\n\t\t\t\t$this->sendJsonFormError($form);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data = new Application_Model_Comment();\n\t\t\t$data->id_user = $this->_user->getId();\n\t\t\t$data->comment = $_POST['comment'];\n\t\t\t$data->comment_type = $_POST['comment_type'];\n\n\t\t\t$r = $this->_commentMapper->save($data);\n\n\t\t\t$url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'comment', 'action' => 'index'));\n\t\t\t$this->_redirect($url);\n\t\t}\n\t}", "public function save($model, $redirect = false)\n\t{\n\t\t$dirty = $model->getDirty();\n\n\t\tif (count($dirty) > 0) {\n\t\t\t$model->save();\n\n\t\t\tif ($model == true && count($model->errors()->all()) > 0) {\n\n\t\t\t\t// Messages from aware are in a different format. Parse them into the error format.\n\t\t\t\tforeach ($model->errors()->all() as $key => $message) {\n\t\t\t\t\t$this->addError($key, $message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function store(CreateCommentRequest $request) {\n \n $comment = new comment;\n $comment->body = $request->body;\n $comment->post_id = $request->post_id;\n\n $request->user()->comments()->save($comment);\n\n session()->flash('flash_message', 'Comment Posted Successfully!');\n\n return redirect()->route('posts.show', Post::find($request->post_id));\n }", "public function store()\n {\n $comment=new commentes;\n $comment->body=request('body');\n $comment->post_id=request('post_id');\n$comment->user_id=request('user_id');\n $comment->save();\n return back();\n }", "public function saved($model)\n\t{\n\t}", "public function cloneAndPersist($model) : Model\n {\n return $this->persist($this->clone($model));\n }", "public function store()\n {\n return $this->form()->store();\n }", "public function store()\n {\n return $this->form()->store();\n }", "public function store()\n {\n return $this->form()->store();\n }", "public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }", "public function store(Request $request)\n {\n\n $comment = new Comment;\n $comment->body = $request->comment;\n $comment->users()->associate($request->user());\n $game = Game::find($request->gameid);\n $game->comments()->save($comment);\n\n return back()->with('status', 'Congratz! comment succesfully saved');\n\n }", "public static function saved($model)\n {\n return new static([\n 'success' => true,\n 'model' => $model->toArray(),\n 'redirect' => $model->editUrl(),\n 'messages' => [$model::singular(true).\" Saved.\"],\n 'errors' => []\n ]);\n }", "public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}", "public function Save() {\n $msg = null;\n if($this['id']) {\n $this->db->ExecuteQuery(self::SQL('update comment'), array($this['data'], $this['filter'], $this['id']));\n $msg = 'update';\n } else {\n $this->db->ExecuteQuery(self::SQL('insert comment'), array($this['data'], $this['filter'], $this->user['id'], $this['idContent']));\n $this['id'] = $this->db->LastInsertId();\n $msg = 'created';\n }\n $rowcount = $this->db->RowCount();\n if($rowcount) {\n $this->AddMessage('success', \"Successfully {$msg} comment\");\n } else {\n $this->AddMessage('error', \"Failed to {$msg} comment \");\n }\n return $rowcount === 1;\n }", "public function save()\n {\n $this->data = array(\n 'pb_name' => \\Input::get('pb_name'),\n 'title' => \\Input::get('title'),\n 'description' => \\Input::get('description'),\n 'template' => \\Input::get('template'),\n 'class_name' => \\Input::get('class_name'),\n 'published' => \\Input::get('published'),\n 'created_by' => \\Auth::user()->id,\n );\n\n return parent::save();\n }", "public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }", "public function store(StoreComment $request)\n {\n $validated = $request->validated();\n $comment = new Comment;\n\n $comment->fill($validated);\n $comment->user_id = Auth::id();\n $comment->vulnerability_id = $request->vulnerability_id;\n $comment->save();\n\n return back();\n }", "public function save() {\n if ($this->loaded) {\n return $this->update();\n }else{\n return $this->create();\n }\n }", "public function store()\n {\n $input = Input::all();\n $thread = Thread::create([\n 'subject' => $input['subject'],\n ]);\n\n // Message\n Message::create([\n 'thread_id' => $thread->id,\n 'user_id' => Auth::id(),\n 'body' => $input['message'],\n ]);\n\n // Sender\n Participant::create([\n 'thread_id' => $thread->id,\n 'user_id' => Auth::id(),\n 'last_read' => new Carbon,\n ]);\n\n // Recipients\n $thread->addParticipant($input['recipient']);\n\n return redirect()->route('messages.show', $thread->id);\n }", "public function save()\n {\n if ($this->_id === false) {\n return $this->create();\n }\n\n return $this->set();\n }", "public function saving(Media $model)\n {\n if (!$this->_request->has('status')) {\n $model->status = Media::STATUS_HIDDEN;\n }\n\n if (!$this->_request->has('target')) {\n $model->target = Media::TARGET_SELF;\n }\n }", "public function save()\n {\n\n // Doesn't exist yet -- Insert it\n if( $this->id == -1 )\n {\n $sql = 'INSERT INTO messages (recipient, sender, annotation)\n VALUES (?, ?, ?);';\n $params = array( $this->recipient, $this->sender, $this->annotation );\n $query = $this->db->query( $sql, $params );\n }\n\n // Already exists -- Update it\n else \n {\n $sql = 'UPDATE messages\n SET recipient = ?, sender = ?, annotation = ?\n WHERE id = ?';\n $params = array( $this->id, $this->recipient->id, $this->sender->id, $this->annotation->id );\n $query = $this->db->query( $sql, $params );\n }\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$data['user_id'] = \\Auth::user()->id;\n\t\t$comment_data = $this->commentService->createComment($data);\n\n\t\treturn Response::json($comment_data, 201);\n\t}", "public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }", "public function persist($model): Model\n {\n return $this->persistenceService->persist($model);\n }", "public function store(CreateCommentRequest $request)\n {\n $super_week = Week::findOrFail($request->week);\n $super_week->comment_by_supervisor = $request->comment_by_supervisor;\n $super_week->verify_by_supervisor = 1;\n $super_week->save();\n return redirect('/company');\n }", "public function saveComment(Request $request)\n {\n $commentDetail = $this->comment->saveComment($request, Auth::id());\n return $this->comment->getComment($commentDetail[\"id\"]);\n }", "public function store(Request $request)\n {\n // user_id , parent_id, comment, commentable_id, commentable_type\n $input['user_id'] = $request->user()->id;\n $input['parent_id'] = $request->input('parent_id');\n $input['comment'] = $request->input('comment');\n $input['comment'] = $request->comment()->id;\n $input['commentable_type'] = $request->input('slug');\n Comment::create($input);\n return redirect($slug)->with('message', 'comment published');\n }", "public function store(Request $request, $top_id) {\n $top = Top::find($top_id);\n if (Auth::check()) {\n $u_id = Auth::id();\n } else {\n return redirect()->back()->with('message', 'You need to login');\n }\n $comment = new Comment();\n $comment->replay_id = NULL;\n $comment->user_id = $u_id;\n $comment->body = $request->body;\n $comment->top()->associate($top);\n $comment->approuved = NULL; //1 - needs to be approuved by admin/moderator\n $user = User::find($comment->user_id);\n $comment->user()->associate($user);\n $comment->save();\n return redirect()->back()->with('message', 'Comment added');\n }", "public function store()\n {\n $post_data = Input::all();\n $CustomForm = new CustomForm();\n $CustomForm->fill( $post_data );\n $CustomForm->slug = str_replace('/ ', '_', strtolower($CustomForm->title));\n $CustomForm->site_id = Config::get('site')['_id'];\n $CustomForm->save();\n return $CustomForm;\n }", "public function store(Request $request)\n {\n try {\n $comment = new Comment;\n /* Required */\n $comment->user_id = $request->input('user_id');\n $comment->milestone_id = $request->input('milestone_id');\n $comment->comment_text = $request->input('comment_text');\n $comment->last_edited = Carbon::now()->setTimezone('UTC')->toDateTimeString();\n /* Optional */\n $comment->permissions = $request->input('permissions', json_encode([]));\n $comment->save();\n } catch (\\Exception $e) {\n return response()->json([\"status\" => \"EXCEPTION\", \"data\" => $e->getMessage()]);\n }\n return response()->json([\"status\" => \"SUCCESS\", \"data\" => $comment->toArrayRecursive()]);\n }", "public function save()\n\t{\n\t\t$args = [\n\t\t\t'post_title' => $this->title,\n\t\t\t'post_content' => $this->desc,\n\t\t\t'post_date' => $this->create_date,\n\t\t];\n\n\t\tif (empty($this->id)) {\n\t\t\t$args['post_type'] = Access::$MACHINE_NAME;\n\t\t\t$args['post_status'] = 'publish';\n\t\t} else {\n\t\t\t$args['ID'] = $this->id;\n\t\t}\n\n\t\tremove_action('save_post', array(get_class($this), 'access_save_meta_box'));\n\t\t$this->id = wp_update_post($args);\n\t\tadd_action('save_post', array(get_class($this), 'access_save_meta_box'));\n\n\t\tupdate_post_meta($this->id,'user',$this->user);\n\t\tupdate_post_meta($this->id,'key',$this->key);\n\t\tupdate_post_meta($this->id,'ips',$this->ips);\n\n\t\treturn $this;\n\t}", "public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }", "public function store(PostCommentRequest $request)\n {\n Comment::create($request->all());\n return back()->with('success', 'Comment was added successfully');\n }", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function store(AddTicketCommentRequest $request)\n {\n $input = $request->validated();\n\n $input['created_at'] = Carbon::now();\n $input['created_by'] = auth()->user()->id;\n\n try {\n $ticketComment = TicketComment::create($input);\n if($input['reply']) {\n $ticket = $ticketComment->ticket;\n $ticketConversation = new TicketConversation();\n $ticketConversation->ticket_id = $ticket->id;\n $ticketConversation->created_by = auth()->user()->id;\n $ticketConversation->conversation = '<div class=\"card card-primary card-outline\">\n <div class=\"card-body p-0\">\n <div class=\"mailbox-read-info\">\n <h5>' . $input['subject'] . '</h5>\n <h6>From: ' . $ticketComment->creator->email . '\n <span class=\"mailbox-read-time float-right\">' . Carbon::now()->isoFormat('LLLL') . '</span>\n </h6>\n </div>\n <div class=\"mailbox-read-message\">\n <p>'. $input['mail'].'</p>\n </div>\n </div>\n </div>';\n $ticketConversation->save();\n $ticket->reply = 1;\n } else if(auth()->user()->type == \"regular-user\") {\n return $this->sendResponse(new TicketCommentResource($ticketComment), 'ticketComment created successfully.');\n } else {\n $ticket = $ticketComment->ticket;\n $ticketConversation = new TicketConversation();\n $ticketConversation->ticket_id = $ticket->id;\n $ticketConversation->created_by = auth()->user->id;\n $ticketConversation->conversation = '<div class=\"card card-primary card-outline\">\n <div class=\"card-body p-0\">\n <div class=\"mailbox-read-info\">\n <h5>' . $input['subject'] . '</h5>\n <h6>From: ' . $ticketComment->creator->email . '\n <span class=\"mailbox-read-time float-right\">' . Carbon::now()->isoFormat('LLLL') . '</span>\n </h6>\n </div>\n <div class=\"mailbox-read-message\">\n <p>'. $input['mail'].'</p>\n </div>\n </div>\n </div>';\n $ticketConversation->save();\n $ticket->reply = 0;\n }\n $ticket->save();\n\n } catch (Exception $ex) {\n throw new ItemNotCreatedException('ticketComment');\n }\n\n return $this->sendResponse(new TicketCommentResource($ticketComment), 'ticketComment created successfully.');\n }", "public function store(Request $request)\n {\n $rules = [\n 'content' => 'required|min:1',\n 'date'=> 'required',\n 'post_id' => 'required',\n 'user_id'=> 'required',\n ];\n $this->validate($request, $rules);\n $comment = Comment::create($request->all());\n return $this->showOne($comment);\n }", "public function store(CreateCommentsRequest $request)\n {\n $input = $request->all();\n\n $comments = $this->commentsRepository->create($input);\n\n Flash::success('Comments saved successfully.');\n\n return redirect(route('comments.index'));\n }", "public function store(Request $request)\n {\n $request->validate([\n 'comment'=>'required',\n ]);\n\t\t\n\t\t$eventStarter = EventStarter::find($request->event_starter_id);\n \n //dd($request->user_id);\n $comment = new Comment([\n 'user_id' => $request->user_id,\n 'event_starter_id'=> $eventStarter->id,\n \t\t 'parent_id'=> $request->parent_id,\n 'comment'=> $request->comment,\n ]);\n\t\t \n $comment->save();\n\t\t \n\t\t if(Auth::guest()){\n return Redirect::guest(\"login\")->withSuccess('You have to login first');\n }\n \n return back();\n }", "public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }", "public function save( Application_Model_Interface $model );", "public function save(Model $model, array $joining = array(), $touch = true)\n {\n $model->save ( array (\n 'touch' => false\n ) );\n $this->attach ( $model->getKey (), $joining, $touch );\n return $model;\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Discussion::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\t\t$data['user_id'] = Auth::id();\n\t\tDiscussion::create($data);\n\t\treturn Redirect::route('discussions.index');\n\t}", "public function saving(ProgramLocation $model)\n {\n # Set Nulalble values to null if empty\n $this->setNullableFields($model);\n }", "protected function bindAndSave(&$model) {\n\t\t$model = $this->bind($model);\n\t\t$model->saveOrUpdate();\n\t\treturn $model;\n\t}" ]
[ "0.6792862", "0.5931886", "0.58542407", "0.56830025", "0.55532944", "0.5527788", "0.5524882", "0.53696376", "0.5351451", "0.53174573", "0.5296563", "0.52663326", "0.52244365", "0.5157345", "0.51543283", "0.5149078", "0.5124249", "0.51101196", "0.5106191", "0.5103197", "0.5100721", "0.5096333", "0.5092071", "0.5053963", "0.50491124", "0.50380296", "0.503391", "0.5021985", "0.4987899", "0.49852064", "0.4979358", "0.49662822", "0.49662822", "0.49628958", "0.49599713", "0.49528164", "0.49432564", "0.4934392", "0.49256805", "0.49079606", "0.4905763", "0.4903237", "0.48963043", "0.48930237", "0.48616323", "0.4850822", "0.48464867", "0.4834969", "0.48341674", "0.4818354", "0.48088247", "0.48086104", "0.48066688", "0.47965884", "0.47964388", "0.47945634", "0.47936732", "0.4792731", "0.47747183", "0.47715586", "0.4770736", "0.47676855", "0.47676855", "0.47676855", "0.4762302", "0.47611985", "0.4758971", "0.47553906", "0.47530833", "0.47504863", "0.47501007", "0.47465196", "0.47443712", "0.47427648", "0.47415435", "0.47382432", "0.4731319", "0.47262153", "0.47211868", "0.47178173", "0.470931", "0.47013986", "0.46977165", "0.46974507", "0.4689381", "0.4688461", "0.4680816", "0.46802706", "0.46799195", "0.46789712", "0.46789208", "0.46757364", "0.46730658", "0.46705282", "0.46683732", "0.46641946", "0.46604073", "0.46558836", "0.46555027", "0.46542367" ]
0.6901158
0
Display a listing of the resource.
public function index() { return response()->json(Event::all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1